[
  {
    "path": ".buildkite/jobs/pipeline.android_demo_app_rn_82.yml",
    "content": "  - label: \":android::react: RN .83 + Android: Demo app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/demo-projects.android.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.android_demo_app_rn_83.yml",
    "content": "  - label: \":android::react: RN .83 + Android: Demo app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/demo-projects.android.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.android_rn_77.yml",
    "content": "  - label: \":android::detox: RN .77 + Android: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.android.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.77.2\n      RCT_NEW_ARCH_ENABLED: 1\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.android_rn_82.yml",
    "content": "  - label: \":android::detox: RN .83 + Android: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.android.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      TEST_GENYCLOUD_SANITY: true\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.android_rn_83.yml",
    "content": "  - label: \":android::detox: RN .83 + Android: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.android.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.ios_demo_app_rn_82.yml",
    "content": "  - label: \":ios::react: RN .83 + iOS: Demo app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/demo-projects.ios.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.ios_demo_app_rn_83.yml",
    "content": "  - label: \":ios::react: RN .83 + iOS: Demo app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/demo-projects.ios.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n      REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.ios_rn_77.yml",
    "content": "  - label: \":ios::detox: RN .77 + iOS: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.ios.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.77.2\n      RCT_NEW_ARCH_ENABLED: 1\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.ios_rn_82.yml",
    "content": "  - label: \":ios::detox: RN .83 + iOS: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.ios.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/jobs/pipeline.ios_rn_83.yml",
    "content": "  - label: \":ios::detox: RN .83 + iOS: Tests app\"\n    command:\n      - \"nvm install\"\n      - \"./scripts/ci.ios.sh\"\n    env:\n      REACT_NATIVE_VERSION: 0.83.0\n      RCT_NEW_ARCH_ENABLED: 1\n    artifact_paths:\n      - \"/Users/builder/uibuilder/work/coverage/**/*.lcov\"\n      - \"/Users/builder/uibuilder/work/**/allure-report-*.html\"\n      - \"/Users/builder/uibuilder/work/artifacts*.tar.gz\"\n\n"
  },
  {
    "path": ".buildkite/pipeline.debug.yml",
    "content": "steps:\n  - block: \":partyparrot: Enter the Debug Mode!\"\n    prompt: \"Detox your mind\"\n    if: 'build.message =~ /^debug\\$/i'\n    fields:\n      - select: \"Ingridients\"\n        key: \"debug-builds\"\n        multiple: true\n        hint: \"hey Chef, what are we cooking today?\"\n        options:\n          - label: \"iOS RN 71\"\n            value: \"ios_rn_71\"\n          - label: \"iOS RN 73\"\n            value: \"ios_rn_73\"\n          - label: \"iOS Demo App RN 71\"\n            value: \"ios_demo_app_rn_71\"\n          - label: \"iOS Demo App RN 73\"\n            value: \"ios_demo_app_rn_73\"\n          - label: \"Android RN 71\"\n            value: \"android_rn_71\"\n          - label: \"Android RN 73\"\n            value: \"android_rn_73\"\n          - label: \"Android Demo App RN 73\"\n            value: \"android_demo_app_rn_73\"\n\n  - label: \"Get Release Pipeline\"\n    command: '.buildkite/pipeline.sh debug | buildkite-agent pipeline upload'\n"
  },
  {
    "path": ".buildkite/pipeline.post_processing.yml",
    "content": "  - wait: ~\n    continue_on_failure: true\n  - label: \"Post-processing: Test coverage\"\n    command:\n      - \"nvm install\"\n      - \"mkdir -p aggregated-coverage\"\n      - \"buildkite-agent artifact download '**/*.lcov' aggregated-coverage\"\n      - \"bash scripts/aggregate_coverage.sh\"\n"
  },
  {
    "path": ".buildkite/pipeline.release.fast.yml",
    "content": "  - wait\n  - label: \":ios: Package iOS\"\n    key: 'ios_package'\n    command:\n      - \"nvm install\"\n      - \"npm run package:ios\"\n    artifact_paths: \"/Users/builder/uibuilder/work/detox/*.tbz\"\n\n  - label: \":android: Package android\"\n    key: 'android_package'\n    command:\n      - \"nvm install\"\n      - \"./scripts/install.sh\"\n      - \"npm run package:android\"\n    env:\n      DETOX_DISABLE_POSTINSTALL: true\n      DETOX_DISABLE_POD_INSTALL: true\n      JAVA_HOME: /opt/openjdk/openlogic-openjdk-17.0.9+9-mac-x64/jdk-17.0.9.jdk/Contents/Home\n    artifact_paths: \"/Users/builder/uibuilder/work/detox/Detox-android/**/*\"\n\n  - label: \":shipit: Publish\"\n    depends_on:\n      - 'android_package'\n      - 'ios_package'\n    command:\n      - \"nvm install 20\"\n      - \"./scripts/install.sh\"\n      - \"npm run release\"\n    env:\n      DETOX_DISABLE_POD_INSTALL: true\n      DETOX_DISABLE_POSTINSTALL: true\n"
  },
  {
    "path": ".buildkite/pipeline.release.yml",
    "content": "steps:\n  - block: \":rocket: Release!\"\n    prompt: \"Fill out the details for release\"\n    if: 'build.message =~ /^release\\$/i'\n    fields:\n      - select: \"IS PRE-RELEASE?\"\n        key: \"pre-release\"\n        default: \"true\"\n        hint: \"A corresponding pre-release prefix will be added to published version name, with the npm tag of this version (for instance, `19.5.0-preminor.0`).\"\n        options:\n          - label: \"Yes, this is a PRE-release version.\"\n            value: \"true\"\n          - label: \"No, this is a REAL release version.\"\n            value: \"false\"\n\n      - select: \"VERSION TYPE\"\n        key: \"release-version-type\"\n        hint: \"A successful build will be released with a version update according to the selected type. `Bump pre-release version` will bump the pre-release version number (for instance, `19.5.0-preminor.1`).\"\n        options:\n          - label: \"Patch\"\n            value: \"patch\"\n          - label: \"Minor\"\n            value: \"minor\"\n          - label: \"Major\"\n            value: \"major\"\n          - label: \"Bump pre-release version\"\n            value: \"release\"\n\n      - select: \"IS DRY RUN?\"\n        key: \"release-dry-run\"\n        hint: \"When set to `Yes`, don't actually release anything, just run the scripts.\"\n        default: \"false\"\n        options:\n          - label: \"Yes\"\n            value: \"true\"\n          - label: \"No\"\n            value: \"false\"\n\n      - select: \"SKIP NPM-PUBLISH?\"\n        key: \"release-skip-npm\"\n        hint: \"This is a hack to fix previously broken release jobs. You need to really know what you're doing.\"\n        default: \"false\"\n        options:\n          - label: \"Yes\"\n            value: \"true\"\n          - label: \"No\"\n            value: \"false\"\n\n      - select: \"DO FAST-RELEASE?\"\n        key: \"fast-release\"\n        hint: \"When set to `Yes`, skip building and testing. USE ONLY IF YOU REALLY REALLY HAVE TO!\"\n        default: \"false\"\n        options:\n          - label: \"Yes\"\n            value: \"true\"\n          - label: \"No\"\n            value: \"false\"\n\n      - text: \"NPM TAG\"\n        key: \"release-npm-tag\"\n        hint: \"Leave `null` for default. For releases from master, the default is `latest`, unless this is a pre-release version, then uses `prerelease` as tag. For releases from other branches, uses `next` if from the `next` branch and `smoke` otherwise.\"\n        default: 'null'\n\n  - label: \"Get Release Pipeline\"\n    command: '.buildkite/pipeline.sh release | buildkite-agent pipeline upload'\n"
  },
  {
    "path": ".buildkite/pipeline.sh",
    "content": "#!/bin/bash -e\n\nif [[ \"$1\" == 'start' ]];then\n  if [[ $(echo $BUILDKITE_MESSAGE | tr '[:upper:]' '[:lower:]') =~ ^release$ ]];then\n    cat .buildkite/pipeline.release.yml\n  elif [[ $(echo $BUILDKITE_MESSAGE | tr '[:upper:]' '[:lower:]') =~ ^debug$ ]];then\n    cat .buildkite/pipeline.debug.yml\n  else\n    .buildkite/pipeline_common.sh\n  fi\n\nelif [[ \"$1\" == 'release' ]];then\n  FAST_RELEASE=$(buildkite-agent meta-data get fast-release)\n  if [[ \"$FAST_RELEASE\" == 'true' ]];then\n    cat .buildkite/pipeline.release.fast.yml\n  else\n    .buildkite/pipeline_common.sh\n    cat .buildkite/pipeline.release.fast.yml\n  fi\n\nelif [[ \"$1\" == 'debug' ]];then\n  stepsList=$(buildkite-agent meta-data get debug-builds)\n  steps=($(echo $stepsList| tr \";\" \"\\n\"))\n  echo \"steps:\"\n  for step in \"${steps[@]}\"\n  do\n      cat .buildkite/jobs/pipeline.$step.yml\n  done\nfi\n"
  },
  {
    "path": ".buildkite/pipeline_common.sh",
    "content": "#!/bin/bash -e\n\necho \"steps:\"\n\ncat .buildkite/jobs/pipeline.android_demo_app_rn_83.yml\ncat .buildkite/jobs/pipeline.android_rn_77.yml\ncat .buildkite/jobs/pipeline.android_rn_83.yml\ncat .buildkite/jobs/pipeline.ios_demo_app_rn_83.yml\ncat .buildkite/jobs/pipeline.ios_rn_77.yml\ncat .buildkite/jobs/pipeline.ios_rn_83.yml\ncat .buildkite/pipeline.post_processing.yml\n"
  },
  {
    "path": ".cursor/rules/detox-idomatic.mdc",
    "content": "---\ndescription: Rules to help Cursor write code that is more Detox idomatic\nglobs: *.js\nalwaysApply: false\n---\n- Whenever an Error needs to be thrown, prefer throwing a DetoxRuntimeError with a proper message and hint.\n\n- Minimize comments usage, especially in-line ones. Leave comments where things are exceptionally unclear for some reason.\n"
  },
  {
    "path": ".cursor/rules/detox-unittests.mdc",
    "content": "---\nDescription: Rules to help Cursor write unit tests code that aligns with the project's standards\nglobs: *.test.js,*.test.ts\nalwaysApply: false\n---\n# Project Rules\n\n## Jest Unit Testing\n\nIn Jest unit test files, **never perform mocking globally**. Instead, perform all mocks inside the `beforeEach()` section.\n\n### Rationale\n- Keeps test setup centralized and visible\n- Ensures mocks are reset between tests\n- Makes test dependencies explicit\n- Prevents test pollution from global mocks\n\n### Example\n\n❌ **Don't do this:**\n```javascript\nconst mockSleep = jest.fn().mockResolvedValue(undefined);\njest.mock('../../../../utils/sleep', () => mockSleep);\n\ndescribe('MyClass', () => {\n  // ...\n});\n```\n\n✅ **Do this instead:**\n```javascript\ndescribe('MyClass', () => {\n  let mockSleep;\n\n  beforeEach(() => {\n    jest.mock('../../../../utils/sleep');\n    mockSleep = require('../../../../utils/sleep');\n    mockSleep.mockResolvedValue(undefined);\n\n// ... other setup\n  });\n});\n```\n\nAlternatively, in cases where jest.mock() doesn't work well out of the box, this can be performed too:\n\n```javascript\n  beforeEach(() => {\n    jest.mock('../../../../utils/sleep', () => jest.fn().mockResolvedValue(undefined));\n    mockSleep = require('../../../../utils/sleep');\n  });\n\n  // Or if the sleep js module actually exports an object:\n  beforeEach(() => {\n    jest.mock('../../../../utils/sleep', () => ({\n      sleep: jest.fn().mockResolvedValue(undefined),\n    }));\n    mockSleep = require('../../../../utils/sleep');\n  });\n```\n\nNote: `jest.mock()` must still be called at the module level (for hoisting), but all mock configuration should happen in `beforeEach()`.\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 4\nindent_style = space\ninsert_final_newline = true\nmax_line_length = 120\ntab_width = 4\ntrim_trailing_whitespace = true\n\n[{*.ats,*.cts,*.mts,*.ts}]\nindent_size = 2\ntab_width = 2\n\n[detox/index.d.ts]\nindent_size = 4\ntab_width = 4\n\n[{*.cjs,*.js,*.mjs}]\nindent_size = 2\ntab_width = 2\n\n[{*.md,*.mdx}]\nindent_size = 2\ntab_width = 2\n\n[{*.yaml,*.yml}]\nindent_size = 2\ntab_width = 2\n\n[{*.css,*.scss,*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}]\nindent_size = 2\ntab_width = 2\n"
  },
  {
    "path": ".ghp/wix.json",
    "content": "{   \n    \"name\": \"detox\",\n    \"title\": \"Detox\",\n    \"description\": \"Graybox E2E tests and automation library for mobile\",\n    \"github\": \"https://github.com/wix/detox\",\n    \"AndroidVideoUrl\": \"\",\n    \"IOSVideoUrl\": \"\",\n    \"IOSDemoAppLink\": \"\",\n    \"MacVideoUrl\": \"https://github.com/wix/react-native/blob/master/src/videos/detox.mp4?raw=true\",\n    \"image\": \"\",\n    \"size\" : \"big\",\n    \"AndroidDemoAppLink\": \"\"\n}\n"
  },
  {
    "path": ".gitattributes",
    "content": "*.sh text eol=lf\n/detox-cli/cli.js text eol=lf\n/detox/local-cli/cli.js text eol=lf\n/generation/index.js text eol=lf\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @d4vidi\n\n# Scripts\n\n*.js @d4vidi @noomorph\n*.ts @d4vidi @noomorph\n*.sh @d4vidi @noomorph\n\n# Android\n\ndetox/android/* @d4vidi @jonathanmos\ndetox/test/android/* @d4vidi @jonathanmos\n*.java @d4vidi @jonathanmos\n*.kt @d4vidi @jonathanmos\n*.gradle @d4vidi @jonathanmos\n\n# iOS\n\ndetox/ios/* @asafkorem\ndetox/test/ios/* @asafkorem\n*.h @asafkorem\n*.m @asafkorem\n*.mm @asafkorem\n*.cpp @asafkorem\n*.swift @asafkorem\n*.pch @asafkorem\n*.plist @asafkorem\n*.xcodeproj @asafkorem\n*.xcworkspace @asafkorem\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/BUG_REPORT_ANDROID.yml",
    "content": "name: \"🐞 Bug Report - Android\"\ndescription: Report an Android-specific bug to help us improve Detox\nlabels: [\"type: bug 🐞\", \"platform: android\", \"status: triage\"]\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to fill out this bug report!\n  - type: checkboxes\n    id: tested-last-detox\n    attributes:\n      label: Did you test using the latest Detox?\n      description: Before reporting this issue, please make sure it can be reproduced on the latest released version of Detox. Check our [release log](https://github.com/wix/Detox/releases).\n      options:\n        - label: I have tested this issue on the latest Detox release and it still reproduces.\n          required: true\n  - type: checkboxes\n    id: troubleshooting-guide\n    attributes:\n      label: Did your test fail and you're not sure why?\n      description: Please read our [troubleshooting guide](https://wix.github.io/Detox/docs/troubleshooting/running-tests) in order to try to solve the issue yourself.\n      options:\n        - label: I have read the troubleshooting guide and it didn't help me.\n          required: true\n  - type: textarea\n    id: description\n    attributes:\n      label: What happened?\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    id: expected-behaviour\n    attributes:\n      label: What was the expected behaviour?\n      description: A clear and concise description of what was expected to happen.\n  - type: textarea\n    id: reproduction\n    attributes:\n      label: Help us reproduce this issue!\n      description: \"Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.\\n\\n\n      If possible, provide an example project that reproduces the issue. You can fork the Detox repo and make the necessary changes to our own [example project](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\"\n  - type: textarea\n    id: environment\n    attributes:\n      label: In what environment did this happen?\n      description: \"Note: the test runner is Jest by default, unless overridden via testRunner property in your detox configuration file (e.g. package.json, detox.config).\"\n      value: \"Detox version:\n      \\nReact Native version:\n      \\nHas Fabric (React Native's new rendering system) enabled: (yes/no)\n      \\nNode version:\n      \\nDevice model:\n      \\nAndroid version:\n      \\nTest-runner (select one): jest / other\"\n  - type: textarea\n    id: detox-logs\n    attributes:\n      label: Detox logs\n      description: Please run your tests using the `--loglevel trace` argument. See [artifacts documentation](https://wix.github.io/Detox/docs/config/artifacts).\n      value: \"<details><summary>Detox logs</summary>\\n\\n```\\npaste logs here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: device-logs\n    attributes:\n      label: Device logs\n      description: Please run your tests using the `--record-logs all` argument and paste the `device.log` file. See [artifacts documentation](https://wix.github.io/Detox/docs/config/artifacts#launch-arguments).\n      value: \"<details><summary>Device logs</summary>\\n\\n```\\npaste your device.log here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: test-artifacts\n    attributes:\n      label: More data, please!\n      description: Please provide any other relevant test artifacts (Screenshots, Videos..). See [artifacts documentation](https://wix.github.io/Detox/docs/api/artifacts).\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/BUG_REPORT_IOS.yml",
    "content": "name: \"🐞 Bug Report - iOS\"\ndescription: Report an iOS-specific bug to help us improve Detox\nlabels: [\"type: bug 🐞\", \"platform: ios\", \"status: triage\"]\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to fill out this bug report!\n  - type: checkboxes\n    id: tested-last-detox\n    attributes:\n      label: Did you test using the latest Detox?\n      description: Before reporting this issue, please make sure it can be reproduced on the latest released version of Detox. Check our [release log](https://github.com/wix/Detox/releases).\n      options:\n        - label: I have tested this issue on the latest Detox release and it still reproduces.\n          required: true\n  - type: checkboxes\n    id: troubleshooting-guide\n    attributes:\n      label: Did your test fail and you're not sure why?\n      description: Please read our [troubleshooting guide](https://wix.github.io/Detox/docs/troubleshooting/running-tests) in order to try to solve the issue yourself.\n      options:\n        - label: I have read the troubleshooting guide and it didn't help me.\n          required: true\n  - type: textarea\n    id: description\n    attributes:\n      label: What happened?\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    id: expected-behaviour\n    attributes:\n      label: What was the expected behaviour?\n      description: A clear and concise description of what was expected to happen.\n  - type: textarea\n    id: reproduction\n    attributes:\n      label: Help us reproduce this issue!\n      description: \"Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.\\n\\n\n      If possible, provide an example project that reproduces the issue. You can fork the Detox repo and make the necessary changes to our own [example project](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\"\n  - type: textarea\n    id: environment\n    attributes:\n      label: In what environment did this happen?\n      description: \"Note: the test runner is Jest by default, unless overridden via testRunner property in your detox configuration file (e.g. package.json, detox.config).\"\n      value: \"Detox version:\n      \\nReact Native version:\n      \\nHas Fabric (React Native's new rendering system) enabled: (yes/no)\n      \\nNode version:\n      \\nDevice model:\n      \\niOS version:\n      \\nmacOS version:\n      \\nXcode version:\n      \\nTest-runner (select one): jest / other\"\n  - type: textarea\n    id: detox-logs\n    attributes:\n      label: Detox logs\n      description: Please run your tests using the `--loglevel trace` argument. See [artifacts documentation](https://wix.github.io/Detox/docs/api/artifacts).\n      value: \"<details><summary>Detox logs</summary>\\n\\n```\\npaste logs here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: device-logs\n    attributes:\n      label: Device logs\n      description: Please run your tests using the `--record-logs all` argument and paste the `device.log` file. See [artifacts documentation](https://wix.github.io/Detox/docs/config/artifacts#launch-arguments).\n      value: \"<details><summary>Device logs</summary>\\n\\n```\\npaste your device.log here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: test-artifacts\n    attributes:\n      label: More data, please!\n      description: Please provide any other relevant test artifacts (Screenshots, Videos..). See [artifacts documentation](https://wix.github.io/Detox/docs/api/artifacts).\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/BUG_REPORT_OTHER.yml",
    "content": "name: \"🐞 Bug Report - Other\"\ndescription: Report a bug to help us improve Detox\nlabels: [\"type: bug 🐞\", \"status: triage\"]\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to fill out this bug report!\n  - type: checkboxes\n    id: tested-last-detox\n    attributes:\n      label: Did you test using the latest Detox?\n      description: Before reporting this issue, please make sure it can be reproduced on the latest released version of Detox. Check our [release log](https://github.com/wix/Detox/releases).\n      options:\n        - label: I have tested this issue on the latest Detox release and it still reproduces.\n          required: true\n  - type: checkboxes\n    id: troubleshooting-guide\n    attributes:\n      label: Did your test fail and you're not sure why?\n      description: Please read our [troubleshooting guide](https://wix.github.io/Detox/docs/troubleshooting/running-tests) in order to try to solve the issue yourself.\n      options:\n        - label: I have read the troubleshooting guide and it didn't help me.\n          required: true\n  - type: textarea\n    id: description\n    attributes:\n      label: What happened?\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    id: expected-behaviour\n    attributes:\n      label: What was the expected behaviour?\n      description: A clear and concise description of what was expected to happen.\n  - type: markdown\n    attributes:\n      value: \"***If the bug occurred while running tests, please re-consider opening a platform-specific bug (iOS or Android), [here](https://github.com/wix/Detox/issues/new/choose). If this is not relevant for a specific platform, please fill in the following fields.***\"\n  - type: textarea\n    id: reproduction\n    attributes:\n      label: Help us reproduce this issue!\n      description: \"Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.\\n\\n\n      If possible, provide an example project that reproduces the issue. You can fork the Detox repo and make the necessary changes to our own [example project](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\"\n  - type: textarea\n    id: environment\n    attributes:\n      label: In what environment did this happen?\n      description: \"Note: the test runner is Jest by default, unless overridden via testRunner property in your detox configuration file (e.g. package.json, detox.config).\"\n      value: \"Detox version:\n      \\nReact Native version:\n      \\nHas Fabric (React Native's new rendering system) enabled: (yes/no)\n      \\nNode version:\n      \\nTest-runner (select one): jest / other\"\n  - type: textarea\n    id: detox-logs\n    attributes:\n      label: Detox logs\n      description: Please run your tests using the `--loglevel trace` argument. See [artifacts documentation](https://wix.github.io/Detox/docs/api/artifacts).\n      value: \"<details><summary>Detox logs</summary>\\n\\n```\\npaste logs here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: device-logs\n    attributes:\n      label: Device logs\n      description: Please run your tests using the `--record-logs all` argument and paste the `device.log` file. See [artifacts documentation](https://wix.github.io/Detox/docs/config/artifacts#launch-arguments).\n      value: \"<details><summary>Device logs</summary>\\n\\n```\\npaste your device.log here!\\n```\\n\\n</details>\"\n  - type: textarea\n    id: test-artifacts\n    attributes:\n      label: More data, please!\n      description: Please provide any other relevant test artifacts (Screenshots, Videos..). See [artifacts documentation](https://wix.github.io/Detox/docs/api/artifacts).\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/ENHANCEMENT.yml",
    "content": "name: \"⚡️ Enhancement\"\ndescription: Suggest an idea for this project\nlabels: [\"type: enhancement ⚡️\", \"status: triage\"]\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to fill out this enhancement suggestion!\n  - type: textarea\n    id: idea-description\n    attributes:\n      label: Describe your idea\n      description: \"A clear and concise description of what you want to happen.\\n\n      If your feature request is related to a problem, please describe any other alternative solutions or features you’ve considered.\"\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/HELP_WITH_USING_DETOX.yml",
    "content": "name: \"🛟 I Need Help - Approach the Maintainers\"\ndescription: Ask a general how-to question. We recommend asking for help on Discord / Stack-Overflow, first!\nlabels: [\"user: need help\"]\nbody:\n  - type: markdown\n    attributes:\n      value: If you have issues running Detox or setting it up, please use one of the [bug templates](https://github.com/wix/Detox/issues/new/choose) instead.\n  - type: textarea\n    id: description\n    attributes:\n      label: Description\n      description: A clear and concise description of what you need help with.\n    validations:\n      required: true\n  - type: textarea\n    id: environment\n    attributes:\n      label: Your environment\n      description: \"Note: the test runner is set in your detox configuration file (e.g. package.json, detox.config).\"\n      value: \"Detox version:\n      \\nReact Native version:\n      \\nNode version:\n      \\nDevice model:\n      \\nOS:\n      \\nTest-runner (select one): jest / other\"\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: \"🛟 I Need Help - Join Our Discord Community\"\n    url: https://discord.gg/CkD5QKheF5\n    about: Get answers from the Detox community on Discord.\n  - name: \"🛟 I Need Help - Post on Stack-Overflow\"\n    url: https://stackoverflow.com/questions/tagged/detox\n    about: Look up or post your problem on Stack-Overflow (we have a dedicated tag!)."
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "### IMPORTANT: DO NOT USE THIS FORM FOR SUBMITTING ISSUES. USE THE DESIGNATED ISSUE TEMPLATES ON GITHUB AND POPULATE ALL THE REQUIRED INFORMATION.\n"
  },
  {
    "path": ".github/lock.yml",
    "content": "# Number of days of inactivity before a closed issue or pull request is locked\ndaysUntilLock: 3\n\n# Issues and pull requests with these labels will not be locked. Set to `[]` to disable\nexemptLabels: [\"🔓 unlocked\"]\n\n# Label to add before locking, such as `outdated`. Set to `false` to disable\nlockLabel: false\n\n# Comment to post before locking. Set to `false` to disable\nlockComment: false\n"
  },
  {
    "path": ".github/no-response.yml",
    "content": "# Configuration for probot-no-response - https://github.com/probot/no-response\n\n# Number of days of inactivity before an Issue is closed for lack of response\ndaysUntilClose: 7\n# Label requiring a response\nresponseRequiredLabel: \"user: more info needed\"\n# Comment to post when closing an Issue for lack of response. Set to `false` to disable\ncloseComment: >\n  This issue has been automatically closed because there has been no response\n  to our request for more information from the original author.\n  \n  \n  \n  For more information on bots in this reporsitory, read [this discussion](https://github.com/wix/Detox/issues/1305).\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "## Description\n\n<!--\nThank you for contributing!\n\nStep 1: Before submitting a pull request that introduces a new functionality or fixes a bug,\nplease open an issue where we could discuss the suggestion, problem - and potential ways to fix.\n-->\n\n- This pull request addresses the issue described here: #<?>\n\n<!--\nStep 2: Provide an overview of how your fix / enhancement works.\nIf possible, provide screenshots of the before and after states (even for simple command line options - show the terminal).\n-->\n\nIn this pull request, I have …\n\n<!--\nStep 3: Please review the checklist below.\n-->\n\n---\n\n\n> _For features/enhancements:_\n - [ ] I have added/updated the relevant references in the [documentation](https://github.com/wix/Detox/tree/master/docs) files.\n\n> _For API changes:_\n - [ ] I have made the necessary changes in the [types index](https://github.com/wix/Detox/blob/master/detox/index.d.ts) file.\n"
  },
  {
    "path": ".github/stale.yml",
    "content": "# Configuration for probot-stale - https://github.com/probot/stale\n\n# Number of days of inactivity before an Issue or Pull Request becomes stale\ndaysUntilStale: 30\n\n# Number of days of inactivity before a stale Issue or Pull Request is closed.\n# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.\ndaysUntilClose: 7\n\n# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable\nexemptLabels:\n  - \"status: accepted\"\n  - \"user: looking for contributors\"\n  - \"📌 pinned\"\n\n# Set to true to ignore issues in a project (defaults to false)\nexemptProjects: false\n\n# Set to true to ignore issues in a milestone (defaults to false)\nexemptMilestones: false\n\n# Label to use when marking as stale\nstaleLabel: \"🏚 stale\"\n\n# Comment to post when marking as stale. Set to `false` to disable\nmarkComment: >\n  This issue has been automatically marked as stale because it has not had\n  recent activity. It will be closed if no further activity occurs. \n  \n  If you believe the issue is still relevant, please test on the latest Detox and report back.\n  \n  \n  \n  Thank you for your contributions!\n  \n  \n  \n  For more information on bots in this repository, read [this discussion](https://github.com/wix/Detox/issues/1305).\n\n# Comment to post when removing the stale label.\n# unmarkComment: >\n#   Your comment here.\n\n# Comment to post when closing a stale Issue or Pull Request.\ncloseComment: >\n  The issue has been closed for inactivity.\n\n# Limit the number of actions per hour, from 1-30. Default is 30\nlimitPerRun: 30\n\n# Limit to only `issues` or `pulls`\n# only: issues\n\n# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':\npulls:\n  daysUntilStale: 30\n  markComment: >\n    This pull request has been automatically marked as stale because it has not had\n    recent activity. It will be closed if no further activity occurs.\n    \n    Thank you for your contributions.\n    \n    For more information on bots in this repository, read [this discussion](https://github.com/wix/Detox/issues/1305).\n\n# issues:\n#   exemptLabels:\n#     - confirmed\n"
  },
  {
    "path": ".github/workflows/broken-links-scan.yml",
    "content": "name: Broken Links Scan\n\non:\n  workflow_dispatch:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  remark:\n    name: Remark\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install dependencies\n        run: yes | npx npq install --immutable\n        env:\n          NPQ_PKG_MGR: yarn\n      - run: yarn remark -r .remarkrc.nightly.mjs .\n"
  },
  {
    "path": ".github/workflows/docs.yml",
    "content": "name: Doclint\n\non:\n  push:\n    branches: [master]\n    paths:\n      - '.github/workflows/docs.yml'\n      - '.markdownlintrc'\n      - '.remarkignore'\n      - '.remarkrc.mjs'\n      - '.retext-spell.dic'\n      - 'package.json'\n      - 'docs/**'\n      - '**.md'\n  pull_request:\n    branches: [master]\n    paths:\n      - '.github/workflows/docs.yml'\n      - '.markdownlintrc'\n      - '.remarkignore'\n      - '.remarkrc.mjs'\n      - '.retext-spell.dic'\n      - 'package.json'\n      - 'docs/**'\n      - '**.md'\n\njobs:\n  markdownlint:\n    name: Markdown\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install dependencies\n        run: yes | npx npq install --immutable\n        env:\n          NPQ_PKG_MGR: yarn\n      - run: yarn docs:lint\n"
  },
  {
    "path": ".github/workflows/looking-for-contributors.yml",
    "content": "name: Looking for Contributors\non:\n    issues:\n        types:\n            - labeled\njobs:\n    add-comment:\n        if: contains(github.event.label.name, 'looking for contributors')\n        runs-on: ubuntu-latest\n        permissions:\n            issues: write\n        steps:\n            - name: Add comment\n              run: |\n                gh issue comment ${{ github.event.issue.number }} --body \"Hello! We appreciate you bringing this issue to our attention.\n                It looks like this could be a valuable addition or fix to our project.\n                We believe that this feature would benefit greatly from contributions from the community,\n                even from first-time contributors.\n\n                If you're interested in contributing to this feature,\n                please take a look at our [contribution guide](https://wix.github.io/Detox/docs/next/contributing).\n                It has all the information you need to know about how to submit a pull request and contribute to our project.\n\n                You're also welcome to join our [Discord server](https://discord.gg/CkD5QKheF5)\n                and discuss this feature with the collaborators or other contributors under the channel 'contributions'.\n\n                Please feel free to reach out to us if you have any questions, or need help with anything.\n                We appreciate your feedback and look forward to working with you!\"\n              env:\n                GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/rapid-test.yml",
    "content": "name: Rapid Test\n\non:\n  push:\n    branches: [master]\n    paths:\n      - '.github/workflows/rapid-test.yml'\n      - 'detox/**'\n      - 'generation/**'\n  pull_request:\n    branches: [master]\n    paths:\n      - '.github/workflows/rapid-test.yml'\n      - 'detox/**'\n      - 'generation/**'\n\njobs:\n\n  linux:\n    name: Linux\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install dependencies\n        run: yes | npx npq install --immutable\n        env:\n          NPQ_PKG_MGR: yarn\n          DETOX_DISABLE_POD_INSTALL: true\n          DETOX_DISABLE_POSTINSTALL: true\n      - name: Lint source project\n        run: yarn lint\n        working-directory: detox\n      - name: Lint test project\n        run: yarn lint\n        working-directory: detox/test\n      - name: Typings\n        run: yarn test\n        working-directory: detox/test\n      - name: Unit tests\n        run: yarn unit\n        working-directory: detox\n      - name: Integration tests\n        run: yarn integration\n        working-directory: detox/test\n      - name: Generation tests\n        run: yarn test\n        working-directory: generation\n      - name: Pack Allure results\n        run: zip -r allure-results.zip detox/allure-results detox/test/allure-results generation/allure-results\n      - name: Upload Allure results\n        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02\n        with:\n          name: allure-results-linux\n          path: allure-results.zip\n\n  windows:\n    name: Windows\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install dependencies\n        run: echo y | npx npq install --immutable\n        shell: bash\n        env:\n          NPQ_PKG_MGR: yarn\n          DETOX_DISABLE_POD_INSTALL: true\n          DETOX_DISABLE_POSTINSTALL: true\n      - name: Unit tests\n        run: yarn unit --coverageThreshold \"{}\"\n        working-directory: detox\n      - name: Integration tests\n        run: yarn integration\n        working-directory: detox/test\n      - name: Pack Allure results\n        run: |\n          Compress-Archive -Path detox/allure-results -DestinationPath allure-results.zip\n        shell: pwsh\n      - name: Upload Allure results\n        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02\n        with:\n          name: allure-results-windows\n          path: allure-results.zip\n"
  },
  {
    "path": ".github/workflows/reproduction-required.yml",
    "content": "name: Reproduction Required\non:\n    issues:\n        types:\n            - labeled\njobs:\n    add-comment:\n        if: contains(github.event.label.name, 'reproduction required')\n        runs-on: ubuntu-latest\n        permissions:\n            issues: write\n        steps:\n            - name: Add comment\n              run: |\n                gh issue comment ${{ github.event.issue.number }} --body \"Hello! We appreciate you bringing this issue to our attention.\n\n                To assist our collaborators or contributors in identifying and resolving the problem,\n                it would be helpful if you could provide a minimal reproduction of the issue.\n\n                We recommend using our React Native template,\n                which can be found at https://github.com/wix-incubator/detoxtemplate,\n                but any minimal reproduction project would be appreciated.\n\n                Your help is greatly appreciated. Thank you for your support!\"\n              env:\n                GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/support.yml",
    "content": "name: 'Support Requests'\n\non:\n  issues:\n    types: [labeled, unlabeled, reopened]\n\npermissions:\n  issues: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Add comment and close issue\n        if: \"${{ github.event.action == 'labeled' && contains(github.event.label.name, 'type: question/stack overflow') }}\"\n        run: |\n          gh issue comment ${{ github.event.issue.number }} --body \"This issue appears to be a general usage or support question.\n\n          In order to get help, please either ask a question on Stack Overflow with the [\\`detox\\`](https://stackoverflow.com/questions/tagged/detox) tag,\n          or simply join our [Discord](https://discord.com/invite/CkD5QKheF5).\n\n          **Feel free to post your Stack Overflow question here for more visibility!**\n\n          For more information about our policy on issues, refer to [this discussion](https://github.com/wix/Detox/issues/1305).\"\n          gh issue close ${{ github.event.issue.number }}\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/surge-purge.yml",
    "content": "name: Purge old domains\non:\n  workflow_dispatch:\n    inputs:\n      days:\n        description: 'Older than (days)'\n        required: false\n\n  schedule:\n    - cron: '0 3 * * *'\njobs:\n  surge-purge:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install dependencies\n        run: yes | npx npq install --immutable\n        env:\n          NPQ_PKG_MGR: yarn\n      - name: Teardown old domains\n        run: yarn zx scripts/purge_expired_domains.mjs --olderThan ${{ github.event.inputs.days || '10' }}\n        env:\n          SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}\n          SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/website.yml",
    "content": "name: Website\n\non:\n  pull_request:\n    branches: [master]\n    paths:\n      - '.github/workflows/website.yml'\n      - 'docs/**'\n      - 'website/**'\n  push:\n    branches: [master]\n    paths:\n      - '.github/workflows/website.yml'\n      - 'docs/**'\n      - 'website/**'\n\njobs:\n  checks:\n    if: github.event_name != 'push'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Install and build\n        working-directory: ./website\n        env:\n          NPQ_PKG_MGR: yarn\n        run: |\n          yes | npx npq install\n          yarn build\n  gh-release:\n    if: github.event_name != 'pull_request'\n    permissions:\n      contents: write\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744\n      - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610\n        with:\n          node-version-file: '.nvmrc'\n      - name: Enable Corepack\n        run: corepack enable\n      - name: Setup SSH\n        run: |\n          mkdir -p ~/.ssh\n          echo \"${{ secrets.GH_PAGES_DEPLOY }}\" > ~/.ssh/id_rsa\n          chmod 600 ~/.ssh/id_rsa\n          ssh-keyscan github.com >> ~/.ssh/known_hosts\n      - name: Release to GitHub Pages\n        env:\n          USE_SSH: true\n          GIT_USER: git\n          NPQ_PKG_MGR: yarn\n        run: |\n          git config --global user.email \"mobile1@wix.com\"\n          git config --global user.name \"mobilewix\"\n          cd website/\n          yes | npx npq install\n          yarn build\n          yarn docusaurus deploy\n"
  },
  {
    "path": ".gitignore",
    "content": "############\n# Node\n############\n# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Allure reports\nallure-report-*.html\nallure-report\nallure-results\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules\njspm_packages\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n\n################\n# JetBrains\n# IDE\n################\n.idea\n.vscode\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n# Custom runners\n.run/\n\n############\n# iOS\n############\n# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build generated\n*/*/ios/build/\n*/*/ios/DerivedData/\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\n*/*/ios/xcuserdata/\n\n## Other\n*.moved-aside\n*.xcuserstate\n*/*/ios/.xcode.env.local\n\n## Obj-C/Swift specific\n*.hmap\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n# Ruby / CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n*/*/ios/Pods/\n*/*/ios/Podfile.lock\n*/*/vendor/bundle/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md\n\n# fastlane specific\n**/fastlane/report.xml\n\n# deliver temporary files\n**/fastlane/Preview.html\n\n# snapshot generated screenshots\n**/fastlane/screenshots\n\n# scan temporary files\n**/fastlane/test_output\n\n\n############\n# Android\n############\n# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nandroid/bin/\nandroid/gen/\nandroid/out/\n\n# Gradle files\nandroid/.gradle/\nandroid/build/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Proguard folder generated by Eclipse\nandroid/proguard/\n\n# Android Studio Navigation editor temp files\nandroid/.navigation/\n\n# Android Studio captures folder\nandroid/captures/\n\n# Intellij\n*.iml\n\n##################\n# React-Native\n##################\n# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\nxcuserdata\n*.xccheckout\nDerivedData\nproject.xcworkspace\n\n# Android/IJ\n#\n.gradle\n.cxx\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n\n# BUCK\nbuck-out/\n\\.buckd/\nandroid/app/libs\nandroid/keystores/debug.keystore\nios.tar\ndemo-native-ios/ModuleCache\ndetox/ios/DetoxBuild\nDetox.framework.tbz\n\ndemo-native-ios/Build\ndetox/DetoxBuild\nexamples/demo-native-ios/Build\nexamples/demo-native-ios/ModuleCache\n\n# Yarn\n.yarn/*\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/sdks\n!.yarn/versions\n.pnp.*\n\ndetox/ios_src\npackage-lock.json\n/detox/src/devices/detox/notifications/notification.json\ndetox/test/artifacts\n/examples/demo-react-native/artifacts\n/examples/demo-react-native-jest/artifacts\n\n## Final outputs\n\nDetox-android/\nDetox-ios-src.tbz\nDetox-ios-framework.tbz\nDetox-ios-xcuitest.tbz\nDetox-ios.tbz\n\n\n# Ignore .env files across the project\n**/.env\n\n#ignore yalc\n.yalc/\nyalc.lock\n/scripts/publishing-e2e/\n.npmrc\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"detox/ios/COSTouchVisualizer\"]\n\tpath = detox/ios/COSTouchVisualizer\n\turl = https://github.com/wix-incubator/COSTouchVisualizer\n[submodule \"detox/ios/DTXLoggingInfra\"]\n\tpath = detox/ios/DTXLoggingInfra\n\turl = https://github.com/wix/DTXLoggingInfra.git\n[submodule \"detox/ios/DetoxSync\"]\n\tpath = detox/ios/DetoxSync\n\turl = git@github.com:wix-incubator/DetoxSync.git\n[submodule \"detox/ios/LNViewHierarchyDumper\"]\n\tpath = detox/ios/LNViewHierarchyDumper\n\turl = https://github.com/wix-playground/LNViewHierarchyDumper.git\n"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/bin/sh\n\n# Strip registry-specific URLs from yarn.lock to keep it portable\nif [ -f yarn.lock ] && git diff --cached --name-only | grep -q \"yarn.lock\"; then\n  if grep -q \"__archiveUrl\" yarn.lock; then\n    echo \"[husky::precommit] stripping __archiveUrl entries from yarn.lock...\" >&2\n\n    # Cross-platform sed in-place (macOS requires '', Linux doesn't)\n    # Handle both formats: ::__archiveUrl= and %3A%3A__archiveUrl= (URL-encoded)\n    if [ \"$(uname)\" = \"Darwin\" ]; then\n      sed -i '' 's/::__archiveUrl=[^\"]*//g' yarn.lock\n      sed -i '' 's/%3A%3A__archiveUrl=[^\"]*//g' yarn.lock\n    else\n      sed -i 's/::__archiveUrl=[^\"]*//g' yarn.lock\n      sed -i 's/%3A%3A__archiveUrl=[^\"]*//g' yarn.lock\n    fi\n\n    git add yarn.lock\n  fi\n\n  echo \"[husky::precommit] validating yarn.lock...\" >&2\n  yarn install --immutable --mode skip-build || {\n    echo \"[husky::precommit] error: yarn.lock validation failed\" >&2\n    exit 1\n  }\nfi\n"
  },
  {
    "path": ".markdownlintrc",
    "content": "{\n  \"first-line-heading\": { \"level\": 1 },\n  \"heading-style\": { \"style\": \"atx\" },\n  \"hr-style\": { \"style\": \"---\" },\n  \"ol-prefix\": { \"style\": \"one_or_ordered\" },\n  \"ul-style\": { \"style\": \"dash\" },\n  \"line-length\": 0,\n  \"no-inline-html\": 0\n}\n"
  },
  {
    "path": ".nvmrc",
    "content": "lts/iron\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n\t\"arrowParens\": \"always\",\n\t\"bracketSameLine\": true,\n\t\"printWidth\": 140,\n\t\"singleQuote\": true,\n\t\"tabWidth\": 2,\n\t\"trailingComma\": \"none\",\n\t\"useTabs\": false\n}\n"
  },
  {
    "path": ".remarkignore",
    "content": "node_modules\nPods\n/detox/ios\n/detox/test/ios\n/website\n"
  },
  {
    "path": ".remarkrc.mjs",
    "content": "import fs from 'fs';\n\nimport dictionary_en from 'dictionary-en';\nimport remark_frontmatter from 'remark-frontmatter';\nimport remark_gfm from 'remark-gfm';\nimport remark_github from 'remark-github';\nimport remark_retext from 'remark-retext';\nimport remark_validate_links from 'remark-validate-links';\nimport retext_contractions from 'retext-contractions';\nimport retext_diacritics from 'retext-diacritics';\nimport retext_english from 'retext-english';\nimport retext_indefinite_article from 'retext-indefinite-article';\nimport retext_profanities from 'retext-profanities';\nimport retext_redundant_acronyms from 'retext-redundant-acronyms';\nimport retext_repeated_words from 'retext-repeated-words';\nimport retext_sentence_spacing from 'retext-sentence-spacing';\nimport retext_spell from 'retext-spell';\nimport retext_syntax_mentions from 'retext-syntax-mentions';\nimport retext_syntax_urls from 'retext-syntax-urls';\nimport {unified} from 'unified';\n\nexport default {\n  frail: true,\n  silentlyIgnore: true,\n  settings: {\n    bullet: '-',\n    bulletOther: '*',\n    bulletOrdered: '.',\n    closeAtx: false,\n    emphasis: '_',\n    fence: '`',\n    fences: true,\n    incrementListMarker: false,\n    listItemIndent: 1,\n    quote: '\"',\n    resourceLink: false,\n    rule: '-',\n    ruleRepetition: 3,\n    ruleSpaces: false,\n    setext: false,\n    strong: '*'\n  },\n  plugins: [\n    [remark_frontmatter, {\n      type: 'yaml',\n      marker: '-',\n    }],\n    // GitHub and its flavored markdown integration\n    [remark_gfm, {\n      tablePipeAlign: true,\n    }],\n    remark_github,\n    // Links integrity.\n    remark_validate_links, // TODO: check how to validate footnotes\n    // Spelling and style.\n    [ remark_retext,\n      unified()\n        .use(retext_english)\n        .use(retext_syntax_mentions)\n        .use(retext_syntax_urls)\n        .use(retext_spell, {\n          dictionary: dictionary_en,\n          personal: fs.readFileSync('.retext-spell.dic'),\n        })\n        .use(retext_contractions)\n        .use(retext_diacritics)\n        .use(retext_indefinite_article)\n        .use(retext_profanities, { sureness: 1, ignore: ['black'] })\n        .use(retext_redundant_acronyms)\n        .use(retext_repeated_words)\n        .use(retext_sentence_spacing)\n    ],\n  ],\n};\n"
  },
  {
    "path": ".remarkrc.nightly.mjs",
    "content": "import preset from './.remarkrc.mjs';\nimport remark_lint_no_dead_urls from 'remark-lint-no-dead-urls';\n\nexport default {\n  ...preset,\n\n  plugins: [\n    [remark_lint_no_dead_urls, {\n      gotOptions: { concurrency: 2 },\n      skipUrlPatterns: [/^https:\\/\\/developer\\.android\\.com(?:\\/.*)?/],\n    }]\n  ]\n};\n"
  },
  {
    "path": ".retext-spell.dic",
    "content": "AAPT/M\nAAR/M\nANR/M\nAOSP/M\nAPI/M\nAPK/M\nAST/M\nAVD/M\nAndroid-ish\nAppleSimUtils\nApplitools\nBitrise\nC5\nCLI\nCMD\nCocoaPods\nCommonJS\nDetox\nDocusaurus\nEAS/M\nE2E/M\nES5\nGenymotion\nGitHub\nGitLab\nGradle\nHTTPS\nHomebrew\nIPA/M\nJS\nJSON\nJavaScript\nKVM\nKotlin\nM1\nMacOS\nNPM\nOpenJDK\nPOJO\nPR/M\nProGuard\nREADME/M\nRN\nROI\nSDK/M\nSWUbanner\nSiri\nTCP\nTLS\nTeamCity\nTypeScript\nUDID/M\nUUID/M\nUI/M\nUML/M\nVitest\nWebDriver\nWix\nXCTest\nXcode\naccessibilityLabels\nafterAll\nafterEach\narg/M\narm64\nasync\nautogenerate/M\nautogenerated\nautostarting\nbeforeAll\nbeforeEach\nbiometric\nblob/M\nblogpost/M\nbreakpoint/M\nbundler\nbunyan\ncancelled\ncheatsheet/M\ncodebase/M\nconfig/M\ncustomization/M\nde\ndeallocate/M\ndebuggable\ndedupe\ndestructure/M\ndevDependencies\ndialogs\nenv/M\nfacto\nfuturewise\nglobal/M\ngraybox/M\nhittable\ning\ninit/M\ninitializations\ninlined\nintegrations\njure\nkeychain/M\nlifecycle/M\nlocalhost\nlockfile/M\nmacOS\nmatcher/M\nminification/M\nminified\nminSdkVersion\nmonorepo\nmultistep\nnatively\nnpm\nopenjdk\norchestrator/M\nparam/M\nparsable\npostbuild/M\npre-set\nprebaked\nprebuild\nprebuilt\nprecompilation/M\nprecompile\nprecompiled\nprecompiler/M\npreconfigure\npreconfigured\npredownloaded\npreinstall\npreinstalling\nprofiler/M\nrepackage\nrepackager/M\nrepo/M\nresponder/M\nroadmap/M\nruntimes\nse\nsnapshotting\nsubdirectories\nsubdirectory/M\nsubmodule/M\nsubprocess\nsubprocesses\nsubproject/M\nsubresponsibilies\nsubview/M\nteardown/M\ntestID/M\ntyping/M\nunbreak/M\nunencrypted\nuninstallation\nunminified\nunobfuscated\nunregister/M\nutil/M\nv12.x\nv20\nwebhook/M\nwebsocket/M\nxcodebuild\nxcpretty\nᵃ\n"
  },
  {
    "path": ".xcoderc",
    "content": "26.1\n"
  },
  {
    "path": ".yarn/releases/yarn-4.12.0.cjs",
    "content": "#!/usr/bin/env node\n/* eslint-disable */\n//prettier-ignore\n(()=>{var xGe=Object.create;var mU=Object.defineProperty;var kGe=Object.getOwnPropertyDescriptor;var QGe=Object.getOwnPropertyNames;var TGe=Object.getPrototypeOf,RGe=Object.prototype.hasOwnProperty;var Ie=(t=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(t,{get:(e,r)=>(typeof require<\"u\"?require:e)[r]}):t)(function(t){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+t+'\" is not supported')});var Xe=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vt=(t,e)=>{for(var r in e)mU(t,r,{get:e[r],enumerable:!0})},FGe=(t,e,r,s)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let a of QGe(e))!RGe.call(t,a)&&a!==r&&mU(t,a,{get:()=>e[a],enumerable:!(s=kGe(e,a))||s.enumerable});return t};var ut=(t,e,r)=>(r=t!=null?xGe(TGe(t)):{},FGe(e||!t||!t.__esModule?mU(r,\"default\",{value:t,enumerable:!0}):r,t));var fi={};Vt(fi,{SAFE_TIME:()=>WZ,S_IFDIR:()=>JP,S_IFLNK:()=>KP,S_IFMT:()=>Mf,S_IFREG:()=>N2});var Mf,JP,N2,KP,WZ,YZ=Xe(()=>{Mf=61440,JP=16384,N2=32768,KP=40960,WZ=456789e3});var or={};Vt(or,{EBADF:()=>Mo,EBUSY:()=>NGe,EEXIST:()=>HGe,EINVAL:()=>LGe,EISDIR:()=>_Ge,ENOENT:()=>MGe,ENOSYS:()=>OGe,ENOTDIR:()=>UGe,ENOTEMPTY:()=>GGe,EOPNOTSUPP:()=>qGe,EROFS:()=>jGe,ERR_DIR_CLOSED:()=>yU});function Cc(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function NGe(t){return Cc(\"EBUSY\",t)}function OGe(t,e){return Cc(\"ENOSYS\",`${t}, ${e}`)}function LGe(t){return Cc(\"EINVAL\",`invalid argument, ${t}`)}function Mo(t){return Cc(\"EBADF\",`bad file descriptor, ${t}`)}function MGe(t){return Cc(\"ENOENT\",`no such file or directory, ${t}`)}function UGe(t){return Cc(\"ENOTDIR\",`not a directory, ${t}`)}function _Ge(t){return Cc(\"EISDIR\",`illegal operation on a directory, ${t}`)}function HGe(t){return Cc(\"EEXIST\",`file already exists, ${t}`)}function jGe(t){return Cc(\"EROFS\",`read-only filesystem, ${t}`)}function GGe(t){return Cc(\"ENOTEMPTY\",`directory not empty, ${t}`)}function qGe(t){return Cc(\"EOPNOTSUPP\",`operation not supported, ${t}`)}function yU(){return Cc(\"ERR_DIR_CLOSED\",\"Directory handle was closed\")}var zP=Xe(()=>{});var $a={};Vt($a,{BigIntStatsEntry:()=>iE,DEFAULT_MODE:()=>CU,DirEntry:()=>EU,StatEntry:()=>nE,areStatsEqual:()=>wU,clearStats:()=>XP,convertToBigIntStats:()=>YGe,makeDefaultStats:()=>VZ,makeEmptyStats:()=>WGe});function VZ(){return new nE}function WGe(){return XP(VZ())}function XP(t){for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];typeof r==\"number\"?t[e]=0:typeof r==\"bigint\"?t[e]=BigInt(0):IU.types.isDate(r)&&(t[e]=new Date(0))}return t}function YGe(t){let e=new iE;for(let r in t)if(Object.hasOwn(t,r)){let s=t[r];typeof s==\"number\"?e[r]=BigInt(s):IU.types.isDate(s)&&(e[r]=new Date(s))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function wU(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,s=e;return!(r.atimeNs!==s.atimeNs||r.mtimeNs!==s.mtimeNs||r.ctimeNs!==s.ctimeNs||r.birthtimeNs!==s.birthtimeNs)}var IU,CU,EU,nE,iE,BU=Xe(()=>{IU=ut(Ie(\"util\")),CU=33188,EU=class{constructor(){this.name=\"\";this.path=\"\";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},nE=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=CU;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},iE=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(CU);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(61440))===BigInt(16384)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(61440))===BigInt(32768)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(61440))===BigInt(40960)}}});function XGe(t){let e,r;if(e=t.match(KGe))t=e[1];else if(r=t.match(zGe))t=`\\\\\\\\${r[1]?\".\\\\\":\"\"}${r[2]}`;else return t;return t.replace(/\\//g,\"\\\\\")}function ZGe(t){t=t.replace(/\\\\/g,\"/\");let e,r;return(e=t.match(VGe))?t=`/${e[1]}`:(r=t.match(JGe))&&(t=`/unc/${r[1]?\".dot/\":\"\"}${r[2]}`),t}function ZP(t,e){return t===fe?KZ(e):vU(e)}var O2,vt,Er,fe,J,JZ,VGe,JGe,KGe,zGe,vU,KZ,el=Xe(()=>{O2=ut(Ie(\"path\")),vt={root:\"/\",dot:\".\",parent:\"..\"},Er={home:\"~\",nodeModules:\"node_modules\",manifest:\"package.json\",lockfile:\"yarn.lock\",virtual:\"__virtual__\",pnpJs:\".pnp.js\",pnpCjs:\".pnp.cjs\",pnpData:\".pnp.data.json\",pnpEsmLoader:\".pnp.loader.mjs\",rc:\".yarnrc.yml\",env:\".env\"},fe=Object.create(O2.default),J=Object.create(O2.default.posix);fe.cwd=()=>process.cwd();J.cwd=process.platform===\"win32\"?()=>vU(process.cwd()):process.cwd;process.platform===\"win32\"&&(J.resolve=(...t)=>t.length>0&&J.isAbsolute(t[0])?O2.default.posix.resolve(...t):O2.default.posix.resolve(J.cwd(),...t));JZ=function(t,e,r){return e=t.normalize(e),r=t.normalize(r),e===r?\".\":(e.endsWith(t.sep)||(e=e+t.sep),r.startsWith(e)?r.slice(e.length):null)};fe.contains=(t,e)=>JZ(fe,t,e);J.contains=(t,e)=>JZ(J,t,e);VGe=/^([a-zA-Z]:.*)$/,JGe=/^\\/\\/(\\.\\/)?(.*)$/,KGe=/^\\/([a-zA-Z]:.*)$/,zGe=/^\\/unc\\/(\\.dot\\/)?(.*)$/;vU=process.platform===\"win32\"?ZGe:t=>t,KZ=process.platform===\"win32\"?XGe:t=>t;fe.fromPortablePath=KZ;fe.toPortablePath=vU});async function $P(t,e){let r=\"0123456789abcdef\";await t.mkdirPromise(e.indexPath,{recursive:!0});let s=[];for(let a of r)for(let n of r)s.push(t.mkdirPromise(t.pathUtils.join(e.indexPath,`${a}${n}`),{recursive:!0}));return await Promise.all(s),e.indexPath}async function zZ(t,e,r,s,a){let n=t.pathUtils.normalize(e),c=r.pathUtils.normalize(s),f=[],p=[],{atime:h,mtime:E}=a.stableTime?{atime:dd,mtime:dd}:await r.lstatPromise(c);await t.mkdirpPromise(t.pathUtils.dirname(e),{utimes:[h,E]}),await SU(f,p,t,n,r,c,{...a,didParentExist:!0});for(let C of f)await C();await Promise.all(p.map(C=>C()))}async function SU(t,e,r,s,a,n,c){let f=c.didParentExist?await XZ(r,s):null,p=await a.lstatPromise(n),{atime:h,mtime:E}=c.stableTime?{atime:dd,mtime:dd}:p,C;switch(!0){case p.isDirectory():C=await e5e(t,e,r,s,f,a,n,p,c);break;case p.isFile():C=await n5e(t,e,r,s,f,a,n,p,c);break;case p.isSymbolicLink():C=await i5e(t,e,r,s,f,a,n,p,c);break;default:throw new Error(`Unsupported file type (${p.mode})`)}return(c.linkStrategy?.type!==\"HardlinkFromIndex\"||!p.isFile())&&((C||f?.mtime?.getTime()!==E.getTime()||f?.atime?.getTime()!==h.getTime())&&(e.push(()=>r.lutimesPromise(s,h,E)),C=!0),(f===null||(f.mode&511)!==(p.mode&511))&&(e.push(()=>r.chmodPromise(s,p.mode&511)),C=!0)),C}async function XZ(t,e){try{return await t.lstatPromise(e)}catch{return null}}async function e5e(t,e,r,s,a,n,c,f,p){if(a!==null&&!a.isDirectory())if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;let h=!1;a===null&&(t.push(async()=>{try{await r.mkdirPromise(s,{mode:f.mode})}catch(S){if(S.code!==\"EEXIST\")throw S}}),h=!0);let E=await n.readdirPromise(c),C=p.didParentExist&&!a?{...p,didParentExist:!1}:p;if(p.stableSort)for(let S of E.sort())await SU(t,e,r,r.pathUtils.join(s,S),n,n.pathUtils.join(c,S),C)&&(h=!0);else(await Promise.all(E.map(async P=>{await SU(t,e,r,r.pathUtils.join(s,P),n,n.pathUtils.join(c,P),C)}))).some(P=>P)&&(h=!0);return h}async function t5e(t,e,r,s,a,n,c,f,p,h){let E=await n.checksumFilePromise(c,{algorithm:\"sha1\"}),C=420,S=f.mode&511,P=`${E}${S!==C?S.toString(8):\"\"}`,I=r.pathUtils.join(h.indexPath,E.slice(0,2),`${P}.dat`),R;(le=>(le[le.Lock=0]=\"Lock\",le[le.Rename=1]=\"Rename\"))(R||={});let N=1,U=await XZ(r,I);if(a){let ie=U&&a.dev===U.dev&&a.ino===U.ino,ue=U?.mtimeMs!==$Ge;if(ie&&ue&&h.autoRepair&&(N=0,U=null),!ie)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1}let W=!U&&N===1?`${I}.${Math.floor(Math.random()*4294967296).toString(16).padStart(8,\"0\")}`:null,ee=!1;return t.push(async()=>{if(!U&&(N===0&&await r.lockPromise(I,async()=>{let ie=await n.readFilePromise(c);await r.writeFilePromise(I,ie)}),N===1&&W)){let ie=await n.readFilePromise(c);await r.writeFilePromise(W,ie);try{await r.linkPromise(W,I)}catch(ue){if(ue.code===\"EEXIST\")ee=!0,await r.unlinkPromise(W);else throw ue}}a||await r.linkPromise(I,s)}),e.push(async()=>{U||(await r.lutimesPromise(I,dd,dd),S!==C&&await r.chmodPromise(I,S)),W&&!ee&&await r.unlinkPromise(W)}),!1}async function r5e(t,e,r,s,a,n,c,f,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;return t.push(async()=>{let h=await n.readFilePromise(c);await r.writeFilePromise(s,h)}),!0}async function n5e(t,e,r,s,a,n,c,f,p){return p.linkStrategy?.type===\"HardlinkFromIndex\"?t5e(t,e,r,s,a,n,c,f,p,p.linkStrategy):r5e(t,e,r,s,a,n,c,f,p)}async function i5e(t,e,r,s,a,n,c,f,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;return t.push(async()=>{await r.symlinkPromise(ZP(r.pathUtils,await n.readlinkPromise(c)),s)}),!0}var dd,$Ge,DU=Xe(()=>{el();dd=new Date(456789e3*1e3),$Ge=dd.getTime()});function ex(t,e,r,s){let a=()=>{let n=r.shift();if(typeof n>\"u\")return null;let c=t.pathUtils.join(e,n);return Object.assign(t.statSync(c),{name:n,path:void 0})};return new L2(e,a,s)}var L2,ZZ=Xe(()=>{zP();L2=class{constructor(e,r,s={}){this.path=e;this.nextDirent=r;this.opts=s;this.closed=!1}throwIfClosed(){if(this.closed)throw yU()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.read())!==null;)yield e}finally{await this.close()}}read(e){let r=this.readSync();return typeof e<\"u\"?e(null,r):Promise.resolve(r)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(e){return this.closeSync(),typeof e<\"u\"?e(null):Promise.resolve()}closeSync(){this.throwIfClosed(),this.opts.onClose?.(),this.closed=!0}}});function $Z(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var e$,tx,t$=Xe(()=>{e$=Ie(\"events\");BU();tx=class t extends e$.EventEmitter{constructor(r,s,{bigint:a=!1}={}){super();this.status=\"ready\";this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=r,this.path=s,this.bigint=a,this.lastStats=this.stat()}static create(r,s,a){let n=new t(r,s,a);return n.start(),n}start(){$Z(this.status,\"ready\"),this.status=\"running\",this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(\"change\",this.lastStats,this.lastStats)},3)}stop(){$Z(this.status,\"running\"),this.status=\"stopped\",this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(\"stop\")}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch{let r=this.bigint?new iE:new nE;return XP(r)}}makeInterval(r){let s=setInterval(()=>{let a=this.stat(),n=this.lastStats;wU(a,n)||(this.lastStats=a,this.emit(\"change\",a,n))},r.interval);return r.persistent?s:s.unref()}registerChangeListener(r,s){this.addListener(\"change\",r),this.changeListeners.set(r,this.makeInterval(s))}unregisterChangeListener(r){this.removeListener(\"change\",r);let s=this.changeListeners.get(r);typeof s<\"u\"&&clearInterval(s),this.changeListeners.delete(r)}unregisterAllChangeListeners(){for(let r of this.changeListeners.keys())this.unregisterChangeListener(r)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let r of this.changeListeners.values())r.ref();return this}unref(){for(let r of this.changeListeners.values())r.unref();return this}}});function sE(t,e,r,s){let a,n,c,f;switch(typeof r){case\"function\":a=!1,n=!0,c=5007,f=r;break;default:({bigint:a=!1,persistent:n=!0,interval:c=5007}=r),f=s;break}let p=rx.get(t);typeof p>\"u\"&&rx.set(t,p=new Map);let h=p.get(e);return typeof h>\"u\"&&(h=tx.create(t,e,{bigint:a}),p.set(e,h)),h.registerChangeListener(f,{persistent:n,interval:c}),h}function md(t,e,r){let s=rx.get(t);if(typeof s>\"u\")return;let a=s.get(e);typeof a>\"u\"||(typeof r>\"u\"?a.unregisterAllChangeListeners():a.unregisterChangeListener(r),a.hasChangeListeners()||(a.stop(),s.delete(e)))}function yd(t){let e=rx.get(t);if(!(typeof e>\"u\"))for(let r of e.keys())md(t,r)}var rx,bU=Xe(()=>{t$();rx=new WeakMap});function s5e(t){let e=t.match(/\\r?\\n/g);if(e===null)return n$.EOL;let r=e.filter(a=>a===`\\r\n`).length,s=e.length-r;return r>s?`\\r\n`:`\n`}function Ed(t,e){return e.replace(/\\r?\\n/g,s5e(t))}var r$,n$,mp,Uf,Id=Xe(()=>{r$=Ie(\"crypto\"),n$=Ie(\"os\");DU();el();mp=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let s=[e];for(;s.length>0;){let a=s.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())s.push(this.pathUtils.join(a,f));else throw new Error(\"Not supported\")}else yield a}}async checksumFilePromise(e,{algorithm:r=\"sha512\"}={}){let s=await this.openPromise(e,\"r\");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,r$.createHash)(r),f=0;for(;(f=await this.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest(\"hex\")}finally{await this.closePromise(s)}}async removePromise(e,{recursive:r=!0,maxRetries:s=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code===\"ENOENT\")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(e,c))))}for(let n=0;n<=s;n++)try{await this.rmdirPromise(e);break}catch(c){if(c.code!==\"EBUSY\"&&c.code!==\"ENOTEMPTY\")throw c;n<s&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let s;try{s=this.lstatSync(e)}catch(a){if(a.code===\"ENOENT\")return;throw a}if(s.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(p){if(p.code===\"EEXIST\")continue;throw p}if(n??=f,r!=null&&await this.chmodPromise(f,r),s!=null)await this.utimesPromise(f,s[0],s[1]);else{let p=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,p.atime,p.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(p){if(p.code===\"EEXIST\")continue;throw p}if(n??=f,r!=null&&this.chmodSync(f,r),s!=null)this.utimesSync(f,s[0],s[1]);else{let p=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,p.atime,p.mtime)}}}return n}async copyPromise(e,r,{baseFs:s=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await zZ(this,e,s,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(e,r,{baseFs:s=this,overwrite:a=!0}={}){let n=s.lstatSync(r),c=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let p=s.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(e,h),s.pathUtils.join(r,h),{baseFs:s,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(e);let p=s.readFileSync(r);this.writeFileSync(e,p)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(e);let p=s.readlinkSync(r);this.symlinkSync(ZP(this.pathUtils,p),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,\"0\")})`);let f=n.mode&511;this.chmodSync(e,f)}async changeFilePromise(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,s):this.changeFileTextPromise(e,r,s)}async changeFileBufferPromise(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:s})}async changeFileTextPromise(e,r,{automaticNewlines:s,mode:a}={}){let n=\"\";try{n=await this.readFilePromise(e,\"utf8\")}catch{}let c=s?Ed(n,r):r;n!==c&&await this.writeFilePromise(e,c,{mode:a})}changeFileSync(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,s):this.changeFileTextSync(e,r,s)}changeFileBufferSync(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:s})}changeFileTextSync(e,r,{automaticNewlines:s=!1,mode:a}={}){let n=\"\";try{n=this.readFileSync(e,\"utf8\")}catch{}let c=s?Ed(n,r):r;n!==c&&this.writeFileSync(e,c,{mode:a})}async movePromise(e,r){try{await this.renamePromise(e,r)}catch(s){if(s.code===\"EXDEV\")await this.copyPromise(r,e),await this.removePromise(e);else throw s}}moveSync(e,r){try{this.renameSync(e,r)}catch(s){if(s.code===\"EXDEV\")this.copySync(r,e),this.removeSync(e);else throw s}}async lockPromise(e,r){let s=`${e}.flock`,a=1e3/60,n=Date.now(),c=null,f=async()=>{let p;try{[p]=await this.readJsonPromise(s)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;c===null;)try{c=await this.openPromise(s,\"wx\")}catch(p){if(p.code===\"EEXIST\"){if(!await f())try{await this.unlinkPromise(s);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${s})`)}else throw p}await this.writePromise(c,JSON.stringify([process.pid]));try{return await r()}finally{try{await this.closePromise(c),await this.unlinkPromise(s)}catch{}}}async readJsonPromise(e){let r=await this.readFilePromise(e,\"utf8\");try{return JSON.parse(r)}catch(s){throw s.message+=` (in ${e})`,s}}readJsonSync(e){let r=this.readFileSync(e,\"utf8\");try{return JSON.parse(r)}catch(s){throw s.message+=` (in ${e})`,s}}async writeJsonPromise(e,r,{compact:s=!1}={}){let a=s?0:2;return await this.writeFilePromise(e,`${JSON.stringify(r,null,a)}\n`)}writeJsonSync(e,r,{compact:s=!1}={}){let a=s?0:2;return this.writeFileSync(e,`${JSON.stringify(r,null,a)}\n`)}async preserveTimePromise(e,r){let s=await this.lstatPromise(e),a=await r();typeof a<\"u\"&&(e=a),await this.lutimesPromise(e,s.atime,s.mtime)}async preserveTimeSync(e,r){let s=this.lstatSync(e),a=r();typeof a<\"u\"&&(e=a),this.lutimesSync(e,s.atime,s.mtime)}},Uf=class extends mp{constructor(){super(J)}}});var _s,yp=Xe(()=>{Id();_s=class extends mp{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,s){return this.baseFs.openPromise(this.mapToBase(e),r,s)}openSync(e,r,s){return this.baseFs.openSync(this.mapToBase(e),r,s)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,s,a,n){return await this.baseFs.readPromise(e,r,s,a,n)}readSync(e,r,s,a,n){return this.baseFs.readSync(e,r,s,a,n)}async writePromise(e,r,s,a,n){return typeof r==\"string\"?await this.baseFs.writePromise(e,r,s):await this.baseFs.writePromise(e,r,s,a,n)}writeSync(e,r,s,a,n){return typeof r==\"string\"?this.baseFs.writeSync(e,r,s):this.baseFs.writeSync(e,r,s,a,n)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async fchmodPromise(e,r){return this.baseFs.fchmodPromise(e,r)}fchmodSync(e,r){return this.baseFs.fchmodSync(e,r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async fchownPromise(e,r,s){return this.baseFs.fchownPromise(e,r,s)}fchownSync(e,r,s){return this.baseFs.fchownSync(e,r,s)}async chownPromise(e,r,s){return this.baseFs.chownPromise(this.mapToBase(e),r,s)}chownSync(e,r,s){return this.baseFs.chownSync(this.mapToBase(e),r,s)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,s=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),s)}copyFileSync(e,r,s=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),s)}async appendFilePromise(e,r,s){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,s)}appendFileSync(e,r,s){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,s)}async writeFilePromise(e,r,s){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,s)}writeFileSync(e,r,s){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,s)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,s){return this.baseFs.utimesPromise(this.mapToBase(e),r,s)}utimesSync(e,r,s){return this.baseFs.utimesSync(this.mapToBase(e),r,s)}async lutimesPromise(e,r,s){return this.baseFs.lutimesPromise(this.mapToBase(e),r,s)}lutimesSync(e,r,s){return this.baseFs.lutimesSync(this.mapToBase(e),r,s)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async rmPromise(e,r){return this.baseFs.rmPromise(this.mapToBase(e),r)}rmSync(e,r){return this.baseFs.rmSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkPromise(c,a,s)}symlinkSync(e,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkSync(c,a,s)}async readFilePromise(e,r){return this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return this.baseFs.readFileSync(this.fsMapToBase(e),r)}readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}async ftruncatePromise(e,r){return this.baseFs.ftruncatePromise(e,r)}ftruncateSync(e,r){return this.baseFs.ftruncateSync(e,r)}watch(e,r,s){return this.baseFs.watch(this.mapToBase(e),r,s)}watchFile(e,r,s){return this.baseFs.watchFile(this.mapToBase(e),r,s)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e==\"number\"?e:this.mapToBase(e)}}});var _f,i$=Xe(()=>{yp();_f=class extends _s{constructor(e,{baseFs:r,pathUtils:s}){super(s),this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}}});function s$(t){let e=t;return typeof t.path==\"string\"&&(e.path=fe.toPortablePath(t.path)),e}var o$,Yn,Cd=Xe(()=>{o$=ut(Ie(\"fs\"));Id();el();Yn=class extends Uf{constructor(e=o$.default){super(),this.realFs=e}getExtractHint(){return!1}getRealPath(){return vt.root}resolve(e){return J.resolve(e)}async openPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.open(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}openSync(e,r,s){return this.realFs.openSync(fe.fromPortablePath(e),r,s)}async opendirPromise(e,r){return await new Promise((s,a)=>{typeof r<\"u\"?this.realFs.opendir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.opendir(fe.fromPortablePath(e),this.makeCallback(s,a))}).then(s=>{let a=s;return Object.defineProperty(a,\"path\",{value:e,configurable:!0,writable:!0}),a})}opendirSync(e,r){let a=typeof r<\"u\"?this.realFs.opendirSync(fe.fromPortablePath(e),r):this.realFs.opendirSync(fe.fromPortablePath(e));return Object.defineProperty(a,\"path\",{value:e,configurable:!0,writable:!0}),a}async readPromise(e,r,s=0,a=0,n=-1){return await new Promise((c,f)=>{this.realFs.read(e,r,s,a,n,(p,h)=>{p?f(p):c(h)})})}readSync(e,r,s,a,n){return this.realFs.readSync(e,r,s,a,n)}async writePromise(e,r,s,a,n){return await new Promise((c,f)=>typeof r==\"string\"?this.realFs.write(e,r,s,this.makeCallback(c,f)):this.realFs.write(e,r,s,a,n,this.makeCallback(c,f)))}writeSync(e,r,s,a,n){return typeof r==\"string\"?this.realFs.writeSync(e,r,s):this.realFs.writeSync(e,r,s,a,n)}async closePromise(e){await new Promise((r,s)=>{this.realFs.close(e,this.makeCallback(r,s))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let s=e!==null?fe.fromPortablePath(e):e;return this.realFs.createReadStream(s,r)}createWriteStream(e,r){let s=e!==null?fe.fromPortablePath(e):e;return this.realFs.createWriteStream(s,r)}async realpathPromise(e){return await new Promise((r,s)=>{this.realFs.realpath(fe.fromPortablePath(e),{},this.makeCallback(r,s))}).then(r=>fe.toPortablePath(r))}realpathSync(e){return fe.toPortablePath(this.realFs.realpathSync(fe.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(fe.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(fe.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((s,a)=>{this.realFs.access(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}existsSync(e){return this.realFs.existsSync(fe.fromPortablePath(e))}async statPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.stat(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.stat(fe.fromPortablePath(e),this.makeCallback(s,a))})}statSync(e,r){return r?this.realFs.statSync(fe.fromPortablePath(e),r):this.realFs.statSync(fe.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.fstat(e,r,this.makeCallback(s,a)):this.realFs.fstat(e,this.makeCallback(s,a))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.lstat(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.lstat(fe.fromPortablePath(e),this.makeCallback(s,a))})}lstatSync(e,r){return r?this.realFs.lstatSync(fe.fromPortablePath(e),r):this.realFs.lstatSync(fe.fromPortablePath(e))}async fchmodPromise(e,r){return await new Promise((s,a)=>{this.realFs.fchmod(e,r,this.makeCallback(s,a))})}fchmodSync(e,r){return this.realFs.fchmodSync(e,r)}async chmodPromise(e,r){return await new Promise((s,a)=>{this.realFs.chmod(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}chmodSync(e,r){return this.realFs.chmodSync(fe.fromPortablePath(e),r)}async fchownPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.fchown(e,r,s,this.makeCallback(a,n))})}fchownSync(e,r,s){return this.realFs.fchownSync(e,r,s)}async chownPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.chown(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}chownSync(e,r,s){return this.realFs.chownSync(fe.fromPortablePath(e),r,s)}async renamePromise(e,r){return await new Promise((s,a)=>{this.realFs.rename(fe.fromPortablePath(e),fe.fromPortablePath(r),this.makeCallback(s,a))})}renameSync(e,r){return this.realFs.renameSync(fe.fromPortablePath(e),fe.fromPortablePath(r))}async copyFilePromise(e,r,s=0){return await new Promise((a,n)=>{this.realFs.copyFile(fe.fromPortablePath(e),fe.fromPortablePath(r),s,this.makeCallback(a,n))})}copyFileSync(e,r,s=0){return this.realFs.copyFileSync(fe.fromPortablePath(e),fe.fromPortablePath(r),s)}async appendFilePromise(e,r,s){return await new Promise((a,n)=>{let c=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.appendFile(c,r,s,this.makeCallback(a,n)):this.realFs.appendFile(c,r,this.makeCallback(a,n))})}appendFileSync(e,r,s){let a=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.appendFileSync(a,r,s):this.realFs.appendFileSync(a,r)}async writeFilePromise(e,r,s){return await new Promise((a,n)=>{let c=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.writeFile(c,r,s,this.makeCallback(a,n)):this.realFs.writeFile(c,r,this.makeCallback(a,n))})}writeFileSync(e,r,s){let a=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.writeFileSync(a,r,s):this.realFs.writeFileSync(a,r)}async unlinkPromise(e){return await new Promise((r,s)=>{this.realFs.unlink(fe.fromPortablePath(e),this.makeCallback(r,s))})}unlinkSync(e){return this.realFs.unlinkSync(fe.fromPortablePath(e))}async utimesPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.utimes(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}utimesSync(e,r,s){this.realFs.utimesSync(fe.fromPortablePath(e),r,s)}async lutimesPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.lutimes(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}lutimesSync(e,r,s){this.realFs.lutimesSync(fe.fromPortablePath(e),r,s)}async mkdirPromise(e,r){return await new Promise((s,a)=>{this.realFs.mkdir(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}mkdirSync(e,r){return this.realFs.mkdirSync(fe.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.rmdir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.rmdir(fe.fromPortablePath(e),this.makeCallback(s,a))})}rmdirSync(e,r){return this.realFs.rmdirSync(fe.fromPortablePath(e),r)}async rmPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.rm(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.rm(fe.fromPortablePath(e),this.makeCallback(s,a))})}rmSync(e,r){return this.realFs.rmSync(fe.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((s,a)=>{this.realFs.link(fe.fromPortablePath(e),fe.fromPortablePath(r),this.makeCallback(s,a))})}linkSync(e,r){return this.realFs.linkSync(fe.fromPortablePath(e),fe.fromPortablePath(r))}async symlinkPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.symlink(fe.fromPortablePath(e.replace(/\\/+$/,\"\")),fe.fromPortablePath(r),s,this.makeCallback(a,n))})}symlinkSync(e,r,s){return this.realFs.symlinkSync(fe.fromPortablePath(e.replace(/\\/+$/,\"\")),fe.fromPortablePath(r),s)}async readFilePromise(e,r){return await new Promise((s,a)=>{let n=typeof e==\"string\"?fe.fromPortablePath(e):e;this.realFs.readFile(n,r,this.makeCallback(s,a))})}readFileSync(e,r){let s=typeof e==\"string\"?fe.fromPortablePath(e):e;return this.realFs.readFileSync(s,r)}async readdirPromise(e,r){return await new Promise((s,a)=>{r?r.recursive&&process.platform===\"win32\"?r.withFileTypes?this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(n=>s(n.map(s$)),a)):this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(n=>s(n.map(fe.toPortablePath)),a)):this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.readdir(fe.fromPortablePath(e),this.makeCallback(s,a))})}readdirSync(e,r){return r?r.recursive&&process.platform===\"win32\"?r.withFileTypes?this.realFs.readdirSync(fe.fromPortablePath(e),r).map(s$):this.realFs.readdirSync(fe.fromPortablePath(e),r).map(fe.toPortablePath):this.realFs.readdirSync(fe.fromPortablePath(e),r):this.realFs.readdirSync(fe.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,s)=>{this.realFs.readlink(fe.fromPortablePath(e),this.makeCallback(r,s))}).then(r=>fe.toPortablePath(r))}readlinkSync(e){return fe.toPortablePath(this.realFs.readlinkSync(fe.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((s,a)=>{this.realFs.truncate(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}truncateSync(e,r){return this.realFs.truncateSync(fe.fromPortablePath(e),r)}async ftruncatePromise(e,r){return await new Promise((s,a)=>{this.realFs.ftruncate(e,r,this.makeCallback(s,a))})}ftruncateSync(e,r){return this.realFs.ftruncateSync(e,r)}watch(e,r,s){return this.realFs.watch(fe.fromPortablePath(e),r,s)}watchFile(e,r,s){return this.realFs.watchFile(fe.fromPortablePath(e),r,s)}unwatchFile(e,r){return this.realFs.unwatchFile(fe.fromPortablePath(e),r)}makeCallback(e,r){return(s,a)=>{s?r(s):e(a)}}}});var Sn,a$=Xe(()=>{Cd();yp();el();Sn=class extends _s{constructor(e,{baseFs:r=new Yn}={}){super(J),this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?J.normalize(e):this.baseFs.resolve(J.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}}});var l$,Hf,c$=Xe(()=>{Cd();yp();el();l$=vt.root,Hf=class extends _s{constructor(e,{baseFs:r=new Yn}={}){super(J),this.target=this.pathUtils.resolve(vt.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(vt.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(l$,e));if(r.match(/^\\.\\.\\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(l$,this.pathUtils.relative(this.target,e))}}});var oE,u$=Xe(()=>{yp();oE=class extends _s{constructor(r,s){super(s);this.instance=null;this.factory=r}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(r){this.instance=r}mapFromBase(r){return r}mapToBase(r){return r}}});var wd,tl,e0,f$=Xe(()=>{wd=Ie(\"fs\");Id();Cd();bU();zP();el();tl=4278190080,e0=class extends Uf{constructor({baseFs:r=new Yn,filter:s=null,magicByte:a=42,maxOpenFiles:n=1/0,useCache:c=!0,maxAge:f=5e3,typeCheck:p=wd.constants.S_IFREG,getMountPoint:h,factoryPromise:E,factorySync:C}){if(Math.floor(a)!==a||!(a>1&&a<=127))throw new Error(\"The magic byte must be set to a round value between 1 and 127 included\");super();this.fdMap=new Map;this.nextFd=3;this.isMount=new Set;this.notMount=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.baseFs=r,this.mountInstances=c?new Map:null,this.factoryPromise=E,this.factorySync=C,this.filter=s,this.getMountPoint=h,this.magic=a<<24,this.maxAge=f,this.maxOpenFiles=n,this.typeCheck=p}getExtractHint(r){return this.baseFs.getExtractHint(r)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(yd(this),this.mountInstances)for(let[r,{childFs:s}]of this.mountInstances.entries())s.saveAndClose?.(),this.mountInstances.delete(r)}discardAndClose(){if(yd(this),this.mountInstances)for(let[r,{childFs:s}]of this.mountInstances.entries())s.discardAndClose?.(),this.mountInstances.delete(r)}resolve(r){return this.baseFs.resolve(r)}remapFd(r,s){let a=this.nextFd++|this.magic;return this.fdMap.set(a,[r,s]),a}async openPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.openPromise(r,s,a),async(n,{subPath:c})=>this.remapFd(n,await n.openPromise(c,s,a)))}openSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.openSync(r,s,a),(n,{subPath:c})=>this.remapFd(n,n.openSync(c,s,a)))}async opendirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.opendirPromise(r,s),async(a,{subPath:n})=>await a.opendirPromise(n,s),{requireSubpath:!1})}opendirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.opendirSync(r,s),(a,{subPath:n})=>a.opendirSync(n,s),{requireSubpath:!1})}async readPromise(r,s,a,n,c){if((r&tl)!==this.magic)return await this.baseFs.readPromise(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"read\");let[p,h]=f;return await p.readPromise(h,s,a,n,c)}readSync(r,s,a,n,c){if((r&tl)!==this.magic)return this.baseFs.readSync(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"readSync\");let[p,h]=f;return p.readSync(h,s,a,n,c)}async writePromise(r,s,a,n,c){if((r&tl)!==this.magic)return typeof s==\"string\"?await this.baseFs.writePromise(r,s,a):await this.baseFs.writePromise(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"write\");let[p,h]=f;return typeof s==\"string\"?await p.writePromise(h,s,a):await p.writePromise(h,s,a,n,c)}writeSync(r,s,a,n,c){if((r&tl)!==this.magic)return typeof s==\"string\"?this.baseFs.writeSync(r,s,a):this.baseFs.writeSync(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"writeSync\");let[p,h]=f;return typeof s==\"string\"?p.writeSync(h,s,a):p.writeSync(h,s,a,n,c)}async closePromise(r){if((r&tl)!==this.magic)return await this.baseFs.closePromise(r);let s=this.fdMap.get(r);if(typeof s>\"u\")throw Mo(\"close\");this.fdMap.delete(r);let[a,n]=s;return await a.closePromise(n)}closeSync(r){if((r&tl)!==this.magic)return this.baseFs.closeSync(r);let s=this.fdMap.get(r);if(typeof s>\"u\")throw Mo(\"closeSync\");this.fdMap.delete(r);let[a,n]=s;return a.closeSync(n)}createReadStream(r,s){return r===null?this.baseFs.createReadStream(r,s):this.makeCallSync(r,()=>this.baseFs.createReadStream(r,s),(a,{archivePath:n,subPath:c})=>{let f=a.createReadStream(c,s);return f.path=fe.fromPortablePath(this.pathUtils.join(n,c)),f})}createWriteStream(r,s){return r===null?this.baseFs.createWriteStream(r,s):this.makeCallSync(r,()=>this.baseFs.createWriteStream(r,s),(a,{subPath:n})=>a.createWriteStream(n,s))}async realpathPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.realpathPromise(r),async(s,{archivePath:a,subPath:n})=>{let c=this.realPaths.get(a);return typeof c>\"u\"&&(c=await this.baseFs.realpathPromise(a),this.realPaths.set(a,c)),this.pathUtils.join(c,this.pathUtils.relative(vt.root,await s.realpathPromise(n)))})}realpathSync(r){return this.makeCallSync(r,()=>this.baseFs.realpathSync(r),(s,{archivePath:a,subPath:n})=>{let c=this.realPaths.get(a);return typeof c>\"u\"&&(c=this.baseFs.realpathSync(a),this.realPaths.set(a,c)),this.pathUtils.join(c,this.pathUtils.relative(vt.root,s.realpathSync(n)))})}async existsPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.existsPromise(r),async(s,{subPath:a})=>await s.existsPromise(a))}existsSync(r){return this.makeCallSync(r,()=>this.baseFs.existsSync(r),(s,{subPath:a})=>s.existsSync(a))}async accessPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.accessPromise(r,s),async(a,{subPath:n})=>await a.accessPromise(n,s))}accessSync(r,s){return this.makeCallSync(r,()=>this.baseFs.accessSync(r,s),(a,{subPath:n})=>a.accessSync(n,s))}async statPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.statPromise(r,s),async(a,{subPath:n})=>await a.statPromise(n,s))}statSync(r,s){return this.makeCallSync(r,()=>this.baseFs.statSync(r,s),(a,{subPath:n})=>a.statSync(n,s))}async fstatPromise(r,s){if((r&tl)!==this.magic)return this.baseFs.fstatPromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fstat\");let[n,c]=a;return n.fstatPromise(c,s)}fstatSync(r,s){if((r&tl)!==this.magic)return this.baseFs.fstatSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fstatSync\");let[n,c]=a;return n.fstatSync(c,s)}async lstatPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.lstatPromise(r,s),async(a,{subPath:n})=>await a.lstatPromise(n,s))}lstatSync(r,s){return this.makeCallSync(r,()=>this.baseFs.lstatSync(r,s),(a,{subPath:n})=>a.lstatSync(n,s))}async fchmodPromise(r,s){if((r&tl)!==this.magic)return this.baseFs.fchmodPromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fchmod\");let[n,c]=a;return n.fchmodPromise(c,s)}fchmodSync(r,s){if((r&tl)!==this.magic)return this.baseFs.fchmodSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fchmodSync\");let[n,c]=a;return n.fchmodSync(c,s)}async chmodPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.chmodPromise(r,s),async(a,{subPath:n})=>await a.chmodPromise(n,s))}chmodSync(r,s){return this.makeCallSync(r,()=>this.baseFs.chmodSync(r,s),(a,{subPath:n})=>a.chmodSync(n,s))}async fchownPromise(r,s,a){if((r&tl)!==this.magic)return this.baseFs.fchownPromise(r,s,a);let n=this.fdMap.get(r);if(typeof n>\"u\")throw Mo(\"fchown\");let[c,f]=n;return c.fchownPromise(f,s,a)}fchownSync(r,s,a){if((r&tl)!==this.magic)return this.baseFs.fchownSync(r,s,a);let n=this.fdMap.get(r);if(typeof n>\"u\")throw Mo(\"fchownSync\");let[c,f]=n;return c.fchownSync(f,s,a)}async chownPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.chownPromise(r,s,a),async(n,{subPath:c})=>await n.chownPromise(c,s,a))}chownSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.chownSync(r,s,a),(n,{subPath:c})=>n.chownSync(c,s,a))}async renamePromise(r,s){return await this.makeCallPromise(r,async()=>await this.makeCallPromise(s,async()=>await this.baseFs.renamePromise(r,s),async()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})}),async(a,{subPath:n})=>await this.makeCallPromise(s,async()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})},async(c,{subPath:f})=>{if(a!==c)throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"});return await a.renamePromise(n,f)}))}renameSync(r,s){return this.makeCallSync(r,()=>this.makeCallSync(s,()=>this.baseFs.renameSync(r,s),()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})}),(a,{subPath:n})=>this.makeCallSync(s,()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})},(c,{subPath:f})=>{if(a!==c)throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"});return a.renameSync(n,f)}))}async copyFilePromise(r,s,a=0){let n=async(c,f,p,h)=>{if(a&wd.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${f}' -> ${h}'`),{code:\"EXDEV\"});if(a&wd.constants.COPYFILE_EXCL&&await this.existsPromise(f))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${f}' -> '${h}'`),{code:\"EEXIST\"});let E;try{E=await c.readFilePromise(f)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${f}' -> '${h}'`),{code:\"EINVAL\"})}await p.writeFilePromise(h,E)};return await this.makeCallPromise(r,async()=>await this.makeCallPromise(s,async()=>await this.baseFs.copyFilePromise(r,s,a),async(c,{subPath:f})=>await n(this.baseFs,r,c,f)),async(c,{subPath:f})=>await this.makeCallPromise(s,async()=>await n(c,f,this.baseFs,s),async(p,{subPath:h})=>c!==p?await n(c,f,p,h):await c.copyFilePromise(f,h,a)))}copyFileSync(r,s,a=0){let n=(c,f,p,h)=>{if(a&wd.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${f}' -> ${h}'`),{code:\"EXDEV\"});if(a&wd.constants.COPYFILE_EXCL&&this.existsSync(f))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${f}' -> '${h}'`),{code:\"EEXIST\"});let E;try{E=c.readFileSync(f)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${f}' -> '${h}'`),{code:\"EINVAL\"})}p.writeFileSync(h,E)};return this.makeCallSync(r,()=>this.makeCallSync(s,()=>this.baseFs.copyFileSync(r,s,a),(c,{subPath:f})=>n(this.baseFs,r,c,f)),(c,{subPath:f})=>this.makeCallSync(s,()=>n(c,f,this.baseFs,s),(p,{subPath:h})=>c!==p?n(c,f,p,h):c.copyFileSync(f,h,a)))}async appendFilePromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.appendFilePromise(r,s,a),async(n,{subPath:c})=>await n.appendFilePromise(c,s,a))}appendFileSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.appendFileSync(r,s,a),(n,{subPath:c})=>n.appendFileSync(c,s,a))}async writeFilePromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.writeFilePromise(r,s,a),async(n,{subPath:c})=>await n.writeFilePromise(c,s,a))}writeFileSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.writeFileSync(r,s,a),(n,{subPath:c})=>n.writeFileSync(c,s,a))}async unlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.unlinkPromise(r),async(s,{subPath:a})=>await s.unlinkPromise(a))}unlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.unlinkSync(r),(s,{subPath:a})=>s.unlinkSync(a))}async utimesPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.utimesPromise(r,s,a),async(n,{subPath:c})=>await n.utimesPromise(c,s,a))}utimesSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.utimesSync(r,s,a),(n,{subPath:c})=>n.utimesSync(c,s,a))}async lutimesPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.lutimesPromise(r,s,a),async(n,{subPath:c})=>await n.lutimesPromise(c,s,a))}lutimesSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.lutimesSync(r,s,a),(n,{subPath:c})=>n.lutimesSync(c,s,a))}async mkdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.mkdirPromise(r,s),async(a,{subPath:n})=>await a.mkdirPromise(n,s))}mkdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.mkdirSync(r,s),(a,{subPath:n})=>a.mkdirSync(n,s))}async rmdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.rmdirPromise(r,s),async(a,{subPath:n})=>await a.rmdirPromise(n,s))}rmdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.rmdirSync(r,s),(a,{subPath:n})=>a.rmdirSync(n,s))}async rmPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.rmPromise(r,s),async(a,{subPath:n})=>await a.rmPromise(n,s))}rmSync(r,s){return this.makeCallSync(r,()=>this.baseFs.rmSync(r,s),(a,{subPath:n})=>a.rmSync(n,s))}async linkPromise(r,s){return await this.makeCallPromise(s,async()=>await this.baseFs.linkPromise(r,s),async(a,{subPath:n})=>await a.linkPromise(r,n))}linkSync(r,s){return this.makeCallSync(s,()=>this.baseFs.linkSync(r,s),(a,{subPath:n})=>a.linkSync(r,n))}async symlinkPromise(r,s,a){return await this.makeCallPromise(s,async()=>await this.baseFs.symlinkPromise(r,s,a),async(n,{subPath:c})=>await n.symlinkPromise(r,c))}symlinkSync(r,s,a){return this.makeCallSync(s,()=>this.baseFs.symlinkSync(r,s,a),(n,{subPath:c})=>n.symlinkSync(r,c))}async readFilePromise(r,s){return this.makeCallPromise(r,async()=>await this.baseFs.readFilePromise(r,s),async(a,{subPath:n})=>await a.readFilePromise(n,s))}readFileSync(r,s){return this.makeCallSync(r,()=>this.baseFs.readFileSync(r,s),(a,{subPath:n})=>a.readFileSync(n,s))}async readdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.readdirPromise(r,s),async(a,{subPath:n})=>await a.readdirPromise(n,s),{requireSubpath:!1})}readdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.readdirSync(r,s),(a,{subPath:n})=>a.readdirSync(n,s),{requireSubpath:!1})}async readlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.readlinkPromise(r),async(s,{subPath:a})=>await s.readlinkPromise(a))}readlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.readlinkSync(r),(s,{subPath:a})=>s.readlinkSync(a))}async truncatePromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.truncatePromise(r,s),async(a,{subPath:n})=>await a.truncatePromise(n,s))}truncateSync(r,s){return this.makeCallSync(r,()=>this.baseFs.truncateSync(r,s),(a,{subPath:n})=>a.truncateSync(n,s))}async ftruncatePromise(r,s){if((r&tl)!==this.magic)return this.baseFs.ftruncatePromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"ftruncate\");let[n,c]=a;return n.ftruncatePromise(c,s)}ftruncateSync(r,s){if((r&tl)!==this.magic)return this.baseFs.ftruncateSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"ftruncateSync\");let[n,c]=a;return n.ftruncateSync(c,s)}watch(r,s,a){return this.makeCallSync(r,()=>this.baseFs.watch(r,s,a),(n,{subPath:c})=>n.watch(c,s,a))}watchFile(r,s,a){return this.makeCallSync(r,()=>this.baseFs.watchFile(r,s,a),()=>sE(this,r,s,a))}unwatchFile(r,s){return this.makeCallSync(r,()=>this.baseFs.unwatchFile(r,s),()=>md(this,r,s))}async makeCallPromise(r,s,a,{requireSubpath:n=!0}={}){if(typeof r!=\"string\")return await s();let c=this.resolve(r),f=this.findMount(c);return f?n&&f.subPath===\"/\"?await s():await this.getMountPromise(f.archivePath,async p=>await a(p,f)):await s()}makeCallSync(r,s,a,{requireSubpath:n=!0}={}){if(typeof r!=\"string\")return s();let c=this.resolve(r),f=this.findMount(c);return!f||n&&f.subPath===\"/\"?s():this.getMountSync(f.archivePath,p=>a(p,f))}findMount(r){if(this.filter&&!this.filter.test(r))return null;let s=\"\";for(;;){let a=r.substring(s.length),n=this.getMountPoint(a,s);if(!n)return null;if(s=this.pathUtils.join(s,n),!this.isMount.has(s)){if(this.notMount.has(s))continue;try{if(this.typeCheck!==null&&(this.baseFs.statSync(s).mode&wd.constants.S_IFMT)!==this.typeCheck){this.notMount.add(s);continue}}catch{return null}this.isMount.add(s)}return{archivePath:s,subPath:this.pathUtils.join(vt.root,r.substring(s.length))}}}limitOpenFiles(r){if(this.mountInstances===null)return;let s=Date.now(),a=s+this.maxAge,n=r===null?0:this.mountInstances.size-r;for(let[c,{childFs:f,expiresAt:p,refCount:h}]of this.mountInstances.entries())if(!(h!==0||f.hasOpenFileHandles?.())){if(s>=p){f.saveAndClose?.(),this.mountInstances.delete(c),n-=1;continue}else if(r===null||n<=0){a=p;break}f.saveAndClose?.(),this.mountInstances.delete(c),n-=1}this.limitOpenFilesTimeout===null&&(r===null&&this.mountInstances.size>0||r!==null)&&isFinite(a)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},a-s).unref())}async getMountPromise(r,s){if(this.mountInstances){let a=this.mountInstances.get(r);if(!a){let n=await this.factoryPromise(this.baseFs,r);a=this.mountInstances.get(r),a||(a={childFs:n(),expiresAt:0,refCount:0})}this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,a.refCount+=1;try{return await s(a.childFs)}finally{a.refCount-=1}}else{let a=(await this.factoryPromise(this.baseFs,r))();try{return await s(a)}finally{a.saveAndClose?.()}}}getMountSync(r,s){if(this.mountInstances){let a=this.mountInstances.get(r);return a||(a={childFs:this.factorySync(this.baseFs,r),expiresAt:0,refCount:0}),this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,s(a.childFs)}else{let a=this.factorySync(this.baseFs,r);try{return s(a)}finally{a.saveAndClose?.()}}}}});var er,nx,A$=Xe(()=>{Id();el();er=()=>Object.assign(new Error(\"ENOSYS: unsupported filesystem access\"),{code:\"ENOSYS\"}),nx=class t extends mp{static{this.instance=new t}constructor(){super(J)}getExtractHint(){throw er()}getRealPath(){throw er()}resolve(){throw er()}async openPromise(){throw er()}openSync(){throw er()}async opendirPromise(){throw er()}opendirSync(){throw er()}async readPromise(){throw er()}readSync(){throw er()}async writePromise(){throw er()}writeSync(){throw er()}async closePromise(){throw er()}closeSync(){throw er()}createWriteStream(){throw er()}createReadStream(){throw er()}async realpathPromise(){throw er()}realpathSync(){throw er()}async readdirPromise(){throw er()}readdirSync(){throw er()}async existsPromise(e){throw er()}existsSync(e){throw er()}async accessPromise(){throw er()}accessSync(){throw er()}async statPromise(){throw er()}statSync(){throw er()}async fstatPromise(e){throw er()}fstatSync(e){throw er()}async lstatPromise(e){throw er()}lstatSync(e){throw er()}async fchmodPromise(){throw er()}fchmodSync(){throw er()}async chmodPromise(){throw er()}chmodSync(){throw er()}async fchownPromise(){throw er()}fchownSync(){throw er()}async chownPromise(){throw er()}chownSync(){throw er()}async mkdirPromise(){throw er()}mkdirSync(){throw er()}async rmdirPromise(){throw er()}rmdirSync(){throw er()}async rmPromise(){throw er()}rmSync(){throw er()}async linkPromise(){throw er()}linkSync(){throw er()}async symlinkPromise(){throw er()}symlinkSync(){throw er()}async renamePromise(){throw er()}renameSync(){throw er()}async copyFilePromise(){throw er()}copyFileSync(){throw er()}async appendFilePromise(){throw er()}appendFileSync(){throw er()}async writeFilePromise(){throw er()}writeFileSync(){throw er()}async unlinkPromise(){throw er()}unlinkSync(){throw er()}async utimesPromise(){throw er()}utimesSync(){throw er()}async lutimesPromise(){throw er()}lutimesSync(){throw er()}async readFilePromise(){throw er()}readFileSync(){throw er()}async readlinkPromise(){throw er()}readlinkSync(){throw er()}async truncatePromise(){throw er()}truncateSync(){throw er()}async ftruncatePromise(e,r){throw er()}ftruncateSync(e,r){throw er()}watch(){throw er()}watchFile(){throw er()}unwatchFile(){throw er()}}});var t0,p$=Xe(()=>{yp();el();t0=class extends _s{constructor(e){super(fe),this.baseFs=e}mapFromBase(e){return fe.fromPortablePath(e)}mapToBase(e){return fe.toPortablePath(e)}}});var o5e,PU,a5e,uo,h$=Xe(()=>{Cd();yp();el();o5e=/^[0-9]+$/,PU=/^(\\/(?:[^/]+\\/)*?(?:\\$\\$virtual|__virtual__))((?:\\/((?:[^/]+-)?[a-f0-9]+)(?:\\/([^/]+))?)?((?:\\/.*)?))$/,a5e=/^([^/]+-)?[a-f0-9]+$/,uo=class t extends _s{static makeVirtualPath(e,r,s){if(J.basename(e)!==\"__virtual__\")throw new Error('Assertion failed: Virtual folders must be named \"__virtual__\"');if(!J.basename(r).match(a5e))throw new Error(\"Assertion failed: Virtual components must be ended by an hexadecimal hash\");let n=J.relative(J.dirname(e),s).split(\"/\"),c=0;for(;c<n.length&&n[c]===\"..\";)c+=1;let f=n.slice(c);return J.join(e,r,String(c),...f)}static resolveVirtual(e){let r=e.match(PU);if(!r||!r[3]&&r[5])return e;let s=J.dirname(r[1]);if(!r[3]||!r[4])return s;if(!o5e.test(r[4]))return e;let n=Number(r[4]),c=\"../\".repeat(n),f=r[5]||\".\";return t.resolveVirtual(J.join(s,c,f))}constructor({baseFs:e=new Yn}={}){super(J),this.baseFs=e}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}realpathSync(e){let r=e.match(PU);if(!r)return this.baseFs.realpathSync(e);if(!r[5])return e;let s=this.baseFs.realpathSync(this.mapToBase(e));return t.makeVirtualPath(r[1],r[3],s)}async realpathPromise(e){let r=e.match(PU);if(!r)return await this.baseFs.realpathPromise(e);if(!r[5])return e;let s=await this.baseFs.realpathPromise(this.mapToBase(e));return t.makeVirtualPath(r[1],r[3],s)}mapToBase(e){if(e===\"\")return e;if(this.pathUtils.isAbsolute(e))return t.resolveVirtual(e);let r=t.resolveVirtual(this.baseFs.resolve(vt.dot)),s=t.resolveVirtual(this.baseFs.resolve(e));return J.relative(r,s)||vt.dot}mapFromBase(e){return e}}});function l5e(t,e){return typeof xU.default.isUtf8<\"u\"?xU.default.isUtf8(t):Buffer.byteLength(e)===t.byteLength}var xU,g$,d$,ix,m$=Xe(()=>{xU=ut(Ie(\"buffer\")),g$=Ie(\"url\"),d$=Ie(\"util\");yp();el();ix=class extends _s{constructor(e){super(fe),this.baseFs=e}mapFromBase(e){return e}mapToBase(e){if(typeof e==\"string\")return e;if(e instanceof URL)return(0,g$.fileURLToPath)(e);if(Buffer.isBuffer(e)){let r=e.toString();if(!l5e(e,r))throw new Error(\"Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942\");return r}throw new Error(`Unsupported path type: ${(0,d$.inspect)(e)}`)}}});var w$,Uo,Ep,r0,sx,ox,aE,Ru,Fu,y$,E$,I$,C$,M2,B$=Xe(()=>{w$=Ie(\"readline\"),Uo=Symbol(\"kBaseFs\"),Ep=Symbol(\"kFd\"),r0=Symbol(\"kClosePromise\"),sx=Symbol(\"kCloseResolve\"),ox=Symbol(\"kCloseReject\"),aE=Symbol(\"kRefs\"),Ru=Symbol(\"kRef\"),Fu=Symbol(\"kUnref\"),M2=class{constructor(e,r){this[C$]=1;this[I$]=void 0;this[E$]=void 0;this[y$]=void 0;this[Uo]=r,this[Ep]=e}get fd(){return this[Ep]}async appendFile(e,r){try{this[Ru](this.appendFile);let s=(typeof r==\"string\"?r:r?.encoding)??void 0;return await this[Uo].appendFilePromise(this.fd,e,s?{encoding:s}:void 0)}finally{this[Fu]()}}async chown(e,r){try{return this[Ru](this.chown),await this[Uo].fchownPromise(this.fd,e,r)}finally{this[Fu]()}}async chmod(e){try{return this[Ru](this.chmod),await this[Uo].fchmodPromise(this.fd,e)}finally{this[Fu]()}}createReadStream(e){return this[Uo].createReadStream(null,{...e,fd:this.fd})}createWriteStream(e){return this[Uo].createWriteStream(null,{...e,fd:this.fd})}datasync(){throw new Error(\"Method not implemented.\")}sync(){throw new Error(\"Method not implemented.\")}async read(e,r,s,a){try{this[Ru](this.read);let n,c;return ArrayBuffer.isView(e)?typeof r==\"object\"&&r!==null?(n=e,c=r?.offset??0,s=r?.length??n.byteLength-c,a=r?.position??null):(n=e,c=r??0,s??=0):(n=e?.buffer??Buffer.alloc(16384),c=e?.offset??0,s=e?.length??n.byteLength-c,a=e?.position??null),s===0?{bytesRead:s,buffer:n}:{bytesRead:await this[Uo].readPromise(this.fd,Buffer.isBuffer(n)?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength),c,s,a),buffer:n}}finally{this[Fu]()}}async readFile(e){try{this[Ru](this.readFile);let r=(typeof e==\"string\"?e:e?.encoding)??void 0;return await this[Uo].readFilePromise(this.fd,r)}finally{this[Fu]()}}readLines(e){return(0,w$.createInterface)({input:this.createReadStream(e),crlfDelay:1/0})}async stat(e){try{return this[Ru](this.stat),await this[Uo].fstatPromise(this.fd,e)}finally{this[Fu]()}}async truncate(e){try{return this[Ru](this.truncate),await this[Uo].ftruncatePromise(this.fd,e)}finally{this[Fu]()}}utimes(e,r){throw new Error(\"Method not implemented.\")}async writeFile(e,r){try{this[Ru](this.writeFile);let s=(typeof r==\"string\"?r:r?.encoding)??void 0;await this[Uo].writeFilePromise(this.fd,e,s)}finally{this[Fu]()}}async write(...e){try{if(this[Ru](this.write),ArrayBuffer.isView(e[0])){let[r,s,a,n]=e;return{bytesWritten:await this[Uo].writePromise(this.fd,r,s??void 0,a??void 0,n??void 0),buffer:r}}else{let[r,s,a]=e;return{bytesWritten:await this[Uo].writePromise(this.fd,r,s,a),buffer:r}}}finally{this[Fu]()}}async writev(e,r){try{this[Ru](this.writev);let s=0;if(typeof r<\"u\")for(let a of e){let n=await this.write(a,void 0,void 0,r);s+=n.bytesWritten,r+=n.bytesWritten}else for(let a of e){let n=await this.write(a);s+=n.bytesWritten}return{buffers:e,bytesWritten:s}}finally{this[Fu]()}}readv(e,r){throw new Error(\"Method not implemented.\")}close(){if(this[Ep]===-1)return Promise.resolve();if(this[r0])return this[r0];if(this[aE]--,this[aE]===0){let e=this[Ep];this[Ep]=-1,this[r0]=this[Uo].closePromise(e).finally(()=>{this[r0]=void 0})}else this[r0]=new Promise((e,r)=>{this[sx]=e,this[ox]=r}).finally(()=>{this[r0]=void 0,this[ox]=void 0,this[sx]=void 0});return this[r0]}[(Uo,Ep,C$=aE,I$=r0,E$=sx,y$=ox,Ru)](e){if(this[Ep]===-1){let r=new Error(\"file closed\");throw r.code=\"EBADF\",r.syscall=e.name,r}this[aE]++}[Fu](){if(this[aE]--,this[aE]===0){let e=this[Ep];this[Ep]=-1,this[Uo].closePromise(e).then(this[sx],this[ox])}}}});function U2(t,e){e=new ix(e);let r=(s,a,n)=>{let c=s[a];s[a]=n,typeof c?.[lE.promisify.custom]<\"u\"&&(n[lE.promisify.custom]=c[lE.promisify.custom])};{r(t,\"exists\",(s,...a)=>{let c=typeof a[a.length-1]==\"function\"?a.pop():()=>{};process.nextTick(()=>{e.existsPromise(s).then(f=>{c(f)},()=>{c(!1)})})}),r(t,\"read\",(...s)=>{let[a,n,c,f,p,h]=s;if(s.length<=3){let E={};s.length<3?h=s[1]:(E=s[1],h=s[2]),{buffer:n=Buffer.alloc(16384),offset:c=0,length:f=n.byteLength,position:p}=E}if(c==null&&(c=0),f|=0,f===0){process.nextTick(()=>{h(null,0,n)});return}p==null&&(p=-1),process.nextTick(()=>{e.readPromise(a,n,c,f,p).then(E=>{h(null,E,n)},E=>{h(E,0,n)})})});for(let s of v$){let a=s.replace(/Promise$/,\"\");if(typeof t[a]>\"u\")continue;let n=e[s];if(typeof n>\"u\")continue;r(t,a,(...f)=>{let h=typeof f[f.length-1]==\"function\"?f.pop():()=>{};process.nextTick(()=>{n.apply(e,f).then(E=>{h(null,E)},E=>{h(E)})})})}t.realpath.native=t.realpath}{r(t,\"existsSync\",s=>{try{return e.existsSync(s)}catch{return!1}}),r(t,\"readSync\",(...s)=>{let[a,n,c,f,p]=s;return s.length<=3&&({offset:c=0,length:f=n.byteLength,position:p}=s[2]||{}),c==null&&(c=0),f|=0,f===0?0:(p==null&&(p=-1),e.readSync(a,n,c,f,p))});for(let s of c5e){let a=s;if(typeof t[a]>\"u\")continue;let n=e[s];typeof n>\"u\"||r(t,a,n.bind(e))}t.realpathSync.native=t.realpathSync}{let s=t.promises;for(let a of v$){let n=a.replace(/Promise$/,\"\");if(typeof s[n]>\"u\")continue;let c=e[a];typeof c>\"u\"||a!==\"open\"&&r(s,n,(f,...p)=>f instanceof M2?f[n].apply(f,p):c.call(e,f,...p))}r(s,\"open\",async(...a)=>{let n=await e.openPromise(...a);return new M2(n,e)})}t.read[lE.promisify.custom]=async(s,a,...n)=>({bytesRead:await e.readPromise(s,a,...n),buffer:a}),t.write[lE.promisify.custom]=async(s,a,...n)=>({bytesWritten:await e.writePromise(s,a,...n),buffer:a})}function ax(t,e){let r=Object.create(t);return U2(r,e),r}var lE,c5e,v$,S$=Xe(()=>{lE=Ie(\"util\");m$();B$();c5e=new Set([\"accessSync\",\"appendFileSync\",\"createReadStream\",\"createWriteStream\",\"chmodSync\",\"fchmodSync\",\"chownSync\",\"fchownSync\",\"closeSync\",\"copyFileSync\",\"linkSync\",\"lstatSync\",\"fstatSync\",\"lutimesSync\",\"mkdirSync\",\"openSync\",\"opendirSync\",\"readlinkSync\",\"readFileSync\",\"readdirSync\",\"readlinkSync\",\"realpathSync\",\"renameSync\",\"rmdirSync\",\"rmSync\",\"statSync\",\"symlinkSync\",\"truncateSync\",\"ftruncateSync\",\"unlinkSync\",\"unwatchFile\",\"utimesSync\",\"watch\",\"watchFile\",\"writeFileSync\",\"writeSync\"]),v$=new Set([\"accessPromise\",\"appendFilePromise\",\"fchmodPromise\",\"chmodPromise\",\"fchownPromise\",\"chownPromise\",\"closePromise\",\"copyFilePromise\",\"linkPromise\",\"fstatPromise\",\"lstatPromise\",\"lutimesPromise\",\"mkdirPromise\",\"openPromise\",\"opendirPromise\",\"readdirPromise\",\"realpathPromise\",\"readFilePromise\",\"readdirPromise\",\"readlinkPromise\",\"renamePromise\",\"rmdirPromise\",\"rmPromise\",\"statPromise\",\"symlinkPromise\",\"truncatePromise\",\"ftruncatePromise\",\"unlinkPromise\",\"utimesPromise\",\"writeFilePromise\",\"writeSync\"])});function D$(t){let e=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,\"0\");return`${t}${e}`}function b$(){if(kU)return kU;let t=fe.toPortablePath(P$.default.tmpdir()),e=ce.realpathSync(t);return process.once(\"exit\",()=>{ce.rmtempSync()}),kU={tmpdir:t,realTmpdir:e}}var P$,Nu,kU,ce,x$=Xe(()=>{P$=ut(Ie(\"os\"));Cd();el();Nu=new Set,kU=null;ce=Object.assign(new Yn,{detachTemp(t){Nu.delete(t)},mktempSync(t){let{tmpdir:e,realTmpdir:r}=b$();for(;;){let s=D$(\"xfs-\");try{this.mkdirSync(J.join(e,s))}catch(n){if(n.code===\"EEXIST\")continue;throw n}let a=J.join(r,s);if(Nu.add(a),typeof t>\"u\")return a;try{return t(a)}finally{if(Nu.has(a)){Nu.delete(a);try{this.removeSync(a)}catch{}}}}},async mktempPromise(t){let{tmpdir:e,realTmpdir:r}=b$();for(;;){let s=D$(\"xfs-\");try{await this.mkdirPromise(J.join(e,s))}catch(n){if(n.code===\"EEXIST\")continue;throw n}let a=J.join(r,s);if(Nu.add(a),typeof t>\"u\")return a;try{return await t(a)}finally{if(Nu.has(a)){Nu.delete(a);try{await this.removePromise(a)}catch{}}}}},async rmtempPromise(){await Promise.all(Array.from(Nu.values()).map(async t=>{try{await ce.removePromise(t,{maxRetries:0}),Nu.delete(t)}catch{}}))},rmtempSync(){for(let t of Nu)try{ce.removeSync(t),Nu.delete(t)}catch{}}})});var _2={};Vt(_2,{AliasFS:()=>_f,BasePortableFakeFS:()=>Uf,CustomDir:()=>L2,CwdFS:()=>Sn,FakeFS:()=>mp,Filename:()=>Er,JailFS:()=>Hf,LazyFS:()=>oE,MountFS:()=>e0,NoFS:()=>nx,NodeFS:()=>Yn,PortablePath:()=>vt,PosixFS:()=>t0,ProxiedFS:()=>_s,VirtualFS:()=>uo,constants:()=>fi,errors:()=>or,extendFs:()=>ax,normalizeLineEndings:()=>Ed,npath:()=>fe,opendir:()=>ex,patchFs:()=>U2,ppath:()=>J,setupCopyIndex:()=>$P,statUtils:()=>$a,unwatchAllFiles:()=>yd,unwatchFile:()=>md,watchFile:()=>sE,xfs:()=>ce});var Dt=Xe(()=>{YZ();zP();BU();DU();ZZ();bU();Id();el();el();i$();Id();a$();c$();u$();f$();A$();Cd();p$();yp();h$();S$();x$()});var F$=_((Dkt,R$)=>{R$.exports=T$;T$.sync=f5e;var k$=Ie(\"fs\");function u5e(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(\";\"),r.indexOf(\"\")!==-1))return!0;for(var s=0;s<r.length;s++){var a=r[s].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a)return!0}return!1}function Q$(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:u5e(e,r)}function T$(t,e,r){k$.stat(t,function(s,a){r(s,s?!1:Q$(a,t,e))})}function f5e(t,e){return Q$(k$.statSync(t),t,e)}});var U$=_((bkt,M$)=>{M$.exports=O$;O$.sync=A5e;var N$=Ie(\"fs\");function O$(t,e,r){N$.stat(t,function(s,a){r(s,s?!1:L$(a,e))})}function A5e(t,e){return L$(N$.statSync(t),e)}function L$(t,e){return t.isFile()&&p5e(t,e)}function p5e(t,e){var r=t.mode,s=t.uid,a=t.gid,n=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),f=parseInt(\"100\",8),p=parseInt(\"010\",8),h=parseInt(\"001\",8),E=f|p,C=r&h||r&p&&a===c||r&f&&s===n||r&E&&n===0;return C}});var H$=_((xkt,_$)=>{var Pkt=Ie(\"fs\"),lx;process.platform===\"win32\"||global.TESTING_WINDOWS?lx=F$():lx=U$();_$.exports=QU;QU.sync=h5e;function QU(t,e,r){if(typeof e==\"function\"&&(r=e,e={}),!r){if(typeof Promise!=\"function\")throw new TypeError(\"callback not provided\");return new Promise(function(s,a){QU(t,e||{},function(n,c){n?a(n):s(c)})})}lx(t,e||{},function(s,a){s&&(s.code===\"EACCES\"||e&&e.ignoreErrors)&&(s=null,a=!1),r(s,a)})}function h5e(t,e){try{return lx.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code===\"EACCES\")return!1;throw r}}});var J$=_((kkt,V$)=>{var cE=process.platform===\"win32\"||process.env.OSTYPE===\"cygwin\"||process.env.OSTYPE===\"msys\",j$=Ie(\"path\"),g5e=cE?\";\":\":\",G$=H$(),q$=t=>Object.assign(new Error(`not found: ${t}`),{code:\"ENOENT\"}),W$=(t,e)=>{let r=e.colon||g5e,s=t.match(/\\//)||cE&&t.match(/\\\\/)?[\"\"]:[...cE?[process.cwd()]:[],...(e.path||process.env.PATH||\"\").split(r)],a=cE?e.pathExt||process.env.PATHEXT||\".EXE;.CMD;.BAT;.COM\":\"\",n=cE?a.split(r):[\"\"];return cE&&t.indexOf(\".\")!==-1&&n[0]!==\"\"&&n.unshift(\"\"),{pathEnv:s,pathExt:n,pathExtExe:a}},Y$=(t,e,r)=>{typeof e==\"function\"&&(r=e,e={}),e||(e={});let{pathEnv:s,pathExt:a,pathExtExe:n}=W$(t,e),c=[],f=h=>new Promise((E,C)=>{if(h===s.length)return e.all&&c.length?E(c):C(q$(t));let S=s[h],P=/^\".*\"$/.test(S)?S.slice(1,-1):S,I=j$.join(P,t),R=!P&&/^\\.[\\\\\\/]/.test(t)?t.slice(0,2)+I:I;E(p(R,h,0))}),p=(h,E,C)=>new Promise((S,P)=>{if(C===a.length)return S(f(E+1));let I=a[C];G$(h+I,{pathExt:n},(R,N)=>{if(!R&&N)if(e.all)c.push(h+I);else return S(h+I);return S(p(h,E,C+1))})});return r?f(0).then(h=>r(null,h),r):f(0)},d5e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:s,pathExtExe:a}=W$(t,e),n=[];for(let c=0;c<r.length;c++){let f=r[c],p=/^\".*\"$/.test(f)?f.slice(1,-1):f,h=j$.join(p,t),E=!p&&/^\\.[\\\\\\/]/.test(t)?t.slice(0,2)+h:h;for(let C=0;C<s.length;C++){let S=E+s[C];try{if(G$.sync(S,{pathExt:a}))if(e.all)n.push(S);else return S}catch{}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw q$(t)};V$.exports=Y$;Y$.sync=d5e});var z$=_((Qkt,TU)=>{\"use strict\";var K$=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!==\"win32\"?\"PATH\":Object.keys(e).reverse().find(s=>s.toUpperCase()===\"PATH\")||\"Path\"};TU.exports=K$;TU.exports.default=K$});var eee=_((Tkt,$$)=>{\"use strict\";var X$=Ie(\"path\"),m5e=J$(),y5e=z$();function Z$(t,e){let r=t.options.env||process.env,s=process.cwd(),a=t.options.cwd!=null,n=a&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(t.options.cwd)}catch{}let c;try{c=m5e.sync(t.command,{path:r[y5e({env:r})],pathExt:e?X$.delimiter:void 0})}catch{}finally{n&&process.chdir(s)}return c&&(c=X$.resolve(a?t.options.cwd:\"\",c)),c}function E5e(t){return Z$(t)||Z$(t,!0)}$$.exports=E5e});var tee=_((Rkt,FU)=>{\"use strict\";var RU=/([()\\][%!^\"`<>&|;, *?])/g;function I5e(t){return t=t.replace(RU,\"^$1\"),t}function C5e(t,e){return t=`${t}`,t=t.replace(/(?=(\\\\+?)?)\\1\"/g,'$1$1\\\\\"'),t=t.replace(/(?=(\\\\+?)?)\\1$/,\"$1$1\"),t=`\"${t}\"`,t=t.replace(RU,\"^$1\"),e&&(t=t.replace(RU,\"^$1\")),t}FU.exports.command=I5e;FU.exports.argument=C5e});var nee=_((Fkt,ree)=>{\"use strict\";ree.exports=/^#!(.*)/});var see=_((Nkt,iee)=>{\"use strict\";var w5e=nee();iee.exports=(t=\"\")=>{let e=t.match(w5e);if(!e)return null;let[r,s]=e[0].replace(/#! ?/,\"\").split(\" \"),a=r.split(\"/\").pop();return a===\"env\"?s:s?`${a} ${s}`:a}});var aee=_((Okt,oee)=>{\"use strict\";var NU=Ie(\"fs\"),B5e=see();function v5e(t){let r=Buffer.alloc(150),s;try{s=NU.openSync(t,\"r\"),NU.readSync(s,r,0,150,0),NU.closeSync(s)}catch{}return B5e(r.toString())}oee.exports=v5e});var fee=_((Lkt,uee)=>{\"use strict\";var S5e=Ie(\"path\"),lee=eee(),cee=tee(),D5e=aee(),b5e=process.platform===\"win32\",P5e=/\\.(?:com|exe)$/i,x5e=/node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;function k5e(t){t.file=lee(t);let e=t.file&&D5e(t.file);return e?(t.args.unshift(t.file),t.command=e,lee(t)):t.file}function Q5e(t){if(!b5e)return t;let e=k5e(t),r=!P5e.test(e);if(t.options.forceShell||r){let s=x5e.test(e);t.command=S5e.normalize(t.command),t.command=cee.command(t.command),t.args=t.args.map(n=>cee.argument(n,s));let a=[t.command].concat(t.args).join(\" \");t.args=[\"/d\",\"/s\",\"/c\",`\"${a}\"`],t.command=process.env.comspec||\"cmd.exe\",t.options.windowsVerbatimArguments=!0}return t}function T5e(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let s={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?s:Q5e(s)}uee.exports=T5e});var hee=_((Mkt,pee)=>{\"use strict\";var OU=process.platform===\"win32\";function LU(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:\"ENOENT\",errno:\"ENOENT\",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function R5e(t,e){if(!OU)return;let r=t.emit;t.emit=function(s,a){if(s===\"exit\"){let n=Aee(a,e);if(n)return r.call(t,\"error\",n)}return r.apply(t,arguments)}}function Aee(t,e){return OU&&t===1&&!e.file?LU(e.original,\"spawn\"):null}function F5e(t,e){return OU&&t===1&&!e.file?LU(e.original,\"spawnSync\"):null}pee.exports={hookChildProcess:R5e,verifyENOENT:Aee,verifyENOENTSync:F5e,notFoundError:LU}});var _U=_((Ukt,uE)=>{\"use strict\";var gee=Ie(\"child_process\"),MU=fee(),UU=hee();function dee(t,e,r){let s=MU(t,e,r),a=gee.spawn(s.command,s.args,s.options);return UU.hookChildProcess(a,s),a}function N5e(t,e,r){let s=MU(t,e,r),a=gee.spawnSync(s.command,s.args,s.options);return a.error=a.error||UU.verifyENOENTSync(a.status,s),a}uE.exports=dee;uE.exports.spawn=dee;uE.exports.sync=N5e;uE.exports._parse=MU;uE.exports._enoent=UU});var yee=_((_kt,mee)=>{\"use strict\";function O5e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Bd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Bd)}O5e(Bd,Error);Bd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function L5e(t,e){e=e!==void 0?e:{};var r={},s={Start:Wa},a=Wa,n=function(O){return O||[]},c=function(O,K,re){return[{command:O,type:K}].concat(re||[])},f=function(O,K){return[{command:O,type:K||\";\"}]},p=function(O){return O},h=\";\",E=ur(\";\",!1),C=\"&\",S=ur(\"&\",!1),P=function(O,K){return K?{chain:O,then:K}:{chain:O}},I=function(O,K){return{type:O,line:K}},R=\"&&\",N=ur(\"&&\",!1),U=\"||\",W=ur(\"||\",!1),ee=function(O,K){return K?{...O,then:K}:O},ie=function(O,K){return{type:O,chain:K}},ue=\"|&\",le=ur(\"|&\",!1),me=\"|\",pe=ur(\"|\",!1),Be=\"=\",Ce=ur(\"=\",!1),g=function(O,K){return{name:O,args:[K]}},we=function(O){return{name:O,args:[]}},ye=\"(\",Ae=ur(\"(\",!1),se=\")\",Z=ur(\")\",!1),De=function(O,K){return{type:\"subshell\",subshell:O,args:K}},Re=\"{\",mt=ur(\"{\",!1),j=\"}\",rt=ur(\"}\",!1),Fe=function(O,K){return{type:\"group\",group:O,args:K}},Ne=function(O,K){return{type:\"command\",args:K,envs:O}},Pe=function(O){return{type:\"envs\",envs:O}},Ve=function(O){return O},ke=function(O){return O},it=/^[0-9]/,Ue=zi([[\"0\",\"9\"]],!1,!1),x=function(O,K,re){return{type:\"redirection\",subtype:K,fd:O!==null?parseInt(O):null,args:[re]}},w=\">>\",b=ur(\">>\",!1),y=\">&\",F=ur(\">&\",!1),z=\">\",X=ur(\">\",!1),$=\"<<<\",oe=ur(\"<<<\",!1),xe=\"<&\",Te=ur(\"<&\",!1),lt=\"<\",Ct=ur(\"<\",!1),qt=function(O){return{type:\"argument\",segments:[].concat(...O)}},ir=function(O){return O},Pt=\"$'\",gn=ur(\"$'\",!1),Pr=\"'\",Ir=ur(\"'\",!1),Or=function(O){return[{type:\"text\",text:O}]},on='\"\"',ai=ur('\"\"',!1),Io=function(){return{type:\"text\",text:\"\"}},rs='\"',$s=ur('\"',!1),Co=function(O){return O},ji=function(O){return{type:\"arithmetic\",arithmetic:O,quoted:!0}},eo=function(O){return{type:\"shell\",shell:O,quoted:!0}},wo=function(O){return{type:\"variable\",...O,quoted:!0}},QA=function(O){return{type:\"text\",text:O}},Af=function(O){return{type:\"arithmetic\",arithmetic:O,quoted:!1}},dh=function(O){return{type:\"shell\",shell:O,quoted:!1}},mh=function(O){return{type:\"variable\",...O,quoted:!1}},to=function(O){return{type:\"glob\",pattern:O}},jn=/^[^']/,Ts=zi([\"'\"],!0,!1),ro=function(O){return O.join(\"\")},ou=/^[^$\"]/,au=zi([\"$\",'\"'],!0,!1),lu=`\\\\\n`,TA=ur(`\\\\\n`,!1),RA=function(){return\"\"},oa=\"\\\\\",aa=ur(\"\\\\\",!1),FA=/^[\\\\$\"`]/,gr=zi([\"\\\\\",\"$\",'\"',\"`\"],!1,!1),Bo=function(O){return O},Me=\"\\\\a\",cu=ur(\"\\\\a\",!1),Cr=function(){return\"a\"},pf=\"\\\\b\",NA=ur(\"\\\\b\",!1),OA=function(){return\"\\b\"},uu=/^[Ee]/,fu=zi([\"E\",\"e\"],!1,!1),oc=function(){return\"\\x1B\"},ve=\"\\\\f\",Nt=ur(\"\\\\f\",!1),ac=function(){return\"\\f\"},Oi=\"\\\\n\",no=ur(\"\\\\n\",!1),Rt=function(){return`\n`},xn=\"\\\\r\",la=ur(\"\\\\r\",!1),Gi=function(){return\"\\r\"},Li=\"\\\\t\",Na=ur(\"\\\\t\",!1),dn=function(){return\"\t\"},Kn=\"\\\\v\",Au=ur(\"\\\\v\",!1),yh=function(){return\"\\v\"},Oa=/^[\\\\'\"?]/,La=zi([\"\\\\\",\"'\",'\"',\"?\"],!1,!1),Ma=function(O){return String.fromCharCode(parseInt(O,16))},$e=\"\\\\x\",Ua=ur(\"\\\\x\",!1),hf=\"\\\\u\",lc=ur(\"\\\\u\",!1),wn=\"\\\\U\",ca=ur(\"\\\\U\",!1),LA=function(O){return String.fromCodePoint(parseInt(O,16))},MA=/^[0-7]/,ua=zi([[\"0\",\"7\"]],!1,!1),Bl=/^[0-9a-fA-f]/,Mt=zi([[\"0\",\"9\"],[\"a\",\"f\"],[\"A\",\"f\"]],!1,!1),kn=yf(),fa=\"{}\",Ha=ur(\"{}\",!1),ns=function(){return\"{}\"},cc=\"-\",pu=ur(\"-\",!1),uc=\"+\",ja=ur(\"+\",!1),Mi=\".\",Is=ur(\".\",!1),vl=function(O,K,re){return{type:\"number\",value:(O===\"-\"?-1:1)*parseFloat(K.join(\"\")+\".\"+re.join(\"\"))}},gf=function(O,K){return{type:\"number\",value:(O===\"-\"?-1:1)*parseInt(K.join(\"\"))}},fc=function(O){return{type:\"variable\",...O}},wi=function(O){return{type:\"variable\",name:O}},Qn=function(O){return O},Ac=\"*\",Ke=ur(\"*\",!1),st=\"/\",St=ur(\"/\",!1),lr=function(O,K,re){return{type:K===\"*\"?\"multiplication\":\"division\",right:re}},te=function(O,K){return K.reduce((re,de)=>({left:re,...de}),O)},Ee=function(O,K,re){return{type:K===\"+\"?\"addition\":\"subtraction\",right:re}},Oe=\"$((\",dt=ur(\"$((\",!1),Et=\"))\",bt=ur(\"))\",!1),tr=function(O){return O},An=\"$(\",li=ur(\"$(\",!1),qi=function(O){return O},Tn=\"${\",Ga=ur(\"${\",!1),my=\":-\",Z1=ur(\":-\",!1),vo=function(O,K){return{name:O,defaultValue:K}},yy=\":-}\",Eh=ur(\":-}\",!1),$1=function(O){return{name:O,defaultValue:[]}},So=\":+\",Ih=ur(\":+\",!1),Ch=function(O,K){return{name:O,alternativeValue:K}},hu=\":+}\",wh=ur(\":+}\",!1),Fg=function(O){return{name:O,alternativeValue:[]}},Ng=function(O){return{name:O}},Og=\"$\",Ey=ur(\"$\",!1),df=function(O){return e.isGlobPattern(O)},Do=function(O){return O},Sl=/^[a-zA-Z0-9_]/,Bh=zi([[\"a\",\"z\"],[\"A\",\"Z\"],[\"0\",\"9\"],\"_\"],!1,!1),Lg=function(){return By()},Dl=/^[$@*?#a-zA-Z0-9_\\-]/,bl=zi([\"$\",\"@\",\"*\",\"?\",\"#\",[\"a\",\"z\"],[\"A\",\"Z\"],[\"0\",\"9\"],\"_\",\"-\"],!1,!1),Iy=/^[()}<>$|&; \\t\"']/,UA=zi([\"(\",\")\",\"}\",\"<\",\">\",\"$\",\"|\",\"&\",\";\",\" \",\"\t\",'\"',\"'\"],!1,!1),Cy=/^[<>&; \\t\"']/,wy=zi([\"<\",\">\",\"&\",\";\",\" \",\"\t\",'\"',\"'\"],!1,!1),_A=/^[ \\t]/,HA=zi([\" \",\"\t\"],!1,!1),Y=0,xt=0,jA=[{line:1,column:1}],bo=0,mf=[],yt=0,gu;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function By(){return t.substring(xt,Y)}function Mg(){return Ef(xt,Y)}function e2(O,K){throw K=K!==void 0?K:Ef(xt,Y),GA([Ug(O)],t.substring(xt,Y),K)}function vh(O,K){throw K=K!==void 0?K:Ef(xt,Y),di(O,K)}function ur(O,K){return{type:\"literal\",text:O,ignoreCase:K}}function zi(O,K,re){return{type:\"class\",parts:O,inverted:K,ignoreCase:re}}function yf(){return{type:\"any\"}}function qa(){return{type:\"end\"}}function Ug(O){return{type:\"other\",description:O}}function du(O){var K=jA[O],re;if(K)return K;for(re=O-1;!jA[re];)re--;for(K=jA[re],K={line:K.line,column:K.column};re<O;)t.charCodeAt(re)===10?(K.line++,K.column=1):K.column++,re++;return jA[O]=K,K}function Ef(O,K){var re=du(O),de=du(K);return{start:{offset:O,line:re.line,column:re.column},end:{offset:K,line:de.line,column:de.column}}}function wt(O){Y<bo||(Y>bo&&(bo=Y,mf=[]),mf.push(O))}function di(O,K){return new Bd(O,null,null,K)}function GA(O,K,re){return new Bd(Bd.buildMessage(O,K),O,K,re)}function Wa(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(re=Aa(),re===r&&(re=null),re!==r?(xt=O,K=n(re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Aa(){var O,K,re,de,Je;if(O=Y,K=Sh(),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=_g(),de!==r?(Je=Ya(),Je===r&&(Je=null),Je!==r?(xt=O,K=c(K,de,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;if(O===r)if(O=Y,K=Sh(),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=_g(),de===r&&(de=null),de!==r?(xt=O,K=f(K,de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;return O}function Ya(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=Aa(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=p(re),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;return O}function _g(){var O;return t.charCodeAt(Y)===59?(O=h,Y++):(O=r,yt===0&&wt(E)),O===r&&(t.charCodeAt(Y)===38?(O=C,Y++):(O=r,yt===0&&wt(S))),O}function Sh(){var O,K,re;return O=Y,K=qA(),K!==r?(re=Hg(),re===r&&(re=null),re!==r?(xt=O,K=P(K,re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Hg(){var O,K,re,de,Je,At,dr;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=vy(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Sh(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=I(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;return O}function vy(){var O;return t.substr(Y,2)===R?(O=R,Y+=2):(O=r,yt===0&&wt(N)),O===r&&(t.substr(Y,2)===U?(O=U,Y+=2):(O=r,yt===0&&wt(W))),O}function qA(){var O,K,re;return O=Y,K=If(),K!==r?(re=jg(),re===r&&(re=null),re!==r?(xt=O,K=ee(K,re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function jg(){var O,K,re,de,Je,At,dr;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=mu(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=qA(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=ie(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;return O}function mu(){var O;return t.substr(Y,2)===ue?(O=ue,Y+=2):(O=r,yt===0&&wt(le)),O===r&&(t.charCodeAt(Y)===124?(O=me,Y++):(O=r,yt===0&&wt(pe))),O}function yu(){var O,K,re,de,Je,At;if(O=Y,K=Ph(),K!==r)if(t.charCodeAt(Y)===61?(re=Be,Y++):(re=r,yt===0&&wt(Ce)),re!==r)if(de=WA(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(xt=O,K=g(K,de),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;else Y=O,O=r;if(O===r)if(O=Y,K=Ph(),K!==r)if(t.charCodeAt(Y)===61?(re=Be,Y++):(re=r,yt===0&&wt(Ce)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=we(K),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;return O}function If(){var O,K,re,de,Je,At,dr,vr,Un,mi,Cs;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(t.charCodeAt(Y)===40?(re=ye,Y++):(re=r,yt===0&&wt(Ae)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Aa(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();if(At!==r)if(t.charCodeAt(Y)===41?(dr=se,Y++):(dr=r,yt===0&&wt(Z)),dr!==r){for(vr=[],Un=kt();Un!==r;)vr.push(Un),Un=kt();if(vr!==r){for(Un=[],mi=Gn();mi!==r;)Un.push(mi),mi=Gn();if(Un!==r){for(mi=[],Cs=kt();Cs!==r;)mi.push(Cs),Cs=kt();mi!==r?(xt=O,K=De(Je,Un),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(t.charCodeAt(Y)===123?(re=Re,Y++):(re=r,yt===0&&wt(mt)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Aa(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();if(At!==r)if(t.charCodeAt(Y)===125?(dr=j,Y++):(dr=r,yt===0&&wt(rt)),dr!==r){for(vr=[],Un=kt();Un!==r;)vr.push(Un),Un=kt();if(vr!==r){for(Un=[],mi=Gn();mi!==r;)Un.push(mi),mi=Gn();if(Un!==r){for(mi=[],Cs=kt();Cs!==r;)mi.push(Cs),Cs=kt();mi!==r?(xt=O,K=Fe(Je,Un),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){for(re=[],de=yu();de!==r;)re.push(de),de=yu();if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r){if(Je=[],At=Eu(),At!==r)for(;At!==r;)Je.push(At),At=Eu();else Je=r;if(Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=Ne(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){if(re=[],de=yu(),de!==r)for(;de!==r;)re.push(de),de=yu();else re=r;if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=Pe(re),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}}}return O}function Rs(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){if(re=[],de=Pi(),de!==r)for(;de!==r;)re.push(de),de=Pi();else re=r;if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=Ve(re),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r;return O}function Eu(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r?(re=Gn(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();K!==r?(re=Pi(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r)}return O}function Gn(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(it.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ue)),re===r&&(re=null),re!==r?(de=is(),de!==r?(Je=Pi(),Je!==r?(xt=O,K=x(re,de,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function is(){var O;return t.substr(Y,2)===w?(O=w,Y+=2):(O=r,yt===0&&wt(b)),O===r&&(t.substr(Y,2)===y?(O=y,Y+=2):(O=r,yt===0&&wt(F)),O===r&&(t.charCodeAt(Y)===62?(O=z,Y++):(O=r,yt===0&&wt(X)),O===r&&(t.substr(Y,3)===$?(O=$,Y+=3):(O=r,yt===0&&wt(oe)),O===r&&(t.substr(Y,2)===xe?(O=xe,Y+=2):(O=r,yt===0&&wt(Te)),O===r&&(t.charCodeAt(Y)===60?(O=lt,Y++):(O=r,yt===0&&wt(Ct))))))),O}function Pi(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(re=WA(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function WA(){var O,K,re;if(O=Y,K=[],re=Cf(),re!==r)for(;re!==r;)K.push(re),re=Cf();else K=r;return K!==r&&(xt=O,K=qt(K)),O=K,O}function Cf(){var O,K;return O=Y,K=mn(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=Gg(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=qg(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=ss(),K!==r&&(xt=O,K=ir(K)),O=K))),O}function mn(){var O,K,re,de;return O=Y,t.substr(Y,2)===Pt?(K=Pt,Y+=2):(K=r,yt===0&&wt(gn)),K!==r?(re=yn(),re!==r?(t.charCodeAt(Y)===39?(de=Pr,Y++):(de=r,yt===0&&wt(Ir)),de!==r?(xt=O,K=Or(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function Gg(){var O,K,re,de;return O=Y,t.charCodeAt(Y)===39?(K=Pr,Y++):(K=r,yt===0&&wt(Ir)),K!==r?(re=wf(),re!==r?(t.charCodeAt(Y)===39?(de=Pr,Y++):(de=r,yt===0&&wt(Ir)),de!==r?(xt=O,K=Or(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function qg(){var O,K,re,de;if(O=Y,t.substr(Y,2)===on?(K=on,Y+=2):(K=r,yt===0&&wt(ai)),K!==r&&(xt=O,K=Io()),O=K,O===r)if(O=Y,t.charCodeAt(Y)===34?(K=rs,Y++):(K=r,yt===0&&wt($s)),K!==r){for(re=[],de=Pl();de!==r;)re.push(de),de=Pl();re!==r?(t.charCodeAt(Y)===34?(de=rs,Y++):(de=r,yt===0&&wt($s)),de!==r?(xt=O,K=Co(re),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;return O}function ss(){var O,K,re;if(O=Y,K=[],re=Po(),re!==r)for(;re!==r;)K.push(re),re=Po();else K=r;return K!==r&&(xt=O,K=Co(K)),O=K,O}function Pl(){var O,K;return O=Y,K=Zr(),K!==r&&(xt=O,K=ji(K)),O=K,O===r&&(O=Y,K=bh(),K!==r&&(xt=O,K=eo(K)),O=K,O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=wo(K)),O=K,O===r&&(O=Y,K=Bf(),K!==r&&(xt=O,K=QA(K)),O=K))),O}function Po(){var O,K;return O=Y,K=Zr(),K!==r&&(xt=O,K=Af(K)),O=K,O===r&&(O=Y,K=bh(),K!==r&&(xt=O,K=dh(K)),O=K,O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=mh(K)),O=K,O===r&&(O=Y,K=Sy(),K!==r&&(xt=O,K=to(K)),O=K,O===r&&(O=Y,K=Dh(),K!==r&&(xt=O,K=QA(K)),O=K)))),O}function wf(){var O,K,re;for(O=Y,K=[],jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ts));re!==r;)K.push(re),jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ts));return K!==r&&(xt=O,K=ro(K)),O=K,O}function Bf(){var O,K,re;if(O=Y,K=[],re=xl(),re===r&&(ou.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(au))),re!==r)for(;re!==r;)K.push(re),re=xl(),re===r&&(ou.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(au)));else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function xl(){var O,K,re;return O=Y,t.substr(Y,2)===lu?(K=lu,Y+=2):(K=r,yt===0&&wt(TA)),K!==r&&(xt=O,K=RA()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(FA.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(gr)),re!==r?(xt=O,K=Bo(re),O=K):(Y=O,O=r)):(Y=O,O=r)),O}function yn(){var O,K,re;for(O=Y,K=[],re=xo(),re===r&&(jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ts)));re!==r;)K.push(re),re=xo(),re===r&&(jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ts)));return K!==r&&(xt=O,K=ro(K)),O=K,O}function xo(){var O,K,re;return O=Y,t.substr(Y,2)===Me?(K=Me,Y+=2):(K=r,yt===0&&wt(cu)),K!==r&&(xt=O,K=Cr()),O=K,O===r&&(O=Y,t.substr(Y,2)===pf?(K=pf,Y+=2):(K=r,yt===0&&wt(NA)),K!==r&&(xt=O,K=OA()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(uu.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(fu)),re!==r?(xt=O,K=oc(),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===ve?(K=ve,Y+=2):(K=r,yt===0&&wt(Nt)),K!==r&&(xt=O,K=ac()),O=K,O===r&&(O=Y,t.substr(Y,2)===Oi?(K=Oi,Y+=2):(K=r,yt===0&&wt(no)),K!==r&&(xt=O,K=Rt()),O=K,O===r&&(O=Y,t.substr(Y,2)===xn?(K=xn,Y+=2):(K=r,yt===0&&wt(la)),K!==r&&(xt=O,K=Gi()),O=K,O===r&&(O=Y,t.substr(Y,2)===Li?(K=Li,Y+=2):(K=r,yt===0&&wt(Na)),K!==r&&(xt=O,K=dn()),O=K,O===r&&(O=Y,t.substr(Y,2)===Kn?(K=Kn,Y+=2):(K=r,yt===0&&wt(Au)),K!==r&&(xt=O,K=yh()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(Oa.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(La)),re!==r?(xt=O,K=Bo(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Iu()))))))))),O}function Iu(){var O,K,re,de,Je,At,dr,vr,Un,mi,Cs,JA;return O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(re=pa(),re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===$e?(K=$e,Y+=2):(K=r,yt===0&&wt(Ua)),K!==r?(re=Y,de=Y,Je=pa(),Je!==r?(At=Fs(),At!==r?(Je=[Je,At],de=Je):(Y=de,de=r)):(Y=de,de=r),de===r&&(de=pa()),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===hf?(K=hf,Y+=2):(K=r,yt===0&&wt(lc)),K!==r?(re=Y,de=Y,Je=Fs(),Je!==r?(At=Fs(),At!==r?(dr=Fs(),dr!==r?(vr=Fs(),vr!==r?(Je=[Je,At,dr,vr],de=Je):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===wn?(K=wn,Y+=2):(K=r,yt===0&&wt(ca)),K!==r?(re=Y,de=Y,Je=Fs(),Je!==r?(At=Fs(),At!==r?(dr=Fs(),dr!==r?(vr=Fs(),vr!==r?(Un=Fs(),Un!==r?(mi=Fs(),mi!==r?(Cs=Fs(),Cs!==r?(JA=Fs(),JA!==r?(Je=[Je,At,dr,vr,Un,mi,Cs,JA],de=Je):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=LA(re),O=K):(Y=O,O=r)):(Y=O,O=r)))),O}function pa(){var O;return MA.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(ua)),O}function Fs(){var O;return Bl.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(Mt)),O}function Dh(){var O,K,re,de,Je;if(O=Y,K=[],re=Y,t.charCodeAt(Y)===92?(de=oa,Y++):(de=r,yt===0&&wt(aa)),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re===r&&(re=Y,t.substr(Y,2)===fa?(de=fa,Y+=2):(de=r,yt===0&&wt(Ha)),de!==r&&(xt=re,de=ns()),re=de,re===r&&(re=Y,de=Y,yt++,Je=Dy(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r))),re!==r)for(;re!==r;)K.push(re),re=Y,t.charCodeAt(Y)===92?(de=oa,Y++):(de=r,yt===0&&wt(aa)),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re===r&&(re=Y,t.substr(Y,2)===fa?(de=fa,Y+=2):(de=r,yt===0&&wt(Ha)),de!==r&&(xt=re,de=ns()),re=de,re===r&&(re=Y,de=Y,yt++,Je=Dy(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r)));else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function YA(){var O,K,re,de,Je,At;if(O=Y,t.charCodeAt(Y)===45?(K=cc,Y++):(K=r,yt===0&&wt(pu)),K===r&&(t.charCodeAt(Y)===43?(K=uc,Y++):(K=r,yt===0&&wt(ja))),K===r&&(K=null),K!==r){if(re=[],it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue)),de!==r)for(;de!==r;)re.push(de),it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue));else re=r;if(re!==r)if(t.charCodeAt(Y)===46?(de=Mi,Y++):(de=r,yt===0&&wt(Is)),de!==r){if(Je=[],it.test(t.charAt(Y))?(At=t.charAt(Y),Y++):(At=r,yt===0&&wt(Ue)),At!==r)for(;At!==r;)Je.push(At),it.test(t.charAt(Y))?(At=t.charAt(Y),Y++):(At=r,yt===0&&wt(Ue));else Je=r;Je!==r?(xt=O,K=vl(K,re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;if(O===r){if(O=Y,t.charCodeAt(Y)===45?(K=cc,Y++):(K=r,yt===0&&wt(pu)),K===r&&(t.charCodeAt(Y)===43?(K=uc,Y++):(K=r,yt===0&&wt(ja))),K===r&&(K=null),K!==r){if(re=[],it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue)),de!==r)for(;de!==r;)re.push(de),it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue));else re=r;re!==r?(xt=O,K=gf(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;if(O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=fc(K)),O=K,O===r&&(O=Y,K=pc(),K!==r&&(xt=O,K=wi(K)),O=K,O===r)))if(O=Y,t.charCodeAt(Y)===40?(K=ye,Y++):(K=r,yt===0&&wt(Ae)),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();if(re!==r)if(de=io(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(t.charCodeAt(Y)===41?(At=se,Y++):(At=r,yt===0&&wt(Z)),At!==r?(xt=O,K=Qn(de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r}return O}function vf(){var O,K,re,de,Je,At,dr,vr;if(O=Y,K=YA(),K!==r){for(re=[],de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===42?(At=Ac,Y++):(At=r,yt===0&&wt(Ke)),At===r&&(t.charCodeAt(Y)===47?(At=st,Y++):(At=r,yt===0&&wt(St))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=YA(),vr!==r?(xt=de,Je=lr(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r;for(;de!==r;){for(re.push(de),de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===42?(At=Ac,Y++):(At=r,yt===0&&wt(Ke)),At===r&&(t.charCodeAt(Y)===47?(At=st,Y++):(At=r,yt===0&&wt(St))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=YA(),vr!==r?(xt=de,Je=lr(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r}re!==r?(xt=O,K=te(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;return O}function io(){var O,K,re,de,Je,At,dr,vr;if(O=Y,K=vf(),K!==r){for(re=[],de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===43?(At=uc,Y++):(At=r,yt===0&&wt(ja)),At===r&&(t.charCodeAt(Y)===45?(At=cc,Y++):(At=r,yt===0&&wt(pu))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=vf(),vr!==r?(xt=de,Je=Ee(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r;for(;de!==r;){for(re.push(de),de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===43?(At=uc,Y++):(At=r,yt===0&&wt(ja)),At===r&&(t.charCodeAt(Y)===45?(At=cc,Y++):(At=r,yt===0&&wt(pu))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=vf(),vr!==r?(xt=de,Je=Ee(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r}re!==r?(xt=O,K=te(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;return O}function Zr(){var O,K,re,de,Je,At;if(O=Y,t.substr(Y,3)===Oe?(K=Oe,Y+=3):(K=r,yt===0&&wt(dt)),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();if(re!==r)if(de=io(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(t.substr(Y,2)===Et?(At=Et,Y+=2):(At=r,yt===0&&wt(bt)),At!==r?(xt=O,K=tr(de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;return O}function bh(){var O,K,re,de;return O=Y,t.substr(Y,2)===An?(K=An,Y+=2):(K=r,yt===0&&wt(li)),K!==r?(re=Aa(),re!==r?(t.charCodeAt(Y)===41?(de=se,Y++):(de=r,yt===0&&wt(Z)),de!==r?(xt=O,K=qi(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function VA(){var O,K,re,de,Je,At;return O=Y,t.substr(Y,2)===Tn?(K=Tn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,2)===my?(de=my,Y+=2):(de=r,yt===0&&wt(Z1)),de!==r?(Je=Rs(),Je!==r?(t.charCodeAt(Y)===125?(At=j,Y++):(At=r,yt===0&&wt(rt)),At!==r?(xt=O,K=vo(re,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Tn?(K=Tn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,3)===yy?(de=yy,Y+=3):(de=r,yt===0&&wt(Eh)),de!==r?(xt=O,K=$1(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Tn?(K=Tn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,2)===So?(de=So,Y+=2):(de=r,yt===0&&wt(Ih)),de!==r?(Je=Rs(),Je!==r?(t.charCodeAt(Y)===125?(At=j,Y++):(At=r,yt===0&&wt(rt)),At!==r?(xt=O,K=Ch(re,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Tn?(K=Tn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,3)===hu?(de=hu,Y+=3):(de=r,yt===0&&wt(wh)),de!==r?(xt=O,K=Fg(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Tn?(K=Tn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.charCodeAt(Y)===125?(de=j,Y++):(de=r,yt===0&&wt(rt)),de!==r?(xt=O,K=Ng(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.charCodeAt(Y)===36?(K=Og,Y++):(K=r,yt===0&&wt(Ey)),K!==r?(re=pc(),re!==r?(xt=O,K=Ng(re),O=K):(Y=O,O=r)):(Y=O,O=r)))))),O}function Sy(){var O,K,re;return O=Y,K=Wg(),K!==r?(xt=Y,re=df(K),re?re=void 0:re=r,re!==r?(xt=O,K=Do(K),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Wg(){var O,K,re,de,Je;if(O=Y,K=[],re=Y,de=Y,yt++,Je=xh(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re!==r)for(;re!==r;)K.push(re),re=Y,de=Y,yt++,Je=xh(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r);else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function Ph(){var O,K,re;if(O=Y,K=[],Sl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Bh)),re!==r)for(;re!==r;)K.push(re),Sl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Bh));else K=r;return K!==r&&(xt=O,K=Lg()),O=K,O}function pc(){var O,K,re;if(O=Y,K=[],Dl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(bl)),re!==r)for(;re!==r;)K.push(re),Dl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(bl));else K=r;return K!==r&&(xt=O,K=Lg()),O=K,O}function Dy(){var O;return Iy.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(UA)),O}function xh(){var O;return Cy.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(wy)),O}function kt(){var O,K;if(O=[],_A.test(t.charAt(Y))?(K=t.charAt(Y),Y++):(K=r,yt===0&&wt(HA)),K!==r)for(;K!==r;)O.push(K),_A.test(t.charAt(Y))?(K=t.charAt(Y),Y++):(K=r,yt===0&&wt(HA));else O=r;return O}if(gu=a(),gu!==r&&Y===t.length)return gu;throw gu!==r&&Y<t.length&&wt(qa()),GA(mf,bo<t.length?t.charAt(bo):null,bo<t.length?Ef(bo,bo+1):Ef(bo,bo))}mee.exports={SyntaxError:Bd,parse:L5e}});function ux(t,e={isGlobPattern:()=>!1}){try{return(0,Eee.parse)(t,e)}catch(r){throw r.location&&(r.message=r.message.replace(/(\\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function fE(t,{endSemicolon:e=!1}={}){return t.map(({command:r,type:s},a)=>`${fx(r)}${s===\";\"?a!==t.length-1||e?\";\":\"\":\" &\"}`).join(\" \")}function fx(t){return`${AE(t.chain)}${t.then?` ${HU(t.then)}`:\"\"}`}function HU(t){return`${t.type} ${fx(t.line)}`}function AE(t){return`${GU(t)}${t.then?` ${jU(t.then)}`:\"\"}`}function jU(t){return`${t.type} ${AE(t.chain)}`}function GU(t){switch(t.type){case\"command\":return`${t.envs.length>0?`${t.envs.map(e=>cx(e)).join(\" \")} `:\"\"}${t.args.map(e=>qU(e)).join(\" \")}`;case\"subshell\":return`(${fE(t.subshell)})${t.args.length>0?` ${t.args.map(e=>H2(e)).join(\" \")}`:\"\"}`;case\"group\":return`{ ${fE(t.group,{endSemicolon:!0})} }${t.args.length>0?` ${t.args.map(e=>H2(e)).join(\" \")}`:\"\"}`;case\"envs\":return t.envs.map(e=>cx(e)).join(\" \");default:throw new Error(`Unsupported command type:  \"${t.type}\"`)}}function cx(t){return`${t.name}=${t.args[0]?vd(t.args[0]):\"\"}`}function qU(t){switch(t.type){case\"redirection\":return H2(t);case\"argument\":return vd(t);default:throw new Error(`Unsupported argument type: \"${t.type}\"`)}}function H2(t){return`${t.subtype} ${t.args.map(e=>vd(e)).join(\" \")}`}function vd(t){return t.segments.map(e=>WU(e)).join(\"\")}function WU(t){let e=(s,a)=>a?`\"${s}\"`:s,r=s=>s===\"\"?\"''\":s.match(/[()}<>$|&;\"'\\n\\t ]/)?s.match(/['\\t\\p{C}]/u)?s.match(/'/)?`\"${s.replace(/[\"$\\t\\p{C}]/u,U5e)}\"`:`$'${s.replace(/[\\t\\p{C}]/u,Cee)}'`:`'${s}'`:s;switch(t.type){case\"text\":return r(t.text);case\"glob\":return t.pattern;case\"shell\":return e(`$(${fE(t.shell)})`,t.quoted);case\"variable\":return e(typeof t.defaultValue>\"u\"?typeof t.alternativeValue>\"u\"?`\\${${t.name}}`:t.alternativeValue.length===0?`\\${${t.name}:+}`:`\\${${t.name}:+${t.alternativeValue.map(s=>vd(s)).join(\" \")}}`:t.defaultValue.length===0?`\\${${t.name}:-}`:`\\${${t.name}:-${t.defaultValue.map(s=>vd(s)).join(\" \")}}`,t.quoted);case\"arithmetic\":return`$(( ${Ax(t.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: \"${t.type}\"`)}}function Ax(t){let e=a=>{switch(a){case\"addition\":return\"+\";case\"subtraction\":return\"-\";case\"multiplication\":return\"*\";case\"division\":return\"/\";default:throw new Error(`Can't extract operator from arithmetic expression of type \"${a}\"`)}},r=(a,n)=>n?`( ${a} )`:a,s=a=>r(Ax(a),![\"number\",\"variable\"].includes(a.type));switch(t.type){case\"number\":return String(t.value);case\"variable\":return t.name;default:return`${s(t.left)} ${e(t.type)} ${s(t.right)}`}}var Eee,Iee,M5e,Cee,U5e,wee=Xe(()=>{Eee=ut(yee());Iee=new Map([[\"\\f\",\"\\\\f\"],[`\n`,\"\\\\n\"],[\"\\r\",\"\\\\r\"],[\"\t\",\"\\\\t\"],[\"\\v\",\"\\\\v\"],[\"\\0\",\"\\\\0\"]]),M5e=new Map([[\"\\\\\",\"\\\\\\\\\"],[\"$\",\"\\\\$\"],['\"','\\\\\"'],...Array.from(Iee,([t,e])=>[t,`\"$'${e}'\"`])]),Cee=t=>Iee.get(t)??`\\\\x${t.charCodeAt(0).toString(16).padStart(2,\"0\")}`,U5e=t=>M5e.get(t)??`\"$'${Cee(t)}'\"`});var vee=_((eQt,Bee)=>{\"use strict\";function _5e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Sd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Sd)}_5e(Sd,Error);Sd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function H5e(t,e){e=e!==void 0?e:{};var r={},s={resolution:Ne},a=Ne,n=\"/\",c=ye(\"/\",!1),f=function(Ue,x){return{from:Ue,descriptor:x}},p=function(Ue){return{descriptor:Ue}},h=\"@\",E=ye(\"@\",!1),C=function(Ue,x){return{fullName:Ue,description:x}},S=function(Ue){return{fullName:Ue}},P=function(){return Be()},I=/^[^\\/@]/,R=Ae([\"/\",\"@\"],!0,!1),N=/^[^\\/]/,U=Ae([\"/\"],!0,!1),W=0,ee=0,ie=[{line:1,column:1}],ue=0,le=[],me=0,pe;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function Be(){return t.substring(ee,W)}function Ce(){return mt(ee,W)}function g(Ue,x){throw x=x!==void 0?x:mt(ee,W),Fe([De(Ue)],t.substring(ee,W),x)}function we(Ue,x){throw x=x!==void 0?x:mt(ee,W),rt(Ue,x)}function ye(Ue,x){return{type:\"literal\",text:Ue,ignoreCase:x}}function Ae(Ue,x,w){return{type:\"class\",parts:Ue,inverted:x,ignoreCase:w}}function se(){return{type:\"any\"}}function Z(){return{type:\"end\"}}function De(Ue){return{type:\"other\",description:Ue}}function Re(Ue){var x=ie[Ue],w;if(x)return x;for(w=Ue-1;!ie[w];)w--;for(x=ie[w],x={line:x.line,column:x.column};w<Ue;)t.charCodeAt(w)===10?(x.line++,x.column=1):x.column++,w++;return ie[Ue]=x,x}function mt(Ue,x){var w=Re(Ue),b=Re(x);return{start:{offset:Ue,line:w.line,column:w.column},end:{offset:x,line:b.line,column:b.column}}}function j(Ue){W<ue||(W>ue&&(ue=W,le=[]),le.push(Ue))}function rt(Ue,x){return new Sd(Ue,null,null,x)}function Fe(Ue,x,w){return new Sd(Sd.buildMessage(Ue,x),Ue,x,w)}function Ne(){var Ue,x,w,b;return Ue=W,x=Pe(),x!==r?(t.charCodeAt(W)===47?(w=n,W++):(w=r,me===0&&j(c)),w!==r?(b=Pe(),b!==r?(ee=Ue,x=f(x,b),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=Pe(),x!==r&&(ee=Ue,x=p(x)),Ue=x),Ue}function Pe(){var Ue,x,w,b;return Ue=W,x=Ve(),x!==r?(t.charCodeAt(W)===64?(w=h,W++):(w=r,me===0&&j(E)),w!==r?(b=it(),b!==r?(ee=Ue,x=C(x,b),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=Ve(),x!==r&&(ee=Ue,x=S(x)),Ue=x),Ue}function Ve(){var Ue,x,w,b,y;return Ue=W,t.charCodeAt(W)===64?(x=h,W++):(x=r,me===0&&j(E)),x!==r?(w=ke(),w!==r?(t.charCodeAt(W)===47?(b=n,W++):(b=r,me===0&&j(c)),b!==r?(y=ke(),y!==r?(ee=Ue,x=P(),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=ke(),x!==r&&(ee=Ue,x=P()),Ue=x),Ue}function ke(){var Ue,x,w;if(Ue=W,x=[],I.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(R)),w!==r)for(;w!==r;)x.push(w),I.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(R));else x=r;return x!==r&&(ee=Ue,x=P()),Ue=x,Ue}function it(){var Ue,x,w;if(Ue=W,x=[],N.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(U)),w!==r)for(;w!==r;)x.push(w),N.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(U));else x=r;return x!==r&&(ee=Ue,x=P()),Ue=x,Ue}if(pe=a(),pe!==r&&W===t.length)return pe;throw pe!==r&&W<t.length&&j(Z()),Fe(le,ue<t.length?t.charAt(ue):null,ue<t.length?mt(ue,ue+1):mt(ue,ue))}Bee.exports={SyntaxError:Sd,parse:H5e}});function px(t){let e=t.match(/^\\*{1,2}\\/(.*)/);if(e)throw new Error(`The override for '${t}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${e[1]}' instead.`);try{return(0,See.parse)(t)}catch(r){throw r.location&&(r.message=r.message.replace(/(\\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function hx(t){let e=\"\";return t.from&&(e+=t.from.fullName,t.from.description&&(e+=`@${t.from.description}`),e+=\"/\"),e+=t.descriptor.fullName,t.descriptor.description&&(e+=`@${t.descriptor.description}`),e}var See,Dee=Xe(()=>{See=ut(vee())});var bd=_((rQt,Dd)=>{\"use strict\";function bee(t){return typeof t>\"u\"||t===null}function j5e(t){return typeof t==\"object\"&&t!==null}function G5e(t){return Array.isArray(t)?t:bee(t)?[]:[t]}function q5e(t,e){var r,s,a,n;if(e)for(n=Object.keys(e),r=0,s=n.length;r<s;r+=1)a=n[r],t[a]=e[a];return t}function W5e(t,e){var r=\"\",s;for(s=0;s<e;s+=1)r+=t;return r}function Y5e(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}Dd.exports.isNothing=bee;Dd.exports.isObject=j5e;Dd.exports.toArray=G5e;Dd.exports.repeat=W5e;Dd.exports.isNegativeZero=Y5e;Dd.exports.extend=q5e});var pE=_((nQt,Pee)=>{\"use strict\";function j2(t,e){Error.call(this),this.name=\"YAMLException\",this.reason=t,this.mark=e,this.message=(this.reason||\"(unknown reason)\")+(this.mark?\" \"+this.mark.toString():\"\"),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||\"\"}j2.prototype=Object.create(Error.prototype);j2.prototype.constructor=j2;j2.prototype.toString=function(e){var r=this.name+\": \";return r+=this.reason||\"(unknown reason)\",!e&&this.mark&&(r+=\" \"+this.mark.toString()),r};Pee.exports=j2});var Qee=_((iQt,kee)=>{\"use strict\";var xee=bd();function YU(t,e,r,s,a){this.name=t,this.buffer=e,this.position=r,this.line=s,this.column=a}YU.prototype.getSnippet=function(e,r){var s,a,n,c,f;if(!this.buffer)return null;for(e=e||4,r=r||75,s=\"\",a=this.position;a>0&&`\\0\\r\n\\x85\\u2028\\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){s=\" ... \",a+=5;break}for(n=\"\",c=this.position;c<this.buffer.length&&`\\0\\r\n\\x85\\u2028\\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=\" ... \",c-=5;break}return f=this.buffer.slice(a,c),xee.repeat(\" \",e)+s+f+n+`\n`+xee.repeat(\" \",e+this.position-a+s.length)+\"^\"};YU.prototype.toString=function(e){var r,s=\"\";return this.name&&(s+='in \"'+this.name+'\" '),s+=\"at line \"+(this.line+1)+\", column \"+(this.column+1),e||(r=this.getSnippet(),r&&(s+=`:\n`+r)),s};kee.exports=YU});var Ss=_((sQt,Ree)=>{\"use strict\";var Tee=pE(),V5e=[\"kind\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"defaultStyle\",\"styleAliases\"],J5e=[\"scalar\",\"sequence\",\"mapping\"];function K5e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(s){e[String(s)]=r})}),e}function z5e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(V5e.indexOf(r)===-1)throw new Tee('Unknown option \"'+r+'\" is met in definition of \"'+t+'\" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=K5e(e.styleAliases||null),J5e.indexOf(this.kind)===-1)throw new Tee('Unknown kind \"'+this.kind+'\" is specified for \"'+t+'\" YAML type.')}Ree.exports=z5e});var Pd=_((oQt,Nee)=>{\"use strict\";var Fee=bd(),gx=pE(),X5e=Ss();function VU(t,e,r){var s=[];return t.include.forEach(function(a){r=VU(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&s.push(c)}),r.push(a)}),r.filter(function(a,n){return s.indexOf(n)===-1})}function Z5e(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function s(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(s);return t}function hE(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!==\"scalar\")throw new gx(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\")}),this.compiledImplicit=VU(this,\"implicit\",[]),this.compiledExplicit=VU(this,\"explicit\",[]),this.compiledTypeMap=Z5e(this.compiledImplicit,this.compiledExplicit)}hE.DEFAULT=null;hE.create=function(){var e,r;switch(arguments.length){case 1:e=hE.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new gx(\"Wrong number of arguments for Schema.create function\")}if(e=Fee.toArray(e),r=Fee.toArray(r),!e.every(function(s){return s instanceof hE}))throw new gx(\"Specified list of super schemas (or a single Schema object) contains a non-Schema object.\");if(!r.every(function(s){return s instanceof X5e}))throw new gx(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");return new hE({include:e,explicit:r})};Nee.exports=hE});var Lee=_((aQt,Oee)=>{\"use strict\";var $5e=Ss();Oee.exports=new $5e(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(t){return t!==null?t:\"\"}})});var Uee=_((lQt,Mee)=>{\"use strict\";var eqe=Ss();Mee.exports=new eqe(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(t){return t!==null?t:[]}})});var Hee=_((cQt,_ee)=>{\"use strict\";var tqe=Ss();_ee.exports=new tqe(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(t){return t!==null?t:{}}})});var dx=_((uQt,jee)=>{\"use strict\";var rqe=Pd();jee.exports=new rqe({explicit:[Lee(),Uee(),Hee()]})});var qee=_((fQt,Gee)=>{\"use strict\";var nqe=Ss();function iqe(t){if(t===null)return!0;var e=t.length;return e===1&&t===\"~\"||e===4&&(t===\"null\"||t===\"Null\"||t===\"NULL\")}function sqe(){return null}function oqe(t){return t===null}Gee.exports=new nqe(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:iqe,construct:sqe,predicate:oqe,represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"}},defaultStyle:\"lowercase\"})});var Yee=_((AQt,Wee)=>{\"use strict\";var aqe=Ss();function lqe(t){if(t===null)return!1;var e=t.length;return e===4&&(t===\"true\"||t===\"True\"||t===\"TRUE\")||e===5&&(t===\"false\"||t===\"False\"||t===\"FALSE\")}function cqe(t){return t===\"true\"||t===\"True\"||t===\"TRUE\"}function uqe(t){return Object.prototype.toString.call(t)===\"[object Boolean]\"}Wee.exports=new aqe(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:lqe,construct:cqe,predicate:uqe,represent:{lowercase:function(t){return t?\"true\":\"false\"},uppercase:function(t){return t?\"TRUE\":\"FALSE\"},camelcase:function(t){return t?\"True\":\"False\"}},defaultStyle:\"lowercase\"})});var Jee=_((pQt,Vee)=>{\"use strict\";var fqe=bd(),Aqe=Ss();function pqe(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function hqe(t){return 48<=t&&t<=55}function gqe(t){return 48<=t&&t<=57}function dqe(t){if(t===null)return!1;var e=t.length,r=0,s=!1,a;if(!e)return!1;if(a=t[r],(a===\"-\"||a===\"+\")&&(a=t[++r]),a===\"0\"){if(r+1===e)return!0;if(a=t[++r],a===\"b\"){for(r++;r<e;r++)if(a=t[r],a!==\"_\"){if(a!==\"0\"&&a!==\"1\")return!1;s=!0}return s&&a!==\"_\"}if(a===\"x\"){for(r++;r<e;r++)if(a=t[r],a!==\"_\"){if(!pqe(t.charCodeAt(r)))return!1;s=!0}return s&&a!==\"_\"}for(;r<e;r++)if(a=t[r],a!==\"_\"){if(!hqe(t.charCodeAt(r)))return!1;s=!0}return s&&a!==\"_\"}if(a===\"_\")return!1;for(;r<e;r++)if(a=t[r],a!==\"_\"){if(a===\":\")break;if(!gqe(t.charCodeAt(r)))return!1;s=!0}return!s||a===\"_\"?!1:a!==\":\"?!0:/^(:[0-5]?[0-9])+$/.test(t.slice(r))}function mqe(t){var e=t,r=1,s,a,n=[];return e.indexOf(\"_\")!==-1&&(e=e.replace(/_/g,\"\")),s=e[0],(s===\"-\"||s===\"+\")&&(s===\"-\"&&(r=-1),e=e.slice(1),s=e[0]),e===\"0\"?0:s===\"0\"?e[1]===\"b\"?r*parseInt(e.slice(2),2):e[1]===\"x\"?r*parseInt(e,16):r*parseInt(e,8):e.indexOf(\":\")!==-1?(e.split(\":\").forEach(function(c){n.unshift(parseInt(c,10))}),e=0,a=1,n.forEach(function(c){e+=c*a,a*=60}),r*e):r*parseInt(e,10)}function yqe(t){return Object.prototype.toString.call(t)===\"[object Number]\"&&t%1===0&&!fqe.isNegativeZero(t)}Vee.exports=new Aqe(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:dqe,construct:mqe,predicate:yqe,represent:{binary:function(t){return t>=0?\"0b\"+t.toString(2):\"-0b\"+t.toString(2).slice(1)},octal:function(t){return t>=0?\"0\"+t.toString(8):\"-0\"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?\"0x\"+t.toString(16).toUpperCase():\"-0x\"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}})});var Xee=_((hQt,zee)=>{\"use strict\";var Kee=bd(),Eqe=Ss(),Iqe=new RegExp(\"^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");function Cqe(t){return!(t===null||!Iqe.test(t)||t[t.length-1]===\"_\")}function wqe(t){var e,r,s,a;return e=t.replace(/_/g,\"\").toLowerCase(),r=e[0]===\"-\"?-1:1,a=[],\"+-\".indexOf(e[0])>=0&&(e=e.slice(1)),e===\".inf\"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===\".nan\"?NaN:e.indexOf(\":\")>=0?(e.split(\":\").forEach(function(n){a.unshift(parseFloat(n,10))}),e=0,s=1,a.forEach(function(n){e+=n*s,s*=60}),r*e):r*parseFloat(e,10)}var Bqe=/^[-+]?[0-9]+e/;function vqe(t,e){var r;if(isNaN(t))switch(e){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===t)switch(e){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(Kee.isNegativeZero(t))return\"-0.0\";return r=t.toString(10),Bqe.test(r)?r.replace(\"e\",\".e\"):r}function Sqe(t){return Object.prototype.toString.call(t)===\"[object Number]\"&&(t%1!==0||Kee.isNegativeZero(t))}zee.exports=new Eqe(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:Cqe,construct:wqe,predicate:Sqe,represent:vqe,defaultStyle:\"lowercase\"})});var JU=_((gQt,Zee)=>{\"use strict\";var Dqe=Pd();Zee.exports=new Dqe({include:[dx()],implicit:[qee(),Yee(),Jee(),Xee()]})});var KU=_((dQt,$ee)=>{\"use strict\";var bqe=Pd();$ee.exports=new bqe({include:[JU()]})});var nte=_((mQt,rte)=>{\"use strict\";var Pqe=Ss(),ete=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),tte=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\\\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$\");function xqe(t){return t===null?!1:ete.exec(t)!==null||tte.exec(t)!==null}function kqe(t){var e,r,s,a,n,c,f,p=0,h=null,E,C,S;if(e=ete.exec(t),e===null&&(e=tte.exec(t)),e===null)throw new Error(\"Date resolve error\");if(r=+e[1],s=+e[2]-1,a=+e[3],!e[4])return new Date(Date.UTC(r,s,a));if(n=+e[4],c=+e[5],f=+e[6],e[7]){for(p=e[7].slice(0,3);p.length<3;)p+=\"0\";p=+p}return e[9]&&(E=+e[10],C=+(e[11]||0),h=(E*60+C)*6e4,e[9]===\"-\"&&(h=-h)),S=new Date(Date.UTC(r,s,a,n,c,f,p)),h&&S.setTime(S.getTime()-h),S}function Qqe(t){return t.toISOString()}rte.exports=new Pqe(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:xqe,construct:kqe,instanceOf:Date,represent:Qqe})});var ste=_((yQt,ite)=>{\"use strict\";var Tqe=Ss();function Rqe(t){return t===\"<<\"||t===null}ite.exports=new Tqe(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:Rqe})});var lte=_((EQt,ate)=>{\"use strict\";var xd;try{ote=Ie,xd=ote(\"buffer\").Buffer}catch{}var ote,Fqe=Ss(),zU=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\\r`;function Nqe(t){if(t===null)return!1;var e,r,s=0,a=t.length,n=zU;for(r=0;r<a;r++)if(e=n.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;s+=6}return s%8===0}function Oqe(t){var e,r,s=t.replace(/[\\r\\n=]/g,\"\"),a=s.length,n=zU,c=0,f=[];for(e=0;e<a;e++)e%4===0&&e&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(s.charAt(e));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),xd?xd.from?xd.from(f):new xd(f):f}function Lqe(t){var e=\"\",r=0,s,a,n=t.length,c=zU;for(s=0;s<n;s++)s%3===0&&s&&(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[s];return a=n%3,a===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):a===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):a===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}function Mqe(t){return xd&&xd.isBuffer(t)}ate.exports=new Fqe(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:Nqe,construct:Oqe,predicate:Mqe,represent:Lqe})});var ute=_((CQt,cte)=>{\"use strict\";var Uqe=Ss(),_qe=Object.prototype.hasOwnProperty,Hqe=Object.prototype.toString;function jqe(t){if(t===null)return!0;var e=[],r,s,a,n,c,f=t;for(r=0,s=f.length;r<s;r+=1){if(a=f[r],c=!1,Hqe.call(a)!==\"[object Object]\")return!1;for(n in a)if(_qe.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(e.indexOf(n)===-1)e.push(n);else return!1}return!0}function Gqe(t){return t!==null?t:[]}cte.exports=new Uqe(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:jqe,construct:Gqe})});var Ate=_((wQt,fte)=>{\"use strict\";var qqe=Ss(),Wqe=Object.prototype.toString;function Yqe(t){if(t===null)return!0;var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1){if(s=c[e],Wqe.call(s)!==\"[object Object]\"||(a=Object.keys(s),a.length!==1))return!1;n[e]=[a[0],s[a[0]]]}return!0}function Vqe(t){if(t===null)return[];var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1)s=c[e],a=Object.keys(s),n[e]=[a[0],s[a[0]]];return n}fte.exports=new qqe(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:Yqe,construct:Vqe})});var hte=_((BQt,pte)=>{\"use strict\";var Jqe=Ss(),Kqe=Object.prototype.hasOwnProperty;function zqe(t){if(t===null)return!0;var e,r=t;for(e in r)if(Kqe.call(r,e)&&r[e]!==null)return!1;return!0}function Xqe(t){return t!==null?t:{}}pte.exports=new Jqe(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:zqe,construct:Xqe})});var gE=_((vQt,gte)=>{\"use strict\";var Zqe=Pd();gte.exports=new Zqe({include:[KU()],implicit:[nte(),ste()],explicit:[lte(),ute(),Ate(),hte()]})});var mte=_((SQt,dte)=>{\"use strict\";var $qe=Ss();function e9e(){return!0}function t9e(){}function r9e(){return\"\"}function n9e(t){return typeof t>\"u\"}dte.exports=new $qe(\"tag:yaml.org,2002:js/undefined\",{kind:\"scalar\",resolve:e9e,construct:t9e,predicate:n9e,represent:r9e})});var Ete=_((DQt,yte)=>{\"use strict\";var i9e=Ss();function s9e(t){if(t===null||t.length===0)return!1;var e=t,r=/\\/([gim]*)$/.exec(t),s=\"\";return!(e[0]===\"/\"&&(r&&(s=r[1]),s.length>3||e[e.length-s.length-1]!==\"/\"))}function o9e(t){var e=t,r=/\\/([gim]*)$/.exec(t),s=\"\";return e[0]===\"/\"&&(r&&(s=r[1]),e=e.slice(1,e.length-s.length-1)),new RegExp(e,s)}function a9e(t){var e=\"/\"+t.source+\"/\";return t.global&&(e+=\"g\"),t.multiline&&(e+=\"m\"),t.ignoreCase&&(e+=\"i\"),e}function l9e(t){return Object.prototype.toString.call(t)===\"[object RegExp]\"}yte.exports=new i9e(\"tag:yaml.org,2002:js/regexp\",{kind:\"scalar\",resolve:s9e,construct:o9e,predicate:l9e,represent:a9e})});var wte=_((bQt,Cte)=>{\"use strict\";var mx;try{Ite=Ie,mx=Ite(\"esprima\")}catch{typeof window<\"u\"&&(mx=window.esprima)}var Ite,c9e=Ss();function u9e(t){if(t===null)return!1;try{var e=\"(\"+t+\")\",r=mx.parse(e,{range:!0});return!(r.type!==\"Program\"||r.body.length!==1||r.body[0].type!==\"ExpressionStatement\"||r.body[0].expression.type!==\"ArrowFunctionExpression\"&&r.body[0].expression.type!==\"FunctionExpression\")}catch{return!1}}function f9e(t){var e=\"(\"+t+\")\",r=mx.parse(e,{range:!0}),s=[],a;if(r.type!==\"Program\"||r.body.length!==1||r.body[0].type!==\"ExpressionStatement\"||r.body[0].expression.type!==\"ArrowFunctionExpression\"&&r.body[0].expression.type!==\"FunctionExpression\")throw new Error(\"Failed to resolve function\");return r.body[0].expression.params.forEach(function(n){s.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type===\"BlockStatement\"?new Function(s,e.slice(a[0]+1,a[1]-1)):new Function(s,\"return \"+e.slice(a[0],a[1]))}function A9e(t){return t.toString()}function p9e(t){return Object.prototype.toString.call(t)===\"[object Function]\"}Cte.exports=new c9e(\"tag:yaml.org,2002:js/function\",{kind:\"scalar\",resolve:u9e,construct:f9e,predicate:p9e,represent:A9e})});var G2=_((xQt,vte)=>{\"use strict\";var Bte=Pd();vte.exports=Bte.DEFAULT=new Bte({include:[gE()],explicit:[mte(),Ete(),wte()]})});var Gte=_((kQt,q2)=>{\"use strict\";var Ip=bd(),Qte=pE(),h9e=Qee(),Tte=gE(),g9e=G2(),i0=Object.prototype.hasOwnProperty,yx=1,Rte=2,Fte=3,Ex=4,XU=1,d9e=2,Ste=3,m9e=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,y9e=/[\\x85\\u2028\\u2029]/,E9e=/[,\\[\\]\\{\\}]/,Nte=/^(?:!|!!|![a-z\\-]+!)$/i,Ote=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function Dte(t){return Object.prototype.toString.call(t)}function jf(t){return t===10||t===13}function Qd(t){return t===9||t===32}function rl(t){return t===9||t===32||t===10||t===13}function dE(t){return t===44||t===91||t===93||t===123||t===125}function I9e(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function C9e(t){return t===120?2:t===117?4:t===85?8:0}function w9e(t){return 48<=t&&t<=57?t-48:-1}function bte(t){return t===48?\"\\0\":t===97?\"\\x07\":t===98?\"\\b\":t===116||t===9?\"\t\":t===110?`\n`:t===118?\"\\v\":t===102?\"\\f\":t===114?\"\\r\":t===101?\"\\x1B\":t===32?\" \":t===34?'\"':t===47?\"/\":t===92?\"\\\\\":t===78?\"\\x85\":t===95?\"\\xA0\":t===76?\"\\u2028\":t===80?\"\\u2029\":\"\"}function B9e(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var Lte=new Array(256),Mte=new Array(256);for(kd=0;kd<256;kd++)Lte[kd]=bte(kd)?1:0,Mte[kd]=bte(kd);var kd;function v9e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||g9e,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Ute(t,e){return new Qte(e,new h9e(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Rr(t,e){throw Ute(t,e)}function Ix(t,e){t.onWarning&&t.onWarning.call(null,Ute(t,e))}var Pte={YAML:function(e,r,s){var a,n,c;e.version!==null&&Rr(e,\"duplication of %YAML directive\"),s.length!==1&&Rr(e,\"YAML directive accepts exactly one argument\"),a=/^([0-9]+)\\.([0-9]+)$/.exec(s[0]),a===null&&Rr(e,\"ill-formed argument of the YAML directive\"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Rr(e,\"unacceptable YAML version of the document\"),e.version=s[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&Ix(e,\"unsupported YAML version of the document\")},TAG:function(e,r,s){var a,n;s.length!==2&&Rr(e,\"TAG directive accepts exactly two arguments\"),a=s[0],n=s[1],Nte.test(a)||Rr(e,\"ill-formed tag handle (first argument) of the TAG directive\"),i0.call(e.tagMap,a)&&Rr(e,'there is a previously declared suffix for \"'+a+'\" tag handle'),Ote.test(n)||Rr(e,\"ill-formed tag prefix (second argument) of the TAG directive\"),e.tagMap[a]=n}};function n0(t,e,r,s){var a,n,c,f;if(e<r){if(f=t.input.slice(e,r),s)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Rr(t,\"expected valid JSON character\");else m9e.test(f)&&Rr(t,\"the stream contains non-printable characters\");t.result+=f}}function xte(t,e,r,s){var a,n,c,f;for(Ip.isObject(r)||Rr(t,\"cannot merge mappings; the provided source object is unacceptable\"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],i0.call(e,n)||(e[n]=r[n],s[n]=!0)}function mE(t,e,r,s,a,n,c,f){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Rr(t,\"nested arrays are not supported inside keys\"),typeof a==\"object\"&&Dte(a[p])===\"[object Object]\"&&(a[p]=\"[object Object]\");if(typeof a==\"object\"&&Dte(a)===\"[object Object]\"&&(a=\"[object Object]\"),a=String(a),e===null&&(e={}),s===\"tag:yaml.org,2002:merge\")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)xte(t,e,n[p],r);else xte(t,e,n,r);else!t.json&&!i0.call(r,a)&&i0.call(e,a)&&(t.line=c||t.line,t.position=f||t.position,Rr(t,\"duplicated mapping key\")),e[a]=n,delete r[a];return e}function ZU(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Rr(t,\"a line break is expected\"),t.line+=1,t.lineStart=t.position}function as(t,e,r){for(var s=0,a=t.input.charCodeAt(t.position);a!==0;){for(;Qd(a);)a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(jf(a))for(ZU(t),a=t.input.charCodeAt(t.position),s++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&s!==0&&t.lineIndent<r&&Ix(t,\"deficient indentation\"),s}function Cx(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||rl(r)))}function $U(t,e){e===1?t.result+=\" \":e>1&&(t.result+=Ip.repeat(`\n`,e-1))}function S9e(t,e,r){var s,a,n,c,f,p,h,E,C=t.kind,S=t.result,P;if(P=t.input.charCodeAt(t.position),rl(P)||dE(P)||P===35||P===38||P===42||P===33||P===124||P===62||P===39||P===34||P===37||P===64||P===96||(P===63||P===45)&&(a=t.input.charCodeAt(t.position+1),rl(a)||r&&dE(a)))return!1;for(t.kind=\"scalar\",t.result=\"\",n=c=t.position,f=!1;P!==0;){if(P===58){if(a=t.input.charCodeAt(t.position+1),rl(a)||r&&dE(a))break}else if(P===35){if(s=t.input.charCodeAt(t.position-1),rl(s))break}else{if(t.position===t.lineStart&&Cx(t)||r&&dE(P))break;if(jf(P))if(p=t.line,h=t.lineStart,E=t.lineIndent,as(t,!1,-1),t.lineIndent>=e){f=!0,P=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=p,t.lineStart=h,t.lineIndent=E;break}}f&&(n0(t,n,c,!1),$U(t,t.line-p),n=c=t.position,f=!1),Qd(P)||(c=t.position+1),P=t.input.charCodeAt(++t.position)}return n0(t,n,c,!1),t.result?!0:(t.kind=C,t.result=S,!1)}function D9e(t,e){var r,s,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind=\"scalar\",t.result=\"\",t.position++,s=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(n0(t,s,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)s=t.position,t.position++,a=t.position;else return!0;else jf(r)?(n0(t,s,a,!0),$U(t,as(t,!1,e)),s=a=t.position):t.position===t.lineStart&&Cx(t)?Rr(t,\"unexpected end of the document within a single quoted scalar\"):(t.position++,a=t.position);Rr(t,\"unexpected end of the stream within a single quoted scalar\")}function b9e(t,e){var r,s,a,n,c,f;if(f=t.input.charCodeAt(t.position),f!==34)return!1;for(t.kind=\"scalar\",t.result=\"\",t.position++,r=s=t.position;(f=t.input.charCodeAt(t.position))!==0;){if(f===34)return n0(t,r,t.position,!0),t.position++,!0;if(f===92){if(n0(t,r,t.position,!0),f=t.input.charCodeAt(++t.position),jf(f))as(t,!1,e);else if(f<256&&Lte[f])t.result+=Mte[f],t.position++;else if((c=C9e(f))>0){for(a=c,n=0;a>0;a--)f=t.input.charCodeAt(++t.position),(c=I9e(f))>=0?n=(n<<4)+c:Rr(t,\"expected hexadecimal character\");t.result+=B9e(n),t.position++}else Rr(t,\"unknown escape sequence\");r=s=t.position}else jf(f)?(n0(t,r,s,!0),$U(t,as(t,!1,e)),r=s=t.position):t.position===t.lineStart&&Cx(t)?Rr(t,\"unexpected end of the document within a double quoted scalar\"):(t.position++,s=t.position)}Rr(t,\"unexpected end of the stream within a double quoted scalar\")}function P9e(t,e){var r=!0,s,a=t.tag,n,c=t.anchor,f,p,h,E,C,S={},P,I,R,N;if(N=t.input.charCodeAt(t.position),N===91)p=93,C=!1,n=[];else if(N===123)p=125,C=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),N=t.input.charCodeAt(++t.position);N!==0;){if(as(t,!0,e),N=t.input.charCodeAt(t.position),N===p)return t.position++,t.tag=a,t.anchor=c,t.kind=C?\"mapping\":\"sequence\",t.result=n,!0;r||Rr(t,\"missed comma between flow collection entries\"),I=P=R=null,h=E=!1,N===63&&(f=t.input.charCodeAt(t.position+1),rl(f)&&(h=E=!0,t.position++,as(t,!0,e))),s=t.line,yE(t,e,yx,!1,!0),I=t.tag,P=t.result,as(t,!0,e),N=t.input.charCodeAt(t.position),(E||t.line===s)&&N===58&&(h=!0,N=t.input.charCodeAt(++t.position),as(t,!0,e),yE(t,e,yx,!1,!0),R=t.result),C?mE(t,n,S,I,P,R):h?n.push(mE(t,null,S,I,P,R)):n.push(P),as(t,!0,e),N=t.input.charCodeAt(t.position),N===44?(r=!0,N=t.input.charCodeAt(++t.position)):r=!1}Rr(t,\"unexpected end of the stream within a flow collection\")}function x9e(t,e){var r,s,a=XU,n=!1,c=!1,f=e,p=0,h=!1,E,C;if(C=t.input.charCodeAt(t.position),C===124)s=!1;else if(C===62)s=!0;else return!1;for(t.kind=\"scalar\",t.result=\"\";C!==0;)if(C=t.input.charCodeAt(++t.position),C===43||C===45)XU===a?a=C===43?Ste:d9e:Rr(t,\"repeat of a chomping mode identifier\");else if((E=w9e(C))>=0)E===0?Rr(t,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):c?Rr(t,\"repeat of an indentation width identifier\"):(f=e+E-1,c=!0);else break;if(Qd(C)){do C=t.input.charCodeAt(++t.position);while(Qd(C));if(C===35)do C=t.input.charCodeAt(++t.position);while(!jf(C)&&C!==0)}for(;C!==0;){for(ZU(t),t.lineIndent=0,C=t.input.charCodeAt(t.position);(!c||t.lineIndent<f)&&C===32;)t.lineIndent++,C=t.input.charCodeAt(++t.position);if(!c&&t.lineIndent>f&&(f=t.lineIndent),jf(C)){p++;continue}if(t.lineIndent<f){a===Ste?t.result+=Ip.repeat(`\n`,n?1+p:p):a===XU&&n&&(t.result+=`\n`);break}for(s?Qd(C)?(h=!0,t.result+=Ip.repeat(`\n`,n?1+p:p)):h?(h=!1,t.result+=Ip.repeat(`\n`,p+1)):p===0?n&&(t.result+=\" \"):t.result+=Ip.repeat(`\n`,p):t.result+=Ip.repeat(`\n`,n?1+p:p),n=!0,c=!0,p=0,r=t.position;!jf(C)&&C!==0;)C=t.input.charCodeAt(++t.position);n0(t,r,t.position,!1)}return!0}function kte(t,e){var r,s=t.tag,a=t.anchor,n=[],c,f=!1,p;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),p=t.input.charCodeAt(t.position);p!==0&&!(p!==45||(c=t.input.charCodeAt(t.position+1),!rl(c)));){if(f=!0,t.position++,as(t,!0,-1)&&t.lineIndent<=e){n.push(null),p=t.input.charCodeAt(t.position);continue}if(r=t.line,yE(t,e,Fte,!1,!0),n.push(t.result),as(t,!0,-1),p=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&p!==0)Rr(t,\"bad indentation of a sequence entry\");else if(t.lineIndent<e)break}return f?(t.tag=s,t.anchor=a,t.kind=\"sequence\",t.result=n,!0):!1}function k9e(t,e,r){var s,a,n,c,f=t.tag,p=t.anchor,h={},E={},C=null,S=null,P=null,I=!1,R=!1,N;for(t.anchor!==null&&(t.anchorMap[t.anchor]=h),N=t.input.charCodeAt(t.position);N!==0;){if(s=t.input.charCodeAt(t.position+1),n=t.line,c=t.position,(N===63||N===58)&&rl(s))N===63?(I&&(mE(t,h,E,C,S,null),C=S=P=null),R=!0,I=!0,a=!0):I?(I=!1,a=!0):Rr(t,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),t.position+=1,N=s;else if(yE(t,r,Rte,!1,!0))if(t.line===n){for(N=t.input.charCodeAt(t.position);Qd(N);)N=t.input.charCodeAt(++t.position);if(N===58)N=t.input.charCodeAt(++t.position),rl(N)||Rr(t,\"a whitespace character is expected after the key-value separator within a block mapping\"),I&&(mE(t,h,E,C,S,null),C=S=P=null),R=!0,I=!1,a=!1,C=t.tag,S=t.result;else if(R)Rr(t,\"can not read an implicit mapping pair; a colon is missed\");else return t.tag=f,t.anchor=p,!0}else if(R)Rr(t,\"can not read a block mapping entry; a multiline key may not be an implicit key\");else return t.tag=f,t.anchor=p,!0;else break;if((t.line===n||t.lineIndent>e)&&(yE(t,e,Ex,!0,a)&&(I?S=t.result:P=t.result),I||(mE(t,h,E,C,S,P,n,c),C=S=P=null),as(t,!0,-1),N=t.input.charCodeAt(t.position)),t.lineIndent>e&&N!==0)Rr(t,\"bad indentation of a mapping entry\");else if(t.lineIndent<e)break}return I&&mE(t,h,E,C,S,null),R&&(t.tag=f,t.anchor=p,t.kind=\"mapping\",t.result=h),R}function Q9e(t){var e,r=!1,s=!1,a,n,c;if(c=t.input.charCodeAt(t.position),c!==33)return!1;if(t.tag!==null&&Rr(t,\"duplication of a tag property\"),c=t.input.charCodeAt(++t.position),c===60?(r=!0,c=t.input.charCodeAt(++t.position)):c===33?(s=!0,a=\"!!\",c=t.input.charCodeAt(++t.position)):a=\"!\",e=t.position,r){do c=t.input.charCodeAt(++t.position);while(c!==0&&c!==62);t.position<t.length?(n=t.input.slice(e,t.position),c=t.input.charCodeAt(++t.position)):Rr(t,\"unexpected end of the stream within a verbatim tag\")}else{for(;c!==0&&!rl(c);)c===33&&(s?Rr(t,\"tag suffix cannot contain exclamation marks\"):(a=t.input.slice(e-1,t.position+1),Nte.test(a)||Rr(t,\"named tag handle cannot contain such characters\"),s=!0,e=t.position+1)),c=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),E9e.test(n)&&Rr(t,\"tag suffix cannot contain flow indicator characters\")}return n&&!Ote.test(n)&&Rr(t,\"tag name cannot contain such characters: \"+n),r?t.tag=n:i0.call(t.tagMap,a)?t.tag=t.tagMap[a]+n:a===\"!\"?t.tag=\"!\"+n:a===\"!!\"?t.tag=\"tag:yaml.org,2002:\"+n:Rr(t,'undeclared tag handle \"'+a+'\"'),!0}function T9e(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Rr(t,\"duplication of an anchor property\"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!rl(r)&&!dE(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Rr(t,\"name of an anchor node must contain at least one character\"),t.anchor=t.input.slice(e,t.position),!0}function R9e(t){var e,r,s;if(s=t.input.charCodeAt(t.position),s!==42)return!1;for(s=t.input.charCodeAt(++t.position),e=t.position;s!==0&&!rl(s)&&!dE(s);)s=t.input.charCodeAt(++t.position);return t.position===e&&Rr(t,\"name of an alias node must contain at least one character\"),r=t.input.slice(e,t.position),i0.call(t.anchorMap,r)||Rr(t,'unidentified alias \"'+r+'\"'),t.result=t.anchorMap[r],as(t,!0,-1),!0}function yE(t,e,r,s,a){var n,c,f,p=1,h=!1,E=!1,C,S,P,I,R;if(t.listener!==null&&t.listener(\"open\",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,n=c=f=Ex===r||Fte===r,s&&as(t,!0,-1)&&(h=!0,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)),p===1)for(;Q9e(t)||T9e(t);)as(t,!0,-1)?(h=!0,f=n,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)):f=!1;if(f&&(f=h||a),(p===1||Ex===r)&&(yx===r||Rte===r?I=e:I=e+1,R=t.position-t.lineStart,p===1?f&&(kte(t,R)||k9e(t,R,I))||P9e(t,I)?E=!0:(c&&x9e(t,I)||D9e(t,I)||b9e(t,I)?E=!0:R9e(t)?(E=!0,(t.tag!==null||t.anchor!==null)&&Rr(t,\"alias node should not have any properties\")):S9e(t,I,yx===r)&&(E=!0,t.tag===null&&(t.tag=\"?\")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):p===0&&(E=f&&kte(t,R))),t.tag!==null&&t.tag!==\"!\")if(t.tag===\"?\"){for(t.result!==null&&t.kind!==\"scalar\"&&Rr(t,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+t.kind+'\"'),C=0,S=t.implicitTypes.length;C<S;C+=1)if(P=t.implicitTypes[C],P.resolve(t.result)){t.result=P.construct(t.result),t.tag=P.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else i0.call(t.typeMap[t.kind||\"fallback\"],t.tag)?(P=t.typeMap[t.kind||\"fallback\"][t.tag],t.result!==null&&P.kind!==t.kind&&Rr(t,\"unacceptable node kind for !<\"+t.tag+'> tag; it should be \"'+P.kind+'\", not \"'+t.kind+'\"'),P.resolve(t.result)?(t.result=P.construct(t.result),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Rr(t,\"cannot resolve a node with !<\"+t.tag+\"> explicit tag\")):Rr(t,\"unknown tag !<\"+t.tag+\">\");return t.listener!==null&&t.listener(\"close\",t),t.tag!==null||t.anchor!==null||E}function F9e(t){var e=t.position,r,s,a,n=!1,c;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};(c=t.input.charCodeAt(t.position))!==0&&(as(t,!0,-1),c=t.input.charCodeAt(t.position),!(t.lineIndent>0||c!==37));){for(n=!0,c=t.input.charCodeAt(++t.position),r=t.position;c!==0&&!rl(c);)c=t.input.charCodeAt(++t.position);for(s=t.input.slice(r,t.position),a=[],s.length<1&&Rr(t,\"directive name must not be less than one character in length\");c!==0;){for(;Qd(c);)c=t.input.charCodeAt(++t.position);if(c===35){do c=t.input.charCodeAt(++t.position);while(c!==0&&!jf(c));break}if(jf(c))break;for(r=t.position;c!==0&&!rl(c);)c=t.input.charCodeAt(++t.position);a.push(t.input.slice(r,t.position))}c!==0&&ZU(t),i0.call(Pte,s)?Pte[s](t,s,a):Ix(t,'unknown document directive \"'+s+'\"')}if(as(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,as(t,!0,-1)):n&&Rr(t,\"directives end mark is expected\"),yE(t,t.lineIndent-1,Ex,!1,!0),as(t,!0,-1),t.checkLineBreaks&&y9e.test(t.input.slice(e,t.position))&&Ix(t,\"non-ASCII line breaks are interpreted as content\"),t.documents.push(t.result),t.position===t.lineStart&&Cx(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,as(t,!0,-1));return}if(t.position<t.length-1)Rr(t,\"end of the stream or a document separator is expected\");else return}function _te(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`\n`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new v9e(t,e),s=t.indexOf(\"\\0\");for(s!==-1&&(r.position=s,Rr(r,\"null byte is not allowed in input\")),r.input+=\"\\0\";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)F9e(r);return r.documents}function Hte(t,e,r){e!==null&&typeof e==\"object\"&&typeof r>\"u\"&&(r=e,e=null);var s=_te(t,r);if(typeof e!=\"function\")return s;for(var a=0,n=s.length;a<n;a+=1)e(s[a])}function jte(t,e){var r=_te(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new Qte(\"expected a single document in the stream, but found more\")}}function N9e(t,e,r){return typeof e==\"object\"&&e!==null&&typeof r>\"u\"&&(r=e,e=null),Hte(t,e,Ip.extend({schema:Tte},r))}function O9e(t,e){return jte(t,Ip.extend({schema:Tte},e))}q2.exports.loadAll=Hte;q2.exports.load=jte;q2.exports.safeLoadAll=N9e;q2.exports.safeLoad=O9e});var Are=_((QQt,n_)=>{\"use strict\";var Y2=bd(),V2=pE(),L9e=G2(),M9e=gE(),Xte=Object.prototype.toString,Zte=Object.prototype.hasOwnProperty,U9e=9,W2=10,_9e=13,H9e=32,j9e=33,G9e=34,$te=35,q9e=37,W9e=38,Y9e=39,V9e=42,ere=44,J9e=45,tre=58,K9e=61,z9e=62,X9e=63,Z9e=64,rre=91,nre=93,$9e=96,ire=123,eWe=124,sre=125,_o={};_o[0]=\"\\\\0\";_o[7]=\"\\\\a\";_o[8]=\"\\\\b\";_o[9]=\"\\\\t\";_o[10]=\"\\\\n\";_o[11]=\"\\\\v\";_o[12]=\"\\\\f\";_o[13]=\"\\\\r\";_o[27]=\"\\\\e\";_o[34]='\\\\\"';_o[92]=\"\\\\\\\\\";_o[133]=\"\\\\N\";_o[160]=\"\\\\_\";_o[8232]=\"\\\\L\";_o[8233]=\"\\\\P\";var tWe=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"];function rWe(t,e){var r,s,a,n,c,f,p;if(e===null)return{};for(r={},s=Object.keys(e),a=0,n=s.length;a<n;a+=1)c=s[a],f=String(e[c]),c.slice(0,2)===\"!!\"&&(c=\"tag:yaml.org,2002:\"+c.slice(2)),p=t.compiledTypeMap.fallback[c],p&&Zte.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function qte(t){var e,r,s;if(e=t.toString(16).toUpperCase(),t<=255)r=\"x\",s=2;else if(t<=65535)r=\"u\",s=4;else if(t<=4294967295)r=\"U\",s=8;else throw new V2(\"code point within a string may not be greater than 0xFFFFFFFF\");return\"\\\\\"+r+Y2.repeat(\"0\",s-e.length)+e}function nWe(t){this.schema=t.schema||L9e,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Y2.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=rWe(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function Wte(t,e){for(var r=Y2.repeat(\" \",e),s=0,a=-1,n=\"\",c,f=t.length;s<f;)a=t.indexOf(`\n`,s),a===-1?(c=t.slice(s),s=f):(c=t.slice(s,a+1),s=a+1),c.length&&c!==`\n`&&(n+=r),n+=c;return n}function e_(t,e){return`\n`+Y2.repeat(\" \",t.indent*e)}function iWe(t,e){var r,s,a;for(r=0,s=t.implicitTypes.length;r<s;r+=1)if(a=t.implicitTypes[r],a.resolve(e))return!0;return!1}function r_(t){return t===H9e||t===U9e}function EE(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function sWe(t){return EE(t)&&!r_(t)&&t!==65279&&t!==_9e&&t!==W2}function Yte(t,e){return EE(t)&&t!==65279&&t!==ere&&t!==rre&&t!==nre&&t!==ire&&t!==sre&&t!==tre&&(t!==$te||e&&sWe(e))}function oWe(t){return EE(t)&&t!==65279&&!r_(t)&&t!==J9e&&t!==X9e&&t!==tre&&t!==ere&&t!==rre&&t!==nre&&t!==ire&&t!==sre&&t!==$te&&t!==W9e&&t!==V9e&&t!==j9e&&t!==eWe&&t!==K9e&&t!==z9e&&t!==Y9e&&t!==G9e&&t!==q9e&&t!==Z9e&&t!==$9e}function ore(t){var e=/^\\n* /;return e.test(t)}var are=1,lre=2,cre=3,ure=4,wx=5;function aWe(t,e,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=oWe(t.charCodeAt(0))&&!r_(t.charCodeAt(t.length-1));if(e)for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),!EE(c))return wx;f=n>0?t.charCodeAt(n-1):null,S=S&&Yte(c,f)}else{for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),c===W2)p=!0,E&&(h=h||n-C-1>s&&t[C+1]!==\" \",C=n);else if(!EE(c))return wx;f=n>0?t.charCodeAt(n-1):null,S=S&&Yte(c,f)}h=h||E&&n-C-1>s&&t[C+1]!==\" \"}return!p&&!h?S&&!a(t)?are:lre:r>9&&ore(t)?wx:h?ure:cre}function lWe(t,e,r,s){t.dump=function(){if(e.length===0)return\"''\";if(!t.noCompatMode&&tWe.indexOf(e)!==-1)return\"'\"+e+\"'\";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),c=s||t.flowLevel>-1&&r>=t.flowLevel;function f(p){return iWe(t,p)}switch(aWe(e,c,t.indent,n,f)){case are:return e;case lre:return\"'\"+e.replace(/'/g,\"''\")+\"'\";case cre:return\"|\"+Vte(e,t.indent)+Jte(Wte(e,a));case ure:return\">\"+Vte(e,t.indent)+Jte(Wte(cWe(e,n),a));case wx:return'\"'+uWe(e,n)+'\"';default:throw new V2(\"impossible error: invalid scalar style\")}}()}function Vte(t,e){var r=ore(t)?String(e):\"\",s=t[t.length-1]===`\n`,a=s&&(t[t.length-2]===`\n`||t===`\n`),n=a?\"+\":s?\"\":\"-\";return r+n+`\n`}function Jte(t){return t[t.length-1]===`\n`?t.slice(0,-1):t}function cWe(t,e){for(var r=/(\\n+)([^\\n]*)/g,s=function(){var h=t.indexOf(`\n`);return h=h!==-1?h:t.length,r.lastIndex=h,Kte(t.slice(0,h),e)}(),a=t[0]===`\n`||t[0]===\" \",n,c;c=r.exec(t);){var f=c[1],p=c[2];n=p[0]===\" \",s+=f+(!a&&!n&&p!==\"\"?`\n`:\"\")+Kte(p,e),a=n}return s}function Kte(t,e){if(t===\"\"||t[0]===\" \")return t;for(var r=/ [^ ]/g,s,a=0,n,c=0,f=0,p=\"\";s=r.exec(t);)f=s.index,f-a>e&&(n=c>a?c:f,p+=`\n`+t.slice(a,n),a=n+1),c=f;return p+=`\n`,t.length-a>e&&c>a?p+=t.slice(a,c)+`\n`+t.slice(c+1):p+=t.slice(a),p.slice(1)}function uWe(t){for(var e=\"\",r,s,a,n=0;n<t.length;n++){if(r=t.charCodeAt(n),r>=55296&&r<=56319&&(s=t.charCodeAt(n+1),s>=56320&&s<=57343)){e+=qte((r-55296)*1024+s-56320+65536),n++;continue}a=_o[r],e+=!a&&EE(r)?t[n]:a||qte(r)}return e}function fWe(t,e,r){var s=\"\",a=t.tag,n,c;for(n=0,c=r.length;n<c;n+=1)Td(t,e,r[n],!1,!1)&&(n!==0&&(s+=\",\"+(t.condenseFlow?\"\":\" \")),s+=t.dump);t.tag=a,t.dump=\"[\"+s+\"]\"}function AWe(t,e,r,s){var a=\"\",n=t.tag,c,f;for(c=0,f=r.length;c<f;c+=1)Td(t,e+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=e_(t,e)),t.dump&&W2===t.dump.charCodeAt(0)?a+=\"-\":a+=\"- \",a+=t.dump);t.tag=n,t.dump=a||\"[]\"}function pWe(t,e,r){var s=\"\",a=t.tag,n=Object.keys(r),c,f,p,h,E;for(c=0,f=n.length;c<f;c+=1)E=\"\",c!==0&&(E+=\", \"),t.condenseFlow&&(E+='\"'),p=n[c],h=r[p],Td(t,e,p,!1,!1)&&(t.dump.length>1024&&(E+=\"? \"),E+=t.dump+(t.condenseFlow?'\"':\"\")+\":\"+(t.condenseFlow?\"\":\" \"),Td(t,e,h,!1,!1)&&(E+=t.dump,s+=E));t.tag=a,t.dump=\"{\"+s+\"}\"}function hWe(t,e,r,s){var a=\"\",n=t.tag,c=Object.keys(r),f,p,h,E,C,S;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys==\"function\")c.sort(t.sortKeys);else if(t.sortKeys)throw new V2(\"sortKeys must be a boolean or a function\");for(f=0,p=c.length;f<p;f+=1)S=\"\",(!s||f!==0)&&(S+=e_(t,e)),h=c[f],E=r[h],Td(t,e+1,h,!0,!0,!0)&&(C=t.tag!==null&&t.tag!==\"?\"||t.dump&&t.dump.length>1024,C&&(t.dump&&W2===t.dump.charCodeAt(0)?S+=\"?\":S+=\"? \"),S+=t.dump,C&&(S+=e_(t,e)),Td(t,e+1,E,!0,C)&&(t.dump&&W2===t.dump.charCodeAt(0)?S+=\":\":S+=\": \",S+=t.dump,a+=S));t.tag=n,t.dump=a||\"{}\"}function zte(t,e,r){var s,a,n,c,f,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof e==\"object\"&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=r?f.tag:\"?\",f.represent){if(p=t.styleMap[f.tag]||f.defaultStyle,Xte.call(f.represent)===\"[object Function]\")s=f.represent(e,p);else if(Zte.call(f.represent,p))s=f.represent[p](e,p);else throw new V2(\"!<\"+f.tag+'> tag resolver accepts not \"'+p+'\" style');t.dump=s}return!0}return!1}function Td(t,e,r,s,a,n){t.tag=null,t.dump=r,zte(t,r,!1)||zte(t,r,!0);var c=Xte.call(t.dump);s&&(s=t.flowLevel<0||t.flowLevel>e);var f=c===\"[object Object]\"||c===\"[object Array]\",p,h;if(f&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!==\"?\"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump=\"*ref_\"+p;else{if(f&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),c===\"[object Object]\")s&&Object.keys(t.dump).length!==0?(hWe(t,e,t.dump,a),h&&(t.dump=\"&ref_\"+p+t.dump)):(pWe(t,e,t.dump),h&&(t.dump=\"&ref_\"+p+\" \"+t.dump));else if(c===\"[object Array]\"){var E=t.noArrayIndent&&e>0?e-1:e;s&&t.dump.length!==0?(AWe(t,E,t.dump,a),h&&(t.dump=\"&ref_\"+p+t.dump)):(fWe(t,E,t.dump),h&&(t.dump=\"&ref_\"+p+\" \"+t.dump))}else if(c===\"[object String]\")t.tag!==\"?\"&&lWe(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new V2(\"unacceptable kind of an object to dump \"+c)}t.tag!==null&&t.tag!==\"?\"&&(t.dump=\"!<\"+t.tag+\"> \"+t.dump)}return!0}function gWe(t,e){var r=[],s=[],a,n;for(t_(t,r,s),a=0,n=s.length;a<n;a+=1)e.duplicates.push(r[s[a]]);e.usedDuplicates=new Array(n)}function t_(t,e,r){var s,a,n;if(t!==null&&typeof t==\"object\")if(a=e.indexOf(t),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(e.push(t),Array.isArray(t))for(a=0,n=t.length;a<n;a+=1)t_(t[a],e,r);else for(s=Object.keys(t),a=0,n=s.length;a<n;a+=1)t_(t[s[a]],e,r)}function fre(t,e){e=e||{};var r=new nWe(e);return r.noRefs||gWe(t,r),Td(r,0,t,!0,!0)?r.dump+`\n`:\"\"}function dWe(t,e){return fre(t,Y2.extend({schema:M9e},e))}n_.exports.dump=fre;n_.exports.safeDump=dWe});var hre=_((TQt,Wi)=>{\"use strict\";var Bx=Gte(),pre=Are();function vx(t){return function(){throw new Error(\"Function \"+t+\" is deprecated and cannot be used.\")}}Wi.exports.Type=Ss();Wi.exports.Schema=Pd();Wi.exports.FAILSAFE_SCHEMA=dx();Wi.exports.JSON_SCHEMA=JU();Wi.exports.CORE_SCHEMA=KU();Wi.exports.DEFAULT_SAFE_SCHEMA=gE();Wi.exports.DEFAULT_FULL_SCHEMA=G2();Wi.exports.load=Bx.load;Wi.exports.loadAll=Bx.loadAll;Wi.exports.safeLoad=Bx.safeLoad;Wi.exports.safeLoadAll=Bx.safeLoadAll;Wi.exports.dump=pre.dump;Wi.exports.safeDump=pre.safeDump;Wi.exports.YAMLException=pE();Wi.exports.MINIMAL_SCHEMA=dx();Wi.exports.SAFE_SCHEMA=gE();Wi.exports.DEFAULT_SCHEMA=G2();Wi.exports.scan=vx(\"scan\");Wi.exports.parse=vx(\"parse\");Wi.exports.compose=vx(\"compose\");Wi.exports.addConstructor=vx(\"addConstructor\")});var dre=_((RQt,gre)=>{\"use strict\";var mWe=hre();gre.exports=mWe});var yre=_((FQt,mre)=>{\"use strict\";function yWe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Rd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Rd)}yWe(Rd,Error);Rd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function EWe(t,e){e=e!==void 0?e:{};var r={},s={Start:lc},a=lc,n=function(te){return[].concat(...te)},c=\"-\",f=dn(\"-\",!1),p=function(te){return te},h=function(te){return Object.assign({},...te)},E=\"#\",C=dn(\"#\",!1),S=Au(),P=function(){return{}},I=\":\",R=dn(\":\",!1),N=function(te,Ee){return{[te]:Ee}},U=\",\",W=dn(\",\",!1),ee=function(te,Ee){return Ee},ie=function(te,Ee,Oe){return Object.assign({},...[te].concat(Ee).map(dt=>({[dt]:Oe})))},ue=function(te){return te},le=function(te){return te},me=Oa(\"correct indentation\"),pe=\" \",Be=dn(\" \",!1),Ce=function(te){return te.length===lr*St},g=function(te){return te.length===(lr+1)*St},we=function(){return lr++,!0},ye=function(){return lr--,!0},Ae=function(){return la()},se=Oa(\"pseudostring\"),Z=/^[^\\r\\n\\t ?:,\\][{}#&*!|>'\"%@`\\-]/,De=Kn([\"\\r\",`\n`,\"\t\",\" \",\"?\",\":\",\",\",\"]\",\"[\",\"{\",\"}\",\"#\",\"&\",\"*\",\"!\",\"|\",\">\",\"'\",'\"',\"%\",\"@\",\"`\",\"-\"],!0,!1),Re=/^[^\\r\\n\\t ,\\][{}:#\"']/,mt=Kn([\"\\r\",`\n`,\"\t\",\" \",\",\",\"]\",\"[\",\"{\",\"}\",\":\",\"#\",'\"',\"'\"],!0,!1),j=function(){return la().replace(/^ *| *$/g,\"\")},rt=\"--\",Fe=dn(\"--\",!1),Ne=/^[a-zA-Z\\/0-9]/,Pe=Kn([[\"a\",\"z\"],[\"A\",\"Z\"],\"/\",[\"0\",\"9\"]],!1,!1),Ve=/^[^\\r\\n\\t :,]/,ke=Kn([\"\\r\",`\n`,\"\t\",\" \",\":\",\",\"],!0,!1),it=\"null\",Ue=dn(\"null\",!1),x=function(){return null},w=\"true\",b=dn(\"true\",!1),y=function(){return!0},F=\"false\",z=dn(\"false\",!1),X=function(){return!1},$=Oa(\"string\"),oe='\"',xe=dn('\"',!1),Te=function(){return\"\"},lt=function(te){return te},Ct=function(te){return te.join(\"\")},qt=/^[^\"\\\\\\0-\\x1F\\x7F]/,ir=Kn(['\"',\"\\\\\",[\"\\0\",\"\u001f\"],\"\\x7F\"],!0,!1),Pt='\\\\\"',gn=dn('\\\\\"',!1),Pr=function(){return'\"'},Ir=\"\\\\\\\\\",Or=dn(\"\\\\\\\\\",!1),on=function(){return\"\\\\\"},ai=\"\\\\/\",Io=dn(\"\\\\/\",!1),rs=function(){return\"/\"},$s=\"\\\\b\",Co=dn(\"\\\\b\",!1),ji=function(){return\"\\b\"},eo=\"\\\\f\",wo=dn(\"\\\\f\",!1),QA=function(){return\"\\f\"},Af=\"\\\\n\",dh=dn(\"\\\\n\",!1),mh=function(){return`\n`},to=\"\\\\r\",jn=dn(\"\\\\r\",!1),Ts=function(){return\"\\r\"},ro=\"\\\\t\",ou=dn(\"\\\\t\",!1),au=function(){return\"\t\"},lu=\"\\\\u\",TA=dn(\"\\\\u\",!1),RA=function(te,Ee,Oe,dt){return String.fromCharCode(parseInt(`0x${te}${Ee}${Oe}${dt}`))},oa=/^[0-9a-fA-F]/,aa=Kn([[\"0\",\"9\"],[\"a\",\"f\"],[\"A\",\"F\"]],!1,!1),FA=Oa(\"blank space\"),gr=/^[ \\t]/,Bo=Kn([\" \",\"\t\"],!1,!1),Me=Oa(\"white space\"),cu=/^[ \\t\\n\\r]/,Cr=Kn([\" \",\"\t\",`\n`,\"\\r\"],!1,!1),pf=`\\r\n`,NA=dn(`\\r\n`,!1),OA=`\n`,uu=dn(`\n`,!1),fu=\"\\r\",oc=dn(\"\\r\",!1),ve=0,Nt=0,ac=[{line:1,column:1}],Oi=0,no=[],Rt=0,xn;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function la(){return t.substring(Nt,ve)}function Gi(){return Ma(Nt,ve)}function Li(te,Ee){throw Ee=Ee!==void 0?Ee:Ma(Nt,ve),hf([Oa(te)],t.substring(Nt,ve),Ee)}function Na(te,Ee){throw Ee=Ee!==void 0?Ee:Ma(Nt,ve),Ua(te,Ee)}function dn(te,Ee){return{type:\"literal\",text:te,ignoreCase:Ee}}function Kn(te,Ee,Oe){return{type:\"class\",parts:te,inverted:Ee,ignoreCase:Oe}}function Au(){return{type:\"any\"}}function yh(){return{type:\"end\"}}function Oa(te){return{type:\"other\",description:te}}function La(te){var Ee=ac[te],Oe;if(Ee)return Ee;for(Oe=te-1;!ac[Oe];)Oe--;for(Ee=ac[Oe],Ee={line:Ee.line,column:Ee.column};Oe<te;)t.charCodeAt(Oe)===10?(Ee.line++,Ee.column=1):Ee.column++,Oe++;return ac[te]=Ee,Ee}function Ma(te,Ee){var Oe=La(te),dt=La(Ee);return{start:{offset:te,line:Oe.line,column:Oe.column},end:{offset:Ee,line:dt.line,column:dt.column}}}function $e(te){ve<Oi||(ve>Oi&&(Oi=ve,no=[]),no.push(te))}function Ua(te,Ee){return new Rd(te,null,null,Ee)}function hf(te,Ee,Oe){return new Rd(Rd.buildMessage(te,Ee),te,Ee,Oe)}function lc(){var te;return te=LA(),te}function wn(){var te,Ee,Oe;for(te=ve,Ee=[],Oe=ca();Oe!==r;)Ee.push(Oe),Oe=ca();return Ee!==r&&(Nt=te,Ee=n(Ee)),te=Ee,te}function ca(){var te,Ee,Oe,dt,Et;return te=ve,Ee=Bl(),Ee!==r?(t.charCodeAt(ve)===45?(Oe=c,ve++):(Oe=r,Rt===0&&$e(f)),Oe!==r?(dt=Qn(),dt!==r?(Et=ua(),Et!==r?(Nt=te,Ee=p(Et),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te}function LA(){var te,Ee,Oe;for(te=ve,Ee=[],Oe=MA();Oe!==r;)Ee.push(Oe),Oe=MA();return Ee!==r&&(Nt=te,Ee=h(Ee)),te=Ee,te}function MA(){var te,Ee,Oe,dt,Et,bt,tr,An,li;if(te=ve,Ee=Qn(),Ee===r&&(Ee=null),Ee!==r){if(Oe=ve,t.charCodeAt(ve)===35?(dt=E,ve++):(dt=r,Rt===0&&$e(C)),dt!==r){if(Et=[],bt=ve,tr=ve,Rt++,An=st(),Rt--,An===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(An=t.charAt(ve),ve++):(An=r,Rt===0&&$e(S)),An!==r?(tr=[tr,An],bt=tr):(ve=bt,bt=r)):(ve=bt,bt=r),bt!==r)for(;bt!==r;)Et.push(bt),bt=ve,tr=ve,Rt++,An=st(),Rt--,An===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(An=t.charAt(ve),ve++):(An=r,Rt===0&&$e(S)),An!==r?(tr=[tr,An],bt=tr):(ve=bt,bt=r)):(ve=bt,bt=r);else Et=r;Et!==r?(dt=[dt,Et],Oe=dt):(ve=Oe,Oe=r)}else ve=Oe,Oe=r;if(Oe===r&&(Oe=null),Oe!==r){if(dt=[],Et=Ke(),Et!==r)for(;Et!==r;)dt.push(Et),Et=Ke();else dt=r;dt!==r?(Nt=te,Ee=P(),te=Ee):(ve=te,te=r)}else ve=te,te=r}else ve=te,te=r;if(te===r&&(te=ve,Ee=Bl(),Ee!==r?(Oe=Ha(),Oe!==r?(dt=Qn(),dt===r&&(dt=null),dt!==r?(t.charCodeAt(ve)===58?(Et=I,ve++):(Et=r,Rt===0&&$e(R)),Et!==r?(bt=Qn(),bt===r&&(bt=null),bt!==r?(tr=ua(),tr!==r?(Nt=te,Ee=N(Oe,tr),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,Ee=Bl(),Ee!==r?(Oe=ns(),Oe!==r?(dt=Qn(),dt===r&&(dt=null),dt!==r?(t.charCodeAt(ve)===58?(Et=I,ve++):(Et=r,Rt===0&&$e(R)),Et!==r?(bt=Qn(),bt===r&&(bt=null),bt!==r?(tr=ua(),tr!==r?(Nt=te,Ee=N(Oe,tr),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r))){if(te=ve,Ee=Bl(),Ee!==r)if(Oe=ns(),Oe!==r)if(dt=Qn(),dt!==r)if(Et=pu(),Et!==r){if(bt=[],tr=Ke(),tr!==r)for(;tr!==r;)bt.push(tr),tr=Ke();else bt=r;bt!==r?(Nt=te,Ee=N(Oe,Et),te=Ee):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r;else ve=te,te=r;else ve=te,te=r;if(te===r)if(te=ve,Ee=Bl(),Ee!==r)if(Oe=ns(),Oe!==r){if(dt=[],Et=ve,bt=Qn(),bt===r&&(bt=null),bt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Rt===0&&$e(W)),tr!==r?(An=Qn(),An===r&&(An=null),An!==r?(li=ns(),li!==r?(Nt=Et,bt=ee(Oe,li),Et=bt):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r),Et!==r)for(;Et!==r;)dt.push(Et),Et=ve,bt=Qn(),bt===r&&(bt=null),bt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Rt===0&&$e(W)),tr!==r?(An=Qn(),An===r&&(An=null),An!==r?(li=ns(),li!==r?(Nt=Et,bt=ee(Oe,li),Et=bt):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r);else dt=r;dt!==r?(Et=Qn(),Et===r&&(Et=null),Et!==r?(t.charCodeAt(ve)===58?(bt=I,ve++):(bt=r,Rt===0&&$e(R)),bt!==r?(tr=Qn(),tr===r&&(tr=null),tr!==r?(An=ua(),An!==r?(Nt=te,Ee=ie(Oe,dt,An),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r}return te}function ua(){var te,Ee,Oe,dt,Et,bt,tr;if(te=ve,Ee=ve,Rt++,Oe=ve,dt=st(),dt!==r?(Et=Mt(),Et!==r?(t.charCodeAt(ve)===45?(bt=c,ve++):(bt=r,Rt===0&&$e(f)),bt!==r?(tr=Qn(),tr!==r?(dt=[dt,Et,bt,tr],Oe=dt):(ve=Oe,Oe=r)):(ve=Oe,Oe=r)):(ve=Oe,Oe=r)):(ve=Oe,Oe=r),Rt--,Oe!==r?(ve=Ee,Ee=void 0):Ee=r,Ee!==r?(Oe=Ke(),Oe!==r?(dt=kn(),dt!==r?(Et=wn(),Et!==r?(bt=fa(),bt!==r?(Nt=te,Ee=ue(Et),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,Ee=st(),Ee!==r?(Oe=kn(),Oe!==r?(dt=LA(),dt!==r?(Et=fa(),Et!==r?(Nt=te,Ee=ue(dt),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r))if(te=ve,Ee=cc(),Ee!==r){if(Oe=[],dt=Ke(),dt!==r)for(;dt!==r;)Oe.push(dt),dt=Ke();else Oe=r;Oe!==r?(Nt=te,Ee=le(Ee),te=Ee):(ve=te,te=r)}else ve=te,te=r;return te}function Bl(){var te,Ee,Oe;for(Rt++,te=ve,Ee=[],t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Rt===0&&$e(Be));Oe!==r;)Ee.push(Oe),t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Rt===0&&$e(Be));return Ee!==r?(Nt=ve,Oe=Ce(Ee),Oe?Oe=void 0:Oe=r,Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)):(ve=te,te=r),Rt--,te===r&&(Ee=r,Rt===0&&$e(me)),te}function Mt(){var te,Ee,Oe;for(te=ve,Ee=[],t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Rt===0&&$e(Be));Oe!==r;)Ee.push(Oe),t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Rt===0&&$e(Be));return Ee!==r?(Nt=ve,Oe=g(Ee),Oe?Oe=void 0:Oe=r,Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)):(ve=te,te=r),te}function kn(){var te;return Nt=ve,te=we(),te?te=void 0:te=r,te}function fa(){var te;return Nt=ve,te=ye(),te?te=void 0:te=r,te}function Ha(){var te;return te=vl(),te===r&&(te=uc()),te}function ns(){var te,Ee,Oe;if(te=vl(),te===r){if(te=ve,Ee=[],Oe=ja(),Oe!==r)for(;Oe!==r;)Ee.push(Oe),Oe=ja();else Ee=r;Ee!==r&&(Nt=te,Ee=Ae()),te=Ee}return te}function cc(){var te;return te=Mi(),te===r&&(te=Is(),te===r&&(te=vl(),te===r&&(te=uc()))),te}function pu(){var te;return te=Mi(),te===r&&(te=vl(),te===r&&(te=ja())),te}function uc(){var te,Ee,Oe,dt,Et,bt;if(Rt++,te=ve,Z.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Rt===0&&$e(De)),Ee!==r){for(Oe=[],dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Re.test(t.charAt(ve))?(bt=t.charAt(ve),ve++):(bt=r,Rt===0&&$e(mt)),bt!==r?(Et=[Et,bt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);dt!==r;)Oe.push(dt),dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Re.test(t.charAt(ve))?(bt=t.charAt(ve),ve++):(bt=r,Rt===0&&$e(mt)),bt!==r?(Et=[Et,bt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);Oe!==r?(Nt=te,Ee=j(),te=Ee):(ve=te,te=r)}else ve=te,te=r;return Rt--,te===r&&(Ee=r,Rt===0&&$e(se)),te}function ja(){var te,Ee,Oe,dt,Et;if(te=ve,t.substr(ve,2)===rt?(Ee=rt,ve+=2):(Ee=r,Rt===0&&$e(Fe)),Ee===r&&(Ee=null),Ee!==r)if(Ne.test(t.charAt(ve))?(Oe=t.charAt(ve),ve++):(Oe=r,Rt===0&&$e(Pe)),Oe!==r){for(dt=[],Ve.test(t.charAt(ve))?(Et=t.charAt(ve),ve++):(Et=r,Rt===0&&$e(ke));Et!==r;)dt.push(Et),Ve.test(t.charAt(ve))?(Et=t.charAt(ve),ve++):(Et=r,Rt===0&&$e(ke));dt!==r?(Nt=te,Ee=j(),te=Ee):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r;return te}function Mi(){var te,Ee;return te=ve,t.substr(ve,4)===it?(Ee=it,ve+=4):(Ee=r,Rt===0&&$e(Ue)),Ee!==r&&(Nt=te,Ee=x()),te=Ee,te}function Is(){var te,Ee;return te=ve,t.substr(ve,4)===w?(Ee=w,ve+=4):(Ee=r,Rt===0&&$e(b)),Ee!==r&&(Nt=te,Ee=y()),te=Ee,te===r&&(te=ve,t.substr(ve,5)===F?(Ee=F,ve+=5):(Ee=r,Rt===0&&$e(z)),Ee!==r&&(Nt=te,Ee=X()),te=Ee),te}function vl(){var te,Ee,Oe,dt;return Rt++,te=ve,t.charCodeAt(ve)===34?(Ee=oe,ve++):(Ee=r,Rt===0&&$e(xe)),Ee!==r?(t.charCodeAt(ve)===34?(Oe=oe,ve++):(Oe=r,Rt===0&&$e(xe)),Oe!==r?(Nt=te,Ee=Te(),te=Ee):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,t.charCodeAt(ve)===34?(Ee=oe,ve++):(Ee=r,Rt===0&&$e(xe)),Ee!==r?(Oe=gf(),Oe!==r?(t.charCodeAt(ve)===34?(dt=oe,ve++):(dt=r,Rt===0&&$e(xe)),dt!==r?(Nt=te,Ee=lt(Oe),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)),Rt--,te===r&&(Ee=r,Rt===0&&$e($)),te}function gf(){var te,Ee,Oe;if(te=ve,Ee=[],Oe=fc(),Oe!==r)for(;Oe!==r;)Ee.push(Oe),Oe=fc();else Ee=r;return Ee!==r&&(Nt=te,Ee=Ct(Ee)),te=Ee,te}function fc(){var te,Ee,Oe,dt,Et,bt;return qt.test(t.charAt(ve))?(te=t.charAt(ve),ve++):(te=r,Rt===0&&$e(ir)),te===r&&(te=ve,t.substr(ve,2)===Pt?(Ee=Pt,ve+=2):(Ee=r,Rt===0&&$e(gn)),Ee!==r&&(Nt=te,Ee=Pr()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===Ir?(Ee=Ir,ve+=2):(Ee=r,Rt===0&&$e(Or)),Ee!==r&&(Nt=te,Ee=on()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===ai?(Ee=ai,ve+=2):(Ee=r,Rt===0&&$e(Io)),Ee!==r&&(Nt=te,Ee=rs()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===$s?(Ee=$s,ve+=2):(Ee=r,Rt===0&&$e(Co)),Ee!==r&&(Nt=te,Ee=ji()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===eo?(Ee=eo,ve+=2):(Ee=r,Rt===0&&$e(wo)),Ee!==r&&(Nt=te,Ee=QA()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===Af?(Ee=Af,ve+=2):(Ee=r,Rt===0&&$e(dh)),Ee!==r&&(Nt=te,Ee=mh()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===to?(Ee=to,ve+=2):(Ee=r,Rt===0&&$e(jn)),Ee!==r&&(Nt=te,Ee=Ts()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===ro?(Ee=ro,ve+=2):(Ee=r,Rt===0&&$e(ou)),Ee!==r&&(Nt=te,Ee=au()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===lu?(Ee=lu,ve+=2):(Ee=r,Rt===0&&$e(TA)),Ee!==r?(Oe=wi(),Oe!==r?(dt=wi(),dt!==r?(Et=wi(),Et!==r?(bt=wi(),bt!==r?(Nt=te,Ee=RA(Oe,dt,Et,bt),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)))))))))),te}function wi(){var te;return oa.test(t.charAt(ve))?(te=t.charAt(ve),ve++):(te=r,Rt===0&&$e(aa)),te}function Qn(){var te,Ee;if(Rt++,te=[],gr.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Rt===0&&$e(Bo)),Ee!==r)for(;Ee!==r;)te.push(Ee),gr.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Rt===0&&$e(Bo));else te=r;return Rt--,te===r&&(Ee=r,Rt===0&&$e(FA)),te}function Ac(){var te,Ee;if(Rt++,te=[],cu.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Rt===0&&$e(Cr)),Ee!==r)for(;Ee!==r;)te.push(Ee),cu.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Rt===0&&$e(Cr));else te=r;return Rt--,te===r&&(Ee=r,Rt===0&&$e(Me)),te}function Ke(){var te,Ee,Oe,dt,Et,bt;if(te=ve,Ee=st(),Ee!==r){for(Oe=[],dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(bt=st(),bt!==r?(Et=[Et,bt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);dt!==r;)Oe.push(dt),dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(bt=st(),bt!==r?(Et=[Et,bt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)}else ve=te,te=r;return te}function st(){var te;return t.substr(ve,2)===pf?(te=pf,ve+=2):(te=r,Rt===0&&$e(NA)),te===r&&(t.charCodeAt(ve)===10?(te=OA,ve++):(te=r,Rt===0&&$e(uu)),te===r&&(t.charCodeAt(ve)===13?(te=fu,ve++):(te=r,Rt===0&&$e(oc)))),te}let St=2,lr=0;if(xn=a(),xn!==r&&ve===t.length)return xn;throw xn!==r&&ve<t.length&&$e(yh()),hf(no,Oi<t.length?t.charAt(Oi):null,Oi<t.length?Ma(Oi,Oi+1):Ma(Oi,Oi))}mre.exports={SyntaxError:Rd,parse:EWe}});function Ire(t){return t.match(IWe)?t:JSON.stringify(t)}function wre(t){return typeof t>\"u\"?!0:typeof t==\"object\"&&t!==null&&!Array.isArray(t)?Object.keys(t).every(e=>wre(t[e])):!1}function i_(t,e,r){if(t===null)return`null\n`;if(typeof t==\"number\"||typeof t==\"boolean\")return`${t.toString()}\n`;if(typeof t==\"string\")return`${Ire(t)}\n`;if(Array.isArray(t)){if(t.length===0)return`[]\n`;let s=\"  \".repeat(e);return`\n${t.map(n=>`${s}- ${i_(n,e+1,!1)}`).join(\"\")}`}if(typeof t==\"object\"&&t){let[s,a]=t instanceof Sx?[t.data,!1]:[t,!0],n=\"  \".repeat(e),c=Object.keys(s);a&&c.sort((p,h)=>{let E=Ere.indexOf(p),C=Ere.indexOf(h);return E===-1&&C===-1?p<h?-1:p>h?1:0:E!==-1&&C===-1?-1:E===-1&&C!==-1?1:E-C});let f=c.filter(p=>!wre(s[p])).map((p,h)=>{let E=s[p],C=Ire(p),S=i_(E,e+1,!0),P=h>0||r?n:\"\",I=C.length>1024?`? ${C}\n${P}:`:`${C}:`,R=S.startsWith(`\n`)?S:` ${S}`;return`${P}${I}${R}`}).join(e===0?`\n`:\"\")||`\n`;return r?`\n${f}`:`${f}`}throw new Error(`Unsupported value type (${t})`)}function nl(t){try{let e=i_(t,0,!1);return e!==`\n`?e:\"\"}catch(e){throw e.location&&(e.message=e.message.replace(/(\\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function CWe(t){return t.endsWith(`\n`)||(t+=`\n`),(0,Cre.parse)(t)}function BWe(t){if(wWe.test(t))return CWe(t);let e=(0,Dx.safeLoad)(t,{schema:Dx.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!=\"object\")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error(\"Expected an indexed object, got an array instead. Does your file follow Yaml's rules?\");return e}function ls(t){return BWe(t)}var Dx,Cre,IWe,Ere,Sx,wWe,Bre=Xe(()=>{Dx=ut(dre()),Cre=ut(yre()),IWe=/^(?![-?:,\\][{}#&*!|>'\"%@` \\t\\r\\n]).([ \\t]*(?![,\\][{}:# \\t\\r\\n]).)*$/,Ere=[\"__metadata\",\"version\",\"resolution\",\"dependencies\",\"peerDependencies\",\"dependenciesMeta\",\"peerDependenciesMeta\",\"binaries\"],Sx=class{constructor(e){this.data=e}};nl.PreserveOrdering=Sx;wWe=/^(#.*(\\r?\\n))*?#\\s+yarn\\s+lockfile\\s+v1\\r?\\n/i});var J2={};Vt(J2,{parseResolution:()=>px,parseShell:()=>ux,parseSyml:()=>ls,stringifyArgument:()=>qU,stringifyArgumentSegment:()=>WU,stringifyArithmeticExpression:()=>Ax,stringifyCommand:()=>GU,stringifyCommandChain:()=>AE,stringifyCommandChainThen:()=>jU,stringifyCommandLine:()=>fx,stringifyCommandLineThen:()=>HU,stringifyEnvSegment:()=>cx,stringifyRedirectArgument:()=>H2,stringifyResolution:()=>hx,stringifyShell:()=>fE,stringifyShellLine:()=>fE,stringifySyml:()=>nl,stringifyValueArgument:()=>vd});var wc=Xe(()=>{wee();Dee();Bre()});var Sre=_((UQt,s_)=>{\"use strict\";var vWe=t=>{let e=!1,r=!1,s=!1;for(let a=0;a<t.length;a++){let n=t[a];e&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(t=t.slice(0,a)+\"-\"+t.slice(a),e=!1,s=r,r=!0,a++):r&&s&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(t=t.slice(0,a-1)+\"-\"+t.slice(a-1),s=r,r=!1,e=!0):(e=n.toLowerCase()===n&&n.toUpperCase()!==n,s=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return t},vre=(t,e)=>{if(!(typeof t==\"string\"||Array.isArray(t)))throw new TypeError(\"Expected the input to be `string | string[]`\");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join(\"-\"):t=t.trim(),t.length===0?\"\":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=vWe(t)),t=t.replace(/^[_.\\- ]+/,\"\").toLowerCase().replace(/[_.\\- ]+(\\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\\d+(\\w|$)/g,a=>a.toUpperCase()),r(t))};s_.exports=vre;s_.exports.default=vre});var Dre=_((_Qt,SWe)=>{SWe.exports=[{name:\"Agola CI\",constant:\"AGOLA\",env:\"AGOLA_GIT_REF\",pr:\"AGOLA_PULL_REQUEST_ID\"},{name:\"Appcircle\",constant:\"APPCIRCLE\",env:\"AC_APPCIRCLE\"},{name:\"AppVeyor\",constant:\"APPVEYOR\",env:\"APPVEYOR\",pr:\"APPVEYOR_PULL_REQUEST_NUMBER\"},{name:\"AWS CodeBuild\",constant:\"CODEBUILD\",env:\"CODEBUILD_BUILD_ARN\"},{name:\"Azure Pipelines\",constant:\"AZURE_PIPELINES\",env:\"TF_BUILD\",pr:{BUILD_REASON:\"PullRequest\"}},{name:\"Bamboo\",constant:\"BAMBOO\",env:\"bamboo_planKey\"},{name:\"Bitbucket Pipelines\",constant:\"BITBUCKET\",env:\"BITBUCKET_COMMIT\",pr:\"BITBUCKET_PR_ID\"},{name:\"Bitrise\",constant:\"BITRISE\",env:\"BITRISE_IO\",pr:\"BITRISE_PULL_REQUEST\"},{name:\"Buddy\",constant:\"BUDDY\",env:\"BUDDY_WORKSPACE_ID\",pr:\"BUDDY_EXECUTION_PULL_REQUEST_ID\"},{name:\"Buildkite\",constant:\"BUILDKITE\",env:\"BUILDKITE\",pr:{env:\"BUILDKITE_PULL_REQUEST\",ne:\"false\"}},{name:\"CircleCI\",constant:\"CIRCLE\",env:\"CIRCLECI\",pr:\"CIRCLE_PULL_REQUEST\"},{name:\"Cirrus CI\",constant:\"CIRRUS\",env:\"CIRRUS_CI\",pr:\"CIRRUS_PR\"},{name:\"Codefresh\",constant:\"CODEFRESH\",env:\"CF_BUILD_ID\",pr:{any:[\"CF_PULL_REQUEST_NUMBER\",\"CF_PULL_REQUEST_ID\"]}},{name:\"Codemagic\",constant:\"CODEMAGIC\",env:\"CM_BUILD_ID\",pr:\"CM_PULL_REQUEST\"},{name:\"Codeship\",constant:\"CODESHIP\",env:{CI_NAME:\"codeship\"}},{name:\"Drone\",constant:\"DRONE\",env:\"DRONE\",pr:{DRONE_BUILD_EVENT:\"pull_request\"}},{name:\"dsari\",constant:\"DSARI\",env:\"DSARI\"},{name:\"Earthly\",constant:\"EARTHLY\",env:\"EARTHLY_CI\"},{name:\"Expo Application Services\",constant:\"EAS\",env:\"EAS_BUILD\"},{name:\"Gerrit\",constant:\"GERRIT\",env:\"GERRIT_PROJECT\"},{name:\"Gitea Actions\",constant:\"GITEA_ACTIONS\",env:\"GITEA_ACTIONS\"},{name:\"GitHub Actions\",constant:\"GITHUB_ACTIONS\",env:\"GITHUB_ACTIONS\",pr:{GITHUB_EVENT_NAME:\"pull_request\"}},{name:\"GitLab CI\",constant:\"GITLAB\",env:\"GITLAB_CI\",pr:\"CI_MERGE_REQUEST_ID\"},{name:\"GoCD\",constant:\"GOCD\",env:\"GO_PIPELINE_LABEL\"},{name:\"Google Cloud Build\",constant:\"GOOGLE_CLOUD_BUILD\",env:\"BUILDER_OUTPUT\"},{name:\"Harness CI\",constant:\"HARNESS\",env:\"HARNESS_BUILD_ID\"},{name:\"Heroku\",constant:\"HEROKU\",env:{env:\"NODE\",includes:\"/app/.heroku/node/bin/node\"}},{name:\"Hudson\",constant:\"HUDSON\",env:\"HUDSON_URL\"},{name:\"Jenkins\",constant:\"JENKINS\",env:[\"JENKINS_URL\",\"BUILD_ID\"],pr:{any:[\"ghprbPullId\",\"CHANGE_ID\"]}},{name:\"LayerCI\",constant:\"LAYERCI\",env:\"LAYERCI\",pr:\"LAYERCI_PULL_REQUEST\"},{name:\"Magnum CI\",constant:\"MAGNUM\",env:\"MAGNUM\"},{name:\"Netlify CI\",constant:\"NETLIFY\",env:\"NETLIFY\",pr:{env:\"PULL_REQUEST\",ne:\"false\"}},{name:\"Nevercode\",constant:\"NEVERCODE\",env:\"NEVERCODE\",pr:{env:\"NEVERCODE_PULL_REQUEST\",ne:\"false\"}},{name:\"Prow\",constant:\"PROW\",env:\"PROW_JOB_ID\"},{name:\"ReleaseHub\",constant:\"RELEASEHUB\",env:\"RELEASE_BUILD_ID\"},{name:\"Render\",constant:\"RENDER\",env:\"RENDER\",pr:{IS_PULL_REQUEST:\"true\"}},{name:\"Sail CI\",constant:\"SAIL\",env:\"SAILCI\",pr:\"SAIL_PULL_REQUEST_NUMBER\"},{name:\"Screwdriver\",constant:\"SCREWDRIVER\",env:\"SCREWDRIVER\",pr:{env:\"SD_PULL_REQUEST\",ne:\"false\"}},{name:\"Semaphore\",constant:\"SEMAPHORE\",env:\"SEMAPHORE\",pr:\"PULL_REQUEST_NUMBER\"},{name:\"Sourcehut\",constant:\"SOURCEHUT\",env:{CI_NAME:\"sourcehut\"}},{name:\"Strider CD\",constant:\"STRIDER\",env:\"STRIDER\"},{name:\"TaskCluster\",constant:\"TASKCLUSTER\",env:[\"TASK_ID\",\"RUN_ID\"]},{name:\"TeamCity\",constant:\"TEAMCITY\",env:\"TEAMCITY_VERSION\"},{name:\"Travis CI\",constant:\"TRAVIS\",env:\"TRAVIS\",pr:{env:\"TRAVIS_PULL_REQUEST\",ne:\"false\"}},{name:\"Vela\",constant:\"VELA\",env:\"VELA\",pr:{VELA_PULL_REQUEST:\"1\"}},{name:\"Vercel\",constant:\"VERCEL\",env:{any:[\"NOW_BUILDER\",\"VERCEL\"]},pr:\"VERCEL_GIT_PULL_REQUEST_ID\"},{name:\"Visual Studio App Center\",constant:\"APPCENTER\",env:\"APPCENTER_BUILD_ID\"},{name:\"Woodpecker\",constant:\"WOODPECKER\",env:{CI:\"woodpecker\"},pr:{CI_BUILD_EVENT:\"pull_request\"}},{name:\"Xcode Cloud\",constant:\"XCODE_CLOUD\",env:\"CI_XCODE_PROJECT\",pr:\"CI_PULL_REQUEST_NUMBER\"},{name:\"Xcode Server\",constant:\"XCODE_SERVER\",env:\"XCS\"}]});var Fd=_(Ml=>{\"use strict\";var Pre=Dre(),Ds=process.env;Object.defineProperty(Ml,\"_vendors\",{value:Pre.map(function(t){return t.constant})});Ml.name=null;Ml.isPR=null;Pre.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(s){return bre(s)});if(Ml[t.constant]=r,!!r)switch(Ml.name=t.name,typeof t.pr){case\"string\":Ml.isPR=!!Ds[t.pr];break;case\"object\":\"env\"in t.pr?Ml.isPR=t.pr.env in Ds&&Ds[t.pr.env]!==t.pr.ne:\"any\"in t.pr?Ml.isPR=t.pr.any.some(function(s){return!!Ds[s]}):Ml.isPR=bre(t.pr);break;default:Ml.isPR=null}});Ml.isCI=!!(Ds.CI!==\"false\"&&(Ds.BUILD_ID||Ds.BUILD_NUMBER||Ds.CI||Ds.CI_APP_ID||Ds.CI_BUILD_ID||Ds.CI_BUILD_NUMBER||Ds.CI_NAME||Ds.CONTINUOUS_INTEGRATION||Ds.RUN_ID||Ml.name));function bre(t){return typeof t==\"string\"?!!Ds[t]:\"env\"in t?Ds[t.env]&&Ds[t.env].includes(t.includes):\"any\"in t?t.any.some(function(e){return!!Ds[e]}):Object.keys(t).every(function(e){return Ds[e]===t[e]})}});var ei,En,Nd,o_,bx,xre,a_,l_,Px=Xe(()=>{(function(t){t.StartOfInput=\"\\0\",t.EndOfInput=\"\u0001\",t.EndOfPartialInput=\"\u0002\"})(ei||(ei={}));(function(t){t[t.InitialNode=0]=\"InitialNode\",t[t.SuccessNode=1]=\"SuccessNode\",t[t.ErrorNode=2]=\"ErrorNode\",t[t.CustomNode=3]=\"CustomNode\"})(En||(En={}));Nd=-1,o_=/^(-h|--help)(?:=([0-9]+))?$/,bx=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,xre=/^-[a-zA-Z]{2,}$/,a_=/^([^=]+)=([\\s\\S]*)$/,l_=process.env.DEBUG_CLI===\"1\"});var nt,IE,xx,c_,kx=Xe(()=>{Px();nt=class extends Error{constructor(e){super(e),this.clipanion={type:\"usage\"},this.name=\"UsageError\"}},IE=class extends Error{constructor(e,r){if(super(),this.input=e,this.candidates=r,this.clipanion={type:\"none\"},this.name=\"UnknownSyntaxError\",this.candidates.length===0)this.message=\"Command not found, but we're not sure what's the alternative.\";else if(this.candidates.every(s=>s.reason!==null&&s.reason===r[0].reason)){let[{reason:s}]=this.candidates;this.message=`${s}\n\n${this.candidates.map(({usage:a})=>`$ ${a}`).join(`\n`)}`}else if(this.candidates.length===1){let[{usage:s}]=this.candidates;this.message=`Command not found; did you mean:\n\n$ ${s}\n${c_(e)}`}else this.message=`Command not found; did you mean one of:\n\n${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`\n`)}\n\n${c_(e)}`}},xx=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:\"none\"},this.name=\"AmbiguousSyntaxError\",this.message=`Cannot find which to pick amongst the following alternatives:\n\n${this.usages.map((s,a)=>`${`${a}.`.padStart(4)} ${s}`).join(`\n`)}\n\n${c_(e)}`}},c_=t=>`While running ${t.filter(e=>e!==ei.EndOfInput&&e!==ei.EndOfPartialInput).map(e=>{let r=JSON.stringify(e);return e.match(/\\s/)||e.length===0||r!==`\"${e}\"`?r:e}).join(\" \")}`});function DWe(t){let e=t.split(`\n`),r=e.filter(a=>a.match(/\\S/)),s=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(s).trimRight()).join(`\n`)}function Ho(t,{format:e,paragraphs:r}){return t=t.replace(/\\r\\n?/g,`\n`),t=DWe(t),t=t.replace(/^\\n+|\\n+$/g,\"\"),t=t.replace(/^(\\s*)-([^\\n]*?)\\n+/gm,`$1-$2\n\n`),t=t.replace(/\\n(\\n)?\\n*/g,(s,a)=>a||\" \"),r&&(t=t.split(/\\n/).map(s=>{let a=s.match(/^\\s*[*-][\\t ]+(.*)/);if(!a)return s.match(/(.{1,80})(?: |$)/g).join(`\n`);let n=s.length-s.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,\"g\")).map((c,f)=>\" \".repeat(n)+(f===0?\"- \":\"  \")+c).join(`\n`)}).join(`\n\n`)),t=t.replace(/(`+)((?:.|[\\n])*?)\\1/g,(s,a,n)=>e.code(a+n+a)),t=t.replace(/(\\*\\*)((?:.|[\\n])*?)\\1/g,(s,a,n)=>e.bold(a+n+a)),t?`${t}\n`:\"\"}var u_,kre,Qre,f_=Xe(()=>{u_=Array(80).fill(\"\\u2501\");for(let t=0;t<=24;++t)u_[u_.length-t]=`\\x1B[38;5;${232+t}m\\u2501`;kre={header:t=>`\\x1B[1m\\u2501\\u2501\\u2501 ${t}${t.length<75?` ${u_.slice(t.length+5).join(\"\")}`:\":\"}\\x1B[0m`,bold:t=>`\\x1B[1m${t}\\x1B[22m`,error:t=>`\\x1B[31m\\x1B[1m${t}\\x1B[22m\\x1B[39m`,code:t=>`\\x1B[36m${t}\\x1B[39m`},Qre={header:t=>t,bold:t=>t,error:t=>t,code:t=>t}});function ya(t){return{...t,[K2]:!0}}function Gf(t,e){return typeof t>\"u\"?[t,e]:typeof t==\"object\"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function Qx(t,{mergeName:e=!1}={}){let r=t.match(/^([^:]+): (.*)$/m);if(!r)return\"validation failed\";let[,s,a]=r;return e&&(a=a[0].toLowerCase()+a.slice(1)),a=s!==\".\"||!e?`${s.replace(/^\\.(\\[|$)/,\"$1\")}: ${a}`:`: ${a}`,a}function z2(t,e){return e.length===1?new nt(`${t}${Qx(e[0],{mergeName:!0})}`):new nt(`${t}:\n${e.map(r=>`\n- ${Qx(r)}`).join(\"\")}`)}function Od(t,e,r){if(typeof r>\"u\")return e;let s=[],a=[],n=f=>{let p=e;return e=f,n.bind(null,p)};if(!r(e,{errors:s,coercions:a,coercion:n}))throw z2(`Invalid value for ${t}`,s);for(let[,f]of a)f();return e}var K2,Cp=Xe(()=>{kx();K2=Symbol(\"clipanion/isOption\")});var Ea={};Vt(Ea,{KeyRelationship:()=>qf,TypeAssertionError:()=>o0,applyCascade:()=>$2,as:()=>WWe,assert:()=>jWe,assertWithErrors:()=>GWe,cascade:()=>Nx,fn:()=>YWe,hasAtLeastOneKey:()=>y_,hasExactLength:()=>Ore,hasForbiddenKeys:()=>fYe,hasKeyRelationship:()=>tB,hasMaxLength:()=>JWe,hasMinLength:()=>VWe,hasMutuallyExclusiveKeys:()=>AYe,hasRequiredKeys:()=>uYe,hasUniqueItems:()=>KWe,isArray:()=>Tx,isAtLeast:()=>d_,isAtMost:()=>ZWe,isBase64:()=>oYe,isBoolean:()=>FWe,isDate:()=>OWe,isDict:()=>UWe,isEnum:()=>fo,isHexColor:()=>sYe,isISO8601:()=>iYe,isInExclusiveRange:()=>eYe,isInInclusiveRange:()=>$We,isInstanceOf:()=>HWe,isInteger:()=>m_,isJSON:()=>aYe,isLiteral:()=>Rre,isLowerCase:()=>tYe,isMap:()=>MWe,isNegative:()=>zWe,isNullable:()=>cYe,isNumber:()=>h_,isObject:()=>Fre,isOneOf:()=>g_,isOptional:()=>lYe,isPartial:()=>_We,isPayload:()=>NWe,isPositive:()=>XWe,isRecord:()=>Fx,isSet:()=>LWe,isString:()=>wE,isTuple:()=>Rx,isUUID4:()=>nYe,isUnknown:()=>p_,isUpperCase:()=>rYe,makeTrait:()=>Nre,makeValidator:()=>Wr,matchesRegExp:()=>Z2,softAssert:()=>qWe});function ti(t){return t===null?\"null\":t===void 0?\"undefined\":t===\"\"?\"an empty string\":typeof t==\"symbol\"?`<${t.toString()}>`:Array.isArray(t)?\"an array\":JSON.stringify(t)}function CE(t,e){if(t.length===0)return\"nothing\";if(t.length===1)return ti(t[0]);let r=t.slice(0,-1),s=t[t.length-1],a=t.length>2?`, ${e} `:` ${e} `;return`${r.map(n=>ti(n)).join(\", \")}${a}${ti(s)}`}function s0(t,e){var r,s,a;return typeof e==\"number\"?`${(r=t?.p)!==null&&r!==void 0?r:\".\"}[${e}]`:bWe.test(e)?`${(s=t?.p)!==null&&s!==void 0?s:\"\"}.${e}`:`${(a=t?.p)!==null&&a!==void 0?a:\".\"}[${JSON.stringify(e)}]`}function A_(t,e,r){return t===1?e:r}function mr({errors:t,p:e}={},r){return t?.push(`${e??\".\"}: ${r}`),!1}function TWe(t,e){return r=>{t[e]=r}}function Wf(t,e){return r=>{let s=t[e];return t[e]=r,Wf(t,e).bind(null,s)}}function X2(t,e,r){let s=()=>(t(r()),a),a=()=>(t(e),s);return s}function p_(){return Wr({test:(t,e)=>!0})}function Rre(t){return Wr({test:(e,r)=>e!==t?mr(r,`Expected ${ti(t)} (got ${ti(e)})`):!0})}function wE(){return Wr({test:(t,e)=>typeof t!=\"string\"?mr(e,`Expected a string (got ${ti(t)})`):!0})}function fo(t){let e=Array.isArray(t)?t:Object.values(t),r=e.every(a=>typeof a==\"string\"||typeof a==\"number\"),s=new Set(e);return s.size===1?Rre([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?mr(n,`Expected one of ${CE(e,\"or\")} (got ${ti(a)})`):mr(n,`Expected a valid enumeration value (got ${ti(a)})`)})}function FWe(){return Wr({test:(t,e)=>{var r;if(typeof t!=\"boolean\"){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s=RWe.get(t);if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a boolean (got ${ti(t)})`)}return!0}})}function h_(){return Wr({test:(t,e)=>{var r;if(typeof t!=\"number\"){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s;if(typeof t==\"string\"){let a;try{a=JSON.parse(t)}catch{}if(typeof a==\"number\")if(JSON.stringify(a)===t)s=a;else return mr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a number (got ${ti(t)})`)}return!0}})}function NWe(t){return Wr({test:(e,r)=>{var s;if(typeof r?.coercions>\"u\")return mr(r,\"The isPayload predicate can only be used with coercion enabled\");if(typeof r.coercion>\"u\")return mr(r,\"Unbound coercion result\");if(typeof e!=\"string\")return mr(r,`Expected a string (got ${ti(e)})`);let a;try{a=JSON.parse(e)}catch{return mr(r,`Expected a JSON string (got ${ti(e)})`)}let n={value:a};return t(a,Object.assign(Object.assign({},r),{coercion:Wf(n,\"value\")}))?(r.coercions.push([(s=r.p)!==null&&s!==void 0?s:\".\",r.coercion.bind(null,n.value)]),!0):!1}})}function OWe(){return Wr({test:(t,e)=>{var r;if(!(t instanceof Date)){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s;if(typeof t==\"string\"&&Tre.test(t))s=new Date(t);else{let a;if(typeof t==\"string\"){let n;try{n=JSON.parse(t)}catch{}typeof n==\"number\"&&(a=n)}else typeof t==\"number\"&&(a=t);if(typeof a<\"u\")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))s=new Date(a*1e3);else return mr(e,`Received a timestamp that can't be safely represented by the runtime (${t})`)}if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a date (got ${ti(t)})`)}return!0}})}function Tx(t,{delimiter:e}={}){return Wr({test:(r,s)=>{var a;let n=r;if(typeof r==\"string\"&&typeof e<\"u\"&&typeof s?.coercions<\"u\"){if(typeof s?.coercion>\"u\")return mr(s,\"Unbound coercion result\");r=r.split(e)}if(!Array.isArray(r))return mr(s,`Expected an array (got ${ti(r)})`);let c=!0;for(let f=0,p=r.length;f<p&&(c=t(r[f],Object.assign(Object.assign({},s),{p:s0(s,f),coercion:Wf(r,f)}))&&c,!(!c&&s?.errors==null));++f);return r!==n&&s.coercions.push([(a=s.p)!==null&&a!==void 0?a:\".\",s.coercion.bind(null,r)]),c}})}function LWe(t,{delimiter:e}={}){let r=Tx(t,{delimiter:e});return Wr({test:(s,a)=>{var n,c;if(Object.getPrototypeOf(s).toString()===\"[object Set]\")if(typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");let f=[...s],p=[...s];if(!r(p,Object.assign(Object.assign({},a),{coercion:void 0})))return!1;let h=()=>p.some((E,C)=>E!==f[C])?new Set(p):s;return a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",X2(a.coercion,s,h)]),!0}else{let f=!0;for(let p of s)if(f=t(p,Object.assign({},a))&&f,!f&&a?.errors==null)break;return f}if(typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");let f={value:s};return r(s,Object.assign(Object.assign({},a),{coercion:Wf(f,\"value\")}))?(a.coercions.push([(c=a.p)!==null&&c!==void 0?c:\".\",X2(a.coercion,s,()=>new Set(f.value))]),!0):!1}return mr(a,`Expected a set (got ${ti(s)})`)}})}function MWe(t,e){let r=Tx(Rx([t,e])),s=Fx(e,{keys:t});return Wr({test:(a,n)=>{var c,f,p;if(Object.getPrototypeOf(a).toString()===\"[object Map]\")if(typeof n?.coercions<\"u\"){if(typeof n?.coercion>\"u\")return mr(n,\"Unbound coercion result\");let h=[...a],E=[...a];if(!r(E,Object.assign(Object.assign({},n),{coercion:void 0})))return!1;let C=()=>E.some((S,P)=>S[0]!==h[P][0]||S[1]!==h[P][1])?new Map(E):a;return n.coercions.push([(c=n.p)!==null&&c!==void 0?c:\".\",X2(n.coercion,a,C)]),!0}else{let h=!0;for(let[E,C]of a)if(h=t(E,Object.assign({},n))&&h,!h&&n?.errors==null||(h=e(C,Object.assign(Object.assign({},n),{p:s0(n,E)}))&&h,!h&&n?.errors==null))break;return h}if(typeof n?.coercions<\"u\"){if(typeof n?.coercion>\"u\")return mr(n,\"Unbound coercion result\");let h={value:a};return Array.isArray(a)?r(a,Object.assign(Object.assign({},n),{coercion:void 0}))?(n.coercions.push([(f=n.p)!==null&&f!==void 0?f:\".\",X2(n.coercion,a,()=>new Map(h.value))]),!0):!1:s(a,Object.assign(Object.assign({},n),{coercion:Wf(h,\"value\")}))?(n.coercions.push([(p=n.p)!==null&&p!==void 0?p:\".\",X2(n.coercion,a,()=>new Map(Object.entries(h.value)))]),!0):!1}return mr(n,`Expected a map (got ${ti(a)})`)}})}function Rx(t,{delimiter:e}={}){let r=Ore(t.length);return Wr({test:(s,a)=>{var n;if(typeof s==\"string\"&&typeof e<\"u\"&&typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");s=s.split(e),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,s)])}if(!Array.isArray(s))return mr(a,`Expected a tuple (got ${ti(s)})`);let c=r(s,Object.assign({},a));for(let f=0,p=s.length;f<p&&f<t.length&&(c=t[f](s[f],Object.assign(Object.assign({},a),{p:s0(a,f),coercion:Wf(s,f)}))&&c,!(!c&&a?.errors==null));++f);return c}})}function Fx(t,{keys:e=null}={}){let r=Tx(Rx([e??wE(),t]));return Wr({test:(s,a)=>{var n;if(Array.isArray(s)&&typeof a?.coercions<\"u\")return typeof a?.coercion>\"u\"?mr(a,\"Unbound coercion result\"):r(s,Object.assign(Object.assign({},a),{coercion:void 0}))?(s=Object.fromEntries(s),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,s)]),!0):!1;if(typeof s!=\"object\"||s===null)return mr(a,`Expected an object (got ${ti(s)})`);let c=Object.keys(s),f=!0;for(let p=0,h=c.length;p<h&&(f||a?.errors!=null);++p){let E=c[p],C=s[E];if(E===\"__proto__\"||E===\"constructor\"){f=mr(Object.assign(Object.assign({},a),{p:s0(a,E)}),\"Unsafe property name\");continue}if(e!==null&&!e(E,a)){f=!1;continue}if(!t(C,Object.assign(Object.assign({},a),{p:s0(a,E),coercion:Wf(s,E)}))){f=!1;continue}}return f}})}function UWe(t,e={}){return Fx(t,e)}function Fre(t,{extra:e=null}={}){let r=Object.keys(t),s=Wr({test:(a,n)=>{if(typeof a!=\"object\"||a===null)return mr(n,`Expected an object (got ${ti(a)})`);let c=new Set([...r,...Object.keys(a)]),f={},p=!0;for(let h of c){if(h===\"constructor\"||h===\"__proto__\")p=mr(Object.assign(Object.assign({},n),{p:s0(n,h)}),\"Unsafe property name\");else{let E=Object.prototype.hasOwnProperty.call(t,h)?t[h]:void 0,C=Object.prototype.hasOwnProperty.call(a,h)?a[h]:void 0;typeof E<\"u\"?p=E(C,Object.assign(Object.assign({},n),{p:s0(n,h),coercion:Wf(a,h)}))&&p:e===null?p=mr(Object.assign(Object.assign({},n),{p:s0(n,h)}),`Extraneous property (got ${ti(C)})`):Object.defineProperty(f,h,{enumerable:!0,get:()=>C,set:TWe(a,h)})}if(!p&&n?.errors==null)break}return e!==null&&(p||n?.errors!=null)&&(p=e(f,n)&&p),p}});return Object.assign(s,{properties:t})}function _We(t){return Fre(t,{extra:Fx(p_())})}function Nre(t){return()=>t}function Wr({test:t}){return Nre(t)()}function jWe(t,e){if(!e(t))throw new o0}function GWe(t,e){let r=[];if(!e(t,{errors:r}))throw new o0({errors:r})}function qWe(t,e){}function WWe(t,e,{coerce:r=!1,errors:s,throw:a}={}){let n=s?[]:void 0;if(!r){if(e(t,{errors:n}))return a?t:{value:t,errors:void 0};if(a)throw new o0({errors:n});return{value:void 0,errors:n??!0}}let c={value:t},f=Wf(c,\"value\"),p=[];if(!e(t,{errors:n,coercion:f,coercions:p})){if(a)throw new o0({errors:n});return{value:void 0,errors:n??!0}}for(let[,h]of p)h();return a?c.value:{value:c.value,errors:void 0}}function YWe(t,e){let r=Rx(t);return(...s)=>{if(!r(s))throw new o0;return e(...s)}}function VWe(t){return Wr({test:(e,r)=>e.length>=t?!0:mr(r,`Expected to have a length of at least ${t} elements (got ${e.length})`)})}function JWe(t){return Wr({test:(e,r)=>e.length<=t?!0:mr(r,`Expected to have a length of at most ${t} elements (got ${e.length})`)})}function Ore(t){return Wr({test:(e,r)=>e.length!==t?mr(r,`Expected to have a length of exactly ${t} elements (got ${e.length})`):!0})}function KWe({map:t}={}){return Wr({test:(e,r)=>{let s=new Set,a=new Set;for(let n=0,c=e.length;n<c;++n){let f=e[n],p=typeof t<\"u\"?t(f):f;if(s.has(p)){if(a.has(p))continue;mr(r,`Expected to contain unique elements; got a duplicate with ${ti(e)}`),a.add(p)}else s.add(p)}return a.size===0}})}function zWe(){return Wr({test:(t,e)=>t<=0?!0:mr(e,`Expected to be negative (got ${t})`)})}function XWe(){return Wr({test:(t,e)=>t>=0?!0:mr(e,`Expected to be positive (got ${t})`)})}function d_(t){return Wr({test:(e,r)=>e>=t?!0:mr(r,`Expected to be at least ${t} (got ${e})`)})}function ZWe(t){return Wr({test:(e,r)=>e<=t?!0:mr(r,`Expected to be at most ${t} (got ${e})`)})}function $We(t,e){return Wr({test:(r,s)=>r>=t&&r<=e?!0:mr(s,`Expected to be in the [${t}; ${e}] range (got ${r})`)})}function eYe(t,e){return Wr({test:(r,s)=>r>=t&&r<e?!0:mr(s,`Expected to be in the [${t}; ${e}[ range (got ${r})`)})}function m_({unsafe:t=!1}={}){return Wr({test:(e,r)=>e!==Math.round(e)?mr(r,`Expected to be an integer (got ${e})`):!t&&!Number.isSafeInteger(e)?mr(r,`Expected to be a safe integer (got ${e})`):!0})}function Z2(t){return Wr({test:(e,r)=>t.test(e)?!0:mr(r,`Expected to match the pattern ${t.toString()} (got ${ti(e)})`)})}function tYe(){return Wr({test:(t,e)=>t!==t.toLowerCase()?mr(e,`Expected to be all-lowercase (got ${t})`):!0})}function rYe(){return Wr({test:(t,e)=>t!==t.toUpperCase()?mr(e,`Expected to be all-uppercase (got ${t})`):!0})}function nYe(){return Wr({test:(t,e)=>QWe.test(t)?!0:mr(e,`Expected to be a valid UUID v4 (got ${ti(t)})`)})}function iYe(){return Wr({test:(t,e)=>Tre.test(t)?!0:mr(e,`Expected to be a valid ISO 8601 date string (got ${ti(t)})`)})}function sYe({alpha:t=!1}){return Wr({test:(e,r)=>(t?PWe.test(e):xWe.test(e))?!0:mr(r,`Expected to be a valid hexadecimal color string (got ${ti(e)})`)})}function oYe(){return Wr({test:(t,e)=>kWe.test(t)?!0:mr(e,`Expected to be a valid base 64 string (got ${ti(t)})`)})}function aYe(t=p_()){return Wr({test:(e,r)=>{let s;try{s=JSON.parse(e)}catch{return mr(r,`Expected to be a valid JSON string (got ${ti(e)})`)}return t(s,r)}})}function Nx(t,...e){let r=Array.isArray(e[0])?e[0]:e;return Wr({test:(s,a)=>{var n,c;let f={value:s},p=typeof a?.coercions<\"u\"?Wf(f,\"value\"):void 0,h=typeof a?.coercions<\"u\"?[]:void 0;if(!t(s,Object.assign(Object.assign({},a),{coercion:p,coercions:h})))return!1;let E=[];if(typeof h<\"u\")for(let[,C]of h)E.push(C());try{if(typeof a?.coercions<\"u\"){if(f.value!==s){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,f.value)])}(c=a?.coercions)===null||c===void 0||c.push(...h)}return r.every(C=>C(f.value,a))}finally{for(let C of E)C()}}})}function $2(t,...e){let r=Array.isArray(e[0])?e[0]:e;return Nx(t,r)}function lYe(t){return Wr({test:(e,r)=>typeof e>\"u\"?!0:t(e,r)})}function cYe(t){return Wr({test:(e,r)=>e===null?!0:t(e,r)})}function uYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)||p.push(h);return p.length>0?mr(c,`Missing required ${A_(p.length,\"property\",\"properties\")} ${CE(p,\"and\")}`):!0}})}function y_(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>Object.keys(n).some(h=>a(s,h,n))?!0:mr(c,`Missing at least one property from ${CE(Array.from(s),\"or\")}`)})}function fYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)&&p.push(h);return p.length>0?mr(c,`Forbidden ${A_(p.length,\"property\",\"properties\")} ${CE(p,\"and\")}`):!0}})}function AYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)&&p.push(h);return p.length>1?mr(c,`Mutually exclusive properties ${CE(p,\"and\")}`):!0}})}function tB(t,e,r,s){var a,n;let c=new Set((a=s?.ignore)!==null&&a!==void 0?a:[]),f=eB[(n=s?.missingIf)!==null&&n!==void 0?n:\"missing\"],p=new Set(r),h=pYe[e],E=e===qf.Forbids?\"or\":\"and\";return Wr({test:(C,S)=>{let P=new Set(Object.keys(C));if(!f(P,t,C)||c.has(C[t]))return!0;let I=[];for(let R of p)(f(P,R,C)&&!c.has(C[R]))!==h.expect&&I.push(R);return I.length>=1?mr(S,`Property \"${t}\" ${h.message} ${A_(I.length,\"property\",\"properties\")} ${CE(I,E)}`):!0}})}var bWe,PWe,xWe,kWe,QWe,Tre,RWe,HWe,g_,o0,eB,qf,pYe,Ul=Xe(()=>{bWe=/^[a-zA-Z_][a-zA-Z0-9_]*$/;PWe=/^#[0-9a-f]{6}$/i,xWe=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,kWe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,QWe=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,Tre=/^(?:[1-9]\\d{3}(-?)(?:(?:0[1-9]|1[0-2])\\1(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])\\1(?:29|30)|(?:0[13578]|1[02])(?:\\1)31|00[1-9]|0[1-9]\\d|[12]\\d{2}|3(?:[0-5]\\d|6[0-5]))|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\\2)29|-?366))T(?:[01]\\d|2[0-3])(:?)[0-5]\\d(?:\\3[0-5]\\d)?(?:Z|[+-][01]\\d(?:\\3[0-5]\\d)?)$/;RWe=new Map([[\"true\",!0],[\"True\",!0],[\"1\",!0],[1,!0],[\"false\",!1],[\"False\",!1],[\"0\",!1],[0,!1]]);HWe=t=>Wr({test:(e,r)=>e instanceof t?!0:mr(r,`Expected an instance of ${t.name} (got ${ti(e)})`)}),g_=(t,{exclusive:e=!1}={})=>Wr({test:(r,s)=>{var a,n,c;let f=[],p=typeof s?.errors<\"u\"?[]:void 0;for(let h=0,E=t.length;h<E;++h){let C=typeof s?.errors<\"u\"?[]:void 0,S=typeof s?.coercions<\"u\"?[]:void 0;if(t[h](r,Object.assign(Object.assign({},s),{errors:C,coercions:S,p:`${(a=s?.p)!==null&&a!==void 0?a:\".\"}#${h+1}`}))){if(f.push([`#${h+1}`,S]),!e)break}else p?.push(C[0])}if(f.length===1){let[,h]=f[0];return typeof h<\"u\"&&((n=s?.coercions)===null||n===void 0||n.push(...h)),!0}return f.length>1?mr(s,`Expected to match exactly a single predicate (matched ${f.join(\", \")})`):(c=s?.errors)===null||c===void 0||c.push(...p),!1}});o0=class extends Error{constructor({errors:e}={}){let r=\"Type mismatch\";if(e&&e.length>0){r+=`\n`;for(let s of e)r+=`\n- ${s}`}super(r)}};eB={missing:(t,e)=>t.has(e),undefined:(t,e,r)=>t.has(e)&&typeof r[e]<\"u\",nil:(t,e,r)=>t.has(e)&&r[e]!=null,falsy:(t,e,r)=>t.has(e)&&!!r[e]};(function(t){t.Forbids=\"Forbids\",t.Requires=\"Requires\"})(qf||(qf={}));pYe={[qf.Forbids]:{expect:!1,message:\"forbids using\"},[qf.Requires]:{expect:!0,message:\"requires using\"}}});var ot,a0=Xe(()=>{Cp();ot=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:c}=await Promise.resolve().then(()=>(Ul(),Ea)),f=c(a(n()),r),p=[],h=[];if(!f(this,{errors:p,coercions:h}))throw z2(\"Invalid option schema\",p);for(let[,C]of h)C()}else if(r!=null)throw new Error(\"Invalid command schema\");let s=await this.execute();return typeof s<\"u\"?s:0}};ot.isOption=K2;ot.Default=[]});function il(t){l_&&console.log(t)}function Mre(){let t={nodes:[]};for(let e=0;e<En.CustomNode;++e)t.nodes.push(_l());return t}function hYe(t){let e=Mre(),r=[],s=e.nodes.length;for(let a of t){r.push(s);for(let n=0;n<a.nodes.length;++n)_re(n)||e.nodes.push(wYe(a.nodes[n],s));s+=a.nodes.length-En.CustomNode+1}for(let a of r)BE(e,En.InitialNode,a);return e}function Ou(t,e){return t.nodes.push(e),t.nodes.length-1}function gYe(t){let e=new Set,r=s=>{if(e.has(s))return;e.add(s);let a=t.nodes[s];for(let c of Object.values(a.statics))for(let{to:f}of c)r(f);for(let[,{to:c}]of a.dynamics)r(c);for(let{to:c}of a.shortcuts)r(c);let n=new Set(a.shortcuts.map(({to:c})=>c));for(;a.shortcuts.length>0;){let{to:c}=a.shortcuts.shift(),f=t.nodes[c];for(let[p,h]of Object.entries(f.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let C of h)E.some(({to:S})=>C.to===S)||E.push(C)}for(let[p,h]of f.dynamics)a.dynamics.some(([E,{to:C}])=>p===E&&h.to===C)||a.dynamics.push([p,h]);for(let p of f.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(En.InitialNode)}function dYe(t,{prefix:e=\"\"}={}){if(l_){il(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)il(`${e}  ${r}: ${JSON.stringify(t.nodes[r])}`)}}function mYe(t,e,r=!1){il(`Running a vm on ${JSON.stringify(e)}`);let s=[{node:En.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];dYe(t,{prefix:\"  \"});let a=[ei.StartOfInput,...e];for(let n=0;n<a.length;++n){let c=a[n],f=c===ei.EndOfInput||c===ei.EndOfPartialInput,p=n-1;il(`  Processing ${JSON.stringify(c)}`);let h=[];for(let{node:E,state:C}of s){il(`    Current node is ${E}`);let S=t.nodes[E];if(E===En.ErrorNode){h.push({node:E,state:C});continue}console.assert(S.shortcuts.length===0,\"Shortcuts should have been eliminated by now\");let P=Object.prototype.hasOwnProperty.call(S.statics,c);if(!r||n<a.length-1||P)if(P){let I=S.statics[c];for(let{to:R,reducer:N}of I)h.push({node:R,state:typeof N<\"u\"?Ox(I_,N,C,c,p):C}),il(`      Static transition to ${R} found`)}else il(\"      No static transition found\");else{let I=!1;for(let R of Object.keys(S.statics))if(R.startsWith(c)){if(c===R)for(let{to:N,reducer:U}of S.statics[R])h.push({node:N,state:typeof U<\"u\"?Ox(I_,U,C,c,p):C}),il(`      Static transition to ${N} found`);else for(let{to:N}of S.statics[R])h.push({node:N,state:{...C,remainder:R.slice(c.length)}}),il(`      Static transition to ${N} found (partial match)`);I=!0}I||il(\"      No partial static transition found\")}if(!f)for(let[I,{to:R,reducer:N}]of S.dynamics)Ox(BYe,I,C,c,p)&&(h.push({node:R,state:typeof N<\"u\"?Ox(I_,N,C,c,p):C}),il(`      Dynamic transition to ${R} found (via ${I})`))}if(h.length===0&&f&&e.length===1)return[{node:En.InitialNode,state:Lre}];if(h.length===0)throw new IE(e,s.filter(({node:E})=>E!==En.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===En.ErrorNode))throw new IE(e,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));s=EYe(h)}if(s.length>0){il(\"  Results:\");for(let n of s)il(`    - ${n.node} -> ${JSON.stringify(n.state)}`)}else il(\"  No results\");return s}function yYe(t,e,{endToken:r=ei.EndOfInput}={}){let s=mYe(t,[...e,r]);return IYe(e,s.map(({state:a})=>a))}function EYe(t){let e=0;for(let{state:r}of t)r.path.length>e&&(e=r.path.length);return t.filter(({state:r})=>r.path.length===e)}function IYe(t,e){let r=e.filter(S=>S.selectedIndex!==null),s=r.filter(S=>!S.partial);if(s.length>0&&(r=s),r.length===0)throw new Error;let a=r.filter(S=>S.selectedIndex===Nd||S.requiredOptions.every(P=>P.some(I=>S.options.find(R=>R.name===I))));if(a.length===0)throw new IE(t,r.map(S=>({usage:S.candidateUsage,reason:null})));let n=0;for(let S of a)S.path.length>n&&(n=S.path.length);let c=a.filter(S=>S.path.length===n),f=S=>S.positionals.filter(({extra:P})=>!P).length+S.options.length,p=c.map(S=>({state:S,positionalCount:f(S)})),h=0;for(let{positionalCount:S}of p)S>h&&(h=S);let E=p.filter(({positionalCount:S})=>S===h).map(({state:S})=>S),C=CYe(E);if(C.length>1)throw new xx(t,C.map(S=>S.candidateUsage));return C[0]}function CYe(t){let e=[],r=[];for(let s of t)s.selectedIndex===Nd?r.push(s):e.push(s);return r.length>0&&e.push({...Lre,path:Ure(...r.map(s=>s.path)),options:r.reduce((s,a)=>s.concat(a.options),[])}),e}function Ure(t,e,...r){return e===void 0?Array.from(t):Ure(t.filter((s,a)=>s===e[a]),...r)}function _l(){return{dynamics:[],shortcuts:[],statics:{}}}function _re(t){return t===En.SuccessNode||t===En.ErrorNode}function E_(t,e=0){return{to:_re(t.to)?t.to:t.to>=En.CustomNode?t.to+e-En.CustomNode+1:t.to+e,reducer:t.reducer}}function wYe(t,e=0){let r=_l();for(let[s,a]of t.dynamics)r.dynamics.push([s,E_(a,e)]);for(let s of t.shortcuts)r.shortcuts.push(E_(s,e));for(let[s,a]of Object.entries(t.statics))r.statics[s]=a.map(n=>E_(n,e));return r}function Hs(t,e,r,s,a){t.nodes[e].dynamics.push([r,{to:s,reducer:a}])}function BE(t,e,r,s){t.nodes[e].shortcuts.push({to:r,reducer:s})}function Ia(t,e,r,s,a){(Object.prototype.hasOwnProperty.call(t.nodes[e].statics,r)?t.nodes[e].statics[r]:t.nodes[e].statics[r]=[]).push({to:s,reducer:a})}function Ox(t,e,r,s,a){if(Array.isArray(e)){let[n,...c]=e;return t[n](r,s,a,...c)}else return t[e](r,s,a)}var Lre,BYe,I_,Hl,C_,Lx,Mx=Xe(()=>{Px();kx();Lre={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:Nd,partial:!1,tokens:[]};BYe={always:()=>!0,isOptionLike:(t,e)=>!t.ignoreOptions&&e!==\"-\"&&e.startsWith(\"-\"),isNotOptionLike:(t,e)=>t.ignoreOptions||e===\"-\"||!e.startsWith(\"-\"),isOption:(t,e,r,s)=>!t.ignoreOptions&&e===s,isBatchOption:(t,e,r,s)=>!t.ignoreOptions&&xre.test(e)&&[...e.slice(1)].every(a=>s.has(`-${a}`)),isBoundOption:(t,e,r,s,a)=>{let n=e.match(a_);return!t.ignoreOptions&&!!n&&bx.test(n[1])&&s.has(n[1])&&a.filter(c=>c.nameSet.includes(n[1])).every(c=>c.allowBinding)},isNegatedOption:(t,e,r,s)=>!t.ignoreOptions&&e===`--no-${s.slice(2)}`,isHelp:(t,e)=>!t.ignoreOptions&&o_.test(e),isUnsupportedOption:(t,e,r,s)=>!t.ignoreOptions&&e.startsWith(\"-\")&&bx.test(e)&&!s.has(e),isInvalidOption:(t,e)=>!t.ignoreOptions&&e.startsWith(\"-\")&&!bx.test(e)},I_={setCandidateState:(t,e,r,s)=>({...t,...s}),setSelectedIndex:(t,e,r,s)=>({...t,selectedIndex:s}),setPartialIndex:(t,e,r,s)=>({...t,selectedIndex:s,partial:!0}),pushBatch:(t,e,r,s)=>{let a=t.options.slice(),n=t.tokens.slice();for(let c=1;c<e.length;++c){let f=s.get(`-${e[c]}`),p=c===1?[0,2]:[c,c+1];a.push({name:f,value:!0}),n.push({segmentIndex:r,type:\"option\",option:f,slice:p})}return{...t,options:a,tokens:n}},pushBound:(t,e,r)=>{let[,s,a]=e.match(a_),n=t.options.concat({name:s,value:a}),c=t.tokens.concat([{segmentIndex:r,type:\"option\",slice:[0,s.length],option:s},{segmentIndex:r,type:\"assign\",slice:[s.length,s.length+1]},{segmentIndex:r,type:\"value\",slice:[s.length+1,s.length+a.length+1]}]);return{...t,options:n,tokens:c}},pushPath:(t,e,r)=>{let s=t.path.concat(e),a=t.tokens.concat({segmentIndex:r,type:\"path\"});return{...t,path:s,tokens:a}},pushPositional:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:!1}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushExtra:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:!0}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushExtraNoLimits:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:Hl}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushTrue:(t,e,r,s)=>{let a=t.options.concat({name:s,value:!0}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:s});return{...t,options:a,tokens:n}},pushFalse:(t,e,r,s)=>{let a=t.options.concat({name:s,value:!1}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:s});return{...t,options:a,tokens:n}},pushUndefined:(t,e,r,s)=>{let a=t.options.concat({name:e,value:void 0}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:e});return{...t,options:a,tokens:n}},pushStringValue:(t,e,r)=>{var s;let a=t.options[t.options.length-1],n=t.options.slice(),c=t.tokens.concat({segmentIndex:r,type:\"value\"});return a.value=((s=a.value)!==null&&s!==void 0?s:[]).concat([e]),{...t,options:n,tokens:c}},setStringValue:(t,e,r)=>{let s=t.options[t.options.length-1],a=t.options.slice(),n=t.tokens.concat({segmentIndex:r,type:\"value\"});return s.value=e,{...t,options:a,tokens:n}},inhibateOptions:t=>({...t,ignoreOptions:!0}),useHelp:(t,e,r,s)=>{let[,,a]=e.match(o_);return typeof a<\"u\"?{...t,options:[{name:\"-c\",value:String(s)},{name:\"-i\",value:a}]}:{...t,options:[{name:\"-c\",value:String(s)}]}},setError:(t,e,r,s)=>e===ei.EndOfInput||e===ei.EndOfPartialInput?{...t,errorMessage:`${s}.`}:{...t,errorMessage:`${s} (\"${e}\").`},setOptionArityError:(t,e)=>{let r=t.options[t.options.length-1];return{...t,errorMessage:`Not enough arguments to option ${r.name}.`}}},Hl=Symbol(),C_=class{constructor(e,r){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=e,this.cliOpts=r}addPath(e){this.paths.push(e)}setArity({leading:e=this.arity.leading,trailing:r=this.arity.trailing,extra:s=this.arity.extra,proxy:a=this.arity.proxy}){Object.assign(this.arity,{leading:e,trailing:r,extra:s,proxy:a})}addPositional({name:e=\"arg\",required:r=!0}={}){if(!r&&this.arity.extra===Hl)throw new Error(\"Optional parameters cannot be declared when using .rest() or .proxy()\");if(!r&&this.arity.trailing.length>0)throw new Error(\"Optional parameters cannot be declared after the required trailing positional arguments\");!r&&this.arity.extra!==Hl?this.arity.extra.push(e):this.arity.extra!==Hl&&this.arity.extra.length===0?this.arity.leading.push(e):this.arity.trailing.push(e)}addRest({name:e=\"arg\",required:r=0}={}){if(this.arity.extra===Hl)throw new Error(\"Infinite lists cannot be declared multiple times in the same command\");if(this.arity.trailing.length>0)throw new Error(\"Infinite lists cannot be declared after the required trailing positional arguments\");for(let s=0;s<r;++s)this.addPositional({name:e});this.arity.extra=Hl}addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.proxy=!0}addOption({names:e,description:r,arity:s=0,hidden:a=!1,required:n=!1,allowBinding:c=!0}){if(!c&&s>1)throw new Error(\"The arity cannot be higher than 1 when the option only supports the --arg=value syntax\");if(!Number.isInteger(s))throw new Error(`The arity must be an integer, got ${s}`);if(s<0)throw new Error(`The arity must be positive, got ${s}`);let f=e.reduce((p,h)=>h.length>p.length?h:p,\"\");for(let p of e)this.allOptionNames.set(p,f);this.options.push({preferredName:f,nameSet:e,description:r,arity:s,hidden:a,required:n,allowBinding:c})}setContext(e){this.context=e}usage({detailed:e=!0,inlineOptions:r=!0}={}){let s=[this.cliOpts.binaryName],a=[];if(this.paths.length>0&&s.push(...this.paths[0]),e){for(let{preferredName:c,nameSet:f,arity:p,hidden:h,description:E,required:C}of this.options){if(h)continue;let S=[];for(let I=0;I<p;++I)S.push(` #${I}`);let P=`${f.join(\",\")}${S.join(\"\")}`;!r&&E?a.push({preferredName:c,nameSet:f,definition:P,description:E,required:C}):s.push(C?`<${P}>`:`[${P}]`)}s.push(...this.arity.leading.map(c=>`<${c}>`)),this.arity.extra===Hl?s.push(\"...\"):s.push(...this.arity.extra.map(c=>`[${c}]`)),s.push(...this.arity.trailing.map(c=>`<${c}>`))}return{usage:s.join(\" \"),options:a}}compile(){if(typeof this.context>\"u\")throw new Error(\"Assertion failed: No context attached\");let e=Mre(),r=En.InitialNode,s=this.usage().usage,a=this.options.filter(f=>f.required).map(f=>f.nameSet);r=Ou(e,_l()),Ia(e,En.InitialNode,ei.StartOfInput,r,[\"setCandidateState\",{candidateUsage:s,requiredOptions:a}]);let n=this.arity.proxy?\"always\":\"isNotOptionLike\",c=this.paths.length>0?this.paths:[[]];for(let f of c){let p=r;if(f.length>0){let S=Ou(e,_l());BE(e,p,S),this.registerOptions(e,S),p=S}for(let S=0;S<f.length;++S){let P=Ou(e,_l());Ia(e,p,f[S],P,\"pushPath\"),p=P}if(this.arity.leading.length>0||!this.arity.proxy){let S=Ou(e,_l());Hs(e,p,\"isHelp\",S,[\"useHelp\",this.cliIndex]),Hs(e,S,\"always\",S,\"pushExtra\"),Ia(e,S,ei.EndOfInput,En.SuccessNode,[\"setSelectedIndex\",Nd]),this.registerOptions(e,p)}this.arity.leading.length>0&&(Ia(e,p,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,p,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex]));let h=p;for(let S=0;S<this.arity.leading.length;++S){let P=Ou(e,_l());(!this.arity.proxy||S+1!==this.arity.leading.length)&&this.registerOptions(e,P),(this.arity.trailing.length>0||S+1!==this.arity.leading.length)&&(Ia(e,P,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,P,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex])),Hs(e,h,\"isNotOptionLike\",P,\"pushPositional\"),h=P}let E=h;if(this.arity.extra===Hl||this.arity.extra.length>0){let S=Ou(e,_l());if(BE(e,h,S),this.arity.extra===Hl){let P=Ou(e,_l());this.arity.proxy||this.registerOptions(e,P),Hs(e,h,n,P,\"pushExtraNoLimits\"),Hs(e,P,n,P,\"pushExtraNoLimits\"),BE(e,P,S)}else for(let P=0;P<this.arity.extra.length;++P){let I=Ou(e,_l());(!this.arity.proxy||P>0)&&this.registerOptions(e,I),Hs(e,E,n,I,\"pushExtra\"),BE(e,I,S),E=I}E=S}this.arity.trailing.length>0&&(Ia(e,E,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,E,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex]));let C=E;for(let S=0;S<this.arity.trailing.length;++S){let P=Ou(e,_l());this.arity.proxy||this.registerOptions(e,P),S+1<this.arity.trailing.length&&(Ia(e,P,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,P,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex])),Hs(e,C,\"isNotOptionLike\",P,\"pushPositional\"),C=P}Hs(e,C,n,En.ErrorNode,[\"setError\",\"Extraneous positional argument\"]),Ia(e,C,ei.EndOfInput,En.SuccessNode,[\"setSelectedIndex\",this.cliIndex]),Ia(e,C,ei.EndOfPartialInput,En.SuccessNode,[\"setSelectedIndex\",this.cliIndex])}return{machine:e,context:this.context}}registerOptions(e,r){Hs(e,r,[\"isOption\",\"--\"],r,\"inhibateOptions\"),Hs(e,r,[\"isBatchOption\",this.allOptionNames],r,[\"pushBatch\",this.allOptionNames]),Hs(e,r,[\"isBoundOption\",this.allOptionNames,this.options],r,\"pushBound\"),Hs(e,r,[\"isUnsupportedOption\",this.allOptionNames],En.ErrorNode,[\"setError\",\"Unsupported option name\"]),Hs(e,r,[\"isInvalidOption\"],En.ErrorNode,[\"setError\",\"Invalid option name\"]);for(let s of this.options)if(s.arity===0)for(let a of s.nameSet)Hs(e,r,[\"isOption\",a],r,[\"pushTrue\",s.preferredName]),a.startsWith(\"--\")&&!a.startsWith(\"--no-\")&&Hs(e,r,[\"isNegatedOption\",a],r,[\"pushFalse\",s.preferredName]);else{let a=Ou(e,_l());for(let n of s.nameSet)Hs(e,r,[\"isOption\",n],a,[\"pushUndefined\",s.preferredName]);for(let n=0;n<s.arity;++n){let c=Ou(e,_l());Ia(e,a,ei.EndOfInput,En.ErrorNode,\"setOptionArityError\"),Ia(e,a,ei.EndOfPartialInput,En.ErrorNode,\"setOptionArityError\"),Hs(e,a,\"isOptionLike\",En.ErrorNode,\"setOptionArityError\");let f=s.arity===1?\"setStringValue\":\"pushStringValue\";Hs(e,a,\"isNotOptionLike\",c,f),a=c}BE(e,a,r)}}},Lx=class t{constructor({binaryName:e=\"...\"}={}){this.builders=[],this.opts={binaryName:e}}static build(e,r={}){return new t(r).commands(e).compile()}getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${e})`);return this.builders[e]}commands(e){for(let r of e)r(this.command());return this}command(){let e=new C_(this.builders.length,this.opts);return this.builders.push(e),e}compile(){let e=[],r=[];for(let a of this.builders){let{machine:n,context:c}=a.compile();e.push(n),r.push(c)}let s=hYe(e);return gYe(s),{machine:s,contexts:r,process:(a,{partial:n}={})=>{let c=n?ei.EndOfPartialInput:ei.EndOfInput;return yYe(s,a,{endToken:c})}}}}});function jre(){return Ux.default&&\"getColorDepth\"in Ux.default.WriteStream.prototype?Ux.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR===\"0\"?1:process.env.FORCE_COLOR===\"1\"||typeof process.stdout<\"u\"&&process.stdout.isTTY?8:1}function Gre(t){let e=Hre;if(typeof e>\"u\"){if(t.stdout===process.stdout&&t.stderr===process.stderr)return null;let{AsyncLocalStorage:r}=Ie(\"async_hooks\");e=Hre=new r;let s=process.stdout._write;process.stdout._write=function(n,c,f){let p=e.getStore();return typeof p>\"u\"?s.call(this,n,c,f):p.stdout.write(n,c,f)};let a=process.stderr._write;process.stderr._write=function(n,c,f){let p=e.getStore();return typeof p>\"u\"?a.call(this,n,c,f):p.stderr.write(n,c,f)}}return r=>e.run(t,r)}var Ux,Hre,qre=Xe(()=>{Ux=ut(Ie(\"tty\"),1)});var _x,Wre=Xe(()=>{a0();_x=class t extends ot{constructor(e){super(),this.contexts=e,this.commands=[]}static from(e,r){let s=new t(r);s.path=e.path;for(let a of e.options)switch(a.name){case\"-c\":s.commands.push(Number(a.value));break;case\"-i\":s.index=Number(a.value);break}return s}async execute(){let e=this.commands;if(typeof this.index<\"u\"&&this.index>=0&&this.index<e.length&&(e=[e[this.index]]),e.length===0)this.context.stdout.write(this.cli.usage());else if(e.length===1)this.context.stdout.write(this.cli.usage(this.contexts[e[0]].commandClass,{detailed:!0}));else if(e.length>1){this.context.stdout.write(`Multiple commands match your selection:\n`),this.context.stdout.write(`\n`);let r=0;for(let s of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[s].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`\n`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.\n`)}}}});async function Jre(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=zre(t);return Ca.from(r,e).runExit(s,a)}async function Kre(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=zre(t);return Ca.from(r,e).run(s,a)}function zre(t){let e,r,s,a;switch(typeof process<\"u\"&&typeof process.argv<\"u\"&&(s=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?s=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],s=t[2]):t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],s=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],s=t[2],a=t[3];break}if(typeof s>\"u\")throw new Error(\"The argv parameter must be provided when running Clipanion outside of a Node context\");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}}function Vre(t){return t()}var Yre,Ca,Xre=Xe(()=>{Px();Mx();f_();qre();a0();Wre();Yre=Symbol(\"clipanion/errorCommand\");Ca=class t{constructor({binaryLabel:e,binaryName:r=\"...\",binaryVersion:s,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new Lx({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=s,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let s=new t(r),a=Array.isArray(e)?e:[e];for(let n of a)s.register(n);return s}register(e){var r;let s=new Map,a=new e;for(let p in a){let h=a[p];typeof h==\"object\"&&h!==null&&h[ot.isOption]&&s.set(p,h)}let n=this.builder.command(),c=n.cliIndex,f=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<\"u\")for(let p of f)n.addPath(p);this.registrations.set(e,{specs:s,builder:n,index:c});for(let[p,{definition:h}]of s.entries())h(n,p);n.setContext({commandClass:e})}process(e,r){let{input:s,context:a,partial:n}=typeof e==\"object\"&&Array.isArray(e)?{input:e,context:r}:e,{contexts:c,process:f}=this.builder.compile(),p=f(s,{partial:n}),h={...t.defaultContext,...a};switch(p.selectedIndex){case Nd:{let E=_x.from(p,c);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=c[p.selectedIndex],C=this.registrations.get(E);if(typeof C>\"u\")throw new Error(\"Assertion failed: Expected the command class to have been registered.\");let S=new E;S.context=h,S.tokens=p.tokens,S.path=p.path;try{for(let[P,{transformer:I}]of C.specs.entries())S[P]=I(C.builder,P,p,h);return S}catch(P){throw P[Yre]=S,P}}break}}async run(e,r){var s,a;let n,c={...t.defaultContext,...r},f=(s=this.enableColors)!==null&&s!==void 0?s:c.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,c)}catch(E){return c.stdout.write(this.error(E,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,C)=>this.error(E,C),format:E=>this.format(E),process:(E,C)=>this.process(E,{...c,...C}),run:(E,C)=>this.run(E,{...c,...C}),usage:(E,C)=>this.usage(E,C)};let p=this.enableCapture&&(a=Gre(c))!==null&&a!==void 0?a:Vre,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return c.stdout.write(this.error(E,{colored:f,command:n})),1}return h}async runExit(e,r){process.exitCode=await this.run(e,r)}definition(e,{colored:r=!1}={}){if(!e.usage)return null;let{usage:s}=this.getUsageByRegistration(e,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(e,{detailed:!0,inlineOptions:!1}),c=typeof e.usage.category<\"u\"?Ho(e.usage.category,{format:this.format(r),paragraphs:!1}):void 0,f=typeof e.usage.description<\"u\"?Ho(e.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof e.usage.details<\"u\"?Ho(e.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof e.usage.examples<\"u\"?e.usage.examples.map(([E,C])=>[Ho(E,{format:this.format(r),paragraphs:!1}),C.replace(/\\$0/g,this.binaryName)]):void 0;return{path:s,usage:a,category:c,description:f,details:p,examples:h,options:n}}definitions({colored:e=!1}={}){let r=[];for(let s of this.registrations.keys()){let a=this.definition(s,{colored:e});a&&r.push(a)}return r}usage(e=null,{colored:r,detailed:s=!1,prefix:a=\"$ \"}={}){var n;if(e===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<\"u\";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(P=>P.length===0))!==null&&n!==void 0?n:!1))if(e){e=null;break}else e=p;else if(E){e=null;continue}}e&&(s=!0)}let c=e!==null&&e instanceof ot?e.constructor:e,f=\"\";if(c)if(s){let{description:p=\"\",details:h=\"\",examples:E=[]}=c.usage||{};p!==\"\"&&(f+=Ho(p,{format:this.format(r),paragraphs:!1}).replace(/^./,P=>P.toUpperCase()),f+=`\n`),(h!==\"\"||E.length>0)&&(f+=`${this.format(r).header(\"Usage\")}\n`,f+=`\n`);let{usage:C,options:S}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${C}\n`,S.length>0){f+=`\n`,f+=`${this.format(r).header(\"Options\")}\n`;let P=S.reduce((I,R)=>Math.max(I,R.definition.length),0);f+=`\n`;for(let{definition:I,description:R}of S)f+=`  ${this.format(r).bold(I.padEnd(P))}    ${Ho(R,{format:this.format(r),paragraphs:!1})}`}if(h!==\"\"&&(f+=`\n`,f+=`${this.format(r).header(\"Details\")}\n`,f+=`\n`,f+=Ho(h,{format:this.format(r),paragraphs:!0})),E.length>0){f+=`\n`,f+=`${this.format(r).header(\"Examples\")}\n`;for(let[P,I]of E)f+=`\n`,f+=Ho(P,{format:this.format(r),paragraphs:!1}),f+=`${I.replace(/^/m,`  ${this.format(r).bold(a)}`).replace(/\\$0/g,this.binaryName)}\n`}}else{let{usage:p}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${p}\n`}else{let p=new Map;for(let[S,{index:P}]of this.registrations.entries()){if(typeof S.usage>\"u\")continue;let I=typeof S.usage.category<\"u\"?Ho(S.usage.category,{format:this.format(r),paragraphs:!1}):null,R=p.get(I);typeof R>\"u\"&&p.set(I,R=[]);let{usage:N}=this.getUsageByIndex(P);R.push({commandClass:S,usage:N})}let h=Array.from(p.keys()).sort((S,P)=>S===null?-1:P===null?1:S.localeCompare(P,\"en\",{usage:\"sort\",caseFirst:\"upper\"})),E=typeof this.binaryLabel<\"u\",C=typeof this.binaryVersion<\"u\";E||C?(E&&C?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}\n\n`:E?f+=`${this.format(r).header(`${this.binaryLabel}`)}\n`:f+=`${this.format(r).header(`${this.binaryVersion}`)}\n`,f+=`  ${this.format(r).bold(a)}${this.binaryName} <command>\n`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>\n`;for(let S of h){let P=p.get(S).slice().sort((R,N)=>R.usage.localeCompare(N.usage,\"en\",{usage:\"sort\",caseFirst:\"upper\"})),I=S!==null?S.trim():\"General commands\";f+=`\n`,f+=`${this.format(r).header(`${I}`)}\n`;for(let{commandClass:R,usage:N}of P){let U=R.usage.description||\"undocumented\";f+=`\n`,f+=`  ${this.format(r).bold(N)}\n`,f+=`    ${Ho(U,{format:this.format(r),paragraphs:!1})}`}}f+=`\n`,f+=Ho(\"You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.\",{format:this.format(r),paragraphs:!0})}return f}error(e,r){var s,{colored:a,command:n=(s=e[Yre])!==null&&s!==void 0?s:null}=r===void 0?{}:r;(!e||typeof e!=\"object\"||!(\"stack\"in e))&&(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let c=\"\",f=e.name.replace(/([a-z])([A-Z])/g,\"$1 $2\");f===\"Error\"&&(f=\"Internal Error\"),c+=`${this.format(a).error(f)}: ${e.message}\n`;let p=e.clipanion;return typeof p<\"u\"?p.type===\"usage\"&&(c+=`\n`,c+=this.usage(n)):e.stack&&(c+=`${e.stack.replace(/^.*\\n/,\"\")}\n`),c}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:t.defaultContext.colorDepth>1)?kre:Qre}getUsageByRegistration(e,r){let s=this.registrations.get(e);if(typeof s>\"u\")throw new Error(\"Assertion failed: Unregistered command\");return this.getUsageByIndex(s.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};Ca.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:jre()}});var rB,Zre=Xe(()=>{a0();rB=class extends ot{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}\n`)}};rB.paths=[[\"--clipanion=definitions\"]]});var nB,$re=Xe(()=>{a0();nB=class extends ot{async execute(){this.context.stdout.write(this.cli.usage())}};nB.paths=[[\"-h\"],[\"--help\"]]});function Hx(t={}){return ya({definition(e,r){var s;e.addProxy({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){return s.positionals.map(({value:a})=>a)}})}var w_=Xe(()=>{Cp()});var iB,ene=Xe(()=>{a0();w_();iB=class extends ot{constructor(){super(...arguments),this.args=Hx()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}\n`)}};iB.paths=[[\"--clipanion=tokens\"]]});var sB,tne=Xe(()=>{a0();sB=class extends ot{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:\"<unknown>\"}\n`)}};sB.paths=[[\"-v\"],[\"--version\"]]});var B_={};Vt(B_,{DefinitionsCommand:()=>rB,HelpCommand:()=>nB,TokensCommand:()=>iB,VersionCommand:()=>sB});var rne=Xe(()=>{Zre();$re();ene();tne()});function nne(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(\",\"),f=new Set(c);return ya({definition(p){p.addOption({names:c,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let C,S=typeof s<\"u\"?[...s]:void 0;for(let{name:P,value:I}of E.options)f.has(P)&&(C=P,S=S??[],S.push(I));return typeof S<\"u\"?Od(C??h,S,a.validator):S}})}var ine=Xe(()=>{Cp()});function sne(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(\",\"),c=new Set(n);return ya({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E=S);return E}})}var one=Xe(()=>{Cp()});function ane(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(\",\"),c=new Set(n);return ya({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E??(E=0),S?E+=1:E=0);return E}})}var lne=Xe(()=>{Cp()});function cne(t={}){return ya({definition(e,r){var s;e.addRest({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){let a=c=>{let f=s.positionals[c];return f.extra===Hl||f.extra===!1&&c<e.arity.leading.length},n=0;for(;n<s.positionals.length&&a(n);)n+=1;return s.positionals.splice(0,n).map(({value:c})=>c)}})}var une=Xe(()=>{Mx();Cp()});function vYe(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(\",\"),f=new Set(c);return ya({definition(p){p.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,C){let S,P=s;typeof a.env<\"u\"&&C.env[a.env]&&(S=a.env,P=C.env[a.env]);for(let{name:I,value:R}of E.options)f.has(I)&&(S=I,P=R);return typeof P==\"string\"?Od(S??h,P,a.validator):P}})}function SYe(t={}){let{required:e=!0}=t;return ya({definition(r,s){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:s,required:t.required})},transformer(r,s,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===Hl||e&&a.positionals[c].extra===!0||!e&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return Od((n=t.name)!==null&&n!==void 0?n:s,f.value,t.validator)}}})}function fne(t,...e){return typeof t==\"string\"?vYe(t,...e):SYe(t)}var Ane=Xe(()=>{Mx();Cp()});var ge={};Vt(ge,{Array:()=>nne,Boolean:()=>sne,Counter:()=>ane,Proxy:()=>Hx,Rest:()=>cne,String:()=>fne,applyValidator:()=>Od,cleanValidationError:()=>Qx,formatError:()=>z2,isOptionSymbol:()=>K2,makeCommandOption:()=>ya,rerouteArguments:()=>Gf});var pne=Xe(()=>{Cp();w_();ine();one();lne();une();Ane()});var oB={};Vt(oB,{Builtins:()=>B_,Cli:()=>Ca,Command:()=>ot,Option:()=>ge,UsageError:()=>nt,formatMarkdownish:()=>Ho,run:()=>Kre,runExit:()=>Jre});var Yt=Xe(()=>{kx();f_();a0();Xre();rne();pne()});var hne=_((VTt,DYe)=>{DYe.exports={name:\"dotenv\",version:\"16.3.1\",description:\"Loads environment variables from .env file\",main:\"lib/main.js\",types:\"lib/main.d.ts\",exports:{\".\":{types:\"./lib/main.d.ts\",require:\"./lib/main.js\",default:\"./lib/main.js\"},\"./config\":\"./config.js\",\"./config.js\":\"./config.js\",\"./lib/env-options\":\"./lib/env-options.js\",\"./lib/env-options.js\":\"./lib/env-options.js\",\"./lib/cli-options\":\"./lib/cli-options.js\",\"./lib/cli-options.js\":\"./lib/cli-options.js\",\"./package.json\":\"./package.json\"},scripts:{\"dts-check\":\"tsc --project tests/types/tsconfig.json\",lint:\"standard\",\"lint-readme\":\"standard-markdown\",pretest:\"npm run lint && npm run dts-check\",test:\"tap tests/*.js --100 -Rspec\",prerelease:\"npm test\",release:\"standard-version\"},repository:{type:\"git\",url:\"git://github.com/motdotla/dotenv.git\"},funding:\"https://github.com/motdotla/dotenv?sponsor=1\",keywords:[\"dotenv\",\"env\",\".env\",\"environment\",\"variables\",\"config\",\"settings\"],readmeFilename:\"README.md\",license:\"BSD-2-Clause\",devDependencies:{\"@definitelytyped/dtslint\":\"^0.0.133\",\"@types/node\":\"^18.11.3\",decache:\"^4.6.1\",sinon:\"^14.0.1\",standard:\"^17.0.0\",\"standard-markdown\":\"^7.1.0\",\"standard-version\":\"^9.5.0\",tap:\"^16.3.0\",tar:\"^6.1.11\",typescript:\"^4.8.4\"},engines:{node:\">=12\"},browser:{fs:!1}}});var yne=_((JTt,wp)=>{var gne=Ie(\"fs\"),S_=Ie(\"path\"),bYe=Ie(\"os\"),PYe=Ie(\"crypto\"),xYe=hne(),D_=xYe.version,kYe=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function QYe(t){let e={},r=t.toString();r=r.replace(/\\r\\n?/mg,`\n`);let s;for(;(s=kYe.exec(r))!=null;){let a=s[1],n=s[2]||\"\";n=n.trim();let c=n[0];n=n.replace(/^(['\"`])([\\s\\S]*)\\1$/mg,\"$2\"),c==='\"'&&(n=n.replace(/\\\\n/g,`\n`),n=n.replace(/\\\\r/g,\"\\r\")),e[a]=n}return e}function TYe(t){let e=mne(t),r=js.configDotenv({path:e});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);let s=dne(t).split(\",\"),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=NYe(r,f);n=js.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return js.parse(n)}function RYe(t){console.log(`[dotenv@${D_}][INFO] ${t}`)}function FYe(t){console.log(`[dotenv@${D_}][WARN] ${t}`)}function v_(t){console.log(`[dotenv@${D_}][DEBUG] ${t}`)}function dne(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:\"\"}function NYe(t,e){let r;try{r=new URL(e)}catch(f){throw f.code===\"ERR_INVALID_URL\"?new Error(\"INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development\"):f}let s=r.password;if(!s)throw new Error(\"INVALID_DOTENV_KEY: Missing key part\");let a=r.searchParams.get(\"environment\");if(!a)throw new Error(\"INVALID_DOTENV_KEY: Missing environment part\");let n=`DOTENV_VAULT_${a.toUpperCase()}`,c=t.parsed[n];if(!c)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:c,key:s}}function mne(t){let e=S_.resolve(process.cwd(),\".env\");return t&&t.path&&t.path.length>0&&(e=t.path),e.endsWith(\".vault\")?e:`${e}.vault`}function OYe(t){return t[0]===\"~\"?S_.join(bYe.homedir(),t.slice(1)):t}function LYe(t){RYe(\"Loading env from encrypted .env.vault\");let e=js._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),js.populate(r,e,t),{parsed:e}}function MYe(t){let e=S_.resolve(process.cwd(),\".env\"),r=\"utf8\",s=!!(t&&t.debug);t&&(t.path!=null&&(e=OYe(t.path)),t.encoding!=null&&(r=t.encoding));try{let a=js.parse(gne.readFileSync(e,{encoding:r})),n=process.env;return t&&t.processEnv!=null&&(n=t.processEnv),js.populate(n,a,t),{parsed:a}}catch(a){return s&&v_(`Failed to load ${e} ${a.message}`),{error:a}}}function UYe(t){let e=mne(t);return dne(t).length===0?js.configDotenv(t):gne.existsSync(e)?js._configVault(t):(FYe(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),js.configDotenv(t))}function _Ye(t,e){let r=Buffer.from(e.slice(-64),\"hex\"),s=Buffer.from(t,\"base64\"),a=s.slice(0,12),n=s.slice(-16);s=s.slice(12,-16);try{let c=PYe.createDecipheriv(\"aes-256-gcm\",r,a);return c.setAuthTag(n),`${c.update(s)}${c.final()}`}catch(c){let f=c instanceof RangeError,p=c.message===\"Invalid key length\",h=c.message===\"Unsupported state or unable to authenticate data\";if(f||p){let E=\"INVALID_DOTENV_KEY: It must be 64 characters long (or more)\";throw new Error(E)}else if(h){let E=\"DECRYPTION_FAILED: Please check your DOTENV_KEY\";throw new Error(E)}else throw console.error(\"Error: \",c.code),console.error(\"Error: \",c.message),c}}function HYe(t,e,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof e!=\"object\")throw new Error(\"OBJECT_REQUIRED: Please check the processEnv argument being passed to populate\");for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(a===!0&&(t[n]=e[n]),s&&v_(a===!0?`\"${n}\" is already defined and WAS overwritten`:`\"${n}\" is already defined and was NOT overwritten`)):t[n]=e[n]}var js={configDotenv:MYe,_configVault:LYe,_parseVault:TYe,config:UYe,decrypt:_Ye,parse:QYe,populate:HYe};wp.exports.configDotenv=js.configDotenv;wp.exports._configVault=js._configVault;wp.exports._parseVault=js._parseVault;wp.exports.config=js.config;wp.exports.decrypt=js.decrypt;wp.exports.parse=js.parse;wp.exports.populate=js.populate;wp.exports=js});var Ine=_((KTt,Ene)=>{\"use strict\";Ene.exports=(t,...e)=>new Promise(r=>{r(t(...e))})});var Ld=_((zTt,b_)=>{\"use strict\";var jYe=Ine(),Cne=t=>{if(t<1)throw new TypeError(\"Expected `concurrency` to be a number from 1 and up\");let e=[],r=0,s=()=>{r--,e.length>0&&e.shift()()},a=(f,p,...h)=>{r++;let E=jYe(f,...h);p(E),E.then(s,s)},n=(f,p,...h)=>{r<t?a(f,p,...h):e.push(a.bind(null,f,p,...h))},c=(f,...p)=>new Promise(h=>n(f,h,...p));return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length}}),c};b_.exports=Cne;b_.exports.default=Cne});function Yf(t){return`YN${t.toString(10).padStart(4,\"0\")}`}function jx(t){let e=Number(t.slice(2));if(typeof Br[e]>\"u\")throw new Error(`Unknown message name: \"${t}\"`);return e}var Br,Gx=Xe(()=>{Br=(Me=>(Me[Me.UNNAMED=0]=\"UNNAMED\",Me[Me.EXCEPTION=1]=\"EXCEPTION\",Me[Me.MISSING_PEER_DEPENDENCY=2]=\"MISSING_PEER_DEPENDENCY\",Me[Me.CYCLIC_DEPENDENCIES=3]=\"CYCLIC_DEPENDENCIES\",Me[Me.DISABLED_BUILD_SCRIPTS=4]=\"DISABLED_BUILD_SCRIPTS\",Me[Me.BUILD_DISABLED=5]=\"BUILD_DISABLED\",Me[Me.SOFT_LINK_BUILD=6]=\"SOFT_LINK_BUILD\",Me[Me.MUST_BUILD=7]=\"MUST_BUILD\",Me[Me.MUST_REBUILD=8]=\"MUST_REBUILD\",Me[Me.BUILD_FAILED=9]=\"BUILD_FAILED\",Me[Me.RESOLVER_NOT_FOUND=10]=\"RESOLVER_NOT_FOUND\",Me[Me.FETCHER_NOT_FOUND=11]=\"FETCHER_NOT_FOUND\",Me[Me.LINKER_NOT_FOUND=12]=\"LINKER_NOT_FOUND\",Me[Me.FETCH_NOT_CACHED=13]=\"FETCH_NOT_CACHED\",Me[Me.YARN_IMPORT_FAILED=14]=\"YARN_IMPORT_FAILED\",Me[Me.REMOTE_INVALID=15]=\"REMOTE_INVALID\",Me[Me.REMOTE_NOT_FOUND=16]=\"REMOTE_NOT_FOUND\",Me[Me.RESOLUTION_PACK=17]=\"RESOLUTION_PACK\",Me[Me.CACHE_CHECKSUM_MISMATCH=18]=\"CACHE_CHECKSUM_MISMATCH\",Me[Me.UNUSED_CACHE_ENTRY=19]=\"UNUSED_CACHE_ENTRY\",Me[Me.MISSING_LOCKFILE_ENTRY=20]=\"MISSING_LOCKFILE_ENTRY\",Me[Me.WORKSPACE_NOT_FOUND=21]=\"WORKSPACE_NOT_FOUND\",Me[Me.TOO_MANY_MATCHING_WORKSPACES=22]=\"TOO_MANY_MATCHING_WORKSPACES\",Me[Me.CONSTRAINTS_MISSING_DEPENDENCY=23]=\"CONSTRAINTS_MISSING_DEPENDENCY\",Me[Me.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]=\"CONSTRAINTS_INCOMPATIBLE_DEPENDENCY\",Me[Me.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]=\"CONSTRAINTS_EXTRANEOUS_DEPENDENCY\",Me[Me.CONSTRAINTS_INVALID_DEPENDENCY=26]=\"CONSTRAINTS_INVALID_DEPENDENCY\",Me[Me.CANT_SUGGEST_RESOLUTIONS=27]=\"CANT_SUGGEST_RESOLUTIONS\",Me[Me.FROZEN_LOCKFILE_EXCEPTION=28]=\"FROZEN_LOCKFILE_EXCEPTION\",Me[Me.CROSS_DRIVE_VIRTUAL_LOCAL=29]=\"CROSS_DRIVE_VIRTUAL_LOCAL\",Me[Me.FETCH_FAILED=30]=\"FETCH_FAILED\",Me[Me.DANGEROUS_NODE_MODULES=31]=\"DANGEROUS_NODE_MODULES\",Me[Me.NODE_GYP_INJECTED=32]=\"NODE_GYP_INJECTED\",Me[Me.AUTHENTICATION_NOT_FOUND=33]=\"AUTHENTICATION_NOT_FOUND\",Me[Me.INVALID_CONFIGURATION_KEY=34]=\"INVALID_CONFIGURATION_KEY\",Me[Me.NETWORK_ERROR=35]=\"NETWORK_ERROR\",Me[Me.LIFECYCLE_SCRIPT=36]=\"LIFECYCLE_SCRIPT\",Me[Me.CONSTRAINTS_MISSING_FIELD=37]=\"CONSTRAINTS_MISSING_FIELD\",Me[Me.CONSTRAINTS_INCOMPATIBLE_FIELD=38]=\"CONSTRAINTS_INCOMPATIBLE_FIELD\",Me[Me.CONSTRAINTS_EXTRANEOUS_FIELD=39]=\"CONSTRAINTS_EXTRANEOUS_FIELD\",Me[Me.CONSTRAINTS_INVALID_FIELD=40]=\"CONSTRAINTS_INVALID_FIELD\",Me[Me.AUTHENTICATION_INVALID=41]=\"AUTHENTICATION_INVALID\",Me[Me.PROLOG_UNKNOWN_ERROR=42]=\"PROLOG_UNKNOWN_ERROR\",Me[Me.PROLOG_SYNTAX_ERROR=43]=\"PROLOG_SYNTAX_ERROR\",Me[Me.PROLOG_EXISTENCE_ERROR=44]=\"PROLOG_EXISTENCE_ERROR\",Me[Me.STACK_OVERFLOW_RESOLUTION=45]=\"STACK_OVERFLOW_RESOLUTION\",Me[Me.AUTOMERGE_FAILED_TO_PARSE=46]=\"AUTOMERGE_FAILED_TO_PARSE\",Me[Me.AUTOMERGE_IMMUTABLE=47]=\"AUTOMERGE_IMMUTABLE\",Me[Me.AUTOMERGE_SUCCESS=48]=\"AUTOMERGE_SUCCESS\",Me[Me.AUTOMERGE_REQUIRED=49]=\"AUTOMERGE_REQUIRED\",Me[Me.DEPRECATED_CLI_SETTINGS=50]=\"DEPRECATED_CLI_SETTINGS\",Me[Me.PLUGIN_NAME_NOT_FOUND=51]=\"PLUGIN_NAME_NOT_FOUND\",Me[Me.INVALID_PLUGIN_REFERENCE=52]=\"INVALID_PLUGIN_REFERENCE\",Me[Me.CONSTRAINTS_AMBIGUITY=53]=\"CONSTRAINTS_AMBIGUITY\",Me[Me.CACHE_OUTSIDE_PROJECT=54]=\"CACHE_OUTSIDE_PROJECT\",Me[Me.IMMUTABLE_INSTALL=55]=\"IMMUTABLE_INSTALL\",Me[Me.IMMUTABLE_CACHE=56]=\"IMMUTABLE_CACHE\",Me[Me.INVALID_MANIFEST=57]=\"INVALID_MANIFEST\",Me[Me.PACKAGE_PREPARATION_FAILED=58]=\"PACKAGE_PREPARATION_FAILED\",Me[Me.INVALID_RANGE_PEER_DEPENDENCY=59]=\"INVALID_RANGE_PEER_DEPENDENCY\",Me[Me.INCOMPATIBLE_PEER_DEPENDENCY=60]=\"INCOMPATIBLE_PEER_DEPENDENCY\",Me[Me.DEPRECATED_PACKAGE=61]=\"DEPRECATED_PACKAGE\",Me[Me.INCOMPATIBLE_OS=62]=\"INCOMPATIBLE_OS\",Me[Me.INCOMPATIBLE_CPU=63]=\"INCOMPATIBLE_CPU\",Me[Me.FROZEN_ARTIFACT_EXCEPTION=64]=\"FROZEN_ARTIFACT_EXCEPTION\",Me[Me.TELEMETRY_NOTICE=65]=\"TELEMETRY_NOTICE\",Me[Me.PATCH_HUNK_FAILED=66]=\"PATCH_HUNK_FAILED\",Me[Me.INVALID_CONFIGURATION_VALUE=67]=\"INVALID_CONFIGURATION_VALUE\",Me[Me.UNUSED_PACKAGE_EXTENSION=68]=\"UNUSED_PACKAGE_EXTENSION\",Me[Me.REDUNDANT_PACKAGE_EXTENSION=69]=\"REDUNDANT_PACKAGE_EXTENSION\",Me[Me.AUTO_NM_SUCCESS=70]=\"AUTO_NM_SUCCESS\",Me[Me.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK=71]=\"NM_CANT_INSTALL_EXTERNAL_SOFT_LINK\",Me[Me.NM_PRESERVE_SYMLINKS_REQUIRED=72]=\"NM_PRESERVE_SYMLINKS_REQUIRED\",Me[Me.UPDATE_LOCKFILE_ONLY_SKIP_LINK=73]=\"UPDATE_LOCKFILE_ONLY_SKIP_LINK\",Me[Me.NM_HARDLINKS_MODE_DOWNGRADED=74]=\"NM_HARDLINKS_MODE_DOWNGRADED\",Me[Me.PROLOG_INSTANTIATION_ERROR=75]=\"PROLOG_INSTANTIATION_ERROR\",Me[Me.INCOMPATIBLE_ARCHITECTURE=76]=\"INCOMPATIBLE_ARCHITECTURE\",Me[Me.GHOST_ARCHITECTURE=77]=\"GHOST_ARCHITECTURE\",Me[Me.RESOLUTION_MISMATCH=78]=\"RESOLUTION_MISMATCH\",Me[Me.PROLOG_LIMIT_EXCEEDED=79]=\"PROLOG_LIMIT_EXCEEDED\",Me[Me.NETWORK_DISABLED=80]=\"NETWORK_DISABLED\",Me[Me.NETWORK_UNSAFE_HTTP=81]=\"NETWORK_UNSAFE_HTTP\",Me[Me.RESOLUTION_FAILED=82]=\"RESOLUTION_FAILED\",Me[Me.AUTOMERGE_GIT_ERROR=83]=\"AUTOMERGE_GIT_ERROR\",Me[Me.CONSTRAINTS_CHECK_FAILED=84]=\"CONSTRAINTS_CHECK_FAILED\",Me[Me.UPDATED_RESOLUTION_RECORD=85]=\"UPDATED_RESOLUTION_RECORD\",Me[Me.EXPLAIN_PEER_DEPENDENCIES_CTA=86]=\"EXPLAIN_PEER_DEPENDENCIES_CTA\",Me[Me.MIGRATION_SUCCESS=87]=\"MIGRATION_SUCCESS\",Me[Me.VERSION_NOTICE=88]=\"VERSION_NOTICE\",Me[Me.TIPS_NOTICE=89]=\"TIPS_NOTICE\",Me[Me.OFFLINE_MODE_ENABLED=90]=\"OFFLINE_MODE_ENABLED\",Me[Me.INVALID_PROVENANCE_ENVIRONMENT=91]=\"INVALID_PROVENANCE_ENVIRONMENT\",Me))(Br||{})});var aB=_((ZTt,wne)=>{var GYe=\"2.0.0\",qYe=Number.MAX_SAFE_INTEGER||9007199254740991,WYe=16,YYe=250,VYe=[\"major\",\"premajor\",\"minor\",\"preminor\",\"patch\",\"prepatch\",\"prerelease\"];wne.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:WYe,MAX_SAFE_BUILD_LENGTH:YYe,MAX_SAFE_INTEGER:qYe,RELEASE_TYPES:VYe,SEMVER_SPEC_VERSION:GYe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lB=_(($Tt,Bne)=>{var JYe=typeof process==\"object\"&&process.env&&process.env.NODE_DEBUG&&/\\bsemver\\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error(\"SEMVER\",...t):()=>{};Bne.exports=JYe});var vE=_((Bp,vne)=>{var{MAX_SAFE_COMPONENT_LENGTH:P_,MAX_SAFE_BUILD_LENGTH:KYe,MAX_LENGTH:zYe}=aB(),XYe=lB();Bp=vne.exports={};var ZYe=Bp.re=[],$Ye=Bp.safeRe=[],rr=Bp.src=[],nr=Bp.t={},eVe=0,x_=\"[a-zA-Z0-9-]\",tVe=[[\"\\\\s\",1],[\"\\\\d\",zYe],[x_,KYe]],rVe=t=>{for(let[e,r]of tVe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Jr=(t,e,r)=>{let s=rVe(e),a=eVe++;XYe(t,a,e),nr[t]=a,rr[a]=e,ZYe[a]=new RegExp(e,r?\"g\":void 0),$Ye[a]=new RegExp(s,r?\"g\":void 0)};Jr(\"NUMERICIDENTIFIER\",\"0|[1-9]\\\\d*\");Jr(\"NUMERICIDENTIFIERLOOSE\",\"\\\\d+\");Jr(\"NONNUMERICIDENTIFIER\",`\\\\d*[a-zA-Z-]${x_}*`);Jr(\"MAINVERSION\",`(${rr[nr.NUMERICIDENTIFIER]})\\\\.(${rr[nr.NUMERICIDENTIFIER]})\\\\.(${rr[nr.NUMERICIDENTIFIER]})`);Jr(\"MAINVERSIONLOOSE\",`(${rr[nr.NUMERICIDENTIFIERLOOSE]})\\\\.(${rr[nr.NUMERICIDENTIFIERLOOSE]})\\\\.(${rr[nr.NUMERICIDENTIFIERLOOSE]})`);Jr(\"PRERELEASEIDENTIFIER\",`(?:${rr[nr.NUMERICIDENTIFIER]}|${rr[nr.NONNUMERICIDENTIFIER]})`);Jr(\"PRERELEASEIDENTIFIERLOOSE\",`(?:${rr[nr.NUMERICIDENTIFIERLOOSE]}|${rr[nr.NONNUMERICIDENTIFIER]})`);Jr(\"PRERELEASE\",`(?:-(${rr[nr.PRERELEASEIDENTIFIER]}(?:\\\\.${rr[nr.PRERELEASEIDENTIFIER]})*))`);Jr(\"PRERELEASELOOSE\",`(?:-?(${rr[nr.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${rr[nr.PRERELEASEIDENTIFIERLOOSE]})*))`);Jr(\"BUILDIDENTIFIER\",`${x_}+`);Jr(\"BUILD\",`(?:\\\\+(${rr[nr.BUILDIDENTIFIER]}(?:\\\\.${rr[nr.BUILDIDENTIFIER]})*))`);Jr(\"FULLPLAIN\",`v?${rr[nr.MAINVERSION]}${rr[nr.PRERELEASE]}?${rr[nr.BUILD]}?`);Jr(\"FULL\",`^${rr[nr.FULLPLAIN]}$`);Jr(\"LOOSEPLAIN\",`[v=\\\\s]*${rr[nr.MAINVERSIONLOOSE]}${rr[nr.PRERELEASELOOSE]}?${rr[nr.BUILD]}?`);Jr(\"LOOSE\",`^${rr[nr.LOOSEPLAIN]}$`);Jr(\"GTLT\",\"((?:<|>)?=?)\");Jr(\"XRANGEIDENTIFIERLOOSE\",`${rr[nr.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);Jr(\"XRANGEIDENTIFIER\",`${rr[nr.NUMERICIDENTIFIER]}|x|X|\\\\*`);Jr(\"XRANGEPLAIN\",`[v=\\\\s]*(${rr[nr.XRANGEIDENTIFIER]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIER]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIER]})(?:${rr[nr.PRERELEASE]})?${rr[nr.BUILD]}?)?)?`);Jr(\"XRANGEPLAINLOOSE\",`[v=\\\\s]*(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:${rr[nr.PRERELEASELOOSE]})?${rr[nr.BUILD]}?)?)?`);Jr(\"XRANGE\",`^${rr[nr.GTLT]}\\\\s*${rr[nr.XRANGEPLAIN]}$`);Jr(\"XRANGELOOSE\",`^${rr[nr.GTLT]}\\\\s*${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"COERCEPLAIN\",`(^|[^\\\\d])(\\\\d{1,${P_}})(?:\\\\.(\\\\d{1,${P_}}))?(?:\\\\.(\\\\d{1,${P_}}))?`);Jr(\"COERCE\",`${rr[nr.COERCEPLAIN]}(?:$|[^\\\\d])`);Jr(\"COERCEFULL\",rr[nr.COERCEPLAIN]+`(?:${rr[nr.PRERELEASE]})?(?:${rr[nr.BUILD]})?(?:$|[^\\\\d])`);Jr(\"COERCERTL\",rr[nr.COERCE],!0);Jr(\"COERCERTLFULL\",rr[nr.COERCEFULL],!0);Jr(\"LONETILDE\",\"(?:~>?)\");Jr(\"TILDETRIM\",`(\\\\s*)${rr[nr.LONETILDE]}\\\\s+`,!0);Bp.tildeTrimReplace=\"$1~\";Jr(\"TILDE\",`^${rr[nr.LONETILDE]}${rr[nr.XRANGEPLAIN]}$`);Jr(\"TILDELOOSE\",`^${rr[nr.LONETILDE]}${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"LONECARET\",\"(?:\\\\^)\");Jr(\"CARETTRIM\",`(\\\\s*)${rr[nr.LONECARET]}\\\\s+`,!0);Bp.caretTrimReplace=\"$1^\";Jr(\"CARET\",`^${rr[nr.LONECARET]}${rr[nr.XRANGEPLAIN]}$`);Jr(\"CARETLOOSE\",`^${rr[nr.LONECARET]}${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"COMPARATORLOOSE\",`^${rr[nr.GTLT]}\\\\s*(${rr[nr.LOOSEPLAIN]})$|^$`);Jr(\"COMPARATOR\",`^${rr[nr.GTLT]}\\\\s*(${rr[nr.FULLPLAIN]})$|^$`);Jr(\"COMPARATORTRIM\",`(\\\\s*)${rr[nr.GTLT]}\\\\s*(${rr[nr.LOOSEPLAIN]}|${rr[nr.XRANGEPLAIN]})`,!0);Bp.comparatorTrimReplace=\"$1$2$3\";Jr(\"HYPHENRANGE\",`^\\\\s*(${rr[nr.XRANGEPLAIN]})\\\\s+-\\\\s+(${rr[nr.XRANGEPLAIN]})\\\\s*$`);Jr(\"HYPHENRANGELOOSE\",`^\\\\s*(${rr[nr.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${rr[nr.XRANGEPLAINLOOSE]})\\\\s*$`);Jr(\"STAR\",\"(<|>)?=?\\\\s*\\\\*\");Jr(\"GTE0\",\"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");Jr(\"GTE0PRE\",\"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\")});var qx=_((eRt,Sne)=>{var nVe=Object.freeze({loose:!0}),iVe=Object.freeze({}),sVe=t=>t?typeof t!=\"object\"?nVe:t:iVe;Sne.exports=sVe});var k_=_((tRt,Pne)=>{var Dne=/^[0-9]+$/,bne=(t,e)=>{let r=Dne.test(t),s=Dne.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},oVe=(t,e)=>bne(e,t);Pne.exports={compareIdentifiers:bne,rcompareIdentifiers:oVe}});var jo=_((rRt,Tne)=>{var Wx=lB(),{MAX_LENGTH:xne,MAX_SAFE_INTEGER:Yx}=aB(),{safeRe:kne,t:Qne}=vE(),aVe=qx(),{compareIdentifiers:SE}=k_(),Q_=class t{constructor(e,r){if(r=aVe(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!=\"string\")throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof e}\".`);if(e.length>xne)throw new TypeError(`version is longer than ${xne} characters`);Wx(\"SemVer\",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?kne[Qne.LOOSE]:kne[Qne.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Yx||this.major<0)throw new TypeError(\"Invalid major version\");if(this.minor>Yx||this.minor<0)throw new TypeError(\"Invalid minor version\");if(this.patch>Yx||this.patch<0)throw new TypeError(\"Invalid patch version\");s[4]?this.prerelease=s[4].split(\".\").map(a=>{if(/^[0-9]+$/.test(a)){let n=+a;if(n>=0&&n<Yx)return n}return a}):this.prerelease=[],this.build=s[5]?s[5].split(\".\"):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(\".\")}`),this.version}toString(){return this.version}compare(e){if(Wx(\"SemVer.compare\",this.version,this.options,e),!(e instanceof t)){if(typeof e==\"string\"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),SE(this.major,e.major)||SE(this.minor,e.minor)||SE(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],a=e.prerelease[r];if(Wx(\"prerelease compare\",r,s,a),s===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(s===void 0)return-1;if(s===a)continue;return SE(s,a)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],a=e.build[r];if(Wx(\"prerelease compare\",r,s,a),s===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(s===void 0)return-1;if(s===a)continue;return SE(s,a)}while(++r)}inc(e,r,s){switch(e){case\"premajor\":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(\"pre\",r,s);break;case\"preminor\":this.prerelease.length=0,this.patch=0,this.minor++,this.inc(\"pre\",r,s);break;case\"prepatch\":this.prerelease.length=0,this.inc(\"patch\",r,s),this.inc(\"pre\",r,s);break;case\"prerelease\":this.prerelease.length===0&&this.inc(\"patch\",r,s),this.inc(\"pre\",r,s);break;case\"major\":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case\"minor\":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case\"patch\":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case\"pre\":{let a=Number(s)?1:0;if(!r&&s===!1)throw new Error(\"invalid increment argument: identifier is empty\");if(this.prerelease.length===0)this.prerelease=[a];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]==\"number\"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(\".\")&&s===!1)throw new Error(\"invalid increment argument: identifier already exists\");this.prerelease.push(a)}}if(r){let n=[r,a];s===!1&&(n=[r]),SE(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(\".\")}`),this}};Tne.exports=Q_});var Md=_((nRt,Fne)=>{var Rne=jo(),lVe=(t,e,r=!1)=>{if(t instanceof Rne)return t;try{return new Rne(t,e)}catch(s){if(!r)return null;throw s}};Fne.exports=lVe});var One=_((iRt,Nne)=>{var cVe=Md(),uVe=(t,e)=>{let r=cVe(t,e);return r?r.version:null};Nne.exports=uVe});var Mne=_((sRt,Lne)=>{var fVe=Md(),AVe=(t,e)=>{let r=fVe(t.trim().replace(/^[=v]+/,\"\"),e);return r?r.version:null};Lne.exports=AVe});var Hne=_((oRt,_ne)=>{var Une=jo(),pVe=(t,e,r,s,a)=>{typeof r==\"string\"&&(a=s,s=r,r=void 0);try{return new Une(t instanceof Une?t.version:t,r).inc(e,s,a).version}catch{return null}};_ne.exports=pVe});var qne=_((aRt,Gne)=>{var jne=Md(),hVe=(t,e)=>{let r=jne(t,null,!0),s=jne(e,null,!0),a=r.compare(s);if(a===0)return null;let n=a>0,c=n?r:s,f=n?s:r,p=!!c.prerelease.length;if(!!f.prerelease.length&&!p)return!f.patch&&!f.minor?\"major\":c.patch?\"patch\":c.minor?\"minor\":\"major\";let E=p?\"pre\":\"\";return r.major!==s.major?E+\"major\":r.minor!==s.minor?E+\"minor\":r.patch!==s.patch?E+\"patch\":\"prerelease\"};Gne.exports=hVe});var Yne=_((lRt,Wne)=>{var gVe=jo(),dVe=(t,e)=>new gVe(t,e).major;Wne.exports=dVe});var Jne=_((cRt,Vne)=>{var mVe=jo(),yVe=(t,e)=>new mVe(t,e).minor;Vne.exports=yVe});var zne=_((uRt,Kne)=>{var EVe=jo(),IVe=(t,e)=>new EVe(t,e).patch;Kne.exports=IVe});var Zne=_((fRt,Xne)=>{var CVe=Md(),wVe=(t,e)=>{let r=CVe(t,e);return r&&r.prerelease.length?r.prerelease:null};Xne.exports=wVe});var Bc=_((ARt,eie)=>{var $ne=jo(),BVe=(t,e,r)=>new $ne(t,r).compare(new $ne(e,r));eie.exports=BVe});var rie=_((pRt,tie)=>{var vVe=Bc(),SVe=(t,e,r)=>vVe(e,t,r);tie.exports=SVe});var iie=_((hRt,nie)=>{var DVe=Bc(),bVe=(t,e)=>DVe(t,e,!0);nie.exports=bVe});var Vx=_((gRt,oie)=>{var sie=jo(),PVe=(t,e,r)=>{let s=new sie(t,r),a=new sie(e,r);return s.compare(a)||s.compareBuild(a)};oie.exports=PVe});var lie=_((dRt,aie)=>{var xVe=Vx(),kVe=(t,e)=>t.sort((r,s)=>xVe(r,s,e));aie.exports=kVe});var uie=_((mRt,cie)=>{var QVe=Vx(),TVe=(t,e)=>t.sort((r,s)=>QVe(s,r,e));cie.exports=TVe});var cB=_((yRt,fie)=>{var RVe=Bc(),FVe=(t,e,r)=>RVe(t,e,r)>0;fie.exports=FVe});var Jx=_((ERt,Aie)=>{var NVe=Bc(),OVe=(t,e,r)=>NVe(t,e,r)<0;Aie.exports=OVe});var T_=_((IRt,pie)=>{var LVe=Bc(),MVe=(t,e,r)=>LVe(t,e,r)===0;pie.exports=MVe});var R_=_((CRt,hie)=>{var UVe=Bc(),_Ve=(t,e,r)=>UVe(t,e,r)!==0;hie.exports=_Ve});var Kx=_((wRt,gie)=>{var HVe=Bc(),jVe=(t,e,r)=>HVe(t,e,r)>=0;gie.exports=jVe});var zx=_((BRt,die)=>{var GVe=Bc(),qVe=(t,e,r)=>GVe(t,e,r)<=0;die.exports=qVe});var F_=_((vRt,mie)=>{var WVe=T_(),YVe=R_(),VVe=cB(),JVe=Kx(),KVe=Jx(),zVe=zx(),XVe=(t,e,r,s)=>{switch(e){case\"===\":return typeof t==\"object\"&&(t=t.version),typeof r==\"object\"&&(r=r.version),t===r;case\"!==\":return typeof t==\"object\"&&(t=t.version),typeof r==\"object\"&&(r=r.version),t!==r;case\"\":case\"=\":case\"==\":return WVe(t,r,s);case\"!=\":return YVe(t,r,s);case\">\":return VVe(t,r,s);case\">=\":return JVe(t,r,s);case\"<\":return KVe(t,r,s);case\"<=\":return zVe(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};mie.exports=XVe});var Eie=_((SRt,yie)=>{var ZVe=jo(),$Ve=Md(),{safeRe:Xx,t:Zx}=vE(),e7e=(t,e)=>{if(t instanceof ZVe)return t;if(typeof t==\"number\"&&(t=String(t)),typeof t!=\"string\")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Xx[Zx.COERCEFULL]:Xx[Zx.COERCE]);else{let p=e.includePrerelease?Xx[Zx.COERCERTLFULL]:Xx[Zx.COERCERTL],h;for(;(h=p.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(r===null)return null;let s=r[2],a=r[3]||\"0\",n=r[4]||\"0\",c=e.includePrerelease&&r[5]?`-${r[5]}`:\"\",f=e.includePrerelease&&r[6]?`+${r[6]}`:\"\";return $Ve(`${s}.${a}.${n}${c}${f}`,e)};yie.exports=e7e});var Cie=_((DRt,Iie)=>{\"use strict\";Iie.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var $x=_((bRt,wie)=>{\"use strict\";wie.exports=Fn;Fn.Node=Ud;Fn.create=Fn;function Fn(t){var e=this;if(e instanceof Fn||(e=new Fn),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach==\"function\")t.forEach(function(a){e.push(a)});else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)e.push(arguments[r]);return e}Fn.prototype.removeNode=function(t){if(t.list!==this)throw new Error(\"removing node which does not belong to this list\");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Fn.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Fn.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Fn.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)r7e(this,arguments[t]);return this.length};Fn.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)n7e(this,arguments[t]);return this.length};Fn.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Fn.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Fn.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,s=0;r!==null;s++)t.call(e,r.value,s,this),r=r.next};Fn.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,s=this.length-1;r!==null;s--)t.call(e,r.value,s,this),r=r.prev};Fn.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Fn.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Fn.prototype.map=function(t,e){e=e||this;for(var r=new Fn,s=this.head;s!==null;)r.push(t.call(e,s.value,this)),s=s.next;return r};Fn.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Fn,s=this.tail;s!==null;)r.push(t.call(e,s.value,this)),s=s.prev;return r};Fn.prototype.reduce=function(t,e){var r,s=this.head;if(arguments.length>1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError(\"Reduce of empty list with no initial value\");for(var a=0;s!==null;a++)r=t(r,s.value,a),s=s.next;return r};Fn.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError(\"Reduce of empty list with no initial value\");for(var a=this.length-1;s!==null;a--)r=t(r,s.value,a),s=s.prev;return r};Fn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Fn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Fn.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Fn;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var s=0,a=this.head;a!==null&&s<t;s++)a=a.next;for(;a!==null&&s<e;s++,a=a.next)r.push(a.value);return r};Fn.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Fn;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var s=this.length,a=this.tail;a!==null&&s>e;s--)a=a.prev;for(;a!==null&&s>t;s--,a=a.prev)r.push(a.value);return r};Fn.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,a=this.head;a!==null&&s<t;s++)a=a.next;for(var n=[],s=0;a&&s<e;s++)n.push(a.value),a=this.removeNode(a);a===null&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(var s=0;s<r.length;s++)a=t7e(this,a,r[s]);return n};Fn.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var s=r.prev;r.prev=r.next,r.next=s}return this.head=e,this.tail=t,this};function t7e(t,e,r){var s=e===t.head?new Ud(r,null,e,t):new Ud(r,e,e.next,t);return s.next===null&&(t.tail=s),s.prev===null&&(t.head=s),t.length++,s}function r7e(t,e){t.tail=new Ud(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function n7e(t,e){t.head=new Ud(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Ud(t,e,r,s){if(!(this instanceof Ud))return new Ud(t,e,r,s);this.list=s,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{Cie()(Fn)}catch{}});var bie=_((PRt,Die)=>{\"use strict\";var i7e=$x(),_d=Symbol(\"max\"),Sp=Symbol(\"length\"),DE=Symbol(\"lengthCalculator\"),fB=Symbol(\"allowStale\"),Hd=Symbol(\"maxAge\"),vp=Symbol(\"dispose\"),Bie=Symbol(\"noDisposeOnSet\"),Gs=Symbol(\"lruList\"),Lu=Symbol(\"cache\"),Sie=Symbol(\"updateAgeOnGet\"),N_=()=>1,L_=class{constructor(e){if(typeof e==\"number\"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!=\"number\"||e.max<0))throw new TypeError(\"max must be a non-negative number\");let r=this[_d]=e.max||1/0,s=e.length||N_;if(this[DE]=typeof s!=\"function\"?N_:s,this[fB]=e.stale||!1,e.maxAge&&typeof e.maxAge!=\"number\")throw new TypeError(\"maxAge must be a number\");this[Hd]=e.maxAge||0,this[vp]=e.dispose,this[Bie]=e.noDisposeOnSet||!1,this[Sie]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!=\"number\"||e<0)throw new TypeError(\"max must be a non-negative number\");this[_d]=e||1/0,uB(this)}get max(){return this[_d]}set allowStale(e){this[fB]=!!e}get allowStale(){return this[fB]}set maxAge(e){if(typeof e!=\"number\")throw new TypeError(\"maxAge must be a non-negative number\");this[Hd]=e,uB(this)}get maxAge(){return this[Hd]}set lengthCalculator(e){typeof e!=\"function\"&&(e=N_),e!==this[DE]&&(this[DE]=e,this[Sp]=0,this[Gs].forEach(r=>{r.length=this[DE](r.value,r.key),this[Sp]+=r.length})),uB(this)}get lengthCalculator(){return this[DE]}get length(){return this[Sp]}get itemCount(){return this[Gs].length}rforEach(e,r){r=r||this;for(let s=this[Gs].tail;s!==null;){let a=s.prev;vie(this,e,s,r),s=a}}forEach(e,r){r=r||this;for(let s=this[Gs].head;s!==null;){let a=s.next;vie(this,e,s,r),s=a}}keys(){return this[Gs].toArray().map(e=>e.key)}values(){return this[Gs].toArray().map(e=>e.value)}reset(){this[vp]&&this[Gs]&&this[Gs].length&&this[Gs].forEach(e=>this[vp](e.key,e.value)),this[Lu]=new Map,this[Gs]=new i7e,this[Sp]=0}dump(){return this[Gs].map(e=>ek(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Gs]}set(e,r,s){if(s=s||this[Hd],s&&typeof s!=\"number\")throw new TypeError(\"maxAge must be a number\");let a=s?Date.now():0,n=this[DE](r,e);if(this[Lu].has(e)){if(n>this[_d])return bE(this,this[Lu].get(e)),!1;let p=this[Lu].get(e).value;return this[vp]&&(this[Bie]||this[vp](e,p.value)),p.now=a,p.maxAge=s,p.value=r,this[Sp]+=n-p.length,p.length=n,this.get(e),uB(this),!0}let c=new M_(e,r,n,a,s);return c.length>this[_d]?(this[vp]&&this[vp](e,r),!1):(this[Sp]+=c.length,this[Gs].unshift(c),this[Lu].set(e,this[Gs].head),uB(this),!0)}has(e){if(!this[Lu].has(e))return!1;let r=this[Lu].get(e).value;return!ek(this,r)}get(e){return O_(this,e,!0)}peek(e){return O_(this,e,!1)}pop(){let e=this[Gs].tail;return e?(bE(this,e),e.value):null}del(e){bE(this,this[Lu].get(e))}load(e){this.reset();let r=Date.now();for(let s=e.length-1;s>=0;s--){let a=e[s],n=a.e||0;if(n===0)this.set(a.k,a.v);else{let c=n-r;c>0&&this.set(a.k,a.v,c)}}}prune(){this[Lu].forEach((e,r)=>O_(this,r,!1))}},O_=(t,e,r)=>{let s=t[Lu].get(e);if(s){let a=s.value;if(ek(t,a)){if(bE(t,s),!t[fB])return}else r&&(t[Sie]&&(s.value.now=Date.now()),t[Gs].unshiftNode(s));return a.value}},ek=(t,e)=>{if(!e||!e.maxAge&&!t[Hd])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[Hd]&&r>t[Hd]},uB=t=>{if(t[Sp]>t[_d])for(let e=t[Gs].tail;t[Sp]>t[_d]&&e!==null;){let r=e.prev;bE(t,e),e=r}},bE=(t,e)=>{if(e){let r=e.value;t[vp]&&t[vp](r.key,r.value),t[Sp]-=r.length,t[Lu].delete(r.key),t[Gs].removeNode(e)}},M_=class{constructor(e,r,s,a,n){this.key=e,this.value=r,this.length=s,this.now=a,this.maxAge=n||0}},vie=(t,e,r,s)=>{let a=r.value;ek(t,a)&&(bE(t,r),t[fB]||(a=void 0)),a&&e.call(s,a.value,a.key,t)};Die.exports=L_});var vc=_((xRt,Qie)=>{var U_=class t{constructor(e,r){if(r=o7e(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof __)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\\s+/).join(\" \"),this.set=this.raw.split(\"||\").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(a=>!xie(a[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let a of this.set)if(a.length===1&&p7e(a[0])){this.set=[a];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(\" \").trim()).join(\"||\").trim(),this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&f7e)|(this.options.loose&&A7e))+\":\"+e,a=Pie.get(s);if(a)return a;let n=this.options.loose,c=n?sl[wa.HYPHENRANGELOOSE]:sl[wa.HYPHENRANGE];e=e.replace(c,B7e(this.options.includePrerelease)),vi(\"hyphen replace\",e),e=e.replace(sl[wa.COMPARATORTRIM],l7e),vi(\"comparator trim\",e),e=e.replace(sl[wa.TILDETRIM],c7e),vi(\"tilde trim\",e),e=e.replace(sl[wa.CARETTRIM],u7e),vi(\"caret trim\",e);let f=e.split(\" \").map(C=>h7e(C,this.options)).join(\" \").split(/\\s+/).map(C=>w7e(C,this.options));n&&(f=f.filter(C=>(vi(\"loose invalid filter\",C,this.options),!!C.match(sl[wa.COMPARATORLOOSE])))),vi(\"range list\",f);let p=new Map,h=f.map(C=>new __(C,this.options));for(let C of h){if(xie(C))return[C];p.set(C.value,C)}p.size>1&&p.has(\"\")&&p.delete(\"\");let E=[...p.values()];return Pie.set(s,E),E}intersects(e,r){if(!(e instanceof t))throw new TypeError(\"a Range is required\");return this.set.some(s=>kie(s,r)&&e.set.some(a=>kie(a,r)&&s.every(n=>a.every(c=>n.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e==\"string\")try{e=new a7e(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(v7e(this.set[r],e,this.options))return!0;return!1}};Qie.exports=U_;var s7e=bie(),Pie=new s7e({max:1e3}),o7e=qx(),__=AB(),vi=lB(),a7e=jo(),{safeRe:sl,t:wa,comparatorTrimReplace:l7e,tildeTrimReplace:c7e,caretTrimReplace:u7e}=vE(),{FLAG_INCLUDE_PRERELEASE:f7e,FLAG_LOOSE:A7e}=aB(),xie=t=>t.value===\"<0.0.0-0\",p7e=t=>t.value===\"\",kie=(t,e)=>{let r=!0,s=t.slice(),a=s.pop();for(;r&&s.length;)r=s.every(n=>a.intersects(n,e)),a=s.pop();return r},h7e=(t,e)=>(vi(\"comp\",t,e),t=m7e(t,e),vi(\"caret\",t),t=g7e(t,e),vi(\"tildes\",t),t=E7e(t,e),vi(\"xrange\",t),t=C7e(t,e),vi(\"stars\",t),t),Ba=t=>!t||t.toLowerCase()===\"x\"||t===\"*\",g7e=(t,e)=>t.trim().split(/\\s+/).map(r=>d7e(r,e)).join(\" \"),d7e=(t,e)=>{let r=e.loose?sl[wa.TILDELOOSE]:sl[wa.TILDE];return t.replace(r,(s,a,n,c,f)=>{vi(\"tilde\",t,s,a,n,c,f);let p;return Ba(a)?p=\"\":Ba(n)?p=`>=${a}.0.0 <${+a+1}.0.0-0`:Ba(c)?p=`>=${a}.${n}.0 <${a}.${+n+1}.0-0`:f?(vi(\"replaceTilde pr\",f),p=`>=${a}.${n}.${c}-${f} <${a}.${+n+1}.0-0`):p=`>=${a}.${n}.${c} <${a}.${+n+1}.0-0`,vi(\"tilde return\",p),p})},m7e=(t,e)=>t.trim().split(/\\s+/).map(r=>y7e(r,e)).join(\" \"),y7e=(t,e)=>{vi(\"caret\",t,e);let r=e.loose?sl[wa.CARETLOOSE]:sl[wa.CARET],s=e.includePrerelease?\"-0\":\"\";return t.replace(r,(a,n,c,f,p)=>{vi(\"caret\",t,a,n,c,f,p);let h;return Ba(n)?h=\"\":Ba(c)?h=`>=${n}.0.0${s} <${+n+1}.0.0-0`:Ba(f)?n===\"0\"?h=`>=${n}.${c}.0${s} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.0${s} <${+n+1}.0.0-0`:p?(vi(\"replaceCaret pr\",p),n===\"0\"?c===\"0\"?h=`>=${n}.${c}.${f}-${p} <${n}.${c}.${+f+1}-0`:h=`>=${n}.${c}.${f}-${p} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.${f}-${p} <${+n+1}.0.0-0`):(vi(\"no pr\"),n===\"0\"?c===\"0\"?h=`>=${n}.${c}.${f}${s} <${n}.${c}.${+f+1}-0`:h=`>=${n}.${c}.${f}${s} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.${f} <${+n+1}.0.0-0`),vi(\"caret return\",h),h})},E7e=(t,e)=>(vi(\"replaceXRanges\",t,e),t.split(/\\s+/).map(r=>I7e(r,e)).join(\" \")),I7e=(t,e)=>{t=t.trim();let r=e.loose?sl[wa.XRANGELOOSE]:sl[wa.XRANGE];return t.replace(r,(s,a,n,c,f,p)=>{vi(\"xRange\",t,s,a,n,c,f,p);let h=Ba(n),E=h||Ba(c),C=E||Ba(f),S=C;return a===\"=\"&&S&&(a=\"\"),p=e.includePrerelease?\"-0\":\"\",h?a===\">\"||a===\"<\"?s=\"<0.0.0-0\":s=\"*\":a&&S?(E&&(c=0),f=0,a===\">\"?(a=\">=\",E?(n=+n+1,c=0,f=0):(c=+c+1,f=0)):a===\"<=\"&&(a=\"<\",E?n=+n+1:c=+c+1),a===\"<\"&&(p=\"-0\"),s=`${a+n}.${c}.${f}${p}`):E?s=`>=${n}.0.0${p} <${+n+1}.0.0-0`:C&&(s=`>=${n}.${c}.0${p} <${n}.${+c+1}.0-0`),vi(\"xRange return\",s),s})},C7e=(t,e)=>(vi(\"replaceStars\",t,e),t.trim().replace(sl[wa.STAR],\"\")),w7e=(t,e)=>(vi(\"replaceGTE0\",t,e),t.trim().replace(sl[e.includePrerelease?wa.GTE0PRE:wa.GTE0],\"\")),B7e=t=>(e,r,s,a,n,c,f,p,h,E,C,S,P)=>(Ba(s)?r=\"\":Ba(a)?r=`>=${s}.0.0${t?\"-0\":\"\"}`:Ba(n)?r=`>=${s}.${a}.0${t?\"-0\":\"\"}`:c?r=`>=${r}`:r=`>=${r}${t?\"-0\":\"\"}`,Ba(h)?p=\"\":Ba(E)?p=`<${+h+1}.0.0-0`:Ba(C)?p=`<${h}.${+E+1}.0-0`:S?p=`<=${h}.${E}.${C}-${S}`:t?p=`<${h}.${E}.${+C+1}-0`:p=`<=${p}`,`${r} ${p}`.trim()),v7e=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(vi(t[s].semver),t[s].semver!==__.ANY&&t[s].semver.prerelease.length>0){let a=t[s].semver;if(a.major===e.major&&a.minor===e.minor&&a.patch===e.patch)return!0}return!1}return!0}});var AB=_((kRt,Lie)=>{var pB=Symbol(\"SemVer ANY\"),G_=class t{static get ANY(){return pB}constructor(e,r){if(r=Tie(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\\s+/).join(\" \"),j_(\"comparator\",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===pB?this.value=\"\":this.value=this.operator+this.semver.version,j_(\"comp\",this)}parse(e){let r=this.options.loose?Rie[Fie.COMPARATORLOOSE]:Rie[Fie.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:\"\",this.operator===\"=\"&&(this.operator=\"\"),s[2]?this.semver=new Nie(s[2],this.options.loose):this.semver=pB}toString(){return this.value}test(e){if(j_(\"Comparator.test\",e,this.options.loose),this.semver===pB||e===pB)return!0;if(typeof e==\"string\")try{e=new Nie(e,this.options)}catch{return!1}return H_(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError(\"a Comparator is required\");return this.operator===\"\"?this.value===\"\"?!0:new Oie(e.value,r).test(this.value):e.operator===\"\"?e.value===\"\"?!0:new Oie(this.value,r).test(e.semver):(r=Tie(r),r.includePrerelease&&(this.value===\"<0.0.0-0\"||e.value===\"<0.0.0-0\")||!r.includePrerelease&&(this.value.startsWith(\"<0.0.0\")||e.value.startsWith(\"<0.0.0\"))?!1:!!(this.operator.startsWith(\">\")&&e.operator.startsWith(\">\")||this.operator.startsWith(\"<\")&&e.operator.startsWith(\"<\")||this.semver.version===e.semver.version&&this.operator.includes(\"=\")&&e.operator.includes(\"=\")||H_(this.semver,\"<\",e.semver,r)&&this.operator.startsWith(\">\")&&e.operator.startsWith(\"<\")||H_(this.semver,\">\",e.semver,r)&&this.operator.startsWith(\"<\")&&e.operator.startsWith(\">\")))}};Lie.exports=G_;var Tie=qx(),{safeRe:Rie,t:Fie}=vE(),H_=F_(),j_=lB(),Nie=jo(),Oie=vc()});var hB=_((QRt,Mie)=>{var S7e=vc(),D7e=(t,e,r)=>{try{e=new S7e(e,r)}catch{return!1}return e.test(t)};Mie.exports=D7e});var _ie=_((TRt,Uie)=>{var b7e=vc(),P7e=(t,e)=>new b7e(t,e).set.map(r=>r.map(s=>s.value).join(\" \").trim().split(\" \"));Uie.exports=P7e});var jie=_((RRt,Hie)=>{var x7e=jo(),k7e=vc(),Q7e=(t,e,r)=>{let s=null,a=null,n=null;try{n=new k7e(e,r)}catch{return null}return t.forEach(c=>{n.test(c)&&(!s||a.compare(c)===-1)&&(s=c,a=new x7e(s,r))}),s};Hie.exports=Q7e});var qie=_((FRt,Gie)=>{var T7e=jo(),R7e=vc(),F7e=(t,e,r)=>{let s=null,a=null,n=null;try{n=new R7e(e,r)}catch{return null}return t.forEach(c=>{n.test(c)&&(!s||a.compare(c)===1)&&(s=c,a=new T7e(s,r))}),s};Gie.exports=F7e});var Vie=_((NRt,Yie)=>{var q_=jo(),N7e=vc(),Wie=cB(),O7e=(t,e)=>{t=new N7e(t,e);let r=new q_(\"0.0.0\");if(t.test(r)||(r=new q_(\"0.0.0-0\"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let a=t.set[s],n=null;a.forEach(c=>{let f=new q_(c.semver.version);switch(c.operator){case\">\":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case\"\":case\">=\":(!n||Wie(f,n))&&(n=f);break;case\"<\":case\"<=\":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),n&&(!r||Wie(r,n))&&(r=n)}return r&&t.test(r)?r:null};Yie.exports=O7e});var Kie=_((ORt,Jie)=>{var L7e=vc(),M7e=(t,e)=>{try{return new L7e(t,e).range||\"*\"}catch{return null}};Jie.exports=M7e});var tk=_((LRt,$ie)=>{var U7e=jo(),Zie=AB(),{ANY:_7e}=Zie,H7e=vc(),j7e=hB(),zie=cB(),Xie=Jx(),G7e=zx(),q7e=Kx(),W7e=(t,e,r,s)=>{t=new U7e(t,s),e=new H7e(e,s);let a,n,c,f,p;switch(r){case\">\":a=zie,n=G7e,c=Xie,f=\">\",p=\">=\";break;case\"<\":a=Xie,n=q7e,c=zie,f=\"<\",p=\"<=\";break;default:throw new TypeError('Must provide a hilo val of \"<\" or \">\"')}if(j7e(t,e,s))return!1;for(let h=0;h<e.set.length;++h){let E=e.set[h],C=null,S=null;if(E.forEach(P=>{P.semver===_7e&&(P=new Zie(\">=0.0.0\")),C=C||P,S=S||P,a(P.semver,C.semver,s)?C=P:c(P.semver,S.semver,s)&&(S=P)}),C.operator===f||C.operator===p||(!S.operator||S.operator===f)&&n(t,S.semver))return!1;if(S.operator===p&&c(t,S.semver))return!1}return!0};$ie.exports=W7e});var tse=_((MRt,ese)=>{var Y7e=tk(),V7e=(t,e,r)=>Y7e(t,e,\">\",r);ese.exports=V7e});var nse=_((URt,rse)=>{var J7e=tk(),K7e=(t,e,r)=>J7e(t,e,\"<\",r);rse.exports=K7e});var ose=_((_Rt,sse)=>{var ise=vc(),z7e=(t,e,r)=>(t=new ise(t,r),e=new ise(e,r),t.intersects(e,r));sse.exports=z7e});var lse=_((HRt,ase)=>{var X7e=hB(),Z7e=Bc();ase.exports=(t,e,r)=>{let s=[],a=null,n=null,c=t.sort((E,C)=>Z7e(E,C,r));for(let E of c)X7e(E,e,r)?(n=E,a||(a=E)):(n&&s.push([a,n]),n=null,a=null);a&&s.push([a,null]);let f=[];for(let[E,C]of s)E===C?f.push(E):!C&&E===c[0]?f.push(\"*\"):C?E===c[0]?f.push(`<=${C}`):f.push(`${E} - ${C}`):f.push(`>=${E}`);let p=f.join(\" || \"),h=typeof e.raw==\"string\"?e.raw:String(e);return p.length<h.length?p:e}});var hse=_((jRt,pse)=>{var cse=vc(),Y_=AB(),{ANY:W_}=Y_,gB=hB(),V_=Bc(),$7e=(t,e,r={})=>{if(t===e)return!0;t=new cse(t,r),e=new cse(e,r);let s=!1;e:for(let a of t.set){for(let n of e.set){let c=tJe(a,n,r);if(s=s||c!==null,c)continue e}if(s)return!1}return!0},eJe=[new Y_(\">=0.0.0-0\")],use=[new Y_(\">=0.0.0\")],tJe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===W_){if(e.length===1&&e[0].semver===W_)return!0;r.includePrerelease?t=eJe:t=use}if(e.length===1&&e[0].semver===W_){if(r.includePrerelease)return!0;e=use}let s=new Set,a,n;for(let P of t)P.operator===\">\"||P.operator===\">=\"?a=fse(a,P,r):P.operator===\"<\"||P.operator===\"<=\"?n=Ase(n,P,r):s.add(P.semver);if(s.size>1)return null;let c;if(a&&n){if(c=V_(a.semver,n.semver,r),c>0)return null;if(c===0&&(a.operator!==\">=\"||n.operator!==\"<=\"))return null}for(let P of s){if(a&&!gB(P,String(a),r)||n&&!gB(P,String(n),r))return null;for(let I of e)if(!gB(P,String(I),r))return!1;return!0}let f,p,h,E,C=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,S=a&&!r.includePrerelease&&a.semver.prerelease.length?a.semver:!1;C&&C.prerelease.length===1&&n.operator===\"<\"&&C.prerelease[0]===0&&(C=!1);for(let P of e){if(E=E||P.operator===\">\"||P.operator===\">=\",h=h||P.operator===\"<\"||P.operator===\"<=\",a){if(S&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===S.major&&P.semver.minor===S.minor&&P.semver.patch===S.patch&&(S=!1),P.operator===\">\"||P.operator===\">=\"){if(f=fse(a,P,r),f===P&&f!==a)return!1}else if(a.operator===\">=\"&&!gB(a.semver,String(P),r))return!1}if(n){if(C&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===C.major&&P.semver.minor===C.minor&&P.semver.patch===C.patch&&(C=!1),P.operator===\"<\"||P.operator===\"<=\"){if(p=Ase(n,P,r),p===P&&p!==n)return!1}else if(n.operator===\"<=\"&&!gB(n.semver,String(P),r))return!1}if(!P.operator&&(n||a)&&c!==0)return!1}return!(a&&h&&!n&&c!==0||n&&E&&!a&&c!==0||S||C)},fse=(t,e,r)=>{if(!t)return e;let s=V_(t.semver,e.semver,r);return s>0?t:s<0||e.operator===\">\"&&t.operator===\">=\"?e:t},Ase=(t,e,r)=>{if(!t)return e;let s=V_(t.semver,e.semver,r);return s<0?t:s>0||e.operator===\"<\"&&t.operator===\"<=\"?e:t};pse.exports=$7e});var Ai=_((GRt,mse)=>{var J_=vE(),gse=aB(),rJe=jo(),dse=k_(),nJe=Md(),iJe=One(),sJe=Mne(),oJe=Hne(),aJe=qne(),lJe=Yne(),cJe=Jne(),uJe=zne(),fJe=Zne(),AJe=Bc(),pJe=rie(),hJe=iie(),gJe=Vx(),dJe=lie(),mJe=uie(),yJe=cB(),EJe=Jx(),IJe=T_(),CJe=R_(),wJe=Kx(),BJe=zx(),vJe=F_(),SJe=Eie(),DJe=AB(),bJe=vc(),PJe=hB(),xJe=_ie(),kJe=jie(),QJe=qie(),TJe=Vie(),RJe=Kie(),FJe=tk(),NJe=tse(),OJe=nse(),LJe=ose(),MJe=lse(),UJe=hse();mse.exports={parse:nJe,valid:iJe,clean:sJe,inc:oJe,diff:aJe,major:lJe,minor:cJe,patch:uJe,prerelease:fJe,compare:AJe,rcompare:pJe,compareLoose:hJe,compareBuild:gJe,sort:dJe,rsort:mJe,gt:yJe,lt:EJe,eq:IJe,neq:CJe,gte:wJe,lte:BJe,cmp:vJe,coerce:SJe,Comparator:DJe,Range:bJe,satisfies:PJe,toComparators:xJe,maxSatisfying:kJe,minSatisfying:QJe,minVersion:TJe,validRange:RJe,outside:FJe,gtr:NJe,ltr:OJe,intersects:LJe,simplifyRange:MJe,subset:UJe,SemVer:rJe,re:J_.re,src:J_.src,tokens:J_.t,SEMVER_SPEC_VERSION:gse.SEMVER_SPEC_VERSION,RELEASE_TYPES:gse.RELEASE_TYPES,compareIdentifiers:dse.compareIdentifiers,rcompareIdentifiers:dse.rcompareIdentifiers}});var Ese=_((qRt,yse)=>{\"use strict\";function _Je(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function jd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,jd)}_Je(jd,Error);jd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function HJe(t,e){e=e!==void 0?e:{};var r={},s={Expression:y},a=y,n=\"|\",c=Fe(\"|\",!1),f=\"&\",p=Fe(\"&\",!1),h=\"^\",E=Fe(\"^\",!1),C=function($,oe){return!!oe.reduce((xe,Te)=>{switch(Te[1]){case\"|\":return xe|Te[3];case\"&\":return xe&Te[3];case\"^\":return xe^Te[3]}},$)},S=\"!\",P=Fe(\"!\",!1),I=function($){return!$},R=\"(\",N=Fe(\"(\",!1),U=\")\",W=Fe(\")\",!1),ee=function($){return $},ie=/^[^ \\t\\n\\r()!|&\\^]/,ue=Ne([\" \",\"\t\",`\n`,\"\\r\",\"(\",\")\",\"!\",\"|\",\"&\",\"^\"],!0,!1),le=function($){return e.queryPattern.test($)},me=function($){return e.checkFn($)},pe=ke(\"whitespace\"),Be=/^[ \\t\\n\\r]/,Ce=Ne([\" \",\"\t\",`\n`,\"\\r\"],!1,!1),g=0,we=0,ye=[{line:1,column:1}],Ae=0,se=[],Z=0,De;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function Re(){return t.substring(we,g)}function mt(){return Ue(we,g)}function j($,oe){throw oe=oe!==void 0?oe:Ue(we,g),b([ke($)],t.substring(we,g),oe)}function rt($,oe){throw oe=oe!==void 0?oe:Ue(we,g),w($,oe)}function Fe($,oe){return{type:\"literal\",text:$,ignoreCase:oe}}function Ne($,oe,xe){return{type:\"class\",parts:$,inverted:oe,ignoreCase:xe}}function Pe(){return{type:\"any\"}}function Ve(){return{type:\"end\"}}function ke($){return{type:\"other\",description:$}}function it($){var oe=ye[$],xe;if(oe)return oe;for(xe=$-1;!ye[xe];)xe--;for(oe=ye[xe],oe={line:oe.line,column:oe.column};xe<$;)t.charCodeAt(xe)===10?(oe.line++,oe.column=1):oe.column++,xe++;return ye[$]=oe,oe}function Ue($,oe){var xe=it($),Te=it(oe);return{start:{offset:$,line:xe.line,column:xe.column},end:{offset:oe,line:Te.line,column:Te.column}}}function x($){g<Ae||(g>Ae&&(Ae=g,se=[]),se.push($))}function w($,oe){return new jd($,null,null,oe)}function b($,oe,xe){return new jd(jd.buildMessage($,oe),$,oe,xe)}function y(){var $,oe,xe,Te,lt,Ct,qt,ir;if($=g,oe=F(),oe!==r){for(xe=[],Te=g,lt=X(),lt!==r?(t.charCodeAt(g)===124?(Ct=n,g++):(Ct=r,Z===0&&x(c)),Ct===r&&(t.charCodeAt(g)===38?(Ct=f,g++):(Ct=r,Z===0&&x(p)),Ct===r&&(t.charCodeAt(g)===94?(Ct=h,g++):(Ct=r,Z===0&&x(E)))),Ct!==r?(qt=X(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Ct,qt,ir],Te=lt):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r);Te!==r;)xe.push(Te),Te=g,lt=X(),lt!==r?(t.charCodeAt(g)===124?(Ct=n,g++):(Ct=r,Z===0&&x(c)),Ct===r&&(t.charCodeAt(g)===38?(Ct=f,g++):(Ct=r,Z===0&&x(p)),Ct===r&&(t.charCodeAt(g)===94?(Ct=h,g++):(Ct=r,Z===0&&x(E)))),Ct!==r?(qt=X(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Ct,qt,ir],Te=lt):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r);xe!==r?(we=$,oe=C(oe,xe),$=oe):(g=$,$=r)}else g=$,$=r;return $}function F(){var $,oe,xe,Te,lt,Ct;return $=g,t.charCodeAt(g)===33?(oe=S,g++):(oe=r,Z===0&&x(P)),oe!==r?(xe=F(),xe!==r?(we=$,oe=I(xe),$=oe):(g=$,$=r)):(g=$,$=r),$===r&&($=g,t.charCodeAt(g)===40?(oe=R,g++):(oe=r,Z===0&&x(N)),oe!==r?(xe=X(),xe!==r?(Te=y(),Te!==r?(lt=X(),lt!==r?(t.charCodeAt(g)===41?(Ct=U,g++):(Ct=r,Z===0&&x(W)),Ct!==r?(we=$,oe=ee(Te),$=oe):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r),$===r&&($=z())),$}function z(){var $,oe,xe,Te,lt;if($=g,oe=X(),oe!==r){if(xe=g,Te=[],ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,Z===0&&x(ue)),lt!==r)for(;lt!==r;)Te.push(lt),ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,Z===0&&x(ue));else Te=r;Te!==r?xe=t.substring(xe,g):xe=Te,xe!==r?(we=g,Te=le(xe),Te?Te=void 0:Te=r,Te!==r?(we=$,oe=me(xe),$=oe):(g=$,$=r)):(g=$,$=r)}else g=$,$=r;return $}function X(){var $,oe;for(Z++,$=[],Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,Z===0&&x(Ce));oe!==r;)$.push(oe),Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,Z===0&&x(Ce));return Z--,$===r&&(oe=r,Z===0&&x(pe)),$}if(De=a(),De!==r&&g===t.length)return De;throw De!==r&&g<t.length&&x(Ve()),b(se,Ae<t.length?t.charAt(Ae):null,Ae<t.length?Ue(Ae,Ae+1):Ue(Ae,Ae))}yse.exports={SyntaxError:jd,parse:HJe}});var Ise=_(rk=>{var{parse:jJe}=Ese();rk.makeParser=(t=/[a-z]+/)=>(e,r)=>jJe(e,{queryPattern:t,checkFn:r});rk.parse=rk.makeParser()});var wse=_((YRt,Cse)=>{\"use strict\";Cse.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var K_=_((VRt,vse)=>{var dB=wse(),Bse={};for(let t of Object.keys(dB))Bse[dB[t]]=t;var hr={rgb:{channels:3,labels:\"rgb\"},hsl:{channels:3,labels:\"hsl\"},hsv:{channels:3,labels:\"hsv\"},hwb:{channels:3,labels:\"hwb\"},cmyk:{channels:4,labels:\"cmyk\"},xyz:{channels:3,labels:\"xyz\"},lab:{channels:3,labels:\"lab\"},lch:{channels:3,labels:\"lch\"},hex:{channels:1,labels:[\"hex\"]},keyword:{channels:1,labels:[\"keyword\"]},ansi16:{channels:1,labels:[\"ansi16\"]},ansi256:{channels:1,labels:[\"ansi256\"]},hcg:{channels:3,labels:[\"h\",\"c\",\"g\"]},apple:{channels:3,labels:[\"r16\",\"g16\",\"b16\"]},gray:{channels:1,labels:[\"gray\"]}};vse.exports=hr;for(let t of Object.keys(hr)){if(!(\"channels\"in hr[t]))throw new Error(\"missing channels property: \"+t);if(!(\"labels\"in hr[t]))throw new Error(\"missing channel labels property: \"+t);if(hr[t].labels.length!==hr[t].channels)throw new Error(\"channel and label counts mismatch: \"+t);let{channels:e,labels:r}=hr[t];delete hr[t].channels,delete hr[t].labels,Object.defineProperty(hr[t],\"channels\",{value:e}),Object.defineProperty(hr[t],\"labels\",{value:r})}hr.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.min(e,r,s),n=Math.max(e,r,s),c=n-a,f,p;n===a?f=0:e===n?f=(r-s)/c:r===n?f=2+(s-e)/c:s===n&&(f=4+(e-r)/c),f=Math.min(f*60,360),f<0&&(f+=360);let h=(a+n)/2;return n===a?p=0:h<=.5?p=c/(n+a):p=c/(2-n-a),[f,p*100,h*100]};hr.rgb.hsv=function(t){let e,r,s,a,n,c=t[0]/255,f=t[1]/255,p=t[2]/255,h=Math.max(c,f,p),E=h-Math.min(c,f,p),C=function(S){return(h-S)/6/E+1/2};return E===0?(a=0,n=0):(n=E/h,e=C(c),r=C(f),s=C(p),c===h?a=s-r:f===h?a=1/3+e-s:p===h&&(a=2/3+r-e),a<0?a+=1:a>1&&(a-=1)),[a*360,n*100,h*100]};hr.rgb.hwb=function(t){let e=t[0],r=t[1],s=t[2],a=hr.rgb.hsl(t)[0],n=1/255*Math.min(e,Math.min(r,s));return s=1-1/255*Math.max(e,Math.max(r,s)),[a,n*100,s*100]};hr.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.min(1-e,1-r,1-s),n=(1-e-a)/(1-a)||0,c=(1-r-a)/(1-a)||0,f=(1-s-a)/(1-a)||0;return[n*100,c*100,f*100,a*100]};function GJe(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}hr.rgb.keyword=function(t){let e=Bse[t];if(e)return e;let r=1/0,s;for(let a of Object.keys(dB)){let n=dB[a],c=GJe(t,n);c<r&&(r=c,s=a)}return s};hr.keyword.rgb=function(t){return dB[t]};hr.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let a=e*.4124+r*.3576+s*.1805,n=e*.2126+r*.7152+s*.0722,c=e*.0193+r*.1192+s*.9505;return[a*100,n*100,c*100]};hr.rgb.lab=function(t){let e=hr.rgb.xyz(t),r=e[0],s=e[1],a=e[2];r/=95.047,s/=100,a/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let n=116*s-16,c=500*(r-s),f=200*(s-a);return[n,c,f]};hr.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100,a,n,c;if(r===0)return c=s*255,[c,c,c];s<.5?a=s*(1+r):a=s+r-s*r;let f=2*s-a,p=[0,0,0];for(let h=0;h<3;h++)n=e+1/3*-(h-1),n<0&&n++,n>1&&n--,6*n<1?c=f+(a-f)*6*n:2*n<1?c=a:3*n<2?c=f+(a-f)*(2/3-n)*6:c=f,p[h]=c*255;return p};hr.hsl.hsv=function(t){let e=t[0],r=t[1]/100,s=t[2]/100,a=r,n=Math.max(s,.01);s*=2,r*=s<=1?s:2-s,a*=n<=1?n:2-n;let c=(s+r)/2,f=s===0?2*a/(n+a):2*r/(s+r);return[e,f*100,c*100]};hr.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,s=t[2]/100,a=Math.floor(e)%6,n=e-Math.floor(e),c=255*s*(1-r),f=255*s*(1-r*n),p=255*s*(1-r*(1-n));switch(s*=255,a){case 0:return[s,p,c];case 1:return[f,s,c];case 2:return[c,s,p];case 3:return[c,f,s];case 4:return[p,c,s];case 5:return[s,c,f]}};hr.hsv.hsl=function(t){let e=t[0],r=t[1]/100,s=t[2]/100,a=Math.max(s,.01),n,c;c=(2-r)*s;let f=(2-r)*a;return n=r*a,n/=f<=1?f:2-f,n=n||0,c/=2,[e,n*100,c*100]};hr.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100,a=r+s,n;a>1&&(r/=a,s/=a);let c=Math.floor(6*e),f=1-s;n=6*e-c,c&1&&(n=1-n);let p=r+n*(f-r),h,E,C;switch(c){default:case 6:case 0:h=f,E=p,C=r;break;case 1:h=p,E=f,C=r;break;case 2:h=r,E=f,C=p;break;case 3:h=r,E=p,C=f;break;case 4:h=p,E=r,C=f;break;case 5:h=f,E=r,C=p;break}return[h*255,E*255,C*255]};hr.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,s=t[2]/100,a=t[3]/100,n=1-Math.min(1,e*(1-a)+a),c=1-Math.min(1,r*(1-a)+a),f=1-Math.min(1,s*(1-a)+a);return[n*255,c*255,f*255]};hr.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,s=t[2]/100,a,n,c;return a=e*3.2406+r*-1.5372+s*-.4986,n=e*-.9689+r*1.8758+s*.0415,c=e*.0557+r*-.204+s*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),c=Math.min(Math.max(0,c),1),[a*255,n*255,c*255]};hr.xyz.lab=function(t){let e=t[0],r=t[1],s=t[2];e/=95.047,r/=100,s/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let a=116*r-16,n=500*(e-r),c=200*(r-s);return[a,n,c]};hr.lab.xyz=function(t){let e=t[0],r=t[1],s=t[2],a,n,c;n=(e+16)/116,a=r/500+n,c=n-s/200;let f=n**3,p=a**3,h=c**3;return n=f>.008856?f:(n-16/116)/7.787,a=p>.008856?p:(a-16/116)/7.787,c=h>.008856?h:(c-16/116)/7.787,a*=95.047,n*=100,c*=108.883,[a,n,c]};hr.lab.lch=function(t){let e=t[0],r=t[1],s=t[2],a;a=Math.atan2(s,r)*360/2/Math.PI,a<0&&(a+=360);let c=Math.sqrt(r*r+s*s);return[e,c,a]};hr.lch.lab=function(t){let e=t[0],r=t[1],a=t[2]/360*2*Math.PI,n=r*Math.cos(a),c=r*Math.sin(a);return[e,n,c]};hr.rgb.ansi16=function(t,e=null){let[r,s,a]=t,n=e===null?hr.rgb.hsv(t)[2]:e;if(n=Math.round(n/50),n===0)return 30;let c=30+(Math.round(a/255)<<2|Math.round(s/255)<<1|Math.round(r/255));return n===2&&(c+=60),c};hr.hsv.ansi16=function(t){return hr.rgb.ansi16(hr.hsv.rgb(t),t[2])};hr.rgb.ansi256=function(t){let e=t[0],r=t[1],s=t[2];return e===r&&r===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)};hr.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,s=(e&1)*r*255,a=(e>>1&1)*r*255,n=(e>>2&1)*r*255;return[s,a,n]};hr.ansi256.rgb=function(t){if(t>=232){let n=(t-232)*10+8;return[n,n,n]}t-=16;let e,r=Math.floor(t/36)/5*255,s=Math.floor((e=t%36)/6)/5*255,a=e%6/5*255;return[r,s,a]};hr.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return\"000000\".substring(r.length)+r};hr.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split(\"\").map(f=>f+f).join(\"\"));let s=parseInt(r,16),a=s>>16&255,n=s>>8&255,c=s&255;return[a,n,c]};hr.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.max(Math.max(e,r),s),n=Math.min(Math.min(e,r),s),c=a-n,f,p;return c<1?f=n/(1-c):f=0,c<=0?p=0:a===e?p=(r-s)/c%6:a===r?p=2+(s-e)/c:p=4+(e-r)/c,p/=6,p%=1,[p*360,c*100,f*100]};hr.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,s=r<.5?2*e*r:2*e*(1-r),a=0;return s<1&&(a=(r-.5*s)/(1-s)),[t[0],s*100,a*100]};hr.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,s=e*r,a=0;return s<1&&(a=(r-s)/(1-s)),[t[0],s*100,a*100]};hr.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100;if(r===0)return[s*255,s*255,s*255];let a=[0,0,0],n=e%1*6,c=n%1,f=1-c,p=0;switch(Math.floor(n)){case 0:a[0]=1,a[1]=c,a[2]=0;break;case 1:a[0]=f,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=c;break;case 3:a[0]=0,a[1]=f,a[2]=1;break;case 4:a[0]=c,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=f}return p=(1-r)*s,[(r*a[0]+p)*255,(r*a[1]+p)*255,(r*a[2]+p)*255]};hr.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,s=e+r*(1-e),a=0;return s>0&&(a=e/s),[t[0],a*100,s*100]};hr.hcg.hsl=function(t){let e=t[1]/100,s=t[2]/100*(1-e)+.5*e,a=0;return s>0&&s<.5?a=e/(2*s):s>=.5&&s<1&&(a=e/(2*(1-s))),[t[0],a*100,s*100]};hr.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,s=e+r*(1-e);return[t[0],(s-e)*100,(1-s)*100]};hr.hwb.hcg=function(t){let e=t[1]/100,s=1-t[2]/100,a=s-e,n=0;return a<1&&(n=(s-a)/(1-a)),[t[0],a*100,n*100]};hr.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};hr.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};hr.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};hr.gray.hsl=function(t){return[0,0,t[0]]};hr.gray.hsv=hr.gray.hsl;hr.gray.hwb=function(t){return[0,100,t[0]]};hr.gray.cmyk=function(t){return[0,0,0,t[0]]};hr.gray.lab=function(t){return[t[0],0,0]};hr.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,s=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return\"000000\".substring(s.length)+s};hr.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var Dse=_((JRt,Sse)=>{var nk=K_();function qJe(){let t={},e=Object.keys(nk);for(let r=e.length,s=0;s<r;s++)t[e[s]]={distance:-1,parent:null};return t}function WJe(t){let e=qJe(),r=[t];for(e[t].distance=0;r.length;){let s=r.pop(),a=Object.keys(nk[s]);for(let n=a.length,c=0;c<n;c++){let f=a[c],p=e[f];p.distance===-1&&(p.distance=e[s].distance+1,p.parent=s,r.unshift(f))}}return e}function YJe(t,e){return function(r){return e(t(r))}}function VJe(t,e){let r=[e[t].parent,t],s=nk[e[t].parent][t],a=e[t].parent;for(;e[a].parent;)r.unshift(e[a].parent),s=YJe(nk[e[a].parent][a],s),a=e[a].parent;return s.conversion=r,s}Sse.exports=function(t){let e=WJe(t),r={},s=Object.keys(e);for(let a=s.length,n=0;n<a;n++){let c=s[n];e[c].parent!==null&&(r[c]=VJe(c,e))}return r}});var Pse=_((KRt,bse)=>{var z_=K_(),JJe=Dse(),PE={},KJe=Object.keys(z_);function zJe(t){let e=function(...r){let s=r[0];return s==null?s:(s.length>1&&(r=s),t(r))};return\"conversion\"in t&&(e.conversion=t.conversion),e}function XJe(t){let e=function(...r){let s=r[0];if(s==null)return s;s.length>1&&(r=s);let a=t(r);if(typeof a==\"object\")for(let n=a.length,c=0;c<n;c++)a[c]=Math.round(a[c]);return a};return\"conversion\"in t&&(e.conversion=t.conversion),e}KJe.forEach(t=>{PE[t]={},Object.defineProperty(PE[t],\"channels\",{value:z_[t].channels}),Object.defineProperty(PE[t],\"labels\",{value:z_[t].labels});let e=JJe(t);Object.keys(e).forEach(s=>{let a=e[s];PE[t][s]=XJe(a),PE[t][s].raw=zJe(a)})});bse.exports=PE});var sk=_((zRt,Rse)=>{\"use strict\";var xse=(t,e)=>(...r)=>`\\x1B[${t(...r)+e}m`,kse=(t,e)=>(...r)=>{let s=t(...r);return`\\x1B[${38+e};5;${s}m`},Qse=(t,e)=>(...r)=>{let s=t(...r);return`\\x1B[${38+e};2;${s[0]};${s[1]};${s[2]}m`},ik=t=>t,Tse=(t,e,r)=>[t,e,r],xE=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let s=r();return Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0}),s},enumerable:!0,configurable:!0})},X_,kE=(t,e,r,s)=>{X_===void 0&&(X_=Pse());let a=s?10:0,n={};for(let[c,f]of Object.entries(X_)){let p=c===\"ansi16\"?\"ansi\":c;c===e?n[p]=t(r,a):typeof f==\"object\"&&(n[p]=t(f[e],a))}return n};function ZJe(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,s]of Object.entries(e)){for(let[a,n]of Object.entries(s))e[a]={open:`\\x1B[${n[0]}m`,close:`\\x1B[${n[1]}m`},s[a]=e[a],t.set(n[0],n[1]);Object.defineProperty(e,r,{value:s,enumerable:!1})}return Object.defineProperty(e,\"codes\",{value:t,enumerable:!1}),e.color.close=\"\\x1B[39m\",e.bgColor.close=\"\\x1B[49m\",xE(e.color,\"ansi\",()=>kE(xse,\"ansi16\",ik,!1)),xE(e.color,\"ansi256\",()=>kE(kse,\"ansi256\",ik,!1)),xE(e.color,\"ansi16m\",()=>kE(Qse,\"rgb\",Tse,!1)),xE(e.bgColor,\"ansi\",()=>kE(xse,\"ansi16\",ik,!0)),xE(e.bgColor,\"ansi256\",()=>kE(kse,\"ansi256\",ik,!0)),xE(e.bgColor,\"ansi16m\",()=>kE(Qse,\"rgb\",Tse,!0)),e}Object.defineProperty(Rse,\"exports\",{enumerable:!0,get:ZJe})});var Nse=_((XRt,Fse)=>{\"use strict\";Fse.exports=(t,e=process.argv)=>{let r=t.startsWith(\"-\")?\"\":t.length===1?\"-\":\"--\",s=e.indexOf(r+t),a=e.indexOf(\"--\");return s!==-1&&(a===-1||s<a)}});var Mse=_((ZRt,Lse)=>{\"use strict\";var $Je=Ie(\"os\"),Ose=Ie(\"tty\"),Sc=Nse(),{env:bs}=process,l0;Sc(\"no-color\")||Sc(\"no-colors\")||Sc(\"color=false\")||Sc(\"color=never\")?l0=0:(Sc(\"color\")||Sc(\"colors\")||Sc(\"color=true\")||Sc(\"color=always\"))&&(l0=1);\"FORCE_COLOR\"in bs&&(bs.FORCE_COLOR===\"true\"?l0=1:bs.FORCE_COLOR===\"false\"?l0=0:l0=bs.FORCE_COLOR.length===0?1:Math.min(parseInt(bs.FORCE_COLOR,10),3));function Z_(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function $_(t,e){if(l0===0)return 0;if(Sc(\"color=16m\")||Sc(\"color=full\")||Sc(\"color=truecolor\"))return 3;if(Sc(\"color=256\"))return 2;if(t&&!e&&l0===void 0)return 0;let r=l0||0;if(bs.TERM===\"dumb\")return r;if(process.platform===\"win32\"){let s=$Je.release().split(\".\");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if(\"CI\"in bs)return[\"TRAVIS\",\"CIRCLECI\",\"APPVEYOR\",\"GITLAB_CI\"].some(s=>s in bs)||bs.CI_NAME===\"codeship\"?1:r;if(\"TEAMCITY_VERSION\"in bs)return/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(bs.TEAMCITY_VERSION)?1:0;if(\"GITHUB_ACTIONS\"in bs)return 1;if(bs.COLORTERM===\"truecolor\")return 3;if(\"TERM_PROGRAM\"in bs){let s=parseInt((bs.TERM_PROGRAM_VERSION||\"\").split(\".\")[0],10);switch(bs.TERM_PROGRAM){case\"iTerm.app\":return s>=3?3:2;case\"Apple_Terminal\":return 2}}return/-256(color)?$/i.test(bs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(bs.TERM)||\"COLORTERM\"in bs?1:r}function eKe(t){let e=$_(t,t&&t.isTTY);return Z_(e)}Lse.exports={supportsColor:eKe,stdout:Z_($_(!0,Ose.isatty(1))),stderr:Z_($_(!0,Ose.isatty(2)))}});var _se=_(($Rt,Use)=>{\"use strict\";var tKe=(t,e,r)=>{let s=t.indexOf(e);if(s===-1)return t;let a=e.length,n=0,c=\"\";do c+=t.substr(n,s-n)+e+r,n=s+a,s=t.indexOf(e,n);while(s!==-1);return c+=t.substr(n),c},rKe=(t,e,r,s)=>{let a=0,n=\"\";do{let c=t[s-1]===\"\\r\";n+=t.substr(a,(c?s-1:s)-a)+e+(c?`\\r\n`:`\n`)+r,a=s+1,s=t.indexOf(`\n`,a)}while(s!==-1);return n+=t.substr(a),n};Use.exports={stringReplaceAll:tKe,stringEncaseCRLFWithFirstIndex:rKe}});var Wse=_((eFt,qse)=>{\"use strict\";var nKe=/(?:\\\\(u(?:[a-f\\d]{4}|\\{[a-f\\d]{1,6}\\})|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi,Hse=/(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g,iKe=/^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/,sKe=/\\\\(u(?:[a-f\\d]{4}|{[a-f\\d]{1,6}})|x[a-f\\d]{2}|.)|([^\\\\])/gi,oKe=new Map([[\"n\",`\n`],[\"r\",\"\\r\"],[\"t\",\"\t\"],[\"b\",\"\\b\"],[\"f\",\"\\f\"],[\"v\",\"\\v\"],[\"0\",\"\\0\"],[\"\\\\\",\"\\\\\"],[\"e\",\"\\x1B\"],[\"a\",\"\\x07\"]]);function Gse(t){let e=t[0]===\"u\",r=t[1]===\"{\";return e&&!r&&t.length===5||t[0]===\"x\"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):oKe.get(t)||t}function aKe(t,e){let r=[],s=e.trim().split(/\\s*,\\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(iKe))r.push(a[2].replace(sKe,(f,p,h)=>p?Gse(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function lKe(t){Hse.lastIndex=0;let e=[],r;for(;(r=Hse.exec(t))!==null;){let s=r[1];if(r[2]){let a=aKe(s,r[2]);e.push([s].concat(a))}else e.push([s])}return e}function jse(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}qse.exports=(t,e)=>{let r=[],s=[],a=[];if(e.replace(nKe,(n,c,f,p,h,E)=>{if(c)a.push(Gse(c));else if(p){let C=a.join(\"\");a=[],s.push(r.length===0?C:jse(t,r)(C)),r.push({inverse:f,styles:lKe(p)})}else if(h){if(r.length===0)throw new Error(\"Found extraneous } in Chalk template literal\");s.push(jse(t,r)(a.join(\"\"))),a=[],r.pop()}else a.push(E)}),s.push(a.join(\"\")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?\"\":\"s\"} (\\`}\\`)`;throw new Error(n)}return s.join(\"\")}});var TE=_((tFt,Xse)=>{\"use strict\";var mB=sk(),{stdout:t4,stderr:r4}=Mse(),{stringReplaceAll:cKe,stringEncaseCRLFWithFirstIndex:uKe}=_se(),{isArray:ok}=Array,Vse=[\"ansi\",\"ansi\",\"ansi256\",\"ansi16m\"],QE=Object.create(null),fKe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error(\"The `level` option should be an integer from 0 to 3\");let r=t4?t4.level:0;t.level=e.level===void 0?r:e.level},n4=class{constructor(e){return Jse(e)}},Jse=t=>{let e={};return fKe(e,t),e.template=(...r)=>zse(e.template,...r),Object.setPrototypeOf(e,ak.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error(\"`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.\")},e.template.Instance=n4,e.template};function ak(t){return Jse(t)}for(let[t,e]of Object.entries(mB))QE[t]={get(){let r=lk(this,i4(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};QE.visible={get(){let t=lk(this,this._styler,!0);return Object.defineProperty(this,\"visible\",{value:t}),t}};var Kse=[\"rgb\",\"hex\",\"keyword\",\"hsl\",\"hsv\",\"hwb\",\"ansi\",\"ansi256\"];for(let t of Kse)QE[t]={get(){let{level:e}=this;return function(...r){let s=i4(mB.color[Vse[e]][t](...r),mB.color.close,this._styler);return lk(this,s,this._isEmpty)}}};for(let t of Kse){let e=\"bg\"+t[0].toUpperCase()+t.slice(1);QE[e]={get(){let{level:r}=this;return function(...s){let a=i4(mB.bgColor[Vse[r]][t](...s),mB.bgColor.close,this._styler);return lk(this,a,this._isEmpty)}}}}var AKe=Object.defineProperties(()=>{},{...QE,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),i4=(t,e,r)=>{let s,a;return r===void 0?(s=t,a=e):(s=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:s,closeAll:a,parent:r}},lk=(t,e,r)=>{let s=(...a)=>ok(a[0])&&ok(a[0].raw)?Yse(s,zse(s,...a)):Yse(s,a.length===1?\"\"+a[0]:a.join(\" \"));return Object.setPrototypeOf(s,AKe),s._generator=t,s._styler=e,s._isEmpty=r,s},Yse=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?\"\":e;let r=t._styler;if(r===void 0)return e;let{openAll:s,closeAll:a}=r;if(e.indexOf(\"\\x1B\")!==-1)for(;r!==void 0;)e=cKe(e,r.close,r.open),r=r.parent;let n=e.indexOf(`\n`);return n!==-1&&(e=uKe(e,a,s,n)),s+e+a},e4,zse=(t,...e)=>{let[r]=e;if(!ok(r)||!ok(r.raw))return e.join(\" \");let s=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\\\]/g,\"\\\\$&\"),String(r.raw[n]));return e4===void 0&&(e4=Wse()),e4(t,a.join(\"\"))};Object.defineProperties(ak.prototype,QE);var ck=ak();ck.supportsColor=t4;ck.stderr=ak({level:r4?r4.level:0});ck.stderr.supportsColor=r4;Xse.exports=ck});var uk=_(Dc=>{\"use strict\";Dc.isInteger=t=>typeof t==\"number\"?Number.isInteger(t):typeof t==\"string\"&&t.trim()!==\"\"?Number.isInteger(Number(t)):!1;Dc.find=(t,e)=>t.nodes.find(r=>r.type===e);Dc.exceedsLimit=(t,e,r=1,s)=>s===!1||!Dc.isInteger(t)||!Dc.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=s;Dc.escapeNode=(t,e=0,r)=>{let s=t.nodes[e];s&&(r&&s.type===r||s.type===\"open\"||s.type===\"close\")&&s.escaped!==!0&&(s.value=\"\\\\\"+s.value,s.escaped=!0)};Dc.encloseBrace=t=>t.type!==\"brace\"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Dc.isInvalidBrace=t=>t.type!==\"brace\"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Dc.isOpenOrClose=t=>t.type===\"open\"||t.type===\"close\"?!0:t.open===!0||t.close===!0;Dc.reduce=t=>t.reduce((e,r)=>(r.type===\"text\"&&e.push(r.value),r.type===\"range\"&&(r.type=\"text\"),e),[]);Dc.flatten=(...t)=>{let e=[],r=s=>{for(let a=0;a<s.length;a++){let n=s[a];Array.isArray(n)?r(n,e):n!==void 0&&e.push(n)}return e};return r(t),e}});var fk=_((nFt,$se)=>{\"use strict\";var Zse=uk();$se.exports=(t,e={})=>{let r=(s,a={})=>{let n=e.escapeInvalid&&Zse.isInvalidBrace(a),c=s.invalid===!0&&e.escapeInvalid===!0,f=\"\";if(s.value)return(n||c)&&Zse.isOpenOrClose(s)?\"\\\\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let p of s.nodes)f+=r(p);return f};return r(t)}});var toe=_((iFt,eoe)=>{\"use strict\";eoe.exports=function(t){return typeof t==\"number\"?t-t===0:typeof t==\"string\"&&t.trim()!==\"\"?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var uoe=_((sFt,coe)=>{\"use strict\";var roe=toe(),Gd=(t,e,r)=>{if(roe(t)===!1)throw new TypeError(\"toRegexRange: expected the first argument to be a number\");if(e===void 0||t===e)return String(t);if(roe(e)===!1)throw new TypeError(\"toRegexRange: expected the second argument to be a number.\");let s={relaxZeros:!0,...r};typeof s.strictZeros==\"boolean\"&&(s.relaxZeros=s.strictZeros===!1);let a=String(s.relaxZeros),n=String(s.shorthand),c=String(s.capture),f=String(s.wrap),p=t+\":\"+e+\"=\"+a+n+c+f;if(Gd.cache.hasOwnProperty(p))return Gd.cache[p].result;let h=Math.min(t,e),E=Math.max(t,e);if(Math.abs(h-E)===1){let R=t+\"|\"+e;return s.capture?`(${R})`:s.wrap===!1?R:`(?:${R})`}let C=loe(t)||loe(e),S={min:t,max:e,a:h,b:E},P=[],I=[];if(C&&(S.isPadded=C,S.maxLen=String(S.max).length),h<0){let R=E<0?Math.abs(E):1;I=noe(R,Math.abs(h),S,s),h=S.a=0}return E>=0&&(P=noe(h,E,S,s)),S.negatives=I,S.positives=P,S.result=pKe(I,P,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&P.length+I.length>1&&(S.result=`(?:${S.result})`),Gd.cache[p]=S,S.result};function pKe(t,e,r){let s=s4(t,e,\"-\",!1,r)||[],a=s4(e,t,\"\",!1,r)||[],n=s4(t,e,\"-?\",!0,r)||[];return s.concat(n).concat(a).join(\"|\")}function hKe(t,e){let r=1,s=1,a=soe(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=soe(t,r);for(a=ooe(e+1,s)-1;t<a&&a<=e;)n.add(a),s+=1,a=ooe(e+1,s)-1;return n=[...n],n.sort(mKe),n}function gKe(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let s=dKe(t,e),a=s.length,n=\"\",c=0;for(let f=0;f<a;f++){let[p,h]=s[f];p===h?n+=p:p!==\"0\"||h!==\"9\"?n+=yKe(p,h,r):c++}return c&&(n+=r.shorthand===!0?\"\\\\d\":\"[0-9]\"),{pattern:n,count:[c],digits:a}}function noe(t,e,r,s){let a=hKe(t,e),n=[],c=t,f;for(let p=0;p<a.length;p++){let h=a[p],E=gKe(String(c),String(h),s),C=\"\";if(!r.isPadded&&f&&f.pattern===E.pattern){f.count.length>1&&f.count.pop(),f.count.push(E.count[0]),f.string=f.pattern+aoe(f.count),c=h+1;continue}r.isPadded&&(C=EKe(h,r,s)),E.string=C+E.pattern+aoe(E.count),n.push(E),c=h+1,f=E}return n}function s4(t,e,r,s,a){let n=[];for(let c of t){let{string:f}=c;!s&&!ioe(e,\"string\",f)&&n.push(r+f),s&&ioe(e,\"string\",f)&&n.push(r+f)}return n}function dKe(t,e){let r=[];for(let s=0;s<t.length;s++)r.push([t[s],e[s]]);return r}function mKe(t,e){return t>e?1:e>t?-1:0}function ioe(t,e,r){return t.some(s=>s[e]===r)}function soe(t,e){return Number(String(t).slice(0,-e)+\"9\".repeat(e))}function ooe(t,e){return t-t%Math.pow(10,e)}function aoe(t){let[e=0,r=\"\"]=t;return r||e>1?`{${e+(r?\",\"+r:\"\")}}`:\"\"}function yKe(t,e,r){return`[${t}${e-t===1?\"\":\"-\"}${e}]`}function loe(t){return/^-?(0+)\\d/.test(t)}function EKe(t,e,r){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),a=r.relaxZeros!==!1;switch(s){case 0:return\"\";case 1:return a?\"0?\":\"0\";case 2:return a?\"0{0,2}\":\"00\";default:return a?`0{0,${s}}`:`0{${s}}`}}Gd.cache={};Gd.clearCache=()=>Gd.cache={};coe.exports=Gd});var l4=_((oFt,yoe)=>{\"use strict\";var IKe=Ie(\"util\"),poe=uoe(),foe=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t),CKe=t=>e=>t===!0?Number(e):String(e),o4=t=>typeof t==\"number\"||typeof t==\"string\"&&t!==\"\",yB=t=>Number.isInteger(+t),a4=t=>{let e=`${t}`,r=-1;if(e[0]===\"-\"&&(e=e.slice(1)),e===\"0\")return!1;for(;e[++r]===\"0\";);return r>0},wKe=(t,e,r)=>typeof t==\"string\"||typeof e==\"string\"?!0:r.stringify===!0,BKe=(t,e,r)=>{if(e>0){let s=t[0]===\"-\"?\"-\":\"\";s&&(t=t.slice(1)),t=s+t.padStart(s?e-1:e,\"0\")}return r===!1?String(t):t},Aoe=(t,e)=>{let r=t[0]===\"-\"?\"-\":\"\";for(r&&(t=t.slice(1),e--);t.length<e;)t=\"0\"+t;return r?\"-\"+t:t},vKe=(t,e)=>{t.negatives.sort((c,f)=>c<f?-1:c>f?1:0),t.positives.sort((c,f)=>c<f?-1:c>f?1:0);let r=e.capture?\"\":\"?:\",s=\"\",a=\"\",n;return t.positives.length&&(s=t.positives.join(\"|\")),t.negatives.length&&(a=`-(${r}${t.negatives.join(\"|\")})`),s&&a?n=`${s}|${a}`:n=s||a,e.wrap?`(${r}${n})`:n},hoe=(t,e,r,s)=>{if(r)return poe(t,e,{wrap:!1,...s});let a=String.fromCharCode(t);if(t===e)return a;let n=String.fromCharCode(e);return`[${a}-${n}]`},goe=(t,e,r)=>{if(Array.isArray(t)){let s=r.wrap===!0,a=r.capture?\"\":\"?:\";return s?`(${a}${t.join(\"|\")})`:t.join(\"|\")}return poe(t,e,r)},doe=(...t)=>new RangeError(\"Invalid range arguments: \"+IKe.inspect(...t)),moe=(t,e,r)=>{if(r.strictRanges===!0)throw doe([t,e]);return[]},SKe=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step \"${t}\" to be a number`);return[]},DKe=(t,e,r=1,s={})=>{let a=Number(t),n=Number(e);if(!Number.isInteger(a)||!Number.isInteger(n)){if(s.strictRanges===!0)throw doe([t,e]);return[]}a===0&&(a=0),n===0&&(n=0);let c=a>n,f=String(t),p=String(e),h=String(r);r=Math.max(Math.abs(r),1);let E=a4(f)||a4(p)||a4(h),C=E?Math.max(f.length,p.length,h.length):0,S=E===!1&&wKe(t,e,s)===!1,P=s.transform||CKe(S);if(s.toRegex&&r===1)return hoe(Aoe(t,C),Aoe(e,C),!0,s);let I={negatives:[],positives:[]},R=W=>I[W<0?\"negatives\":\"positives\"].push(Math.abs(W)),N=[],U=0;for(;c?a>=n:a<=n;)s.toRegex===!0&&r>1?R(a):N.push(BKe(P(a,U),C,S)),a=c?a-r:a+r,U++;return s.toRegex===!0?r>1?vKe(I,s):goe(N,null,{wrap:!1,...s}):N},bKe=(t,e,r=1,s={})=>{if(!yB(t)&&t.length>1||!yB(e)&&e.length>1)return moe(t,e,s);let a=s.transform||(S=>String.fromCharCode(S)),n=`${t}`.charCodeAt(0),c=`${e}`.charCodeAt(0),f=n>c,p=Math.min(n,c),h=Math.max(n,c);if(s.toRegex&&r===1)return hoe(p,h,!1,s);let E=[],C=0;for(;f?n>=c:n<=c;)E.push(a(n,C)),n=f?n-r:n+r,C++;return s.toRegex===!0?goe(E,null,{wrap:!1,options:s}):E},Ak=(t,e,r,s={})=>{if(e==null&&o4(t))return[t];if(!o4(t)||!o4(e))return moe(t,e,s);if(typeof r==\"function\")return Ak(t,e,1,{transform:r});if(foe(r))return Ak(t,e,0,r);let a={...s};return a.capture===!0&&(a.wrap=!0),r=r||a.step||1,yB(r)?yB(t)&&yB(e)?DKe(t,e,r,a):bKe(t,e,Math.max(Math.abs(r),1),a):r!=null&&!foe(r)?SKe(r,a):Ak(t,e,1,r)};yoe.exports=Ak});var Coe=_((aFt,Ioe)=>{\"use strict\";var PKe=l4(),Eoe=uk(),xKe=(t,e={})=>{let r=(s,a={})=>{let n=Eoe.isInvalidBrace(a),c=s.invalid===!0&&e.escapeInvalid===!0,f=n===!0||c===!0,p=e.escapeInvalid===!0?\"\\\\\":\"\",h=\"\";if(s.isOpen===!0||s.isClose===!0)return p+s.value;if(s.type===\"open\")return f?p+s.value:\"(\";if(s.type===\"close\")return f?p+s.value:\")\";if(s.type===\"comma\")return s.prev.type===\"comma\"?\"\":f?s.value:\"|\";if(s.value)return s.value;if(s.nodes&&s.ranges>0){let E=Eoe.reduce(s.nodes),C=PKe(...E,{...e,wrap:!1,toRegex:!0});if(C.length!==0)return E.length>1&&C.length>1?`(${C})`:C}if(s.nodes)for(let E of s.nodes)h+=r(E,s);return h};return r(t)};Ioe.exports=xKe});var voe=_((lFt,Boe)=>{\"use strict\";var kKe=l4(),woe=fk(),RE=uk(),qd=(t=\"\",e=\"\",r=!1)=>{let s=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?RE.flatten(e).map(a=>`{${a}}`):e;for(let a of t)if(Array.isArray(a))for(let n of a)s.push(qd(n,e,r));else for(let n of e)r===!0&&typeof n==\"string\"&&(n=`{${n}}`),s.push(Array.isArray(n)?qd(a,n,r):a+n);return RE.flatten(s)},QKe=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,s=(a,n={})=>{a.queue=[];let c=n,f=n.queue;for(;c.type!==\"brace\"&&c.type!==\"root\"&&c.parent;)c=c.parent,f=c.queue;if(a.invalid||a.dollar){f.push(qd(f.pop(),woe(a,e)));return}if(a.type===\"brace\"&&a.invalid!==!0&&a.nodes.length===2){f.push(qd(f.pop(),[\"{}\"]));return}if(a.nodes&&a.ranges>0){let C=RE.reduce(a.nodes);if(RE.exceedsLimit(...C,e.step,r))throw new RangeError(\"expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.\");let S=kKe(...C,e);S.length===0&&(S=woe(a,e)),f.push(qd(f.pop(),S)),a.nodes=[];return}let p=RE.encloseBrace(a),h=a.queue,E=a;for(;E.type!==\"brace\"&&E.type!==\"root\"&&E.parent;)E=E.parent,h=E.queue;for(let C=0;C<a.nodes.length;C++){let S=a.nodes[C];if(S.type===\"comma\"&&a.type===\"brace\"){C===1&&h.push(\"\"),h.push(\"\");continue}if(S.type===\"close\"){f.push(qd(f.pop(),h,p));continue}if(S.value&&S.type!==\"open\"){h.push(qd(h.pop(),S.value));continue}S.nodes&&s(S,a)}return h};return RE.flatten(s(t))};Boe.exports=QKe});var Doe=_((cFt,Soe)=>{\"use strict\";Soe.exports={MAX_LENGTH:1024*64,CHAR_0:\"0\",CHAR_9:\"9\",CHAR_UPPERCASE_A:\"A\",CHAR_LOWERCASE_A:\"a\",CHAR_UPPERCASE_Z:\"Z\",CHAR_LOWERCASE_Z:\"z\",CHAR_LEFT_PARENTHESES:\"(\",CHAR_RIGHT_PARENTHESES:\")\",CHAR_ASTERISK:\"*\",CHAR_AMPERSAND:\"&\",CHAR_AT:\"@\",CHAR_BACKSLASH:\"\\\\\",CHAR_BACKTICK:\"`\",CHAR_CARRIAGE_RETURN:\"\\r\",CHAR_CIRCUMFLEX_ACCENT:\"^\",CHAR_COLON:\":\",CHAR_COMMA:\",\",CHAR_DOLLAR:\"$\",CHAR_DOT:\".\",CHAR_DOUBLE_QUOTE:'\"',CHAR_EQUAL:\"=\",CHAR_EXCLAMATION_MARK:\"!\",CHAR_FORM_FEED:\"\\f\",CHAR_FORWARD_SLASH:\"/\",CHAR_HASH:\"#\",CHAR_HYPHEN_MINUS:\"-\",CHAR_LEFT_ANGLE_BRACKET:\"<\",CHAR_LEFT_CURLY_BRACE:\"{\",CHAR_LEFT_SQUARE_BRACKET:\"[\",CHAR_LINE_FEED:`\n`,CHAR_NO_BREAK_SPACE:\"\\xA0\",CHAR_PERCENT:\"%\",CHAR_PLUS:\"+\",CHAR_QUESTION_MARK:\"?\",CHAR_RIGHT_ANGLE_BRACKET:\">\",CHAR_RIGHT_CURLY_BRACE:\"}\",CHAR_RIGHT_SQUARE_BRACKET:\"]\",CHAR_SEMICOLON:\";\",CHAR_SINGLE_QUOTE:\"'\",CHAR_SPACE:\" \",CHAR_TAB:\"\t\",CHAR_UNDERSCORE:\"_\",CHAR_VERTICAL_LINE:\"|\",CHAR_ZERO_WIDTH_NOBREAK_SPACE:\"\\uFEFF\"}});var Qoe=_((uFt,koe)=>{\"use strict\";var TKe=fk(),{MAX_LENGTH:boe,CHAR_BACKSLASH:c4,CHAR_BACKTICK:RKe,CHAR_COMMA:FKe,CHAR_DOT:NKe,CHAR_LEFT_PARENTHESES:OKe,CHAR_RIGHT_PARENTHESES:LKe,CHAR_LEFT_CURLY_BRACE:MKe,CHAR_RIGHT_CURLY_BRACE:UKe,CHAR_LEFT_SQUARE_BRACKET:Poe,CHAR_RIGHT_SQUARE_BRACKET:xoe,CHAR_DOUBLE_QUOTE:_Ke,CHAR_SINGLE_QUOTE:HKe,CHAR_NO_BREAK_SPACE:jKe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:GKe}=Doe(),qKe=(t,e={})=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");let r=e||{},s=typeof r.maxLength==\"number\"?Math.min(boe,r.maxLength):boe;if(t.length>s)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${s})`);let a={type:\"root\",input:t,nodes:[]},n=[a],c=a,f=a,p=0,h=t.length,E=0,C=0,S,P={},I=()=>t[E++],R=N=>{if(N.type===\"text\"&&f.type===\"dot\"&&(f.type=\"text\"),f&&f.type===\"text\"&&N.type===\"text\"){f.value+=N.value;return}return c.nodes.push(N),N.parent=c,N.prev=f,f=N,N};for(R({type:\"bos\"});E<h;)if(c=n[n.length-1],S=I(),!(S===GKe||S===jKe)){if(S===c4){R({type:\"text\",value:(e.keepEscaping?S:\"\")+I()});continue}if(S===xoe){R({type:\"text\",value:\"\\\\\"+S});continue}if(S===Poe){p++;let N=!0,U;for(;E<h&&(U=I());){if(S+=U,U===Poe){p++;continue}if(U===c4){S+=I();continue}if(U===xoe&&(p--,p===0))break}R({type:\"text\",value:S});continue}if(S===OKe){c=R({type:\"paren\",nodes:[]}),n.push(c),R({type:\"text\",value:S});continue}if(S===LKe){if(c.type!==\"paren\"){R({type:\"text\",value:S});continue}c=n.pop(),R({type:\"text\",value:S}),c=n[n.length-1];continue}if(S===_Ke||S===HKe||S===RKe){let N=S,U;for(e.keepQuotes!==!0&&(S=\"\");E<h&&(U=I());){if(U===c4){S+=U+I();continue}if(U===N){e.keepQuotes===!0&&(S+=U);break}S+=U}R({type:\"text\",value:S});continue}if(S===MKe){C++;let U={type:\"brace\",open:!0,close:!1,dollar:f.value&&f.value.slice(-1)===\"$\"||c.dollar===!0,depth:C,commas:0,ranges:0,nodes:[]};c=R(U),n.push(c),R({type:\"open\",value:S});continue}if(S===UKe){if(c.type!==\"brace\"){R({type:\"text\",value:S});continue}let N=\"close\";c=n.pop(),c.close=!0,R({type:N,value:S}),C--,c=n[n.length-1];continue}if(S===FKe&&C>0){if(c.ranges>0){c.ranges=0;let N=c.nodes.shift();c.nodes=[N,{type:\"text\",value:TKe(c)}]}R({type:\"comma\",value:S}),c.commas++;continue}if(S===NKe&&C>0&&c.commas===0){let N=c.nodes;if(C===0||N.length===0){R({type:\"text\",value:S});continue}if(f.type===\"dot\"){if(c.range=[],f.value+=S,f.type=\"range\",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type=\"text\";continue}c.ranges++,c.args=[];continue}if(f.type===\"range\"){N.pop();let U=N[N.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}R({type:\"dot\",value:S});continue}R({type:\"text\",value:S})}do if(c=n.pop(),c.type!==\"root\"){c.nodes.forEach(W=>{W.nodes||(W.type===\"open\"&&(W.isOpen=!0),W.type===\"close\"&&(W.isClose=!0),W.nodes||(W.type=\"text\"),W.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(c);N.nodes.splice(U,1,...c.nodes)}while(n.length>0);return R({type:\"eos\"}),a};koe.exports=qKe});var Foe=_((fFt,Roe)=>{\"use strict\";var Toe=fk(),WKe=Coe(),YKe=voe(),VKe=Qoe(),jl=(t,e={})=>{let r=[];if(Array.isArray(t))for(let s of t){let a=jl.create(s,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(jl.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};jl.parse=(t,e={})=>VKe(t,e);jl.stringify=(t,e={})=>Toe(typeof t==\"string\"?jl.parse(t,e):t,e);jl.compile=(t,e={})=>(typeof t==\"string\"&&(t=jl.parse(t,e)),WKe(t,e));jl.expand=(t,e={})=>{typeof t==\"string\"&&(t=jl.parse(t,e));let r=YKe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};jl.create=(t,e={})=>t===\"\"||t.length<3?[t]:e.expand!==!0?jl.compile(t,e):jl.expand(t,e);Roe.exports=jl});var EB=_((AFt,Uoe)=>{\"use strict\";var JKe=Ie(\"path\"),Vf=\"\\\\\\\\/\",Noe=`[^${Vf}]`,Dp=\"\\\\.\",KKe=\"\\\\+\",zKe=\"\\\\?\",pk=\"\\\\/\",XKe=\"(?=.)\",Ooe=\"[^/]\",u4=`(?:${pk}|$)`,Loe=`(?:^|${pk})`,f4=`${Dp}{1,2}${u4}`,ZKe=`(?!${Dp})`,$Ke=`(?!${Loe}${f4})`,eze=`(?!${Dp}{0,1}${u4})`,tze=`(?!${f4})`,rze=`[^.${pk}]`,nze=`${Ooe}*?`,Moe={DOT_LITERAL:Dp,PLUS_LITERAL:KKe,QMARK_LITERAL:zKe,SLASH_LITERAL:pk,ONE_CHAR:XKe,QMARK:Ooe,END_ANCHOR:u4,DOTS_SLASH:f4,NO_DOT:ZKe,NO_DOTS:$Ke,NO_DOT_SLASH:eze,NO_DOTS_SLASH:tze,QMARK_NO_DOT:rze,STAR:nze,START_ANCHOR:Loe},ize={...Moe,SLASH_LITERAL:`[${Vf}]`,QMARK:Noe,STAR:`${Noe}*?`,DOTS_SLASH:`${Dp}{1,2}(?:[${Vf}]|$)`,NO_DOT:`(?!${Dp})`,NO_DOTS:`(?!(?:^|[${Vf}])${Dp}{1,2}(?:[${Vf}]|$))`,NO_DOT_SLASH:`(?!${Dp}{0,1}(?:[${Vf}]|$))`,NO_DOTS_SLASH:`(?!${Dp}{1,2}(?:[${Vf}]|$))`,QMARK_NO_DOT:`[^.${Vf}]`,START_ANCHOR:`(?:^|[${Vf}])`,END_ANCHOR:`(?:[${Vf}]|$)`},sze={alnum:\"a-zA-Z0-9\",alpha:\"a-zA-Z\",ascii:\"\\\\x00-\\\\x7F\",blank:\" \\\\t\",cntrl:\"\\\\x00-\\\\x1F\\\\x7F\",digit:\"0-9\",graph:\"\\\\x21-\\\\x7E\",lower:\"a-z\",print:\"\\\\x20-\\\\x7E \",punct:\"\\\\-!\\\"#$%&'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~\",space:\" \\\\t\\\\r\\\\n\\\\v\\\\f\",upper:\"A-Z\",word:\"A-Za-z0-9_\",xdigit:\"A-Fa-f0-9\"};Uoe.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:sze,REGEX_BACKSLASH:/\\\\(?![*+?^${}(|)[\\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\\].,$*+?^{}()|\\\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\\\?)((\\W)(\\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,REPLACEMENTS:{\"***\":\"*\",\"**/**\":\"**\",\"**/**/**\":\"**\"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:JKe.sep,extglobChars(t){return{\"!\":{type:\"negate\",open:\"(?:(?!(?:\",close:`))${t.STAR})`},\"?\":{type:\"qmark\",open:\"(?:\",close:\")?\"},\"+\":{type:\"plus\",open:\"(?:\",close:\")+\"},\"*\":{type:\"star\",open:\"(?:\",close:\")*\"},\"@\":{type:\"at\",open:\"(?:\",close:\")\"}}},globChars(t){return t===!0?ize:Moe}}});var IB=_(ol=>{\"use strict\";var oze=Ie(\"path\"),aze=process.platform===\"win32\",{REGEX_BACKSLASH:lze,REGEX_REMOVE_BACKSLASH:cze,REGEX_SPECIAL_CHARS:uze,REGEX_SPECIAL_CHARS_GLOBAL:fze}=EB();ol.isObject=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t);ol.hasRegexChars=t=>uze.test(t);ol.isRegexChar=t=>t.length===1&&ol.hasRegexChars(t);ol.escapeRegex=t=>t.replace(fze,\"\\\\$1\");ol.toPosixSlashes=t=>t.replace(lze,\"/\");ol.removeBackslashes=t=>t.replace(cze,e=>e===\"\\\\\"?\"\":e);ol.supportsLookbehinds=()=>{let t=process.version.slice(1).split(\".\").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ol.isWindows=t=>t&&typeof t.windows==\"boolean\"?t.windows:aze===!0||oze.sep===\"\\\\\";ol.escapeLast=(t,e,r)=>{let s=t.lastIndexOf(e,r);return s===-1?t:t[s-1]===\"\\\\\"?ol.escapeLast(t,e,s-1):`${t.slice(0,s)}\\\\${t.slice(s)}`};ol.removePrefix=(t,e={})=>{let r=t;return r.startsWith(\"./\")&&(r=r.slice(2),e.prefix=\"./\"),r};ol.wrapOutput=(t,e={},r={})=>{let s=r.contains?\"\":\"^\",a=r.contains?\"\":\"$\",n=`${s}(?:${t})${a}`;return e.negated===!0&&(n=`(?:^(?!${n}).*$)`),n}});var Voe=_((hFt,Yoe)=>{\"use strict\";var _oe=IB(),{CHAR_ASTERISK:A4,CHAR_AT:Aze,CHAR_BACKWARD_SLASH:CB,CHAR_COMMA:pze,CHAR_DOT:p4,CHAR_EXCLAMATION_MARK:h4,CHAR_FORWARD_SLASH:Woe,CHAR_LEFT_CURLY_BRACE:g4,CHAR_LEFT_PARENTHESES:d4,CHAR_LEFT_SQUARE_BRACKET:hze,CHAR_PLUS:gze,CHAR_QUESTION_MARK:Hoe,CHAR_RIGHT_CURLY_BRACE:dze,CHAR_RIGHT_PARENTHESES:joe,CHAR_RIGHT_SQUARE_BRACKET:mze}=EB(),Goe=t=>t===Woe||t===CB,qoe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},yze=(t,e)=>{let r=e||{},s=t.length-1,a=r.parts===!0||r.scanToEnd===!0,n=[],c=[],f=[],p=t,h=-1,E=0,C=0,S=!1,P=!1,I=!1,R=!1,N=!1,U=!1,W=!1,ee=!1,ie=!1,ue=!1,le=0,me,pe,Be={value:\"\",depth:0,isGlob:!1},Ce=()=>h>=s,g=()=>p.charCodeAt(h+1),we=()=>(me=pe,p.charCodeAt(++h));for(;h<s;){pe=we();let De;if(pe===CB){W=Be.backslashes=!0,pe=we(),pe===g4&&(U=!0);continue}if(U===!0||pe===g4){for(le++;Ce()!==!0&&(pe=we());){if(pe===CB){W=Be.backslashes=!0,we();continue}if(pe===g4){le++;continue}if(U!==!0&&pe===p4&&(pe=we())===p4){if(S=Be.isBrace=!0,I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(U!==!0&&pe===pze){if(S=Be.isBrace=!0,I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===dze&&(le--,le===0)){U=!1,S=Be.isBrace=!0,ue=!0;break}}if(a===!0)continue;break}if(pe===Woe){if(n.push(h),c.push(Be),Be={value:\"\",depth:0,isGlob:!1},ue===!0)continue;if(me===p4&&h===E+1){E+=2;continue}C=h+1;continue}if(r.noext!==!0&&(pe===gze||pe===Aze||pe===A4||pe===Hoe||pe===h4)===!0&&g()===d4){if(I=Be.isGlob=!0,R=Be.isExtglob=!0,ue=!0,pe===h4&&h===E&&(ie=!0),a===!0){for(;Ce()!==!0&&(pe=we());){if(pe===CB){W=Be.backslashes=!0,pe=we();continue}if(pe===joe){I=Be.isGlob=!0,ue=!0;break}}continue}break}if(pe===A4){if(me===A4&&(N=Be.isGlobstar=!0),I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===Hoe){if(I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===hze){for(;Ce()!==!0&&(De=we());){if(De===CB){W=Be.backslashes=!0,we();continue}if(De===mze){P=Be.isBracket=!0,I=Be.isGlob=!0,ue=!0;break}}if(a===!0)continue;break}if(r.nonegate!==!0&&pe===h4&&h===E){ee=Be.negated=!0,E++;continue}if(r.noparen!==!0&&pe===d4){if(I=Be.isGlob=!0,a===!0){for(;Ce()!==!0&&(pe=we());){if(pe===d4){W=Be.backslashes=!0,pe=we();continue}if(pe===joe){ue=!0;break}}continue}break}if(I===!0){if(ue=!0,a===!0)continue;break}}r.noext===!0&&(R=!1,I=!1);let ye=p,Ae=\"\",se=\"\";E>0&&(Ae=p.slice(0,E),p=p.slice(E),C-=E),ye&&I===!0&&C>0?(ye=p.slice(0,C),se=p.slice(C)):I===!0?(ye=\"\",se=p):ye=p,ye&&ye!==\"\"&&ye!==\"/\"&&ye!==p&&Goe(ye.charCodeAt(ye.length-1))&&(ye=ye.slice(0,-1)),r.unescape===!0&&(se&&(se=_oe.removeBackslashes(se)),ye&&W===!0&&(ye=_oe.removeBackslashes(ye)));let Z={prefix:Ae,input:t,start:E,base:ye,glob:se,isBrace:S,isBracket:P,isGlob:I,isExtglob:R,isGlobstar:N,negated:ee,negatedExtglob:ie};if(r.tokens===!0&&(Z.maxDepth=0,Goe(pe)||c.push(Be),Z.tokens=c),r.parts===!0||r.tokens===!0){let De;for(let Re=0;Re<n.length;Re++){let mt=De?De+1:E,j=n[Re],rt=t.slice(mt,j);r.tokens&&(Re===0&&E!==0?(c[Re].isPrefix=!0,c[Re].value=Ae):c[Re].value=rt,qoe(c[Re]),Z.maxDepth+=c[Re].depth),(Re!==0||rt!==\"\")&&f.push(rt),De=j}if(De&&De+1<t.length){let Re=t.slice(De+1);f.push(Re),r.tokens&&(c[c.length-1].value=Re,qoe(c[c.length-1]),Z.maxDepth+=c[c.length-1].depth)}Z.slashes=n,Z.parts=f}return Z};Yoe.exports=yze});var zoe=_((gFt,Koe)=>{\"use strict\";var hk=EB(),Gl=IB(),{MAX_LENGTH:gk,POSIX_REGEX_SOURCE:Eze,REGEX_NON_SPECIAL_CHARS:Ize,REGEX_SPECIAL_CHARS_BACKREF:Cze,REPLACEMENTS:Joe}=hk,wze=(t,e)=>{if(typeof e.expandRange==\"function\")return e.expandRange(...t,e);t.sort();let r=`[${t.join(\"-\")}]`;try{new RegExp(r)}catch{return t.map(a=>Gl.escapeRegex(a)).join(\"..\")}return r},FE=(t,e)=>`Missing ${t}: \"${e}\" - use \"\\\\\\\\${e}\" to match literal characters`,m4=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");t=Joe[t]||t;let r={...e},s=typeof r.maxLength==\"number\"?Math.min(gk,r.maxLength):gk,a=t.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);let n={type:\"bos\",value:\"\",output:r.prepend||\"\"},c=[n],f=r.capture?\"\":\"?:\",p=Gl.isWindows(e),h=hk.globChars(p),E=hk.extglobChars(h),{DOT_LITERAL:C,PLUS_LITERAL:S,SLASH_LITERAL:P,ONE_CHAR:I,DOTS_SLASH:R,NO_DOT:N,NO_DOT_SLASH:U,NO_DOTS_SLASH:W,QMARK:ee,QMARK_NO_DOT:ie,STAR:ue,START_ANCHOR:le}=h,me=x=>`(${f}(?:(?!${le}${x.dot?R:C}).)*?)`,pe=r.dot?\"\":N,Be=r.dot?ee:ie,Ce=r.bash===!0?me(r):ue;r.capture&&(Ce=`(${Ce})`),typeof r.noext==\"boolean\"&&(r.noextglob=r.noext);let g={input:t,index:-1,start:0,dot:r.dot===!0,consumed:\"\",output:\"\",prefix:\"\",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=Gl.removePrefix(t,g),a=t.length;let we=[],ye=[],Ae=[],se=n,Z,De=()=>g.index===a-1,Re=g.peek=(x=1)=>t[g.index+x],mt=g.advance=()=>t[++g.index]||\"\",j=()=>t.slice(g.index+1),rt=(x=\"\",w=0)=>{g.consumed+=x,g.index+=w},Fe=x=>{g.output+=x.output!=null?x.output:x.value,rt(x.value)},Ne=()=>{let x=1;for(;Re()===\"!\"&&(Re(2)!==\"(\"||Re(3)===\"?\");)mt(),g.start++,x++;return x%2===0?!1:(g.negated=!0,g.start++,!0)},Pe=x=>{g[x]++,Ae.push(x)},Ve=x=>{g[x]--,Ae.pop()},ke=x=>{if(se.type===\"globstar\"){let w=g.braces>0&&(x.type===\"comma\"||x.type===\"brace\"),b=x.extglob===!0||we.length&&(x.type===\"pipe\"||x.type===\"paren\");x.type!==\"slash\"&&x.type!==\"paren\"&&!w&&!b&&(g.output=g.output.slice(0,-se.output.length),se.type=\"star\",se.value=\"*\",se.output=Ce,g.output+=se.output)}if(we.length&&x.type!==\"paren\"&&(we[we.length-1].inner+=x.value),(x.value||x.output)&&Fe(x),se&&se.type===\"text\"&&x.type===\"text\"){se.value+=x.value,se.output=(se.output||\"\")+x.value;return}x.prev=se,c.push(x),se=x},it=(x,w)=>{let b={...E[w],conditions:1,inner:\"\"};b.prev=se,b.parens=g.parens,b.output=g.output;let y=(r.capture?\"(\":\"\")+b.open;Pe(\"parens\"),ke({type:x,value:w,output:g.output?\"\":I}),ke({type:\"paren\",extglob:!0,value:mt(),output:y}),we.push(b)},Ue=x=>{let w=x.close+(r.capture?\")\":\"\"),b;if(x.type===\"negate\"){let y=Ce;if(x.inner&&x.inner.length>1&&x.inner.includes(\"/\")&&(y=me(r)),(y!==Ce||De()||/^\\)+$/.test(j()))&&(w=x.close=`)$))${y}`),x.inner.includes(\"*\")&&(b=j())&&/^\\.[^\\\\/.]+$/.test(b)){let F=m4(b,{...e,fastpaths:!1}).output;w=x.close=`)${F})${y})`}x.prev.type===\"bos\"&&(g.negatedExtglob=!0)}ke({type:\"paren\",extglob:!0,value:Z,output:w}),Ve(\"parens\")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\\]{}\"])/.test(t)){let x=!1,w=t.replace(Cze,(b,y,F,z,X,$)=>z===\"\\\\\"?(x=!0,b):z===\"?\"?y?y+z+(X?ee.repeat(X.length):\"\"):$===0?Be+(X?ee.repeat(X.length):\"\"):ee.repeat(F.length):z===\".\"?C.repeat(F.length):z===\"*\"?y?y+z+(X?Ce:\"\"):Ce:y?b:`\\\\${b}`);return x===!0&&(r.unescape===!0?w=w.replace(/\\\\/g,\"\"):w=w.replace(/\\\\+/g,b=>b.length%2===0?\"\\\\\\\\\":b?\"\\\\\":\"\")),w===t&&r.contains===!0?(g.output=t,g):(g.output=Gl.wrapOutput(w,g,e),g)}for(;!De();){if(Z=mt(),Z===\"\\0\")continue;if(Z===\"\\\\\"){let b=Re();if(b===\"/\"&&r.bash!==!0||b===\".\"||b===\";\")continue;if(!b){Z+=\"\\\\\",ke({type:\"text\",value:Z});continue}let y=/^\\\\+/.exec(j()),F=0;if(y&&y[0].length>2&&(F=y[0].length,g.index+=F,F%2!==0&&(Z+=\"\\\\\")),r.unescape===!0?Z=mt():Z+=mt(),g.brackets===0){ke({type:\"text\",value:Z});continue}}if(g.brackets>0&&(Z!==\"]\"||se.value===\"[\"||se.value===\"[^\")){if(r.posix!==!1&&Z===\":\"){let b=se.value.slice(1);if(b.includes(\"[\")&&(se.posix=!0,b.includes(\":\"))){let y=se.value.lastIndexOf(\"[\"),F=se.value.slice(0,y),z=se.value.slice(y+2),X=Eze[z];if(X){se.value=F+X,g.backtrack=!0,mt(),!n.output&&c.indexOf(se)===1&&(n.output=I);continue}}}(Z===\"[\"&&Re()!==\":\"||Z===\"-\"&&Re()===\"]\")&&(Z=`\\\\${Z}`),Z===\"]\"&&(se.value===\"[\"||se.value===\"[^\")&&(Z=`\\\\${Z}`),r.posix===!0&&Z===\"!\"&&se.value===\"[\"&&(Z=\"^\"),se.value+=Z,Fe({value:Z});continue}if(g.quotes===1&&Z!=='\"'){Z=Gl.escapeRegex(Z),se.value+=Z,Fe({value:Z});continue}if(Z==='\"'){g.quotes=g.quotes===1?0:1,r.keepQuotes===!0&&ke({type:\"text\",value:Z});continue}if(Z===\"(\"){Pe(\"parens\"),ke({type:\"paren\",value:Z});continue}if(Z===\")\"){if(g.parens===0&&r.strictBrackets===!0)throw new SyntaxError(FE(\"opening\",\"(\"));let b=we[we.length-1];if(b&&g.parens===b.parens+1){Ue(we.pop());continue}ke({type:\"paren\",value:Z,output:g.parens?\")\":\"\\\\)\"}),Ve(\"parens\");continue}if(Z===\"[\"){if(r.nobracket===!0||!j().includes(\"]\")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"]\"));Z=`\\\\${Z}`}else Pe(\"brackets\");ke({type:\"bracket\",value:Z});continue}if(Z===\"]\"){if(r.nobracket===!0||se&&se.type===\"bracket\"&&se.value.length===1){ke({type:\"text\",value:Z,output:`\\\\${Z}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"opening\",\"[\"));ke({type:\"text\",value:Z,output:`\\\\${Z}`});continue}Ve(\"brackets\");let b=se.value.slice(1);if(se.posix!==!0&&b[0]===\"^\"&&!b.includes(\"/\")&&(Z=`/${Z}`),se.value+=Z,Fe({value:Z}),r.literalBrackets===!1||Gl.hasRegexChars(b))continue;let y=Gl.escapeRegex(se.value);if(g.output=g.output.slice(0,-se.value.length),r.literalBrackets===!0){g.output+=y,se.value=y;continue}se.value=`(${f}${y}|${se.value})`,g.output+=se.value;continue}if(Z===\"{\"&&r.nobrace!==!0){Pe(\"braces\");let b={type:\"brace\",value:Z,output:\"(\",outputIndex:g.output.length,tokensIndex:g.tokens.length};ye.push(b),ke(b);continue}if(Z===\"}\"){let b=ye[ye.length-1];if(r.nobrace===!0||!b){ke({type:\"text\",value:Z,output:Z});continue}let y=\")\";if(b.dots===!0){let F=c.slice(),z=[];for(let X=F.length-1;X>=0&&(c.pop(),F[X].type!==\"brace\");X--)F[X].type!==\"dots\"&&z.unshift(F[X].value);y=wze(z,r),g.backtrack=!0}if(b.comma!==!0&&b.dots!==!0){let F=g.output.slice(0,b.outputIndex),z=g.tokens.slice(b.tokensIndex);b.value=b.output=\"\\\\{\",Z=y=\"\\\\}\",g.output=F;for(let X of z)g.output+=X.output||X.value}ke({type:\"brace\",value:Z,output:y}),Ve(\"braces\"),ye.pop();continue}if(Z===\"|\"){we.length>0&&we[we.length-1].conditions++,ke({type:\"text\",value:Z});continue}if(Z===\",\"){let b=Z,y=ye[ye.length-1];y&&Ae[Ae.length-1]===\"braces\"&&(y.comma=!0,b=\"|\"),ke({type:\"comma\",value:Z,output:b});continue}if(Z===\"/\"){if(se.type===\"dot\"&&g.index===g.start+1){g.start=g.index+1,g.consumed=\"\",g.output=\"\",c.pop(),se=n;continue}ke({type:\"slash\",value:Z,output:P});continue}if(Z===\".\"){if(g.braces>0&&se.type===\"dot\"){se.value===\".\"&&(se.output=C);let b=ye[ye.length-1];se.type=\"dots\",se.output+=Z,se.value+=Z,b.dots=!0;continue}if(g.braces+g.parens===0&&se.type!==\"bos\"&&se.type!==\"slash\"){ke({type:\"text\",value:Z,output:C});continue}ke({type:\"dot\",value:Z,output:C});continue}if(Z===\"?\"){if(!(se&&se.value===\"(\")&&r.noextglob!==!0&&Re()===\"(\"&&Re(2)!==\"?\"){it(\"qmark\",Z);continue}if(se&&se.type===\"paren\"){let y=Re(),F=Z;if(y===\"<\"&&!Gl.supportsLookbehinds())throw new Error(\"Node.js v10 or higher is required for regex lookbehinds\");(se.value===\"(\"&&!/[!=<:]/.test(y)||y===\"<\"&&!/<([!=]|\\w+>)/.test(j()))&&(F=`\\\\${Z}`),ke({type:\"text\",value:Z,output:F});continue}if(r.dot!==!0&&(se.type===\"slash\"||se.type===\"bos\")){ke({type:\"qmark\",value:Z,output:ie});continue}ke({type:\"qmark\",value:Z,output:ee});continue}if(Z===\"!\"){if(r.noextglob!==!0&&Re()===\"(\"&&(Re(2)!==\"?\"||!/[!=<:]/.test(Re(3)))){it(\"negate\",Z);continue}if(r.nonegate!==!0&&g.index===0){Ne();continue}}if(Z===\"+\"){if(r.noextglob!==!0&&Re()===\"(\"&&Re(2)!==\"?\"){it(\"plus\",Z);continue}if(se&&se.value===\"(\"||r.regex===!1){ke({type:\"plus\",value:Z,output:S});continue}if(se&&(se.type===\"bracket\"||se.type===\"paren\"||se.type===\"brace\")||g.parens>0){ke({type:\"plus\",value:Z});continue}ke({type:\"plus\",value:S});continue}if(Z===\"@\"){if(r.noextglob!==!0&&Re()===\"(\"&&Re(2)!==\"?\"){ke({type:\"at\",extglob:!0,value:Z,output:\"\"});continue}ke({type:\"text\",value:Z});continue}if(Z!==\"*\"){(Z===\"$\"||Z===\"^\")&&(Z=`\\\\${Z}`);let b=Ize.exec(j());b&&(Z+=b[0],g.index+=b[0].length),ke({type:\"text\",value:Z});continue}if(se&&(se.type===\"globstar\"||se.star===!0)){se.type=\"star\",se.star=!0,se.value+=Z,se.output=Ce,g.backtrack=!0,g.globstar=!0,rt(Z);continue}let x=j();if(r.noextglob!==!0&&/^\\([^?]/.test(x)){it(\"star\",Z);continue}if(se.type===\"star\"){if(r.noglobstar===!0){rt(Z);continue}let b=se.prev,y=b.prev,F=b.type===\"slash\"||b.type===\"bos\",z=y&&(y.type===\"star\"||y.type===\"globstar\");if(r.bash===!0&&(!F||x[0]&&x[0]!==\"/\")){ke({type:\"star\",value:Z,output:\"\"});continue}let X=g.braces>0&&(b.type===\"comma\"||b.type===\"brace\"),$=we.length&&(b.type===\"pipe\"||b.type===\"paren\");if(!F&&b.type!==\"paren\"&&!X&&!$){ke({type:\"star\",value:Z,output:\"\"});continue}for(;x.slice(0,3)===\"/**\";){let oe=t[g.index+4];if(oe&&oe!==\"/\")break;x=x.slice(3),rt(\"/**\",3)}if(b.type===\"bos\"&&De()){se.type=\"globstar\",se.value+=Z,se.output=me(r),g.output=se.output,g.globstar=!0,rt(Z);continue}if(b.type===\"slash\"&&b.prev.type!==\"bos\"&&!z&&De()){g.output=g.output.slice(0,-(b.output+se.output).length),b.output=`(?:${b.output}`,se.type=\"globstar\",se.output=me(r)+(r.strictSlashes?\")\":\"|$)\"),se.value+=Z,g.globstar=!0,g.output+=b.output+se.output,rt(Z);continue}if(b.type===\"slash\"&&b.prev.type!==\"bos\"&&x[0]===\"/\"){let oe=x[1]!==void 0?\"|$\":\"\";g.output=g.output.slice(0,-(b.output+se.output).length),b.output=`(?:${b.output}`,se.type=\"globstar\",se.output=`${me(r)}${P}|${P}${oe})`,se.value+=Z,g.output+=b.output+se.output,g.globstar=!0,rt(Z+mt()),ke({type:\"slash\",value:\"/\",output:\"\"});continue}if(b.type===\"bos\"&&x[0]===\"/\"){se.type=\"globstar\",se.value+=Z,se.output=`(?:^|${P}|${me(r)}${P})`,g.output=se.output,g.globstar=!0,rt(Z+mt()),ke({type:\"slash\",value:\"/\",output:\"\"});continue}g.output=g.output.slice(0,-se.output.length),se.type=\"globstar\",se.output=me(r),se.value+=Z,g.output+=se.output,g.globstar=!0,rt(Z);continue}let w={type:\"star\",value:Z,output:Ce};if(r.bash===!0){w.output=\".*?\",(se.type===\"bos\"||se.type===\"slash\")&&(w.output=pe+w.output),ke(w);continue}if(se&&(se.type===\"bracket\"||se.type===\"paren\")&&r.regex===!0){w.output=Z,ke(w);continue}(g.index===g.start||se.type===\"slash\"||se.type===\"dot\")&&(se.type===\"dot\"?(g.output+=U,se.output+=U):r.dot===!0?(g.output+=W,se.output+=W):(g.output+=pe,se.output+=pe),Re()!==\"*\"&&(g.output+=I,se.output+=I)),ke(w)}for(;g.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"]\"));g.output=Gl.escapeLast(g.output,\"[\"),Ve(\"brackets\")}for(;g.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\")\"));g.output=Gl.escapeLast(g.output,\"(\"),Ve(\"parens\")}for(;g.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"}\"));g.output=Gl.escapeLast(g.output,\"{\"),Ve(\"braces\")}if(r.strictSlashes!==!0&&(se.type===\"star\"||se.type===\"bracket\")&&ke({type:\"maybe_slash\",value:\"\",output:`${P}?`}),g.backtrack===!0){g.output=\"\";for(let x of g.tokens)g.output+=x.output!=null?x.output:x.value,x.suffix&&(g.output+=x.suffix)}return g};m4.fastpaths=(t,e)=>{let r={...e},s=typeof r.maxLength==\"number\"?Math.min(gk,r.maxLength):gk,a=t.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);t=Joe[t]||t;let n=Gl.isWindows(e),{DOT_LITERAL:c,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:E,NO_DOTS:C,NO_DOTS_SLASH:S,STAR:P,START_ANCHOR:I}=hk.globChars(n),R=r.dot?C:E,N=r.dot?S:E,U=r.capture?\"\":\"?:\",W={negated:!1,prefix:\"\"},ee=r.bash===!0?\".*?\":P;r.capture&&(ee=`(${ee})`);let ie=pe=>pe.noglobstar===!0?ee:`(${U}(?:(?!${I}${pe.dot?h:c}).)*?)`,ue=pe=>{switch(pe){case\"*\":return`${R}${p}${ee}`;case\".*\":return`${c}${p}${ee}`;case\"*.*\":return`${R}${ee}${c}${p}${ee}`;case\"*/*\":return`${R}${ee}${f}${p}${N}${ee}`;case\"**\":return R+ie(r);case\"**/*\":return`(?:${R}${ie(r)}${f})?${N}${p}${ee}`;case\"**/*.*\":return`(?:${R}${ie(r)}${f})?${N}${ee}${c}${p}${ee}`;case\"**/.*\":return`(?:${R}${ie(r)}${f})?${c}${p}${ee}`;default:{let Be=/^(.*?)\\.(\\w+)$/.exec(pe);if(!Be)return;let Ce=ue(Be[1]);return Ce?Ce+c+Be[2]:void 0}}},le=Gl.removePrefix(t,W),me=ue(le);return me&&r.strictSlashes!==!0&&(me+=`${f}?`),me};Koe.exports=m4});var Zoe=_((dFt,Xoe)=>{\"use strict\";var Bze=Ie(\"path\"),vze=Voe(),y4=zoe(),E4=IB(),Sze=EB(),Dze=t=>t&&typeof t==\"object\"&&!Array.isArray(t),Zi=(t,e,r=!1)=>{if(Array.isArray(t)){let E=t.map(S=>Zi(S,e,r));return S=>{for(let P of E){let I=P(S);if(I)return I}return!1}}let s=Dze(t)&&t.tokens&&t.input;if(t===\"\"||typeof t!=\"string\"&&!s)throw new TypeError(\"Expected pattern to be a non-empty string\");let a=e||{},n=E4.isWindows(e),c=s?Zi.compileRe(t,e):Zi.makeRe(t,e,!1,!0),f=c.state;delete c.state;let p=()=>!1;if(a.ignore){let E={...e,ignore:null,onMatch:null,onResult:null};p=Zi(a.ignore,E,r)}let h=(E,C=!1)=>{let{isMatch:S,match:P,output:I}=Zi.test(E,c,e,{glob:t,posix:n}),R={glob:t,state:f,regex:c,posix:n,input:E,output:I,match:P,isMatch:S};return typeof a.onResult==\"function\"&&a.onResult(R),S===!1?(R.isMatch=!1,C?R:!1):p(E)?(typeof a.onIgnore==\"function\"&&a.onIgnore(R),R.isMatch=!1,C?R:!1):(typeof a.onMatch==\"function\"&&a.onMatch(R),C?R:!0)};return r&&(h.state=f),h};Zi.test=(t,e,r,{glob:s,posix:a}={})=>{if(typeof t!=\"string\")throw new TypeError(\"Expected input to be a string\");if(t===\"\")return{isMatch:!1,output:\"\"};let n=r||{},c=n.format||(a?E4.toPosixSlashes:null),f=t===s,p=f&&c?c(t):t;return f===!1&&(p=c?c(t):t,f=p===s),(f===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?f=Zi.matchBase(t,e,r,a):f=e.exec(p)),{isMatch:!!f,match:f,output:p}};Zi.matchBase=(t,e,r,s=E4.isWindows(r))=>(e instanceof RegExp?e:Zi.makeRe(e,r)).test(Bze.basename(t));Zi.isMatch=(t,e,r)=>Zi(e,r)(t);Zi.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zi.parse(r,e)):y4(t,{...e,fastpaths:!1});Zi.scan=(t,e)=>vze(t,e);Zi.compileRe=(t,e,r=!1,s=!1)=>{if(r===!0)return t.output;let a=e||{},n=a.contains?\"\":\"^\",c=a.contains?\"\":\"$\",f=`${n}(?:${t.output})${c}`;t&&t.negated===!0&&(f=`^(?!${f}).*$`);let p=Zi.toRegex(f,e);return s===!0&&(p.state=t),p};Zi.makeRe=(t,e={},r=!1,s=!1)=>{if(!t||typeof t!=\"string\")throw new TypeError(\"Expected a non-empty string\");let a={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]===\".\"||t[0]===\"*\")&&(a.output=y4.fastpaths(t,e)),a.output||(a=y4(t,e)),Zi.compileRe(a,e,r,s)};Zi.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?\"i\":\"\"))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Zi.constants=Sze;Xoe.exports=Zi});var eae=_((mFt,$oe)=>{\"use strict\";$oe.exports=Zoe()});var Go=_((yFt,iae)=>{\"use strict\";var rae=Ie(\"util\"),nae=Foe(),Jf=eae(),I4=IB(),tae=t=>t===\"\"||t===\"./\",xi=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let s=new Set,a=new Set,n=new Set,c=0,f=E=>{n.add(E.output),r&&r.onResult&&r.onResult(E)};for(let E=0;E<e.length;E++){let C=Jf(String(e[E]),{...r,onResult:f},!0),S=C.state.negated||C.state.negatedExtglob;S&&c++;for(let P of t){let I=C(P,!0);(S?!I.isMatch:I.isMatch)&&(S?s.add(I.output):(s.delete(I.output),a.add(I.output)))}}let h=(c===e.length?[...n]:[...a]).filter(E=>!s.has(E));if(r&&h.length===0){if(r.failglob===!0)throw new Error(`No matches found for \"${e.join(\", \")}\"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(E=>E.replace(/\\\\/g,\"\")):e}return h};xi.match=xi;xi.matcher=(t,e)=>Jf(t,e);xi.isMatch=(t,e,r)=>Jf(e,r)(t);xi.any=xi.isMatch;xi.not=(t,e,r={})=>{e=[].concat(e).map(String);let s=new Set,a=[],n=f=>{r.onResult&&r.onResult(f),a.push(f.output)},c=new Set(xi(t,e,{...r,onResult:n}));for(let f of a)c.has(f)||s.add(f);return[...s]};xi.contains=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(`Expected a string: \"${rae.inspect(t)}\"`);if(Array.isArray(e))return e.some(s=>xi.contains(t,s,r));if(typeof e==\"string\"){if(tae(t)||tae(e))return!1;if(t.includes(e)||t.startsWith(\"./\")&&t.slice(2).includes(e))return!0}return xi.isMatch(t,e,{...r,contains:!0})};xi.matchKeys=(t,e,r)=>{if(!I4.isObject(t))throw new TypeError(\"Expected the first argument to be an object\");let s=xi(Object.keys(t),e,r),a={};for(let n of s)a[n]=t[n];return a};xi.some=(t,e,r)=>{let s=[].concat(t);for(let a of[].concat(e)){let n=Jf(String(a),r);if(s.some(c=>n(c)))return!0}return!1};xi.every=(t,e,r)=>{let s=[].concat(t);for(let a of[].concat(e)){let n=Jf(String(a),r);if(!s.every(c=>n(c)))return!1}return!0};xi.all=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(`Expected a string: \"${rae.inspect(t)}\"`);return[].concat(e).every(s=>Jf(s,r)(t))};xi.capture=(t,e,r)=>{let s=I4.isWindows(r),n=Jf.makeRe(String(t),{...r,capture:!0}).exec(s?I4.toPosixSlashes(e):e);if(n)return n.slice(1).map(c=>c===void 0?\"\":c)};xi.makeRe=(...t)=>Jf.makeRe(...t);xi.scan=(...t)=>Jf.scan(...t);xi.parse=(t,e)=>{let r=[];for(let s of[].concat(t||[]))for(let a of nae(String(s),e))r.push(Jf.parse(a,e));return r};xi.braces=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return e&&e.nobrace===!0||!/\\{.*\\}/.test(t)?[t]:nae(t,e)};xi.braceExpand=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return xi.braces(t,{...e,expand:!0})};iae.exports=xi});var oae=_((EFt,sae)=>{\"use strict\";sae.exports=({onlyFirst:t=!1}={})=>{let e=[\"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))\"].join(\"|\");return new RegExp(e,t?void 0:\"g\")}});var dk=_((IFt,aae)=>{\"use strict\";var bze=oae();aae.exports=t=>typeof t==\"string\"?t.replace(bze(),\"\"):t});function lae(t){return Number.isSafeInteger(t)&&t>=0}var cae=Xe(()=>{});function uae(t){return t!=null&&typeof t!=\"function\"&&lae(t.length)}var fae=Xe(()=>{cae()});function bc(t){return t===\"__proto__\"}var wB=Xe(()=>{});function NE(t){switch(typeof t){case\"number\":case\"symbol\":return!1;case\"string\":return t.includes(\".\")||t.includes(\"[\")||t.includes(\"]\")}}var mk=Xe(()=>{});function OE(t){return typeof t==\"string\"||typeof t==\"symbol\"?t:Object.is(t?.valueOf?.(),-0)?\"-0\":String(t)}var yk=Xe(()=>{});function Mu(t){let e=[],r=t.length;if(r===0)return e;let s=0,a=\"\",n=\"\",c=!1;for(t.charCodeAt(0)===46&&(e.push(\"\"),s++);s<r;){let f=t[s];n?f===\"\\\\\"&&s+1<r?(s++,a+=t[s]):f===n?n=\"\":a+=f:c?f==='\"'||f===\"'\"?n=f:f===\"]\"?(c=!1,e.push(a),a=\"\"):a+=f:f===\"[\"?(c=!0,a&&(e.push(a),a=\"\")):f===\".\"?a&&(e.push(a),a=\"\"):a+=f,s++}return a&&e.push(a),e}var LE=Xe(()=>{});function va(t,e,r){if(t==null)return r;switch(typeof e){case\"string\":{if(bc(e))return r;let s=t[e];return s===void 0?NE(e)?va(t,Mu(e),r):r:s}case\"number\":case\"symbol\":{typeof e==\"number\"&&(e=OE(e));let s=t[e];return s===void 0?r:s}default:{if(Array.isArray(e))return Pze(t,e,r);if(Object.is(e?.valueOf(),-0)?e=\"-0\":e=String(e),bc(e))return r;let s=t[e];return s===void 0?r:s}}}function Pze(t,e,r){if(e.length===0)return r;let s=t;for(let a=0;a<e.length;a++){if(s==null||bc(e[a]))return r;s=s[e[a]]}return s===void 0?r:s}var Ek=Xe(()=>{wB();mk();yk();LE()});function C4(t){return t!==null&&(typeof t==\"object\"||typeof t==\"function\")}var Aae=Xe(()=>{});function ME(t){return t==null||typeof t!=\"object\"&&typeof t!=\"function\"}var Ik=Xe(()=>{});function Ck(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}var w4=Xe(()=>{});function Wd(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}var wk=Xe(()=>{});function Yd(t){return t==null?t===void 0?\"[object Undefined]\":\"[object Null]\":Object.prototype.toString.call(t)}var Bk=Xe(()=>{});var vk,UE,_E,HE,Vd,Sk,Dk,bk,Pk,xk,pae,kk,jE,hae,Qk,Tk,Rk,Fk,Nk,gae,Ok,Lk,Mk,dae,Uk,_k,Hk=Xe(()=>{vk=\"[object RegExp]\",UE=\"[object String]\",_E=\"[object Number]\",HE=\"[object Boolean]\",Vd=\"[object Arguments]\",Sk=\"[object Symbol]\",Dk=\"[object Date]\",bk=\"[object Map]\",Pk=\"[object Set]\",xk=\"[object Array]\",pae=\"[object Function]\",kk=\"[object ArrayBuffer]\",jE=\"[object Object]\",hae=\"[object Error]\",Qk=\"[object DataView]\",Tk=\"[object Uint8Array]\",Rk=\"[object Uint8ClampedArray]\",Fk=\"[object Uint16Array]\",Nk=\"[object Uint32Array]\",gae=\"[object BigUint64Array]\",Ok=\"[object Int8Array]\",Lk=\"[object Int16Array]\",Mk=\"[object Int32Array]\",dae=\"[object BigInt64Array]\",Uk=\"[object Float32Array]\",_k=\"[object Float64Array]\"});function GE(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var jk=Xe(()=>{});function mae(t,e){return u0(t,void 0,t,new Map,e)}function u0(t,e,r,s=new Map,a=void 0){let n=a?.(t,e,r,s);if(n!=null)return n;if(ME(t))return t;if(s.has(t))return s.get(t);if(Array.isArray(t)){let c=new Array(t.length);s.set(t,c);for(let f=0;f<t.length;f++)c[f]=u0(t[f],f,r,s,a);return Object.hasOwn(t,\"index\")&&(c.index=t.index),Object.hasOwn(t,\"input\")&&(c.input=t.input),c}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let c=new RegExp(t.source,t.flags);return c.lastIndex=t.lastIndex,c}if(t instanceof Map){let c=new Map;s.set(t,c);for(let[f,p]of t)c.set(f,u0(p,f,r,s,a));return c}if(t instanceof Set){let c=new Set;s.set(t,c);for(let f of t)c.add(u0(f,void 0,r,s,a));return c}if(typeof Buffer<\"u\"&&Buffer.isBuffer(t))return t.subarray();if(GE(t)){let c=new(Object.getPrototypeOf(t)).constructor(t.length);s.set(t,c);for(let f=0;f<t.length;f++)c[f]=u0(t[f],f,r,s,a);return c}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<\"u\"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let c=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return s.set(t,c),c0(c,t,r,s,a),c}if(typeof File<\"u\"&&t instanceof File){let c=new File([t],t.name,{type:t.type});return s.set(t,c),c0(c,t,r,s,a),c}if(t instanceof Blob){let c=new Blob([t],{type:t.type});return s.set(t,c),c0(c,t,r,s,a),c}if(t instanceof Error){let c=new t.constructor;return s.set(t,c),c.message=t.message,c.name=t.name,c.stack=t.stack,c.cause=t.cause,c0(c,t,r,s,a),c}if(typeof t==\"object\"&&xze(t)){let c=Object.create(Object.getPrototypeOf(t));return s.set(t,c),c0(c,t,r,s,a),c}return t}function c0(t,e,r=t,s,a){let n=[...Object.keys(e),...Wd(e)];for(let c=0;c<n.length;c++){let f=n[c],p=Object.getOwnPropertyDescriptor(t,f);(p==null||p.writable)&&(t[f]=u0(e[f],f,r,s,a))}}function xze(t){switch(Yd(t)){case Vd:case xk:case kk:case Qk:case HE:case Dk:case Uk:case _k:case Ok:case Lk:case Mk:case bk:case _E:case jE:case vk:case Pk:case UE:case Sk:case Tk:case Rk:case Fk:case Nk:return!0;default:return!1}}var B4=Xe(()=>{wk();Bk();Hk();Ik();jk()});function yae(t){return u0(t,void 0,t,new Map,void 0)}var Eae=Xe(()=>{B4()});function Iae(t,e){return mae(t,(r,s,a,n)=>{let c=e?.(r,s,a,n);if(c!=null)return c;if(typeof t==\"object\")switch(Object.prototype.toString.call(t)){case _E:case UE:case HE:{let f=new t.constructor(t?.valueOf());return c0(f,t),f}case Vd:{let f={};return c0(f,t),f.length=t.length,f[Symbol.iterator]=t[Symbol.iterator],f}default:return}})}var Cae=Xe(()=>{B4();Hk()});function f0(t){return Iae(t)}var v4=Xe(()=>{Cae()});function Gk(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case\"number\":return Number.isInteger(t)&&t>=0&&t<e;case\"symbol\":return!1;case\"string\":return kze.test(t)}}var kze,S4=Xe(()=>{kze=/^(?:0|[1-9]\\d*)$/});function BB(t){return t!==null&&typeof t==\"object\"&&Yd(t)===\"[object Arguments]\"}var D4=Xe(()=>{Bk()});function vB(t,e){let r;if(Array.isArray(e)?r=e:typeof e==\"string\"&&NE(e)&&t?.[e]==null?r=Mu(e):r=[e],r.length===0)return!1;let s=t;for(let a=0;a<r.length;a++){let n=r[a];if((s==null||!Object.hasOwn(s,n))&&!((Array.isArray(s)||BB(s))&&Gk(n)&&n<s.length))return!1;s=s[n]}return!0}var b4=Xe(()=>{mk();S4();D4();LE()});function P4(t){return typeof t==\"object\"&&t!==null}var wae=Xe(()=>{});function Bae(t){return typeof t==\"symbol\"||t instanceof Symbol}var vae=Xe(()=>{});function Sae(t,e){return Array.isArray(t)?!1:typeof t==\"number\"||typeof t==\"boolean\"||t==null||Bae(t)?!0:typeof t==\"string\"&&(Tze.test(t)||!Qze.test(t))||e!=null&&Object.hasOwn(e,t)}var Qze,Tze,Dae=Xe(()=>{vae();Qze=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Tze=/^\\w*$/});function A0(t,e){if(t==null)return!0;switch(typeof e){case\"symbol\":case\"number\":case\"object\":{if(Array.isArray(e))return bae(t,e);if(typeof e==\"number\"?e=OE(e):typeof e==\"object\"&&(Object.is(e?.valueOf(),-0)?e=\"-0\":e=String(e)),bc(e))return!1;if(t?.[e]===void 0)return!0;try{return delete t[e],!0}catch{return!1}}case\"string\":{if(t?.[e]===void 0&&NE(e))return bae(t,Mu(e));if(bc(e))return!1;try{return delete t[e],!0}catch{return!1}}}}function bae(t,e){let r=va(t,e.slice(0,-1),t),s=e[e.length-1];if(r?.[s]===void 0)return!0;if(bc(s))return!1;try{return delete r[s],!0}catch{return!1}}var x4=Xe(()=>{Ek();wB();mk();yk();LE()});function Pae(t){return t==null}var xae=Xe(()=>{});var kae,Qae=Xe(()=>{w4();kae=(t,e,r)=>{let s=t[e];(!(Object.hasOwn(t,e)&&Ck(s,r))||r===void 0&&!(e in t))&&(t[e]=r)}});function Tae(t,e,r,s){if(t==null&&!C4(t))return t;let a=Sae(e,t)?[e]:Array.isArray(e)?e:typeof e==\"string\"?Mu(e):[e],n=t;for(let c=0;c<a.length&&n!=null;c++){let f=OE(a[c]);if(bc(f))continue;let p;if(c===a.length-1)p=r(n[f]);else{let h=n[f],E=s?.(h,f,t);p=E!==void 0?E:C4(h)?h:Gk(a[c+1])?[]:{}}kae(n,f,p),n=n[f]}return t}var Rae=Xe(()=>{wB();Qae();S4();Dae();yk();Aae();LE()});function Jd(t,e,r){return Tae(t,e,()=>r,()=>{})}var k4=Xe(()=>{Rae()});function Fae(t,e=0,r={}){typeof r!=\"object\"&&(r={});let s=null,a=null,n=null,c=0,f=null,p,{leading:h=!1,trailing:E=!0,maxWait:C}=r,S=\"maxWait\"in r,P=S?Math.max(Number(C)||0,e):0,I=ue=>(s!==null&&(p=t.apply(a,s)),s=a=null,c=ue,p),R=ue=>(c=ue,f=setTimeout(ee,e),h&&s!==null?I(ue):p),N=ue=>(f=null,E&&s!==null?I(ue):p),U=ue=>{if(n===null)return!0;let le=ue-n,me=le>=e||le<0,pe=S&&ue-c>=P;return me||pe},W=ue=>{let le=n===null?0:ue-n,me=e-le,pe=P-(ue-c);return S?Math.min(me,pe):me},ee=()=>{let ue=Date.now();if(U(ue))return N(ue);f=setTimeout(ee,W(ue))},ie=function(...ue){let le=Date.now(),me=U(le);if(s=ue,a=this,n=le,me){if(f===null)return R(le);if(S)return clearTimeout(f),f=setTimeout(ee,e),I(le)}return f===null&&(f=setTimeout(ee,e)),p};return ie.cancel=()=>{f!==null&&clearTimeout(f),c=0,n=s=a=f=null},ie.flush=()=>f===null?p:N(Date.now()),ie}var Nae=Xe(()=>{});function Q4(t,e=0,r={}){let{leading:s=!0,trailing:a=!0}=r;return Fae(t,e,{leading:s,maxWait:e,trailing:a})}var Oae=Xe(()=>{Nae()});function T4(t){if(t==null)return\"\";if(typeof t==\"string\")return t;if(Array.isArray(t))return t.map(T4).join(\",\");let e=String(t);return e===\"0\"&&Object.is(Number(t),-0)?\"-0\":e}var Lae=Xe(()=>{});function R4(t){if(!t||typeof t!=\"object\")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)===\"[object Object]\":!1}var Mae=Xe(()=>{});function Uae(t,e,r){return SB(t,e,void 0,void 0,void 0,void 0,r)}function SB(t,e,r,s,a,n,c){let f=c(t,e,r,s,a,n);if(f!==void 0)return f;if(typeof t==typeof e)switch(typeof t){case\"bigint\":case\"string\":case\"boolean\":case\"symbol\":case\"undefined\":return t===e;case\"number\":return t===e||Object.is(t,e);case\"function\":return t===e;case\"object\":return DB(t,e,n,c)}return DB(t,e,n,c)}function DB(t,e,r,s){if(Object.is(t,e))return!0;let a=Yd(t),n=Yd(e);if(a===Vd&&(a=jE),n===Vd&&(n=jE),a!==n)return!1;switch(a){case UE:return t.toString()===e.toString();case _E:{let p=t.valueOf(),h=e.valueOf();return Ck(p,h)}case HE:case Dk:case Sk:return Object.is(t.valueOf(),e.valueOf());case vk:return t.source===e.source&&t.flags===e.flags;case pae:return t===e}r=r??new Map;let c=r.get(t),f=r.get(e);if(c!=null&&f!=null)return c===e;r.set(t,e),r.set(e,t);try{switch(a){case bk:{if(t.size!==e.size)return!1;for(let[p,h]of t.entries())if(!e.has(p)||!SB(h,e.get(p),p,t,e,r,s))return!1;return!0}case Pk:{if(t.size!==e.size)return!1;let p=Array.from(t.values()),h=Array.from(e.values());for(let E=0;E<p.length;E++){let C=p[E],S=h.findIndex(P=>SB(C,P,void 0,t,e,r,s));if(S===-1)return!1;h.splice(S,1)}return!0}case xk:case Tk:case Rk:case Fk:case Nk:case gae:case Ok:case Lk:case Mk:case dae:case Uk:case _k:{if(typeof Buffer<\"u\"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let p=0;p<t.length;p++)if(!SB(t[p],e[p],p,t,e,r,s))return!1;return!0}case kk:return t.byteLength!==e.byteLength?!1:DB(new Uint8Array(t),new Uint8Array(e),r,s);case Qk:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:DB(new Uint8Array(t),new Uint8Array(e),r,s);case hae:return t.name===e.name&&t.message===e.message;case jE:{if(!(DB(t.constructor,e.constructor,r,s)||R4(t)&&R4(e)))return!1;let h=[...Object.keys(t),...Wd(t)],E=[...Object.keys(e),...Wd(e)];if(h.length!==E.length)return!1;for(let C=0;C<h.length;C++){let S=h[C],P=t[S];if(!Object.hasOwn(e,S))return!1;let I=e[S];if(!SB(P,I,S,t,e,r,s))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}var _ae=Xe(()=>{Mae();wk();Bk();Hk();w4()});function Hae(){}var jae=Xe(()=>{});function F4(t,e){return Uae(t,e,Hae)}var Gae=Xe(()=>{_ae();jae()});function qae(t){return GE(t)}var Wae=Xe(()=>{jk()});function Yae(t){if(typeof t!=\"object\"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!==\"[object Object]\"){let r=t[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${r}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var Vae=Xe(()=>{});function Jae(t){if(ME(t))return t;if(Array.isArray(t)||GE(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<\"u\"&&t instanceof SharedArrayBuffer)return t.slice(0);let e=Object.getPrototypeOf(t),r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){let s=new r(t);return s.lastIndex=t.lastIndex,s}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let s=new r(t.message);return s.stack=t.stack,s.name=t.name,s.cause=t.cause,s}if(typeof File<\"u\"&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t==\"object\"){let s=Object.create(e);return Object.assign(s,t)}return t}var Kae=Xe(()=>{Ik();jk()});function N4(t,...e){let r=e.slice(0,-1),s=e[e.length-1],a=t;for(let n=0;n<r.length;n++){let c=r[n];a=qk(a,c,s,new Map)}return a}function qk(t,e,r,s){if(ME(t)&&(t=Object(t)),e==null||typeof e!=\"object\")return t;if(s.has(e))return Jae(s.get(e));if(s.set(e,t),Array.isArray(e)){e=e.slice();for(let n=0;n<e.length;n++)e[n]=e[n]??void 0}let a=[...Object.keys(e),...Wd(e)];for(let n=0;n<a.length;n++){let c=a[n];if(bc(c))continue;let f=e[c],p=t[c];if(BB(f)&&(f={...f}),BB(p)&&(p={...p}),typeof Buffer<\"u\"&&Buffer.isBuffer(f)&&(f=f0(f)),Array.isArray(f))if(typeof p==\"object\"&&p!=null){let E=[],C=Reflect.ownKeys(p);for(let S=0;S<C.length;S++){let P=C[S];E[P]=p[P]}p=E}else p=[];let h=r(p,f,c,t,e,s);h!=null?t[c]=h:Array.isArray(f)||P4(p)&&P4(f)?t[c]=qk(p,f,r,s):p==null&&Yae(f)?t[c]=qk({},f,r,s):p==null&&qae(f)?t[c]=f0(f):(p===void 0||f!==void 0)&&(t[c]=f)}return t}var zae=Xe(()=>{v4();wB();Kae();Ik();wk();D4();wae();Vae();Wae()});function O4(t,...e){if(t==null)return{};let r=yae(t);for(let s=0;s<e.length;s++){let a=e[s];switch(typeof a){case\"object\":{Array.isArray(a)||(a=Array.from(a));for(let n=0;n<a.length;n++){let c=a[n];A0(r,c)}break}case\"string\":case\"symbol\":case\"number\":{A0(r,a);break}}}return r}var Xae=Xe(()=>{x4();Eae()});function Kd(t,...e){if(Pae(t))return{};let r={};for(let s=0;s<e.length;s++){let a=e[s];switch(typeof a){case\"object\":{Array.isArray(a)||(uae(a)?a=Array.from(a):a=[a]);break}case\"string\":case\"symbol\":case\"number\":{a=[a];break}}for(let n of a){let c=va(t,n);c===void 0&&!vB(t,n)||(typeof n==\"string\"&&Object.hasOwn(t,n)?r[n]=c:Jd(r,n,c))}}return r}var Zae=Xe(()=>{Ek();b4();k4();fae();xae()});function $ae(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}var ele=Xe(()=>{});function bB(t){return $ae(T4(t))}var tle=Xe(()=>{ele();Lae()});var ql=Xe(()=>{Oae();Gae();v4();Ek();b4();zae();Xae();Zae();k4();x4();tle();LE()});var je={};Vt(je,{AsyncActions:()=>U4,BufferStream:()=>M4,CachingStrategy:()=>fle,DefaultStream:()=>_4,allSettledSafe:()=>Uu,assertNever:()=>G4,bufferStream:()=>WE,buildIgnorePattern:()=>Uze,convertMapsToIndexableObjects:()=>Yk,dynamicRequire:()=>Pp,escapeRegExp:()=>Fze,getArrayWithDefault:()=>xB,getFactoryWithDefault:()=>Yl,getMapWithDefault:()=>q4,getSetWithDefault:()=>bp,groupBy:()=>jze,isIndexableObject:()=>L4,isPathLike:()=>_ze,isTaggedYarnVersion:()=>Rze,makeDeferred:()=>lle,mapAndFilter:()=>Wl,mapAndFind:()=>p0,mergeIntoTarget:()=>ple,overrideType:()=>Nze,parseBoolean:()=>kB,parseDuration:()=>Jk,parseInt:()=>YE,parseOptionalBoolean:()=>Ale,plural:()=>Wk,prettifyAsyncErrors:()=>qE,prettifySyncErrors:()=>W4,releaseAfterUseAsync:()=>Lze,replaceEnvVariables:()=>Vk,sortMap:()=>qs,toMerged:()=>Hze,tryParseOptionalBoolean:()=>Y4,validateEnum:()=>Oze});function Rze(t){return!!(sle.default.valid(t)&&t.match(/^[^-]+(-rc\\.[0-9]+)?$/))}function Wk(t,{one:e,more:r,zero:s=r}){return t===0?s:t===1?e:r}function Fze(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Nze(t){}function G4(t){throw new Error(`Assertion failed: Unexpected object '${t}'`)}function Oze(t,e){let r=Object.values(t);if(!r.includes(e))throw new nt(`Invalid value for enumeration: ${JSON.stringify(e)} (expected one of ${r.map(s=>JSON.stringify(s)).join(\", \")})`);return e}function Wl(t,e){let r=[];for(let s of t){let a=e(s);a!==ole&&r.push(a)}return r}function p0(t,e){for(let r of t){let s=e(r);if(s!==ale)return s}}function L4(t){return typeof t==\"object\"&&t!==null}async function Uu(t){let e=await Promise.allSettled(t),r=[];for(let s of e){if(s.status===\"rejected\")throw s.reason;r.push(s.value)}return r}function Yk(t){if(t instanceof Map&&(t=Object.fromEntries(t)),L4(t))for(let e of Object.keys(t)){let r=t[e];L4(r)&&(t[e]=Yk(r))}return t}function Yl(t,e,r){let s=t.get(e);return typeof s>\"u\"&&t.set(e,s=r()),s}function xB(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=[]),r}function bp(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=new Set),r}function q4(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=new Map),r}async function Lze(t,e){if(e==null)return await t();try{return await t()}finally{await e()}}async function qE(t,e){try{return await t()}catch(r){throw r.message=e(r.message),r}}function W4(t,e){try{return t()}catch(r){throw r.message=e(r.message),r}}async function WE(t){return await new Promise((e,r)=>{let s=[];t.on(\"error\",a=>{r(a)}),t.on(\"data\",a=>{s.push(a)}),t.on(\"end\",()=>{e(Buffer.concat(s))})})}function lle(){let t,e;return{promise:new Promise((s,a)=>{t=s,e=a}),resolve:t,reject:e}}function cle(t){return PB(fe.fromPortablePath(t))}function ule(path){let physicalPath=fe.fromPortablePath(path),currentCacheEntry=PB.cache[physicalPath];delete PB.cache[physicalPath];let result;try{result=cle(physicalPath);let freshCacheEntry=PB.cache[physicalPath],dynamicModule=eval(\"module\"),freshCacheIndex=dynamicModule.children.indexOf(freshCacheEntry);freshCacheIndex!==-1&&dynamicModule.children.splice(freshCacheIndex,1)}finally{PB.cache[physicalPath]=currentCacheEntry}return result}function Mze(t){let e=rle.get(t),r=ce.statSync(t);if(e?.mtime===r.mtimeMs)return e.instance;let s=ule(t);return rle.set(t,{mtime:r.mtimeMs,instance:s}),s}function Pp(t,{cachingStrategy:e=2}={}){switch(e){case 0:return ule(t);case 1:return Mze(t);case 2:return cle(t);default:throw new Error(\"Unsupported caching strategy\")}}function qs(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let s=[];for(let n of e)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function Uze(t){return t.length===0?null:t.map(e=>`(${nle.default.makeRe(e,{windows:!1,dot:!0}).source})`).join(\"|\")}function Vk(t,{env:e}){let r=/\\\\?\\${(?<variableName>[\\d\\w_]+)(?<colon>:)?(?:-(?<fallback>[^}]*))?}/g;return t.replace(r,(s,...a)=>{if(s.startsWith(\"\\\\\"))return s.slice(1);let{variableName:n,colon:c,fallback:f}=a[a.length-1],p=Object.hasOwn(e,n),h=e[n];if(h||p&&!c)return h;if(f!=null)return f;throw new nt(`Environment variable not found (${n})`)})}function kB(t){switch(t){case\"true\":case\"1\":case 1:case!0:return!0;case\"false\":case\"0\":case 0:case!1:return!1;default:throw new Error(`Couldn't parse \"${t}\" as a boolean`)}}function Ale(t){return typeof t>\"u\"?t:kB(t)}function Y4(t){try{return Ale(t)}catch{return null}}function _ze(t){return!!(fe.isAbsolute(t)||t.match(/^(\\.{1,2}|~)\\//))}function ple(t,...e){let r=c=>({value:c}),s=r(t),a=e.map(c=>r(c)),{value:n}=N4(s,...a,(c,f)=>{if(Array.isArray(c)&&Array.isArray(f)){for(let p of f)c.find(h=>F4(h,p))||c.push(p);return c}});return n}function Hze(...t){return ple({},...t)}function jze(t,e){let r=Object.create(null);for(let s of t){let a=s[e];r[a]??=[],r[a].push(s)}return r}function YE(t){return typeof t==\"string\"?Number.parseInt(t,10):t}function Jk(t,e){let r=Gze.exec(t)?.groups;if(!r)throw new Error(`Couldn't parse \"${t}\" as a duration`);if(r.unit===void 0)return parseFloat(r.num);let s=H4[r.unit];if(!s)throw new Error(`Invalid duration unit \"${r.unit}\"`);return parseFloat(r.num)*s/H4[e]}var nle,ile,sle,j4,ole,ale,M4,U4,_4,PB,rle,fle,H4,Gze,Pc=Xe(()=>{Dt();Yt();ql();nle=ut(Go()),ile=ut(Ld()),sle=ut(Ai()),j4=Ie(\"stream\");ole=Symbol();Wl.skip=ole;ale=Symbol();p0.skip=ale;M4=class extends j4.Transform{constructor(){super(...arguments);this.chunks=[]}_transform(r,s,a){if(s!==\"buffer\"||!Buffer.isBuffer(r))throw new Error(\"Assertion failed: BufferStream only accept buffers\");this.chunks.push(r),a(null,null)}_flush(r){r(null,Buffer.concat(this.chunks))}};U4=class{constructor(e){this.deferred=new Map;this.promises=new Map;this.limit=(0,ile.default)(e)}set(e,r){let s=this.deferred.get(e);typeof s>\"u\"&&this.deferred.set(e,s=lle());let a=this.limit(()=>r());return this.promises.set(e,a),a.then(()=>{this.promises.get(e)===a&&s.resolve()},n=>{this.promises.get(e)===a&&s.reject(n)}),s.promise}reduce(e,r){let s=this.promises.get(e)??Promise.resolve();this.set(e,()=>r(s))}async wait(){await Promise.all(this.promises.values())}},_4=class extends j4.Transform{constructor(r=Buffer.alloc(0)){super();this.active=!0;this.ifEmpty=r}_transform(r,s,a){if(s!==\"buffer\"||!Buffer.isBuffer(r))throw new Error(\"Assertion failed: DefaultStream only accept buffers\");this.active=!1,a(null,r)}_flush(r){this.active&&this.ifEmpty.length>0?r(null,this.ifEmpty):r(null)}},PB=eval(\"require\");rle=new Map;fle=(s=>(s[s.NoCache=0]=\"NoCache\",s[s.FsTime=1]=\"FsTime\",s[s.Node=2]=\"Node\",s))(fle||{});H4={ms:1,s:1e3,m:60*1e3,h:60*60*1e3,d:24*60*60*1e3,w:7*24*60*60*1e3},Gze=new RegExp(`^(?<num>\\\\d*\\\\.?\\\\d+)(?<unit>${Object.keys(H4).join(\"|\")})?$`)});var VE,V4,J4,hle=Xe(()=>{VE=(r=>(r.HARD=\"HARD\",r.SOFT=\"SOFT\",r))(VE||{}),V4=(s=>(s.Dependency=\"Dependency\",s.PeerDependency=\"PeerDependency\",s.PeerDependencyMeta=\"PeerDependencyMeta\",s))(V4||{}),J4=(s=>(s.Inactive=\"inactive\",s.Redundant=\"redundant\",s.Active=\"active\",s))(J4||{})});var he={};Vt(he,{LogLevel:()=>eQ,Style:()=>Xk,Type:()=>ht,addLogFilterSupport:()=>RB,applyColor:()=>ri,applyHyperlink:()=>KE,applyStyle:()=>zd,json:()=>Xd,jsonOrPretty:()=>Yze,mark:()=>$4,pretty:()=>Ht,prettyField:()=>Kf,prettyList:()=>Z4,prettyTruncatedLocatorList:()=>$k,stripAnsi:()=>JE.default,supportsColor:()=>Zk,supportsHyperlinks:()=>X4,tuple:()=>_u});function gle(t){let e=[\"KiB\",\"MiB\",\"GiB\",\"TiB\"],r=e.length;for(;r>1&&t<1024**r;)r-=1;let s=1024**r;return`${Math.floor(t*100/s)/100} ${e[r-1]}`}function Kk(t,e){if(Array.isArray(e))return e.length===0?ri(t,\"[]\",ht.CODE):ri(t,\"[ \",ht.CODE)+e.map(r=>Kk(t,r)).join(\", \")+ri(t,\" ]\",ht.CODE);if(typeof e==\"string\")return ri(t,JSON.stringify(e),ht.STRING);if(typeof e==\"number\")return ri(t,JSON.stringify(e),ht.NUMBER);if(typeof e==\"boolean\")return ri(t,JSON.stringify(e),ht.BOOLEAN);if(e===null)return ri(t,\"null\",ht.NULL);if(typeof e==\"object\"&&Object.getPrototypeOf(e)===Object.prototype){let r=Object.entries(e);return r.length===0?ri(t,\"{}\",ht.CODE):ri(t,\"{ \",ht.CODE)+r.map(([s,a])=>`${Kk(t,s)}: ${Kk(t,a)}`).join(\", \")+ri(t,\" }\",ht.CODE)}if(typeof e>\"u\")return ri(t,\"undefined\",ht.NULL);throw new Error(\"Assertion failed: The value doesn't seem to be a valid JSON object\")}function _u(t,e){return[e,t]}function zd(t,e,r){return t.get(\"enableColors\")&&r&2&&(e=TB.default.bold(e)),e}function ri(t,e,r){if(!t.get(\"enableColors\"))return e;let s=qze.get(r);if(s===null)return e;let a=typeof s>\"u\"?r:z4.level>=3?s[0]:s[1],n=typeof a==\"number\"?K4.ansi256(a):a.startsWith(\"#\")?K4.hex(a):K4[a];if(typeof n!=\"function\")throw new Error(`Invalid format type ${a}`);return n(e)}function KE(t,e,r){return t.get(\"enableHyperlinks\")?Wze?`\\x1B]8;;${r}\\x1B\\\\${e}\\x1B]8;;\\x1B\\\\`:`\\x1B]8;;${r}\\x07${e}\\x1B]8;;\\x07`:e}function Ht(t,e,r){if(e===null)return ri(t,\"null\",ht.NULL);if(Object.hasOwn(zk,r))return zk[r].pretty(t,e);if(typeof e!=\"string\")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof e}`);return ri(t,e,r)}function Z4(t,e,r,{separator:s=\", \"}={}){return[...e].map(a=>Ht(t,a,r)).join(s)}function Xd(t,e){if(t===null)return null;if(Object.hasOwn(zk,e))return zk[e].json(t);if(typeof t!=\"string\")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof t}`);return t}function Yze(t,e,[r,s]){return t?Xd(r,s):Ht(e,r,s)}function $4(t){return{Check:ri(t,\"\\u2713\",\"green\"),Cross:ri(t,\"\\u2718\",\"red\"),Question:ri(t,\"?\",\"cyan\")}}function Kf(t,{label:e,value:[r,s]}){return`${Ht(t,e,ht.CODE)}: ${Ht(t,r,s)}`}function $k(t,e,r){let s=[],a=[...e],n=r;for(;a.length>0;){let h=a[0],E=`${Yr(t,h)}, `,C=e3(h).length+2;if(s.length>0&&n<C)break;s.push([E,C]),n-=C,a.shift()}if(a.length===0)return s.map(([h])=>h).join(\"\").slice(0,-2);let c=\"X\".repeat(a.length.toString().length),f=`and ${c} more.`,p=a.length;for(;s.length>1&&n<f.length;)n+=s[s.length-1][1],p+=1,s.pop();return[s.map(([h])=>h).join(\"\"),f.replace(c,Ht(t,p,ht.NUMBER))].join(\"\")}function RB(t,{configuration:e}){let r=e.get(\"logFilters\"),s=new Map,a=new Map,n=[];for(let C of r){let S=C.get(\"level\");if(typeof S>\"u\")continue;let P=C.get(\"code\");typeof P<\"u\"&&s.set(P,S);let I=C.get(\"text\");typeof I<\"u\"&&a.set(I,S);let R=C.get(\"pattern\");typeof R<\"u\"&&n.push([dle.default.matcher(R,{contains:!0}),S])}n.reverse();let c=(C,S,P)=>{if(C===null||C===0)return P;let I=a.size>0||n.length>0?(0,JE.default)(S):S;if(a.size>0){let R=a.get(I);if(typeof R<\"u\")return R??P}if(n.length>0){for(let[R,N]of n)if(R(I))return N??P}if(s.size>0){let R=s.get(Yf(C));if(typeof R<\"u\")return R??P}return P},f=t.reportInfo,p=t.reportWarning,h=t.reportError,E=function(C,S,P,I){switch(c(S,P,I)){case\"info\":f.call(C,S,P);break;case\"warning\":p.call(C,S??0,P);break;case\"error\":h.call(C,S??0,P);break}};t.reportInfo=function(...C){return E(this,...C,\"info\")},t.reportWarning=function(...C){return E(this,...C,\"warning\")},t.reportError=function(...C){return E(this,...C,\"error\")}}var TB,QB,dle,JE,ht,Xk,z4,Zk,X4,K4,qze,qo,zk,Wze,eQ,xc=Xe(()=>{Dt();TB=ut(TE()),QB=ut(Fd());Yt();dle=ut(Go()),JE=ut(dk());Gx();Wo();ht={NO_HINT:\"NO_HINT\",ID:\"ID\",NULL:\"NULL\",SCOPE:\"SCOPE\",NAME:\"NAME\",RANGE:\"RANGE\",REFERENCE:\"REFERENCE\",NUMBER:\"NUMBER\",STRING:\"STRING\",BOOLEAN:\"BOOLEAN\",PATH:\"PATH\",URL:\"URL\",ADDED:\"ADDED\",REMOVED:\"REMOVED\",CODE:\"CODE\",INSPECT:\"INSPECT\",DURATION:\"DURATION\",SIZE:\"SIZE\",SIZE_DIFF:\"SIZE_DIFF\",IDENT:\"IDENT\",DESCRIPTOR:\"DESCRIPTOR\",LOCATOR:\"LOCATOR\",RESOLUTION:\"RESOLUTION\",DEPENDENT:\"DEPENDENT\",PACKAGE_EXTENSION:\"PACKAGE_EXTENSION\",SETTING:\"SETTING\",MARKDOWN:\"MARKDOWN\",MARKDOWN_INLINE:\"MARKDOWN_INLINE\"},Xk=(e=>(e[e.BOLD=2]=\"BOLD\",e))(Xk||{}),z4=QB.default.GITHUB_ACTIONS?{level:2}:TB.default.supportsColor?{level:TB.default.supportsColor.level}:{level:0},Zk=z4.level!==0,X4=Zk&&!QB.default.GITHUB_ACTIONS&&!QB.default.CIRCLE&&!QB.default.GITLAB,K4=new TB.default.Instance(z4),qze=new Map([[ht.NO_HINT,null],[ht.NULL,[\"#a853b5\",129]],[ht.SCOPE,[\"#d75f00\",166]],[ht.NAME,[\"#d7875f\",173]],[ht.RANGE,[\"#00afaf\",37]],[ht.REFERENCE,[\"#87afff\",111]],[ht.NUMBER,[\"#ffd700\",220]],[ht.STRING,[\"#b4bd68\",32]],[ht.BOOLEAN,[\"#faa023\",209]],[ht.PATH,[\"#d75fd7\",170]],[ht.URL,[\"#d75fd7\",170]],[ht.ADDED,[\"#5faf00\",70]],[ht.REMOVED,[\"#ff3131\",160]],[ht.CODE,[\"#87afff\",111]],[ht.SIZE,[\"#ffd700\",220]]]),qo=t=>t;zk={[ht.ID]:qo({pretty:(t,e)=>typeof e==\"number\"?ri(t,`${e}`,ht.NUMBER):ri(t,e,ht.CODE),json:t=>t}),[ht.INSPECT]:qo({pretty:(t,e)=>Kk(t,e),json:t=>t}),[ht.NUMBER]:qo({pretty:(t,e)=>ri(t,`${e}`,ht.NUMBER),json:t=>t}),[ht.IDENT]:qo({pretty:(t,e)=>$i(t,e),json:t=>un(t)}),[ht.LOCATOR]:qo({pretty:(t,e)=>Yr(t,e),json:t=>ll(t)}),[ht.DESCRIPTOR]:qo({pretty:(t,e)=>ni(t,e),json:t=>al(t)}),[ht.RESOLUTION]:qo({pretty:(t,{descriptor:e,locator:r})=>FB(t,e,r),json:({descriptor:t,locator:e})=>({descriptor:al(t),locator:e!==null?ll(e):null})}),[ht.DEPENDENT]:qo({pretty:(t,{locator:e,descriptor:r})=>t3(t,e,r),json:({locator:t,descriptor:e})=>({locator:ll(t),descriptor:al(e)})}),[ht.PACKAGE_EXTENSION]:qo({pretty:(t,e)=>{switch(e.type){case\"Dependency\":return`${$i(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"dependencies\",ht.CODE)} \\u27A4 ${$i(t,e.descriptor)}`;case\"PeerDependency\":return`${$i(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"peerDependencies\",ht.CODE)} \\u27A4 ${$i(t,e.descriptor)}`;case\"PeerDependencyMeta\":return`${$i(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"peerDependenciesMeta\",ht.CODE)} \\u27A4 ${$i(t,Sa(e.selector))} \\u27A4 ${ri(t,e.key,ht.CODE)}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${e.type}`)}},json:t=>{switch(t.type){case\"Dependency\":return`${un(t.parentDescriptor)} > ${un(t.descriptor)}`;case\"PeerDependency\":return`${un(t.parentDescriptor)} >> ${un(t.descriptor)}`;case\"PeerDependencyMeta\":return`${un(t.parentDescriptor)} >> ${t.selector} / ${t.key}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${t.type}`)}}}),[ht.SETTING]:qo({pretty:(t,e)=>(t.get(e),KE(t,ri(t,e,ht.CODE),`https://yarnpkg.com/configuration/yarnrc#${e}`)),json:t=>t}),[ht.DURATION]:qo({pretty:(t,e)=>{if(e>1e3*60){let r=Math.floor(e/1e3/60),s=Math.ceil((e-r*60*1e3)/1e3);return s===0?`${r}m`:`${r}m ${s}s`}else{let r=Math.floor(e/1e3),s=e-r*1e3;return s===0?`${r}s`:`${r}s ${s}ms`}},json:t=>t}),[ht.SIZE]:qo({pretty:(t,e)=>ri(t,gle(e),ht.NUMBER),json:t=>t}),[ht.SIZE_DIFF]:qo({pretty:(t,e)=>{let r=e>=0?\"+\":\"-\",s=r===\"+\"?ht.REMOVED:ht.ADDED;return ri(t,`${r} ${gle(Math.max(Math.abs(e),1))}`,s)},json:t=>t}),[ht.PATH]:qo({pretty:(t,e)=>ri(t,fe.fromPortablePath(e),ht.PATH),json:t=>fe.fromPortablePath(t)}),[ht.MARKDOWN]:qo({pretty:(t,{text:e,format:r,paragraphs:s})=>Ho(e,{format:r,paragraphs:s}),json:({text:t})=>t}),[ht.MARKDOWN_INLINE]:qo({pretty:(t,e)=>(e=e.replace(/(`+)((?:.|[\\n])*?)\\1/g,(r,s,a)=>Ht(t,s+a+s,ht.CODE)),e=e.replace(/(\\*\\*)((?:.|[\\n])*?)\\1/g,(r,s,a)=>zd(t,a,2)),e),json:t=>t})};Wze=!!process.env.KONSOLE_VERSION;eQ=(a=>(a.Error=\"error\",a.Warning=\"warning\",a.Info=\"info\",a.Discard=\"discard\",a))(eQ||{})});var mle=_(zE=>{\"use strict\";Object.defineProperty(zE,\"__esModule\",{value:!0});zE.splitWhen=zE.flatten=void 0;function Vze(t){return t.reduce((e,r)=>[].concat(e,r),[])}zE.flatten=Vze;function Jze(t,e){let r=[[]],s=0;for(let a of t)e(a)?(s++,r[s]=[]):r[s].push(a);return r}zE.splitWhen=Jze});var yle=_(tQ=>{\"use strict\";Object.defineProperty(tQ,\"__esModule\",{value:!0});tQ.isEnoentCodeError=void 0;function Kze(t){return t.code===\"ENOENT\"}tQ.isEnoentCodeError=Kze});var Ele=_(rQ=>{\"use strict\";Object.defineProperty(rQ,\"__esModule\",{value:!0});rQ.createDirentFromStats=void 0;var r3=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function zze(t,e){return new r3(t,e)}rQ.createDirentFromStats=zze});var Ble=_(cs=>{\"use strict\";Object.defineProperty(cs,\"__esModule\",{value:!0});cs.convertPosixPathToPattern=cs.convertWindowsPathToPattern=cs.convertPathToPattern=cs.escapePosixPath=cs.escapeWindowsPath=cs.escape=cs.removeLeadingDotSegment=cs.makeAbsolute=cs.unixify=void 0;var Xze=Ie(\"os\"),Zze=Ie(\"path\"),Ile=Xze.platform()===\"win32\",$ze=2,eXe=/(\\\\?)([()*?[\\]{|}]|^!|[!+@](?=\\()|\\\\(?![!()*+?@[\\]{|}]))/g,tXe=/(\\\\?)([()[\\]{}]|^!|[!+@](?=\\())/g,rXe=/^\\\\\\\\([.?])/,nXe=/\\\\(?![!()+@[\\]{}])/g;function iXe(t){return t.replace(/\\\\/g,\"/\")}cs.unixify=iXe;function sXe(t,e){return Zze.resolve(t,e)}cs.makeAbsolute=sXe;function oXe(t){if(t.charAt(0)===\".\"){let e=t.charAt(1);if(e===\"/\"||e===\"\\\\\")return t.slice($ze)}return t}cs.removeLeadingDotSegment=oXe;cs.escape=Ile?n3:i3;function n3(t){return t.replace(tXe,\"\\\\$2\")}cs.escapeWindowsPath=n3;function i3(t){return t.replace(eXe,\"\\\\$2\")}cs.escapePosixPath=i3;cs.convertPathToPattern=Ile?Cle:wle;function Cle(t){return n3(t).replace(rXe,\"//$1\").replace(nXe,\"/\")}cs.convertWindowsPathToPattern=Cle;function wle(t){return i3(t)}cs.convertPosixPathToPattern=wle});var Sle=_((JOt,vle)=>{vle.exports=function(e){if(typeof e!=\"string\"||e===\"\")return!1;for(var r;r=/(\\\\).|([@?!+*]\\(.*\\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Ple=_((KOt,ble)=>{var aXe=Sle(),Dle={\"{\":\"}\",\"(\":\")\",\"[\":\"]\"},lXe=function(t){if(t[0]===\"!\")return!0;for(var e=0,r=-2,s=-2,a=-2,n=-2,c=-2;e<t.length;){if(t[e]===\"*\"||t[e+1]===\"?\"&&/[\\].+)]/.test(t[e])||s!==-1&&t[e]===\"[\"&&t[e+1]!==\"]\"&&(s<e&&(s=t.indexOf(\"]\",e)),s>e&&(c===-1||c>s||(c=t.indexOf(\"\\\\\",e),c===-1||c>s)))||a!==-1&&t[e]===\"{\"&&t[e+1]!==\"}\"&&(a=t.indexOf(\"}\",e),a>e&&(c=t.indexOf(\"\\\\\",e),c===-1||c>a))||n!==-1&&t[e]===\"(\"&&t[e+1]===\"?\"&&/[:!=]/.test(t[e+2])&&t[e+3]!==\")\"&&(n=t.indexOf(\")\",e),n>e&&(c=t.indexOf(\"\\\\\",e),c===-1||c>n))||r!==-1&&t[e]===\"(\"&&t[e+1]!==\"|\"&&(r<e&&(r=t.indexOf(\"|\",e)),r!==-1&&t[r+1]!==\")\"&&(n=t.indexOf(\")\",r),n>r&&(c=t.indexOf(\"\\\\\",r),c===-1||c>n))))return!0;if(t[e]===\"\\\\\"){var f=t[e+1];e+=2;var p=Dle[f];if(p){var h=t.indexOf(p,e);h!==-1&&(e=h+1)}if(t[e]===\"!\")return!0}else e++}return!1},cXe=function(t){if(t[0]===\"!\")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\\]]/.test(t[e]))return!0;if(t[e]===\"\\\\\"){var r=t[e+1];e+=2;var s=Dle[r];if(s){var a=t.indexOf(s,e);a!==-1&&(e=a+1)}if(t[e]===\"!\")return!0}else e++}return!1};ble.exports=function(e,r){if(typeof e!=\"string\"||e===\"\")return!1;if(aXe(e))return!0;var s=lXe;return r&&r.strict===!1&&(s=cXe),s(e)}});var kle=_((zOt,xle)=>{\"use strict\";var uXe=Ple(),fXe=Ie(\"path\").posix.dirname,AXe=Ie(\"os\").platform()===\"win32\",s3=\"/\",pXe=/\\\\/g,hXe=/[\\{\\[].*[\\}\\]]$/,gXe=/(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/,dXe=/\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;xle.exports=function(e,r){var s=Object.assign({flipBackslashes:!0},r);s.flipBackslashes&&AXe&&e.indexOf(s3)<0&&(e=e.replace(pXe,s3)),hXe.test(e)&&(e+=s3),e+=\"a\";do e=fXe(e);while(uXe(e)||gXe.test(e));return e.replace(dXe,\"$1\")}});var Mle=_(jr=>{\"use strict\";Object.defineProperty(jr,\"__esModule\",{value:!0});jr.removeDuplicateSlashes=jr.matchAny=jr.convertPatternsToRe=jr.makeRe=jr.getPatternParts=jr.expandBraceExpansion=jr.expandPatternsWithBraceExpansion=jr.isAffectDepthOfReadingPattern=jr.endsWithSlashGlobStar=jr.hasGlobStar=jr.getBaseDirectory=jr.isPatternRelatedToParentDirectory=jr.getPatternsOutsideCurrentDirectory=jr.getPatternsInsideCurrentDirectory=jr.getPositivePatterns=jr.getNegativePatterns=jr.isPositivePattern=jr.isNegativePattern=jr.convertToNegativePattern=jr.convertToPositivePattern=jr.isDynamicPattern=jr.isStaticPattern=void 0;var mXe=Ie(\"path\"),yXe=kle(),o3=Go(),Qle=\"**\",EXe=\"\\\\\",IXe=/[*?]|^!/,CXe=/\\[[^[]*]/,wXe=/(?:^|[^!*+?@])\\([^(]*\\|[^|]*\\)/,BXe=/[!*+?@]\\([^(]*\\)/,vXe=/,|\\.\\./,SXe=/(?!^)\\/{2,}/g;function Tle(t,e={}){return!Rle(t,e)}jr.isStaticPattern=Tle;function Rle(t,e={}){return t===\"\"?!1:!!(e.caseSensitiveMatch===!1||t.includes(EXe)||IXe.test(t)||CXe.test(t)||wXe.test(t)||e.extglob!==!1&&BXe.test(t)||e.braceExpansion!==!1&&DXe(t))}jr.isDynamicPattern=Rle;function DXe(t){let e=t.indexOf(\"{\");if(e===-1)return!1;let r=t.indexOf(\"}\",e+1);if(r===-1)return!1;let s=t.slice(e,r);return vXe.test(s)}function bXe(t){return nQ(t)?t.slice(1):t}jr.convertToPositivePattern=bXe;function PXe(t){return\"!\"+t}jr.convertToNegativePattern=PXe;function nQ(t){return t.startsWith(\"!\")&&t[1]!==\"(\"}jr.isNegativePattern=nQ;function Fle(t){return!nQ(t)}jr.isPositivePattern=Fle;function xXe(t){return t.filter(nQ)}jr.getNegativePatterns=xXe;function kXe(t){return t.filter(Fle)}jr.getPositivePatterns=kXe;function QXe(t){return t.filter(e=>!a3(e))}jr.getPatternsInsideCurrentDirectory=QXe;function TXe(t){return t.filter(a3)}jr.getPatternsOutsideCurrentDirectory=TXe;function a3(t){return t.startsWith(\"..\")||t.startsWith(\"./..\")}jr.isPatternRelatedToParentDirectory=a3;function RXe(t){return yXe(t,{flipBackslashes:!1})}jr.getBaseDirectory=RXe;function FXe(t){return t.includes(Qle)}jr.hasGlobStar=FXe;function Nle(t){return t.endsWith(\"/\"+Qle)}jr.endsWithSlashGlobStar=Nle;function NXe(t){let e=mXe.basename(t);return Nle(t)||Tle(e)}jr.isAffectDepthOfReadingPattern=NXe;function OXe(t){return t.reduce((e,r)=>e.concat(Ole(r)),[])}jr.expandPatternsWithBraceExpansion=OXe;function Ole(t){let e=o3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,s)=>r.length-s.length),e.filter(r=>r!==\"\")}jr.expandBraceExpansion=Ole;function LXe(t,e){let{parts:r}=o3.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith(\"/\")&&(r[0]=r[0].slice(1),r.unshift(\"\")),r}jr.getPatternParts=LXe;function Lle(t,e){return o3.makeRe(t,e)}jr.makeRe=Lle;function MXe(t,e){return t.map(r=>Lle(r,e))}jr.convertPatternsToRe=MXe;function UXe(t,e){return e.some(r=>r.test(t))}jr.matchAny=UXe;function _Xe(t){return t.replace(SXe,\"/\")}jr.removeDuplicateSlashes=_Xe});var jle=_((ZOt,Hle)=>{\"use strict\";var HXe=Ie(\"stream\"),Ule=HXe.PassThrough,jXe=Array.prototype.slice;Hle.exports=GXe;function GXe(){let t=[],e=jXe.call(arguments),r=!1,s=e[e.length-1];s&&!Array.isArray(s)&&s.pipe==null?e.pop():s={};let a=s.end!==!1,n=s.pipeError===!0;s.objectMode==null&&(s.objectMode=!0),s.highWaterMark==null&&(s.highWaterMark=64*1024);let c=Ule(s);function f(){for(let E=0,C=arguments.length;E<C;E++)t.push(_le(arguments[E],s));return p(),this}function p(){if(r)return;r=!0;let E=t.shift();if(!E){process.nextTick(h);return}Array.isArray(E)||(E=[E]);let C=E.length+1;function S(){--C>0||(r=!1,p())}function P(I){function R(){I.removeListener(\"merge2UnpipeEnd\",R),I.removeListener(\"end\",R),n&&I.removeListener(\"error\",N),S()}function N(U){c.emit(\"error\",U)}if(I._readableState.endEmitted)return S();I.on(\"merge2UnpipeEnd\",R),I.on(\"end\",R),n&&I.on(\"error\",N),I.pipe(c,{end:!1}),I.resume()}for(let I=0;I<E.length;I++)P(E[I]);S()}function h(){r=!1,c.emit(\"queueDrain\"),a&&c.end()}return c.setMaxListeners(0),c.add=f,c.on(\"unpipe\",function(E){E.emit(\"merge2UnpipeEnd\")}),e.length&&f.apply(null,e),c}function _le(t,e){if(Array.isArray(t))for(let r=0,s=t.length;r<s;r++)t[r]=_le(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(Ule(e))),!t._readableState||!t.pause||!t.pipe)throw new Error(\"Only readable stream can be merged.\");t.pause()}return t}});var qle=_(iQ=>{\"use strict\";Object.defineProperty(iQ,\"__esModule\",{value:!0});iQ.merge=void 0;var qXe=jle();function WXe(t){let e=qXe(t);return t.forEach(r=>{r.once(\"error\",s=>e.emit(\"error\",s))}),e.once(\"close\",()=>Gle(t)),e.once(\"end\",()=>Gle(t)),e}iQ.merge=WXe;function Gle(t){t.forEach(e=>e.emit(\"close\"))}});var Wle=_(XE=>{\"use strict\";Object.defineProperty(XE,\"__esModule\",{value:!0});XE.isEmpty=XE.isString=void 0;function YXe(t){return typeof t==\"string\"}XE.isString=YXe;function VXe(t){return t===\"\"}XE.isEmpty=VXe});var xp=_(Yo=>{\"use strict\";Object.defineProperty(Yo,\"__esModule\",{value:!0});Yo.string=Yo.stream=Yo.pattern=Yo.path=Yo.fs=Yo.errno=Yo.array=void 0;var JXe=mle();Yo.array=JXe;var KXe=yle();Yo.errno=KXe;var zXe=Ele();Yo.fs=zXe;var XXe=Ble();Yo.path=XXe;var ZXe=Mle();Yo.pattern=ZXe;var $Xe=qle();Yo.stream=$Xe;var eZe=Wle();Yo.string=eZe});var Kle=_(Vo=>{\"use strict\";Object.defineProperty(Vo,\"__esModule\",{value:!0});Vo.convertPatternGroupToTask=Vo.convertPatternGroupsToTasks=Vo.groupPatternsByBaseDirectory=Vo.getNegativePatternsAsPositive=Vo.getPositivePatterns=Vo.convertPatternsToTasks=Vo.generate=void 0;var Hu=xp();function tZe(t,e){let r=Yle(t,e),s=Yle(e.ignore,e),a=Vle(r),n=Jle(r,s),c=a.filter(E=>Hu.pattern.isStaticPattern(E,e)),f=a.filter(E=>Hu.pattern.isDynamicPattern(E,e)),p=l3(c,n,!1),h=l3(f,n,!0);return p.concat(h)}Vo.generate=tZe;function Yle(t,e){let r=t;return e.braceExpansion&&(r=Hu.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(s=>s.includes(\"/\")?s:`**/${s}`)),r.map(s=>Hu.pattern.removeDuplicateSlashes(s))}function l3(t,e,r){let s=[],a=Hu.pattern.getPatternsOutsideCurrentDirectory(t),n=Hu.pattern.getPatternsInsideCurrentDirectory(t),c=c3(a),f=c3(n);return s.push(...u3(c,e,r)),\".\"in f?s.push(f3(\".\",n,e,r)):s.push(...u3(f,e,r)),s}Vo.convertPatternsToTasks=l3;function Vle(t){return Hu.pattern.getPositivePatterns(t)}Vo.getPositivePatterns=Vle;function Jle(t,e){return Hu.pattern.getNegativePatterns(t).concat(e).map(Hu.pattern.convertToPositivePattern)}Vo.getNegativePatternsAsPositive=Jle;function c3(t){let e={};return t.reduce((r,s)=>{let a=Hu.pattern.getBaseDirectory(s);return a in r?r[a].push(s):r[a]=[s],r},e)}Vo.groupPatternsByBaseDirectory=c3;function u3(t,e,r){return Object.keys(t).map(s=>f3(s,t[s],e,r))}Vo.convertPatternGroupsToTasks=u3;function f3(t,e,r,s){return{dynamic:s,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Hu.pattern.convertToNegativePattern))}}Vo.convertPatternGroupToTask=f3});var Xle=_(sQ=>{\"use strict\";Object.defineProperty(sQ,\"__esModule\",{value:!0});sQ.read=void 0;function rZe(t,e,r){e.fs.lstat(t,(s,a)=>{if(s!==null){zle(r,s);return}if(!a.isSymbolicLink()||!e.followSymbolicLink){A3(r,a);return}e.fs.stat(t,(n,c)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){zle(r,n);return}A3(r,a);return}e.markSymbolicLink&&(c.isSymbolicLink=()=>!0),A3(r,c)})})}sQ.read=rZe;function zle(t,e){t(e)}function A3(t,e){t(null,e)}});var Zle=_(oQ=>{\"use strict\";Object.defineProperty(oQ,\"__esModule\",{value:!0});oQ.read=void 0;function nZe(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let s=e.fs.statSync(t);return e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),s}catch(s){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw s}}oQ.read=nZe});var $le=_(h0=>{\"use strict\";Object.defineProperty(h0,\"__esModule\",{value:!0});h0.createFileSystemAdapter=h0.FILE_SYSTEM_ADAPTER=void 0;var aQ=Ie(\"fs\");h0.FILE_SYSTEM_ADAPTER={lstat:aQ.lstat,stat:aQ.stat,lstatSync:aQ.lstatSync,statSync:aQ.statSync};function iZe(t){return t===void 0?h0.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},h0.FILE_SYSTEM_ADAPTER),t)}h0.createFileSystemAdapter=iZe});var ece=_(h3=>{\"use strict\";Object.defineProperty(h3,\"__esModule\",{value:!0});var sZe=$le(),p3=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=sZe.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};h3.default=p3});var Zd=_(g0=>{\"use strict\";Object.defineProperty(g0,\"__esModule\",{value:!0});g0.statSync=g0.stat=g0.Settings=void 0;var tce=Xle(),oZe=Zle(),g3=ece();g0.Settings=g3.default;function aZe(t,e,r){if(typeof e==\"function\"){tce.read(t,d3(),e);return}tce.read(t,d3(e),r)}g0.stat=aZe;function lZe(t,e){let r=d3(e);return oZe.read(t,r)}g0.statSync=lZe;function d3(t={}){return t instanceof g3.default?t:new g3.default(t)}});var ice=_((lLt,nce)=>{var rce;nce.exports=typeof queueMicrotask==\"function\"?queueMicrotask.bind(typeof window<\"u\"?window:global):t=>(rce||(rce=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var oce=_((cLt,sce)=>{sce.exports=uZe;var cZe=ice();function uZe(t,e){let r,s,a,n=!0;Array.isArray(t)?(r=[],s=t.length):(a=Object.keys(t),r={},s=a.length);function c(p){function h(){e&&e(p,r),e=null}n?cZe(h):h()}function f(p,h,E){r[p]=E,(--s===0||h)&&c(h)}s?a?a.forEach(function(p){t[p](function(h,E){f(p,h,E)})}):t.forEach(function(p,h){p(function(E,C){f(h,E,C)})}):c(null),n=!1}});var m3=_(cQ=>{\"use strict\";Object.defineProperty(cQ,\"__esModule\",{value:!0});cQ.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var lQ=process.versions.node.split(\".\");if(lQ[0]===void 0||lQ[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var ace=Number.parseInt(lQ[0],10),fZe=Number.parseInt(lQ[1],10),lce=10,AZe=10,pZe=ace>lce,hZe=ace===lce&&fZe>=AZe;cQ.IS_SUPPORT_READDIR_WITH_FILE_TYPES=pZe||hZe});var cce=_(uQ=>{\"use strict\";Object.defineProperty(uQ,\"__esModule\",{value:!0});uQ.createDirentFromStats=void 0;var y3=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function gZe(t,e){return new y3(t,e)}uQ.createDirentFromStats=gZe});var E3=_(fQ=>{\"use strict\";Object.defineProperty(fQ,\"__esModule\",{value:!0});fQ.fs=void 0;var dZe=cce();fQ.fs=dZe});var I3=_(AQ=>{\"use strict\";Object.defineProperty(AQ,\"__esModule\",{value:!0});AQ.joinPathSegments=void 0;function mZe(t,e,r){return t.endsWith(r)?t+e:t+r+e}AQ.joinPathSegments=mZe});var gce=_(d0=>{\"use strict\";Object.defineProperty(d0,\"__esModule\",{value:!0});d0.readdir=d0.readdirWithFileTypes=d0.read=void 0;var yZe=Zd(),uce=oce(),EZe=m3(),fce=E3(),Ace=I3();function IZe(t,e,r){if(!e.stats&&EZe.IS_SUPPORT_READDIR_WITH_FILE_TYPES){pce(t,e,r);return}hce(t,e,r)}d0.read=IZe;function pce(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(s,a)=>{if(s!==null){pQ(r,s);return}let n=a.map(f=>({dirent:f,name:f.name,path:Ace.joinPathSegments(t,f.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){C3(r,n);return}let c=n.map(f=>CZe(f,e));uce(c,(f,p)=>{if(f!==null){pQ(r,f);return}C3(r,p)})})}d0.readdirWithFileTypes=pce;function CZe(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(s,a)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){r(s);return}r(null,t);return}t.dirent=fce.fs.createDirentFromStats(t.name,a),r(null,t)})}}function hce(t,e,r){e.fs.readdir(t,(s,a)=>{if(s!==null){pQ(r,s);return}let n=a.map(c=>{let f=Ace.joinPathSegments(t,c,e.pathSegmentSeparator);return p=>{yZe.stat(f,e.fsStatSettings,(h,E)=>{if(h!==null){p(h);return}let C={name:c,path:f,dirent:fce.fs.createDirentFromStats(c,E)};e.stats&&(C.stats=E),p(null,C)})}});uce(n,(c,f)=>{if(c!==null){pQ(r,c);return}C3(r,f)})})}d0.readdir=hce;function pQ(t,e){t(e)}function C3(t,e){t(null,e)}});var Ice=_(m0=>{\"use strict\";Object.defineProperty(m0,\"__esModule\",{value:!0});m0.readdir=m0.readdirWithFileTypes=m0.read=void 0;var wZe=Zd(),BZe=m3(),dce=E3(),mce=I3();function vZe(t,e){return!e.stats&&BZe.IS_SUPPORT_READDIR_WITH_FILE_TYPES?yce(t,e):Ece(t,e)}m0.read=vZe;function yce(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(s=>{let a={dirent:s,name:s.name,path:mce.joinPathSegments(t,s.name,e.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let n=e.fs.statSync(a.path);a.dirent=dce.fs.createDirentFromStats(a.name,n)}catch(n){if(e.throwErrorOnBrokenSymbolicLink)throw n}return a})}m0.readdirWithFileTypes=yce;function Ece(t,e){return e.fs.readdirSync(t).map(s=>{let a=mce.joinPathSegments(t,s,e.pathSegmentSeparator),n=wZe.statSync(a,e.fsStatSettings),c={name:s,path:a,dirent:dce.fs.createDirentFromStats(s,n)};return e.stats&&(c.stats=n),c})}m0.readdir=Ece});var Cce=_(y0=>{\"use strict\";Object.defineProperty(y0,\"__esModule\",{value:!0});y0.createFileSystemAdapter=y0.FILE_SYSTEM_ADAPTER=void 0;var ZE=Ie(\"fs\");y0.FILE_SYSTEM_ADAPTER={lstat:ZE.lstat,stat:ZE.stat,lstatSync:ZE.lstatSync,statSync:ZE.statSync,readdir:ZE.readdir,readdirSync:ZE.readdirSync};function SZe(t){return t===void 0?y0.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},y0.FILE_SYSTEM_ADAPTER),t)}y0.createFileSystemAdapter=SZe});var wce=_(B3=>{\"use strict\";Object.defineProperty(B3,\"__esModule\",{value:!0});var DZe=Ie(\"path\"),bZe=Zd(),PZe=Cce(),w3=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=PZe.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,DZe.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new bZe.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};B3.default=w3});var hQ=_(E0=>{\"use strict\";Object.defineProperty(E0,\"__esModule\",{value:!0});E0.Settings=E0.scandirSync=E0.scandir=void 0;var Bce=gce(),xZe=Ice(),v3=wce();E0.Settings=v3.default;function kZe(t,e,r){if(typeof e==\"function\"){Bce.read(t,S3(),e);return}Bce.read(t,S3(e),r)}E0.scandir=kZe;function QZe(t,e){let r=S3(e);return xZe.read(t,r)}E0.scandirSync=QZe;function S3(t={}){return t instanceof v3.default?t:new v3.default(t)}});var Sce=_((ELt,vce)=>{\"use strict\";function TZe(t){var e=new t,r=e;function s(){var n=e;return n.next?e=n.next:(e=new t,r=e),n.next=null,n}function a(n){r.next=n,r=n}return{get:s,release:a}}vce.exports=TZe});var bce=_((ILt,D3)=>{\"use strict\";var RZe=Sce();function Dce(t,e,r){if(typeof t==\"function\"&&(r=e,e=t,t=null),!(r>=1))throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");var s=RZe(FZe),a=null,n=null,c=0,f=null,p={push:R,drain:kc,saturated:kc,pause:E,paused:!1,get concurrency(){return r},set concurrency(ue){if(!(ue>=1))throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");if(r=ue,!p.paused)for(;a&&c<r;)c++,U()},running:h,resume:P,idle:I,length:C,getQueue:S,unshift:N,empty:kc,kill:W,killAndDrain:ee,error:ie};return p;function h(){return c}function E(){p.paused=!0}function C(){for(var ue=a,le=0;ue;)ue=ue.next,le++;return le}function S(){for(var ue=a,le=[];ue;)le.push(ue.value),ue=ue.next;return le}function P(){if(p.paused){if(p.paused=!1,a===null){c++,U();return}for(;a&&c<r;)c++,U()}}function I(){return c===0&&p.length()===0}function R(ue,le){var me=s.get();me.context=t,me.release=U,me.value=ue,me.callback=le||kc,me.errorHandler=f,c>=r||p.paused?n?(n.next=me,n=me):(a=me,n=me,p.saturated()):(c++,e.call(t,me.value,me.worked))}function N(ue,le){var me=s.get();me.context=t,me.release=U,me.value=ue,me.callback=le||kc,me.errorHandler=f,c>=r||p.paused?a?(me.next=a,a=me):(a=me,n=me,p.saturated()):(c++,e.call(t,me.value,me.worked))}function U(ue){ue&&s.release(ue);var le=a;le&&c<=r?p.paused?c--:(n===a&&(n=null),a=le.next,le.next=null,e.call(t,le.value,le.worked),n===null&&p.empty()):--c===0&&p.drain()}function W(){a=null,n=null,p.drain=kc}function ee(){a=null,n=null,p.drain(),p.drain=kc}function ie(ue){f=ue}}function kc(){}function FZe(){this.value=null,this.callback=kc,this.next=null,this.release=kc,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,s){var a=t.callback,n=t.errorHandler,c=t.value;t.value=null,t.callback=kc,t.errorHandler&&n(r,c),a.call(t.context,r,s),t.release(t)}}function NZe(t,e,r){typeof t==\"function\"&&(r=e,e=t,t=null);function s(E,C){e.call(this,E).then(function(S){C(null,S)},C)}var a=Dce(t,s,r),n=a.push,c=a.unshift;return a.push=f,a.unshift=p,a.drained=h,a;function f(E){var C=new Promise(function(S,P){n(E,function(I,R){if(I){P(I);return}S(R)})});return C.catch(kc),C}function p(E){var C=new Promise(function(S,P){c(E,function(I,R){if(I){P(I);return}S(R)})});return C.catch(kc),C}function h(){if(a.idle())return new Promise(function(S){S()});var E=a.drain,C=new Promise(function(S){a.drain=function(){E(),S()}});return C}}D3.exports=Dce;D3.exports.promise=NZe});var gQ=_(zf=>{\"use strict\";Object.defineProperty(zf,\"__esModule\",{value:!0});zf.joinPathSegments=zf.replacePathSegmentSeparator=zf.isAppliedFilter=zf.isFatalError=void 0;function OZe(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}zf.isFatalError=OZe;function LZe(t,e){return t===null||t(e)}zf.isAppliedFilter=LZe;function MZe(t,e){return t.split(/[/\\\\]/).join(e)}zf.replacePathSegmentSeparator=MZe;function UZe(t,e,r){return t===\"\"?e:t.endsWith(r)?t+e:t+r+e}zf.joinPathSegments=UZe});var x3=_(P3=>{\"use strict\";Object.defineProperty(P3,\"__esModule\",{value:!0});var _Ze=gQ(),b3=class{constructor(e,r){this._root=e,this._settings=r,this._root=_Ze.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};P3.default=b3});var T3=_(Q3=>{\"use strict\";Object.defineProperty(Q3,\"__esModule\",{value:!0});var HZe=Ie(\"events\"),jZe=hQ(),GZe=bce(),dQ=gQ(),qZe=x3(),k3=class extends qZe.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=jZe.scandir,this._emitter=new HZe.EventEmitter,this._queue=GZe(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(\"end\")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error(\"The reader is already destroyed\");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(\"entry\",e)}onError(e){this._emitter.once(\"error\",e)}onEnd(e){this._emitter.once(\"end\",e)}_pushToQueue(e,r){let s={directory:e,base:r};this._queue.push(s,a=>{a!==null&&this._handleError(a)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(s,a)=>{if(s!==null){r(s,void 0);return}for(let n of a)this._handleEntry(n,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!dQ.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(\"error\",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let s=e.path;r!==void 0&&(e.path=dQ.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),dQ.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&dQ.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(s,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(\"entry\",e)}};Q3.default=k3});var Pce=_(F3=>{\"use strict\";Object.defineProperty(F3,\"__esModule\",{value:!0});var WZe=T3(),R3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new WZe.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{YZe(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{VZe(e,this._storage)}),this._reader.read()}};F3.default=R3;function YZe(t,e){t(e)}function VZe(t,e){t(null,e)}});var xce=_(O3=>{\"use strict\";Object.defineProperty(O3,\"__esModule\",{value:!0});var JZe=Ie(\"stream\"),KZe=T3(),N3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new KZe.default(this._root,this._settings),this._stream=new JZe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(\"error\",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};O3.default=N3});var kce=_(M3=>{\"use strict\";Object.defineProperty(M3,\"__esModule\",{value:!0});var zZe=hQ(),mQ=gQ(),XZe=x3(),L3=class extends XZe.default{constructor(){super(...arguments),this._scandir=zZe.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let s=this._scandir(e,this._settings.fsScandirSettings);for(let a of s)this._handleEntry(a,r)}catch(s){this._handleError(s)}}_handleError(e){if(mQ.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let s=e.path;r!==void 0&&(e.path=mQ.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),mQ.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&mQ.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(s,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};M3.default=L3});var Qce=_(_3=>{\"use strict\";Object.defineProperty(_3,\"__esModule\",{value:!0});var ZZe=kce(),U3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new ZZe.default(this._root,this._settings)}read(){return this._reader.read()}};_3.default=U3});var Tce=_(j3=>{\"use strict\";Object.defineProperty(j3,\"__esModule\",{value:!0});var $Ze=Ie(\"path\"),e$e=hQ(),H3=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,$Ze.sep),this.fsScandirSettings=new e$e.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};j3.default=H3});var EQ=_(Xf=>{\"use strict\";Object.defineProperty(Xf,\"__esModule\",{value:!0});Xf.Settings=Xf.walkStream=Xf.walkSync=Xf.walk=void 0;var Rce=Pce(),t$e=xce(),r$e=Qce(),G3=Tce();Xf.Settings=G3.default;function n$e(t,e,r){if(typeof e==\"function\"){new Rce.default(t,yQ()).read(e);return}new Rce.default(t,yQ(e)).read(r)}Xf.walk=n$e;function i$e(t,e){let r=yQ(e);return new r$e.default(t,r).read()}Xf.walkSync=i$e;function s$e(t,e){let r=yQ(e);return new t$e.default(t,r).read()}Xf.walkStream=s$e;function yQ(t={}){return t instanceof G3.default?t:new G3.default(t)}});var IQ=_(W3=>{\"use strict\";Object.defineProperty(W3,\"__esModule\",{value:!0});var o$e=Ie(\"path\"),a$e=Zd(),Fce=xp(),q3=class{constructor(e){this._settings=e,this._fsStatSettings=new a$e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return o$e.resolve(this._settings.cwd,e)}_makeEntry(e,r){let s={name:r,path:r,dirent:Fce.fs.createDirentFromStats(r,e)};return this._settings.stats&&(s.stats=e),s}_isFatalError(e){return!Fce.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};W3.default=q3});var J3=_(V3=>{\"use strict\";Object.defineProperty(V3,\"__esModule\",{value:!0});var l$e=Ie(\"stream\"),c$e=Zd(),u$e=EQ(),f$e=IQ(),Y3=class extends f$e.default{constructor(){super(...arguments),this._walkStream=u$e.walkStream,this._stat=c$e.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let s=e.map(this._getFullEntryPath,this),a=new l$e.PassThrough({objectMode:!0});a._write=(n,c,f)=>this._getEntry(s[n],e[n],r).then(p=>{p!==null&&r.entryFilter(p)&&a.push(p),n===s.length-1&&a.end(),f()}).catch(f);for(let n=0;n<s.length;n++)a.write(n);return a}_getEntry(e,r,s){return this._getStat(e).then(a=>this._makeEntry(a,r)).catch(a=>{if(s.errorFilter(a))return null;throw a})}_getStat(e){return new Promise((r,s)=>{this._stat(e,this._fsStatSettings,(a,n)=>a===null?r(n):s(a))})}};V3.default=Y3});var Nce=_(z3=>{\"use strict\";Object.defineProperty(z3,\"__esModule\",{value:!0});var A$e=EQ(),p$e=IQ(),h$e=J3(),K3=class extends p$e.default{constructor(){super(...arguments),this._walkAsync=A$e.walk,this._readerStream=new h$e.default(this._settings)}dynamic(e,r){return new Promise((s,a)=>{this._walkAsync(e,r,(n,c)=>{n===null?s(c):a(n)})})}async static(e,r){let s=[],a=this._readerStream.static(e,r);return new Promise((n,c)=>{a.once(\"error\",c),a.on(\"data\",f=>s.push(f)),a.once(\"end\",()=>n(s))})}};z3.default=K3});var Oce=_(Z3=>{\"use strict\";Object.defineProperty(Z3,\"__esModule\",{value:!0});var NB=xp(),X3=class{constructor(e,r,s){this._patterns=e,this._settings=r,this._micromatchOptions=s,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),s=this._splitSegmentsIntoSections(r);this._storage.push({complete:s.length<=1,pattern:e,segments:r,sections:s})}}_getPatternSegments(e){return NB.pattern.getPatternParts(e,this._micromatchOptions).map(s=>NB.pattern.isDynamicPattern(s,this._settings)?{dynamic:!0,pattern:s,patternRe:NB.pattern.makeRe(s,this._micromatchOptions)}:{dynamic:!1,pattern:s})}_splitSegmentsIntoSections(e){return NB.array.splitWhen(e,r=>r.dynamic&&NB.pattern.hasGlobStar(r.pattern))}};Z3.default=X3});var Lce=_(e8=>{\"use strict\";Object.defineProperty(e8,\"__esModule\",{value:!0});var g$e=Oce(),$3=class extends g$e.default{match(e){let r=e.split(\"/\"),s=r.length,a=this._storage.filter(n=>!n.complete||n.segments.length>s);for(let n of a){let c=n.sections[0];if(!n.complete&&s>c.length||r.every((p,h)=>{let E=n.segments[h];return!!(E.dynamic&&E.patternRe.test(p)||!E.dynamic&&E.pattern===p)}))return!0}return!1}};e8.default=$3});var Mce=_(r8=>{\"use strict\";Object.defineProperty(r8,\"__esModule\",{value:!0});var CQ=xp(),d$e=Lce(),t8=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,s){let a=this._getMatcher(r),n=this._getNegativePatternsRe(s);return c=>this._filter(e,c,a,n)}_getMatcher(e){return new d$e.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(CQ.pattern.isAffectDepthOfReadingPattern);return CQ.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,s,a){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let n=CQ.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(n,s)?!1:this._isSkippedByNegativePatterns(n,a)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let s=r.split(\"/\").length;if(e===\"\")return s;let a=e.split(\"/\").length;return s-a}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!CQ.pattern.matchAny(e,r)}};r8.default=t8});var Uce=_(i8=>{\"use strict\";Object.defineProperty(i8,\"__esModule\",{value:!0});var $d=xp(),n8=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let s=$d.pattern.convertPatternsToRe(e,this._micromatchOptions),a=$d.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}));return n=>this._filter(n,s,a)}_filter(e,r,s){let a=$d.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(a)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(a,s))return!1;let n=e.dirent.isDirectory(),c=this._isMatchToPatterns(a,r,n)&&!this._isMatchToPatterns(a,s,n);return this._settings.unique&&c&&this._createIndexRecord(a),c}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;let s=$d.path.makeAbsolute(this._settings.cwd,e);return $d.pattern.matchAny(s,r)}_isMatchToPatterns(e,r,s){let a=$d.pattern.matchAny(e,r);return!a&&s?$d.pattern.matchAny(e+\"/\",r):a}};i8.default=n8});var _ce=_(o8=>{\"use strict\";Object.defineProperty(o8,\"__esModule\",{value:!0});var m$e=xp(),s8=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return m$e.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};o8.default=s8});var jce=_(l8=>{\"use strict\";Object.defineProperty(l8,\"__esModule\",{value:!0});var Hce=xp(),a8=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Hce.path.makeAbsolute(this._settings.cwd,r),r=Hce.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+=\"/\"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};l8.default=a8});var wQ=_(u8=>{\"use strict\";Object.defineProperty(u8,\"__esModule\",{value:!0});var y$e=Ie(\"path\"),E$e=Mce(),I$e=Uce(),C$e=_ce(),w$e=jce(),c8=class{constructor(e){this._settings=e,this.errorFilter=new C$e.default(this._settings),this.entryFilter=new I$e.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new E$e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new w$e.default(this._settings)}_getRootDirectory(e){return y$e.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base===\".\"?\"\":e.base;return{basePath:r,pathSegmentSeparator:\"/\",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};u8.default=c8});var Gce=_(A8=>{\"use strict\";Object.defineProperty(A8,\"__esModule\",{value:!0});var B$e=Nce(),v$e=wQ(),f8=class extends v$e.default{constructor(){super(...arguments),this._reader=new B$e.default(this._settings)}async read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e);return(await this.api(r,e,s)).map(n=>s.transform(n))}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};A8.default=f8});var qce=_(h8=>{\"use strict\";Object.defineProperty(h8,\"__esModule\",{value:!0});var S$e=Ie(\"stream\"),D$e=J3(),b$e=wQ(),p8=class extends b$e.default{constructor(){super(...arguments),this._reader=new D$e.default(this._settings)}read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e),a=this.api(r,e,s),n=new S$e.Readable({objectMode:!0,read:()=>{}});return a.once(\"error\",c=>n.emit(\"error\",c)).on(\"data\",c=>n.emit(\"data\",s.transform(c))).once(\"end\",()=>n.emit(\"end\")),n.once(\"close\",()=>a.destroy()),n}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};h8.default=p8});var Wce=_(d8=>{\"use strict\";Object.defineProperty(d8,\"__esModule\",{value:!0});var P$e=Zd(),x$e=EQ(),k$e=IQ(),g8=class extends k$e.default{constructor(){super(...arguments),this._walkSync=x$e.walkSync,this._statSync=P$e.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let s=[];for(let a of e){let n=this._getFullEntryPath(a),c=this._getEntry(n,a,r);c===null||!r.entryFilter(c)||s.push(c)}return s}_getEntry(e,r,s){try{let a=this._getStat(e);return this._makeEntry(a,r)}catch(a){if(s.errorFilter(a))return null;throw a}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};d8.default=g8});var Yce=_(y8=>{\"use strict\";Object.defineProperty(y8,\"__esModule\",{value:!0});var Q$e=Wce(),T$e=wQ(),m8=class extends T$e.default{constructor(){super(...arguments),this._reader=new Q$e.default(this._settings)}read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e);return this.api(r,e,s).map(s.transform)}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};y8.default=m8});var Vce=_(eI=>{\"use strict\";Object.defineProperty(eI,\"__esModule\",{value:!0});eI.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var $E=Ie(\"fs\"),R$e=Ie(\"os\"),F$e=Math.max(R$e.cpus().length,1);eI.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:$E.lstat,lstatSync:$E.lstatSync,stat:$E.stat,statSync:$E.statSync,readdir:$E.readdir,readdirSync:$E.readdirSync};var E8=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,F$e),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},eI.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};eI.default=E8});var BQ=_((WLt,Kce)=>{\"use strict\";var Jce=Kle(),N$e=Gce(),O$e=qce(),L$e=Yce(),I8=Vce(),Qc=xp();async function C8(t,e){ju(t);let r=w8(t,N$e.default,e),s=await Promise.all(r);return Qc.array.flatten(s)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(h,E){ju(h);let C=w8(h,L$e.default,E);return Qc.array.flatten(C)}t.sync=e;function r(h,E){ju(h);let C=w8(h,O$e.default,E);return Qc.stream.merge(C)}t.stream=r;function s(h,E){ju(h);let C=[].concat(h),S=new I8.default(E);return Jce.generate(C,S)}t.generateTasks=s;function a(h,E){ju(h);let C=new I8.default(E);return Qc.pattern.isDynamicPattern(h,C)}t.isDynamicPattern=a;function n(h){return ju(h),Qc.path.escape(h)}t.escapePath=n;function c(h){return ju(h),Qc.path.convertPathToPattern(h)}t.convertPathToPattern=c;let f;(function(h){function E(S){return ju(S),Qc.path.escapePosixPath(S)}h.escapePath=E;function C(S){return ju(S),Qc.path.convertPosixPathToPattern(S)}h.convertPathToPattern=C})(f=t.posix||(t.posix={}));let p;(function(h){function E(S){return ju(S),Qc.path.escapeWindowsPath(S)}h.escapePath=E;function C(S){return ju(S),Qc.path.convertWindowsPathToPattern(S)}h.convertPathToPattern=C})(p=t.win32||(t.win32={}))})(C8||(C8={}));function w8(t,e,r){let s=[].concat(t),a=new I8.default(r),n=Jce.generate(s,a),c=new e(a);return n.map(c.read,c)}function ju(t){if(![].concat(t).every(s=>Qc.string.isString(s)&&!Qc.string.isEmpty(s)))throw new TypeError(\"Patterns must be a string (non empty) or an array of strings\")}Kce.exports=C8});var Nn={};Vt(Nn,{checksumFile:()=>SQ,checksumPattern:()=>DQ,makeHash:()=>us});function us(...t){let e=(0,vQ.createHash)(\"sha512\"),r=\"\";for(let s of t)typeof s==\"string\"?r+=s:s&&(r&&(e.update(r),r=\"\"),e.update(s));return r&&e.update(r),e.digest(\"hex\")}async function SQ(t,{baseFs:e,algorithm:r}={baseFs:ce,algorithm:\"sha512\"}){let s=await e.openPromise(t,\"r\");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,vQ.createHash)(r),f=0;for(;(f=await e.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest(\"hex\")}finally{await e.closePromise(s)}}async function DQ(t,{cwd:e}){let s=(await(0,B8.default)(t,{cwd:fe.fromPortablePath(e),onlyDirectories:!0})).map(f=>`${f}/**/*`),a=await(0,B8.default)([t,...s],{cwd:fe.fromPortablePath(e),onlyFiles:!1});a.sort();let n=await Promise.all(a.map(async f=>{let p=[Buffer.from(f)],h=J.join(e,fe.toPortablePath(f)),E=await ce.lstatPromise(h);return E.isSymbolicLink()?p.push(Buffer.from(await ce.readlinkPromise(h))):E.isFile()&&p.push(await ce.readFilePromise(h)),p.join(\"\\0\")})),c=(0,vQ.createHash)(\"sha512\");for(let f of n)c.update(f);return c.digest(\"hex\")}var vQ,B8,I0=Xe(()=>{Dt();vQ=Ie(\"crypto\"),B8=ut(BQ())});var G={};Vt(G,{allPeerRequests:()=>qB,areDescriptorsEqual:()=>eue,areIdentsEqual:()=>UB,areLocatorsEqual:()=>_B,areVirtualPackagesEquivalent:()=>Y$e,bindDescriptor:()=>q$e,bindLocator:()=>W$e,convertDescriptorToLocator:()=>bQ,convertLocatorToDescriptor:()=>S8,convertPackageToLocator:()=>H$e,convertToIdent:()=>_$e,convertToManifestRange:()=>ret,copyPackage:()=>LB,devirtualizeDescriptor:()=>MB,devirtualizeLocator:()=>rI,ensureDevirtualizedDescriptor:()=>j$e,ensureDevirtualizedLocator:()=>G$e,getIdentVendorPath:()=>x8,isPackageCompatible:()=>TQ,isVirtualDescriptor:()=>kp,isVirtualLocator:()=>Gu,makeDescriptor:()=>On,makeIdent:()=>Da,makeLocator:()=>Ws,makeRange:()=>kQ,parseDescriptor:()=>C0,parseFileStyleRange:()=>eet,parseIdent:()=>Sa,parseLocator:()=>Qp,parseRange:()=>em,prettyDependent:()=>t3,prettyDescriptor:()=>ni,prettyIdent:()=>$i,prettyLocator:()=>Yr,prettyLocatorNoColors:()=>e3,prettyRange:()=>iI,prettyReference:()=>jB,prettyResolution:()=>FB,prettyWorkspace:()=>GB,renamePackage:()=>D8,slugifyIdent:()=>v8,slugifyLocator:()=>nI,sortDescriptors:()=>sI,stringifyDescriptor:()=>al,stringifyIdent:()=>un,stringifyLocator:()=>ll,tryParseDescriptor:()=>HB,tryParseIdent:()=>tue,tryParseLocator:()=>xQ,tryParseRange:()=>$$e,unwrapIdentFromScope:()=>iet,virtualizeDescriptor:()=>b8,virtualizePackage:()=>P8,wrapIdentIntoScope:()=>net});function Da(t,e){if(t?.startsWith(\"@\"))throw new Error(\"Invalid scope: don't prefix it with '@'\");return{identHash:us(t,e),scope:t,name:e}}function On(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:us(t.identHash,e),range:e}}function Ws(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:us(t.identHash,e),reference:e}}function _$e(t){return{identHash:t.identHash,scope:t.scope,name:t.name}}function bQ(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.descriptorHash,reference:t.range}}function S8(t){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:t.locatorHash,range:t.reference}}function H$e(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.locatorHash,reference:t.reference}}function D8(t,e){return{identHash:e.identHash,scope:e.scope,name:e.name,locatorHash:e.locatorHash,reference:e.reference,version:t.version,languageName:t.languageName,linkType:t.linkType,conditions:t.conditions,dependencies:new Map(t.dependencies),peerDependencies:new Map(t.peerDependencies),dependenciesMeta:new Map(t.dependenciesMeta),peerDependenciesMeta:new Map(t.peerDependenciesMeta),bin:new Map(t.bin)}}function LB(t){return D8(t,t)}function b8(t,e){if(e.includes(\"#\"))throw new Error(\"Invalid entropy\");return On(t,`virtual:${e}#${t.range}`)}function P8(t,e){if(e.includes(\"#\"))throw new Error(\"Invalid entropy\");return D8(t,Ws(t,`virtual:${e}#${t.reference}`))}function kp(t){return t.range.startsWith(OB)}function Gu(t){return t.reference.startsWith(OB)}function MB(t){if(!kp(t))throw new Error(\"Not a virtual descriptor\");return On(t,t.range.replace(PQ,\"\"))}function rI(t){if(!Gu(t))throw new Error(\"Not a virtual descriptor\");return Ws(t,t.reference.replace(PQ,\"\"))}function j$e(t){return kp(t)?On(t,t.range.replace(PQ,\"\")):t}function G$e(t){return Gu(t)?Ws(t,t.reference.replace(PQ,\"\")):t}function q$e(t,e){return t.range.includes(\"::\")?t:On(t,`${t.range}::${tI.default.stringify(e)}`)}function W$e(t,e){return t.reference.includes(\"::\")?t:Ws(t,`${t.reference}::${tI.default.stringify(e)}`)}function UB(t,e){return t.identHash===e.identHash}function eue(t,e){return t.descriptorHash===e.descriptorHash}function _B(t,e){return t.locatorHash===e.locatorHash}function Y$e(t,e){if(!Gu(t))throw new Error(\"Invalid package type\");if(!Gu(e))throw new Error(\"Invalid package type\");if(!UB(t,e)||t.dependencies.size!==e.dependencies.size)return!1;for(let r of t.dependencies.values()){let s=e.dependencies.get(r.identHash);if(!s||!eue(r,s))return!1}return!0}function Sa(t){let e=tue(t);if(!e)throw new Error(`Invalid ident (${t})`);return e}function tue(t){let e=t.match(V$e);if(!e)return null;let[,r,s]=e;return Da(typeof r<\"u\"?r:null,s)}function C0(t,e=!1){let r=HB(t,e);if(!r)throw new Error(`Invalid descriptor (${t})`);return r}function HB(t,e=!1){let r=e?t.match(J$e):t.match(K$e);if(!r)return null;let[,s,a,n]=r;if(n===\"unknown\")throw new Error(`Invalid range (${t})`);let c=typeof s<\"u\"?s:null,f=typeof n<\"u\"?n:\"unknown\";return On(Da(c,a),f)}function Qp(t,e=!1){let r=xQ(t,e);if(!r)throw new Error(`Invalid locator (${t})`);return r}function xQ(t,e=!1){let r=e?t.match(z$e):t.match(X$e);if(!r)return null;let[,s,a,n]=r;if(n===\"unknown\")throw new Error(`Invalid reference (${t})`);let c=typeof s<\"u\"?s:null,f=typeof n<\"u\"?n:\"unknown\";return Ws(Da(c,a),f)}function em(t,e){let r=t.match(Z$e);if(r===null)throw new Error(`Invalid range (${t})`);let s=typeof r[1]<\"u\"?r[1]:null;if(typeof e?.requireProtocol==\"string\"&&s!==e.requireProtocol)throw new Error(`Invalid protocol (${s})`);if(e?.requireProtocol&&s===null)throw new Error(`Missing protocol (${s})`);let a=typeof r[3]<\"u\"?decodeURIComponent(r[2]):null;if(e?.requireSource&&a===null)throw new Error(`Missing source (${t})`);let n=typeof r[3]<\"u\"?decodeURIComponent(r[3]):decodeURIComponent(r[2]),c=e?.parseSelector?tI.default.parse(n):n,f=typeof r[4]<\"u\"?tI.default.parse(r[4]):null;return{protocol:s,source:a,selector:c,params:f}}function $$e(t,e){try{return em(t,e)}catch{return null}}function eet(t,{protocol:e}){let{selector:r,params:s}=em(t,{requireProtocol:e,requireBindings:!0});if(typeof s.locator!=\"string\")throw new Error(`Assertion failed: Invalid bindings for ${t}`);return{parentLocator:Qp(s.locator,!0),path:r}}function zce(t){return t=t.replaceAll(\"%\",\"%25\"),t=t.replaceAll(\":\",\"%3A\"),t=t.replaceAll(\"#\",\"%23\"),t}function tet(t){return t===null?!1:Object.entries(t).length>0}function kQ({protocol:t,source:e,selector:r,params:s}){let a=\"\";return t!==null&&(a+=`${t}`),e!==null&&(a+=`${zce(e)}#`),a+=zce(r),tet(s)&&(a+=`::${tI.default.stringify(s)}`),a}function ret(t){let{params:e,protocol:r,source:s,selector:a}=em(t);for(let n in e)n.startsWith(\"__\")&&delete e[n];return kQ({protocol:r,source:s,params:e,selector:a})}function un(t){return t.scope?`@${t.scope}/${t.name}`:`${t.name}`}function net(t,e){return t.scope?Da(e,`${t.scope}__${t.name}`):Da(e,t.name)}function iet(t,e){if(t.scope!==e)return t;let r=t.name.indexOf(\"__\");if(r===-1)return Da(null,t.name);let s=t.name.slice(0,r),a=t.name.slice(r+2);return Da(s,a)}function al(t){return t.scope?`@${t.scope}/${t.name}@${t.range}`:`${t.name}@${t.range}`}function ll(t){return t.scope?`@${t.scope}/${t.name}@${t.reference}`:`${t.name}@${t.reference}`}function v8(t){return t.scope!==null?`@${t.scope}-${t.name}`:t.name}function nI(t){let{protocol:e,selector:r}=em(t.reference),s=e!==null?e.replace(set,\"\"):\"exotic\",a=Xce.default.valid(r),n=a!==null?`${s}-${a}`:`${s}`,c=10;return t.scope?`${v8(t)}-${n}-${t.locatorHash.slice(0,c)}`:`${v8(t)}-${n}-${t.locatorHash.slice(0,c)}`}function $i(t,e){return e.scope?`${Ht(t,`@${e.scope}/`,ht.SCOPE)}${Ht(t,e.name,ht.NAME)}`:`${Ht(t,e.name,ht.NAME)}`}function QQ(t){if(t.startsWith(OB)){let e=QQ(t.substring(t.indexOf(\"#\")+1)),r=t.substring(OB.length,OB.length+M$e);return`${e} [${r}]`}else return t.replace(oet,\"?[...]\")}function iI(t,e){return`${Ht(t,QQ(e),ht.RANGE)}`}function ni(t,e){return`${$i(t,e)}${Ht(t,\"@\",ht.RANGE)}${iI(t,e.range)}`}function jB(t,e){return`${Ht(t,QQ(e),ht.REFERENCE)}`}function Yr(t,e){return`${$i(t,e)}${Ht(t,\"@\",ht.REFERENCE)}${jB(t,e.reference)}`}function e3(t){return`${un(t)}@${QQ(t.reference)}`}function sI(t){return qs(t,[e=>un(e),e=>e.range])}function GB(t,e){return $i(t,e.anchoredLocator)}function FB(t,e,r){let s=kp(e)?MB(e):e;return r===null?`${ni(t,s)} \\u2192 ${$4(t).Cross}`:s.identHash===r.identHash?`${ni(t,s)} \\u2192 ${jB(t,r.reference)}`:`${ni(t,s)} \\u2192 ${Yr(t,r)}`}function t3(t,e,r){return r===null?`${Yr(t,e)}`:`${Yr(t,e)} (via ${iI(t,r.range)})`}function x8(t){return`node_modules/${un(t)}`}function TQ(t,e){return t.conditions?U$e(t.conditions,r=>{let[,s,a]=r.match($ce),n=e[s];return n?n.includes(a):!0}):!0}function qB(t){let e=new Set;if(\"children\"in t)e.add(t);else for(let r of t.requests.values())e.add(r);for(let r of e)for(let s of r.children.values())e.add(s);return e}var tI,Xce,Zce,OB,M$e,$ce,U$e,PQ,V$e,J$e,K$e,z$e,X$e,Z$e,set,oet,Wo=Xe(()=>{tI=ut(Ie(\"querystring\")),Xce=ut(Ai()),Zce=ut(Ise());xc();I0();Pc();Wo();OB=\"virtual:\",M$e=5,$ce=/(os|cpu|libc)=([a-z0-9_-]+)/,U$e=(0,Zce.makeParser)($ce);PQ=/^[^#]*#/;V$e=/^(?:@([^/]+?)\\/)?([^@/]+)$/;J$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))$/,K$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))?$/;z$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))$/,X$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))?$/;Z$e=/^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/;set=/:$/;oet=/\\?.*/});var rue,nue=Xe(()=>{Wo();rue={hooks:{reduceDependency:(t,e,r,s,{resolver:a,resolveOptions:n})=>{for(let{pattern:c,reference:f}of e.topLevelWorkspace.manifest.resolutions){if(c.from&&(c.from.fullName!==un(r)||e.configuration.normalizeLocator(Ws(Sa(c.from.fullName),c.from.description??r.reference)).locatorHash!==r.locatorHash)||c.descriptor.fullName!==un(t)||e.configuration.normalizeDependency(On(Qp(c.descriptor.fullName),c.descriptor.description??t.range)).descriptorHash!==t.descriptorHash)continue;return a.bindDescriptor(e.configuration.normalizeDependency(On(t,f)),e.topLevelWorkspace.anchoredLocator,n)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let s=GB(t.configuration,r);await t.configuration.triggerHook(a=>a.validateWorkspace,r,{reportWarning:(a,n)=>e.reportWarning(a,`${s}: ${n}`),reportError:(a,n)=>e.reportError(a,`${s}: ${n}`)})}},validateWorkspace:async(t,e)=>{let{manifest:r}=t;r.resolutions.length&&t.cwd!==t.project.cwd&&r.errors.push(new Error(\"Resolutions field will be ignored\"));for(let s of r.errors)e.reportWarning(57,s.message)}}}});var Ei,tm=Xe(()=>{Ei=class t{static{this.protocol=\"workspace:\"}supportsDescriptor(e,r){return!!(e.range.startsWith(t.protocol)||r.project.tryWorkspaceByDescriptor(e)!==null)}supportsLocator(e,r){return!!e.reference.startsWith(t.protocol)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){return[s.project.getWorkspaceByDescriptor(e).anchoredLocator]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let s=r.project.getWorkspaceByCwd(e.reference.slice(t.protocol.length));return{...e,version:s.manifest.version||\"0.0.0\",languageName:\"unknown\",linkType:\"SOFT\",conditions:null,dependencies:r.project.configuration.normalizeDependencyMap(new Map([...s.manifest.dependencies,...s.manifest.devDependencies])),peerDependencies:new Map([...s.manifest.peerDependencies]),dependenciesMeta:s.manifest.dependenciesMeta,peerDependenciesMeta:s.manifest.peerDependenciesMeta,bin:s.manifest.bin}}}});var Fr={};Vt(Fr,{SemVer:()=>lue.SemVer,clean:()=>cet,getComparator:()=>oue,mergeComparators:()=>k8,satisfiesWithPrereleases:()=>Zf,simplifyRanges:()=>Q8,stringifyComparator:()=>aue,validRange:()=>cl});function Zf(t,e,r=!1){if(!t)return!1;let s=`${e}${r}`,a=iue.get(s);if(typeof a>\"u\")try{a=new Tp.default.Range(e,{includePrerelease:!0,loose:r})}catch{return!1}finally{iue.set(s,a||null)}else if(a===null)return!1;let n;try{n=new Tp.default.SemVer(t,a)}catch{return!1}return a.test(n)?!0:(n.prerelease&&(n.prerelease=[]),a.set.some(c=>{for(let f of c)f.semver.prerelease&&(f.semver.prerelease=[]);return c.every(f=>f.test(n))}))}function cl(t){if(t.indexOf(\":\")!==-1)return null;let e=sue.get(t);if(typeof e<\"u\")return e;try{e=new Tp.default.Range(t)}catch{e=null}return sue.set(t,e),e}function cet(t){let e=aet.exec(t);return e?e[1]:null}function oue(t){if(t.semver===Tp.default.Comparator.ANY)return{gt:null,lt:null};switch(t.operator){case\"\":return{gt:[\">=\",t.semver],lt:[\"<=\",t.semver]};case\">\":case\">=\":return{gt:[t.operator,t.semver],lt:null};case\"<\":case\"<=\":return{gt:null,lt:[t.operator,t.semver]};default:throw new Error(`Assertion failed: Unexpected comparator operator (${t.operator})`)}}function k8(t){if(t.length===0)return null;let e=null,r=null;for(let s of t){if(s.gt){let a=e!==null?Tp.default.compare(s.gt[1],e[1]):null;(a===null||a>0||a===0&&s.gt[0]===\">\")&&(e=s.gt)}if(s.lt){let a=r!==null?Tp.default.compare(s.lt[1],r[1]):null;(a===null||a<0||a===0&&s.lt[0]===\"<\")&&(r=s.lt)}}if(e&&r){let s=Tp.default.compare(e[1],r[1]);if(s===0&&(e[0]===\">\"||r[0]===\"<\")||s>0)return null}return{gt:e,lt:r}}function aue(t){if(t.gt&&t.lt){if(t.gt[0]===\">=\"&&t.lt[0]===\"<=\"&&t.gt[1].version===t.lt[1].version)return t.gt[1].version;if(t.gt[0]===\">=\"&&t.lt[0]===\"<\"){if(t.lt[1].version===`${t.gt[1].major+1}.0.0-0`)return`^${t.gt[1].version}`;if(t.lt[1].version===`${t.gt[1].major}.${t.gt[1].minor+1}.0-0`)return`~${t.gt[1].version}`}}let e=[];return t.gt&&e.push(t.gt[0]+t.gt[1].version),t.lt&&e.push(t.lt[0]+t.lt[1].version),e.length?e.join(\" \"):\"*\"}function Q8(t){let e=t.map(uet).map(s=>cl(s).set.map(a=>a.map(n=>oue(n)))),r=e.shift().map(s=>k8(s)).filter(s=>s!==null);for(let s of e){let a=[];for(let n of r)for(let c of s){let f=k8([n,...c]);f!==null&&a.push(f)}r=a}return r.length===0?null:r.map(s=>aue(s)).join(\" || \")}function uet(t){let e=t.split(\"||\");if(e.length>1){let r=new Set;for(let s of e)e.some(a=>a!==s&&Tp.default.subset(s,a))||r.add(s);if(r.size<e.length)return[...r].join(\" || \")}return t}var Tp,lue,iue,sue,aet,Rp=Xe(()=>{Tp=ut(Ai()),lue=ut(Ai()),iue=new Map;sue=new Map;aet=/^(?:[\\sv=]*?)((0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\s*)$/});function cue(t){let e=t.match(/^[ \\t]+/m);return e?e[0]:\"  \"}function uue(t){return t.charCodeAt(0)===65279?t.slice(1):t}function ba(t){return t.replace(/\\\\/g,\"/\")}function RQ(t,{yamlCompatibilityMode:e}){return e?Y4(t):typeof t>\"u\"||typeof t==\"boolean\"?t:null}function fue(t,e){let r=e.search(/[^!]/);if(r===-1)return\"invalid\";let s=r%2===0?\"\":\"!\",a=e.slice(r);return`${s}${t}=${a}`}function T8(t,e){return e.length===1?fue(t,e[0]):`(${e.map(r=>fue(t,r)).join(\" | \")})`}var Aue,Ut,oI=Xe(()=>{Dt();wc();Aue=ut(Ai());tm();Pc();Rp();Wo();Ut=class t{constructor(){this.indent=\"  \";this.name=null;this.version=null;this.os=null;this.cpu=null;this.libc=null;this.type=null;this.packageManager=null;this.private=!1;this.license=null;this.main=null;this.module=null;this.browser=null;this.languageName=null;this.bin=new Map;this.scripts=new Map;this.dependencies=new Map;this.devDependencies=new Map;this.peerDependencies=new Map;this.workspaceDefinitions=[];this.dependenciesMeta=new Map;this.peerDependenciesMeta=new Map;this.resolutions=[];this.files=null;this.publishConfig=null;this.installConfig=null;this.preferUnplugged=null;this.raw={};this.errors=[]}static{this.fileName=\"package.json\"}static{this.allDependencies=[\"dependencies\",\"devDependencies\",\"peerDependencies\"]}static{this.hardDependencies=[\"dependencies\",\"devDependencies\"]}static async tryFind(e,{baseFs:r=new Yn}={}){let s=J.join(e,\"package.json\");try{return await t.fromFile(s,{baseFs:r})}catch(a){if(a.code===\"ENOENT\")return null;throw a}}static async find(e,{baseFs:r}={}){let s=await t.tryFind(e,{baseFs:r});if(s===null)throw new Error(\"Manifest not found\");return s}static async fromFile(e,{baseFs:r=new Yn}={}){let s=new t;return await s.loadFile(e,{baseFs:r}),s}static fromText(e){let r=new t;return r.loadFromText(e),r}loadFromText(e){let r;try{r=JSON.parse(uue(e)||\"{}\")}catch(s){throw s.message+=` (when parsing ${e})`,s}this.load(r),this.indent=cue(e)}async loadFile(e,{baseFs:r=new Yn}){let s=await r.readFilePromise(e,\"utf8\"),a;try{a=JSON.parse(uue(s)||\"{}\")}catch(n){throw n.message+=` (when parsing ${e})`,n}this.load(a),this.indent=cue(s)}load(e,{yamlCompatibilityMode:r=!1}={}){if(typeof e!=\"object\"||e===null)throw new Error(`Utterly invalid manifest data (${e})`);this.raw=e;let s=[];if(this.name=null,typeof e.name==\"string\")try{this.name=Sa(e.name)}catch{s.push(new Error(\"Parsing failed for the 'name' field\"))}if(typeof e.version==\"string\"?this.version=e.version:this.version=null,Array.isArray(e.os)){let n=[];this.os=n;for(let c of e.os)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'os' field\")):n.push(c)}else this.os=null;if(Array.isArray(e.cpu)){let n=[];this.cpu=n;for(let c of e.cpu)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'cpu' field\")):n.push(c)}else this.cpu=null;if(Array.isArray(e.libc)){let n=[];this.libc=n;for(let c of e.libc)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'libc' field\")):n.push(c)}else this.libc=null;if(typeof e.type==\"string\"?this.type=e.type:this.type=null,typeof e.packageManager==\"string\"?this.packageManager=e.packageManager:this.packageManager=null,typeof e.private==\"boolean\"?this.private=e.private:this.private=!1,typeof e.license==\"string\"?this.license=e.license:this.license=null,typeof e.languageName==\"string\"?this.languageName=e.languageName:this.languageName=null,typeof e.main==\"string\"?this.main=ba(e.main):this.main=null,typeof e.module==\"string\"?this.module=ba(e.module):this.module=null,e.browser!=null)if(typeof e.browser==\"string\")this.browser=ba(e.browser);else{this.browser=new Map;for(let[n,c]of Object.entries(e.browser))this.browser.set(ba(n),typeof c==\"string\"?ba(c):c)}else this.browser=null;if(this.bin=new Map,typeof e.bin==\"string\")e.bin.trim()===\"\"?s.push(new Error(\"Invalid bin field\")):this.name!==null?this.bin.set(this.name.name,ba(e.bin)):s.push(new Error(\"String bin field, but no attached package name\"));else if(typeof e.bin==\"object\"&&e.bin!==null)for(let[n,c]of Object.entries(e.bin)){if(typeof c!=\"string\"||c.trim()===\"\"){s.push(new Error(`Invalid bin definition for '${n}'`));continue}let f=Sa(n);this.bin.set(f.name,ba(c))}if(this.scripts=new Map,typeof e.scripts==\"object\"&&e.scripts!==null)for(let[n,c]of Object.entries(e.scripts)){if(typeof c!=\"string\"){s.push(new Error(`Invalid script definition for '${n}'`));continue}this.scripts.set(n,c)}if(this.dependencies=new Map,typeof e.dependencies==\"object\"&&e.dependencies!==null)for(let[n,c]of Object.entries(e.dependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.dependencies.set(p.identHash,p)}if(this.devDependencies=new Map,typeof e.devDependencies==\"object\"&&e.devDependencies!==null)for(let[n,c]of Object.entries(e.devDependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.devDependencies.set(p.identHash,p)}if(this.peerDependencies=new Map,typeof e.peerDependencies==\"object\"&&e.peerDependencies!==null)for(let[n,c]of Object.entries(e.peerDependencies)){let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}(typeof c!=\"string\"||!c.startsWith(Ei.protocol)&&!cl(c))&&(s.push(new Error(`Invalid dependency range for '${n}'`)),c=\"*\");let p=On(f,c);this.peerDependencies.set(p.identHash,p)}typeof e.workspaces==\"object\"&&e.workspaces!==null&&e.workspaces.nohoist&&s.push(new Error(\"'nohoist' is deprecated, please use 'installConfig.hoistingLimits' instead\"));let a=Array.isArray(e.workspaces)?e.workspaces:typeof e.workspaces==\"object\"&&e.workspaces!==null&&Array.isArray(e.workspaces.packages)?e.workspaces.packages:[];this.workspaceDefinitions=[];for(let n of a){if(typeof n!=\"string\"){s.push(new Error(`Invalid workspace definition for '${n}'`));continue}this.workspaceDefinitions.push({pattern:n})}if(this.dependenciesMeta=new Map,typeof e.dependenciesMeta==\"object\"&&e.dependenciesMeta!==null)for(let[n,c]of Object.entries(e.dependenciesMeta)){if(typeof c!=\"object\"||c===null){s.push(new Error(`Invalid meta field for '${n}`));continue}let f=C0(n),p=this.ensureDependencyMeta(f),h=RQ(c.built,{yamlCompatibilityMode:r});if(h===null){s.push(new Error(`Invalid built meta field for '${n}'`));continue}let E=RQ(c.optional,{yamlCompatibilityMode:r});if(E===null){s.push(new Error(`Invalid optional meta field for '${n}'`));continue}let C=RQ(c.unplugged,{yamlCompatibilityMode:r});if(C===null){s.push(new Error(`Invalid unplugged meta field for '${n}'`));continue}Object.assign(p,{built:h,optional:E,unplugged:C})}if(this.peerDependenciesMeta=new Map,typeof e.peerDependenciesMeta==\"object\"&&e.peerDependenciesMeta!==null)for(let[n,c]of Object.entries(e.peerDependenciesMeta)){if(typeof c!=\"object\"||c===null){s.push(new Error(`Invalid meta field for '${n}'`));continue}let f=C0(n),p=this.ensurePeerDependencyMeta(f),h=RQ(c.optional,{yamlCompatibilityMode:r});if(h===null){s.push(new Error(`Invalid optional meta field for '${n}'`));continue}Object.assign(p,{optional:h})}if(this.resolutions=[],typeof e.resolutions==\"object\"&&e.resolutions!==null)for(let[n,c]of Object.entries(e.resolutions)){if(typeof c!=\"string\"){s.push(new Error(`Invalid resolution entry for '${n}'`));continue}try{this.resolutions.push({pattern:px(n),reference:c})}catch(f){s.push(f);continue}}if(Array.isArray(e.files)){this.files=new Set;for(let n of e.files){if(typeof n!=\"string\"){s.push(new Error(`Invalid files entry for '${n}'`));continue}this.files.add(n)}}else this.files=null;if(typeof e.publishConfig==\"object\"&&e.publishConfig!==null){if(this.publishConfig={},typeof e.publishConfig.access==\"string\"&&(this.publishConfig.access=e.publishConfig.access),typeof e.publishConfig.main==\"string\"&&(this.publishConfig.main=ba(e.publishConfig.main)),typeof e.publishConfig.module==\"string\"&&(this.publishConfig.module=ba(e.publishConfig.module)),e.publishConfig.browser!=null)if(typeof e.publishConfig.browser==\"string\")this.publishConfig.browser=ba(e.publishConfig.browser);else{this.publishConfig.browser=new Map;for(let[n,c]of Object.entries(e.publishConfig.browser))this.publishConfig.browser.set(ba(n),typeof c==\"string\"?ba(c):c)}if(typeof e.publishConfig.registry==\"string\"&&(this.publishConfig.registry=e.publishConfig.registry),typeof e.publishConfig.provenance==\"boolean\"&&(this.publishConfig.provenance=e.publishConfig.provenance),typeof e.publishConfig.bin==\"string\")this.name!==null?this.publishConfig.bin=new Map([[this.name.name,ba(e.publishConfig.bin)]]):s.push(new Error(\"String bin field, but no attached package name\"));else if(typeof e.publishConfig.bin==\"object\"&&e.publishConfig.bin!==null){this.publishConfig.bin=new Map;for(let[n,c]of Object.entries(e.publishConfig.bin)){if(typeof c!=\"string\"){s.push(new Error(`Invalid bin definition for '${n}'`));continue}this.publishConfig.bin.set(n,ba(c))}}if(Array.isArray(e.publishConfig.executableFiles)){this.publishConfig.executableFiles=new Set;for(let n of e.publishConfig.executableFiles){if(typeof n!=\"string\"){s.push(new Error(\"Invalid executable file definition\"));continue}this.publishConfig.executableFiles.add(ba(n))}}}else this.publishConfig=null;if(typeof e.installConfig==\"object\"&&e.installConfig!==null){this.installConfig={};for(let n of Object.keys(e.installConfig))n===\"hoistingLimits\"?typeof e.installConfig.hoistingLimits==\"string\"?this.installConfig.hoistingLimits=e.installConfig.hoistingLimits:s.push(new Error(\"Invalid hoisting limits definition\")):n==\"selfReferences\"?typeof e.installConfig.selfReferences==\"boolean\"?this.installConfig.selfReferences=e.installConfig.selfReferences:s.push(new Error(\"Invalid selfReferences definition, must be a boolean value\")):s.push(new Error(`Unrecognized installConfig key: ${n}`))}else this.installConfig=null;if(typeof e.optionalDependencies==\"object\"&&e.optionalDependencies!==null)for(let[n,c]of Object.entries(e.optionalDependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.dependencies.set(p.identHash,p);let h=On(f,\"unknown\"),E=this.ensureDependencyMeta(h);Object.assign(E,{optional:!0})}typeof e.preferUnplugged==\"boolean\"?this.preferUnplugged=e.preferUnplugged:this.preferUnplugged=null,this.errors=s}getForScope(e){switch(e){case\"dependencies\":return this.dependencies;case\"devDependencies\":return this.devDependencies;case\"peerDependencies\":return this.peerDependencies;default:throw new Error(`Unsupported value (\"${e}\")`)}}hasConsumerDependency(e){return!!(this.dependencies.has(e.identHash)||this.peerDependencies.has(e.identHash))}hasHardDependency(e){return!!(this.dependencies.has(e.identHash)||this.devDependencies.has(e.identHash))}hasSoftDependency(e){return!!this.peerDependencies.has(e.identHash)}hasDependency(e){return!!(this.hasHardDependency(e)||this.hasSoftDependency(e))}getConditions(){let e=[];return this.os&&this.os.length>0&&e.push(T8(\"os\",this.os)),this.cpu&&this.cpu.length>0&&e.push(T8(\"cpu\",this.cpu)),this.libc&&this.libc.length>0&&e.push(T8(\"libc\",this.libc)),e.length>0?e.join(\" & \"):null}ensureDependencyMeta(e){if(e.range!==\"unknown\"&&!Aue.default.valid(e.range))throw new Error(`Invalid meta field range for '${al(e)}'`);let r=un(e),s=e.range!==\"unknown\"?e.range:null,a=this.dependenciesMeta.get(r);a||this.dependenciesMeta.set(r,a=new Map);let n=a.get(s);return n||a.set(s,n={}),n}ensurePeerDependencyMeta(e){if(e.range!==\"unknown\")throw new Error(`Invalid meta field range for '${al(e)}'`);let r=un(e),s=this.peerDependenciesMeta.get(r);return s||this.peerDependenciesMeta.set(r,s={}),s}setRawField(e,r,{after:s=[]}={}){let a=new Set(s.filter(n=>Object.hasOwn(this.raw,n)));if(a.size===0||Object.hasOwn(this.raw,e))this.raw[e]=r;else{let n=this.raw,c=this.raw={},f=!1;for(let p of Object.keys(n))c[p]=n[p],f||(a.delete(p),a.size===0&&(c[e]=r,f=!0))}}exportTo(e,{compatibilityMode:r=!0}={}){if(Object.assign(e,this.raw),this.name!==null?e.name=un(this.name):delete e.name,this.version!==null?e.version=this.version:delete e.version,this.os!==null?e.os=this.os:delete e.os,this.cpu!==null?e.cpu=this.cpu:delete e.cpu,this.type!==null?e.type=this.type:delete e.type,this.packageManager!==null?e.packageManager=this.packageManager:delete e.packageManager,this.private?e.private=!0:delete e.private,this.license!==null?e.license=this.license:delete e.license,this.languageName!==null?e.languageName=this.languageName:delete e.languageName,this.main!==null?e.main=this.main:delete e.main,this.module!==null?e.module=this.module:delete e.module,this.browser!==null){let n=this.browser;typeof n==\"string\"?e.browser=n:n instanceof Map&&(e.browser=Object.assign({},...Array.from(n.keys()).sort().map(c=>({[c]:n.get(c)}))))}else delete e.browser;this.bin.size===1&&this.name!==null&&this.bin.has(this.name.name)?e.bin=this.bin.get(this.name.name):this.bin.size>0?e.bin=Object.assign({},...Array.from(this.bin.keys()).sort().map(n=>({[n]:this.bin.get(n)}))):delete e.bin,this.workspaceDefinitions.length>0?this.raw.workspaces&&!Array.isArray(this.raw.workspaces)?e.workspaces={...this.raw.workspaces,packages:this.workspaceDefinitions.map(({pattern:n})=>n)}:e.workspaces=this.workspaceDefinitions.map(({pattern:n})=>n):this.raw.workspaces&&!Array.isArray(this.raw.workspaces)&&Object.keys(this.raw.workspaces).length>0?e.workspaces=this.raw.workspaces:delete e.workspaces;let s=[],a=[];for(let n of this.dependencies.values()){let c=this.dependenciesMeta.get(un(n)),f=!1;if(r&&c){let p=c.get(null);p&&p.optional&&(f=!0)}f?a.push(n):s.push(n)}s.length>0?e.dependencies=Object.assign({},...sI(s).map(n=>({[un(n)]:n.range}))):delete e.dependencies,a.length>0?e.optionalDependencies=Object.assign({},...sI(a).map(n=>({[un(n)]:n.range}))):delete e.optionalDependencies,this.devDependencies.size>0?e.devDependencies=Object.assign({},...sI(this.devDependencies.values()).map(n=>({[un(n)]:n.range}))):delete e.devDependencies,this.peerDependencies.size>0?e.peerDependencies=Object.assign({},...sI(this.peerDependencies.values()).map(n=>({[un(n)]:n.range}))):delete e.peerDependencies,e.dependenciesMeta={};for(let[n,c]of qs(this.dependenciesMeta.entries(),([f,p])=>f))for(let[f,p]of qs(c.entries(),([h,E])=>h!==null?`0${h}`:\"1\")){let h=f!==null?al(On(Sa(n),f)):n,E={...p};r&&f===null&&delete E.optional,Object.keys(E).length!==0&&(e.dependenciesMeta[h]=E)}if(Object.keys(e.dependenciesMeta).length===0&&delete e.dependenciesMeta,this.peerDependenciesMeta.size>0?e.peerDependenciesMeta=Object.assign({},...qs(this.peerDependenciesMeta.entries(),([n,c])=>n).map(([n,c])=>({[n]:c}))):delete e.peerDependenciesMeta,this.resolutions.length>0?e.resolutions=Object.assign({},...this.resolutions.map(({pattern:n,reference:c})=>({[hx(n)]:c}))):delete e.resolutions,this.files!==null?e.files=Array.from(this.files):delete e.files,this.preferUnplugged!==null?e.preferUnplugged=this.preferUnplugged:delete e.preferUnplugged,this.scripts!==null&&this.scripts.size>0){e.scripts??={};for(let n of Object.keys(e.scripts))this.scripts.has(n)||delete e.scripts[n];for(let[n,c]of this.scripts.entries())e.scripts[n]=c}else delete e.scripts;return e}}});function Aet(t){return typeof t.reportCode<\"u\"}var pue,hue,fet,jt,Ao,Tc=Xe(()=>{ql();pue=Ie(\"stream\"),hue=Ie(\"string_decoder\"),fet=15,jt=class extends Error{constructor(r,s,a){super(s);this.reportExtra=a;this.reportCode=r}};Ao=class{constructor(){this.cacheHits=new Set;this.cacheMisses=new Set;this.reportedInfos=new Set;this.reportedWarnings=new Set;this.reportedErrors=new Set}getRecommendedLength(){return 180}reportCacheHit(e){this.cacheHits.add(e.locatorHash)}reportCacheMiss(e,r){this.cacheMisses.add(e.locatorHash)}static progressViaCounter(e){let r=0,s,a=new Promise(p=>{s=p}),n=p=>{let h=s;a=new Promise(E=>{s=E}),r=p,h()},c=(p=0)=>{n(r+1)},f=async function*(){for(;r<e;)await a,yield{progress:r/e}}();return{[Symbol.asyncIterator](){return f},hasProgress:!0,hasTitle:!1,set:n,tick:c}}static progressViaTitle(){let e,r,s=new Promise(c=>{r=c}),a=Q4(c=>{let f=r;s=new Promise(p=>{r=p}),e=c,f()},1e3/fet),n=async function*(){for(;;)await s,yield{title:e}}();return{[Symbol.asyncIterator](){return n},hasProgress:!1,hasTitle:!0,setTitle:a}}async startProgressPromise(e,r){let s=this.reportProgress(e);try{return await r(e)}finally{s.stop()}}startProgressSync(e,r){let s=this.reportProgress(e);try{return r(e)}finally{s.stop()}}reportInfoOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedInfos.has(a)||(this.reportedInfos.add(a),this.reportInfo(e,r),s?.reportExtra?.(this))}reportWarningOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedWarnings.has(a)||(this.reportedWarnings.add(a),this.reportWarning(e,r),s?.reportExtra?.(this))}reportErrorOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedErrors.has(a)||(this.reportedErrors.add(a),this.reportError(e,r),s?.reportExtra?.(this))}reportExceptionOnce(e){Aet(e)?this.reportErrorOnce(e.reportCode,e.message,{key:e,reportExtra:e.reportExtra}):this.reportErrorOnce(1,e.stack||e.message,{key:e})}createStreamReporter(e=null){let r=new pue.PassThrough,s=new hue.StringDecoder,a=\"\";return r.on(\"data\",n=>{let c=s.write(n),f;do if(f=c.indexOf(`\n`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a=\"\",e!==null?this.reportInfo(null,`${e} ${p}`):this.reportInfo(null,p)}while(f!==-1);a+=c}),r.on(\"end\",()=>{let n=s.end();n!==\"\"&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var aI,R8=Xe(()=>{Tc();Wo();aI=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));return s||null}getFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));if(!s)throw new jt(11,`${Yr(r.project.configuration,e)} isn't supported by any available fetcher`);return s}}});var rm,F8=Xe(()=>{Wo();rm=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,s){return this.getResolverByDescriptor(e,s).bindDescriptor(e,r,s)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,s){return await this.getResolverByDescriptor(e,s).getCandidates(e,r,s)}async getSatisfying(e,r,s,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,s,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));return s||null}getResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!s)throw new Error(`${ni(r.project.configuration,e)} isn't supported by any available resolver`);return s}tryResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));return s||null}getResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));if(!s)throw new Error(`${Yr(r.project.configuration,e)} isn't supported by any available resolver`);return s}}});var lI,N8=Xe(()=>{Dt();Wo();lI=class{supports(e){return!!e.reference.startsWith(\"virtual:\")}getLocalPath(e,r){let s=e.reference.indexOf(\"#\");if(s===-1)throw new Error(\"Invalid virtual package reference\");let a=e.reference.slice(s+1),n=Ws(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let s=e.reference.indexOf(\"#\");if(s===-1)throw new Error(\"Invalid virtual package reference\");let a=e.reference.slice(s+1),n=Ws(e,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,c,r)}getLocatorFilename(e){return nI(e)}async ensureVirtualLink(e,r,s){let a=r.packageFs.getRealPath(),n=s.project.configuration.get(\"virtualFolder\"),c=this.getLocatorFilename(e),f=uo.makeVirtualPath(n,c,a),p=new _f(f,{baseFs:r.packageFs,pathUtils:J});return{...r,packageFs:p}}}});var FQ,gue=Xe(()=>{FQ=class t{static{this.protocol=\"virtual:\"}static isVirtualDescriptor(e){return!!e.range.startsWith(t.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(t.protocol)}supportsDescriptor(e,r){return t.isVirtualDescriptor(e)}supportsLocator(e,r){return t.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){throw new Error('Assertion failed: calling \"bindDescriptor\" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling \"getResolutionDependencies\" on a virtual descriptor is unsupported')}async getCandidates(e,r,s){throw new Error('Assertion failed: calling \"getCandidates\" on a virtual descriptor is unsupported')}async getSatisfying(e,r,s,a){throw new Error('Assertion failed: calling \"getSatisfying\" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling \"resolve\" on a virtual locator is unsupported')}}});var cI,O8=Xe(()=>{Dt();tm();cI=class{supports(e){return!!e.reference.startsWith(Ei.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let s=this.getWorkspace(e,r).cwd;return{packageFs:new Sn(s),prefixPath:vt.dot,localPath:s}}getWorkspace(e,r){return r.project.getWorkspaceByCwd(e.reference.slice(Ei.protocol.length))}}});function WB(t){return typeof t==\"object\"&&t!==null&&!Array.isArray(t)}function due(t){return typeof t>\"u\"?3:WB(t)?0:Array.isArray(t)?1:2}function U8(t,e){return Object.hasOwn(t,e)}function het(t){return WB(t)&&U8(t,\"onConflict\")&&typeof t.onConflict==\"string\"}function get(t){if(typeof t>\"u\")return{onConflict:\"default\",value:t};if(!het(t))return{onConflict:\"default\",value:t};if(U8(t,\"value\"))return t;let{onConflict:e,...r}=t;return{onConflict:e,value:r}}function mue(t,e){let r=WB(t)&&U8(t,e)?t[e]:void 0;return get(r)}function uI(t,e){return[t,e,yue]}function _8(t){return Array.isArray(t)?t[2]===yue:!1}function L8(t,e){if(WB(t)){let r={};for(let s of Object.keys(t))r[s]=L8(t[s],e);return uI(e,r)}return Array.isArray(t)?uI(e,t.map(r=>L8(r,e))):uI(e,t)}function M8(t,e,r,s,a){let n,c=[],f=a,p=0;for(let E=a-1;E>=s;--E){let[C,S]=t[E],{onConflict:P,value:I}=mue(S,r),R=due(I);if(R!==3){if(n??=R,R!==n||P===\"hardReset\"){p=f;break}if(R===2)return uI(C,I);if(c.unshift([C,I]),P===\"reset\"){p=E;break}P===\"extend\"&&E===s&&(s=0),f=E}}if(typeof n>\"u\")return null;let h=c.map(([E])=>E).join(\", \");switch(n){case 1:return uI(h,new Array().concat(...c.map(([E,C])=>C.map(S=>L8(S,E)))));case 0:{let E=Object.assign({},...c.map(([,R])=>R)),C=Object.keys(E),S={},P=t.map(([R,N])=>[R,mue(N,r).value]),I=pet(P,([R,N])=>{let U=due(N);return U!==0&&U!==3});if(I!==-1){let R=P.slice(I+1);for(let N of C)S[N]=M8(R,e,N,0,R.length)}else for(let R of C)S[R]=M8(P,e,R,p,P.length);return uI(h,S)}default:throw new Error(\"Assertion failed: Non-extendable value type\")}}function Eue(t){return M8(t.map(([e,r])=>[e,{\".\":r}]),[],\".\",0,t.length)}function YB(t){return _8(t)?t[1]:t}function NQ(t){let e=_8(t)?t[1]:t;if(Array.isArray(e))return e.map(r=>NQ(r));if(WB(e)){let r={};for(let[s,a]of Object.entries(e))r[s]=NQ(a);return r}return e}function H8(t){return _8(t)?t[0]:null}var pet,yue,Iue=Xe(()=>{pet=(t,e,r)=>{let s=[...t];return s.reverse(),s.findIndex(e,r)};yue=Symbol()});var OQ={};Vt(OQ,{getDefaultGlobalFolder:()=>G8,getHomeFolder:()=>fI,isFolderInside:()=>q8});function G8(){if(process.platform===\"win32\"){let t=fe.toPortablePath(process.env.LOCALAPPDATA||fe.join((0,j8.homedir)(),\"AppData\",\"Local\"));return J.resolve(t,\"Yarn/Berry\")}if(process.env.XDG_DATA_HOME){let t=fe.toPortablePath(process.env.XDG_DATA_HOME);return J.resolve(t,\"yarn/berry\")}return J.resolve(fI(),\".yarn/berry\")}function fI(){return fe.toPortablePath((0,j8.homedir)()||\"/usr/local/share\")}function q8(t,e){let r=J.relative(e,t);return r&&!r.startsWith(\"..\")&&!J.isAbsolute(r)}var j8,LQ=Xe(()=>{Dt();j8=Ie(\"os\")});var Bue=_((EMt,wue)=>{\"use strict\";var W8=Ie(\"https\"),Y8=Ie(\"http\"),{URL:Cue}=Ie(\"url\"),V8=class extends Y8.Agent{constructor(e){let{proxy:r,proxyRequestOptions:s,...a}=e;super(a),this.proxy=typeof r==\"string\"?new Cue(r):r,this.proxyRequestOptions=s||{}}createConnection(e,r){let s={...this.proxyRequestOptions,method:\"CONNECT\",host:this.proxy.hostname,port:this.proxy.port,path:`${e.host}:${e.port}`,setHost:!1,headers:{...this.proxyRequestOptions.headers,connection:this.keepAlive?\"keep-alive\":\"close\",host:`${e.host}:${e.port}`},agent:!1,timeout:e.timeout||0};if(this.proxy.username||this.proxy.password){let n=Buffer.from(`${decodeURIComponent(this.proxy.username||\"\")}:${decodeURIComponent(this.proxy.password||\"\")}`).toString(\"base64\");s.headers[\"proxy-authorization\"]=`Basic ${n}`}this.proxy.protocol===\"https:\"&&(s.servername=this.proxy.hostname);let a=(this.proxy.protocol===\"http:\"?Y8:W8).request(s);a.once(\"connect\",(n,c,f)=>{a.removeAllListeners(),c.removeAllListeners(),n.statusCode===200?r(null,c):(c.destroy(),r(new Error(`Bad response: ${n.statusCode}`),null))}),a.once(\"timeout\",()=>{a.destroy(new Error(\"Proxy timeout\"))}),a.once(\"error\",n=>{a.removeAllListeners(),r(n,null)}),a.end()}},J8=class extends W8.Agent{constructor(e){let{proxy:r,proxyRequestOptions:s,...a}=e;super(a),this.proxy=typeof r==\"string\"?new Cue(r):r,this.proxyRequestOptions=s||{}}createConnection(e,r){let s={...this.proxyRequestOptions,method:\"CONNECT\",host:this.proxy.hostname,port:this.proxy.port,path:`${e.host}:${e.port}`,setHost:!1,headers:{...this.proxyRequestOptions.headers,connection:this.keepAlive?\"keep-alive\":\"close\",host:`${e.host}:${e.port}`},agent:!1,timeout:e.timeout||0};if(this.proxy.username||this.proxy.password){let n=Buffer.from(`${decodeURIComponent(this.proxy.username||\"\")}:${decodeURIComponent(this.proxy.password||\"\")}`).toString(\"base64\");s.headers[\"proxy-authorization\"]=`Basic ${n}`}this.proxy.protocol===\"https:\"&&(s.servername=this.proxy.hostname);let a=(this.proxy.protocol===\"http:\"?Y8:W8).request(s);a.once(\"connect\",(n,c,f)=>{if(a.removeAllListeners(),c.removeAllListeners(),n.statusCode===200){let p=super.createConnection({...e,socket:c});r(null,p)}else c.destroy(),r(new Error(`Bad response: ${n.statusCode}`),null)}),a.once(\"timeout\",()=>{a.destroy(new Error(\"Proxy timeout\"))}),a.once(\"error\",n=>{a.removeAllListeners(),r(n,null)}),a.end()}};wue.exports={HttpProxyAgent:V8,HttpsProxyAgent:J8}});var K8,vue,Sue,Due=Xe(()=>{K8=ut(Bue(),1),vue=K8.default.HttpProxyAgent,Sue=K8.default.HttpsProxyAgent});var Np=_((Fp,MQ)=>{\"use strict\";Object.defineProperty(Fp,\"__esModule\",{value:!0});var bue=[\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float32Array\",\"Float64Array\",\"BigInt64Array\",\"BigUint64Array\"];function met(t){return bue.includes(t)}var yet=[\"Function\",\"Generator\",\"AsyncGenerator\",\"GeneratorFunction\",\"AsyncGeneratorFunction\",\"AsyncFunction\",\"Observable\",\"Array\",\"Buffer\",\"Blob\",\"Object\",\"RegExp\",\"Date\",\"Error\",\"Map\",\"Set\",\"WeakMap\",\"WeakSet\",\"ArrayBuffer\",\"SharedArrayBuffer\",\"DataView\",\"Promise\",\"URL\",\"FormData\",\"URLSearchParams\",\"HTMLElement\",...bue];function Eet(t){return yet.includes(t)}var Iet=[\"null\",\"undefined\",\"string\",\"number\",\"bigint\",\"boolean\",\"symbol\"];function Cet(t){return Iet.includes(t)}function AI(t){return e=>typeof e===t}var{toString:Pue}=Object.prototype,VB=t=>{let e=Pue.call(t).slice(8,-1);if(/HTML\\w+Element/.test(e)&&be.domElement(t))return\"HTMLElement\";if(Eet(e))return e},pi=t=>e=>VB(e)===t;function be(t){if(t===null)return\"null\";switch(typeof t){case\"undefined\":return\"undefined\";case\"string\":return\"string\";case\"number\":return\"number\";case\"boolean\":return\"boolean\";case\"function\":return\"Function\";case\"bigint\":return\"bigint\";case\"symbol\":return\"symbol\";default:}if(be.observable(t))return\"Observable\";if(be.array(t))return\"Array\";if(be.buffer(t))return\"Buffer\";let e=VB(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError(\"Please don't use object wrappers for primitive types\");return\"Object\"}be.undefined=AI(\"undefined\");be.string=AI(\"string\");var wet=AI(\"number\");be.number=t=>wet(t)&&!be.nan(t);be.bigint=AI(\"bigint\");be.function_=AI(\"function\");be.null_=t=>t===null;be.class_=t=>be.function_(t)&&t.toString().startsWith(\"class \");be.boolean=t=>t===!0||t===!1;be.symbol=AI(\"symbol\");be.numericString=t=>be.string(t)&&!be.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));be.array=(t,e)=>Array.isArray(t)?be.function_(e)?t.every(e):!0:!1;be.buffer=t=>{var e,r,s,a;return(a=(s=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||s===void 0?void 0:s.call(r,t))!==null&&a!==void 0?a:!1};be.blob=t=>pi(\"Blob\")(t);be.nullOrUndefined=t=>be.null_(t)||be.undefined(t);be.object=t=>!be.null_(t)&&(typeof t==\"object\"||be.function_(t));be.iterable=t=>{var e;return be.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};be.asyncIterable=t=>{var e;return be.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};be.generator=t=>{var e,r;return be.iterable(t)&&be.function_((e=t)===null||e===void 0?void 0:e.next)&&be.function_((r=t)===null||r===void 0?void 0:r.throw)};be.asyncGenerator=t=>be.asyncIterable(t)&&be.function_(t.next)&&be.function_(t.throw);be.nativePromise=t=>pi(\"Promise\")(t);var Bet=t=>{var e,r;return be.function_((e=t)===null||e===void 0?void 0:e.then)&&be.function_((r=t)===null||r===void 0?void 0:r.catch)};be.promise=t=>be.nativePromise(t)||Bet(t);be.generatorFunction=pi(\"GeneratorFunction\");be.asyncGeneratorFunction=t=>VB(t)===\"AsyncGeneratorFunction\";be.asyncFunction=t=>VB(t)===\"AsyncFunction\";be.boundFunction=t=>be.function_(t)&&!t.hasOwnProperty(\"prototype\");be.regExp=pi(\"RegExp\");be.date=pi(\"Date\");be.error=pi(\"Error\");be.map=t=>pi(\"Map\")(t);be.set=t=>pi(\"Set\")(t);be.weakMap=t=>pi(\"WeakMap\")(t);be.weakSet=t=>pi(\"WeakSet\")(t);be.int8Array=pi(\"Int8Array\");be.uint8Array=pi(\"Uint8Array\");be.uint8ClampedArray=pi(\"Uint8ClampedArray\");be.int16Array=pi(\"Int16Array\");be.uint16Array=pi(\"Uint16Array\");be.int32Array=pi(\"Int32Array\");be.uint32Array=pi(\"Uint32Array\");be.float32Array=pi(\"Float32Array\");be.float64Array=pi(\"Float64Array\");be.bigInt64Array=pi(\"BigInt64Array\");be.bigUint64Array=pi(\"BigUint64Array\");be.arrayBuffer=pi(\"ArrayBuffer\");be.sharedArrayBuffer=pi(\"SharedArrayBuffer\");be.dataView=pi(\"DataView\");be.enumCase=(t,e)=>Object.values(e).includes(t);be.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;be.urlInstance=t=>pi(\"URL\")(t);be.urlString=t=>{if(!be.string(t))return!1;try{return new URL(t),!0}catch{return!1}};be.truthy=t=>!!t;be.falsy=t=>!t;be.nan=t=>Number.isNaN(t);be.primitive=t=>be.null_(t)||Cet(typeof t);be.integer=t=>Number.isInteger(t);be.safeInteger=t=>Number.isSafeInteger(t);be.plainObject=t=>{if(Pue.call(t)!==\"[object Object]\")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};be.typedArray=t=>met(VB(t));var vet=t=>be.safeInteger(t)&&t>=0;be.arrayLike=t=>!be.nullOrUndefined(t)&&!be.function_(t)&&vet(t.length);be.inRange=(t,e)=>{if(be.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(be.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Det=1,bet=[\"innerHTML\",\"ownerDocument\",\"style\",\"attributes\",\"nodeValue\"];be.domElement=t=>be.object(t)&&t.nodeType===Det&&be.string(t.nodeName)&&!be.plainObject(t)&&bet.every(e=>e in t);be.observable=t=>{var e,r,s,a;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((a=(s=t)[\"@@observable\"])===null||a===void 0?void 0:a.call(s)):!1};be.nodeStream=t=>be.object(t)&&be.function_(t.pipe)&&!be.observable(t);be.infinite=t=>t===1/0||t===-1/0;var xue=t=>e=>be.integer(e)&&Math.abs(e%2)===t;be.evenInteger=xue(0);be.oddInteger=xue(1);be.emptyArray=t=>be.array(t)&&t.length===0;be.nonEmptyArray=t=>be.array(t)&&t.length>0;be.emptyString=t=>be.string(t)&&t.length===0;var Pet=t=>be.string(t)&&!/\\S/.test(t);be.emptyStringOrWhitespace=t=>be.emptyString(t)||Pet(t);be.nonEmptyString=t=>be.string(t)&&t.length>0;be.nonEmptyStringAndNotWhitespace=t=>be.string(t)&&!be.emptyStringOrWhitespace(t);be.emptyObject=t=>be.object(t)&&!be.map(t)&&!be.set(t)&&Object.keys(t).length===0;be.nonEmptyObject=t=>be.object(t)&&!be.map(t)&&!be.set(t)&&Object.keys(t).length>0;be.emptySet=t=>be.set(t)&&t.size===0;be.nonEmptySet=t=>be.set(t)&&t.size>0;be.emptyMap=t=>be.map(t)&&t.size===0;be.nonEmptyMap=t=>be.map(t)&&t.size>0;be.propertyKey=t=>be.any([be.string,be.number,be.symbol],t);be.formData=t=>pi(\"FormData\")(t);be.urlSearchParams=t=>pi(\"URLSearchParams\")(t);var kue=(t,e,r)=>{if(!be.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError(\"Invalid number of values\");return t.call(r,e)};be.any=(t,...e)=>(be.array(t)?t:[t]).some(s=>kue(Array.prototype.some,s,e));be.all=(t,...e)=>kue(Array.prototype.every,t,e);var _t=(t,e,r,s={})=>{if(!t){let{multipleValues:a}=s,n=a?`received values of types ${[...new Set(r.map(c=>`\\`${be(c)}\\``))].join(\", \")}`:`received value of type \\`${be(r)}\\``;throw new TypeError(`Expected value which is \\`${e}\\`, ${n}.`)}};Fp.assert={undefined:t=>_t(be.undefined(t),\"undefined\",t),string:t=>_t(be.string(t),\"string\",t),number:t=>_t(be.number(t),\"number\",t),bigint:t=>_t(be.bigint(t),\"bigint\",t),function_:t=>_t(be.function_(t),\"Function\",t),null_:t=>_t(be.null_(t),\"null\",t),class_:t=>_t(be.class_(t),\"Class\",t),boolean:t=>_t(be.boolean(t),\"boolean\",t),symbol:t=>_t(be.symbol(t),\"symbol\",t),numericString:t=>_t(be.numericString(t),\"string with a number\",t),array:(t,e)=>{_t(be.array(t),\"Array\",t),e&&t.forEach(e)},buffer:t=>_t(be.buffer(t),\"Buffer\",t),blob:t=>_t(be.blob(t),\"Blob\",t),nullOrUndefined:t=>_t(be.nullOrUndefined(t),\"null or undefined\",t),object:t=>_t(be.object(t),\"Object\",t),iterable:t=>_t(be.iterable(t),\"Iterable\",t),asyncIterable:t=>_t(be.asyncIterable(t),\"AsyncIterable\",t),generator:t=>_t(be.generator(t),\"Generator\",t),asyncGenerator:t=>_t(be.asyncGenerator(t),\"AsyncGenerator\",t),nativePromise:t=>_t(be.nativePromise(t),\"native Promise\",t),promise:t=>_t(be.promise(t),\"Promise\",t),generatorFunction:t=>_t(be.generatorFunction(t),\"GeneratorFunction\",t),asyncGeneratorFunction:t=>_t(be.asyncGeneratorFunction(t),\"AsyncGeneratorFunction\",t),asyncFunction:t=>_t(be.asyncFunction(t),\"AsyncFunction\",t),boundFunction:t=>_t(be.boundFunction(t),\"Function\",t),regExp:t=>_t(be.regExp(t),\"RegExp\",t),date:t=>_t(be.date(t),\"Date\",t),error:t=>_t(be.error(t),\"Error\",t),map:t=>_t(be.map(t),\"Map\",t),set:t=>_t(be.set(t),\"Set\",t),weakMap:t=>_t(be.weakMap(t),\"WeakMap\",t),weakSet:t=>_t(be.weakSet(t),\"WeakSet\",t),int8Array:t=>_t(be.int8Array(t),\"Int8Array\",t),uint8Array:t=>_t(be.uint8Array(t),\"Uint8Array\",t),uint8ClampedArray:t=>_t(be.uint8ClampedArray(t),\"Uint8ClampedArray\",t),int16Array:t=>_t(be.int16Array(t),\"Int16Array\",t),uint16Array:t=>_t(be.uint16Array(t),\"Uint16Array\",t),int32Array:t=>_t(be.int32Array(t),\"Int32Array\",t),uint32Array:t=>_t(be.uint32Array(t),\"Uint32Array\",t),float32Array:t=>_t(be.float32Array(t),\"Float32Array\",t),float64Array:t=>_t(be.float64Array(t),\"Float64Array\",t),bigInt64Array:t=>_t(be.bigInt64Array(t),\"BigInt64Array\",t),bigUint64Array:t=>_t(be.bigUint64Array(t),\"BigUint64Array\",t),arrayBuffer:t=>_t(be.arrayBuffer(t),\"ArrayBuffer\",t),sharedArrayBuffer:t=>_t(be.sharedArrayBuffer(t),\"SharedArrayBuffer\",t),dataView:t=>_t(be.dataView(t),\"DataView\",t),enumCase:(t,e)=>_t(be.enumCase(t,e),\"EnumCase\",t),urlInstance:t=>_t(be.urlInstance(t),\"URL\",t),urlString:t=>_t(be.urlString(t),\"string with a URL\",t),truthy:t=>_t(be.truthy(t),\"truthy\",t),falsy:t=>_t(be.falsy(t),\"falsy\",t),nan:t=>_t(be.nan(t),\"NaN\",t),primitive:t=>_t(be.primitive(t),\"primitive\",t),integer:t=>_t(be.integer(t),\"integer\",t),safeInteger:t=>_t(be.safeInteger(t),\"integer\",t),plainObject:t=>_t(be.plainObject(t),\"plain object\",t),typedArray:t=>_t(be.typedArray(t),\"TypedArray\",t),arrayLike:t=>_t(be.arrayLike(t),\"array-like\",t),domElement:t=>_t(be.domElement(t),\"HTMLElement\",t),observable:t=>_t(be.observable(t),\"Observable\",t),nodeStream:t=>_t(be.nodeStream(t),\"Node.js Stream\",t),infinite:t=>_t(be.infinite(t),\"infinite number\",t),emptyArray:t=>_t(be.emptyArray(t),\"empty array\",t),nonEmptyArray:t=>_t(be.nonEmptyArray(t),\"non-empty array\",t),emptyString:t=>_t(be.emptyString(t),\"empty string\",t),emptyStringOrWhitespace:t=>_t(be.emptyStringOrWhitespace(t),\"empty string or whitespace\",t),nonEmptyString:t=>_t(be.nonEmptyString(t),\"non-empty string\",t),nonEmptyStringAndNotWhitespace:t=>_t(be.nonEmptyStringAndNotWhitespace(t),\"non-empty string and not whitespace\",t),emptyObject:t=>_t(be.emptyObject(t),\"empty object\",t),nonEmptyObject:t=>_t(be.nonEmptyObject(t),\"non-empty object\",t),emptySet:t=>_t(be.emptySet(t),\"empty set\",t),nonEmptySet:t=>_t(be.nonEmptySet(t),\"non-empty set\",t),emptyMap:t=>_t(be.emptyMap(t),\"empty map\",t),nonEmptyMap:t=>_t(be.nonEmptyMap(t),\"non-empty map\",t),propertyKey:t=>_t(be.propertyKey(t),\"PropertyKey\",t),formData:t=>_t(be.formData(t),\"FormData\",t),urlSearchParams:t=>_t(be.urlSearchParams(t),\"URLSearchParams\",t),evenInteger:t=>_t(be.evenInteger(t),\"even integer\",t),oddInteger:t=>_t(be.oddInteger(t),\"odd integer\",t),directInstanceOf:(t,e)=>_t(be.directInstanceOf(t,e),\"T\",t),inRange:(t,e)=>_t(be.inRange(t,e),\"in range\",t),any:(t,...e)=>_t(be.any(t,...e),\"predicate returns truthy for any value\",e,{multipleValues:!0}),all:(t,...e)=>_t(be.all(t,...e),\"predicate returns truthy for all values\",e,{multipleValues:!0})};Object.defineProperties(be,{class:{value:be.class_},function:{value:be.function_},null:{value:be.null_}});Object.defineProperties(Fp.assert,{class:{value:Fp.assert.class_},function:{value:Fp.assert.function_},null:{value:Fp.assert.null_}});Fp.default=be;MQ.exports=be;MQ.exports.default=be;MQ.exports.assert=Fp.assert});var Que=_((CMt,z8)=>{\"use strict\";var UQ=class extends Error{constructor(e){super(e||\"Promise was canceled\"),this.name=\"CancelError\"}get isCanceled(){return!0}},_Q=class t{static fn(e){return(...r)=>new t((s,a,n)=>{r.push(n),e(...r).then(s,a)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,s)=>{this._reject=s;let a=f=>{this._isPending=!1,r(f)},n=f=>{this._isPending=!1,s(f)},c=f=>{if(!this._isPending)throw new Error(\"The `onCancel` handler was attached after the promise settled.\");this._cancelHandlers.push(f)};return Object.defineProperties(c,{shouldReject:{get:()=>this._rejectOnCancel,set:f=>{this._rejectOnCancel=f}}}),e(a,n,c)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new UQ(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(_Q.prototype,Promise.prototype);z8.exports=_Q;z8.exports.CancelError=UQ});var Tue=_((Z8,$8)=>{\"use strict\";Object.defineProperty(Z8,\"__esModule\",{value:!0});function xet(t){return t.encrypted}var X8=(t,e)=>{let r;typeof e==\"function\"?r={connect:e}:r=e;let s=typeof r.connect==\"function\",a=typeof r.secureConnect==\"function\",n=typeof r.close==\"function\",c=()=>{s&&r.connect(),xet(t)&&a&&(t.authorized?r.secureConnect():t.authorizationError||t.once(\"secureConnect\",r.secureConnect)),n&&t.once(\"close\",r.close)};t.writable&&!t.connecting?c():t.connecting?t.once(\"connect\",c):t.destroyed&&n&&r.close(t._hadError)};Z8.default=X8;$8.exports=X8;$8.exports.default=X8});var Rue=_((tH,rH)=>{\"use strict\";Object.defineProperty(tH,\"__esModule\",{value:!0});var ket=Tue(),Qet=Number(process.versions.node.split(\".\")[0]),eH=t=>{let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=c=>{let f=c.emit.bind(c);c.emit=(p,...h)=>(p===\"error\"&&(e.error=Date.now(),e.phases.total=e.error-e.start,c.emit=f),f(p,...h))};r(t),t.prependOnceListener(\"abort\",()=>{e.abort=Date.now(),(!e.response||Qet>=13)&&(e.phases.total=Date.now()-e.start)});let s=c=>{e.socket=Date.now(),e.phases.wait=e.socket-e.start;let f=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};c.prependOnceListener(\"lookup\",f),ket.default(c,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(c.removeListener(\"lookup\",f),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?s(t.socket):t.prependOnceListener(\"socket\",s);let a=()=>{var c;e.upload=Date.now(),e.phases.request=e.upload-(c=e.secureConnect,c??e.connect)};return(typeof t.writableFinished==\"boolean\"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))?a():t.prependOnceListener(\"finish\",a),t.prependOnceListener(\"response\",c=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,c.timings=e,r(c),c.prependOnceListener(\"end\",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start})}),e};tH.default=eH;rH.exports=eH;rH.exports.default=eH});var _ue=_((wMt,sH)=>{\"use strict\";var{V4MAPPED:Tet,ADDRCONFIG:Ret,ALL:Uue,promises:{Resolver:Fue},lookup:Fet}=Ie(\"dns\"),{promisify:nH}=Ie(\"util\"),Net=Ie(\"os\"),pI=Symbol(\"cacheableLookupCreateConnection\"),iH=Symbol(\"cacheableLookupInstance\"),Nue=Symbol(\"expires\"),Oet=typeof Uue==\"number\",Oue=t=>{if(!(t&&typeof t.createConnection==\"function\"))throw new Error(\"Expected an Agent instance as the first argument\")},Let=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},Lue=()=>{let t=!1,e=!1;for(let r of Object.values(Net.networkInterfaces()))for(let s of r)if(!s.internal&&(s.family===\"IPv6\"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Met=t=>Symbol.iterator in t,Mue={ttl:!0},Uet={all:!0},HQ=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:s=3600,errorTtl:a=.15,resolver:n=new Fue,lookup:c=Fet}={}){if(this.maxTtl=r,this.errorTtl=a,this._cache=e,this._resolver=n,this._dnsLookup=nH(c),this._resolver instanceof Fue?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=nH(this._resolver.resolve4.bind(this._resolver)),this._resolve6=nH(this._resolver.resolve6.bind(this._resolver))),this._iface=Lue(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,s<1)this._fallback=!1;else{this._fallback=!0;let f=setInterval(()=>{this._hostnamesToFallback.clear()},s*1e3);f.unref&&f.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,s){if(typeof r==\"function\"?(s=r,r={}):typeof r==\"number\"&&(r={family:r}),!s)throw new Error(\"Callback must be a function.\");this.lookupAsync(e,r).then(a=>{r.all?s(null,a):s(null,a.address,a.family,a.expires,a.ttl)},s)}async lookupAsync(e,r={}){typeof r==\"number\"&&(r={family:r});let s=await this.query(e);if(r.family===6){let a=s.filter(n=>n.family===6);r.hints&Tet&&(Oet&&r.hints&Uue||a.length===0)?Let(s):s=a}else r.family===4&&(s=s.filter(a=>a.family===4));if(r.hints&Ret){let{_iface:a}=this;s=s.filter(n=>n.family===6?a.has6:a.has4)}if(s.length===0){let a=new Error(`cacheableLookup ENOTFOUND ${e}`);throw a.code=\"ENOTFOUND\",a.hostname=e,a}return r.all?s:s[0]}async query(e){let r=await this._cache.get(e);if(!r){let s=this._pending[e];if(s)r=await s;else{let a=this.queryAndCache(e);this._pending[e]=a,r=await a}}return r=r.map(s=>({...s})),r}async _resolve(e){let r=async h=>{try{return await h}catch(E){if(E.code===\"ENODATA\"||E.code===\"ENOTFOUND\")return[];throw E}},[s,a]=await Promise.all([this._resolve4(e,Mue),this._resolve6(e,Mue)].map(h=>r(h))),n=0,c=0,f=0,p=Date.now();for(let h of s)h.family=4,h.expires=p+h.ttl*1e3,n=Math.max(n,h.ttl);for(let h of a)h.family=6,h.expires=p+h.ttl*1e3,c=Math.max(c,h.ttl);return s.length>0?a.length>0?f=Math.min(n,c):f=n:f=c,{entries:[...s,...a],cacheTtl:f}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,s){if(this.maxTtl>0&&s>0){s=Math.min(s,this.maxTtl)*1e3,r[Nue]=Date.now()+s;try{await this._cache.set(e,r,s)}catch(a){this.lookupAsync=async()=>{let n=new Error(\"Cache Error. Please recreate the CacheableLookup instance.\");throw n.cause=a,n}}Met(this._cache)&&this._tick(s)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Uet);try{let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let s=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,s),delete this._pending[e],r.entries}catch(r){throw delete this._pending[e],r}}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let s=1/0,a=Date.now();for(let[n,c]of this._cache){let f=c[Nue];a>=f?this._cache.delete(n):f<s&&(s=f)}s!==1/0&&this._tick(s-a)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(Oue(e),pI in e)throw new Error(\"CacheableLookup has been already installed\");e[pI]=e.createConnection,e[iH]=this,e.createConnection=(r,s)=>(\"lookup\"in r||(r.lookup=this.lookup),e[pI](r,s))}uninstall(e){if(Oue(e),e[pI]){if(e[iH]!==this)throw new Error(\"The agent is not owned by this CacheableLookup instance\");e.createConnection=e[pI],delete e[pI],delete e[iH]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Lue(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};sH.exports=HQ;sH.exports.default=HQ});var Gue=_((BMt,oH)=>{\"use strict\";var _et=typeof URL>\"u\"?Ie(\"url\").URL:URL,Het=\"text/plain\",jet=\"us-ascii\",Hue=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Get=(t,{stripHash:e})=>{let r=t.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${t}`);let s=r[1].split(\";\"),a=r[2],n=e?\"\":r[3],c=!1;s[s.length-1]===\"base64\"&&(s.pop(),c=!0);let f=(s.shift()||\"\").toLowerCase(),h=[...s.map(E=>{let[C,S=\"\"]=E.split(\"=\").map(P=>P.trim());return C===\"charset\"&&(S=S.toLowerCase(),S===jet)?\"\":`${C}${S?`=${S}`:\"\"}`}).filter(Boolean)];return c&&h.push(\"base64\"),(h.length!==0||f&&f!==Het)&&h.unshift(f),`data:${h.join(\";\")},${c?a.trim():a}${n?`#${n}`:\"\"}`},jue=(t,e)=>{if(e={defaultProtocol:\"http:\",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},Reflect.has(e,\"normalizeHttps\"))throw new Error(\"options.normalizeHttps is renamed to options.forceHttp\");if(Reflect.has(e,\"normalizeHttp\"))throw new Error(\"options.normalizeHttp is renamed to options.forceHttps\");if(Reflect.has(e,\"stripFragment\"))throw new Error(\"options.stripFragment is renamed to options.stripHash\");if(t=t.trim(),/^data:/i.test(t))return Get(t,e);let r=t.startsWith(\"//\");!r&&/^\\.*\\//.test(t)||(t=t.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//,e.defaultProtocol));let a=new _et(t);if(e.forceHttp&&e.forceHttps)throw new Error(\"The `forceHttp` and `forceHttps` options cannot be used together\");if(e.forceHttp&&a.protocol===\"https:\"&&(a.protocol=\"http:\"),e.forceHttps&&a.protocol===\"http:\"&&(a.protocol=\"https:\"),e.stripAuthentication&&(a.username=\"\",a.password=\"\"),e.stripHash&&(a.hash=\"\"),a.pathname&&(a.pathname=a.pathname.replace(/((?!:).|^)\\/{2,}/g,(n,c)=>/^(?!\\/)/g.test(c)?`${c}/`:\"/\")),a.pathname&&(a.pathname=decodeURI(a.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let n=a.pathname.split(\"/\"),c=n[n.length-1];Hue(c,e.removeDirectoryIndex)&&(n=n.slice(0,n.length-1),a.pathname=n.slice(1).join(\"/\")+\"/\")}if(a.hostname&&(a.hostname=a.hostname.replace(/\\.$/,\"\"),e.stripWWW&&/^www\\.([a-z\\-\\d]{2,63})\\.([a-z.]{2,5})$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\\./,\"\"))),Array.isArray(e.removeQueryParameters))for(let n of[...a.searchParams.keys()])Hue(n,e.removeQueryParameters)&&a.searchParams.delete(n);return e.sortQueryParameters&&a.searchParams.sort(),e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\\/$/,\"\")),t=a.toString(),(e.removeTrailingSlash||a.pathname===\"/\")&&a.hash===\"\"&&(t=t.replace(/\\/$/,\"\")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\\/\\//,\"//\")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\\/\\//,\"\")),t};oH.exports=jue;oH.exports.default=jue});var Yue=_((vMt,Wue)=>{Wue.exports=que;function que(t,e){if(t&&e)return que(t)(e);if(typeof t!=\"function\")throw new TypeError(\"need wrapper function\");return Object.keys(t).forEach(function(s){r[s]=t[s]}),r;function r(){for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];var n=t.apply(this,s),c=s[s.length-1];return typeof n==\"function\"&&n!==c&&Object.keys(c).forEach(function(f){n[f]=c[f]}),n}}});var lH=_((SMt,aH)=>{var Vue=Yue();aH.exports=Vue(jQ);aH.exports.strict=Vue(Jue);jQ.proto=jQ(function(){Object.defineProperty(Function.prototype,\"once\",{value:function(){return jQ(this)},configurable:!0}),Object.defineProperty(Function.prototype,\"onceStrict\",{value:function(){return Jue(this)},configurable:!0})});function jQ(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Jue(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||\"Function wrapped with `once`\";return e.onceError=r+\" shouldn't be called more than once\",e.called=!1,e}});var cH=_((DMt,zue)=>{var qet=lH(),Wet=function(){},Yet=function(t){return t.setHeader&&typeof t.abort==\"function\"},Vet=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},Kue=function(t,e,r){if(typeof e==\"function\")return Kue(t,null,e);e||(e={}),r=qet(r||Wet);var s=t._writableState,a=t._readableState,n=e.readable||e.readable!==!1&&t.readable,c=e.writable||e.writable!==!1&&t.writable,f=function(){t.writable||p()},p=function(){c=!1,n||r.call(t)},h=function(){n=!1,c||r.call(t)},E=function(I){r.call(t,I?new Error(\"exited with error code: \"+I):null)},C=function(I){r.call(t,I)},S=function(){if(n&&!(a&&a.ended))return r.call(t,new Error(\"premature close\"));if(c&&!(s&&s.ended))return r.call(t,new Error(\"premature close\"))},P=function(){t.req.on(\"finish\",p)};return Yet(t)?(t.on(\"complete\",p),t.on(\"abort\",S),t.req?P():t.on(\"request\",P)):c&&!s&&(t.on(\"end\",f),t.on(\"close\",f)),Vet(t)&&t.on(\"exit\",E),t.on(\"end\",h),t.on(\"finish\",p),e.error!==!1&&t.on(\"error\",C),t.on(\"close\",S),function(){t.removeListener(\"complete\",p),t.removeListener(\"abort\",S),t.removeListener(\"request\",P),t.req&&t.req.removeListener(\"finish\",p),t.removeListener(\"end\",f),t.removeListener(\"close\",f),t.removeListener(\"finish\",p),t.removeListener(\"exit\",E),t.removeListener(\"end\",h),t.removeListener(\"error\",C),t.removeListener(\"close\",S)}};zue.exports=Kue});var $ue=_((bMt,Zue)=>{var Jet=lH(),Ket=cH(),uH=Ie(\"fs\"),JB=function(){},zet=/^v?\\.0/.test(process.version),GQ=function(t){return typeof t==\"function\"},Xet=function(t){return!zet||!uH?!1:(t instanceof(uH.ReadStream||JB)||t instanceof(uH.WriteStream||JB))&&GQ(t.close)},Zet=function(t){return t.setHeader&&GQ(t.abort)},$et=function(t,e,r,s){s=Jet(s);var a=!1;t.on(\"close\",function(){a=!0}),Ket(t,{readable:e,writable:r},function(c){if(c)return s(c);a=!0,s()});var n=!1;return function(c){if(!a&&!n){if(n=!0,Xet(t))return t.close(JB);if(Zet(t))return t.abort();if(GQ(t.destroy))return t.destroy();s(c||new Error(\"stream was destroyed\"))}}},Xue=function(t){t()},ett=function(t,e){return t.pipe(e)},ttt=function(){var t=Array.prototype.slice.call(arguments),e=GQ(t[t.length-1]||JB)&&t.pop()||JB;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error(\"pump requires two streams per minimum\");var r,s=t.map(function(a,n){var c=n<t.length-1,f=n>0;return $et(a,c,f,function(p){r||(r=p),p&&s.forEach(Xue),!c&&(s.forEach(Xue),e(r))})});return t.reduce(ett)};Zue.exports=ttt});var tfe=_((PMt,efe)=>{\"use strict\";var{PassThrough:rtt}=Ie(\"stream\");efe.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,s=r===\"buffer\",a=!1;e?a=!(r||s):r=r||\"utf8\",s&&(r=null);let n=new rtt({objectMode:a});r&&n.setEncoding(r);let c=0,f=[];return n.on(\"data\",p=>{f.push(p),a?c=f.length:c+=p.length}),n.getBufferedValue=()=>e?f:s?Buffer.concat(f,c):f.join(\"\"),n.getBufferedLength=()=>c,n}});var rfe=_((xMt,hI)=>{\"use strict\";var ntt=$ue(),itt=tfe(),qQ=class extends Error{constructor(){super(\"maxBuffer exceeded\"),this.name=\"MaxBufferError\"}};async function WQ(t,e){if(!t)return Promise.reject(new Error(\"Expected a stream\"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,s;return await new Promise((a,n)=>{let c=f=>{f&&(f.bufferedData=s.getBufferedValue()),n(f)};s=ntt(t,itt(e),f=>{if(f){c(f);return}a()}),s.on(\"data\",()=>{s.getBufferedLength()>r&&c(new qQ)})}),s.getBufferedValue()}hI.exports=WQ;hI.exports.default=WQ;hI.exports.buffer=(t,e)=>WQ(t,{...e,encoding:\"buffer\"});hI.exports.array=(t,e)=>WQ(t,{...e,array:!0});hI.exports.MaxBufferError=qQ});var ife=_((QMt,nfe)=>{\"use strict\";var stt=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),ott=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),att=new Set([500,502,503,504]),ltt={date:!0,connection:!0,\"keep-alive\":!0,\"proxy-authenticate\":!0,\"proxy-authorization\":!0,te:!0,trailer:!0,\"transfer-encoding\":!0,upgrade:!0},ctt={\"content-length\":!0,\"content-encoding\":!0,\"transfer-encoding\":!0,\"content-range\":!0};function nm(t){let e=parseInt(t,10);return isFinite(e)?e:0}function utt(t){return t?att.has(t.status):!0}function fH(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let s of r){let[a,n]=s.split(/=/,2);e[a.trim()]=n===void 0?!0:n.trim().replace(/^\"|\"$/g,\"\")}return e}function ftt(t){let e=[];for(let r in t){let s=t[r];e.push(s===!0?r:r+\"=\"+s)}if(e.length)return e.join(\", \")}nfe.exports=class{constructor(e,r,{shared:s,cacheHeuristic:a,immutableMinTimeToLive:n,ignoreCargoCult:c,_fromObject:f}={}){if(f){this._fromObject(f);return}if(!r||!r.headers)throw Error(\"Response headers missing\");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=s!==!1,this._cacheHeuristic=a!==void 0?a:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status=\"status\"in r?r.status:200,this._resHeaders=r.headers,this._rescc=fH(r.headers[\"cache-control\"]),this._method=\"method\"in e?e.method:\"GET\",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=fH(e.headers[\"cache-control\"]),c&&\"pre-check\"in this._rescc&&\"post-check\"in this._rescc&&(delete this._rescc[\"pre-check\"],delete this._rescc[\"post-check\"],delete this._rescc[\"no-cache\"],delete this._rescc[\"no-store\"],delete this._rescc[\"must-revalidate\"],this._resHeaders=Object.assign({},this._resHeaders,{\"cache-control\":ftt(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers[\"cache-control\"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc[\"no-cache\"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc[\"no-store\"]&&(this._method===\"GET\"||this._method===\"HEAD\"||this._method===\"POST\"&&this._hasExplicitExpiration())&&ott.has(this._status)&&!this._rescc[\"no-store\"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc[\"max-age\"]||this._isShared&&this._rescc[\"s-maxage\"]||this._rescc.public||stt.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc[\"s-maxage\"]||this._rescc[\"max-age\"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error(\"Request headers missing\")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=fH(e.headers[\"cache-control\"]);return r[\"no-cache\"]||/no-cache/.test(e.headers.pragma)||r[\"max-age\"]&&this.age()>r[\"max-age\"]||r[\"min-fresh\"]&&this.timeToLive()<1e3*r[\"min-fresh\"]||this.stale()&&!(r[\"max-stale\"]&&!this._rescc[\"must-revalidate\"]&&(r[\"max-stale\"]===!0||r[\"max-stale\"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method===\"HEAD\")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc[\"must-revalidate\"]||this._rescc.public||this._rescc[\"s-maxage\"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary===\"*\")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\\s*,\\s*/);for(let s of r)if(e.headers[s]!==this._reqHeaders[s])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let s in e)ltt[s]||(r[s]=e[s]);if(e.connection){let s=e.connection.trim().split(/\\s*,\\s*/);for(let a of s)delete r[a]}if(r.warning){let s=r.warning.split(/,/).filter(a=>!/^\\s*1[0-9][0-9]/.test(a));s.length?r.warning=s.join(\",\").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:\"\")+'113 - \"rfc7234 5.5.4\"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return nm(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc[\"no-cache\"]||this._isShared&&this._resHeaders[\"set-cookie\"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary===\"*\")return 0;if(this._isShared){if(this._rescc[\"proxy-revalidate\"])return 0;if(this._rescc[\"s-maxage\"])return nm(this._rescc[\"s-maxage\"])}if(this._rescc[\"max-age\"])return nm(this._rescc[\"max-age\"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let s=Date.parse(this._resHeaders.expires);return Number.isNaN(s)||s<r?0:Math.max(e,(s-r)/1e3)}if(this._resHeaders[\"last-modified\"]){let s=Date.parse(this._resHeaders[\"last-modified\"]);if(isFinite(s)&&r>s)return Math.max(e,(r-s)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+nm(this._rescc[\"stale-if-error\"]),s=e+nm(this._rescc[\"stale-while-revalidate\"]);return Math.max(0,e,r,s)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+nm(this._rescc[\"stale-if-error\"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+nm(this._rescc[\"stale-while-revalidate\"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error(\"Reinitialized\");if(!e||e.v!==1)throw Error(\"Invalid serialization\");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r[\"if-range\"],!this._requestMatches(e,!0)||!this.storable())return delete r[\"if-none-match\"],delete r[\"if-modified-since\"],r;if(this._resHeaders.etag&&(r[\"if-none-match\"]=r[\"if-none-match\"]?`${r[\"if-none-match\"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r[\"accept-ranges\"]||r[\"if-match\"]||r[\"if-unmodified-since\"]||this._method&&this._method!=\"GET\"){if(delete r[\"if-modified-since\"],r[\"if-none-match\"]){let a=r[\"if-none-match\"].split(/,/).filter(n=>!/^\\s*W\\//.test(n));a.length?r[\"if-none-match\"]=a.join(\",\").trim():delete r[\"if-none-match\"]}}else this._resHeaders[\"last-modified\"]&&!r[\"if-modified-since\"]&&(r[\"if-modified-since\"]=this._resHeaders[\"last-modified\"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&utt(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error(\"Response headers missing\");let s=!1;if(r.status!==void 0&&r.status!=304?s=!1:r.headers.etag&&!/^\\s*W\\//.test(r.headers.etag)?s=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\\s*W\\//,\"\")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?s=this._resHeaders.etag.replace(/^\\s*W\\//,\"\")===r.headers.etag.replace(/^\\s*W\\//,\"\"):this._resHeaders[\"last-modified\"]?s=this._resHeaders[\"last-modified\"]===r.headers[\"last-modified\"]:!this._resHeaders.etag&&!this._resHeaders[\"last-modified\"]&&!r.headers.etag&&!r.headers[\"last-modified\"]&&(s=!0),!s)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let a={};for(let c in this._resHeaders)a[c]=c in r.headers&&!ctt[c]?r.headers[c]:this._resHeaders[c];let n=Object.assign({},r,{status:this._status,method:this._method,headers:a});return{policy:new this.constructor(e,n,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var YQ=_((TMt,sfe)=>{\"use strict\";sfe.exports=t=>{let e={};for(let[r,s]of Object.entries(t))e[r.toLowerCase()]=s;return e}});var afe=_((RMt,ofe)=>{\"use strict\";var Att=Ie(\"stream\").Readable,ptt=YQ(),AH=class extends Att{constructor(e,r,s,a){if(typeof e!=\"number\")throw new TypeError(\"Argument `statusCode` should be a number\");if(typeof r!=\"object\")throw new TypeError(\"Argument `headers` should be an object\");if(!(s instanceof Buffer))throw new TypeError(\"Argument `body` should be a buffer\");if(typeof a!=\"string\")throw new TypeError(\"Argument `url` should be a string\");super(),this.statusCode=e,this.headers=ptt(r),this.body=s,this.url=a}_read(){this.push(this.body),this.push(null)}};ofe.exports=AH});var cfe=_((FMt,lfe)=>{\"use strict\";var htt=[\"destroy\",\"setTimeout\",\"socket\",\"headers\",\"trailers\",\"rawHeaders\",\"statusCode\",\"httpVersion\",\"httpVersionMinor\",\"httpVersionMajor\",\"rawTrailers\",\"statusMessage\"];lfe.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(htt));for(let s of r)s in e||(e[s]=typeof t[s]==\"function\"?t[s].bind(t):t[s])}});var ffe=_((NMt,ufe)=>{\"use strict\";var gtt=Ie(\"stream\").PassThrough,dtt=cfe(),mtt=t=>{if(!(t&&t.pipe))throw new TypeError(\"Parameter `response` must be a response stream.\");let e=new gtt;return dtt(t,e),t.pipe(e)};ufe.exports=mtt});var Afe=_(pH=>{pH.stringify=function t(e){if(typeof e>\"u\")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(\":base64:\"+e.toString(\"base64\"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e==\"object\"){var r=\"\",s=Array.isArray(e);r=s?\"[\":\"{\";var a=!0;for(var n in e){var c=typeof e[n]==\"function\"||!s&&typeof e[n]>\"u\";Object.hasOwnProperty.call(e,n)&&!c&&(a||(r+=\",\"),a=!1,s?e[n]==null?r+=\"null\":r+=t(e[n]):e[n]!==void 0&&(r+=t(n)+\":\"+t(e[n])))}return r+=s?\"]\":\"}\",r}else return typeof e==\"string\"?JSON.stringify(/^:/.test(e)?\":\"+e:e):typeof e>\"u\"?\"null\":JSON.stringify(e)};pH.parse=function(t){return JSON.parse(t,function(e,r){return typeof r==\"string\"?/^:base64:/.test(r)?Buffer.from(r.substring(8),\"base64\"):/^:/.test(r)?r.substring(1):r:r})}});var dfe=_((LMt,gfe)=>{\"use strict\";var ytt=Ie(\"events\"),pfe=Afe(),Ett=t=>{let e={redis:\"@keyv/redis\",rediss:\"@keyv/redis\",mongodb:\"@keyv/mongo\",mongo:\"@keyv/mongo\",sqlite:\"@keyv/sqlite\",postgresql:\"@keyv/postgres\",postgres:\"@keyv/postgres\",mysql:\"@keyv/mysql\",etcd:\"@keyv/etcd\",offline:\"@keyv/offline\",tiered:\"@keyv/tiered\"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(Ie(e[r]))(t)}return new Map},hfe=[\"sqlite\",\"postgres\",\"mysql\",\"mongo\",\"redis\",\"tiered\"],hH=class extends ytt{constructor(e,{emitErrors:r=!0,...s}={}){if(super(),this.opts={namespace:\"keyv\",serialize:pfe.stringify,deserialize:pfe.parse,...typeof e==\"string\"?{uri:e}:e,...s},!this.opts.store){let n={...this.opts};this.opts.store=Ett(n)}if(this.opts.compression){let n=this.opts.compression;this.opts.serialize=n.serialize.bind(n),this.opts.deserialize=n.deserialize.bind(n)}typeof this.opts.store.on==\"function\"&&r&&this.opts.store.on(\"error\",n=>this.emit(\"error\",n)),this.opts.store.namespace=this.opts.namespace;let a=n=>async function*(){for await(let[c,f]of typeof n==\"function\"?n(this.opts.store.namespace):n){let p=await this.opts.deserialize(f);if(!(this.opts.store.namespace&&!c.includes(this.opts.store.namespace))){if(typeof p.expires==\"number\"&&Date.now()>p.expires){this.delete(c);continue}yield[this._getKeyUnprefix(c),p.value]}}};typeof this.opts.store[Symbol.iterator]==\"function\"&&this.opts.store instanceof Map?this.iterator=a(this.opts.store):typeof this.opts.store.iterator==\"function\"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=a(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return hfe.includes(this.opts.store.opts.dialect)||hfe.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(\":\").splice(1).join(\":\")}get(e,r){let{store:s}=this.opts,a=Array.isArray(e),n=a?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(a&&s.getMany===void 0){let c=[];for(let f of n)c.push(Promise.resolve().then(()=>s.get(f)).then(p=>typeof p==\"string\"?this.opts.deserialize(p):this.opts.compression?this.opts.deserialize(p):p).then(p=>{if(p!=null)return typeof p.expires==\"number\"&&Date.now()>p.expires?this.delete(f).then(()=>{}):r&&r.raw?p:p.value}));return Promise.allSettled(c).then(f=>{let p=[];for(let h of f)p.push(h.value);return p})}return Promise.resolve().then(()=>a?s.getMany(n):s.get(n)).then(c=>typeof c==\"string\"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return a?c.map((f,p)=>{if(typeof f==\"string\"&&(f=this.opts.deserialize(f)),f!=null){if(typeof f.expires==\"number\"&&Date.now()>f.expires){this.delete(e[p]).then(()=>{});return}return r&&r.raw?f:f.value}}):typeof c.expires==\"number\"&&Date.now()>c.expires?this.delete(e).then(()=>{}):r&&r.raw?c:c.value})}set(e,r,s){let a=this._getKeyPrefix(e);typeof s>\"u\"&&(s=this.opts.ttl),s===0&&(s=void 0);let{store:n}=this.opts;return Promise.resolve().then(()=>{let c=typeof s==\"number\"?Date.now()+s:null;return typeof r==\"symbol\"&&this.emit(\"error\",\"symbol cannot be serialized\"),r={value:r,expires:c},this.opts.serialize(r)}).then(c=>n.set(a,c,s)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let a=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let n=[];for(let c of a)n.push(r.delete(c));return Promise.allSettled(n).then(c=>c.every(f=>f.value===!0))}return Promise.resolve().then(()=>r.deleteMany(a))}let s=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(s))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:s}=this.opts;return Promise.resolve().then(async()=>typeof s.has==\"function\"?s.has(r):await s.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect==\"function\")return e.disconnect()}};gfe.exports=hH});var Efe=_((UMt,yfe)=>{\"use strict\";var Itt=Ie(\"events\"),VQ=Ie(\"url\"),Ctt=Gue(),wtt=rfe(),gH=ife(),mfe=afe(),Btt=YQ(),vtt=ffe(),Stt=dfe(),KB=class t{constructor(e,r){if(typeof e!=\"function\")throw new TypeError(\"Parameter `request` must be a function\");return this.cache=new Stt({uri:typeof r==\"string\"&&r,store:typeof r!=\"string\"&&r,namespace:\"cacheable-request\"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,s)=>{let a;if(typeof r==\"string\")a=dH(VQ.parse(r)),r={};else if(r instanceof VQ.URL)a=dH(VQ.parse(r.toString())),r={};else{let[C,...S]=(r.path||\"\").split(\"?\"),P=S.length>0?`?${S.join(\"?\")}`:\"\";a=dH({...r,pathname:C,search:P})}r={headers:{},method:\"GET\",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...Dtt(a)},r.headers=Btt(r.headers);let n=new Itt,c=Ctt(VQ.format(a),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),f=`${r.method}:${c}`,p=!1,h=!1,E=C=>{h=!0;let S=!1,P,I=new Promise(N=>{P=()=>{S||(S=!0,N())}}),R=N=>{if(p&&!C.forceRefresh){N.status=N.statusCode;let W=gH.fromObject(p.cachePolicy).revalidatedPolicy(C,N);if(!W.modified){let ee=W.policy.responseHeaders();N=new mfe(p.statusCode,ee,p.body,p.url),N.cachePolicy=W.policy,N.fromCache=!0}}N.fromCache||(N.cachePolicy=new gH(C,N,C),N.fromCache=!1);let U;C.cache&&N.cachePolicy.storable()?(U=vtt(N),(async()=>{try{let W=wtt.buffer(N);if(await Promise.race([I,new Promise(le=>N.once(\"end\",le))]),S)return;let ee=await W,ie={cachePolicy:N.cachePolicy.toObject(),url:N.url,statusCode:N.fromCache?p.statusCode:N.statusCode,body:ee},ue=C.strictTtl?N.cachePolicy.timeToLive():void 0;C.maxTtl&&(ue=ue?Math.min(ue,C.maxTtl):C.maxTtl),await this.cache.set(f,ie,ue)}catch(W){n.emit(\"error\",new t.CacheError(W))}})()):C.cache&&p&&(async()=>{try{await this.cache.delete(f)}catch(W){n.emit(\"error\",new t.CacheError(W))}})(),n.emit(\"response\",U||N),typeof s==\"function\"&&s(U||N)};try{let N=e(C,R);N.once(\"error\",P),N.once(\"abort\",P),n.emit(\"request\",N)}catch(N){n.emit(\"error\",new t.RequestError(N))}};return(async()=>{let C=async P=>{await Promise.resolve();let I=P.cache?await this.cache.get(f):void 0;if(typeof I>\"u\")return E(P);let R=gH.fromObject(I.cachePolicy);if(R.satisfiesWithoutRevalidation(P)&&!P.forceRefresh){let N=R.responseHeaders(),U=new mfe(I.statusCode,N,I.body,I.url);U.cachePolicy=R,U.fromCache=!0,n.emit(\"response\",U),typeof s==\"function\"&&s(U)}else p=I,P.headers=R.revalidationHeaders(P),E(P)},S=P=>n.emit(\"error\",new t.CacheError(P));this.cache.once(\"error\",S),n.on(\"response\",()=>this.cache.removeListener(\"error\",S));try{await C(r)}catch(P){r.automaticFailover&&!h&&E(r),n.emit(\"error\",new t.CacheError(P))}})(),n}}};function Dtt(t){let e={...t};return e.path=`${t.pathname||\"/\"}${t.search||\"\"}`,delete e.pathname,delete e.search,e}function dH(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||\"localhost\",port:t.port,pathname:t.pathname,search:t.search}}KB.RequestError=class extends Error{constructor(t){super(t.message),this.name=\"RequestError\",Object.assign(this,t)}};KB.CacheError=class extends Error{constructor(t){super(t.message),this.name=\"CacheError\",Object.assign(this,t)}};yfe.exports=KB});var Cfe=_((jMt,Ife)=>{\"use strict\";var btt=[\"aborted\",\"complete\",\"headers\",\"httpVersion\",\"httpVersionMinor\",\"httpVersionMajor\",\"method\",\"rawHeaders\",\"rawTrailers\",\"setTimeout\",\"socket\",\"statusCode\",\"statusMessage\",\"trailers\",\"url\"];Ife.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error(\"The second stream must have the `autoDestroy` option set to `false`\");let r=new Set(Object.keys(t).concat(btt)),s={};for(let a of r)a in e||(s[a]={get(){let n=t[a];return typeof n==\"function\"?n.bind(t):n},set(n){t[a]=n},enumerable:!0,configurable:!1});return Object.defineProperties(e,s),t.once(\"aborted\",()=>{e.destroy(),e.emit(\"aborted\")}),t.once(\"close\",()=>{t.complete&&e.readable?e.once(\"end\",()=>{e.emit(\"close\")}):e.emit(\"close\")}),e}});var Bfe=_((GMt,wfe)=>{\"use strict\";var{Transform:Ptt,PassThrough:xtt}=Ie(\"stream\"),mH=Ie(\"zlib\"),ktt=Cfe();wfe.exports=t=>{let e=(t.headers[\"content-encoding\"]||\"\").toLowerCase();if(![\"gzip\",\"deflate\",\"br\"].includes(e))return t;let r=e===\"br\";if(r&&typeof mH.createBrotliDecompress!=\"function\")return t.destroy(new Error(\"Brotli is not supported on Node.js < 12\")),t;let s=!0,a=new Ptt({transform(f,p,h){s=!1,h(null,f)},flush(f){f()}}),n=new xtt({autoDestroy:!1,destroy(f,p){t.destroy(),p(f)}}),c=r?mH.createBrotliDecompress():mH.createUnzip();return c.once(\"error\",f=>{if(s&&!t.readable){n.end();return}n.destroy(f)}),ktt(t,n),t.pipe(a).pipe(c).pipe(n),n}});var EH=_((qMt,vfe)=>{\"use strict\";var yH=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError(\"`maxSize` must be a number greater than 0\");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction==\"function\")for(let[s,a]of this.oldCache.entries())this.onEviction(s,a);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};vfe.exports=yH});var CH=_((WMt,Pfe)=>{\"use strict\";var Qtt=Ie(\"events\"),Ttt=Ie(\"tls\"),Rtt=Ie(\"http2\"),Ftt=EH(),Pa=Symbol(\"currentStreamsCount\"),Sfe=Symbol(\"request\"),Rc=Symbol(\"cachedOriginSet\"),gI=Symbol(\"gracefullyClosing\"),Ntt=[\"maxDeflateDynamicTableSize\",\"maxSessionMemory\",\"maxHeaderListPairs\",\"maxOutstandingPings\",\"maxReservedRemoteStreams\",\"maxSendHeaderBlockLength\",\"paddingStrategy\",\"localAddress\",\"path\",\"rejectUnauthorized\",\"minDHSize\",\"ca\",\"cert\",\"clientCertEngine\",\"ciphers\",\"key\",\"pfx\",\"servername\",\"minVersion\",\"maxVersion\",\"secureProtocol\",\"crl\",\"honorCipherOrder\",\"ecdhCurve\",\"dhparam\",\"secureOptions\",\"sessionIdContext\"],Ott=(t,e,r)=>{let s=0,a=t.length;for(;s<a;){let n=s+a>>>1;r(t[n],e)?s=n+1:a=n}return s},Ltt=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,IH=(t,e)=>{for(let r of t)r[Rc].length<e[Rc].length&&r[Rc].every(s=>e[Rc].includes(s))&&r[Pa]+e[Pa]<=e.remoteSettings.maxConcurrentStreams&&bfe(r)},Mtt=(t,e)=>{for(let r of t)e[Rc].length<r[Rc].length&&e[Rc].every(s=>r[Rc].includes(s))&&e[Pa]+r[Pa]<=r.remoteSettings.maxConcurrentStreams&&bfe(e)},Dfe=({agent:t,isFree:e})=>{let r={};for(let s in t.sessions){let n=t.sessions[s].filter(c=>{let f=c[im.kCurrentStreamsCount]<c.remoteSettings.maxConcurrentStreams;return e?f:!f});n.length!==0&&(r[s]=n)}return r},bfe=t=>{t[gI]=!0,t[Pa]===0&&t.close()},im=class t extends Qtt{constructor({timeout:e=6e4,maxSessions:r=1/0,maxFreeSessions:s=10,maxCachedTlsSessions:a=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=s,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new Ftt({maxSize:a})}static normalizeOrigin(e,r){return typeof e==\"string\"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r=\"\";if(e)for(let s of Ntt)e[s]&&(r+=`:${e[s]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let s=this.queue[e][r];this._sessionsCount<this.maxSessions&&!s.completed&&(s.completed=!0,s())}getSession(e,r,s){return new Promise((a,n)=>{Array.isArray(s)?(s=[...s],a()):s=[{resolve:a,reject:n}];let c=this.normalizeOptions(r),f=t.normalizeOrigin(e,r&&r.servername);if(f===void 0){for(let{reject:E}of s)E(new TypeError(\"The `origin` argument needs to be a string or an URL object\"));return}if(c in this.sessions){let E=this.sessions[c],C=-1,S=-1,P;for(let I of E){let R=I.remoteSettings.maxConcurrentStreams;if(R<C)break;if(I[Rc].includes(f)){let N=I[Pa];if(N>=R||I[gI]||I.destroyed)continue;P||(C=R),N>S&&(P=I,S=N)}}if(P){if(s.length!==1){for(let{reject:I}of s){let R=new Error(`Expected the length of listeners to be 1, got ${s.length}.\nPlease report this to https://github.com/szmarczak/http2-wrapper/`);I(R)}return}s[0].resolve(P);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...s),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let p=()=>{c in this.queue&&this.queue[c][f]===h&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},h=()=>{let E=`${f}:${c}`,C=!1;try{let S=Rtt.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[Pa]=0,S[gI]=!1;let P=()=>S[Pa]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once(\"session\",N=>{this.tlsSessionCache.set(E,N)}),S.once(\"error\",N=>{for(let{reject:U}of s)U(N);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once(\"close\",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[c];N.splice(N.indexOf(S),1),N.length===0&&delete this.sessions[c]}else{let N=new Error(\"Session closed without receiving a SETTINGS frame\");N.code=\"HTTP2WRAPPER_NOSETTINGS\";for(let{reject:U}of s)U(N);p()}this._tryToCreateNewSession(c,f)});let R=()=>{if(!(!(c in this.queue)||!P())){for(let N of S[Rc])if(N in this.queue[c]){let{listeners:U}=this.queue[c][N];for(;U.length!==0&&P();)U.shift().resolve(S);let W=this.queue[c];if(W[N].listeners.length===0&&(delete W[N],Object.keys(W).length===0)){delete this.queue[c];break}if(!P())break}}};S.on(\"origin\",()=>{S[Rc]=S.originSet,P()&&(R(),IH(this.sessions[c],S))}),S.once(\"remoteSettings\",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let N=new Error(\"Agent has been destroyed\");for(let U of s)U.reject(N);S.destroy();return}S[Rc]=S.originSet;{let N=this.sessions;if(c in N){let U=N[c];U.splice(Ott(U,S,Ltt),0,S)}else N[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit(\"session\",S),R(),p(),S[Pa]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on(\"remoteSettings\",()=>{R(),IH(this.sessions[c],S)})}),S[Sfe]=S.request,S.request=(N,U)=>{if(S[gI])throw new Error(\"The session is gracefully closing. No new streams are allowed.\");let W=S[Sfe](N,U);return S.ref(),++S[Pa],S[Pa]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,W.once(\"close\",()=>{if(I=P(),--S[Pa],!S.destroyed&&!S.closed&&(Mtt(this.sessions[c],S),P()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let ee=S[Pa]===0;ee&&S.unref(),ee&&(this._freeSessionsCount>this.maxFreeSessions||S[gI])?S.close():(IH(this.sessions[c],S),R())}}),W}}catch(S){for(let P of s)P.reject(S);p()}};h.listeners=s,h.completed=!1,h.destroyed=!1,this.queue[c][f]=h,this._tryToCreateNewSession(c,f)})}request(e,r,s,a){return new Promise((n,c)=>{this.getSession(e,r,[{reject:c,resolve:f=>{try{n(f.request(s,a))}catch(p){c(p)}}}])})}createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=[\"h2\"];let s=e.port||443,a=e.hostname||e.host;return typeof r.servername>\"u\"&&(r.servername=a),Ttt.connect(s,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[Pa]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let s of r)s.destroy(e);for(let r of Object.values(this.queue))for(let s of Object.values(r))s.destroyed=!0;this.queue={}}get freeSessions(){return Dfe({agent:this,isFree:!0})}get busySessions(){return Dfe({agent:this,isFree:!1})}};im.kCurrentStreamsCount=Pa;im.kGracefullyClosing=gI;Pfe.exports={Agent:im,globalAgent:new im}});var BH=_((YMt,xfe)=>{\"use strict\";var{Readable:Utt}=Ie(\"stream\"),wH=class extends Utt{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage=\"\",this.httpVersion=\"2.0\",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners(\"data\"),this.resume())}_read(){this.req&&this.req._request.resume()}};xfe.exports=wH});var vH=_((VMt,kfe)=>{\"use strict\";kfe.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname==\"string\"&&t.hostname.startsWith(\"[\")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||\"\"}${t.search||\"\"}`};return typeof t.port==\"string\"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||\"\"}:${t.password||\"\"}`),e}});var Tfe=_((JMt,Qfe)=>{\"use strict\";Qfe.exports=(t,e,r)=>{for(let s of r)t.on(s,(...a)=>e.emit(s,...a))}});var Ffe=_((KMt,Rfe)=>{\"use strict\";Rfe.exports=t=>{switch(t){case\":method\":case\":scheme\":case\":authority\":case\":path\":return!0;default:return!1}}});var Ofe=_((XMt,Nfe)=>{\"use strict\";var dI=(t,e,r)=>{Nfe.exports[e]=class extends t{constructor(...a){super(typeof r==\"string\"?r:r(a)),this.name=`${super.name} [${e}]`,this.code=e}}};dI(TypeError,\"ERR_INVALID_ARG_TYPE\",t=>{let e=t[0].includes(\".\")?\"property\":\"argument\",r=t[1],s=Array.isArray(r);return s&&(r=`${r.slice(0,-1).join(\", \")} or ${r.slice(-1)}`),`The \"${t[0]}\" ${e} must be ${s?\"one of\":\"of\"} type ${r}. Received ${typeof t[2]}`});dI(TypeError,\"ERR_INVALID_PROTOCOL\",t=>`Protocol \"${t[0]}\" not supported. Expected \"${t[1]}\"`);dI(Error,\"ERR_HTTP_HEADERS_SENT\",t=>`Cannot ${t[0]} headers after they are sent to the client`);dI(TypeError,\"ERR_INVALID_HTTP_TOKEN\",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);dI(TypeError,\"ERR_HTTP_INVALID_HEADER_VALUE\",t=>`Invalid value \"${t[0]} for header \"${t[1]}\"`);dI(TypeError,\"ERR_INVALID_CHAR\",t=>`Invalid character in ${t[0]} [${t[1]}]`)});var xH=_((ZMt,Gfe)=>{\"use strict\";var _tt=Ie(\"http2\"),{Writable:Htt}=Ie(\"stream\"),{Agent:Lfe,globalAgent:jtt}=CH(),Gtt=BH(),qtt=vH(),Wtt=Tfe(),Ytt=Ffe(),{ERR_INVALID_ARG_TYPE:SH,ERR_INVALID_PROTOCOL:Vtt,ERR_HTTP_HEADERS_SENT:Mfe,ERR_INVALID_HTTP_TOKEN:Jtt,ERR_HTTP_INVALID_HEADER_VALUE:Ktt,ERR_INVALID_CHAR:ztt}=Ofe(),{HTTP2_HEADER_STATUS:Ufe,HTTP2_HEADER_METHOD:_fe,HTTP2_HEADER_PATH:Hfe,HTTP2_METHOD_CONNECT:Xtt}=_tt.constants,Jo=Symbol(\"headers\"),DH=Symbol(\"origin\"),bH=Symbol(\"session\"),jfe=Symbol(\"options\"),JQ=Symbol(\"flushedHeaders\"),zB=Symbol(\"jobs\"),Ztt=/^[\\^`\\-\\w!#$%&*+.|~]+$/,$tt=/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/,PH=class extends Htt{constructor(e,r,s){super({autoDestroy:!1});let a=typeof e==\"string\"||e instanceof URL;if(a&&(e=qtt(e instanceof URL?e:new URL(e))),typeof r==\"function\"||r===void 0?(s=r,r=a?e:{...e}):r={...e,...r},r.h2session)this[bH]=r.h2session;else if(r.agent===!1)this.agent=new Lfe({maxFreeSessions:0});else if(typeof r.agent>\"u\"||r.agent===null)typeof r.createConnection==\"function\"?(this.agent=new Lfe({maxFreeSessions:0}),this.agent.createConnection=r.createConnection):this.agent=jtt;else if(typeof r.agent.request==\"function\")this.agent=r.agent;else throw new SH(\"options.agent\",[\"Agent-like Object\",\"undefined\",\"false\"],r.agent);if(r.protocol&&r.protocol!==\"https:\")throw new Vtt(r.protocol,\"https:\");let n=r.port||r.defaultPort||this.agent&&this.agent.defaultPort||443,c=r.hostname||r.host||\"localhost\";delete r.hostname,delete r.host,delete r.port;let{timeout:f}=r;if(r.timeout=void 0,this[Jo]=Object.create(null),this[zB]=[],this.socket=null,this.connection=null,this.method=r.method||\"GET\",this.path=r.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,r.headers)for(let[p,h]of Object.entries(r.headers))this.setHeader(p,h);r.auth&&!(\"authorization\"in this[Jo])&&(this[Jo].authorization=\"Basic \"+Buffer.from(r.auth).toString(\"base64\")),r.session=r.tlsSession,r.path=r.socketPath,this[jfe]=r,n===443?(this[DH]=`https://${c}`,\":authority\"in this[Jo]||(this[Jo][\":authority\"]=c)):(this[DH]=`https://${c}:${n}`,\":authority\"in this[Jo]||(this[Jo][\":authority\"]=`${c}:${n}`)),f&&this.setTimeout(f),s&&this.once(\"response\",s),this[JQ]=!1}get method(){return this[Jo][_fe]}set method(e){e&&(this[Jo][_fe]=e.toUpperCase())}get path(){return this[Jo][Hfe]}set path(e){e&&(this[Jo][Hfe]=e)}get _mustNotHaveABody(){return this.method===\"GET\"||this.method===\"HEAD\"||this.method===\"DELETE\"}_write(e,r,s){if(this._mustNotHaveABody){s(new Error(\"The GET, HEAD and DELETE methods must NOT have a body\"));return}this.flushHeaders();let a=()=>this._request.write(e,r,s);this._request?a():this[zB].push(a)}_final(e){if(this.destroyed)return;this.flushHeaders();let r=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?r():this[zB].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit(\"abort\")),this.aborted=!0,this.destroy())}_destroy(e,r){this.res&&this.res._dump(),this._request&&this._request.destroy(),r(e)}async flushHeaders(){if(this[JQ]||this.destroyed)return;this[JQ]=!0;let e=this.method===Xtt,r=s=>{if(this._request=s,this.destroyed){s.destroy();return}e||Wtt(s,this,[\"timeout\",\"continue\",\"close\",\"error\"]);let a=c=>(...f)=>{!this.writable&&!this.destroyed?c(...f):this.once(\"finish\",()=>{c(...f)})};s.once(\"response\",a((c,f,p)=>{let h=new Gtt(this.socket,s.readableHighWaterMark);this.res=h,h.req=this,h.statusCode=c[Ufe],h.headers=c,h.rawHeaders=p,h.once(\"end\",()=>{this.aborted?(h.aborted=!0,h.emit(\"aborted\")):(h.complete=!0,h.socket=null,h.connection=null)}),e?(h.upgrade=!0,this.emit(\"connect\",h,s,Buffer.alloc(0))?this.emit(\"close\"):s.destroy()):(s.on(\"data\",E=>{!h._dumped&&!h.push(E)&&s.pause()}),s.once(\"end\",()=>{h.push(null)}),this.emit(\"response\",h)||h._dump())})),s.once(\"headers\",a(c=>this.emit(\"information\",{statusCode:c[Ufe]}))),s.once(\"trailers\",a((c,f,p)=>{let{res:h}=this;h.trailers=c,h.rawTrailers=p}));let{socket:n}=s.session;this.socket=n,this.connection=n;for(let c of this[zB])c();this.emit(\"socket\",this.socket)};if(this[bH])try{r(this[bH].request(this[Jo]))}catch(s){this.emit(\"error\",s)}else{this.reusedSocket=!0;try{r(await this.agent.request(this[DH],this[jfe],this[Jo]))}catch(s){this.emit(\"error\",s)}}}getHeader(e){if(typeof e!=\"string\")throw new SH(\"name\",\"string\",e);return this[Jo][e.toLowerCase()]}get headersSent(){return this[JQ]}removeHeader(e){if(typeof e!=\"string\")throw new SH(\"name\",\"string\",e);if(this.headersSent)throw new Mfe(\"remove\");delete this[Jo][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new Mfe(\"set\");if(typeof e!=\"string\"||!Ztt.test(e)&&!Ytt(e))throw new Jtt(\"Header name\",e);if(typeof r>\"u\")throw new Ktt(r,e);if($tt.test(r))throw new ztt(\"header content\",e);this[Jo][e.toLowerCase()]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let s=()=>this._request.setTimeout(e,r);return this._request?s():this[zB].push(s),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Gfe.exports=PH});var Wfe=_(($Mt,qfe)=>{\"use strict\";var ert=Ie(\"tls\");qfe.exports=(t={},e=ert.connect)=>new Promise((r,s)=>{let a=!1,n,c=async()=>{await p,n.off(\"timeout\",f),n.off(\"error\",s),t.resolveSocket?(r({alpnProtocol:n.alpnProtocol,socket:n,timeout:a}),a&&(await Promise.resolve(),n.emit(\"timeout\"))):(n.destroy(),r({alpnProtocol:n.alpnProtocol,timeout:a}))},f=async()=>{a=!0,c()},p=(async()=>{try{n=await e(t,c),n.on(\"error\",s),n.once(\"timeout\",f)}catch(h){s(h)}})()})});var Vfe=_((eUt,Yfe)=>{\"use strict\";var trt=Ie(\"net\");Yfe.exports=t=>{let e=t.host,r=t.headers&&t.headers.host;return r&&(r.startsWith(\"[\")?r.indexOf(\"]\")===-1?e=r:e=r.slice(1,-1):e=r.split(\":\",1)[0]),trt.isIP(e)?\"\":e}});var zfe=_((tUt,QH)=>{\"use strict\";var Jfe=Ie(\"http\"),kH=Ie(\"https\"),rrt=Wfe(),nrt=EH(),irt=xH(),srt=Vfe(),ort=vH(),KQ=new nrt({maxSize:100}),XB=new Map,Kfe=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let s=()=>{t.emit(\"free\",e,r)};e.on(\"free\",s);let a=()=>{t.removeSocket(e,r)};e.on(\"close\",a);let n=()=>{t.removeSocket(e,r),e.off(\"close\",a),e.off(\"free\",s),e.off(\"agentRemove\",n)};e.on(\"agentRemove\",n),t.emit(\"free\",e,r)},art=async t=>{let e=`${t.host}:${t.port}:${t.ALPNProtocols.sort()}`;if(!KQ.has(e)){if(XB.has(e))return(await XB.get(e)).alpnProtocol;let{path:r,agent:s}=t;t.path=t.socketPath;let a=rrt(t);XB.set(e,a);try{let{socket:n,alpnProtocol:c}=await a;if(KQ.set(e,c),t.path=r,c===\"h2\")n.destroy();else{let{globalAgent:f}=kH,p=kH.Agent.prototype.createConnection;s?s.createConnection===p?Kfe(s,n,t):n.destroy():f.createConnection===p?Kfe(f,n,t):n.destroy()}return XB.delete(e),c}catch(n){throw XB.delete(e),n}}return KQ.get(e)};QH.exports=async(t,e,r)=>{if((typeof t==\"string\"||t instanceof URL)&&(t=ort(new URL(t))),typeof e==\"function\"&&(r=e,e=void 0),e={ALPNProtocols:[\"h2\",\"http/1.1\"],...t,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error(\"The `ALPNProtocols` option must be an Array with at least one entry\");e.protocol=e.protocol||\"https:\";let s=e.protocol===\"https:\";e.host=e.hostname||e.host||\"localhost\",e.session=e.tlsSession,e.servername=e.servername||srt(e),e.port=e.port||(s?443:80),e._defaultAgent=s?kH.globalAgent:Jfe.globalAgent;let a=e.agent;if(a){if(a.addRequest)throw new Error(\"The `options.agent` object can contain only `http`, `https` or `http2` properties\");e.agent=a[s?\"https\":\"http\"]}return s&&await art(e)===\"h2\"?(a&&(e.agent=a.http2),new irt(e,r)):Jfe.request(e,r)};QH.exports.protocolCache=KQ});var Zfe=_((rUt,Xfe)=>{\"use strict\";var lrt=Ie(\"http2\"),crt=CH(),TH=xH(),urt=BH(),frt=zfe(),Art=(t,e,r)=>new TH(t,e,r),prt=(t,e,r)=>{let s=new TH(t,e,r);return s.end(),s};Xfe.exports={...lrt,ClientRequest:TH,IncomingMessage:urt,...crt,request:Art,get:prt,auto:frt}});var FH=_(RH=>{\"use strict\";Object.defineProperty(RH,\"__esModule\",{value:!0});var $fe=Np();RH.default=t=>$fe.default.nodeStream(t)&&$fe.default.function_(t.getBoundary)});var nAe=_(NH=>{\"use strict\";Object.defineProperty(NH,\"__esModule\",{value:!0});var tAe=Ie(\"fs\"),rAe=Ie(\"util\"),eAe=Np(),hrt=FH(),grt=rAe.promisify(tAe.stat);NH.default=async(t,e)=>{if(e&&\"content-length\"in e)return Number(e[\"content-length\"]);if(!t)return 0;if(eAe.default.string(t))return Buffer.byteLength(t);if(eAe.default.buffer(t))return t.length;if(hrt.default(t))return rAe.promisify(t.getLength.bind(t))();if(t instanceof tAe.ReadStream){let{size:r}=await grt(t.path);return r===0?void 0:r}}});var LH=_(OH=>{\"use strict\";Object.defineProperty(OH,\"__esModule\",{value:!0});function drt(t,e,r){let s={};for(let a of r)s[a]=(...n)=>{e.emit(a,...n)},t.on(a,s[a]);return()=>{for(let a of r)t.off(a,s[a])}}OH.default=drt});var iAe=_(MH=>{\"use strict\";Object.defineProperty(MH,\"__esModule\",{value:!0});MH.default=()=>{let t=[];return{once(e,r,s){e.once(r,s),t.push({origin:e,event:r,fn:s})},unhandleAll(){for(let e of t){let{origin:r,event:s,fn:a}=e;r.removeListener(s,a)}t.length=0}}}});var oAe=_(ZB=>{\"use strict\";Object.defineProperty(ZB,\"__esModule\",{value:!0});ZB.TimeoutError=void 0;var mrt=Ie(\"net\"),yrt=iAe(),sAe=Symbol(\"reentry\"),Ert=()=>{},zQ=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),this.event=r,this.name=\"TimeoutError\",this.code=\"ETIMEDOUT\"}};ZB.TimeoutError=zQ;ZB.default=(t,e,r)=>{if(sAe in t)return Ert;t[sAe]=!0;let s=[],{once:a,unhandleAll:n}=yrt.default(),c=(C,S,P)=>{var I;let R=setTimeout(S,C,C,P);(I=R.unref)===null||I===void 0||I.call(R);let N=()=>{clearTimeout(R)};return s.push(N),N},{host:f,hostname:p}=r,h=(C,S)=>{t.destroy(new zQ(C,S))},E=()=>{for(let C of s)C();n()};if(t.once(\"error\",C=>{if(E(),t.listenerCount(\"error\")===0)throw C}),t.once(\"close\",E),a(t,\"response\",C=>{a(C,\"end\",E)}),typeof e.request<\"u\"&&c(e.request,h,\"request\"),typeof e.socket<\"u\"){let C=()=>{h(e.socket,\"socket\")};t.setTimeout(e.socket,C),s.push(()=>{t.removeListener(\"timeout\",C)})}return a(t,\"socket\",C=>{var S;let{socketPath:P}=t;if(C.connecting){let I=!!(P??mrt.isIP((S=p??f)!==null&&S!==void 0?S:\"\")!==0);if(typeof e.lookup<\"u\"&&!I&&typeof C.address().address>\"u\"){let R=c(e.lookup,h,\"lookup\");a(C,\"lookup\",R)}if(typeof e.connect<\"u\"){let R=()=>c(e.connect,h,\"connect\");I?a(C,\"connect\",R()):a(C,\"lookup\",N=>{N===null&&a(C,\"connect\",R())})}typeof e.secureConnect<\"u\"&&r.protocol===\"https:\"&&a(C,\"connect\",()=>{let R=c(e.secureConnect,h,\"secureConnect\");a(C,\"secureConnect\",R)})}if(typeof e.send<\"u\"){let I=()=>c(e.send,h,\"send\");C.connecting?a(C,\"connect\",()=>{a(t,\"upload-complete\",I())}):a(t,\"upload-complete\",I())}}),typeof e.response<\"u\"&&a(t,\"upload-complete\",()=>{let C=c(e.response,h,\"response\");a(t,\"response\",C)}),E}});var lAe=_(UH=>{\"use strict\";Object.defineProperty(UH,\"__esModule\",{value:!0});var aAe=Np();UH.default=t=>{t=t;let e={protocol:t.protocol,hostname:aAe.default.string(t.hostname)&&t.hostname.startsWith(\"[\")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||\"\"}${t.search||\"\"}`};return aAe.default.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||\"\"}:${t.password||\"\"}`),e}});var cAe=_(_H=>{\"use strict\";Object.defineProperty(_H,\"__esModule\",{value:!0});var Irt=Ie(\"url\"),Crt=[\"protocol\",\"host\",\"hostname\",\"port\",\"pathname\",\"search\"];_H.default=(t,e)=>{var r,s;if(e.path){if(e.pathname)throw new TypeError(\"Parameters `path` and `pathname` are mutually exclusive.\");if(e.search)throw new TypeError(\"Parameters `path` and `search` are mutually exclusive.\");if(e.searchParams)throw new TypeError(\"Parameters `path` and `searchParams` are mutually exclusive.\")}if(e.search&&e.searchParams)throw new TypeError(\"Parameters `search` and `searchParams` are mutually exclusive.\");if(!t){if(!e.protocol)throw new TypeError(\"No URL protocol specified\");t=`${e.protocol}//${(s=(r=e.hostname)!==null&&r!==void 0?r:e.host)!==null&&s!==void 0?s:\"\"}`}let a=new Irt.URL(t);if(e.path){let n=e.path.indexOf(\"?\");n===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,n),e.search=e.path.slice(n+1)),delete e.path}for(let n of Crt)e[n]&&(a[n]=e[n].toString());return a}});var uAe=_(jH=>{\"use strict\";Object.defineProperty(jH,\"__esModule\",{value:!0});var HH=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e==\"object\"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e==\"object\"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e==\"object\"?this.weakMap.has(e):this.map.has(e)}};jH.default=HH});var qH=_(GH=>{\"use strict\";Object.defineProperty(GH,\"__esModule\",{value:!0});var wrt=async t=>{let e=[],r=0;for await(let s of t)e.push(s),r+=Buffer.byteLength(s);return Buffer.isBuffer(e[0])?Buffer.concat(e,r):Buffer.from(e.join(\"\"))};GH.default=wrt});var AAe=_(sm=>{\"use strict\";Object.defineProperty(sm,\"__esModule\",{value:!0});sm.dnsLookupIpVersionToFamily=sm.isDnsLookupIpVersion=void 0;var fAe={auto:0,ipv4:4,ipv6:6};sm.isDnsLookupIpVersion=t=>t in fAe;sm.dnsLookupIpVersionToFamily=t=>{if(sm.isDnsLookupIpVersion(t))return fAe[t];throw new Error(\"Invalid DNS lookup IP version\")}});var WH=_(XQ=>{\"use strict\";Object.defineProperty(XQ,\"__esModule\",{value:!0});XQ.isResponseOk=void 0;XQ.isResponseOk=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304}});var hAe=_(YH=>{\"use strict\";Object.defineProperty(YH,\"__esModule\",{value:!0});var pAe=new Set;YH.default=t=>{pAe.has(t)||(pAe.add(t),process.emitWarning(`Got: ${t}`,{type:\"DeprecationWarning\"}))}});var gAe=_(VH=>{\"use strict\";Object.defineProperty(VH,\"__esModule\",{value:!0});var Si=Np(),Brt=(t,e)=>{if(Si.default.null_(t.encoding))throw new TypeError(\"To get a Buffer, set `options.responseType` to `buffer` instead\");Si.assert.any([Si.default.string,Si.default.undefined],t.encoding),Si.assert.any([Si.default.boolean,Si.default.undefined],t.resolveBodyOnly),Si.assert.any([Si.default.boolean,Si.default.undefined],t.methodRewriting),Si.assert.any([Si.default.boolean,Si.default.undefined],t.isStream),Si.assert.any([Si.default.string,Si.default.undefined],t.responseType),t.responseType===void 0&&(t.responseType=\"text\");let{retry:r}=t;if(e?t.retry={...e.retry}:t.retry={calculateDelay:s=>s.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Si.default.object(r)?(t.retry={...t.retry,...r},t.retry.methods=[...new Set(t.retry.methods.map(s=>s.toUpperCase()))],t.retry.statusCodes=[...new Set(t.retry.statusCodes)],t.retry.errorCodes=[...new Set(t.retry.errorCodes)]):Si.default.number(r)&&(t.retry.limit=r),Si.default.undefined(t.retry.maxRetryAfter)&&(t.retry.maxRetryAfter=Math.min(...[t.timeout.request,t.timeout.connect].filter(Si.default.number))),Si.default.object(t.pagination)){e&&(t.pagination={...e.pagination,...t.pagination});let{pagination:s}=t;if(!Si.default.function_(s.transform))throw new Error(\"`options.pagination.transform` must be implemented\");if(!Si.default.function_(s.shouldContinue))throw new Error(\"`options.pagination.shouldContinue` must be implemented\");if(!Si.default.function_(s.filter))throw new TypeError(\"`options.pagination.filter` must be implemented\");if(!Si.default.function_(s.paginate))throw new Error(\"`options.pagination.paginate` must be implemented\")}return t.responseType===\"json\"&&t.headers.accept===void 0&&(t.headers.accept=\"application/json\"),t};VH.default=Brt});var dAe=_($B=>{\"use strict\";Object.defineProperty($B,\"__esModule\",{value:!0});$B.retryAfterStatusCodes=void 0;$B.retryAfterStatusCodes=new Set([413,429,503]);var vrt=({attemptCount:t,retryOptions:e,error:r,retryAfter:s})=>{if(t>e.limit)return 0;let a=e.methods.includes(r.options.method),n=e.errorCodes.includes(r.code),c=r.response&&e.statusCodes.includes(r.response.statusCode);if(!a||!n&&!c)return 0;if(r.response){if(s)return e.maxRetryAfter===void 0||s>e.maxRetryAfter?0:s;if(r.response.statusCode===413)return 0}let f=Math.random()*100;return 2**(t-1)*1e3+f};$B.default=vrt});var rv=_(Ln=>{\"use strict\";Object.defineProperty(Ln,\"__esModule\",{value:!0});Ln.UnsupportedProtocolError=Ln.ReadError=Ln.TimeoutError=Ln.UploadError=Ln.CacheError=Ln.HTTPError=Ln.MaxRedirectsError=Ln.RequestError=Ln.setNonEnumerableProperties=Ln.knownHookEvents=Ln.withoutBody=Ln.kIsNormalizedAlready=void 0;var mAe=Ie(\"util\"),yAe=Ie(\"stream\"),Srt=Ie(\"fs\"),w0=Ie(\"url\"),EAe=Ie(\"http\"),JH=Ie(\"http\"),Drt=Ie(\"https\"),brt=Rue(),Prt=_ue(),IAe=Efe(),xrt=Bfe(),krt=Zfe(),Qrt=YQ(),at=Np(),Trt=nAe(),CAe=FH(),Rrt=LH(),wAe=oAe(),Frt=lAe(),BAe=cAe(),Nrt=uAe(),Ort=qH(),vAe=AAe(),Lrt=WH(),B0=hAe(),Mrt=gAe(),Urt=dAe(),KH,po=Symbol(\"request\"),eT=Symbol(\"response\"),mI=Symbol(\"responseSize\"),yI=Symbol(\"downloadedSize\"),EI=Symbol(\"bodySize\"),II=Symbol(\"uploadedSize\"),ZQ=Symbol(\"serverResponsesPiped\"),SAe=Symbol(\"unproxyEvents\"),DAe=Symbol(\"isFromCache\"),zH=Symbol(\"cancelTimeouts\"),bAe=Symbol(\"startedReading\"),CI=Symbol(\"stopReading\"),$Q=Symbol(\"triggerRead\"),v0=Symbol(\"body\"),ev=Symbol(\"jobs\"),PAe=Symbol(\"originalResponse\"),xAe=Symbol(\"retryTimeout\");Ln.kIsNormalizedAlready=Symbol(\"isNormalizedAlready\");var _rt=at.default.string(process.versions.brotli);Ln.withoutBody=new Set([\"GET\",\"HEAD\"]);Ln.knownHookEvents=[\"init\",\"beforeRequest\",\"beforeRedirect\",\"beforeError\",\"beforeRetry\",\"afterResponse\"];function Hrt(t){for(let e in t){let r=t[e];if(!at.default.string(r)&&!at.default.number(r)&&!at.default.boolean(r)&&!at.default.null_(r)&&!at.default.undefined(r))throw new TypeError(`The \\`searchParams\\` value '${String(r)}' must be a string, number, boolean or null`)}}function jrt(t){return at.default.object(t)&&!(\"statusCode\"in t)}var XH=new Nrt.default,Grt=async t=>new Promise((e,r)=>{let s=a=>{r(a)};t.pending||e(),t.once(\"error\",s),t.once(\"ready\",()=>{t.off(\"error\",s),e()})}),qrt=new Set([300,301,302,303,304,307,308]),Wrt=[\"context\",\"body\",\"json\",\"form\"];Ln.setNonEnumerableProperties=(t,e)=>{let r={};for(let s of t)if(s)for(let a of Wrt)a in s&&(r[a]={writable:!0,configurable:!0,enumerable:!1,value:s[a]});Object.defineProperties(e,r)};var fs=class extends Error{constructor(e,r,s){var a;if(super(e),Error.captureStackTrace(this,this.constructor),this.name=\"RequestError\",this.code=r.code,s instanceof aT?(Object.defineProperty(this,\"request\",{enumerable:!1,value:s}),Object.defineProperty(this,\"response\",{enumerable:!1,value:s[eT]}),Object.defineProperty(this,\"options\",{enumerable:!1,value:s.options})):Object.defineProperty(this,\"options\",{enumerable:!1,value:s}),this.timings=(a=this.request)===null||a===void 0?void 0:a.timings,at.default.string(r.stack)&&at.default.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,c=this.stack.slice(n).split(`\n`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`\n`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`\n`)}${f.reverse().join(`\n`)}`}}};Ln.RequestError=fs;var tT=class extends fs{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name=\"MaxRedirectsError\"}};Ln.MaxRedirectsError=tT;var rT=class extends fs{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name=\"HTTPError\"}};Ln.HTTPError=rT;var nT=class extends fs{constructor(e,r){super(e.message,e,r),this.name=\"CacheError\"}};Ln.CacheError=nT;var iT=class extends fs{constructor(e,r){super(e.message,e,r),this.name=\"UploadError\"}};Ln.UploadError=iT;var sT=class extends fs{constructor(e,r,s){super(e.message,e,s),this.name=\"TimeoutError\",this.event=e.event,this.timings=r}};Ln.TimeoutError=sT;var tv=class extends fs{constructor(e,r){super(e.message,e,r),this.name=\"ReadError\"}};Ln.ReadError=tv;var oT=class extends fs{constructor(e){super(`Unsupported protocol \"${e.url.protocol}\"`,{},e),this.name=\"UnsupportedProtocolError\"}};Ln.UnsupportedProtocolError=oT;var Yrt=[\"socket\",\"connect\",\"continue\",\"information\",\"upgrade\",\"timeout\"],aT=class extends yAe.Duplex{constructor(e,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[yI]=0,this[II]=0,this.requestInitialized=!1,this[ZQ]=new Set,this.redirects=[],this[CI]=!1,this[$Q]=!1,this[ev]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on(\"pipe\",h=>{h.prependListener(\"data\",a),h.on(\"data\",n),h.prependListener(\"end\",a),h.on(\"end\",n)}),this.on(\"unpipe\",h=>{h.off(\"data\",a),h.off(\"data\",n),h.off(\"end\",a),h.off(\"end\",n)}),this.on(\"pipe\",h=>{h instanceof JH.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:c,body:f,form:p}=r;if((c||f||p)&&this._lockWrite(),Ln.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,s)}catch(h){at.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof Srt.ReadStream&&await Grt(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError(\"Missing `url` property\");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[po])===null||h===void 0||h.destroy();return}for(let C of this[ev])C();this[ev].length=0,this.requestInitialized=!0}catch(E){if(E instanceof fs){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(e,r,s){var a,n,c,f,p;let h=r;if(at.default.object(e)&&!at.default.urlInstance(e))r={...s,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError(\"The `url` option is mutually exclusive with the `input` argument\");r={...s,...r},e!==void 0&&(r.url=e),at.default.urlInstance(r.url)&&(r.url=new w0.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),at.assert.any([at.default.string,at.default.undefined],r.method),at.assert.any([at.default.object,at.default.undefined],r.headers),at.assert.any([at.default.string,at.default.urlInstance,at.default.undefined],r.prefixUrl),at.assert.any([at.default.object,at.default.undefined],r.cookieJar),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.searchParams),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.cache),at.assert.any([at.default.object,at.default.number,at.default.undefined],r.timeout),at.assert.any([at.default.object,at.default.undefined],r.context),at.assert.any([at.default.object,at.default.undefined],r.hooks),at.assert.any([at.default.boolean,at.default.undefined],r.decompress),at.assert.any([at.default.boolean,at.default.undefined],r.ignoreInvalidCookies),at.assert.any([at.default.boolean,at.default.undefined],r.followRedirect),at.assert.any([at.default.number,at.default.undefined],r.maxRedirects),at.assert.any([at.default.boolean,at.default.undefined],r.throwHttpErrors),at.assert.any([at.default.boolean,at.default.undefined],r.http2),at.assert.any([at.default.boolean,at.default.undefined],r.allowGetBody),at.assert.any([at.default.string,at.default.undefined],r.localAddress),at.assert.any([vAe.isDnsLookupIpVersion,at.default.undefined],r.dnsLookupIpVersion),at.assert.any([at.default.object,at.default.undefined],r.https),at.assert.any([at.default.boolean,at.default.undefined],r.rejectUnauthorized),r.https&&(at.assert.any([at.default.boolean,at.default.undefined],r.https.rejectUnauthorized),at.assert.any([at.default.function_,at.default.undefined],r.https.checkServerIdentity),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificateAuthority),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.key),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificate),at.assert.any([at.default.string,at.default.undefined],r.https.passphrase),at.assert.any([at.default.string,at.default.buffer,at.default.array,at.default.undefined],r.https.pfx)),at.assert.any([at.default.object,at.default.undefined],r.cacheOptions),at.default.string(r.method)?r.method=r.method.toUpperCase():r.method=\"GET\",r.headers===s?.headers?r.headers={...r.headers}:r.headers=Qrt({...s?.headers,...r.headers}),\"slashes\"in r)throw new TypeError(\"The legacy `url.Url` has been deprecated. Use `URL` instead.\");if(\"auth\"in r)throw new TypeError(\"Parameter `auth` is deprecated. Use `username` / `password` instead.\");if(\"searchParams\"in r&&r.searchParams&&r.searchParams!==s?.searchParams){let P;if(at.default.string(r.searchParams)||r.searchParams instanceof w0.URLSearchParams)P=new w0.URLSearchParams(r.searchParams);else{Hrt(r.searchParams),P=new w0.URLSearchParams;for(let I in r.searchParams){let R=r.searchParams[I];R===null?P.append(I,\"\"):R!==void 0&&P.append(I,R)}}(a=s?.searchParams)===null||a===void 0||a.forEach((I,R)=>{P.has(R)||P.append(R,I)}),r.searchParams=P}if(r.username=(n=r.username)!==null&&n!==void 0?n:\"\",r.password=(c=r.password)!==null&&c!==void 0?c:\"\",at.default.undefined(r.prefixUrl)?r.prefixUrl=(f=s?.prefixUrl)!==null&&f!==void 0?f:\"\":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==\"\"&&!r.prefixUrl.endsWith(\"/\")&&(r.prefixUrl+=\"/\")),at.default.string(r.url)){if(r.url.startsWith(\"/\"))throw new Error(\"`input` must not start with a slash when using `prefixUrl`\");r.url=BAe.default(r.prefixUrl+r.url,r)}else(at.default.undefined(r.url)&&r.prefixUrl!==\"\"||r.protocol)&&(r.url=BAe.default(r.prefixUrl,r));if(r.url){\"port\"in r&&delete r.port;let{prefixUrl:P}=r;Object.defineProperty(r,\"prefixUrl\",{set:R=>{let N=r.url;if(!N.href.startsWith(R))throw new Error(`Cannot change \\`prefixUrl\\` from ${P} to ${R}: ${N.href}`);r.url=new w0.URL(R+N.href.slice(P.length)),P=R},get:()=>P});let{protocol:I}=r.url;if(I===\"unix:\"&&(I=\"http:\",r.url=new w0.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),I!==\"http:\"&&I!==\"https:\")throw new oT(r);r.username===\"\"?r.username=r.url.username:r.url.username=r.username,r.password===\"\"?r.password=r.url.password:r.url.password=r.password}let{cookieJar:E}=r;if(E){let{setCookie:P,getCookieString:I}=E;at.assert.function_(P),at.assert.function_(I),P.length===4&&I.length===0&&(P=mAe.promisify(P.bind(r.cookieJar)),I=mAe.promisify(I.bind(r.cookieJar)),r.cookieJar={setCookie:P,getCookieString:I})}let{cache:C}=r;if(C&&(XH.has(C)||XH.set(C,new IAe((P,I)=>{let R=P[po](P,I);return at.default.promise(R)&&(R.once=(N,U)=>{if(N===\"error\")R.catch(U);else if(N===\"abort\")(async()=>{try{(await R).once(\"abort\",U)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${N}`);return R}),R},C))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)KH||(KH=new Prt.default),r.dnsCache=KH;else if(!at.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \\`dnsCache\\` must be a CacheableLookup instance or a boolean, got ${at.default(r.dnsCache)}`);at.default.number(r.timeout)?r.timeout={request:r.timeout}:s&&r.timeout!==s.timeout?r.timeout={...s.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let S=r.hooks===s?.hooks;r.hooks={...r.hooks};for(let P of Ln.knownHookEvents)if(P in r.hooks)if(at.default.array(r.hooks[P]))r.hooks[P]=[...r.hooks[P]];else throw new TypeError(`Parameter \\`${P}\\` must be an Array, got ${at.default(r.hooks[P])}`);else r.hooks[P]=[];if(s&&!S)for(let P of Ln.knownHookEvents)s.hooks[P].length>0&&(r.hooks[P]=[...s.hooks[P],...r.hooks[P]]);if(\"family\"in r&&B0.default('\"options.family\" was never documented, please use \"options.dnsLookupIpVersion\"'),s?.https&&(r.https={...s.https,...r.https}),\"rejectUnauthorized\"in r&&B0.default('\"options.rejectUnauthorized\" is now deprecated, please use \"options.https.rejectUnauthorized\"'),\"checkServerIdentity\"in r&&B0.default('\"options.checkServerIdentity\" was never documented, please use \"options.https.checkServerIdentity\"'),\"ca\"in r&&B0.default('\"options.ca\" was never documented, please use \"options.https.certificateAuthority\"'),\"key\"in r&&B0.default('\"options.key\" was never documented, please use \"options.https.key\"'),\"cert\"in r&&B0.default('\"options.cert\" was never documented, please use \"options.https.certificate\"'),\"passphrase\"in r&&B0.default('\"options.passphrase\" was never documented, please use \"options.https.passphrase\"'),\"pfx\"in r&&B0.default('\"options.pfx\" was never documented, please use \"options.https.pfx\"'),\"followRedirects\"in r)throw new TypeError(\"The `followRedirects` option does not exist. Use `followRedirect` instead.\");if(r.agent){for(let P in r.agent)if(P!==\"http\"&&P!==\"https\"&&P!==\"http2\")throw new TypeError(`Expected the \\`options.agent\\` properties to be \\`http\\`, \\`https\\` or \\`http2\\`, got \\`${P}\\``)}return r.maxRedirects=(p=r.maxRedirects)!==null&&p!==void 0?p:0,Ln.setNonEnumerableProperties([s,h],r),Mrt.default(r,s)}_lockWrite(){let e=()=>{throw new TypeError(\"The payload has been already provided\")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,s=!at.default.undefined(e.form),a=!at.default.undefined(e.json),n=!at.default.undefined(e.body),c=s||a||n,f=Ln.withoutBody.has(e.method)&&!(e.method===\"GET\"&&e.allowGetBody);if(this._cannotHaveBody=f,c){if(f)throw new TypeError(`The \\`${e.method}\\` method cannot be used with a body`);if([n,s,a].filter(p=>p).length>1)throw new TypeError(\"The `body`, `json` and `form` options are mutually exclusive\");if(n&&!(e.body instanceof yAe.Readable)&&!at.default.string(e.body)&&!at.default.buffer(e.body)&&!CAe.default(e.body))throw new TypeError(\"The `body` option must be a stream.Readable, string or Buffer\");if(s&&!at.default.object(e.form))throw new TypeError(\"The `form` option must be an Object\");{let p=!at.default.string(r[\"content-type\"]);n?(CAe.default(e.body)&&p&&(r[\"content-type\"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[v0]=e.body):s?(p&&(r[\"content-type\"]=\"application/x-www-form-urlencoded\"),this[v0]=new w0.URLSearchParams(e.form).toString()):(p&&(r[\"content-type\"]=\"application/json\"),this[v0]=e.stringifyJson(e.json));let h=await Trt.default(this[v0],e.headers);at.default.undefined(r[\"content-length\"])&&at.default.undefined(r[\"transfer-encoding\"])&&!f&&!at.default.undefined(h)&&(r[\"content-length\"]=String(h))}}else f?this._lockWrite():this._unlockWrite();this[EI]=Number(r[\"content-length\"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:s}=r;this[PAe]=e,r.decompress&&(e=xrt(e));let a=e.statusCode,n=e;n.statusMessage=n.statusMessage?n.statusMessage:EAe.STATUS_CODES[a],n.url=r.url.toString(),n.requestUrl=this.requestUrl,n.redirectUrls=this.redirects,n.request=this,n.isFromCache=e.fromCache||!1,n.ip=this.ip,n.retryCount=this.retryCount,this[DAe]=n.isFromCache,this[mI]=Number(e.headers[\"content-length\"])||void 0,this[eT]=e,e.once(\"end\",()=>{this[mI]=this[yI],this.emit(\"downloadProgress\",this.downloadProgress)}),e.once(\"error\",f=>{e.destroy(),this._beforeError(new tv(f,this))}),e.once(\"aborted\",()=>{this._beforeError(new tv({name:\"Error\",message:\"The server aborted pending request\",code:\"ECONNRESET\"},this))}),this.emit(\"downloadProgress\",this.downloadProgress);let c=e.headers[\"set-cookie\"];if(at.default.object(r.cookieJar)&&c){let f=c.map(async p=>r.cookieJar.setCookie(p,s.toString()));r.ignoreInvalidCookies&&(f=f.map(async p=>p.catch(()=>{})));try{await Promise.all(f)}catch(p){this._beforeError(p);return}}if(r.followRedirect&&e.headers.location&&qrt.has(a)){if(e.resume(),this[po]&&(this[zH](),delete this[po],this[SAe]()),(a===303&&r.method!==\"GET\"&&r.method!==\"HEAD\"||!r.methodRewriting)&&(r.method=\"GET\",\"body\"in r&&delete r.body,\"json\"in r&&delete r.json,\"form\"in r&&delete r.form,this[v0]=void 0,delete r.headers[\"content-length\"]),this.redirects.length>=r.maxRedirects){this._beforeError(new tT(this));return}try{let p=Buffer.from(e.headers.location,\"binary\").toString(),h=new w0.URL(p,s),E=h.toString();decodeURI(E),h.hostname!==s.hostname||h.port!==s.port?(\"host\"in r.headers&&delete r.headers.host,\"cookie\"in r.headers&&delete r.headers.cookie,\"authorization\"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username=\"\",r.password=\"\")):(h.username=r.username,h.password=r.password),this.redirects.push(E),r.url=h;for(let C of r.hooks.beforeRedirect)await C(r,n);this.emit(\"redirect\",n,r),await this._makeRequest()}catch(p){this._beforeError(p);return}return}if(r.isStream&&r.throwHttpErrors&&!Lrt.isResponseOk(n)){this._beforeError(new rT(n));return}e.on(\"readable\",()=>{this[$Q]&&this._read()}),this.on(\"resume\",()=>{e.resume()}),this.on(\"pause\",()=>{e.pause()}),e.once(\"end\",()=>{this.push(null)}),this.emit(\"response\",e);for(let f of this[ZQ])if(!f.headersSent){for(let p in e.headers){let h=r.decompress?p!==\"content-encoding\":!0,E=e.headers[p];h&&f.setHeader(p,E)}f.statusCode=a}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:s,url:a}=r;brt.default(e),this[zH]=wAe.default(e,s,a);let n=r.cache?\"cacheableResponse\":\"response\";e.once(n,p=>{this._onResponse(p)}),e.once(\"error\",p=>{var h;e.destroy(),(h=e.res)===null||h===void 0||h.removeAllListeners(\"end\"),p=p instanceof wAe.TimeoutError?new sT(p,this.timings,this):new fs(p.message,p,this),this._beforeError(p)}),this[SAe]=Rrt.default(e,this,Yrt),this[po]=e,this.emit(\"uploadProgress\",this.uploadProgress);let c=this[v0],f=this.redirects.length===0?this:e;at.default.nodeStream(c)?(c.pipe(f),c.once(\"error\",p=>{this._beforeError(new iT(p,this))})):(this._unlockWrite(),at.default.undefined(c)?(this._cannotHaveBody||this._noPipe)&&(f.end(),this._lockWrite()):(this._writeRequest(c,void 0,()=>{}),f.end(),this._lockWrite())),this.emit(\"request\",e)}async _createCacheableRequest(e,r){return new Promise((s,a)=>{Object.assign(r,Frt.default(e)),delete r.url;let n,c=XH.get(r.cache)(r,async f=>{f._readableState.autoDestroy=!1,n&&(await n).emit(\"cacheableResponse\",f),s(f)});r.url=e,c.once(\"error\",a),c.once(\"request\",async f=>{n=f,s(n)})})}async _makeRequest(){var e,r,s,a,n;let{options:c}=this,{headers:f}=c;for(let U in f)if(at.default.undefined(f[U]))delete f[U];else if(at.default.null_(f[U]))throw new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${U}\\` header`);if(c.decompress&&at.default.undefined(f[\"accept-encoding\"])&&(f[\"accept-encoding\"]=_rt?\"gzip, deflate, br\":\"gzip, deflate\"),c.cookieJar){let U=await c.cookieJar.getCookieString(c.url.toString());at.default.nonEmptyString(U)&&(c.headers.cookie=U)}for(let U of c.hooks.beforeRequest){let W=await U(c);if(!at.default.undefined(W)){c.request=()=>W;break}}c.body&&this[v0]!==c.body&&(this[v0]=c.body);let{agent:p,request:h,timeout:E,url:C}=c;if(c.dnsCache&&!(\"lookup\"in c)&&(c.lookup=c.dnsCache.lookup),C.hostname===\"unix\"){let U=/(?<socketPath>.+?):(?<path>.+)/.exec(`${C.pathname}${C.search}`);if(U?.groups){let{socketPath:W,path:ee}=U.groups;Object.assign(c,{socketPath:W,path:ee,host:\"\"})}}let S=C.protocol===\"https:\",P;c.http2?P=krt.auto:P=S?Drt.request:EAe.request;let I=(e=c.request)!==null&&e!==void 0?e:P,R=c.cache?this._createCacheableRequest:I;p&&!c.http2&&(c.agent=p[S?\"https\":\"http\"]),c[po]=I,delete c.request,delete c.timeout;let N=c;if(N.shared=(r=c.cacheOptions)===null||r===void 0?void 0:r.shared,N.cacheHeuristic=(s=c.cacheOptions)===null||s===void 0?void 0:s.cacheHeuristic,N.immutableMinTimeToLive=(a=c.cacheOptions)===null||a===void 0?void 0:a.immutableMinTimeToLive,N.ignoreCargoCult=(n=c.cacheOptions)===null||n===void 0?void 0:n.ignoreCargoCult,c.dnsLookupIpVersion!==void 0)try{N.family=vAe.dnsLookupIpVersionToFamily(c.dnsLookupIpVersion)}catch{throw new Error(\"Invalid `dnsLookupIpVersion` option value\")}c.https&&(\"rejectUnauthorized\"in c.https&&(N.rejectUnauthorized=c.https.rejectUnauthorized),c.https.checkServerIdentity&&(N.checkServerIdentity=c.https.checkServerIdentity),c.https.certificateAuthority&&(N.ca=c.https.certificateAuthority),c.https.certificate&&(N.cert=c.https.certificate),c.https.key&&(N.key=c.https.key),c.https.passphrase&&(N.passphrase=c.https.passphrase),c.https.pfx&&(N.pfx=c.https.pfx));try{let U=await R(C,N);at.default.undefined(U)&&(U=P(C,N)),c.request=h,c.timeout=E,c.agent=p,c.https&&(\"rejectUnauthorized\"in c.https&&delete N.rejectUnauthorized,c.https.checkServerIdentity&&delete N.checkServerIdentity,c.https.certificateAuthority&&delete N.ca,c.https.certificate&&delete N.cert,c.https.key&&delete N.key,c.https.passphrase&&delete N.passphrase,c.https.pfx&&delete N.pfx),jrt(U)?this._onRequest(U):this.writable?(this.once(\"finish\",()=>{this._onResponse(U)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(U)}catch(U){throw U instanceof IAe.CacheError?new nT(U,this):new fs(U.message,U,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new fs(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[CI])return;let{options:r}=this,s=this.retryCount+1;this[CI]=!0,e instanceof fs||(e=new fs(e.message,e,this));let a=e,{response:n}=a;(async()=>{if(n&&!n.body){n.setEncoding(this._readableState.encoding);try{n.rawBody=await Ort.default(n),n.body=n.rawBody.toString()}catch{}}if(this.listenerCount(\"retry\")!==0){let c;try{let f;n&&\"retry-after\"in n.headers&&(f=Number(n.headers[\"retry-after\"]),Number.isNaN(f)?(f=Date.parse(n.headers[\"retry-after\"])-Date.now(),f<=0&&(f=1)):f*=1e3),c=await r.retry.calculateDelay({attemptCount:s,retryOptions:r.retry,error:a,retryAfter:f,computedValue:Urt.default({attemptCount:s,retryOptions:r.retry,error:a,retryAfter:f,computedValue:0})})}catch(f){this._error(new fs(f.message,f,this));return}if(c){let f=async()=>{try{for(let p of this.options.hooks.beforeRetry)await p(this.options,a,s)}catch(p){this._error(new fs(p.message,e,this));return}this.destroyed||(this.destroy(),this.emit(\"retry\",s,e))};this[xAe]=setTimeout(f,c);return}}this._error(a)})()}_read(){this[$Q]=!0;let e=this[eT];if(e&&!this[CI]){e.readableLength&&(this[$Q]=!1);let r;for(;(r=e.read())!==null;){this[yI]+=r.length,this[bAe]=!0;let s=this.downloadProgress;s.percent<1&&this.emit(\"downloadProgress\",s),this.push(r)}}}_write(e,r,s){let a=()=>{this._writeRequest(e,r,s)};this.requestInitialized?a():this[ev].push(a)}_writeRequest(e,r,s){this[po].destroyed||(this._progressCallbacks.push(()=>{this[II]+=Buffer.byteLength(e,r);let a=this.uploadProgress;a.percent<1&&this.emit(\"uploadProgress\",a)}),this[po].write(e,r,a=>{!a&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),s(a)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(po in this)){e();return}if(this[po].destroyed){e();return}this[po].end(s=>{s||(this[EI]=this[II],this.emit(\"uploadProgress\",this.uploadProgress),this[po].emit(\"upload-complete\")),e(s)})};this.requestInitialized?r():this[ev].push(r)}_destroy(e,r){var s;this[CI]=!0,clearTimeout(this[xAe]),po in this&&(this[zH](),!((s=this[eT])===null||s===void 0)&&s.complete||this[po].destroy()),e!==null&&!at.default.undefined(e)&&!(e instanceof fs)&&(e=new fs(e.message,e,this)),r(e)}get _isAboutToError(){return this[CI]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,s;return((r=(e=this[po])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((s=this[PAe])===null||s===void 0)&&s.complete)}get socket(){var e,r;return(r=(e=this[po])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[mI]?e=this[yI]/this[mI]:this[mI]===this[yI]?e=1:e=0,{percent:e,transferred:this[yI],total:this[mI]}}get uploadProgress(){let e;return this[EI]?e=this[II]/this[EI]:this[EI]===this[II]?e=1:e=0,{percent:e,transferred:this[II],total:this[EI]}}get timings(){var e;return(e=this[po])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[DAe]}pipe(e,r){if(this[bAe])throw new Error(\"Failed to pipe. The response has been emitted already.\");return e instanceof JH.ServerResponse&&this[ZQ].add(e),super.pipe(e,r)}unpipe(e){return e instanceof JH.ServerResponse&&this[ZQ].delete(e),super.unpipe(e),this}};Ln.default=aT});var nv=_(qu=>{\"use strict\";var Vrt=qu&&qu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Jrt=qu&&qu.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vrt(e,t,r)};Object.defineProperty(qu,\"__esModule\",{value:!0});qu.CancelError=qu.ParseError=void 0;var kAe=rv(),ZH=class extends kAe.RequestError{constructor(e,r){let{options:s}=r.request;super(`${e.message} in \"${s.url.toString()}\"`,e,r.request),this.name=\"ParseError\"}};qu.ParseError=ZH;var $H=class extends kAe.RequestError{constructor(e){super(\"Promise was canceled\",{},e),this.name=\"CancelError\"}get isCanceled(){return!0}};qu.CancelError=$H;Jrt(rv(),qu)});var TAe=_(ej=>{\"use strict\";Object.defineProperty(ej,\"__esModule\",{value:!0});var QAe=nv(),Krt=(t,e,r,s)=>{let{rawBody:a}=t;try{if(e===\"text\")return a.toString(s);if(e===\"json\")return a.length===0?\"\":r(a.toString());if(e===\"buffer\")return a;throw new QAe.ParseError({message:`Unknown body type '${e}'`,name:\"Error\"},t)}catch(n){throw new QAe.ParseError(n,t)}};ej.default=Krt});var tj=_(S0=>{\"use strict\";var zrt=S0&&S0.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Xrt=S0&&S0.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&zrt(e,t,r)};Object.defineProperty(S0,\"__esModule\",{value:!0});var Zrt=Ie(\"events\"),$rt=Np(),ent=Que(),lT=nv(),RAe=TAe(),FAe=rv(),tnt=LH(),rnt=qH(),NAe=WH(),nnt=[\"request\",\"response\",\"redirect\",\"uploadProgress\",\"downloadProgress\"];function OAe(t){let e,r,s=new Zrt.EventEmitter,a=new ent((c,f,p)=>{let h=E=>{let C=new FAe.default(void 0,t);C.retryCount=E,C._noPipe=!0,p(()=>C.destroy()),p.shouldReject=!1,p(()=>f(new lT.CancelError(C))),e=C,C.once(\"response\",async I=>{var R;if(I.retryCount=E,I.request.aborted)return;let N;try{N=await rnt.default(C),I.rawBody=N}catch{return}if(C._isAboutToError)return;let U=((R=I.headers[\"content-encoding\"])!==null&&R!==void 0?R:\"\").toLowerCase(),W=[\"gzip\",\"deflate\",\"br\"].includes(U),{options:ee}=C;if(W&&!ee.decompress)I.body=N;else try{I.body=RAe.default(I,ee.responseType,ee.parseJson,ee.encoding)}catch(ie){if(I.body=N.toString(),NAe.isResponseOk(I)){C._beforeError(ie);return}}try{for(let[ie,ue]of ee.hooks.afterResponse.entries())I=await ue(I,async le=>{let me=FAe.default.normalizeArguments(void 0,{...le,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},ee);me.hooks.afterResponse=me.hooks.afterResponse.slice(0,ie);for(let Be of me.hooks.beforeRetry)await Be(me);let pe=OAe(me);return p(()=>{pe.catch(()=>{}),pe.cancel()}),pe})}catch(ie){C._beforeError(new lT.RequestError(ie.message,ie,C));return}if(!NAe.isResponseOk(I)){C._beforeError(new lT.HTTPError(I));return}r=I,c(C.options.resolveBodyOnly?I.body:I)});let S=I=>{if(a.isCanceled)return;let{options:R}=C;if(I instanceof lT.HTTPError&&!R.throwHttpErrors){let{response:N}=I;c(C.options.resolveBodyOnly?N.body:N);return}f(I)};C.once(\"error\",S);let P=C.options.body;C.once(\"retry\",(I,R)=>{var N,U;if(P===((N=R.request)===null||N===void 0?void 0:N.options.body)&&$rt.default.nodeStream((U=R.request)===null||U===void 0?void 0:U.options.body)){S(R);return}h(I)}),tnt.default(C,s,nnt)};h(0)});a.on=(c,f)=>(s.on(c,f),a);let n=c=>{let f=(async()=>{await a;let{options:p}=r.request;return RAe.default(r,c,p.parseJson,p.encoding)})();return Object.defineProperties(f,Object.getOwnPropertyDescriptors(a)),f};return a.json=()=>{let{headers:c}=e.options;return!e.writableFinished&&c.accept===void 0&&(c.accept=\"application/json\"),n(\"json\")},a.buffer=()=>n(\"buffer\"),a.text=()=>n(\"text\"),a}S0.default=OAe;Xrt(nv(),S0)});var LAe=_(rj=>{\"use strict\";Object.defineProperty(rj,\"__esModule\",{value:!0});var int=nv();function snt(t,...e){let r=(async()=>{if(t instanceof int.RequestError)try{for(let a of e)if(a)for(let n of a)t=await n(t)}catch(a){t=a}throw t})(),s=()=>r;return r.json=s,r.text=s,r.buffer=s,r.on=s,r}rj.default=snt});var _Ae=_(nj=>{\"use strict\";Object.defineProperty(nj,\"__esModule\",{value:!0});var MAe=Np();function UAe(t){for(let e of Object.values(t))(MAe.default.plainObject(e)||MAe.default.array(e))&&UAe(e);return Object.freeze(t)}nj.default=UAe});var jAe=_(HAe=>{\"use strict\";Object.defineProperty(HAe,\"__esModule\",{value:!0})});var ij=_(Nc=>{\"use strict\";var ont=Nc&&Nc.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),ant=Nc&&Nc.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&ont(e,t,r)};Object.defineProperty(Nc,\"__esModule\",{value:!0});Nc.defaultHandler=void 0;var GAe=Np(),Fc=tj(),lnt=LAe(),uT=rv(),cnt=_Ae(),unt={RequestError:Fc.RequestError,CacheError:Fc.CacheError,ReadError:Fc.ReadError,HTTPError:Fc.HTTPError,MaxRedirectsError:Fc.MaxRedirectsError,TimeoutError:Fc.TimeoutError,ParseError:Fc.ParseError,CancelError:Fc.CancelError,UnsupportedProtocolError:Fc.UnsupportedProtocolError,UploadError:Fc.UploadError},fnt=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:cT}=uT.default,qAe=(...t)=>{let e;for(let r of t)e=cT(void 0,r,e);return e},Ant=t=>t.isStream?new uT.default(void 0,t):Fc.default(t),pnt=t=>\"defaults\"in t&&\"options\"in t.defaults,hnt=[\"get\",\"post\",\"put\",\"patch\",\"head\",\"delete\"];Nc.defaultHandler=(t,e)=>e(t);var WAe=(t,e)=>{if(t)for(let r of t)r(e)},YAe=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(s=>(a,n)=>{let c,f=s(a,p=>(c=n(p),c));if(f!==c&&!a.isStream&&c){let p=f,{then:h,catch:E,finally:C}=p;Object.setPrototypeOf(p,Object.getPrototypeOf(c)),Object.defineProperties(p,Object.getOwnPropertyDescriptors(c)),p.then=h,p.catch=E,p.finally=C}return f});let e=(s,a={},n)=>{var c,f;let p=0,h=E=>t.handlers[p++](E,p===t.handlers.length?Ant:h);if(GAe.default.plainObject(s)){let E={...s,...a};uT.setNonEnumerableProperties([s,a],E),a=E,s=void 0}try{let E;try{WAe(t.options.hooks.init,a),WAe((c=a.hooks)===null||c===void 0?void 0:c.init,a)}catch(S){E=S}let C=cT(s,a,n??t.options);if(C[uT.kIsNormalizedAlready]=!0,E)throw new Fc.RequestError(E.message,E,C);return h(C)}catch(E){if(a.isStream)throw E;return lnt.default(E,t.options.hooks.beforeError,(f=a.hooks)===null||f===void 0?void 0:f.beforeError)}};e.extend=(...s)=>{let a=[t.options],n=[...t._rawHandlers],c;for(let f of s)pnt(f)?(a.push(f.defaults.options),n.push(...f.defaults._rawHandlers),c=f.defaults.mutableDefaults):(a.push(f),\"handlers\"in f&&n.push(...f.handlers),c=f.mutableDefaults);return n=n.filter(f=>f!==Nc.defaultHandler),n.length===0&&n.push(Nc.defaultHandler),YAe({options:qAe(...a),handlers:n,mutableDefaults:!!c})};let r=async function*(s,a){let n=cT(s,a,t.options);n.resolveBodyOnly=!1;let c=n.pagination;if(!GAe.default.object(c))throw new TypeError(\"`options.pagination` must be implemented\");let f=[],{countLimit:p}=c,h=0;for(;h<c.requestLimit;){h!==0&&await fnt(c.backoff);let E=await e(void 0,void 0,n),C=await c.transform(E),S=[];for(let I of C)if(c.filter(I,f,S)&&(!c.shouldContinue(I,f,S)||(yield I,c.stackAllItems&&f.push(I),S.push(I),--p<=0)))return;let P=c.paginate(E,f,S);if(P===!1)return;P===E.request.options?n=E.request.options:P!==void 0&&(n=cT(void 0,P,n)),h++}};e.paginate=r,e.paginate.all=async(s,a)=>{let n=[];for await(let c of r(s,a))n.push(c);return n},e.paginate.each=r,e.stream=(s,a)=>e(s,{...a,isStream:!0});for(let s of hnt)e[s]=(a,n)=>e(a,{...n,method:s}),e.stream[s]=(a,n)=>e(a,{...n,method:s,isStream:!0});return Object.assign(e,unt),Object.defineProperty(e,\"defaults\",{value:t.mutableDefaults?t:cnt.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=qAe,e};Nc.default=YAe;ant(jAe(),Nc)});var KAe=_((Op,fT)=>{\"use strict\";var gnt=Op&&Op.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),VAe=Op&&Op.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&gnt(e,t,r)};Object.defineProperty(Op,\"__esModule\",{value:!0});var dnt=Ie(\"url\"),JAe=ij(),mnt={options:{method:\"GET\",retry:{limit:2,methods:[\"GET\",\"PUT\",\"HEAD\",\"DELETE\",\"OPTIONS\",\"TRACE\"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:[\"ETIMEDOUT\",\"ECONNRESET\",\"EADDRINUSE\",\"ECONNREFUSED\",\"EPIPE\",\"ENOTFOUND\",\"ENETUNREACH\",\"EAI_AGAIN\"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{\"user-agent\":\"got (https://github.com/sindresorhus/got)\"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:\"text\",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:\"\",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType===\"json\"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,\"link\"))return!1;let e=t.headers.link.split(\",\"),r;for(let s of e){let a=s.split(\";\");if(a[1].includes(\"next\")){r=a[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new dnt.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[JAe.defaultHandler],mutableDefaults:!1},sj=JAe.default(mnt);Op.default=sj;fT.exports=sj;fT.exports.default=sj;fT.exports.__esModule=!0;VAe(ij(),Op);VAe(tj(),Op)});var nn={};Vt(nn,{Method:()=>tpe,del:()=>wnt,get:()=>lj,getNetworkSettings:()=>epe,post:()=>cj,put:()=>Cnt,request:()=>iv});async function oj(t){return Yl(XAe,t,()=>ce.readFilePromise(t).then(e=>(XAe.set(t,e),e)))}function Int({statusCode:t,statusMessage:e},r){let s=Ht(r,t,ht.NUMBER),a=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return KE(r,`${s}${e?` (${e})`:\"\"}`,a)}async function AT(t,{configuration:e,customErrorMessage:r}){try{return await t}catch(s){if(s.name!==\"HTTPError\")throw s;let a=r?.(s,e)??s.response.body?.error;a==null&&(s.message.startsWith(\"Response code\")?a=\"The remote server failed to provide the requested resource\":a=s.message),s.code===\"ETIMEDOUT\"&&s.event===\"socket\"&&(a+=`(can be increased via ${Ht(e,\"httpTimeout\",ht.SETTING)})`);let n=new jt(35,a,c=>{s.response&&c.reportError(35,`  ${Kf(e,{label:\"Response Code\",value:_u(ht.NO_HINT,Int(s.response,e))})}`),s.request&&(c.reportError(35,`  ${Kf(e,{label:\"Request Method\",value:_u(ht.NO_HINT,s.request.options.method)})}`),c.reportError(35,`  ${Kf(e,{label:\"Request URL\",value:_u(ht.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&c.reportError(35,`  ${Kf(e,{label:\"Request Redirects\",value:_u(ht.NO_HINT,Z4(e,s.request.redirects,ht.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&c.reportError(35,`  ${Kf(e,{label:\"Request Retry Count\",value:_u(ht.NO_HINT,`${Ht(e,s.request.retryCount,ht.NUMBER)} (can be increased via ${Ht(e,\"httpRetry\",ht.SETTING)})`)})}`)});throw n.originalError=s,n}}function epe(t,e){let r=[...e.configuration.get(\"networkSettings\")].sort(([c],[f])=>f.length-c.length),s={enableNetwork:void 0,httpsCaFilePath:void 0,httpProxy:void 0,httpsProxy:void 0,httpsKeyFilePath:void 0,httpsCertFilePath:void 0},a=Object.keys(s),n=typeof t==\"string\"?new URL(t):t;for(let[c,f]of r)if(aj.default.isMatch(n.hostname,c))for(let p of a){let h=f.get(p);h!==null&&typeof s[p]>\"u\"&&(s[p]=h)}for(let c of a)typeof s[c]>\"u\"&&(s[c]=e.configuration.get(c));return s}async function iv(t,e,{configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c=\"GET\",wrapNetworkRequest:f}){let p={target:t,body:e,configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c},h=async()=>await Bnt(t,e,p),E=typeof f<\"u\"?await f(h,p):h;return await(await r.reduceHook(S=>S.wrapNetworkRequest,E,p))()}async function lj(t,{configuration:e,jsonResponse:r,customErrorMessage:s,wrapNetworkRequest:a,...n}){let c=()=>AT(iv(t,null,{configuration:e,wrapNetworkRequest:a,...n}),{configuration:e,customErrorMessage:s}).then(p=>p.body),f=await(typeof a<\"u\"?c():Yl(zAe,t,()=>c().then(p=>(zAe.set(t,p),p))));return r?JSON.parse(f.toString()):f}async function Cnt(t,e,{customErrorMessage:r,...s}){return(await AT(iv(t,e,{...s,method:\"PUT\"}),{customErrorMessage:r,configuration:s.configuration})).body}async function cj(t,e,{customErrorMessage:r,...s}){return(await AT(iv(t,e,{...s,method:\"POST\"}),{customErrorMessage:r,configuration:s.configuration})).body}async function wnt(t,{customErrorMessage:e,...r}){return(await AT(iv(t,null,{...r,method:\"DELETE\"}),{customErrorMessage:e,configuration:r.configuration})).body}async function Bnt(t,e,{configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c=\"GET\"}){let f=typeof t==\"string\"?new URL(t):t,p=epe(f,{configuration:r});if(p.enableNetwork===!1)throw new jt(80,`Request to '${f.href}' has been blocked because of your configuration settings`);if(f.protocol===\"http:\"&&!aj.default.isMatch(f.hostname,r.get(\"unsafeHttpWhitelist\")))throw new jt(81,`Unsafe http requests must be explicitly whitelisted in your configuration (${f.hostname})`);let h={headers:s,method:c};h.responseType=n?\"json\":\"buffer\",e!==null&&(Buffer.isBuffer(e)||!a&&typeof e==\"string\"?h.body=e:h.json=e);let E=r.get(\"httpTimeout\"),C=r.get(\"httpRetry\"),S=r.get(\"enableStrictSsl\"),P=p.httpsCaFilePath,I=p.httpsCertFilePath,R=p.httpsKeyFilePath,{default:N}=await Promise.resolve().then(()=>ut(KAe())),U=P?await oj(P):void 0,W=I?await oj(I):void 0,ee=R?await oj(R):void 0,ie={rejectUnauthorized:S,ca:U,cert:W,key:ee},ue={http:p.httpProxy?new vue({proxy:p.httpProxy,proxyRequestOptions:ie}):ynt,https:p.httpsProxy?new Sue({proxy:p.httpsProxy,proxyRequestOptions:ie}):Ent},le=N.extend({timeout:{socket:E},retry:C,agent:ue,https:{rejectUnauthorized:S,certificateAuthority:U,certificate:W,key:ee},...h});return r.getLimit(\"networkConcurrency\")(()=>le(f))}var ZAe,$Ae,aj,zAe,XAe,ynt,Ent,tpe,pT=Xe(()=>{Dt();Due();ZAe=Ie(\"https\"),$Ae=Ie(\"http\"),aj=ut(Go());Tc();xc();Pc();zAe=new Map,XAe=new Map,ynt=new $Ae.Agent({keepAlive:!0}),Ent=new ZAe.Agent({keepAlive:!0});tpe=(a=>(a.GET=\"GET\",a.PUT=\"PUT\",a.POST=\"POST\",a.DELETE=\"DELETE\",a))(tpe||{})});var Ui={};Vt(Ui,{availableParallelism:()=>fj,getArchitecture:()=>sv,getArchitectureName:()=>Pnt,getArchitectureSet:()=>uj,getCaller:()=>Tnt,major:()=>vnt,openUrl:()=>Snt});function bnt(){if(process.platform!==\"linux\")return null;let t;try{t=ce.readFileSync(Dnt)}catch{}if(typeof t<\"u\"){if(t&&(t.includes(\"GLIBC\")||t.includes(\"GNU libc\")||t.includes(\"GNU C Library\")))return\"glibc\";if(t&&t.includes(\"musl\"))return\"musl\"}let r=(process.report?.getReport()??{}).sharedObjects??[],s=/\\/(?:(ld-linux-|[^/]+-linux-gnu\\/)|(libc.musl-|ld-musl-))/;return p0(r,a=>{let n=a.match(s);if(!n)return p0.skip;if(n[1])return\"glibc\";if(n[2])return\"musl\";throw new Error(\"Assertion failed: Expected the libc variant to have been detected\")})??null}function sv(){return npe=npe??{os:(process.env.YARN_IS_TEST_ENV?process.env.YARN_OS_OVERRIDE:void 0)??process.platform,cpu:(process.env.YARN_IS_TEST_ENV?process.env.YARN_CPU_OVERRIDE:void 0)??process.arch,libc:(process.env.YARN_IS_TEST_ENV?process.env.YARN_LIBC_OVERRIDE:void 0)??bnt()}}function Pnt(t=sv()){return t.libc?`${t.os}-${t.cpu}-${t.libc}`:`${t.os}-${t.cpu}`}function uj(){let t=sv();return ipe=ipe??{os:[t.os],cpu:[t.cpu],libc:t.libc?[t.libc]:[]}}function Qnt(t){let e=xnt.exec(t);if(!e)return null;let r=e[2]&&e[2].indexOf(\"native\")===0,s=e[2]&&e[2].indexOf(\"eval\")===0,a=knt.exec(e[2]);return s&&a!=null&&(e[2]=a[1],e[3]=a[2],e[4]=a[3]),{file:r?null:e[2],methodName:e[1]||\"<unknown>\",arguments:r?[e[2]]:[],line:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}function Tnt(){let e=new Error().stack.split(`\n`)[3];return Qnt(e)}function fj(){return typeof hT.default.availableParallelism<\"u\"?hT.default.availableParallelism():Math.max(1,hT.default.cpus().length)}var hT,vnt,rpe,Snt,Dnt,npe,ipe,xnt,knt,gT=Xe(()=>{Dt();hT=ut(Ie(\"os\"));dT();Pc();vnt=Number(process.versions.node.split(\".\")[0]),rpe=new Map([[\"darwin\",\"open\"],[\"linux\",\"xdg-open\"],[\"win32\",\"explorer.exe\"]]).get(process.platform),Snt=typeof rpe<\"u\"?async t=>{try{return await Aj(rpe,[t],{cwd:J.cwd()}),!0}catch{return!1}}:void 0,Dnt=\"/usr/bin/ldd\";xnt=/^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,knt=/\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/});function yj(t,e,r,s,a){let n=YB(r);if(s.isArray||s.type===\"ANY\"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>pj(t,`${e}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>pj(t,e,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings \"${e}\" cannot be an array`);return pj(t,e,r,s,a)}function pj(t,e,r,s,a){let n=YB(r);switch(s.type){case\"ANY\":return NQ(n);case\"SHAPE\":return Ont(t,e,r,s,a);case\"MAP\":return Lnt(t,e,r,s,a)}if(n===null&&!s.isNullable&&s.default!==null)throw new Error(`Non-nullable configuration settings \"${e}\" cannot be set to null`);if(\"values\"in s&&s.values?.includes(n))return n;let f=(()=>{if(s.type===\"BOOLEAN\"&&typeof n!=\"string\")return kB(n);if(typeof n!=\"string\")throw new Error(`Expected configuration setting \"${e}\" to be a string, got ${typeof n}`);let p=Vk(n,{env:t.env});switch(s.type){case\"ABSOLUTE_PATH\":{let h=a,E=H8(r);return E&&E[0]!==\"<\"&&(h=J.dirname(E)),J.resolve(h,fe.toPortablePath(p))}case\"LOCATOR_LOOSE\":return Qp(p,!1);case\"NUMBER\":return parseInt(p);case\"LOCATOR\":return Qp(p);case\"BOOLEAN\":return kB(p);case\"DURATION\":return Jk(p,s.unit);default:return p}})();if(\"values\"in s&&s.values&&!s.values.includes(f))throw new Error(`Invalid value, expected one of ${s.values.join(\", \")}`);return f}function Ont(t,e,r,s,a){let n=YB(r);if(typeof n!=\"object\"||Array.isArray(n))throw new nt(`Object configuration settings \"${e}\" must be an object`);let c=Ej(t,s,{ignoreArrays:!0});if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=`${e}.${f}`;if(!s.properties[f])throw new nt(`Unrecognized configuration settings found: ${e}.${f} - run \"yarn config\" to see the list of settings supported in Yarn`);c.set(f,yj(t,h,p,s.properties[f],a))}return c}function Lnt(t,e,r,s,a){let n=YB(r),c=new Map;if(typeof n!=\"object\"||Array.isArray(n))throw new nt(`Map configuration settings \"${e}\" must be an object`);if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=s.normalizeKeys?s.normalizeKeys(f):f,E=`${e}['${h}']`,C=s.valueDefinition;c.set(h,yj(t,E,p,C,a))}return c}function Ej(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case\"SHAPE\":{if(e.isArray&&!r)return[];let s=new Map;for(let[a,n]of Object.entries(e.properties))s.set(a,Ej(t,n));return s}case\"MAP\":return e.isArray&&!r?[]:new Map;case\"ABSOLUTE_PATH\":return e.default===null?null:t.projectCwd===null?Array.isArray(e.default)?e.default.map(s=>J.normalize(s)):J.isAbsolute(e.default)?J.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(s=>J.resolve(t.projectCwd,s)):J.resolve(t.projectCwd,e.default);case\"DURATION\":return Jk(e.default,e.unit);default:return e.default}}function yT(t,e,r){if(e.type===\"SECRET\"&&typeof t==\"string\"&&r.hideSecrets)return Nnt;if(e.type===\"ABSOLUTE_PATH\"&&typeof t==\"string\"&&r.getNativePaths)return fe.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let s=[];for(let a of t)s.push(yT(a,e,r));return s}if(e.type===\"MAP\"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=yT(n,e.valueDefinition,r);typeof c<\"u\"&&s.set(a,c)}return s}if(e.type===\"SHAPE\"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=e.properties[a],f=yT(n,c,r);typeof f<\"u\"&&s.set(a,f)}return s}return t}function Mnt(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),e.startsWith(ET)&&(e=(0,ope.default)(e.slice(ET.length)),t[e]=r);return t}function gj(){let t=`${ET}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r==\"string\")return r;return dj}async function spe(t){try{return await ce.readFilePromise(t)}catch{return Buffer.of()}}async function Unt(t,e){return Buffer.compare(...await Promise.all([spe(t),spe(e)]))===0}async function _nt(t,e){let[r,s]=await Promise.all([ce.statPromise(t),ce.statPromise(e)]);return r.dev===s.dev&&r.ino===s.ino}async function jnt({configuration:t,selfPath:e}){let r=t.get(\"yarnPath\");return t.get(\"ignorePath\")||r===null||r===e||await Hnt(r,e)?null:r}var ope,Lp,ape,lpe,cpe,hj,Rnt,ov,Fnt,Mp,ET,dj,Nnt,wI,upe,mj,IT,mT,Hnt,ze,av=Xe(()=>{Dt();wc();ope=ut(Sre()),Lp=ut(Fd());Yt();ape=ut(yne()),lpe=Ie(\"module\"),cpe=ut(Ld()),hj=Ie(\"stream\");nue();oI();R8();F8();N8();gue();O8();tm();Iue();LQ();xc();I0();pT();Pc();gT();Rp();Wo();Rnt=function(){if(!Lp.GITHUB_ACTIONS||!process.env.GITHUB_EVENT_PATH)return!1;let t=fe.toPortablePath(process.env.GITHUB_EVENT_PATH),e;try{e=ce.readJsonSync(t)}catch{return!1}return!(!(\"repository\"in e)||!e.repository||(e.repository.private??!0))}(),ov=new Set([\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\"]),Fnt=new Set([\"isTestEnv\",\"injectNpmUser\",\"injectNpmPassword\",\"injectNpm2FaToken\",\"zipDataEpilogue\",\"cacheCheckpointOverride\",\"cacheVersionOverride\",\"lockfileVersionOverride\",\"osOverride\",\"cpuOverride\",\"libcOverride\",\"binFolder\",\"version\",\"flags\",\"profile\",\"gpg\",\"ignoreNode\",\"wrapOutput\",\"home\",\"confDir\",\"registry\",\"ignoreCwd\"]),Mp=/^(?!v)[a-z0-9._-]+$/i,ET=\"yarn_\",dj=\".yarnrc.yml\",Nnt=\"********\",wI=(C=>(C.ANY=\"ANY\",C.BOOLEAN=\"BOOLEAN\",C.ABSOLUTE_PATH=\"ABSOLUTE_PATH\",C.LOCATOR=\"LOCATOR\",C.LOCATOR_LOOSE=\"LOCATOR_LOOSE\",C.NUMBER=\"NUMBER\",C.STRING=\"STRING\",C.DURATION=\"DURATION\",C.SECRET=\"SECRET\",C.SHAPE=\"SHAPE\",C.MAP=\"MAP\",C))(wI||{}),upe=ht,mj=(c=>(c.MILLISECONDS=\"ms\",c.SECONDS=\"s\",c.MINUTES=\"m\",c.HOURS=\"h\",c.DAYS=\"d\",c.WEEKS=\"w\",c))(mj||{}),IT=(r=>(r.JUNCTIONS=\"junctions\",r.SYMLINKS=\"symlinks\",r))(IT||{}),mT={lastUpdateCheck:{description:\"Last timestamp we checked whether new Yarn versions were available\",type:\"STRING\",default:null},yarnPath:{description:\"Path to the local executable that must be used over the global one\",type:\"ABSOLUTE_PATH\",default:null},ignorePath:{description:\"If true, the local executable will be ignored when using the global one\",type:\"BOOLEAN\",default:!1},globalFolder:{description:\"Folder where all system-global files are stored\",type:\"ABSOLUTE_PATH\",default:G8()},cacheFolder:{description:\"Folder where the cache files must be written\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/cache\"},compressionLevel:{description:\"Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)\",type:\"NUMBER\",values:[\"mixed\",0,1,2,3,4,5,6,7,8,9],default:0},virtualFolder:{description:\"Folder where the virtual packages (cf doc) will be mapped on the disk (must be named __virtual__)\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/__virtual__\"},installStatePath:{description:\"Path of the file where the install state will be persisted\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/install-state.gz\"},immutablePatterns:{description:\"Array of glob patterns; files matching them won't be allowed to change during immutable installs\",type:\"STRING\",default:[],isArray:!0},rcFilename:{description:\"Name of the files where the configuration can be found\",type:\"STRING\",default:gj()},enableGlobalCache:{description:\"If true, the system-wide cache folder will be used regardless of `cache-folder`\",type:\"BOOLEAN\",default:!0},cacheMigrationMode:{description:\"Defines the conditions under which Yarn upgrades should cause the cache archives to be regenerated.\",type:\"STRING\",values:[\"always\",\"match-spec\",\"required-only\"],default:\"always\"},enableColors:{description:\"If true, the CLI is allowed to use colors in its output\",type:\"BOOLEAN\",default:Zk,defaultText:\"<dynamic>\"},enableHyperlinks:{description:\"If true, the CLI is allowed to use hyperlinks in its output\",type:\"BOOLEAN\",default:X4,defaultText:\"<dynamic>\"},enableInlineBuilds:{description:\"If true, the CLI will print the build output on the command line\",type:\"BOOLEAN\",default:Lp.isCI,defaultText:\"<dynamic>\"},enableMessageNames:{description:\"If true, the CLI will prefix most messages with codes suitable for search engines\",type:\"BOOLEAN\",default:!0},enableProgressBars:{description:\"If true, the CLI is allowed to show a progress bar for long-running events\",type:\"BOOLEAN\",default:!Lp.isCI,defaultText:\"<dynamic>\"},enableTimers:{description:\"If true, the CLI is allowed to print the time spent executing commands\",type:\"BOOLEAN\",default:!0},enableTips:{description:\"If true, installs will print a helpful message every day of the week\",type:\"BOOLEAN\",default:!Lp.isCI,defaultText:\"<dynamic>\"},preferInteractive:{description:\"If true, the CLI will automatically use the interactive mode when called from a TTY\",type:\"BOOLEAN\",default:!1},preferTruncatedLines:{description:\"If true, the CLI will truncate lines that would go beyond the size of the terminal\",type:\"BOOLEAN\",default:!1},progressBarStyle:{description:\"Which style of progress bar should be used (only when progress bars are enabled)\",type:\"STRING\",default:void 0,defaultText:\"<dynamic>\"},defaultLanguageName:{description:\"Default language mode that should be used when a package doesn't offer any insight\",type:\"STRING\",default:\"node\"},defaultProtocol:{description:\"Default resolution protocol used when resolving pure semver and tag ranges\",type:\"STRING\",default:\"npm:\"},enableTransparentWorkspaces:{description:\"If false, Yarn won't automatically resolve workspace dependencies unless they use the `workspace:` protocol\",type:\"BOOLEAN\",default:!0},supportedArchitectures:{description:\"Architectures that Yarn will fetch and inject into the resolver\",type:\"SHAPE\",properties:{os:{description:\"Array of supported process.platform strings, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]},cpu:{description:\"Array of supported process.arch strings, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]},libc:{description:\"Array of supported libc libraries, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]}}},enableMirror:{description:\"If true, the downloaded packages will be retrieved and stored in both the local and global folders\",type:\"BOOLEAN\",default:!0},enableNetwork:{description:\"If false, Yarn will refuse to use the network if required to\",type:\"BOOLEAN\",default:!0},enableOfflineMode:{description:\"If true, Yarn will attempt to retrieve files and metadata from the global cache rather than the network\",type:\"BOOLEAN\",default:!1},httpProxy:{description:\"URL of the http proxy that must be used for outgoing http requests\",type:\"STRING\",default:null},httpsProxy:{description:\"URL of the http proxy that must be used for outgoing https requests\",type:\"STRING\",default:null},unsafeHttpWhitelist:{description:\"List of the hostnames for which http queries are allowed (glob patterns are supported)\",type:\"STRING\",default:[],isArray:!0},httpTimeout:{description:\"Timeout of each http request\",type:\"DURATION\",unit:\"ms\",default:\"1m\"},httpRetry:{description:\"Retry times on http failure\",type:\"NUMBER\",default:3},networkConcurrency:{description:\"Maximal number of concurrent requests\",type:\"NUMBER\",default:50},taskPoolConcurrency:{description:\"Maximal amount of concurrent heavy task processing\",type:\"NUMBER\",default:fj()},taskPoolMode:{description:\"Execution strategy for heavy tasks\",type:\"STRING\",values:[\"async\",\"workers\"],default:\"workers\"},networkSettings:{description:\"Network settings per hostname (glob patterns are supported)\",type:\"MAP\",valueDefinition:{description:\"\",type:\"SHAPE\",properties:{httpsCaFilePath:{description:\"Path to file containing one or multiple Certificate Authority signing certificates\",type:\"ABSOLUTE_PATH\",default:null},enableNetwork:{description:\"If false, the package manager will refuse to use the network if required to\",type:\"BOOLEAN\",default:null},httpProxy:{description:\"URL of the http proxy that must be used for outgoing http requests\",type:\"STRING\",default:null},httpsProxy:{description:\"URL of the http proxy that must be used for outgoing https requests\",type:\"STRING\",default:null},httpsKeyFilePath:{description:\"Path to file containing private key in PEM format\",type:\"ABSOLUTE_PATH\",default:null},httpsCertFilePath:{description:\"Path to file containing certificate chain in PEM format\",type:\"ABSOLUTE_PATH\",default:null}}}},httpsCaFilePath:{description:\"A path to a file containing one or multiple Certificate Authority signing certificates\",type:\"ABSOLUTE_PATH\",default:null},httpsKeyFilePath:{description:\"Path to file containing private key in PEM format\",type:\"ABSOLUTE_PATH\",default:null},httpsCertFilePath:{description:\"Path to file containing certificate chain in PEM format\",type:\"ABSOLUTE_PATH\",default:null},enableStrictSsl:{description:\"If false, SSL certificate errors will be ignored\",type:\"BOOLEAN\",default:!0},logFilters:{description:\"Overrides for log levels\",type:\"SHAPE\",isArray:!0,concatenateValues:!0,properties:{code:{description:\"Code of the messages covered by this override\",type:\"STRING\",default:void 0},text:{description:\"Code of the texts covered by this override\",type:\"STRING\",default:void 0},pattern:{description:\"Code of the patterns covered by this override\",type:\"STRING\",default:void 0},level:{description:\"Log level override, set to null to remove override\",type:\"STRING\",values:Object.values(eQ),isNullable:!0,default:void 0}}},enableTelemetry:{description:\"If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry\",type:\"BOOLEAN\",default:!0},telemetryInterval:{description:\"Minimal amount of time between two telemetry uploads\",type:\"DURATION\",unit:\"d\",default:\"7d\"},telemetryUserId:{description:\"If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.\",type:\"STRING\",default:null},enableHardenedMode:{description:\"If true, automatically enable --check-resolutions --refresh-lockfile on installs\",type:\"BOOLEAN\",default:Lp.isPR&&Rnt,defaultText:\"<true on public PRs>\"},enableScripts:{description:\"If true, packages are allowed to have install scripts by default\",type:\"BOOLEAN\",default:!0},enableStrictSettings:{description:\"If true, unknown settings will cause Yarn to abort\",type:\"BOOLEAN\",default:!0},enableImmutableCache:{description:\"If true, the cache is reputed immutable and actions that would modify it will throw\",type:\"BOOLEAN\",default:!1},enableCacheClean:{description:\"If false, disallows the `cache clean` command\",type:\"BOOLEAN\",default:!0},checksumBehavior:{description:\"Enumeration defining what to do when a checksum doesn't match expectations\",type:\"STRING\",default:\"throw\"},injectEnvironmentFiles:{description:\"List of all the environment files that Yarn should inject inside the process when it starts\",type:\"ABSOLUTE_PATH\",default:[\".env.yarn?\"],isArray:!0},packageExtensions:{description:\"Map of package corrections to apply on the dependency tree\",type:\"MAP\",valueDefinition:{description:\"The extension that will be applied to any package whose version matches the specified range\",type:\"SHAPE\",properties:{dependencies:{description:\"The set of dependencies that must be made available to the current package in order for it to work properly\",type:\"MAP\",valueDefinition:{description:\"A range\",type:\"STRING\"}},peerDependencies:{description:\"Inherited dependencies - the consumer of the package will be tasked to provide them\",type:\"MAP\",valueDefinition:{description:\"A semver range\",type:\"STRING\"}},peerDependenciesMeta:{description:\"Extra information related to the dependencies listed in the peerDependencies field\",type:\"MAP\",valueDefinition:{description:\"The peerDependency meta\",type:\"SHAPE\",properties:{optional:{description:\"If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error\",type:\"BOOLEAN\",default:!1}}}}}}}};Hnt=process.platform===\"win32\"?Unt:_nt;ze=class t{constructor(e){this.isCI=Lp.isCI;this.projectCwd=null;this.plugins=new Map;this.settings=new Map;this.values=new Map;this.sources=new Map;this.invalid=new Map;this.env={};this.limits=new Map;this.packageExtensions=null;this.startingCwd=e}static{this.deleteProperty=Symbol()}static{this.telemetry=null}static create(e,r,s){let a=new t(e);typeof r<\"u\"&&!(r instanceof Map)&&(a.projectCwd=r),a.importSettings(mT);let n=typeof s<\"u\"?s:r instanceof Map?r:new Map;for(let[c,f]of n)a.activatePlugin(c,f);return a}static async find(e,r,{strict:s=!0,usePathCheck:a=null,useRc:n=!0}={}){let c=Mnt();delete c.rcFilename;let f=new t(e),p=await t.findRcFiles(e),h=await t.findFolderRcFile(fI());h&&(p.find(me=>me.path===h.path)||p.unshift(h));let E=Eue(p.map(le=>[le.path,le.data])),C=vt.dot,S=new Set(Object.keys(mT)),P=({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe})=>({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe}),I=({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe,...Be})=>{let Ce={};for(let[g,we]of Object.entries(Be))S.has(g)&&(Ce[g]=we);return Ce},R=({yarnPath:le,ignorePath:me,...pe})=>{let Be={};for(let[Ce,g]of Object.entries(pe))S.has(Ce)||(Be[Ce]=g);return Be};if(f.importSettings(P(mT)),f.useWithSource(\"<environment>\",P(c),e,{strict:!1}),E){let[le,me]=E;f.useWithSource(le,P(me),C,{strict:!1})}if(a){if(await jnt({configuration:f,selfPath:a})!==null)return f;f.useWithSource(\"<override>\",{ignorePath:!0},e,{strict:!1,overwrite:!0})}let N=await t.findProjectCwd(e);f.startingCwd=e,f.projectCwd=N;let U=Object.assign(Object.create(null),process.env);f.env=U;let W=await Promise.all(f.get(\"injectEnvironmentFiles\").map(async le=>{let me=le.endsWith(\"?\")?await ce.readFilePromise(le.slice(0,-1),\"utf8\").catch(()=>\"\"):await ce.readFilePromise(le,\"utf8\");return(0,ape.parse)(me)}));for(let le of W)for(let[me,pe]of Object.entries(le))f.env[me]=Vk(pe,{env:U});if(f.importSettings(I(mT)),f.useWithSource(\"<environment>\",I(c),e,{strict:s}),E){let[le,me]=E;f.useWithSource(le,I(me),C,{strict:s})}let ee=le=>\"default\"in le?le.default:le,ie=new Map([[\"@@core\",rue]]);if(r!==null)for(let le of r.plugins.keys())ie.set(le,ee(r.modules.get(le)));for(let[le,me]of ie)f.activatePlugin(le,me);let ue=new Map([]);if(r!==null){let le=new Map;for(let[Be,Ce]of r.modules)le.set(Be,()=>Ce);let me=new Set,pe=async(Be,Ce)=>{let{factory:g,name:we}=Pp(Be);if(!g||me.has(we))return;let ye=new Map(le),Ae=Z=>{if((0,lpe.isBuiltin)(Z))return Pp(Z);if(ye.has(Z))return ye.get(Z)();throw new nt(`This plugin cannot access the package referenced via ${Z} which is neither a builtin, nor an exposed entry`)},se=await qE(async()=>ee(await g(Ae)),Z=>`${Z} (when initializing ${we}, defined in ${Ce})`);le.set(we,()=>se),me.add(we),ue.set(we,se)};if(c.plugins)for(let Be of c.plugins.split(\";\")){let Ce=J.resolve(e,fe.toPortablePath(Be));await pe(Ce,\"<environment>\")}for(let{path:Be,cwd:Ce,data:g}of p)if(n&&Array.isArray(g.plugins))for(let we of g.plugins){let ye=typeof we!=\"string\"?we.path:we,Ae=we?.spec??\"\",se=we?.checksum??\"\";if(ov.has(Ae))continue;let Z=J.resolve(Ce,fe.toPortablePath(ye));if(!await ce.existsPromise(Z)){if(!Ae){let mt=Ht(f,J.basename(Z,\".cjs\"),ht.NAME),j=Ht(f,\".gitignore\",ht.NAME),rt=Ht(f,f.values.get(\"rcFilename\"),ht.NAME),Fe=Ht(f,\"https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored\",ht.URL);throw new nt(`Missing source for the ${mt} plugin - please try to remove the plugin from ${rt} then reinstall it manually. This error usually occurs because ${j} is incorrect, check ${Fe} to make sure your plugin folder isn't gitignored.`)}if(!Ae.match(/^https?:/)){let mt=Ht(f,J.basename(Z,\".cjs\"),ht.NAME),j=Ht(f,f.values.get(\"rcFilename\"),ht.NAME);throw new nt(`Failed to recognize the source for the ${mt} plugin - please try to delete the plugin from ${j} then reinstall it manually.`)}let De=await lj(Ae,{configuration:f}),Re=us(De);if(se&&se!==Re){let mt=Ht(f,J.basename(Z,\".cjs\"),ht.NAME),j=Ht(f,f.values.get(\"rcFilename\"),ht.NAME),rt=Ht(f,`yarn plugin import ${Ae}`,ht.CODE);throw new nt(`Failed to fetch the ${mt} plugin from its remote location: its checksum seems to have changed. If this is expected, please remove the plugin from ${j} then run ${rt} to reimport it.`)}await ce.mkdirPromise(J.dirname(Z),{recursive:!0}),await ce.writeFilePromise(Z,De)}await pe(Z,Be)}}for(let[le,me]of ue)f.activatePlugin(le,me);if(f.useWithSource(\"<environment>\",R(c),e,{strict:s}),E){let[le,me]=E;f.useWithSource(le,R(me),C,{strict:s})}return f.get(\"enableGlobalCache\")&&(f.values.set(\"cacheFolder\",`${f.get(\"globalFolder\")}/cache`),f.sources.set(\"cacheFolder\",\"<internal>\")),f}static async findRcFiles(e){let r=gj(),s=[],a=e,n=null;for(;a!==n;){n=a;let c=J.join(n,r);if(ce.existsSync(c)){let f,p;try{p=await ce.readFilePromise(c,\"utf8\"),f=ls(p)}catch{let h=\"\";throw p?.match(/^\\s+(?!-)[^:]+\\s+\\S+/m)&&(h=\" (in particular, make sure you list the colons after each key name)\"),new nt(`Parse error when loading ${c}; please check it's proper Yaml${h}`)}s.unshift({path:c,cwd:n,data:f})}a=J.dirname(n)}return s}static async findFolderRcFile(e){let r=J.join(e,Er.rc),s;try{s=await ce.readFilePromise(r,\"utf8\")}catch(n){if(n.code===\"ENOENT\")return null;throw n}let a=ls(s);return{path:r,cwd:e,data:a}}static async findProjectCwd(e){let r=null,s=e,a=null;for(;s!==a;){if(a=s,ce.existsSync(J.join(a,Er.lockfile)))return a;ce.existsSync(J.join(a,Er.manifest))&&(r=a),s=J.dirname(a)}return r}static async updateConfiguration(e,r,s={}){let a=gj(),n=J.join(e,a),c=ce.existsSync(n)?ls(await ce.readFilePromise(n,\"utf8\")):{},f=!1,p;if(typeof r==\"function\"){try{p=r(c)}catch{p=r({})}if(p===c)return!1}else{p=c;for(let h of Object.keys(r)){let E=c[h],C=r[h],S;if(typeof C==\"function\")try{S=C(E)}catch{S=C(void 0)}else S=C;E!==S&&(S===t.deleteProperty?delete p[h]:p[h]=S,f=!0)}if(!f)return!1}return await ce.changeFilePromise(n,nl(p),{automaticNewlines:!0}),!0}static async addPlugin(e,r){r.length!==0&&await t.updateConfiguration(e,s=>{let a=s.plugins??[];if(a.length===0)return{...s,plugins:r};let n=[],c=[...r];for(let f of a){let p=typeof f!=\"string\"?f.path:f,h=c.find(E=>E.path===p);h?(n.push(h),c=c.filter(E=>E!==h)):n.push(f)}return n.push(...c),{...s,plugins:n}})}static async updateHomeConfiguration(e){let r=fI();return await t.updateConfiguration(r,e)}activatePlugin(e,r){this.plugins.set(e,r),typeof r.configuration<\"u\"&&this.importSettings(r.configuration)}importSettings(e){for(let[r,s]of Object.entries(e))if(s!=null){if(this.settings.has(r))throw new Error(`Cannot redefine settings \"${r}\"`);this.settings.set(r,s),this.values.set(r,Ej(this,s))}}useWithSource(e,r,s,a){try{this.use(e,r,s,a)}catch(n){throw n.message+=` (in ${Ht(this,e,ht.PATH)})`,n}}use(e,r,s,{strict:a=!0,overwrite:n=!1}={}){a=a&&this.get(\"enableStrictSettings\");for(let c of[\"enableStrictSettings\",...Object.keys(r)]){let f=r[c],p=H8(f);if(p&&(e=p),typeof f>\"u\"||c===\"plugins\"||e===\"<environment>\"&&Fnt.has(c))continue;if(c===\"rcFilename\")throw new nt(`The rcFilename settings can only be set via ${`${ET}RC_FILENAME`.toUpperCase()}, not via a rc file`);let h=this.settings.get(c);if(!h){let C=fI(),S=e[0]!==\"<\"?J.dirname(e):null;if(a&&!(S!==null?C===S:!1))throw new nt(`Unrecognized or legacy configuration settings found: ${c} - run \"yarn config\" to see the list of settings supported in Yarn`);this.invalid.set(c,e);continue}if(this.sources.has(c)&&!(n||h.type===\"MAP\"||h.isArray&&h.concatenateValues))continue;let E;try{E=yj(this,c,f,h,s)}catch(C){throw C.message+=` in ${Ht(this,e,ht.PATH)}`,C}if(c===\"enableStrictSettings\"&&e!==\"<environment>\"){a=E;continue}if(h.type===\"MAP\"){let C=this.values.get(c);this.values.set(c,new Map(n?[...C,...E]:[...E,...C])),this.sources.set(c,`${this.sources.get(c)}, ${e}`)}else if(h.isArray&&h.concatenateValues){let C=this.values.get(c);this.values.set(c,n?[...C,...E]:[...E,...C]),this.sources.set(c,`${this.sources.get(c)}, ${e}`)}else this.values.set(c,E),this.sources.set(c,e)}}get(e){if(!this.values.has(e))throw new Error(`Invalid configuration key \"${e}\"`);return this.values.get(e)}getSpecial(e,{hideSecrets:r=!1,getNativePaths:s=!1}){let a=this.get(e),n=this.settings.get(e);if(typeof n>\"u\")throw new nt(`Couldn't find a configuration settings named \"${e}\"`);return yT(a,n,{hideSecrets:r,getNativePaths:s})}getSubprocessStreams(e,{header:r,prefix:s,report:a}){let n,c,f=ce.createWriteStream(e);if(this.get(\"enableInlineBuilds\")){let p=a.createStreamReporter(`${s} ${Ht(this,\"STDOUT\",\"green\")}`),h=a.createStreamReporter(`${s} ${Ht(this,\"STDERR\",\"red\")}`);n=new hj.PassThrough,n.pipe(p),n.pipe(f),c=new hj.PassThrough,c.pipe(h),c.pipe(f)}else n=f,c=f,typeof r<\"u\"&&n.write(`${r}\n`);return{stdout:n,stderr:c}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let s of r.resolvers||[])e.push(new s);return new rm([new FQ,new Ei,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let s of r.fetchers||[])e.push(new s);return new aI([new lI,new cI,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let s of r.linkers||[])e.push(new s);return e}getSupportedArchitectures(){let e=sv(),r=this.get(\"supportedArchitectures\"),s=r.get(\"os\");s!==null&&(s=s.map(c=>c===\"current\"?e.os:c));let a=r.get(\"cpu\");a!==null&&(a=a.map(c=>c===\"current\"?e.cpu:c));let n=r.get(\"libc\");return n!==null&&(n=Wl(n,c=>c===\"current\"?e.libc??Wl.skip:c)),{os:s,cpu:a,libc:n}}isInteractive({interactive:e,stdout:r}){return r.isTTY?e??this.get(\"preferInteractive\"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let e=this.packageExtensions,r=(s,a,{userProvided:n=!1}={})=>{if(!cl(s.range))throw new Error(\"Only semver ranges are allowed as keys for the packageExtensions setting\");let c=new Ut;c.load(a,{yamlCompatibilityMode:!0});let f=xB(e,s.identHash),p=[];f.push([s.range,p]);let h={status:\"inactive\",userProvided:n,parentDescriptor:s};for(let E of c.dependencies.values())p.push({...h,type:\"Dependency\",descriptor:E});for(let E of c.peerDependencies.values())p.push({...h,type:\"PeerDependency\",descriptor:E});for(let[E,C]of c.peerDependenciesMeta)for(let[S,P]of Object.entries(C))p.push({...h,type:\"PeerDependencyMeta\",selector:E,key:S,value:P})};await this.triggerHook(s=>s.registerPackageExtensions,this,r);for(let[s,a]of this.get(\"packageExtensions\"))r(C0(s,!0),Yk(a),{userProvided:!0});return e}normalizeLocator(e){return cl(e.reference)?Ws(e,`${this.get(\"defaultProtocol\")}${e.reference}`):Mp.test(e.reference)?Ws(e,`${this.get(\"defaultProtocol\")}${e.reference}`):e}normalizeDependency(e){return cl(e.range)?On(e,`${this.get(\"defaultProtocol\")}${e.range}`):Mp.test(e.range)?On(e,`${this.get(\"defaultProtocol\")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,s])=>[r,this.normalizeDependency(s)]))}normalizePackage(e,{packageExtensions:r}){let s=LB(e),a=r.get(e.identHash);if(typeof a<\"u\"){let c=e.version;if(c!==null){for(let[f,p]of a)if(Zf(c,f))for(let h of p)switch(h.status===\"inactive\"&&(h.status=\"redundant\"),h.type){case\"Dependency\":typeof s.dependencies.get(h.descriptor.identHash)>\"u\"&&(h.status=\"active\",s.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case\"PeerDependency\":typeof s.peerDependencies.get(h.descriptor.identHash)>\"u\"&&(h.status=\"active\",s.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case\"PeerDependencyMeta\":{let E=s.peerDependenciesMeta.get(h.selector);(typeof E>\"u\"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status=\"active\",Yl(s.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:G4(h)}}}let n=c=>c.scope?`${c.scope}__${c.name}`:`${c.name}`;for(let c of s.peerDependenciesMeta.keys()){let f=Sa(c);s.peerDependencies.has(f.identHash)||s.peerDependencies.set(f.identHash,On(f,\"*\"))}for(let c of s.peerDependencies.values()){if(c.scope===\"types\")continue;let f=n(c),p=Da(\"types\",f),h=un(p);s.peerDependencies.has(p.identHash)||s.peerDependenciesMeta.has(h)||s.dependencies.has(p.identHash)||(s.peerDependencies.set(p.identHash,On(p,\"*\")),s.peerDependenciesMeta.set(h,{optional:!0}))}return s.dependencies=new Map(qs(s.dependencies,([,c])=>al(c))),s.peerDependencies=new Map(qs(s.peerDependencies,([,c])=>al(c))),s}getLimit(e){return Yl(this.limits,e,()=>(0,cpe.default)(this.get(e)))}async triggerHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);n&&await n(...r)}}async triggerMultipleHooks(e,r){for(let s of r)await this.triggerHook(e,...s)}async reduceHook(e,r,...s){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=e(c);f&&(a=await f(a,...s))}return a}async firstHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);if(!n)continue;let c=await n(...r);if(typeof c<\"u\")return c}return null}}});var qr={};Vt(qr,{EndStrategy:()=>Bj,ExecError:()=>CT,PipeError:()=>lv,execvp:()=>Aj,pipevp:()=>Wu});function om(t){return t!==null&&typeof t.fd==\"number\"}function Ij(){}function Cj(){for(let t of am)t.kill()}async function Wu(t,e,{cwd:r,env:s=process.env,strict:a=!1,stdin:n=null,stdout:c,stderr:f,end:p=2}){let h=[\"pipe\",\"pipe\",\"pipe\"];n===null?h[0]=\"ignore\":om(n)&&(h[0]=n),om(c)&&(h[1]=c),om(f)&&(h[2]=f);let E=(0,wj.default)(t,e,{cwd:fe.fromPortablePath(r),env:{...s,PWD:fe.fromPortablePath(r)},stdio:h});am.add(E),am.size===1&&(process.on(\"SIGINT\",Ij),process.on(\"SIGTERM\",Cj)),!om(n)&&n!==null&&n.pipe(E.stdin),om(c)||E.stdout.pipe(c,{end:!1}),om(f)||E.stderr.pipe(f,{end:!1});let C=()=>{for(let S of new Set([c,f]))om(S)||S.end()};return new Promise((S,P)=>{E.on(\"error\",I=>{am.delete(E),am.size===0&&(process.off(\"SIGINT\",Ij),process.off(\"SIGTERM\",Cj)),(p===2||p===1)&&C(),P(I)}),E.on(\"close\",(I,R)=>{am.delete(E),am.size===0&&(process.off(\"SIGINT\",Ij),process.off(\"SIGTERM\",Cj)),(p===2||p===1&&I!==0)&&C(),I===0||!a?S({code:vj(I,R)}):P(new lv({fileName:t,code:I,signal:R}))})})}async function Aj(t,e,{cwd:r,env:s=process.env,encoding:a=\"utf8\",strict:n=!1}){let c=[\"ignore\",\"pipe\",\"pipe\"],f=[],p=[],h=fe.fromPortablePath(r);typeof s.PWD<\"u\"&&(s={...s,PWD:h});let E=(0,wj.default)(t,e,{cwd:h,env:s,stdio:c});return E.stdout.on(\"data\",C=>{f.push(C)}),E.stderr.on(\"data\",C=>{p.push(C)}),await new Promise((C,S)=>{E.on(\"error\",P=>{let I=ze.create(r),R=Ht(I,t,ht.PATH);S(new jt(1,`Process ${R} failed to spawn`,N=>{N.reportError(1,`  ${Kf(I,{label:\"Thrown Error\",value:_u(ht.NO_HINT,P.message)})}`)}))}),E.on(\"close\",(P,I)=>{let R=a===\"buffer\"?Buffer.concat(f):Buffer.concat(f).toString(a),N=a===\"buffer\"?Buffer.concat(p):Buffer.concat(p).toString(a);P===0||!n?C({code:vj(P,I),stdout:R,stderr:N}):S(new CT({fileName:t,code:P,signal:I,stdout:R,stderr:N}))})})}function vj(t,e){let r=Gnt.get(e);return typeof r<\"u\"?128+r:t??1}function qnt(t,e,{configuration:r,report:s}){s.reportError(1,`  ${Kf(r,t!==null?{label:\"Exit Code\",value:_u(ht.NUMBER,t)}:{label:\"Exit Signal\",value:_u(ht.CODE,e)})}`)}var wj,Bj,lv,CT,am,Gnt,dT=Xe(()=>{Dt();wj=ut(_U());av();Tc();xc();Bj=(s=>(s[s.Never=0]=\"Never\",s[s.ErrorCode=1]=\"ErrorCode\",s[s.Always=2]=\"Always\",s))(Bj||{}),lv=class extends jt{constructor({fileName:e,code:r,signal:s}){let a=ze.create(J.cwd()),n=Ht(a,e,ht.PATH);super(1,`Child ${n} reported an error`,c=>{qnt(r,s,{configuration:a,report:c})}),this.code=vj(r,s)}},CT=class extends lv{constructor({fileName:e,code:r,signal:s,stdout:a,stderr:n}){super({fileName:e,code:r,signal:s}),this.stdout=a,this.stderr=n}};am=new Set;Gnt=new Map([[\"SIGINT\",2],[\"SIGQUIT\",3],[\"SIGKILL\",9],[\"SIGTERM\",15]])});function Ape(t){fpe=t}function cv(){return typeof Sj>\"u\"&&(Sj=fpe()),Sj}var Sj,fpe,Dj=Xe(()=>{fpe=()=>{throw new Error(\"Assertion failed: No libzip instance is available, and no factory was configured\")}});var ppe=_((wT,Pj)=>{var Wnt=Object.assign({},Ie(\"fs\")),bj=function(){var t=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(t=t||__filename),function(e){e=e||{};var r=typeof e<\"u\"?e:{},s,a;r.ready=new Promise(function(Ke,st){s=Ke,a=st});var n={},c;for(c in r)r.hasOwnProperty(c)&&(n[c]=r[c]);var f=[],p=\"./this.program\",h=function(Ke,st){throw st},E=!1,C=!0,S=\"\";function P(Ke){return r.locateFile?r.locateFile(Ke,S):S+Ke}var I,R,N,U;C&&(E?S=Ie(\"path\").dirname(S)+\"/\":S=__dirname+\"/\",I=function(st,St){var lr=Me(st);return lr?St?lr:lr.toString():(N||(N=Wnt),U||(U=Ie(\"path\")),st=U.normalize(st),N.readFileSync(st,St?null:\"utf8\"))},R=function(st){var St=I(st,!0);return St.buffer||(St=new Uint8Array(St)),we(St.buffer),St},process.argv.length>1&&(p=process.argv[1].replace(/\\\\/g,\"/\")),f=process.argv.slice(2),h=function(Ke){process.exit(Ke)},r.inspect=function(){return\"[Emscripten Module object]\"});var W=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(c in n)n.hasOwnProperty(c)&&(r[c]=n[c]);n=null,r.arguments&&(f=r.arguments),r.thisProgram&&(p=r.thisProgram),r.quit&&(h=r.quit);var ie=0,ue=function(Ke){ie=Ke},le;r.wasmBinary&&(le=r.wasmBinary);var me=r.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&rs(\"no native wasm support detected\");function pe(Ke,st,St){switch(st=st||\"i8\",st.charAt(st.length-1)===\"*\"&&(st=\"i32\"),st){case\"i1\":return Ve[Ke>>0];case\"i8\":return Ve[Ke>>0];case\"i16\":return mh((Ke>>1)*2);case\"i32\":return to((Ke>>2)*4);case\"i64\":return to((Ke>>2)*4);case\"float\":return Af((Ke>>2)*4);case\"double\":return dh((Ke>>3)*8);default:rs(\"invalid type for getValue: \"+st)}return null}var Be,Ce=!1,g;function we(Ke,st){Ke||rs(\"Assertion failed: \"+st)}function ye(Ke){var st=r[\"_\"+Ke];return we(st,\"Cannot call unknown function \"+Ke+\", make sure it is exported\"),st}function Ae(Ke,st,St,lr,te){var Ee={string:function(qi){var Tn=0;if(qi!=null&&qi!==0){var Ga=(qi.length<<2)+1;Tn=wi(Ga),mt(qi,Tn,Ga)}return Tn},array:function(qi){var Tn=wi(qi.length);return Fe(qi,Tn),Tn}};function Oe(qi){return st===\"string\"?De(qi):st===\"boolean\"?!!qi:qi}var dt=ye(Ke),Et=[],bt=0;if(lr)for(var tr=0;tr<lr.length;tr++){var An=Ee[St[tr]];An?(bt===0&&(bt=gf()),Et[tr]=An(lr[tr])):Et[tr]=lr[tr]}var li=dt.apply(null,Et);return li=Oe(li),bt!==0&&fc(bt),li}function se(Ke,st,St,lr){St=St||[];var te=St.every(function(Oe){return Oe===\"number\"}),Ee=st!==\"string\";return Ee&&te&&!lr?ye(Ke):function(){return Ae(Ke,st,St,arguments,lr)}}var Z=new TextDecoder(\"utf8\");function De(Ke,st){if(!Ke)return\"\";for(var St=Ke+st,lr=Ke;!(lr>=St)&&ke[lr];)++lr;return Z.decode(ke.subarray(Ke,lr))}function Re(Ke,st,St,lr){if(!(lr>0))return 0;for(var te=St,Ee=St+lr-1,Oe=0;Oe<Ke.length;++Oe){var dt=Ke.charCodeAt(Oe);if(dt>=55296&&dt<=57343){var Et=Ke.charCodeAt(++Oe);dt=65536+((dt&1023)<<10)|Et&1023}if(dt<=127){if(St>=Ee)break;st[St++]=dt}else if(dt<=2047){if(St+1>=Ee)break;st[St++]=192|dt>>6,st[St++]=128|dt&63}else if(dt<=65535){if(St+2>=Ee)break;st[St++]=224|dt>>12,st[St++]=128|dt>>6&63,st[St++]=128|dt&63}else{if(St+3>=Ee)break;st[St++]=240|dt>>18,st[St++]=128|dt>>12&63,st[St++]=128|dt>>6&63,st[St++]=128|dt&63}}return st[St]=0,St-te}function mt(Ke,st,St){return Re(Ke,ke,st,St)}function j(Ke){for(var st=0,St=0;St<Ke.length;++St){var lr=Ke.charCodeAt(St);lr>=55296&&lr<=57343&&(lr=65536+((lr&1023)<<10)|Ke.charCodeAt(++St)&1023),lr<=127?++st:lr<=2047?st+=2:lr<=65535?st+=3:st+=4}return st}function rt(Ke){var st=j(Ke)+1,St=La(st);return St&&Re(Ke,Ve,St,st),St}function Fe(Ke,st){Ve.set(Ke,st)}function Ne(Ke,st){return Ke%st>0&&(Ke+=st-Ke%st),Ke}var Pe,Ve,ke,it,Ue,x,w,b,y,F;function z(Ke){Pe=Ke,r.HEAP_DATA_VIEW=F=new DataView(Ke),r.HEAP8=Ve=new Int8Array(Ke),r.HEAP16=it=new Int16Array(Ke),r.HEAP32=x=new Int32Array(Ke),r.HEAPU8=ke=new Uint8Array(Ke),r.HEAPU16=Ue=new Uint16Array(Ke),r.HEAPU32=w=new Uint32Array(Ke),r.HEAPF32=b=new Float32Array(Ke),r.HEAPF64=y=new Float64Array(Ke)}var X=r.INITIAL_MEMORY||16777216,$,oe=[],xe=[],Te=[],lt=!1;function Ct(){if(r.preRun)for(typeof r.preRun==\"function\"&&(r.preRun=[r.preRun]);r.preRun.length;)Pt(r.preRun.shift());Ts(oe)}function qt(){lt=!0,Ts(xe)}function ir(){if(r.postRun)for(typeof r.postRun==\"function\"&&(r.postRun=[r.postRun]);r.postRun.length;)Pr(r.postRun.shift());Ts(Te)}function Pt(Ke){oe.unshift(Ke)}function gn(Ke){xe.unshift(Ke)}function Pr(Ke){Te.unshift(Ke)}var Ir=0,Or=null,on=null;function ai(Ke){Ir++,r.monitorRunDependencies&&r.monitorRunDependencies(Ir)}function Io(Ke){if(Ir--,r.monitorRunDependencies&&r.monitorRunDependencies(Ir),Ir==0&&(Or!==null&&(clearInterval(Or),Or=null),on)){var st=on;on=null,st()}}r.preloadedImages={},r.preloadedAudios={};function rs(Ke){r.onAbort&&r.onAbort(Ke),Ke+=\"\",ee(Ke),Ce=!0,g=1,Ke=\"abort(\"+Ke+\"). Build with -s ASSERTIONS=1 for more info.\";var st=new WebAssembly.RuntimeError(Ke);throw a(st),st}var $s=\"data:application/octet-stream;base64,\";function Co(Ke){return Ke.startsWith($s)}var ji=\"data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF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A0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQAoDQAgACgCJEEDRgRAIABBDGoEQCAAQQA2AhAgAEEXNgIMC0F/DwsCQCAAKAIgBEAgACkDGELAAINCAFINASAAQQxqBEAgAEEANgIQIABBHTYCDAtBfw8LAkAgACgCACICRQ0AIAIQMkF/Sg0AIAAoAgAhASAAQQxqIgAEQCAAIAEoAgw2AgAgACABKAIQNgIEC0F/DwsgAEEAQgBBABAOQn9VDQAgACgCACIARQ0BIAAQGhpBfw8LQQAhASAAQQA7ATQgAEEMagRAIABCADcCDAsgACAAKAIgQQFqNgIgCyABCzsAIAAtACgEfkJ/BSAAKAIgRQRAIABBDGoiAARAIABBADYCBCAAQRI2AgALQn8PCy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JxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwEIC0H//wNxEA0LIAMgCQR/QS0FIAEvAQoLQf//A3EQDSADIAEvAQwQDSADIAsEf0HjAAUgASgCEAtB//8Dc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/IAEgAkIgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6AAwL1wICBH8BfgJAAkAgACgCQCABp0EEdGooAgAiA0UEQCACBEAgAkEANgIEIAJBFDYCAAsMAQsgACgCACADK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QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AGAgAiABKQBoNwBoIAIgASkAcDcAcCACIAEpAHg3AHggAUGAAWohASACQYABaiECIBpCgAF9IhpCH1YNAAsLIBpCEFoEQCACIAEpAAA3AAAgAiABKQAINwAIIBpCEH0hGiACQRBqIQIgAUEQaiEBCyAaQghaBEAgAiABKQAANwAAIBpCCH0hGiACQQhqIQIgAUEIaiEBCyAaQgRaBEAgAiABKAAANgAAIBpCBH0hGiACQQRqIQIgAUEEaiEBCyAaQgJaBEAgAiABLwAAOwAAIBpCAn0hGiACQQJqIQIgAUECaiEBCyAcIBt9IRwgGlBFBEAgAiABLQAAOgAAIAJBAWohAiABQQFqIQELIBxCAFINAAsLIAUgBmshAUEAIARrIQUCQCAEQQdLBEAgBCEDDAELIAEgBE0EQCAEIQMMAQsgAiAEayEFA0ACQCACIAUpAAA3AAAgBEEBdCEDIAEgBGshASACIARqIQIgBEEDSw0AIAMhBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAAC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QAgA62GIAuEIQsgBCAFQQRJBH8gBgUgByAIQYDSAGooAgBrrSAGrYYgC4QhCyAIQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwUakEAOwEAIABBmBRqQQA7AQAgAEGUFGpBADsBACAAQZAUakEAOwEAIABBjBRqQQA7AQAgAEGIFGpBADsBACAA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BH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS0AAEcNACAGIAQtAAJHDQAgBEEDaiEEQQAhCQJAA0AgBiAELQAARw0BIAQtAAEgBkcEQCAJQQFyIQkMAgsgBC0AAiAGRwRAIAlBAnIhCQwCCyAELQADIAZHBEAgCUEDciEJDAILIAQt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IAEgBUHAgAEoAgARAAAiATYCHCAMIAE2AjALIAMoAiwiDUUNASAQIA1rIQUgAygCOCEBIAwoAhwiBigCFARAIAZBQGsgASAFIA1B3IABKAIAEQgADAILIAYgBigCHCABIAUgDUHEgAEoAgARBAAiATYCHCAMIAE2AjAMAQsgDSAQIAZrIAYQBxoLIANBADYCNCADIAMoAiw2AjBBAAwECyAKIAYgAygCNCIFayIBIAEgCksbIQsgECAKayEGIAUgDWohBQJAIAkEQAJAIAtFDQAgDCgCHCIBKAIUBEAgAUFAayAFIAYgC0HcgAEoAgARCAAMAQsgASABKAIcIAUgBiALQcSAASgCABEEACIBNgIcIAwgATYCMAsgCiALayIFRQ0BIBAgBWshBiADKAI4IQEgDCgCHCINKAIUBEAgDUFAayABIAYgBUHcgAEoAgARCAAMBQsgDSANKAIcIAEgBiAFQcSAASgCABEEACIBNgIcIAwgATYCMAwECyAFIAYgCxAHGiAKIAtrIgUNAgtBACEIIANBACADKAI0IAtqIgUgBSADKAIsIgFGGzYCNCABIAMoAjAiAU0NACADIAEgC2o2AjALIAgMAgsgAygCOCAQIAVrIAUQBxoLIAMgBTYCNCADIAMoAiw2AjBBAAtFBEAgDCgCECEPIAwoAgQhFyAHKAKIAQwDCyAHQdL+ADYCBAtBfCEXDAILIAYhFyAFCyEFIAwgICAXayIBIAwoAghqNgIIIAwgFiAPayIGIAwoAhRqNgIUIAcgBygCICAGajYCICAMIAcoAghBAEdBBnQgBWogBygCBCIFQb/+AEZBB3RqQYACIAVBwv4ARkEIdCAFQcf+AEYbajYCLCAEIARBeyAEGyABIAZyGyEXCyAUQRBqJAAgFwshASACIAIpAwAgADUCIH03AwACQAJAAkACQCABQQVqDgcBAgICAgMAAgtBAQ8LIAAoAhQNAEEDDwsgACgCACIABEAgACABNgIEIABBDTYCAAtBAiEBCyABCwkAIABBAToADAtEAAJAIAJC/////w9YBEAgACgCFEUNAQsgACgCACIABEAgAEEANgIEIABBEjYCAAtBAA8LIAAgATYCECAAIAI+AhRB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q0X7/IjjfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQB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AABMAAAAHAEHg0wALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHQ1AALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEGA1gALIwIAAAADAAAABwAAAAAAAAAQERIACAcJBgoFCwQMAw0CDgEPAEHQ1gALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHA1wALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEG42AALASwAQcTYAAthLQAAAAQABAAIAAQALgAAAAQABgAQAAYALwAAAAQADAAgABgALwAAAAgAEAAgACAALwAAAAgAEACAAIAALwAAAAgAIACAAAABMAAAACAAgAACAQAEMAAAACAAAgECAQAQMABBsNkAC6UTAwAEAAUABgAHAAgACQAKAAsADQAPABEAEwAXABsAHwAjACsAMwA7AEMAUwBjAHMAgwCjAMMA4wACAQAAAAAAABAAEAAQABAAEAAQABAAEAARABEAEQARABIAEgASABIAEwATABMAEwAUABQAFAAUABUAFQAVABUAEABNAMoAAAABAAIAAwAEAAUABwAJAA0AEQAZACEAMQBBAGEAgQDBAAEBgQEBAgEDAQQBBgEIAQwBEAEYASABMAFAAWAAAAAAEAAQABAAEAARABEAEgASABMAEwAUABQAFQAVABYAFgAXABcAGAAYABkAGQAaABoAGwAbABwAHAAdAB0AQABAAGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcAAEAcKAA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xlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w==\";Co(ji)||(ji=P(ji));function eo(Ke){try{if(Ke==ji&&le)return new Uint8Array(le);var st=Me(Ke);if(st)return st;if(R)return R(Ke);throw\"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)\"}catch(St){rs(St)}}function wo(Ke,st){var St,lr,te;try{te=eo(Ke),lr=new WebAssembly.Module(te),St=new WebAssembly.Instance(lr,st)}catch(Oe){var Ee=Oe.toString();throw ee(\"failed to compile wasm module: \"+Ee),(Ee.includes(\"imported Memory\")||Ee.includes(\"memory import\"))&&ee(\"Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time).\"),Oe}return[St,lr]}function QA(){var Ke={a:cu};function st(te,Ee){var Oe=te.exports;r.asm=Oe,Be=r.asm.g,z(Be.buffer),$=r.asm.W,gn(r.asm.h),Io(\"wasm-instantiate\")}if(ai(\"wasm-instantiate\"),r.instantiateWasm)try{var St=r.instantiateWasm(Ke,st);return St}catch(te){return ee(\"Module.instantiateWasm callback failed with error: \"+te),!1}var lr=wo(ji,Ke);return st(lr[0]),r.asm}function Af(Ke){return F.getFloat32(Ke,!0)}function dh(Ke){return F.getFloat64(Ke,!0)}function mh(Ke){return F.getInt16(Ke,!0)}function to(Ke){return F.getInt32(Ke,!0)}function jn(Ke,st){F.setInt32(Ke,st,!0)}function Ts(Ke){for(;Ke.length>0;){var st=Ke.shift();if(typeof st==\"function\"){st(r);continue}var St=st.func;typeof St==\"number\"?st.arg===void 0?$.get(St)():$.get(St)(st.arg):St(st.arg===void 0?null:st.arg)}}function ro(Ke,st){var St=new Date(to((Ke>>2)*4)*1e3);jn((st>>2)*4,St.getUTCSeconds()),jn((st+4>>2)*4,St.getUTCMinutes()),jn((st+8>>2)*4,St.getUTCHours()),jn((st+12>>2)*4,St.getUTCDate()),jn((st+16>>2)*4,St.getUTCMonth()),jn((st+20>>2)*4,St.getUTCFullYear()-1900),jn((st+24>>2)*4,St.getUTCDay()),jn((st+36>>2)*4,0),jn((st+32>>2)*4,0);var lr=Date.UTC(St.getUTCFullYear(),0,1,0,0,0,0),te=(St.getTime()-lr)/(1e3*60*60*24)|0;return jn((st+28>>2)*4,te),ro.GMTString||(ro.GMTString=rt(\"GMT\")),jn((st+40>>2)*4,ro.GMTString),st}function ou(Ke,st){return ro(Ke,st)}function au(Ke,st,St){ke.copyWithin(Ke,st,st+St)}function lu(Ke){try{return Be.grow(Ke-Pe.byteLength+65535>>>16),z(Be.buffer),1}catch{}}function TA(Ke){var st=ke.length;Ke=Ke>>>0;var St=2147483648;if(Ke>St)return!1;for(var lr=1;lr<=4;lr*=2){var te=st*(1+.2/lr);te=Math.min(te,Ke+100663296);var Ee=Math.min(St,Ne(Math.max(Ke,te),65536)),Oe=lu(Ee);if(Oe)return!0}return!1}function RA(Ke){ue(Ke)}function oa(Ke){var st=Date.now()/1e3|0;return Ke&&jn((Ke>>2)*4,st),st}function aa(){if(aa.called)return;aa.called=!0;var Ke=new Date().getFullYear(),st=new Date(Ke,0,1),St=new Date(Ke,6,1),lr=st.getTimezoneOffset(),te=St.getTimezoneOffset(),Ee=Math.max(lr,te);jn((vl()>>2)*4,Ee*60),jn((Is()>>2)*4,+(lr!=te));function Oe(An){var li=An.toTimeString().match(/\\(([A-Za-z ]+)\\)$/);return li?li[1]:\"GMT\"}var dt=Oe(st),Et=Oe(St),bt=rt(dt),tr=rt(Et);te<lr?(jn((Mi()>>2)*4,bt),jn((Mi()+4>>2)*4,tr)):(jn((Mi()>>2)*4,tr),jn((Mi()+4>>2)*4,bt))}function FA(Ke){aa();var st=Date.UTC(to((Ke+20>>2)*4)+1900,to((Ke+16>>2)*4),to((Ke+12>>2)*4),to((Ke+8>>2)*4),to((Ke+4>>2)*4),to((Ke>>2)*4),0),St=new Date(st);jn((Ke+24>>2)*4,St.getUTCDay());var lr=Date.UTC(St.getUTCFullYear(),0,1,0,0,0,0),te=(St.getTime()-lr)/(1e3*60*60*24)|0;return jn((Ke+28>>2)*4,te),St.getTime()/1e3|0}var gr=typeof atob==\"function\"?atob:function(Ke){var st=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",St=\"\",lr,te,Ee,Oe,dt,Et,bt,tr=0;Ke=Ke.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");do Oe=st.indexOf(Ke.charAt(tr++)),dt=st.indexOf(Ke.charAt(tr++)),Et=st.indexOf(Ke.charAt(tr++)),bt=st.indexOf(Ke.charAt(tr++)),lr=Oe<<2|dt>>4,te=(dt&15)<<4|Et>>2,Ee=(Et&3)<<6|bt,St=St+String.fromCharCode(lr),Et!==64&&(St=St+String.fromCharCode(te)),bt!==64&&(St=St+String.fromCharCode(Ee));while(tr<Ke.length);return St};function Bo(Ke){if(typeof C==\"boolean\"&&C){var st;try{st=Buffer.from(Ke,\"base64\")}catch{st=new Buffer(Ke,\"base64\")}return new Uint8Array(st.buffer,st.byteOffset,st.byteLength)}try{for(var St=gr(Ke),lr=new Uint8Array(St.length),te=0;te<St.length;++te)lr[te]=St.charCodeAt(te);return lr}catch{throw new Error(\"Converting base64 string to bytes failed.\")}}function Me(Ke){if(Co(Ke))return Bo(Ke.slice($s.length))}var cu={e:ou,c:au,d:TA,a:RA,b:oa,f:FA},Cr=QA(),pf=r.___wasm_call_ctors=Cr.h,NA=r._zip_ext_count_symlinks=Cr.i,OA=r._zip_file_get_external_attributes=Cr.j,uu=r._zipstruct_statS=Cr.k,fu=r._zipstruct_stat_size=Cr.l,oc=r._zipstruct_stat_mtime=Cr.m,ve=r._zipstruct_stat_crc=Cr.n,Nt=r._zipstruct_errorS=Cr.o,ac=r._zipstruct_error_code_zip=Cr.p,Oi=r._zipstruct_stat_comp_size=Cr.q,no=r._zipstruct_stat_comp_method=Cr.r,Rt=r._zip_close=Cr.s,xn=r._zip_delete=Cr.t,la=r._zip_dir_add=Cr.u,Gi=r._zip_discard=Cr.v,Li=r._zip_error_init_with_code=Cr.w,Na=r._zip_get_error=Cr.x,dn=r._zip_file_get_error=Cr.y,Kn=r._zip_error_strerror=Cr.z,Au=r._zip_fclose=Cr.A,yh=r._zip_file_add=Cr.B,Oa=r._free=Cr.C,La=r._malloc=Cr.D,Ma=r._zip_source_error=Cr.E,$e=r._zip_source_seek=Cr.F,Ua=r._zip_file_set_external_attributes=Cr.G,hf=r._zip_file_set_mtime=Cr.H,lc=r._zip_fopen_index=Cr.I,wn=r._zip_fread=Cr.J,ca=r._zip_get_name=Cr.K,LA=r._zip_get_num_entries=Cr.L,MA=r._zip_source_read=Cr.M,ua=r._zip_name_locate=Cr.N,Bl=r._zip_open_from_source=Cr.O,Mt=r._zip_set_file_compression=Cr.P,kn=r._zip_source_buffer=Cr.Q,fa=r._zip_source_buffer_create=Cr.R,Ha=r._zip_source_close=Cr.S,ns=r._zip_source_free=Cr.T,cc=r._zip_source_keep=Cr.U,pu=r._zip_source_open=Cr.V,uc=r._zip_source_tell=Cr.X,ja=r._zip_stat_index=Cr.Y,Mi=r.__get_tzname=Cr.Z,Is=r.__get_daylight=Cr._,vl=r.__get_timezone=Cr.$,gf=r.stackSave=Cr.aa,fc=r.stackRestore=Cr.ba,wi=r.stackAlloc=Cr.ca;r.cwrap=se,r.getValue=pe;var Qn;on=function Ke(){Qn||Ac(),Qn||(on=Ke)};function Ac(Ke){if(Ke=Ke||f,Ir>0||(Ct(),Ir>0))return;function st(){Qn||(Qn=!0,r.calledRun=!0,!Ce&&(qt(),s(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),ir()))}r.setStatus?(r.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){r.setStatus(\"\")},1),st()},1)):st()}if(r.run=Ac,r.preInit)for(typeof r.preInit==\"function\"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Ac(),e}}();typeof wT==\"object\"&&typeof Pj==\"object\"?Pj.exports=bj:typeof define==\"function\"&&define.amd?define([],function(){return bj}):typeof wT==\"object\"&&(wT.createModule=bj)});var Up,hpe,gpe,dpe=Xe(()=>{Up=[\"number\",\"number\"],hpe=(Z=>(Z[Z.ZIP_ER_OK=0]=\"ZIP_ER_OK\",Z[Z.ZIP_ER_MULTIDISK=1]=\"ZIP_ER_MULTIDISK\",Z[Z.ZIP_ER_RENAME=2]=\"ZIP_ER_RENAME\",Z[Z.ZIP_ER_CLOSE=3]=\"ZIP_ER_CLOSE\",Z[Z.ZIP_ER_SEEK=4]=\"ZIP_ER_SEEK\",Z[Z.ZIP_ER_READ=5]=\"ZIP_ER_READ\",Z[Z.ZIP_ER_WRITE=6]=\"ZIP_ER_WRITE\",Z[Z.ZIP_ER_CRC=7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",Z))(hpe||{}),gpe=t=>({get HEAPU8(){return t.HEAPU8},errors:hpe,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,ZIP_CHECKCONS:4,ZIP_EXCL:2,ZIP_RDONLY:16,ZIP_FL_OVERWRITE:8192,ZIP_FL_COMPRESSED:4,ZIP_OPSYS_DOS:0,ZIP_OPSYS_AMIGA:1,ZIP_OPSYS_OPENVMS:2,ZIP_OPSYS_UNIX:3,ZIP_OPSYS_VM_CMS:4,ZIP_OPSYS_ATARI_ST:5,ZIP_OPSYS_OS_2:6,ZIP_OPSYS_MACINTOSH:7,ZIP_OPSYS_Z_SYSTEM:8,ZIP_OPSYS_CPM:9,ZIP_OPSYS_WINDOWS_NTFS:10,ZIP_OPSYS_MVS:11,ZIP_OPSYS_VSE:12,ZIP_OPSYS_ACORN_RISC:13,ZIP_OPSYS_VFAT:14,ZIP_OPSYS_ALTERNATE_MVS:15,ZIP_OPSYS_BEOS:16,ZIP_OPSYS_TANDEM:17,ZIP_OPSYS_OS_400:18,ZIP_OPSYS_OS_X:19,ZIP_CM_DEFAULT:-1,ZIP_CM_STORE:0,ZIP_CM_DEFLATE:8,uint08S:t._malloc(1),uint32S:t._malloc(4),malloc:t._malloc,free:t._free,getValue:t.getValue,openFromSource:t.cwrap(\"zip_open_from_source\",\"number\",[\"number\",\"number\",\"number\"]),close:t.cwrap(\"zip_close\",\"number\",[\"number\"]),discard:t.cwrap(\"zip_discard\",null,[\"number\"]),getError:t.cwrap(\"zip_get_error\",\"number\",[\"number\"]),getName:t.cwrap(\"zip_get_name\",\"string\",[\"number\",\"number\",\"number\"]),getNumEntries:t.cwrap(\"zip_get_num_entries\",\"number\",[\"number\",\"number\"]),delete:t.cwrap(\"zip_delete\",\"number\",[\"number\",\"number\"]),statIndex:t.cwrap(\"zip_stat_index\",\"number\",[\"number\",...Up,\"number\",\"number\"]),fopenIndex:t.cwrap(\"zip_fopen_index\",\"number\",[\"number\",...Up,\"number\"]),fread:t.cwrap(\"zip_fread\",\"number\",[\"number\",\"number\",\"number\",\"number\"]),fclose:t.cwrap(\"zip_fclose\",\"number\",[\"number\"]),dir:{add:t.cwrap(\"zip_dir_add\",\"number\",[\"number\",\"string\"])},file:{add:t.cwrap(\"zip_file_add\",\"number\",[\"number\",\"string\",\"number\",\"number\"]),getError:t.cwrap(\"zip_file_get_error\",\"number\",[\"number\"]),getExternalAttributes:t.cwrap(\"zip_file_get_external_attributes\",\"number\",[\"number\",...Up,\"number\",\"number\",\"number\"]),setExternalAttributes:t.cwrap(\"zip_file_set_external_attributes\",\"number\",[\"number\",...Up,\"number\",\"number\",\"number\"]),setMtime:t.cwrap(\"zip_file_set_mtime\",\"number\",[\"number\",...Up,\"number\",\"number\"]),setCompression:t.cwrap(\"zip_set_file_compression\",\"number\",[\"number\",...Up,\"number\",\"number\"])},ext:{countSymlinks:t.cwrap(\"zip_ext_count_symlinks\",\"number\",[\"number\"])},error:{initWithCode:t.cwrap(\"zip_error_init_with_code\",null,[\"number\",\"number\"]),strerror:t.cwrap(\"zip_error_strerror\",\"string\",[\"number\"])},name:{locate:t.cwrap(\"zip_name_locate\",\"number\",[\"number\",\"string\",\"number\"])},source:{fromUnattachedBuffer:t.cwrap(\"zip_source_buffer_create\",\"number\",[\"number\",...Up,\"number\",\"number\"]),fromBuffer:t.cwrap(\"zip_source_buffer\",\"number\",[\"number\",\"number\",...Up,\"number\"]),free:t.cwrap(\"zip_source_free\",null,[\"number\"]),keep:t.cwrap(\"zip_source_keep\",null,[\"number\"]),open:t.cwrap(\"zip_source_open\",\"number\",[\"number\"]),close:t.cwrap(\"zip_source_close\",\"number\",[\"number\"]),seek:t.cwrap(\"zip_source_seek\",\"number\",[\"number\",...Up,\"number\"]),tell:t.cwrap(\"zip_source_tell\",\"number\",[\"number\"]),read:t.cwrap(\"zip_source_read\",\"number\",[\"number\",\"number\",\"number\"]),error:t.cwrap(\"zip_source_error\",\"number\",[\"number\"])},struct:{statS:t.cwrap(\"zipstruct_statS\",\"number\",[]),statSize:t.cwrap(\"zipstruct_stat_size\",\"number\",[\"number\"]),statCompSize:t.cwrap(\"zipstruct_stat_comp_size\",\"number\",[\"number\"]),statCompMethod:t.cwrap(\"zipstruct_stat_comp_method\",\"number\",[\"number\"]),statMtime:t.cwrap(\"zipstruct_stat_mtime\",\"number\",[\"number\"]),statCrc:t.cwrap(\"zipstruct_stat_crc\",\"number\",[\"number\"]),errorS:t.cwrap(\"zipstruct_errorS\",\"number\",[]),errorCodeZip:t.cwrap(\"zipstruct_error_code_zip\",\"number\",[\"number\"])}})});function xj(t,e){let r=t.indexOf(e);if(r<=0)return null;let s=r;for(;r>=0&&(s=r+e.length,t[s]!==J.sep);){if(t[r-1]===J.sep)return null;r=t.indexOf(e,s)}return t.length>s&&t[s]!==J.sep?null:t.slice(0,s)}var $f,mpe=Xe(()=>{Dt();Dt();eA();$f=class t extends e0{static async openPromise(e,r){let s=new t(r);try{return await e(s)}finally{s.saveAndClose()}}constructor(e={}){let r=e.fileExtensions,s=e.readOnlyArchives,a=typeof r>\"u\"?f=>xj(f,\".zip\"):f=>{for(let p of r){let h=xj(f,p);if(h)return h}return null},n=(f,p)=>new As(p,{baseFs:f,readOnly:s,stats:f.statSync(p),customZipImplementation:e.customZipImplementation}),c=async(f,p)=>{let h={baseFs:f,readOnly:s,stats:await f.statPromise(p),customZipImplementation:e.customZipImplementation};return()=>new As(p,h)};super({...e,factorySync:n,factoryPromise:c,getMountPoint:a})}}});var kj,BI,Qj=Xe(()=>{Dj();kj=class extends Error{constructor(e,r){super(e),this.name=\"Libzip Error\",this.code=r}},BI=class{constructor(e){this.filesShouldBeCached=!0;let r=\"buffer\"in e?e.buffer:e.baseFs.readFileSync(e.path);this.libzip=cv();let s=this.libzip.malloc(4);try{let c=0;e.readOnly&&(c|=this.libzip.ZIP_RDONLY);let f=this.allocateUnattachedSource(r);try{this.zip=this.libzip.openFromSource(f,c,s),this.lzSource=f}catch(p){throw this.libzip.source.free(f),p}if(this.zip===0){let p=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(p,this.libzip.getValue(s,\"i32\")),this.makeLibzipError(p)}}finally{this.libzip.free(s)}let a=this.libzip.getNumEntries(this.zip,0),n=new Array(a);for(let c=0;c<a;++c)n[c]=this.libzip.getName(this.zip,c,0);if(this.listings=n,this.symlinkCount=this.libzip.ext.countSymlinks(this.zip),this.symlinkCount===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}getSymlinkCount(){return this.symlinkCount}getListings(){return this.listings}stat(e){let r=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.libzip.struct.statSize(r)>>>0,n=this.libzip.struct.statMtime(r)>>>0,c=this.libzip.struct.statCrc(r)>>>0;return{size:a,mtime:n,crc:c}}makeLibzipError(e){let r=this.libzip.struct.errorCodeZip(e),s=this.libzip.error.strerror(e),a=new kj(s,this.libzip.errors[r]);if(r===this.libzip.errors.ZIP_ER_CHANGED)throw new Error(`Assertion failed: Unexpected libzip error: ${a.message}`);return a}setFileSource(e,r,s){let a=this.allocateSource(s);try{let n=this.libzip.file.add(this.zip,e,a,this.libzip.ZIP_FL_OVERWRITE);if(n===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(r!==null&&this.libzip.file.setCompression(this.zip,n,0,r[0],r[1])===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return n}catch(n){throw this.libzip.source.free(a),n}}setMtime(e,r){if(this.libzip.file.setMtime(this.zip,e,0,r,0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}getExternalAttributes(e){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let s=this.libzip.getValue(this.libzip.uint08S,\"i8\")>>>0,a=this.libzip.getValue(this.libzip.uint32S,\"i32\")>>>0;return[s,a]}setExternalAttributes(e,r,s){if(this.libzip.file.setExternalAttributes(this.zip,e,0,0,r,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}locate(e){return this.libzip.name.locate(this.zip,e,0)}getFileSource(e){let r=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.libzip.struct.statCompSize(r),n=this.libzip.struct.statCompMethod(r),c=this.libzip.malloc(a);try{let f=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(f===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let p=this.libzip.fread(f,c,a,0);if(p===-1)throw this.makeLibzipError(this.libzip.file.getError(f));if(p<a)throw new Error(\"Incomplete read\");if(p>a)throw new Error(\"Overread\");let h=this.libzip.HEAPU8.subarray(c,c+a);return{data:Buffer.from(h),compressionMethod:n}}finally{this.libzip.fclose(f)}}finally{this.libzip.free(c)}}deleteEntry(e){if(this.libzip.delete(this.zip,e)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}addDirectory(e){let r=this.libzip.dir.add(this.zip,e);if(r===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return r}getBufferAndClose(){try{if(this.libzip.source.keep(this.lzSource),this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.libzip.source.open(this.lzSource)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_END)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let e=this.libzip.source.tell(this.lzSource);if(e===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_SET)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let r=this.libzip.malloc(e);if(!r)throw new Error(\"Couldn't allocate enough memory\");try{let s=this.libzip.source.read(this.lzSource,r,e);if(s===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(s<e)throw new Error(\"Incomplete read\");if(s>e)throw new Error(\"Overread\");let a=Buffer.from(this.libzip.HEAPU8.subarray(r,r+e));return process.env.YARN_IS_TEST_ENV&&process.env.YARN_ZIP_DATA_EPILOGUE&&(a=Buffer.concat([a,Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)])),a}finally{this.libzip.free(r)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource)}}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let r=this.libzip.malloc(e.byteLength);if(!r)throw new Error(\"Couldn't allocate enough memory\");return new Uint8Array(this.libzip.HEAPU8.buffer,r,e.byteLength).set(e),{buffer:r,byteLength:e.byteLength}}allocateUnattachedSource(e){let r=this.libzip.struct.errorS(),{buffer:s,byteLength:a}=this.allocateBuffer(e),n=this.libzip.source.fromUnattachedBuffer(s,a,0,1,r);if(n===0)throw this.libzip.free(r),this.makeLibzipError(r);return n}allocateSource(e){let{buffer:r,byteLength:s}=this.allocateBuffer(e),a=this.libzip.source.fromBuffer(this.zip,r,s,0,1);if(a===0)throw this.libzip.free(r),this.makeLibzipError(this.libzip.getError(this.zip));return a}discard(){this.libzip.discard(this.zip)}}});function Ynt(t){if(typeof t==\"string\"&&String(+t)===t)return+t;if(typeof t==\"number\"&&Number.isFinite(t))return t<0?Date.now()/1e3:t;if(ype.types.isDate(t))return t.getTime()/1e3;throw new Error(\"Invalid time\")}function BT(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var xa,Tj,ype,Rj,lm,Fj,Nj,Epe,As,vT=Xe(()=>{Dt();Dt();Dt();Dt();Dt();Dt();xa=Ie(\"fs\"),Tj=Ie(\"stream\"),ype=Ie(\"util\"),Rj=ut(Ie(\"zlib\"));Qj();lm=3,Fj=0,Nj=8,Epe=\"mixed\";As=class extends Uf{constructor(r,s={}){super();this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;s.readOnly&&(this.readOnly=!0);let a=s;this.level=typeof a.level<\"u\"?a.level:Epe;let n=s.customZipImplementation??BI;if(typeof r==\"string\"){let{baseFs:f=new Yn}=a;this.baseFs=f,this.path=r}else this.path=null,this.baseFs=null;if(s.stats)this.stats=s.stats;else if(typeof r==\"string\")try{this.stats=this.baseFs.statSync(r)}catch(f){if(f.code===\"ENOENT\"&&a.create)this.stats=$a.makeDefaultStats();else throw f}else this.stats=$a.makeDefaultStats();typeof r==\"string\"?s.create?this.zipImpl=new n({buffer:BT(),readOnly:this.readOnly}):this.zipImpl=new n({path:r,baseFs:this.baseFs,readOnly:this.readOnly,size:this.stats.size}):this.zipImpl=new n({buffer:r??BT(),readOnly:this.readOnly}),this.listings.set(vt.root,new Set);let c=this.zipImpl.getListings();for(let f=0;f<c.length;f++){let p=c[f];if(J.isAbsolute(p))continue;let h=J.resolve(vt.root,p);this.registerEntry(h,f),p.endsWith(\"/\")&&this.registerListing(h)}this.symlinkCount=this.zipImpl.getSymlinkCount(),this.ready=!0}getExtractHint(r){for(let s of this.entries.keys()){let a=this.pathUtils.extname(s);if(r.relevantExtensions.has(a))return!0}return!1}getAllFiles(){return Array.from(this.entries.keys())}getRealPath(){if(!this.path)throw new Error(\"ZipFS don't have real paths when loaded from a buffer\");return this.path}prepareClose(){if(!this.ready)throw or.EBUSY(\"archive closed, close\");yd(this)}getBufferAndClose(){if(this.prepareClose(),this.entries.size===0)return this.discardAndClose(),BT();try{return this.zipImpl.getBufferAndClose()}finally{this.ready=!1}}discardAndClose(){this.prepareClose(),this.zipImpl.discard(),this.ready=!1}saveAndClose(){if(!this.path||!this.baseFs)throw new Error(\"ZipFS cannot be saved and must be discarded when loaded from a buffer\");if(this.readOnly){this.discardAndClose();return}let r=this.baseFs.existsSync(this.path)||this.stats.mode===$a.DEFAULT_MODE?void 0:this.stats.mode;this.baseFs.writeFileSync(this.path,this.getBufferAndClose(),{mode:r}),this.ready=!1}resolve(r){return J.resolve(vt.root,r)}async openPromise(r,s,a){return this.openSync(r,s,a)}openSync(r,s,a){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:r}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(r,s){return this.opendirSync(r,s)}opendirSync(r,s={}){let a=this.resolveFilename(`opendir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`opendir '${r}'`);let n=this.listings.get(a);if(!n)throw or.ENOTDIR(`opendir '${r}'`);let c=[...n],f=this.openSync(a,\"r\");return ex(this,a,c,{onClose:()=>{this.closeSync(f)}})}async readPromise(r,s,a,n,c){return this.readSync(r,s,a,n,c)}readSync(r,s,a=0,n=s.byteLength,c=-1){let f=this.fds.get(r);if(typeof f>\"u\")throw or.EBADF(\"read\");let p=c===-1||c===null?f.cursor:c,h=this.readFileSync(f.p);h.copy(s,a,p,p+n);let E=Math.max(0,Math.min(h.length-p,n));return(c===-1||c===null)&&(f.cursor+=E),E}async writePromise(r,s,a,n,c){return typeof s==\"string\"?this.writeSync(r,s,c):this.writeSync(r,s,a,n,c)}writeSync(r,s,a,n,c){throw typeof this.fds.get(r)>\"u\"?or.EBADF(\"read\"):new Error(\"Unimplemented\")}async closePromise(r){return this.closeSync(r)}closeSync(r){if(typeof this.fds.get(r)>\"u\")throw or.EBADF(\"read\");this.fds.delete(r)}createReadStream(r,{encoding:s}={}){if(r===null)throw new Error(\"Unimplemented\");let a=this.openSync(r,\"r\"),n=Object.assign(new Tj.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(f,p)=>{clearImmediate(c),this.closeSync(a),p(f)}}),{close(){n.destroy()},bytesRead:0,path:r,pending:!1}),c=setImmediate(async()=>{try{let f=await this.readFilePromise(r,s);n.bytesRead=f.length,n.end(f)}catch(f){n.destroy(f)}});return n}createWriteStream(r,{encoding:s}={}){if(this.readOnly)throw or.EROFS(`open '${r}'`);if(r===null)throw new Error(\"Unimplemented\");let a=[],n=this.openSync(r,\"w\"),c=Object.assign(new Tj.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(f,p)=>{try{f?p(f):(this.writeFileSync(r,Buffer.concat(a),s),p(null))}catch(h){p(h)}finally{this.closeSync(n)}}}),{close(){c.destroy()},bytesWritten:0,path:r,pending:!1});return c.on(\"data\",f=>{let p=Buffer.from(f);c.bytesWritten+=p.length,a.push(p)}),c}async realpathPromise(r){return this.realpathSync(r)}realpathSync(r){let s=this.resolveFilename(`lstat '${r}'`,r);if(!this.entries.has(s)&&!this.listings.has(s))throw or.ENOENT(`lstat '${r}'`);return s}async existsPromise(r){return this.existsSync(r)}existsSync(r){if(!this.ready)throw or.EBUSY(`archive closed, existsSync '${r}'`);if(this.symlinkCount===0){let a=J.resolve(vt.root,r);return this.entries.has(a)||this.listings.has(a)}let s;try{s=this.resolveFilename(`stat '${r}'`,r,void 0,!1)}catch{return!1}return s===void 0?!1:this.entries.has(s)||this.listings.has(s)}async accessPromise(r,s){return this.accessSync(r,s)}accessSync(r,s=xa.constants.F_OK){let a=this.resolveFilename(`access '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`access '${r}'`);if(this.readOnly&&s&xa.constants.W_OK)throw or.EROFS(`access '${r}'`)}async statPromise(r,s={bigint:!1}){return s.bigint?this.statSync(r,{bigint:!0}):this.statSync(r)}statSync(r,s={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`stat '${r}'`,r,void 0,s.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(s.throwIfNoEntry===!1)return;throw or.ENOENT(`stat '${r}'`)}if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`stat '${r}'`);return this.statImpl(`stat '${r}'`,a,s)}}async fstatPromise(r,s){return this.fstatSync(r,s)}fstatSync(r,s){let a=this.fds.get(r);if(typeof a>\"u\")throw or.EBADF(\"fstatSync\");let{p:n}=a,c=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(c)&&!this.listings.has(c))throw or.ENOENT(`stat '${n}'`);if(n[n.length-1]===\"/\"&&!this.listings.has(c))throw or.ENOTDIR(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,c,s)}async lstatPromise(r,s={bigint:!1}){return s.bigint?this.lstatSync(r,{bigint:!0}):this.lstatSync(r)}lstatSync(r,s={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`lstat '${r}'`,r,!1,s.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(s.throwIfNoEntry===!1)return;throw or.ENOENT(`lstat '${r}'`)}if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`lstat '${r}'`);return this.statImpl(`lstat '${r}'`,a,s)}}statImpl(r,s,a={}){let n=this.entries.get(s);if(typeof n<\"u\"){let c=this.zipImpl.stat(n),f=c.crc,p=c.size,h=c.mtime*1e3,E=this.stats.uid,C=this.stats.gid,S=512,P=Math.ceil(c.size/S),I=h,R=h,N=h,U=new Date(I),W=new Date(R),ee=new Date(N),ie=new Date(h),ue=this.listings.has(s)?xa.constants.S_IFDIR:this.isSymbolicLink(n)?xa.constants.S_IFLNK:xa.constants.S_IFREG,le=ue===xa.constants.S_IFDIR?493:420,me=ue|this.getUnixMode(n,le)&511,pe=Object.assign(new $a.StatEntry,{uid:E,gid:C,size:p,blksize:S,blocks:P,atime:U,birthtime:W,ctime:ee,mtime:ie,atimeMs:I,birthtimeMs:R,ctimeMs:N,mtimeMs:h,mode:me,crc:f});return a.bigint===!0?$a.convertToBigIntStats(pe):pe}if(this.listings.has(s)){let c=this.stats.uid,f=this.stats.gid,p=0,h=512,E=0,C=this.stats.mtimeMs,S=this.stats.mtimeMs,P=this.stats.mtimeMs,I=this.stats.mtimeMs,R=new Date(C),N=new Date(S),U=new Date(P),W=new Date(I),ee=xa.constants.S_IFDIR|493,ue=Object.assign(new $a.StatEntry,{uid:c,gid:f,size:p,blksize:h,blocks:E,atime:R,birthtime:N,ctime:U,mtime:W,atimeMs:C,birthtimeMs:S,ctimeMs:P,mtimeMs:I,mode:ee,crc:0});return a.bigint===!0?$a.convertToBigIntStats(ue):ue}throw new Error(\"Unreachable\")}getUnixMode(r,s){let[a,n]=this.zipImpl.getExternalAttributes(r);return a!==lm?s:n>>>16}registerListing(r){let s=this.listings.get(r);if(s)return s;this.registerListing(J.dirname(r)).add(J.basename(r));let n=new Set;return this.listings.set(r,n),n}registerEntry(r,s){this.registerListing(J.dirname(r)).add(J.basename(r)),this.entries.set(r,s)}unregisterListing(r){this.listings.delete(r),this.listings.get(J.dirname(r))?.delete(J.basename(r))}unregisterEntry(r){this.unregisterListing(r);let s=this.entries.get(r);this.entries.delete(r),!(typeof s>\"u\")&&(this.fileSources.delete(s),this.isSymbolicLink(s)&&this.symlinkCount--)}deleteEntry(r,s){this.unregisterEntry(r),this.zipImpl.deleteEntry(s)}resolveFilename(r,s,a=!0,n=!0){if(!this.ready)throw or.EBUSY(`archive closed, ${r}`);let c=J.resolve(vt.root,s);if(c===\"/\")return vt.root;let f=this.entries.get(c);if(a&&f!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(f)){let p=this.getFileSource(f).toString();return this.resolveFilename(r,J.resolve(J.dirname(c),p),!0,n)}else return c;for(;;){let p=this.resolveFilename(r,J.dirname(c),!0,n);if(p===void 0)return p;let h=this.listings.has(p),E=this.entries.has(p);if(!h&&!E){if(n===!1)return;throw or.ENOENT(r)}if(!h)throw or.ENOTDIR(r);if(c=J.resolve(p,J.basename(c)),!a||this.symlinkCount===0)break;let C=this.zipImpl.locate(c.slice(1));if(C===-1)break;if(this.isSymbolicLink(C)){let S=this.getFileSource(C).toString();c=J.resolve(J.dirname(c),S)}else break}return c}setFileSource(r,s){let a=Buffer.isBuffer(s)?s:Buffer.from(s),n=J.relative(vt.root,r),c=null;this.level!==\"mixed\"&&(c=[this.level===0?Fj:Nj,this.level]);let f=this.zipImpl.setFileSource(n,c,a);return this.fileSources.set(f,a),f}isSymbolicLink(r){if(this.symlinkCount===0)return!1;let[s,a]=this.zipImpl.getExternalAttributes(r);return s!==lm?!1:(a>>>16&xa.constants.S_IFMT)===xa.constants.S_IFLNK}getFileSource(r,s={asyncDecompress:!1}){let a=this.fileSources.get(r);if(typeof a<\"u\")return a;let{data:n,compressionMethod:c}=this.zipImpl.getFileSource(r);if(c===Fj)return this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,n),n;if(c===Nj){if(s.asyncDecompress)return new Promise((f,p)=>{Rj.default.inflateRaw(n,(h,E)=>{h?p(h):(this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,E),f(E))})});{let f=Rj.default.inflateRawSync(n);return this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,f),f}}else throw new Error(`Unsupported compression method: ${c}`)}async fchmodPromise(r,s){return this.chmodPromise(this.fdToPath(r,\"fchmod\"),s)}fchmodSync(r,s){return this.chmodSync(this.fdToPath(r,\"fchmodSync\"),s)}async chmodPromise(r,s){return this.chmodSync(r,s)}chmodSync(r,s){if(this.readOnly)throw or.EROFS(`chmod '${r}'`);s&=493;let a=this.resolveFilename(`chmod '${r}'`,r,!1),n=this.entries.get(a);if(typeof n>\"u\")throw new Error(`Assertion failed: The entry should have been registered (${a})`);let f=this.getUnixMode(n,xa.constants.S_IFREG|0)&-512|s;this.zipImpl.setExternalAttributes(n,lm,f<<16)}async fchownPromise(r,s,a){return this.chownPromise(this.fdToPath(r,\"fchown\"),s,a)}fchownSync(r,s,a){return this.chownSync(this.fdToPath(r,\"fchownSync\"),s,a)}async chownPromise(r,s,a){return this.chownSync(r,s,a)}chownSync(r,s,a){throw new Error(\"Unimplemented\")}async renamePromise(r,s){return this.renameSync(r,s)}renameSync(r,s){throw new Error(\"Unimplemented\")}async copyFilePromise(r,s,a){let{indexSource:n,indexDest:c,resolvedDestP:f}=this.prepareCopyFile(r,s,a),p=await this.getFileSource(n,{asyncDecompress:!0}),h=this.setFileSource(f,p);h!==c&&this.registerEntry(f,h)}copyFileSync(r,s,a=0){let{indexSource:n,indexDest:c,resolvedDestP:f}=this.prepareCopyFile(r,s,a),p=this.getFileSource(n),h=this.setFileSource(f,p);h!==c&&this.registerEntry(f,h)}prepareCopyFile(r,s,a=0){if(this.readOnly)throw or.EROFS(`copyfile '${r} -> '${s}'`);if(a&xa.constants.COPYFILE_FICLONE_FORCE)throw or.ENOSYS(\"unsupported clone operation\",`copyfile '${r}' -> ${s}'`);let n=this.resolveFilename(`copyfile '${r} -> ${s}'`,r),c=this.entries.get(n);if(typeof c>\"u\")throw or.EINVAL(`copyfile '${r}' -> '${s}'`);let f=this.resolveFilename(`copyfile '${r}' -> ${s}'`,s),p=this.entries.get(f);if(a&(xa.constants.COPYFILE_EXCL|xa.constants.COPYFILE_FICLONE_FORCE)&&typeof p<\"u\")throw or.EEXIST(`copyfile '${r}' -> '${s}'`);return{indexSource:c,resolvedDestP:f,indexDest:p}}async appendFilePromise(r,s,a){if(this.readOnly)throw or.EROFS(`open '${r}'`);return typeof a>\"u\"?a={flag:\"a\"}:typeof a==\"string\"?a={flag:\"a\",encoding:a}:typeof a.flag>\"u\"&&(a={flag:\"a\",...a}),this.writeFilePromise(r,s,a)}appendFileSync(r,s,a={}){if(this.readOnly)throw or.EROFS(`open '${r}'`);return typeof a>\"u\"?a={flag:\"a\"}:typeof a==\"string\"?a={flag:\"a\",encoding:a}:typeof a.flag>\"u\"&&(a={flag:\"a\",...a}),this.writeFileSync(r,s,a)}fdToPath(r,s){let a=this.fds.get(r)?.p;if(typeof a>\"u\")throw or.EBADF(s);return a}async writeFilePromise(r,s,a){let{encoding:n,mode:c,index:f,resolvedP:p}=this.prepareWriteFile(r,a);f!==void 0&&typeof a==\"object\"&&a.flag&&a.flag.includes(\"a\")&&(s=Buffer.concat([await this.getFileSource(f,{asyncDecompress:!0}),Buffer.from(s)])),n!==null&&(s=s.toString(n));let h=this.setFileSource(p,s);h!==f&&this.registerEntry(p,h),c!==null&&await this.chmodPromise(p,c)}writeFileSync(r,s,a){let{encoding:n,mode:c,index:f,resolvedP:p}=this.prepareWriteFile(r,a);f!==void 0&&typeof a==\"object\"&&a.flag&&a.flag.includes(\"a\")&&(s=Buffer.concat([this.getFileSource(f),Buffer.from(s)])),n!==null&&(s=s.toString(n));let h=this.setFileSource(p,s);h!==f&&this.registerEntry(p,h),c!==null&&this.chmodSync(p,c)}prepareWriteFile(r,s){if(typeof r==\"number\"&&(r=this.fdToPath(r,\"read\")),this.readOnly)throw or.EROFS(`open '${r}'`);let a=this.resolveFilename(`open '${r}'`,r);if(this.listings.has(a))throw or.EISDIR(`open '${r}'`);let n=null,c=null;typeof s==\"string\"?n=s:typeof s==\"object\"&&({encoding:n=null,mode:c=null}=s);let f=this.entries.get(a);return{encoding:n,mode:c,resolvedP:a,index:f}}async unlinkPromise(r){return this.unlinkSync(r)}unlinkSync(r){if(this.readOnly)throw or.EROFS(`unlink '${r}'`);let s=this.resolveFilename(`unlink '${r}'`,r);if(this.listings.has(s))throw or.EISDIR(`unlink '${r}'`);let a=this.entries.get(s);if(typeof a>\"u\")throw or.EINVAL(`unlink '${r}'`);this.deleteEntry(s,a)}async utimesPromise(r,s,a){return this.utimesSync(r,s,a)}utimesSync(r,s,a){if(this.readOnly)throw or.EROFS(`utimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r);this.utimesImpl(n,a)}async lutimesPromise(r,s,a){return this.lutimesSync(r,s,a)}lutimesSync(r,s,a){if(this.readOnly)throw or.EROFS(`lutimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r,!1);this.utimesImpl(n,a)}utimesImpl(r,s){this.listings.has(r)&&(this.entries.has(r)||this.hydrateDirectory(r));let a=this.entries.get(r);if(a===void 0)throw new Error(\"Unreachable\");this.zipImpl.setMtime(a,Ynt(s))}async mkdirPromise(r,s){return this.mkdirSync(r,s)}mkdirSync(r,{mode:s=493,recursive:a=!1}={}){if(a)return this.mkdirpSync(r,{chmod:s});if(this.readOnly)throw or.EROFS(`mkdir '${r}'`);let n=this.resolveFilename(`mkdir '${r}'`,r);if(this.entries.has(n)||this.listings.has(n))throw or.EEXIST(`mkdir '${r}'`);this.hydrateDirectory(n),this.chmodSync(n,s)}async rmdirPromise(r,s){return this.rmdirSync(r,s)}rmdirSync(r,{recursive:s=!1}={}){if(this.readOnly)throw or.EROFS(`rmdir '${r}'`);if(s){this.removeSync(r);return}let a=this.resolveFilename(`rmdir '${r}'`,r),n=this.listings.get(a);if(!n)throw or.ENOTDIR(`rmdir '${r}'`);if(n.size>0)throw or.ENOTEMPTY(`rmdir '${r}'`);let c=this.entries.get(a);if(typeof c>\"u\")throw or.EINVAL(`rmdir '${r}'`);this.deleteEntry(r,c)}async rmPromise(r,s){return this.rmSync(r,s)}rmSync(r,{recursive:s=!1}={}){if(this.readOnly)throw or.EROFS(`rm '${r}'`);if(s){this.removeSync(r);return}let a=this.resolveFilename(`rm '${r}'`,r),n=this.listings.get(a);if(!n)throw or.ENOTDIR(`rm '${r}'`);if(n.size>0)throw or.ENOTEMPTY(`rm '${r}'`);let c=this.entries.get(a);if(typeof c>\"u\")throw or.EINVAL(`rm '${r}'`);this.deleteEntry(r,c)}hydrateDirectory(r){let s=this.zipImpl.addDirectory(J.relative(vt.root,r));return this.registerListing(r),this.registerEntry(r,s),s}async linkPromise(r,s){return this.linkSync(r,s)}linkSync(r,s){throw or.EOPNOTSUPP(`link '${r}' -> '${s}'`)}async symlinkPromise(r,s){return this.symlinkSync(r,s)}symlinkSync(r,s){if(this.readOnly)throw or.EROFS(`symlink '${r}' -> '${s}'`);let a=this.resolveFilename(`symlink '${r}' -> '${s}'`,s);if(this.listings.has(a))throw or.EISDIR(`symlink '${r}' -> '${s}'`);if(this.entries.has(a))throw or.EEXIST(`symlink '${r}' -> '${s}'`);let n=this.setFileSource(a,r);this.registerEntry(a,n),this.zipImpl.setExternalAttributes(n,lm,(xa.constants.S_IFLNK|511)<<16),this.symlinkCount+=1}async readFilePromise(r,s){typeof s==\"object\"&&(s=s?s.encoding:void 0);let a=await this.readFileBuffer(r,{asyncDecompress:!0});return s?a.toString(s):a}readFileSync(r,s){typeof s==\"object\"&&(s=s?s.encoding:void 0);let a=this.readFileBuffer(r);return s?a.toString(s):a}readFileBuffer(r,s={asyncDecompress:!1}){typeof r==\"number\"&&(r=this.fdToPath(r,\"read\"));let a=this.resolveFilename(`open '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`open '${r}'`);if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`open '${r}'`);if(this.listings.has(a))throw or.EISDIR(\"read\");let n=this.entries.get(a);if(n===void 0)throw new Error(\"Unreachable\");return this.getFileSource(n,s)}async readdirPromise(r,s){return this.readdirSync(r,s)}readdirSync(r,s){let a=this.resolveFilename(`scandir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`scandir '${r}'`);let n=this.listings.get(a);if(!n)throw or.ENOTDIR(`scandir '${r}'`);if(s?.recursive)if(s?.withFileTypes){let c=Array.from(n,f=>Object.assign(this.statImpl(\"lstat\",J.join(r,f)),{name:f,path:vt.dot,parentPath:vt.dot}));for(let f of c){if(!f.isDirectory())continue;let p=J.join(f.path,f.name),h=this.listings.get(J.join(a,p));for(let E of h)c.push(Object.assign(this.statImpl(\"lstat\",J.join(r,p,E)),{name:E,path:p,parentPath:p}))}return c}else{let c=[...n];for(let f of c){let p=this.listings.get(J.join(a,f));if(!(typeof p>\"u\"))for(let h of p)c.push(J.join(f,h))}return c}else return s?.withFileTypes?Array.from(n,c=>Object.assign(this.statImpl(\"lstat\",J.join(r,c)),{name:c,path:void 0,parentPath:void 0})):[...n]}async readlinkPromise(r){let s=this.prepareReadlink(r);return(await this.getFileSource(s,{asyncDecompress:!0})).toString()}readlinkSync(r){let s=this.prepareReadlink(r);return this.getFileSource(s).toString()}prepareReadlink(r){let s=this.resolveFilename(`readlink '${r}'`,r,!1);if(!this.entries.has(s)&&!this.listings.has(s))throw or.ENOENT(`readlink '${r}'`);if(r[r.length-1]===\"/\"&&!this.listings.has(s))throw or.ENOTDIR(`open '${r}'`);if(this.listings.has(s))throw or.EINVAL(`readlink '${r}'`);let a=this.entries.get(s);if(a===void 0)throw new Error(\"Unreachable\");if(!this.isSymbolicLink(a))throw or.EINVAL(`readlink '${r}'`);return a}async truncatePromise(r,s=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>\"u\")throw or.EINVAL(`open '${r}'`);let c=await this.getFileSource(n,{asyncDecompress:!0}),f=Buffer.alloc(s,0);return c.copy(f),await this.writeFilePromise(r,f)}truncateSync(r,s=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>\"u\")throw or.EINVAL(`open '${r}'`);let c=this.getFileSource(n),f=Buffer.alloc(s,0);return c.copy(f),this.writeFileSync(r,f)}async ftruncatePromise(r,s){return this.truncatePromise(this.fdToPath(r,\"ftruncate\"),s)}ftruncateSync(r,s){return this.truncateSync(this.fdToPath(r,\"ftruncateSync\"),s)}watch(r,s,a){let n;switch(typeof s){case\"function\":case\"string\":case\"undefined\":n=!0;break;default:({persistent:n=!0}=s);break}if(!n)return{on:()=>{},close:()=>{}};let c=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(c)}}}watchFile(r,s,a){let n=J.resolve(vt.root,r);return sE(this,n,s,a)}unwatchFile(r,s){let a=J.resolve(vt.root,r);return md(this,a,s)}}});function Cpe(t,e,r=Buffer.alloc(0),s){let a=new As(r),n=C=>C===e||C.startsWith(`${e}/`)?C.slice(0,e.length):null,c=async(C,S)=>()=>a,f=(C,S)=>a,p={...t},h=new Yn(p),E=new e0({baseFs:h,getMountPoint:n,factoryPromise:c,factorySync:f,magicByte:21,maxAge:1/0,typeCheck:s?.typeCheck});return U2(Ipe.default,new t0(E)),a}var Ipe,wpe=Xe(()=>{Dt();Ipe=ut(Ie(\"fs\"));vT()});var Bpe=Xe(()=>{mpe();vT();wpe()});var Oj,uv,ST,vpe=Xe(()=>{Dt();vT();Oj={CENTRAL_DIRECTORY:33639248,END_OF_CENTRAL_DIRECTORY:101010256},uv=22,ST=class t{constructor(e){this.filesShouldBeCached=!1;if(\"buffer\"in e)throw new Error(\"Buffer based zip archives are not supported\");if(!e.readOnly)throw new Error(\"Writable zip archives are not supported\");this.baseFs=e.baseFs,this.fd=this.baseFs.openSync(e.path,\"r\");try{this.entries=t.readZipSync(this.fd,this.baseFs,e.size)}catch(r){throw this.baseFs.closeSync(this.fd),this.fd=\"closed\",r}}static readZipSync(e,r,s){if(s<uv)throw new Error(\"Invalid ZIP file: EOCD not found\");let a=-1,n=Buffer.alloc(uv);if(r.readSync(e,n,0,uv,s-uv),n.readUInt32LE(0)===Oj.END_OF_CENTRAL_DIRECTORY)a=0;else{let R=Math.min(65557,s);n=Buffer.alloc(R),r.readSync(e,n,0,R,Math.max(0,s-R));for(let N=n.length-4;N>=0;N--)if(n.readUInt32LE(N)===Oj.END_OF_CENTRAL_DIRECTORY){a=N;break}if(a===-1)throw new Error(\"Not a zip archive\")}let c=n.readUInt16LE(a+10),f=n.readUInt32LE(a+12),p=n.readUInt32LE(a+16),h=n.readUInt16LE(a+20);if(a+h+uv>n.length)throw new Error(\"Zip archive inconsistent\");if(c==65535||f==4294967295||p==4294967295)throw new Error(\"Zip 64 is not supported\");if(f>s)throw new Error(\"Zip archive inconsistent\");if(c>f/46)throw new Error(\"Zip archive inconsistent\");let E=Buffer.alloc(f);if(r.readSync(e,E,0,E.length,p)!==E.length)throw new Error(\"Zip archive inconsistent\");let C=[],S=0,P=0,I=0;for(;P<c;){if(S+46>E.length)throw new Error(\"Zip archive inconsistent\");if(E.readUInt32LE(S)!==Oj.CENTRAL_DIRECTORY)throw new Error(\"Zip archive inconsistent\");let N=E.readUInt16LE(S+4)>>>8;if(E.readUInt16LE(S+8)&1)throw new Error(\"Encrypted zip files are not supported\");let W=E.readUInt16LE(S+10),ee=E.readUInt32LE(S+16),ie=E.readUInt16LE(S+28),ue=E.readUInt16LE(S+30),le=E.readUInt16LE(S+32),me=E.readUInt32LE(S+42),pe=E.toString(\"utf8\",S+46,S+46+ie).replaceAll(\"\\0\",\" \");if(pe.includes(\"\\0\"))throw new Error(\"Invalid ZIP file\");let Be=E.readUInt32LE(S+20),Ce=E.readUInt32LE(S+38);C.push({name:pe,os:N,mtime:fi.SAFE_TIME,crc:ee,compressionMethod:W,isSymbolicLink:N===lm&&(Ce>>>16&fi.S_IFMT)===fi.S_IFLNK,size:E.readUInt32LE(S+24),compressedSize:Be,externalAttributes:Ce,localHeaderOffset:me}),I+=Be,P+=1,S+=46+ie+ue+le}if(I>s)throw new Error(\"Zip archive inconsistent\");if(S!==E.length)throw new Error(\"Zip archive inconsistent\");return C}getExternalAttributes(e){let r=this.entries[e];return[r.os,r.externalAttributes]}getListings(){return this.entries.map(e=>e.name)}getSymlinkCount(){let e=0;for(let r of this.entries)r.isSymbolicLink&&(e+=1);return e}stat(e){let r=this.entries[e];return{crc:r.crc,mtime:r.mtime,size:r.size}}locate(e){for(let r=0;r<this.entries.length;r++)if(this.entries[r].name===e)return r;return-1}getFileSource(e){if(this.fd===\"closed\")throw new Error(\"ZIP file is closed\");let r=this.entries[e],s=Buffer.alloc(30);this.baseFs.readSync(this.fd,s,0,s.length,r.localHeaderOffset);let a=s.readUInt16LE(26),n=s.readUInt16LE(28),c=Buffer.alloc(r.compressedSize);if(this.baseFs.readSync(this.fd,c,0,r.compressedSize,r.localHeaderOffset+30+a+n)!==r.compressedSize)throw new Error(\"Invalid ZIP file\");return{data:c,compressionMethod:r.compressionMethod}}discard(){this.fd!==\"closed\"&&(this.baseFs.closeSync(this.fd),this.fd=\"closed\")}addDirectory(e){throw new Error(\"Not implemented\")}deleteEntry(e){throw new Error(\"Not implemented\")}setMtime(e,r){throw new Error(\"Not implemented\")}getBufferAndClose(){throw new Error(\"Not implemented\")}setFileSource(e,r,s){throw new Error(\"Not implemented\")}setExternalAttributes(e,r,s){throw new Error(\"Not implemented\")}}});var fv={};Vt(fv,{DEFAULT_COMPRESSION_LEVEL:()=>Epe,DEFLATE:()=>Nj,JsZipImpl:()=>ST,LibZipImpl:()=>BI,STORE:()=>Fj,ZIP_UNIX:()=>lm,ZipFS:()=>As,ZipOpenFS:()=>$f,getArchivePart:()=>xj,getLibzipPromise:()=>Jnt,getLibzipSync:()=>Vnt,makeEmptyArchive:()=>BT,mountMemoryDrive:()=>Cpe});function Vnt(){return cv()}async function Jnt(){return cv()}var Spe,eA=Xe(()=>{Dj();Spe=ut(ppe());dpe();Bpe();vpe();Qj();Ape(()=>{let t=(0,Spe.default)();return gpe(t)})});var Av,Dpe=Xe(()=>{Dt();Yt();pv();Av=class extends ot{constructor(){super(...arguments);this.cwd=ge.String(\"--cwd\",process.cwd(),{description:\"The directory to run the command in\"});this.commandName=ge.String();this.args=ge.Proxy()}static{this.usage={description:\"run a command using yarn's portable shell\",details:`\n      This command will run a command using Yarn's portable shell.\n\n      Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.\n\n      Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.\n\n      Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.\n\n      For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.\n    `,examples:[[\"Run a simple command\",\"$0 echo Hello\"],[\"Run a command with a glob pattern\",\"$0 echo '*.js'\"],[\"Run a command with a redirection\",\"$0 echo Hello World '>' hello.txt\"],[\"Run a command with an escaped glob pattern (The double escape is needed in Unix shells)\",`$0 echo '\"*.js\"'`],[\"Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)\",'$0 \"GREETING=Hello echo $GREETING World\"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(\" \")}`:this.commandName;return await vI(r,[],{cwd:fe.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var Vl,bpe=Xe(()=>{Vl=class extends Error{constructor(e){super(e),this.name=\"ShellError\"}}});var PT={};Vt(PT,{fastGlobOptions:()=>kpe,isBraceExpansion:()=>Lj,isGlobPattern:()=>Knt,match:()=>znt,micromatchOptions:()=>bT});function Knt(t){if(!DT.default.scan(t,bT).isGlob)return!1;try{DT.default.parse(t,bT)}catch{return!1}return!0}function znt(t,{cwd:e,baseFs:r}){return(0,Ppe.default)(t,{...kpe,cwd:fe.fromPortablePath(e),fs:ax(xpe.default,new t0(r))})}function Lj(t){return DT.default.scan(t,bT).isBrace}var Ppe,xpe,DT,bT,kpe,Qpe=Xe(()=>{Dt();Ppe=ut(BQ()),xpe=ut(Ie(\"fs\")),DT=ut(Go()),bT={strictBrackets:!0},kpe={onlyDirectories:!1,onlyFiles:!1}});function Mj(){}function Uj(){for(let t of cm)t.kill()}function Npe(t,e,r,s){return a=>{let n=a[0]instanceof tA.Transform?\"pipe\":a[0],c=a[1]instanceof tA.Transform?\"pipe\":a[1],f=a[2]instanceof tA.Transform?\"pipe\":a[2],p=(0,Rpe.default)(t,e,{...s,stdio:[n,c,f]});return cm.add(p),cm.size===1&&(process.on(\"SIGINT\",Mj),process.on(\"SIGTERM\",Uj)),a[0]instanceof tA.Transform&&a[0].pipe(p.stdin),a[1]instanceof tA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof tA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on(\"error\",E=>{switch(cm.delete(p),cm.size===0&&(process.off(\"SIGINT\",Mj),process.off(\"SIGTERM\",Uj)),E.code){case\"ENOENT\":a[2].write(`command not found: ${t}\n`),h(127);break;case\"EACCES\":a[2].write(`permission denied: ${t}\n`),h(128);break;default:a[2].write(`uncaught error: ${E.message}\n`),h(1);break}}),p.on(\"close\",E=>{cm.delete(p),cm.size===0&&(process.off(\"SIGINT\",Mj),process.off(\"SIGTERM\",Uj)),h(E!==null?E:129)})})}}}function Ope(t){return e=>{let r=e[0]===\"pipe\"?new tA.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function xT(t,e){return Hj.start(t,e)}function Tpe(t,e=null){let r=new tA.PassThrough,s=new Fpe.StringDecoder,a=\"\";return r.on(\"data\",n=>{let c=s.write(n),f;do if(f=c.indexOf(`\n`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a=\"\",t(e!==null?`${e} ${p}`:p)}while(f!==-1);a+=c}),r.on(\"end\",()=>{let n=s.end();n!==\"\"&&t(e!==null?`${e} ${n}`:n)}),r}function Lpe(t,{prefix:e}){return{stdout:Tpe(r=>t.stdout.write(`${r}\n`),t.stdout.isTTY?e:null),stderr:Tpe(r=>t.stderr.write(`${r}\n`),t.stderr.isTTY?e:null)}}var Rpe,tA,Fpe,cm,Oc,_j,Hj,jj=Xe(()=>{Rpe=ut(_U()),tA=Ie(\"stream\"),Fpe=Ie(\"string_decoder\"),cm=new Set;Oc=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},_j=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error(\"Assertion failed: No stream attached\");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error(\"Assertion failed: No stream attached\");return this.stream}},Hj=class t{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:s,stderr:a}){let n=new t(null,e);return n.stdin=r,n.stdout=s,n.stderr=a,n}pipeTo(e,r=1){let s=new t(this,e),a=new _j;return s.pipe=a,s.stdout=this.stdout,s.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),s}async exec(){let e=[\"ignore\",\"ignore\",\"ignore\"];if(this.pipe)e[0]=\"pipe\";else{if(this.stdin===null)throw new Error(\"Assertion failed: No input stream registered\");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error(\"Assertion failed: No output stream registered\");r=this.stdout,e[1]=r.get();let s;if(this.stderr===null)throw new Error(\"Assertion failed: No error stream registered\");s=this.stderr,e[2]=s.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),s.close(),n))}async run(){let e=[];for(let s=this;s;s=s.ancestor)e.push(s.exec());return(await Promise.all(e))[0]}}});var mv={};Vt(mv,{EntryCommand:()=>Av,ShellError:()=>Vl,execute:()=>vI,globUtils:()=>PT});function Mpe(t,e,r){let s=new Jl.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(s,{end:!1}),(e&2)===2&&r.stdin instanceof Jl.Writable&&s.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stderr,{end:!1});break;default:throw new Vl(`Bad file descriptor: \"${t}\"`)}return s}function QT(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function Znt(t,e,r){let s=[],a=new Jl.PassThrough;return a.on(\"data\",n=>s.push(n)),await TT(t,e,QT(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\\r\\n]+$/,\"\")}async function Upe(t,e,r){let s=t.map(async n=>{let c=await um(n.args,e,r);return{name:n.name,value:c.join(\" \")}});return(await Promise.all(s)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function kT(t){return t.match(/[^ \\r\\n\\t]+/g)||[]}async function Wpe(t,e,r,s,a=s){switch(t.name){case\"$\":s(String(process.pid));break;case\"#\":s(String(e.args.length));break;case\"@\":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let c=kT(n);for(let f=0;f<c.length-1;++f)a(c[f]);s(c[c.length-1])}break;case\"*\":{let n=e.args.join(\" \");if(t.quoted)s(n);else for(let c of kT(n))a(c)}break;case\"PPID\":s(String(process.ppid));break;case\"RANDOM\":s(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(t.name,10),c,f=Number.isFinite(n);if(f?n>=0&&n<e.args.length&&(c=e.args[n]):Object.hasOwn(r.variables,t.name)?c=r.variables[t.name]:Object.hasOwn(r.environment,t.name)&&(c=r.environment[t.name]),typeof c<\"u\"&&t.alternativeValue?c=(await um(t.alternativeValue,e,r)).join(\" \"):typeof c>\"u\"&&(t.defaultValue?c=(await um(t.defaultValue,e,r)).join(\" \"):t.alternativeValue&&(c=\"\")),typeof c>\"u\")throw f?new Vl(`Unbound argument #${n}`):new Vl(`Unbound variable \"${t.name}\"`);if(t.quoted)s(c);else{let p=kT(c);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<\"u\"&&s(h)}}break}}async function hv(t,e,r){if(t.type===\"number\"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: \"${t.value}\", only integers are allowed`)}else if(t.type===\"variable\"){let s=[];await Wpe({...t,quoted:!0},e,r,n=>s.push(n));let a=Number(s.join(\" \"));return Number.isNaN(a)?hv({type:\"variable\",name:s.join(\" \")},e,r):hv({type:\"number\",value:a},e,r)}else return $nt[t.type](await hv(t.left,e,r),await hv(t.right,e,r))}async function um(t,e,r){let s=new Map,a=[],n=[],c=E=>{n.push(E)},f=()=>{n.length>0&&a.push(n.join(\"\")),n=[]},p=E=>{c(E),f()},h=(E,C,S)=>{let P=JSON.stringify({type:E,fd:C}),I=s.get(P);typeof I>\"u\"&&s.set(P,I=[]),I.push(S)};for(let E of t){let C=!1;switch(E.type){case\"redirection\":{let S=await um(E.args,e,r);for(let P of S)h(E.subtype,E.fd,P)}break;case\"argument\":for(let S of E.segments)switch(S.type){case\"text\":c(S.text);break;case\"glob\":c(S.pattern),C=!0;break;case\"shell\":{let P=await Znt(S.shell,e,r);if(S.quoted)c(P);else{let I=kT(P);for(let R=0;R<I.length-1;++R)p(I[R]);c(I[I.length-1])}}break;case\"variable\":await Wpe(S,e,r,c,p);break;case\"arithmetic\":c(String(await hv(S.arithmetic,e,r)));break}break}if(f(),C){let S=a.pop();if(typeof S>\"u\")throw new Error(\"Assertion failed: Expected a glob pattern to have been set\");let P=await e.glob.match(S,{cwd:r.cwd,baseFs:e.baseFs});if(P.length===0){let I=Lj(S)?\". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22\":\"\";throw new Vl(`No matches found: \"${S}\"${I}`)}for(let I of P.sort())p(I)}}if(s.size>0){let E=[];for(let[C,S]of s.entries())E.splice(E.length,0,C,String(S.length),...S);a.splice(0,0,\"__ysh_set_redirects\",...E,\"--\")}return a}function gv(t,e,r){e.builtins.has(t[0])||(t=[\"command\",...t]);let s=fe.fromPortablePath(r.cwd),a=r.environment;typeof a.PWD<\"u\"&&(a={...a,PWD:s});let[n,...c]=t;if(n===\"command\")return Npe(c[0],c.slice(1),e,{cwd:s,env:a});let f=e.builtins.get(n);if(typeof f>\"u\")throw new Error(`Assertion failed: A builtin should exist for \"${n}\"`);return Ope(async({stdin:p,stdout:h,stderr:E})=>{let{stdin:C,stdout:S,stderr:P}=r;r.stdin=p,r.stdout=h,r.stderr=E;try{return await f(c,e,r)}finally{r.stdin=C,r.stdout=S,r.stderr=P}})}function eit(t,e,r){return s=>{let a=new Jl.PassThrough,n=TT(t,e,QT(r,{stdin:a}));return{stdin:a,promise:n}}}function tit(t,e,r){return s=>{let a=new Jl.PassThrough,n=TT(t,e,r);return{stdin:a,promise:n}}}function _pe(t,e,r,s){if(e.length===0)return t;{let a;do a=String(Math.random());while(Object.hasOwn(s.procedures,a));return s.procedures={...s.procedures},s.procedures[a]=t,gv([...e,\"__ysh_run_procedure\",a],r,s)}}async function Hpe(t,e,r){let s=t,a=null,n=null;for(;s;){let c=s.then?{...r}:r,f;switch(s.type){case\"command\":{let p=await um(s.args,e,r),h=await Upe(s.envs,e,r);f=s.envs.length?gv(p,e,QT(c,{environment:h})):gv(p,e,c)}break;case\"subshell\":{let p=await um(s.args,e,r),h=eit(s.subshell,e,c);f=_pe(h,p,e,c)}break;case\"group\":{let p=await um(s.args,e,r),h=tit(s.group,e,c);f=_pe(h,p,e,c)}break;case\"envs\":{let p=await Upe(s.envs,e,r);c.environment={...c.environment,...p},f=gv([\"true\"],e,c)}break}if(typeof f>\"u\")throw new Error(\"Assertion failed: An action should have been generated\");if(a===null)n=xT(f,{stdin:new Oc(c.stdin),stdout:new Oc(c.stdout),stderr:new Oc(c.stderr)});else{if(n===null)throw new Error(\"Assertion failed: The execution pipeline should have been setup\");switch(a){case\"|\":n=n.pipeTo(f,1);break;case\"|&\":n=n.pipeTo(f,3);break}}s.then?(a=s.then.type,s=s.then.chain):s=null}if(n===null)throw new Error(\"Assertion failed: The execution pipeline should have been setup\");return await n.run()}async function rit(t,e,r,{background:s=!1}={}){function a(n){let c=[\"#2E86AB\",\"#A23B72\",\"#F18F01\",\"#C73E1D\",\"#CCE2A3\"],f=c[n%c.length];return jpe.default.hex(f)}if(s){let n=r.nextBackgroundJobIndex++,c=a(n),f=`[${n}]`,p=c(f),{stdout:h,stderr:E}=Lpe(r,{prefix:p});return r.backgroundJobs.push(Hpe(t,e,QT(r,{stdout:h,stderr:E})).catch(C=>E.write(`${C.message}\n`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${c(AE(t))}' has ended\n`)})),0}return await Hpe(t,e,r)}async function nit(t,e,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables[\"?\"]=String(f)},c=async f=>{try{return await rit(f.chain,e,r,{background:s&&typeof f.then>\"u\"})}catch(p){if(!(p instanceof Vl))throw p;return r.stderr.write(`${p.message}\n`),1}};for(n(await c(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case\"&&\":a===0&&n(await c(t.then.line));break;case\"||\":a!==0&&n(await c(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: \"${t.then.type}\"`)}t=t.then.line}return a}async function TT(t,e,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of t){if(a=await nit(n,e,r,{background:c===\"&\"}),r.exitCode!==null)return r.exitCode;r.variables[\"?\"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,a}function Ype(t){switch(t.type){case\"variable\":return t.name===\"@\"||t.name===\"#\"||t.name===\"*\"||Number.isFinite(parseInt(t.name,10))||\"defaultValue\"in t&&!!t.defaultValue&&t.defaultValue.some(e=>dv(e))||\"alternativeValue\"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>dv(e));case\"arithmetic\":return Gj(t.arithmetic);case\"shell\":return qj(t.shell);default:return!1}}function dv(t){switch(t.type){case\"redirection\":return t.args.some(e=>dv(e));case\"argument\":return t.segments.some(e=>Ype(e));default:throw new Error(`Assertion failed: Unsupported argument type: \"${t.type}\"`)}}function Gj(t){switch(t.type){case\"variable\":return Ype(t);case\"number\":return!1;default:return Gj(t.left)||Gj(t.right)}}function qj(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let s;switch(r.type){case\"subshell\":s=qj(r.subshell);break;case\"command\":s=r.envs.some(a=>a.args.some(n=>dv(n)))||r.args.some(a=>dv(a));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function vI(t,e=[],{baseFs:r=new Yn,builtins:s={},cwd:a=fe.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=PT}={}){let C={};for(let[I,R]of Object.entries(n))typeof R<\"u\"&&(C[I]=R);let S=new Map(Xnt);for(let[I,R]of Object.entries(s))S.set(I,R);c===null&&(c=new Jl.PassThrough,c.end());let P=ux(t,E);if(!qj(P)&&P.length>0&&e.length>0){let{command:I}=P[P.length-1];for(;I.then;)I=I.then.line;let R=I.chain;for(;R.then;)R=R.then.chain;R.type===\"command\"&&(R.args=R.args.concat(e.map(N=>({type:\"argument\",segments:[{type:\"text\",text:N}]}))))}return await TT(P,{args:e,baseFs:r,builtins:S,initialStdin:c,initialStdout:f,initialStderr:p,glob:E},{cwd:a,environment:C,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:p,variables:Object.assign({},h,{\"?\":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var jpe,Gpe,Jl,qpe,Xnt,$nt,pv=Xe(()=>{Dt();wc();jpe=ut(TE()),Gpe=Ie(\"os\"),Jl=Ie(\"stream\"),qpe=Ie(\"timers/promises\");Dpe();bpe();Qpe();jj();jj();Xnt=new Map([[\"cd\",async([t=(0,Gpe.homedir)(),...e],r,s)=>{let a=J.resolve(s.cwd,fe.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code===\"ENOENT\"?new Vl(`cd: no such file or directory: ${t}`):c})).isDirectory())throw new Vl(`cd: not a directory: ${t}`);return s.cwd=a,0}],[\"pwd\",async(t,e,r)=>(r.stdout.write(`${fe.fromPortablePath(r.cwd)}\n`),0)],[\":\",async(t,e,r)=>0],[\"true\",async(t,e,r)=>0],[\"false\",async(t,e,r)=>1],[\"exit\",async([t,...e],r,s)=>s.exitCode=parseInt(t??s.variables[\"?\"],10)],[\"echo\",async(t,e,r)=>(r.stdout.write(`${t.join(\" \")}\n`),0)],[\"sleep\",async([t],e,r)=>{if(typeof t>\"u\")throw new Vl(\"sleep: missing operand\");let s=Number(t);if(Number.isNaN(s))throw new Vl(`sleep: invalid time interval '${t}'`);return await(0,qpe.setTimeout)(1e3*s,0)}],[\"unset\",async(t,e,r)=>{for(let s of t)delete r.environment[s],delete r.variables[s];return 0}],[\"__ysh_run_procedure\",async(t,e,r)=>{let s=r.procedures[t[0]];return await xT(s,{stdin:new Oc(r.stdin),stdout:new Oc(r.stdout),stderr:new Oc(r.stderr)}).run()}],[\"__ysh_set_redirects\",async(t,e,r)=>{let s=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],p=[],h=0;for(;t[h]!==\"--\";){let C=t[h++],{type:S,fd:P}=JSON.parse(C),I=W=>{switch(P){case null:case 0:c.push(W);break;default:throw new Error(`Unsupported file descriptor: \"${P}\"`)}},R=W=>{switch(P){case null:case 1:f.push(W);break;case 2:p.push(W);break;default:throw new Error(`Unsupported file descriptor: \"${P}\"`)}},N=Number(t[h++]),U=h+N;for(let W=h;W<U;++h,++W)switch(S){case\"<\":I(()=>e.baseFs.createReadStream(J.resolve(r.cwd,fe.toPortablePath(t[W]))));break;case\"<<<\":I(()=>{let ee=new Jl.PassThrough;return process.nextTick(()=>{ee.write(`${t[W]}\n`),ee.end()}),ee});break;case\"<&\":I(()=>Mpe(Number(t[W]),1,r));break;case\">\":case\">>\":{let ee=J.resolve(r.cwd,fe.toPortablePath(t[W]));R(ee===\"/dev/null\"?new Jl.Writable({autoDestroy:!0,emitClose:!0,write(ie,ue,le){setImmediate(le)}}):e.baseFs.createWriteStream(ee,S===\">>\"?{flags:\"a\"}:void 0))}break;case\">&\":R(Mpe(Number(t[W]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: \"${S}\"`)}}if(c.length>0){let C=new Jl.PassThrough;s=C;let S=P=>{if(P===c.length)C.end();else{let I=c[P]();I.pipe(C,{end:!1}),I.on(\"end\",()=>{S(P+1)})}};S(0)}if(f.length>0){let C=new Jl.PassThrough;a=C;for(let S of f)C.pipe(S)}if(p.length>0){let C=new Jl.PassThrough;n=C;for(let S of p)C.pipe(S)}let E=await xT(gv(t.slice(h+1),e,r),{stdin:new Oc(s),stdout:new Oc(a),stderr:new Oc(n)}).run();return await Promise.all(f.map(C=>new Promise((S,P)=>{C.on(\"error\",I=>{P(I)}),C.on(\"close\",()=>{S()}),C.end()}))),await Promise.all(p.map(C=>new Promise((S,P)=>{C.on(\"error\",I=>{P(I)}),C.on(\"close\",()=>{S()}),C.end()}))),E}]]);$nt={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var Vpe=_((S4t,RT)=>{function iit(){var t=0,e=1,r=2,s=3,a=4,n=5,c=6,f=7,p=8,h=9,E=10,C=11,S=12,P=13,I=14,R=15,N=16,U=17,W=0,ee=1,ie=2,ue=3,le=4;function me(g,we){return 55296<=g.charCodeAt(we)&&g.charCodeAt(we)<=56319&&56320<=g.charCodeAt(we+1)&&g.charCodeAt(we+1)<=57343}function pe(g,we){we===void 0&&(we=0);var ye=g.charCodeAt(we);if(55296<=ye&&ye<=56319&&we<g.length-1){var Ae=ye,se=g.charCodeAt(we+1);return 56320<=se&&se<=57343?(Ae-55296)*1024+(se-56320)+65536:Ae}if(56320<=ye&&ye<=57343&&we>=1){var Ae=g.charCodeAt(we-1),se=ye;return 55296<=Ae&&Ae<=56319?(Ae-55296)*1024+(se-56320)+65536:se}return ye}function Be(g,we,ye){var Ae=[g].concat(we).concat([ye]),se=Ae[Ae.length-2],Z=ye,De=Ae.lastIndexOf(I);if(De>1&&Ae.slice(1,De).every(function(j){return j==s})&&[s,P,U].indexOf(g)==-1)return ie;var Re=Ae.lastIndexOf(a);if(Re>0&&Ae.slice(1,Re).every(function(j){return j==a})&&[S,a].indexOf(se)==-1)return Ae.filter(function(j){return j==a}).length%2==1?ue:le;if(se==t&&Z==e)return W;if(se==r||se==t||se==e)return Z==I&&we.every(function(j){return j==s})?ie:ee;if(Z==r||Z==t||Z==e)return ee;if(se==c&&(Z==c||Z==f||Z==h||Z==E))return W;if((se==h||se==f)&&(Z==f||Z==p))return W;if((se==E||se==p)&&Z==p)return W;if(Z==s||Z==R)return W;if(Z==n)return W;if(se==S)return W;var mt=Ae.indexOf(s)!=-1?Ae.lastIndexOf(s)-1:Ae.length-2;return[P,U].indexOf(Ae[mt])!=-1&&Ae.slice(mt+1,-1).every(function(j){return j==s})&&Z==I||se==R&&[N,U].indexOf(Z)!=-1?W:we.indexOf(a)!=-1?ie:se==a&&Z==a?W:ee}this.nextBreak=function(g,we){if(we===void 0&&(we=0),we<0)return 0;if(we>=g.length-1)return g.length;for(var ye=Ce(pe(g,we)),Ae=[],se=we+1;se<g.length;se++)if(!me(g,se-1)){var Z=Ce(pe(g,se));if(Be(ye,Ae,Z))return se;Ae.push(Z)}return g.length},this.splitGraphemes=function(g){for(var we=[],ye=0,Ae;(Ae=this.nextBreak(g,ye))<g.length;)we.push(g.slice(ye,Ae)),ye=Ae;return ye<g.length&&we.push(g.slice(ye)),we},this.iterateGraphemes=function(g){var we=0,ye={next:function(){var Ae,se;return(se=this.nextBreak(g,we))<g.length?(Ae=g.slice(we,se),we=se,{value:Ae,done:!1}):we<g.length?(Ae=g.slice(we),we=g.length,{value:Ae,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<\"u\"&&Symbol.iterator&&(ye[Symbol.iterator]=function(){return ye}),ye},this.countGraphemes=function(g){for(var we=0,ye=0,Ae;(Ae=this.nextBreak(g,ye))<g.length;)ye=Ae,we++;return ye<g.length&&we++,we};function Ce(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?S:g==13?t:g==10?e:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?r:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?s:127462<=g&&g<=127487?a:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?n:4352<=g&&g<=4447||43360<=g&&g<=43388?c:4448<=g&&g<=4519||55216<=g&&g<=55238?f:4520<=g&&g<=4607||55243<=g&&g<=55291?p:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?h:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?E:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?P:127995<=g&&g<=127999?I:g==8205?R:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?N:128102<=g&&g<=128105?U:C}return this}typeof RT<\"u\"&&RT.exports&&(RT.exports=iit)});var Kpe=_((D4t,Jpe)=>{var sit=/^(.*?)(\\x1b\\[[^m]+m|\\x1b\\]8;;.*?(\\x1b\\\\|\\u0007))/,FT;function oit(){if(FT)return FT;if(typeof Intl.Segmenter<\"u\"){let t=new Intl.Segmenter(\"en\",{granularity:\"grapheme\"});return FT=e=>Array.from(t.segment(e),({segment:r})=>r)}else{let t=Vpe(),e=new t;return FT=r=>e.splitGraphemes(r)}}Jpe.exports=(t,e=0,r=t.length)=>{if(e<0||r<0)throw new RangeError(\"Negative indices aren't supported by this implementation\");let s=r-e,a=\"\",n=0,c=0;for(;t.length>0;){let f=t.match(sit)||[t,t,void 0],p=oit()(f[1]),h=Math.min(e-n,p.length);p=p.slice(h);let E=Math.min(s-c,p.length);a+=p.slice(0,E).join(\"\"),n+=h,c+=E,typeof f[2]<\"u\"&&(a+=f[2]),t=t.slice(f[0].length)}return a}});var fn,yv=Xe(()=>{fn=process.env.YARN_IS_TEST_ENV?\"0.0.0\":\"4.12.0\"});function the(t,{configuration:e,json:r}){if(!e.get(\"enableMessageNames\"))return\"\";let a=Yf(t===null?0:t);return!r&&t===null?Ht(e,a,\"grey\"):a}function Wj(t,{configuration:e,json:r}){let s=the(t,{configuration:e,json:r});if(!s||t===null||t===0)return s;let a=Br[t],n=`https://yarnpkg.com/advanced/error-codes#${s}---${a}`.toLowerCase();return KE(e,s,n)}async function SI({configuration:t,stdout:e,forceError:r},s){let a=await Ot.start({configuration:t,stdout:e,includeFooter:!1},async n=>{let c=!1,f=!1;for(let p of s)typeof p.option<\"u\"&&(p.error||r?(f=!0,n.reportError(50,p.message)):(c=!0,n.reportWarning(50,p.message)),p.callback?.());c&&!f&&n.reportSeparator()});return a.hasErrors()?a.exitCode():null}var $pe,NT,ait,zpe,Xpe,D0,ehe,Zpe,lit,cit,OT,uit,Ot,Ev=Xe(()=>{$pe=ut(Kpe()),NT=ut(Fd());Gx();Tc();yv();xc();ait=\"\\xB7\",zpe=[\"\\u280B\",\"\\u2819\",\"\\u2839\",\"\\u2838\",\"\\u283C\",\"\\u2834\",\"\\u2826\",\"\\u2827\",\"\\u2807\",\"\\u280F\"],Xpe=80,D0=NT.default.GITHUB_ACTIONS?{start:t=>`::group::${t}\n`,end:t=>`::endgroup::\n`}:NT.default.TRAVIS?{start:t=>`travis_fold:start:${t}\n`,end:t=>`travis_fold:end:${t}\n`}:NT.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\\W+/g,\"_\")}[collapsed=true]\\r\\x1B[0K${t}\n`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\\W+/g,\"_\")}\\r\\x1B[0K`}:null,ehe=D0!==null,Zpe=new Date,lit=[\"iTerm.app\",\"Apple_Terminal\",\"WarpTerminal\",\"vscode\"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,cit=t=>t,OT=cit({patrick:{date:[17,3],chars:[\"\\u{1F340}\",\"\\u{1F331}\"],size:40},simba:{date:[19,7],chars:[\"\\u{1F981}\",\"\\u{1F334}\"],size:40},jack:{date:[31,10],chars:[\"\\u{1F383}\",\"\\u{1F987}\"],size:40},hogsfather:{date:[31,12],chars:[\"\\u{1F389}\",\"\\u{1F384}\"],size:40},default:{chars:[\"=\",\"-\"],size:80}}),uit=lit&&Object.keys(OT).find(t=>{let e=OT[t];return!(e.date&&(e.date[0]!==Zpe.getDate()||e.date[1]!==Zpe.getMonth()+1))})||\"default\";Ot=class extends Ao{constructor({configuration:r,stdout:s,json:a=!1,forceSectionAlignment:n=!1,includeNames:c=!0,includePrefix:f=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:C=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(RB(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=c,this.includePrefix=f,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=C,this.json=a,this.stdout=s,r.get(\"enableProgressBars\")&&!a&&s.isTTY&&s.columns>22){let S=r.get(\"progressBarStyle\")||uit;if(!Object.hasOwn(OT,S))throw new Error(\"Assertion failed: Invalid progress bar style\");this.progressStyle=OT[S];let P=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*P/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!=\"string\"){let h=c;c=h.message,f=f??h.name}let p=typeof f<\"u\"?`${f}: ${c}`:c;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,zd(r.configuration,`Yarn ${fn}`,2));try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let s=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,s-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}startTimerImpl(r,s,a){return{cb:typeof s==\"function\"?s:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\\u250C ${r}`),this.indent+=1,D0!==null&&!this.json&&this.includeInfos&&this.stdout.write(D0.start(r))},reportFooter:f=>{if(this.indent-=1,D0!==null&&!this.json&&this.includeInfos){this.stdout.write(D0.end(r));for(let p of this.timerFooter)p()}this.configuration.get(\"enableTimers\")&&f>200?this.reportInfo(null,`\\u2514 Completed in ${Ht(this.configuration,f,ht.DURATION)}`):this.reportInfo(null,\"\\u2514 Completed\"),this.level-=1},skipIfEmpty:(typeof s==\"function\"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}reportSeparator(){this.indent===0?this.writeLine(\"\"):this.reportInfo(null,\"\")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\",c=`${this.formatPrefix(n,\"blueBright\")}${s}`;this.json?this.reportJson({type:\"info\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(c)}reportWarning(r,s){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\";this.json?this.reportJson({type:\"warning\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,\"yellowBright\")}${s}`)}reportError(r,s){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,s)),this.reportErrorImpl(r,s)}reportErrorImpl(r,s){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\";this.json?this.reportJson({type:\"error\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,\"redBright\")}${s}`,{truncate:!1})}reportFold(r,s){if(!D0)return;let a=`${D0.start(r)}${s}${D0.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)return{...Promise.resolve(),stop:()=>{}};if(r.hasProgress&&r.hasTitle)throw new Error(\"Unimplemented: Progress bars can't have both progress and titles.\");let s=!1,a=Promise.resolve().then(async()=>{let c={progress:r.hasProgress?0:void 0,title:r.hasTitle?\"\":void 0};this.progress.set(r,{definition:c,lastScaledSize:r.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:f,title:p}of r)s||c.progress===f&&c.title===p||(c.progress=f,c.title=p,this.refreshProgress());n()}),n=()=>{s||(s=!0,this.progress.delete(r),this.refreshProgress({delta:1}))};return{...a,stop:n}}reportJson(r){this.json&&this.writeLine(`${JSON.stringify(r)}`)}async finalize(){if(!this.includeFooter)return;let r=\"\";this.errorCount>0?r=\"Failed with errors\":this.warningCount>0?r=\"Done with warnings\":r=\"Done\";let s=Ht(this.configuration,Date.now()-this.startTime,ht.DURATION),a=this.configuration.get(\"enableTimers\")?`${r} in ${s}`:r;this.errorCount>0?this.reportError(0,a):this.warningCount>0?this.reportWarning(0,a):this.reportInfo(0,a)}writeLine(r,{truncate:s}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(r,{truncate:s})}\n`),this.writeProgress()}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}\n`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write(\"\\x1B[0J\"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>Xpe&&(this.progressFrame=(this.progressFrame+1)%zpe.length,this.progressTime=r);let s=zpe[this.progressFrame];for(let a of this.progress.values()){let n=\"\";if(typeof a.lastScaledSize<\"u\"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let c=this.formatName(null),f=c?`${c}: `:\"\",p=a.definition.title?` ${a.definition.title}`:\"\";this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"blueBright\")} ${f}${s}${n}${p}\n`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},Xpe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<\"u\"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,p=c.lastScaledSize;c.lastScaledSize=f;let h=c.lastTitle;if(c.lastTitle=c.definition.title,f!==p||(n=h!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>\"u\"&&(s=this.configuration.get(\"preferTruncatedLines\")),s&&(r=(0,$pe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?the(r,{configuration:this.configuration,json:this.json}):\"\"}formatPrefix(r,s){return this.includePrefix?`${Ht(this.configuration,\"\\u27A4\",s)} ${r}${this.formatIndent()}`:\"\"}formatNameWithHyperlink(r){return this.includeNames?Wj(r,{configuration:this.configuration,json:this.json}):\"\"}formatIndent(){return this.level>0||!this.forceSectionAlignment?\"\\u2502 \".repeat(this.indent):`${ait} `}}});var In={};Vt(In,{PackageManager:()=>nhe,detectPackageManager:()=>ihe,executePackageAccessibleBinary:()=>che,executePackageScript:()=>LT,executePackageShellcode:()=>Yj,executeWorkspaceAccessibleBinary:()=>mit,executeWorkspaceLifecycleScript:()=>ahe,executeWorkspaceScript:()=>ohe,getPackageAccessibleBinaries:()=>MT,getWorkspaceAccessibleBinaries:()=>lhe,hasPackageScript:()=>hit,hasWorkspaceScript:()=>Vj,isNodeScript:()=>Jj,makeScriptEnv:()=>Iv,maybeExecuteWorkspaceLifecycleScript:()=>dit,prepareExternalProject:()=>pit});async function b0(t,e,r,s=[]){if(process.platform===\"win32\"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @\"${r}\" ${s.map(n=>`\"${n.replace('\"','\"\"')}\"`).join(\" \")} %*`;await ce.writeFilePromise(J.format({dir:t,name:e,ext:\".cmd\"}),a)}await ce.writeFilePromise(J.join(t,e),`#!/bin/sh\nexec \"${r}\" ${s.map(a=>`'${a.replace(/'/g,`'\"'\"'`)}'`).join(\" \")} \"$@\"\n`,{mode:493})}async function ihe(t){let e=await Ut.tryFind(t);if(e?.packageManager){let s=xQ(e.packageManager);if(s?.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=s.reference.split(\".\");switch(s.name){case\"yarn\":return{packageManagerField:!0,packageManager:Number(n)===1?\"Yarn Classic\":\"Yarn\",reason:a};case\"npm\":return{packageManagerField:!0,packageManager:\"npm\",reason:a};case\"pnpm\":return{packageManagerField:!0,packageManager:\"pnpm\",reason:a}}}}let r;try{r=await ce.readFilePromise(J.join(t,Er.lockfile),\"utf8\")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:\"Yarn\",reason:'\"__metadata\" key found in yarn.lock'}:{packageManager:\"Yarn Classic\",reason:'\"__metadata\" key not found in yarn.lock, must be a Yarn classic lockfile'}:ce.existsSync(J.join(t,\"package-lock.json\"))?{packageManager:\"npm\",reason:`found npm's \"package-lock.json\" lockfile`}:ce.existsSync(J.join(t,\"pnpm-lock.yaml\"))?{packageManager:\"pnpm\",reason:`found pnpm's \"pnpm-lock.yaml\" lockfile`}:null}async function Iv({project:t,locator:e,binFolder:r,ignoreCorepack:s,lifecycleScript:a,baseEnv:n=t?.configuration.env??process.env}){let c={};for(let[E,C]of Object.entries(n))typeof C<\"u\"&&(c[E.toLowerCase()!==\"path\"?E:\"PATH\"]=C);let f=fe.fromPortablePath(r);c.BERRY_BIN_FOLDER=fe.fromPortablePath(f);let p=process.env.COREPACK_ROOT&&!s?fe.join(process.env.COREPACK_ROOT,\"dist/yarn.js\"):process.argv[1];if(await Promise.all([b0(r,\"node\",process.execPath),...fn!==null?[b0(r,\"run\",process.execPath,[p,\"run\"]),b0(r,\"yarn\",process.execPath,[p]),b0(r,\"yarnpkg\",process.execPath,[p]),b0(r,\"node-gyp\",process.execPath,[p,\"run\",\"--top-level\",\"node-gyp\"])]:[]]),t&&(c.INIT_CWD=fe.fromPortablePath(t.configuration.startingCwd),c.PROJECT_CWD=fe.fromPortablePath(t.cwd)),c.PATH=c.PATH?`${f}${fe.delimiter}${c.PATH}`:`${f}`,c.npm_execpath=`${f}${fe.sep}yarn`,c.npm_node_execpath=`${f}${fe.sep}node`,e){if(!t)throw new Error(\"Assertion failed: Missing project\");let E=t.tryWorkspaceByLocator(e),C=E?E.manifest.version??\"\":t.storedPackages.get(e.locatorHash).version??\"\";c.npm_package_name=un(e),c.npm_package_version=C;let S;if(E)S=E.cwd;else{let P=t.storedPackages.get(e.locatorHash);if(!P)throw new Error(`Package for ${Yr(t.configuration,e)} not found in the project`);let I=t.configuration.getLinkers(),R={project:t,report:new Ot({stdout:new P0.PassThrough,configuration:t.configuration})},N=I.find(U=>U.supportsPackage(P,R));if(!N)throw new Error(`The package ${Yr(t.configuration,P)} isn't supported by any of the available linkers`);S=await N.findPackageLocation(P,R)}c.npm_package_json=fe.fromPortablePath(J.join(S,Er.manifest))}let h=fn!==null?`yarn/${fn}`:`yarn/${Pp(\"@yarnpkg/core\").version}-core`;return c.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(c.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(E=>E.setupScriptEnvironment,t,c,async(E,C,S)=>await b0(r,E,C,S)),c}async function pit(t,e,{configuration:r,report:s,workspace:a=null,locator:n=null}){await Ait(async()=>{await ce.mktempPromise(async c=>{let f=J.join(c,\"pack.log\"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(f,{prefix:fe.fromPortablePath(t),report:s}),C=n&&Gu(n)?rI(n):n,S=C?ll(C):\"an external project\";h.write(`Packing ${S} from sources\n`);let P=await ihe(t),I;P!==null?(h.write(`Using ${P.packageManager} for bootstrap. Reason: ${P.reason}\n\n`),I=P.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn\n\n`),I=\"Yarn\");let R=I===\"Yarn\"&&!P?.packageManagerField;await ce.mktempPromise(async N=>{let U=await Iv({binFolder:N,ignoreCorepack:R,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:\"0\"}}),ee=new Map([[\"Yarn Classic\",async()=>{let ue=a!==null?[\"workspace\",a]:[],le=J.join(t,Er.manifest),me=await ce.readFilePromise(le),pe=await Wu(process.execPath,[process.argv[1],\"set\",\"version\",\"classic\",\"--only-if-needed\",\"--yarn-path\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(pe.code!==0)return pe.code;await ce.writeFilePromise(le,me),await ce.appendFilePromise(J.join(t,\".npmignore\"),`/.yarn\n`),h.write(`\n`),delete U.NODE_ENV;let Be=await Wu(\"yarn\",[\"install\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(Be.code!==0)return Be.code;h.write(`\n`);let Ce=await Wu(\"yarn\",[...ue,\"pack\",\"--filename\",fe.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ce.code!==0?Ce.code:0}],[\"Yarn\",async()=>{let ue=a!==null?[\"workspace\",a]:[];U.YARN_ENABLE_INLINE_BUILDS=\"1\";let le=J.join(t,Er.lockfile);await ce.existsPromise(le)||await ce.writeFilePromise(le,\"\");let me=await Wu(\"yarn\",[...ue,\"pack\",\"--install-if-needed\",\"--filename\",fe.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return me.code!==0?me.code:0}],[\"npm\",async()=>{if(a!==null){let we=new P0.PassThrough,ye=WE(we);we.pipe(h,{end:!1});let Ae=await Wu(\"npm\",[\"--version\"],{cwd:t,env:U,stdin:p,stdout:we,stderr:E,end:0});if(we.end(),Ae.code!==0)return h.end(),E.end(),Ae.code;let se=(await ye).toString().trim();if(!Zf(se,\">=7.x\")){let Z=Da(null,\"npm\"),De=On(Z,se),Re=On(Z,\">=7.x\");throw new Error(`Workspaces aren't supported by ${ni(r,De)}; please upgrade to ${ni(r,Re)} (npm has been detected as the primary package manager for ${Ht(r,t,ht.PATH)})`)}}let ue=a!==null?[\"--workspace\",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let le=await Wu(\"npm\",[\"install\",\"--legacy-peer-deps\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(le.code!==0)return le.code;let me=new P0.PassThrough,pe=WE(me);me.pipe(h);let Be=await Wu(\"npm\",[\"pack\",\"--silent\",...ue],{cwd:t,env:U,stdin:p,stdout:me,stderr:E});if(Be.code!==0)return Be.code;let Ce=(await pe).toString().trim().replace(/^.*\\n/s,\"\"),g=J.resolve(t,fe.toPortablePath(Ce));return await ce.renamePromise(g,e),0}]]).get(I);if(typeof ee>\"u\")throw new Error(\"Assertion failed: Unsupported workflow\");let ie=await ee();if(!(ie===0||typeof ie>\"u\"))throw ce.detachTemp(c),new jt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Ht(r,f,ht.PATH)})`)})})})}async function hit(t,e,{project:r}){let s=r.tryWorkspaceByLocator(t);if(s!==null)return Vj(s,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r.configuration,t)} not found in the project`);return await $f.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),p={project:r,report:new Ot({stdout:new P0.PassThrough,configuration:c})},h=f.find(P=>P.supportsPackage(a,p));if(!h)throw new Error(`The package ${Yr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),C=new Sn(E,{baseFs:n});return(await Ut.find(vt.dot,{baseFs:C})).scripts.has(e)})}async function LT(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ce.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await she(t,{project:a,binFolder:p,cwd:s,lifecycleScript:e}),S=h.scripts.get(e);if(typeof S>\"u\")return 1;let P=async()=>await vI(S,r,{cwd:C,env:E,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(R=>R.wrapScriptExecution,P,a,t,e,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function Yj(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ce.mktempPromise(async p=>{let{env:h,cwd:E}=await she(t,{project:a,binFolder:p,cwd:s});return await vI(e,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function git(t,{binFolder:e,cwd:r,lifecycleScript:s}){let a=await Iv({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:s});return await Kj(e,await lhe(t)),typeof r>\"u\"&&(r=J.dirname(await ce.realpathPromise(J.join(t.cwd,\"package.json\")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function she(t,{project:e,binFolder:r,cwd:s,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return git(n,{binFolder:r,cwd:s,lifecycleScript:a});let c=e.storedPackages.get(t.locatorHash);if(!c)throw new Error(`Package for ${Yr(e.configuration,t)} not found in the project`);return await $f.openPromise(async f=>{let p=e.configuration,h=e.configuration.getLinkers(),E={project:e,report:new Ot({stdout:new P0.PassThrough,configuration:p})},C=h.find(N=>N.supportsPackage(c,E));if(!C)throw new Error(`The package ${Yr(e.configuration,c)} isn't supported by any of the available linkers`);let S=await Iv({project:e,locator:t,binFolder:r,lifecycleScript:a});await Kj(r,await MT(t,{project:e}));let P=await C.findPackageLocation(c,E),I=new Sn(P,{baseFs:f}),R=await Ut.find(vt.dot,{baseFs:I});return typeof s>\"u\"&&(s=P),{manifest:R,binFolder:r,env:S,cwd:s}})}async function ohe(t,e,r,{cwd:s,stdin:a,stdout:n,stderr:c}){return await LT(t.anchoredLocator,e,r,{cwd:s,project:t.project,stdin:a,stdout:n,stderr:c})}function Vj(t,e){return t.manifest.scripts.has(e)}async function ahe(t,e,{cwd:r,report:s}){let{configuration:a}=t.project,n=null;await ce.mktempPromise(async c=>{let f=J.join(c,`${e}.log`),p=`# This file contains the result of Yarn calling the \"${e}\" lifecycle script inside a workspace (\"${fe.fromPortablePath(t.cwd)}\")\n`,{stdout:h,stderr:E}=a.getSubprocessStreams(f,{report:s,prefix:Yr(a,t.anchoredLocator),header:p});s.reportInfo(36,`Calling the \"${e}\" lifecycle script`);let C=await ohe(t,e,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw ce.detachTemp(c),new jt(36,`${bB(e)} script failed (exit code ${Ht(a,C,ht.NUMBER)}, logs can be found here: ${Ht(a,f,ht.PATH)}); run ${Ht(a,`yarn ${e}`,ht.CODE)} to investigate`)})}async function dit(t,e,r){Vj(t,e)&&await ahe(t,e,r)}function Jj(t){let e=J.extname(t);if(e.match(/\\.[cm]?[jt]sx?$/))return!0;if(e===\".exe\"||e===\".bin\")return!1;let r=Buffer.alloc(4),s;try{s=ce.openSync(t,\"r\")}catch{return!0}try{ce.readSync(s,r,0,r.length,0)}finally{ce.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function MT(t,{project:e}){let r=e.configuration,s=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r,t)} not found in the project`);let n=new P0.Writable,c=r.getLinkers(),f={project:e,report:new Ot({configuration:r,stdout:n})},p=new Set([t.locatorHash]);for(let E of a.dependencies.values()){let C=e.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(`Assertion failed: The resolution (${ni(r,E)}) should have been registered`);p.add(C)}let h=await Promise.all(Array.from(p,async E=>{let C=e.storedPackages.get(E);if(!C)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(C.bin.size===0)return Wl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Wl.skip;let P=null;try{P=await S.findPackageLocation(C,f)}catch(I){if(I.code===\"LOCATOR_NOT_INSTALLED\")return Wl.skip;throw I}return{dependency:C,packageLocation:P}}));for(let E of h){if(E===Wl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[P,I]of C.bin){let R=J.resolve(S,I);s.set(P,[C,fe.fromPortablePath(R),Jj(R)])}}return s}async function lhe(t){return await MT(t.anchoredLocator,{project:t.project})}async function Kj(t,e){await Promise.all(Array.from(e,([r,[,s,a]])=>a?b0(t,r,process.execPath,[s]):b0(t,r,s,[])))}async function che(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await MT(t,{project:a});let E=h.get(e);if(!E)throw new Error(`Binary not found (${e}) for ${Yr(a.configuration,t)}`);return await ce.mktempPromise(async C=>{let[,S]=E,P=await Iv({project:a,locator:t,binFolder:C});await Kj(P.BERRY_BIN_FOLDER,h);let I=Jj(fe.toPortablePath(S))?Wu(process.execPath,[...p,S,...r],{cwd:s,env:P,stdin:n,stdout:c,stderr:f}):Wu(S,r,{cwd:s,env:P,stdin:n,stdout:c,stderr:f}),R;try{R=await I}finally{await ce.removePromise(P.BERRY_BIN_FOLDER)}return R.code})}async function mit(t,e,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await che(t.anchoredLocator,e,r,{project:t.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var rhe,P0,nhe,fit,Ait,zj=Xe(()=>{Dt();Dt();eA();pv();ql();rhe=ut(Ld()),P0=Ie(\"stream\");oI();Tc();Ev();yv();dT();xc();Pc();Rp();Wo();nhe=(a=>(a.Yarn1=\"Yarn Classic\",a.Yarn2=\"Yarn\",a.Npm=\"npm\",a.Pnpm=\"pnpm\",a))(nhe||{});fit=2,Ait=(0,rhe.default)(fit)});var DI=_((J4t,fhe)=>{\"use strict\";var uhe=new Map([[\"C\",\"cwd\"],[\"f\",\"file\"],[\"z\",\"gzip\"],[\"P\",\"preservePaths\"],[\"U\",\"unlink\"],[\"strip-components\",\"strip\"],[\"stripComponents\",\"strip\"],[\"keep-newer\",\"newer\"],[\"keepNewer\",\"newer\"],[\"keep-newer-files\",\"newer\"],[\"keepNewerFiles\",\"newer\"],[\"k\",\"keep\"],[\"keep-existing\",\"keep\"],[\"keepExisting\",\"keep\"],[\"m\",\"noMtime\"],[\"no-mtime\",\"noMtime\"],[\"p\",\"preserveOwner\"],[\"L\",\"follow\"],[\"h\",\"follow\"]]);fhe.exports=t=>t?Object.keys(t).map(e=>[uhe.has(e)?uhe.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var PI=_((K4t,Ihe)=>{\"use strict\";var Ahe=typeof process==\"object\"&&process?process:{stdout:null,stderr:null},yit=Ie(\"events\"),phe=Ie(\"stream\"),hhe=Ie(\"string_decoder\").StringDecoder,_p=Symbol(\"EOF\"),Hp=Symbol(\"maybeEmitEnd\"),x0=Symbol(\"emittedEnd\"),UT=Symbol(\"emittingEnd\"),Cv=Symbol(\"emittedError\"),_T=Symbol(\"closed\"),ghe=Symbol(\"read\"),HT=Symbol(\"flush\"),dhe=Symbol(\"flushChunk\"),ul=Symbol(\"encoding\"),jp=Symbol(\"decoder\"),jT=Symbol(\"flowing\"),wv=Symbol(\"paused\"),bI=Symbol(\"resume\"),Ys=Symbol(\"bufferLength\"),Xj=Symbol(\"bufferPush\"),Zj=Symbol(\"bufferShift\"),Ko=Symbol(\"objectMode\"),zo=Symbol(\"destroyed\"),$j=Symbol(\"emitData\"),mhe=Symbol(\"emitEnd\"),e6=Symbol(\"emitEnd2\"),Gp=Symbol(\"async\"),Bv=t=>Promise.resolve().then(t),yhe=global._MP_NO_ITERATOR_SYMBOLS_!==\"1\",Eit=yhe&&Symbol.asyncIterator||Symbol(\"asyncIterator not implemented\"),Iit=yhe&&Symbol.iterator||Symbol(\"iterator not implemented\"),Cit=t=>t===\"end\"||t===\"finish\"||t===\"prefinish\",wit=t=>t instanceof ArrayBuffer||typeof t==\"object\"&&t.constructor&&t.constructor.name===\"ArrayBuffer\"&&t.byteLength>=0,Bit=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),GT=class{constructor(e,r,s){this.src=e,this.dest=r,this.opts=s,this.ondrain=()=>e[bI](),r.on(\"drain\",this.ondrain)}unpipe(){this.dest.removeListener(\"drain\",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},t6=class extends GT{unpipe(){this.src.removeListener(\"error\",this.proxyErrors),super.unpipe()}constructor(e,r,s){super(e,r,s),this.proxyErrors=a=>r.emit(\"error\",a),e.on(\"error\",this.proxyErrors)}};Ihe.exports=class Ehe extends phe{constructor(e){super(),this[jT]=!1,this[wv]=!1,this.pipes=[],this.buffer=[],this[Ko]=e&&e.objectMode||!1,this[Ko]?this[ul]=null:this[ul]=e&&e.encoding||null,this[ul]===\"buffer\"&&(this[ul]=null),this[Gp]=e&&!!e.async||!1,this[jp]=this[ul]?new hhe(this[ul]):null,this[_p]=!1,this[x0]=!1,this[UT]=!1,this[_T]=!1,this[Cv]=null,this.writable=!0,this.readable=!0,this[Ys]=0,this[zo]=!1}get bufferLength(){return this[Ys]}get encoding(){return this[ul]}set encoding(e){if(this[Ko])throw new Error(\"cannot set encoding in objectMode\");if(this[ul]&&e!==this[ul]&&(this[jp]&&this[jp].lastNeed||this[Ys]))throw new Error(\"cannot change encoding\");this[ul]!==e&&(this[jp]=e?new hhe(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[jp].write(r)))),this[ul]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Ko]}set objectMode(e){this[Ko]=this[Ko]||!!e}get async(){return this[Gp]}set async(e){this[Gp]=this[Gp]||!!e}write(e,r,s){if(this[_p])throw new Error(\"write after end\");if(this[zo])return this.emit(\"error\",Object.assign(new Error(\"Cannot call write after a stream was destroyed\"),{code:\"ERR_STREAM_DESTROYED\"})),!0;typeof r==\"function\"&&(s=r,r=\"utf8\"),r||(r=\"utf8\");let a=this[Gp]?Bv:n=>n();return!this[Ko]&&!Buffer.isBuffer(e)&&(Bit(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):wit(e)?e=Buffer.from(e):typeof e!=\"string\"&&(this.objectMode=!0)),this[Ko]?(this.flowing&&this[Ys]!==0&&this[HT](!0),this.flowing?this.emit(\"data\",e):this[Xj](e),this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing):e.length?(typeof e==\"string\"&&!(r===this[ul]&&!this[jp].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[ul]&&(e=this[jp].write(e)),this.flowing&&this[Ys]!==0&&this[HT](!0),this.flowing?this.emit(\"data\",e):this[Xj](e),this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing):(this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing)}read(e){if(this[zo])return null;if(this[Ys]===0||e===0||e>this[Ys])return this[Hp](),null;this[Ko]&&(e=null),this.buffer.length>1&&!this[Ko]&&(this.encoding?this.buffer=[this.buffer.join(\"\")]:this.buffer=[Buffer.concat(this.buffer,this[Ys])]);let r=this[ghe](e||null,this.buffer[0]);return this[Hp](),r}[ghe](e,r){return e===r.length||e===null?this[Zj]():(this.buffer[0]=r.slice(e),r=r.slice(0,e),this[Ys]-=e),this.emit(\"data\",r),!this.buffer.length&&!this[_p]&&this.emit(\"drain\"),r}end(e,r,s){return typeof e==\"function\"&&(s=e,e=null),typeof r==\"function\"&&(s=r,r=\"utf8\"),e&&this.write(e,r),s&&this.once(\"end\",s),this[_p]=!0,this.writable=!1,(this.flowing||!this[wv])&&this[Hp](),this}[bI](){this[zo]||(this[wv]=!1,this[jT]=!0,this.emit(\"resume\"),this.buffer.length?this[HT]():this[_p]?this[Hp]():this.emit(\"drain\"))}resume(){return this[bI]()}pause(){this[jT]=!1,this[wv]=!0}get destroyed(){return this[zo]}get flowing(){return this[jT]}get paused(){return this[wv]}[Xj](e){this[Ko]?this[Ys]+=1:this[Ys]+=e.length,this.buffer.push(e)}[Zj](){return this.buffer.length&&(this[Ko]?this[Ys]-=1:this[Ys]-=this.buffer[0].length),this.buffer.shift()}[HT](e){do;while(this[dhe](this[Zj]()));!e&&!this.buffer.length&&!this[_p]&&this.emit(\"drain\")}[dhe](e){return e?(this.emit(\"data\",e),this.flowing):!1}pipe(e,r){if(this[zo])return;let s=this[x0];return r=r||{},e===Ahe.stdout||e===Ahe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,s?r.end&&e.end():(this.pipes.push(r.proxyErrors?new t6(this,e,r):new GT(this,e,r)),this[Gp]?Bv(()=>this[bI]()):this[bI]()),e}unpipe(e){let r=this.pipes.find(s=>s.dest===e);r&&(this.pipes.splice(this.pipes.indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let s=super.on(e,r);return e===\"data\"&&!this.pipes.length&&!this.flowing?this[bI]():e===\"readable\"&&this[Ys]!==0?super.emit(\"readable\"):Cit(e)&&this[x0]?(super.emit(e),this.removeAllListeners(e)):e===\"error\"&&this[Cv]&&(this[Gp]?Bv(()=>r.call(this,this[Cv])):r.call(this,this[Cv])),s}get emittedEnd(){return this[x0]}[Hp](){!this[UT]&&!this[x0]&&!this[zo]&&this.buffer.length===0&&this[_p]&&(this[UT]=!0,this.emit(\"end\"),this.emit(\"prefinish\"),this.emit(\"finish\"),this[_T]&&this.emit(\"close\"),this[UT]=!1)}emit(e,r,...s){if(e!==\"error\"&&e!==\"close\"&&e!==zo&&this[zo])return;if(e===\"data\")return r?this[Gp]?Bv(()=>this[$j](r)):this[$j](r):!1;if(e===\"end\")return this[mhe]();if(e===\"close\"){if(this[_T]=!0,!this[x0]&&!this[zo])return;let n=super.emit(\"close\");return this.removeAllListeners(\"close\"),n}else if(e===\"error\"){this[Cv]=r;let n=super.emit(\"error\",r);return this[Hp](),n}else if(e===\"resume\"){let n=super.emit(\"resume\");return this[Hp](),n}else if(e===\"finish\"||e===\"prefinish\"){let n=super.emit(e);return this.removeAllListeners(e),n}let a=super.emit(e,r,...s);return this[Hp](),a}[$j](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let r=super.emit(\"data\",e);return this[Hp](),r}[mhe](){this[x0]||(this[x0]=!0,this.readable=!1,this[Gp]?Bv(()=>this[e6]()):this[e6]())}[e6](){if(this[jp]){let r=this[jp].end();if(r){for(let s of this.pipes)s.dest.write(r);super.emit(\"data\",r)}}for(let r of this.pipes)r.end();let e=super.emit(\"end\");return this.removeAllListeners(\"end\"),e}collect(){let e=[];this[Ko]||(e.dataLength=0);let r=this.promise();return this.on(\"data\",s=>{e.push(s),this[Ko]||(e.dataLength+=s.length)}),r.then(()=>e)}concat(){return this[Ko]?Promise.reject(new Error(\"cannot concat in objectMode\")):this.collect().then(e=>this[Ko]?Promise.reject(new Error(\"cannot concat in objectMode\")):this[ul]?e.join(\"\"):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(zo,()=>r(new Error(\"stream destroyed\"))),this.on(\"error\",s=>r(s)),this.on(\"end\",()=>e())})}[Eit](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[_p])return Promise.resolve({done:!0});let s=null,a=null,n=h=>{this.removeListener(\"data\",c),this.removeListener(\"end\",f),a(h)},c=h=>{this.removeListener(\"error\",n),this.removeListener(\"end\",f),this.pause(),s({value:h,done:!!this[_p]})},f=()=>{this.removeListener(\"error\",n),this.removeListener(\"data\",c),s({done:!0})},p=()=>n(new Error(\"stream destroyed\"));return new Promise((h,E)=>{a=E,s=h,this.once(zo,p),this.once(\"error\",n),this.once(\"end\",f),this.once(\"data\",c)})}}}[Iit](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[zo]?(e?this.emit(\"error\",e):this.emit(zo),this):(this[zo]=!0,this.buffer.length=0,this[Ys]=0,typeof this.close==\"function\"&&!this[_T]&&this.close(),e?this.emit(\"error\",e):this.emit(zo),this)}static isStream(e){return!!e&&(e instanceof Ehe||e instanceof phe||e instanceof yit&&(typeof e.pipe==\"function\"||typeof e.write==\"function\"&&typeof e.end==\"function\"))}}});var whe=_((z4t,Che)=>{var vit=Ie(\"zlib\").constants||{ZLIB_VERNUM:4736};Che.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},vit))});var m6=_(Kl=>{\"use strict\";var o6=Ie(\"assert\"),k0=Ie(\"buffer\").Buffer,She=Ie(\"zlib\"),fm=Kl.constants=whe(),Sit=PI(),Bhe=k0.concat,Am=Symbol(\"_superWrite\"),kI=class extends Error{constructor(e){super(\"zlib: \"+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code=\"ZLIB_ERROR\"),this.message=\"zlib: \"+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return\"ZlibError\"}},Dit=Symbol(\"opts\"),vv=Symbol(\"flushFlag\"),vhe=Symbol(\"finishFlushFlag\"),d6=Symbol(\"fullFlushFlag\"),Ii=Symbol(\"handle\"),qT=Symbol(\"onError\"),xI=Symbol(\"sawError\"),r6=Symbol(\"level\"),n6=Symbol(\"strategy\"),i6=Symbol(\"ended\"),X4t=Symbol(\"_defaultFullFlush\"),WT=class extends Sit{constructor(e,r){if(!e||typeof e!=\"object\")throw new TypeError(\"invalid options for ZlibBase constructor\");super(e),this[xI]=!1,this[i6]=!1,this[Dit]=e,this[vv]=e.flush,this[vhe]=e.finishFlush;try{this[Ii]=new She[r](e)}catch(s){throw new kI(s)}this[qT]=s=>{this[xI]||(this[xI]=!0,this.close(),this.emit(\"error\",s))},this[Ii].on(\"error\",s=>this[qT](new kI(s))),this.once(\"end\",()=>this.close)}close(){this[Ii]&&(this[Ii].close(),this[Ii]=null,this.emit(\"close\"))}reset(){if(!this[xI])return o6(this[Ii],\"zlib binding closed\"),this[Ii].reset()}flush(e){this.ended||(typeof e!=\"number\"&&(e=this[d6]),this.write(Object.assign(k0.alloc(0),{[vv]:e})))}end(e,r,s){return e&&this.write(e,r),this.flush(this[vhe]),this[i6]=!0,super.end(null,null,s)}get ended(){return this[i6]}write(e,r,s){if(typeof r==\"function\"&&(s=r,r=\"utf8\"),typeof e==\"string\"&&(e=k0.from(e,r)),this[xI])return;o6(this[Ii],\"zlib binding closed\");let a=this[Ii]._handle,n=a.close;a.close=()=>{};let c=this[Ii].close;this[Ii].close=()=>{},k0.concat=h=>h;let f;try{let h=typeof e[vv]==\"number\"?e[vv]:this[vv];f=this[Ii]._processChunk(e,h),k0.concat=Bhe}catch(h){k0.concat=Bhe,this[qT](new kI(h))}finally{this[Ii]&&(this[Ii]._handle=a,a.close=n,this[Ii].close=c,this[Ii].removeAllListeners(\"error\"))}this[Ii]&&this[Ii].on(\"error\",h=>this[qT](new kI(h)));let p;if(f)if(Array.isArray(f)&&f.length>0){p=this[Am](k0.from(f[0]));for(let h=1;h<f.length;h++)p=this[Am](f[h])}else p=this[Am](k0.from(f));return s&&s(),p}[Am](e){return super.write(e)}},qp=class extends WT{constructor(e,r){e=e||{},e.flush=e.flush||fm.Z_NO_FLUSH,e.finishFlush=e.finishFlush||fm.Z_FINISH,super(e,r),this[d6]=fm.Z_FULL_FLUSH,this[r6]=e.level,this[n6]=e.strategy}params(e,r){if(!this[xI]){if(!this[Ii])throw new Error(\"cannot switch params when binding is closed\");if(!this[Ii].params)throw new Error(\"not supported in this implementation\");if(this[r6]!==e||this[n6]!==r){this.flush(fm.Z_SYNC_FLUSH),o6(this[Ii],\"zlib binding closed\");let s=this[Ii].flush;this[Ii].flush=(a,n)=>{this.flush(a),n()};try{this[Ii].params(e,r)}finally{this[Ii].flush=s}this[Ii]&&(this[r6]=e,this[n6]=r)}}}},a6=class extends qp{constructor(e){super(e,\"Deflate\")}},l6=class extends qp{constructor(e){super(e,\"Inflate\")}},s6=Symbol(\"_portable\"),c6=class extends qp{constructor(e){super(e,\"Gzip\"),this[s6]=e&&!!e.portable}[Am](e){return this[s6]?(this[s6]=!1,e[9]=255,super[Am](e)):super[Am](e)}},u6=class extends qp{constructor(e){super(e,\"Gunzip\")}},f6=class extends qp{constructor(e){super(e,\"DeflateRaw\")}},A6=class extends qp{constructor(e){super(e,\"InflateRaw\")}},p6=class extends qp{constructor(e){super(e,\"Unzip\")}},YT=class extends WT{constructor(e,r){e=e||{},e.flush=e.flush||fm.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||fm.BROTLI_OPERATION_FINISH,super(e,r),this[d6]=fm.BROTLI_OPERATION_FLUSH}},h6=class extends YT{constructor(e){super(e,\"BrotliCompress\")}},g6=class extends YT{constructor(e){super(e,\"BrotliDecompress\")}};Kl.Deflate=a6;Kl.Inflate=l6;Kl.Gzip=c6;Kl.Gunzip=u6;Kl.DeflateRaw=f6;Kl.InflateRaw=A6;Kl.Unzip=p6;typeof She.BrotliCompress==\"function\"?(Kl.BrotliCompress=h6,Kl.BrotliDecompress=g6):Kl.BrotliCompress=Kl.BrotliDecompress=class{constructor(){throw new Error(\"Brotli is not supported in this version of Node.js\")}}});var QI=_((e3t,Dhe)=>{var bit=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Dhe.exports=bit!==\"win32\"?t=>t:t=>t&&t.replace(/\\\\/g,\"/\")});var VT=_((r3t,bhe)=>{\"use strict\";var Pit=PI(),y6=QI(),E6=Symbol(\"slurp\");bhe.exports=class extends Pit{constructor(e,r,s){switch(super(),this.pause(),this.extended=r,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case\"File\":case\"OldFile\":case\"Link\":case\"SymbolicLink\":case\"CharacterDevice\":case\"BlockDevice\":case\"Directory\":case\"FIFO\":case\"ContiguousFile\":case\"GNUDumpDir\":break;case\"NextFileHasLongLinkpath\":case\"NextFileHasLongPath\":case\"OldGnuLongPath\":case\"GlobalExtendedHeader\":case\"ExtendedHeader\":case\"OldExtendedHeader\":this.meta=!0;break;default:this.ignore=!0}this.path=y6(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=y6(e.linkpath),this.uname=e.uname,this.gname=e.gname,r&&this[E6](r),s&&this[E6](s,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error(\"writing more to entry than is appropriate\");let s=this.remain,a=this.blockRemain;return this.remain=Math.max(0,s-r),this.blockRemain=Math.max(0,a-r),this.ignore?!0:s>=r?super.write(e):super.write(e.slice(0,s))}[E6](e,r){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(r&&s===\"path\")&&(this[s]=s===\"path\"||s===\"linkpath\"?y6(e[s]):e[s])}}});var I6=_(JT=>{\"use strict\";JT.name=new Map([[\"0\",\"File\"],[\"\",\"OldFile\"],[\"1\",\"Link\"],[\"2\",\"SymbolicLink\"],[\"3\",\"CharacterDevice\"],[\"4\",\"BlockDevice\"],[\"5\",\"Directory\"],[\"6\",\"FIFO\"],[\"7\",\"ContiguousFile\"],[\"g\",\"GlobalExtendedHeader\"],[\"x\",\"ExtendedHeader\"],[\"A\",\"SolarisACL\"],[\"D\",\"GNUDumpDir\"],[\"I\",\"Inode\"],[\"K\",\"NextFileHasLongLinkpath\"],[\"L\",\"NextFileHasLongPath\"],[\"M\",\"ContinuationFile\"],[\"N\",\"OldGnuLongPath\"],[\"S\",\"SparseFile\"],[\"V\",\"TapeVolumeHeader\"],[\"X\",\"OldExtendedHeader\"]]);JT.code=new Map(Array.from(JT.name).map(t=>[t[1],t[0]]))});var Qhe=_((i3t,khe)=>{\"use strict\";var xit=(t,e)=>{if(Number.isSafeInteger(t))t<0?Qit(t,e):kit(t,e);else throw Error(\"cannot encode number outside of javascript safe integer range\");return e},kit=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},Qit=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var s=e.length;s>1;s--){var a=t&255;t=Math.floor(t/256),r?e[s-1]=Phe(a):a===0?e[s-1]=0:(r=!0,e[s-1]=xhe(a))}},Tit=t=>{let e=t[0],r=e===128?Fit(t.slice(1,t.length)):e===255?Rit(t):null;if(r===null)throw Error(\"invalid base256 encoding\");if(!Number.isSafeInteger(r))throw Error(\"parsed number outside of javascript safe integer range\");return r},Rit=t=>{for(var e=t.length,r=0,s=!1,a=e-1;a>-1;a--){var n=t[a],c;s?c=Phe(n):n===0?c=n:(s=!0,c=xhe(n)),c!==0&&(r-=c*Math.pow(256,e-a-1))}return r},Fit=t=>{for(var e=t.length,r=0,s=e-1;s>-1;s--){var a=t[s];a!==0&&(r+=a*Math.pow(256,e-s-1))}return r},Phe=t=>(255^t)&255,xhe=t=>(255^t)+1&255;khe.exports={encode:xit,parse:Tit}});var RI=_((s3t,Rhe)=>{\"use strict\";var C6=I6(),TI=Ie(\"path\").posix,The=Qhe(),w6=Symbol(\"slurp\"),zl=Symbol(\"type\"),S6=class{constructor(e,r,s,a){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[zl]=\"0\",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,r||0,s,a):e&&this.set(e)}decode(e,r,s,a){if(r||(r=0),!e||!(e.length>=r+512))throw new Error(\"need 512 bytes for header\");if(this.path=pm(e,r,100),this.mode=Q0(e,r+100,8),this.uid=Q0(e,r+108,8),this.gid=Q0(e,r+116,8),this.size=Q0(e,r+124,12),this.mtime=B6(e,r+136,12),this.cksum=Q0(e,r+148,12),this[w6](s),this[w6](a,!0),this[zl]=pm(e,r+156,1),this[zl]===\"\"&&(this[zl]=\"0\"),this[zl]===\"0\"&&this.path.substr(-1)===\"/\"&&(this[zl]=\"5\"),this[zl]===\"5\"&&(this.size=0),this.linkpath=pm(e,r+157,100),e.slice(r+257,r+265).toString()===\"ustar\\x0000\")if(this.uname=pm(e,r+265,32),this.gname=pm(e,r+297,32),this.devmaj=Q0(e,r+329,8),this.devmin=Q0(e,r+337,8),e[r+475]!==0){let c=pm(e,r+345,155);this.path=c+\"/\"+this.path}else{let c=pm(e,r+345,130);c&&(this.path=c+\"/\"+this.path),this.atime=B6(e,r+476,12),this.ctime=B6(e,r+488,12)}let n=8*32;for(let c=r;c<r+148;c++)n+=e[c];for(let c=r+156;c<r+512;c++)n+=e[c];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[w6](e,r){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(r&&s===\"path\")&&(this[s]=e[s])}encode(e,r){if(e||(e=this.block=Buffer.alloc(512),r=0),r||(r=0),!(e.length>=r+512))throw new Error(\"need 512 bytes for header\");let s=this.ctime||this.atime?130:155,a=Nit(this.path||\"\",s),n=a[0],c=a[1];this.needPax=a[2],this.needPax=hm(e,r,100,n)||this.needPax,this.needPax=T0(e,r+100,8,this.mode)||this.needPax,this.needPax=T0(e,r+108,8,this.uid)||this.needPax,this.needPax=T0(e,r+116,8,this.gid)||this.needPax,this.needPax=T0(e,r+124,12,this.size)||this.needPax,this.needPax=v6(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[zl].charCodeAt(0),this.needPax=hm(e,r+157,100,this.linkpath)||this.needPax,e.write(\"ustar\\x0000\",r+257,8),this.needPax=hm(e,r+265,32,this.uname)||this.needPax,this.needPax=hm(e,r+297,32,this.gname)||this.needPax,this.needPax=T0(e,r+329,8,this.devmaj)||this.needPax,this.needPax=T0(e,r+337,8,this.devmin)||this.needPax,this.needPax=hm(e,r+345,s,c)||this.needPax,e[r+475]!==0?this.needPax=hm(e,r+345,155,c)||this.needPax:(this.needPax=hm(e,r+345,130,c)||this.needPax,this.needPax=v6(e,r+476,12,this.atime)||this.needPax,this.needPax=v6(e,r+488,12,this.ctime)||this.needPax);let f=8*32;for(let p=r;p<r+148;p++)f+=e[p];for(let p=r+156;p<r+512;p++)f+=e[p];return this.cksum=f,T0(e,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let r in e)e[r]!==null&&e[r]!==void 0&&(this[r]=e[r])}get type(){return C6.name.get(this[zl])||this[zl]}get typeKey(){return this[zl]}set type(e){C6.code.has(e)?this[zl]=C6.code.get(e):this[zl]=e}},Nit=(t,e)=>{let s=t,a=\"\",n,c=TI.parse(t).root||\".\";if(Buffer.byteLength(s)<100)n=[s,a,!1];else{a=TI.dirname(s),s=TI.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(a)<=e?n=[s,a,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(a)<=e?n=[s.substr(0,99),a,!0]:(s=TI.join(TI.basename(a),s),a=TI.dirname(a));while(a!==c&&!n);n||(n=[t.substr(0,99),\"\",!0])}return n},pm=(t,e,r)=>t.slice(e,e+r).toString(\"utf8\").replace(/\\0.*/,\"\"),B6=(t,e,r)=>Oit(Q0(t,e,r)),Oit=t=>t===null?null:new Date(t*1e3),Q0=(t,e,r)=>t[e]&128?The.parse(t.slice(e,e+r)):Mit(t,e,r),Lit=t=>isNaN(t)?null:t,Mit=(t,e,r)=>Lit(parseInt(t.slice(e,e+r).toString(\"utf8\").replace(/\\0.*$/,\"\").trim(),8)),Uit={12:8589934591,8:2097151},T0=(t,e,r,s)=>s===null?!1:s>Uit[r]||s<0?(The.encode(s,t.slice(e,e+r)),!0):(_it(t,e,r,s),!1),_it=(t,e,r,s)=>t.write(Hit(s,r),e,r,\"ascii\"),Hit=(t,e)=>jit(Math.floor(t).toString(8),e),jit=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join(\"0\")+t+\" \")+\"\\0\",v6=(t,e,r,s)=>s===null?!1:T0(t,e,r,s.getTime()/1e3),Git=new Array(156).join(\"\\0\"),hm=(t,e,r,s)=>s===null?!1:(t.write(s+Git,e,r,\"utf8\"),s.length!==Buffer.byteLength(s)||s.length>r);Rhe.exports=S6});var KT=_((o3t,Fhe)=>{\"use strict\";var qit=RI(),Wit=Ie(\"path\"),Sv=class{constructor(e,r){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=r||!1}encode(){let e=this.encodeBody();if(e===\"\")return null;let r=Buffer.byteLength(e),s=512*Math.ceil(1+r/512),a=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)a[n]=0;new qit({path:(\"PaxHeader/\"+Wit.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?\"GlobalExtendedHeader\":\"ExtendedHeader\",linkpath:\"\",uname:this.uname||\"\",gname:this.gname||\"\",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(a),a.write(e,512,r,\"utf8\");for(let n=r+512;n<a.length;n++)a[n]=0;return a}encodeBody(){return this.encodeField(\"path\")+this.encodeField(\"ctime\")+this.encodeField(\"atime\")+this.encodeField(\"dev\")+this.encodeField(\"ino\")+this.encodeField(\"nlink\")+this.encodeField(\"charset\")+this.encodeField(\"comment\")+this.encodeField(\"gid\")+this.encodeField(\"gname\")+this.encodeField(\"linkpath\")+this.encodeField(\"mtime\")+this.encodeField(\"size\")+this.encodeField(\"uid\")+this.encodeField(\"uname\")}encodeField(e){if(this[e]===null||this[e]===void 0)return\"\";let r=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=\" \"+(e===\"dev\"||e===\"ino\"||e===\"nlink\"?\"SCHILY.\":\"\")+e+\"=\"+r+`\n`,a=Buffer.byteLength(s),n=Math.floor(Math.log(a)/Math.log(10))+1;return a+n>=Math.pow(10,n)&&(n+=1),n+a+s}};Sv.parse=(t,e,r)=>new Sv(Yit(Vit(t),e),r);var Yit=(t,e)=>e?Object.keys(t).reduce((r,s)=>(r[s]=t[s],r),e):t,Vit=t=>t.replace(/\\n$/,\"\").split(`\n`).reduce(Jit,Object.create(null)),Jit=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+\" \").length);let s=e.split(\"=\"),a=s.shift().replace(/^SCHILY\\.(dev|ino|nlink)/,\"$1\");if(!a)return t;let n=s.join(\"=\");return t[a]=/^([A-Z]+\\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};Fhe.exports=Sv});var FI=_((a3t,Nhe)=>{Nhe.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)===\"/\";)r=e,e--;return r===-1?t:t.slice(0,r)}});var zT=_((l3t,Ohe)=>{\"use strict\";Ohe.exports=t=>class extends t{warn(e,r,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=r instanceof Error&&r.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(r instanceof Error&&(s=Object.assign(r,s),r=r.message),this.emit(\"warn\",s.tarCode,r,s)):r instanceof Error?this.emit(\"error\",Object.assign(r,s)):this.emit(\"error\",Object.assign(new Error(`${e}: ${r}`),s))}}});var b6=_((u3t,Lhe)=>{\"use strict\";var XT=[\"|\",\"<\",\">\",\"?\",\":\"],D6=XT.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),Kit=new Map(XT.map((t,e)=>[t,D6[e]])),zit=new Map(D6.map((t,e)=>[t,XT[e]]));Lhe.exports={encode:t=>XT.reduce((e,r)=>e.split(r).join(Kit.get(r)),t),decode:t=>D6.reduce((e,r)=>e.split(r).join(zit.get(r)),t)}});var P6=_((f3t,Uhe)=>{var{isAbsolute:Xit,parse:Mhe}=Ie(\"path\").win32;Uhe.exports=t=>{let e=\"\",r=Mhe(t);for(;Xit(t)||r.root;){let s=t.charAt(0)===\"/\"&&t.slice(0,4)!==\"//?/\"?\"/\":r.root;t=t.substr(s.length),e+=s,r=Mhe(t)}return[e,t]}});var Hhe=_((A3t,_he)=>{\"use strict\";_he.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var M6=_((g3t,t0e)=>{\"use strict\";var Jhe=PI(),Khe=KT(),zhe=RI(),nA=Ie(\"fs\"),jhe=Ie(\"path\"),rA=QI(),Zit=FI(),Xhe=(t,e)=>e?(t=rA(t).replace(/^\\.(\\/|$)/,\"\"),Zit(e)+\"/\"+t):rA(t),$it=16*1024*1024,Ghe=Symbol(\"process\"),qhe=Symbol(\"file\"),Whe=Symbol(\"directory\"),k6=Symbol(\"symlink\"),Yhe=Symbol(\"hardlink\"),Dv=Symbol(\"header\"),ZT=Symbol(\"read\"),Q6=Symbol(\"lstat\"),$T=Symbol(\"onlstat\"),T6=Symbol(\"onread\"),R6=Symbol(\"onreadlink\"),F6=Symbol(\"openfile\"),N6=Symbol(\"onopenfile\"),R0=Symbol(\"close\"),eR=Symbol(\"mode\"),O6=Symbol(\"awaitDrain\"),x6=Symbol(\"ondrain\"),iA=Symbol(\"prefix\"),Vhe=Symbol(\"hadError\"),Zhe=zT(),est=b6(),$he=P6(),e0e=Hhe(),tR=Zhe(class extends Jhe{constructor(e,r){if(r=r||{},super(r),typeof e!=\"string\")throw new TypeError(\"path is required\");this.path=rA(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||\"\",this.maxReadSize=r.maxReadSize||$it,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=rA(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?rA(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn==\"function\"&&this.on(\"warn\",r.onwarn);let s=!1;if(!this.preservePaths){let[a,n]=$he(this.path);a&&(this.path=n,s=a)}this.win32=!!r.win32||process.platform===\"win32\",this.win32&&(this.path=est.decode(this.path.replace(/\\\\/g,\"/\")),e=e.replace(/\\\\/g,\"/\")),this.absolute=rA(r.absolute||jhe.resolve(this.cwd,e)),this.path===\"\"&&(this.path=\"./\"),s&&this.warn(\"TAR_ENTRY_INFO\",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[$T](this.statCache.get(this.absolute)):this[Q6]()}emit(e,...r){return e===\"error\"&&(this[Vhe]=!0),super.emit(e,...r)}[Q6](){nA.lstat(this.absolute,(e,r)=>{if(e)return this.emit(\"error\",e);this[$T](r)})}[$T](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=rst(e),this.emit(\"stat\",e),this[Ghe]()}[Ghe](){switch(this.type){case\"File\":return this[qhe]();case\"Directory\":return this[Whe]();case\"SymbolicLink\":return this[k6]();default:return this.end()}}[eR](e){return e0e(e,this.type===\"Directory\",this.portable)}[iA](e){return Xhe(e,this.prefix)}[Dv](){this.type===\"Directory\"&&this.portable&&(this.noMtime=!0),this.header=new zhe({path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,mode:this[eR](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:\"\",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Khe({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Whe](){this.path.substr(-1)!==\"/\"&&(this.path+=\"/\"),this.stat.size=0,this[Dv](),this.end()}[k6](){nA.readlink(this.absolute,(e,r)=>{if(e)return this.emit(\"error\",e);this[R6](r)})}[R6](e){this.linkpath=rA(e),this[Dv](),this.end()}[Yhe](e){this.type=\"Link\",this.linkpath=rA(jhe.relative(this.cwd,e)),this.stat.size=0,this[Dv](),this.end()}[qhe](){if(this.stat.nlink>1){let e=this.stat.dev+\":\"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[Yhe](r)}this.linkCache.set(e,this.absolute)}if(this[Dv](),this.stat.size===0)return this.end();this[F6]()}[F6](){nA.open(this.absolute,\"r\",(e,r)=>{if(e)return this.emit(\"error\",e);this[N6](r)})}[N6](e){if(this.fd=e,this[Vhe])return this[R0]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ZT]()}[ZT](){let{fd:e,buf:r,offset:s,length:a,pos:n}=this;nA.read(e,r,s,a,n,(c,f)=>{if(c)return this[R0](()=>this.emit(\"error\",c));this[T6](f)})}[R0](e){nA.close(this.fd,e)}[T6](e){if(e<=0&&this.remain>0){let a=new Error(\"encountered unexpected EOF\");return a.path=this.absolute,a.syscall=\"read\",a.code=\"EOF\",this[R0](()=>this.emit(\"error\",a))}if(e>this.remain){let a=new Error(\"did not encounter expected EOF\");return a.path=this.absolute,a.syscall=\"read\",a.code=\"EOF\",this[R0](()=>this.emit(\"error\",a))}if(e===this.remain)for(let a=e;a<this.length&&e<this.blockRemain;a++)this.buf[a+this.offset]=0,e++,this.remain++;let r=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(r)?this[x6]():this[O6](()=>this[x6]())}[O6](e){this.once(\"drain\",e)}write(e){if(this.blockRemain<e.length){let r=new Error(\"writing more data than expected\");return r.path=this.absolute,this.emit(\"error\",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[x6](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[R0](e=>e?this.emit(\"error\",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ZT]()}}),L6=class extends tR{[Q6](){this[$T](nA.lstatSync(this.absolute))}[k6](){this[R6](nA.readlinkSync(this.absolute))}[F6](){this[N6](nA.openSync(this.absolute,\"r\"))}[ZT](){let e=!0;try{let{fd:r,buf:s,offset:a,length:n,pos:c}=this,f=nA.readSync(r,s,a,n,c);this[T6](f),e=!1}finally{if(e)try{this[R0](()=>{})}catch{}}}[O6](e){e()}[R0](e){nA.closeSync(this.fd),e()}},tst=Zhe(class extends Jhe{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type===\"Directory\"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=rA(e.path),this.mode=this[eR](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=rA(e.linkpath),typeof r.onwarn==\"function\"&&this.on(\"warn\",r.onwarn);let s=!1;if(!this.preservePaths){let[a,n]=$he(this.path);a&&(this.path=n,s=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new zhe({path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn(\"TAR_ENTRY_INFO\",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Khe({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[iA](e){return Xhe(e,this.prefix)}[eR](e){return e0e(e,this.type===\"Directory\",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error(\"writing more to entry than is appropriate\");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});tR.Sync=L6;tR.Tar=tst;var rst=t=>t.isFile()?\"File\":t.isDirectory()?\"Directory\":t.isSymbolicLink()?\"SymbolicLink\":\"Unsupported\";t0e.exports=tR});var uR=_((m3t,l0e)=>{\"use strict\";var lR=class{constructor(e,r){this.path=e||\"./\",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},nst=PI(),ist=m6(),sst=VT(),V6=M6(),ost=V6.Sync,ast=V6.Tar,lst=$x(),r0e=Buffer.alloc(1024),iR=Symbol(\"onStat\"),rR=Symbol(\"ended\"),sA=Symbol(\"queue\"),NI=Symbol(\"current\"),gm=Symbol(\"process\"),nR=Symbol(\"processing\"),n0e=Symbol(\"processJob\"),oA=Symbol(\"jobs\"),U6=Symbol(\"jobDone\"),sR=Symbol(\"addFSEntry\"),i0e=Symbol(\"addTarEntry\"),G6=Symbol(\"stat\"),q6=Symbol(\"readdir\"),oR=Symbol(\"onreaddir\"),aR=Symbol(\"pipe\"),s0e=Symbol(\"entry\"),_6=Symbol(\"entryOpt\"),W6=Symbol(\"writeEntryClass\"),a0e=Symbol(\"write\"),H6=Symbol(\"ondrain\"),cR=Ie(\"fs\"),o0e=Ie(\"path\"),cst=zT(),j6=QI(),J6=cst(class extends nst{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||\"\",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=j6(e.prefix||\"\"),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[W6]=V6,typeof e.onwarn==\"function\"&&this.on(\"warn\",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!=\"object\"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ist.Gzip(e.gzip),this.zip.on(\"data\",r=>super.write(r)),this.zip.on(\"end\",r=>super.end()),this.zip.on(\"drain\",r=>this[H6]()),this.on(\"resume\",r=>this.zip.resume())):this.on(\"drain\",this[H6]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter==\"function\"?e.filter:r=>!0,this[sA]=new lst,this[oA]=0,this.jobs=+e.jobs||4,this[nR]=!1,this[rR]=!1}[a0e](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[rR]=!0,this[gm](),this}write(e){if(this[rR])throw new Error(\"write after end\");return e instanceof sst?this[i0e](e):this[sR](e),this.flowing}[i0e](e){let r=j6(o0e.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new lR(e.path,r,!1);s.entry=new ast(e,this[_6](s)),s.entry.on(\"end\",a=>this[U6](s)),this[oA]+=1,this[sA].push(s)}this[gm]()}[sR](e){let r=j6(o0e.resolve(this.cwd,e));this[sA].push(new lR(e,r)),this[gm]()}[G6](e){e.pending=!0,this[oA]+=1;let r=this.follow?\"stat\":\"lstat\";cR[r](e.absolute,(s,a)=>{e.pending=!1,this[oA]-=1,s?this.emit(\"error\",s):this[iR](e,a)})}[iR](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[gm]()}[q6](e){e.pending=!0,this[oA]+=1,cR.readdir(e.absolute,(r,s)=>{if(e.pending=!1,this[oA]-=1,r)return this.emit(\"error\",r);this[oR](e,s)})}[oR](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[gm]()}[gm](){if(!this[nR]){this[nR]=!0;for(let e=this[sA].head;e!==null&&this[oA]<this.jobs;e=e.next)if(this[n0e](e.value),e.value.ignore){let r=e.next;this[sA].removeNode(e),e.next=r}this[nR]=!1,this[rR]&&!this[sA].length&&this[oA]===0&&(this.zip?this.zip.end(r0e):(super.write(r0e),super.end()))}}get[NI](){return this[sA]&&this[sA].head&&this[sA].head.value}[U6](e){this[sA].shift(),this[oA]-=1,this[gm]()}[n0e](e){if(!e.pending){if(e.entry){e===this[NI]&&!e.piped&&this[aR](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[iR](e,this.statCache.get(e.absolute)):this[G6](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[oR](e,this.readdirCache.get(e.absolute)):this[q6](e),!e.readdir))){if(e.entry=this[s0e](e),!e.entry){e.ignore=!0;return}e===this[NI]&&!e.piped&&this[aR](e)}}}[_6](e){return{onwarn:(r,s,a)=>this.warn(r,s,a),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[s0e](e){this[oA]+=1;try{return new this[W6](e.path,this[_6](e)).on(\"end\",()=>this[U6](e)).on(\"error\",r=>this.emit(\"error\",r))}catch(r){this.emit(\"error\",r)}}[H6](){this[NI]&&this[NI].entry&&this[NI].entry.resume()}[aR](e){e.piped=!0,e.readdir&&e.readdir.forEach(a=>{let n=e.path,c=n===\"./\"?\"\":n.replace(/\\/*$/,\"/\");this[sR](c+a)});let r=e.entry,s=this.zip;s?r.on(\"data\",a=>{s.write(a)||r.pause()}):r.on(\"data\",a=>{super.write(a)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Y6=class extends J6{constructor(e){super(e),this[W6]=ost}pause(){}resume(){}[G6](e){let r=this.follow?\"statSync\":\"lstatSync\";this[iR](e,cR[r](e.absolute))}[q6](e,r){this[oR](e,cR.readdirSync(e.absolute))}[aR](e){let r=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(a=>{let n=e.path,c=n===\"./\"?\"\":n.replace(/\\/*$/,\"/\");this[sR](c+a)}),s?r.on(\"data\",a=>{s.write(a)}):r.on(\"data\",a=>{super[a0e](a)})}};J6.Sync=Y6;l0e.exports=J6});var GI=_(Pv=>{\"use strict\";var ust=PI(),fst=Ie(\"events\").EventEmitter,fl=Ie(\"fs\"),X6=fl.writev;if(!X6){let t=process.binding(\"fs\"),e=t.FSReqWrap||t.FSReqCallback;X6=(r,s,a,n)=>{let c=(p,h)=>n(p,h,s),f=new e;f.oncomplete=c,t.writeBuffers(r,s,a,f)}}var HI=Symbol(\"_autoClose\"),Yu=Symbol(\"_close\"),bv=Symbol(\"_ended\"),ii=Symbol(\"_fd\"),c0e=Symbol(\"_finished\"),N0=Symbol(\"_flags\"),K6=Symbol(\"_flush\"),Z6=Symbol(\"_handleChunk\"),$6=Symbol(\"_makeBuf\"),gR=Symbol(\"_mode\"),fR=Symbol(\"_needDrain\"),UI=Symbol(\"_onerror\"),jI=Symbol(\"_onopen\"),z6=Symbol(\"_onread\"),LI=Symbol(\"_onwrite\"),O0=Symbol(\"_open\"),Wp=Symbol(\"_path\"),dm=Symbol(\"_pos\"),aA=Symbol(\"_queue\"),MI=Symbol(\"_read\"),u0e=Symbol(\"_readSize\"),F0=Symbol(\"_reading\"),AR=Symbol(\"_remain\"),f0e=Symbol(\"_size\"),pR=Symbol(\"_write\"),OI=Symbol(\"_writing\"),hR=Symbol(\"_defaultFlag\"),_I=Symbol(\"_errored\"),dR=class extends ust{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!=\"string\")throw new TypeError(\"path must be a string\");this[_I]=!1,this[ii]=typeof r.fd==\"number\"?r.fd:null,this[Wp]=e,this[u0e]=r.readSize||16*1024*1024,this[F0]=!1,this[f0e]=typeof r.size==\"number\"?r.size:1/0,this[AR]=this[f0e],this[HI]=typeof r.autoClose==\"boolean\"?r.autoClose:!0,typeof this[ii]==\"number\"?this[MI]():this[O0]()}get fd(){return this[ii]}get path(){return this[Wp]}write(){throw new TypeError(\"this is a readable stream\")}end(){throw new TypeError(\"this is a readable stream\")}[O0](){fl.open(this[Wp],\"r\",(e,r)=>this[jI](e,r))}[jI](e,r){e?this[UI](e):(this[ii]=r,this.emit(\"open\",r),this[MI]())}[$6](){return Buffer.allocUnsafe(Math.min(this[u0e],this[AR]))}[MI](){if(!this[F0]){this[F0]=!0;let e=this[$6]();if(e.length===0)return process.nextTick(()=>this[z6](null,0,e));fl.read(this[ii],e,0,e.length,null,(r,s,a)=>this[z6](r,s,a))}}[z6](e,r,s){this[F0]=!1,e?this[UI](e):this[Z6](r,s)&&this[MI]()}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.close(e,r=>r?this.emit(\"error\",r):this.emit(\"close\"))}}[UI](e){this[F0]=!0,this[Yu](),this.emit(\"error\",e)}[Z6](e,r){let s=!1;return this[AR]-=e,e>0&&(s=super.write(e<r.length?r.slice(0,e):r)),(e===0||this[AR]<=0)&&(s=!1,this[Yu](),super.end()),s}emit(e,r){switch(e){case\"prefinish\":case\"finish\":break;case\"drain\":typeof this[ii]==\"number\"&&this[MI]();break;case\"error\":return this[_I]?void 0:(this[_I]=!0,super.emit(e,r));default:return super.emit(e,r)}}},eG=class extends dR{[O0](){let e=!0;try{this[jI](null,fl.openSync(this[Wp],\"r\")),e=!1}finally{e&&this[Yu]()}}[MI](){let e=!0;try{if(!this[F0]){this[F0]=!0;do{let r=this[$6](),s=r.length===0?0:fl.readSync(this[ii],r,0,r.length,null);if(!this[Z6](s,r))break}while(!0);this[F0]=!1}e=!1}finally{e&&this[Yu]()}}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.closeSync(e),this.emit(\"close\")}}},mR=class extends fst{constructor(e,r){r=r||{},super(r),this.readable=!1,this.writable=!0,this[_I]=!1,this[OI]=!1,this[bv]=!1,this[fR]=!1,this[aA]=[],this[Wp]=e,this[ii]=typeof r.fd==\"number\"?r.fd:null,this[gR]=r.mode===void 0?438:r.mode,this[dm]=typeof r.start==\"number\"?r.start:null,this[HI]=typeof r.autoClose==\"boolean\"?r.autoClose:!0;let s=this[dm]!==null?\"r+\":\"w\";this[hR]=r.flags===void 0,this[N0]=this[hR]?s:r.flags,this[ii]===null&&this[O0]()}emit(e,r){if(e===\"error\"){if(this[_I])return;this[_I]=!0}return super.emit(e,r)}get fd(){return this[ii]}get path(){return this[Wp]}[UI](e){this[Yu](),this[OI]=!0,this.emit(\"error\",e)}[O0](){fl.open(this[Wp],this[N0],this[gR],(e,r)=>this[jI](e,r))}[jI](e,r){this[hR]&&this[N0]===\"r+\"&&e&&e.code===\"ENOENT\"?(this[N0]=\"w\",this[O0]()):e?this[UI](e):(this[ii]=r,this.emit(\"open\",r),this[K6]())}end(e,r){return e&&this.write(e,r),this[bv]=!0,!this[OI]&&!this[aA].length&&typeof this[ii]==\"number\"&&this[LI](null,0),this}write(e,r){return typeof e==\"string\"&&(e=Buffer.from(e,r)),this[bv]?(this.emit(\"error\",new Error(\"write() after end()\")),!1):this[ii]===null||this[OI]||this[aA].length?(this[aA].push(e),this[fR]=!0,!1):(this[OI]=!0,this[pR](e),!0)}[pR](e){fl.write(this[ii],e,0,e.length,this[dm],(r,s)=>this[LI](r,s))}[LI](e,r){e?this[UI](e):(this[dm]!==null&&(this[dm]+=r),this[aA].length?this[K6]():(this[OI]=!1,this[bv]&&!this[c0e]?(this[c0e]=!0,this[Yu](),this.emit(\"finish\")):this[fR]&&(this[fR]=!1,this.emit(\"drain\"))))}[K6](){if(this[aA].length===0)this[bv]&&this[LI](null,0);else if(this[aA].length===1)this[pR](this[aA].pop());else{let e=this[aA];this[aA]=[],X6(this[ii],e,this[dm],(r,s)=>this[LI](r,s))}}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.close(e,r=>r?this.emit(\"error\",r):this.emit(\"close\"))}}},tG=class extends mR{[O0](){let e;if(this[hR]&&this[N0]===\"r+\")try{e=fl.openSync(this[Wp],this[N0],this[gR])}catch(r){if(r.code===\"ENOENT\")return this[N0]=\"w\",this[O0]();throw r}else e=fl.openSync(this[Wp],this[N0],this[gR]);this[jI](null,e)}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.closeSync(e),this.emit(\"close\")}}[pR](e){let r=!0;try{this[LI](null,fl.writeSync(this[ii],e,0,e.length,this[dm])),r=!1}finally{if(r)try{this[Yu]()}catch{}}}};Pv.ReadStream=dR;Pv.ReadStreamSync=eG;Pv.WriteStream=mR;Pv.WriteStreamSync=tG});var vR=_((I3t,y0e)=>{\"use strict\";var Ast=zT(),pst=RI(),hst=Ie(\"events\"),gst=$x(),dst=1024*1024,mst=VT(),A0e=KT(),yst=m6(),rG=Buffer.from([31,139]),Lc=Symbol(\"state\"),mm=Symbol(\"writeEntry\"),Yp=Symbol(\"readEntry\"),nG=Symbol(\"nextEntry\"),p0e=Symbol(\"processEntry\"),Mc=Symbol(\"extendedHeader\"),xv=Symbol(\"globalExtendedHeader\"),L0=Symbol(\"meta\"),h0e=Symbol(\"emitMeta\"),Di=Symbol(\"buffer\"),Vp=Symbol(\"queue\"),ym=Symbol(\"ended\"),g0e=Symbol(\"emittedEnd\"),Em=Symbol(\"emit\"),Al=Symbol(\"unzip\"),yR=Symbol(\"consumeChunk\"),ER=Symbol(\"consumeChunkSub\"),iG=Symbol(\"consumeBody\"),d0e=Symbol(\"consumeMeta\"),m0e=Symbol(\"consumeHeader\"),IR=Symbol(\"consuming\"),sG=Symbol(\"bufferConcat\"),oG=Symbol(\"maybeEnd\"),kv=Symbol(\"writing\"),M0=Symbol(\"aborted\"),CR=Symbol(\"onDone\"),Im=Symbol(\"sawValidEntry\"),wR=Symbol(\"sawNullBlock\"),BR=Symbol(\"sawEOF\"),Est=t=>!0;y0e.exports=Ast(class extends hst{constructor(e){e=e||{},super(e),this.file=e.file||\"\",this[Im]=null,this.on(CR,r=>{(this[Lc]===\"begin\"||this[Im]===!1)&&this.warn(\"TAR_BAD_ARCHIVE\",\"Unrecognized archive format\")}),e.ondone?this.on(CR,e.ondone):this.on(CR,r=>{this.emit(\"prefinish\"),this.emit(\"finish\"),this.emit(\"end\"),this.emit(\"close\")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||dst,this.filter=typeof e.filter==\"function\"?e.filter:Est,this.writable=!0,this.readable=!1,this[Vp]=new gst,this[Di]=null,this[Yp]=null,this[mm]=null,this[Lc]=\"begin\",this[L0]=\"\",this[Mc]=null,this[xv]=null,this[ym]=!1,this[Al]=null,this[M0]=!1,this[wR]=!1,this[BR]=!1,typeof e.onwarn==\"function\"&&this.on(\"warn\",e.onwarn),typeof e.onentry==\"function\"&&this.on(\"entry\",e.onentry)}[m0e](e,r){this[Im]===null&&(this[Im]=!1);let s;try{s=new pst(e,r,this[Mc],this[xv])}catch(a){return this.warn(\"TAR_ENTRY_INVALID\",a)}if(s.nullBlock)this[wR]?(this[BR]=!0,this[Lc]===\"begin\"&&(this[Lc]=\"header\"),this[Em](\"eof\")):(this[wR]=!0,this[Em](\"nullBlock\"));else if(this[wR]=!1,!s.cksumValid)this.warn(\"TAR_ENTRY_INVALID\",\"checksum failure\",{header:s});else if(!s.path)this.warn(\"TAR_ENTRY_INVALID\",\"path is required\",{header:s});else{let a=s.type;if(/^(Symbolic)?Link$/.test(a)&&!s.linkpath)this.warn(\"TAR_ENTRY_INVALID\",\"linkpath required\",{header:s});else if(!/^(Symbolic)?Link$/.test(a)&&s.linkpath)this.warn(\"TAR_ENTRY_INVALID\",\"linkpath forbidden\",{header:s});else{let n=this[mm]=new mst(s,this[Mc],this[xv]);if(!this[Im])if(n.remain){let c=()=>{n.invalid||(this[Im]=!0)};n.on(\"end\",c)}else this[Im]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Em](\"ignoredEntry\",n),this[Lc]=\"ignore\",n.resume()):n.size>0&&(this[L0]=\"\",n.on(\"data\",c=>this[L0]+=c),this[Lc]=\"meta\"):(this[Mc]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Em](\"ignoredEntry\",n),this[Lc]=n.remain?\"ignore\":\"header\",n.resume()):(n.remain?this[Lc]=\"body\":(this[Lc]=\"header\",n.end()),this[Yp]?this[Vp].push(n):(this[Vp].push(n),this[nG]())))}}}[p0e](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Yp]=e,this.emit(\"entry\",e),e.emittedEnd||(e.on(\"end\",s=>this[nG]()),r=!1)):(this[Yp]=null,r=!1),r}[nG](){do;while(this[p0e](this[Vp].shift()));if(!this[Vp].length){let e=this[Yp];!e||e.flowing||e.size===e.remain?this[kv]||this.emit(\"drain\"):e.once(\"drain\",s=>this.emit(\"drain\"))}}[iG](e,r){let s=this[mm],a=s.blockRemain,n=a>=e.length&&r===0?e:e.slice(r,r+a);return s.write(n),s.blockRemain||(this[Lc]=\"header\",this[mm]=null,s.end()),n.length}[d0e](e,r){let s=this[mm],a=this[iG](e,r);return this[mm]||this[h0e](s),a}[Em](e,r,s){!this[Vp].length&&!this[Yp]?this.emit(e,r,s):this[Vp].push([e,r,s])}[h0e](e){switch(this[Em](\"meta\",this[L0]),e.type){case\"ExtendedHeader\":case\"OldExtendedHeader\":this[Mc]=A0e.parse(this[L0],this[Mc],!1);break;case\"GlobalExtendedHeader\":this[xv]=A0e.parse(this[L0],this[xv],!0);break;case\"NextFileHasLongPath\":case\"OldGnuLongPath\":this[Mc]=this[Mc]||Object.create(null),this[Mc].path=this[L0].replace(/\\0.*/,\"\");break;case\"NextFileHasLongLinkpath\":this[Mc]=this[Mc]||Object.create(null),this[Mc].linkpath=this[L0].replace(/\\0.*/,\"\");break;default:throw new Error(\"unknown meta: \"+e.type)}}abort(e){this[M0]=!0,this.emit(\"abort\",e),this.warn(\"TAR_ABORT\",e,{recoverable:!1})}write(e){if(this[M0])return;if(this[Al]===null&&e){if(this[Di]&&(e=Buffer.concat([this[Di],e]),this[Di]=null),e.length<rG.length)return this[Di]=e,!0;for(let s=0;this[Al]===null&&s<rG.length;s++)e[s]!==rG[s]&&(this[Al]=!1);if(this[Al]===null){let s=this[ym];this[ym]=!1,this[Al]=new yst.Unzip,this[Al].on(\"data\",n=>this[yR](n)),this[Al].on(\"error\",n=>this.abort(n)),this[Al].on(\"end\",n=>{this[ym]=!0,this[yR]()}),this[kv]=!0;let a=this[Al][s?\"end\":\"write\"](e);return this[kv]=!1,a}}this[kv]=!0,this[Al]?this[Al].write(e):this[yR](e),this[kv]=!1;let r=this[Vp].length?!1:this[Yp]?this[Yp].flowing:!0;return!r&&!this[Vp].length&&this[Yp].once(\"drain\",s=>this.emit(\"drain\")),r}[sG](e){e&&!this[M0]&&(this[Di]=this[Di]?Buffer.concat([this[Di],e]):e)}[oG](){if(this[ym]&&!this[g0e]&&!this[M0]&&!this[IR]){this[g0e]=!0;let e=this[mm];if(e&&e.blockRemain){let r=this[Di]?this[Di].length:0;this.warn(\"TAR_BAD_ARCHIVE\",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[Di]&&e.write(this[Di]),e.end()}this[Em](CR)}}[yR](e){if(this[IR])this[sG](e);else if(!e&&!this[Di])this[oG]();else{if(this[IR]=!0,this[Di]){this[sG](e);let r=this[Di];this[Di]=null,this[ER](r)}else this[ER](e);for(;this[Di]&&this[Di].length>=512&&!this[M0]&&!this[BR];){let r=this[Di];this[Di]=null,this[ER](r)}this[IR]=!1}(!this[Di]||this[ym])&&this[oG]()}[ER](e){let r=0,s=e.length;for(;r+512<=s&&!this[M0]&&!this[BR];)switch(this[Lc]){case\"begin\":case\"header\":this[m0e](e,r),r+=512;break;case\"ignore\":case\"body\":r+=this[iG](e,r);break;case\"meta\":r+=this[d0e](e,r);break;default:throw new Error(\"invalid state: \"+this[Lc])}r<s&&(this[Di]?this[Di]=Buffer.concat([e.slice(r),this[Di]]):this[Di]=e.slice(r))}end(e){this[M0]||(this[Al]?this[Al].end(e):(this[ym]=!0,this.write(e)))}})});var SR=_((C3t,w0e)=>{\"use strict\";var Ist=DI(),I0e=vR(),qI=Ie(\"fs\"),Cst=GI(),E0e=Ie(\"path\"),aG=FI();w0e.exports=(t,e,r)=>{typeof t==\"function\"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e==\"function\"&&(r=e,e=null),e?e=Array.from(e):e=[];let s=Ist(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return e.length&&Bst(s,e),s.noResume||wst(s),s.file&&s.sync?vst(s):s.file?Sst(s,r):C0e(s)};var wst=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},Bst=(t,e)=>{let r=new Map(e.map(n=>[aG(n),!0])),s=t.filter,a=(n,c)=>{let f=c||E0e.parse(n).root||\".\",p=n===f?!1:r.has(n)?r.get(n):a(E0e.dirname(n),f);return r.set(n,p),p};t.filter=s?(n,c)=>s(n,c)&&a(aG(n)):n=>a(aG(n))},vst=t=>{let e=C0e(t),r=t.file,s=!0,a;try{let n=qI.statSync(r),c=t.maxReadSize||16*1024*1024;if(n.size<c)e.end(qI.readFileSync(r));else{let f=0,p=Buffer.allocUnsafe(c);for(a=qI.openSync(r,\"r\");f<n.size;){let h=qI.readSync(a,p,0,c,f);f+=h,e.write(p.slice(0,h))}e.end()}s=!1}finally{if(s&&a)try{qI.closeSync(a)}catch{}}},Sst=(t,e)=>{let r=new I0e(t),s=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((c,f)=>{r.on(\"error\",f),r.on(\"end\",c),qI.stat(a,(p,h)=>{if(p)f(p);else{let E=new Cst.ReadStream(a,{readSize:s,size:h.size});E.on(\"error\",f),E.pipe(r)}})});return e?n.then(e,e):n},C0e=t=>new I0e(t)});var P0e=_((w3t,b0e)=>{\"use strict\";var Dst=DI(),DR=uR(),B0e=GI(),v0e=SR(),S0e=Ie(\"path\");b0e.exports=(t,e,r)=>{if(typeof e==\"function\"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");e=Array.from(e);let s=Dst(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return s.file&&s.sync?bst(s,e):s.file?Pst(s,e,r):s.sync?xst(s,e):kst(s,e)};var bst=(t,e)=>{let r=new DR.Sync(t),s=new B0e.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(s),D0e(r,e)},Pst=(t,e,r)=>{let s=new DR(t),a=new B0e.WriteStream(t.file,{mode:t.mode||438});s.pipe(a);let n=new Promise((c,f)=>{a.on(\"error\",f),a.on(\"close\",c),s.on(\"error\",f)});return lG(s,e),r?n.then(r,r):n},D0e=(t,e)=>{e.forEach(r=>{r.charAt(0)===\"@\"?v0e({file:S0e.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:s=>t.add(s)}):t.add(r)}),t.end()},lG=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)===\"@\")return v0e({file:S0e.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:s=>t.add(s)}).then(s=>lG(t,e));t.add(r)}t.end()},xst=(t,e)=>{let r=new DR.Sync(t);return D0e(r,e),r},kst=(t,e)=>{let r=new DR(t);return lG(r,e),r}});var cG=_((B3t,N0e)=>{\"use strict\";var Qst=DI(),x0e=uR(),Xl=Ie(\"fs\"),k0e=GI(),Q0e=SR(),T0e=Ie(\"path\"),R0e=RI();N0e.exports=(t,e,r)=>{let s=Qst(t);if(!s.file)throw new TypeError(\"file is required\");if(s.gzip)throw new TypeError(\"cannot append to compressed archives\");if(!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");return e=Array.from(e),s.sync?Tst(s,e):Fst(s,e,r)};var Tst=(t,e)=>{let r=new x0e.Sync(t),s=!0,a,n;try{try{a=Xl.openSync(t.file,\"r+\")}catch(p){if(p.code===\"ENOENT\")a=Xl.openSync(t.file,\"w+\");else throw p}let c=Xl.fstatSync(a),f=Buffer.alloc(512);e:for(n=0;n<c.size;n+=512){for(let E=0,C=0;E<512;E+=C){if(C=Xl.readSync(a,f,E,f.length-E,n+E),n===0&&f[0]===31&&f[1]===139)throw new Error(\"cannot append to compressed archives\");if(!C)break e}let p=new R0e(f);if(!p.cksumValid)break;let h=512*Math.ceil(p.size/512);if(n+h+512>c.size)break;n+=h,t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime)}s=!1,Rst(t,r,n,a,e)}finally{if(s)try{Xl.closeSync(a)}catch{}}},Rst=(t,e,r,s,a)=>{let n=new k0e.WriteStreamSync(t.file,{fd:s,start:r});e.pipe(n),Nst(e,a)},Fst=(t,e,r)=>{e=Array.from(e);let s=new x0e(t),a=(c,f,p)=>{let h=(I,R)=>{I?Xl.close(c,N=>p(I)):p(null,R)},E=0;if(f===0)return h(null,0);let C=0,S=Buffer.alloc(512),P=(I,R)=>{if(I)return h(I);if(C+=R,C<512&&R)return Xl.read(c,S,C,S.length-C,E+C,P);if(E===0&&S[0]===31&&S[1]===139)return h(new Error(\"cannot append to compressed archives\"));if(C<512)return h(null,E);let N=new R0e(S);if(!N.cksumValid)return h(null,E);let U=512*Math.ceil(N.size/512);if(E+U+512>f||(E+=U+512,E>=f))return h(null,E);t.mtimeCache&&t.mtimeCache.set(N.path,N.mtime),C=0,Xl.read(c,S,0,512,E,P)};Xl.read(c,S,0,512,E,P)},n=new Promise((c,f)=>{s.on(\"error\",f);let p=\"r+\",h=(E,C)=>{if(E&&E.code===\"ENOENT\"&&p===\"r+\")return p=\"w+\",Xl.open(t.file,p,h);if(E)return f(E);Xl.fstat(C,(S,P)=>{if(S)return Xl.close(C,()=>f(S));a(C,P.size,(I,R)=>{if(I)return f(I);let N=new k0e.WriteStream(t.file,{fd:C,start:R});s.pipe(N),N.on(\"error\",f),N.on(\"close\",c),F0e(s,e)})})};Xl.open(t.file,p,h)});return r?n.then(r,r):n},Nst=(t,e)=>{e.forEach(r=>{r.charAt(0)===\"@\"?Q0e({file:T0e.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:s=>t.add(s)}):t.add(r)}),t.end()},F0e=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)===\"@\")return Q0e({file:T0e.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:s=>t.add(s)}).then(s=>F0e(t,e));t.add(r)}t.end()}});var L0e=_((v3t,O0e)=>{\"use strict\";var Ost=DI(),Lst=cG();O0e.exports=(t,e,r)=>{let s=Ost(t);if(!s.file)throw new TypeError(\"file is required\");if(s.gzip)throw new TypeError(\"cannot append to compressed archives\");if(!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");return e=Array.from(e),Mst(s),Lst(s,e,r)};var Mst=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,s)=>e(r,s)&&!(t.mtimeCache.get(r)>s.mtime):(r,s)=>!(t.mtimeCache.get(r)>s.mtime)}});var _0e=_((S3t,U0e)=>{var{promisify:M0e}=Ie(\"util\"),U0=Ie(\"fs\"),Ust=t=>{if(!t)t={mode:511,fs:U0};else if(typeof t==\"object\")t={mode:511,fs:U0,...t};else if(typeof t==\"number\")t={mode:t,fs:U0};else if(typeof t==\"string\")t={mode:parseInt(t,8),fs:U0};else throw new TypeError(\"invalid options argument\");return t.mkdir=t.mkdir||t.fs.mkdir||U0.mkdir,t.mkdirAsync=M0e(t.mkdir),t.stat=t.stat||t.fs.stat||U0.stat,t.statAsync=M0e(t.stat),t.statSync=t.statSync||t.fs.statSync||U0.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||U0.mkdirSync,t};U0e.exports=Ust});var j0e=_((D3t,H0e)=>{var _st=process.platform,{resolve:Hst,parse:jst}=Ie(\"path\"),Gst=t=>{if(/\\0/.test(t))throw Object.assign(new TypeError(\"path must be a string without null bytes\"),{path:t,code:\"ERR_INVALID_ARG_VALUE\"});if(t=Hst(t),_st===\"win32\"){let e=/[*|\"<>?:]/,{root:r}=jst(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error(\"Illegal characters in path.\"),{path:t,code:\"EINVAL\"})}return t};H0e.exports=Gst});var V0e=_((b3t,Y0e)=>{var{dirname:G0e}=Ie(\"path\"),q0e=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(s=>s.isDirectory()?r:void 0,s=>s.code===\"ENOENT\"?q0e(t,G0e(e),e):void 0),W0e=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(s){return s.code===\"ENOENT\"?W0e(t,G0e(e),e):void 0}};Y0e.exports={findMade:q0e,findMadeSync:W0e}});var AG=_((P3t,K0e)=>{var{dirname:J0e}=Ie(\"path\"),uG=(t,e,r)=>{e.recursive=!1;let s=J0e(t);return s===t?e.mkdirAsync(t,e).catch(a=>{if(a.code!==\"EISDIR\")throw a}):e.mkdirAsync(t,e).then(()=>r||t,a=>{if(a.code===\"ENOENT\")return uG(s,e).then(n=>uG(t,e,n));if(a.code!==\"EEXIST\"&&a.code!==\"EROFS\")throw a;return e.statAsync(t).then(n=>{if(n.isDirectory())return r;throw a},()=>{throw a})})},fG=(t,e,r)=>{let s=J0e(t);if(e.recursive=!1,s===t)try{return e.mkdirSync(t,e)}catch(a){if(a.code!==\"EISDIR\")throw a;return}try{return e.mkdirSync(t,e),r||t}catch(a){if(a.code===\"ENOENT\")return fG(t,e,fG(s,e,r));if(a.code!==\"EEXIST\"&&a.code!==\"EROFS\")throw a;try{if(!e.statSync(t).isDirectory())throw a}catch{throw a}}};K0e.exports={mkdirpManual:uG,mkdirpManualSync:fG}});var Z0e=_((x3t,X0e)=>{var{dirname:z0e}=Ie(\"path\"),{findMade:qst,findMadeSync:Wst}=V0e(),{mkdirpManual:Yst,mkdirpManualSync:Vst}=AG(),Jst=(t,e)=>(e.recursive=!0,z0e(t)===t?e.mkdirAsync(t,e):qst(e,t).then(s=>e.mkdirAsync(t,e).then(()=>s).catch(a=>{if(a.code===\"ENOENT\")return Yst(t,e);throw a}))),Kst=(t,e)=>{if(e.recursive=!0,z0e(t)===t)return e.mkdirSync(t,e);let s=Wst(e,t);try{return e.mkdirSync(t,e),s}catch(a){if(a.code===\"ENOENT\")return Vst(t,e);throw a}};X0e.exports={mkdirpNative:Jst,mkdirpNativeSync:Kst}});var rge=_((k3t,tge)=>{var $0e=Ie(\"fs\"),zst=process.version,pG=zst.replace(/^v/,\"\").split(\".\"),ege=+pG[0]>10||+pG[0]==10&&+pG[1]>=12,Xst=ege?t=>t.mkdir===$0e.mkdir:()=>!1,Zst=ege?t=>t.mkdirSync===$0e.mkdirSync:()=>!1;tge.exports={useNative:Xst,useNativeSync:Zst}});var lge=_((Q3t,age)=>{var WI=_0e(),YI=j0e(),{mkdirpNative:nge,mkdirpNativeSync:ige}=Z0e(),{mkdirpManual:sge,mkdirpManualSync:oge}=AG(),{useNative:$st,useNativeSync:eot}=rge(),VI=(t,e)=>(t=YI(t),e=WI(e),$st(e)?nge(t,e):sge(t,e)),tot=(t,e)=>(t=YI(t),e=WI(e),eot(e)?ige(t,e):oge(t,e));VI.sync=tot;VI.native=(t,e)=>nge(YI(t),WI(e));VI.manual=(t,e)=>sge(YI(t),WI(e));VI.nativeSync=(t,e)=>ige(YI(t),WI(e));VI.manualSync=(t,e)=>oge(YI(t),WI(e));age.exports=VI});var gge=_((T3t,hge)=>{\"use strict\";var Uc=Ie(\"fs\"),Cm=Ie(\"path\"),rot=Uc.lchown?\"lchown\":\"chown\",not=Uc.lchownSync?\"lchownSync\":\"chownSync\",uge=Uc.lchown&&!process.version.match(/v1[1-9]+\\./)&&!process.version.match(/v10\\.[6-9]/),cge=(t,e,r)=>{try{return Uc[not](t,e,r)}catch(s){if(s.code!==\"ENOENT\")throw s}},iot=(t,e,r)=>{try{return Uc.chownSync(t,e,r)}catch(s){if(s.code!==\"ENOENT\")throw s}},sot=uge?(t,e,r,s)=>a=>{!a||a.code!==\"EISDIR\"?s(a):Uc.chown(t,e,r,s)}:(t,e,r,s)=>s,hG=uge?(t,e,r)=>{try{return cge(t,e,r)}catch(s){if(s.code!==\"EISDIR\")throw s;iot(t,e,r)}}:(t,e,r)=>cge(t,e,r),oot=process.version,fge=(t,e,r)=>Uc.readdir(t,e,r),aot=(t,e)=>Uc.readdirSync(t,e);/^v4\\./.test(oot)&&(fge=(t,e,r)=>Uc.readdir(t,r));var bR=(t,e,r,s)=>{Uc[rot](t,e,r,sot(t,e,r,a=>{s(a&&a.code!==\"ENOENT\"?a:null)}))},Age=(t,e,r,s,a)=>{if(typeof e==\"string\")return Uc.lstat(Cm.resolve(t,e),(n,c)=>{if(n)return a(n.code!==\"ENOENT\"?n:null);c.name=e,Age(t,c,r,s,a)});if(e.isDirectory())gG(Cm.resolve(t,e.name),r,s,n=>{if(n)return a(n);let c=Cm.resolve(t,e.name);bR(c,r,s,a)});else{let n=Cm.resolve(t,e.name);bR(n,r,s,a)}},gG=(t,e,r,s)=>{fge(t,{withFileTypes:!0},(a,n)=>{if(a){if(a.code===\"ENOENT\")return s();if(a.code!==\"ENOTDIR\"&&a.code!==\"ENOTSUP\")return s(a)}if(a||!n.length)return bR(t,e,r,s);let c=n.length,f=null,p=h=>{if(!f){if(h)return s(f=h);if(--c===0)return bR(t,e,r,s)}};n.forEach(h=>Age(t,h,e,r,p))})},lot=(t,e,r,s)=>{if(typeof e==\"string\")try{let a=Uc.lstatSync(Cm.resolve(t,e));a.name=e,e=a}catch(a){if(a.code===\"ENOENT\")return;throw a}e.isDirectory()&&pge(Cm.resolve(t,e.name),r,s),hG(Cm.resolve(t,e.name),r,s)},pge=(t,e,r)=>{let s;try{s=aot(t,{withFileTypes:!0})}catch(a){if(a.code===\"ENOENT\")return;if(a.code===\"ENOTDIR\"||a.code===\"ENOTSUP\")return hG(t,e,r);throw a}return s&&s.length&&s.forEach(a=>lot(t,a,e,r)),hG(t,e,r)};hge.exports=gG;gG.sync=pge});var Ege=_((R3t,dG)=>{\"use strict\";var dge=lge(),_c=Ie(\"fs\"),PR=Ie(\"path\"),mge=gge(),Vu=QI(),xR=class extends Error{constructor(e,r){super(\"Cannot extract through symbolic link\"),this.path=r,this.symlink=e}get name(){return\"SylinkError\"}},kR=class extends Error{constructor(e,r){super(r+\": Cannot cd into '\"+e+\"'\"),this.path=e,this.code=r}get name(){return\"CwdError\"}},QR=(t,e)=>t.get(Vu(e)),Qv=(t,e,r)=>t.set(Vu(e),r),cot=(t,e)=>{_c.stat(t,(r,s)=>{(r||!s.isDirectory())&&(r=new kR(t,r&&r.code||\"ENOTDIR\")),e(r)})};dG.exports=(t,e,r)=>{t=Vu(t);let s=e.umask,a=e.mode|448,n=(a&s)!==0,c=e.uid,f=e.gid,p=typeof c==\"number\"&&typeof f==\"number\"&&(c!==e.processUid||f!==e.processGid),h=e.preserve,E=e.unlink,C=e.cache,S=Vu(e.cwd),P=(N,U)=>{N?r(N):(Qv(C,t,!0),U&&p?mge(U,c,f,W=>P(W)):n?_c.chmod(t,a,r):r())};if(C&&QR(C,t)===!0)return P();if(t===S)return cot(t,P);if(h)return dge(t,{mode:a}).then(N=>P(null,N),P);let R=Vu(PR.relative(S,t)).split(\"/\");TR(S,R,a,C,E,S,null,P)};var TR=(t,e,r,s,a,n,c,f)=>{if(!e.length)return f(null,c);let p=e.shift(),h=Vu(PR.resolve(t+\"/\"+p));if(QR(s,h))return TR(h,e,r,s,a,n,c,f);_c.mkdir(h,r,yge(h,e,r,s,a,n,c,f))},yge=(t,e,r,s,a,n,c,f)=>p=>{p?_c.lstat(t,(h,E)=>{if(h)h.path=h.path&&Vu(h.path),f(h);else if(E.isDirectory())TR(t,e,r,s,a,n,c,f);else if(a)_c.unlink(t,C=>{if(C)return f(C);_c.mkdir(t,r,yge(t,e,r,s,a,n,c,f))});else{if(E.isSymbolicLink())return f(new xR(t,t+\"/\"+e.join(\"/\")));f(p)}}):(c=c||t,TR(t,e,r,s,a,n,c,f))},uot=t=>{let e=!1,r=\"ENOTDIR\";try{e=_c.statSync(t).isDirectory()}catch(s){r=s.code}finally{if(!e)throw new kR(t,r)}};dG.exports.sync=(t,e)=>{t=Vu(t);let r=e.umask,s=e.mode|448,a=(s&r)!==0,n=e.uid,c=e.gid,f=typeof n==\"number\"&&typeof c==\"number\"&&(n!==e.processUid||c!==e.processGid),p=e.preserve,h=e.unlink,E=e.cache,C=Vu(e.cwd),S=N=>{Qv(E,t,!0),N&&f&&mge.sync(N,n,c),a&&_c.chmodSync(t,s)};if(E&&QR(E,t)===!0)return S();if(t===C)return uot(C),S();if(p)return S(dge.sync(t,s));let I=Vu(PR.relative(C,t)).split(\"/\"),R=null;for(let N=I.shift(),U=C;N&&(U+=\"/\"+N);N=I.shift())if(U=Vu(PR.resolve(U)),!QR(E,U))try{_c.mkdirSync(U,s),R=R||U,Qv(E,U,!0)}catch{let ee=_c.lstatSync(U);if(ee.isDirectory()){Qv(E,U,!0);continue}else if(h){_c.unlinkSync(U),_c.mkdirSync(U,s),R=R||U,Qv(E,U,!0);continue}else if(ee.isSymbolicLink())return new xR(U,U+\"/\"+I.join(\"/\"))}return S(R)}});var yG=_((F3t,Ige)=>{var mG=Object.create(null),{hasOwnProperty:fot}=Object.prototype;Ige.exports=t=>(fot.call(mG,t)||(mG[t]=t.normalize(\"NFKD\")),mG[t])});var vge=_((N3t,Bge)=>{var Cge=Ie(\"assert\"),Aot=yG(),pot=FI(),{join:wge}=Ie(\"path\"),hot=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,got=hot===\"win32\";Bge.exports=()=>{let t=new Map,e=new Map,r=h=>h.split(\"/\").slice(0,-1).reduce((C,S)=>(C.length&&(S=wge(C[C.length-1],S)),C.push(S||\"/\"),C),[]),s=new Set,a=h=>{let E=e.get(h);if(!E)throw new Error(\"function does not have any path reservations\");return{paths:E.paths.map(C=>t.get(C)),dirs:[...E.dirs].map(C=>t.get(C))}},n=h=>{let{paths:E,dirs:C}=a(h);return E.every(S=>S[0]===h)&&C.every(S=>S[0]instanceof Set&&S[0].has(h))},c=h=>s.has(h)||!n(h)?!1:(s.add(h),h(()=>f(h)),!0),f=h=>{if(!s.has(h))return!1;let{paths:E,dirs:C}=e.get(h),S=new Set;return E.forEach(P=>{let I=t.get(P);Cge.equal(I[0],h),I.length===1?t.delete(P):(I.shift(),typeof I[0]==\"function\"?S.add(I[0]):I[0].forEach(R=>S.add(R)))}),C.forEach(P=>{let I=t.get(P);Cge(I[0]instanceof Set),I[0].size===1&&I.length===1?t.delete(P):I[0].size===1?(I.shift(),S.add(I[0])):I[0].delete(h)}),s.delete(h),S.forEach(P=>c(P)),!0};return{check:n,reserve:(h,E)=>{h=got?[\"win32 parallelization disabled\"]:h.map(S=>Aot(pot(wge(S))).toLowerCase());let C=new Set(h.map(S=>r(S)).reduce((S,P)=>S.concat(P)));return e.set(E,{dirs:C,paths:h}),h.forEach(S=>{let P=t.get(S);P?P.push(E):t.set(S,[E])}),C.forEach(S=>{let P=t.get(S);P?P[P.length-1]instanceof Set?P[P.length-1].add(E):P.push(new Set([E])):t.set(S,[new Set([E])])}),c(E)}}}});var bge=_((O3t,Dge)=>{var dot=process.platform,mot=dot===\"win32\",yot=global.__FAKE_TESTING_FS__||Ie(\"fs\"),{O_CREAT:Eot,O_TRUNC:Iot,O_WRONLY:Cot,UV_FS_O_FILEMAP:Sge=0}=yot.constants,wot=mot&&!!Sge,Bot=512*1024,vot=Sge|Iot|Eot|Cot;Dge.exports=wot?t=>t<Bot?vot:\"w\":()=>\"w\"});var bG=_((L3t,Hge)=>{\"use strict\";var Sot=Ie(\"assert\"),Dot=vR(),Mn=Ie(\"fs\"),bot=GI(),Jp=Ie(\"path\"),Mge=Ege(),Pge=b6(),Pot=vge(),xot=P6(),Zl=QI(),kot=FI(),Qot=yG(),xge=Symbol(\"onEntry\"),CG=Symbol(\"checkFs\"),kge=Symbol(\"checkFs2\"),NR=Symbol(\"pruneCache\"),wG=Symbol(\"isReusable\"),Hc=Symbol(\"makeFs\"),BG=Symbol(\"file\"),vG=Symbol(\"directory\"),OR=Symbol(\"link\"),Qge=Symbol(\"symlink\"),Tge=Symbol(\"hardlink\"),Rge=Symbol(\"unsupported\"),Fge=Symbol(\"checkPath\"),_0=Symbol(\"mkdir\"),Xo=Symbol(\"onError\"),RR=Symbol(\"pending\"),Nge=Symbol(\"pend\"),JI=Symbol(\"unpend\"),EG=Symbol(\"ended\"),IG=Symbol(\"maybeClose\"),SG=Symbol(\"skip\"),Tv=Symbol(\"doChown\"),Rv=Symbol(\"uid\"),Fv=Symbol(\"gid\"),Nv=Symbol(\"checkedCwd\"),Uge=Ie(\"crypto\"),_ge=bge(),Tot=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Ov=Tot===\"win32\",Rot=(t,e)=>{if(!Ov)return Mn.unlink(t,e);let r=t+\".DELETE.\"+Uge.randomBytes(16).toString(\"hex\");Mn.rename(t,r,s=>{if(s)return e(s);Mn.unlink(r,e)})},Fot=t=>{if(!Ov)return Mn.unlinkSync(t);let e=t+\".DELETE.\"+Uge.randomBytes(16).toString(\"hex\");Mn.renameSync(t,e),Mn.unlinkSync(e)},Oge=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,Lge=t=>Qot(kot(Zl(t))).toLowerCase(),Not=(t,e)=>{e=Lge(e);for(let r of t.keys()){let s=Lge(r);(s===e||s.indexOf(e+\"/\")===0)&&t.delete(r)}},Oot=t=>{for(let e of t.keys())t.delete(e)},Lv=class extends Dot{constructor(e){if(e||(e={}),e.ondone=r=>{this[EG]=!0,this[IG]()},super(e),this[Nv]=!1,this.reservations=Pot(),this.transform=typeof e.transform==\"function\"?e.transform:null,this.writable=!0,this.readable=!1,this[RR]=0,this[EG]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid==\"number\"||typeof e.gid==\"number\"){if(typeof e.uid!=\"number\"||typeof e.gid!=\"number\")throw new TypeError(\"cannot set owner without number uid and gid\");if(e.preserveOwner)throw new TypeError(\"cannot preserve owner in archive and also set owner explicitly\");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!=\"number\"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Ov,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=Zl(Jp.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask==\"number\"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on(\"entry\",r=>this[xge](r))}warn(e,r,s={}){return(e===\"TAR_BAD_ARCHIVE\"||e===\"TAR_ABORT\")&&(s.recoverable=!1),super.warn(e,r,s)}[IG](){this[EG]&&this[RR]===0&&(this.emit(\"prefinish\"),this.emit(\"finish\"),this.emit(\"end\"),this.emit(\"close\"))}[Fge](e){if(this.strip){let r=Zl(e.path).split(\"/\");if(r.length<this.strip)return!1;if(e.path=r.slice(this.strip).join(\"/\"),e.type===\"Link\"){let s=Zl(e.linkpath).split(\"/\");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join(\"/\");else return!1}}if(!this.preservePaths){let r=Zl(e.path),s=r.split(\"/\");if(s.includes(\"..\")||Ov&&/^[a-z]:\\.\\.$/i.test(s[0]))return this.warn(\"TAR_ENTRY_ERROR\",\"path contains '..'\",{entry:e,path:r}),!1;let[a,n]=xot(r);a&&(e.path=n,this.warn(\"TAR_ENTRY_INFO\",`stripping ${a} from absolute path`,{entry:e,path:r}))}if(Jp.isAbsolute(e.path)?e.absolute=Zl(Jp.resolve(e.path)):e.absolute=Zl(Jp.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+\"/\")!==0&&e.absolute!==this.cwd)return this.warn(\"TAR_ENTRY_ERROR\",\"path escaped extraction target\",{entry:e,path:Zl(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!==\"Directory\"&&e.type!==\"GNUDumpDir\")return!1;if(this.win32){let{root:r}=Jp.win32.parse(e.absolute);e.absolute=r+Pge.encode(e.absolute.substr(r.length));let{root:s}=Jp.win32.parse(e.path);e.path=s+Pge.encode(e.path.substr(s.length))}return!0}[xge](e){if(!this[Fge](e))return e.resume();switch(Sot.equal(typeof e.absolute,\"string\"),e.type){case\"Directory\":case\"GNUDumpDir\":e.mode&&(e.mode=e.mode|448);case\"File\":case\"OldFile\":case\"ContiguousFile\":case\"Link\":case\"SymbolicLink\":return this[CG](e);case\"CharacterDevice\":case\"BlockDevice\":case\"FIFO\":default:return this[Rge](e)}}[Xo](e,r){e.name===\"CwdError\"?this.emit(\"error\",e):(this.warn(\"TAR_ENTRY_ERROR\",e,{entry:r}),this[JI](),r.resume())}[_0](e,r,s){Mge(Zl(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},s)}[Tv](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==\"number\"&&e.uid!==this.processUid||typeof e.gid==\"number\"&&e.gid!==this.processGid)||typeof this.uid==\"number\"&&this.uid!==this.processUid||typeof this.gid==\"number\"&&this.gid!==this.processGid}[Rv](e){return Oge(this.uid,e.uid,this.processUid)}[Fv](e){return Oge(this.gid,e.gid,this.processGid)}[BG](e,r){let s=e.mode&4095||this.fmode,a=new bot.WriteStream(e.absolute,{flags:_ge(e.size),mode:s,autoClose:!1});a.on(\"error\",p=>{a.fd&&Mn.close(a.fd,()=>{}),a.write=()=>!0,this[Xo](p,e),r()});let n=1,c=p=>{if(p){a.fd&&Mn.close(a.fd,()=>{}),this[Xo](p,e),r();return}--n===0&&Mn.close(a.fd,h=>{h?this[Xo](h,e):this[JI](),r()})};a.on(\"finish\",p=>{let h=e.absolute,E=a.fd;if(e.mtime&&!this.noMtime){n++;let C=e.atime||new Date,S=e.mtime;Mn.futimes(E,C,S,P=>P?Mn.utimes(h,C,S,I=>c(I&&P)):c())}if(this[Tv](e)){n++;let C=this[Rv](e),S=this[Fv](e);Mn.fchown(E,C,S,P=>P?Mn.chown(h,C,S,I=>c(I&&P)):c())}c()});let f=this.transform&&this.transform(e)||e;f!==e&&(f.on(\"error\",p=>{this[Xo](p,e),r()}),e.pipe(f)),f.pipe(a)}[vG](e,r){let s=e.mode&4095||this.dmode;this[_0](e.absolute,s,a=>{if(a){this[Xo](a,e),r();return}let n=1,c=f=>{--n===0&&(r(),this[JI](),e.resume())};e.mtime&&!this.noMtime&&(n++,Mn.utimes(e.absolute,e.atime||new Date,e.mtime,c)),this[Tv](e)&&(n++,Mn.chown(e.absolute,this[Rv](e),this[Fv](e),c)),c()})}[Rge](e){e.unsupported=!0,this.warn(\"TAR_ENTRY_UNSUPPORTED\",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Qge](e,r){this[OR](e,e.linkpath,\"symlink\",r)}[Tge](e,r){let s=Zl(Jp.resolve(this.cwd,e.linkpath));this[OR](e,s,\"link\",r)}[Nge](){this[RR]++}[JI](){this[RR]--,this[IG]()}[SG](e){this[JI](),e.resume()}[wG](e,r){return e.type===\"File\"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!Ov}[CG](e){this[Nge]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,s=>this[kge](e,s))}[NR](e){e.type===\"SymbolicLink\"?Oot(this.dirCache):e.type!==\"Directory\"&&Not(this.dirCache,e.absolute)}[kge](e,r){this[NR](e);let s=f=>{this[NR](e),r(f)},a=()=>{this[_0](this.cwd,this.dmode,f=>{if(f){this[Xo](f,e),s();return}this[Nv]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let f=Zl(Jp.dirname(e.absolute));if(f!==this.cwd)return this[_0](f,this.dmode,p=>{if(p){this[Xo](p,e),s();return}c()})}c()},c=()=>{Mn.lstat(e.absolute,(f,p)=>{if(p&&(this.keep||this.newer&&p.mtime>e.mtime)){this[SG](e),s();return}if(f||this[wG](e,p))return this[Hc](null,e,s);if(p.isDirectory()){if(e.type===\"Directory\"){let h=!this.noChmod&&e.mode&&(p.mode&4095)!==e.mode,E=C=>this[Hc](C,e,s);return h?Mn.chmod(e.absolute,e.mode,E):E()}if(e.absolute!==this.cwd)return Mn.rmdir(e.absolute,h=>this[Hc](h,e,s))}if(e.absolute===this.cwd)return this[Hc](null,e,s);Rot(e.absolute,h=>this[Hc](h,e,s))})};this[Nv]?n():a()}[Hc](e,r,s){if(e){this[Xo](e,r),s();return}switch(r.type){case\"File\":case\"OldFile\":case\"ContiguousFile\":return this[BG](r,s);case\"Link\":return this[Tge](r,s);case\"SymbolicLink\":return this[Qge](r,s);case\"Directory\":case\"GNUDumpDir\":return this[vG](r,s)}}[OR](e,r,s,a){Mn[s](r,e.absolute,n=>{n?this[Xo](n,e):(this[JI](),e.resume()),a()})}},FR=t=>{try{return[null,t()]}catch(e){return[e,null]}},DG=class extends Lv{[Hc](e,r){return super[Hc](e,r,()=>{})}[CG](e){if(this[NR](e),!this[Nv]){let n=this[_0](this.cwd,this.dmode);if(n)return this[Xo](n,e);this[Nv]=!0}if(e.absolute!==this.cwd){let n=Zl(Jp.dirname(e.absolute));if(n!==this.cwd){let c=this[_0](n,this.dmode);if(c)return this[Xo](c,e)}}let[r,s]=FR(()=>Mn.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[SG](e);if(r||this[wG](e,s))return this[Hc](null,e);if(s.isDirectory()){if(e.type===\"Directory\"){let c=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[f]=c?FR(()=>{Mn.chmodSync(e.absolute,e.mode)}):[];return this[Hc](f,e)}let[n]=FR(()=>Mn.rmdirSync(e.absolute));this[Hc](n,e)}let[a]=e.absolute===this.cwd?[]:FR(()=>Fot(e.absolute));this[Hc](a,e)}[BG](e,r){let s=e.mode&4095||this.fmode,a=f=>{let p;try{Mn.closeSync(n)}catch(h){p=h}(f||p)&&this[Xo](f||p,e),r()},n;try{n=Mn.openSync(e.absolute,_ge(e.size),s)}catch(f){return a(f)}let c=this.transform&&this.transform(e)||e;c!==e&&(c.on(\"error\",f=>this[Xo](f,e)),e.pipe(c)),c.on(\"data\",f=>{try{Mn.writeSync(n,f,0,f.length)}catch(p){a(p)}}),c.on(\"end\",f=>{let p=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,E=e.mtime;try{Mn.futimesSync(n,h,E)}catch(C){try{Mn.utimesSync(e.absolute,h,E)}catch{p=C}}}if(this[Tv](e)){let h=this[Rv](e),E=this[Fv](e);try{Mn.fchownSync(n,h,E)}catch(C){try{Mn.chownSync(e.absolute,h,E)}catch{p=p||C}}}a(p)})}[vG](e,r){let s=e.mode&4095||this.dmode,a=this[_0](e.absolute,s);if(a){this[Xo](a,e),r();return}if(e.mtime&&!this.noMtime)try{Mn.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Tv](e))try{Mn.chownSync(e.absolute,this[Rv](e),this[Fv](e))}catch{}r(),e.resume()}[_0](e,r){try{return Mge.sync(Zl(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(s){return s}}[OR](e,r,s,a){try{Mn[s+\"Sync\"](r,e.absolute),a(),e.resume()}catch(n){return this[Xo](n,e)}}};Lv.Sync=DG;Hge.exports=Lv});var Yge=_((M3t,Wge)=>{\"use strict\";var Lot=DI(),LR=bG(),Gge=Ie(\"fs\"),qge=GI(),jge=Ie(\"path\"),PG=FI();Wge.exports=(t,e,r)=>{typeof t==\"function\"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e==\"function\"&&(r=e,e=null),e?e=Array.from(e):e=[];let s=Lot(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return e.length&&Mot(s,e),s.file&&s.sync?Uot(s):s.file?_ot(s,r):s.sync?Hot(s):jot(s)};var Mot=(t,e)=>{let r=new Map(e.map(n=>[PG(n),!0])),s=t.filter,a=(n,c)=>{let f=c||jge.parse(n).root||\".\",p=n===f?!1:r.has(n)?r.get(n):a(jge.dirname(n),f);return r.set(n,p),p};t.filter=s?(n,c)=>s(n,c)&&a(PG(n)):n=>a(PG(n))},Uot=t=>{let e=new LR.Sync(t),r=t.file,s=Gge.statSync(r),a=t.maxReadSize||16*1024*1024;new qge.ReadStreamSync(r,{readSize:a,size:s.size}).pipe(e)},_ot=(t,e)=>{let r=new LR(t),s=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((c,f)=>{r.on(\"error\",f),r.on(\"close\",c),Gge.stat(a,(p,h)=>{if(p)f(p);else{let E=new qge.ReadStream(a,{readSize:s,size:h.size});E.on(\"error\",f),E.pipe(r)}})});return e?n.then(e,e):n},Hot=t=>new LR.Sync(t),jot=t=>new LR(t)});var Vge=_(Ps=>{\"use strict\";Ps.c=Ps.create=P0e();Ps.r=Ps.replace=cG();Ps.t=Ps.list=SR();Ps.u=Ps.update=L0e();Ps.x=Ps.extract=Yge();Ps.Pack=uR();Ps.Unpack=bG();Ps.Parse=vR();Ps.ReadEntry=VT();Ps.WriteEntry=M6();Ps.Header=RI();Ps.Pax=KT();Ps.types=I6()});var xG,Jge,H0,Mv,Uv,Kge=Xe(()=>{xG=ut(Ld()),Jge=Ie(\"worker_threads\"),H0=Symbol(\"kTaskInfo\"),Mv=class{constructor(e,r){this.fn=e;this.limit=(0,xG.default)(r.poolSize)}run(e){return this.limit(()=>this.fn(e))}},Uv=class{constructor(e,r){this.source=e;this.workers=[];this.limit=(0,xG.default)(r.poolSize),this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let s=this.workers.pop();s?s.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new Jge.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,\"--unhandled-rejections=strict\"]});return e.on(\"message\",r=>{if(!e[H0])throw new Error(\"Assertion failed: Worker sent a result without having a task assigned\");e[H0].resolve(r),e[H0]=null,e.unref(),this.workers.push(e)}),e.on(\"error\",r=>{e[H0]?.reject(r),e[H0]=null}),e.on(\"exit\",r=>{r!==0&&e[H0]?.reject(new Error(`Worker exited with code ${r}`)),e[H0]=null}),e}run(e){return this.limit(()=>{let r=this.workers.pop()??this.createWorker();return r.ref(),new Promise((s,a)=>{r[H0]={resolve:s,reject:a},r.postMessage(e)})})}}});var Xge=_((j3t,zge)=>{var kG;zge.exports.getContent=()=>(typeof kG>\"u\"&&(kG=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"W2xFdgBPZrjSneDvVbLecg9fIhuy4cX6GuF9CJQpmu4RdNt2tSIi3YZAPJzO1Ju/O0dV1bTkYsgCLThVdbatry9HdhTU1geV2ROjsMltUFBZJKzSZoSLXaDMA7MJtfXUZJlq3aQXKbUKncLmJdo5ByJUTvhIXveNwEBNvBd2oxvnpn4bPkVdGHlvHIlNFxsdCpFJELoRwnbMYlM4po2Z06KXwCi1p2pjs9id3NE2aovZB2yHbSj773jMlfchfy8YwvdDUZ/vn38/MrcgKXdhPVyCRIJINOTc+nvG10A05G5fDWBJlRYRLcZ2SJ9KXzV9P+t4bZ/4ta/XzPq/ny+h1gFHGaDHLBUStJHA1I6ePGRc71wTQyYfc9XD5lW9lkNwtRR9fQNnHnpZTidToeBJ1Jm1RF0pyQsV2LW+fcW218zX0zX/IxA45ZhdTxJH79h9EQSUiPkborYYSHZWctm7f//rd+ZPtVfMU6BpdkJgCVQmfvqm+fVbEgYxqmR7xsfeTPDsKih7u8clJ/eEIKB1UIl7ilvT1LKqXzCI9eUZcoOKhSFnla7zhX1BzrDkzGO57PXtznEtQ5DI6RoVcQbKVsRC1v/6verXL2Y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LDAg92AslKZcu4X3qsiluFx62lA5XZqgqDRo5YYWsqdyk9Vn0Y+5BFggcC5MZ4D5FEs0V4sEK8EA/wPcpDFlWMyvg8WKeNgWb7EbHbqR1d92dlSn0E8nRsdOo+z3J7tbSAC3f9e3SzDJB5xVXbt+Zq3ayiGJzf4KV4Mfkf\",\"base64\")).toString()),kG)});var ps={};Vt(ps,{convertToZip:()=>Yot,convertToZipWorker:()=>RG,extractArchiveTo:()=>rde,getDefaultTaskPool:()=>ede,getTaskPoolForConfiguration:()=>tde,makeArchiveFromDirectory:()=>Wot});function Got(t,e){switch(t){case\"async\":return new Mv(RG,{poolSize:e});case\"workers\":return new Uv((0,TG.getContent)(),{poolSize:e});default:throw new Error(`Assertion failed: Unknown value ${t} for taskPoolMode`)}}function ede(){return typeof QG>\"u\"&&(QG=Got(\"workers\",Ui.availableParallelism())),QG}function tde(t){return typeof t>\"u\"?ede():Yl(qot,t,()=>{let e=t.get(\"taskPoolMode\"),r=t.get(\"taskPoolConcurrency\");switch(e){case\"async\":return new Mv(RG,{poolSize:r});case\"workers\":return new Uv((0,TG.getContent)(),{poolSize:r});default:throw new Error(`Assertion failed: Unknown value ${e} for taskPoolMode`)}})}async function RG(t){let{tmpFile:e,tgz:r,compressionLevel:s,extractBufferOpts:a}=t,n=new As(e,{create:!0,level:s,stats:$a.makeDefaultStats()}),c=Buffer.from(r.buffer,r.byteOffset,r.byteLength);return await rde(c,n,a),n.saveAndClose(),e}async function Wot(t,{baseFs:e=new Yn,prefixPath:r=vt.root,compressionLevel:s,inMemory:a=!1}={}){let n;if(a)n=new As(null,{level:s});else{let f=await ce.mktempPromise(),p=J.join(f,\"archive.zip\");n=new As(p,{create:!0,level:s})}let c=J.resolve(vt.root,r);return await n.copyPromise(c,t,{baseFs:e,stableTime:!0,stableSort:!0}),n}async function Yot(t,e={}){let r=await ce.mktempPromise(),s=J.join(r,\"archive.zip\"),a=e.compressionLevel??e.configuration?.get(\"compressionLevel\")??\"mixed\",n={prefixPath:e.prefixPath,stripComponents:e.stripComponents};return await(e.taskPool??tde(e.configuration)).run({tmpFile:s,tgz:t,compressionLevel:a,extractBufferOpts:n}),new As(s,{level:e.compressionLevel})}async function*Vot(t){let e=new $ge.default.Parse,r=new Zge.PassThrough({objectMode:!0,autoDestroy:!0,emitClose:!0});e.on(\"entry\",s=>{r.write(s)}),e.on(\"error\",s=>{r.destroy(s)}),e.on(\"close\",()=>{r.destroyed||r.end()}),e.end(t);for await(let s of r){let a=s;yield a,a.resume()}}async function rde(t,e,{stripComponents:r=0,prefixPath:s=vt.dot}={}){function a(n){if(n.path[0]===\"/\")return!0;let c=n.path.split(/\\//g);return!!(c.some(f=>f===\"..\")||c.length<=r)}for await(let n of Vot(t)){if(a(n))continue;let c=J.normalize(fe.toPortablePath(n.path)).replace(/\\/$/,\"\").split(/\\//g);if(c.length<=r)continue;let f=c.slice(r).join(\"/\"),p=J.join(s,f),h=420;switch((n.type===\"Directory\"||(n.mode??0)&73)&&(h|=73),n.type){case\"Directory\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.mkdirSync(p,{mode:h}),e.utimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break;case\"OldFile\":case\"File\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.writeFileSync(p,await WE(n),{mode:h}),e.utimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break;case\"SymbolicLink\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.symlinkSync(n.linkpath,p),e.lutimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break}}return e}var Zge,$ge,TG,QG,qot,nde=Xe(()=>{Ge();Dt();eA();Zge=Ie(\"stream\"),$ge=ut(Vge());Kge();Pc();TG=ut(Xge());qot=new WeakMap});var sde=_((FG,ide)=>{(function(t,e){typeof FG==\"object\"?ide.exports=e():typeof define==\"function\"&&define.amd?define(e):t.treeify=e()})(FG,function(){function t(a,n){var c=n?\"\\u2514\":\"\\u251C\";return a?c+=\"\\u2500 \":c+=\"\\u2500\\u2500\\u2510\",c}function e(a,n){var c=[];for(var f in a)a.hasOwnProperty(f)&&(n&&typeof a[f]==\"function\"||c.push(f));return c}function r(a,n,c,f,p,h,E){var C=\"\",S=0,P,I,R=f.slice(0);if(R.push([n,c])&&f.length>0&&(f.forEach(function(U,W){W>0&&(C+=(U[1]?\" \":\"\\u2502\")+\"  \"),!I&&U[0]===n&&(I=!0)}),C+=t(a,c)+a,p&&(typeof n!=\"object\"||n instanceof Date)&&(C+=\": \"+n),I&&(C+=\" (circular ref.)\"),E(C)),!I&&typeof n==\"object\"){var N=e(n,h);N.forEach(function(U){P=++S===N.length,r(U,n[U],P,R,p,h,E)})}}var s={};return s.asLines=function(a,n,c,f){var p=typeof c!=\"function\"?c:!1;r(\".\",a,!1,[],n,p,f||c)},s.asTree=function(a,n,c){var f=\"\";return r(\".\",a,!1,[],n,c,function(p){f+=p+`\n`}),f},s})});var xs={};Vt(xs,{emitList:()=>Jot,emitTree:()=>cde,treeNodeToJson:()=>lde,treeNodeToTreeify:()=>ade});function ade(t,{configuration:e}){let r={},s=0,a=(n,c)=>{let f=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of f){if(!h)continue;let{label:E,value:C,children:S}=h,P=[];typeof E<\"u\"&&P.push(zd(e,E,2)),typeof C<\"u\"&&P.push(Ht(e,C[0],C[1])),P.length===0&&P.push(zd(e,`${p}`,2));let I=P.join(\": \").trim(),R=`\\0${s++}\\0`,N=c[`${R}${I}`]={};typeof S<\"u\"&&a(S,N)}};if(typeof t.children>\"u\")throw new Error(\"The root node must only contain children\");return a(t.children,r),r}function lde(t){let e=r=>{if(typeof r.children>\"u\"){if(typeof r.value>\"u\")throw new Error(\"Assertion failed: Expected a value to be set if the children are missing\");return Xd(r.value[0],r.value[1])}let s=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of s)c&&(a[Kot(n)]=e(c));return typeof r.value>\"u\"?a:{value:Xd(r.value[0],r.value[1]),children:a}};return e(t)}function Jot(t,{configuration:e,stdout:r,json:s}){let a=t.map(n=>({value:n}));cde({children:a},{configuration:e,stdout:r,json:s})}function cde(t,{configuration:e,stdout:r,json:s,separators:a=0}){if(s){let c=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let f of c)f&&r.write(`${JSON.stringify(lde(f))}\n`);return}let n=(0,ode.asTree)(ade(t,{configuration:e}),!1,!1);if(n=n.replace(/\\0[0-9]+\\0/g,\"\"),a>=1&&(n=n.replace(/^([├└]─)/gm,`\\u2502\n$1`).replace(/^│\\n/,\"\")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\\n]+\\n)(([│ ]).{2}[├└].{2}[^\\n]*\\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3  \\u2502 \n$2`).replace(/^│\\n/,\"\");if(a>=3)throw new Error(\"Only the first two levels are accepted by treeUtils.emitTree\");r.write(n)}function Kot(t){return typeof t==\"string\"?t.replace(/^\\0[0-9]+\\0/,\"\"):t}var ode,ude=Xe(()=>{ode=ut(sde());xc()});var MR,fde=Xe(()=>{MR=class{constructor(e){this.releaseFunction=e;this.map=new Map}addOrCreate(e,r){let s=this.map.get(e);if(typeof s<\"u\"){if(s.refCount<=0)throw new Error(`Race condition in RefCountedMap. While adding a new key the refCount is: ${s.refCount} for ${JSON.stringify(e)}`);return s.refCount++,{value:s.value,release:()=>this.release(e)}}else{let a=r();return this.map.set(e,{refCount:1,value:a}),{value:a,release:()=>this.release(e)}}}release(e){let r=this.map.get(e);if(!r)throw new Error(`Unbalanced calls to release. No known instances of: ${JSON.stringify(e)}`);let s=r.refCount;if(s<=0)throw new Error(`Unbalanced calls to release. Too many release vs alloc refcount would become: ${s-1} of ${JSON.stringify(e)}`);s==1?(this.map.delete(e),this.releaseFunction(r.value)):r.refCount--}}});function _v(t){let e=t.match(zot);if(!e?.groups)throw new Error(\"Assertion failed: Expected the checksum to match the requested pattern\");let r=e.groups.cacheVersion?parseInt(e.groups.cacheVersion):null;return{cacheKey:e.groups.cacheKey??null,cacheVersion:r,cacheSpec:e.groups.cacheSpec??null,hash:e.groups.hash}}var Ade,NG,OG,UR,Kr,zot,LG=Xe(()=>{Ge();Dt();Dt();eA();Ade=Ie(\"crypto\"),NG=ut(Ie(\"fs\"));fde();Tc();I0();Pc();Wo();OG=YE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),UR=YE(process.env.YARN_CACHE_VERSION_OVERRIDE??10),Kr=class t{constructor(e,{configuration:r,immutable:s=r.get(\"enableImmutableCache\"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.refCountedZipFsCache=new MR(e=>{e.discardAndClose()});this.cacheId=`-${(0,Ade.randomBytes)(8).toString(\"hex\")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=s,this.check=a;let{cacheSpec:n,cacheKey:c}=t.getCacheKey(r);this.cacheSpec=n,this.cacheKey=c}static async find(e,{immutable:r,check:s}={}){let a=new t(e.get(\"cacheFolder\"),{configuration:e,immutable:r,check:s});return await a.setup(),a}static getCacheKey(e){let r=e.get(\"compressionLevel\"),s=r!==\"mixed\"?`c${r}`:\"\";return{cacheKey:[UR,s].join(\"\"),cacheSpec:s}}get mirrorCwd(){if(!this.configuration.get(\"enableMirror\"))return null;let e=`${this.configuration.get(\"globalFolder\")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${nI(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=_v(r).hash.slice(0,10);return`${nI(e)}-${a}.zip`}isChecksumCompatible(e){if(e===null)return!1;let{cacheVersion:r,cacheSpec:s}=_v(e);if(r===null||r<OG)return!1;let a=this.configuration.get(\"cacheMigrationMode\");return!(r<UR&&a===\"always\"||s!==this.cacheSpec&&a!==\"required-only\")}getLocatorPath(e,r){return this.mirrorCwd===null?J.resolve(this.cwd,this.getVersionFilename(e)):r===null?J.resolve(this.cwd,this.getVersionFilename(e)):J.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?J.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get(\"enableGlobalCache\"))if(this.immutable){if(!await ce.existsPromise(this.cwd))throw new jt(56,\"Cache path does not exist.\")}else{await ce.mkdirPromise(this.cwd,{recursive:!0});let e=J.resolve(this.cwd,\".gitignore\");await ce.changeFilePromise(e,`/.gitignore\n*.flock\n*.tmp\n`)}(this.mirrorCwd||!this.immutable)&&await ce.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:s,onMiss:a,loader:n,...c}){let f=this.getLocatorMirrorPath(e),p=new Yn,h=()=>{let pe=new As,Be=J.join(vt.root,x8(e));return pe.mkdirSync(Be,{recursive:!0}),pe.writeJsonSync(J.join(Be,Er.manifest),{name:un(e),mocked:!0}),pe},E=async(pe,{isColdHit:Be,controlPath:Ce=null})=>{if(Ce===null&&c.unstablePackages?.has(e.locatorHash))return{isValid:!0,hash:null};let g=r&&!Be?_v(r).cacheKey:this.cacheKey,we=!c.skipIntegrityCheck||!r?`${g}/${await SQ(pe)}`:r;if(Ce!==null){let Ae=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await SQ(Ce)}`:r;if(we!==Ae)throw new jt(18,\"The remote archive doesn't match the local checksum - has the local cache been corrupted?\")}let ye=null;switch(r!==null&&we!==r&&(this.check?ye=\"throw\":_v(r).cacheKey!==_v(we).cacheKey?ye=\"update\":ye=this.configuration.get(\"checksumBehavior\")),ye){case null:case\"update\":return{isValid:!0,hash:we};case\"ignore\":return{isValid:!0,hash:r};case\"reset\":return{isValid:!1,hash:r};default:case\"throw\":throw new jt(18,\"The remote archive doesn't match the expected checksum\")}},C=async pe=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Yr(this.configuration,e)}`);let Be=await n(),Ce=Be.getRealPath();Be.saveAndClose(),await ce.chmodPromise(Ce,420);let g=await E(pe,{controlPath:Ce,isColdHit:!1});if(!g.isValid)throw new Error(\"Assertion failed: Expected a valid checksum\");return g.hash},S=async()=>{if(f===null||!await ce.existsPromise(f)){let pe=await n(),Be=pe.getRealPath();return pe.saveAndClose(),{source:\"loader\",path:Be}}return{source:\"mirror\",path:f}},P=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${Yr(this.configuration,e)}`);if(this.immutable)throw new jt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}`);let{path:pe,source:Be}=await S(),{hash:Ce}=await E(pe,{isColdHit:!0}),g=this.getLocatorPath(e,Ce),we=[];Be!==\"mirror\"&&f!==null&&we.push(async()=>{let Ae=`${f}${this.cacheId}`;await ce.copyFilePromise(pe,Ae,NG.default.constants.COPYFILE_FICLONE),await ce.chmodPromise(Ae,420),await ce.renamePromise(Ae,f)}),(!c.mirrorWriteOnly||f===null)&&we.push(async()=>{let Ae=`${g}${this.cacheId}`;await ce.copyFilePromise(pe,Ae,NG.default.constants.COPYFILE_FICLONE),await ce.chmodPromise(Ae,420),await ce.renamePromise(Ae,g)});let ye=c.mirrorWriteOnly?f??g:g;return await Promise.all(we.map(Ae=>Ae())),[!1,ye,Ce]},I=async()=>{let Be=(async()=>{let Ce=c.unstablePackages?.has(e.locatorHash),g=Ce||!r||this.isChecksumCompatible(r)?this.getLocatorPath(e,r):null,we=g!==null?this.markedFiles.has(g)||await p.existsPromise(g):!1,ye=!!c.mockedPackages?.has(e.locatorHash)&&(!this.check||!we),Ae=ye||we,se=Ae?s:a;if(se&&se(),Ae){let Z=null,De=g;if(!ye)if(this.check)Z=await C(De);else{let Re=await E(De,{isColdHit:!1});if(Re.isValid)Z=Re.hash;else return P()}return[ye,De,Z]}else{if(this.immutable&&Ce)throw new jt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}; consider defining ${he.pretty(this.configuration,\"supportedArchitectures\",he.Type.CODE)} to cache packages for multiple systems`);return P()}})();this.mutexes.set(e.locatorHash,Be);try{return await Be}finally{this.mutexes.delete(e.locatorHash)}};for(let pe;pe=this.mutexes.get(e.locatorHash);)await pe;let[R,N,U]=await I();R||this.markedFiles.add(N);let W=()=>this.refCountedZipFsCache.addOrCreate(N,()=>R?h():new As(N,{baseFs:p,readOnly:!0})),ee,ie=new oE(()=>W4(()=>(ee=W(),ee.value),pe=>`Failed to open the cache entry for ${Yr(this.configuration,e)}: ${pe}`),J),ue=new _f(N,{baseFs:ie,pathUtils:J}),le=()=>{ee?.release()},me=c.unstablePackages?.has(e.locatorHash)?null:U;return[ue,le,me]}},zot=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\\/)?(?<hash>.*)$/});var _R,pde=Xe(()=>{_R=(r=>(r[r.SCRIPT=0]=\"SCRIPT\",r[r.SHELLCODE=1]=\"SHELLCODE\",r))(_R||{})});var Xot,KI,MG=Xe(()=>{Dt();wc();Rp();Wo();Xot=[[/^(git(?:\\+(?:https|ssh))?:\\/\\/.*(?:\\.git)?)#(.*)$/,(t,e,r,s)=>`${r}#commit=${s}`],[/^https:\\/\\/((?:[^/]+?)@)?codeload\\.github\\.com\\/([^/]+\\/[^/]+)\\/tar\\.gz\\/([0-9a-f]+)$/,(t,e,r=\"\",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https:\\/\\/((?:[^/]+?)@)?github\\.com\\/([^/]+\\/[^/]+?)(?:\\.git)?#([0-9a-f]+)$/,(t,e,r=\"\",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https?:\\/\\/[^/]+\\/(?:[^/]+\\/)*(?:@.+(?:\\/|(?:%2f)))?([^/]+)\\/(?:-|download)\\/\\1-[^/]+\\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\\/\\/npm\\.pkg\\.github\\.com\\/download\\/(?:@[^/]+)\\/(?:[^/]+)\\/(?:[^/]+)\\/(?:[0-9a-f]+)(?:#|$)/,t=>`npm:${t}`],[/^https:\\/\\/npm\\.fontawesome\\.com\\/(?:@[^/]+)\\/([^/]+)\\/-\\/([^/]+)\\/\\1-\\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\\/\\/[^/]+\\/.*\\/(@[^/]+)\\/([^/]+)\\/-\\/\\1\\/\\2-(?:[.\\d\\w-]+)\\.tgz(?:#|$)/,(t,e)=>kQ({protocol:\"npm:\",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],KI=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:r}){let s=J.join(e.cwd,Er.lockfile);if(!ce.existsSync(s))return;let a=await ce.readFilePromise(s,\"utf8\"),n=ls(a);if(Object.hasOwn(n,\"__metadata\"))return;let c=this.resolutions=new Map;for(let f of Object.keys(n)){let p=HB(f);if(!p){r.reportWarning(14,`Failed to parse the string \"${f}\" into a proper descriptor`);continue}let h=cl(p.range)?On(p,`npm:${p.range}`):p,{version:E,resolved:C}=n[f];if(!C)continue;let S;for(let[I,R]of Xot){let N=C.match(I);if(N){S=R(E,...N);break}}if(!S){r.reportWarning(14,`${ni(e.configuration,h)}: Only some patterns can be imported from legacy lockfiles (not \"${C}\")`);continue}let P=h;try{let I=em(h.range),R=HB(I.selector,!0);R&&(P=R)}catch{}c.set(h.descriptorHash,Ws(P,S))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Assertion failed: This resolver doesn't support resolving locators to packages\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!this.resolutions)throw new Error(\"Assertion failed: The resolution store should have been setup\");let a=this.resolutions.get(e.descriptorHash);if(!a)throw new Error(\"Assertion failed: The resolution should have been registered\");let n=S8(a),c=s.project.configuration.normalizeDependency(n);return await this.resolver.getCandidates(c,r,s)}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){throw new Error(\"Assertion failed: This resolver doesn't support resolving locators to packages\")}}});var lA,hde=Xe(()=>{Tc();Ev();xc();lA=class extends Ao{constructor({configuration:r,stdout:s,suggestInstall:a=!0}){super();this.errorCount=0;RB(this,{configuration:r}),this.configuration=r,this.stdout=s,this.suggestInstall=a}static async start(r,s){let a=new this(r);try{await s(a)}catch(n){a.reportExceptionOnce(n)}finally{await a.finalize()}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){}reportCacheMiss(r){}startSectionSync(r,s){return s()}async startSectionPromise(r,s){return await s()}startTimerSync(r,s,a){return(typeof s==\"function\"?s:a)()}async startTimerPromise(r,s,a){return await(typeof s==\"function\"?s:a)()}reportSeparator(){}reportInfo(r,s){}reportWarning(r,s){}reportError(r,s){this.errorCount+=1,this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} ${this.formatNameWithHyperlink(r)}: ${s}\n`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,s){}async finalize(){this.errorCount>0&&(this.stdout.write(`\n`),this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} Errors happened when preparing the environment required to run this command.\n`),this.suggestInstall&&this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} This might be caused by packages being missing from the lockfile, in which case running \"yarn install\" might help.\n`))}formatNameWithHyperlink(r){return Wj(r,{configuration:this.configuration,json:!1})}}});var zI,UG=Xe(()=>{Wo();zI=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(bQ(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error(\"The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,s){let a=s.project.storedResolutions.get(e.descriptorHash);if(a){let c=s.project.originalPackages.get(a);if(c)return[c]}let n=s.project.originalPackages.get(bQ(e).locatorHash);if(n)return[n];throw new Error(\"Resolution expected from the lockfile data\")}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let s=r.project.originalPackages.get(e.locatorHash);if(!s)throw new Error(\"The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache\");return s}}});function Kp(){}function Zot(t,e,r,s,a){for(var n=0,c=e.length,f=0,p=0;n<c;n++){var h=e[n];if(h.removed){if(h.value=t.join(s.slice(p,p+h.count)),p+=h.count,n&&e[n-1].added){var C=e[n-1];e[n-1]=e[n],e[n]=C}}else{if(!h.added&&a){var E=r.slice(f,f+h.count);E=E.map(function(P,I){var R=s[p+I];return R.length>P.length?R:P}),h.value=t.join(E)}else h.value=t.join(r.slice(f,f+h.count));f+=h.count,h.added||(p+=h.count)}}var S=e[c-1];return c>1&&typeof S.value==\"string\"&&(S.added||S.removed)&&t.equals(\"\",S.value)&&(e[c-2].value+=S.value,e.pop()),e}function $ot(t){return{newPos:t.newPos,components:t.components.slice(0)}}function eat(t,e){if(typeof t==\"function\")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function mde(t,e,r){return r=eat(r,{ignoreWhitespace:!0}),qG.diff(t,e,r)}function tat(t,e,r){return WG.diff(t,e,r)}function HR(t){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?HR=function(e){return typeof e}:HR=function(e){return e&&typeof Symbol==\"function\"&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},HR(t)}function _G(t){return iat(t)||sat(t)||oat(t)||aat()}function iat(t){if(Array.isArray(t))return HG(t)}function sat(t){if(typeof Symbol<\"u\"&&Symbol.iterator in Object(t))return Array.from(t)}function oat(t,e){if(t){if(typeof t==\"string\")return HG(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r===\"Object\"&&t.constructor&&(r=t.constructor.name),r===\"Map\"||r===\"Set\")return Array.from(t);if(r===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HG(t,e)}}function HG(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,s=new Array(e);r<e;r++)s[r]=t[r];return s}function aat(){throw new TypeError(`Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jG(t,e,r,s,a){e=e||[],r=r||[],s&&(t=s(a,t));var n;for(n=0;n<e.length;n+=1)if(e[n]===t)return r[n];var c;if(lat.call(t)===\"[object Array]\"){for(e.push(t),c=new Array(t.length),r.push(c),n=0;n<t.length;n+=1)c[n]=jG(t[n],e,r,s,a);return e.pop(),r.pop(),c}if(t&&t.toJSON&&(t=t.toJSON()),HR(t)===\"object\"&&t!==null){e.push(t),c={},r.push(c);var f=[],p;for(p in t)t.hasOwnProperty(p)&&f.push(p);for(f.sort(),n=0;n<f.length;n+=1)p=f[n],c[p]=jG(t[p],e,r,s,p);e.pop(),r.pop()}else c=t;return c}function yde(t,e,r,s,a,n,c){c||(c={}),typeof c.context>\"u\"&&(c.context=4);var f=tat(r,s,c);if(!f)return;f.push({value:\"\",lines:[]});function p(U){return U.map(function(W){return\" \"+W})}for(var h=[],E=0,C=0,S=[],P=1,I=1,R=function(W){var ee=f[W],ie=ee.lines||ee.value.replace(/\\n$/,\"\").split(`\n`);if(ee.lines=ie,ee.added||ee.removed){var ue;if(!E){var le=f[W-1];E=P,C=I,le&&(S=c.context>0?p(le.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(ue=S).push.apply(ue,_G(ie.map(function(Ae){return(ee.added?\"+\":\"-\")+Ae}))),ee.added?I+=ie.length:P+=ie.length}else{if(E)if(ie.length<=c.context*2&&W<f.length-2){var me;(me=S).push.apply(me,_G(p(ie)))}else{var pe,Be=Math.min(ie.length,c.context);(pe=S).push.apply(pe,_G(p(ie.slice(0,Be))));var Ce={oldStart:E,oldLines:P-E+Be,newStart:C,newLines:I-C+Be,lines:S};if(W>=f.length-2&&ie.length<=c.context){var g=/\\n$/.test(r),we=/\\n$/.test(s),ye=ie.length==0&&S.length>Ce.oldLines;!g&&ye&&r.length>0&&S.splice(Ce.oldLines,0,\"\\\\ No newline at end of file\"),(!g&&!ye||!we)&&S.push(\"\\\\ No newline at end of file\")}h.push(Ce),E=0,C=0,S=[]}P+=ie.length,I+=ie.length}},N=0;N<f.length;N++)R(N);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:n,hunks:h}}var y8t,gde,dde,qG,WG,rat,nat,lat,Hv,GG,YG=Xe(()=>{Kp.prototype={diff:function(e,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.callback;typeof s==\"function\"&&(a=s,s={}),this.options=s;var n=this;function c(R){return a?(setTimeout(function(){a(void 0,R)},0),!0):R}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var f=r.length,p=e.length,h=1,E=f+p;s.maxEditLength&&(E=Math.min(E,s.maxEditLength));var C=[{newPos:-1,components:[]}],S=this.extractCommon(C[0],r,e,0);if(C[0].newPos+1>=f&&S+1>=p)return c([{value:this.join(r),count:r.length}]);function P(){for(var R=-1*h;R<=h;R+=2){var N=void 0,U=C[R-1],W=C[R+1],ee=(W?W.newPos:0)-R;U&&(C[R-1]=void 0);var ie=U&&U.newPos+1<f,ue=W&&0<=ee&&ee<p;if(!ie&&!ue){C[R]=void 0;continue}if(!ie||ue&&U.newPos<W.newPos?(N=$ot(W),n.pushComponent(N.components,void 0,!0)):(N=U,N.newPos++,n.pushComponent(N.components,!0,void 0)),ee=n.extractCommon(N,r,e,R),N.newPos+1>=f&&ee+1>=p)return c(Zot(n,N.components,r,e,n.useLongestToken));C[R]=N}h++}if(a)(function R(){setTimeout(function(){if(h>E)return a();P()||R()},0)})();else for(;h<=E;){var I=P();if(I)return I}},pushComponent:function(e,r,s){var a=e[e.length-1];a&&a.added===r&&a.removed===s?e[e.length-1]={count:a.count+1,added:r,removed:s}:e.push({count:1,added:r,removed:s})},extractCommon:function(e,r,s,a){for(var n=r.length,c=s.length,f=e.newPos,p=f-a,h=0;f+1<n&&p+1<c&&this.equals(r[f+1],s[p+1]);)f++,p++,h++;return h&&e.components.push({count:h}),e.newPos=f,p},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],s=0;s<e.length;s++)e[s]&&r.push(e[s]);return r},castInput:function(e){return e},tokenize:function(e){return e.split(\"\")},join:function(e){return e.join(\"\")}};y8t=new Kp;gde=/^[A-Za-z\\xC0-\\u02C6\\u02C8-\\u02D7\\u02DE-\\u02FF\\u1E00-\\u1EFF]+$/,dde=/\\S/,qG=new Kp;qG.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!dde.test(t)&&!dde.test(e)};qG.tokenize=function(t){for(var e=t.split(/([^\\S\\r\\n]+|[()[\\]{}'\"\\r\\n]|\\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&gde.test(e[r])&&gde.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};WG=new Kp;WG.tokenize=function(t){var e=[],r=t.split(/(\\n|\\r\\n)/);r[r.length-1]||r.pop();for(var s=0;s<r.length;s++){var a=r[s];s%2&&!this.options.newlineIsToken?e[e.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),e.push(a))}return e};rat=new Kp;rat.tokenize=function(t){return t.split(/(\\S.+?[.!?])(?=\\s+|$)/)};nat=new Kp;nat.tokenize=function(t){return t.split(/([{}:;,]|\\s+)/)};lat=Object.prototype.toString,Hv=new Kp;Hv.useLongestToken=!0;Hv.tokenize=WG.tokenize;Hv.castInput=function(t){var e=this.options,r=e.undefinedReplacement,s=e.stringifyReplacer,a=s===void 0?function(n,c){return typeof c>\"u\"?r:c}:s;return typeof t==\"string\"?t:JSON.stringify(jG(t,null,null,a),a,\"  \")};Hv.equals=function(t,e){return Kp.prototype.equals.call(Hv,t.replace(/,([\\r\\n])/g,\"$1\"),e.replace(/,([\\r\\n])/g,\"$1\"))};GG=new Kp;GG.tokenize=function(t){return t.slice()};GG.join=GG.removeEmpty=function(t){return t}});var jR,Ede=Xe(()=>{Tc();jR=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r)}supportsLocator(e,r){return this.resolver.supportsLocator(e,r)}shouldPersistResolution(e,r){return this.resolver.shouldPersistResolution(e,r)}bindDescriptor(e,r,s){return this.resolver.bindDescriptor(e,r,s)}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,s){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}async getSatisfying(e,r,s,a){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}async resolve(e,r){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}}});var ki,VG=Xe(()=>{Tc();ki=class extends Ao{reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,r){return r()}async startSectionPromise(e,r){return await r()}startTimerSync(e,r,s){return(typeof r==\"function\"?r:s)()}async startTimerPromise(e,r,s){return await(typeof r==\"function\"?r:s)()}reportSeparator(){}reportInfo(e,r){}reportWarning(e,r){}reportError(e,r){}reportProgress(e){return{...Promise.resolve().then(async()=>{for await(let{}of e);}),stop:()=>{}}}reportJson(e){}reportFold(e,r){}async finalize(){}}});var Ide,XI,JG=Xe(()=>{Dt();Ide=ut(BQ());oI();tm();xc();I0();Rp();Wo();XI=class{constructor(e,{project:r}){this.workspacesCwds=new Set;this.project=r,this.cwd=e}async setup(){this.manifest=await Ut.tryFind(this.cwd)??new Ut,this.relativeCwd=J.relative(this.project.cwd,this.cwd)||vt.dot;let e=this.manifest.name?this.manifest.name:Da(null,`${this.computeCandidateName()}-${us(this.relativeCwd).substring(0,6)}`);this.anchoredDescriptor=On(e,`${Ei.protocol}${this.relativeCwd}`),this.anchoredLocator=Ws(e,`${Ei.protocol}${this.relativeCwd}`);let r=this.manifest.workspaceDefinitions.map(({pattern:a})=>a);if(r.length===0)return;let s=await(0,Ide.default)(r,{cwd:fe.fromPortablePath(this.cwd),onlyDirectories:!0,ignore:[\"**/node_modules\",\"**/.git\",\"**/.yarn\"]});s.sort(),await s.reduce(async(a,n)=>{let c=J.resolve(this.cwd,fe.toPortablePath(n)),f=await ce.existsPromise(J.join(c,\"package.json\"));await a,f&&this.workspacesCwds.add(c)},Promise.resolve())}get anchoredPackage(){let e=this.project.storedPackages.get(this.anchoredLocator.locatorHash);if(!e)throw new Error(`Assertion failed: Expected workspace ${GB(this.project.configuration,this)} (${Ht(this.project.configuration,J.join(this.cwd,Er.manifest),ht.PATH)}) to have been resolved. Run \"yarn install\" to update the lockfile`);return e}accepts(e){let r=e.indexOf(\":\"),s=r!==-1?e.slice(0,r+1):null,a=r!==-1?e.slice(r+1):e;if(s===Ei.protocol&&J.normalize(a)===this.relativeCwd||s===Ei.protocol&&(a===\"*\"||a===\"^\"||a===\"~\"))return!0;let n=cl(a);return n?s===Ei.protocol?n.test(this.manifest.version??\"0.0.0\"):this.project.configuration.get(\"enableTransparentWorkspaces\")&&this.manifest.version!==null?n.test(this.manifest.version):!1:!1}computeCandidateName(){return this.cwd===this.project.cwd?\"root-workspace\":`${J.basename(this.cwd)}`||\"unnamed-workspace\"}getRecursiveWorkspaceDependencies({dependencies:e=Ut.hardDependencies}={}){let r=new Set,s=a=>{for(let n of e)for(let c of a.manifest[n].values()){let f=this.project.tryWorkspaceByDescriptor(c);f===null||r.has(f)||(r.add(f),s(f))}};return s(this),r}getRecursiveWorkspaceDependents({dependencies:e=Ut.hardDependencies}={}){let r=new Set,s=a=>{for(let n of this.project.workspaces)e.some(f=>[...n.manifest[f].values()].some(p=>{let h=this.project.tryWorkspaceByDescriptor(p);return h!==null&&_B(h.anchoredLocator,a.anchoredLocator)}))&&!r.has(n)&&(r.add(n),s(n))};return s(this),r}getRecursiveWorkspaceChildren(){let e=new Set([this]);for(let r of e)for(let s of r.workspacesCwds){let a=this.project.workspacesByCwd.get(s);a&&e.add(a)}return e.delete(this),Array.from(e)}async persistManifest(){let e={};this.manifest.exportTo(e);let r=J.join(this.cwd,Ut.fileName),s=`${JSON.stringify(e,null,this.manifest.indent)}\n`;await ce.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=e}}});function hat({project:t,allDescriptors:e,allResolutions:r,allPackages:s,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,peerWarnings:f=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,C=[],S=new Map,P=new Map,I=new Map,R=new Map,N=new Map,U=new Map(t.workspaces.map(le=>{let me=le.anchoredLocator.locatorHash,pe=s.get(me);if(typeof pe>\"u\")throw new Error(\"Assertion failed: The workspace should have an associated package\");return[me,LB(pe)]})),W=()=>{let le=ce.mktempSync(),me=J.join(le,\"stacktrace.log\"),pe=String(C.length+1).length,Be=C.map((Ce,g)=>`${`${g+1}.`.padStart(pe,\" \")} ${ll(Ce)}\n`).join(\"\");throw ce.writeFileSync(me,Be),ce.detachTemp(le),new jt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${fe.fromPortablePath(me)}`)},ee=le=>{let me=r.get(le.descriptorHash);if(typeof me>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let pe=s.get(me);if(!pe)throw new Error(\"Assertion failed: The package could not be found\");return pe},ie=(le,me,pe,{top:Be,optional:Ce})=>{C.length>1e3&&W(),C.push(me);let g=ue(le,me,pe,{top:Be,optional:Ce});return C.pop(),g},ue=(le,me,pe,{top:Be,optional:Ce})=>{if(Ce||n.delete(me.locatorHash),a.has(me.locatorHash))return;a.add(me.locatorHash);let g=s.get(me.locatorHash);if(!g)throw new Error(`Assertion failed: The package (${Yr(t.configuration,me)}) should have been registered`);let we=new Set,ye=new Map,Ae=[],se=[],Z=[],De=[];for(let Re of Array.from(g.dependencies.values())){if(g.peerDependencies.has(Re.identHash)&&g.locatorHash!==Be)continue;if(kp(Re))throw new Error(\"Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch\");h.delete(Re.descriptorHash);let mt=Ce;if(!mt){let ke=g.dependenciesMeta.get(un(Re));if(typeof ke<\"u\"){let it=ke.get(null);typeof it<\"u\"&&it.optional&&(mt=!0)}}let j=r.get(Re.descriptorHash);if(!j)throw new Error(`Assertion failed: The resolution (${ni(t.configuration,Re)}) should have been registered`);let rt=U.get(j)||s.get(j);if(!rt)throw new Error(`Assertion failed: The package (${j}, resolved from ${ni(t.configuration,Re)}) should have been registered`);if(rt.peerDependencies.size===0){ie(Re,rt,new Map,{top:Be,optional:mt});continue}let Fe,Ne,Pe=new Set,Ve=new Map;Ae.push(()=>{Fe=b8(Re,me.locatorHash),Ne=P8(rt,me.locatorHash),g.dependencies.set(Re.identHash,Fe),r.set(Fe.descriptorHash,Ne.locatorHash),e.set(Fe.descriptorHash,Fe),s.set(Ne.locatorHash,Ne),bp(R,Ne.locatorHash).add(Fe.descriptorHash),we.add(Ne.locatorHash)}),se.push(()=>{N.set(Ne.locatorHash,Ve);for(let ke of Ne.peerDependencies.values()){let Ue=Yl(ye,ke.identHash,()=>{let x=pe.get(ke.identHash)??null,w=g.dependencies.get(ke.identHash);return!w&&UB(me,ke)&&(le.identHash===me.identHash?w=le:(w=On(me,le.range),e.set(w.descriptorHash,w),r.set(w.descriptorHash,me.locatorHash),h.delete(w.descriptorHash),x=null)),w||(w=On(ke,\"missing:\")),{subject:me,ident:ke,provided:w,root:!x,requests:new Map,hash:`p${us(me.locatorHash,ke.identHash).slice(0,6)}`}}).provided;if(Ue.range===\"missing:\"&&Ne.dependencies.has(ke.identHash)){Ne.peerDependencies.delete(ke.identHash);continue}if(Ve.set(ke.identHash,{requester:Ne,descriptor:ke,meta:Ne.peerDependenciesMeta.get(un(ke)),children:new Map}),Ne.dependencies.set(ke.identHash,Ue),kp(Ue)){let x=r.get(Ue.descriptorHash);bp(I,x).add(Ne.locatorHash)}S.set(Ue.identHash,Ue),Ue.range===\"missing:\"&&Pe.add(Ue.identHash)}Ne.dependencies=new Map(qs(Ne.dependencies,([ke,it])=>un(it)))}),Z.push(()=>{if(!s.has(Ne.locatorHash))return;let ke=E.get(rt.locatorHash);typeof ke==\"number\"&&ke>=2&&W();let it=E.get(rt.locatorHash),Ue=typeof it<\"u\"?it+1:1;E.set(rt.locatorHash,Ue),ie(Fe,Ne,Ve,{top:Be,optional:mt}),E.set(rt.locatorHash,Ue-1)}),De.push(()=>{let ke=r.get(Fe.descriptorHash);if(typeof ke>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let it=N.get(ke);if(typeof it>\"u\")throw new Error(\"Assertion failed: Expected the peer requests to be registered\");for(let Ue of ye.values()){let x=it.get(Ue.ident.identHash);x&&(Ue.requests.set(Fe.descriptorHash,x),p.set(Ue.hash,Ue),Ue.root||pe.get(Ue.ident.identHash)?.children.set(Fe.descriptorHash,x))}if(s.has(Ne.locatorHash))for(let Ue of Pe)Ne.dependencies.delete(Ue)})}for(let Re of[...Ae,...se])Re();for(let Re of we){we.delete(Re);let mt=s.get(Re),j=us(rI(mt).locatorHash,...Array.from(mt.dependencies.values(),Pe=>{let Ve=Pe.range!==\"missing:\"?r.get(Pe.descriptorHash):\"missing:\";if(typeof Ve>\"u\")throw new Error(`Assertion failed: Expected the resolution for ${ni(t.configuration,Pe)} to have been registered`);return Ve===Be?`${Ve} (top)`:Ve})),rt=P.get(j);if(typeof rt>\"u\"){P.set(j,mt);continue}let Fe=bp(R,rt.locatorHash);for(let Pe of R.get(mt.locatorHash)??[])r.set(Pe,rt.locatorHash),Fe.add(Pe);s.delete(mt.locatorHash),a.delete(mt.locatorHash),we.delete(mt.locatorHash);let Ne=I.get(mt.locatorHash);if(Ne!==void 0){let Pe=bp(I,rt.locatorHash);for(let Ve of Ne)Pe.add(Ve),we.add(Ve)}}for(let Re of[...Z,...De])Re()};for(let le of t.workspaces){let me=le.anchoredLocator;h.delete(le.anchoredDescriptor.descriptorHash),ie(le.anchoredDescriptor,me,new Map,{top:me.locatorHash,optional:!1})}for(let le of p.values()){if(!le.root)continue;let me=s.get(le.subject.locatorHash);if(typeof me>\"u\")continue;for(let Be of le.requests.values()){let Ce=`p${us(le.subject.locatorHash,un(le.ident),Be.requester.locatorHash).slice(0,6)}`;c.set(Ce,{subject:le.subject.locatorHash,requested:le.ident,rootRequester:Be.requester.locatorHash,allRequesters:Array.from(qB(Be),g=>g.requester.locatorHash)})}let pe=[...qB(le)];if(le.provided.range!==\"missing:\"){let Be=ee(le.provided),Ce=Be.version??\"0.0.0\",g=ye=>{if(ye.startsWith(Ei.protocol)){if(!t.tryWorkspaceByLocator(Be))return null;ye=ye.slice(Ei.protocol.length),(ye===\"^\"||ye===\"~\")&&(ye=\"*\")}return ye},we=!0;for(let ye of pe){let Ae=g(ye.descriptor.range);if(Ae===null){we=!1;continue}if(!Zf(Ce,Ae)){we=!1;let se=`p${us(le.subject.locatorHash,un(le.ident),ye.requester.locatorHash).slice(0,6)}`;f.push({type:1,subject:me,requested:le.ident,requester:ye.requester,version:Ce,hash:se,requirementCount:pe.length})}}if(!we){let ye=pe.map(Ae=>g(Ae.descriptor.range));f.push({type:3,node:le,range:ye.includes(null)?null:Q8(ye),hash:le.hash})}}else{let Be=!0;for(let Ce of pe)if(!Ce.meta?.optional){Be=!1;let g=`p${us(le.subject.locatorHash,un(le.ident),Ce.requester.locatorHash).slice(0,6)}`;f.push({type:0,subject:me,requested:le.ident,requester:Ce.requester,hash:g})}Be||f.push({type:2,node:le,hash:le.hash})}}}function*gat(t){let e=new Map;if(\"children\"in t)e.set(t,t);else for(let r of t.requests.values())e.set(r,r);for(let[r,s]of e){yield{request:r,root:s};for(let a of r.children.values())e.has(a)||e.set(a,s)}}function dat(t,e){let r=[],s=[],a=!1;for(let n of t.peerWarnings)if(!(n.type===1||n.type===0)){if(!t.tryWorkspaceByLocator(n.node.subject)){a=!0;continue}if(n.type===3){let c=t.storedResolutions.get(n.node.provided.descriptorHash);if(typeof c>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let f=t.storedPackages.get(c);if(typeof f>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");let p=p0(gat(n.node),({request:C,root:S})=>Zf(f.version??\"0.0.0\",C.descriptor.range)?p0.skip:C===S?$i(t.configuration,C.requester):`${$i(t.configuration,C.requester)} (via ${$i(t.configuration,S.requester)})`),h=[...qB(n.node)].length>1?\"and other dependencies request\":\"requests\",E=n.range?iI(t.configuration,n.range):Ht(t.configuration,\"but they have non-overlapping ranges!\",\"redBright\");r.push(`${$i(t.configuration,n.node.ident)} is listed by your project with version ${jB(t.configuration,f.version??\"0.0.0\")} (${Ht(t.configuration,n.hash,ht.CODE)}), which doesn't satisfy what ${p} ${h} (${E}).`)}if(n.type===2){let c=n.node.requests.size>1?\" and other dependencies\":\"\";s.push(`${Yr(t.configuration,n.node.subject)} doesn't provide ${$i(t.configuration,n.node.ident)} (${Ht(t.configuration,n.hash,ht.CODE)}), requested by ${$i(t.configuration,n.node.requests.values().next().value.requester)}${c}.`)}}e.startSectionSync({reportFooter:()=>{e.reportWarning(86,`Some peer dependencies are incorrectly met by your project; run ${Ht(t.configuration,\"yarn explain peer-requirements <hash>\",ht.CODE)} for details, where ${Ht(t.configuration,\"<hash>\",ht.CODE)} is the six-letter p-prefixed code.`)},skipIfEmpty:!0},()=>{for(let n of qs(r,c=>JE.default(c)))e.reportWarning(60,n);for(let n of qs(s,c=>JE.default(c)))e.reportWarning(2,n)}),a&&e.reportWarning(86,`Some peer dependencies are incorrectly met by dependencies; run ${Ht(t.configuration,\"yarn explain peer-requirements\",ht.CODE)} for details.`)}var GR,qR,Bde,XG,zG,ZG,WR,cat,uat,Cde,fat,Aat,pat,$l,KG,YR,wde,Tt,vde=Xe(()=>{Dt();Dt();wc();Yt();GR=Ie(\"crypto\");YG();ql();qR=ut(Ld()),Bde=ut(Ai()),XG=Ie(\"util\"),zG=ut(Ie(\"v8\")),ZG=ut(Ie(\"zlib\"));LG();av();MG();UG();oI();F8();Tc();Ede();Ev();VG();tm();JG();LQ();xc();I0();Pc();gT();zj();Rp();Wo();WR=YE(process.env.YARN_LOCKFILE_VERSION_OVERRIDE??8),cat=3,uat=/ *, */g,Cde=/\\/$/,fat=32,Aat=(0,XG.promisify)(ZG.default.gzip),pat=(0,XG.promisify)(ZG.default.gunzip),$l=(r=>(r.UpdateLockfile=\"update-lockfile\",r.SkipBuild=\"skip-build\",r))($l||{}),KG={restoreLinkersCustomData:[\"linkersCustomData\"],restoreResolutions:[\"accessibleLocators\",\"conditionalLocators\",\"disabledLocators\",\"optionalBuilds\",\"storedDescriptors\",\"storedResolutions\",\"storedPackages\",\"lockFileChecksum\"],restoreBuildState:[\"skippedBuilds\",\"storedBuildState\"]},YR=(a=>(a[a.NotProvided=0]=\"NotProvided\",a[a.NotCompatible=1]=\"NotCompatible\",a[a.NodeNotProvided=2]=\"NodeNotProvided\",a[a.NodeNotCompatible=3]=\"NodeNotCompatible\",a))(YR||{}),wde=t=>us(`${cat}`,t),Tt=class t{constructor(e,{configuration:r}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.skippedBuilds=new Set;this.lockfileLastVersion=null;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.peerWarnings=[];this.peerRequirementNodes=new Map;this.linkersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=r,this.cwd=e}static async find(e,r){if(!e.projectCwd)throw new nt(`No project found in ${r}`);let s=e.projectCwd,a=r,n=null;for(;n!==e.projectCwd;){if(n=a,ce.existsSync(J.join(n,Er.manifest))){s=n;break}a=J.dirname(n)}let c=new t(e.projectCwd,{configuration:e});ze.telemetry?.reportProject(c.cwd),await c.setupResolutions(),await c.setupWorkspaces(),ze.telemetry?.reportWorkspaceCount(c.workspaces.length),ze.telemetry?.reportDependencyCount(c.workspaces.reduce((I,R)=>I+R.manifest.dependencies.size+R.manifest.devDependencies.size,0));let f=c.tryWorkspaceByCwd(s);if(f)return{project:c,workspace:f,locator:f.anchoredLocator};let p=await c.findLocatorForLocation(`${s}/`,{strict:!0});if(p)return{project:c,locator:p,workspace:null};let h=Ht(e,c.cwd,ht.PATH),E=Ht(e,J.relative(c.cwd,s),ht.PATH),C=`- If ${h} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,S=`- If ${h} is intended to be a project, it might be that you forgot to list ${E} in its workspace configuration.`,P=`- Finally, if ${h} is fine and you intend ${E} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new nt(`The nearest package directory (${Ht(e,s,ht.PATH)}) doesn't seem to be part of the project declared in ${Ht(e,c.cwd,ht.PATH)}.\n\n${[C,S,P].join(`\n`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=J.join(this.cwd,Er.lockfile),r=this.configuration.get(\"defaultLanguageName\");if(ce.existsSync(e)){let s=await ce.readFilePromise(e,\"utf8\");this.lockFileChecksum=wde(s);let a=ls(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<WR;for(let f of Object.keys(a)){if(f===\"__metadata\")continue;let p=a[f];if(typeof p.resolution>\"u\")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let h=Qp(p.resolution,!0),E=new Ut;E.load(p,{yamlCompatibilityMode:!0});let C=E.version,S=E.languageName||r,P=p.linkType.toUpperCase(),I=p.conditions??null,R=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,W=E.peerDependenciesMeta,ee=E.bin;if(p.checksum!=null){let ue=typeof c<\"u\"&&!p.checksum.includes(\"/\")?`${c}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,ue)}let ie={...h,version:C,languageName:S,linkType:P,conditions:I,dependencies:R,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:W,bin:ee};this.originalPackages.set(ie.locatorHash,ie);for(let ue of f.split(uat)){let le=C0(ue);n<=6&&(le=this.configuration.normalizeDependency(le),le=On(le,le.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,\"$1npm%3A\"))),this.storedDescriptors.set(le.descriptorHash,le),this.storedResolutions.set(le.descriptorHash,h.locatorHash)}}}else s.includes(\"yarn lockfile v1\")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,r=(0,qR.default)(4),s=async(a,n)=>{if(e.has(n))return a;e.add(n);let c=new XI(n,{project:this});await r(()=>c.setup());let f=a.then(()=>{this.addWorkspace(c)});return Array.from(c.workspacesCwds).reduce(s,f)};await s(Promise.resolve(),this.cwd)}addWorkspace(e){let r=this.workspacesByIdent.get(e.anchoredLocator.identHash);if(typeof r<\"u\")throw new Error(`Duplicate workspace name ${$i(this.configuration,e.anchoredLocator)}: ${fe.fromPortablePath(e.cwd)} conflicts with ${fe.fromPortablePath(r.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.anchoredLocator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){J.isAbsolute(e)||(e=J.resolve(this.cwd,e)),e=J.normalize(e).replace(/\\/+$/,\"\");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let s of this.workspaces)J.relative(s.cwd,e).startsWith(\"../\")||r&&r.cwd.length>=s.cwd.length||(r=s);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>\"u\"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${$i(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){if(e.range.startsWith(Ei.protocol)){let s=e.range.slice(Ei.protocol.length);if(s!==\"^\"&&s!==\"~\"&&s!==\"*\"&&!cl(s))return this.tryWorkspaceByCwd(s)}let r=this.tryWorkspaceByIdent(e);return r===null||(kp(e)&&(e=MB(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${ni(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Gu(e)&&(e=rI(e)),r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${Yr(this.configuration,e)})`);return r}deleteDescriptor(e){this.storedResolutions.delete(e),this.storedDescriptors.delete(e)}deleteLocator(e){this.originalPackages.delete(e),this.storedPackages.delete(e),this.accessibleLocators.delete(e)}forgetResolution(e){if(\"descriptorHash\"in e){let r=this.storedResolutions.get(e.descriptorHash);this.deleteDescriptor(e.descriptorHash);let s=new Set(this.storedResolutions.values());typeof r<\"u\"&&!s.has(r)&&this.deleteLocator(r)}if(\"locatorHash\"in e){this.deleteLocator(e.locatorHash);for(let[r,s]of this.storedResolutions)s===e.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let e=this.configuration.makeResolver(),r=new Map;for(let[s,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(s)}for(let s of this.originalPackages.values()){let a;try{a=e.shouldPersistResolution(s,{project:this,resolver:e})}catch{a=!1}if(!a){this.deleteLocator(s.locatorHash);let n=r.get(s.locatorHash);if(n){r.delete(s.locatorHash);for(let c of n)this.deleteDescriptor(c)}}}}forgetVirtualResolutions(){for(let e of this.storedPackages.values())for(let[r,s]of e.dependencies)kp(s)&&e.dependencies.set(r,MB(s))}getDependencyMeta(e,r){let s={},n=this.topLevelWorkspace.manifest.dependenciesMeta.get(un(e));if(!n)return s;let c=n.get(null);if(c&&Object.assign(s,c),r===null||!Bde.default.valid(r))return s;for(let[f,p]of n)f!==null&&f===r&&Object.assign(s,p);return s}async findLocatorForLocation(e,{strict:r=!1}={}){let s=new ki,a=this.configuration.getLinkers(),n={project:this,report:s};for(let c of a){let f=await c.findPackageLocator(e,n);if(f){if(r&&(await c.findPackageLocation(f,n)).replace(Cde,\"\")!==e.replace(Cde,\"\"))continue;return f}}return null}async loadUserConfig(){let e=J.join(this.cwd,\".pnp.cjs\");await ce.existsPromise(e)&&Pp(e).setup();let r=J.join(this.cwd,\"yarn.config.cjs\");return await ce.existsPromise(r)?Pp(r):null}async preparePackage(e,{resolver:r,resolveOptions:s}){let a=await this.configuration.getPackageExtensions(),n=this.configuration.normalizePackage(e,{packageExtensions:a});for(let[c,f]of n.dependencies){let p=await this.configuration.reduceHook(E=>E.reduceDependency,f,this,n,f,{resolver:r,resolveOptions:s});if(!UB(f,p))throw new Error(\"Assertion failed: The descriptor ident cannot be changed through aliases\");let h=r.bindDescriptor(p,n,s);n.dependencies.set(c,h)}return n}async resolveEverything(e){if(!this.workspacesByCwd||!this.workspacesByIdent)throw new Error(\"Workspaces must have been setup before calling this function\");this.forgetVirtualResolutions();let r=new Map(this.originalPackages),s=[];e.lockfileOnly||this.forgetTransientResolutions();let a=e.resolver||this.configuration.makeResolver(),n=new KI(a);await n.setup(this,{report:e.report});let c=e.lockfileOnly?[new jR(a)]:[n,a],f=new rm([new zI(a),...c]),p=new rm([...c]),h=this.configuration.makeFetcher(),E=e.lockfileOnly?{project:this,report:e.report,resolver:f}:{project:this,report:e.report,resolver:f,fetchOptions:{project:this,cache:e.cache,checksums:this.storedChecksums,report:e.report,fetcher:h,cacheOptions:{mirrorWriteOnly:!0}}},C=new Map,S=new Map,P=new Map,I=new Map,R=new Map,N=new Map,U=this.topLevelWorkspace.anchoredLocator,W=new Set,ee=[],ie=uj(),ue=this.configuration.getSupportedArchitectures();await e.report.startProgressPromise(Ao.progressViaTitle(),async se=>{let Z=async rt=>{let Fe=await qE(async()=>await f.resolve(rt,E),ke=>`${Yr(this.configuration,rt)}: ${ke}`);if(!_B(rt,Fe))throw new Error(`Assertion failed: The locator cannot be changed by the resolver (went from ${Yr(this.configuration,rt)} to ${Yr(this.configuration,Fe)})`);I.set(Fe.locatorHash,Fe),!r.delete(Fe.locatorHash)&&!this.tryWorkspaceByLocator(Fe)&&s.push(Fe);let Pe=await this.preparePackage(Fe,{resolver:f,resolveOptions:E}),Ve=Uu([...Pe.dependencies.values()].map(ke=>j(ke)));return ee.push(Ve),Ve.catch(()=>{}),S.set(Pe.locatorHash,Pe),Pe},De=async rt=>{let Fe=R.get(rt.locatorHash);if(typeof Fe<\"u\")return Fe;let Ne=Promise.resolve().then(()=>Z(rt));return R.set(rt.locatorHash,Ne),Ne},Re=async(rt,Fe)=>{let Ne=await j(Fe);return C.set(rt.descriptorHash,rt),P.set(rt.descriptorHash,Ne.locatorHash),Ne},mt=async rt=>{se.setTitle(ni(this.configuration,rt));let Fe=this.resolutionAliases.get(rt.descriptorHash);if(typeof Fe<\"u\")return Re(rt,this.storedDescriptors.get(Fe));let Ne=f.getResolutionDependencies(rt,E),Pe=Object.fromEntries(await Uu(Object.entries(Ne).map(async([it,Ue])=>{let x=f.bindDescriptor(Ue,U,E),w=await j(x);return W.add(w.locatorHash),[it,w]}))),ke=(await qE(async()=>await f.getCandidates(rt,Pe,E),it=>`${ni(this.configuration,rt)}: ${it}`))[0];if(typeof ke>\"u\")throw new jt(82,`${ni(this.configuration,rt)}: No candidates found`);if(e.checkResolutions){let{locators:it}=await p.getSatisfying(rt,Pe,[ke],{...E,resolver:p});if(!it.find(Ue=>Ue.locatorHash===ke.locatorHash))throw new jt(78,`Invalid resolution ${FB(this.configuration,rt,ke)}`)}return C.set(rt.descriptorHash,rt),P.set(rt.descriptorHash,ke.locatorHash),De(ke)},j=rt=>{let Fe=N.get(rt.descriptorHash);if(typeof Fe<\"u\")return Fe;C.set(rt.descriptorHash,rt);let Ne=Promise.resolve().then(()=>mt(rt));return N.set(rt.descriptorHash,Ne),Ne};for(let rt of this.workspaces){let Fe=rt.anchoredDescriptor;ee.push(j(Fe))}for(;ee.length>0;){let rt=[...ee];ee.length=0,await Uu(rt)}});let le=Wl(r.values(),se=>this.tryWorkspaceByLocator(se)?Wl.skip:se);if(s.length>0||le.length>0){let se=new Set(this.workspaces.flatMap(rt=>{let Fe=S.get(rt.anchoredLocator.locatorHash);if(!Fe)throw new Error(\"Assertion failed: The workspace should have been resolved\");return Array.from(Fe.dependencies.values(),Ne=>{let Pe=P.get(Ne.descriptorHash);if(!Pe)throw new Error(\"Assertion failed: The resolution should have been registered\");return Pe})})),Z=rt=>se.has(rt.locatorHash)?\"0\":\"1\",De=rt=>ll(rt),Re=qs(s,[Z,De]),mt=qs(le,[Z,De]),j=e.report.getRecommendedLength();Re.length>0&&e.report.reportInfo(85,`${Ht(this.configuration,\"+\",ht.ADDED)} ${$k(this.configuration,Re,j)}`),mt.length>0&&e.report.reportInfo(85,`${Ht(this.configuration,\"-\",ht.REMOVED)} ${$k(this.configuration,mt,j)}`)}let me=new Set(this.resolutionAliases.values()),pe=new Set(S.keys()),Be=new Set,Ce=new Map,g=[],we=new Map;hat({project:this,accessibleLocators:Be,volatileDescriptors:me,optionalBuilds:pe,peerRequirements:Ce,peerWarnings:g,peerRequirementNodes:we,allDescriptors:C,allResolutions:P,allPackages:S});for(let se of W)pe.delete(se);for(let se of me)C.delete(se),P.delete(se);let ye=new Set,Ae=new Set;for(let se of S.values())se.conditions!=null&&pe.has(se.locatorHash)&&(TQ(se,ue)||(TQ(se,ie)&&e.report.reportWarningOnce(77,`${Yr(this.configuration,se)}: Your current architecture (${process.platform}-${process.arch}) is supported by this package, but is missing from the ${Ht(this.configuration,\"supportedArchitectures\",ht.SETTING)} setting`),Ae.add(se.locatorHash)),ye.add(se.locatorHash));this.storedResolutions=P,this.storedDescriptors=C,this.storedPackages=S,this.accessibleLocators=Be,this.conditionalLocators=ye,this.disabledLocators=Ae,this.originalPackages=I,this.optionalBuilds=pe,this.peerRequirements=Ce,this.peerWarnings=g,this.peerRequirementNodes=we}async fetchEverything({cache:e,report:r,fetcher:s,mode:a,persistProject:n=!0}){let c={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators},f=s||this.configuration.makeFetcher(),p={checksums:this.storedChecksums,project:this,cache:e,fetcher:f,report:r,cacheOptions:c},h=Array.from(new Set(qs(this.storedResolutions.values(),[I=>{let R=this.storedPackages.get(I);if(!R)throw new Error(\"Assertion failed: The locator should have been registered\");return ll(R)}])));a===\"update-lockfile\"&&(h=h.filter(I=>!this.storedChecksums.has(I)));let E=!1,C=Ao.progressViaCounter(h.length);await r.reportProgress(C);let S=(0,qR.default)(fat);if(await Uu(h.map(I=>S(async()=>{let R=this.storedPackages.get(I);if(!R)throw new Error(\"Assertion failed: The locator should have been registered\");if(Gu(R))return;let N;try{N=await f.fetch(R,p)}catch(U){U.message=`${Yr(this.configuration,R)}: ${U.message}`,r.reportExceptionOnce(U),E=U;return}N.checksum!=null?this.storedChecksums.set(R.locatorHash,N.checksum):this.storedChecksums.delete(R.locatorHash),N.releaseFs&&N.releaseFs()}).finally(()=>{C.tick()}))),E)throw E;let P=n&&a!==\"update-lockfile\"?await this.cacheCleanup({cache:e,report:r}):null;if(r.cacheMisses.size>0||P){let R=(await Promise.all([...r.cacheMisses].map(async le=>{let me=this.storedPackages.get(le),pe=this.storedChecksums.get(le)??null,Be=e.getLocatorPath(me,pe);return(await ce.statPromise(Be)).size}))).reduce((le,me)=>le+me,0)-(P?.size??0),N=r.cacheMisses.size,U=P?.count??0,W=`${Wk(N,{zero:\"No new packages\",one:\"A package was\",more:`${Ht(this.configuration,N,ht.NUMBER)} packages were`})} added to the project`,ee=`${Wk(U,{zero:\"none were\",one:\"one was\",more:`${Ht(this.configuration,U,ht.NUMBER)} were`})} removed`,ie=R!==0?` (${Ht(this.configuration,R,ht.SIZE_DIFF)})`:\"\",ue=U>0?N>0?`${W}, and ${ee}${ie}.`:`${W}, but ${ee}${ie}.`:`${W}${ie}.`;r.reportInfo(13,ue)}}async linkEverything({cache:e,report:r,fetcher:s,mode:a}){let n={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators,skipIntegrityCheck:!0},c=s||this.configuration.makeFetcher(),f={checksums:this.storedChecksums,project:this,cache:e,fetcher:c,report:r,cacheOptions:n},p=this.configuration.getLinkers(),h={project:this,report:r},E=new Map(p.map(ye=>{let Ae=ye.makeInstaller(h),se=ye.getCustomDataKey(),Z=this.linkersCustomData.get(se);return typeof Z<\"u\"&&Ae.attachCustomData(Z),[ye,Ae]})),C=new Map,S=new Map,P=new Map,I=new Map(await Uu([...this.accessibleLocators].map(async ye=>{let Ae=this.storedPackages.get(ye);if(!Ae)throw new Error(\"Assertion failed: The locator should have been registered\");return[ye,await c.fetch(Ae,f)]}))),R=[],N=new Set,U=[];for(let ye of this.accessibleLocators){let Ae=this.storedPackages.get(ye);if(typeof Ae>\"u\")throw new Error(\"Assertion failed: The locator should have been registered\");let se=I.get(Ae.locatorHash);if(typeof se>\"u\")throw new Error(\"Assertion failed: The fetch result should have been registered\");let Z=[],De=mt=>{Z.push(mt)},Re=this.tryWorkspaceByLocator(Ae);if(Re!==null){let mt=[],{scripts:j}=Re.manifest;for(let Fe of[\"preinstall\",\"install\",\"postinstall\"])j.has(Fe)&&mt.push({type:0,script:Fe});try{for(let[Fe,Ne]of E)if(Fe.supportsPackage(Ae,h)&&(await Ne.installPackage(Ae,se,{holdFetchResult:De})).buildRequest!==null)throw new Error(\"Assertion failed: Linkers can't return build directives for workspaces; this responsibility befalls to the Yarn core\")}finally{Z.length===0?se.releaseFs?.():R.push(Uu(Z).catch(()=>{}).then(()=>{se.releaseFs?.()}))}let rt=J.join(se.packageFs.getRealPath(),se.prefixPath);S.set(Ae.locatorHash,rt),!Gu(Ae)&&mt.length>0&&P.set(Ae.locatorHash,{buildDirectives:mt,buildLocations:[rt]})}else{let mt=p.find(Fe=>Fe.supportsPackage(Ae,h));if(!mt)throw new jt(12,`${Yr(this.configuration,Ae)} isn't supported by any available linker`);let j=E.get(mt);if(!j)throw new Error(\"Assertion failed: The installer should have been registered\");let rt;try{rt=await j.installPackage(Ae,se,{holdFetchResult:De})}finally{Z.length===0?se.releaseFs?.():R.push(Uu(Z).then(()=>{}).then(()=>{se.releaseFs?.()}))}C.set(Ae.locatorHash,mt),S.set(Ae.locatorHash,rt.packageLocation),rt.buildRequest&&rt.packageLocation&&(rt.buildRequest.skipped?(N.add(Ae.locatorHash),this.skippedBuilds.has(Ae.locatorHash)||U.push([Ae,rt.buildRequest.explain])):P.set(Ae.locatorHash,{buildDirectives:rt.buildRequest.directives,buildLocations:[rt.packageLocation]}))}}let W=new Map;for(let ye of this.accessibleLocators){let Ae=this.storedPackages.get(ye);if(!Ae)throw new Error(\"Assertion failed: The locator should have been registered\");let se=this.tryWorkspaceByLocator(Ae)!==null,Z=async(De,Re)=>{let mt=S.get(Ae.locatorHash);if(typeof mt>\"u\")throw new Error(`Assertion failed: The package (${Yr(this.configuration,Ae)}) should have been registered`);let j=[];for(let rt of Ae.dependencies.values()){let Fe=this.storedResolutions.get(rt.descriptorHash);if(typeof Fe>\"u\")throw new Error(`Assertion failed: The resolution (${ni(this.configuration,rt)}, from ${Yr(this.configuration,Ae)})should have been registered`);let Ne=this.storedPackages.get(Fe);if(typeof Ne>\"u\")throw new Error(`Assertion failed: The package (${Fe}, resolved from ${ni(this.configuration,rt)}) should have been registered`);let Pe=this.tryWorkspaceByLocator(Ne)===null?C.get(Fe):null;if(typeof Pe>\"u\")throw new Error(`Assertion failed: The package (${Fe}, resolved from ${ni(this.configuration,rt)}) should have been registered`);Pe===De||Pe===null?S.get(Ne.locatorHash)!==null&&j.push([rt,Ne]):!se&&mt!==null&&xB(W,Fe).push(mt)}mt!==null&&await Re.attachInternalDependencies(Ae,j)};if(se)for(let[De,Re]of E)De.supportsPackage(Ae,h)&&await Z(De,Re);else{let De=C.get(Ae.locatorHash);if(!De)throw new Error(\"Assertion failed: The linker should have been found\");let Re=E.get(De);if(!Re)throw new Error(\"Assertion failed: The installer should have been registered\");await Z(De,Re)}}for(let[ye,Ae]of W){let se=this.storedPackages.get(ye);if(!se)throw new Error(\"Assertion failed: The package should have been registered\");let Z=C.get(se.locatorHash);if(!Z)throw new Error(\"Assertion failed: The linker should have been found\");let De=E.get(Z);if(!De)throw new Error(\"Assertion failed: The installer should have been registered\");await De.attachExternalDependents(se,Ae)}let ee=new Map;for(let[ye,Ae]of E){let se=await Ae.finalizeInstall();for(let Z of se?.records??[])Z.buildRequest.skipped?(N.add(Z.locator.locatorHash),this.skippedBuilds.has(Z.locator.locatorHash)||U.push([Z.locator,Z.buildRequest.explain])):P.set(Z.locator.locatorHash,{buildDirectives:Z.buildRequest.directives,buildLocations:Z.buildLocations});typeof se?.customData<\"u\"&&ee.set(ye.getCustomDataKey(),se.customData)}if(this.linkersCustomData=ee,await Uu(R),a===\"skip-build\")return;for(let[,ye]of qs(U,([Ae])=>ll(Ae)))ye(r);let ie=new Set(P.keys()),ue=(0,GR.createHash)(\"sha512\");ue.update(process.versions.node),await this.configuration.triggerHook(ye=>ye.globalHashGeneration,this,ye=>{ue.update(\"\\0\"),ue.update(ye)});let le=ue.digest(\"hex\"),me=new Map,pe=ye=>{let Ae=me.get(ye.locatorHash);if(typeof Ae<\"u\")return Ae;let se=this.storedPackages.get(ye.locatorHash);if(typeof se>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");let Z=(0,GR.createHash)(\"sha512\");Z.update(ye.locatorHash),me.set(ye.locatorHash,\"<recursive>\");for(let De of se.dependencies.values()){let Re=this.storedResolutions.get(De.descriptorHash);if(typeof Re>\"u\")throw new Error(`Assertion failed: The resolution (${ni(this.configuration,De)}) should have been registered`);let mt=this.storedPackages.get(Re);if(typeof mt>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");Z.update(pe(mt))}return Ae=Z.digest(\"hex\"),me.set(ye.locatorHash,Ae),Ae},Be=(ye,Ae)=>{let se=(0,GR.createHash)(\"sha512\");se.update(le),se.update(pe(ye));for(let Z of Ae)se.update(Z);return se.digest(\"hex\")},Ce=new Map,g=!1,we=ye=>{let Ae=new Set([ye.locatorHash]);for(let se of Ae){let Z=this.storedPackages.get(se);if(!Z)throw new Error(\"Assertion failed: The package should have been registered\");for(let De of Z.dependencies.values()){let Re=this.storedResolutions.get(De.descriptorHash);if(!Re)throw new Error(`Assertion failed: The resolution (${ni(this.configuration,De)}) should have been registered`);if(Re!==ye.locatorHash&&ie.has(Re))return!1;let mt=this.storedPackages.get(Re);if(!mt)throw new Error(\"Assertion failed: The package should have been registered\");let j=this.tryWorkspaceByLocator(mt);if(j){if(j.anchoredLocator.locatorHash!==ye.locatorHash&&ie.has(j.anchoredLocator.locatorHash))return!1;Ae.add(j.anchoredLocator.locatorHash)}Ae.add(Re)}}return!0};for(;ie.size>0;){let ye=ie.size,Ae=[];for(let se of ie){let Z=this.storedPackages.get(se);if(!Z)throw new Error(\"Assertion failed: The package should have been registered\");if(!we(Z))continue;let De=P.get(Z.locatorHash);if(!De)throw new Error(\"Assertion failed: The build directive should have been registered\");let Re=Be(Z,De.buildLocations);if(this.storedBuildState.get(Z.locatorHash)===Re){Ce.set(Z.locatorHash,Re),ie.delete(se);continue}g||(await this.persistInstallStateFile(),g=!0),this.storedBuildState.has(Z.locatorHash)?r.reportInfo(8,`${Yr(this.configuration,Z)} must be rebuilt because its dependency tree changed`):r.reportInfo(7,`${Yr(this.configuration,Z)} must be built because it never has been before or the last one failed`);let mt=De.buildLocations.map(async j=>{if(!J.isAbsolute(j))throw new Error(`Assertion failed: Expected the build location to be absolute (not ${j})`);for(let rt of De.buildDirectives){let Fe=`# This file contains the result of Yarn building a package (${ll(Z)})\n`;switch(rt.type){case 0:Fe+=`# Script name: ${rt.script}\n`;break;case 1:Fe+=`# Script code: ${rt.script}\n`;break}let Ne=null;if(!await ce.mktempPromise(async Ve=>{let ke=J.join(Ve,\"build.log\"),{stdout:it,stderr:Ue}=this.configuration.getSubprocessStreams(ke,{header:Fe,prefix:Yr(this.configuration,Z),report:r}),x;try{switch(rt.type){case 0:x=await LT(Z,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:Ue});break;case 1:x=await Yj(Z,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:Ue});break}}catch(y){Ue.write(y.stack),x=1}if(it.end(),Ue.end(),x===0)return!0;ce.detachTemp(Ve);let w=`${Yr(this.configuration,Z)} couldn't be built successfully (exit code ${Ht(this.configuration,x,ht.NUMBER)}, logs can be found here: ${Ht(this.configuration,ke,ht.PATH)})`,b=this.optionalBuilds.has(Z.locatorHash);return b?r.reportInfo(9,w):r.reportError(9,w),ehe&&r.reportFold(fe.fromPortablePath(ke),ce.readFileSync(ke,\"utf8\")),b}))return!1}return!0});Ae.push(...mt,Promise.allSettled(mt).then(j=>{ie.delete(se),j.every(rt=>rt.status===\"fulfilled\"&&rt.value===!0)&&Ce.set(Z.locatorHash,Re)}))}if(await Uu(Ae),ye===ie.size){let se=Array.from(ie).map(Z=>{let De=this.storedPackages.get(Z);if(!De)throw new Error(\"Assertion failed: The package should have been registered\");return Yr(this.configuration,De)}).join(\", \");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${se})`);break}}this.storedBuildState=Ce,this.skippedBuilds=N}async installWithNewReport(e,r){return(await Ot.start({configuration:this.configuration,json:e.json,stdout:e.stdout,forceSectionAlignment:!0,includeLogs:!e.json&&!e.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(e){let r=this.configuration.get(\"nodeLinker\");ze.telemetry?.reportInstall(r);let s=!1;if(await e.report.startTimerPromise(\"Project validation\",{skipIfEmpty:!0},async()=>{this.configuration.get(\"enableOfflineMode\")&&e.report.reportWarning(90,\"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it\"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,C)=>{e.report.reportWarning(E,C)},reportError:(E,C)=>{e.report.reportError(E,C),s=!0}})}),s)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,C]of E)for(let S of C)S.status=\"inactive\";let n=J.join(this.cwd,Er.lockfile),c=null;if(e.immutable)try{c=await ce.readFilePromise(n,\"utf8\")}catch(E){throw E.code===\"ENOENT\"?new jt(28,\"The lockfile would have been created by this install, which is explicitly forbidden.\"):E}await e.report.startTimerPromise(\"Resolution step\",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise(\"Post-resolution validation\",{skipIfEmpty:!0},async()=>{dat(this,e.report);for(let[,E]of a)for(let[,C]of E)for(let S of C)if(S.userProvided){let P=Ht(this.configuration,S,ht.PACKAGE_EXTENSION);switch(S.status){case\"inactive\":e.report.reportWarning(68,`${P}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case\"redundant\":e.report.reportWarning(69,`${P}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(c!==null){let E=Ed(c,this.generateLockfile());if(E!==c){let C=yde(n,n,c,E,void 0,void 0,{maxEditLength:100});if(C){e.report.reportSeparator();for(let S of C.hunks){e.report.reportInfo(null,`@@ -${S.oldStart},${S.oldLines} +${S.newStart},${S.newLines} @@`);for(let P of S.lines)P.startsWith(\"+\")?e.report.reportError(28,Ht(this.configuration,P,ht.ADDED)):P.startsWith(\"-\")?e.report.reportError(28,Ht(this.configuration,P,ht.REMOVED)):e.report.reportInfo(null,Ht(this.configuration,P,\"grey\"))}e.report.reportSeparator()}throw new jt(28,\"The lockfile would have been modified by this install, which is explicitly forbidden.\")}}});for(let E of a.values())for(let[,C]of E)for(let S of C)S.userProvided&&S.status===\"active\"&&ze.telemetry?.reportPackageExtension(Xd(S,ht.PACKAGE_EXTENSION));await e.report.startTimerPromise(\"Fetch step\",async()=>{await this.fetchEverything(e)});let f=e.immutable?[...new Set(this.configuration.get(\"immutablePatterns\"))].sort():[],p=await Promise.all(f.map(async E=>DQ(E,{cwd:this.cwd})));(typeof e.persistProject>\"u\"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise(\"Link step\",async()=>{if(e.mode===\"update-lockfile\"){e.report.reportWarning(73,`Skipped due to ${Ht(this.configuration,\"mode=update-lockfile\",ht.CODE)}`);return}await this.linkEverything(e);let E=await Promise.all(f.map(async C=>DQ(C,{cwd:this.cwd})));for(let C=0;C<f.length;++C)p[C]!==E[C]&&e.report.reportError(64,`The checksum for ${f[C]} has been modified by this install, which is explicitly forbidden.`)}),await this.persistInstallStateFile();let h=!1;await e.report.startTimerPromise(\"Post-install validation\",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,C)=>{e.report.reportWarning(E,C)},reportError:(E,C)=>{e.report.reportError(E,C),h=!0}})}),!h&&await this.configuration.triggerHook(E=>E.afterAllInstalled,this,e)}generateLockfile(){let e=new Map;for(let[n,c]of this.storedResolutions.entries()){let f=e.get(c);f||e.set(c,f=new Set),f.add(n)}let r={},{cacheKey:s}=Kr.getCacheKey(this.configuration);r.__metadata={version:WR,cacheKey:s};for(let[n,c]of e.entries()){let f=this.originalPackages.get(n);if(!f)continue;let p=[];for(let C of c){let S=this.storedDescriptors.get(C);if(!S)throw new Error(\"Assertion failed: The descriptor should have been registered\");p.push(S)}let h=p.map(C=>al(C)).sort().join(\", \"),E=new Ut;E.version=f.linkType===\"HARD\"?f.version:\"0.0.0-use.local\",E.languageName=f.languageName,E.dependencies=new Map(f.dependencies),E.peerDependencies=new Map(f.peerDependencies),E.dependenciesMeta=new Map(f.dependenciesMeta),E.peerDependenciesMeta=new Map(f.peerDependenciesMeta),E.bin=new Map(f.bin),r[h]={...E.exportTo({},{compatibilityMode:!1}),linkType:f.linkType.toLowerCase(),resolution:ll(f),checksum:this.storedChecksums.get(f.locatorHash),conditions:f.conditions||void 0}}return`${[`# This file is generated by running \"yarn install\" inside your project.\n`,`# Manual changes might be lost - proceed with caution!\n`].join(\"\")}\n`+nl(r)}async persistLockfile(){let e=J.join(this.cwd,Er.lockfile),r=\"\";try{r=await ce.readFilePromise(e,\"utf8\")}catch{}let s=this.generateLockfile(),a=Ed(r,s);a!==r&&(await ce.writeFilePromise(e,a),this.lockFileChecksum=wde(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let c of Object.values(KG))e.push(...c);let r=Kd(this,e),s=zG.default.serialize(r),a=us(s);if(this.installStateChecksum===a)return;let n=this.configuration.get(\"installStatePath\");await ce.mkdirPromise(J.dirname(n),{recursive:!0}),await ce.writeFilePromise(n,await Aat(s)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:s=!0}={}){let a=this.configuration.get(\"installStatePath\"),n;try{let c=await pat(await ce.readFilePromise(a));n=zG.default.deserialize(c),this.installStateChecksum=us(c)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<\"u\"&&(this.linkersCustomData=n.linkersCustomData),s&&Object.assign(this,Kd(n,KG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,Kd(n,KG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new ki}),await this.persistInstallStateFile()}async persist(){let e=(0,qR.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>e(()=>r.persistManifest()))])}async cacheCleanup({cache:e,report:r}){if(this.configuration.get(\"enableGlobalCache\"))return null;let s=new Set([\".gitignore\"]);if(!q8(e.cwd,this.cwd)||!await ce.existsPromise(e.cwd))return null;let a=[];for(let c of await ce.readdirPromise(e.cwd)){if(s.has(c))continue;let f=J.resolve(e.cwd,c);e.markedFiles.has(f)||(e.immutable?r.reportError(56,`${Ht(this.configuration,J.basename(f),\"magenta\")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(ce.lstatPromise(f).then(async p=>(await ce.removePromise(f),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((c,f)=>c+f,0)}}}});function mat(t){let s=Math.floor(t.timeNow/864e5),a=t.updateInterval*864e5,n=t.state.lastUpdate??t.timeNow+a+Math.floor(a*t.randomInitialInterval),c=n+a,f=t.state.lastTips??s*864e5,p=f+864e5+8*36e5-t.timeZone,h=c<=t.timeNow,E=p<=t.timeNow,C=null;return(h||E||!t.state.lastUpdate||!t.state.lastTips)&&(C={},C.lastUpdate=h?t.timeNow:n,C.lastTips=f,C.blocks=h?{}:t.state.blocks,C.displayedTips=t.state.displayedTips),{nextState:C,triggerUpdate:h,triggerTips:E,nextTips:E?s*864e5:f}}var ZI,Sde=Xe(()=>{Dt();yv();I0();pT();Pc();Rp();ZI=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=e;let s=this.getRegistryPath();this.isNew=!ce.existsSync(s),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(e){let r=new Set(this.displayedTips),s=f=>f&&fn?Zf(fn,f):!1,a=e.map((f,p)=>p).filter(f=>e[f]&&s(e[f]?.selector));if(a.length===0)return null;let n=a.filter(f=>!r.has(f));if(n.length===0){let f=Math.floor(a.length*.2);this.displayedTips=f>0?this.displayedTips.slice(-f):[],n=a.filter(p=>!r.has(p))}let c=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(c),this.commitTips(),e[c]}reportVersion(e){this.reportValue(\"version\",e.replace(/-git\\..*/,\"-git\"))}reportCommandName(e){this.reportValue(\"commandName\",e||\"<none>\")}reportPluginName(e){this.reportValue(\"pluginName\",e)}reportProject(e){this.reportEnumerator(\"projectCount\",e)}reportInstall(e){this.reportHit(\"installCount\",e)}reportPackageExtension(e){this.reportValue(\"packageExtension\",e)}reportWorkspaceCount(e){this.reportValue(\"workspaceCount\",String(e))}reportDependencyCount(e){this.reportValue(\"dependencyCount\",String(e))}reportValue(e,r){bp(this.values,e).add(r)}reportEnumerator(e,r){bp(this.enumerators,e).add(us(r))}reportHit(e,r=\"*\"){let s=q4(this.hits,e),a=Yl(s,r,()=>0);s.set(r,a+1)}getRegistryPath(){let e=this.configuration.get(\"globalFolder\");return J.join(e,\"telemetry.json\")}sendReport(e){let r=this.getRegistryPath(),s;try{s=ce.readJsonSync(r)}catch{s={}}let{nextState:a,triggerUpdate:n,triggerTips:c,nextTips:f}=mat({state:s,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get(\"telemetryInterval\")});if(this.nextTips=f,this.displayedTips=s.displayedTips??[],a!==null)try{ce.mkdirSync(J.dirname(r),{recursive:!0}),ce.writeJsonSync(r,a)}catch{return!1}if(c&&this.configuration.get(\"enableTips\")&&(this.shouldShowTips=!0),n){let p=s.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,E=C=>cj(h,C,{configuration:this.configuration}).catch(()=>{});for(let[C,S]of Object.entries(s.blocks??{})){if(Object.keys(S).length===0)continue;let P=S;P.userId=C,P.reportType=\"primary\";for(let N of Object.keys(P.enumerators??{}))P.enumerators[N]=P.enumerators[N].length;E(P);let I=new Map,R=20;for(let[N,U]of Object.entries(P.values))U.length>0&&I.set(N,U.slice(0,R));for(;I.size>0;){let N={};N.userId=C,N.reportType=\"secondary\",N.metrics={};for(let[U,W]of I)N.metrics[U]=W.shift(),W.length===0&&I.delete(U);E(N)}}}}return!0}applyChanges(){let e=this.getRegistryPath(),r;try{r=ce.readJsonSync(e)}catch{r={}}let s=this.configuration.get(\"telemetryUserId\")??\"*\",a=r.blocks=r.blocks??{},n=a[s]=a[s]??{};for(let c of this.hits.keys()){let f=n.hits=n.hits??{},p=f[c]=f[c]??{};for(let[h,E]of this.hits.get(c))p[h]=(p[h]??0)+E}for(let c of[\"values\",\"enumerators\"])for(let f of this[c].keys()){let p=n[c]=n[c]??{};p[f]=[...new Set([...p[f]??[],...this[c].get(f)??[]])]}this.shouldCommitTips&&(r.lastTips=this.nextTips,r.displayedTips=this.displayedTips),ce.mkdirSync(J.dirname(e),{recursive:!0}),ce.writeJsonSync(e,r)}startBuffer(){process.on(\"exit\",()=>{try{this.applyChanges()}catch{}})}}});var jv={};Vt(jv,{BuildDirectiveType:()=>_R,CACHE_CHECKPOINT:()=>OG,CACHE_VERSION:()=>UR,Cache:()=>Kr,Configuration:()=>ze,DEFAULT_RC_FILENAME:()=>dj,DurationUnit:()=>mj,FormatType:()=>upe,InstallMode:()=>$l,LEGACY_PLUGINS:()=>ov,LOCKFILE_VERSION:()=>WR,LegacyMigrationResolver:()=>KI,LightReport:()=>lA,LinkType:()=>VE,LockfileResolver:()=>zI,Manifest:()=>Ut,MessageName:()=>Br,MultiFetcher:()=>aI,PackageExtensionStatus:()=>J4,PackageExtensionType:()=>V4,PeerWarningType:()=>YR,Project:()=>Tt,Report:()=>Ao,ReportError:()=>jt,SettingsType:()=>wI,StreamReport:()=>Ot,TAG_REGEXP:()=>Mp,TelemetryManager:()=>ZI,ThrowReport:()=>ki,VirtualFetcher:()=>lI,WindowsLinkType:()=>IT,Workspace:()=>XI,WorkspaceFetcher:()=>cI,WorkspaceResolver:()=>Ei,YarnVersion:()=>fn,execUtils:()=>qr,folderUtils:()=>OQ,formatUtils:()=>he,hashUtils:()=>Nn,httpUtils:()=>nn,miscUtils:()=>je,nodeUtils:()=>Ui,parseMessageName:()=>jx,reportOptionDeprecations:()=>SI,scriptUtils:()=>In,semverUtils:()=>Fr,stringifyMessageName:()=>Yf,structUtils:()=>G,tgzUtils:()=>ps,treeUtils:()=>xs});var Ge=Xe(()=>{dT();LQ();xc();I0();pT();Pc();gT();zj();Rp();Wo();nde();ude();LG();av();av();pde();MG();hde();UG();oI();Gx();R8();vde();Tc();Ev();Sde();VG();N8();O8();tm();JG();yv();hle()});var Qde=_((WHt,qv)=>{\"use strict\";var Eat=process.env.TERM_PROGRAM===\"Hyper\",Iat=process.platform===\"win32\",Pde=process.platform===\"linux\",$G={ballotDisabled:\"\\u2612\",ballotOff:\"\\u2610\",ballotOn:\"\\u2611\",bullet:\"\\u2022\",bulletWhite:\"\\u25E6\",fullBlock:\"\\u2588\",heart:\"\\u2764\",identicalTo:\"\\u2261\",line:\"\\u2500\",mark:\"\\u203B\",middot:\"\\xB7\",minus:\"\\uFF0D\",multiplication:\"\\xD7\",obelus:\"\\xF7\",pencilDownRight:\"\\u270E\",pencilRight:\"\\u270F\",pencilUpRight:\"\\u2710\",percent:\"%\",pilcrow2:\"\\u2761\",pilcrow:\"\\xB6\",plusMinus:\"\\xB1\",section:\"\\xA7\",starsOff:\"\\u2606\",starsOn:\"\\u2605\",upDownArrow:\"\\u2195\"},xde=Object.assign({},$G,{check:\"\\u221A\",cross:\"\\xD7\",ellipsisLarge:\"...\",ellipsis:\"...\",info:\"i\",question:\"?\",questionSmall:\"?\",pointer:\">\",pointerSmall:\"\\xBB\",radioOff:\"( )\",radioOn:\"(*)\",warning:\"\\u203C\"}),kde=Object.assign({},$G,{ballotCross:\"\\u2718\",check:\"\\u2714\",cross:\"\\u2716\",ellipsisLarge:\"\\u22EF\",ellipsis:\"\\u2026\",info:\"\\u2139\",question:\"?\",questionFull:\"\\uFF1F\",questionSmall:\"\\uFE56\",pointer:Pde?\"\\u25B8\":\"\\u276F\",pointerSmall:Pde?\"\\u2023\":\"\\u203A\",radioOff:\"\\u25EF\",radioOn:\"\\u25C9\",warning:\"\\u26A0\"});qv.exports=Iat&&!Eat?xde:kde;Reflect.defineProperty(qv.exports,\"common\",{enumerable:!1,value:$G});Reflect.defineProperty(qv.exports,\"windows\",{enumerable:!1,value:xde});Reflect.defineProperty(qv.exports,\"other\",{enumerable:!1,value:kde})});var Ju=_((YHt,e5)=>{\"use strict\";var Cat=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t),wat=/[\\u001b\\u009b][[\\]#;?()]*(?:(?:(?:[^\\W_]*;?[^\\W_]*)\\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,Tde=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};\"FORCE_COLOR\"in process.env&&(t.enabled=process.env.FORCE_COLOR!==\"0\");let e=n=>{let c=n.open=`\\x1B[${n.codes[0]}m`,f=n.close=`\\x1B[${n.codes[1]}m`,p=n.regex=new RegExp(`\\\\u001b\\\\[${n.codes[1]}m`,\"g\");return n.wrap=(h,E)=>{h.includes(f)&&(h=h.replace(p,f+c));let C=c+h+f;return E?C.replace(/\\r*\\n/g,`${f}$&${c}`):C},n},r=(n,c,f)=>typeof n==\"function\"?n(c):n.wrap(c,f),s=(n,c)=>{if(n===\"\"||n==null)return\"\";if(t.enabled===!1)return n;if(t.visible===!1)return\"\";let f=\"\"+n,p=f.includes(`\n`),h=c.length;for(h>0&&c.includes(\"unstyle\")&&(c=[...new Set([\"unstyle\",...c])].reverse());h-- >0;)f=r(t.styles[c[h]],f,p);return f},a=(n,c,f)=>{t.styles[n]=e({name:n,codes:c}),(t.keys[f]||(t.keys[f]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(h){t.alias(n,h)},get(){let h=E=>s(E,h.stack);return Reflect.setPrototypeOf(h,t),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a(\"reset\",[0,0],\"modifier\"),a(\"bold\",[1,22],\"modifier\"),a(\"dim\",[2,22],\"modifier\"),a(\"italic\",[3,23],\"modifier\"),a(\"underline\",[4,24],\"modifier\"),a(\"inverse\",[7,27],\"modifier\"),a(\"hidden\",[8,28],\"modifier\"),a(\"strikethrough\",[9,29],\"modifier\"),a(\"black\",[30,39],\"color\"),a(\"red\",[31,39],\"color\"),a(\"green\",[32,39],\"color\"),a(\"yellow\",[33,39],\"color\"),a(\"blue\",[34,39],\"color\"),a(\"magenta\",[35,39],\"color\"),a(\"cyan\",[36,39],\"color\"),a(\"white\",[37,39],\"color\"),a(\"gray\",[90,39],\"color\"),a(\"grey\",[90,39],\"color\"),a(\"bgBlack\",[40,49],\"bg\"),a(\"bgRed\",[41,49],\"bg\"),a(\"bgGreen\",[42,49],\"bg\"),a(\"bgYellow\",[43,49],\"bg\"),a(\"bgBlue\",[44,49],\"bg\"),a(\"bgMagenta\",[45,49],\"bg\"),a(\"bgCyan\",[46,49],\"bg\"),a(\"bgWhite\",[47,49],\"bg\"),a(\"blackBright\",[90,39],\"bright\"),a(\"redBright\",[91,39],\"bright\"),a(\"greenBright\",[92,39],\"bright\"),a(\"yellowBright\",[93,39],\"bright\"),a(\"blueBright\",[94,39],\"bright\"),a(\"magentaBright\",[95,39],\"bright\"),a(\"cyanBright\",[96,39],\"bright\"),a(\"whiteBright\",[97,39],\"bright\"),a(\"bgBlackBright\",[100,49],\"bgBright\"),a(\"bgRedBright\",[101,49],\"bgBright\"),a(\"bgGreenBright\",[102,49],\"bgBright\"),a(\"bgYellowBright\",[103,49],\"bgBright\"),a(\"bgBlueBright\",[104,49],\"bgBright\"),a(\"bgMagentaBright\",[105,49],\"bgBright\"),a(\"bgCyanBright\",[106,49],\"bgBright\"),a(\"bgWhiteBright\",[107,49],\"bgBright\"),t.ansiRegex=wat,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n==\"string\"&&n!==\"\"&&t.ansiRegex.test(n)),t.alias=(n,c)=>{let f=typeof c==\"string\"?t[c]:c;if(typeof f!=\"function\")throw new TypeError(\"Expected alias to be the name of an existing color (string) or a function\");f.stack||(Reflect.defineProperty(f,\"name\",{value:n}),t.styles[n]=f,f.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=h=>s(h,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(f.stack):f.stack,p}})},t.theme=n=>{if(!Cat(n))throw new TypeError(\"Expected theme to be an object\");for(let c of Object.keys(n))t.alias(c,n[c]);return t},t.alias(\"unstyle\",n=>typeof n==\"string\"&&n!==\"\"?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,\"\")):\"\"),t.alias(\"noop\",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Qde(),t.define=a,t};e5.exports=Tde();e5.exports.create=Tde});var Zo=_(pn=>{\"use strict\";var Bat=Object.prototype.toString,jc=Ju(),Rde=!1,t5=[],Fde={yellow:\"blue\",cyan:\"red\",green:\"magenta\",black:\"white\",blue:\"yellow\",red:\"cyan\",magenta:\"green\",white:\"black\"};pn.longest=(t,e)=>t.reduce((r,s)=>Math.max(r,e?s[e].length:s.length),0);pn.hasColor=t=>!!t&&jc.hasColor(t);var JR=pn.isObject=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t);pn.nativeType=t=>Bat.call(t).slice(8,-1).toLowerCase().replace(/\\s/g,\"\");pn.isAsyncFn=t=>pn.nativeType(t)===\"asyncfunction\";pn.isPrimitive=t=>t!=null&&typeof t!=\"object\"&&typeof t!=\"function\";pn.resolve=(t,e,...r)=>typeof e==\"function\"?e.call(t,...r):e;pn.scrollDown=(t=[])=>[...t.slice(1),t[0]];pn.scrollUp=(t=[])=>[t.pop(),...t];pn.reorder=(t=[])=>{let e=t.slice();return e.sort((r,s)=>r.index>s.index?1:r.index<s.index?-1:0),e};pn.swap=(t,e,r)=>{let s=t.length,a=r===s?0:r<0?s-1:r,n=t[e];t[e]=t[a],t[a]=n};pn.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize==\"function\"&&(r=t.getWindowSize()[0]),process.platform===\"win32\"?r-1:r};pn.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize==\"function\"&&(r=t.getWindowSize()[1]),r};pn.wordWrap=(t,e={})=>{if(!t)return t;typeof e==\"number\"&&(e={width:e});let{indent:r=\"\",newline:s=`\n`+r,width:a=80}=e,n=(s+r).match(/[^\\S\\n]/g)||[];a-=n.length;let c=`.{1,${a}}([\\\\s\\\\u200B]+|$)|[^\\\\s\\\\u200B]+?([\\\\s\\\\u200B]+|$)`,f=t.trim(),p=new RegExp(c,\"g\"),h=f.match(p)||[];return h=h.map(E=>E.replace(/\\n$/,\"\")),e.padEnd&&(h=h.map(E=>E.padEnd(a,\" \"))),e.padStart&&(h=h.map(E=>E.padStart(a,\" \"))),r+h.join(s)};pn.unmute=t=>{let e=t.stack.find(s=>jc.keys.color.includes(s));return e?jc[e]:t.stack.find(s=>s.slice(2)===\"bg\")?jc[e.slice(2)]:s=>s};pn.pascal=t=>t?t[0].toUpperCase()+t.slice(1):\"\";pn.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>jc.keys.color.includes(s));if(e){let s=jc[\"bg\"+pn.pascal(e)];return s?s.black:t}let r=t.stack.find(s=>s.slice(0,2)===\"bg\");return r?jc[r.slice(2).toLowerCase()]||t:jc.none};pn.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>jc.keys.color.includes(s)),r=t.stack.find(s=>s.slice(0,2)===\"bg\");if(e&&!r)return jc[Fde[e]||e];if(r){let s=r.slice(2).toLowerCase(),a=Fde[s];return a&&jc[\"bg\"+pn.pascal(a)]||t}return jc.none};pn.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),s=e>=12?\"pm\":\"am\";e=e%12;let a=e===0?12:e,n=r<10?\"0\"+r:r;return a+\":\"+n+\" \"+s};pn.set=(t={},e=\"\",r)=>e.split(\".\").reduce((s,a,n,c)=>{let f=c.length-1>n?s[a]||{}:r;return!pn.isObject(f)&&n<c.length-1&&(f={}),s[a]=f},t);pn.get=(t={},e=\"\",r)=>{let s=t[e]==null?e.split(\".\").reduce((a,n)=>a&&a[n],t):t[e];return s??r};pn.mixin=(t,e)=>{if(!JR(t))return e;if(!JR(e))return t;for(let r of Object.keys(e)){let s=Object.getOwnPropertyDescriptor(e,r);if(s.hasOwnProperty(\"value\"))if(t.hasOwnProperty(r)&&JR(s.value)){let a=Object.getOwnPropertyDescriptor(t,r);JR(a.value)?t[r]=pn.merge({},t[r],e[r]):Reflect.defineProperty(t,r,s)}else Reflect.defineProperty(t,r,s);else Reflect.defineProperty(t,r,s)}return t};pn.merge=(...t)=>{let e={};for(let r of t)pn.mixin(e,r);return e};pn.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let s of Object.keys(r)){let a=r[s];typeof a==\"function\"?pn.define(t,s,a.bind(e)):pn.define(t,s,a)}};pn.onExit=t=>{let e=(r,s)=>{Rde||(Rde=!0,t5.forEach(a=>a()),r===!0&&process.exit(128+s))};t5.length===0&&(process.once(\"SIGTERM\",e.bind(null,!0,15)),process.once(\"SIGINT\",e.bind(null,!0,2)),process.once(\"exit\",e)),t5.push(t)};pn.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};pn.defineExport=(t,e,r)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){s=a},get(){return s?s():r()}})}});var Nde=_(rC=>{\"use strict\";rC.ctrl={a:\"first\",b:\"backward\",c:\"cancel\",d:\"deleteForward\",e:\"last\",f:\"forward\",g:\"reset\",i:\"tab\",k:\"cutForward\",l:\"reset\",n:\"newItem\",m:\"cancel\",j:\"submit\",p:\"search\",r:\"remove\",s:\"save\",u:\"undo\",w:\"cutLeft\",x:\"toggleCursor\",v:\"paste\"};rC.shift={up:\"shiftUp\",down:\"shiftDown\",left:\"shiftLeft\",right:\"shiftRight\",tab:\"prev\"};rC.fn={up:\"pageUp\",down:\"pageDown\",left:\"pageLeft\",right:\"pageRight\",delete:\"deleteForward\"};rC.option={b:\"backward\",f:\"forward\",d:\"cutRight\",left:\"cutLeft\",up:\"altUp\",down:\"altDown\"};rC.keys={pageup:\"pageUp\",pagedown:\"pageDown\",home:\"home\",end:\"end\",cancel:\"cancel\",delete:\"deleteForward\",backspace:\"delete\",down:\"down\",enter:\"submit\",escape:\"cancel\",left:\"left\",space:\"space\",number:\"number\",return:\"submit\",right:\"right\",tab:\"next\",up:\"up\"}});var Mde=_((KHt,Lde)=>{\"use strict\";var Ode=Ie(\"readline\"),vat=Nde(),Sat=/^(?:\\x1b)([a-zA-Z0-9])$/,Dat=/^(?:\\x1b+)(O|N|\\[|\\[\\[)(?:(\\d+)(?:;(\\d+))?([~^$])|(?:1;)?(\\d+)?([a-zA-Z]))/,bat={OP:\"f1\",OQ:\"f2\",OR:\"f3\",OS:\"f4\",\"[11~\":\"f1\",\"[12~\":\"f2\",\"[13~\":\"f3\",\"[14~\":\"f4\",\"[[A\":\"f1\",\"[[B\":\"f2\",\"[[C\":\"f3\",\"[[D\":\"f4\",\"[[E\":\"f5\",\"[15~\":\"f5\",\"[17~\":\"f6\",\"[18~\":\"f7\",\"[19~\":\"f8\",\"[20~\":\"f9\",\"[21~\":\"f10\",\"[23~\":\"f11\",\"[24~\":\"f12\",\"[A\":\"up\",\"[B\":\"down\",\"[C\":\"right\",\"[D\":\"left\",\"[E\":\"clear\",\"[F\":\"end\",\"[H\":\"home\",OA:\"up\",OB:\"down\",OC:\"right\",OD:\"left\",OE:\"clear\",OF:\"end\",OH:\"home\",\"[1~\":\"home\",\"[2~\":\"insert\",\"[3~\":\"delete\",\"[4~\":\"end\",\"[5~\":\"pageup\",\"[6~\":\"pagedown\",\"[[5~\":\"pageup\",\"[[6~\":\"pagedown\",\"[7~\":\"home\",\"[8~\":\"end\",\"[a\":\"up\",\"[b\":\"down\",\"[c\":\"right\",\"[d\":\"left\",\"[e\":\"clear\",\"[2$\":\"insert\",\"[3$\":\"delete\",\"[5$\":\"pageup\",\"[6$\":\"pagedown\",\"[7$\":\"home\",\"[8$\":\"end\",Oa:\"up\",Ob:\"down\",Oc:\"right\",Od:\"left\",Oe:\"clear\",\"[2^\":\"insert\",\"[3^\":\"delete\",\"[5^\":\"pageup\",\"[6^\":\"pagedown\",\"[7^\":\"home\",\"[8^\":\"end\",\"[Z\":\"tab\"};function Pat(t){return[\"[a\",\"[b\",\"[c\",\"[d\",\"[e\",\"[2$\",\"[3$\",\"[5$\",\"[6$\",\"[7$\",\"[8$\",\"[Z\"].includes(t)}function xat(t){return[\"Oa\",\"Ob\",\"Oc\",\"Od\",\"Oe\",\"[2^\",\"[3^\",\"[5^\",\"[6^\",\"[7^\",\"[8^\"].includes(t)}var KR=(t=\"\",e={})=>{let r,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t=\"\\x1B\"+String(t)):t=String(t):t!==void 0&&typeof t!=\"string\"?t=String(t):t||(t=s.sequence||\"\"),s.sequence=s.sequence||t||s.name,t===\"\\r\")s.raw=void 0,s.name=\"return\";else if(t===`\n`)s.name=\"enter\";else if(t===\"\t\")s.name=\"tab\";else if(t===\"\\b\"||t===\"\\x7F\"||t===\"\\x1B\\x7F\"||t===\"\\x1B\\b\")s.name=\"backspace\",s.meta=t.charAt(0)===\"\\x1B\";else if(t===\"\\x1B\"||t===\"\\x1B\\x1B\")s.name=\"escape\",s.meta=t.length===2;else if(t===\" \"||t===\"\\x1B \")s.name=\"space\",s.meta=t.length===2;else if(t<=\"\u001a\")s.name=String.fromCharCode(t.charCodeAt(0)+97-1),s.ctrl=!0;else if(t.length===1&&t>=\"0\"&&t<=\"9\")s.name=\"number\";else if(t.length===1&&t>=\"a\"&&t<=\"z\")s.name=t;else if(t.length===1&&t>=\"A\"&&t<=\"Z\")s.name=t.toLowerCase(),s.shift=!0;else if(r=Sat.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=Dat.exec(t)){let a=[...t];a[0]===\"\\x1B\"&&a[1]===\"\\x1B\"&&(s.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(\"\"),c=(r[3]||r[5]||1)-1;s.ctrl=!!(c&4),s.meta=!!(c&10),s.shift=!!(c&1),s.code=n,s.name=bat[n],s.shift=Pat(n)||s.shift,s.ctrl=xat(n)||s.ctrl}return s};KR.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error(\"Invalid stream passed\");let s=Ode.createInterface({terminal:!0,input:r});Ode.emitKeypressEvents(r,s);let a=(f,p)=>e(f,KR(f,p),s),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on(\"keypress\",a),s.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener(\"keypress\",a),s.pause(),s.close()}};KR.action=(t,e,r)=>{let s={...vat,...r};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)};Lde.exports=KR});var _de=_((zHt,Ude)=>{\"use strict\";Ude.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let s=e[r];typeof s==\"number\"&&(s={interval:s}),kat(t,r,s)}};function kat(t,e,r={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;s.frames=r.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,t.render()},a);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,\"interval\",{value:n}),t.once(\"close\",()=>s.stop()),s.stop}});var jde=_((XHt,Hde)=>{\"use strict\";var{define:Qat,width:Tat}=Zo(),r5=class{constructor(e){let r=e.options;Qat(this,\"_prompt\",e),this.type=e.type,this.name=e.name,this.message=\"\",this.header=\"\",this.footer=\"\",this.error=\"\",this.hint=\"\",this.input=\"\",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt=\"\",this.buffer=\"\",this.width=Tat(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r==\"function\"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading==\"boolean\"?this._loading:this.loadingChoices?\"choices\":!1}get status(){return this.cancelled?\"cancelled\":this.submitted?\"submitted\":\"pending\"}};Hde.exports=r5});var qde=_((ZHt,Gde)=>{\"use strict\";var n5=Zo(),ho=Ju(),i5={default:ho.noop,noop:ho.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||n5.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||n5.complement(this.primary)},primary:ho.cyan,success:ho.green,danger:ho.magenta,strong:ho.bold,warning:ho.yellow,muted:ho.dim,disabled:ho.gray,dark:ho.dim.gray,underline:ho.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse}};i5.merge=(t={})=>{t.styles&&typeof t.styles.enabled==\"boolean\"&&(ho.enabled=t.styles.enabled),t.styles&&typeof t.styles.visible==\"boolean\"&&(ho.visible=t.styles.visible);let e=n5.merge({},i5,t.styles);delete e.merge;for(let r of Object.keys(ho))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>ho[r]});for(let r of Object.keys(ho.styles))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>ho[r]});return e};Gde.exports=i5});var Yde=_(($Ht,Wde)=>{\"use strict\";var s5=process.platform===\"win32\",zp=Ju(),Rat=Zo(),o5={...zp.symbols,upDownDoubleArrow:\"\\u21D5\",upDownDoubleArrow2:\"\\u2B0D\",upDownArrow:\"\\u2195\",asterisk:\"*\",asterism:\"\\u2042\",bulletWhite:\"\\u25E6\",electricArrow:\"\\u2301\",ellipsisLarge:\"\\u22EF\",ellipsisSmall:\"\\u2026\",fullBlock:\"\\u2588\",identicalTo:\"\\u2261\",indicator:zp.symbols.check,leftAngle:\"\\u2039\",mark:\"\\u203B\",minus:\"\\u2212\",multiplication:\"\\xD7\",obelus:\"\\xF7\",percent:\"%\",pilcrow:\"\\xB6\",pilcrow2:\"\\u2761\",pencilUpRight:\"\\u2710\",pencilDownRight:\"\\u270E\",pencilRight:\"\\u270F\",plus:\"+\",plusMinus:\"\\xB1\",pointRight:\"\\u261E\",rightAngle:\"\\u203A\",section:\"\\xA7\",hexagon:{off:\"\\u2B21\",on:\"\\u2B22\",disabled:\"\\u2B22\"},ballot:{on:\"\\u2611\",off:\"\\u2610\",disabled:\"\\u2612\"},stars:{on:\"\\u2605\",off:\"\\u2606\",disabled:\"\\u2606\"},folder:{on:\"\\u25BC\",off:\"\\u25B6\",disabled:\"\\u25B6\"},prefix:{pending:zp.symbols.question,submitted:zp.symbols.check,cancelled:zp.symbols.cross},separator:{pending:zp.symbols.pointerSmall,submitted:zp.symbols.middot,cancelled:zp.symbols.middot},radio:{off:s5?\"( )\":\"\\u25EF\",on:s5?\"(*)\":\"\\u25C9\",disabled:s5?\"(|)\":\"\\u24BE\"},numbers:[\"\\u24EA\",\"\\u2460\",\"\\u2461\",\"\\u2462\",\"\\u2463\",\"\\u2464\",\"\\u2465\",\"\\u2466\",\"\\u2467\",\"\\u2468\",\"\\u2469\",\"\\u246A\",\"\\u246B\",\"\\u246C\",\"\\u246D\",\"\\u246E\",\"\\u246F\",\"\\u2470\",\"\\u2471\",\"\\u2472\",\"\\u2473\",\"\\u3251\",\"\\u3252\",\"\\u3253\",\"\\u3254\",\"\\u3255\",\"\\u3256\",\"\\u3257\",\"\\u3258\",\"\\u3259\",\"\\u325A\",\"\\u325B\",\"\\u325C\",\"\\u325D\",\"\\u325E\",\"\\u325F\",\"\\u32B1\",\"\\u32B2\",\"\\u32B3\",\"\\u32B4\",\"\\u32B5\",\"\\u32B6\",\"\\u32B7\",\"\\u32B8\",\"\\u32B9\",\"\\u32BA\",\"\\u32BB\",\"\\u32BC\",\"\\u32BD\",\"\\u32BE\",\"\\u32BF\"]};o5.merge=t=>{let e=Rat.merge({},zp.symbols,o5,t.symbols);return delete e.merge,e};Wde.exports=o5});var Jde=_((ejt,Vde)=>{\"use strict\";var Fat=qde(),Nat=Yde(),Oat=Zo();Vde.exports=t=>{t.options=Oat.merge({},t.options.theme,t.options),t.symbols=Nat.merge(t.options),t.styles=Fat.merge(t.options)}});var $de=_((Xde,Zde)=>{\"use strict\";var Kde=process.env.TERM_PROGRAM===\"Apple_Terminal\",Lat=Ju(),a5=Zo(),Ku=Zde.exports=Xde,_i=\"\\x1B[\",zde=\"\\x07\",l5=!1,j0=Ku.code={bell:zde,beep:zde,beginning:`${_i}G`,down:`${_i}J`,esc:_i,getPosition:`${_i}6n`,hide:`${_i}?25l`,line:`${_i}2K`,lineEnd:`${_i}K`,lineStart:`${_i}1K`,restorePosition:_i+(Kde?\"8\":\"u\"),savePosition:_i+(Kde?\"7\":\"s\"),screen:`${_i}2J`,show:`${_i}?25h`,up:`${_i}1J`},wm=Ku.cursor={get hidden(){return l5},hide(){return l5=!0,j0.hide},show(){return l5=!1,j0.show},forward:(t=1)=>`${_i}${t}C`,backward:(t=1)=>`${_i}${t}D`,nextLine:(t=1)=>`${_i}E`.repeat(t),prevLine:(t=1)=>`${_i}F`.repeat(t),up:(t=1)=>t?`${_i}${t}A`:\"\",down:(t=1)=>t?`${_i}${t}B`:\"\",right:(t=1)=>t?`${_i}${t}C`:\"\",left:(t=1)=>t?`${_i}${t}D`:\"\",to(t,e){return e?`${_i}${e+1};${t+1}H`:`${_i}${t+1}G`},move(t=0,e=0){let r=\"\";return r+=t<0?wm.left(-t):t>0?wm.right(t):\"\",r+=e<0?wm.up(-e):e>0?wm.down(e):\"\",r},restore(t={}){let{after:e,cursor:r,initial:s,input:a,prompt:n,size:c,value:f}=t;if(s=a5.isPrimitive(s)?String(s):\"\",a=a5.isPrimitive(a)?String(a):\"\",f=a5.isPrimitive(f)?String(f):\"\",c){let p=Ku.cursor.up(c)+Ku.cursor.to(n.length),h=a.length-r;return h>0&&(p+=Ku.cursor.left(h)),p}if(f||e){let p=!a&&s?-s.length:-a.length+r;return e&&(p-=e.length),a===\"\"&&s&&!n.includes(s)&&(p+=s.length),Ku.cursor.move(p)}}},c5=Ku.erase={screen:j0.screen,up:j0.up,down:j0.down,line:j0.line,lineEnd:j0.lineEnd,lineStart:j0.lineStart,lines(t){let e=\"\";for(let r=0;r<t;r++)e+=Ku.erase.line+(r<t-1?Ku.cursor.up(1):\"\");return t&&(e+=Ku.code.beginning),e}};Ku.clear=(t=\"\",e=process.stdout.columns)=>{if(!e)return c5.line+wm.to(0);let r=n=>[...Lat.unstyle(n)].length,s=t.split(/\\r?\\n/),a=0;for(let n of s)a+=1+Math.floor(Math.max(r(n)-1,0)/e);return(c5.line+wm.prevLine()).repeat(a-1)+c5.line+wm.to(0)}});var nC=_((tjt,tme)=>{\"use strict\";var Mat=Ie(\"events\"),eme=Ju(),u5=Mde(),Uat=_de(),_at=jde(),Hat=Jde(),pl=Zo(),Bm=$de(),f5=class t extends Mat{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,Hat(this),Uat(this),this.state=new _at(this),this.initial=[e.initial,e.default].find(r=>r!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=Gat(this.options.margin),this.setMaxListeners(0),jat(this)}async keypress(e,r={}){this.keypressed=!0;let s=u5.action(e,u5(e,r),this.options.actions);this.state.keypress=s,this.emit(\"keypress\",e,s),this.emit(\"state\",this.state.clone());let a=this.options[s.action]||this[s.action]||this.dispatch;if(typeof a==\"function\")return await a.call(this,e,s);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit(\"alert\"):this.stdout.write(Bm.code.beep)}cursorHide(){this.stdout.write(Bm.cursor.hide()),pl.onExit(()=>this.cursorShow())}cursorShow(){this.stdout.write(Bm.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let r=this.state.buffer;this.state.buffer=\"\",!(!r&&!e||this.options.show===!1)&&this.stdout.write(Bm.cursor.down(e)+Bm.clear(r,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:r,rest:s}=this.sections(),{cursor:a,initial:n=\"\",input:c=\"\",value:f=\"\"}=this,p=this.state.size=s.length,h={after:r,cursor:a,initial:n,input:c,prompt:e,size:p,value:f},E=Bm.cursor.restore(h);E&&this.stdout.write(E)}sections(){let{buffer:e,input:r,prompt:s}=this.state;s=eme.unstyle(s);let a=eme.unstyle(e),n=a.indexOf(s),c=a.slice(0,n),p=a.slice(n).split(`\n`),h=p[0],E=p[p.length-1],S=(s+(r?\" \"+r:\"\")).length,P=S<h.length?h.slice(S+1):\"\";return{header:c,prompt:h,after:P,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`\n`+this.symbols.pointer+\" \";typeof e==\"string\"?r+=e.trim():r+=\"Invalid input\",this.state.error=`\n`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit(\"submit\",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel==\"function\"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit(\"cancel\",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Bm.cursor.down(e.rest.length)),this.write(`\n`.repeat(r))}catch{}this.emit(\"close\")}start(){!this.stop&&this.options.show!==!1&&(this.stop=u5.listen(this,this.keypress.bind(this)),this.once(\"close\",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip==\"function\"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:s}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>s.call(this,this.value),typeof r.initial==\"function\"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun==\"function\"&&await r.onRun.call(this,this),typeof r.onSubmit==\"function\"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error(\"expected prompt to have a custom render method\")}run(){return new Promise(async(e,r)=>{if(this.once(\"submit\",e),this.once(\"cancel\",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit(\"run\")})}async element(e,r,s){let{options:a,state:n,symbols:c,timers:f}=this,p=f&&f[e];n.timer=p;let h=a[e]||n[e]||c[e],E=r&&r[e]!=null?r[e]:await h;if(E===\"\")return E;let C=await this.resolve(E,n,r,s);return!C&&r&&r[e]?this.resolve(h,n,r,s):C}async prefix(){let e=await this.element(\"prefix\")||this.symbols,r=this.timers&&this.timers.prefix,s=this.state;return s.timer=r,pl.isObject(e)&&(e=e[s.status]||e.pending),pl.hasColor(e)?e:(this.styles[s.status]||this.styles.pending)(e)}async message(){let e=await this.element(\"message\");return pl.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element(\"separator\")||this.symbols,r=this.timers&&this.timers.separator,s=this.state;s.timer=r;let a=e[s.status]||e.pending||s.separator,n=await this.resolve(a,s);return pl.isObject(n)&&(n=n[s.status]||n.pending),pl.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let s=await this.element(\"pointer\",e,r);if(typeof s==\"string\"&&pl.hasColor(s))return s;if(s){let a=this.styles,n=this.index===r,c=n?a.primary:h=>h,f=await this.resolve(s[n?\"on\":\"off\"]||s,this.state),p=pl.hasColor(f)?f:c(f);return n?p:\" \".repeat(f.length)}}async indicator(e,r){let s=await this.element(\"indicator\",e,r);if(typeof s==\"string\"&&pl.hasColor(s))return s;if(s){let a=this.styles,n=e.enabled===!0,c=n?a.success:a.dark,f=s[n?\"on\":\"off\"]||s;return pl.hasColor(f)?f:c(f)}return\"\"}body(){return null}footer(){if(this.state.status===\"pending\")return this.element(\"footer\")}header(){if(this.state.status===\"pending\")return this.element(\"header\")}async hint(){if(this.state.status===\"pending\"&&!this.isValue(this.state.input)){let e=await this.element(\"hint\");return pl.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?\"\":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==\"\"}resolve(e,...r){return pl.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||pl.height(this.stdout,25)}get width(){return this.options.columns||pl.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,s=[r,e].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return e=>new this(e).run()}};function jat(t){let e=a=>t[a]===void 0||typeof t[a]==\"function\",r=[\"actions\",\"choices\",\"initial\",\"margin\",\"roles\",\"styles\",\"symbols\",\"theme\",\"timers\",\"value\"],s=[\"body\",\"footer\",\"error\",\"header\",\"hint\",\"indicator\",\"message\",\"prefix\",\"separator\",\"skip\"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n==\"function\"&&e(a)?s.includes(a)||(t[a]=n.bind(t)):typeof t[a]!=\"function\"&&(t[a]=n)}}function Gat(t){typeof t==\"number\"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=a=>a%2===0?`\n`:\" \",s=[];for(let a=0;a<4;a++){let n=r(a);e[a]?s.push(n.repeat(e[a])):s.push(\"\")}return s}tme.exports=f5});var ime=_((rjt,nme)=>{\"use strict\";var qat=Zo(),rme={default(t,e){return e},checkbox(t,e){throw new Error(\"checkbox role is not implemented yet\")},editable(t,e){throw new Error(\"editable role is not implemented yet\")},expandable(t,e){throw new Error(\"expandable role is not implemented yet\")},heading(t,e){return e.disabled=\"\",e.indicator=[e.indicator,\" \"].find(r=>r!=null),e.message=e.message||\"\",e},input(t,e){throw new Error(\"input role is not implemented yet\")},option(t,e){return rme.default(t,e)},radio(t,e){throw new Error(\"radio role is not implemented yet\")},separator(t,e){return e.disabled=\"\",e.indicator=[e.indicator,\" \"].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};nme.exports=(t,e={})=>{let r=qat.merge({},rme,e.roles);return r[t]||r.default}});var Wv=_((njt,ame)=>{\"use strict\";var Wat=Ju(),Yat=nC(),Vat=ime(),zR=Zo(),{reorder:A5,scrollUp:Jat,scrollDown:Kat,isObject:sme,swap:zat}=zR,p5=class extends Yat{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=\"\"}async initialize(){typeof this.options.initial==\"function\"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:s,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!=\"function\"&&this.selectable.length===0)throw new Error(\"At least one choice must be selectable\");sme(r)&&(r=Object.keys(r)),Array.isArray(r)?(s!=null&&(this.index=this.findIndex(s)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(r=s),typeof r==\"string\"&&(r=this.findIndex(r)),typeof r==\"number\"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let s=[],a=0,n=async(c,f)=>{typeof c==\"function\"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let p=0;p<c.length;p++){let h=c[p]=await this.toChoice(c[p],a++,f);s.push(h),h.choices&&await n(h.choices,h)}return s};return n(e,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(e,r,s){if(typeof e==\"function\"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e==\"string\"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let a=e.value;if(e=Vat(e.role,this.options)(this,e),typeof e.disabled==\"string\"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint=\"(disabled)\"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||\"\",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input=\"\",e.index=r,e.cursor=0,zR.define(e,\"parent\",s),e.level=s?s.level+1:1,e.indent==null&&(e.indent=s?s.indent+\"  \":e.indent||\"\"),e.path=s?s.path+\".\"+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,Wat.unstyle(e.message).length));let c={...e};return e.reset=(f=c.input,p=c.value)=>{for(let h of Object.keys(c))e[h]=c[h];e.input=f,e.value=p},a==null&&typeof e.initial==\"function\"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit(\"choice\",e,r,this),typeof e.onChoice==\"function\"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,s){let a=await this.toChoice(e,r,s);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,s){let a={name:\"New choice name?\",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input=\"\",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?\"  \".repeat(e.level-1):\"\":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!=\"boolean\"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!=\"boolean\"&&(r=!e.enabled),e.enabled=r,e.choices&&e.choices.forEach(a=>this.toggle(a,r));let s=e.parent;for(;s;){let a=s.choices.filter(n=>this.isDisabled(n));s.enabled=a.every(n=>n.enabled===!0),s=s.parent}return ome(this,this.choices),this.emit(\"toggle\",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let r=s=>{let a=Number(s);if(a>this.choices.length-1)return this.alert();let n=this.focused,c=this.choices.find(f=>a===f.index);if(!c.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(c)===-1){let f=A5(this.choices),p=f.indexOf(c);if(n.index>p){let h=f.slice(p,p+this.limit),E=f.filter(C=>!h.includes(C));this.choices=h.concat(E)}else{let h=p-this.limit+1;this.choices=f.slice(h).concat(f.slice(0,h))}}return this.index=this.choices.indexOf(c),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(s=>{let a=this.choices.length,n=this.num,c=(f=!1,p)=>{clearTimeout(this.numberTimeout),f&&(p=r(n)),this.num=\"\",s(p)};if(n===\"0\"||n.length===1&&+(n+\"0\")>a)return c(!0);if(Number(n)>a)return c(!1,this.alert());this.numberTimeout=setTimeout(()=>c(!0),this.delay)})}home(){return this.choices=A5(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,r=A5(this.choices);return this.choices=r.slice(e).concat(r.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,r=this.visible.length,s=this.index;return this.options.scroll===!1&&s===0?this.alert():e>r&&s===0?this.scrollUp():(this.index=(s-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,r=this.visible.length,s=this.index;return this.options.scroll===!1&&s===r-1?this.alert():e>r&&s===r-1?this.scrollDown():(this.index=(s+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=Jat(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=Kat(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){zat(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&[\"disabled\",\"collapsed\",\"hidden\",\"completing\",\"readonly\"].some(s=>e[s]===!0)?!0:e&&e.role===\"heading\"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(r=>this.isEnabled(r));if(e.choices){let r=e.choices.filter(s=>!this.isDisabled(s));return e.enabled&&r.every(s=>this.isEnabled(s))}return e.enabled&&!this.isDisabled(e)}isChoice(e,r){return e.name===r||e.index===Number(r)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(r=>this.isChoice(e,r)):this.isChoice(e,this.initial)}map(e=[],r=\"value\"){return[].concat(e||[]).reduce((s,a)=>(s[a]=this.find(a,r),s),{})}filter(e,r){let a=typeof e==\"function\"?e:(f,p)=>[f.name,p].includes(e),c=(this.options.multiple?this.state._choices:this.choices).filter(a);return r?c.map(f=>f[r]):c}find(e,r){if(sme(e))return r?e[r]:e;let a=typeof e==\"function\"?e:(c,f)=>[c.name,f].includes(e),n=this.choices.find(a);if(n)return r?n[r]:n}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(c=>c.newChoice))return this.alert();let{reorder:r,sort:s}=this.options,a=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&r!==!1&&s!==!0&&(n=zR.reorder(n)),this.value=a?n.map(c=>c.name):n.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let r of e)this.state._choices.some(s=>s.name===r.name)||this.state._choices.push(r);if(!this._initial&&this.options.initial){this._initial=!0;let r=this.initial;if(typeof r==\"string\"||typeof r==\"number\"){let s=this.find(r);s&&(this.initial=s.index,this.focus(s,!0))}}}get choices(){return ome(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:r,choices:s}=this,a=e.limit||this._limit||r.limit||s.length;return Math.min(a,this.height)}set value(e){super.value=e}get value(){return typeof super.value!=\"string\"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function ome(t,e){if(e instanceof Promise)return e;if(typeof e==\"function\"){if(zR.isAsyncFn(e))return e;e=e.call(t,t)}for(let r of e){if(Array.isArray(r.choices)){let s=r.choices.filter(a=>!t.isDisabled(a));r.enabled=s.every(a=>a.enabled===!0)}t.isDisabled(r)===!0&&delete r.enabled}return e}ame.exports=p5});var G0=_((ijt,lme)=>{\"use strict\";var Xat=Wv(),h5=Zo(),g5=class extends Xat{constructor(e){super(e),this.emptyError=this.options.emptyError||\"No items were selected\"}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,r){return!this.multiple||this.options.pointer?super.pointer(e,r):\"\"}indicator(e,r){return this.multiple?super.indicator(e,r):\"\"}choiceMessage(e,r){let s=this.resolve(e.message,this.state,e,r);return e.role===\"heading\"&&!h5.hasColor(s)&&(s=this.styles.strong(s)),this.resolve(s,this.state,e,r)}choiceSeparator(){return\":\"}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=await this.pointer(e,r),n=await this.indicator(e,r)+(e.pad||\"\"),c=await this.resolve(e.hint,this.state,e,r);c&&!h5.hasColor(c)&&(c=this.styles.muted(c));let f=this.indent(e),p=await this.choiceMessage(e,r),h=()=>[this.margin[3],f+a+n,p,this.margin[1],c].filter(Boolean).join(\" \");return e.role===\"heading\"?h():e.disabled?(h5.hasColor(p)||(p=this.styles.disabled(p)),h()):(s&&(p=this.styles.em(p)),h())}async renderChoices(){if(this.state.loading===\"choices\")return this.styles.warning(\"Loading choices\");if(this.state.submitted)return\"\";let e=this.visible.map(async(n,c)=>await this.renderChoice(n,c)),r=await Promise.all(e);r.length||r.push(this.styles.danger(\"No matching choices\"));let s=this.margin[0]+r.join(`\n`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,s].filter(Boolean).join(`\n`)}format(){return!this.state.submitted||this.state.cancelled?\"\":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(\", \"):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,s=\"\",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(s=[n,f,c,\"\"].join(\" \"),this.state.prompt=s);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();p&&(s+=p),h&&!s.includes(h)&&(s+=\" \"+h),e&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,s,E,C].filter(Boolean).join(`\n`)),this.write(this.margin[2]),this.restore()}};lme.exports=g5});var ume=_((sjt,cme)=>{\"use strict\";var Zat=G0(),$at=(t,e)=>{let r=t.toLowerCase();return s=>{let n=s.toLowerCase().indexOf(r),c=e(s.slice(n,n+r.length));return n>=0?s.slice(0,n)+c+s.slice(n+r.length):s}},d5=class extends Zat{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:s}=this.state;return this.input=s.slice(0,r)+e+s.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest==\"function\")return this.options.suggest.call(this,e,r);let s=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(s))}pointer(){return\"\"}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(\", \");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!==\"pending\")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=$at(this.input,e),s=this.choices;this.choices=s.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=s}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};cme.exports=d5});var y5=_((ojt,fme)=>{\"use strict\";var m5=Zo();fme.exports=(t,e={})=>{t.cursorHide();let{input:r=\"\",initial:s=\"\",pos:a,showCursor:n=!0,color:c}=e,f=c||t.styles.placeholder,p=m5.inverse(t.styles.primary),h=R=>p(t.styles.black(R)),E=r,C=\" \",S=h(C);if(t.blink&&t.blink.off===!0&&(h=R=>R,S=\"\"),n&&a===0&&s===\"\"&&r===\"\")return h(C);if(n&&a===0&&(r===s||r===\"\"))return h(s[0])+f(s.slice(1));s=m5.isPrimitive(s)?`${s}`:\"\",r=m5.isPrimitive(r)?`${r}`:\"\";let P=s&&s.startsWith(r)&&s!==r,I=P?h(s[r.length]):S;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),I=\"\"),n===!1&&(I=\"\"),P){let R=t.styles.unstyle(E+I);return E+I+f(s.slice(R.length))}return E+I}});var XR=_((ajt,Ame)=>{\"use strict\";var elt=Ju(),tlt=G0(),rlt=y5(),E5=class extends tlt{constructor(e){super({...e,multiple:!0}),this.type=\"form\",this.initial=this.options.initial,this.align=[this.options.align,\"right\"].find(r=>r!=null),this.emptyError=\"\",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:s,input:a}=r;return r.value=r.input=a.slice(0,s)+e+a.slice(s),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:s}=e;return e.value=e.input=s.slice(0,r-1)+s.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:s}=e;if(s[r]===void 0)return this.alert();let a=`${s}`.slice(0,r)+`${s}`.slice(r+1);return e.value=e.input=a,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:s}=e;return r&&r.startsWith(s)&&s!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input=\"\",e.cursor=0,this.render()):this.alert()}separator(){return\"\"}format(e){return this.state.submitted?\"\":super.format(e)}pointer(){return\"\"}indicator(e){return e.input?\"\\u29BF\":\"\\u2299\"}async choiceSeparator(e,r){let s=await this.resolve(e.separator,this.state,e,r)||\":\";return s?\" \"+this.styles.disabled(s):\"\"}async renderChoice(e,r){await this.onChoice(e,r);let{state:s,styles:a}=this,{cursor:n,initial:c=\"\",name:f,hint:p,input:h=\"\"}=e,{muted:E,submitted:C,primary:S,danger:P}=a,I=p,R=this.index===r,N=e.validate||(()=>!0),U=await this.choiceSeparator(e,r),W=e.message;this.align===\"right\"&&(W=W.padStart(this.longest+1,\" \")),this.align===\"left\"&&(W=W.padEnd(this.longest+1,\" \"));let ee=this.values[f]=h||c,ie=h?\"success\":\"dark\";await N.call(e,ee,this.state)!==!0&&(ie=\"danger\");let ue=a[ie],le=ue(await this.indicator(e,r))+(e.pad||\"\"),me=this.indent(e),pe=()=>[me,le,W+U,h,I].filter(Boolean).join(\" \");if(s.submitted)return W=elt.unstyle(W),h=C(h),I=\"\",pe();if(e.format)h=await e.format.call(this,h,e,r);else{let Be=this.styles.muted;h=rlt(this,{input:h,initial:c,pos:n,showCursor:R,color:Be})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[f]=await e.result.call(this,ee,e,r)),R&&(W=S(W)),e.error?h+=(h?\" \":\"\")+P(e.error.trim()):e.hint&&(h+=(h?\" \":\"\")+E(e.hint.trim())),pe()}async submit(){return this.value=this.values,super.base.submit.call(this)}};Ame.exports=E5});var I5=_((ljt,hme)=>{\"use strict\";var nlt=XR(),ilt=()=>{throw new Error(\"expected prompt to have a custom authenticate method\")},pme=(t=ilt)=>{class e extends nlt{constructor(s){super(s)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(s){return pme(s)}}return e};hme.exports=pme()});var mme=_((cjt,dme)=>{\"use strict\";var slt=I5();function olt(t,e){return t.username===this.options.username&&t.password===this.options.password}var gme=(t=olt)=>{let e=[{name:\"username\",message:\"username\"},{name:\"password\",message:\"password\",format(s){return this.options.showPassword?s:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(s.length))}}];class r extends slt.create(t){constructor(a){super({...a,choices:e})}static create(a){return gme(a)}}return r};dme.exports=gme()});var ZR=_((ujt,yme)=>{\"use strict\";var alt=nC(),{isPrimitive:llt,hasColor:clt}=Zo(),C5=class extends alt{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:r,state:s}=this;return s.submitted?r.success(e):r.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return llt(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status===\"pending\"){let e=await this.element(\"hint\");return clt(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=this.styles.muted(this.default),f=[s,n,c,a].filter(Boolean).join(\" \");this.state.prompt=f;let p=await this.header(),h=this.value=this.cast(e),E=await this.format(h),C=await this.error()||await this.hint(),S=await this.footer();C&&!f.includes(C)&&(E+=\" \"+C),f+=\" \"+E,this.clear(r),this.write([p,f,S].filter(Boolean).join(`\n`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};yme.exports=C5});var Ime=_((fjt,Eme)=>{\"use strict\";var ult=ZR(),w5=class extends ult{constructor(e){super(e),this.default=this.options.default||(this.initial?\"(Y/n)\":\"(y/N)\")}};Eme.exports=w5});var wme=_((Ajt,Cme)=>{\"use strict\";var flt=G0(),Alt=XR(),iC=Alt.prototype,B5=class extends flt{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,\"left\"].find(r=>r!=null),this.emptyError=\"\",this.values={}}dispatch(e,r){let s=this.focused,a=s.parent||{};return!s.editable&&!a.editable&&(e===\"a\"||e===\"i\")?super[e]():iC.dispatch.call(this,e,r)}append(e,r){return iC.append.call(this,e,r)}delete(e,r){return iC.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?iC.next.call(this):super.next()}prev(){return this.focused.editable?iC.prev.call(this):super.prev()}async indicator(e,r){let s=e.indicator||\"\",a=e.editable?s:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||\"\"}indent(e){return e.role===\"heading\"?\"\":e.editable?\" \":\"  \"}async renderChoice(e,r){return e.indent=\"\",e.editable?iC.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return\"\"}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!=\"function\"||r.role===\"heading\")continue;let s=r.parent?this.value[r.parent.name]:this.value;if(r.editable?s=r.value===r.name?r.initial||\"\":r.value:this.isDisabled(r)||(s=r.enabled===!0),e=await r.validate(s,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e==\"string\"?e:\"Invalid Input\"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role===\"heading\"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||\"\":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Cme.exports=B5});var vm=_((pjt,Bme)=>{\"use strict\";var plt=nC(),hlt=y5(),{isPrimitive:glt}=Zo(),v5=class extends plt{constructor(e){super(e),this.initial=glt(this.initial)?String(this.initial):\"\",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let s=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name===\"return\"&&(!s||s.name!==\"return\")?this.append(`\n`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value=\"\",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:s}=this.state;this.input=`${s}`.slice(0,r)+e+`${s}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),s=this.input.slice(e),a=r.split(\" \");this.state.clipboard.push(a.pop()),this.input=a.join(\" \"),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):\"\";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):hlt(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),s=await this.separator(),a=await this.message(),n=[r,a,s].filter(Boolean).join(\" \");this.state.prompt=n;let c=await this.header(),f=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!f.includes(p)&&(f+=\" \"+p),n+=\" \"+f,this.clear(e),this.write([c,n,h].filter(Boolean).join(`\n`)),this.restore()}};Bme.exports=v5});var Sme=_((hjt,vme)=>{\"use strict\";var dlt=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),$R=t=>dlt(t).filter(Boolean);vme.exports=(t,e={},r=\"\")=>{let{past:s=[],present:a=\"\"}=e,n,c;switch(t){case\"prev\":case\"undo\":return n=s.slice(0,s.length-1),c=s[s.length-1]||\"\",{past:$R([r,...n]),present:c};case\"next\":case\"redo\":return n=s.slice(1),c=s[0]||\"\",{past:$R([...n,r]),present:c};case\"save\":return{past:$R([...s,r]),present:\"\"};case\"remove\":return c=$R(s.filter(f=>f!==r)),a=\"\",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: \"${t}\"`)}}});var D5=_((gjt,bme)=>{\"use strict\";var mlt=vm(),Dme=Sme(),S5=class extends mlt{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let s=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get(\"values\")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Dme(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion(\"prev\")}altDown(){return this.completion(\"next\")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=Dme(\"save\",this.data,this.input),this.store.set(\"values\",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};bme.exports=S5});var xme=_((djt,Pme)=>{\"use strict\";var ylt=vm(),b5=class extends ylt{format(){return\"\"}};Pme.exports=b5});var Qme=_((mjt,kme)=>{\"use strict\";var Elt=vm(),P5=class extends Elt{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||\"\"}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(\", \")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};kme.exports=P5});var Rme=_((yjt,Tme)=>{\"use strict\";var Ilt=G0(),x5=class extends Ilt{constructor(e){super({...e,multiple:!0})}};Tme.exports=x5});var Q5=_((Ejt,Fme)=>{\"use strict\";var Clt=vm(),k5=class extends Clt{constructor(e={}){super({style:\"number\",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:\"\",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e===\".\"&&this.input.includes(\".\")?this.alert(\"invalid number\"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,s=this.toNumber(this.input);return s>this.max+r?this.alert():(this.input=`${s+r}`,this.render())}down(e){let r=e||this.minor,s=this.toNumber(this.input);return s<this.min-r?this.alert():(this.input=`${s-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format==\"function\"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=\"\"){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\\.)|(\\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};Fme.exports=k5});var Ome=_((Ijt,Nme)=>{Nme.exports=Q5()});var Mme=_((Cjt,Lme)=>{\"use strict\";var wlt=vm(),T5=class extends wlt{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):\"\"}};Lme.exports=T5});var Hme=_((wjt,_me)=>{\"use strict\";var Blt=Ju(),vlt=Wv(),Ume=Zo(),R5=class extends vlt{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||\"left\"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`\n   `;let r=e.startNumber||1;typeof this.scale==\"number\"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let s=0;s<this.scale.length;s++)r.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,s){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return\"\"}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(\", \"):\"\"}pointer(){return\"\"}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?\"\":[\"\",...this.scale.map(s=>`   ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`\n`)}renderScaleHeading(e){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading==\"function\"&&(r=this.options.renderScaleHeading.call(this,e));let s=this.scaleLength-r.join(\"\").length,a=Math.round(s/(r.length-1)),c=r.map(p=>this.styles.strong(p)).join(\" \".repeat(a)),f=\" \".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(e,r,s){if(typeof this.options.scaleIndicator==\"function\")return this.options.scaleIndicator.call(this,e,r,s);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let s=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term===\"Hyper\"?\"\":\" \";return s.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!Ume.hasColor(n)&&(n=this.styles.muted(n));let c=I=>this.margin[3]+I.replace(/\\s+$/,\"\").padEnd(this.widths[0],\" \"),f=this.newline,p=this.indent(e),h=await this.resolve(e.message,this.state,e,r),E=await this.renderScale(e,r),C=this.margin[1]+this.margin[3];this.scaleLength=Blt.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let P=Ume.wordWrap(h,{width:this.widths[0],newline:f}).split(`\n`).map(I=>c(I)+this.margin[1]);return s&&(E=this.styles.info(E),P=P.map(I=>this.styles.info(I))),P[0]+=E,this.linebreak&&P.push(\"\"),[p+a,P.join(`\n`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return\"\";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),s=await this.renderScaleHeading();return this.margin[0]+[s,...r.map(a=>a.join(\" \"))].join(`\n`)}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=\"\";this.options.promptLine!==!1&&(c=[s,n,a,\"\"].join(\" \"),this.state.prompt=c);let f=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),C=await this.renderChoices(),S=await this.footer(),P=this.emptyError;p&&(c+=p),E&&!c.includes(E)&&(c+=\" \"+E),e&&!p&&!C.trim()&&this.multiple&&P!=null&&(c+=this.styles.danger(P)),this.clear(r),this.write([f,c,h,C,S].filter(Boolean).join(`\n`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};_me.exports=R5});var qme=_((Bjt,Gme)=>{\"use strict\";var jme=Ju(),Slt=(t=\"\")=>typeof t==\"string\"?t.replace(/^['\"]|['\"]$/g,\"\"):\"\",N5=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=Slt(e.initial||this.field.initial||\"\"),this.message=e.message||this.name,this.cursor=0,this.input=\"\",this.lines=[]}},Dlt=async(t={},e={},r=s=>s)=>{let s=new Set,a=t.fields||[],n=t.template,c=[],f=[],p=[],h=1;typeof n==\"function\"&&(n=await n());let E=-1,C=()=>n[++E],S=()=>n[E+1],P=I=>{I.line=h,c.push(I)};for(P({type:\"bos\",value:\"\"});E<n.length-1;){let I=C();if(/^[^\\S\\n ]$/.test(I)){P({type:\"text\",value:I});continue}if(I===`\n`){P({type:\"newline\",value:I}),h++;continue}if(I===\"\\\\\"){I+=C(),P({type:\"text\",value:I});continue}if((I===\"$\"||I===\"#\"||I===\"{\")&&S()===\"{\"){let N=C();I+=N;let U={type:\"template\",open:I,inner:\"\",close:\"\",value:I},W;for(;W=C();){if(W===\"}\"){S()===\"}\"&&(W+=C()),U.value+=W,U.close=W;break}W===\":\"?(U.initial=\"\",U.key=U.inner):U.initial!==void 0&&(U.initial+=W),U.value+=W,U.inner+=W}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,e.hasOwnProperty(U.key)&&(U.initial=e[U.key]),U=r(U),P(U),p.push(U.key),s.add(U.key);let ee=f.find(ie=>ie.name===U.key);U.field=a.find(ie=>ie.name===U.key),ee||(ee=new N5(U),f.push(ee)),ee.lines.push(U.line-1);continue}let R=c[c.length-1];R.type===\"text\"&&R.line===h?R.value+=I:P({type:\"text\",value:I})}return P({type:\"eos\",value:\"\"}),{input:n,tabstops:c,unique:s,keys:p,items:f}};Gme.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),s={...e.values,...e.initial},{tabstops:a,items:n,keys:c}=await Dlt(e,s),f=F5(\"result\",t,e),p=F5(\"format\",t,e),h=F5(\"validate\",t,e,!0),E=t.isValue.bind(t);return async(C={},S=!1)=>{let P=0;C.required=r,C.items=n,C.keys=c,C.output=\"\";let I=async(W,ee,ie,ue)=>{let le=await h(W,ee,ie,ue);return le===!1?\"Invalid field \"+ie.name:le};for(let W of a){let ee=W.value,ie=W.key;if(W.type!==\"template\"){ee&&(C.output+=ee);continue}if(W.type===\"template\"){let ue=n.find(Ce=>Ce.name===ie);e.required===!0&&C.required.add(ue.name);let le=[ue.input,C.values[ue.value],ue.value,ee].find(E),pe=(ue.field||{}).message||W.inner;if(S){let Ce=await I(C.values[ie],C,ue,P);if(Ce&&typeof Ce==\"string\"||Ce===!1){C.invalid.set(ie,Ce);continue}C.invalid.delete(ie);let g=await f(C.values[ie],C,ue,P);C.output+=jme.unstyle(g);continue}ue.placeholder=!1;let Be=ee;ee=await p(ee,C,ue,P),le!==ee?(C.values[ie]=le,ee=t.styles.typing(le),C.missing.delete(pe)):(C.values[ie]=void 0,le=`<${pe}>`,ee=t.styles.primary(le),ue.placeholder=!0,C.required.has(ie)&&C.missing.add(pe)),C.missing.has(pe)&&C.validating&&(ee=t.styles.warning(le)),C.invalid.has(ie)&&C.validating&&(ee=t.styles.danger(le)),P===C.index&&(Be!==ee?ee=t.styles.underline(ee):ee=t.styles.heading(jme.unstyle(ee))),P++}ee&&(C.output+=ee)}let R=C.output.split(`\n`).map(W=>\" \"+W),N=n.length,U=0;for(let W of n)C.invalid.has(W.name)&&W.lines.forEach(ee=>{R[ee][0]===\" \"&&(R[ee]=C.styles.danger(C.symbols.bullet)+R[ee].slice(1))}),t.isValue(C.values[W.name])&&U++;return C.completed=(U/N*100).toFixed(0),C.output=R.join(`\n`),C.output}};function F5(t,e,r,s){return(a,n,c,f)=>typeof c.field[t]==\"function\"?c.field[t].call(e,a,n,c,f):[s,a].find(p=>e.isValue(p))}});var Yme=_((vjt,Wme)=>{\"use strict\";var blt=Ju(),Plt=qme(),xlt=nC(),O5=class extends xlt{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Plt(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let s=this.getItem(),a=s.input.slice(0,this.cursor),n=s.input.slice(this.cursor);this.input=s.input=`${a}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),s=e.input.slice(0,this.cursor-1);this.input=e.input=`${s}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:s,size:a}=this.state,n=[this.options.newline,`\n`].find(W=>W!=null),c=await this.prefix(),f=await this.separator(),p=await this.message(),h=[c,p,f].filter(Boolean).join(\" \");this.state.prompt=h;let E=await this.header(),C=await this.error()||\"\",S=await this.hint()||\"\",P=s?\"\":await this.interpolate(this.state),I=this.state.key=r[e]||\"\",R=await this.format(I),N=await this.footer();R&&(h+=\" \"+R),S&&!R&&this.state.completed===0&&(h+=\" \"+S),this.clear(a);let U=[E,h,P,N,C.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:s,index:a}=this.state,n=r.find(c=>c.name===s[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!=\"function\"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:s,values:a}=this.state;if(e.size){let f=\"\";for(let[p,h]of e)f+=`Invalid ${p}: ${h}\n`;return this.state.error=f,super.submit()}if(r.size)return this.state.error=\"Required: \"+[...r.keys()].join(\", \"),super.submit();let c=blt.unstyle(s).split(`\n`).map(f=>f.slice(1)).join(`\n`);return this.value={values:a,result:c},super.submit()}};Wme.exports=O5});var Jme=_((Sjt,Vme)=>{\"use strict\";var klt=\"(Use <shift>+<up/down> to sort)\",Qlt=G0(),L5=class extends Qlt{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,klt].find(this.isValue.bind(this))}indicator(){return\"\"}async renderChoice(e,r){let s=await super.renderChoice(e,r),a=this.symbols.identicalTo+\" \",n=this.index===r&&this.sorting?this.styles.muted(a):\"  \";return this.options.drag===!1&&(n=\"\"),this.options.numbered===!0?n+`${r+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Vme.exports=L5});var zme=_((Djt,Kme)=>{\"use strict\";var Tlt=Wv(),M5=class extends Tlt{constructor(e={}){if(super(e),this.emptyError=e.emptyError||\"No items were selected\",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=[\"\",\"4 - Strongly Agree\",\"3 - Agree\",\"2 - Neutral\",\"1 - Disagree\",\"0 - Strongly Disagree\",\"\"];r=r.map(s=>this.styles.muted(s)),this.state.header=r.join(`\n   `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let s of r)s.scale=Rlt(5,this.options),s.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],s=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!s,this.render()}indicator(){return\"\"}pointer(){return\"\"}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return\"   \"}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=this.term===\"Hyper\",n=a?9:8,c=a?\"\":\" \",f=this.symbols.line.repeat(n),p=\" \".repeat(n+(a?0:1)),h=ee=>(ee?this.styles.success(\"\\u25C9\"):\"\\u25EF\")+c,E=r+1+\".\",C=s?this.styles.heading:this.styles.noop,S=await this.resolve(e.message,this.state,e,r),P=this.indent(e),I=P+e.scale.map((ee,ie)=>h(ie===e.scaleIdx)).join(f),R=ee=>ee===e.scaleIdx?C(ee):ee,N=P+e.scale.map((ee,ie)=>R(ie)).join(p),U=()=>[E,S].filter(Boolean).join(\" \"),W=()=>[U(),I,N,\" \"].filter(Boolean).join(`\n`);return s&&(I=this.styles.cyan(I),N=this.styles.cyan(N)),W()}async renderChoices(){if(this.state.submitted)return\"\";let e=this.visible.map(async(s,a)=>await this.renderChoice(s,a)),r=await Promise.all(e);return r.length||r.push(this.styles.danger(\"No matching choices\")),r.join(`\n`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(\", \"):\"\"}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=[s,n,a].filter(Boolean).join(\" \");this.state.prompt=c;let f=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();(p||!h)&&(c+=\" \"+p),h&&!c.includes(h)&&(c+=\" \"+h),e&&!p&&!E&&this.multiple&&this.type!==\"form\"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,E,C].filter(Boolean).join(`\n`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function Rlt(t,e={}){if(Array.isArray(e.scale))return e.scale.map(s=>({...s}));let r=[];for(let s=1;s<t+1;s++)r.push({i:s,selected:!1});return r}Kme.exports=M5});var Zme=_((bjt,Xme)=>{Xme.exports=D5()});var eye=_((Pjt,$me)=>{\"use strict\";var Flt=ZR(),U5=class extends Flt{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||\"no\",this.enabled=this.options.enabled||\"yes\",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e=\"\",r){switch(e.toLowerCase()){case\" \":return this.toggle();case\"1\":case\"y\":case\"t\":return this.enable();case\"0\":case\"n\":case\"f\":return this.disable();default:return this.alert()}}format(){let e=s=>this.styles.primary.underline(s);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(\" / \"))}async render(){let{size:e}=this.state,r=await this.header(),s=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),p=await this.footer(),h=[s,n,a,c].join(\" \");this.state.prompt=h,f&&!h.includes(f)&&(h+=\" \"+f),this.clear(e),this.write([r,h,p].filter(Boolean).join(`\n`)),this.write(this.margin[2]),this.restore()}};$me.exports=U5});var rye=_((xjt,tye)=>{\"use strict\";var Nlt=G0(),_5=class extends Nlt{constructor(e){if(super(e),typeof this.options.correctChoice!=\"number\"||this.options.correctChoice<0)throw new Error(\"Please specify the index of the correct answer from the list of choices\")}async toChoices(e,r){let s=await super.toChoices(e,r);if(s.length<2)throw new Error(\"Please give at least two choices to the user\");if(this.options.correctChoice>s.length)throw new Error(\"Please specify the index of the correct answer from the list of choices\");return s}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};tye.exports=_5});var iye=_(H5=>{\"use strict\";var nye=Zo(),ks=(t,e)=>{nye.defineExport(H5,t,e),nye.defineExport(H5,t.toLowerCase(),e)};ks(\"AutoComplete\",()=>ume());ks(\"BasicAuth\",()=>mme());ks(\"Confirm\",()=>Ime());ks(\"Editable\",()=>wme());ks(\"Form\",()=>XR());ks(\"Input\",()=>D5());ks(\"Invisible\",()=>xme());ks(\"List\",()=>Qme());ks(\"MultiSelect\",()=>Rme());ks(\"Numeral\",()=>Ome());ks(\"Password\",()=>Mme());ks(\"Scale\",()=>Hme());ks(\"Select\",()=>G0());ks(\"Snippet\",()=>Yme());ks(\"Sort\",()=>Jme());ks(\"Survey\",()=>zme());ks(\"Text\",()=>Zme());ks(\"Toggle\",()=>eye());ks(\"Quiz\",()=>rye())});var oye=_((Qjt,sye)=>{sye.exports={ArrayPrompt:Wv(),AuthPrompt:I5(),BooleanPrompt:ZR(),NumberPrompt:Q5(),StringPrompt:vm()}});var Vv=_((Tjt,lye)=>{\"use strict\";var aye=Ie(\"assert\"),G5=Ie(\"events\"),q0=Zo(),zu=class extends G5{constructor(e,r){super(),this.options=q0.merge({},e),this.answers={...r}}register(e,r){if(q0.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}aye.equal(typeof r,\"function\",\"expected a function\");let s=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[s]=r:this.prompts[s]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r==\"function\"&&(r=await r.call(this)),await this.ask(q0.merge({},this.options,r))}catch(s){return Promise.reject(s)}return this.answers}async ask(e){typeof e==\"function\"&&(e=await e.call(this));let r=q0.merge({},this.options,e),{type:s,name:a}=e,{set:n,get:c}=q0;if(typeof s==\"function\"&&(s=await s.call(this,e,this.answers)),!s)return this.answers[a];aye(this.prompts[s],`Prompt \"${s}\" is not registered`);let f=new this.prompts[s](r),p=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on(\"submit\",E=>{this.emit(\"answer\",a,E,f),n(this.answers,a,E)});let h=f.emit.bind(f);return f.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit(\"prompt\",f,this),r.autofill&&p!=null?(f.value=f.input=p,r.autofill===\"show\"&&await f.submit()):p=f.value=await f.run(),p}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||nC()}static get prompts(){return iye()}static get types(){return oye()}static get prompt(){let e=(r,...s)=>{let a=new this(...s),n=a.emit.bind(a);return a.emit=(...c)=>(e.emit(...c),n(...c)),a.prompt(r)};return q0.mixinEmitter(e,new G5),e}};q0.mixinEmitter(zu,new G5);var j5=zu.prompts;for(let t of Object.keys(j5)){let e=t.toLowerCase(),r=s=>new j5[t](s).run();zu.prompt[e]=r,zu[e]=r,zu[t]||Reflect.defineProperty(zu,t,{get:()=>j5[t]})}var Yv=t=>{q0.defineExport(zu,t,()=>zu.types[t])};Yv(\"ArrayPrompt\");Yv(\"AuthPrompt\");Yv(\"BooleanPrompt\");Yv(\"NumberPrompt\");Yv(\"StringPrompt\");lye.exports=zu});var dye=_((tGt,qlt)=>{qlt.exports={name:\"@yarnpkg/cli\",version:\"4.12.0\",license:\"BSD-2-Clause\",main:\"./sources/index.ts\",exports:{\".\":\"./sources/index.ts\",\"./polyfills\":\"./sources/polyfills.ts\",\"./package.json\":\"./package.json\"},dependencies:{\"@yarnpkg/core\":\"workspace:^\",\"@yarnpkg/fslib\":\"workspace:^\",\"@yarnpkg/libzip\":\"workspace:^\",\"@yarnpkg/parsers\":\"workspace:^\",\"@yarnpkg/plugin-catalog\":\"workspace:^\",\"@yarnpkg/plugin-compat\":\"workspace:^\",\"@yarnpkg/plugin-constraints\":\"workspace:^\",\"@yarnpkg/plugin-dlx\":\"workspace:^\",\"@yarnpkg/plugin-essentials\":\"workspace:^\",\"@yarnpkg/plugin-exec\":\"workspace:^\",\"@yarnpkg/plugin-file\":\"workspace:^\",\"@yarnpkg/plugin-git\":\"workspace:^\",\"@yarnpkg/plugin-github\":\"workspace:^\",\"@yarnpkg/plugin-http\":\"workspace:^\",\"@yarnpkg/plugin-init\":\"workspace:^\",\"@yarnpkg/plugin-interactive-tools\":\"workspace:^\",\"@yarnpkg/plugin-jsr\":\"workspace:^\",\"@yarnpkg/plugin-link\":\"workspace:^\",\"@yarnpkg/plugin-nm\":\"workspace:^\",\"@yarnpkg/plugin-npm\":\"workspace:^\",\"@yarnpkg/plugin-npm-cli\":\"workspace:^\",\"@yarnpkg/plugin-pack\":\"workspace:^\",\"@yarnpkg/plugin-patch\":\"workspace:^\",\"@yarnpkg/plugin-pnp\":\"workspace:^\",\"@yarnpkg/plugin-pnpm\":\"workspace:^\",\"@yarnpkg/plugin-stage\":\"workspace:^\",\"@yarnpkg/plugin-typescript\":\"workspace:^\",\"@yarnpkg/plugin-version\":\"workspace:^\",\"@yarnpkg/plugin-workspace-tools\":\"workspace:^\",\"@yarnpkg/shell\":\"workspace:^\",\"ci-info\":\"^4.0.0\",clipanion:\"^4.0.0-rc.2\",semver:\"^7.1.2\",tslib:\"^2.4.0\",typanion:\"^3.14.0\"},devDependencies:{\"@types/semver\":\"^7.1.0\",\"@yarnpkg/builder\":\"workspace:^\",\"@yarnpkg/monorepo\":\"workspace:^\",\"@yarnpkg/pnpify\":\"workspace:^\"},peerDependencies:{\"@yarnpkg/core\":\"workspace:^\"},scripts:{postpack:\"rm -rf lib\",prepack:'run build:compile \"$(pwd)\"',\"build:cli+hook\":\"run build:pnp:hook && builder build bundle\",\"build:cli\":\"builder build bundle\",\"run:cli\":\"builder run\",\"update-local\":\"run build:cli --no-git-hash && rsync -a --delete bundles/ bin/\"},publishConfig:{main:\"./lib/index.js\",bin:null,exports:{\".\":\"./lib/index.js\",\"./package.json\":\"./package.json\"}},files:[\"/lib/**/*\",\"!/lib/pluginConfiguration.*\",\"!/lib/cli.*\"],\"@yarnpkg/builder\":{bundles:{standard:[\"@yarnpkg/plugin-essentials\",\"@yarnpkg/plugin-catalog\",\"@yarnpkg/plugin-compat\",\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-dlx\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-file\",\"@yarnpkg/plugin-git\",\"@yarnpkg/plugin-github\",\"@yarnpkg/plugin-http\",\"@yarnpkg/plugin-init\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-jsr\",\"@yarnpkg/plugin-link\",\"@yarnpkg/plugin-nm\",\"@yarnpkg/plugin-npm\",\"@yarnpkg/plugin-npm-cli\",\"@yarnpkg/plugin-pack\",\"@yarnpkg/plugin-patch\",\"@yarnpkg/plugin-pnp\",\"@yarnpkg/plugin-pnpm\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\"]}},repository:{type:\"git\",url:\"git+https://github.com/yarnpkg/berry.git\",directory:\"packages/yarnpkg-cli\"},engines:{node:\">=18.12.0\"}}});var iq=_((R9t,Pye)=>{\"use strict\";Pye.exports=function(e,r){r===!0&&(r=0);var s=\"\";if(typeof e==\"string\")try{s=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(s=e.protocol);var a=s.split(/\\:|\\+/).filter(Boolean);return typeof r==\"number\"?a[r]:a}});var kye=_((F9t,xye)=>{\"use strict\";var uct=iq();function fct(t){var e={protocols:[],protocol:null,port:null,resource:\"\",host:\"\",user:\"\",password:\"\",pathname:\"\",hash:\"\",search:\"\",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=uct(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||\"\",e.password=r.password||\"\",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=[\"file\"],e.protocol=e.protocols[0],e.port=\"\",e.resource=\"\",e.user=\"\",e.pathname=\"\",e.hash=\"\",e.search=\"\",e.href=t,e.query={},e.parse_failed=!0}return e}xye.exports=fct});var Rye=_((N9t,Tye)=>{\"use strict\";var Act=kye();function pct(t){return t&&typeof t==\"object\"&&\"default\"in t?t:{default:t}}var hct=pct(Act),gct=\"text/plain\",dct=\"us-ascii\",Qye=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),mct=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:s,data:a,hash:n}=r.groups,c=s.split(\";\");n=e?\"\":n;let f=!1;c[c.length-1]===\"base64\"&&(c.pop(),f=!0);let p=(c.shift()||\"\").toLowerCase(),E=[...c.map(C=>{let[S,P=\"\"]=C.split(\"=\").map(I=>I.trim());return S===\"charset\"&&(P=P.toLowerCase(),P===dct)?\"\":`${S}${P?`=${P}`:\"\"}`}).filter(Boolean)];return f&&E.push(\"base64\"),(E.length>0||p&&p!==gct)&&E.unshift(p),`data:${E.join(\";\")},${f?a.trim():a}${n?`#${n}`:\"\"}`};function yct(t,e){if(e={defaultProtocol:\"http:\",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return mct(t,e);if(/^view-source:/i.test(t))throw new Error(\"`view-source:` is not supported as it is a non-standard protocol\");let r=t.startsWith(\"//\");!r&&/^\\.*\\//.test(t)||(t=t.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//,e.defaultProtocol));let a=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error(\"The `forceHttp` and `forceHttps` options cannot be used together\");if(e.forceHttp&&a.protocol===\"https:\"&&(a.protocol=\"http:\"),e.forceHttps&&a.protocol===\"http:\"&&(a.protocol=\"https:\"),e.stripAuthentication&&(a.username=\"\",a.password=\"\"),e.stripHash?a.hash=\"\":e.stripTextFragment&&(a.hash=a.hash.replace(/#?:~:text.*?$/i,\"\")),a.pathname){let c=/\\b[a-z][a-z\\d+\\-.]{1,50}:\\/\\//g,f=0,p=\"\";for(;;){let E=c.exec(a.pathname);if(!E)break;let C=E[0],S=E.index,P=a.pathname.slice(f,S);p+=P.replace(/\\/{2,}/g,\"/\"),p+=C,f=S+C.length}let h=a.pathname.slice(f,a.pathname.length);p+=h.replace(/\\/{2,}/g,\"/\"),a.pathname=p}if(a.pathname)try{a.pathname=decodeURI(a.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=a.pathname.split(\"/\"),f=c[c.length-1];Qye(f,e.removeDirectoryIndex)&&(c=c.slice(0,-1),a.pathname=c.slice(1).join(\"/\")+\"/\")}if(a.hostname&&(a.hostname=a.hostname.replace(/\\.$/,\"\"),e.stripWWW&&/^www\\.(?!www\\.)[a-z\\-\\d]{1,63}\\.[a-z.\\-\\d]{2,63}$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\\./,\"\"))),Array.isArray(e.removeQueryParameters))for(let c of[...a.searchParams.keys()])Qye(c,e.removeQueryParameters)&&a.searchParams.delete(c);if(e.removeQueryParameters===!0&&(a.search=\"\"),e.sortQueryParameters){a.searchParams.sort();try{a.search=decodeURIComponent(a.search)}catch{}}e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\\/$/,\"\"));let n=t;return t=a.toString(),!e.removeSingleSlash&&a.pathname===\"/\"&&!n.endsWith(\"/\")&&a.hash===\"\"&&(t=t.replace(/\\/$/,\"\")),(e.removeTrailingSlash||a.pathname===\"/\")&&a.hash===\"\"&&e.removeSingleSlash&&(t=t.replace(/\\/$/,\"\")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\\/\\//,\"//\")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\\/\\//,\"\")),t}var sq=(t,e=!1)=>{let r=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\\/\\/)([\\w\\.\\-@]+)[\\/:]([\\~,\\.\\w,\\-,\\_,\\/]+?(?:\\.git|\\/)?)$/,s=n=>{let c=new Error(n);throw c.subject_url=t,c};(typeof t!=\"string\"||!t.trim())&&s(\"Invalid url.\"),t.length>sq.MAX_INPUT_LENGTH&&s(\"Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH.\"),e&&(typeof e!=\"object\"&&(e={stripHash:!1}),t=yct(t,e));let a=hct.default(t);if(a.parse_failed){let n=a.href.match(r);n?(a.protocols=[\"ssh\"],a.protocol=\"ssh\",a.resource=n[2],a.host=n[2],a.user=n[1],a.pathname=`/${n[3]}`,a.parse_failed=!1):s(\"URL parsing failed.\")}return a};sq.MAX_INPUT_LENGTH=2048;Tye.exports=sq});var Oye=_((O9t,Nye)=>{\"use strict\";var Ect=iq();function Fye(t){if(Array.isArray(t))return t.indexOf(\"ssh\")!==-1||t.indexOf(\"rsync\")!==-1;if(typeof t!=\"string\")return!1;var e=Ect(t);if(t=t.substring(t.indexOf(\"://\")+3),Fye(e))return!0;var r=new RegExp(\".([a-zA-Z\\\\d]+):(\\\\d+)/\");return!t.match(r)&&t.indexOf(\"@\")<t.indexOf(\":\")}Nye.exports=Fye});var Uye=_((L9t,Mye)=>{\"use strict\";var Ict=Rye(),Lye=Oye();function Cct(t){var e=Ict(t);return e.token=\"\",e.password===\"x-oauth-basic\"?e.token=e.user:e.user===\"x-token-auth\"&&(e.token=e.password),Lye(e.protocols)||e.protocols.length===0&&Lye(t)?e.protocol=\"ssh\":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol=\"file\",e.protocols=[\"file\"]),e.href=e.href.replace(/\\/$/,\"\"),e}Mye.exports=Cct});var Hye=_((M9t,_ye)=>{\"use strict\";var wct=Uye();function oq(t){if(typeof t!=\"string\")throw new Error(\"The url must be a string.\");var e=/^([a-z\\d-]{1,39})\\/([-\\.\\w]{1,100})$/i;e.test(t)&&(t=\"https://github.com/\"+t);var r=wct(t),s=r.resource.split(\".\"),a=null;switch(r.toString=function(N){return oq.stringify(this,N)},r.source=s.length>2?s.slice(1-s.length).join(\".\"):r.source=r.resource,r.git_suffix=/\\.git$/.test(r.pathname),r.name=decodeURIComponent((r.pathname||r.href).replace(/(^\\/)|(\\/$)/g,\"\").replace(/\\.git$/,\"\")),r.owner=decodeURIComponent(r.user),r.source){case\"git.cloudforge.com\":r.owner=r.user,r.organization=s[0],r.source=\"cloudforge.com\";break;case\"visualstudio.com\":if(r.resource===\"vs-ssh.visualstudio.com\"){a=r.name.split(\"/\"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3],r.full_name=a[2]+\"/\"+a[3]);break}else{a=r.name.split(\"/\"),a.length===2?(r.owner=a[1],r.name=a[1],r.full_name=\"_git/\"+r.name):a.length===3?(r.name=a[2],a[0]===\"DefaultCollection\"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+\"/_git/\"+r.name):(r.owner=a[0],r.full_name=r.owner+\"/_git/\"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+\"/\"+r.owner+\"/_git/\"+r.name);break}case\"dev.azure.com\":case\"azure.com\":if(r.resource===\"ssh.dev.azure.com\"){a=r.name.split(\"/\"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3]);break}else{a=r.name.split(\"/\"),a.length===5?(r.organization=a[0],r.owner=a[1],r.name=a[4],r.full_name=\"_git/\"+r.name):a.length===3?(r.name=a[2],a[0]===\"DefaultCollection\"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+\"/_git/\"+r.name):(r.owner=a[0],r.full_name=r.owner+\"/_git/\"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+\"/\"+r.owner+\"/_git/\"+r.name),r.query&&r.query.path&&(r.filepath=r.query.path.replace(/^\\/+/g,\"\")),r.query&&r.query.version&&(r.ref=r.query.version.replace(/^GB/,\"\"));break}default:a=r.name.split(\"/\");var n=a.length-1;if(a.length>=2){var c=a.indexOf(\"-\",2),f=a.indexOf(\"blob\",2),p=a.indexOf(\"tree\",2),h=a.indexOf(\"commit\",2),E=a.indexOf(\"src\",2),C=a.indexOf(\"raw\",2),S=a.indexOf(\"edit\",2);n=c>0?c-1:f>0?f-1:p>0?p-1:h>0?h-1:E>0?E-1:C>0?C-1:S>0?S-1:n,r.owner=a.slice(0,n).join(\"/\"),r.name=a[n],h&&(r.commit=a[n+2])}r.ref=\"\",r.filepathtype=\"\",r.filepath=\"\";var P=a.length>n&&a[n+1]===\"-\"?n+1:n;a.length>P+2&&[\"raw\",\"src\",\"blob\",\"tree\",\"edit\"].indexOf(a[P+1])>=0&&(r.filepathtype=a[P+1],r.ref=a[P+2],a.length>P+3&&(r.filepath=a.slice(P+3).join(\"/\"))),r.organization=r.owner;break}r.full_name||(r.full_name=r.owner,r.name&&(r.full_name&&(r.full_name+=\"/\"),r.full_name+=r.name)),r.owner.startsWith(\"scm/\")&&(r.source=\"bitbucket-server\",r.owner=r.owner.replace(\"scm/\",\"\"),r.organization=r.owner,r.full_name=r.owner+\"/\"+r.name);var I=/(projects|users)\\/(.*?)\\/repos\\/(.*?)((\\/.*$)|$)/,R=I.exec(r.pathname);return R!=null&&(r.source=\"bitbucket-server\",R[1]===\"users\"?r.owner=\"~\"+R[2]:r.owner=R[2],r.organization=r.owner,r.name=R[3],a=R[4].split(\"/\"),a.length>1&&([\"raw\",\"browse\"].indexOf(a[1])>=0?(r.filepathtype=a[1],a.length>2&&(r.filepath=a.slice(2).join(\"/\"))):a[1]===\"commits\"&&a.length>2&&(r.commit=a[2])),r.full_name=r.owner+\"/\"+r.name,r.query.at?r.ref=r.query.at:r.ref=\"\"),r}oq.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join(\"+\"):t.protocol);var r=t.port?\":\"+t.port:\"\",s=t.user||\"git\",a=t.git_suffix?\".git\":\"\";switch(e){case\"ssh\":return r?\"ssh://\"+s+\"@\"+t.resource+r+\"/\"+t.full_name+a:s+\"@\"+t.resource+\":\"+t.full_name+a;case\"git+ssh\":case\"ssh+git\":case\"ftp\":case\"ftps\":return e+\"://\"+s+\"@\"+t.resource+r+\"/\"+t.full_name+a;case\"http\":case\"https\":var n=t.token?Bct(t):t.user&&(t.protocols.includes(\"http\")||t.protocols.includes(\"https\"))?t.user+\"@\":\"\";return e+\"://\"+n+t.resource+r+\"/\"+vct(t)+a;default:return t.href}};function Bct(t){switch(t.source){case\"bitbucket.org\":return\"x-token-auth:\"+t.token+\"@\";default:return t.token+\"@\"}}function vct(t){switch(t.source){case\"bitbucket-server\":return\"scm/\"+t.full_name;default:return\"\"+t.full_name}}_ye.exports=oq});function jct(t,e){return e===1&&Hct.has(t[0])}function nS(t){let e=Array.isArray(t)?t:Mu(t);return e.map((s,a)=>Uct.test(s)?`[${s}]`:_ct.test(s)&&!jct(e,a)?`.${s}`:`[${JSON.stringify(s)}]`).join(\"\").replace(/^\\./,\"\")}function Gct(t,e){let r=[];if(e.methodName!==null&&r.push(he.pretty(t,e.methodName,he.Type.CODE)),e.file!==null){let s=[];s.push(he.pretty(t,e.file,he.Type.PATH)),e.line!==null&&(s.push(he.pretty(t,e.line,he.Type.NUMBER)),e.column!==null&&s.push(he.pretty(t,e.column,he.Type.NUMBER))),r.push(`(${s.join(he.pretty(t,\":\",\"grey\"))})`)}return r.join(\" \")}function iF(t,{manifestUpdates:e,reportedErrors:r},{fix:s}={}){let a=new Map,n=new Map,c=[...r.keys()].map(f=>[f,new Map]);for(let[f,p]of[...c,...e]){let h=r.get(f)?.map(P=>({text:P,fixable:!1}))??[],E=!1,C=t.getWorkspaceByCwd(f),S=C.manifest.exportTo({});for(let[P,I]of p){if(I.size>1){let R=[...I].map(([N,U])=>{let W=he.pretty(t.configuration,N,he.Type.INSPECT),ee=U.size>0?Gct(t.configuration,U.values().next().value):null;return ee!==null?`\n${W} at ${ee}`:`\n${W}`}).join(\"\");h.push({text:`Conflict detected in constraint targeting ${he.pretty(t.configuration,P,he.Type.CODE)}; conflicting values are:${R}`,fixable:!1})}else{let[[R]]=I,N=va(S,P);if(JSON.stringify(N)===JSON.stringify(R))continue;if(!s){let U=typeof N>\"u\"?`Missing field ${he.pretty(t.configuration,P,he.Type.CODE)}; expected ${he.pretty(t.configuration,R,he.Type.INSPECT)}`:typeof R>\"u\"?`Extraneous field ${he.pretty(t.configuration,P,he.Type.CODE)} currently set to ${he.pretty(t.configuration,N,he.Type.INSPECT)}`:`Invalid field ${he.pretty(t.configuration,P,he.Type.CODE)}; expected ${he.pretty(t.configuration,R,he.Type.INSPECT)}, found ${he.pretty(t.configuration,N,he.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof R>\"u\"?A0(S,P):Jd(S,P,R),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function rEe(t,{configuration:e}){let r={children:[]};for(let[s,a]of t){let n=[];for(let f of a){let p=f.text.split(/\\n/);f.fixable&&(p[0]=`${he.pretty(e,\"\\u2699\",\"gray\")} ${p[0]}`),n.push({value:he.tuple(he.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:he.tuple(he.Type.NO_HINT,h)}))})}let c={value:he.tuple(he.Type.LOCATOR,s.anchoredLocator),children:je.sortMap(n,f=>f.value[1])};r.children.push(c)}return r.children=je.sortMap(r.children,s=>s.value[1]),r}var WC,Uct,_ct,Hct,iS=Xe(()=>{Ge();ql();WC=class{constructor(e){this.indexedFields=e;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let e of this.indexedFields)this.indexes[e]=new Map}insert(e){this.items.push(e);for(let r of this.indexedFields){let s=Object.hasOwn(e,r)?e[r]:void 0;if(typeof s>\"u\")continue;je.getArrayWithDefault(this.indexes[r],s).push(e)}return e}find(e){if(typeof e>\"u\")return this.items;let r=Object.entries(e);if(r.length===0)return this.items;let s=[],a;for(let[c,f]of r){let p=c,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>\"u\"){s.push([p,f]);continue}let E=new Set(h.get(f)??[]);if(E.size===0)return[];if(typeof a>\"u\")a=E;else for(let C of a)E.has(C)||a.delete(C);if(a.size===0)break}let n=[...a??[]];return s.length>0&&(n=n.filter(c=>{for(let[f,p]of s)if(!(typeof p<\"u\"?Object.hasOwn(c,f)&&c[f]===p:Object.hasOwn(c,f)===!1))return!1;return!0})),n}},Uct=/^[0-9]+$/,_ct=/^[a-zA-Z0-9_]+$/,Hct=new Set([\"scripts\",...Ut.allDependencies])});var nEe=_((_Yt,vq)=>{var qct;(function(t){var e=function(){return{\"append/2\":[new t.type.Rule(new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Var(\"L\")]),new t.type.Term(\"foldl\",[new t.type.Term(\"append\",[]),new t.type.Var(\"X\"),new t.type.Term(\"[]\",[]),new t.type.Var(\"L\")]))],\"append/3\":[new t.type.Rule(new t.type.Term(\"append\",[new t.type.Term(\"[]\",[]),new t.type.Var(\"X\"),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"append\",[new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"S\")])]),new t.type.Term(\"append\",[new t.type.Var(\"T\"),new t.type.Var(\"X\"),new t.type.Var(\"S\")]))],\"member/2\":[new t.type.Rule(new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"_\")])]),null),new t.type.Rule(new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"Xs\")])]),new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]))],\"permutation/2\":[new t.type.Rule(new t.type.Term(\"permutation\",[new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"permutation\",[new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"permutation\",[new t.type.Var(\"T\"),new t.type.Var(\"P\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"P\")]),new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"Y\")]),new t.type.Var(\"S\")])])]))],\"maplist/2\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"X\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"Xs\")])]))],\"maplist/3\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\")])]))],\"maplist/4\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\")])]))],\"maplist/5\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\")])]))],\"maplist/6\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\")])]))],\"maplist/7\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")]),new t.type.Term(\".\",[new t.type.Var(\"F\"),new t.type.Var(\"Fs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\"),new t.type.Var(\"F\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\"),new t.type.Var(\"Fs\")])]))],\"maplist/8\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")]),new t.type.Term(\".\",[new t.type.Var(\"F\"),new t.type.Var(\"Fs\")]),new t.type.Term(\".\",[new t.type.Var(\"G\"),new t.type.Var(\"Gs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\"),new t.type.Var(\"F\"),new t.type.Var(\"G\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\"),new t.type.Var(\"Fs\"),new t.type.Var(\"Gs\")])]))],\"include/3\":[new t.type.Rule(new t.type.Term(\"include\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"include\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"A\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"A\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"B\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"F\"),new t.type.Var(\"B\")]),new t.type.Term(\",\",[new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"F\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"S\")])]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"L\"),new t.type.Var(\"S\")])]),new t.type.Term(\"include\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"S\")])])])])]))],\"exclude/3\":[new t.type.Rule(new t.type.Term(\"exclude\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"exclude\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"exclude\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"E\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"Q\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"R\"),new t.type.Var(\"Q\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"R\")]),new t.type.Term(\",\",[new t.type.Term(\"!\",[]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"E\")])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"E\")])])])])])])]))],\"foldl/4\":[new t.type.Rule(new t.type.Term(\"foldl\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Var(\"I\"),new t.type.Var(\"I\")]),null),new t.type.Rule(new t.type.Term(\"foldl\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"I\"),new t.type.Var(\"R\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"I\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])])])]),new t.type.Var(\"L2\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P2\"),new t.type.Var(\"L2\")]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P2\")]),new t.type.Term(\"foldl\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"X\"),new t.type.Var(\"R\")])])])])]))],\"select/3\":[new t.type.Rule(new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"Xs\")]),null),new t.type.Rule(new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Ys\")])]),new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Var(\"Xs\"),new t.type.Var(\"Ys\")]))],\"sum_list/2\":[new t.type.Rule(new t.type.Term(\"sum_list\",[new t.type.Term(\"[]\",[]),new t.type.Num(0,!1)]),null),new t.type.Rule(new t.type.Term(\"sum_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"sum_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\"is\",[new t.type.Var(\"S\"),new t.type.Term(\"+\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")])])]))],\"max_list/2\":[new t.type.Rule(new t.type.Term(\"max_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"max_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"max_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"X\")]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"Y\")])])]))],\"min_list/2\":[new t.type.Rule(new t.type.Term(\"min_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"min_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"min_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"=<\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"X\")]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"Y\")])])]))],\"prod_list/2\":[new t.type.Rule(new t.type.Term(\"prod_list\",[new t.type.Term(\"[]\",[]),new t.type.Num(1,!1)]),null),new t.type.Rule(new t.type.Term(\"prod_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"prod_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\"is\",[new t.type.Var(\"S\"),new t.type.Term(\"*\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")])])]))],\"last/2\":[new t.type.Rule(new t.type.Term(\"last\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"last\",[new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"X\")]),new t.type.Term(\"last\",[new t.type.Var(\"Xs\"),new t.type.Var(\"X\")]))],\"prefix/2\":[new t.type.Rule(new t.type.Term(\"prefix\",[new t.type.Var(\"Part\"),new t.type.Var(\"Whole\")]),new t.type.Term(\"append\",[new t.type.Var(\"Part\"),new t.type.Var(\"_\"),new t.type.Var(\"Whole\")]))],\"nth0/3\":[new t.type.Rule(new t.type.Term(\"nth0\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")])]),new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")]),new t.type.Term(\"!\",[])])])]))],\"nth1/3\":[new t.type.Rule(new t.type.Term(\"nth1\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")])]),new t.type.Term(\",\",[new t.type.Term(\">\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")]),new t.type.Term(\"!\",[])])])]))],\"nth0/4\":[new t.type.Rule(new t.type.Term(\"nth0\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")])]),new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\"!\",[])])])]))],\"nth1/4\":[new t.type.Rule(new t.type.Term(\"nth1\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")])]),new t.type.Term(\",\",[new t.type.Term(\">\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\"!\",[])])])]))],\"nth/5\":[new t.type.Rule(new t.type.Term(\"nth\",[new t.type.Var(\"N\"),new t.type.Var(\"N\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),null),new t.type.Rule(new t.type.Term(\"nth\",[new t.type.Var(\"N\"),new t.type.Var(\"O\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"Y\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Ys\")])]),new t.type.Term(\",\",[new t.type.Term(\"is\",[new t.type.Var(\"M\"),new t.type.Term(\"+\",[new t.type.Var(\"N\"),new t.type.Num(1,!1)])]),new t.type.Term(\"nth\",[new t.type.Var(\"M\"),new t.type.Var(\"O\"),new t.type.Var(\"Xs\"),new t.type.Var(\"Y\"),new t.type.Var(\"Ys\")])]))],\"length/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(!t.type.is_variable(f)&&!t.type.is_integer(f))s.throw_error(t.error.type(\"integer\",f,n.indicator));else if(t.type.is_integer(f)&&f.value<0)s.throw_error(t.error.domain(\"not_less_than_zero\",f,n.indicator));else{var p=new t.type.Term(\"length\",[c,new t.type.Num(0,!1),f]);t.type.is_integer(f)&&(p=new t.type.Term(\",\",[p,new t.type.Term(\"!\",[])])),s.prepend([new t.type.State(a.goal.replace(p),a.substitution,a)])}},\"length/3\":[new t.type.Rule(new t.type.Term(\"length\",[new t.type.Term(\"[]\",[]),new t.type.Var(\"N\"),new t.type.Var(\"N\")]),null),new t.type.Rule(new t.type.Term(\"length\",[new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"X\")]),new t.type.Var(\"A\"),new t.type.Var(\"N\")]),new t.type.Term(\",\",[new t.type.Term(\"succ\",[new t.type.Var(\"A\"),new t.type.Var(\"B\")]),new t.type.Term(\"length\",[new t.type.Var(\"X\"),new t.type.Var(\"B\"),new t.type.Var(\"N\")])]))],\"replicate/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_integer(f))s.throw_error(t.error.type(\"integer\",f,n.indicator));else if(f.value<0)s.throw_error(t.error.domain(\"not_less_than_zero\",f,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=new t.type.Term(\"[]\"),E=0;E<f.value;E++)h=new t.type.Term(\".\",[c,h]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[h,p])),a.substitution,a)])}},\"sort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h=c;h.indicator===\"./2\";)p.push(h.args[0]),h=h.args[1];if(t.type.is_variable(h))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(h))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=p.sort(t.compare),C=E.length-1;C>0;C--)E[C].equals(E[C-1])&&E.splice(C,1);for(var S=new t.type.Term(\"[]\"),C=E.length-1;C>=0;C--)S=new t.type.Term(\".\",[E[C],S]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,f])),a.substitution,a)])}}},\"msort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h=c;h.indicator===\"./2\";)p.push(h.args[0]),h=h.args[1];if(t.type.is_variable(h))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(h))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=p.sort(t.compare),C=new t.type.Term(\"[]\"),S=E.length-1;S>=0;S--)C=new t.type.Term(\".\",[E[S],C]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,f])),a.substitution,a)])}}},\"keysort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h,E=c;E.indicator===\"./2\";){if(h=E.args[0],t.type.is_variable(h)){s.throw_error(t.error.instantiation(n.indicator));return}else if(!t.type.is_term(h)||h.indicator!==\"-/2\"){s.throw_error(t.error.type(\"pair\",h,n.indicator));return}h.args[0].pair=h.args[1],p.push(h.args[0]),E=E.args[1]}if(t.type.is_variable(E))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(E))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var C=p.sort(t.compare),S=new t.type.Term(\"[]\"),P=C.length-1;P>=0;P--)S=new t.type.Term(\".\",[new t.type.Term(\"-\",[C[P],C[P].pair]),S]),delete C[P].pair;s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,f])),a.substitution,a)])}}},\"take/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f)||t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!t.type.is_integer(c))s.throw_error(t.error.type(\"integer\",c,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=c.value,E=[],C=f;h>0&&C.indicator===\"./2\";)E.push(C.args[0]),C=C.args[1],h--;if(h===0){for(var S=new t.type.Term(\"[]\"),h=E.length-1;h>=0;h--)S=new t.type.Term(\".\",[E[h],S]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,p])),a.substitution,a)])}}},\"drop/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f)||t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!t.type.is_integer(c))s.throw_error(t.error.type(\"integer\",c,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=c.value,E=[],C=f;h>0&&C.indicator===\"./2\";)E.push(C.args[0]),C=C.args[1],h--;h===0&&s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,p])),a.substitution,a)])}},\"reverse/2\":function(s,a,n){var c=n.args[0],f=n.args[1],p=t.type.is_instantiated_list(c),h=t.type.is_instantiated_list(f);if(t.type.is_variable(c)&&t.type.is_variable(f))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(c)&&!t.type.is_fully_list(c))s.throw_error(t.error.type(\"list\",c,n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!p&&!h)s.throw_error(t.error.instantiation(n.indicator));else{for(var E=p?c:f,C=new t.type.Term(\"[]\",[]);E.indicator===\"./2\";)C=new t.type.Term(\".\",[E.args[0],C]),E=E.args[1];s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,p?f:c])),a.substitution,a)])}},\"list_to_set/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else{for(var p=c,h=[];p.indicator===\"./2\";)h.push(p.args[0]),p=p.args[1];if(t.type.is_variable(p))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_term(p)||p.indicator!==\"[]/0\")s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=[],C=new t.type.Term(\"[]\",[]),S,P=0;P<h.length;P++){S=!1;for(var I=0;I<E.length&&!S;I++)S=t.compare(h[P],E[I])===0;S||E.push(h[P])}for(P=E.length-1;P>=0;P--)C=new t.type.Term(\".\",[E[P],C]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[f,C])),a.substitution,a)])}}}}},r=[\"append/2\",\"append/3\",\"member/2\",\"permutation/2\",\"maplist/2\",\"maplist/3\",\"maplist/4\",\"maplist/5\",\"maplist/6\",\"maplist/7\",\"maplist/8\",\"include/3\",\"exclude/3\",\"foldl/4\",\"sum_list/2\",\"max_list/2\",\"min_list/2\",\"prod_list/2\",\"last/2\",\"prefix/2\",\"nth0/3\",\"nth1/3\",\"nth0/4\",\"nth1/4\",\"length/2\",\"replicate/3\",\"select/3\",\"sort/2\",\"msort/2\",\"keysort/2\",\"take/3\",\"drop/3\",\"reverse/2\",\"list_to_set/2\"];typeof vq<\"u\"?vq.exports=function(s){t=s,new t.type.Module(\"lists\",e(),r)}:new t.type.Module(\"lists\",e(),r)})(qct)});var yEe=_($r=>{\"use strict\";var bm=process.platform===\"win32\",Sq=\"aes-256-cbc\",Wct=\"sha256\",oEe=\"The current environment doesn't support interactive reading from TTY.\",si=Ie(\"fs\"),iEe=process.binding(\"tty_wrap\").TTY,bq=Ie(\"child_process\"),V0=Ie(\"path\"),Pq={prompt:\"> \",hideEchoBack:!1,mask:\"*\",limit:[],limitMessage:\"Input another, please.$<( [)limit(])>\",defaultInput:\"\",trueValue:[],falseValue:[],caseSensitive:!1,keepWhitespace:!1,encoding:\"utf8\",bufferSize:1024,print:void 0,history:!0,cd:!1,phContent:void 0,preCheck:void 0},Xp=\"none\",Zu,VC,sEe=!1,Y0,oF,Dq,Yct=0,Rq=\"\",Dm=[],aF,aEe=!1,xq=!1,sS=!1;function lEe(t){function e(r){return r.replace(/[^\\w\\u0080-\\uFFFF]/g,function(s){return\"#\"+s.charCodeAt(0)+\";\"})}return oF.concat(function(r){var s=[];return Object.keys(r).forEach(function(a){r[a]===\"boolean\"?t[a]&&s.push(\"--\"+a):r[a]===\"string\"&&t[a]&&s.push(\"--\"+a,e(t[a]))}),s}({display:\"string\",displayOnly:\"boolean\",keyIn:\"boolean\",hideEchoBack:\"boolean\",mask:\"string\",limit:\"string\",caseSensitive:\"boolean\"}))}function Vct(t,e){function r(U){var W,ee=\"\",ie;for(Dq=Dq||Ie(\"os\").tmpdir();;){W=V0.join(Dq,U+ee);try{ie=si.openSync(W,\"wx\")}catch(ue){if(ue.code===\"EEXIST\"){ee++;continue}else throw ue}si.closeSync(ie);break}return W}var s,a,n,c={},f,p,h=r(\"readline-sync.stdout\"),E=r(\"readline-sync.stderr\"),C=r(\"readline-sync.exit\"),S=r(\"readline-sync.done\"),P=Ie(\"crypto\"),I,R,N;I=P.createHash(Wct),I.update(\"\"+process.pid+Yct+++Math.random()),N=I.digest(\"hex\"),R=P.createDecipher(Sq,N),s=lEe(t),bm?(a=process.env.ComSpec||\"cmd.exe\",process.env.Q='\"',n=[\"/V:ON\",\"/S\",\"/C\",\"(%Q%\"+a+\"%Q% /V:ON /S /C %Q%%Q%\"+Y0+\"%Q%\"+s.map(function(U){return\" %Q%\"+U+\"%Q%\"}).join(\"\")+\" & (echo !ERRORLEVEL!)>%Q%\"+C+\"%Q%%Q%) 2>%Q%\"+E+\"%Q% |%Q%\"+process.execPath+\"%Q% %Q%\"+__dirname+\"\\\\encrypt.js%Q% %Q%\"+Sq+\"%Q% %Q%\"+N+\"%Q% >%Q%\"+h+\"%Q% & (echo 1)>%Q%\"+S+\"%Q%\"]):(a=\"/bin/sh\",n=[\"-c\",'(\"'+Y0+'\"'+s.map(function(U){return\" '\"+U.replace(/'/g,\"'\\\\''\")+\"'\"}).join(\"\")+'; echo $?>\"'+C+'\") 2>\"'+E+'\" |\"'+process.execPath+'\" \"'+__dirname+'/encrypt.js\" \"'+Sq+'\" \"'+N+'\" >\"'+h+'\"; echo 1 >\"'+S+'\"']),sS&&sS(\"_execFileSync\",s);try{bq.spawn(a,n,e)}catch(U){c.error=new Error(U.message),c.error.method=\"_execFileSync - spawn\",c.error.program=a,c.error.args=n}for(;si.readFileSync(S,{encoding:t.encoding}).trim()!==\"1\";);return(f=si.readFileSync(C,{encoding:t.encoding}).trim())===\"0\"?c.input=R.update(si.readFileSync(h,{encoding:\"binary\"}),\"hex\",t.encoding)+R.final(t.encoding):(p=si.readFileSync(E,{encoding:t.encoding}).trim(),c.error=new Error(oEe+(p?`\n`+p:\"\")),c.error.method=\"_execFileSync\",c.error.program=a,c.error.args=n,c.error.extMessage=p,c.error.exitCode=+f),si.unlinkSync(h),si.unlinkSync(E),si.unlinkSync(C),si.unlinkSync(S),c}function Jct(t){var e,r={},s,a={env:process.env,encoding:t.encoding};if(Y0||(bm?process.env.PSModulePath?(Y0=\"powershell.exe\",oF=[\"-ExecutionPolicy\",\"Bypass\",\"-File\",__dirname+\"\\\\read.ps1\"]):(Y0=\"cscript.exe\",oF=[\"//nologo\",__dirname+\"\\\\read.cs.js\"]):(Y0=\"/bin/sh\",oF=[__dirname+\"/read.sh\"])),bm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),bq.execFileSync){e=lEe(t),sS&&sS(\"execFileSync\",e);try{r.input=bq.execFileSync(Y0,e,a)}catch(n){s=n.stderr?(n.stderr+\"\").trim():\"\",r.error=new Error(oEe+(s?`\n`+s:\"\")),r.error.method=\"execFileSync\",r.error.program=Y0,r.error.args=e,r.error.extMessage=s,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=Vct(t,a);return r.error||(r.input=r.input.replace(/^\\s*'|'\\s*$/g,\"\"),t.display=\"\"),r}function kq(t){var e=\"\",r=t.display,s=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=Jct(t);if(n.error)throw n.error;return n.input}return xq&&xq(t),function(){var n,c,f;function p(){return n||(n=process.binding(\"fs\"),c=process.binding(\"constants\")),n}if(typeof Xp==\"string\")if(Xp=null,bm){if(f=function(h){var E=h.replace(/^\\D+/,\"\").split(\".\"),C=0;return(E[0]=+E[0])&&(C+=E[0]*1e4),(E[1]=+E[1])&&(C+=E[1]*100),(E[2]=+E[2])&&(C+=E[2]),C}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),Xp=process.stdin.fd,VC=process.stdin._handle;else try{Xp=p().open(\"CONIN$\",c.O_RDWR,parseInt(\"0666\",8)),VC=new iEe(Xp,!0)}catch{}if(process.stdout.isTTY)Zu=process.stdout.fd;else{try{Zu=si.openSync(\"\\\\\\\\.\\\\CON\",\"w\")}catch{}if(typeof Zu!=\"number\")try{Zu=p().open(\"CONOUT$\",c.O_RDWR,parseInt(\"0666\",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{Xp=si.openSync(\"/dev/tty\",\"r\"),VC=process.stdin._handle}catch{}}else try{Xp=si.openSync(\"/dev/tty\",\"r\"),VC=new iEe(Xp,!1)}catch{}if(process.stdout.isTTY)Zu=process.stdout.fd;else try{Zu=si.openSync(\"/dev/tty\",\"w\")}catch{}}}(),function(){var n,c,f=!t.hideEchoBack&&!t.keyIn,p,h,E,C,S;aF=\"\";function P(I){return I===sEe?!0:VC.setRawMode(I)!==0?!1:(sEe=I,!0)}if(aEe||!VC||typeof Zu!=\"number\"&&(t.display||!f)){e=a();return}if(t.display&&(si.writeSync(Zu,t.display),t.display=\"\"),!t.displayOnly){if(!P(!f)){e=a();return}for(h=t.keyIn?1:t.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),t.keyIn&&t.limit&&(c=new RegExp(\"[^\"+t.limit+\"]\",\"g\"+(t.caseSensitive?\"\":\"i\")));;){E=0;try{E=si.readSync(Xp,p,0,h)}catch(I){if(I.code!==\"EOF\"){P(!1),e+=a();return}}if(E>0?(C=p.toString(t.encoding,0,E),aF+=C):(C=`\n`,aF+=\"\\0\"),C&&typeof(S=(C.match(/^(.*?)[\\r\\n]/)||[])[1])==\"string\"&&(C=S,n=!0),C&&(C=C.replace(/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g,\"\")),C&&c&&(C=C.replace(c,\"\")),C&&(f||(t.hideEchoBack?t.mask&&si.writeSync(Zu,new Array(C.length+1).join(t.mask)):si.writeSync(Zu,C)),e+=C),!t.keyIn&&n||t.keyIn&&e.length>=h)break}!f&&!s&&si.writeSync(Zu,`\n`),P(!1)}}(),t.print&&!s&&t.print(r+(t.displayOnly?\"\":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+`\n`),t.encoding),t.displayOnly?\"\":Rq=t.keepWhitespace||t.keyIn?e:e.trim()}function Kct(t,e){var r=[];function s(a){a!=null&&(Array.isArray(a)?a.forEach(s):(!e||e(a))&&r.push(a))}return s(t),r}function Fq(t){return t.replace(/[\\x00-\\x7f]/g,function(e){return\"\\\\x\"+(\"00\"+e.charCodeAt().toString(16)).substr(-2)})}function Vs(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]==\"boolean\"&&(r=t.shift(),r&&(e=Object.keys(Pq),t.unshift(Pq))),t.reduce(function(s,a){return a==null||(a.hasOwnProperty(\"noEchoBack\")&&!a.hasOwnProperty(\"hideEchoBack\")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty(\"noTrim\")&&!a.hasOwnProperty(\"keepWhitespace\")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var c;if(a.hasOwnProperty(n))switch(c=a[n],n){case\"mask\":case\"limitMessage\":case\"defaultInput\":case\"encoding\":c=c!=null?c+\"\":\"\",c&&n!==\"limitMessage\"&&(c=c.replace(/[\\r\\n]/g,\"\")),s[n]=c;break;case\"bufferSize\":!isNaN(c=parseInt(c,10))&&typeof c==\"number\"&&(s[n]=c);break;case\"displayOnly\":case\"keyIn\":case\"hideEchoBack\":case\"caseSensitive\":case\"keepWhitespace\":case\"history\":case\"cd\":s[n]=!!c;break;case\"limit\":case\"trueValue\":case\"falseValue\":s[n]=Kct(c,function(f){var p=typeof f;return p===\"string\"||p===\"number\"||p===\"function\"||f instanceof RegExp}).map(function(f){return typeof f==\"string\"?f.replace(/[\\r\\n]/g,\"\"):f});break;case\"print\":case\"phContent\":case\"preCheck\":s[n]=typeof c==\"function\"?c:void 0;break;case\"prompt\":case\"display\":s[n]=c??\"\";break}})),s},{})}function Qq(t,e,r){return e.some(function(s){var a=typeof s;return a===\"string\"?r?t===s:t.toLowerCase()===s.toLowerCase():a===\"number\"?parseFloat(t)===s:a===\"function\"?s(t):s instanceof RegExp?s.test(t):!1})}function Nq(t,e){var r=V0.normalize(bm?(process.env.HOMEDRIVE||\"\")+(process.env.HOMEPATH||\"\"):process.env.HOME||\"\").replace(/[\\/\\\\]+$/,\"\");return t=V0.normalize(t),e?t.replace(/^~(?=\\/|\\\\|$)/,r):t.replace(new RegExp(\"^\"+Fq(r)+\"(?=\\\\/|\\\\\\\\|$)\",bm?\"i\":\"\"),\"~\")}function JC(t,e){var r=\"(?:\\\\(([\\\\s\\\\S]*?)\\\\))?(\\\\w+|.-.)(?:\\\\(([\\\\s\\\\S]*?)\\\\))?\",s=new RegExp(\"(\\\\$)?(\\\\$<\"+r+\">)\",\"g\"),a=new RegExp(\"(\\\\$)?(\\\\$\\\\{\"+r+\"\\\\})\",\"g\");function n(c,f,p,h,E,C){var S;return f||typeof(S=e(E))!=\"string\"?p:S?(h||\"\")+S+(C||\"\"):\"\"}return t.replace(s,n).replace(a,n)}function cEe(t,e,r){var s,a=[],n=-1,c=0,f=\"\",p;function h(E,C){return C.length>3?(E.push(C[0]+\"...\"+C[C.length-1]),p=!0):C.length&&(E=E.concat(C)),E}return s=t.reduce(function(E,C){return E.concat((C+\"\").split(\"\"))},[]).reduce(function(E,C){var S,P;return e||(C=C.toLowerCase()),S=/^\\d$/.test(C)?1:/^[A-Z]$/.test(C)?2:/^[a-z]$/.test(C)?3:0,r&&S===0?f+=C:(P=C.charCodeAt(0),S&&S===n&&P===c+1?a.push(C):(E=h(E,a),a=[C],n=S),c=P),E},[]),s=h(s,a),f&&(s.push(f),p=!0),{values:s,suppressed:p}}function uEe(t,e){return t.join(t.length>2?\", \":e?\" / \":\"/\")}function fEe(t,e){var r,s,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!=\"string\")switch(t){case\"hideEchoBack\":case\"mask\":case\"defaultInput\":case\"caseSensitive\":case\"keepWhitespace\":case\"encoding\":case\"bufferSize\":case\"history\":case\"cd\":r=e.hasOwnProperty(t)?typeof e[t]==\"boolean\"?e[t]?\"on\":\"off\":e[t]+\"\":\"\";break;case\"limit\":case\"trueValue\":case\"falseValue\":s=e[e.hasOwnProperty(t+\"Src\")?t+\"Src\":t],e.keyIn?(a=cEe(s,e.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f===\"string\"||f===\"number\"}),r=uEe(s,a.suppressed);break;case\"limitCount\":case\"limitCountNotZero\":r=e[e.hasOwnProperty(\"limitSrc\")?\"limitSrc\":\"limit\"].length,r=r||t!==\"limitCountNotZero\"?r+\"\":\"\";break;case\"lastInput\":r=Rq;break;case\"cwd\":case\"CWD\":case\"cwdHome\":r=process.cwd(),t===\"CWD\"?r=V0.basename(r):t===\"cwdHome\"&&(r=Nq(r));break;case\"date\":case\"time\":case\"localeDate\":case\"localeTime\":r=new Date()[\"to\"+t.replace(/^./,function(c){return c.toUpperCase()})+\"String\"]();break;default:typeof(n=(t.match(/^history_m(\\d+)$/)||[])[1])==\"string\"&&(r=Dm[Dm.length-n]||\"\")}return r}function AEe(t){var e=/^(.)-(.)$/.exec(t),r=\"\",s,a,n,c;if(!e)return null;for(s=e[1].charCodeAt(0),a=e[2].charCodeAt(0),c=s<a?1:-1,n=s;n!==a+c;n+=c)r+=String.fromCharCode(n);return r}function Tq(t){var e=new RegExp(/(\\s*)(?:(\"|')(.*?)(?:\\2|$)|(\\S+))/g),r,s=\"\",a=[],n;for(t=t.trim();r=e.exec(t);)n=r[3]||r[4]||\"\",r[1]&&(a.push(s),s=\"\"),s+=n;return s&&a.push(s),a}function pEe(t,e){return e.trueValue.length&&Qq(t,e.trueValue,e.caseSensitive)?!0:e.falseValue.length&&Qq(t,e.falseValue,e.caseSensitive)?!1:t}function hEe(t){var e,r,s,a,n,c,f;function p(E){return fEe(E,t)}function h(E){t.display+=(/[^\\r\\n]$/.test(t.display)?`\n`:\"\")+E}for(t.limitSrc=t.limit,t.displaySrc=t.display,t.limit=\"\",t.display=JC(t.display+\"\",p);;){if(e=kq(t),r=!1,s=\"\",t.defaultInput&&!e&&(e=t.defaultInput),t.history&&((a=/^\\s*\\!(?:\\!|-1)(:p)?\\s*$/.exec(e))?(n=Dm[0]||\"\",a[1]?r=!0:e=n,h(n+`\n`),r||(t.displayOnly=!0,kq(t),t.displayOnly=!1)):e&&e!==Dm[Dm.length-1]&&(Dm=[e])),!r&&t.cd&&e)switch(c=Tq(e),c[0].toLowerCase()){case\"cd\":if(c[1])try{process.chdir(Nq(c[1],!0))}catch(E){h(E+\"\")}r=!0;break;case\"pwd\":h(process.cwd()),r=!0;break}if(!r&&t.preCheck&&(f=t.preCheck(e,t),e=f.res,f.forceNext&&(r=!0)),!r){if(!t.limitSrc.length||Qq(e,t.limitSrc,t.caseSensitive))break;t.limitMessage&&(s=JC(t.limitMessage,p))}h((s?s+`\n`:\"\")+JC(t.displaySrc+\"\",p))}return pEe(e,t)}$r._DBG_set_useExt=function(t){aEe=t};$r._DBG_set_checkOptions=function(t){xq=t};$r._DBG_set_checkMethod=function(t){sS=t};$r._DBG_clearHistory=function(){Rq=\"\",Dm=[]};$r.setDefaultOptions=function(t){return Pq=Vs(!0,t),Vs(!0)};$r.question=function(t,e){return hEe(Vs(Vs(!0,e),{display:t}))};$r.prompt=function(t){var e=Vs(!0,t);return e.display=e.prompt,hEe(e)};$r.keyIn=function(t,e){var r=Vs(Vs(!0,e),{display:t,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(s){var a=typeof s;return a===\"string\"||a===\"number\"}).map(function(s){return JC(s+\"\",AEe)}),r.limit=Fq(r.limitSrc.join(\"\")),[\"trueValue\",\"falseValue\"].forEach(function(s){r[s]=r[s].reduce(function(a,n){var c=typeof n;return c===\"string\"||c===\"number\"?a=a.concat((n+\"\").split(\"\")):a.push(n),a},[])}),r.display=JC(r.display+\"\",function(s){return fEe(s,r)}),pEe(kq(r),r)};$r.questionEMail=function(t,e){return t==null&&(t=\"Input e-mail address: \"),$r.question(t,Vs({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:\"Input valid e-mail address, please.\",trueValue:null,falseValue:null},e,{keepWhitespace:!1,cd:!1}))};$r.questionNewPassword=function(t,e){var r,s,a,n=Vs({hideEchoBack:!0,mask:\"*\",limitMessage:`It can include: $<charlist>\nAnd the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(P){return P===\"charlist\"?r.text:P===\"length\"?s+\"...\"+a:null}}),c,f,p,h,E,C,S;for(e=e||{},c=JC(e.charlist?e.charlist+\"\":\"$<!-~>\",AEe),(isNaN(s=parseInt(e.min,10))||typeof s!=\"number\")&&(s=12),(isNaN(a=parseInt(e.max,10))||typeof a!=\"number\")&&(a=24),h=new RegExp(\"^[\"+Fq(c)+\"]{\"+s+\",\"+a+\"}$\"),r=cEe([c],n.caseSensitive,!0),r.text=uEe(r.values,r.suppressed),f=e.confirmMessage!=null?e.confirmMessage:\"Reinput a same one to confirm it: \",p=e.unmatchMessage!=null?e.unmatchMessage:\"It differs from first one. Hit only the Enter key if you want to retry from first one.\",t==null&&(t=\"Input new password: \"),E=n.limitMessage;!S;)n.limit=h,n.limitMessage=E,C=$r.question(t,n),n.limit=[C,\"\"],n.limitMessage=p,S=$r.question(f,n);return C};function gEe(t,e,r){var s;function a(n){return s=r(n),!isNaN(s)&&typeof s==\"number\"}return $r.question(t,Vs({limitMessage:\"Input valid number, please.\"},e,{limit:a,cd:!1})),s}$r.questionInt=function(t,e){return gEe(t,e,function(r){return parseInt(r,10)})};$r.questionFloat=function(t,e){return gEe(t,e,parseFloat)};$r.questionPath=function(t,e){var r,s=\"\",a=Vs({hideEchoBack:!1,limitMessage:`$<error(\n)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var c,f,p;n=Nq(n,!0),s=\"\";function h(E){E.split(/\\/|\\\\/).reduce(function(C,S){var P=V0.resolve(C+=S+V0.sep);if(!si.existsSync(P))si.mkdirSync(P);else if(!si.statSync(P).isDirectory())throw new Error(\"Non directory already exists: \"+P);return C},\"\")}try{if(c=si.existsSync(n),r=c?si.realpathSync(n):V0.resolve(n),!e.hasOwnProperty(\"exists\")&&!c||typeof e.exists==\"boolean\"&&e.exists!==c)return s=(c?\"Already exists\":\"No such file or directory\")+\": \"+r,!1;if(!c&&e.create&&(e.isDirectory?h(r):(h(V0.dirname(r)),si.closeSync(si.openSync(r,\"w\"))),r=si.realpathSync(r)),c&&(e.min||e.max||e.isFile||e.isDirectory)){if(f=si.statSync(r),e.isFile&&!f.isFile())return s=\"Not file: \"+r,!1;if(e.isDirectory&&!f.isDirectory())return s=\"Not directory: \"+r,!1;if(e.min&&f.size<+e.min||e.max&&f.size>+e.max)return s=\"Size \"+f.size+\" is out of range: \"+r,!1}if(typeof e.validate==\"function\"&&(p=e.validate(r))!==!0)return typeof p==\"string\"&&(s=p),!1}catch(E){return s=E+\"\",!1}return!0},phContent:function(n){return n===\"error\"?s:n!==\"min\"&&n!==\"max\"?null:e.hasOwnProperty(n)?e[n]+\"\":\"\"}});return e=e||{},t==null&&(t='Input path (you can \"cd\" and \"pwd\"): '),$r.question(t,a),r};function dEe(t,e){var r={},s={};return typeof t==\"object\"?(Object.keys(t).forEach(function(a){typeof t[a]==\"function\"&&(s[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=Tq(a),n=r.args[0]||\"\",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!==\"_\"&&s.hasOwnProperty(n)?s[n].apply(a,r.args.slice(1)):s.hasOwnProperty(\"_\")?s._.apply(a,r.args):null,{res:a,forceNext:!1}},s.hasOwnProperty(\"_\")||(r.limit=function(){var a=r.args[0]||\"\";return e.caseSensitive||(a=a.toLowerCase()),s.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=Tq(a),r.hRes=typeof t==\"function\"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}$r.promptCL=function(t,e){var r=Vs({hideEchoBack:!1,limitMessage:\"Requested command is not available.\",caseSensitive:!1,history:!0},e),s=dEe(t,r);return r.limit=s.limit,r.preCheck=s.preCheck,$r.prompt(r),s.args};$r.promptLoop=function(t,e){for(var r=Vs({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t($r.prompt(r)););};$r.promptCLLoop=function(t,e){var r=Vs({hideEchoBack:!1,limitMessage:\"Requested command is not available.\",caseSensitive:!1,history:!0},e),s=dEe(t,r);for(r.limit=s.limit,r.preCheck=s.preCheck;$r.prompt(r),!s.hRes;);};$r.promptSimShell=function(t){return $r.prompt(Vs({hideEchoBack:!1,history:!0},t,{prompt:function(){return bm?\"$<cwd>>\":(process.env.USER||\"\")+(process.env.HOSTNAME?\"@\"+process.env.HOSTNAME.replace(/\\..*$/,\"\"):\"\")+\":$<cwdHome>$ \"}()}))};function mEe(t,e,r){var s;return t==null&&(t=\"Are you sure? \"),(!e||e.guide!==!1)&&(t+=\"\")&&(t=t.replace(/\\s*:?\\s*$/,\"\")+\" [y/n]: \"),s=$r.keyIn(t,Vs(e,{hideEchoBack:!1,limit:r,trueValue:\"y\",falseValue:\"n\",caseSensitive:!1})),typeof s==\"boolean\"?s:\"\"}$r.keyInYN=function(t,e){return mEe(t,e)};$r.keyInYNStrict=function(t,e){return mEe(t,e,\"yn\")};$r.keyInPause=function(t,e){t==null&&(t=\"Continue...\"),(!e||e.guide!==!1)&&(t+=\"\")&&(t=t.replace(/\\s+$/,\"\")+\" (Hit any key)\"),$r.keyIn(t,Vs({limit:null},e,{hideEchoBack:!0,mask:\"\"}))};$r.keyInSelect=function(t,e,r){var s=Vs({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p===\"itemsCount\"?t.length+\"\":p===\"firstItem\"?(t[0]+\"\").trim():p===\"lastItem\"?(t[t.length-1]+\"\").trim():null}}),a=\"\",n={},c=49,f=`\n`;if(!Array.isArray(t)||!t.length||t.length>35)throw\"`items` must be Array (max length: 35).\";return t.forEach(function(p,h){var E=String.fromCharCode(c);a+=E,n[E]=h,f+=\"[\"+E+\"] \"+(p+\"\").trim()+`\n`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+=\"0\",n[0]=-1,f+=\"[0] \"+(r&&r.cancel!=null&&typeof r.cancel!=\"boolean\"?(r.cancel+\"\").trim():\"CANCEL\")+`\n`),s.limit=a,f+=`\n`,e==null&&(e=\"Choose one from list: \"),(e+=\"\")&&((!r||r.guide!==!1)&&(e=e.replace(/\\s*:?\\s*$/,\"\")+\" [$<limit>]: \"),f+=e),n[$r.keyIn(f,s).toLowerCase()]};$r.getRawInput=function(){return aF};function oS(t,e){var r;return e.length&&(r={},r[t]=e[0]),$r.setDefaultOptions(r)[t]}$r.setPrint=function(){return oS(\"print\",arguments)};$r.setPrompt=function(){return oS(\"prompt\",arguments)};$r.setEncoding=function(){return oS(\"encoding\",arguments)};$r.setMask=function(){return oS(\"mask\",arguments)};$r.setBufferSize=function(){return oS(\"bufferSize\",arguments)}});var Oq=_((jYt,ec)=>{(function(){var t={major:0,minor:2,patch:66,status:\"beta\"};tau_file_system={files:{},open:function(w,b,y){var F=tau_file_system.files[w];if(!F){if(y===\"read\")return null;F={path:w,text:\"\",type:b,get:function(z,X){return X===this.text.length||X>this.text.length?\"end_of_file\":this.text.substring(X,X+z)},put:function(z,X){return X===\"end_of_file\"?(this.text+=z,!0):X===\"past_end_of_file\"?null:(this.text=this.text.substring(0,X)+z+this.text.substring(X+z.length),!0)},get_byte:function(z){if(z===\"end_of_stream\")return-1;var X=Math.floor(z/2);if(this.text.length<=X)return-1;var $=n(this.text[Math.floor(z/2)],0);return z%2===0?$&255:$/256>>>0},put_byte:function(z,X){var $=X===\"end_of_stream\"?this.text.length:Math.floor(X/2);if(this.text.length<$)return null;var oe=this.text.length===$?-1:n(this.text[Math.floor(X/2)],0);return X%2===0?(oe=oe/256>>>0,oe=(oe&255)<<8|z&255):(oe=oe&255,oe=(z&255)<<8|oe&255),this.text.length===$?this.text+=c(oe):this.text=this.text.substring(0,$)+c(oe)+this.text.substring($+1),!0},flush:function(){return!0},close:function(){var z=tau_file_system.files[this.path];return z?!0:null}},tau_file_system.files[w]=F}return y===\"write\"&&(F.text=\"\"),F}},tau_user_input={buffer:\"\",get:function(w,b){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,b){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,b,y){var F=Ie(\"fs\"),z=F.openSync(w,y[0]);return y===\"read\"&&!F.existsSync(w)?null:{get:function(X,$){var oe=new Buffer(X);return F.readSync(z,oe,0,X,$),oe.toString()},put:function(X,$){var oe=Buffer.from(X);if($===\"end_of_file\")F.writeSync(z,oe);else{if($===\"past_end_of_file\")return null;F.writeSync(z,oe,0,oe.length,$)}return!0},get_byte:function(X){return null},put_byte:function(X,$){return null},flush:function(){return!0},close:function(){return F.closeSync(z),!0}}}},nodejs_user_input={buffer:\"\",get:function(w,b){for(var y,F=yEe();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,b){return process.stdout.write(w),!0},flush:function(){return!0}};var e;Array.prototype.indexOf?e=function(w,b){return w.indexOf(b)}:e=function(w,b){for(var y=w.length,F=0;F<y;F++)if(b===w[F])return F;return-1};var r=function(w,b){if(w.length!==0){for(var y=w[0],F=w.length,z=1;z<F;z++)y=b(y,w[z]);return y}},s;Array.prototype.map?s=function(w,b){return w.map(b)}:s=function(w,b){for(var y=[],F=w.length,z=0;z<F;z++)y.push(b(w[z]));return y};var a;Array.prototype.filter?a=function(w,b){return w.filter(b)}:a=function(w,b){for(var y=[],F=w.length,z=0;z<F;z++)b(w[z])&&y.push(w[z]);return y};var n;String.prototype.codePointAt?n=function(w,b){return w.codePointAt(b)}:n=function(w,b){return w.charCodeAt(b)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,p=1,h=/(\\\\a)|(\\\\b)|(\\\\f)|(\\\\n)|(\\\\r)|(\\\\t)|(\\\\v)|\\\\x([0-9a-fA-F]+)\\\\|\\\\([0-7]+)\\\\|(\\\\\\\\)|(\\\\')|('')|(\\\\\")|(\\\\`)|(\\\\.)|(.)/g,E={\"\\\\a\":7,\"\\\\b\":8,\"\\\\f\":12,\"\\\\n\":10,\"\\\\r\":13,\"\\\\t\":9,\"\\\\v\":11};function C(w){var b=[],y=!1;return w.replace(h,function(F,z,X,$,oe,xe,Te,lt,Ct,qt,ir,Pt,gn,Pr,Ir,Or,on){switch(!0){case Ct!==void 0:return b.push(parseInt(Ct,16)),\"\";case qt!==void 0:return b.push(parseInt(qt,8)),\"\";case ir!==void 0:case Pt!==void 0:case gn!==void 0:case Pr!==void 0:case Ir!==void 0:return b.push(n(F.substr(1),0)),\"\";case on!==void 0:return b.push(n(on,0)),\"\";case Or!==void 0:y=!0;default:return b.push(E[F]),\"\"}}),y?null:b}function S(w,b){var y=\"\";if(w.length<2)return w;try{w=w.replace(/\\\\([0-7]+)\\\\/g,function($,oe){return c(parseInt(oe,8))}),w=w.replace(/\\\\x([0-9a-fA-F]+)\\\\/g,function($,oe){return c(parseInt(oe,16))})}catch{return null}for(var F=0;F<w.length;F++){var z=w.charAt(F),X=w.charAt(F+1);if(z===b&&X===b)F++,y+=b;else if(z===\"\\\\\")if([\"a\",\"b\",\"f\",\"n\",\"r\",\"t\",\"v\",\"'\",'\"',\"\\\\\",\"a\",\"\\b\",\"\\f\",`\n`,\"\\r\",\"\t\",\"\\v\"].indexOf(X)!==-1)switch(F+=1,X){case\"a\":y+=\"a\";break;case\"b\":y+=\"\\b\";break;case\"f\":y+=\"\\f\";break;case\"n\":y+=`\n`;break;case\"r\":y+=\"\\r\";break;case\"t\":y+=\"\t\";break;case\"v\":y+=\"\\v\";break;case\"'\":y+=\"'\";break;case'\"':y+='\"';break;case\"\\\\\":y+=\"\\\\\";break}else return null;else y+=z}return y}function P(w){for(var b=\"\",y=0;y<w.length;y++)switch(w.charAt(y)){case\"'\":b+=\"\\\\'\";break;case\"\\\\\":b+=\"\\\\\\\\\";break;case\"\\b\":b+=\"\\\\b\";break;case\"\\f\":b+=\"\\\\f\";break;case`\n`:b+=\"\\\\n\";break;case\"\\r\":b+=\"\\\\r\";break;case\"\t\":b+=\"\\\\t\";break;case\"\\v\":b+=\"\\\\v\";break;default:b+=w.charAt(y);break}return b}function I(w){var b=w.substr(2);switch(w.substr(0,2).toLowerCase()){case\"0x\":return parseInt(b,16);case\"0b\":return parseInt(b,2);case\"0o\":return parseInt(b,8);case\"0'\":return C(b)[0];default:return parseFloat(w)}}var R={whitespace:/^\\s*(?:(?:%.*)|(?:\\/\\*(?:\\n|\\r|.)*?\\*\\/)|(?:\\s+))\\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\\!|,|;|[a-z][0-9a-zA-Z_]*|[#\\$\\&\\*\\+\\-\\.\\/\\:\\<\\=\\>\\?\\@\\^\\~\\\\]+|'(?:[^']*?(?:\\\\(?:x?\\d+)?\\\\)*(?:'')*(?:\\\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\\\[abfnrtv\\\\'\"`]|\\\\x?\\d+\\\\|[^\\\\])|\\d+(?:\\.\\d+(?:[eE][+-]?\\d+)?)?)/,string:/^(?:\"([^\"]|\"\"|\\\\\")*\"|`([^`]|``|\\\\`)*`)/,l_brace:/^(?:\\[)/,r_brace:/^(?:\\])/,l_bracket:/^(?:\\{)/,r_bracket:/^(?:\\})/,bar:/^(?:\\|)/,l_paren:/^(?:\\()/,r_paren:/^(?:\\))/};function N(w,b){return w.get_flag(\"char_conversion\").id===\"on\"?b.replace(/./g,function(y){return w.get_char_conversion(y)}):b}function U(w){this.thread=w,this.text=\"\",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var b,y=0,F=0,z=0,X=[],$=!1;if(w){var oe=this.tokens[w-1];y=oe.len,b=N(this.thread,this.text.substr(oe.len)),F=oe.line,z=oe.start}else b=this.text;if(/^\\s*$/.test(b))return null;for(;b!==\"\";){var xe=[],Te=!1;if(/^\\n/.exec(b)!==null){F++,z=0,y++,b=b.replace(/\\n/,\"\"),$=!0;continue}for(var lt in R)if(R.hasOwnProperty(lt)){var Ct=R[lt].exec(b);Ct&&xe.push({value:Ct[0],name:lt,matches:Ct})}if(!xe.length)return this.set_last_tokens([{value:b,matches:[],name:\"lexical\",line:F,start:z}]);var oe=r(xe,function(Pr,Ir){return Pr.value.length>=Ir.value.length?Pr:Ir});switch(oe.start=z,oe.line=F,b=b.replace(oe.value,\"\"),z+=oe.value.length,y+=oe.value.length,oe.name){case\"atom\":oe.raw=oe.value,oe.value.charAt(0)===\"'\"&&(oe.value=S(oe.value.substr(1,oe.value.length-2),\"'\"),oe.value===null&&(oe.name=\"lexical\",oe.value=\"unknown escape sequence\"));break;case\"number\":oe.float=oe.value.substring(0,2)!==\"0x\"&&oe.value.match(/[.eE]/)!==null&&oe.value!==\"0'.\",oe.value=I(oe.value),oe.blank=Te;break;case\"string\":var qt=oe.value.charAt(0);oe.value=S(oe.value.substr(1,oe.value.length-2),qt),oe.value===null&&(oe.name=\"lexical\",oe.value=\"unknown escape sequence\");break;case\"whitespace\":var ir=X[X.length-1];ir&&(ir.space=!0),Te=!0;continue;case\"r_bracket\":X.length>0&&X[X.length-1].name===\"l_bracket\"&&(oe=X.pop(),oe.name=\"atom\",oe.value=\"{}\",oe.raw=\"{}\",oe.space=!1);break;case\"r_brace\":X.length>0&&X[X.length-1].name===\"l_brace\"&&(oe=X.pop(),oe.name=\"atom\",oe.value=\"[]\",oe.raw=\"[]\",oe.space=!1);break}oe.len=y,X.push(oe),Te=!1}var Pt=this.set_last_tokens(X);return Pt.length===0?null:Pt};function W(w,b,y,F,z){if(!b[y])return{type:f,value:x.error.syntax(b[y-1],\"expression expected\",!0)};var X;if(F===\"0\"){var $=b[y];switch($.name){case\"number\":return{type:p,len:y+1,value:new x.type.Num($.value,$.float)};case\"variable\":return{type:p,len:y+1,value:new x.type.Var($.value)};case\"string\":var oe;switch(w.get_flag(\"double_quotes\").id){case\"atom\":oe=new j($.value,[]);break;case\"codes\":oe=new j(\"[]\",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(\".\",[new x.type.Num(n($.value,xe),!1),oe]);break;case\"chars\":oe=new j(\"[]\",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(\".\",[new x.type.Term($.value.charAt(xe),[]),oe]);break}return{type:p,len:y+1,value:oe};case\"l_paren\":var Pt=W(w,b,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:b[Pt.len]&&b[Pt.len].name===\"r_paren\"?(Pt.len++,Pt):{type:f,derived:!0,value:x.error.syntax(b[Pt.len]?b[Pt.len]:b[Pt.len-1],\") or operator expected\",!b[Pt.len])};case\"l_bracket\":var Pt=W(w,b,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:b[Pt.len]&&b[Pt.len].name===\"r_bracket\"?(Pt.len++,Pt.value=new j(\"{}\",[Pt.value]),Pt):{type:f,derived:!0,value:x.error.syntax(b[Pt.len]?b[Pt.len]:b[Pt.len-1],\"} or operator expected\",!b[Pt.len])}}var Te=ee(w,b,y,z);return Te.type===p||Te.derived||(Te=ie(w,b,y),Te.type===p||Te.derived)?Te:{type:f,derived:!1,value:x.error.syntax(b[y],\"unexpected token\")}}var lt=w.__get_max_priority(),Ct=w.__get_next_priority(F),qt=y;if(b[y].name===\"atom\"&&b[y+1]&&(b[y].space||b[y+1].name!==\"l_paren\")){var $=b[y++],ir=w.__lookup_operator_classes(F,$.value);if(ir&&ir.indexOf(\"fy\")>-1){var Pt=W(w,b,y,F,z);if(Pt.type!==f)return $.value===\"-\"&&!$.space&&x.type.is_number(Pt.value)?{value:new x.type.Num(-Pt.value.value,Pt.value.is_float),len:Pt.len,type:p}:{value:new x.type.Term($.value,[Pt.value]),len:Pt.len,type:p};X=Pt}else if(ir&&ir.indexOf(\"fx\")>-1){var Pt=W(w,b,y,Ct,z);if(Pt.type!==f)return{value:new x.type.Term($.value,[Pt.value]),len:Pt.len,type:p};X=Pt}}y=qt;var Pt=W(w,b,y,Ct,z);if(Pt.type===p){y=Pt.len;var $=b[y];if(b[y]&&(b[y].name===\"atom\"&&w.__lookup_operator_classes(F,$.value)||b[y].name===\"bar\"&&w.__lookup_operator_classes(F,\"|\"))){var gn=Ct,Pr=F,ir=w.__lookup_operator_classes(F,$.value);if(ir.indexOf(\"xf\")>-1)return{value:new x.type.Term($.value,[Pt.value]),len:++Pt.len,type:p};if(ir.indexOf(\"xfx\")>-1){var Ir=W(w,b,y+1,gn,z);return Ir.type===p?{value:new x.type.Term($.value,[Pt.value,Ir.value]),len:Ir.len,type:p}:(Ir.derived=!0,Ir)}else if(ir.indexOf(\"xfy\")>-1){var Ir=W(w,b,y+1,Pr,z);return Ir.type===p?{value:new x.type.Term($.value,[Pt.value,Ir.value]),len:Ir.len,type:p}:(Ir.derived=!0,Ir)}else if(Pt.type!==f)for(;;){y=Pt.len;var $=b[y];if($&&$.name===\"atom\"&&w.__lookup_operator_classes(F,$.value)){var ir=w.__lookup_operator_classes(F,$.value);if(ir.indexOf(\"yf\")>-1)Pt={value:new x.type.Term($.value,[Pt.value]),len:++y,type:p};else if(ir.indexOf(\"yfx\")>-1){var Ir=W(w,b,++y,gn,z);if(Ir.type===f)return Ir.derived=!0,Ir;y=Ir.len,Pt={value:new x.type.Term($.value,[Pt.value,Ir.value]),len:y,type:p}}else break}else break}}else X={type:f,value:x.error.syntax(b[Pt.len-1],\"operator expected\")};return Pt}return Pt}function ee(w,b,y,F){if(!b[y]||b[y].name===\"atom\"&&b[y].raw===\".\"&&!F&&(b[y].space||!b[y+1]||b[y+1].name!==\"l_paren\"))return{type:f,derived:!1,value:x.error.syntax(b[y-1],\"unfounded token\")};var z=b[y],X=[];if(b[y].name===\"atom\"&&b[y].raw!==\",\"){if(y++,b[y-1].space)return{type:p,len:y,value:new x.type.Term(z.value,X)};if(b[y]&&b[y].name===\"l_paren\"){if(b[y+1]&&b[y+1].name===\"r_paren\")return{type:f,derived:!0,value:x.error.syntax(b[y+1],\"argument expected\")};var $=W(w,b,++y,\"999\",!0);if($.type===f)return $.derived?$:{type:f,derived:!0,value:x.error.syntax(b[y]?b[y]:b[y-1],\"argument expected\",!b[y])};for(X.push($.value),y=$.len;b[y]&&b[y].name===\"atom\"&&b[y].value===\",\";){if($=W(w,b,y+1,\"999\",!0),$.type===f)return $.derived?$:{type:f,derived:!0,value:x.error.syntax(b[y+1]?b[y+1]:b[y],\"argument expected\",!b[y+1])};X.push($.value),y=$.len}if(b[y]&&b[y].name===\"r_paren\")y++;else return{type:f,derived:!0,value:x.error.syntax(b[y]?b[y]:b[y-1],\", or ) expected\",!b[y])}}return{type:p,len:y,value:new x.type.Term(z.value,X)}}return{type:f,derived:!1,value:x.error.syntax(b[y],\"term expected\")}}function ie(w,b,y){if(!b[y])return{type:f,derived:!1,value:x.error.syntax(b[y-1],\"[ expected\")};if(b[y]&&b[y].name===\"l_brace\"){var F=W(w,b,++y,\"999\",!0),z=[F.value],X=void 0;if(F.type===f)return b[y]&&b[y].name===\"r_brace\"?{type:p,len:y+1,value:new x.type.Term(\"[]\",[])}:{type:f,derived:!0,value:x.error.syntax(b[y],\"] expected\")};for(y=F.len;b[y]&&b[y].name===\"atom\"&&b[y].value===\",\";){if(F=W(w,b,y+1,\"999\",!0),F.type===f)return F.derived?F:{type:f,derived:!0,value:x.error.syntax(b[y+1]?b[y+1]:b[y],\"argument expected\",!b[y+1])};z.push(F.value),y=F.len}var $=!1;if(b[y]&&b[y].name===\"bar\"){if($=!0,F=W(w,b,y+1,\"999\",!0),F.type===f)return F.derived?F:{type:f,derived:!0,value:x.error.syntax(b[y+1]?b[y+1]:b[y],\"argument expected\",!b[y+1])};X=F.value,y=F.len}return b[y]&&b[y].name===\"r_brace\"?{type:p,len:y+1,value:g(z,X)}:{type:f,derived:!0,value:x.error.syntax(b[y]?b[y]:b[y-1],$?\"] expected\":\", or | or ] expected\",!b[y])}}return{type:f,derived:!1,value:x.error.syntax(b[y],\"list expected\")}}function ue(w,b,y){var F=b[y].line,z=W(w,b,y,w.__get_max_priority(),!1),X=null,$;if(z.type!==f)if(y=z.len,b[y]&&b[y].name===\"atom\"&&b[y].raw===\".\")if(y++,x.type.is_term(z.value)){if(z.value.indicator===\":-/2\"?(X=new x.type.Rule(z.value.args[0],Ce(z.value.args[1])),$={value:X,len:y,type:p}):z.value.indicator===\"-->/2\"?(X=pe(new x.type.Rule(z.value.args[0],z.value.args[1]),w),X.body=Ce(X.body),$={value:X,len:y,type:x.type.is_rule(X)?p:f}):(X=new x.type.Rule(z.value,null),$={value:X,len:y,type:p}),X){var oe=X.singleton_variables();oe.length>0&&w.throw_warning(x.warning.singleton(oe,X.head.indicator,F))}return $}else return{type:f,value:x.error.syntax(b[y],\"callable expected\")};else return{type:f,value:x.error.syntax(b[y]?b[y]:b[y-1],\". or operator expected\")};return z}function le(w,b,y){y=y||{},y.from=y.from?y.from:\"$tau-js\",y.reconsult=y.reconsult!==void 0?y.reconsult:!0;var F=new U(w),z={},X;F.new_text(b);var $=0,oe=F.get_tokens($);do{if(oe===null||!oe[$])break;var xe=ue(w,oe,$);if(xe.type===f)return new j(\"throw\",[xe.value]);if(xe.value.body===null&&xe.value.head.indicator===\"?-/1\"){var Te=new it(w.session);Te.add_goal(xe.value.head.args[0]),Te.answer(function(Ct){x.type.is_error(Ct)?w.throw_warning(Ct.args[0]):(Ct===!1||Ct===null)&&w.throw_warning(x.warning.failed_goal(xe.value.head.args[0],xe.len))}),$=xe.len;var lt=!0}else if(xe.value.body===null&&xe.value.head.indicator===\":-/1\"){var lt=w.run_directive(xe.value.head.args[0]);$=xe.len,xe.value.head.args[0].indicator===\"char_conversion/2\"&&(oe=F.get_tokens($),$=0)}else{X=xe.value.head.indicator,y.reconsult!==!1&&z[X]!==!0&&!w.is_multifile_predicate(X)&&(w.session.rules[X]=a(w.session.rules[X]||[],function(qt){return qt.dynamic}),z[X]=!0);var lt=w.add_rule(xe.value,y);$=xe.len}if(!lt)return lt}while(!0);return!0}function me(w,b){var y=new U(w);y.new_text(b);var F=0;do{var z=y.get_tokens(F);if(z===null)break;var X=W(w,z,0,w.__get_max_priority(),!1);if(X.type!==f){var $=X.len,oe=$;if(z[$]&&z[$].name===\"atom\"&&z[$].raw===\".\")w.add_goal(Ce(X.value));else{var xe=z[$];return new j(\"throw\",[x.error.syntax(xe||z[$-1],\". or operator expected\",!xe)])}F=X.len+1}else return new j(\"throw\",[X.value])}while(!0);return!0}function pe(w,b){w=w.rename(b);var y=b.next_free_variable(),F=Be(w.body,y,b);return F.error?F.value:(w.body=F.value,w.head.args=w.head.args.concat([y,F.variable]),w.head=new j(w.head.id,w.head.args),w)}function Be(w,b,y){var F;if(x.type.is_term(w)&&w.indicator===\"!/0\")return{value:w,variable:b,error:!1};if(x.type.is_term(w)&&w.indicator===\",/2\"){var z=Be(w.args[0],b,y);if(z.error)return z;var X=Be(w.args[1],z.variable,y);return X.error?X:{value:new j(\",\",[z.value,X.value]),variable:X.variable,error:!1}}else{if(x.type.is_term(w)&&w.indicator===\"{}/1\")return{value:w.args[0],variable:b,error:!1};if(x.type.is_empty_list(w))return{value:new j(\"true\",[]),variable:b,error:!1};if(x.type.is_list(w)){F=y.next_free_variable();for(var $=w,oe;$.indicator===\"./2\";)oe=$,$=$.args[1];return x.type.is_variable($)?{value:x.error.instantiation(\"DCG\"),variable:b,error:!0}:x.type.is_empty_list($)?(oe.args[1]=F,{value:new j(\"=\",[b,w]),variable:F,error:!1}):{value:x.error.type(\"list\",w,\"DCG\"),variable:b,error:!0}}else return x.type.is_callable(w)?(F=y.next_free_variable(),w.args=w.args.concat([b,F]),w=new j(w.id,w.args),{value:w,variable:F,error:!1}):{value:x.error.type(\"callable\",w,\"DCG\"),variable:b,error:!0}}}function Ce(w){return x.type.is_variable(w)?new j(\"call\",[w]):x.type.is_term(w)&&[\",/2\",\";/2\",\"->/2\"].indexOf(w.indicator)!==-1?new j(w.id,[Ce(w.args[0]),Ce(w.args[1])]):w}function g(w,b){for(var y=b||new x.type.Term(\"[]\",[]),F=w.length-1;F>=0;F--)y=new x.type.Term(\".\",[w[F],y]);return y}function we(w,b){for(var y=w.length-1;y>=0;y--)w[y]===b&&w.splice(y,1)}function ye(w){for(var b={},y=[],F=0;F<w.length;F++)w[F]in b||(y.push(w[F]),b[w[F]]=!0);return y}function Ae(w,b,y,F){if(w.session.rules[y]!==null){for(var z=0;z<w.session.rules[y].length;z++)if(w.session.rules[y][z]===F){w.session.rules[y].splice(z,1),w.success(b);break}}}function se(w){return function(b,y,F){var z=F.args[0],X=F.args.slice(1,w);if(x.type.is_variable(z))b.throw_error(x.error.instantiation(b.level));else if(!x.type.is_callable(z))b.throw_error(x.error.type(\"callable\",z,b.level));else{var $=new j(z.id,z.args.concat(X));b.prepend([new Pe(y.goal.replace($),y.substitution,y)])}}}function Z(w){for(var b=w.length-1;b>=0;b--)if(w.charAt(b)===\"/\")return new j(\"/\",[new j(w.substring(0,b)),new Re(parseInt(w.substring(b+1)),!1)])}function De(w){this.id=w}function Re(w,b){this.is_float=b!==void 0?b:parseInt(w)!==w,this.value=this.is_float?w:parseInt(w)}var mt=0;function j(w,b,y){this.ref=y||++mt,this.id=w,this.args=b||[],this.indicator=w+\"/\"+this.args.length}var rt=0;function Fe(w,b,y,F,z,X){this.id=rt++,this.stream=w,this.mode=b,this.alias=y,this.type=F!==void 0?F:\"text\",this.reposition=z!==void 0?z:!0,this.eof_action=X!==void 0?X:\"eof_code\",this.position=this.mode===\"append\"?\"end_of_stream\":0,this.output=this.mode===\"write\"||this.mode===\"append\",this.input=this.mode===\"read\"}function Ne(w){w=w||{},this.links=w}function Pe(w,b,y){b=b||new Ne,y=y||null,this.goal=w,this.substitution=b,this.parent=y}function Ve(w,b,y){this.head=w,this.body=b,this.dynamic=y||!1}function ke(w){w=w===void 0||w<=0?1e3:w,this.rules={},this.src_predicates={},this.rename=0,this.modules=[],this.thread=new it(this),this.total_threads=1,this.renamed_variables={},this.public_predicates={},this.multifile_predicates={},this.limit=w,this.streams={user_input:new Fe(typeof ec<\"u\"&&ec.exports?nodejs_user_input:tau_user_input,\"read\",\"user_input\",\"text\",!1,\"reset\"),user_output:new Fe(typeof ec<\"u\"&&ec.exports?nodejs_user_output:tau_user_output,\"write\",\"user_output\",\"text\",!1,\"eof_code\")},this.file_system=typeof ec<\"u\"&&ec.exports?nodejs_file_system:tau_file_system,this.standard_input=this.streams.user_input,this.standard_output=this.streams.user_output,this.current_input=this.streams.user_input,this.current_output=this.streams.user_output,this.format_success=function(b){return b.substitution},this.format_error=function(b){return b.goal},this.flag={bounded:x.flag.bounded.value,max_integer:x.flag.max_integer.value,min_integer:x.flag.min_integer.value,integer_rounding_function:x.flag.integer_rounding_function.value,char_conversion:x.flag.char_conversion.value,debug:x.flag.debug.value,max_arity:x.flag.max_arity.value,unknown:x.flag.unknown.value,double_quotes:x.flag.double_quotes.value,occurs_check:x.flag.occurs_check.value,dialect:x.flag.dialect.value,version_data:x.flag.version_data.value,nodejs:x.flag.nodejs.value},this.__loaded_modules=[],this.__char_conversion={},this.__operators={1200:{\":-\":[\"fx\",\"xfx\"],\"-->\":[\"xfx\"],\"?-\":[\"fx\"]},1100:{\";\":[\"xfy\"]},1050:{\"->\":[\"xfy\"]},1e3:{\",\":[\"xfy\"]},900:{\"\\\\+\":[\"fy\"]},700:{\"=\":[\"xfx\"],\"\\\\=\":[\"xfx\"],\"==\":[\"xfx\"],\"\\\\==\":[\"xfx\"],\"@<\":[\"xfx\"],\"@=<\":[\"xfx\"],\"@>\":[\"xfx\"],\"@>=\":[\"xfx\"],\"=..\":[\"xfx\"],is:[\"xfx\"],\"=:=\":[\"xfx\"],\"=\\\\=\":[\"xfx\"],\"<\":[\"xfx\"],\"=<\":[\"xfx\"],\">\":[\"xfx\"],\">=\":[\"xfx\"]},600:{\":\":[\"xfy\"]},500:{\"+\":[\"yfx\"],\"-\":[\"yfx\"],\"/\\\\\":[\"yfx\"],\"\\\\/\":[\"yfx\"]},400:{\"*\":[\"yfx\"],\"/\":[\"yfx\"],\"//\":[\"yfx\"],rem:[\"yfx\"],mod:[\"yfx\"],\"<<\":[\"yfx\"],\">>\":[\"yfx\"]},200:{\"**\":[\"xfx\"],\"^\":[\"xfy\"],\"-\":[\"fy\"],\"+\":[\"fy\"],\"\\\\\":[\"fy\"]}}}function it(w){this.epoch=Date.now(),this.session=w,this.session.total_threads++,this.total_steps=0,this.cpu_time=0,this.cpu_time_last=0,this.points=[],this.debugger=!1,this.debugger_states=[],this.level=\"top_level/0\",this.__calls=[],this.current_limit=this.session.limit,this.warnings=[]}function Ue(w,b,y){this.id=w,this.rules=b,this.exports=y,x.module[w]=this}Ue.prototype.exports_predicate=function(w){return this.exports.indexOf(w)!==-1},De.prototype.unify=function(w,b){if(b&&e(w.variables(),this.id)!==-1&&!x.type.is_variable(w))return null;var y={};return y[this.id]=w,new Ne(y)},Re.prototype.unify=function(w,b){return x.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float?new Ne:null},j.prototype.unify=function(w,b){if(x.type.is_term(w)&&this.indicator===w.indicator){for(var y=new Ne,F=0;F<this.args.length;F++){var z=x.unify(this.args[F].apply(y),w.args[F].apply(y),b);if(z===null)return null;for(var X in z.links)y.links[X]=z.links[X];y=y.apply(z)}return y}return null},Fe.prototype.unify=function(w,b){return x.type.is_stream(w)&&this.id===w.id?new Ne:null},De.prototype.toString=function(w){return this.id},Re.prototype.toString=function(w){return this.is_float&&e(this.value.toString(),\".\")===-1?this.value+\".0\":this.value.toString()},j.prototype.toString=function(w,b,y){if(w=w||{},w.quoted=w.quoted===void 0?!0:w.quoted,w.ignore_ops=w.ignore_ops===void 0?!1:w.ignore_ops,w.numbervars=w.numbervars===void 0?!1:w.numbervars,b=b===void 0?1200:b,y=y===void 0?\"\":y,w.numbervars&&this.indicator===\"$VAR/1\"&&x.type.is_integer(this.args[0])&&this.args[0].value>=0){var F=this.args[0].value,z=Math.floor(F/26),X=F%26;return\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[X]+(z!==0?z:\"\")}switch(this.indicator){case\"[]/0\":case\"{}/0\":case\"!/0\":return this.id;case\"{}/1\":return\"{\"+this.args[0].toString(w)+\"}\";case\"./2\":for(var $=\"[\"+this.args[0].toString(w),oe=this.args[1];oe.indicator===\"./2\";)$+=\", \"+oe.args[0].toString(w),oe=oe.args[1];return oe.indicator!==\"[]/0\"&&($+=\"|\"+oe.toString(w)),$+=\"]\",$;case\",/2\":return\"(\"+this.args[0].toString(w)+\", \"+this.args[1].toString(w)+\")\";default:var xe=this.id,Te=w.session?w.session.lookup_operator(this.id,this.args.length):null;if(w.session===void 0||w.ignore_ops||Te===null)return w.quoted&&!/^(!|,|;|[a-z][0-9a-zA-Z_]*)$/.test(xe)&&xe!==\"{}\"&&xe!==\"[]\"&&(xe=\"'\"+P(xe)+\"'\"),xe+(this.args.length?\"(\"+s(this.args,function(ir){return ir.toString(w)}).join(\", \")+\")\":\"\");var lt=Te.priority>b.priority||Te.priority===b.priority&&(Te.class===\"xfy\"&&this.indicator!==b.indicator||Te.class===\"yfx\"&&this.indicator!==b.indicator||this.indicator===b.indicator&&Te.class===\"yfx\"&&y===\"right\"||this.indicator===b.indicator&&Te.class===\"xfy\"&&y===\"left\");Te.indicator=this.indicator;var Ct=lt?\"(\":\"\",qt=lt?\")\":\"\";return this.args.length===0?\"(\"+this.id+\")\":[\"fy\",\"fx\"].indexOf(Te.class)!==-1?Ct+xe+\" \"+this.args[0].toString(w,Te)+qt:[\"yf\",\"xf\"].indexOf(Te.class)!==-1?Ct+this.args[0].toString(w,Te)+\" \"+xe+qt:Ct+this.args[0].toString(w,Te,\"left\")+\" \"+this.id+\" \"+this.args[1].toString(w,Te,\"right\")+qt}},Fe.prototype.toString=function(w){return\"<stream>(\"+this.id+\")\"},Ne.prototype.toString=function(w){var b=\"{\";for(var y in this.links)this.links.hasOwnProperty(y)&&(b!==\"{\"&&(b+=\", \"),b+=y+\"/\"+this.links[y].toString(w));return b+=\"}\",b},Pe.prototype.toString=function(w){return this.goal===null?\"<\"+this.substitution.toString(w)+\">\":\"<\"+this.goal.toString(w)+\", \"+this.substitution.toString(w)+\">\"},Ve.prototype.toString=function(w){return this.body?this.head.toString(w)+\" :- \"+this.body.toString(w)+\".\":this.head.toString(w)+\".\"},ke.prototype.toString=function(w){for(var b=\"\",y=0;y<this.modules.length;y++)b+=\":- use_module(library(\"+this.modules[y]+`)).\n`;b+=`\n`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)b+=this.rules[key][y].toString(w),b+=`\n`;return b},De.prototype.clone=function(){return new De(this.id)},Re.prototype.clone=function(){return new Re(this.value,this.is_float)},j.prototype.clone=function(){return new j(this.id,s(this.args,function(w){return w.clone()}))},Fe.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Ne.prototype.clone=function(){var w={};for(var b in this.links)this.links.hasOwnProperty(b)&&(w[b]=this.links[b].clone());return new Ne(w)},Pe.prototype.clone=function(){return new Pe(this.goal.clone(),this.substitution.clone(),this.parent)},Ve.prototype.clone=function(){return new Ve(this.head.clone(),this.body!==null?this.body.clone():null)},De.prototype.equals=function(w){return x.type.is_variable(w)&&this.id===w.id},Re.prototype.equals=function(w){return x.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},j.prototype.equals=function(w){if(!x.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var b=0;b<this.args.length;b++)if(!this.args[b].equals(w.args[b]))return!1;return!0},Fe.prototype.equals=function(w){return x.type.is_stream(w)&&this.id===w.id},Ne.prototype.equals=function(w){var b;if(!x.type.is_substitution(w))return!1;for(b in this.links)if(this.links.hasOwnProperty(b)&&(!w.links[b]||!this.links[b].equals(w.links[b])))return!1;for(b in w.links)if(w.links.hasOwnProperty(b)&&!this.links[b])return!1;return!0},Pe.prototype.equals=function(w){return x.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},Ve.prototype.equals=function(w){return x.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},De.prototype.rename=function(w){return w.get_free_variable(this)},Re.prototype.rename=function(w){return this},j.prototype.rename=function(w){return new j(this.id,s(this.args,function(b){return b.rename(w)}))},Fe.prototype.rename=function(w){return this},Ve.prototype.rename=function(w){return new Ve(this.head.rename(w),this.body!==null?this.body.rename(w):null)},De.prototype.variables=function(){return[this.id]},Re.prototype.variables=function(){return[]},j.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Fe.prototype.variables=function(){return[]},Ve.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},De.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},Re.prototype.apply=function(w){return this},j.prototype.apply=function(w){if(this.indicator===\"./2\"){for(var b=[],y=this;y.indicator===\"./2\";)b.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),z=b.length-1;z>=0;z--)F=new j(\".\",[b[z],F]);return F}return new j(this.id,s(this.args,function(X){return X.apply(w)}),this.ref)},Fe.prototype.apply=function(w){return this},Ve.prototype.apply=function(w){return new Ve(this.head.apply(w),this.body!==null?this.body.apply(w):null)},Ne.prototype.apply=function(w){var b,y={};for(b in this.links)this.links.hasOwnProperty(b)&&(y[b]=this.links[b].apply(w));return new Ne(y)},j.prototype.select=function(){for(var w=this;w.indicator===\",/2\";)w=w.args[0];return w},j.prototype.replace=function(w){return this.indicator===\",/2\"?this.args[0].indicator===\",/2\"?new j(\",\",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new j(\",\",[w,this.args[1]]):w},j.prototype.search=function(w){if(x.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var b=0;b<this.args.length;b++)if(x.type.is_term(this.args[b])&&this.args[b].search(w))return!0;return!1},ke.prototype.get_current_input=function(){return this.current_input},it.prototype.get_current_input=function(){return this.session.get_current_input()},ke.prototype.get_current_output=function(){return this.current_output},it.prototype.get_current_output=function(){return this.session.get_current_output()},ke.prototype.set_current_input=function(w){this.current_input=w},it.prototype.set_current_input=function(w){return this.session.set_current_input(w)},ke.prototype.set_current_output=function(w){this.current_input=w},it.prototype.set_current_output=function(w){return this.session.set_current_output(w)},ke.prototype.get_stream_by_alias=function(w){return this.streams[w]},it.prototype.get_stream_by_alias=function(w){return this.session.get_stream_by_alias(w)},ke.prototype.file_system_open=function(w,b,y){return this.file_system.open(w,b,y)},it.prototype.file_system_open=function(w,b,y){return this.session.file_system_open(w,b,y)},ke.prototype.get_char_conversion=function(w){return this.__char_conversion[w]||w},it.prototype.get_char_conversion=function(w){return this.session.get_char_conversion(w)},ke.prototype.parse=function(w){return this.thread.parse(w)},it.prototype.parse=function(w){var b=new U(this);b.new_text(w);var y=b.get_tokens();if(y===null)return!1;var F=W(this,y,0,this.__get_max_priority(),!1);return F.len!==y.length?!1:{value:F.value,expr:F,tokens:y}},ke.prototype.get_flag=function(w){return this.flag[w]},it.prototype.get_flag=function(w){return this.session.get_flag(w)},ke.prototype.add_rule=function(w,b){return b=b||{},b.from=b.from?b.from:\"$tau-js\",this.src_predicates[w.head.indicator]=b.from,this.rules[w.head.indicator]||(this.rules[w.head.indicator]=[]),this.rules[w.head.indicator].push(w),this.public_predicates.hasOwnProperty(w.head.indicator)||(this.public_predicates[w.head.indicator]=!1),!0},it.prototype.add_rule=function(w,b){return this.session.add_rule(w,b)},ke.prototype.run_directive=function(w){this.thread.run_directive(w)},it.prototype.run_directive=function(w){return x.type.is_directive(w)?(x.directive[w.indicator](this,w),!0):!1},ke.prototype.__get_max_priority=function(){return\"1200\"},it.prototype.__get_max_priority=function(){return this.session.__get_max_priority()},ke.prototype.__get_next_priority=function(w){var b=0;w=parseInt(w);for(var y in this.__operators)if(this.__operators.hasOwnProperty(y)){var F=parseInt(y);F>b&&F<w&&(b=F)}return b.toString()},it.prototype.__get_next_priority=function(w){return this.session.__get_next_priority(w)},ke.prototype.__lookup_operator_classes=function(w,b){return this.__operators.hasOwnProperty(w)&&this.__operators[w][b]instanceof Array&&this.__operators[w][b]||!1},it.prototype.__lookup_operator_classes=function(w,b){return this.session.__lookup_operator_classes(w,b)},ke.prototype.lookup_operator=function(w,b){for(var y in this.__operators)if(this.__operators[y][w]){for(var F=0;F<this.__operators[y][w].length;F++)if(b===0||this.__operators[y][w][F].length===b+1)return{priority:y,class:this.__operators[y][w][F]}}return null},it.prototype.lookup_operator=function(w,b){return this.session.lookup_operator(w,b)},ke.prototype.throw_warning=function(w){this.thread.throw_warning(w)},it.prototype.throw_warning=function(w){this.warnings.push(w)},ke.prototype.get_warnings=function(){return this.thread.get_warnings()},it.prototype.get_warnings=function(){return this.warnings},ke.prototype.add_goal=function(w,b){this.thread.add_goal(w,b)},it.prototype.add_goal=function(w,b,y){y=y||null,b===!0&&(this.points=[]);for(var F=w.variables(),z={},X=0;X<F.length;X++)z[F[X]]=new De(F[X]);this.points.push(new Pe(w,new Ne(z),y))},ke.prototype.consult=function(w,b){return this.thread.consult(w,b)},it.prototype.consult=function(w,b){var y=\"\";if(typeof w==\"string\"){y=w;var F=y.length;if(y.substring(F-3,F)===\".pl\"&&document.getElementById(y)){var z=document.getElementById(y),X=z.getAttribute(\"type\");X!==null&&X.replace(/ /g,\"\").toLowerCase()===\"text/prolog\"&&(y=z.text)}}else if(w.nodeName)switch(w.nodeName.toLowerCase()){case\"input\":case\"textarea\":y=w.value;break;default:y=w.innerHTML;break}else return!1;return this.warnings=[],le(this,y,b)},ke.prototype.query=function(w){return this.thread.query(w)},it.prototype.query=function(w){return this.points=[],this.debugger_points=[],me(this,w)},ke.prototype.head_point=function(){return this.thread.head_point()},it.prototype.head_point=function(){return this.points[this.points.length-1]},ke.prototype.get_free_variable=function(w){return this.thread.get_free_variable(w)},it.prototype.get_free_variable=function(w){var b=[];if(w.id===\"_\"||this.session.renamed_variables[w.id]===void 0){for(this.session.rename++,this.points.length>0&&(b=this.head_point().substitution.domain());e(b,x.format_variable(this.session.rename))!==-1;)this.session.rename++;if(w.id===\"_\")return new De(x.format_variable(this.session.rename));this.session.renamed_variables[w.id]=x.format_variable(this.session.rename)}return new De(this.session.renamed_variables[w.id])},ke.prototype.next_free_variable=function(){return this.thread.next_free_variable()},it.prototype.next_free_variable=function(){this.session.rename++;var w=[];for(this.points.length>0&&(w=this.head_point().substitution.domain());e(w,x.format_variable(this.session.rename))!==-1;)this.session.rename++;return new De(x.format_variable(this.session.rename))},ke.prototype.is_public_predicate=function(w){return!this.public_predicates.hasOwnProperty(w)||this.public_predicates[w]===!0},it.prototype.is_public_predicate=function(w){return this.session.is_public_predicate(w)},ke.prototype.is_multifile_predicate=function(w){return this.multifile_predicates.hasOwnProperty(w)&&this.multifile_predicates[w]===!0},it.prototype.is_multifile_predicate=function(w){return this.session.is_multifile_predicate(w)},ke.prototype.prepend=function(w){return this.thread.prepend(w)},it.prototype.prepend=function(w){for(var b=w.length-1;b>=0;b--)this.points.push(w[b])},ke.prototype.success=function(w,b){return this.thread.success(w,b)},it.prototype.success=function(w,y){var y=typeof y>\"u\"?w:y;this.prepend([new Pe(w.goal.replace(null),w.substitution,y)])},ke.prototype.throw_error=function(w){return this.thread.throw_error(w)},it.prototype.throw_error=function(w){this.prepend([new Pe(new j(\"throw\",[w]),new Ne,null,null)])},ke.prototype.step_rule=function(w,b){return this.thread.step_rule(w,b)},it.prototype.step_rule=function(w,b){var y=b.indicator;if(w===\"user\"&&(w=null),w===null&&this.session.rules.hasOwnProperty(y))return this.session.rules[y];for(var F=w===null?this.session.modules:e(this.session.modules,w)===-1?[]:[w],z=0;z<F.length;z++){var X=x.module[F[z]];if(X.rules.hasOwnProperty(y)&&(X.rules.hasOwnProperty(this.level)||X.exports_predicate(y)))return x.module[F[z]].rules[y]}return null},ke.prototype.step=function(){return this.thread.step()},it.prototype.step=function(){if(this.points.length!==0){var w=!1,b=this.points.pop();if(this.debugger&&this.debugger_states.push(b),x.type.is_term(b.goal)){var y=b.goal.select(),F=null,z=[];if(y!==null){this.total_steps++;for(var X=b;X.parent!==null&&X.parent.goal.search(y);)X=X.parent;if(this.level=X.parent===null?\"top_level/0\":X.parent.goal.select().indicator,x.type.is_term(y)&&y.indicator===\":/2\"&&(F=y.args[0].id,y=y.args[1]),F===null&&x.type.is_builtin(y))this.__call_indicator=y.indicator,w=x.predicate[y.indicator](this,b,y);else{var $=this.step_rule(F,y);if($===null)this.session.rules.hasOwnProperty(y.indicator)||(this.get_flag(\"unknown\").id===\"error\"?this.throw_error(x.error.existence(\"procedure\",y.indicator,this.level)):this.get_flag(\"unknown\").id===\"warning\"&&this.throw_warning(\"unknown procedure \"+y.indicator+\" (from \"+this.level+\")\"));else if($ instanceof Function)w=$(this,b,y);else{for(var oe in $)if($.hasOwnProperty(oe)){var xe=$[oe];this.session.renamed_variables={},xe=xe.rename(this);var Te=this.get_flag(\"occurs_check\").indicator===\"true/0\",lt=new Pe,Ct=x.unify(y,xe.head,Te);Ct!==null&&(lt.goal=b.goal.replace(xe.body),lt.goal!==null&&(lt.goal=lt.goal.apply(Ct)),lt.substitution=b.substitution.apply(Ct),lt.parent=b,z.push(lt))}this.prepend(z)}}}}else x.type.is_variable(b.goal)?this.throw_error(x.error.instantiation(this.level)):this.throw_error(x.error.type(\"callable\",b.goal,this.level));return w}},ke.prototype.answer=function(w){return this.thread.answer(w)},it.prototype.answer=function(w){w=w||function(b){},this.__calls.push(w),!(this.__calls.length>1)&&this.again()},ke.prototype.answers=function(w,b,y){return this.thread.answers(w,b,y)},it.prototype.answers=function(w,b,y){var F=b||1e3,z=this;if(b<=0){y&&y();return}this.answer(function(X){w(X),X!==!1?setTimeout(function(){z.answers(w,b-1,y)},1):y&&y()})},ke.prototype.again=function(w){return this.thread.again(w)},it.prototype.again=function(w){for(var b,y=Date.now();this.__calls.length>0;){for(this.warnings=[],w!==!1&&(this.current_limit=this.session.limit);this.current_limit>0&&this.points.length>0&&this.head_point().goal!==null&&!x.type.is_error(this.head_point().goal);)if(this.current_limit--,this.step()===!0)return;var F=Date.now();this.cpu_time_last=F-y,this.cpu_time+=this.cpu_time_last;var z=this.__calls.shift();this.current_limit<=0?z(null):this.points.length===0?z(!1):x.type.is_error(this.head_point().goal)?(b=this.session.format_error(this.points.pop()),this.points=[],z(b)):(this.debugger&&this.debugger_states.push(this.head_point()),b=this.session.format_success(this.points.pop()),z(b))}},ke.prototype.unfold=function(w){if(w.body===null)return!1;var b=w.head,y=w.body,F=y.select(),z=new it(this),X=[];z.add_goal(F),z.step();for(var $=z.points.length-1;$>=0;$--){var oe=z.points[$],xe=b.apply(oe.substitution),Te=y.replace(oe.goal);Te!==null&&(Te=Te.apply(oe.substitution)),X.push(new Ve(xe,Te))}var lt=this.rules[b.indicator],Ct=e(lt,w);return X.length>0&&Ct!==-1?(lt.splice.apply(lt,[Ct,1].concat(X)),!0):!1},it.prototype.unfold=function(w){return this.session.unfold(w)},De.prototype.interpret=function(w){return x.error.instantiation(w.level)},Re.prototype.interpret=function(w){return this},j.prototype.interpret=function(w){return x.type.is_unitary_list(this)?this.args[0].interpret(w):x.operate(w,this)},De.prototype.compare=function(w){return this.id<w.id?-1:this.id>w.id?1:0},Re.prototype.compare=function(w){if(this.value===w.value&&this.is_float===w.is_float)return 0;if(this.value<w.value||this.value===w.value&&this.is_float&&!w.is_float)return-1;if(this.value>w.value)return 1},j.prototype.compare=function(w){if(this.args.length<w.args.length||this.args.length===w.args.length&&this.id<w.id)return-1;if(this.args.length>w.args.length||this.args.length===w.args.length&&this.id>w.id)return 1;for(var b=0;b<this.args.length;b++){var y=x.compare(this.args[b],w.args[b]);if(y!==0)return y}return 0},Ne.prototype.lookup=function(w){return this.links[w]?this.links[w]:null},Ne.prototype.filter=function(w){var b={};for(var y in this.links)if(this.links.hasOwnProperty(y)){var F=this.links[y];w(y,F)&&(b[y]=F)}return new Ne(b)},Ne.prototype.exclude=function(w){var b={};for(var y in this.links)this.links.hasOwnProperty(y)&&e(w,y)===-1&&(b[y]=this.links[y]);return new Ne(b)},Ne.prototype.add=function(w,b){this.links[w]=b},Ne.prototype.domain=function(w){var b=w===!0?function(z){return z}:function(z){return new De(z)},y=[];for(var F in this.links)y.push(b(F));return y},De.prototype.compile=function(){return'new pl.type.Var(\"'+this.id.toString()+'\")'},Re.prototype.compile=function(){return\"new pl.type.Num(\"+this.value.toString()+\", \"+this.is_float.toString()+\")\"},j.prototype.compile=function(){return'new pl.type.Term(\"'+this.id.replace(/\"/g,'\\\\\"')+'\", ['+s(this.args,function(w){return w.compile()})+\"])\"},Ve.prototype.compile=function(){return\"new pl.type.Rule(\"+this.head.compile()+\", \"+(this.body===null?\"null\":this.body.compile())+\")\"},ke.prototype.compile=function(){var w,b=[],y;for(var F in this.rules)if(this.rules.hasOwnProperty(F)){var z=this.rules[F];y=[],w='\"'+F+'\": [';for(var X=0;X<z.length;X++)y.push(z[X].compile());w+=y.join(),w+=\"]\",b.push(w)}return\"{\"+b.join()+\"};\"},De.prototype.toJavaScript=function(){},Re.prototype.toJavaScript=function(){return this.value},j.prototype.toJavaScript=function(){if(this.args.length===0&&this.indicator!==\"[]/0\")return this.id;if(x.type.is_list(this)){for(var w=[],b=this,y;b.indicator===\"./2\";){if(y=b.args[0].toJavaScript(),y===void 0)return;w.push(y),b=b.args[1]}if(b.indicator===\"[]/0\")return w}},Ve.prototype.singleton_variables=function(){var w=this.head.variables(),b={},y=[];this.body!==null&&(w=w.concat(this.body.variables()));for(var F=0;F<w.length;F++)b[w[F]]===void 0&&(b[w[F]]=0),b[w[F]]++;for(var z in b)z!==\"_\"&&b[z]===1&&y.push(z);return y};var x={__env:typeof ec<\"u\"&&ec.exports?global:window,module:{},version:t,parser:{tokenizer:U,expression:W},utils:{str_indicator:Z,codePointAt:n,fromCodePoint:c},statistics:{getCountTerms:function(){return mt}},fromJavaScript:{test:{boolean:function(w){return w===!0||w===!1},number:function(w){return typeof w==\"number\"},string:function(w){return typeof w==\"string\"},list:function(w){return w instanceof Array},variable:function(w){return w===void 0},any:function(w){return!0}},conversion:{boolean:function(w){return new j(w?\"true\":\"false\",[])},number:function(w){return new Re(w,w%1!==0)},string:function(w){return new j(w,[])},list:function(w){for(var b=[],y,F=0;F<w.length;F++){if(y=x.fromJavaScript.apply(w[F]),y===void 0)return;b.push(y)}return g(b)},variable:function(w){return new De(\"_\")},any:function(w){}},apply:function(w){for(var b in x.fromJavaScript.test)if(b!==\"any\"&&x.fromJavaScript.test[b](w))return x.fromJavaScript.conversion[b](w);return x.fromJavaScript.conversion.any(w)}},type:{Var:De,Num:Re,Term:j,Rule:Ve,State:Pe,Stream:Fe,Module:Ue,Thread:it,Session:ke,Substitution:Ne,order:[De,Re,j,Fe],compare:function(w,b){var y=e(x.type.order,w.constructor),F=e(x.type.order,b.constructor);if(y<F)return-1;if(y>F)return 1;if(w.constructor===Re){if(w.is_float&&b.is_float)return 0;if(w.is_float)return-1;if(b.is_float)return 1}return 0},is_substitution:function(w){return w instanceof Ne},is_state:function(w){return w instanceof Pe},is_rule:function(w){return w instanceof Ve},is_variable:function(w){return w instanceof De},is_stream:function(w){return w instanceof Fe},is_anonymous_var:function(w){return w instanceof De&&w.id===\"_\"},is_callable:function(w){return w instanceof j},is_number:function(w){return w instanceof Re},is_integer:function(w){return w instanceof Re&&!w.is_float},is_float:function(w){return w instanceof Re&&w.is_float},is_term:function(w){return w instanceof j},is_atom:function(w){return w instanceof j&&w.args.length===0},is_ground:function(w){if(w instanceof De)return!1;if(w instanceof j){for(var b=0;b<w.args.length;b++)if(!x.type.is_ground(w.args[b]))return!1}return!0},is_atomic:function(w){return w instanceof j&&w.args.length===0||w instanceof Re},is_compound:function(w){return w instanceof j&&w.args.length>0},is_list:function(w){return w instanceof j&&(w.indicator===\"[]/0\"||w.indicator===\"./2\")},is_empty_list:function(w){return w instanceof j&&w.indicator===\"[]/0\"},is_non_empty_list:function(w){return w instanceof j&&w.indicator===\"./2\"},is_fully_list:function(w){for(;w instanceof j&&w.indicator===\"./2\";)w=w.args[1];return w instanceof De||w instanceof j&&w.indicator===\"[]/0\"},is_instantiated_list:function(w){for(;w instanceof j&&w.indicator===\"./2\";)w=w.args[1];return w instanceof j&&w.indicator===\"[]/0\"},is_unitary_list:function(w){return w instanceof j&&w.indicator===\"./2\"&&w.args[1]instanceof j&&w.args[1].indicator===\"[]/0\"},is_character:function(w){return w instanceof j&&(w.id.length===1||w.id.length>0&&w.id.length<=2&&n(w.id,0)>=65536)},is_character_code:function(w){return w instanceof Re&&!w.is_float&&w.value>=0&&w.value<=1114111},is_byte:function(w){return w instanceof Re&&!w.is_float&&w.value>=0&&w.value<=255},is_operator:function(w){return w instanceof j&&x.arithmetic.evaluation[w.indicator]},is_directive:function(w){return w instanceof j&&x.directive[w.indicator]!==void 0},is_builtin:function(w){return w instanceof j&&x.predicate[w.indicator]!==void 0},is_error:function(w){return w instanceof j&&w.indicator===\"throw/1\"},is_predicate_indicator:function(w){return w instanceof j&&w.indicator===\"//2\"&&w.args[0]instanceof j&&w.args[0].args.length===0&&w.args[1]instanceof Re&&w.args[1].is_float===!1},is_flag:function(w){return w instanceof j&&w.args.length===0&&x.flag[w.id]!==void 0},is_value_flag:function(w,b){if(!x.type.is_flag(w))return!1;for(var y in x.flag[w.id].allowed)if(x.flag[w.id].allowed.hasOwnProperty(y)&&x.flag[w.id].allowed[y].equals(b))return!0;return!1},is_io_mode:function(w){return x.type.is_atom(w)&&[\"read\",\"write\",\"append\"].indexOf(w.id)!==-1},is_stream_option:function(w){return x.type.is_term(w)&&(w.indicator===\"alias/1\"&&x.type.is_atom(w.args[0])||w.indicator===\"reposition/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"type/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"text\"||w.args[0].id===\"binary\")||w.indicator===\"eof_action/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"error\"||w.args[0].id===\"eof_code\"||w.args[0].id===\"reset\"))},is_stream_position:function(w){return x.type.is_integer(w)&&w.value>=0||x.type.is_atom(w)&&(w.id===\"end_of_stream\"||w.id===\"past_end_of_stream\")},is_stream_property:function(w){return x.type.is_term(w)&&(w.indicator===\"input/0\"||w.indicator===\"output/0\"||w.indicator===\"alias/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0]))||w.indicator===\"file_name/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0]))||w.indicator===\"position/1\"&&(x.type.is_variable(w.args[0])||x.type.is_stream_position(w.args[0]))||w.indicator===\"reposition/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\"))||w.indicator===\"type/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"text\"||w.args[0].id===\"binary\"))||w.indicator===\"mode/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"read\"||w.args[0].id===\"write\"||w.args[0].id===\"append\"))||w.indicator===\"eof_action/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"error\"||w.args[0].id===\"eof_code\"||w.args[0].id===\"reset\"))||w.indicator===\"end_of_stream/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"at\"||w.args[0].id===\"past\"||w.args[0].id===\"not\")))},is_streamable:function(w){return w.__proto__.stream!==void 0},is_read_option:function(w){return x.type.is_term(w)&&[\"variables/1\",\"variable_names/1\",\"singletons/1\"].indexOf(w.indicator)!==-1},is_write_option:function(w){return x.type.is_term(w)&&(w.indicator===\"quoted/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"ignore_ops/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"numbervars/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\"))},is_close_option:function(w){return x.type.is_term(w)&&w.indicator===\"force/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")},is_modifiable_flag:function(w){return x.type.is_flag(w)&&x.flag[w.id].changeable},is_module:function(w){return w instanceof j&&w.indicator===\"library/1\"&&w.args[0]instanceof j&&w.args[0].args.length===0&&x.module[w.args[0].id]!==void 0}},arithmetic:{evaluation:{\"e/0\":{type_args:null,type_result:!0,fn:function(w){return Math.E}},\"pi/0\":{type_args:null,type_result:!0,fn:function(w){return Math.PI}},\"tau/0\":{type_args:null,type_result:!0,fn:function(w){return 2*Math.PI}},\"epsilon/0\":{type_args:null,type_result:!0,fn:function(w){return Number.EPSILON}},\"+/1\":{type_args:null,type_result:null,fn:function(w,b){return w}},\"-/1\":{type_args:null,type_result:null,fn:function(w,b){return-w}},\"\\\\/1\":{type_args:!1,type_result:!1,fn:function(w,b){return~w}},\"abs/1\":{type_args:null,type_result:null,fn:function(w,b){return Math.abs(w)}},\"sign/1\":{type_args:null,type_result:null,fn:function(w,b){return Math.sign(w)}},\"float_integer_part/1\":{type_args:!0,type_result:!1,fn:function(w,b){return parseInt(w)}},\"float_fractional_part/1\":{type_args:!0,type_result:!0,fn:function(w,b){return w-parseInt(w)}},\"float/1\":{type_args:null,type_result:!0,fn:function(w,b){return parseFloat(w)}},\"floor/1\":{type_args:!0,type_result:!1,fn:function(w,b){return Math.floor(w)}},\"truncate/1\":{type_args:!0,type_result:!1,fn:function(w,b){return parseInt(w)}},\"round/1\":{type_args:!0,type_result:!1,fn:function(w,b){return Math.round(w)}},\"ceiling/1\":{type_args:!0,type_result:!1,fn:function(w,b){return Math.ceil(w)}},\"sin/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.sin(w)}},\"cos/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.cos(w)}},\"tan/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.tan(w)}},\"asin/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.asin(w)}},\"acos/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.acos(w)}},\"atan/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.atan(w)}},\"atan2/2\":{type_args:null,type_result:!0,fn:function(w,b,y){return Math.atan2(w,b)}},\"exp/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.exp(w)}},\"sqrt/1\":{type_args:null,type_result:!0,fn:function(w,b){return Math.sqrt(w)}},\"log/1\":{type_args:null,type_result:!0,fn:function(w,b){return w>0?Math.log(w):x.error.evaluation(\"undefined\",b.__call_indicator)}},\"+/2\":{type_args:null,type_result:null,fn:function(w,b,y){return w+b}},\"-/2\":{type_args:null,type_result:null,fn:function(w,b,y){return w-b}},\"*/2\":{type_args:null,type_result:null,fn:function(w,b,y){return w*b}},\"//2\":{type_args:null,type_result:!0,fn:function(w,b,y){return b?w/b:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"///2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return b?parseInt(w/b):x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"**/2\":{type_args:null,type_result:!0,fn:function(w,b,y){return Math.pow(w,b)}},\"^/2\":{type_args:null,type_result:null,fn:function(w,b,y){return Math.pow(w,b)}},\"<</2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return w<<b}},\">>/2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return w>>b}},\"/\\\\/2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return w&b}},\"\\\\//2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return w|b}},\"xor/2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return w^b}},\"rem/2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return b?w%b:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"mod/2\":{type_args:!1,type_result:!1,fn:function(w,b,y){return b?w-parseInt(w/b)*b:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"max/2\":{type_args:null,type_result:null,fn:function(w,b,y){return Math.max(w,b)}},\"min/2\":{type_args:null,type_result:null,fn:function(w,b,y){return Math.min(w,b)}}}},directive:{\"dynamic/1\":function(w,b){var y=b.args[0];if(x.type.is_variable(y))w.throw_error(x.error.instantiation(b.indicator));else if(!x.type.is_compound(y)||y.indicator!==\"//2\")w.throw_error(x.error.type(\"predicate_indicator\",y,b.indicator));else if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))w.throw_error(x.error.instantiation(b.indicator));else if(!x.type.is_atom(y.args[0]))w.throw_error(x.error.type(\"atom\",y.args[0],b.indicator));else if(!x.type.is_integer(y.args[1]))w.throw_error(x.error.type(\"integer\",y.args[1],b.indicator));else{var F=b.args[0].args[0].id+\"/\"+b.args[0].args[1].value;w.session.public_predicates[F]=!0,w.session.rules[F]||(w.session.rules[F]=[])}},\"multifile/1\":function(w,b){var y=b.args[0];x.type.is_variable(y)?w.throw_error(x.error.instantiation(b.indicator)):!x.type.is_compound(y)||y.indicator!==\"//2\"?w.throw_error(x.error.type(\"predicate_indicator\",y,b.indicator)):x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1])?w.throw_error(x.error.instantiation(b.indicator)):x.type.is_atom(y.args[0])?x.type.is_integer(y.args[1])?w.session.multifile_predicates[b.args[0].args[0].id+\"/\"+b.args[0].args[1].value]=!0:w.throw_error(x.error.type(\"integer\",y.args[1],b.indicator)):w.throw_error(x.error.type(\"atom\",y.args[0],b.indicator))},\"set_prolog_flag/2\":function(w,b){var y=b.args[0],F=b.args[1];x.type.is_variable(y)||x.type.is_variable(F)?w.throw_error(x.error.instantiation(b.indicator)):x.type.is_atom(y)?x.type.is_flag(y)?x.type.is_value_flag(y,F)?x.type.is_modifiable_flag(y)?w.session.flag[y.id]=F:w.throw_error(x.error.permission(\"modify\",\"flag\",y)):w.throw_error(x.error.domain(\"flag_value\",new j(\"+\",[y,F]),b.indicator)):w.throw_error(x.error.domain(\"prolog_flag\",y,b.indicator)):w.throw_error(x.error.type(\"atom\",y,b.indicator))},\"use_module/1\":function(w,b){var y=b.args[0];if(x.type.is_variable(y))w.throw_error(x.error.instantiation(b.indicator));else if(!x.type.is_term(y))w.throw_error(x.error.type(\"term\",y,b.indicator));else if(x.type.is_module(y)){var F=y.args[0].id;e(w.session.modules,F)===-1&&w.session.modules.push(F)}},\"char_conversion/2\":function(w,b){var y=b.args[0],F=b.args[1];x.type.is_variable(y)||x.type.is_variable(F)?w.throw_error(x.error.instantiation(b.indicator)):x.type.is_character(y)?x.type.is_character(F)?y.id===F.id?delete w.session.__char_conversion[y.id]:w.session.__char_conversion[y.id]=F.id:w.throw_error(x.error.type(\"character\",F,b.indicator)):w.throw_error(x.error.type(\"character\",y,b.indicator))},\"op/3\":function(w,b){var y=b.args[0],F=b.args[1],z=b.args[2];if(x.type.is_variable(y)||x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(b.indicator));else if(!x.type.is_integer(y))w.throw_error(x.error.type(\"integer\",y,b.indicator));else if(!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,b.indicator));else if(!x.type.is_atom(z))w.throw_error(x.error.type(\"atom\",z,b.indicator));else if(y.value<0||y.value>1200)w.throw_error(x.error.domain(\"operator_priority\",y,b.indicator));else if(z.id===\",\")w.throw_error(x.error.permission(\"modify\",\"operator\",z,b.indicator));else if(z.id===\"|\"&&(y.value<1001||F.id.length!==3))w.throw_error(x.error.permission(\"modify\",\"operator\",z,b.indicator));else if([\"fy\",\"fx\",\"yf\",\"xf\",\"xfx\",\"yfx\",\"xfy\"].indexOf(F.id)===-1)w.throw_error(x.error.domain(\"operator_specifier\",F,b.indicator));else{var X={prefix:null,infix:null,postfix:null};for(var $ in w.session.__operators)if(w.session.__operators.hasOwnProperty($)){var oe=w.session.__operators[$][z.id];oe&&(e(oe,\"fx\")!==-1&&(X.prefix={priority:$,type:\"fx\"}),e(oe,\"fy\")!==-1&&(X.prefix={priority:$,type:\"fy\"}),e(oe,\"xf\")!==-1&&(X.postfix={priority:$,type:\"xf\"}),e(oe,\"yf\")!==-1&&(X.postfix={priority:$,type:\"yf\"}),e(oe,\"xfx\")!==-1&&(X.infix={priority:$,type:\"xfx\"}),e(oe,\"xfy\")!==-1&&(X.infix={priority:$,type:\"xfy\"}),e(oe,\"yfx\")!==-1&&(X.infix={priority:$,type:\"yfx\"}))}var xe;switch(F.id){case\"fy\":case\"fx\":xe=\"prefix\";break;case\"yf\":case\"xf\":xe=\"postfix\";break;default:xe=\"infix\";break}if(((X.prefix&&xe===\"prefix\"||X.postfix&&xe===\"postfix\"||X.infix&&xe===\"infix\")&&X[xe].type!==F.id||X.infix&&xe===\"postfix\"||X.postfix&&xe===\"infix\")&&y.value!==0)w.throw_error(x.error.permission(\"create\",\"operator\",z,b.indicator));else return X[xe]&&(we(w.session.__operators[X[xe].priority][z.id],F.id),w.session.__operators[X[xe].priority][z.id].length===0&&delete w.session.__operators[X[xe].priority][z.id]),y.value>0&&(w.session.__operators[y.value]||(w.session.__operators[y.value.toString()]={}),w.session.__operators[y.value][z.id]||(w.session.__operators[y.value][z.id]=[]),w.session.__operators[y.value][z.id].push(F.id)),!0}}},predicate:{\"op/3\":function(w,b,y){x.directive[\"op/3\"](w,y)&&w.success(b)},\"current_op/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2],$=[];for(var oe in w.session.__operators)for(var xe in w.session.__operators[oe])for(var Te=0;Te<w.session.__operators[oe][xe].length;Te++)$.push(new Pe(b.goal.replace(new j(\",\",[new j(\"=\",[new Re(oe,!1),F]),new j(\",\",[new j(\"=\",[new j(w.session.__operators[oe][xe][Te],[]),z]),new j(\"=\",[new j(xe,[]),X])])])),b.substitution,b));w.prepend($)},\";/2\":function(w,b,y){if(x.type.is_term(y.args[0])&&y.args[0].indicator===\"->/2\"){var F=w.points,z=w.session.format_success,X=w.session.format_error;w.session.format_success=function(Te){return Te.substitution},w.session.format_error=function(Te){return Te.goal},w.points=[new Pe(y.args[0].args[0],b.substitution,b)];var $=function(Te){w.points=F,w.session.format_success=z,w.session.format_error=X,Te===!1?w.prepend([new Pe(b.goal.replace(y.args[1]),b.substitution,b)]):x.type.is_error(Te)?w.throw_error(Te.args[0]):Te===null?(w.prepend([b]),w.__calls.shift()(null)):w.prepend([new Pe(b.goal.replace(y.args[0].args[1]).apply(Te),b.substitution.apply(Te),b)])};w.__calls.unshift($)}else{var oe=new Pe(b.goal.replace(y.args[0]),b.substitution,b),xe=new Pe(b.goal.replace(y.args[1]),b.substitution,b);w.prepend([oe,xe])}},\"!/0\":function(w,b,y){var F,z,X=[];for(F=b,z=null;F.parent!==null&&F.parent.goal.search(y);)if(z=F,F=F.parent,F.goal!==null){var $=F.goal.select();if($&&$.id===\"call\"&&$.search(y)){F=z;break}}for(var oe=w.points.length-1;oe>=0;oe--){for(var xe=w.points[oe],Te=xe.parent;Te!==null&&Te!==F.parent;)Te=Te.parent;Te===null&&Te!==F.parent&&X.push(xe)}w.points=X.reverse(),w.success(b)},\"\\\\+/1\":function(w,b,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(w.level)):x.type.is_callable(F)?w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\",\",[new j(\"call\",[F]),new j(\"!\",[])]),new j(\"fail\",[])])),b.substitution,b),new Pe(b.goal.replace(null),b.substitution,b)]):w.throw_error(x.error.type(\"callable\",F,w.level))},\"->/2\":function(w,b,y){var F=b.goal.replace(new j(\",\",[y.args[0],new j(\",\",[new j(\"!\"),y.args[1]])]));w.prepend([new Pe(F,b.substitution,b)])},\"fail/0\":function(w,b,y){},\"false/0\":function(w,b,y){},\"true/0\":function(w,b,y){w.success(b)},\"call/1\":se(1),\"call/2\":se(2),\"call/3\":se(3),\"call/4\":se(4),\"call/5\":se(5),\"call/6\":se(6),\"call/7\":se(7),\"call/8\":se(8),\"once/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"call\",[F]),new j(\"!\",[])])),b.substitution,b)])},\"forall/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"\\\\+\",[new j(\",\",[new j(\"call\",[F]),new j(\"\\\\+\",[new j(\"call\",[z])])])])),b.substitution,b)])},\"repeat/0\":function(w,b,y){w.prepend([new Pe(b.goal.replace(null),b.substitution,b),b])},\"throw/1\":function(w,b,y){x.type.is_variable(y.args[0])?w.throw_error(x.error.instantiation(w.level)):w.throw_error(y.args[0])},\"catch/3\":function(w,b,y){var F=w.points;w.points=[],w.prepend([new Pe(y.args[0],b.substitution,b)]);var z=w.session.format_success,X=w.session.format_error;w.session.format_success=function(oe){return oe.substitution},w.session.format_error=function(oe){return oe.goal};var $=function(oe){var xe=w.points;if(w.points=F,w.session.format_success=z,w.session.format_error=X,x.type.is_error(oe)){for(var Te=[],lt=w.points.length-1;lt>=0;lt--){for(var ir=w.points[lt],Ct=ir.parent;Ct!==null&&Ct!==b.parent;)Ct=Ct.parent;Ct===null&&Ct!==b.parent&&Te.push(ir)}w.points=Te;var qt=w.get_flag(\"occurs_check\").indicator===\"true/0\",ir=new Pe,Pt=x.unify(oe.args[0],y.args[1],qt);Pt!==null?(ir.substitution=b.substitution.apply(Pt),ir.goal=b.goal.replace(y.args[2]).apply(Pt),ir.parent=b,w.prepend([ir])):w.throw_error(oe.args[0])}else if(oe!==!1){for(var gn=oe===null?[]:[new Pe(b.goal.apply(oe).replace(null),b.substitution.apply(oe),b)],Pr=[],lt=xe.length-1;lt>=0;lt--){Pr.push(xe[lt]);var Ir=xe[lt].goal!==null?xe[lt].goal.select():null;if(x.type.is_term(Ir)&&Ir.indicator===\"!/0\")break}var Or=s(Pr,function(on){return on.goal===null&&(on.goal=new j(\"true\",[])),on=new Pe(b.goal.replace(new j(\"catch\",[on.goal,y.args[1],y.args[2]])),b.substitution.apply(on.substitution),on.parent),on.exclude=y.args[0].variables(),on}).reverse();w.prepend(Or),w.prepend(gn),oe===null&&(this.current_limit=0,w.__calls.shift()(null))}};w.__calls.unshift($)},\"=/2\":function(w,b,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=new Pe,X=x.unify(y.args[0],y.args[1],F);X!==null&&(z.goal=b.goal.apply(X).replace(null),z.substitution=b.substitution.apply(X),z.parent=b,w.prepend([z]))},\"unify_with_occurs_check/2\":function(w,b,y){var F=new Pe,z=x.unify(y.args[0],y.args[1],!0);z!==null&&(F.goal=b.goal.apply(z).replace(null),F.substitution=b.substitution.apply(z),F.parent=b,w.prepend([F]))},\"\\\\=/2\":function(w,b,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=x.unify(y.args[0],y.args[1],F);z===null&&w.success(b)},\"subsumes_term/2\":function(w,b,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=x.unify(y.args[1],y.args[0],F);z!==null&&y.args[1].apply(z).equals(y.args[1])&&w.success(b)},\"findall/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2];if(x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(z))w.throw_error(x.error.type(\"callable\",z,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))w.throw_error(x.error.type(\"list\",X,y.indicator));else{var $=w.next_free_variable(),oe=new j(\",\",[z,new j(\"=\",[$,F])]),xe=w.points,Te=w.session.limit,lt=w.session.format_success;w.session.format_success=function(ir){return ir.substitution},w.add_goal(oe,!0,b);var Ct=[],qt=function(ir){if(ir!==!1&&ir!==null&&!x.type.is_error(ir))w.__calls.unshift(qt),Ct.push(ir.links[$.id]),w.session.limit=w.current_limit;else if(w.points=xe,w.session.limit=Te,w.session.format_success=lt,x.type.is_error(ir))w.throw_error(ir.args[0]);else if(w.current_limit>0){for(var Pt=new j(\"[]\"),gn=Ct.length-1;gn>=0;gn--)Pt=new j(\".\",[Ct[gn],Pt]);w.prepend([new Pe(b.goal.replace(new j(\"=\",[X,Pt])),b.substitution,b)])}};w.__calls.unshift(qt)}},\"bagof/3\":function(w,b,y){var F,z=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(X))w.throw_error(x.error.type(\"callable\",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else{var oe=w.next_free_variable(),xe;X.indicator===\"^/2\"?(xe=X.args[0].variables(),X=X.args[1]):xe=[],xe=xe.concat(z.variables());for(var Te=X.variables().filter(function(Or){return e(xe,Or)===-1}),lt=new j(\"[]\"),Ct=Te.length-1;Ct>=0;Ct--)lt=new j(\".\",[new De(Te[Ct]),lt]);var qt=new j(\",\",[X,new j(\"=\",[oe,new j(\",\",[lt,z])])]),ir=w.points,Pt=w.session.limit,gn=w.session.format_success;w.session.format_success=function(Or){return Or.substitution},w.add_goal(qt,!0,b);var Pr=[],Ir=function(Or){if(Or!==!1&&Or!==null&&!x.type.is_error(Or)){w.__calls.unshift(Ir);var on=!1,ai=Or.links[oe.id].args[0],Io=Or.links[oe.id].args[1];for(var rs in Pr)if(Pr.hasOwnProperty(rs)){var $s=Pr[rs];if($s.variables.equals(ai)){$s.answers.push(Io),on=!0;break}}on||Pr.push({variables:ai,answers:[Io]}),w.session.limit=w.current_limit}else if(w.points=ir,w.session.limit=Pt,w.session.format_success=gn,x.type.is_error(Or))w.throw_error(Or.args[0]);else if(w.current_limit>0){for(var Co=[],ji=0;ji<Pr.length;ji++){Or=Pr[ji].answers;for(var eo=new j(\"[]\"),wo=Or.length-1;wo>=0;wo--)eo=new j(\".\",[Or[wo],eo]);Co.push(new Pe(b.goal.replace(new j(\",\",[new j(\"=\",[lt,Pr[ji].variables]),new j(\"=\",[$,eo])])),b.substitution,b))}w.prepend(Co)}};w.__calls.unshift(Ir)}},\"setof/3\":function(w,b,y){var F,z=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(X))w.throw_error(x.error.type(\"callable\",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else{var oe=w.next_free_variable(),xe;X.indicator===\"^/2\"?(xe=X.args[0].variables(),X=X.args[1]):xe=[],xe=xe.concat(z.variables());for(var Te=X.variables().filter(function(Or){return e(xe,Or)===-1}),lt=new j(\"[]\"),Ct=Te.length-1;Ct>=0;Ct--)lt=new j(\".\",[new De(Te[Ct]),lt]);var qt=new j(\",\",[X,new j(\"=\",[oe,new j(\",\",[lt,z])])]),ir=w.points,Pt=w.session.limit,gn=w.session.format_success;w.session.format_success=function(Or){return Or.substitution},w.add_goal(qt,!0,b);var Pr=[],Ir=function(Or){if(Or!==!1&&Or!==null&&!x.type.is_error(Or)){w.__calls.unshift(Ir);var on=!1,ai=Or.links[oe.id].args[0],Io=Or.links[oe.id].args[1];for(var rs in Pr)if(Pr.hasOwnProperty(rs)){var $s=Pr[rs];if($s.variables.equals(ai)){$s.answers.push(Io),on=!0;break}}on||Pr.push({variables:ai,answers:[Io]}),w.session.limit=w.current_limit}else if(w.points=ir,w.session.limit=Pt,w.session.format_success=gn,x.type.is_error(Or))w.throw_error(Or.args[0]);else if(w.current_limit>0){for(var Co=[],ji=0;ji<Pr.length;ji++){Or=Pr[ji].answers.sort(x.compare);for(var eo=new j(\"[]\"),wo=Or.length-1;wo>=0;wo--)eo=new j(\".\",[Or[wo],eo]);Co.push(new Pe(b.goal.replace(new j(\",\",[new j(\"=\",[lt,Pr[ji].variables]),new j(\"=\",[$,eo])])),b.substitution,b))}w.prepend(Co)}};w.__calls.unshift(Ir)}},\"functor/3\":function(w,b,y){var F,z=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(z)&&(x.type.is_variable(X)||x.type.is_variable($)))w.throw_error(x.error.instantiation(\"functor/3\"));else if(!x.type.is_variable($)&&!x.type.is_integer($))w.throw_error(x.error.type(\"integer\",y.args[2],\"functor/3\"));else if(!x.type.is_variable(X)&&!x.type.is_atomic(X))w.throw_error(x.error.type(\"atomic\",y.args[1],\"functor/3\"));else if(x.type.is_integer(X)&&x.type.is_integer($)&&$.value!==0)w.throw_error(x.error.type(\"atom\",y.args[1],\"functor/3\"));else if(x.type.is_variable(z)){if(y.args[2].value>=0){for(var oe=[],xe=0;xe<$.value;xe++)oe.push(w.next_free_variable());var Te=x.type.is_integer(X)?X:new j(X.id,oe);w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,Te])),b.substitution,b)])}}else{var lt=x.type.is_integer(z)?z:new j(z.id,[]),Ct=x.type.is_integer(z)?new Re(0,!1):new Re(z.args.length,!1),qt=new j(\",\",[new j(\"=\",[lt,X]),new j(\"=\",[Ct,$])]);w.prepend([new Pe(b.goal.replace(qt),b.substitution,b)])}},\"arg/3\":function(w,b,y){if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))w.throw_error(x.error.instantiation(y.indicator));else if(y.args[0].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[0],y.indicator));else if(!x.type.is_compound(y.args[1]))w.throw_error(x.error.type(\"compound\",y.args[1],y.indicator));else{var F=y.args[0].value;if(F>0&&F<=y.args[1].args.length){var z=new j(\"=\",[y.args[1].args[F-1],y.args[2]]);w.prepend([new Pe(b.goal.replace(z),b.substitution,b)])}}},\"=../2\":function(w,b,y){var F;if(x.type.is_variable(y.args[0])&&(x.type.is_variable(y.args[1])||x.type.is_non_empty_list(y.args[1])&&x.type.is_variable(y.args[1].args[0])))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_fully_list(y.args[1]))w.throw_error(x.error.type(\"list\",y.args[1],y.indicator));else if(x.type.is_variable(y.args[0])){if(!x.type.is_variable(y.args[1])){var X=[];for(F=y.args[1].args[1];F.indicator===\"./2\";)X.push(F.args[0]),F=F.args[1];x.type.is_variable(y.args[0])&&x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):X.length===0&&x.type.is_compound(y.args[1].args[0])?w.throw_error(x.error.type(\"atomic\",y.args[1].args[0],y.indicator)):X.length>0&&(x.type.is_compound(y.args[1].args[0])||x.type.is_number(y.args[1].args[0]))?w.throw_error(x.error.type(\"atom\",y.args[1].args[0],y.indicator)):X.length===0?w.prepend([new Pe(b.goal.replace(new j(\"=\",[y.args[1].args[0],y.args[0]],b)),b.substitution,b)]):w.prepend([new Pe(b.goal.replace(new j(\"=\",[new j(y.args[1].args[0].id,X),y.args[0]])),b.substitution,b)])}}else{if(x.type.is_atomic(y.args[0]))F=new j(\".\",[y.args[0],new j(\"[]\")]);else{F=new j(\"[]\");for(var z=y.args[0].args.length-1;z>=0;z--)F=new j(\".\",[y.args[0].args[z],F]);F=new j(\".\",[new j(y.args[0].id),F])}w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,y.args[1]])),b.substitution,b)])}},\"copy_term/2\":function(w,b,y){var F=y.args[0].rename(w);w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,y.args[1]])),b.substitution,b.parent)])},\"term_variables/2\":function(w,b,y){var F=y.args[0],z=y.args[1];if(!x.type.is_fully_list(z))w.throw_error(x.error.type(\"list\",z,y.indicator));else{var X=g(s(ye(F.variables()),function($){return new De($)}));w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,X])),b.substitution,b)])}},\"clause/2\":function(w,b,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_callable(y.args[1]))w.throw_error(x.error.type(\"callable\",y.args[1],y.indicator));else if(w.session.rules[y.args[0].indicator]!==void 0)if(w.is_public_predicate(y.args[0].indicator)){var F=[];for(var z in w.session.rules[y.args[0].indicator])if(w.session.rules[y.args[0].indicator].hasOwnProperty(z)){var X=w.session.rules[y.args[0].indicator][z];w.session.renamed_variables={},X=X.rename(w),X.body===null&&(X.body=new j(\"true\"));var $=new j(\",\",[new j(\"=\",[X.head,y.args[0]]),new j(\"=\",[X.body,y.args[1]])]);F.push(new Pe(b.goal.replace($),b.substitution,b))}w.prepend(F)}else w.throw_error(x.error.permission(\"access\",\"private_procedure\",y.args[0].indicator,y.indicator))},\"current_predicate/1\":function(w,b,y){var F=y.args[0];if(!x.type.is_variable(F)&&(!x.type.is_compound(F)||F.indicator!==\"//2\"))w.throw_error(x.error.type(\"predicate_indicator\",F,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_variable(F.args[0])&&!x.type.is_atom(F.args[0]))w.throw_error(x.error.type(\"atom\",F.args[0],y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_variable(F.args[1])&&!x.type.is_integer(F.args[1]))w.throw_error(x.error.type(\"integer\",F.args[1],y.indicator));else{var z=[];for(var X in w.session.rules)if(w.session.rules.hasOwnProperty(X)){var $=X.lastIndexOf(\"/\"),oe=X.substr(0,$),xe=parseInt(X.substr($+1,X.length-($+1))),Te=new j(\"/\",[new j(oe),new Re(xe,!1)]),lt=new j(\"=\",[Te,F]);z.push(new Pe(b.goal.replace(lt),b.substitution,b))}w.prepend(z)}},\"asserta/1\":function(w,b,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=Ce(y.args[0].args[1])):(F=y.args[0],z=null),x.type.is_callable(F)?z!==null&&!x.type.is_callable(z)?w.throw_error(x.error.type(\"callable\",z,y.indicator)):w.is_public_predicate(F.indicator)?(w.session.rules[F.indicator]===void 0&&(w.session.rules[F.indicator]=[]),w.session.public_predicates[F.indicator]=!0,w.session.rules[F.indicator]=[new Ve(F,z,!0)].concat(w.session.rules[F.indicator]),w.success(b)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator)):w.throw_error(x.error.type(\"callable\",F,y.indicator))}},\"assertz/1\":function(w,b,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=Ce(y.args[0].args[1])):(F=y.args[0],z=null),x.type.is_callable(F)?z!==null&&!x.type.is_callable(z)?w.throw_error(x.error.type(\"callable\",z,y.indicator)):w.is_public_predicate(F.indicator)?(w.session.rules[F.indicator]===void 0&&(w.session.rules[F.indicator]=[]),w.session.public_predicates[F.indicator]=!0,w.session.rules[F.indicator].push(new Ve(F,z,!0)),w.success(b)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator)):w.throw_error(x.error.type(\"callable\",F,y.indicator))}},\"retract/1\":function(w,b,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;if(y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=y.args[0].args[1]):(F=y.args[0],z=new j(\"true\")),typeof b.retract>\"u\")if(w.is_public_predicate(F.indicator)){if(w.session.rules[F.indicator]!==void 0){for(var X=[],$=0;$<w.session.rules[F.indicator].length;$++){w.session.renamed_variables={};var oe=w.session.rules[F.indicator][$],xe=oe.rename(w);xe.body===null&&(xe.body=new j(\"true\",[]));var Te=w.get_flag(\"occurs_check\").indicator===\"true/0\",lt=x.unify(new j(\",\",[F,z]),new j(\",\",[xe.head,xe.body]),Te);if(lt!==null){var Ct=new Pe(b.goal.replace(new j(\",\",[new j(\"retract\",[new j(\":-\",[F,z])]),new j(\",\",[new j(\"=\",[F,xe.head]),new j(\"=\",[z,xe.body])])])),b.substitution,b);Ct.retract=oe,X.push(Ct)}}w.prepend(X)}}else w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator));else Ae(w,b,F.indicator,b.retract)}},\"retractall/1\":function(w,b,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_callable(F)?w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"retract\",[new x.type.Term(\":-\",[F,new De(\"_\")])]),new j(\"fail\",[])])),b.substitution,b),new Pe(b.goal.replace(null),b.substitution,b)]):w.throw_error(x.error.type(\"callable\",F,y.indicator))},\"abolish/1\":function(w,b,y){if(x.type.is_variable(y.args[0])||x.type.is_term(y.args[0])&&y.args[0].indicator===\"//2\"&&(x.type.is_variable(y.args[0].args[0])||x.type.is_variable(y.args[0].args[1])))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_term(y.args[0])||y.args[0].indicator!==\"//2\")w.throw_error(x.error.type(\"predicate_indicator\",y.args[0],y.indicator));else if(!x.type.is_atom(y.args[0].args[0]))w.throw_error(x.error.type(\"atom\",y.args[0].args[0],y.indicator));else if(!x.type.is_integer(y.args[0].args[1]))w.throw_error(x.error.type(\"integer\",y.args[0].args[1],y.indicator));else if(y.args[0].args[1].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[0].args[1],y.indicator));else if(x.type.is_number(w.get_flag(\"max_arity\"))&&y.args[0].args[1].value>w.get_flag(\"max_arity\").value)w.throw_error(x.error.representation(\"max_arity\",y.indicator));else{var F=y.args[0].args[0].id+\"/\"+y.args[0].args[1].value;w.is_public_predicate(F)?(delete w.session.rules[F],w.success(b)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F,y.indicator))}},\"atom_length/2\":function(w,b,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_atom(y.args[0]))w.throw_error(x.error.type(\"atom\",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_integer(y.args[1]))w.throw_error(x.error.type(\"integer\",y.args[1],y.indicator));else if(x.type.is_integer(y.args[1])&&y.args[1].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[1],y.indicator));else{var F=new Re(y.args[0].id.length,!1);w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,y.args[1]])),b.substitution,b)])}},\"atom_concat/3\":function(w,b,y){var F,z,X=y.args[0],$=y.args[1],oe=y.args[2];if(x.type.is_variable(oe)&&(x.type.is_variable(X)||x.type.is_variable($)))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_atom(X))w.throw_error(x.error.type(\"atom\",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_atom($))w.throw_error(x.error.type(\"atom\",$,y.indicator));else if(!x.type.is_variable(oe)&&!x.type.is_atom(oe))w.throw_error(x.error.type(\"atom\",oe,y.indicator));else{var xe=x.type.is_variable(X),Te=x.type.is_variable($);if(!xe&&!Te)z=new j(\"=\",[oe,new j(X.id+$.id)]),w.prepend([new Pe(b.goal.replace(z),b.substitution,b)]);else if(xe&&!Te)F=oe.id.substr(0,oe.id.length-$.id.length),F+$.id===oe.id&&(z=new j(\"=\",[X,new j(F)]),w.prepend([new Pe(b.goal.replace(z),b.substitution,b)]));else if(Te&&!xe)F=oe.id.substr(X.id.length),X.id+F===oe.id&&(z=new j(\"=\",[$,new j(F)]),w.prepend([new Pe(b.goal.replace(z),b.substitution,b)]));else{for(var lt=[],Ct=0;Ct<=oe.id.length;Ct++){var qt=new j(oe.id.substr(0,Ct)),ir=new j(oe.id.substr(Ct));z=new j(\",\",[new j(\"=\",[qt,X]),new j(\"=\",[ir,$])]),lt.push(new Pe(b.goal.replace(z),b.substitution,b))}w.prepend(lt)}}},\"sub_atom/5\":function(w,b,y){var F,z=y.args[0],X=y.args[1],$=y.args[2],oe=y.args[3],xe=y.args[4];if(x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_integer(X))w.throw_error(x.error.type(\"integer\",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_integer($))w.throw_error(x.error.type(\"integer\",$,y.indicator));else if(!x.type.is_variable(oe)&&!x.type.is_integer(oe))w.throw_error(x.error.type(\"integer\",oe,y.indicator));else if(x.type.is_integer(X)&&X.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",X,y.indicator));else if(x.type.is_integer($)&&$.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",$,y.indicator));else if(x.type.is_integer(oe)&&oe.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",oe,y.indicator));else{var Te=[],lt=[],Ct=[];if(x.type.is_variable(X))for(F=0;F<=z.id.length;F++)Te.push(F);else Te.push(X.value);if(x.type.is_variable($))for(F=0;F<=z.id.length;F++)lt.push(F);else lt.push($.value);if(x.type.is_variable(oe))for(F=0;F<=z.id.length;F++)Ct.push(F);else Ct.push(oe.value);var qt=[];for(var ir in Te)if(Te.hasOwnProperty(ir)){F=Te[ir];for(var Pt in lt)if(lt.hasOwnProperty(Pt)){var gn=lt[Pt],Pr=z.id.length-F-gn;if(e(Ct,Pr)!==-1&&F+gn+Pr===z.id.length){var Ir=z.id.substr(F,gn);if(z.id===z.id.substr(0,F)+Ir+z.id.substr(F+gn,Pr)){var Or=new j(\"=\",[new j(Ir),xe]),on=new j(\"=\",[X,new Re(F)]),ai=new j(\"=\",[$,new Re(gn)]),Io=new j(\"=\",[oe,new Re(Pr)]),rs=new j(\",\",[new j(\",\",[new j(\",\",[on,ai]),Io]),Or]);qt.push(new Pe(b.goal.replace(rs),b.substitution,b))}}}}w.prepend(qt)}},\"atom_chars/2\":function(w,b,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_variable(F)){for(var oe=z,xe=x.type.is_variable(F),Te=\"\";oe.indicator===\"./2\";){if(x.type.is_character(oe.args[0]))Te+=oe.args[0].id;else if(x.type.is_variable(oe.args[0])&&xe){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character\",oe.args[0],y.indicator));return}oe=oe.args[1]}x.type.is_variable(oe)&&xe?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)?w.throw_error(x.error.type(\"list\",z,y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[new j(Te),F])),b.substitution,b)])}else{for(var X=new j(\"[]\"),$=F.id.length-1;$>=0;$--)X=new j(\".\",[new j(F.id.charAt($)),X]);w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,X])),b.substitution,b)])}},\"atom_codes/2\":function(w,b,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_variable(F)){for(var oe=z,xe=x.type.is_variable(F),Te=\"\";oe.indicator===\"./2\";){if(x.type.is_character_code(oe.args[0]))Te+=c(oe.args[0].value);else if(x.type.is_variable(oe.args[0])&&xe){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.representation(\"character_code\",y.indicator));return}oe=oe.args[1]}x.type.is_variable(oe)&&xe?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)?w.throw_error(x.error.type(\"list\",z,y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[new j(Te),F])),b.substitution,b)])}else{for(var X=new j(\"[]\"),$=F.id.length-1;$>=0;$--)X=new j(\".\",[new Re(n(F.id,$),!1),X]);w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,X])),b.substitution,b)])}},\"char_code/2\":function(w,b,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_character(F))w.throw_error(x.error.type(\"character\",F,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",z,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character_code(z))w.throw_error(x.error.representation(\"character_code\",y.indicator));else if(x.type.is_variable(z)){var X=new Re(n(F.id,0),!1);w.prepend([new Pe(b.goal.replace(new j(\"=\",[X,z])),b.substitution,b)])}else{var $=new j(c(z.value));w.prepend([new Pe(b.goal.replace(new j(\"=\",[$,F])),b.substitution,b)])}},\"number_chars/2\":function(w,b,y){var F,z=y.args[0],X=y.args[1];if(x.type.is_variable(z)&&x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_number(z))w.throw_error(x.error.type(\"number\",z,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))w.throw_error(x.error.type(\"list\",X,y.indicator));else{var $=x.type.is_variable(z);if(!x.type.is_variable(X)){var oe=X,xe=!0;for(F=\"\";oe.indicator===\"./2\";){if(x.type.is_character(oe.args[0]))F+=oe.args[0].id;else if(x.type.is_variable(oe.args[0]))xe=!1;else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character\",oe.args[0],y.indicator));return}oe=oe.args[1]}if(xe=xe&&x.type.is_empty_list(oe),!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)){w.throw_error(x.error.type(\"list\",X,y.indicator));return}if(!xe&&$){w.throw_error(x.error.instantiation(y.indicator));return}else if(xe)if(x.type.is_variable(oe)&&$){w.throw_error(x.error.instantiation(y.indicator));return}else{var Te=w.parse(F),lt=Te.value;!x.type.is_number(lt)||Te.tokens[Te.tokens.length-1].space?w.throw_error(x.error.syntax_by_predicate(\"parseable_number\",y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,lt])),b.substitution,b)]);return}}if(!$){F=z.toString();for(var Ct=new j(\"[]\"),qt=F.length-1;qt>=0;qt--)Ct=new j(\".\",[new j(F.charAt(qt)),Ct]);w.prepend([new Pe(b.goal.replace(new j(\"=\",[X,Ct])),b.substitution,b)])}}},\"number_codes/2\":function(w,b,y){var F,z=y.args[0],X=y.args[1];if(x.type.is_variable(z)&&x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_number(z))w.throw_error(x.error.type(\"number\",z,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))w.throw_error(x.error.type(\"list\",X,y.indicator));else{var $=x.type.is_variable(z);if(!x.type.is_variable(X)){var oe=X,xe=!0;for(F=\"\";oe.indicator===\"./2\";){if(x.type.is_character_code(oe.args[0]))F+=c(oe.args[0].value);else if(x.type.is_variable(oe.args[0]))xe=!1;else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character_code\",oe.args[0],y.indicator));return}oe=oe.args[1]}if(xe=xe&&x.type.is_empty_list(oe),!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)){w.throw_error(x.error.type(\"list\",X,y.indicator));return}if(!xe&&$){w.throw_error(x.error.instantiation(y.indicator));return}else if(xe)if(x.type.is_variable(oe)&&$){w.throw_error(x.error.instantiation(y.indicator));return}else{var Te=w.parse(F),lt=Te.value;!x.type.is_number(lt)||Te.tokens[Te.tokens.length-1].space?w.throw_error(x.error.syntax_by_predicate(\"parseable_number\",y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,lt])),b.substitution,b)]);return}}if(!$){F=z.toString();for(var Ct=new j(\"[]\"),qt=F.length-1;qt>=0;qt--)Ct=new j(\".\",[new Re(n(F,qt),!1),Ct]);w.prepend([new Pe(b.goal.replace(new j(\"=\",[X,Ct])),b.substitution,b)])}}},\"upcase_atom/2\":function(w,b,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?!x.type.is_variable(z)&&!x.type.is_atom(z)?w.throw_error(x.error.type(\"atom\",z,y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,new j(F.id.toUpperCase(),[])])),b.substitution,b)]):w.throw_error(x.error.type(\"atom\",F,y.indicator))},\"downcase_atom/2\":function(w,b,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?!x.type.is_variable(z)&&!x.type.is_atom(z)?w.throw_error(x.error.type(\"atom\",z,y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,new j(F.id.toLowerCase(),[])])),b.substitution,b)]):w.throw_error(x.error.type(\"atom\",F,y.indicator))},\"atomic_list_concat/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"atomic_list_concat\",[F,new j(\"\",[]),z])),b.substitution,b)])},\"atomic_list_concat/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2];if(x.type.is_variable(z)||x.type.is_variable(F)&&x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_list(F))w.throw_error(x.error.type(\"list\",F,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_atom(X))w.throw_error(x.error.type(\"atom\",X,y.indicator));else if(x.type.is_variable(X)){for(var oe=\"\",xe=F;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(!x.type.is_atom(xe.args[0])&&!x.type.is_number(xe.args[0])){w.throw_error(x.error.type(\"atomic\",xe.args[0],y.indicator));return}oe!==\"\"&&(oe+=z.id),x.type.is_atom(xe.args[0])?oe+=xe.args[0].id:oe+=\"\"+xe.args[0].value,xe=xe.args[1]}oe=new j(oe,[]),x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_term(xe)||xe.indicator!==\"[]/0\"?w.throw_error(x.error.type(\"list\",F,y.indicator)):w.prepend([new Pe(b.goal.replace(new j(\"=\",[oe,X])),b.substitution,b)])}else{var $=g(s(X.id.split(z.id),function(Te){return new j(Te,[])}));w.prepend([new Pe(b.goal.replace(new j(\"=\",[$,F])),b.substitution,b)])}},\"@=</2\":function(w,b,y){x.compare(y.args[0],y.args[1])<=0&&w.success(b)},\"==/2\":function(w,b,y){x.compare(y.args[0],y.args[1])===0&&w.success(b)},\"\\\\==/2\":function(w,b,y){x.compare(y.args[0],y.args[1])!==0&&w.success(b)},\"@</2\":function(w,b,y){x.compare(y.args[0],y.args[1])<0&&w.success(b)},\"@>/2\":function(w,b,y){x.compare(y.args[0],y.args[1])>0&&w.success(b)},\"@>=/2\":function(w,b,y){x.compare(y.args[0],y.args[1])>=0&&w.success(b)},\"compare/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2];if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_atom(F)&&[\"<\",\">\",\"=\"].indexOf(F.id)===-1)w.throw_error(x.type.domain(\"order\",F,y.indicator));else{var $=x.compare(z,X);$=$===0?\"=\":$===-1?\"<\":\">\",w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,new j($,[])])),b.substitution,b)])}},\"is/2\":function(w,b,y){var F=y.args[1].interpret(w);x.type.is_number(F)?w.prepend([new Pe(b.goal.replace(new j(\"=\",[y.args[0],F],w.level)),b.substitution,b)]):w.throw_error(F)},\"between/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2];if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_integer(F))w.throw_error(x.error.type(\"integer\",F,y.indicator));else if(!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",z,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_integer(X))w.throw_error(x.error.type(\"integer\",X,y.indicator));else if(x.type.is_variable(X)){var $=[new Pe(b.goal.replace(new j(\"=\",[X,F])),b.substitution,b)];F.value<z.value&&$.push(new Pe(b.goal.replace(new j(\"between\",[new Re(F.value+1,!1),z,X])),b.substitution,b)),w.prepend($)}else F.value<=X.value&&z.value>=X.value&&w.success(b)},\"succ/2\":function(w,b,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)&&x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_integer(F)?w.throw_error(x.error.type(\"integer\",F,y.indicator)):!x.type.is_variable(z)&&!x.type.is_integer(z)?w.throw_error(x.error.type(\"integer\",z,y.indicator)):!x.type.is_variable(F)&&F.value<0?w.throw_error(x.error.domain(\"not_less_than_zero\",F,y.indicator)):!x.type.is_variable(z)&&z.value<0?w.throw_error(x.error.domain(\"not_less_than_zero\",z,y.indicator)):(x.type.is_variable(z)||z.value>0)&&(x.type.is_variable(F)?w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,new Re(z.value-1,!1)])),b.substitution,b)]):w.prepend([new Pe(b.goal.replace(new j(\"=\",[z,new Re(F.value+1,!1)])),b.substitution,b)]))},\"=:=/2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F===0&&w.success(b)},\"=\\\\=/2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F!==0&&w.success(b)},\"</2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F<0&&w.success(b)},\"=</2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F<=0&&w.success(b)},\">/2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F>0&&w.success(b)},\">=/2\":function(w,b,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F>=0&&w.success(b)},\"var/1\":function(w,b,y){x.type.is_variable(y.args[0])&&w.success(b)},\"atom/1\":function(w,b,y){x.type.is_atom(y.args[0])&&w.success(b)},\"atomic/1\":function(w,b,y){x.type.is_atomic(y.args[0])&&w.success(b)},\"compound/1\":function(w,b,y){x.type.is_compound(y.args[0])&&w.success(b)},\"integer/1\":function(w,b,y){x.type.is_integer(y.args[0])&&w.success(b)},\"float/1\":function(w,b,y){x.type.is_float(y.args[0])&&w.success(b)},\"number/1\":function(w,b,y){x.type.is_number(y.args[0])&&w.success(b)},\"nonvar/1\":function(w,b,y){x.type.is_variable(y.args[0])||w.success(b)},\"ground/1\":function(w,b,y){y.variables().length===0&&w.success(b)},\"acyclic_term/1\":function(w,b,y){for(var F=b.substitution.apply(b.substitution),z=y.args[0].variables(),X=0;X<z.length;X++)if(b.substitution.links[z[X]]!==void 0&&!b.substitution.links[z[X]].equals(F.links[z[X]]))return;w.success(b)},\"callable/1\":function(w,b,y){x.type.is_callable(y.args[0])&&w.success(b)},\"is_list/1\":function(w,b,y){for(var F=y.args[0];x.type.is_term(F)&&F.indicator===\"./2\";)F=F.args[1];x.type.is_term(F)&&F.indicator===\"[]/0\"&&w.success(b)},\"current_input/1\":function(w,b,y){var F=y.args[0];!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream\",F,y.indicator)):(x.type.is_atom(F)&&w.get_stream_by_alias(F.id)&&(F=w.get_stream_by_alias(F.id)),w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,w.get_current_input()])),b.substitution,b)]))},\"current_output/1\":function(w,b,y){var F=y.args[0];!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):(x.type.is_atom(F)&&w.get_stream_by_alias(F.id)&&(F=w.get_stream_by_alias(F.id)),w.prepend([new Pe(b.goal.replace(new j(\"=\",[F,w.get_current_output()])),b.substitution,b)]))},\"set_input/1\":function(w,b,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):x.type.is_stream(z)?z.output===!0?w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator)):(w.set_current_input(z),w.success(b)):w.throw_error(x.error.existence(\"stream\",F,y.indicator))},\"set_output/1\":function(w,b,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):x.type.is_stream(z)?z.input===!0?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):(w.set_current_output(z),w.success(b)):w.throw_error(x.error.existence(\"stream\",F,y.indicator))},\"open/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2];w.prepend([new Pe(b.goal.replace(new j(\"open\",[F,z,X,new j(\"[]\",[])])),b.substitution,b)])},\"open/4\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2],$=y.args[3];if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_atom(z))w.throw_error(x.error.type(\"atom\",z,y.indicator));else if(!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else if(!x.type.is_variable(X))w.throw_error(x.error.type(\"variable\",X,y.indicator));else if(!x.type.is_atom(F)&&!x.type.is_streamable(F))w.throw_error(x.error.domain(\"source_sink\",F,y.indicator));else if(!x.type.is_io_mode(z))w.throw_error(x.error.domain(\"io_mode\",z,y.indicator));else{for(var oe={},xe=$,Te;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Te=xe.args[0],x.type.is_variable(Te)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_stream_option(Te)){w.throw_error(x.error.domain(\"stream_option\",Te,y.indicator));return}oe[Te.id]=Te.args[0].id,xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",$,y.indicator));return}else{var lt=oe.alias;if(lt&&w.get_stream_by_alias(lt)){w.throw_error(x.error.permission(\"open\",\"source_sink\",new j(\"alias\",[new j(lt,[])]),y.indicator));return}oe.type||(oe.type=\"text\");var Ct;if(x.type.is_atom(F)?Ct=w.file_system_open(F.id,oe.type,z.id):Ct=F.stream(oe.type,z.id),Ct===!1){w.throw_error(x.error.permission(\"open\",\"source_sink\",F,y.indicator));return}else if(Ct===null){w.throw_error(x.error.existence(\"source_sink\",F,y.indicator));return}var qt=new Fe(Ct,z.id,oe.alias,oe.type,oe.reposition===\"true\",oe.eof_action);lt?w.session.streams[lt]=qt:w.session.streams[qt.id]=qt,w.prepend([new Pe(b.goal.replace(new j(\"=\",[X,qt])),b.substitution,b)])}}},\"close/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\"close\",[F,new j(\"[]\",[])])),b.substitution,b)])},\"close/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(z))w.throw_error(x.error.type(\"list\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else{for(var $={},oe=z,xe;x.type.is_term(oe)&&oe.indicator===\"./2\";){if(xe=oe.args[0],x.type.is_variable(xe)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_close_option(xe)){w.throw_error(x.error.domain(\"close_option\",xe,y.indicator));return}$[xe.id]=xe.args[0].id===\"true\",oe=oe.args[1]}if(oe.indicator!==\"[]/0\"){x.type.is_variable(oe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",z,y.indicator));return}else{if(X===w.session.standard_input||X===w.session.standard_output){w.success(b);return}else X===w.session.current_input?w.session.current_input=w.session.standard_input:X===w.session.current_output&&(w.session.current_output=w.session.current_output);X.alias!==null?delete w.session.streams[X.alias]:delete w.session.streams[X.id],X.output&&X.stream.flush();var Te=X.stream.close();X.stream=null,($.force===!0||Te===!0)&&w.success(b)}}},\"flush_output/0\":function(w,b,y){w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"flush_output\",[new De(\"S\")])])),b.substitution,b)])},\"flush_output/1\":function(w,b,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(z)||z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):F.input===!0?w.throw_error(x.error.permission(\"output\",\"stream\",output,y.indicator)):(z.stream.flush(),w.success(b))},\"stream_property/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_variable(F)&&(!x.type.is_stream(X)||X.stream===null))w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_stream_property(z))w.throw_error(x.error.domain(\"stream_property\",z,y.indicator));else{var $=[],oe=[];if(!x.type.is_variable(F))$.push(X);else for(var xe in w.session.streams)$.push(w.session.streams[xe]);for(var Te=0;Te<$.length;Te++){var lt=[];$[Te].filename&&lt.push(new j(\"file_name\",[new j($[Te].file_name,[])])),lt.push(new j(\"mode\",[new j($[Te].mode,[])])),lt.push(new j($[Te].input?\"input\":\"output\",[])),$[Te].alias&&lt.push(new j(\"alias\",[new j($[Te].alias,[])])),lt.push(new j(\"position\",[typeof $[Te].position==\"number\"?new Re($[Te].position,!1):new j($[Te].position,[])])),lt.push(new j(\"end_of_stream\",[new j($[Te].position===\"end_of_stream\"?\"at\":$[Te].position===\"past_end_of_stream\"?\"past\":\"not\",[])])),lt.push(new j(\"eof_action\",[new j($[Te].eof_action,[])])),lt.push(new j(\"reposition\",[new j($[Te].reposition?\"true\":\"false\",[])])),lt.push(new j(\"type\",[new j($[Te].type,[])]));for(var Ct=0;Ct<lt.length;Ct++)oe.push(new Pe(b.goal.replace(new j(\",\",[new j(\"=\",[x.type.is_variable(F)?F:X,$[Te]]),new j(\"=\",[z,lt[Ct]])])),b.substitution,b))}w.prepend(oe)}},\"at_end_of_stream/0\":function(w,b,y){w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\",\",[new j(\"stream_property\",[new De(\"S\"),new j(\"end_of_stream\",[new De(\"E\")])]),new j(\",\",[new j(\"!\",[]),new j(\";\",[new j(\"=\",[new De(\"E\"),new j(\"at\",[])]),new j(\"=\",[new De(\"E\"),new j(\"past\",[])])])])])])),b.substitution,b)])},\"at_end_of_stream/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"stream_property\",[F,new j(\"end_of_stream\",[new De(\"E\")])]),new j(\",\",[new j(\"!\",[]),new j(\";\",[new j(\"=\",[new De(\"E\"),new j(\"at\",[])]),new j(\"=\",[new De(\"E\"),new j(\"past\",[])])])])])),b.substitution,b)])},\"set_stream_position/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(X)||X.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):x.type.is_stream_position(z)?X.reposition===!1?w.throw_error(x.error.permission(\"reposition\",\"stream\",F,y.indicator)):(x.type.is_integer(z)?X.position=z.value:X.position=z.id,w.success(b)):w.throw_error(x.error.domain(\"stream_position\",z,y.indicator))},\"get_char/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_char\",[new De(\"S\"),F])])),b.substitution,b)])},\"get_char/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character(z))w.throw_error(x.error.type(\"in_character\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=\"end_of_file\",X.position=\"past_end_of_stream\";else{if($=X.stream.get(1,X.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}X.position++}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new j($,[]),z])),b.substitution,b)])}},\"get_code/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_code\",[new De(\"S\"),F])])),b.substitution,b)])},\"get_code/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",char,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=-1,X.position=\"past_end_of_stream\";else{if($=X.stream.get(1,X.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}$=n($,0),X.position++}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new Re($,!1),z])),b.substitution,b)])}},\"peek_char/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_char\",[new De(\"S\"),F])])),b.substitution,b)])},\"peek_char/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character(z))w.throw_error(x.error.type(\"in_character\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=\"end_of_file\",X.position=\"past_end_of_stream\";else if($=X.stream.get(1,X.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new j($,[]),z])),b.substitution,b)])}},\"peek_code/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_code\",[new De(\"S\"),F])])),b.substitution,b)])},\"peek_code/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",char,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=-1,X.position=\"past_end_of_stream\";else{if($=X.stream.get(1,X.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}$=n($,0)}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new Re($,!1),z])),b.substitution,b)])}},\"put_char/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_char\",[new De(\"S\"),F])])),b.substitution,b)])},\"put_char/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_character(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(X)||X.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):X.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):X.type===\"binary\"?w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator)):X.stream.put(z.id,X.position)&&(typeof X.position==\"number\"&&X.position++,w.success(b)):w.throw_error(x.error.type(\"character\",z,y.indicator))},\"put_code/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_code\",[new De(\"S\"),F])])),b.substitution,b)])},\"put_code/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_integer(z)?x.type.is_character_code(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(X)||X.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):X.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):X.type===\"binary\"?w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator)):X.stream.put_char(c(z.value),X.position)&&(typeof X.position==\"number\"&&X.position++,w.success(b)):w.throw_error(x.error.representation(\"character_code\",y.indicator)):w.throw_error(x.error.type(\"integer\",z,y.indicator))},\"nl/0\":function(w,b,y){w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_char\",[new De(\"S\"),new j(`\n`,[])])])),b.substitution,b)])},\"nl/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\"put_char\",[F,new j(`\n`,[])])),b.substitution,b)])},\"get_byte/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_byte\",[new De(\"S\"),F])])),b.substitution,b)])},\"get_byte/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type(\"in_byte\",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"text\")w.throw_error(x.error.permission(\"input\",\"text_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=\"end_of_file\",X.position=\"past_end_of_stream\";else{if($=X.stream.get_byte(X.position),$===null){w.throw_error(x.error.representation(\"byte\",y.indicator));return}X.position++}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new Re($,!1),z])),b.substitution,b)])}},\"peek_byte/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_byte\",[new De(\"S\"),F])])),b.substitution,b)])},\"peek_byte/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type(\"in_byte\",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(X)||X.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(X.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(X.type===\"text\")w.throw_error(x.error.permission(\"input\",\"text_stream\",F,y.indicator));else if(X.position===\"past_end_of_stream\"&&X.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(X.position===\"end_of_stream\")$=\"end_of_file\",X.position=\"past_end_of_stream\";else if($=X.stream.get_byte(X.position),$===null){w.throw_error(x.error.representation(\"byte\",y.indicator));return}w.prepend([new Pe(b.goal.replace(new j(\"=\",[new Re($,!1),z])),b.substitution,b)])}},\"put_byte/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_byte\",[new De(\"S\"),F])])),b.substitution,b)])},\"put_byte/2\":function(w,b,y){var F=y.args[0],z=y.args[1],X=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_byte(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(X)||X.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):X.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):X.type===\"text\"?w.throw_error(x.error.permission(\"output\",\"text_stream\",F,y.indicator)):X.stream.put_byte(z.value,X.position)&&(typeof X.position==\"number\"&&X.position++,w.success(b)):w.throw_error(x.error.type(\"byte\",z,y.indicator))},\"read/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"read_term\",[new De(\"S\"),F,new j(\"[]\",[])])])),b.substitution,b)])},\"read/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"read_term\",[F,z,new j(\"[]\",[])])),b.substitution,b)])},\"read_term/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"read_term\",[new De(\"S\"),F,z])])),b.substitution,b)])},\"read_term/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2],$=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(X))w.throw_error(x.error.type(\"list\",X,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream($)||$.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if($.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if($.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if($.position===\"past_end_of_stream\"&&$.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{for(var oe={},xe=X,Te;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Te=xe.args[0],x.type.is_variable(Te)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_read_option(Te)){w.throw_error(x.error.domain(\"read_option\",Te,y.indicator));return}oe[Te.id]=Te.args[0],xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",X,y.indicator));return}else{for(var lt,Ct,qt,ir=\"\",Pt=[],gn=null;gn===null||gn.name!==\"atom\"||gn.value!==\".\"||qt.type===f&&x.flatten_error(new j(\"throw\",[qt.value])).found===\"token_not_found\";){if(lt=$.stream.get(1,$.position),lt===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}if(lt===\"end_of_file\"||lt===\"past_end_of_file\"){qt?w.throw_error(x.error.syntax(Pt[qt.len-1],\". or expression expected\",!1)):w.throw_error(x.error.syntax(null,\"token not found\",!0));return}$.position++,ir+=lt,Ct=new U(w),Ct.new_text(ir),Pt=Ct.get_tokens(),gn=Pt!==null&&Pt.length>0?Pt[Pt.length-1]:null,Pt!==null&&(qt=W(w,Pt,0,w.__get_max_priority(),!1))}if(qt.type===p&&qt.len===Pt.length-1&&gn.value===\".\"){qt=qt.value.rename(w);var Pr=new j(\"=\",[z,qt]);if(oe.variables){var Ir=g(s(ye(qt.variables()),function(Or){return new De(Or)}));Pr=new j(\",\",[Pr,new j(\"=\",[oe.variables,Ir])])}if(oe.variable_names){var Ir=g(s(ye(qt.variables()),function(on){var ai;for(ai in w.session.renamed_variables)if(w.session.renamed_variables.hasOwnProperty(ai)&&w.session.renamed_variables[ai]===on)break;return new j(\"=\",[new j(ai,[]),new De(on)])}));Pr=new j(\",\",[Pr,new j(\"=\",[oe.variable_names,Ir])])}if(oe.singletons){var Ir=g(s(new Ve(qt,null).singleton_variables(),function(on){var ai;for(ai in w.session.renamed_variables)if(w.session.renamed_variables.hasOwnProperty(ai)&&w.session.renamed_variables[ai]===on)break;return new j(\"=\",[new j(ai,[]),new De(on)])}));Pr=new j(\",\",[Pr,new j(\"=\",[oe.singletons,Ir])])}w.prepend([new Pe(b.goal.replace(Pr),b.substitution,b)])}else qt.type===p?w.throw_error(x.error.syntax(Pt[qt.len],\"unexpected token\",!1)):w.throw_error(qt.value)}}},\"write/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write\",[new De(\"S\"),F])])),b.substitution,b)])},\"write/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"false\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"false\")]),new j(\".\",[new j(\"numbervars\",[new j(\"true\")]),new j(\"[]\",[])])])])])),b.substitution,b)])},\"writeq/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"writeq\",[new De(\"S\"),F])])),b.substitution,b)])},\"writeq/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"true\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"false\")]),new j(\".\",[new j(\"numbervars\",[new j(\"true\")]),new j(\"[]\",[])])])])])),b.substitution,b)])},\"write_canonical/1\":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write_canonical\",[new De(\"S\"),F])])),b.substitution,b)])},\"write_canonical/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"true\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"true\")]),new j(\".\",[new j(\"numbervars\",[new j(\"false\")]),new j(\"[]\",[])])])])])),b.substitution,b)])},\"write_term/2\":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write_term\",[new De(\"S\"),F,z])])),b.substitution,b)])},\"write_term/3\":function(w,b,y){var F=y.args[0],z=y.args[1],X=y.args[2],$=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(X))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(X))w.throw_error(x.error.type(\"list\",X,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream($)||$.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if($.input)w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator));else if($.type===\"binary\")w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator));else if($.position===\"past_end_of_stream\"&&$.eof_action===\"error\")w.throw_error(x.error.permission(\"output\",\"past_end_of_stream\",F,y.indicator));else{for(var oe={},xe=X,Te;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Te=xe.args[0],x.type.is_variable(Te)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_write_option(Te)){w.throw_error(x.error.domain(\"write_option\",Te,y.indicator));return}oe[Te.id]=Te.args[0].id===\"true\",xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",X,y.indicator));return}else{oe.session=w.session;var lt=z.toString(oe);$.stream.put(lt,$.position),typeof $.position==\"number\"&&($.position+=lt.length),w.success(b)}}},\"halt/0\":function(w,b,y){w.points=[]},\"halt/1\":function(w,b,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_integer(F)?w.points=[]:w.throw_error(x.error.type(\"integer\",F,y.indicator))},\"current_prolog_flag/2\":function(w,b,y){var F=y.args[0],z=y.args[1];if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_flag(F))w.throw_error(x.error.domain(\"prolog_flag\",F,y.indicator));else{var X=[];for(var $ in x.flag)if(x.flag.hasOwnProperty($)){var oe=new j(\",\",[new j(\"=\",[new j($),F]),new j(\"=\",[w.get_flag($),z])]);X.push(new Pe(b.goal.replace(oe),b.substitution,b))}w.prepend(X)}},\"set_prolog_flag/2\":function(w,b,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?x.type.is_flag(F)?x.type.is_value_flag(F,z)?x.type.is_modifiable_flag(F)?(w.session.flag[F.id]=z,w.success(b)):w.throw_error(x.error.permission(\"modify\",\"flag\",F)):w.throw_error(x.error.domain(\"flag_value\",new j(\"+\",[F,z]),y.indicator)):w.throw_error(x.error.domain(\"prolog_flag\",F,y.indicator)):w.throw_error(x.error.type(\"atom\",F,y.indicator))}},flag:{bounded:{allowed:[new j(\"true\"),new j(\"false\")],value:new j(\"true\"),changeable:!1},max_integer:{allowed:[new Re(Number.MAX_SAFE_INTEGER)],value:new Re(Number.MAX_SAFE_INTEGER),changeable:!1},min_integer:{allowed:[new Re(Number.MIN_SAFE_INTEGER)],value:new Re(Number.MIN_SAFE_INTEGER),changeable:!1},integer_rounding_function:{allowed:[new j(\"down\"),new j(\"toward_zero\")],value:new j(\"toward_zero\"),changeable:!1},char_conversion:{allowed:[new j(\"on\"),new j(\"off\")],value:new j(\"on\"),changeable:!0},debug:{allowed:[new j(\"on\"),new j(\"off\")],value:new j(\"off\"),changeable:!0},max_arity:{allowed:[new j(\"unbounded\")],value:new j(\"unbounded\"),changeable:!1},unknown:{allowed:[new j(\"error\"),new j(\"fail\"),new j(\"warning\")],value:new j(\"error\"),changeable:!0},double_quotes:{allowed:[new j(\"chars\"),new j(\"codes\"),new j(\"atom\")],value:new j(\"codes\"),changeable:!0},occurs_check:{allowed:[new j(\"false\"),new j(\"true\")],value:new j(\"false\"),changeable:!0},dialect:{allowed:[new j(\"tau\")],value:new j(\"tau\"),changeable:!1},version_data:{allowed:[new j(\"tau\",[new Re(t.major,!1),new Re(t.minor,!1),new Re(t.patch,!1),new j(t.status)])],value:new j(\"tau\",[new Re(t.major,!1),new Re(t.minor,!1),new Re(t.patch,!1),new j(t.status)]),changeable:!1},nodejs:{allowed:[new j(\"yes\"),new j(\"no\")],value:new j(typeof ec<\"u\"&&ec.exports?\"yes\":\"no\"),changeable:!1}},unify:function(w,b,y){y=y===void 0?!1:y;for(var F=[{left:w,right:b}],z={};F.length!==0;){var X=F.pop();if(w=X.left,b=X.right,x.type.is_term(w)&&x.type.is_term(b)){if(w.indicator!==b.indicator)return null;for(var $=0;$<w.args.length;$++)F.push({left:w.args[$],right:b.args[$]})}else if(x.type.is_number(w)&&x.type.is_number(b)){if(w.value!==b.value||w.is_float!==b.is_float)return null}else if(x.type.is_variable(w)){if(x.type.is_variable(b)&&w.id===b.id)continue;if(y===!0&&b.variables().indexOf(w.id)!==-1)return null;if(w.id!==\"_\"){var oe=new Ne;oe.add(w.id,b);for(var $=0;$<F.length;$++)F[$].left=F[$].left.apply(oe),F[$].right=F[$].right.apply(oe);for(var $ in z)z[$]=z[$].apply(oe);z[w.id]=b}}else if(x.type.is_variable(b))F.push({left:b,right:w});else if(w.unify!==void 0){if(!w.unify(b))return null}else return null}return new Ne(z)},compare:function(w,b){var y=x.type.compare(w,b);return y!==0?y:w.compare(b)},arithmetic_compare:function(w,b,y){var F=b.interpret(w);if(x.type.is_number(F)){var z=y.interpret(w);return x.type.is_number(z)?F.value<z.value?-1:F.value>z.value?1:0:z}else return F},operate:function(w,b){if(x.type.is_operator(b)){for(var y=x.type.is_operator(b),F=[],z,X=!1,$=0;$<b.args.length;$++){if(z=b.args[$].interpret(w),x.type.is_number(z)){if(y.type_args!==null&&z.is_float!==y.type_args)return x.error.type(y.type_args?\"float\":\"integer\",z,w.__call_indicator);F.push(z.value)}else return z;X=X||z.is_float}return F.push(w),z=x.arithmetic.evaluation[b.indicator].fn.apply(this,F),X=y.type_result===null?X:y.type_result,x.type.is_term(z)?z:z===Number.POSITIVE_INFINITY||z===Number.NEGATIVE_INFINITY?x.error.evaluation(\"overflow\",w.__call_indicator):X===!1&&w.get_flag(\"bounded\").id===\"true\"&&(z>w.get_flag(\"max_integer\").value||z<w.get_flag(\"min_integer\").value)?x.error.evaluation(\"int_overflow\",w.__call_indicator):new Re(z,X)}else return x.error.type(\"evaluable\",b.indicator,w.__call_indicator)},error:{existence:function(w,b,y){return typeof b==\"string\"&&(b=Z(b)),new j(\"error\",[new j(\"existence_error\",[new j(w),b]),Z(y)])},type:function(w,b,y){return new j(\"error\",[new j(\"type_error\",[new j(w),b]),Z(y)])},instantiation:function(w){return new j(\"error\",[new j(\"instantiation_error\"),Z(w)])},domain:function(w,b,y){return new j(\"error\",[new j(\"domain_error\",[new j(w),b]),Z(y)])},representation:function(w,b){return new j(\"error\",[new j(\"representation_error\",[new j(w)]),Z(b)])},permission:function(w,b,y,F){return new j(\"error\",[new j(\"permission_error\",[new j(w),new j(b),y]),Z(F)])},evaluation:function(w,b){return new j(\"error\",[new j(\"evaluation_error\",[new j(w)]),Z(b)])},syntax:function(w,b,y){w=w||{value:\"\",line:0,column:0,matches:[\"\"],start:0};var F=y&&w.matches.length>0?w.start+w.matches[0].length:w.start,z=y?new j(\"token_not_found\"):new j(\"found\",[new j(w.value.toString())]),X=new j(\".\",[new j(\"line\",[new Re(w.line+1)]),new j(\".\",[new j(\"column\",[new Re(F+1)]),new j(\".\",[z,new j(\"[]\",[])])])]);return new j(\"error\",[new j(\"syntax_error\",[new j(b)]),X])},syntax_by_predicate:function(w,b){return new j(\"error\",[new j(\"syntax_error\",[new j(w)]),Z(b)])}},warning:{singleton:function(w,b,y){for(var F=new j(\"[]\"),z=w.length-1;z>=0;z--)F=new j(\".\",[new De(w[z]),F]);return new j(\"warning\",[new j(\"singleton_variables\",[F,Z(b)]),new j(\".\",[new j(\"line\",[new Re(y,!1)]),new j(\"[]\")])])},failed_goal:function(w,b){return new j(\"warning\",[new j(\"failed_goal\",[w]),new j(\".\",[new j(\"line\",[new Re(b,!1)]),new j(\"[]\")])])}},format_variable:function(w){return\"_\"+w},format_answer:function(w,b,F){b instanceof ke&&(b=b.thread);var F=F||{};if(F.session=b?b.session:void 0,x.type.is_error(w))return\"uncaught exception: \"+w.args[0].toString();if(w===!1)return\"false.\";if(w===null)return\"limit exceeded ;\";var z=0,X=\"\";if(x.type.is_substitution(w)){var $=w.domain(!0);w=w.filter(function(Te,lt){return!x.type.is_variable(lt)||$.indexOf(lt.id)!==-1&&Te!==lt.id})}for(var oe in w.links)w.links.hasOwnProperty(oe)&&(z++,X!==\"\"&&(X+=\", \"),X+=oe.toString(F)+\" = \"+w.links[oe].toString(F));var xe=typeof b>\"u\"||b.points.length>0?\" ;\":\".\";return z===0?\"true\"+xe:X+xe},flatten_error:function(w){if(!x.type.is_error(w))return null;w=w.args[0];var b={};return b.type=w.args[0].id,b.thrown=b.type===\"syntax_error\"?null:w.args[1].id,b.expected=null,b.found=null,b.representation=null,b.existence=null,b.existence_type=null,b.line=null,b.column=null,b.permission_operation=null,b.permission_type=null,b.evaluation_type=null,b.type===\"type_error\"||b.type===\"domain_error\"?(b.expected=w.args[0].args[0].id,b.found=w.args[0].args[1].toString()):b.type===\"syntax_error\"?w.args[1].indicator===\"./2\"?(b.expected=w.args[0].args[0].id,b.found=w.args[1].args[1].args[1].args[0],b.found=b.found.id===\"token_not_found\"?b.found.id:b.found.args[0].id,b.line=w.args[1].args[0].args[0].value,b.column=w.args[1].args[1].args[0].args[0].value):b.thrown=w.args[1].id:b.type===\"permission_error\"?(b.found=w.args[0].args[2].toString(),b.permission_operation=w.args[0].args[0].id,b.permission_type=w.args[0].args[1].id):b.type===\"evaluation_error\"?b.evaluation_type=w.args[0].args[0].id:b.type===\"representation_error\"?b.representation=w.args[0].args[0].id:b.type===\"existence_error\"&&(b.existence=w.args[0].args[1].toString(),b.existence_type=w.args[0].args[0].id),b},create:function(w){return new x.type.Session(w)}};typeof ec<\"u\"?ec.exports=x:window.pl=x})()});function EEe(t,e,r){t.prepend(r.map(s=>new hl.default.type.State(e.goal.replace(s),e.substitution,e)))}function Lq(t){let e=CEe.get(t.session);if(e==null)throw new Error(\"Assertion failed: A project should have been registered for the active session\");return e}function wEe(t,e){CEe.set(t,e),t.consult(`:- use_module(library(${Zct.id})).`)}var hl,IEe,J0,zct,Xct,CEe,Zct,BEe=Xe(()=>{Ge();ql();hl=ut(Oq()),IEe=ut(Ie(\"vm\")),{is_atom:J0,is_variable:zct,is_instantiated_list:Xct}=hl.default.type;CEe=new WeakMap;Zct=new hl.default.type.Module(\"constraints\",{\"project_workspaces_by_descriptor/3\":(t,e,r)=>{let[s,a,n]=r.args;if(!J0(s)||!J0(a)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let c=G.parseIdent(s.id),f=G.makeDescriptor(c,a.id),h=Lq(t).tryWorkspaceByDescriptor(f);zct(n)&&h!==null&&EEe(t,e,[new hl.default.type.Term(\"=\",[n,new hl.default.type.Term(String(h.relativeCwd))])]),J0(n)&&h!==null&&h.relativeCwd===n.id&&t.success(e)},\"workspace_field/3\":(t,e,r)=>{let[s,a,n]=r.args;if(!J0(s)||!J0(a)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let f=Lq(t).tryWorkspaceByCwd(s.id);if(f==null)return;let p=va(f.manifest.raw,a.id);typeof p>\"u\"||EEe(t,e,[new hl.default.type.Term(\"=\",[n,new hl.default.type.Term(typeof p==\"object\"?JSON.stringify(p):p)])])},\"workspace_field_test/3\":(t,e,r)=>{let[s,a,n]=r.args;t.prepend([new hl.default.type.State(e.goal.replace(new hl.default.type.Term(\"workspace_field_test\",[s,a,n,new hl.default.type.Term(\"[]\",[])])),e.substitution,e)])},\"workspace_field_test/4\":(t,e,r)=>{let[s,a,n,c]=r.args;if(!J0(s)||!J0(a)||!J0(n)||!Xct(c)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let p=Lq(t).tryWorkspaceByCwd(s.id);if(p==null)return;let h=va(p.manifest.raw,a.id);if(typeof h>\"u\")return;let E={$$:h};for(let[S,P]of c.toJavaScript().entries())E[`$${S}`]=P;IEe.default.runInNewContext(n.id,E)&&t.success(e)}},[\"project_workspaces_by_descriptor/3\",\"workspace_field/3\",\"workspace_field_test/3\",\"workspace_field_test/4\"])});var aS={};Vt(aS,{Constraints:()=>Uq,DependencyType:()=>bEe});function go(t){if(t instanceof KC.default.type.Num)return t.value;if(t instanceof KC.default.type.Term)switch(t.indicator){case\"throw/1\":return go(t.args[0]);case\"error/1\":return go(t.args[0]);case\"error/2\":if(t.args[0]instanceof KC.default.type.Term&&t.args[0].indicator===\"syntax_error/1\")return Object.assign(go(t.args[0]),...go(t.args[1]));{let e=go(t.args[0]);return e.message+=` (in ${go(t.args[1])})`,e}case\"syntax_error/1\":return new jt(43,`Syntax error: ${go(t.args[0])}`);case\"existence_error/2\":return new jt(44,`Existence error: ${go(t.args[0])} ${go(t.args[1])} not found`);case\"instantiation_error/0\":return new jt(75,\"Instantiation error: an argument is variable when an instantiated argument was expected\");case\"line/1\":return{line:go(t.args[0])};case\"column/1\":return{column:go(t.args[0])};case\"found/1\":return{found:go(t.args[0])};case\"./2\":return[go(t.args[0])].concat(go(t.args[1]));case\"//2\":return`${go(t.args[0])}/${go(t.args[1])}`;default:return t.id}throw`couldn't pretty print because of unsupported node ${t}`}function SEe(t){let e;try{e=go(t)}catch(r){throw typeof r==\"string\"?new jt(42,`Unknown error: ${t} (note: ${r})`):r}return typeof e.line<\"u\"&&typeof e.column<\"u\"&&(e.message+=` at line ${e.line}, column ${e.column}`),e}function Pm(t){return t.id===\"null\"?null:`${t.toJavaScript()}`}function $ct(t){if(t.id===\"null\")return null;{let e=t.toJavaScript();if(typeof e!=\"string\")return JSON.stringify(e);try{return JSON.stringify(JSON.parse(e))}catch{return JSON.stringify(e)}}}function K0(t){return typeof t==\"string\"?`'${t}'`:\"[]\"}var DEe,KC,bEe,vEe,Mq,Uq,lS=Xe(()=>{Ge();Ge();Dt();DEe=ut(nEe()),KC=ut(Oq());iS();BEe();(0,DEe.default)(KC.default);bEe=(s=>(s.Dependencies=\"dependencies\",s.DevDependencies=\"devDependencies\",s.PeerDependencies=\"peerDependencies\",s))(bEe||{}),vEe=[\"dependencies\",\"devDependencies\",\"peerDependencies\"];Mq=class{constructor(e,r){let s=1e3*e.workspaces.length;this.session=KC.default.create(s),wEe(this.session,e),this.session.consult(\":- use_module(library(lists)).\"),this.session.consult(r)}fetchNextAnswer(){return new Promise(e=>{this.session.answer(r=>{e(r)})})}async*makeQuery(e){let r=this.session.query(e);if(r!==!0)throw SEe(r);for(;;){let s=await this.fetchNextAnswer();if(s===null)throw new jt(79,\"Resolution limit exceeded\");if(!s)break;if(s.id===\"throw\")throw SEe(s);yield s}}};Uq=class t{constructor(e){this.source=\"\";this.project=e;let r=e.configuration.get(\"constraintsPath\");ce.existsSync(r)&&(this.source=ce.readFileSync(r,\"utf8\"))}static async find(e){return new t(e)}getProjectDatabase(){let e=\"\";for(let r of vEe)e+=`dependency_type(${r}).\n`;for(let r of this.project.workspacesByCwd.values()){let s=r.relativeCwd;e+=`workspace(${K0(s)}).\n`,e+=`workspace_ident(${K0(s)}, ${K0(G.stringifyIdent(r.anchoredLocator))}).\n`,e+=`workspace_version(${K0(s)}, ${K0(r.manifest.version)}).\n`;for(let a of vEe)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${K0(s)}, ${K0(G.stringifyIdent(n))}, ${K0(n.range)}, ${a}).\n`}return e+=`workspace(_) :- false.\n`,e+=`workspace_ident(_, _) :- false.\n`,e+=`workspace_version(_, _) :- false.\n`,e+=`workspace_has_dependency(_, _, _, _) :- false.\n`,e}getDeclarations(){let e=\"\";return e+=`gen_enforced_dependency(_, _, _, _) :- false.\n`,e+=`gen_enforced_field(_, _, _) :- false.\n`,e}get fullSource(){return`${this.getProjectDatabase()}\n${this.source}\n${this.getDeclarations()}`}createSession(){return new Mq(this.project,this.fullSource)}async processClassic(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async process(){let{enforcedDependencies:e,enforcedFields:r}=await this.processClassic(),s=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:c,dependencyType:f}of e){let p=nS([f,G.stringifyIdent(n)]),h=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(h,p).set(c??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:c}of r){let f=nS(n),p=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(p,f).set(JSON.parse(c)??void 0,new Set)}return{manifestUpdates:s,reportedErrors:new Map}}async genEnforcedDependencies(e){let r=[];for await(let s of e.makeQuery(\"workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).\")){let a=J.resolve(this.project.cwd,Pm(s.links.WorkspaceCwd)),n=Pm(s.links.DependencyIdent),c=Pm(s.links.DependencyRange),f=Pm(s.links.DependencyType);if(a===null||n===null)throw new Error(\"Invalid rule\");let p=this.project.getWorkspaceByCwd(a),h=G.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return je.sortMap(r,[({dependencyRange:s})=>s!==null?\"0\":\"1\",({workspace:s})=>G.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>G.stringifyIdent(s)])}async genEnforcedFields(e){let r=[];for await(let s of e.makeQuery(\"workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).\")){let a=J.resolve(this.project.cwd,Pm(s.links.WorkspaceCwd)),n=Pm(s.links.FieldPath),c=$ct(s.links.FieldValue);if(a===null||n===null)throw new Error(\"Invalid rule\");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return je.sortMap(r,[({workspace:s})=>G.stringifyIdent(s.anchoredLocator),({fieldPath:s})=>s])}async*query(e){let r=this.createSession();for await(let s of r.makeQuery(e)){let a={};for(let[n,c]of Object.entries(s.links))n!==\"_\"&&(a[n]=Pm(c));yield a}}}});var OEe=_(fF=>{\"use strict\";Object.defineProperty(fF,\"__esModule\",{value:!0});function BS(t){let e=[...t.caches],r=e.shift();return r===void 0?NEe():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>BS({caches:e}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>BS({caches:e}).set(s,a))},delete(s){return r.delete(s).catch(()=>BS({caches:e}).delete(s))},clear(){return r.clear().catch(()=>BS({caches:e}).clear())}}}function NEe(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}fF.createFallbackableCache=BS;fF.createNullCache=NEe});var MEe=_((BJt,LEe)=>{LEe.exports=OEe()});var UEe=_($q=>{\"use strict\";Object.defineProperty($q,\"__esModule\",{value:!0});function yut(t={serializable:!0}){let e={};return{get(r,s,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let c=s(),f=a&&a.miss||(()=>Promise.resolve());return c.then(p=>f(p)).then(()=>c)},set(r,s){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}$q.createInMemoryCache=yut});var HEe=_((SJt,_Ee)=>{_Ee.exports=UEe()});var GEe=_($u=>{\"use strict\";Object.defineProperty($u,\"__esModule\",{value:!0});function Eut(t,e,r){let s={\"x-algolia-api-key\":r,\"x-algolia-application-id\":e};return{headers(){return t===e9.WithinHeaders?s:{}},queryParameters(){return t===e9.WithinQueryParameters?s:{}}}}function Iut(t){let e=0,r=()=>(e++,new Promise(s=>{setTimeout(()=>{s(t(r))},Math.min(100*e,1e3))}));return t(r)}function jEe(t,e=(r,s)=>Promise.resolve()){return Object.assign(t,{wait(r){return jEe(t.then(s=>Promise.all([e(s,r),s])).then(s=>s[1]))}})}function Cut(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[r],t[r]=s}return t}function wut(t,e){return e&&Object.keys(e).forEach(r=>{t[r]=e[r](t)}),t}function But(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}var vut=\"4.22.1\",Sut=t=>()=>t.transporter.requester.destroy(),e9={WithinQueryParameters:0,WithinHeaders:1};$u.AuthMode=e9;$u.addMethods=wut;$u.createAuth=Eut;$u.createRetryablePromise=Iut;$u.createWaitablePromise=jEe;$u.destroy=Sut;$u.encode=But;$u.shuffle=Cut;$u.version=vut});var vS=_((bJt,qEe)=>{qEe.exports=GEe()});var WEe=_(t9=>{\"use strict\";Object.defineProperty(t9,\"__esModule\",{value:!0});var Dut={Delete:\"DELETE\",Get:\"GET\",Post:\"POST\",Put:\"PUT\"};t9.MethodEnum=Dut});var SS=_((xJt,YEe)=>{YEe.exports=WEe()});var aIe=_(Yi=>{\"use strict\";Object.defineProperty(Yi,\"__esModule\",{value:!0});var JEe=SS();function r9(t,e){let r=t||{},s=r.data||{};return Object.keys(r).forEach(a=>{[\"timeout\",\"headers\",\"queryParameters\",\"data\",\"cacheable\"].indexOf(a)===-1&&(s[a]=r[a])}),{data:Object.entries(s).length>0?s:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var DS={Read:1,Write:2,Any:3},sw={Up:1,Down:2,Timeouted:3},KEe=2*60*1e3;function i9(t,e=sw.Up){return{...t,status:e,lastUpdate:Date.now()}}function zEe(t){return t.status===sw.Up||Date.now()-t.lastUpdate>KEe}function XEe(t){return t.status===sw.Timeouted&&Date.now()-t.lastUpdate<=KEe}function s9(t){return typeof t==\"string\"?{protocol:\"https\",url:t,accept:DS.Any}:{protocol:t.protocol||\"https\",url:t.url,accept:t.accept||DS.Any}}function but(t,e){return Promise.all(e.map(r=>t.get(r,()=>Promise.resolve(i9(r))))).then(r=>{let s=r.filter(f=>zEe(f)),a=r.filter(f=>XEe(f)),n=[...s,...a],c=n.length>0?n.map(f=>s9(f)):e;return{getTimeout(f,p){return(a.length===0&&f===0?1:a.length+3+f)*p},statelessHosts:c}})}var Put=({isTimedOut:t,status:e})=>!t&&~~e===0,xut=t=>{let e=t.status;return t.isTimedOut||Put(t)||~~(e/100)!==2&&~~(e/100)!==4},kut=({status:t})=>~~(t/100)===2,Qut=(t,e)=>xut(t)?e.onRetry(t):kut(t)?e.onSuccess(t):e.onFail(t);function VEe(t,e,r,s){let a=[],n=rIe(r,s),c=nIe(t,s),f=r.method,p=r.method!==JEe.MethodEnum.Get?{}:{...r.data,...s.data},h={\"x-algolia-agent\":t.userAgent.value,...t.queryParameters,...p,...s.queryParameters},E=0,C=(S,P)=>{let I=S.pop();if(I===void 0)throw oIe(n9(a));let R={data:n,headers:c,method:f,url:eIe(I,r.path,h),connectTimeout:P(E,t.timeouts.connect),responseTimeout:P(E,s.timeout)},N=W=>{let ee={request:R,response:W,host:I,triesLeft:S.length};return a.push(ee),ee},U={onSuccess:W=>ZEe(W),onRetry(W){let ee=N(W);return W.isTimedOut&&E++,Promise.all([t.logger.info(\"Retryable failure\",o9(ee)),t.hostsCache.set(I,i9(I,W.isTimedOut?sw.Timeouted:sw.Down))]).then(()=>C(S,P))},onFail(W){throw N(W),$Ee(W,n9(a))}};return t.requester.send(R).then(W=>Qut(W,U))};return but(t.hostsCache,e).then(S=>C([...S.statelessHosts].reverse(),S.getTimeout))}function Tut(t){let{hostsCache:e,logger:r,requester:s,requestsCache:a,responsesCache:n,timeouts:c,userAgent:f,hosts:p,queryParameters:h,headers:E}=t,C={hostsCache:e,logger:r,requester:s,requestsCache:a,responsesCache:n,timeouts:c,userAgent:f,headers:E,queryParameters:h,hosts:p.map(S=>s9(S)),read(S,P){let I=r9(P,C.timeouts.read),R=()=>VEe(C,C.hosts.filter(W=>(W.accept&DS.Read)!==0),S,I);if((I.cacheable!==void 0?I.cacheable:S.cacheable)!==!0)return R();let U={request:S,mappedRequestOptions:I,transporter:{queryParameters:C.queryParameters,headers:C.headers}};return C.responsesCache.get(U,()=>C.requestsCache.get(U,()=>C.requestsCache.set(U,R()).then(W=>Promise.all([C.requestsCache.delete(U),W]),W=>Promise.all([C.requestsCache.delete(U),Promise.reject(W)])).then(([W,ee])=>ee)),{miss:W=>C.responsesCache.set(U,W)})},write(S,P){return VEe(C,C.hosts.filter(I=>(I.accept&DS.Write)!==0),S,r9(P,C.timeouts.write))}};return C}function Rut(t){let e={value:`Algolia for JavaScript (${t})`,add(r){let s=`; ${r.segment}${r.version!==void 0?` (${r.version})`:\"\"}`;return e.value.indexOf(s)===-1&&(e.value=`${e.value}${s}`),e}};return e}function ZEe(t){try{return JSON.parse(t.content)}catch(e){throw sIe(e.message,t)}}function $Ee({content:t,status:e},r){let s=t;try{s=JSON.parse(t).message}catch{}return iIe(s,e,r)}function Fut(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}function eIe(t,e,r){let s=tIe(r),a=`${t.protocol}://${t.url}/${e.charAt(0)===\"/\"?e.substr(1):e}`;return s.length&&(a+=`?${s}`),a}function tIe(t){let e=r=>Object.prototype.toString.call(r)===\"[object Object]\"||Object.prototype.toString.call(r)===\"[object Array]\";return Object.keys(t).map(r=>Fut(\"%s=%s\",r,e(t[r])?JSON.stringify(t[r]):t[r])).join(\"&\")}function rIe(t,e){if(t.method===JEe.MethodEnum.Get||t.data===void 0&&e.data===void 0)return;let r=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(r)}function nIe(t,e){let r={...t.headers,...e.headers},s={};return Object.keys(r).forEach(a=>{let n=r[a];s[a.toLowerCase()]=n}),s}function n9(t){return t.map(e=>o9(e))}function o9(t){let e=t.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return{...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function iIe(t,e,r){return{name:\"ApiError\",message:t,status:e,transporterStackTrace:r}}function sIe(t,e){return{name:\"DeserializationError\",message:t,response:e}}function oIe(t){return{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",transporterStackTrace:t}}Yi.CallEnum=DS;Yi.HostStatusEnum=sw;Yi.createApiError=iIe;Yi.createDeserializationError=sIe;Yi.createMappedRequestOptions=r9;Yi.createRetryError=oIe;Yi.createStatefulHost=i9;Yi.createStatelessHost=s9;Yi.createTransporter=Tut;Yi.createUserAgent=Rut;Yi.deserializeFailure=$Ee;Yi.deserializeSuccess=ZEe;Yi.isStatefulHostTimeouted=XEe;Yi.isStatefulHostUp=zEe;Yi.serializeData=rIe;Yi.serializeHeaders=nIe;Yi.serializeQueryParameters=tIe;Yi.serializeUrl=eIe;Yi.stackFrameWithoutCredentials=o9;Yi.stackTraceWithoutCredentials=n9});var bS=_((QJt,lIe)=>{lIe.exports=aIe()});var cIe=_(X0=>{\"use strict\";Object.defineProperty(X0,\"__esModule\",{value:!0});var ow=vS(),Nut=bS(),PS=SS(),Out=t=>{let e=t.region||\"us\",r=ow.createAuth(ow.AuthMode.WithinHeaders,t.appId,t.apiKey),s=Nut.createTransporter({hosts:[{url:`analytics.${e}.algolia.com`}],...t,headers:{...r.headers(),\"content-type\":\"application/json\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a=t.appId;return ow.addMethods({appId:a,transporter:s},t.methods)},Lut=t=>(e,r)=>t.transporter.write({method:PS.MethodEnum.Post,path:\"2/abtests\",data:e},r),Mut=t=>(e,r)=>t.transporter.write({method:PS.MethodEnum.Delete,path:ow.encode(\"2/abtests/%s\",e)},r),Uut=t=>(e,r)=>t.transporter.read({method:PS.MethodEnum.Get,path:ow.encode(\"2/abtests/%s\",e)},r),_ut=t=>e=>t.transporter.read({method:PS.MethodEnum.Get,path:\"2/abtests\"},e),Hut=t=>(e,r)=>t.transporter.write({method:PS.MethodEnum.Post,path:ow.encode(\"2/abtests/%s/stop\",e)},r);X0.addABTest=Lut;X0.createAnalyticsClient=Out;X0.deleteABTest=Mut;X0.getABTest=Uut;X0.getABTests=_ut;X0.stopABTest=Hut});var fIe=_((RJt,uIe)=>{uIe.exports=cIe()});var pIe=_(xS=>{\"use strict\";Object.defineProperty(xS,\"__esModule\",{value:!0});var a9=vS(),jut=bS(),AIe=SS(),Gut=t=>{let e=t.region||\"us\",r=a9.createAuth(a9.AuthMode.WithinHeaders,t.appId,t.apiKey),s=jut.createTransporter({hosts:[{url:`personalization.${e}.algolia.com`}],...t,headers:{...r.headers(),\"content-type\":\"application/json\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}});return a9.addMethods({appId:t.appId,transporter:s},t.methods)},qut=t=>e=>t.transporter.read({method:AIe.MethodEnum.Get,path:\"1/strategies/personalization\"},e),Wut=t=>(e,r)=>t.transporter.write({method:AIe.MethodEnum.Post,path:\"1/strategies/personalization\",data:e},r);xS.createPersonalizationClient=Gut;xS.getPersonalizationStrategy=qut;xS.setPersonalizationStrategy=Wut});var gIe=_((NJt,hIe)=>{hIe.exports=pIe()});var xIe=_(Ft=>{\"use strict\";Object.defineProperty(Ft,\"__esModule\",{value:!0});var Jt=vS(),gl=bS(),br=SS(),Yut=Ie(\"crypto\");function AF(t){let e=r=>t.request(r).then(s=>{if(t.batch!==void 0&&t.batch(s.hits),!t.shouldStop(s))return s.cursor?e({cursor:s.cursor}):e({page:(r.page||0)+1})});return e({})}var Vut=t=>{let e=t.appId,r=Jt.createAuth(t.authMode!==void 0?t.authMode:Jt.AuthMode.WithinHeaders,e,t.apiKey),s=gl.createTransporter({hosts:[{url:`${e}-dsn.algolia.net`,accept:gl.CallEnum.Read},{url:`${e}.algolia.net`,accept:gl.CallEnum.Write}].concat(Jt.shuffle([{url:`${e}-1.algolianet.com`},{url:`${e}-2.algolianet.com`},{url:`${e}-3.algolianet.com`}])),...t,headers:{...r.headers(),\"content-type\":\"application/x-www-form-urlencoded\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a={transporter:s,appId:e,addAlgoliaAgent(n,c){s.userAgent.add({segment:n,version:c})},clearCache(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>{})}};return Jt.addMethods(a,t.methods)};function dIe(){return{name:\"MissingObjectIDError\",message:\"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.\"}}function mIe(){return{name:\"ObjectNotFoundError\",message:\"Object not found.\"}}function yIe(){return{name:\"ValidUntilNotFoundError\",message:\"ValidUntil not found in given secured api key.\"}}var Jut=t=>(e,r)=>{let{queryParameters:s,...a}=r||{},n={acl:e,...s!==void 0?{queryParameters:s}:{}},c=(f,p)=>Jt.createRetryablePromise(h=>kS(t)(f.key,p).catch(E=>{if(E.status!==404)throw E;return h()}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:\"1/keys\",data:n},a),c)},Kut=t=>(e,r,s)=>{let a=gl.createMappedRequestOptions(s);return a.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:br.MethodEnum.Post,path:\"1/clusters/mapping\",data:{cluster:r}},a)},zut=t=>(e,r,s)=>t.transporter.write({method:br.MethodEnum.Post,path:\"1/clusters/mapping/batch\",data:{users:e,cluster:r}},s),Xut=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:{action:\"addEntry\",body:[]}}},r),(s,a)=>aw(t)(s.taskID,a)),pF=t=>(e,r,s)=>{let a=(n,c)=>QS(t)(e,{methods:{waitTask:hs}}).waitTask(n.taskID,c);return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",e),data:{operation:\"copy\",destination:r}},s),a)},Zut=t=>(e,r,s)=>pF(t)(e,r,{...s,scope:[gF.Rules]}),$ut=t=>(e,r,s)=>pF(t)(e,r,{...s,scope:[gF.Settings]}),eft=t=>(e,r,s)=>pF(t)(e,r,{...s,scope:[gF.Synonyms]}),tft=t=>(e,r)=>e.method===br.MethodEnum.Get?t.transporter.read(e,r):t.transporter.write(e,r),rft=t=>(e,r)=>{let s=(a,n)=>Jt.createRetryablePromise(c=>kS(t)(e,n).then(c).catch(f=>{if(f.status!==404)throw f}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Delete,path:Jt.encode(\"1/keys/%s\",e)},r),s)},nft=t=>(e,r,s)=>{let a=r.map(n=>({action:\"deleteEntry\",body:{objectID:n}}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},ift=()=>(t,e)=>{let r=gl.serializeQueryParameters(e),s=Yut.createHmac(\"sha256\",t).update(r).digest(\"hex\");return Buffer.from(s+r).toString(\"base64\")},kS=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/keys/%s\",e)},r),EIe=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/task/%s\",e.toString())},r),sft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"/1/dictionaries/*/settings\"},e),oft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/logs\"},e),aft=()=>t=>{let e=Buffer.from(t,\"base64\").toString(\"ascii\"),r=/validUntil=(\\d+)/,s=e.match(r);if(s===null)throw yIe();return parseInt(s[1],10)-Math.round(new Date().getTime()/1e3)},lft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/clusters/mapping/top\"},e),cft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/clusters/mapping/%s\",e)},r),uft=t=>e=>{let{retrieveMappings:r,...s}=e||{};return r===!0&&(s.getClusters=!0),t.transporter.read({method:br.MethodEnum.Get,path:\"1/clusters/mapping/pending\"},s)},QS=t=>(e,r={})=>{let s={transporter:t.transporter,appId:t.appId,indexName:e};return Jt.addMethods(s,r.methods)},fft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/keys\"},e),Aft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/clusters\"},e),pft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/indexes\"},e),hft=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:\"1/clusters/mapping\"},e),gft=t=>(e,r,s)=>{let a=(n,c)=>QS(t)(e,{methods:{waitTask:hs}}).waitTask(n.taskID,c);return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",e),data:{operation:\"move\",destination:r}},s),a)},dft=t=>(e,r)=>{let s=(a,n)=>Promise.all(Object.keys(a.taskID).map(c=>QS(t)(c,{methods:{waitTask:hs}}).waitTask(a.taskID[c],n)));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:\"1/indexes/*/batch\",data:{requests:e}},r),s)},mft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:e}},r),yft=t=>(e,r)=>{let s=e.map(a=>({...a,params:gl.serializeQueryParameters(a.params||{})}));return t.transporter.read({method:br.MethodEnum.Post,path:\"1/indexes/*/queries\",data:{requests:s},cacheable:!0},r)},Eft=t=>(e,r)=>Promise.all(e.map(s=>{let{facetName:a,facetQuery:n,...c}=s.params;return QS(t)(s.indexName,{methods:{searchForFacetValues:DIe}}).searchForFacetValues(a,n,{...r,...c})})),Ift=t=>(e,r)=>{let s=gl.createMappedRequestOptions(r);return s.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:br.MethodEnum.Delete,path:\"1/clusters/mapping\"},s)},Cft=t=>(e,r,s)=>{let a=r.map(n=>({action:\"addEntry\",body:n}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},wft=t=>(e,r)=>{let s=(a,n)=>Jt.createRetryablePromise(c=>kS(t)(e,n).catch(f=>{if(f.status!==404)throw f;return c()}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/keys/%s/restore\",e)},r),s)},Bft=t=>(e,r,s)=>{let a=r.map(n=>({action:\"addEntry\",body:n}));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},vft=t=>(e,r,s)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/search\",e),data:{query:r},cacheable:!0},s),Sft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Post,path:\"1/clusters/mapping/search\",data:{query:e}},r),Dft=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Put,path:\"/1/dictionaries/*/settings\",data:e},r),(s,a)=>aw(t)(s.taskID,a)),bft=t=>(e,r)=>{let s=Object.assign({},r),{queryParameters:a,...n}=r||{},c=a?{queryParameters:a}:{},f=[\"acl\",\"indexes\",\"referers\",\"restrictSources\",\"queryParameters\",\"description\",\"maxQueriesPerIPPerHour\",\"maxHitsPerQuery\"],p=E=>Object.keys(s).filter(C=>f.indexOf(C)!==-1).every(C=>{if(Array.isArray(E[C])&&Array.isArray(s[C])){let S=E[C];return S.length===s[C].length&&S.every((P,I)=>P===s[C][I])}else return E[C]===s[C]}),h=(E,C)=>Jt.createRetryablePromise(S=>kS(t)(e,C).then(P=>p(P)?Promise.resolve():S()));return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Put,path:Jt.encode(\"1/keys/%s\",e),data:c},n),h)},aw=t=>(e,r)=>Jt.createRetryablePromise(s=>EIe(t)(e,r).then(a=>a.status!==\"published\"?s():void 0)),IIe=t=>(e,r)=>{let s=(a,n)=>hs(t)(a.taskID,n);return Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/batch\",t.indexName),data:{requests:e}},r),s)},Pft=t=>e=>AF({shouldStop:r=>r.cursor===void 0,...e,request:r=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/browse\",t.indexName),data:r},e)}),xft=t=>e=>{let r={hitsPerPage:1e3,...e};return AF({shouldStop:s=>s.hits.length<r.hitsPerPage,...r,request(s){return bIe(t)(\"\",{...r,...s}).then(a=>({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},kft=t=>e=>{let r={hitsPerPage:1e3,...e};return AF({shouldStop:s=>s.hits.length<r.hitsPerPage,...r,request(s){return PIe(t)(\"\",{...r,...s}).then(a=>({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},hF=t=>(e,r,s)=>{let{batchSize:a,...n}=s||{},c={taskIDs:[],objectIDs:[]},f=(p=0)=>{let h=[],E;for(E=p;E<e.length&&(h.push(e[E]),h.length!==(a||1e3));E++);return h.length===0?Promise.resolve(c):IIe(t)(h.map(C=>({action:r,body:C})),n).then(C=>(c.objectIDs=c.objectIDs.concat(C.objectIDs),c.taskIDs.push(C.taskID),E++,f(E)))};return Jt.createWaitablePromise(f(),(p,h)=>Promise.all(p.taskIDs.map(E=>hs(t)(E,h))))},Qft=t=>e=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/clear\",t.indexName)},e),(r,s)=>hs(t)(r.taskID,s)),Tft=t=>e=>{let{forwardToReplicas:r,...s}=e||{},a=gl.createMappedRequestOptions(s);return r&&(a.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/clear\",t.indexName)},a),(n,c)=>hs(t)(n.taskID,c))},Rft=t=>e=>{let{forwardToReplicas:r,...s}=e||{},a=gl.createMappedRequestOptions(s);return r&&(a.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/clear\",t.indexName)},a),(n,c)=>hs(t)(n.taskID,c))},Fft=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/deleteByQuery\",t.indexName),data:e},r),(s,a)=>hs(t)(s.taskID,a)),Nft=t=>e=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s\",t.indexName)},e),(r,s)=>hs(t)(r.taskID,s)),Oft=t=>(e,r)=>Jt.createWaitablePromise(CIe(t)([e],r).then(s=>({taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),CIe=t=>(e,r)=>{let s=e.map(a=>({objectID:a}));return hF(t)(s,km.DeleteObject,r)},Lft=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s/rules/%s\",t.indexName,e)},n),(c,f)=>hs(t)(c.taskID,f))},Mft=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},n),(c,f)=>hs(t)(c.taskID,f))},Uft=t=>e=>wIe(t)(e).then(()=>!0).catch(r=>{if(r.status!==404)throw r;return!1}),_ft=t=>(e,r,s)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/answers/%s/prediction\",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},s),Hft=t=>(e,r)=>{let{query:s,paginate:a,...n}=r||{},c=0,f=()=>SIe(t)(s||\"\",{...n,page:c}).then(p=>{for(let[h,E]of Object.entries(p.hits))if(e(E))return{object:E,position:parseInt(h,10),page:c};if(c++,a===!1||c>=p.nbPages)throw mIe();return f()});return f()},jft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/%s\",t.indexName,e)},r),Gft=()=>(t,e)=>{for(let[r,s]of Object.entries(t.hits))if(s.objectID===e)return parseInt(r,10);return-1},qft=t=>(e,r)=>{let{attributesToRetrieve:s,...a}=r||{},n=e.map(c=>({indexName:t.indexName,objectID:c,...s?{attributesToRetrieve:s}:{}}));return t.transporter.read({method:br.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:n}},a)},Wft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/rules/%s\",t.indexName,e)},r),wIe=t=>e=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/settings\",t.indexName),data:{getVersion:2}},e),Yft=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},r),BIe=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/task/%s\",t.indexName,e.toString())},r),Vft=t=>(e,r)=>Jt.createWaitablePromise(vIe(t)([e],r).then(s=>({objectID:s.objectIDs[0],taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),vIe=t=>(e,r)=>{let{createIfNotExists:s,...a}=r||{},n=s?km.PartialUpdateObject:km.PartialUpdateObjectNoCreate;return hF(t)(e,n,a)},Jft=t=>(e,r)=>{let{safe:s,autoGenerateObjectIDIfNotExist:a,batchSize:n,...c}=r||{},f=(I,R,N,U)=>Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",I),data:{operation:N,destination:R}},U),(W,ee)=>hs(t)(W.taskID,ee)),p=Math.random().toString(36).substring(7),h=`${t.indexName}_tmp_${p}`,E=l9({appId:t.appId,transporter:t.transporter,indexName:h}),C=[],S=f(t.indexName,h,\"copy\",{...c,scope:[\"settings\",\"synonyms\",\"rules\"]});C.push(S);let P=(s?S.wait(c):S).then(()=>{let I=E(e,{...c,autoGenerateObjectIDIfNotExist:a,batchSize:n});return C.push(I),s?I.wait(c):I}).then(()=>{let I=f(h,t.indexName,\"move\",c);return C.push(I),s?I.wait(c):I}).then(()=>Promise.all(C)).then(([I,R,N])=>({objectIDs:R.objectIDs,taskIDs:[I.taskID,...R.taskIDs,N.taskID]}));return Jt.createWaitablePromise(P,(I,R)=>Promise.all(C.map(N=>N.wait(R))))},Kft=t=>(e,r)=>c9(t)(e,{...r,clearExistingRules:!0}),zft=t=>(e,r)=>u9(t)(e,{...r,clearExistingSynonyms:!0}),Xft=t=>(e,r)=>Jt.createWaitablePromise(l9(t)([e],r).then(s=>({objectID:s.objectIDs[0],taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),l9=t=>(e,r)=>{let{autoGenerateObjectIDIfNotExist:s,...a}=r||{},n=s?km.AddObject:km.UpdateObject;if(n===km.UpdateObject){for(let c of e)if(c.objectID===void 0)return Jt.createWaitablePromise(Promise.reject(dIe()))}return hF(t)(e,n,a)},Zft=t=>(e,r)=>c9(t)([e],r),c9=t=>(e,r)=>{let{forwardToReplicas:s,clearExistingRules:a,...n}=r||{},c=gl.createMappedRequestOptions(n);return s&&(c.queryParameters.forwardToReplicas=1),a&&(c.queryParameters.clearExistingRules=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/batch\",t.indexName),data:e},c),(f,p)=>hs(t)(f.taskID,p))},$ft=t=>(e,r)=>u9(t)([e],r),u9=t=>(e,r)=>{let{forwardToReplicas:s,clearExistingSynonyms:a,replaceExistingSynonyms:n,...c}=r||{},f=gl.createMappedRequestOptions(c);return s&&(f.queryParameters.forwardToReplicas=1),(n||a)&&(f.queryParameters.replaceExistingSynonyms=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/batch\",t.indexName),data:e},f),(p,h)=>hs(t)(p.taskID,h))},SIe=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/query\",t.indexName),data:{query:e},cacheable:!0},r),DIe=t=>(e,r,s)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/facets/%s/query\",t.indexName,e),data:{facetQuery:r},cacheable:!0},s),bIe=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/search\",t.indexName),data:{query:e}},r),PIe=t=>(e,r)=>t.transporter.read({method:br.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/search\",t.indexName),data:{query:e}},r),eAt=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:br.MethodEnum.Put,path:Jt.encode(\"1/indexes/%s/settings\",t.indexName),data:e},n),(c,f)=>hs(t)(c.taskID,f))},hs=t=>(e,r)=>Jt.createRetryablePromise(s=>BIe(t)(e,r).then(a=>a.status!==\"published\"?s():void 0)),tAt={AddObject:\"addObject\",Analytics:\"analytics\",Browser:\"browse\",DeleteIndex:\"deleteIndex\",DeleteObject:\"deleteObject\",EditSettings:\"editSettings\",Inference:\"inference\",ListIndexes:\"listIndexes\",Logs:\"logs\",Personalization:\"personalization\",Recommendation:\"recommendation\",Search:\"search\",SeeUnretrievableAttributes:\"seeUnretrievableAttributes\",Settings:\"settings\",Usage:\"usage\"},km={AddObject:\"addObject\",UpdateObject:\"updateObject\",PartialUpdateObject:\"partialUpdateObject\",PartialUpdateObjectNoCreate:\"partialUpdateObjectNoCreate\",DeleteObject:\"deleteObject\",DeleteIndex:\"delete\",ClearIndex:\"clear\"},gF={Settings:\"settings\",Synonyms:\"synonyms\",Rules:\"rules\"},rAt={None:\"none\",StopIfEnoughMatches:\"stopIfEnoughMatches\"},nAt={Synonym:\"synonym\",OneWaySynonym:\"oneWaySynonym\",AltCorrection1:\"altCorrection1\",AltCorrection2:\"altCorrection2\",Placeholder:\"placeholder\"};Ft.ApiKeyACLEnum=tAt;Ft.BatchActionEnum=km;Ft.ScopeEnum=gF;Ft.StrategyEnum=rAt;Ft.SynonymEnum=nAt;Ft.addApiKey=Jut;Ft.assignUserID=Kut;Ft.assignUserIDs=zut;Ft.batch=IIe;Ft.browseObjects=Pft;Ft.browseRules=xft;Ft.browseSynonyms=kft;Ft.chunkedBatch=hF;Ft.clearDictionaryEntries=Xut;Ft.clearObjects=Qft;Ft.clearRules=Tft;Ft.clearSynonyms=Rft;Ft.copyIndex=pF;Ft.copyRules=Zut;Ft.copySettings=$ut;Ft.copySynonyms=eft;Ft.createBrowsablePromise=AF;Ft.createMissingObjectIDError=dIe;Ft.createObjectNotFoundError=mIe;Ft.createSearchClient=Vut;Ft.createValidUntilNotFoundError=yIe;Ft.customRequest=tft;Ft.deleteApiKey=rft;Ft.deleteBy=Fft;Ft.deleteDictionaryEntries=nft;Ft.deleteIndex=Nft;Ft.deleteObject=Oft;Ft.deleteObjects=CIe;Ft.deleteRule=Lft;Ft.deleteSynonym=Mft;Ft.exists=Uft;Ft.findAnswers=_ft;Ft.findObject=Hft;Ft.generateSecuredApiKey=ift;Ft.getApiKey=kS;Ft.getAppTask=EIe;Ft.getDictionarySettings=sft;Ft.getLogs=oft;Ft.getObject=jft;Ft.getObjectPosition=Gft;Ft.getObjects=qft;Ft.getRule=Wft;Ft.getSecuredApiKeyRemainingValidity=aft;Ft.getSettings=wIe;Ft.getSynonym=Yft;Ft.getTask=BIe;Ft.getTopUserIDs=lft;Ft.getUserID=cft;Ft.hasPendingMappings=uft;Ft.initIndex=QS;Ft.listApiKeys=fft;Ft.listClusters=Aft;Ft.listIndices=pft;Ft.listUserIDs=hft;Ft.moveIndex=gft;Ft.multipleBatch=dft;Ft.multipleGetObjects=mft;Ft.multipleQueries=yft;Ft.multipleSearchForFacetValues=Eft;Ft.partialUpdateObject=Vft;Ft.partialUpdateObjects=vIe;Ft.removeUserID=Ift;Ft.replaceAllObjects=Jft;Ft.replaceAllRules=Kft;Ft.replaceAllSynonyms=zft;Ft.replaceDictionaryEntries=Cft;Ft.restoreApiKey=wft;Ft.saveDictionaryEntries=Bft;Ft.saveObject=Xft;Ft.saveObjects=l9;Ft.saveRule=Zft;Ft.saveRules=c9;Ft.saveSynonym=$ft;Ft.saveSynonyms=u9;Ft.search=SIe;Ft.searchDictionaryEntries=vft;Ft.searchForFacetValues=DIe;Ft.searchRules=bIe;Ft.searchSynonyms=PIe;Ft.searchUserIDs=Sft;Ft.setDictionarySettings=Dft;Ft.setSettings=eAt;Ft.updateApiKey=bft;Ft.waitAppTask=aw;Ft.waitTask=hs});var QIe=_((LJt,kIe)=>{kIe.exports=xIe()});var TIe=_(dF=>{\"use strict\";Object.defineProperty(dF,\"__esModule\",{value:!0});function iAt(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var sAt={Debug:1,Info:2,Error:3};dF.LogLevelEnum=sAt;dF.createNullLogger=iAt});var FIe=_((UJt,RIe)=>{RIe.exports=TIe()});var MIe=_(f9=>{\"use strict\";Object.defineProperty(f9,\"__esModule\",{value:!0});var NIe=Ie(\"http\"),OIe=Ie(\"https\"),oAt=Ie(\"url\"),LIe={keepAlive:!0},aAt=new NIe.Agent(LIe),lAt=new OIe.Agent(LIe);function cAt({agent:t,httpAgent:e,httpsAgent:r,requesterOptions:s={}}={}){let a=e||t||aAt,n=r||t||lAt;return{send(c){return new Promise(f=>{let p=oAt.parse(c.url),h=p.query===null?p.pathname:`${p.pathname}?${p.query}`,E={...s,agent:p.protocol===\"https:\"?n:a,hostname:p.hostname,path:h,method:c.method,headers:{...s&&s.headers?s.headers:{},...c.headers},...p.port!==void 0?{port:p.port||\"\"}:{}},C=(p.protocol===\"https:\"?OIe:NIe).request(E,R=>{let N=[];R.on(\"data\",U=>{N=N.concat(U)}),R.on(\"end\",()=>{clearTimeout(P),clearTimeout(I),f({status:R.statusCode||0,content:Buffer.concat(N).toString(),isTimedOut:!1})})}),S=(R,N)=>setTimeout(()=>{C.abort(),f({status:0,content:N,isTimedOut:!0})},R*1e3),P=S(c.connectTimeout,\"Connection timeout\"),I;C.on(\"error\",R=>{clearTimeout(P),clearTimeout(I),f({status:0,content:R.message,isTimedOut:!1})}),C.once(\"response\",()=>{clearTimeout(P),I=S(c.responseTimeout,\"Socket timeout\")}),c.data!==void 0&&C.write(c.data),C.end()})},destroy(){return a.destroy(),n.destroy(),Promise.resolve()}}}f9.createNodeHttpRequester=cAt});var _Ie=_((HJt,UIe)=>{UIe.exports=MIe()});var qIe=_((jJt,GIe)=>{\"use strict\";var HIe=MEe(),uAt=HEe(),lw=fIe(),p9=vS(),A9=gIe(),Gt=QIe(),fAt=FIe(),AAt=_Ie(),pAt=bS();function jIe(t,e,r){let s={appId:t,apiKey:e,timeouts:{connect:2,read:5,write:30},requester:AAt.createNodeHttpRequester(),logger:fAt.createNullLogger(),responsesCache:HIe.createNullCache(),requestsCache:HIe.createNullCache(),hostsCache:uAt.createInMemoryCache(),userAgent:pAt.createUserAgent(p9.version).add({segment:\"Node.js\",version:process.versions.node})},a={...s,...r},n=()=>c=>A9.createPersonalizationClient({...s,...c,methods:{getPersonalizationStrategy:A9.getPersonalizationStrategy,setPersonalizationStrategy:A9.setPersonalizationStrategy}});return Gt.createSearchClient({...a,methods:{search:Gt.multipleQueries,searchForFacetValues:Gt.multipleSearchForFacetValues,multipleBatch:Gt.multipleBatch,multipleGetObjects:Gt.multipleGetObjects,multipleQueries:Gt.multipleQueries,copyIndex:Gt.copyIndex,copySettings:Gt.copySettings,copyRules:Gt.copyRules,copySynonyms:Gt.copySynonyms,moveIndex:Gt.moveIndex,listIndices:Gt.listIndices,getLogs:Gt.getLogs,listClusters:Gt.listClusters,multipleSearchForFacetValues:Gt.multipleSearchForFacetValues,getApiKey:Gt.getApiKey,addApiKey:Gt.addApiKey,listApiKeys:Gt.listApiKeys,updateApiKey:Gt.updateApiKey,deleteApiKey:Gt.deleteApiKey,restoreApiKey:Gt.restoreApiKey,assignUserID:Gt.assignUserID,assignUserIDs:Gt.assignUserIDs,getUserID:Gt.getUserID,searchUserIDs:Gt.searchUserIDs,listUserIDs:Gt.listUserIDs,getTopUserIDs:Gt.getTopUserIDs,removeUserID:Gt.removeUserID,hasPendingMappings:Gt.hasPendingMappings,generateSecuredApiKey:Gt.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:Gt.getSecuredApiKeyRemainingValidity,destroy:p9.destroy,clearDictionaryEntries:Gt.clearDictionaryEntries,deleteDictionaryEntries:Gt.deleteDictionaryEntries,getDictionarySettings:Gt.getDictionarySettings,getAppTask:Gt.getAppTask,replaceDictionaryEntries:Gt.replaceDictionaryEntries,saveDictionaryEntries:Gt.saveDictionaryEntries,searchDictionaryEntries:Gt.searchDictionaryEntries,setDictionarySettings:Gt.setDictionarySettings,waitAppTask:Gt.waitAppTask,customRequest:Gt.customRequest,initIndex:c=>f=>Gt.initIndex(c)(f,{methods:{batch:Gt.batch,delete:Gt.deleteIndex,findAnswers:Gt.findAnswers,getObject:Gt.getObject,getObjects:Gt.getObjects,saveObject:Gt.saveObject,saveObjects:Gt.saveObjects,search:Gt.search,searchForFacetValues:Gt.searchForFacetValues,waitTask:Gt.waitTask,setSettings:Gt.setSettings,getSettings:Gt.getSettings,partialUpdateObject:Gt.partialUpdateObject,partialUpdateObjects:Gt.partialUpdateObjects,deleteObject:Gt.deleteObject,deleteObjects:Gt.deleteObjects,deleteBy:Gt.deleteBy,clearObjects:Gt.clearObjects,browseObjects:Gt.browseObjects,getObjectPosition:Gt.getObjectPosition,findObject:Gt.findObject,exists:Gt.exists,saveSynonym:Gt.saveSynonym,saveSynonyms:Gt.saveSynonyms,getSynonym:Gt.getSynonym,searchSynonyms:Gt.searchSynonyms,browseSynonyms:Gt.browseSynonyms,deleteSynonym:Gt.deleteSynonym,clearSynonyms:Gt.clearSynonyms,replaceAllObjects:Gt.replaceAllObjects,replaceAllSynonyms:Gt.replaceAllSynonyms,searchRules:Gt.searchRules,getRule:Gt.getRule,deleteRule:Gt.deleteRule,saveRule:Gt.saveRule,saveRules:Gt.saveRules,replaceAllRules:Gt.replaceAllRules,browseRules:Gt.browseRules,clearRules:Gt.clearRules}}),initAnalytics:()=>c=>lw.createAnalyticsClient({...s,...c,methods:{addABTest:lw.addABTest,getABTest:lw.getABTest,getABTests:lw.getABTests,stopABTest:lw.stopABTest,deleteABTest:lw.deleteABTest}}),initPersonalization:n,initRecommendation:()=>c=>(a.logger.info(\"The `initRecommendation` method is deprecated. Use `initPersonalization` instead.\"),n()(c))}})}jIe.version=p9.version;GIe.exports=jIe});var g9=_((GJt,h9)=>{var WIe=qIe();h9.exports=WIe;h9.exports.default=WIe});var y9=_((WJt,JIe)=>{\"use strict\";var VIe=Object.getOwnPropertySymbols,gAt=Object.prototype.hasOwnProperty,dAt=Object.prototype.propertyIsEnumerable;function mAt(t){if(t==null)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}function yAt(){try{if(!Object.assign)return!1;var t=new String(\"abc\");if(t[5]=\"de\",Object.getOwnPropertyNames(t)[0]===\"5\")return!1;for(var e={},r=0;r<10;r++)e[\"_\"+String.fromCharCode(r)]=r;var s=Object.getOwnPropertyNames(e).map(function(n){return e[n]});if(s.join(\"\")!==\"0123456789\")return!1;var a={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(n){a[n]=n}),Object.keys(Object.assign({},a)).join(\"\")===\"abcdefghijklmnopqrst\"}catch{return!1}}JIe.exports=yAt()?Object.assign:function(t,e){for(var r,s=mAt(t),a,n=1;n<arguments.length;n++){r=Object(arguments[n]);for(var c in r)gAt.call(r,c)&&(s[c]=r[c]);if(VIe){a=VIe(r);for(var f=0;f<a.length;f++)dAt.call(r,a[f])&&(s[a[f]]=r[a[f]])}}return s}});var uCe=_(Dn=>{\"use strict\";var I9=y9(),cw=60103,XIe=60106;Dn.Fragment=60107;Dn.StrictMode=60108;Dn.Profiler=60114;var ZIe=60109,$Ie=60110,eCe=60112;Dn.Suspense=60113;var tCe=60115,rCe=60116;typeof Symbol==\"function\"&&Symbol.for&&(Gc=Symbol.for,cw=Gc(\"react.element\"),XIe=Gc(\"react.portal\"),Dn.Fragment=Gc(\"react.fragment\"),Dn.StrictMode=Gc(\"react.strict_mode\"),Dn.Profiler=Gc(\"react.profiler\"),ZIe=Gc(\"react.provider\"),$Ie=Gc(\"react.context\"),eCe=Gc(\"react.forward_ref\"),Dn.Suspense=Gc(\"react.suspense\"),tCe=Gc(\"react.memo\"),rCe=Gc(\"react.lazy\"));var Gc,KIe=typeof Symbol==\"function\"&&Symbol.iterator;function EAt(t){return t===null||typeof t!=\"object\"?null:(t=KIe&&t[KIe]||t[\"@@iterator\"],typeof t==\"function\"?t:null)}function TS(t){for(var e=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+t,r=1;r<arguments.length;r++)e+=\"&args[]=\"+encodeURIComponent(arguments[r]);return\"Minified React error #\"+t+\"; visit \"+e+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var nCe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iCe={};function uw(t,e,r){this.props=t,this.context=e,this.refs=iCe,this.updater=r||nCe}uw.prototype.isReactComponent={};uw.prototype.setState=function(t,e){if(typeof t!=\"object\"&&typeof t!=\"function\"&&t!=null)throw Error(TS(85));this.updater.enqueueSetState(this,t,e,\"setState\")};uw.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,\"forceUpdate\")};function sCe(){}sCe.prototype=uw.prototype;function C9(t,e,r){this.props=t,this.context=e,this.refs=iCe,this.updater=r||nCe}var w9=C9.prototype=new sCe;w9.constructor=C9;I9(w9,uw.prototype);w9.isPureReactComponent=!0;var B9={current:null},oCe=Object.prototype.hasOwnProperty,aCe={key:!0,ref:!0,__self:!0,__source:!0};function lCe(t,e,r){var s,a={},n=null,c=null;if(e!=null)for(s in e.ref!==void 0&&(c=e.ref),e.key!==void 0&&(n=\"\"+e.key),e)oCe.call(e,s)&&!aCe.hasOwnProperty(s)&&(a[s]=e[s]);var f=arguments.length-2;if(f===1)a.children=r;else if(1<f){for(var p=Array(f),h=0;h<f;h++)p[h]=arguments[h+2];a.children=p}if(t&&t.defaultProps)for(s in f=t.defaultProps,f)a[s]===void 0&&(a[s]=f[s]);return{$$typeof:cw,type:t,key:n,ref:c,props:a,_owner:B9.current}}function IAt(t,e){return{$$typeof:cw,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function v9(t){return typeof t==\"object\"&&t!==null&&t.$$typeof===cw}function CAt(t){var e={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+t.replace(/[=:]/g,function(r){return e[r]})}var zIe=/\\/+/g;function E9(t,e){return typeof t==\"object\"&&t!==null&&t.key!=null?CAt(\"\"+t.key):e.toString(36)}function yF(t,e,r,s,a){var n=typeof t;(n===\"undefined\"||n===\"boolean\")&&(t=null);var c=!1;if(t===null)c=!0;else switch(n){case\"string\":case\"number\":c=!0;break;case\"object\":switch(t.$$typeof){case cw:case XIe:c=!0}}if(c)return c=t,a=a(c),t=s===\"\"?\".\"+E9(c,0):s,Array.isArray(a)?(r=\"\",t!=null&&(r=t.replace(zIe,\"$&/\")+\"/\"),yF(a,e,r,\"\",function(h){return h})):a!=null&&(v9(a)&&(a=IAt(a,r+(!a.key||c&&c.key===a.key?\"\":(\"\"+a.key).replace(zIe,\"$&/\")+\"/\")+t)),e.push(a)),1;if(c=0,s=s===\"\"?\".\":s+\":\",Array.isArray(t))for(var f=0;f<t.length;f++){n=t[f];var p=s+E9(n,f);c+=yF(n,e,r,p,a)}else if(p=EAt(t),typeof p==\"function\")for(t=p.call(t),f=0;!(n=t.next()).done;)n=n.value,p=s+E9(n,f++),c+=yF(n,e,r,p,a);else if(n===\"object\")throw e=\"\"+t,Error(TS(31,e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e));return c}function mF(t,e,r){if(t==null)return t;var s=[],a=0;return yF(t,s,\"\",\"\",function(n){return e.call(r,n,a++)}),s}function wAt(t){if(t._status===-1){var e=t._result;e=e(),t._status=0,t._result=e,e.then(function(r){t._status===0&&(r=r.default,t._status=1,t._result=r)},function(r){t._status===0&&(t._status=2,t._result=r)})}if(t._status===1)return t._result;throw t._result}var cCe={current:null};function Zp(){var t=cCe.current;if(t===null)throw Error(TS(321));return t}var BAt={ReactCurrentDispatcher:cCe,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:B9,IsSomeRendererActing:{current:!1},assign:I9};Dn.Children={map:mF,forEach:function(t,e,r){mF(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return mF(t,function(){e++}),e},toArray:function(t){return mF(t,function(e){return e})||[]},only:function(t){if(!v9(t))throw Error(TS(143));return t}};Dn.Component=uw;Dn.PureComponent=C9;Dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BAt;Dn.cloneElement=function(t,e,r){if(t==null)throw Error(TS(267,t));var s=I9({},t.props),a=t.key,n=t.ref,c=t._owner;if(e!=null){if(e.ref!==void 0&&(n=e.ref,c=B9.current),e.key!==void 0&&(a=\"\"+e.key),t.type&&t.type.defaultProps)var f=t.type.defaultProps;for(p in e)oCe.call(e,p)&&!aCe.hasOwnProperty(p)&&(s[p]=e[p]===void 0&&f!==void 0?f[p]:e[p])}var p=arguments.length-2;if(p===1)s.children=r;else if(1<p){f=Array(p);for(var h=0;h<p;h++)f[h]=arguments[h+2];s.children=f}return{$$typeof:cw,type:t.type,key:a,ref:n,props:s,_owner:c}};Dn.createContext=function(t,e){return e===void 0&&(e=null),t={$$typeof:$Ie,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider={$$typeof:ZIe,_context:t},t.Consumer=t};Dn.createElement=lCe;Dn.createFactory=function(t){var e=lCe.bind(null,t);return e.type=t,e};Dn.createRef=function(){return{current:null}};Dn.forwardRef=function(t){return{$$typeof:eCe,render:t}};Dn.isValidElement=v9;Dn.lazy=function(t){return{$$typeof:rCe,_payload:{_status:-1,_result:t},_init:wAt}};Dn.memo=function(t,e){return{$$typeof:tCe,type:t,compare:e===void 0?null:e}};Dn.useCallback=function(t,e){return Zp().useCallback(t,e)};Dn.useContext=function(t,e){return Zp().useContext(t,e)};Dn.useDebugValue=function(){};Dn.useEffect=function(t,e){return Zp().useEffect(t,e)};Dn.useImperativeHandle=function(t,e,r){return Zp().useImperativeHandle(t,e,r)};Dn.useLayoutEffect=function(t,e){return Zp().useLayoutEffect(t,e)};Dn.useMemo=function(t,e){return Zp().useMemo(t,e)};Dn.useReducer=function(t,e,r){return Zp().useReducer(t,e,r)};Dn.useRef=function(t){return Zp().useRef(t)};Dn.useState=function(t){return Zp().useState(t)};Dn.version=\"17.0.2\"});var hn=_((VJt,fCe)=>{\"use strict\";fCe.exports=uCe()});var EF=_((JJt,ACe)=>{function vAt(t){var e=typeof t;return t!=null&&(e==\"object\"||e==\"function\")}ACe.exports=vAt});var hCe=_((KJt,pCe)=>{var SAt=typeof global==\"object\"&&global&&global.Object===Object&&global;pCe.exports=SAt});var S9=_((zJt,gCe)=>{var DAt=hCe(),bAt=typeof self==\"object\"&&self&&self.Object===Object&&self,PAt=DAt||bAt||Function(\"return this\")();gCe.exports=PAt});var mCe=_((XJt,dCe)=>{var xAt=S9(),kAt=function(){return xAt.Date.now()};dCe.exports=kAt});var ECe=_((ZJt,yCe)=>{var QAt=/\\s/;function TAt(t){for(var e=t.length;e--&&QAt.test(t.charAt(e)););return e}yCe.exports=TAt});var CCe=_(($Jt,ICe)=>{var RAt=ECe(),FAt=/^\\s+/;function NAt(t){return t&&t.slice(0,RAt(t)+1).replace(FAt,\"\")}ICe.exports=NAt});var D9=_((eKt,wCe)=>{var OAt=S9(),LAt=OAt.Symbol;wCe.exports=LAt});var DCe=_((tKt,SCe)=>{var BCe=D9(),vCe=Object.prototype,MAt=vCe.hasOwnProperty,UAt=vCe.toString,RS=BCe?BCe.toStringTag:void 0;function _At(t){var e=MAt.call(t,RS),r=t[RS];try{t[RS]=void 0;var s=!0}catch{}var a=UAt.call(t);return s&&(e?t[RS]=r:delete t[RS]),a}SCe.exports=_At});var PCe=_((rKt,bCe)=>{var HAt=Object.prototype,jAt=HAt.toString;function GAt(t){return jAt.call(t)}bCe.exports=GAt});var TCe=_((nKt,QCe)=>{var xCe=D9(),qAt=DCe(),WAt=PCe(),YAt=\"[object Null]\",VAt=\"[object Undefined]\",kCe=xCe?xCe.toStringTag:void 0;function JAt(t){return t==null?t===void 0?VAt:YAt:kCe&&kCe in Object(t)?qAt(t):WAt(t)}QCe.exports=JAt});var FCe=_((iKt,RCe)=>{function KAt(t){return t!=null&&typeof t==\"object\"}RCe.exports=KAt});var OCe=_((sKt,NCe)=>{var zAt=TCe(),XAt=FCe(),ZAt=\"[object Symbol]\";function $At(t){return typeof t==\"symbol\"||XAt(t)&&zAt(t)==ZAt}NCe.exports=$At});var _Ce=_((oKt,UCe)=>{var ept=CCe(),LCe=EF(),tpt=OCe(),MCe=NaN,rpt=/^[-+]0x[0-9a-f]+$/i,npt=/^0b[01]+$/i,ipt=/^0o[0-7]+$/i,spt=parseInt;function opt(t){if(typeof t==\"number\")return t;if(tpt(t))return MCe;if(LCe(t)){var e=typeof t.valueOf==\"function\"?t.valueOf():t;t=LCe(e)?e+\"\":e}if(typeof t!=\"string\")return t===0?t:+t;t=ept(t);var r=npt.test(t);return r||ipt.test(t)?spt(t.slice(2),r?2:8):rpt.test(t)?MCe:+t}UCe.exports=opt});var GCe=_((aKt,jCe)=>{var apt=EF(),b9=mCe(),HCe=_Ce(),lpt=\"Expected a function\",cpt=Math.max,upt=Math.min;function fpt(t,e,r){var s,a,n,c,f,p,h=0,E=!1,C=!1,S=!0;if(typeof t!=\"function\")throw new TypeError(lpt);e=HCe(e)||0,apt(r)&&(E=!!r.leading,C=\"maxWait\"in r,n=C?cpt(HCe(r.maxWait)||0,e):n,S=\"trailing\"in r?!!r.trailing:S);function P(le){var me=s,pe=a;return s=a=void 0,h=le,c=t.apply(pe,me),c}function I(le){return h=le,f=setTimeout(U,e),E?P(le):c}function R(le){var me=le-p,pe=le-h,Be=e-me;return C?upt(Be,n-pe):Be}function N(le){var me=le-p,pe=le-h;return p===void 0||me>=e||me<0||C&&pe>=n}function U(){var le=b9();if(N(le))return W(le);f=setTimeout(U,R(le))}function W(le){return f=void 0,S&&s?P(le):(s=a=void 0,c)}function ee(){f!==void 0&&clearTimeout(f),h=0,s=p=a=f=void 0}function ie(){return f===void 0?c:W(b9())}function ue(){var le=b9(),me=N(le);if(s=arguments,a=this,p=le,me){if(f===void 0)return I(p);if(C)return clearTimeout(f),f=setTimeout(U,e),P(p)}return f===void 0&&(f=setTimeout(U,e)),c}return ue.cancel=ee,ue.flush=ie,ue}jCe.exports=fpt});var WCe=_((lKt,qCe)=>{var Apt=GCe(),ppt=EF(),hpt=\"Expected a function\";function gpt(t,e,r){var s=!0,a=!0;if(typeof t!=\"function\")throw new TypeError(hpt);return ppt(r)&&(s=\"leading\"in r?!!r.leading:s,a=\"trailing\"in r?!!r.trailing:a),Apt(t,e,{leading:s,maxWait:e,trailing:a})}qCe.exports=gpt});var x9=_((cKt,P9)=>{\"use strict\";var Cn=P9.exports;P9.exports.default=Cn;var Xn=\"\\x1B[\",NS=\"\\x1B]\",fw=\"\\x07\",IF=\";\",YCe=process.env.TERM_PROGRAM===\"Apple_Terminal\";Cn.cursorTo=(t,e)=>{if(typeof t!=\"number\")throw new TypeError(\"The `x` argument is required\");return typeof e!=\"number\"?Xn+(t+1)+\"G\":Xn+(e+1)+\";\"+(t+1)+\"H\"};Cn.cursorMove=(t,e)=>{if(typeof t!=\"number\")throw new TypeError(\"The `x` argument is required\");let r=\"\";return t<0?r+=Xn+-t+\"D\":t>0&&(r+=Xn+t+\"C\"),e<0?r+=Xn+-e+\"A\":e>0&&(r+=Xn+e+\"B\"),r};Cn.cursorUp=(t=1)=>Xn+t+\"A\";Cn.cursorDown=(t=1)=>Xn+t+\"B\";Cn.cursorForward=(t=1)=>Xn+t+\"C\";Cn.cursorBackward=(t=1)=>Xn+t+\"D\";Cn.cursorLeft=Xn+\"G\";Cn.cursorSavePosition=YCe?\"\\x1B7\":Xn+\"s\";Cn.cursorRestorePosition=YCe?\"\\x1B8\":Xn+\"u\";Cn.cursorGetPosition=Xn+\"6n\";Cn.cursorNextLine=Xn+\"E\";Cn.cursorPrevLine=Xn+\"F\";Cn.cursorHide=Xn+\"?25l\";Cn.cursorShow=Xn+\"?25h\";Cn.eraseLines=t=>{let e=\"\";for(let r=0;r<t;r++)e+=Cn.eraseLine+(r<t-1?Cn.cursorUp():\"\");return t&&(e+=Cn.cursorLeft),e};Cn.eraseEndLine=Xn+\"K\";Cn.eraseStartLine=Xn+\"1K\";Cn.eraseLine=Xn+\"2K\";Cn.eraseDown=Xn+\"J\";Cn.eraseUp=Xn+\"1J\";Cn.eraseScreen=Xn+\"2J\";Cn.scrollUp=Xn+\"S\";Cn.scrollDown=Xn+\"T\";Cn.clearScreen=\"\\x1Bc\";Cn.clearTerminal=process.platform===\"win32\"?`${Cn.eraseScreen}${Xn}0f`:`${Cn.eraseScreen}${Xn}3J${Xn}H`;Cn.beep=fw;Cn.link=(t,e)=>[NS,\"8\",IF,IF,e,fw,t,NS,\"8\",IF,IF,fw].join(\"\");Cn.image=(t,e={})=>{let r=`${NS}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=\";preserveAspectRatio=0\"),r+\":\"+t.toString(\"base64\")+fw};Cn.iTerm={setCwd:(t=process.cwd())=>`${NS}50;CurrentDir=${t}${fw}`,annotation:(t,e={})=>{let r=`${NS}1337;`,s=typeof e.x<\"u\",a=typeof e.y<\"u\";if((s||a)&&!(s&&a&&typeof e.length<\"u\"))throw new Error(\"`x`, `y` and `length` must be defined when `x` or `y` is defined\");return t=t.replace(/\\|/g,\"\"),r+=e.isHidden?\"AddHiddenAnnotation=\":\"AddAnnotation=\",e.length>0?r+=(s?[t,e.length,e.x,e.y]:[e.length,t]).join(\"|\"):r+=t,r+fw}}});var JCe=_((uKt,k9)=>{\"use strict\";var VCe=(t,e)=>{for(let r of Reflect.ownKeys(e))Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t};k9.exports=VCe;k9.exports.default=VCe});var zCe=_((fKt,wF)=>{\"use strict\";var dpt=JCe(),CF=new WeakMap,KCe=(t,e={})=>{if(typeof t!=\"function\")throw new TypeError(\"Expected a function\");let r,s=0,a=t.displayName||t.name||\"<anonymous>\",n=function(...c){if(CF.set(n,++s),s===1)r=t.apply(this,c),t=null;else if(e.throw===!0)throw new Error(`Function \\`${a}\\` can only be called once`);return r};return dpt(n,t),CF.set(n,s),n};wF.exports=KCe;wF.exports.default=KCe;wF.exports.callCount=t=>{if(!CF.has(t))throw new Error(`The given function \\`${t.name}\\` is not wrapped by the \\`onetime\\` package`);return CF.get(t)}});var XCe=_((AKt,BF)=>{BF.exports=[\"SIGABRT\",\"SIGALRM\",\"SIGHUP\",\"SIGINT\",\"SIGTERM\"];process.platform!==\"win32\"&&BF.exports.push(\"SIGVTALRM\",\"SIGXCPU\",\"SIGXFSZ\",\"SIGUSR2\",\"SIGTRAP\",\"SIGSYS\",\"SIGQUIT\",\"SIGIOT\");process.platform===\"linux\"&&BF.exports.push(\"SIGIO\",\"SIGPOLL\",\"SIGPWR\",\"SIGSTKFLT\",\"SIGUNUSED\")});var R9=_((pKt,hw)=>{var Qi=global.process,Qm=function(t){return t&&typeof t==\"object\"&&typeof t.removeListener==\"function\"&&typeof t.emit==\"function\"&&typeof t.reallyExit==\"function\"&&typeof t.listeners==\"function\"&&typeof t.kill==\"function\"&&typeof t.pid==\"number\"&&typeof t.on==\"function\"};Qm(Qi)?(ZCe=Ie(\"assert\"),Aw=XCe(),$Ce=/^win/i.test(Qi.platform),OS=Ie(\"events\"),typeof OS!=\"function\"&&(OS=OS.EventEmitter),Qi.__signal_exit_emitter__?Js=Qi.__signal_exit_emitter__:(Js=Qi.__signal_exit_emitter__=new OS,Js.count=0,Js.emitted={}),Js.infinite||(Js.setMaxListeners(1/0),Js.infinite=!0),hw.exports=function(t,e){if(!Qm(global.process))return function(){};ZCe.equal(typeof t,\"function\",\"a callback must be provided for exit handler\"),pw===!1&&Q9();var r=\"exit\";e&&e.alwaysLast&&(r=\"afterexit\");var s=function(){Js.removeListener(r,t),Js.listeners(\"exit\").length===0&&Js.listeners(\"afterexit\").length===0&&vF()};return Js.on(r,t),s},vF=function(){!pw||!Qm(global.process)||(pw=!1,Aw.forEach(function(e){try{Qi.removeListener(e,SF[e])}catch{}}),Qi.emit=DF,Qi.reallyExit=T9,Js.count-=1)},hw.exports.unload=vF,Tm=function(e,r,s){Js.emitted[e]||(Js.emitted[e]=!0,Js.emit(e,r,s))},SF={},Aw.forEach(function(t){SF[t]=function(){if(Qm(global.process)){var r=Qi.listeners(t);r.length===Js.count&&(vF(),Tm(\"exit\",null,t),Tm(\"afterexit\",null,t),$Ce&&t===\"SIGHUP\"&&(t=\"SIGINT\"),Qi.kill(Qi.pid,t))}}}),hw.exports.signals=function(){return Aw},pw=!1,Q9=function(){pw||!Qm(global.process)||(pw=!0,Js.count+=1,Aw=Aw.filter(function(e){try{return Qi.on(e,SF[e]),!0}catch{return!1}}),Qi.emit=twe,Qi.reallyExit=ewe)},hw.exports.load=Q9,T9=Qi.reallyExit,ewe=function(e){Qm(global.process)&&(Qi.exitCode=e||0,Tm(\"exit\",Qi.exitCode,null),Tm(\"afterexit\",Qi.exitCode,null),T9.call(Qi,Qi.exitCode))},DF=Qi.emit,twe=function(e,r){if(e===\"exit\"&&Qm(global.process)){r!==void 0&&(Qi.exitCode=r);var s=DF.apply(this,arguments);return Tm(\"exit\",Qi.exitCode,null),Tm(\"afterexit\",Qi.exitCode,null),s}else return DF.apply(this,arguments)}):hw.exports=function(){return function(){}};var ZCe,Aw,$Ce,OS,Js,vF,Tm,SF,pw,Q9,T9,ewe,DF,twe});var nwe=_((hKt,rwe)=>{\"use strict\";var mpt=zCe(),ypt=R9();rwe.exports=mpt(()=>{ypt(()=>{process.stderr.write(\"\\x1B[?25h\")},{alwaysLast:!0})})});var F9=_(gw=>{\"use strict\";var Ept=nwe(),bF=!1;gw.show=(t=process.stderr)=>{t.isTTY&&(bF=!1,t.write(\"\\x1B[?25h\"))};gw.hide=(t=process.stderr)=>{t.isTTY&&(Ept(),bF=!0,t.write(\"\\x1B[?25l\"))};gw.toggle=(t,e)=>{t!==void 0&&(bF=t),bF?gw.show(e):gw.hide(e)}});var awe=_(LS=>{\"use strict\";var owe=LS&&LS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(LS,\"__esModule\",{value:!0});var iwe=owe(x9()),swe=owe(F9()),Ipt=(t,{showCursor:e=!1}={})=>{let r=0,s=\"\",a=!1,n=c=>{!e&&!a&&(swe.default.hide(),a=!0);let f=c+`\n`;f!==s&&(s=f,t.write(iwe.default.eraseLines(r)+f),r=f.split(`\n`).length)};return n.clear=()=>{t.write(iwe.default.eraseLines(r)),s=\"\",r=0},n.done=()=>{s=\"\",r=0,e||(swe.default.show(),a=!1)},n};LS.default={create:Ipt}});var lwe=_((mKt,Cpt)=>{Cpt.exports=[{name:\"AppVeyor\",constant:\"APPVEYOR\",env:\"APPVEYOR\",pr:\"APPVEYOR_PULL_REQUEST_NUMBER\"},{name:\"Azure Pipelines\",constant:\"AZURE_PIPELINES\",env:\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\",pr:\"SYSTEM_PULLREQUEST_PULLREQUESTID\"},{name:\"Bamboo\",constant:\"BAMBOO\",env:\"bamboo_planKey\"},{name:\"Bitbucket Pipelines\",constant:\"BITBUCKET\",env:\"BITBUCKET_COMMIT\",pr:\"BITBUCKET_PR_ID\"},{name:\"Bitrise\",constant:\"BITRISE\",env:\"BITRISE_IO\",pr:\"BITRISE_PULL_REQUEST\"},{name:\"Buddy\",constant:\"BUDDY\",env:\"BUDDY_WORKSPACE_ID\",pr:\"BUDDY_EXECUTION_PULL_REQUEST_ID\"},{name:\"Buildkite\",constant:\"BUILDKITE\",env:\"BUILDKITE\",pr:{env:\"BUILDKITE_PULL_REQUEST\",ne:\"false\"}},{name:\"CircleCI\",constant:\"CIRCLE\",env:\"CIRCLECI\",pr:\"CIRCLE_PULL_REQUEST\"},{name:\"Cirrus CI\",constant:\"CIRRUS\",env:\"CIRRUS_CI\",pr:\"CIRRUS_PR\"},{name:\"AWS CodeBuild\",constant:\"CODEBUILD\",env:\"CODEBUILD_BUILD_ARN\"},{name:\"Codeship\",constant:\"CODESHIP\",env:{CI_NAME:\"codeship\"}},{name:\"Drone\",constant:\"DRONE\",env:\"DRONE\",pr:{DRONE_BUILD_EVENT:\"pull_request\"}},{name:\"dsari\",constant:\"DSARI\",env:\"DSARI\"},{name:\"GitLab CI\",constant:\"GITLAB\",env:\"GITLAB_CI\"},{name:\"GoCD\",constant:\"GOCD\",env:\"GO_PIPELINE_LABEL\"},{name:\"Hudson\",constant:\"HUDSON\",env:\"HUDSON_URL\"},{name:\"Jenkins\",constant:\"JENKINS\",env:[\"JENKINS_URL\",\"BUILD_ID\"],pr:{any:[\"ghprbPullId\",\"CHANGE_ID\"]}},{name:\"Magnum CI\",constant:\"MAGNUM\",env:\"MAGNUM\"},{name:\"Netlify CI\",constant:\"NETLIFY\",env:\"NETLIFY_BUILD_BASE\",pr:{env:\"PULL_REQUEST\",ne:\"false\"}},{name:\"Sail CI\",constant:\"SAIL\",env:\"SAILCI\",pr:\"SAIL_PULL_REQUEST_NUMBER\"},{name:\"Semaphore\",constant:\"SEMAPHORE\",env:\"SEMAPHORE\",pr:\"PULL_REQUEST_NUMBER\"},{name:\"Shippable\",constant:\"SHIPPABLE\",env:\"SHIPPABLE\",pr:{IS_PULL_REQUEST:\"true\"}},{name:\"Solano CI\",constant:\"SOLANO\",env:\"TDDIUM\",pr:\"TDDIUM_PR_ID\"},{name:\"Strider CD\",constant:\"STRIDER\",env:\"STRIDER\"},{name:\"TaskCluster\",constant:\"TASKCLUSTER\",env:[\"TASK_ID\",\"RUN_ID\"]},{name:\"TeamCity\",constant:\"TEAMCITY\",env:\"TEAMCITY_VERSION\"},{name:\"Travis CI\",constant:\"TRAVIS\",env:\"TRAVIS\",pr:{env:\"TRAVIS_PULL_REQUEST\",ne:\"false\"}}]});var fwe=_(tc=>{\"use strict\";var uwe=lwe(),uA=process.env;Object.defineProperty(tc,\"_vendors\",{value:uwe.map(function(t){return t.constant})});tc.name=null;tc.isPR=null;uwe.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(s){return cwe(s)});if(tc[t.constant]=r,r)switch(tc.name=t.name,typeof t.pr){case\"string\":tc.isPR=!!uA[t.pr];break;case\"object\":\"env\"in t.pr?tc.isPR=t.pr.env in uA&&uA[t.pr.env]!==t.pr.ne:\"any\"in t.pr?tc.isPR=t.pr.any.some(function(s){return!!uA[s]}):tc.isPR=cwe(t.pr);break;default:tc.isPR=null}});tc.isCI=!!(uA.CI||uA.CONTINUOUS_INTEGRATION||uA.BUILD_NUMBER||uA.RUN_ID||tc.name);function cwe(t){return typeof t==\"string\"?!!uA[t]:Object.keys(t).every(function(e){return uA[e]===t[e]})}});var pwe=_((EKt,Awe)=>{\"use strict\";Awe.exports=fwe().isCI});var gwe=_((IKt,hwe)=>{\"use strict\";var wpt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};hwe.exports=(t,{include:e,exclude:r}={})=>{let s=a=>{let n=c=>typeof c==\"string\"?a===c:c.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of wpt(t.constructor.prototype)){if(n===\"constructor\"||!s(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value==\"function\"&&(t[n]=t[n].bind(t))}return t}});var Cwe=_(Vn=>{\"use strict\";var mw,_S,QF,H9;typeof performance==\"object\"&&typeof performance.now==\"function\"?(dwe=performance,Vn.unstable_now=function(){return dwe.now()}):(N9=Date,mwe=N9.now(),Vn.unstable_now=function(){return N9.now()-mwe});var dwe,N9,mwe;typeof window>\"u\"||typeof MessageChannel!=\"function\"?(dw=null,O9=null,L9=function(){if(dw!==null)try{var t=Vn.unstable_now();dw(!0,t),dw=null}catch(e){throw setTimeout(L9,0),e}},mw=function(t){dw!==null?setTimeout(mw,0,t):(dw=t,setTimeout(L9,0))},_S=function(t,e){O9=setTimeout(t,e)},QF=function(){clearTimeout(O9)},Vn.unstable_shouldYield=function(){return!1},H9=Vn.unstable_forceFrameRate=function(){}):(ywe=window.setTimeout,Ewe=window.clearTimeout,typeof console<\"u\"&&(Iwe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!=\"function\"&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"),typeof Iwe!=\"function\"&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\")),MS=!1,US=null,PF=-1,M9=5,U9=0,Vn.unstable_shouldYield=function(){return Vn.unstable_now()>=U9},H9=function(){},Vn.unstable_forceFrameRate=function(t){0>t||125<t?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):M9=0<t?Math.floor(1e3/t):5},_9=new MessageChannel,xF=_9.port2,_9.port1.onmessage=function(){if(US!==null){var t=Vn.unstable_now();U9=t+M9;try{US(!0,t)?xF.postMessage(null):(MS=!1,US=null)}catch(e){throw xF.postMessage(null),e}}else MS=!1},mw=function(t){US=t,MS||(MS=!0,xF.postMessage(null))},_S=function(t,e){PF=ywe(function(){t(Vn.unstable_now())},e)},QF=function(){Ewe(PF),PF=-1});var dw,O9,L9,ywe,Ewe,Iwe,MS,US,PF,M9,U9,_9,xF;function j9(t,e){var r=t.length;t.push(e);e:for(;;){var s=r-1>>>1,a=t[s];if(a!==void 0&&0<kF(a,e))t[s]=e,t[r]=a,r=s;else break e}}function ef(t){return t=t[0],t===void 0?null:t}function TF(t){var e=t[0];if(e!==void 0){var r=t.pop();if(r!==e){t[0]=r;e:for(var s=0,a=t.length;s<a;){var n=2*(s+1)-1,c=t[n],f=n+1,p=t[f];if(c!==void 0&&0>kF(c,r))p!==void 0&&0>kF(p,c)?(t[s]=p,t[f]=r,s=f):(t[s]=c,t[n]=r,s=n);else if(p!==void 0&&0>kF(p,r))t[s]=p,t[f]=r,s=f;else break e}}return e}return null}function kF(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}var fA=[],Z0=[],Bpt=1,qc=null,$o=3,RF=!1,Rm=!1,HS=!1;function G9(t){for(var e=ef(Z0);e!==null;){if(e.callback===null)TF(Z0);else if(e.startTime<=t)TF(Z0),e.sortIndex=e.expirationTime,j9(fA,e);else break;e=ef(Z0)}}function q9(t){if(HS=!1,G9(t),!Rm)if(ef(fA)!==null)Rm=!0,mw(W9);else{var e=ef(Z0);e!==null&&_S(q9,e.startTime-t)}}function W9(t,e){Rm=!1,HS&&(HS=!1,QF()),RF=!0;var r=$o;try{for(G9(e),qc=ef(fA);qc!==null&&(!(qc.expirationTime>e)||t&&!Vn.unstable_shouldYield());){var s=qc.callback;if(typeof s==\"function\"){qc.callback=null,$o=qc.priorityLevel;var a=s(qc.expirationTime<=e);e=Vn.unstable_now(),typeof a==\"function\"?qc.callback=a:qc===ef(fA)&&TF(fA),G9(e)}else TF(fA);qc=ef(fA)}if(qc!==null)var n=!0;else{var c=ef(Z0);c!==null&&_S(q9,c.startTime-e),n=!1}return n}finally{qc=null,$o=r,RF=!1}}var vpt=H9;Vn.unstable_IdlePriority=5;Vn.unstable_ImmediatePriority=1;Vn.unstable_LowPriority=4;Vn.unstable_NormalPriority=3;Vn.unstable_Profiling=null;Vn.unstable_UserBlockingPriority=2;Vn.unstable_cancelCallback=function(t){t.callback=null};Vn.unstable_continueExecution=function(){Rm||RF||(Rm=!0,mw(W9))};Vn.unstable_getCurrentPriorityLevel=function(){return $o};Vn.unstable_getFirstCallbackNode=function(){return ef(fA)};Vn.unstable_next=function(t){switch($o){case 1:case 2:case 3:var e=3;break;default:e=$o}var r=$o;$o=e;try{return t()}finally{$o=r}};Vn.unstable_pauseExecution=function(){};Vn.unstable_requestPaint=vpt;Vn.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=$o;$o=t;try{return e()}finally{$o=r}};Vn.unstable_scheduleCallback=function(t,e,r){var s=Vn.unstable_now();switch(typeof r==\"object\"&&r!==null?(r=r.delay,r=typeof r==\"number\"&&0<r?s+r:s):r=s,t){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return a=r+a,t={id:Bpt++,callback:e,priorityLevel:t,startTime:r,expirationTime:a,sortIndex:-1},r>s?(t.sortIndex=r,j9(Z0,t),ef(fA)===null&&t===ef(Z0)&&(HS?QF():HS=!0,_S(q9,r-s))):(t.sortIndex=a,j9(fA,t),Rm||RF||(Rm=!0,mw(W9))),t};Vn.unstable_wrapCallback=function(t){var e=$o;return function(){var r=$o;$o=e;try{return t.apply(this,arguments)}finally{$o=r}}}});var Y9=_((wKt,wwe)=>{\"use strict\";wwe.exports=Cwe()});var Bwe=_((BKt,jS)=>{jS.exports=function(e){var r={},s=y9(),a=hn(),n=Y9();function c(v){for(var D=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+v,Q=1;Q<arguments.length;Q++)D+=\"&args[]=\"+encodeURIComponent(arguments[Q]);return\"Minified React error #\"+v+\"; visit \"+D+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var f=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,p=60103,h=60106,E=60107,C=60108,S=60114,P=60109,I=60110,R=60112,N=60113,U=60120,W=60115,ee=60116,ie=60121,ue=60129,le=60130,me=60131;if(typeof Symbol==\"function\"&&Symbol.for){var pe=Symbol.for;p=pe(\"react.element\"),h=pe(\"react.portal\"),E=pe(\"react.fragment\"),C=pe(\"react.strict_mode\"),S=pe(\"react.profiler\"),P=pe(\"react.provider\"),I=pe(\"react.context\"),R=pe(\"react.forward_ref\"),N=pe(\"react.suspense\"),U=pe(\"react.suspense_list\"),W=pe(\"react.memo\"),ee=pe(\"react.lazy\"),ie=pe(\"react.block\"),pe(\"react.scope\"),ue=pe(\"react.debug_trace_mode\"),le=pe(\"react.offscreen\"),me=pe(\"react.legacy_hidden\")}var Be=typeof Symbol==\"function\"&&Symbol.iterator;function Ce(v){return v===null||typeof v!=\"object\"?null:(v=Be&&v[Be]||v[\"@@iterator\"],typeof v==\"function\"?v:null)}function g(v){if(v==null)return null;if(typeof v==\"function\")return v.displayName||v.name||null;if(typeof v==\"string\")return v;switch(v){case E:return\"Fragment\";case h:return\"Portal\";case S:return\"Profiler\";case C:return\"StrictMode\";case N:return\"Suspense\";case U:return\"SuspenseList\"}if(typeof v==\"object\")switch(v.$$typeof){case I:return(v.displayName||\"Context\")+\".Consumer\";case P:return(v._context.displayName||\"Context\")+\".Provider\";case R:var D=v.render;return D=D.displayName||D.name||\"\",v.displayName||(D!==\"\"?\"ForwardRef(\"+D+\")\":\"ForwardRef\");case W:return g(v.type);case ie:return g(v._render);case ee:D=v._payload,v=v._init;try{return g(v(D))}catch{}}return null}function we(v){var D=v,Q=v;if(v.alternate)for(;D.return;)D=D.return;else{v=D;do D=v,D.flags&1026&&(Q=D.return),v=D.return;while(v)}return D.tag===3?Q:null}function ye(v){if(we(v)!==v)throw Error(c(188))}function Ae(v){var D=v.alternate;if(!D){if(D=we(v),D===null)throw Error(c(188));return D!==v?null:v}for(var Q=v,H=D;;){var V=Q.return;if(V===null)break;var ne=V.alternate;if(ne===null){if(H=V.return,H!==null){Q=H;continue}break}if(V.child===ne.child){for(ne=V.child;ne;){if(ne===Q)return ye(V),v;if(ne===H)return ye(V),D;ne=ne.sibling}throw Error(c(188))}if(Q.return!==H.return)Q=V,H=ne;else{for(var Se=!1,_e=V.child;_e;){if(_e===Q){Se=!0,Q=V,H=ne;break}if(_e===H){Se=!0,H=V,Q=ne;break}_e=_e.sibling}if(!Se){for(_e=ne.child;_e;){if(_e===Q){Se=!0,Q=ne,H=V;break}if(_e===H){Se=!0,H=ne,Q=V;break}_e=_e.sibling}if(!Se)throw Error(c(189))}}if(Q.alternate!==H)throw Error(c(190))}if(Q.tag!==3)throw Error(c(188));return Q.stateNode.current===Q?v:D}function se(v){if(v=Ae(v),!v)return null;for(var D=v;;){if(D.tag===5||D.tag===6)return D;if(D.child)D.child.return=D,D=D.child;else{if(D===v)break;for(;!D.sibling;){if(!D.return||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}}return null}function Z(v){if(v=Ae(v),!v)return null;for(var D=v;;){if(D.tag===5||D.tag===6)return D;if(D.child&&D.tag!==4)D.child.return=D,D=D.child;else{if(D===v)break;for(;!D.sibling;){if(!D.return||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}}return null}function De(v,D){for(var Q=v.alternate;D!==null;){if(D===v||D===Q)return!0;D=D.return}return!1}var Re=e.getPublicInstance,mt=e.getRootHostContext,j=e.getChildHostContext,rt=e.prepareForCommit,Fe=e.resetAfterCommit,Ne=e.createInstance,Pe=e.appendInitialChild,Ve=e.finalizeInitialChildren,ke=e.prepareUpdate,it=e.shouldSetTextContent,Ue=e.createTextInstance,x=e.scheduleTimeout,w=e.cancelTimeout,b=e.noTimeout,y=e.isPrimaryRenderer,F=e.supportsMutation,z=e.supportsPersistence,X=e.supportsHydration,$=e.getInstanceFromNode,oe=e.makeOpaqueHydratingObject,xe=e.makeClientId,Te=e.beforeActiveInstanceBlur,lt=e.afterActiveInstanceBlur,Ct=e.preparePortalMount,qt=e.supportsTestSelectors,ir=e.findFiberRoot,Pt=e.getBoundingRect,gn=e.getTextContent,Pr=e.isHiddenSubtree,Ir=e.matchAccessibilityRole,Or=e.setFocusIfFocusable,on=e.setupIntersectionObserver,ai=e.appendChild,Io=e.appendChildToContainer,rs=e.commitTextUpdate,$s=e.commitMount,Co=e.commitUpdate,ji=e.insertBefore,eo=e.insertInContainerBefore,wo=e.removeChild,QA=e.removeChildFromContainer,Af=e.resetTextContent,dh=e.hideInstance,mh=e.hideTextInstance,to=e.unhideInstance,jn=e.unhideTextInstance,Ts=e.clearContainer,ro=e.cloneInstance,ou=e.createContainerChildSet,au=e.appendChildToContainerChildSet,lu=e.finalizeContainerChildren,TA=e.replaceContainerChildren,RA=e.cloneHiddenInstance,oa=e.cloneHiddenTextInstance,aa=e.canHydrateInstance,FA=e.canHydrateTextInstance,gr=e.isSuspenseInstancePending,Bo=e.isSuspenseInstanceFallback,Me=e.getNextHydratableSibling,cu=e.getFirstHydratableChild,Cr=e.hydrateInstance,pf=e.hydrateTextInstance,NA=e.getNextHydratableInstanceAfterSuspenseInstance,OA=e.commitHydratedContainer,uu=e.commitHydratedSuspenseInstance,fu;function oc(v){if(fu===void 0)try{throw Error()}catch(Q){var D=Q.stack.trim().match(/\\n( *(at )?)/);fu=D&&D[1]||\"\"}return`\n`+fu+v}var ve=!1;function Nt(v,D){if(!v||ve)return\"\";ve=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(D)if(D=function(){throw Error()},Object.defineProperty(D.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(D,[])}catch(pt){var H=pt}Reflect.construct(v,[],D)}else{try{D.call()}catch(pt){H=pt}v.call(D.prototype)}else{try{throw Error()}catch(pt){H=pt}v()}}catch(pt){if(pt&&H&&typeof pt.stack==\"string\"){for(var V=pt.stack.split(`\n`),ne=H.stack.split(`\n`),Se=V.length-1,_e=ne.length-1;1<=Se&&0<=_e&&V[Se]!==ne[_e];)_e--;for(;1<=Se&&0<=_e;Se--,_e--)if(V[Se]!==ne[_e]){if(Se!==1||_e!==1)do if(Se--,_e--,0>_e||V[Se]!==ne[_e])return`\n`+V[Se].replace(\" at new \",\" at \");while(1<=Se&&0<=_e);break}}}finally{ve=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:\"\")?oc(v):\"\"}var ac=[],Oi=-1;function no(v){return{current:v}}function Rt(v){0>Oi||(v.current=ac[Oi],ac[Oi]=null,Oi--)}function xn(v,D){Oi++,ac[Oi]=v.current,v.current=D}var la={},Gi=no(la),Li=no(!1),Na=la;function dn(v,D){var Q=v.type.contextTypes;if(!Q)return la;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===D)return H.__reactInternalMemoizedMaskedChildContext;var V={},ne;for(ne in Q)V[ne]=D[ne];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=D,v.__reactInternalMemoizedMaskedChildContext=V),V}function Kn(v){return v=v.childContextTypes,v!=null}function Au(){Rt(Li),Rt(Gi)}function yh(v,D,Q){if(Gi.current!==la)throw Error(c(168));xn(Gi,D),xn(Li,Q)}function Oa(v,D,Q){var H=v.stateNode;if(v=D.childContextTypes,typeof H.getChildContext!=\"function\")return Q;H=H.getChildContext();for(var V in H)if(!(V in v))throw Error(c(108,g(D)||\"Unknown\",V));return s({},Q,H)}function La(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||la,Na=Gi.current,xn(Gi,v),xn(Li,Li.current),!0}function Ma(v,D,Q){var H=v.stateNode;if(!H)throw Error(c(169));Q?(v=Oa(v,D,Na),H.__reactInternalMemoizedMergedChildContext=v,Rt(Li),Rt(Gi),xn(Gi,v)):Rt(Li),xn(Li,Q)}var $e=null,Ua=null,hf=n.unstable_now;hf();var lc=0,wn=8;function ca(v){if(1&v)return wn=15,1;if(2&v)return wn=14,2;if(4&v)return wn=13,4;var D=24&v;return D!==0?(wn=12,D):v&32?(wn=11,32):(D=192&v,D!==0?(wn=10,D):v&256?(wn=9,256):(D=3584&v,D!==0?(wn=8,D):v&4096?(wn=7,4096):(D=4186112&v,D!==0?(wn=6,D):(D=62914560&v,D!==0?(wn=5,D):v&67108864?(wn=4,67108864):v&134217728?(wn=3,134217728):(D=805306368&v,D!==0?(wn=2,D):1073741824&v?(wn=1,1073741824):(wn=8,v))))))}function LA(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function MA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(c(358,v))}}function ua(v,D){var Q=v.pendingLanes;if(Q===0)return wn=0;var H=0,V=0,ne=v.expiredLanes,Se=v.suspendedLanes,_e=v.pingedLanes;if(ne!==0)H=ne,V=wn=15;else if(ne=Q&134217727,ne!==0){var pt=ne&~Se;pt!==0?(H=ca(pt),V=wn):(_e&=ne,_e!==0&&(H=ca(_e),V=wn))}else ne=Q&~Se,ne!==0?(H=ca(ne),V=wn):_e!==0&&(H=ca(_e),V=wn);if(H===0)return 0;if(H=31-ns(H),H=Q&((0>H?0:1<<H)<<1)-1,D!==0&&D!==H&&!(D&Se)){if(ca(D),V<=wn)return D;wn=V}if(D=v.entangledLanes,D!==0)for(v=v.entanglements,D&=H;0<D;)Q=31-ns(D),V=1<<Q,H|=v[Q],D&=~V;return H}function Bl(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function Mt(v,D){switch(v){case 15:return 1;case 14:return 2;case 12:return v=kn(24&~D),v===0?Mt(10,D):v;case 10:return v=kn(192&~D),v===0?Mt(8,D):v;case 8:return v=kn(3584&~D),v===0&&(v=kn(4186112&~D),v===0&&(v=512)),v;case 2:return D=kn(805306368&~D),D===0&&(D=268435456),D}throw Error(c(358,v))}function kn(v){return v&-v}function fa(v){for(var D=[],Q=0;31>Q;Q++)D.push(v);return D}function Ha(v,D,Q){v.pendingLanes|=D;var H=D-1;v.suspendedLanes&=H,v.pingedLanes&=H,v=v.eventTimes,D=31-ns(D),v[D]=Q}var ns=Math.clz32?Math.clz32:uc,cc=Math.log,pu=Math.LN2;function uc(v){return v===0?32:31-(cc(v)/pu|0)|0}var ja=n.unstable_runWithPriority,Mi=n.unstable_scheduleCallback,Is=n.unstable_cancelCallback,vl=n.unstable_shouldYield,gf=n.unstable_requestPaint,fc=n.unstable_now,wi=n.unstable_getCurrentPriorityLevel,Qn=n.unstable_ImmediatePriority,Ac=n.unstable_UserBlockingPriority,Ke=n.unstable_NormalPriority,st=n.unstable_LowPriority,St=n.unstable_IdlePriority,lr={},te=gf!==void 0?gf:function(){},Ee=null,Oe=null,dt=!1,Et=fc(),bt=1e4>Et?fc:function(){return fc()-Et};function tr(){switch(wi()){case Qn:return 99;case Ac:return 98;case Ke:return 97;case st:return 96;case St:return 95;default:throw Error(c(332))}}function An(v){switch(v){case 99:return Qn;case 98:return Ac;case 97:return Ke;case 96:return st;case 95:return St;default:throw Error(c(332))}}function li(v,D){return v=An(v),ja(v,D)}function qi(v,D,Q){return v=An(v),Mi(v,D,Q)}function Tn(){if(Oe!==null){var v=Oe;Oe=null,Is(v)}Ga()}function Ga(){if(!dt&&Ee!==null){dt=!0;var v=0;try{var D=Ee;li(99,function(){for(;v<D.length;v++){var Q=D[v];do Q=Q(!0);while(Q!==null)}}),Ee=null}catch(Q){throw Ee!==null&&(Ee=Ee.slice(v+1)),Mi(Qn,Tn),Q}finally{dt=!1}}}var my=f.ReactCurrentBatchConfig;function Z1(v,D){return v===D&&(v!==0||1/v===1/D)||v!==v&&D!==D}var vo=typeof Object.is==\"function\"?Object.is:Z1,yy=Object.prototype.hasOwnProperty;function Eh(v,D){if(vo(v,D))return!0;if(typeof v!=\"object\"||v===null||typeof D!=\"object\"||D===null)return!1;var Q=Object.keys(v),H=Object.keys(D);if(Q.length!==H.length)return!1;for(H=0;H<Q.length;H++)if(!yy.call(D,Q[H])||!vo(v[Q[H]],D[Q[H]]))return!1;return!0}function $1(v){switch(v.tag){case 5:return oc(v.type);case 16:return oc(\"Lazy\");case 13:return oc(\"Suspense\");case 19:return oc(\"SuspenseList\");case 0:case 2:case 15:return v=Nt(v.type,!1),v;case 11:return v=Nt(v.type.render,!1),v;case 22:return v=Nt(v.type._render,!1),v;case 1:return v=Nt(v.type,!0),v;default:return\"\"}}function So(v,D){if(v&&v.defaultProps){D=s({},D),v=v.defaultProps;for(var Q in v)D[Q]===void 0&&(D[Q]=v[Q]);return D}return D}var Ih=no(null),Ch=null,hu=null,wh=null;function Fg(){wh=hu=Ch=null}function Ng(v,D){v=v.type._context,y?(xn(Ih,v._currentValue),v._currentValue=D):(xn(Ih,v._currentValue2),v._currentValue2=D)}function Og(v){var D=Ih.current;Rt(Ih),v=v.type._context,y?v._currentValue=D:v._currentValue2=D}function Ey(v,D){for(;v!==null;){var Q=v.alternate;if((v.childLanes&D)===D){if(Q===null||(Q.childLanes&D)===D)break;Q.childLanes|=D}else v.childLanes|=D,Q!==null&&(Q.childLanes|=D);v=v.return}}function df(v,D){Ch=v,wh=hu=null,v=v.dependencies,v!==null&&v.firstContext!==null&&(v.lanes&D&&(Je=!0),v.firstContext=null)}function Do(v,D){if(wh!==v&&D!==!1&&D!==0)if((typeof D!=\"number\"||D===1073741823)&&(wh=v,D=1073741823),D={context:v,observedBits:D,next:null},hu===null){if(Ch===null)throw Error(c(308));hu=D,Ch.dependencies={lanes:0,firstContext:D,responders:null}}else hu=hu.next=D;return y?v._currentValue:v._currentValue2}var Sl=!1;function Bh(v){v.updateQueue={baseState:v.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function Lg(v,D){v=v.updateQueue,D.updateQueue===v&&(D.updateQueue={baseState:v.baseState,firstBaseUpdate:v.firstBaseUpdate,lastBaseUpdate:v.lastBaseUpdate,shared:v.shared,effects:v.effects})}function Dl(v,D){return{eventTime:v,lane:D,tag:0,payload:null,callback:null,next:null}}function bl(v,D){if(v=v.updateQueue,v!==null){v=v.shared;var Q=v.pending;Q===null?D.next=D:(D.next=Q.next,Q.next=D),v.pending=D}}function Iy(v,D){var Q=v.updateQueue,H=v.alternate;if(H!==null&&(H=H.updateQueue,Q===H)){var V=null,ne=null;if(Q=Q.firstBaseUpdate,Q!==null){do{var Se={eventTime:Q.eventTime,lane:Q.lane,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null};ne===null?V=ne=Se:ne=ne.next=Se,Q=Q.next}while(Q!==null);ne===null?V=ne=D:ne=ne.next=D}else V=ne=D;Q={baseState:H.baseState,firstBaseUpdate:V,lastBaseUpdate:ne,shared:H.shared,effects:H.effects},v.updateQueue=Q;return}v=Q.lastBaseUpdate,v===null?Q.firstBaseUpdate=D:v.next=D,Q.lastBaseUpdate=D}function UA(v,D,Q,H){var V=v.updateQueue;Sl=!1;var ne=V.firstBaseUpdate,Se=V.lastBaseUpdate,_e=V.shared.pending;if(_e!==null){V.shared.pending=null;var pt=_e,Wt=pt.next;pt.next=null,Se===null?ne=Wt:Se.next=Wt,Se=pt;var Sr=v.alternate;if(Sr!==null){Sr=Sr.updateQueue;var Lr=Sr.lastBaseUpdate;Lr!==Se&&(Lr===null?Sr.firstBaseUpdate=Wt:Lr.next=Wt,Sr.lastBaseUpdate=pt)}}if(ne!==null){Lr=V.baseState,Se=0,Sr=Wt=pt=null;do{_e=ne.lane;var Zt=ne.eventTime;if((H&_e)===_e){Sr!==null&&(Sr=Sr.next={eventTime:Zt,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var zn=v,yi=ne;switch(_e=D,Zt=Q,yi.tag){case 1:if(zn=yi.payload,typeof zn==\"function\"){Lr=zn.call(Zt,Lr,_e);break e}Lr=zn;break e;case 3:zn.flags=zn.flags&-4097|64;case 0:if(zn=yi.payload,_e=typeof zn==\"function\"?zn.call(Zt,Lr,_e):zn,_e==null)break e;Lr=s({},Lr,_e);break e;case 2:Sl=!0}}ne.callback!==null&&(v.flags|=32,_e=V.effects,_e===null?V.effects=[ne]:_e.push(ne))}else Zt={eventTime:Zt,lane:_e,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Sr===null?(Wt=Sr=Zt,pt=Lr):Sr=Sr.next=Zt,Se|=_e;if(ne=ne.next,ne===null){if(_e=V.shared.pending,_e===null)break;ne=_e.next,_e.next=null,V.lastBaseUpdate=_e,V.shared.pending=null}}while(!0);Sr===null&&(pt=Lr),V.baseState=pt,V.firstBaseUpdate=Wt,V.lastBaseUpdate=Sr,Zg|=Se,v.lanes=Se,v.memoizedState=Lr}}function Cy(v,D,Q){if(v=D.effects,D.effects=null,v!==null)for(D=0;D<v.length;D++){var H=v[D],V=H.callback;if(V!==null){if(H.callback=null,H=Q,typeof V!=\"function\")throw Error(c(191,V));V.call(H)}}}var wy=new a.Component().refs;function _A(v,D,Q,H){D=v.memoizedState,Q=Q(H,D),Q=Q==null?D:s({},D,Q),v.memoizedState=Q,v.lanes===0&&(v.updateQueue.baseState=Q)}var HA={isMounted:function(v){return(v=v._reactInternals)?we(v)===v:!1},enqueueSetState:function(v,D,Q){v=v._reactInternals;var H=ko(),V=Bs(v),ne=Dl(H,V);ne.payload=D,Q!=null&&(ne.callback=Q),bl(v,ne),Tl(v,V,H)},enqueueReplaceState:function(v,D,Q){v=v._reactInternals;var H=ko(),V=Bs(v),ne=Dl(H,V);ne.tag=1,ne.payload=D,Q!=null&&(ne.callback=Q),bl(v,ne),Tl(v,V,H)},enqueueForceUpdate:function(v,D){v=v._reactInternals;var Q=ko(),H=Bs(v),V=Dl(Q,H);V.tag=2,D!=null&&(V.callback=D),bl(v,V),Tl(v,H,Q)}};function Y(v,D,Q,H,V,ne,Se){return v=v.stateNode,typeof v.shouldComponentUpdate==\"function\"?v.shouldComponentUpdate(H,ne,Se):D.prototype&&D.prototype.isPureReactComponent?!Eh(Q,H)||!Eh(V,ne):!0}function xt(v,D,Q){var H=!1,V=la,ne=D.contextType;return typeof ne==\"object\"&&ne!==null?ne=Do(ne):(V=Kn(D)?Na:Gi.current,H=D.contextTypes,ne=(H=H!=null)?dn(v,V):la),D=new D(Q,ne),v.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,D.updater=HA,v.stateNode=D,D._reactInternals=v,H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=V,v.__reactInternalMemoizedMaskedChildContext=ne),D}function jA(v,D,Q,H){v=D.state,typeof D.componentWillReceiveProps==\"function\"&&D.componentWillReceiveProps(Q,H),typeof D.UNSAFE_componentWillReceiveProps==\"function\"&&D.UNSAFE_componentWillReceiveProps(Q,H),D.state!==v&&HA.enqueueReplaceState(D,D.state,null)}function bo(v,D,Q,H){var V=v.stateNode;V.props=Q,V.state=v.memoizedState,V.refs=wy,Bh(v);var ne=D.contextType;typeof ne==\"object\"&&ne!==null?V.context=Do(ne):(ne=Kn(D)?Na:Gi.current,V.context=dn(v,ne)),UA(v,Q,V,H),V.state=v.memoizedState,ne=D.getDerivedStateFromProps,typeof ne==\"function\"&&(_A(v,D,ne,Q),V.state=v.memoizedState),typeof D.getDerivedStateFromProps==\"function\"||typeof V.getSnapshotBeforeUpdate==\"function\"||typeof V.UNSAFE_componentWillMount!=\"function\"&&typeof V.componentWillMount!=\"function\"||(D=V.state,typeof V.componentWillMount==\"function\"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount==\"function\"&&V.UNSAFE_componentWillMount(),D!==V.state&&HA.enqueueReplaceState(V,V.state,null),UA(v,Q,V,H),V.state=v.memoizedState),typeof V.componentDidMount==\"function\"&&(v.flags|=4)}var mf=Array.isArray;function yt(v,D,Q){if(v=Q.ref,v!==null&&typeof v!=\"function\"&&typeof v!=\"object\"){if(Q._owner){if(Q=Q._owner,Q){if(Q.tag!==1)throw Error(c(309));var H=Q.stateNode}if(!H)throw Error(c(147,v));var V=\"\"+v;return D!==null&&D.ref!==null&&typeof D.ref==\"function\"&&D.ref._stringRef===V?D.ref:(D=function(ne){var Se=H.refs;Se===wy&&(Se=H.refs={}),ne===null?delete Se[V]:Se[V]=ne},D._stringRef=V,D)}if(typeof v!=\"string\")throw Error(c(284));if(!Q._owner)throw Error(c(290,v))}return v}function gu(v,D){if(v.type!==\"textarea\")throw Error(c(31,Object.prototype.toString.call(D)===\"[object Object]\"?\"object with keys {\"+Object.keys(D).join(\", \")+\"}\":D))}function By(v){function D(et,qe){if(v){var gt=et.lastEffect;gt!==null?(gt.nextEffect=qe,et.lastEffect=qe):et.firstEffect=et.lastEffect=qe,qe.nextEffect=null,qe.flags=8}}function Q(et,qe){if(!v)return null;for(;qe!==null;)D(et,qe),qe=qe.sibling;return null}function H(et,qe){for(et=new Map;qe!==null;)qe.key!==null?et.set(qe.key,qe):et.set(qe.index,qe),qe=qe.sibling;return et}function V(et,qe){return et=Su(et,qe),et.index=0,et.sibling=null,et}function ne(et,qe,gt){return et.index=gt,v?(gt=et.alternate,gt!==null?(gt=gt.index,gt<qe?(et.flags=2,qe):gt):(et.flags=2,qe)):qe}function Se(et){return v&&et.alternate===null&&(et.flags=2),et}function _e(et,qe,gt,Xt){return qe===null||qe.tag!==6?(qe=b2(gt,et.mode,Xt),qe.return=et,qe):(qe=V(qe,gt),qe.return=et,qe)}function pt(et,qe,gt,Xt){return qe!==null&&qe.elementType===gt.type?(Xt=V(qe,gt.props),Xt.ref=yt(et,qe,gt),Xt.return=et,Xt):(Xt=sd(gt.type,gt.key,gt.props,null,et.mode,Xt),Xt.ref=yt(et,qe,gt),Xt.return=et,Xt)}function Wt(et,qe,gt,Xt){return qe===null||qe.tag!==4||qe.stateNode.containerInfo!==gt.containerInfo||qe.stateNode.implementation!==gt.implementation?(qe=Qo(gt,et.mode,Xt),qe.return=et,qe):(qe=V(qe,gt.children||[]),qe.return=et,qe)}function Sr(et,qe,gt,Xt,Dr){return qe===null||qe.tag!==7?(qe=kf(gt,et.mode,Xt,Dr),qe.return=et,qe):(qe=V(qe,gt),qe.return=et,qe)}function Lr(et,qe,gt){if(typeof qe==\"string\"||typeof qe==\"number\")return qe=b2(\"\"+qe,et.mode,gt),qe.return=et,qe;if(typeof qe==\"object\"&&qe!==null){switch(qe.$$typeof){case p:return gt=sd(qe.type,qe.key,qe.props,null,et.mode,gt),gt.ref=yt(et,null,qe),gt.return=et,gt;case h:return qe=Qo(qe,et.mode,gt),qe.return=et,qe}if(mf(qe)||Ce(qe))return qe=kf(qe,et.mode,gt,null),qe.return=et,qe;gu(et,qe)}return null}function Zt(et,qe,gt,Xt){var Dr=qe!==null?qe.key:null;if(typeof gt==\"string\"||typeof gt==\"number\")return Dr!==null?null:_e(et,qe,\"\"+gt,Xt);if(typeof gt==\"object\"&&gt!==null){switch(gt.$$typeof){case p:return gt.key===Dr?gt.type===E?Sr(et,qe,gt.props.children,Xt,Dr):pt(et,qe,gt,Xt):null;case h:return gt.key===Dr?Wt(et,qe,gt,Xt):null}if(mf(gt)||Ce(gt))return Dr!==null?null:Sr(et,qe,gt,Xt,null);gu(et,gt)}return null}function zn(et,qe,gt,Xt,Dr){if(typeof Xt==\"string\"||typeof Xt==\"number\")return et=et.get(gt)||null,_e(qe,et,\"\"+Xt,Dr);if(typeof Xt==\"object\"&&Xt!==null){switch(Xt.$$typeof){case p:return et=et.get(Xt.key===null?gt:Xt.key)||null,Xt.type===E?Sr(qe,et,Xt.props.children,Dr,Xt.key):pt(qe,et,Xt,Dr);case h:return et=et.get(Xt.key===null?gt:Xt.key)||null,Wt(qe,et,Xt,Dr)}if(mf(Xt)||Ce(Xt))return et=et.get(gt)||null,Sr(qe,et,Xt,Dr,null);gu(qe,Xt)}return null}function yi(et,qe,gt,Xt){for(var Dr=null,Zn=null,kr=qe,Rn=qe=0,_n=null;kr!==null&&Rn<gt.length;Rn++){kr.index>Rn?(_n=kr,kr=null):_n=kr.sibling;var zr=Zt(et,kr,gt[Rn],Xt);if(zr===null){kr===null&&(kr=_n);break}v&&kr&&zr.alternate===null&&D(et,kr),qe=ne(zr,qe,Rn),Zn===null?Dr=zr:Zn.sibling=zr,Zn=zr,kr=_n}if(Rn===gt.length)return Q(et,kr),Dr;if(kr===null){for(;Rn<gt.length;Rn++)kr=Lr(et,gt[Rn],Xt),kr!==null&&(qe=ne(kr,qe,Rn),Zn===null?Dr=kr:Zn.sibling=kr,Zn=kr);return Dr}for(kr=H(et,kr);Rn<gt.length;Rn++)_n=zn(kr,et,Rn,gt[Rn],Xt),_n!==null&&(v&&_n.alternate!==null&&kr.delete(_n.key===null?Rn:_n.key),qe=ne(_n,qe,Rn),Zn===null?Dr=_n:Zn.sibling=_n,Zn=_n);return v&&kr.forEach(function(ci){return D(et,ci)}),Dr}function za(et,qe,gt,Xt){var Dr=Ce(gt);if(typeof Dr!=\"function\")throw Error(c(150));if(gt=Dr.call(gt),gt==null)throw Error(c(151));for(var Zn=Dr=null,kr=qe,Rn=qe=0,_n=null,zr=gt.next();kr!==null&&!zr.done;Rn++,zr=gt.next()){kr.index>Rn?(_n=kr,kr=null):_n=kr.sibling;var ci=Zt(et,kr,zr.value,Xt);if(ci===null){kr===null&&(kr=_n);break}v&&kr&&ci.alternate===null&&D(et,kr),qe=ne(ci,qe,Rn),Zn===null?Dr=ci:Zn.sibling=ci,Zn=ci,kr=_n}if(zr.done)return Q(et,kr),Dr;if(kr===null){for(;!zr.done;Rn++,zr=gt.next())zr=Lr(et,zr.value,Xt),zr!==null&&(qe=ne(zr,qe,Rn),Zn===null?Dr=zr:Zn.sibling=zr,Zn=zr);return Dr}for(kr=H(et,kr);!zr.done;Rn++,zr=gt.next())zr=zn(kr,et,Rn,zr.value,Xt),zr!==null&&(v&&zr.alternate!==null&&kr.delete(zr.key===null?Rn:zr.key),qe=ne(zr,qe,Rn),Zn===null?Dr=zr:Zn.sibling=zr,Zn=zr);return v&&kr.forEach(function(Du){return D(et,Du)}),Dr}return function(et,qe,gt,Xt){var Dr=typeof gt==\"object\"&&gt!==null&&gt.type===E&&gt.key===null;Dr&&(gt=gt.props.children);var Zn=typeof gt==\"object\"&&gt!==null;if(Zn)switch(gt.$$typeof){case p:e:{for(Zn=gt.key,Dr=qe;Dr!==null;){if(Dr.key===Zn){switch(Dr.tag){case 7:if(gt.type===E){Q(et,Dr.sibling),qe=V(Dr,gt.props.children),qe.return=et,et=qe;break e}break;default:if(Dr.elementType===gt.type){Q(et,Dr.sibling),qe=V(Dr,gt.props),qe.ref=yt(et,Dr,gt),qe.return=et,et=qe;break e}}Q(et,Dr);break}else D(et,Dr);Dr=Dr.sibling}gt.type===E?(qe=kf(gt.props.children,et.mode,Xt,gt.key),qe.return=et,et=qe):(Xt=sd(gt.type,gt.key,gt.props,null,et.mode,Xt),Xt.ref=yt(et,qe,gt),Xt.return=et,et=Xt)}return Se(et);case h:e:{for(Dr=gt.key;qe!==null;){if(qe.key===Dr)if(qe.tag===4&&qe.stateNode.containerInfo===gt.containerInfo&&qe.stateNode.implementation===gt.implementation){Q(et,qe.sibling),qe=V(qe,gt.children||[]),qe.return=et,et=qe;break e}else{Q(et,qe);break}else D(et,qe);qe=qe.sibling}qe=Qo(gt,et.mode,Xt),qe.return=et,et=qe}return Se(et)}if(typeof gt==\"string\"||typeof gt==\"number\")return gt=\"\"+gt,qe!==null&&qe.tag===6?(Q(et,qe.sibling),qe=V(qe,gt),qe.return=et,et=qe):(Q(et,qe),qe=b2(gt,et.mode,Xt),qe.return=et,et=qe),Se(et);if(mf(gt))return yi(et,qe,gt,Xt);if(Ce(gt))return za(et,qe,gt,Xt);if(Zn&&gu(et,gt),typeof gt>\"u\"&&!Dr)switch(et.tag){case 1:case 22:case 0:case 11:case 15:throw Error(c(152,g(et.type)||\"Component\"))}return Q(et,qe)}}var Mg=By(!0),e2=By(!1),vh={},ur=no(vh),zi=no(vh),yf=no(vh);function qa(v){if(v===vh)throw Error(c(174));return v}function Ug(v,D){xn(yf,D),xn(zi,v),xn(ur,vh),v=mt(D),Rt(ur),xn(ur,v)}function du(){Rt(ur),Rt(zi),Rt(yf)}function Ef(v){var D=qa(yf.current),Q=qa(ur.current);D=j(Q,v.type,D),Q!==D&&(xn(zi,v),xn(ur,D))}function wt(v){zi.current===v&&(Rt(ur),Rt(zi))}var di=no(0);function GA(v){for(var D=v;D!==null;){if(D.tag===13){var Q=D.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||gr(Q)||Bo(Q)))return D}else if(D.tag===19&&D.memoizedProps.revealOrder!==void 0){if(D.flags&64)return D}else if(D.child!==null){D.child.return=D,D=D.child;continue}if(D===v)break;for(;D.sibling===null;){if(D.return===null||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}return null}var Wa=null,Aa=null,Ya=!1;function _g(v,D){var Q=Ka(5,null,null,0);Q.elementType=\"DELETED\",Q.type=\"DELETED\",Q.stateNode=D,Q.return=v,Q.flags=8,v.lastEffect!==null?(v.lastEffect.nextEffect=Q,v.lastEffect=Q):v.firstEffect=v.lastEffect=Q}function Sh(v,D){switch(v.tag){case 5:return D=aa(D,v.type,v.pendingProps),D!==null?(v.stateNode=D,!0):!1;case 6:return D=FA(D,v.pendingProps),D!==null?(v.stateNode=D,!0):!1;case 13:return!1;default:return!1}}function Hg(v){if(Ya){var D=Aa;if(D){var Q=D;if(!Sh(v,D)){if(D=Me(Q),!D||!Sh(v,D)){v.flags=v.flags&-1025|2,Ya=!1,Wa=v;return}_g(Wa,Q)}Wa=v,Aa=cu(D)}else v.flags=v.flags&-1025|2,Ya=!1,Wa=v}}function vy(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;Wa=v}function qA(v){if(!X||v!==Wa)return!1;if(!Ya)return vy(v),Ya=!0,!1;var D=v.type;if(v.tag!==5||D!==\"head\"&&D!==\"body\"&&!it(D,v.memoizedProps))for(D=Aa;D;)_g(v,D),D=Me(D);if(vy(v),v.tag===13){if(!X)throw Error(c(316));if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(c(317));Aa=NA(v)}else Aa=Wa?Me(v.stateNode):null;return!0}function jg(){X&&(Aa=Wa=null,Ya=!1)}var mu=[];function yu(){for(var v=0;v<mu.length;v++){var D=mu[v];y?D._workInProgressVersionPrimary=null:D._workInProgressVersionSecondary=null}mu.length=0}var If=f.ReactCurrentDispatcher,Rs=f.ReactCurrentBatchConfig,Eu=0,Gn=null,is=null,Pi=null,WA=!1,Cf=!1;function mn(){throw Error(c(321))}function Gg(v,D){if(D===null)return!1;for(var Q=0;Q<D.length&&Q<v.length;Q++)if(!vo(v[Q],D[Q]))return!1;return!0}function qg(v,D,Q,H,V,ne){if(Eu=ne,Gn=D,D.memoizedState=null,D.updateQueue=null,D.lanes=0,If.current=v===null||v.memoizedState===null?O:K,v=Q(H,V),Cf){ne=0;do{if(Cf=!1,!(25>ne))throw Error(c(301));ne+=1,Pi=is=null,D.updateQueue=null,If.current=re,v=Q(H,V)}while(Cf)}if(If.current=kt,D=is!==null&&is.next!==null,Eu=0,Pi=is=Gn=null,WA=!1,D)throw Error(c(300));return v}function ss(){var v={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pi===null?Gn.memoizedState=Pi=v:Pi=Pi.next=v,Pi}function Pl(){if(is===null){var v=Gn.alternate;v=v!==null?v.memoizedState:null}else v=is.next;var D=Pi===null?Gn.memoizedState:Pi.next;if(D!==null)Pi=D,is=v;else{if(v===null)throw Error(c(310));is=v,v={memoizedState:is.memoizedState,baseState:is.baseState,baseQueue:is.baseQueue,queue:is.queue,next:null},Pi===null?Gn.memoizedState=Pi=v:Pi=Pi.next=v}return Pi}function Po(v,D){return typeof D==\"function\"?D(v):D}function wf(v){var D=Pl(),Q=D.queue;if(Q===null)throw Error(c(311));Q.lastRenderedReducer=v;var H=is,V=H.baseQueue,ne=Q.pending;if(ne!==null){if(V!==null){var Se=V.next;V.next=ne.next,ne.next=Se}H.baseQueue=V=ne,Q.pending=null}if(V!==null){V=V.next,H=H.baseState;var _e=Se=ne=null,pt=V;do{var Wt=pt.lane;if((Eu&Wt)===Wt)_e!==null&&(_e=_e.next={lane:0,action:pt.action,eagerReducer:pt.eagerReducer,eagerState:pt.eagerState,next:null}),H=pt.eagerReducer===v?pt.eagerState:v(H,pt.action);else{var Sr={lane:Wt,action:pt.action,eagerReducer:pt.eagerReducer,eagerState:pt.eagerState,next:null};_e===null?(Se=_e=Sr,ne=H):_e=_e.next=Sr,Gn.lanes|=Wt,Zg|=Wt}pt=pt.next}while(pt!==null&&pt!==V);_e===null?ne=H:_e.next=Se,vo(H,D.memoizedState)||(Je=!0),D.memoizedState=H,D.baseState=ne,D.baseQueue=_e,Q.lastRenderedState=H}return[D.memoizedState,Q.dispatch]}function Bf(v){var D=Pl(),Q=D.queue;if(Q===null)throw Error(c(311));Q.lastRenderedReducer=v;var H=Q.dispatch,V=Q.pending,ne=D.memoizedState;if(V!==null){Q.pending=null;var Se=V=V.next;do ne=v(ne,Se.action),Se=Se.next;while(Se!==V);vo(ne,D.memoizedState)||(Je=!0),D.memoizedState=ne,D.baseQueue===null&&(D.baseState=ne),Q.lastRenderedState=ne}return[ne,H]}function xl(v,D,Q){var H=D._getVersion;H=H(D._source);var V=y?D._workInProgressVersionPrimary:D._workInProgressVersionSecondary;if(V!==null?v=V===H:(v=v.mutableReadLanes,(v=(Eu&v)===v)&&(y?D._workInProgressVersionPrimary=H:D._workInProgressVersionSecondary=H,mu.push(D))),v)return Q(D._source);throw mu.push(D),Error(c(350))}function yn(v,D,Q,H){var V=so;if(V===null)throw Error(c(349));var ne=D._getVersion,Se=ne(D._source),_e=If.current,pt=_e.useState(function(){return xl(V,D,Q)}),Wt=pt[1],Sr=pt[0];pt=Pi;var Lr=v.memoizedState,Zt=Lr.refs,zn=Zt.getSnapshot,yi=Lr.source;Lr=Lr.subscribe;var za=Gn;return v.memoizedState={refs:Zt,source:D,subscribe:H},_e.useEffect(function(){Zt.getSnapshot=Q,Zt.setSnapshot=Wt;var et=ne(D._source);if(!vo(Se,et)){et=Q(D._source),vo(Sr,et)||(Wt(et),et=Bs(za),V.mutableReadLanes|=et&V.pendingLanes),et=V.mutableReadLanes,V.entangledLanes|=et;for(var qe=V.entanglements,gt=et;0<gt;){var Xt=31-ns(gt),Dr=1<<Xt;qe[Xt]|=et,gt&=~Dr}}},[Q,D,H]),_e.useEffect(function(){return H(D._source,function(){var et=Zt.getSnapshot,qe=Zt.setSnapshot;try{qe(et(D._source));var gt=Bs(za);V.mutableReadLanes|=gt&V.pendingLanes}catch(Xt){qe(function(){throw Xt})}})},[D,H]),vo(zn,Q)&&vo(yi,D)&&vo(Lr,H)||(v={pending:null,dispatch:null,lastRenderedReducer:Po,lastRenderedState:Sr},v.dispatch=Wt=xh.bind(null,Gn,v),pt.queue=v,pt.baseQueue=null,Sr=xl(V,D,Q),pt.memoizedState=pt.baseState=Sr),Sr}function xo(v,D,Q){var H=Pl();return yn(H,v,D,Q)}function Iu(v){var D=ss();return typeof v==\"function\"&&(v=v()),D.memoizedState=D.baseState=v,v=D.queue={pending:null,dispatch:null,lastRenderedReducer:Po,lastRenderedState:v},v=v.dispatch=xh.bind(null,Gn,v),[D.memoizedState,v]}function pa(v,D,Q,H){return v={tag:v,create:D,destroy:Q,deps:H,next:null},D=Gn.updateQueue,D===null?(D={lastEffect:null},Gn.updateQueue=D,D.lastEffect=v.next=v):(Q=D.lastEffect,Q===null?D.lastEffect=v.next=v:(H=Q.next,Q.next=v,v.next=H,D.lastEffect=v)),v}function Fs(v){var D=ss();return v={current:v},D.memoizedState=v}function Dh(){return Pl().memoizedState}function YA(v,D,Q,H){var V=ss();Gn.flags|=v,V.memoizedState=pa(1|D,Q,void 0,H===void 0?null:H)}function vf(v,D,Q,H){var V=Pl();H=H===void 0?null:H;var ne=void 0;if(is!==null){var Se=is.memoizedState;if(ne=Se.destroy,H!==null&&Gg(H,Se.deps)){pa(D,Q,ne,H);return}}Gn.flags|=v,V.memoizedState=pa(1|D,Q,ne,H)}function io(v,D){return YA(516,4,v,D)}function Zr(v,D){return vf(516,4,v,D)}function bh(v,D){return vf(4,2,v,D)}function VA(v,D){if(typeof D==\"function\")return v=v(),D(v),function(){D(null)};if(D!=null)return v=v(),D.current=v,function(){D.current=null}}function Sy(v,D,Q){return Q=Q!=null?Q.concat([v]):null,vf(4,2,VA.bind(null,D,v),Q)}function Wg(){}function Ph(v,D){var Q=Pl();D=D===void 0?null:D;var H=Q.memoizedState;return H!==null&&D!==null&&Gg(D,H[1])?H[0]:(Q.memoizedState=[v,D],v)}function pc(v,D){var Q=Pl();D=D===void 0?null:D;var H=Q.memoizedState;return H!==null&&D!==null&&Gg(D,H[1])?H[0]:(v=v(),Q.memoizedState=[v,D],v)}function Dy(v,D){var Q=tr();li(98>Q?98:Q,function(){v(!0)}),li(97<Q?97:Q,function(){var H=Rs.transition;Rs.transition=1;try{v(!1),D()}finally{Rs.transition=H}})}function xh(v,D,Q){var H=ko(),V=Bs(v),ne={lane:V,action:Q,eagerReducer:null,eagerState:null,next:null},Se=D.pending;if(Se===null?ne.next=ne:(ne.next=Se.next,Se.next=ne),D.pending=ne,Se=v.alternate,v===Gn||Se!==null&&Se===Gn)Cf=WA=!0;else{if(v.lanes===0&&(Se===null||Se.lanes===0)&&(Se=D.lastRenderedReducer,Se!==null))try{var _e=D.lastRenderedState,pt=Se(_e,Q);if(ne.eagerReducer=Se,ne.eagerState=pt,vo(pt,_e))return}catch{}finally{}Tl(v,V,H)}}var kt={readContext:Do,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useOpaqueIdentifier:mn,unstable_isNewReconciler:!1},O={readContext:Do,useCallback:function(v,D){return ss().memoizedState=[v,D===void 0?null:D],v},useContext:Do,useEffect:io,useImperativeHandle:function(v,D,Q){return Q=Q!=null?Q.concat([v]):null,YA(4,2,VA.bind(null,D,v),Q)},useLayoutEffect:function(v,D){return YA(4,2,v,D)},useMemo:function(v,D){var Q=ss();return D=D===void 0?null:D,v=v(),Q.memoizedState=[v,D],v},useReducer:function(v,D,Q){var H=ss();return D=Q!==void 0?Q(D):D,H.memoizedState=H.baseState=D,v=H.queue={pending:null,dispatch:null,lastRenderedReducer:v,lastRenderedState:D},v=v.dispatch=xh.bind(null,Gn,v),[H.memoizedState,v]},useRef:Fs,useState:Iu,useDebugValue:Wg,useDeferredValue:function(v){var D=Iu(v),Q=D[0],H=D[1];return io(function(){var V=Rs.transition;Rs.transition=1;try{H(v)}finally{Rs.transition=V}},[v]),Q},useTransition:function(){var v=Iu(!1),D=v[0];return v=Dy.bind(null,v[1]),Fs(v),[v,D]},useMutableSource:function(v,D,Q){var H=ss();return H.memoizedState={refs:{getSnapshot:D,setSnapshot:null},source:v,subscribe:Q},yn(H,v,D,Q)},useOpaqueIdentifier:function(){if(Ya){var v=!1,D=oe(function(){throw v||(v=!0,Q(xe())),Error(c(355))}),Q=Iu(D)[1];return!(Gn.mode&2)&&(Gn.flags|=516,pa(5,function(){Q(xe())},void 0,null)),D}return D=xe(),Iu(D),D},unstable_isNewReconciler:!1},K={readContext:Do,useCallback:Ph,useContext:Do,useEffect:Zr,useImperativeHandle:Sy,useLayoutEffect:bh,useMemo:pc,useReducer:wf,useRef:Dh,useState:function(){return wf(Po)},useDebugValue:Wg,useDeferredValue:function(v){var D=wf(Po),Q=D[0],H=D[1];return Zr(function(){var V=Rs.transition;Rs.transition=1;try{H(v)}finally{Rs.transition=V}},[v]),Q},useTransition:function(){var v=wf(Po)[0];return[Dh().current,v]},useMutableSource:xo,useOpaqueIdentifier:function(){return wf(Po)[0]},unstable_isNewReconciler:!1},re={readContext:Do,useCallback:Ph,useContext:Do,useEffect:Zr,useImperativeHandle:Sy,useLayoutEffect:bh,useMemo:pc,useReducer:Bf,useRef:Dh,useState:function(){return Bf(Po)},useDebugValue:Wg,useDeferredValue:function(v){var D=Bf(Po),Q=D[0],H=D[1];return Zr(function(){var V=Rs.transition;Rs.transition=1;try{H(v)}finally{Rs.transition=V}},[v]),Q},useTransition:function(){var v=Bf(Po)[0];return[Dh().current,v]},useMutableSource:xo,useOpaqueIdentifier:function(){return Bf(Po)[0]},unstable_isNewReconciler:!1},de=f.ReactCurrentOwner,Je=!1;function At(v,D,Q,H){D.child=v===null?e2(D,null,Q,H):Mg(D,v.child,Q,H)}function dr(v,D,Q,H,V){Q=Q.render;var ne=D.ref;return df(D,V),H=qg(v,D,Q,H,ne,V),v!==null&&!Je?(D.updateQueue=v.updateQueue,D.flags&=-517,v.lanes&=~V,qn(v,D,V)):(D.flags|=1,At(v,D,H,V),D.child)}function vr(v,D,Q,H,V,ne){if(v===null){var Se=Q.type;return typeof Se==\"function\"&&!S2(Se)&&Se.defaultProps===void 0&&Q.compare===null&&Q.defaultProps===void 0?(D.tag=15,D.type=Se,Un(v,D,Se,H,V,ne)):(v=sd(Q.type,null,H,D,D.mode,ne),v.ref=D.ref,v.return=D,D.child=v)}return Se=v.child,!(V&ne)&&(V=Se.memoizedProps,Q=Q.compare,Q=Q!==null?Q:Eh,Q(V,H)&&v.ref===D.ref)?qn(v,D,ne):(D.flags|=1,v=Su(Se,H),v.ref=D.ref,v.return=D,D.child=v)}function Un(v,D,Q,H,V,ne){if(v!==null&&Eh(v.memoizedProps,H)&&v.ref===D.ref)if(Je=!1,(ne&V)!==0)v.flags&16384&&(Je=!0);else return D.lanes=v.lanes,qn(v,D,ne);return JA(v,D,Q,H,ne)}function mi(v,D,Q){var H=D.pendingProps,V=H.children,ne=v!==null?v.memoizedState:null;if(H.mode===\"hidden\"||H.mode===\"unstable-defer-without-hiding\")if(!(D.mode&4))D.memoizedState={baseLanes:0},qy(D,Q);else if(Q&1073741824)D.memoizedState={baseLanes:0},qy(D,ne!==null?ne.baseLanes:Q);else return v=ne!==null?ne.baseLanes|Q:Q,D.lanes=D.childLanes=1073741824,D.memoizedState={baseLanes:v},qy(D,v),null;else ne!==null?(H=ne.baseLanes|Q,D.memoizedState=null):H=Q,qy(D,H);return At(v,D,V,Q),D.child}function Cs(v,D){var Q=D.ref;(v===null&&Q!==null||v!==null&&v.ref!==Q)&&(D.flags|=128)}function JA(v,D,Q,H,V){var ne=Kn(Q)?Na:Gi.current;return ne=dn(D,ne),df(D,V),Q=qg(v,D,Q,H,ne,V),v!==null&&!Je?(D.updateQueue=v.updateQueue,D.flags&=-517,v.lanes&=~V,qn(v,D,V)):(D.flags|=1,At(v,D,Q,V),D.child)}function lP(v,D,Q,H,V){if(Kn(Q)){var ne=!0;La(D)}else ne=!1;if(df(D,V),D.stateNode===null)v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),xt(D,Q,H),bo(D,Q,H,V),H=!0;else if(v===null){var Se=D.stateNode,_e=D.memoizedProps;Se.props=_e;var pt=Se.context,Wt=Q.contextType;typeof Wt==\"object\"&&Wt!==null?Wt=Do(Wt):(Wt=Kn(Q)?Na:Gi.current,Wt=dn(D,Wt));var Sr=Q.getDerivedStateFromProps,Lr=typeof Sr==\"function\"||typeof Se.getSnapshotBeforeUpdate==\"function\";Lr||typeof Se.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof Se.componentWillReceiveProps!=\"function\"||(_e!==H||pt!==Wt)&&jA(D,Se,H,Wt),Sl=!1;var Zt=D.memoizedState;Se.state=Zt,UA(D,H,Se,V),pt=D.memoizedState,_e!==H||Zt!==pt||Li.current||Sl?(typeof Sr==\"function\"&&(_A(D,Q,Sr,H),pt=D.memoizedState),(_e=Sl||Y(D,Q,_e,H,Zt,pt,Wt))?(Lr||typeof Se.UNSAFE_componentWillMount!=\"function\"&&typeof Se.componentWillMount!=\"function\"||(typeof Se.componentWillMount==\"function\"&&Se.componentWillMount(),typeof Se.UNSAFE_componentWillMount==\"function\"&&Se.UNSAFE_componentWillMount()),typeof Se.componentDidMount==\"function\"&&(D.flags|=4)):(typeof Se.componentDidMount==\"function\"&&(D.flags|=4),D.memoizedProps=H,D.memoizedState=pt),Se.props=H,Se.state=pt,Se.context=Wt,H=_e):(typeof Se.componentDidMount==\"function\"&&(D.flags|=4),H=!1)}else{Se=D.stateNode,Lg(v,D),_e=D.memoizedProps,Wt=D.type===D.elementType?_e:So(D.type,_e),Se.props=Wt,Lr=D.pendingProps,Zt=Se.context,pt=Q.contextType,typeof pt==\"object\"&&pt!==null?pt=Do(pt):(pt=Kn(Q)?Na:Gi.current,pt=dn(D,pt));var zn=Q.getDerivedStateFromProps;(Sr=typeof zn==\"function\"||typeof Se.getSnapshotBeforeUpdate==\"function\")||typeof Se.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof Se.componentWillReceiveProps!=\"function\"||(_e!==Lr||Zt!==pt)&&jA(D,Se,H,pt),Sl=!1,Zt=D.memoizedState,Se.state=Zt,UA(D,H,Se,V);var yi=D.memoizedState;_e!==Lr||Zt!==yi||Li.current||Sl?(typeof zn==\"function\"&&(_A(D,Q,zn,H),yi=D.memoizedState),(Wt=Sl||Y(D,Q,Wt,H,Zt,yi,pt))?(Sr||typeof Se.UNSAFE_componentWillUpdate!=\"function\"&&typeof Se.componentWillUpdate!=\"function\"||(typeof Se.componentWillUpdate==\"function\"&&Se.componentWillUpdate(H,yi,pt),typeof Se.UNSAFE_componentWillUpdate==\"function\"&&Se.UNSAFE_componentWillUpdate(H,yi,pt)),typeof Se.componentDidUpdate==\"function\"&&(D.flags|=4),typeof Se.getSnapshotBeforeUpdate==\"function\"&&(D.flags|=256)):(typeof Se.componentDidUpdate!=\"function\"||_e===v.memoizedProps&&Zt===v.memoizedState||(D.flags|=4),typeof Se.getSnapshotBeforeUpdate!=\"function\"||_e===v.memoizedProps&&Zt===v.memoizedState||(D.flags|=256),D.memoizedProps=H,D.memoizedState=yi),Se.props=H,Se.state=yi,Se.context=pt,H=Wt):(typeof Se.componentDidUpdate!=\"function\"||_e===v.memoizedProps&&Zt===v.memoizedState||(D.flags|=4),typeof Se.getSnapshotBeforeUpdate!=\"function\"||_e===v.memoizedProps&&Zt===v.memoizedState||(D.flags|=256),H=!1)}return t2(v,D,Q,H,ne,V)}function t2(v,D,Q,H,V,ne){Cs(v,D);var Se=(D.flags&64)!==0;if(!H&&!Se)return V&&Ma(D,Q,!1),qn(v,D,ne);H=D.stateNode,de.current=D;var _e=Se&&typeof Q.getDerivedStateFromError!=\"function\"?null:H.render();return D.flags|=1,v!==null&&Se?(D.child=Mg(D,v.child,null,ne),D.child=Mg(D,null,_e,ne)):At(v,D,_e,ne),D.memoizedState=H.state,V&&Ma(D,Q,!0),D.child}function by(v){var D=v.stateNode;D.pendingContext?yh(v,D.pendingContext,D.pendingContext!==D.context):D.context&&yh(v,D.context,!1),Ug(v,D.containerInfo)}var kh={dehydrated:null,retryLane:0};function r2(v,D,Q){var H=D.pendingProps,V=di.current,ne=!1,Se;return(Se=(D.flags&64)!==0)||(Se=v!==null&&v.memoizedState===null?!1:(V&2)!==0),Se?(ne=!0,D.flags&=-65):v!==null&&v.memoizedState===null||H.fallback===void 0||H.unstable_avoidThisFallback===!0||(V|=1),xn(di,V&1),v===null?(H.fallback!==void 0&&Hg(D),v=H.children,V=H.fallback,ne?(v=Va(D,v,V,Q),D.child.memoizedState={baseLanes:Q},D.memoizedState=kh,v):typeof H.unstable_expectedLoadTime==\"number\"?(v=Va(D,v,V,Q),D.child.memoizedState={baseLanes:Q},D.memoizedState=kh,D.lanes=33554432,v):(Q=D2({mode:\"visible\",children:v},D.mode,Q,null),Q.return=D,D.child=Q)):v.memoizedState!==null?ne?(H=KA(v,D,H.children,H.fallback,Q),ne=D.child,V=v.child.memoizedState,ne.memoizedState=V===null?{baseLanes:Q}:{baseLanes:V.baseLanes|Q},ne.childLanes=v.childLanes&~Q,D.memoizedState=kh,H):(Q=n2(v,D,H.children,Q),D.memoizedState=null,Q):ne?(H=KA(v,D,H.children,H.fallback,Q),ne=D.child,V=v.child.memoizedState,ne.memoizedState=V===null?{baseLanes:Q}:{baseLanes:V.baseLanes|Q},ne.childLanes=v.childLanes&~Q,D.memoizedState=kh,H):(Q=n2(v,D,H.children,Q),D.memoizedState=null,Q)}function Va(v,D,Q,H){var V=v.mode,ne=v.child;return D={mode:\"hidden\",children:D},!(V&2)&&ne!==null?(ne.childLanes=0,ne.pendingProps=D):ne=D2(D,V,0,null),Q=kf(Q,V,H,null),ne.return=v,Q.return=v,ne.sibling=Q,v.child=ne,Q}function n2(v,D,Q,H){var V=v.child;return v=V.sibling,Q=Su(V,{mode:\"visible\",children:Q}),!(D.mode&2)&&(Q.lanes=H),Q.return=D,Q.sibling=null,v!==null&&(v.nextEffect=null,v.flags=8,D.firstEffect=D.lastEffect=v),D.child=Q}function KA(v,D,Q,H,V){var ne=D.mode,Se=v.child;v=Se.sibling;var _e={mode:\"hidden\",children:Q};return!(ne&2)&&D.child!==Se?(Q=D.child,Q.childLanes=0,Q.pendingProps=_e,Se=Q.lastEffect,Se!==null?(D.firstEffect=Q.firstEffect,D.lastEffect=Se,Se.nextEffect=null):D.firstEffect=D.lastEffect=null):Q=Su(Se,_e),v!==null?H=Su(v,H):(H=kf(H,ne,V,null),H.flags|=2),H.return=D,Q.return=D,Q.sibling=H,D.child=Q,H}function Qh(v,D){v.lanes|=D;var Q=v.alternate;Q!==null&&(Q.lanes|=D),Ey(v.return,D)}function Py(v,D,Q,H,V,ne){var Se=v.memoizedState;Se===null?v.memoizedState={isBackwards:D,rendering:null,renderingStartTime:0,last:H,tail:Q,tailMode:V,lastEffect:ne}:(Se.isBackwards=D,Se.rendering=null,Se.renderingStartTime=0,Se.last=H,Se.tail=Q,Se.tailMode=V,Se.lastEffect=ne)}function cP(v,D,Q){var H=D.pendingProps,V=H.revealOrder,ne=H.tail;if(At(v,D,H.children,Q),H=di.current,H&2)H=H&1|2,D.flags|=64;else{if(v!==null&&v.flags&64)e:for(v=D.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&Qh(v,Q);else if(v.tag===19)Qh(v,Q);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===D)break e;for(;v.sibling===null;){if(v.return===null||v.return===D)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}H&=1}if(xn(di,H),!(D.mode&2))D.memoizedState=null;else switch(V){case\"forwards\":for(Q=D.child,V=null;Q!==null;)v=Q.alternate,v!==null&&GA(v)===null&&(V=Q),Q=Q.sibling;Q=V,Q===null?(V=D.child,D.child=null):(V=Q.sibling,Q.sibling=null),Py(D,!1,V,Q,ne,D.lastEffect);break;case\"backwards\":for(Q=null,V=D.child,D.child=null;V!==null;){if(v=V.alternate,v!==null&&GA(v)===null){D.child=V;break}v=V.sibling,V.sibling=Q,Q=V,V=v}Py(D,!0,Q,null,ne,D.lastEffect);break;case\"together\":Py(D,!1,null,null,void 0,D.lastEffect);break;default:D.memoizedState=null}return D.child}function qn(v,D,Q){if(v!==null&&(D.dependencies=v.dependencies),Zg|=D.lanes,Q&D.childLanes){if(v!==null&&D.child!==v.child)throw Error(c(153));if(D.child!==null){for(v=D.child,Q=Su(v,v.pendingProps),D.child=Q,Q.return=D;v.sibling!==null;)v=v.sibling,Q=Q.sibling=Su(v,v.pendingProps),Q.return=D;Q.sibling=null}return D.child}return null}function os(v){v.flags|=4}var kl,Ql,Cu,ha;if(F)kl=function(v,D){for(var Q=D.child;Q!==null;){if(Q.tag===5||Q.tag===6)Pe(v,Q.stateNode);else if(Q.tag!==4&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}},Ql=function(){},Cu=function(v,D,Q,H,V){if(v=v.memoizedProps,v!==H){var ne=D.stateNode,Se=qa(ur.current);Q=ke(ne,Q,v,H,V,Se),(D.updateQueue=Q)&&os(D)}},ha=function(v,D,Q,H){Q!==H&&os(D)};else if(z){kl=function(v,D,Q,H){for(var V=D.child;V!==null;){if(V.tag===5){var ne=V.stateNode;Q&&H&&(ne=RA(ne,V.type,V.memoizedProps,V)),Pe(v,ne)}else if(V.tag===6)ne=V.stateNode,Q&&H&&(ne=oa(ne,V.memoizedProps,V)),Pe(v,ne);else if(V.tag!==4){if(V.tag===13&&V.flags&4&&(ne=V.memoizedState!==null)){var Se=V.child;if(Se!==null&&(Se.child!==null&&(Se.child.return=Se,kl(v,Se,!0,ne)),ne=Se.sibling,ne!==null)){ne.return=V,V=ne;continue}}if(V.child!==null){V.child.return=V,V=V.child;continue}}if(V===D)break;for(;V.sibling===null;){if(V.return===null||V.return===D)return;V=V.return}V.sibling.return=V.return,V=V.sibling}};var zA=function(v,D,Q,H){for(var V=D.child;V!==null;){if(V.tag===5){var ne=V.stateNode;Q&&H&&(ne=RA(ne,V.type,V.memoizedProps,V)),au(v,ne)}else if(V.tag===6)ne=V.stateNode,Q&&H&&(ne=oa(ne,V.memoizedProps,V)),au(v,ne);else if(V.tag!==4){if(V.tag===13&&V.flags&4&&(ne=V.memoizedState!==null)){var Se=V.child;if(Se!==null&&(Se.child!==null&&(Se.child.return=Se,zA(v,Se,!0,ne)),ne=Se.sibling,ne!==null)){ne.return=V,V=ne;continue}}if(V.child!==null){V.child.return=V,V=V.child;continue}}if(V===D)break;for(;V.sibling===null;){if(V.return===null||V.return===D)return;V=V.return}V.sibling.return=V.return,V=V.sibling}};Ql=function(v){var D=v.stateNode;if(v.firstEffect!==null){var Q=D.containerInfo,H=ou(Q);zA(H,v,!1,!1),D.pendingChildren=H,os(v),lu(Q,H)}},Cu=function(v,D,Q,H,V){var ne=v.stateNode,Se=v.memoizedProps;if((v=D.firstEffect===null)&&Se===H)D.stateNode=ne;else{var _e=D.stateNode,pt=qa(ur.current),Wt=null;Se!==H&&(Wt=ke(_e,Q,Se,H,V,pt)),v&&Wt===null?D.stateNode=ne:(ne=ro(ne,Wt,Q,Se,H,D,v,_e),Ve(ne,Q,H,V,pt)&&os(D),D.stateNode=ne,v?os(D):kl(ne,D,!1,!1))}},ha=function(v,D,Q,H){Q!==H?(v=qa(yf.current),Q=qa(ur.current),D.stateNode=Ue(H,v,Q,D),os(D)):D.stateNode=v.stateNode}}else Ql=function(){},Cu=function(){},ha=function(){};function XA(v,D){if(!Ya)switch(v.tailMode){case\"hidden\":D=v.tail;for(var Q=null;D!==null;)D.alternate!==null&&(Q=D),D=D.sibling;Q===null?v.tail=null:Q.sibling=null;break;case\"collapsed\":Q=v.tail;for(var H=null;Q!==null;)Q.alternate!==null&&(H=Q),Q=Q.sibling;H===null?D||v.tail===null?v.tail=null:v.tail.sibling=null:H.sibling=null}}function jL(v,D,Q){var H=D.pendingProps;switch(D.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Kn(D.type)&&Au(),null;case 3:return du(),Rt(Li),Rt(Gi),yu(),H=D.stateNode,H.pendingContext&&(H.context=H.pendingContext,H.pendingContext=null),(v===null||v.child===null)&&(qA(D)?os(D):H.hydrate||(D.flags|=256)),Ql(D),null;case 5:wt(D);var V=qa(yf.current);if(Q=D.type,v!==null&&D.stateNode!=null)Cu(v,D,Q,H,V),v.ref!==D.ref&&(D.flags|=128);else{if(!H){if(D.stateNode===null)throw Error(c(166));return null}if(v=qa(ur.current),qA(D)){if(!X)throw Error(c(175));v=Cr(D.stateNode,D.type,D.memoizedProps,V,v,D),D.updateQueue=v,v!==null&&os(D)}else{var ne=Ne(Q,H,V,v,D);kl(ne,D,!1,!1),D.stateNode=ne,Ve(ne,Q,H,V,v)&&os(D)}D.ref!==null&&(D.flags|=128)}return null;case 6:if(v&&D.stateNode!=null)ha(v,D,v.memoizedProps,H);else{if(typeof H!=\"string\"&&D.stateNode===null)throw Error(c(166));if(v=qa(yf.current),V=qa(ur.current),qA(D)){if(!X)throw Error(c(176));pf(D.stateNode,D.memoizedProps,D)&&os(D)}else D.stateNode=Ue(H,v,V,D)}return null;case 13:return Rt(di),H=D.memoizedState,D.flags&64?(D.lanes=Q,D):(H=H!==null,V=!1,v===null?D.memoizedProps.fallback!==void 0&&qA(D):V=v.memoizedState!==null,H&&!V&&D.mode&2&&(v===null&&D.memoizedProps.unstable_avoidThisFallback!==!0||di.current&1?ws===0&&(ws=3):((ws===0||ws===3)&&(ws=4),so===null||!(Zg&134217727)&&!(Fh&134217727)||Nh(so,Ns))),z&&H&&(D.flags|=4),F&&(H||V)&&(D.flags|=4),null);case 4:return du(),Ql(D),v===null&&Ct(D.stateNode.containerInfo),null;case 10:return Og(D),null;case 17:return Kn(D.type)&&Au(),null;case 19:if(Rt(di),H=D.memoizedState,H===null)return null;if(V=(D.flags&64)!==0,ne=H.rendering,ne===null)if(V)XA(H,!1);else{if(ws!==0||v!==null&&v.flags&64)for(v=D.child;v!==null;){if(ne=GA(v),ne!==null){for(D.flags|=64,XA(H,!1),v=ne.updateQueue,v!==null&&(D.updateQueue=v,D.flags|=4),H.lastEffect===null&&(D.firstEffect=null),D.lastEffect=H.lastEffect,v=Q,H=D.child;H!==null;)V=H,Q=v,V.flags&=2,V.nextEffect=null,V.firstEffect=null,V.lastEffect=null,ne=V.alternate,ne===null?(V.childLanes=0,V.lanes=Q,V.child=null,V.memoizedProps=null,V.memoizedState=null,V.updateQueue=null,V.dependencies=null,V.stateNode=null):(V.childLanes=ne.childLanes,V.lanes=ne.lanes,V.child=ne.child,V.memoizedProps=ne.memoizedProps,V.memoizedState=ne.memoizedState,V.updateQueue=ne.updateQueue,V.type=ne.type,Q=ne.dependencies,V.dependencies=Q===null?null:{lanes:Q.lanes,firstContext:Q.firstContext}),H=H.sibling;return xn(di,di.current&1|2),D.child}v=v.sibling}H.tail!==null&&bt()>m2&&(D.flags|=64,V=!0,XA(H,!1),D.lanes=33554432)}else{if(!V)if(v=GA(ne),v!==null){if(D.flags|=64,V=!0,v=v.updateQueue,v!==null&&(D.updateQueue=v,D.flags|=4),XA(H,!0),H.tail===null&&H.tailMode===\"hidden\"&&!ne.alternate&&!Ya)return D=D.lastEffect=H.lastEffect,D!==null&&(D.nextEffect=null),null}else 2*bt()-H.renderingStartTime>m2&&Q!==1073741824&&(D.flags|=64,V=!0,XA(H,!1),D.lanes=33554432);H.isBackwards?(ne.sibling=D.child,D.child=ne):(v=H.last,v!==null?v.sibling=ne:D.child=ne,H.last=ne)}return H.tail!==null?(v=H.tail,H.rendering=v,H.tail=v.sibling,H.lastEffect=D.lastEffect,H.renderingStartTime=bt(),v.sibling=null,D=di.current,xn(di,V?D&1|2:D&1),v):null;case 23:case 24:return B2(),v!==null&&v.memoizedState!==null!=(D.memoizedState!==null)&&H.mode!==\"unstable-defer-without-hiding\"&&(D.flags|=4),null}throw Error(c(156,D.tag))}function qL(v){switch(v.tag){case 1:Kn(v.type)&&Au();var D=v.flags;return D&4096?(v.flags=D&-4097|64,v):null;case 3:if(du(),Rt(Li),Rt(Gi),yu(),D=v.flags,D&64)throw Error(c(285));return v.flags=D&-4097|64,v;case 5:return wt(v),null;case 13:return Rt(di),D=v.flags,D&4096?(v.flags=D&-4097|64,v):null;case 19:return Rt(di),null;case 4:return du(),null;case 10:return Og(v),null;case 23:case 24:return B2(),null;default:return null}}function Yg(v,D){try{var Q=\"\",H=D;do Q+=$1(H),H=H.return;while(H);var V=Q}catch(ne){V=`\nError generating stack: `+ne.message+`\n`+ne.stack}return{value:v,source:D,stack:V}}function Vg(v,D){try{console.error(D.value)}catch(Q){setTimeout(function(){throw Q})}}var WL=typeof WeakMap==\"function\"?WeakMap:Map;function i2(v,D,Q){Q=Dl(-1,Q),Q.tag=3,Q.payload={element:null};var H=D.value;return Q.callback=function(){_y||(_y=!0,y2=H),Vg(v,D)},Q}function Jg(v,D,Q){Q=Dl(-1,Q),Q.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H==\"function\"){var V=D.value;Q.payload=function(){return Vg(v,D),H(V)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch==\"function\"&&(Q.callback=function(){typeof H!=\"function\"&&(hc===null?hc=new Set([this]):hc.add(this),Vg(v,D));var Se=D.stack;this.componentDidCatch(D.value,{componentStack:Se!==null?Se:\"\"})}),Q}var YL=typeof WeakSet==\"function\"?WeakSet:Set;function s2(v){var D=v.ref;if(D!==null)if(typeof D==\"function\")try{D(null)}catch(Q){xf(v,Q)}else D.current=null}function xy(v,D){switch(D.tag){case 0:case 11:case 15:case 22:return;case 1:if(D.flags&256&&v!==null){var Q=v.memoizedProps,H=v.memoizedState;v=D.stateNode,D=v.getSnapshotBeforeUpdate(D.elementType===D.type?Q:So(D.type,Q),H),v.__reactInternalSnapshotBeforeUpdate=D}return;case 3:F&&D.flags&256&&Ts(D.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(c(163))}function Th(v,D){if(D=D.updateQueue,D=D!==null?D.lastEffect:null,D!==null){var Q=D=D.next;do{if((Q.tag&v)===v){var H=Q.destroy;Q.destroy=void 0,H!==void 0&&H()}Q=Q.next}while(Q!==D)}}function uP(v,D,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{if((v.tag&3)===3){var H=v.create;v.destroy=H()}v=v.next}while(v!==D)}if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{var V=v;H=V.next,V=V.tag,V&4&&V&1&&(vP(Q,v),tM(Q,v)),v=H}while(v!==D)}return;case 1:v=Q.stateNode,Q.flags&4&&(D===null?v.componentDidMount():(H=Q.elementType===Q.type?D.memoizedProps:So(Q.type,D.memoizedProps),v.componentDidUpdate(H,D.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),D=Q.updateQueue,D!==null&&Cy(Q,D,v);return;case 3:if(D=Q.updateQueue,D!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=Re(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Cy(Q,D,v)}return;case 5:v=Q.stateNode,D===null&&Q.flags&4&&$s(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:X&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&uu(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(c(163))}function fP(v,D){if(F)for(var Q=v;;){if(Q.tag===5){var H=Q.stateNode;D?dh(H):to(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)H=Q.stateNode,D?mh(H):jn(H,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function ky(v,D){if(Ua&&typeof Ua.onCommitFiberUnmount==\"function\")try{Ua.onCommitFiberUnmount($e,D)}catch{}switch(D.tag){case 0:case 11:case 14:case 15:case 22:if(v=D.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var H=Q,V=H.destroy;if(H=H.tag,V!==void 0)if(H&4)vP(D,Q);else{H=D;try{V()}catch(ne){xf(H,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(s2(D),v=D.stateNode,typeof v.componentWillUnmount==\"function\")try{v.props=D.memoizedProps,v.state=D.memoizedState,v.componentWillUnmount()}catch(ne){xf(D,ne)}break;case 5:s2(D);break;case 4:F?gP(v,D):z&&z&&(D=D.stateNode.containerInfo,v=ou(D),TA(D,v))}}function AP(v,D){for(var Q=D;;)if(ky(v,Q),Q.child===null||F&&Q.tag===4){if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Qy(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function pP(v){return v.tag===5||v.tag===3||v.tag===4}function hP(v){if(F){e:{for(var D=v.return;D!==null;){if(pP(D))break e;D=D.return}throw Error(c(160))}var Q=D;switch(D=Q.stateNode,Q.tag){case 5:var H=!1;break;case 3:D=D.containerInfo,H=!0;break;case 4:D=D.containerInfo,H=!0;break;default:throw Error(c(161))}Q.flags&16&&(Af(D),Q.flags&=-17);e:t:for(Q=v;;){for(;Q.sibling===null;){if(Q.return===null||pP(Q.return)){Q=null;break e}Q=Q.return}for(Q.sibling.return=Q.return,Q=Q.sibling;Q.tag!==5&&Q.tag!==6&&Q.tag!==18;){if(Q.flags&2||Q.child===null||Q.tag===4)continue t;Q.child.return=Q,Q=Q.child}if(!(Q.flags&2)){Q=Q.stateNode;break e}}H?o2(v,Q,D):a2(v,Q,D)}}function o2(v,D,Q){var H=v.tag,V=H===5||H===6;if(V)v=V?v.stateNode:v.stateNode.instance,D?eo(Q,v,D):Io(Q,v);else if(H!==4&&(v=v.child,v!==null))for(o2(v,D,Q),v=v.sibling;v!==null;)o2(v,D,Q),v=v.sibling}function a2(v,D,Q){var H=v.tag,V=H===5||H===6;if(V)v=V?v.stateNode:v.stateNode.instance,D?ji(Q,v,D):ai(Q,v);else if(H!==4&&(v=v.child,v!==null))for(a2(v,D,Q),v=v.sibling;v!==null;)a2(v,D,Q),v=v.sibling}function gP(v,D){for(var Q=D,H=!1,V,ne;;){if(!H){H=Q.return;e:for(;;){if(H===null)throw Error(c(160));switch(V=H.stateNode,H.tag){case 5:ne=!1;break e;case 3:V=V.containerInfo,ne=!0;break e;case 4:V=V.containerInfo,ne=!0;break e}H=H.return}H=!0}if(Q.tag===5||Q.tag===6)AP(v,Q),ne?QA(V,Q.stateNode):wo(V,Q.stateNode);else if(Q.tag===4){if(Q.child!==null){V=Q.stateNode.containerInfo,ne=!0,Q.child.return=Q,Q=Q.child;continue}}else if(ky(v,Q),Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return,Q.tag===4&&(H=!1)}Q.sibling.return=Q.return,Q=Q.sibling}}function l2(v,D){if(F){switch(D.tag){case 0:case 11:case 14:case 15:case 22:Th(3,D);return;case 1:return;case 5:var Q=D.stateNode;if(Q!=null){var H=D.memoizedProps;v=v!==null?v.memoizedProps:H;var V=D.type,ne=D.updateQueue;D.updateQueue=null,ne!==null&&Co(Q,ne,V,v,H,D)}return;case 6:if(D.stateNode===null)throw Error(c(162));Q=D.memoizedProps,rs(D.stateNode,v!==null?v.memoizedProps:Q,Q);return;case 3:X&&(D=D.stateNode,D.hydrate&&(D.hydrate=!1,OA(D.containerInfo)));return;case 12:return;case 13:dP(D),Kg(D);return;case 19:Kg(D);return;case 17:return;case 23:case 24:fP(D,D.memoizedState!==null);return}throw Error(c(163))}switch(D.tag){case 0:case 11:case 14:case 15:case 22:Th(3,D);return;case 12:return;case 13:dP(D),Kg(D);return;case 19:Kg(D);return;case 3:X&&(Q=D.stateNode,Q.hydrate&&(Q.hydrate=!1,OA(Q.containerInfo)));break;case 23:case 24:return}e:if(z){switch(D.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:D=D.stateNode,TA(D.containerInfo,D.pendingChildren);break e}throw Error(c(163))}}function dP(v){v.memoizedState!==null&&(d2=bt(),F&&fP(v.child,!0))}function Kg(v){var D=v.updateQueue;if(D!==null){v.updateQueue=null;var Q=v.stateNode;Q===null&&(Q=v.stateNode=new YL),D.forEach(function(H){var V=nM.bind(null,v,H);Q.has(H)||(Q.add(H),H.then(V,V))})}}function VL(v,D){return v!==null&&(v=v.memoizedState,v===null||v.dehydrated!==null)?(D=D.memoizedState,D!==null&&D.dehydrated===null):!1}var Ty=0,Ry=1,Fy=2,zg=3,Ny=4;if(typeof Symbol==\"function\"&&Symbol.for){var Xg=Symbol.for;Ty=Xg(\"selector.component\"),Ry=Xg(\"selector.has_pseudo_class\"),Fy=Xg(\"selector.role\"),zg=Xg(\"selector.test_id\"),Ny=Xg(\"selector.text\")}function Oy(v){var D=$(v);if(D!=null){if(typeof D.memoizedProps[\"data-testname\"]!=\"string\")throw Error(c(364));return D}if(v=ir(v),v===null)throw Error(c(362));return v.stateNode.current}function Sf(v,D){switch(D.$$typeof){case Ty:if(v.type===D.value)return!0;break;case Ry:e:{D=D.value,v=[v,0];for(var Q=0;Q<v.length;){var H=v[Q++],V=v[Q++],ne=D[V];if(H.tag!==5||!Pr(H)){for(;ne!=null&&Sf(H,ne);)V++,ne=D[V];if(V===D.length){D=!0;break e}else for(H=H.child;H!==null;)v.push(H,V),H=H.sibling}}D=!1}return D;case Fy:if(v.tag===5&&Ir(v.stateNode,D.value))return!0;break;case Ny:if((v.tag===5||v.tag===6)&&(v=gn(v),v!==null&&0<=v.indexOf(D.value)))return!0;break;case zg:if(v.tag===5&&(v=v.memoizedProps[\"data-testname\"],typeof v==\"string\"&&v.toLowerCase()===D.value.toLowerCase()))return!0;break;default:throw Error(c(365,D))}return!1}function Df(v){switch(v.$$typeof){case Ty:return\"<\"+(g(v.value)||\"Unknown\")+\">\";case Ry:return\":has(\"+(Df(v)||\"\")+\")\";case Fy:return'[role=\"'+v.value+'\"]';case Ny:return'\"'+v.value+'\"';case zg:return'[data-testname=\"'+v.value+'\"]';default:throw Error(c(365,v))}}function c2(v,D){var Q=[];v=[v,0];for(var H=0;H<v.length;){var V=v[H++],ne=v[H++],Se=D[ne];if(V.tag!==5||!Pr(V)){for(;Se!=null&&Sf(V,Se);)ne++,Se=D[ne];if(ne===D.length)Q.push(V);else for(V=V.child;V!==null;)v.push(V,ne),V=V.sibling}}return Q}function u2(v,D){if(!qt)throw Error(c(363));v=Oy(v),v=c2(v,D),D=[],v=Array.from(v);for(var Q=0;Q<v.length;){var H=v[Q++];if(H.tag===5)Pr(H)||D.push(H.stateNode);else for(H=H.child;H!==null;)v.push(H),H=H.sibling}return D}var Ly=null;function JL(v){if(Ly===null)try{var D=(\"require\"+Math.random()).slice(0,7);Ly=(jS&&jS[D]).call(jS,\"timers\").setImmediate}catch{Ly=function(H){var V=new MessageChannel;V.port1.onmessage=H,V.port2.postMessage(void 0)}}return Ly(v)}var KL=Math.ceil,My=f.ReactCurrentDispatcher,f2=f.ReactCurrentOwner,A2=f.IsSomeRendererActing,xr=0,so=null,Xi=null,Ns=0,ZA=0,p2=no(0),ws=0,Uy=null,Rh=0,Zg=0,Fh=0,h2=0,g2=null,d2=0,m2=1/0;function bf(){m2=bt()+500}var sr=null,_y=!1,y2=null,hc=null,Pf=!1,$g=null,ed=90,E2=[],I2=[],wu=null,td=0,C2=null,Hy=-1,Bu=0,jy=0,rd=null,nd=!1;function ko(){return xr&48?bt():Hy!==-1?Hy:Hy=bt()}function Bs(v){if(v=v.mode,!(v&2))return 1;if(!(v&4))return tr()===99?1:2;if(Bu===0&&(Bu=Rh),my.transition!==0){jy!==0&&(jy=g2!==null?g2.pendingLanes:0),v=Bu;var D=4186112&~jy;return D&=-D,D===0&&(v=4186112&~v,D=v&-v,D===0&&(D=8192)),D}return v=tr(),xr&4&&v===98?v=Mt(12,Bu):(v=LA(v),v=Mt(v,Bu)),v}function Tl(v,D,Q){if(50<td)throw td=0,C2=null,Error(c(185));if(v=Gy(v,D),v===null)return null;Ha(v,D,Q),v===so&&(Fh|=D,ws===4&&Nh(v,Ns));var H=tr();D===1?xr&8&&!(xr&48)?w2(v):(ga(v,Q),xr===0&&(bf(),Tn())):(!(xr&4)||H!==98&&H!==99||(wu===null?wu=new Set([v]):wu.add(v)),ga(v,Q)),g2=v}function Gy(v,D){v.lanes|=D;var Q=v.alternate;for(Q!==null&&(Q.lanes|=D),Q=v,v=v.return;v!==null;)v.childLanes|=D,Q=v.alternate,Q!==null&&(Q.childLanes|=D),Q=v,v=v.return;return Q.tag===3?Q.stateNode:null}function ga(v,D){for(var Q=v.callbackNode,H=v.suspendedLanes,V=v.pingedLanes,ne=v.expirationTimes,Se=v.pendingLanes;0<Se;){var _e=31-ns(Se),pt=1<<_e,Wt=ne[_e];if(Wt===-1){if(!(pt&H)||pt&V){Wt=D,ca(pt);var Sr=wn;ne[_e]=10<=Sr?Wt+250:6<=Sr?Wt+5e3:-1}}else Wt<=D&&(v.expiredLanes|=pt);Se&=~pt}if(H=ua(v,v===so?Ns:0),D=wn,H===0)Q!==null&&(Q!==lr&&Is(Q),v.callbackNode=null,v.callbackPriority=0);else{if(Q!==null){if(v.callbackPriority===D)return;Q!==lr&&Is(Q)}D===15?(Q=w2.bind(null,v),Ee===null?(Ee=[Q],Oe=Mi(Qn,Ga)):Ee.push(Q),Q=lr):D===14?Q=qi(99,w2.bind(null,v)):(Q=MA(D),Q=qi(Q,mP.bind(null,v))),v.callbackPriority=D,v.callbackNode=Q}}function mP(v){if(Hy=-1,jy=Bu=0,xr&48)throw Error(c(327));var D=v.callbackNode;if(vu()&&v.callbackNode!==D)return null;var Q=ua(v,v===so?Ns:0);if(Q===0)return null;var H=Q,V=xr;xr|=16;var ne=CP();(so!==v||Ns!==H)&&(bf(),Oh(v,H));do try{ZL();break}catch(_e){IP(v,_e)}while(!0);if(Fg(),My.current=ne,xr=V,Xi!==null?H=0:(so=null,Ns=0,H=ws),Rh&Fh)Oh(v,0);else if(H!==0){if(H===2&&(xr|=64,v.hydrate&&(v.hydrate=!1,Ts(v.containerInfo)),Q=Bl(v),Q!==0&&(H=id(v,Q))),H===1)throw D=Uy,Oh(v,0),Nh(v,Q),ga(v,bt()),D;switch(v.finishedWork=v.current.alternate,v.finishedLanes=Q,H){case 0:case 1:throw Error(c(345));case 2:$A(v);break;case 3:if(Nh(v,Q),(Q&62914560)===Q&&(H=d2+500-bt(),10<H)){if(ua(v,0)!==0)break;if(V=v.suspendedLanes,(V&Q)!==Q){ko(),v.pingedLanes|=v.suspendedLanes&V;break}v.timeoutHandle=x($A.bind(null,v),H);break}$A(v);break;case 4:if(Nh(v,Q),(Q&4186112)===Q)break;for(H=v.eventTimes,V=-1;0<Q;){var Se=31-ns(Q);ne=1<<Se,Se=H[Se],Se>V&&(V=Se),Q&=~ne}if(Q=V,Q=bt()-Q,Q=(120>Q?120:480>Q?480:1080>Q?1080:1920>Q?1920:3e3>Q?3e3:4320>Q?4320:1960*KL(Q/1960))-Q,10<Q){v.timeoutHandle=x($A.bind(null,v),Q);break}$A(v);break;case 5:$A(v);break;default:throw Error(c(329))}}return ga(v,bt()),v.callbackNode===D?mP.bind(null,v):null}function Nh(v,D){for(D&=~h2,D&=~Fh,v.suspendedLanes|=D,v.pingedLanes&=~D,v=v.expirationTimes;0<D;){var Q=31-ns(D),H=1<<Q;v[Q]=-1,D&=~H}}function w2(v){if(xr&48)throw Error(c(327));if(vu(),v===so&&v.expiredLanes&Ns){var D=Ns,Q=id(v,D);Rh&Fh&&(D=ua(v,D),Q=id(v,D))}else D=ua(v,0),Q=id(v,D);if(v.tag!==0&&Q===2&&(xr|=64,v.hydrate&&(v.hydrate=!1,Ts(v.containerInfo)),D=Bl(v),D!==0&&(Q=id(v,D))),Q===1)throw Q=Uy,Oh(v,0),Nh(v,D),ga(v,bt()),Q;return v.finishedWork=v.current.alternate,v.finishedLanes=D,$A(v),ga(v,bt()),null}function zL(){if(wu!==null){var v=wu;wu=null,v.forEach(function(D){D.expiredLanes|=24&D.pendingLanes,ga(D,bt())})}Tn()}function yP(v,D){var Q=xr;xr|=1;try{return v(D)}finally{xr=Q,xr===0&&(bf(),Tn())}}function EP(v,D){var Q=xr;if(Q&48)return v(D);xr|=1;try{if(v)return li(99,v.bind(null,D))}finally{xr=Q,Tn()}}function qy(v,D){xn(p2,ZA),ZA|=D,Rh|=D}function B2(){ZA=p2.current,Rt(p2)}function Oh(v,D){v.finishedWork=null,v.finishedLanes=0;var Q=v.timeoutHandle;if(Q!==b&&(v.timeoutHandle=b,w(Q)),Xi!==null)for(Q=Xi.return;Q!==null;){var H=Q;switch(H.tag){case 1:H=H.type.childContextTypes,H!=null&&Au();break;case 3:du(),Rt(Li),Rt(Gi),yu();break;case 5:wt(H);break;case 4:du();break;case 13:Rt(di);break;case 19:Rt(di);break;case 10:Og(H);break;case 23:case 24:B2()}Q=Q.return}so=v,Xi=Su(v.current,null),Ns=ZA=Rh=D,ws=0,Uy=null,h2=Fh=Zg=0}function IP(v,D){do{var Q=Xi;try{if(Fg(),If.current=kt,WA){for(var H=Gn.memoizedState;H!==null;){var V=H.queue;V!==null&&(V.pending=null),H=H.next}WA=!1}if(Eu=0,Pi=is=Gn=null,Cf=!1,f2.current=null,Q===null||Q.return===null){ws=1,Uy=D,Xi=null;break}e:{var ne=v,Se=Q.return,_e=Q,pt=D;if(D=Ns,_e.flags|=2048,_e.firstEffect=_e.lastEffect=null,pt!==null&&typeof pt==\"object\"&&typeof pt.then==\"function\"){var Wt=pt;if(!(_e.mode&2)){var Sr=_e.alternate;Sr?(_e.updateQueue=Sr.updateQueue,_e.memoizedState=Sr.memoizedState,_e.lanes=Sr.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Lr=(di.current&1)!==0,Zt=Se;do{var zn;if(zn=Zt.tag===13){var yi=Zt.memoizedState;if(yi!==null)zn=yi.dehydrated!==null;else{var za=Zt.memoizedProps;zn=za.fallback===void 0?!1:za.unstable_avoidThisFallback!==!0?!0:!Lr}}if(zn){var et=Zt.updateQueue;if(et===null){var qe=new Set;qe.add(Wt),Zt.updateQueue=qe}else et.add(Wt);if(!(Zt.mode&2)){if(Zt.flags|=64,_e.flags|=16384,_e.flags&=-2981,_e.tag===1)if(_e.alternate===null)_e.tag=17;else{var gt=Dl(-1,1);gt.tag=2,bl(_e,gt)}_e.lanes|=1;break e}pt=void 0,_e=D;var Xt=ne.pingCache;if(Xt===null?(Xt=ne.pingCache=new WL,pt=new Set,Xt.set(Wt,pt)):(pt=Xt.get(Wt),pt===void 0&&(pt=new Set,Xt.set(Wt,pt))),!pt.has(_e)){pt.add(_e);var Dr=DP.bind(null,ne,Wt,_e);Wt.then(Dr,Dr)}Zt.flags|=4096,Zt.lanes=D;break e}Zt=Zt.return}while(Zt!==null);pt=Error((g(_e.type)||\"A React component\")+` suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}ws!==5&&(ws=2),pt=Yg(pt,_e),Zt=Se;do{switch(Zt.tag){case 3:ne=pt,Zt.flags|=4096,D&=-D,Zt.lanes|=D;var Zn=i2(Zt,ne,D);Iy(Zt,Zn);break e;case 1:ne=pt;var kr=Zt.type,Rn=Zt.stateNode;if(!(Zt.flags&64)&&(typeof kr.getDerivedStateFromError==\"function\"||Rn!==null&&typeof Rn.componentDidCatch==\"function\"&&(hc===null||!hc.has(Rn)))){Zt.flags|=4096,D&=-D,Zt.lanes|=D;var _n=Jg(Zt,ne,D);Iy(Zt,_n);break e}}Zt=Zt.return}while(Zt!==null)}BP(Q)}catch(zr){D=zr,Xi===Q&&Q!==null&&(Xi=Q=Q.return);continue}break}while(!0)}function CP(){var v=My.current;return My.current=kt,v===null?kt:v}function id(v,D){var Q=xr;xr|=16;var H=CP();so===v&&Ns===D||Oh(v,D);do try{XL();break}catch(V){IP(v,V)}while(!0);if(Fg(),xr=Q,My.current=H,Xi!==null)throw Error(c(261));return so=null,Ns=0,ws}function XL(){for(;Xi!==null;)wP(Xi)}function ZL(){for(;Xi!==null&&!vl();)wP(Xi)}function wP(v){var D=bP(v.alternate,v,ZA);v.memoizedProps=v.pendingProps,D===null?BP(v):Xi=D,f2.current=null}function BP(v){var D=v;do{var Q=D.alternate;if(v=D.return,D.flags&2048){if(Q=qL(D),Q!==null){Q.flags&=2047,Xi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=jL(Q,D,ZA),Q!==null){Xi=Q;return}if(Q=D,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||ZA&1073741824||!(Q.mode&4)){for(var H=0,V=Q.child;V!==null;)H|=V.lanes|V.childLanes,V=V.sibling;Q.childLanes=H}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=D.firstEffect),D.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=D.firstEffect),v.lastEffect=D.lastEffect),1<D.flags&&(v.lastEffect!==null?v.lastEffect.nextEffect=D:v.firstEffect=D,v.lastEffect=D))}if(D=D.sibling,D!==null){Xi=D;return}Xi=D=v}while(D!==null);ws===0&&(ws=5)}function $A(v){var D=tr();return li(99,$L.bind(null,v,D)),null}function $L(v,D){do vu();while($g!==null);if(xr&48)throw Error(c(327));var Q=v.finishedWork;if(Q===null)return null;if(v.finishedWork=null,v.finishedLanes=0,Q===v.current)throw Error(c(177));v.callbackNode=null;var H=Q.lanes|Q.childLanes,V=H,ne=v.pendingLanes&~V;v.pendingLanes=V,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=V,v.mutableReadLanes&=V,v.entangledLanes&=V,V=v.entanglements;for(var Se=v.eventTimes,_e=v.expirationTimes;0<ne;){var pt=31-ns(ne),Wt=1<<pt;V[pt]=0,Se[pt]=-1,_e[pt]=-1,ne&=~Wt}if(wu!==null&&!(H&24)&&wu.has(v)&&wu.delete(v),v===so&&(Xi=so=null,Ns=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,H=Q.firstEffect):H=Q:H=Q.firstEffect,H!==null){V=xr,xr|=32,f2.current=null,rd=rt(v.containerInfo),nd=!1,sr=H;do try{eM()}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);rd=null,sr=H;do try{for(Se=v;sr!==null;){var Sr=sr.flags;if(Sr&16&&F&&Af(sr.stateNode),Sr&128){var Lr=sr.alternate;if(Lr!==null){var Zt=Lr.ref;Zt!==null&&(typeof Zt==\"function\"?Zt(null):Zt.current=null)}}switch(Sr&1038){case 2:hP(sr),sr.flags&=-3;break;case 6:hP(sr),sr.flags&=-3,l2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,l2(sr.alternate,sr);break;case 4:l2(sr.alternate,sr);break;case 8:_e=Se,ne=sr,F?gP(_e,ne):AP(_e,ne);var zn=ne.alternate;Qy(ne),zn!==null&&Qy(zn)}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);nd&&lt(),Fe(v.containerInfo),v.current=Q,sr=H;do try{for(Sr=v;sr!==null;){var yi=sr.flags;if(yi&36&&uP(Sr,sr.alternate,sr),yi&128){Lr=void 0;var za=sr.ref;if(za!==null){var et=sr.stateNode;switch(sr.tag){case 5:Lr=Re(et);break;default:Lr=et}typeof za==\"function\"?za(Lr):za.current=Lr}}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);sr=null,te(),xr=V}else v.current=Q;if(Pf)Pf=!1,$g=v,ed=D;else for(sr=H;sr!==null;)D=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(yi=sr,yi.sibling=null,yi.stateNode=null),sr=D;if(H=v.pendingLanes,H===0&&(hc=null),H===1?v===C2?td++:(td=0,C2=v):td=0,Q=Q.stateNode,Ua&&typeof Ua.onCommitFiberRoot==\"function\")try{Ua.onCommitFiberRoot($e,Q,void 0,(Q.current.flags&64)===64)}catch{}if(ga(v,bt()),_y)throw _y=!1,v=y2,y2=null,v;return xr&8||Tn(),null}function eM(){for(;sr!==null;){var v=sr.alternate;nd||rd===null||(sr.flags&8?De(sr,rd)&&(nd=!0,Te()):sr.tag===13&&VL(v,sr)&&De(sr,rd)&&(nd=!0,Te()));var D=sr.flags;D&256&&xy(v,sr),!(D&512)||Pf||(Pf=!0,qi(97,function(){return vu(),null})),sr=sr.nextEffect}}function vu(){if(ed!==90){var v=97<ed?97:ed;return ed=90,li(v,rM)}return!1}function tM(v,D){E2.push(D,v),Pf||(Pf=!0,qi(97,function(){return vu(),null}))}function vP(v,D){I2.push(D,v),Pf||(Pf=!0,qi(97,function(){return vu(),null}))}function rM(){if($g===null)return!1;var v=$g;if($g=null,xr&48)throw Error(c(331));var D=xr;xr|=32;var Q=I2;I2=[];for(var H=0;H<Q.length;H+=2){var V=Q[H],ne=Q[H+1],Se=V.destroy;if(V.destroy=void 0,typeof Se==\"function\")try{Se()}catch(pt){if(ne===null)throw Error(c(330));xf(ne,pt)}}for(Q=E2,E2=[],H=0;H<Q.length;H+=2){V=Q[H],ne=Q[H+1];try{var _e=V.create;V.destroy=_e()}catch(pt){if(ne===null)throw Error(c(330));xf(ne,pt)}}for(_e=v.current.firstEffect;_e!==null;)v=_e.nextEffect,_e.nextEffect=null,_e.flags&8&&(_e.sibling=null,_e.stateNode=null),_e=v;return xr=D,Tn(),!0}function SP(v,D,Q){D=Yg(Q,D),D=i2(v,D,1),bl(v,D),D=ko(),v=Gy(v,1),v!==null&&(Ha(v,1,D),ga(v,D))}function xf(v,D){if(v.tag===3)SP(v,v,D);else for(var Q=v.return;Q!==null;){if(Q.tag===3){SP(Q,v,D);break}else if(Q.tag===1){var H=Q.stateNode;if(typeof Q.type.getDerivedStateFromError==\"function\"||typeof H.componentDidCatch==\"function\"&&(hc===null||!hc.has(H))){v=Yg(D,v);var V=Jg(Q,v,1);if(bl(Q,V),V=ko(),Q=Gy(Q,1),Q!==null)Ha(Q,1,V),ga(Q,V);else if(typeof H.componentDidCatch==\"function\"&&(hc===null||!hc.has(H)))try{H.componentDidCatch(D,v)}catch{}break}}Q=Q.return}}function DP(v,D,Q){var H=v.pingCache;H!==null&&H.delete(D),D=ko(),v.pingedLanes|=v.suspendedLanes&Q,so===v&&(Ns&Q)===Q&&(ws===4||ws===3&&(Ns&62914560)===Ns&&500>bt()-d2?Oh(v,0):h2|=Q),ga(v,D)}function nM(v,D){var Q=v.stateNode;Q!==null&&Q.delete(D),D=0,D===0&&(D=v.mode,D&2?D&4?(Bu===0&&(Bu=Rh),D=kn(62914560&~Bu),D===0&&(D=4194304)):D=tr()===99?1:2:D=1),Q=ko(),v=Gy(v,D),v!==null&&(Ha(v,D,Q),ga(v,Q))}var bP;bP=function(v,D,Q){var H=D.lanes;if(v!==null)if(v.memoizedProps!==D.pendingProps||Li.current)Je=!0;else if(Q&H)Je=!!(v.flags&16384);else{switch(Je=!1,D.tag){case 3:by(D),jg();break;case 5:Ef(D);break;case 1:Kn(D.type)&&La(D);break;case 4:Ug(D,D.stateNode.containerInfo);break;case 10:Ng(D,D.memoizedProps.value);break;case 13:if(D.memoizedState!==null)return Q&D.child.childLanes?r2(v,D,Q):(xn(di,di.current&1),D=qn(v,D,Q),D!==null?D.sibling:null);xn(di,di.current&1);break;case 19:if(H=(Q&D.childLanes)!==0,v.flags&64){if(H)return cP(v,D,Q);D.flags|=64}var V=D.memoizedState;if(V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),xn(di,di.current),H)break;return null;case 23:case 24:return D.lanes=0,mi(v,D,Q)}return qn(v,D,Q)}else Je=!1;switch(D.lanes=0,D.tag){case 2:if(H=D.type,v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),v=D.pendingProps,V=dn(D,Gi.current),df(D,Q),V=qg(null,D,H,v,V,Q),D.flags|=1,typeof V==\"object\"&&V!==null&&typeof V.render==\"function\"&&V.$$typeof===void 0){if(D.tag=1,D.memoizedState=null,D.updateQueue=null,Kn(H)){var ne=!0;La(D)}else ne=!1;D.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,Bh(D);var Se=H.getDerivedStateFromProps;typeof Se==\"function\"&&_A(D,H,Se,v),V.updater=HA,D.stateNode=V,V._reactInternals=D,bo(D,H,v,Q),D=t2(null,D,H,!0,ne,Q)}else D.tag=0,At(null,D,V,Q),D=D.child;return D;case 16:V=D.elementType;e:{switch(v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),v=D.pendingProps,ne=V._init,V=ne(V._payload),D.type=V,ne=D.tag=sM(V),v=So(V,v),ne){case 0:D=JA(null,D,V,v,Q);break e;case 1:D=lP(null,D,V,v,Q);break e;case 11:D=dr(null,D,V,v,Q);break e;case 14:D=vr(null,D,V,So(V.type,v),H,Q);break e}throw Error(c(306,V,\"\"))}return D;case 0:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),JA(v,D,H,V,Q);case 1:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),lP(v,D,H,V,Q);case 3:if(by(D),H=D.updateQueue,v===null||H===null)throw Error(c(282));if(H=D.pendingProps,V=D.memoizedState,V=V!==null?V.element:null,Lg(v,D),UA(D,H,null,Q),H=D.memoizedState.element,H===V)jg(),D=qn(v,D,Q);else{if(V=D.stateNode,(ne=V.hydrate)&&(X?(Aa=cu(D.stateNode.containerInfo),Wa=D,ne=Ya=!0):ne=!1),ne){if(X&&(v=V.mutableSourceEagerHydrationData,v!=null))for(V=0;V<v.length;V+=2)ne=v[V],Se=v[V+1],y?ne._workInProgressVersionPrimary=Se:ne._workInProgressVersionSecondary=Se,mu.push(ne);for(Q=e2(D,null,H,Q),D.child=Q;Q;)Q.flags=Q.flags&-3|1024,Q=Q.sibling}else At(v,D,H,Q),jg();D=D.child}return D;case 5:return Ef(D),v===null&&Hg(D),H=D.type,V=D.pendingProps,ne=v!==null?v.memoizedProps:null,Se=V.children,it(H,V)?Se=null:ne!==null&&it(H,ne)&&(D.flags|=16),Cs(v,D),At(v,D,Se,Q),D.child;case 6:return v===null&&Hg(D),null;case 13:return r2(v,D,Q);case 4:return Ug(D,D.stateNode.containerInfo),H=D.pendingProps,v===null?D.child=Mg(D,null,H,Q):At(v,D,H,Q),D.child;case 11:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),dr(v,D,H,V,Q);case 7:return At(v,D,D.pendingProps,Q),D.child;case 8:return At(v,D,D.pendingProps.children,Q),D.child;case 12:return At(v,D,D.pendingProps.children,Q),D.child;case 10:e:{if(H=D.type._context,V=D.pendingProps,Se=D.memoizedProps,ne=V.value,Ng(D,ne),Se!==null){var _e=Se.value;if(ne=vo(_e,ne)?0:(typeof H._calculateChangedBits==\"function\"?H._calculateChangedBits(_e,ne):1073741823)|0,ne===0){if(Se.children===V.children&&!Li.current){D=qn(v,D,Q);break e}}else for(_e=D.child,_e!==null&&(_e.return=D);_e!==null;){var pt=_e.dependencies;if(pt!==null){Se=_e.child;for(var Wt=pt.firstContext;Wt!==null;){if(Wt.context===H&&Wt.observedBits&ne){_e.tag===1&&(Wt=Dl(-1,Q&-Q),Wt.tag=2,bl(_e,Wt)),_e.lanes|=Q,Wt=_e.alternate,Wt!==null&&(Wt.lanes|=Q),Ey(_e.return,Q),pt.lanes|=Q;break}Wt=Wt.next}}else Se=_e.tag===10&&_e.type===D.type?null:_e.child;if(Se!==null)Se.return=_e;else for(Se=_e;Se!==null;){if(Se===D){Se=null;break}if(_e=Se.sibling,_e!==null){_e.return=Se.return,Se=_e;break}Se=Se.return}_e=Se}}At(v,D,V.children,Q),D=D.child}return D;case 9:return V=D.type,ne=D.pendingProps,H=ne.children,df(D,Q),V=Do(V,ne.unstable_observedBits),H=H(V),D.flags|=1,At(v,D,H,Q),D.child;case 14:return V=D.type,ne=So(V,D.pendingProps),ne=So(V.type,ne),vr(v,D,V,ne,H,Q);case 15:return Un(v,D,D.type,D.pendingProps,H,Q);case 17:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),D.tag=1,Kn(H)?(v=!0,La(D)):v=!1,df(D,Q),xt(D,H,V),bo(D,H,V,Q),t2(null,D,H,!0,v,Q);case 19:return cP(v,D,Q);case 23:return mi(v,D,Q);case 24:return mi(v,D,Q)}throw Error(c(156,D.tag))};var Wy={current:!1},Os=n.unstable_flushAllWithoutAsserting,PP=typeof Os==\"function\";function v2(){if(Os!==void 0)return Os();for(var v=!1;vu();)v=!0;return v}function da(v){try{v2(),JL(function(){v2()?da(v):v()})}catch(D){v(D)}}var Ja=0,Yy=!1;function iM(v,D,Q,H){this.tag=v,this.key=Q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=D,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=H,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Ka(v,D,Q,H){return new iM(v,D,Q,H)}function S2(v){return v=v.prototype,!(!v||!v.isReactComponent)}function sM(v){if(typeof v==\"function\")return S2(v)?1:0;if(v!=null){if(v=v.$$typeof,v===R)return 11;if(v===W)return 14}return 2}function Su(v,D){var Q=v.alternate;return Q===null?(Q=Ka(v.tag,D,v.key,v.mode),Q.elementType=v.elementType,Q.type=v.type,Q.stateNode=v.stateNode,Q.alternate=v,v.alternate=Q):(Q.pendingProps=D,Q.type=v.type,Q.flags=0,Q.nextEffect=null,Q.firstEffect=null,Q.lastEffect=null),Q.childLanes=v.childLanes,Q.lanes=v.lanes,Q.child=v.child,Q.memoizedProps=v.memoizedProps,Q.memoizedState=v.memoizedState,Q.updateQueue=v.updateQueue,D=v.dependencies,Q.dependencies=D===null?null:{lanes:D.lanes,firstContext:D.firstContext},Q.sibling=v.sibling,Q.index=v.index,Q.ref=v.ref,Q}function sd(v,D,Q,H,V,ne){var Se=2;if(H=v,typeof v==\"function\")S2(v)&&(Se=1);else if(typeof v==\"string\")Se=5;else e:switch(v){case E:return kf(Q.children,V,ne,D);case ue:Se=8,V|=16;break;case C:Se=8,V|=1;break;case S:return v=Ka(12,Q,D,V|8),v.elementType=S,v.type=S,v.lanes=ne,v;case N:return v=Ka(13,Q,D,V),v.type=N,v.elementType=N,v.lanes=ne,v;case U:return v=Ka(19,Q,D,V),v.elementType=U,v.lanes=ne,v;case le:return D2(Q,V,ne,D);case me:return v=Ka(24,Q,D,V),v.elementType=me,v.lanes=ne,v;default:if(typeof v==\"object\"&&v!==null)switch(v.$$typeof){case P:Se=10;break e;case I:Se=9;break e;case R:Se=11;break e;case W:Se=14;break e;case ee:Se=16,H=null;break e;case ie:Se=22;break e}throw Error(c(130,v==null?v:typeof v,\"\"))}return D=Ka(Se,Q,D,V),D.elementType=v,D.type=H,D.lanes=ne,D}function kf(v,D,Q,H){return v=Ka(7,v,H,D),v.lanes=Q,v}function D2(v,D,Q,H){return v=Ka(23,v,H,D),v.elementType=le,v.lanes=Q,v}function b2(v,D,Q){return v=Ka(6,v,null,D),v.lanes=Q,v}function Qo(v,D,Q){return D=Ka(4,v.children!==null?v.children:[],v.key,D),D.lanes=Q,D.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},D}function oM(v,D,Q){this.tag=D,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=b,this.pendingContext=this.context=null,this.hydrate=Q,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=fa(0),this.expirationTimes=fa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fa(0),X&&(this.mutableSourceEagerHydrationData=null)}function xP(v){var D=v._reactInternals;if(D===void 0)throw typeof v.render==\"function\"?Error(c(188)):Error(c(268,Object.keys(v)));return v=se(D),v===null?null:v.stateNode}function kP(v,D){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var Q=v.retryLane;v.retryLane=Q!==0&&Q<D?Q:D}}function Vy(v,D){kP(v,D),(v=v.alternate)&&kP(v,D)}function aM(v){return v=se(v),v===null?null:v.stateNode}function lM(){return null}return r.IsThisRendererActing=Wy,r.act=function(v){function D(){Ja--,A2.current=Q,Wy.current=H}Yy===!1&&(Yy=!0,console.error(\"act(...) is not supported in production builds of React, and might not behave as expected.\")),Ja++;var Q=A2.current,H=Wy.current;A2.current=!0,Wy.current=!0;try{var V=yP(v)}catch(ne){throw D(),ne}if(V!==null&&typeof V==\"object\"&&typeof V.then==\"function\")return{then:function(ne,Se){V.then(function(){1<Ja||PP===!0&&Q===!0?(D(),ne()):da(function(_e){D(),_e?Se(_e):ne()})},function(_e){D(),Se(_e)})}};try{Ja!==1||PP!==!1&&Q!==!1||v2(),D()}catch(ne){throw D(),ne}return{then:function(ne){ne()}}},r.attemptContinuousHydration=function(v){if(v.tag===13){var D=ko();Tl(v,67108864,D),Vy(v,67108864)}},r.attemptHydrationAtCurrentPriority=function(v){if(v.tag===13){var D=ko(),Q=Bs(v);Tl(v,Q,D),Vy(v,Q)}},r.attemptSynchronousHydration=function(v){switch(v.tag){case 3:var D=v.stateNode;if(D.hydrate){var Q=ca(D.pendingLanes);D.expiredLanes|=Q&D.pendingLanes,ga(D,bt()),!(xr&48)&&(bf(),Tn())}break;case 13:var H=ko();EP(function(){return Tl(v,1,H)}),Vy(v,4)}},r.attemptUserBlockingHydration=function(v){if(v.tag===13){var D=ko();Tl(v,4,D),Vy(v,4)}},r.batchedEventUpdates=function(v,D){var Q=xr;xr|=2;try{return v(D)}finally{xr=Q,xr===0&&(bf(),Tn())}},r.batchedUpdates=yP,r.createComponentSelector=function(v){return{$$typeof:Ty,value:v}},r.createContainer=function(v,D,Q){return v=new oM(v,D,Q),D=Ka(3,null,null,D===2?7:D===1?3:0),v.current=D,D.stateNode=v,Bh(D),v},r.createHasPsuedoClassSelector=function(v){return{$$typeof:Ry,value:v}},r.createPortal=function(v,D,Q){var H=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:H==null?null:\"\"+H,children:v,containerInfo:D,implementation:Q}},r.createRoleSelector=function(v){return{$$typeof:Fy,value:v}},r.createTestNameSelector=function(v){return{$$typeof:zg,value:v}},r.createTextSelector=function(v){return{$$typeof:Ny,value:v}},r.deferredUpdates=function(v){return li(97,v)},r.discreteUpdates=function(v,D,Q,H,V){var ne=xr;xr|=4;try{return li(98,v.bind(null,D,Q,H,V))}finally{xr=ne,xr===0&&(bf(),Tn())}},r.findAllNodes=u2,r.findBoundingRects=function(v,D){if(!qt)throw Error(c(363));D=u2(v,D),v=[];for(var Q=0;Q<D.length;Q++)v.push(Pt(D[Q]));for(D=v.length-1;0<D;D--){Q=v[D];for(var H=Q.x,V=H+Q.width,ne=Q.y,Se=ne+Q.height,_e=D-1;0<=_e;_e--)if(D!==_e){var pt=v[_e],Wt=pt.x,Sr=Wt+pt.width,Lr=pt.y,Zt=Lr+pt.height;if(H>=Wt&&ne>=Lr&&V<=Sr&&Se<=Zt){v.splice(D,1);break}else if(H!==Wt||Q.width!==pt.width||Zt<ne||Lr>Se){if(!(ne!==Lr||Q.height!==pt.height||Sr<H||Wt>V)){Wt>H&&(pt.width+=Wt-H,pt.x=H),Sr<V&&(pt.width=V-Wt),v.splice(D,1);break}}else{Lr>ne&&(pt.height+=Lr-ne,pt.y=ne),Zt<Se&&(pt.height=Se-Lr),v.splice(D,1);break}}}return v},r.findHostInstance=xP,r.findHostInstanceWithNoPortals=function(v){return v=Z(v),v===null?null:v.tag===20?v.stateNode.instance:v.stateNode},r.findHostInstanceWithWarning=function(v){return xP(v)},r.flushControlled=function(v){var D=xr;xr|=1;try{li(99,v)}finally{xr=D,xr===0&&(bf(),Tn())}},r.flushDiscreteUpdates=function(){!(xr&49)&&(zL(),vu())},r.flushPassiveEffects=vu,r.flushSync=EP,r.focusWithin=function(v,D){if(!qt)throw Error(c(363));for(v=Oy(v),D=c2(v,D),D=Array.from(D),v=0;v<D.length;){var Q=D[v++];if(!Pr(Q)){if(Q.tag===5&&Or(Q.stateNode))return!0;for(Q=Q.child;Q!==null;)D.push(Q),Q=Q.sibling}}return!1},r.getCurrentUpdateLanePriority=function(){return lc},r.getFindAllNodesFailureDescription=function(v,D){if(!qt)throw Error(c(363));var Q=0,H=[];v=[Oy(v),0];for(var V=0;V<v.length;){var ne=v[V++],Se=v[V++],_e=D[Se];if((ne.tag!==5||!Pr(ne))&&(Sf(ne,_e)&&(H.push(Df(_e)),Se++,Se>Q&&(Q=Se)),Se<D.length))for(ne=ne.child;ne!==null;)v.push(ne,Se),ne=ne.sibling}if(Q<D.length){for(v=[];Q<D.length;Q++)v.push(Df(D[Q]));return`findAllNodes was able to match part of the selector:\n  `+(H.join(\" > \")+`\n\nNo matching component was found for:\n  `)+v.join(\" > \")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return Re(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:aM,findFiberByHostInstance:v.findFiberByHostInstance||lM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\")v=!1;else{var D=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!D.isDisabled&&D.supportsFiber)try{$e=D.inject(v),Ua=D}catch{}v=!0}return v},r.observeVisibleRects=function(v,D,Q,H){if(!qt)throw Error(c(363));v=u2(v,D);var V=on(v,Q,H).disconnect;return{disconnect:function(){V()}}},r.registerMutableSourceForHydration=function(v,D){var Q=D._getVersion;Q=Q(D._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[D,Q]:v.mutableSourceEagerHydrationData.push(D,Q)},r.runWithPriority=function(v,D){var Q=lc;try{return lc=v,D()}finally{lc=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,D){var Q=xr;xr&=-2,xr|=8;try{return v(D)}finally{xr=Q,xr===0&&(bf(),Tn())}},r.updateContainer=function(v,D,Q,H){var V=D.current,ne=ko(),Se=Bs(V);e:if(Q){Q=Q._reactInternals;t:{if(we(Q)!==Q||Q.tag!==1)throw Error(c(170));var _e=Q;do{switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Kn(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}_e=_e.return}while(_e!==null);throw Error(c(171))}if(Q.tag===1){var pt=Q.type;if(Kn(pt)){Q=Oa(Q,pt,_e);break e}}Q=_e}else Q=la;return D.context===null?D.context=Q:D.pendingContext=Q,D=Dl(ne,Se),D.payload={element:v},H=H===void 0?null:H,H!==null&&(D.callback=H),bl(V,D),Tl(V,Se,ne),Se},r}});var Swe=_((vKt,vwe)=>{\"use strict\";vwe.exports=Bwe()});var bwe=_((SKt,Dwe)=>{\"use strict\";var Spt={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};Dwe.exports=Spt});var Qwe=_((DKt,kwe)=>{\"use strict\";var Dpt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},FF=function(){function t(e,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,\"value\"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,s){return r&&t(e.prototype,r),s&&t(e,s),e}}();function V9(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J9(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var tf=bwe(),bpt=function(){function t(e,r,s,a,n,c){J9(this,t),this.left=e,this.right=r,this.top=s,this.bottom=a,this.width=n,this.height=c}return FF(t,[{key:\"fromJS\",value:function(r){r(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:\"toString\",value:function(){return\"<Layout#\"+this.left+\":\"+this.right+\";\"+this.top+\":\"+this.bottom+\";\"+this.width+\":\"+this.height+\">\"}}]),t}(),Pwe=function(){FF(t,null,[{key:\"fromJS\",value:function(r){var s=r.width,a=r.height;return new t(s,a)}}]);function t(e,r){J9(this,t),this.width=e,this.height=r}return FF(t,[{key:\"fromJS\",value:function(r){r(this.width,this.height)}},{key:\"toString\",value:function(){return\"<Size#\"+this.width+\"x\"+this.height+\">\"}}]),t}(),xwe=function(){function t(e,r){J9(this,t),this.unit=e,this.value=r}return FF(t,[{key:\"fromJS\",value:function(r){r(this.unit,this.value)}},{key:\"toString\",value:function(){switch(this.unit){case tf.UNIT_POINT:return String(this.value);case tf.UNIT_PERCENT:return this.value+\"%\";case tf.UNIT_AUTO:return\"auto\";default:return this.value+\"?\"}}},{key:\"valueOf\",value:function(){return this.value}}]),t}();kwe.exports=function(t,e){function r(c,f,p){var h=c[f];c[f]=function(){for(var E=arguments.length,C=Array(E),S=0;S<E;S++)C[S]=arguments[S];return p.call.apply(p,[this,h].concat(C))}}for(var s=[\"setPosition\",\"setMargin\",\"setFlexBasis\",\"setWidth\",\"setHeight\",\"setMinWidth\",\"setMinHeight\",\"setMaxWidth\",\"setMaxHeight\",\"setPadding\"],a=function(){var f,p=s[n],h=(f={},V9(f,tf.UNIT_POINT,e.Node.prototype[p]),V9(f,tf.UNIT_PERCENT,e.Node.prototype[p+\"Percent\"]),V9(f,tf.UNIT_AUTO,e.Node.prototype[p+\"Auto\"]),f);r(e.Node.prototype,p,function(E){for(var C=arguments.length,S=Array(C>1?C-1:0),P=1;P<C;P++)S[P-1]=arguments[P];var I=S.pop(),R=void 0,N=void 0;if(I===\"auto\")R=tf.UNIT_AUTO,N=void 0;else if(I instanceof xwe)R=I.unit,N=I.valueOf();else if(R=typeof I==\"string\"&&I.endsWith(\"%\")?tf.UNIT_PERCENT:tf.UNIT_POINT,N=parseFloat(I),!Number.isNaN(I)&&Number.isNaN(N))throw new Error(\"Invalid value \"+I+\" for \"+p);if(!h[R])throw new Error('Failed to execute \"'+p+`\": Unsupported unit '`+I+\"'\");if(N!==void 0){var U;return(U=h[R]).call.apply(U,[this].concat(S,[N]))}else{var W;return(W=h[R]).call.apply(W,[this].concat(S))}})},n=0;n<s.length;n++)a();return r(e.Config.prototype,\"free\",function(){e.Config.destroy(this)}),r(e.Node,\"create\",function(c,f){return f?e.Node.createWithConfig(f):e.Node.createDefault()}),r(e.Node.prototype,\"free\",function(){e.Node.destroy(this)}),r(e.Node.prototype,\"freeRecursive\",function(){for(var c=0,f=this.getChildCount();c<f;++c)this.getChild(0).freeRecursive();this.free()}),r(e.Node.prototype,\"setMeasureFunc\",function(c,f){return f?c.call(this,function(){return Pwe.fromJS(f.apply(void 0,arguments))}):this.unsetMeasureFunc()}),r(e.Node.prototype,\"calculateLayout\",function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:tf.DIRECTION_LTR;return c.call(this,f,p,h)}),Dpt({Config:e.Config,Node:e.Node,Layout:t(\"Layout\",bpt),Size:t(\"Size\",Pwe),Value:t(\"Value\",xwe),getInstanceCount:function(){return e.getInstanceCount.apply(e,arguments)}},tf)}});var Twe=_((exports,module)=>{(function(t,e){typeof define==\"function\"&&define.amd?define([],function(){return e}):typeof module==\"object\"&&module.exports?module.exports=e:(t.nbind=t.nbind||{}).init=e})(exports,function(Module,cb){typeof Module==\"function\"&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(t,e){return function(){t&&t.apply(this,arguments);try{Module.ccall(\"nbind_init\")}catch(r){e(r);return}e(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=(typeof Module<\"u\"?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if(Module.ENVIRONMENT===\"WEB\")ENVIRONMENT_IS_WEB=!0;else if(Module.ENVIRONMENT===\"WORKER\")ENVIRONMENT_IS_WORKER=!0;else if(Module.ENVIRONMENT===\"NODE\")ENVIRONMENT_IS_NODE=!0;else if(Module.ENVIRONMENT===\"SHELL\")ENVIRONMENT_IS_SHELL=!0;else throw new Error(\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\");else ENVIRONMENT_IS_WEB=typeof window==\"object\",ENVIRONMENT_IS_WORKER=typeof importScripts==\"function\",ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof Ie==\"function\"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(e,r){nodeFS||(nodeFS={}(\"\")),nodePath||(nodePath={}(\"\")),e=nodePath.normalize(e);var s=nodeFS.readFileSync(e);return r?s:s.toString()},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\\\/g,\"/\"):Module.thisProgram=\"unknown-program\"),Module.arguments=process.argv.slice(2),typeof module<\"u\"&&(module.exports=Module),Module.inspect=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr<\"u\"&&(Module.printErr=printErr),typeof read<\"u\"?Module.read=read:Module.read=function(){throw\"no read() available\"},Module.readBinary=function(e){if(typeof readbuffer==\"function\")return new Uint8Array(readbuffer(e));var r=read(e,\"binary\");return assert(typeof r==\"object\"),r},typeof scriptArgs<\"u\"?Module.arguments=scriptArgs:typeof arguments<\"u\"&&(Module.arguments=arguments),typeof quit==\"function\"&&(Module.quit=function(t,e){quit(t)});else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(e){var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),Module.readAsync=function(e,r,s){var a=new XMLHttpRequest;a.open(\"GET\",e,!0),a.responseType=\"arraybuffer\",a.onload=function(){a.status==200||a.status==0&&a.response?r(a.response):s()},a.onerror=s,a.send(null)},typeof arguments<\"u\"&&(Module.arguments=arguments),typeof console<\"u\")Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump<\"u\"?function(t){dump(t)}:function(t){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle>\"u\"&&(Module.setWindowTitle=function(t){document.title=t})}else throw\"Unknown runtime environment. Where are we?\";function globalEval(t){eval.call(null,t)}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram=\"./this.program\"),Module.quit||(Module.quit=function(t,e){throw e}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(t){return tempRet0=t,t},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(t){STACKTOP=t},getNativeTypeSize:function(t){switch(t){case\"i1\":case\"i8\":return 1;case\"i16\":return 2;case\"i32\":return 4;case\"i64\":return 8;case\"float\":return 4;case\"double\":return 8;default:{if(t[t.length-1]===\"*\")return Runtime.QUANTUM_SIZE;if(t[0]===\"i\"){var e=parseInt(t.substr(1));return assert(e%8===0),e/8}else return 0}}},getNativeFieldSize:function(t){return Math.max(Runtime.getNativeTypeSize(t),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(t,e){return e===\"double\"||e===\"i64\"?t&7&&(assert((t&7)===4),t+=4):assert((t&3)===0),t},getAlignSize:function(t,e,r){return!r&&(t==\"i64\"||t==\"double\")?8:t?Math.min(e||(t?Runtime.getNativeFieldSize(t):0),Runtime.QUANTUM_SIZE):Math.min(e,8)},dynCall:function(t,e,r){return r&&r.length?Module[\"dynCall_\"+t].apply(null,[e].concat(r)):Module[\"dynCall_\"+t].call(null,e)},functionPointers:[],addFunction:function(t){for(var e=0;e<Runtime.functionPointers.length;e++)if(!Runtime.functionPointers[e])return Runtime.functionPointers[e]=t,2*(1+e);throw\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\"},removeFunction:function(t){Runtime.functionPointers[(t-2)/2]=null},warnOnce:function(t){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[t]||(Runtime.warnOnce.shown[t]=1,Module.printErr(t))},funcWrappers:{},getFuncWrapper:function(t,e){if(t){assert(e),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]={});var r=Runtime.funcWrappers[e];return r[t]||(e.length===1?r[t]=function(){return Runtime.dynCall(e,t)}:e.length===2?r[t]=function(a){return Runtime.dynCall(e,t,[a])}:r[t]=function(){return Runtime.dynCall(e,t,Array.prototype.slice.call(arguments))}),r[t]}},getCompilerSetting:function(t){throw\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\"},stackAlloc:function(t){var e=STACKTOP;return STACKTOP=STACKTOP+t|0,STACKTOP=STACKTOP+15&-16,e},staticAlloc:function(t){var e=STATICTOP;return STATICTOP=STATICTOP+t|0,STATICTOP=STATICTOP+15&-16,e},dynamicAlloc:function(t){var e=HEAP32[DYNAMICTOP_PTR>>2],r=(e+t+15|0)&-16;if(HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY){var s=enlargeMemory();if(!s)return HEAP32[DYNAMICTOP_PTR>>2]=e,0}return e},alignMemory:function(t,e){var r=t=Math.ceil(t/(e||16))*(e||16);return r},makeBigInt:function(t,e,r){var s=r?+(t>>>0)+ +(e>>>0)*4294967296:+(t>>>0)+ +(e|0)*4294967296;return s},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0;function assert(t,e){t||abort(\"Assertion failed: \"+e)}function getCFunc(ident){var func=Module[\"_\"+ident];if(!func)try{func=eval(\"_\"+ident)}catch(t){}return assert(func,\"Cannot call unknown function \"+ident+\" (perhaps LLVM optimizations or closure removed it?)\"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(t){var e=Runtime.stackAlloc(t.length);return writeArrayToMemory(t,e),e},stringToC:function(t){var e=0;if(t!=null&&t!==0){var r=(t.length<<2)+1;e=Runtime.stackAlloc(r),stringToUTF8(t,e,r)}return e}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,s,a,n){var c=getCFunc(e),f=[],p=0;if(a)for(var h=0;h<a.length;h++){var E=toC[s[h]];E?(p===0&&(p=Runtime.stackSave()),f[h]=E(a[h])):f[h]=a[h]}var C=c.apply(null,f);if(r===\"string\"&&(C=Pointer_stringify(C)),p!==0){if(n&&n.async){EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(p)});return}Runtime.stackRestore(p)}return C};var sourceRegex=/^function\\s*[a-zA-Z$_0-9]*\\s*\\(([^)]*)\\)\\s*{\\s*([^*]*?)[\\s;]*(?:return\\s*(.*?)[;\\s]*)?}$/;function parseJSFunc(t){var e=t.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource){JSsource={};for(var t in JSfuncs)JSfuncs.hasOwnProperty(t)&&(JSsource[t]=parseJSFunc(JSfuncs[t]))}}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(t){return t===\"number\"}),numericRet=returnType!==\"string\";if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(t,e){return\"$\"+e}),funcstr=\"(function(\"+argNames.join(\",\")+\") {\",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+=\"var stack = \"+JSsource.stackSave.body+\";\";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type!==\"number\"){var convertCode=JSsource[type+\"ToC\"];funcstr+=\"var \"+convertCode.arguments+\" = \"+arg+\";\",funcstr+=convertCode.body+\";\",funcstr+=arg+\"=(\"+convertCode.returnValue+\");\"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+=\"var ret = \"+cfuncname+\"(\"+argNames.join(\",\")+\");\",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+=\"ret = \"+strgfy+\"(ret);\"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace(\"()\",\"(stack)\")+\";\"),funcstr+=\"return ret})\",eval(funcstr)}})(),Module.ccall=ccall,Module.cwrap=cwrap;function setValue(t,e,r,s){switch(r=r||\"i8\",r.charAt(r.length-1)===\"*\"&&(r=\"i32\"),r){case\"i1\":HEAP8[t>>0]=e;break;case\"i8\":HEAP8[t>>0]=e;break;case\"i16\":HEAP16[t>>1]=e;break;case\"i32\":HEAP32[t>>2]=e;break;case\"i64\":tempI64=[e>>>0,(tempDouble=e,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case\"float\":HEAPF32[t>>2]=e;break;case\"double\":HEAPF64[t>>3]=e;break;default:abort(\"invalid type for setValue: \"+r)}}Module.setValue=setValue;function getValue(t,e,r){switch(e=e||\"i8\",e.charAt(e.length-1)===\"*\"&&(e=\"i32\"),e){case\"i1\":return HEAP8[t>>0];case\"i8\":return HEAP8[t>>0];case\"i16\":return HEAP16[t>>1];case\"i32\":return HEAP32[t>>2];case\"i64\":return HEAP32[t>>2];case\"float\":return HEAPF32[t>>2];case\"double\":return HEAPF64[t>>3];default:abort(\"invalid type for setValue: \"+e)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(t,e,r,s){var a,n;typeof t==\"number\"?(a=!0,n=t):(a=!1,n=t.length);var c=typeof e==\"string\"?e:null,f;if(r==ALLOC_NONE?f=s:f=[typeof _malloc==\"function\"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][r===void 0?ALLOC_STATIC:r](Math.max(n,c?1:e.length)),a){var s=f,p;for(assert((f&3)==0),p=f+(n&-4);s<p;s+=4)HEAP32[s>>2]=0;for(p=f+n;s<p;)HEAP8[s++>>0]=0;return f}if(c===\"i8\")return t.subarray||t.slice?HEAPU8.set(t,f):HEAPU8.set(new Uint8Array(t),f),f;for(var h=0,E,C,S;h<n;){var P=t[h];if(typeof P==\"function\"&&(P=Runtime.getFunctionIndex(P)),E=c||e[h],E===0){h++;continue}E==\"i64\"&&(E=\"i32\"),setValue(f+h,P,E),S!==E&&(C=Runtime.getNativeTypeSize(E),S=E),h+=C}return f}Module.allocate=allocate;function getMemory(t){return staticSealed?runtimeInitialized?_malloc(t):Runtime.dynamicAlloc(t):Runtime.staticAlloc(t)}Module.getMemory=getMemory;function Pointer_stringify(t,e){if(e===0||!t)return\"\";for(var r=0,s,a=0;s=HEAPU8[t+a>>0],r|=s,!(s==0&&!e||(a++,e&&a==e)););e||(e=a);var n=\"\";if(r<128){for(var c=1024,f;e>0;)f=String.fromCharCode.apply(String,HEAPU8.subarray(t,t+Math.min(e,c))),n=n?n+f:f,t+=c,e-=c;return n}return Module.UTF8ToString(t)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(t){for(var e=\"\";;){var r=HEAP8[t++>>0];if(!r)return e;e+=String.fromCharCode(r)}}Module.AsciiToString=AsciiToString;function stringToAscii(t,e){return writeAsciiToMemory(t,e,!1)}Module.stringToAscii=stringToAscii;var UTF8Decoder=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0;function UTF8ArrayToString(t,e){for(var r=e;t[r];)++r;if(r-e>16&&t.subarray&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,r));for(var s,a,n,c,f,p,h=\"\";;){if(s=t[e++],!s)return h;if(!(s&128)){h+=String.fromCharCode(s);continue}if(a=t[e++]&63,(s&224)==192){h+=String.fromCharCode((s&31)<<6|a);continue}if(n=t[e++]&63,(s&240)==224?s=(s&15)<<12|a<<6|n:(c=t[e++]&63,(s&248)==240?s=(s&7)<<18|a<<12|n<<6|c:(f=t[e++]&63,(s&252)==248?s=(s&3)<<24|a<<18|n<<12|c<<6|f:(p=t[e++]&63,s=(s&1)<<30|a<<24|n<<18|c<<12|f<<6|p))),s<65536)h+=String.fromCharCode(s);else{var E=s-65536;h+=String.fromCharCode(55296|E>>10,56320|E&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(t){return UTF8ArrayToString(HEAPU8,t)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(t,e,r,s){if(!(s>0))return 0;for(var a=r,n=r+s-1,c=0;c<t.length;++c){var f=t.charCodeAt(c);if(f>=55296&&f<=57343&&(f=65536+((f&1023)<<10)|t.charCodeAt(++c)&1023),f<=127){if(r>=n)break;e[r++]=f}else if(f<=2047){if(r+1>=n)break;e[r++]=192|f>>6,e[r++]=128|f&63}else if(f<=65535){if(r+2>=n)break;e[r++]=224|f>>12,e[r++]=128|f>>6&63,e[r++]=128|f&63}else if(f<=2097151){if(r+3>=n)break;e[r++]=240|f>>18,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}else if(f<=67108863){if(r+4>=n)break;e[r++]=248|f>>24,e[r++]=128|f>>18&63,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}else{if(r+5>=n)break;e[r++]=252|f>>30,e[r++]=128|f>>24&63,e[r++]=128|f>>18&63,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}}return e[r]=0,r-a}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(t){for(var e=0,r=0;r<t.length;++r){var s=t.charCodeAt(r);s>=55296&&s<=57343&&(s=65536+((s&1023)<<10)|t.charCodeAt(++r)&1023),s<=127?++e:s<=2047?e+=2:s<=65535?e+=3:s<=2097151?e+=4:s<=67108863?e+=5:e+=6}return e}Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0;function demangle(t){var e=Module.___cxa_demangle||Module.__cxa_demangle;if(e){try{var r=t.substr(1),s=lengthBytesUTF8(r)+1,a=_malloc(s);stringToUTF8(r,a,s);var n=_malloc(4),c=e(a,0,0,n);if(getValue(n,\"i32\")===0&&c)return Pointer_stringify(c)}catch{}finally{a&&_free(a),n&&_free(n),c&&_free(c)}return t}return Runtime.warnOnce(\"warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling\"),t}function demangleAll(t){var e=/__Z[\\w\\d_]+/g;return t.replace(e,function(r){var s=demangle(r);return r===s?r:r+\" [\"+s+\"]\"})}function jsStackTrace(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return\"(no stack trace available)\"}return t.stack.toString()}function stackTrace(){var t=jsStackTrace();return Module.extraStackTrace&&(t+=`\n`+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort(\"Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value \"+TOTAL_MEMORY+\", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 \")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr(\"TOTAL_MEMORY should be larger than TOTAL_STACK, was \"+TOTAL_MEMORY+\"! (TOTAL_STACK=\"+TOTAL_STACK+\")\"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw\"Runtime error: expected the system to be little-endian!\";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(t){for(;t.length>0;){var e=t.shift();if(typeof e==\"function\"){e();continue}var r=e.func;typeof r==\"number\"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun==\"function\"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun==\"function\"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var s=r>0?r:lengthBytesUTF8(t)+1,a=new Array(s),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r<t.length;r++){var s=t[r];s>255&&(s&=255),e.push(String.fromCharCode(s))}return e.join(\"\")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce(\"writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!\");var s,a;r&&(a=e+lengthBytesUTF8(t),s=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=s)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(t,e,r){for(var s=0;s<t.length;++s)HEAP8[e++>>0]=t.charCodeAt(s);r||(HEAP8[e>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function t(e,r){var s=e>>>16,a=e&65535,n=r>>>16,c=r&65535;return a*c+(s*c+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(t){return froundBuffer[0]=t,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(t){t=t>>>0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(t,e,r,s,a,n,c,f){return _nbind.callbackSignatureList[t].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(t,e,r,s,a,n,c,f){return ASM_CONSTS[t](e,r,s,a,n,c,f)}function _emscripten_asm_const_iiiii(t,e,r,s,a){return ASM_CONSTS[t](e,r,s,a)}function _emscripten_asm_const_iiidddddd(t,e,r,s,a,n,c,f,p){return ASM_CONSTS[t](e,r,s,a,n,c,f,p)}function _emscripten_asm_const_iiididi(t,e,r,s,a,n,c){return ASM_CONSTS[t](e,r,s,a,n,c)}function _emscripten_asm_const_iiii(t,e,r,s){return ASM_CONSTS[t](e,r,s)}function _emscripten_asm_const_iiiid(t,e,r,s,a){return ASM_CONSTS[t](e,r,s,a)}function _emscripten_asm_const_iiiiii(t,e,r,s,a,n){return ASM_CONSTS[t](e,r,s,a,n)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],\"i8\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;STATICTOP+=16;function _atexit(t,e){__ATEXIT__.unshift({func:t,arg:e})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr(\"missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj\"),abort(-1)}function __decorate(t,e,r,s){var a=arguments.length,n=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,c;if(typeof Reflect==\"object\"&&typeof Reflect.decorate==\"function\")n=Reflect.decorate(t,e,r,s);else for(var f=t.length-1;f>=0;f--)(c=t[f])&&(n=(a<3?c(n):a>3?c(e,r,n):c(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function _defineHidden(t){return function(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!1,value:t,writable:!0})}}var _nbind={};function __nbind_free_external(t){_nbind.externalList[t].dereference(t)}function __nbind_reference_external(t){_nbind.externalList[t].reference()}function _llvm_stackrestore(t){var e=_llvm_stacksave,r=e.LLVM_SAVEDSTACKS[t];e.LLVM_SAVEDSTACKS.splice(t,1),Runtime.stackRestore(r)}function __nbind_register_pool(t,e,r,s){_nbind.Pool.pageSize=t,_nbind.Pool.usedPtr=e/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=s/4,HEAP32[e/4]=16909060,HEAP8[e]==1&&(_nbind.bigEndian=!0),HEAP32[e/4]=0,_nbind.makeTypeKindTbl=(n={},n[1024]=_nbind.PrimitiveType,n[64]=_nbind.Int64Type,n[2048]=_nbind.BindClass,n[3072]=_nbind.BindClassPtr,n[4096]=_nbind.SharedClassPtr,n[5120]=_nbind.ArrayType,n[6144]=_nbind.ArrayType,n[7168]=_nbind.CStringType,n[9216]=_nbind.CallbackType,n[10240]=_nbind.BindType,n),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,\"cbFunction &\":_nbind.CallbackType,\"const cbFunction &\":_nbind.CallbackType,\"const std::string &\":_nbind.StringType,\"std::string\":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var a=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:\"\"});a.proto=Module,_nbind.BindClass.list.push(a);var n}function _emscripten_set_main_loop_timing(t,e){if(Browser.mainLoop.timingMode=t,Browser.mainLoop.timingValue=e,!Browser.mainLoop.func)return 1;if(t==0)Browser.mainLoop.scheduler=function(){var c=Math.max(0,Browser.mainLoop.tickStartTime+e-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,c)},Browser.mainLoop.method=\"timeout\";else if(t==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method=\"rAF\";else if(t==2){if(!window.setImmediate){let n=function(c){c.source===window&&c.data===s&&(c.stopPropagation(),r.shift()())};var a=n,r=[],s=\"setimmediate\";window.addEventListener(\"message\",n,!0),window.setImmediate=function(f){r.push(f),ENVIRONMENT_IS_WORKER?(Module.setImmediates===void 0&&(Module.setImmediates=[]),Module.setImmediates.push(f),window.postMessage({target:s})):window.postMessage(s,\"*\")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method=\"immediate\"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(t,e,r,s,a){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\"),Browser.mainLoop.func=t,Browser.mainLoop.arg=s;var n;typeof s<\"u\"?n=function(){Module.dynCall_vi(t,s)}:n=function(){Module.dynCall_v(t)};var c=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var p=Date.now(),h=Browser.mainLoop.queue.shift();if(h.func(h.arg),Browser.mainLoop.remainingBlockers){var E=Browser.mainLoop.remainingBlockers,C=E%1==0?E-1:Math.floor(E);h.counted?Browser.mainLoop.remainingBlockers=C:(C=C+.5,Browser.mainLoop.remainingBlockers=(8*E+C)/9)}if(console.log('main loop blocker \"'+h.name+'\" took '+(Date.now()-p)+\" ms\"),Browser.mainLoop.updateStatus(),c<Browser.mainLoop.currentlyRunningMainloop)return;setTimeout(Browser.mainLoop.runner,0);return}if(!(c<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else Browser.mainLoop.timingMode==0&&(Browser.mainLoop.tickStartTime=_emscripten_get_now());Browser.mainLoop.method===\"timeout\"&&Module.ctx&&(Module.printErr(\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\"),Browser.mainLoop.method=\"\"),Browser.mainLoop.runIter(n),!(c<Browser.mainLoop.currentlyRunningMainloop)&&(typeof SDL==\"object\"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},a||(e&&e>0?_emscripten_set_main_loop_timing(0,1e3/e):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw\"SimulateInfiniteLoop\"}var Browser={mainLoop:{scheduler:null,method:\"\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var t=Browser.mainLoop.timingMode,e=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(t,e),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var t=Module.statusMessage||\"Please wait...\",e=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;e?e<r?Module.setStatus(t+\" (\"+(r-e)+\"/\"+r+\")\"):Module.setStatus(t):Module.setStatus(\"\")}},runIter:function(t){if(!ABORT){if(Module.preMainLoop){var e=Module.preMainLoop();if(e===!1)return}try{t()}catch(r){if(r instanceof ExitStatus)return;throw r&&typeof r==\"object\"&&r.stack&&Module.printErr(\"exception thrown: \"+[r,r.stack]),r}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),Browser.initted)return;Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch{Browser.hasBlobConstructor=!1,console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\")}Browser.BlobBuilder=typeof MozBlobBuilder<\"u\"?MozBlobBuilder:typeof WebKitBlobBuilder<\"u\"?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log(\"warning: no BlobBuilder\"),Browser.URLObject=typeof window<\"u\"?window.URL?window.URL:window.webkitURL:void 0,!Module.noImageDecoding&&typeof Browser.URLObject>\"u\"&&(console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\"),Module.noImageDecoding=!0);var t={};t.canHandle=function(n){return!Module.noImageDecoding&&/\\.(jpg|jpeg|png|bmp)$/i.test(n)},t.handle=function(n,c,f,p){var h=null;if(Browser.hasBlobConstructor)try{h=new Blob([n],{type:Browser.getMimetype(c)}),h.size!==n.length&&(h=new Blob([new Uint8Array(n).buffer],{type:Browser.getMimetype(c)}))}catch(P){Runtime.warnOnce(\"Blob constructor present but fails: \"+P+\"; falling back to blob builder\")}if(!h){var E=new Browser.BlobBuilder;E.append(new Uint8Array(n).buffer),h=E.getBlob()}var C=Browser.URLObject.createObjectURL(h),S=new Image;S.onload=function(){assert(S.complete,\"Image \"+c+\" could not be decoded\");var I=document.createElement(\"canvas\");I.width=S.width,I.height=S.height;var R=I.getContext(\"2d\");R.drawImage(S,0,0),Module.preloadedImages[c]=I,Browser.URLObject.revokeObjectURL(C),f&&f(n)},S.onerror=function(I){console.log(\"Image \"+C+\" could not be decoded\"),p&&p()},S.src=C},Module.preloadPlugins.push(t);var e={};e.canHandle=function(n){return!Module.noAudioDecoding&&n.substr(-4)in{\".ogg\":1,\".wav\":1,\".mp3\":1}},e.handle=function(n,c,f,p){var h=!1;function E(R){h||(h=!0,Module.preloadedAudios[c]=R,f&&f(n))}function C(){h||(h=!0,Module.preloadedAudios[c]=new Audio,p&&p())}if(Browser.hasBlobConstructor){try{var S=new Blob([n],{type:Browser.getMimetype(c)})}catch{return C()}var P=Browser.URLObject.createObjectURL(S),I=new Audio;I.addEventListener(\"canplaythrough\",function(){E(I)},!1),I.onerror=function(N){if(h)return;console.log(\"warning: browser could not fully decode audio \"+c+\", trying slower base64 approach\");function U(W){for(var ee=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",ie=\"=\",ue=\"\",le=0,me=0,pe=0;pe<W.length;pe++)for(le=le<<8|W[pe],me+=8;me>=6;){var Be=le>>me-6&63;me-=6,ue+=ee[Be]}return me==2?(ue+=ee[(le&3)<<4],ue+=ie+ie):me==4&&(ue+=ee[(le&15)<<2],ue+=ie),ue}I.src=\"data:audio/x-\"+c.substr(-3)+\";base64,\"+U(n),E(I)},I.src=P,Browser.safeSetTimeout(function(){E(I)},1e4)}else return C()},Module.preloadPlugins.push(e);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var s=Module.canvas;s&&(s.requestPointerLock=s.requestPointerLock||s.mozRequestPointerLock||s.webkitRequestPointerLock||s.msRequestPointerLock||function(){},s.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},s.exitPointerLock=s.exitPointerLock.bind(document),document.addEventListener(\"pointerlockchange\",r,!1),document.addEventListener(\"mozpointerlockchange\",r,!1),document.addEventListener(\"webkitpointerlockchange\",r,!1),document.addEventListener(\"mspointerlockchange\",r,!1),Module.elementPointerLock&&s.addEventListener(\"click\",function(a){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext:function(t,e,r,s){if(e&&Module.ctx&&t==Module.canvas)return Module.ctx;var a,n;if(e){var c={antialias:!1,alpha:!1};if(s)for(var f in s)c[f]=s[f];n=GL.createContext(t,c),n&&(a=GL.getContext(n).GLctx)}else a=t.getContext(\"2d\");return a?(r&&(e||assert(typeof GLctx>\"u\",\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\"),Module.ctx=a,e&&GL.makeContextCurrent(n),Module.useWebGL=e,Browser.moduleContextCreatedCallbacks.forEach(function(p){p()}),Browser.init()),a):null},destroyContext:function(t,e,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(t,e,r){Browser.lockPointer=t,Browser.resizeCanvas=e,Browser.vrDevice=r,typeof Browser.lockPointer>\"u\"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>\"u\"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice>\"u\"&&(Browser.vrDevice=null);var s=Module.canvas;function a(){Browser.isFullscreen=!1;var c=s.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===c?(s.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},s.exitFullscreen=s.exitFullscreen.bind(document),Browser.lockPointer&&s.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(c.parentNode.insertBefore(s,c),c.parentNode.removeChild(c),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(s)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener(\"fullscreenchange\",a,!1),document.addEventListener(\"mozfullscreenchange\",a,!1),document.addEventListener(\"webkitfullscreenchange\",a,!1),document.addEventListener(\"MSFullscreenChange\",a,!1));var n=document.createElement(\"div\");s.parentNode.insertBefore(n,s),n.appendChild(s),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?function(){n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(n.webkitRequestFullScreen?function(){n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?n.requestFullscreen({vrDisplay:r}):n.requestFullscreen()},requestFullScreen:function(t,e,r){return Module.printErr(\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\"),Browser.requestFullScreen=function(s,a,n){return Browser.requestFullscreen(s,a,n)},Browser.requestFullscreen(t,e,r)},nextRAF:0,fakeRequestAnimationFrame:function(t){var e=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=e+1e3/60;else for(;e+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-e,0);setTimeout(t,r)},requestAnimationFrame:function t(e){typeof window>\"u\"?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(t){return function(){if(!ABORT)return t.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var t=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],t.forEach(function(e){e()})}},safeRequestAnimationFrame:function(t){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))})},safeSetTimeout:function(t,e){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))},e)},safeSetInterval:function(t,e){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&t()},e)},getMimetype:function(t){return{jpg:\"image/jpeg\",jpeg:\"image/jpeg\",png:\"image/png\",bmp:\"image/bmp\",ogg:\"audio/ogg\",wav:\"audio/wav\",mp3:\"audio/mpeg\"}[t.substr(t.lastIndexOf(\".\")+1)]},getUserMedia:function(t){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(t)},getMovementX:function(t){return t.movementX||t.mozMovementX||t.webkitMovementX||0},getMovementY:function(t){return t.movementY||t.mozMovementY||t.webkitMovementY||0},getMouseWheelDelta:function(t){var e=0;switch(t.type){case\"DOMMouseScroll\":e=t.detail;break;case\"mousewheel\":e=t.wheelDelta;break;case\"wheel\":e=t.deltaY;break;default:throw\"unrecognized mouse wheel event: \"+t.type}return e},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(t){if(Browser.pointerLock)t.type!=\"mousemove\"&&\"mozMovementX\"in t?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(t),Browser.mouseMovementY=Browser.getMovementY(t)),typeof SDL<\"u\"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var e=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,s=Module.canvas.height,a=typeof window.scrollX<\"u\"?window.scrollX:window.pageXOffset,n=typeof window.scrollY<\"u\"?window.scrollY:window.pageYOffset;if(t.type===\"touchstart\"||t.type===\"touchend\"||t.type===\"touchmove\"){var c=t.touch;if(c===void 0)return;var f=c.pageX-(a+e.left),p=c.pageY-(n+e.top);f=f*(r/e.width),p=p*(s/e.height);var h={x:f,y:p};if(t.type===\"touchstart\")Browser.lastTouches[c.identifier]=h,Browser.touches[c.identifier]=h;else if(t.type===\"touchend\"||t.type===\"touchmove\"){var E=Browser.touches[c.identifier];E||(E=h),Browser.lastTouches[c.identifier]=E,Browser.touches[c.identifier]=h}return}var C=t.pageX-(a+e.left),S=t.pageY-(n+e.top);C=C*(r/e.width),S=S*(s/e.height),Browser.mouseMovementX=C-Browser.mouseX,Browser.mouseMovementY=S-Browser.mouseY,Browser.mouseX=C,Browser.mouseY=S}},asyncLoad:function(t,e,r,s){var a=s?\"\":\"al \"+t;Module.readAsync(t,function(n){assert(n,'Loading data file \"'+t+'\" failed (no arrayBuffer).'),e(new Uint8Array(n)),a&&removeRunDependency(a)},function(n){if(r)r();else throw'Loading data file \"'+t+'\" failed.'}),a&&addRunDependency(a)},resizeListeners:[],updateResizeListeners:function(){var t=Module.canvas;Browser.resizeListeners.forEach(function(e){e(t.width,t.height)})},setCanvasSize:function(t,e,r){var s=Module.canvas;Browser.updateCanvasDimensions(s,t,e),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL<\"u\"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL<\"u\"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t&-8388609,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},updateCanvasDimensions:function(t,e,r){e&&r?(t.widthNative=e,t.heightNative=r):(e=t.widthNative,r=t.heightNative);var s=e,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(s/a<Module.forcedAspectRatio?s=Math.round(a*Module.forcedAspectRatio):a=Math.round(s/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&typeof screen<\"u\"){var n=Math.min(screen.width/s,screen.height/a);s=Math.round(s*n),a=Math.round(a*n)}Browser.resizeCanvas?(t.width!=s&&(t.width=s),t.height!=a&&(t.height=a),typeof t.style<\"u\"&&(t.style.removeProperty(\"width\"),t.style.removeProperty(\"height\"))):(t.width!=e&&(t.width=e),t.height!=r&&(t.height=r),typeof t.style<\"u\"&&(s!=e||a!=r?(t.style.setProperty(\"width\",s+\"px\",\"important\"),t.style.setProperty(\"height\",a+\"px\",\"important\")):(t.style.removeProperty(\"width\"),t.style.removeProperty(\"height\"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var t=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,t}},SYSCALLS={varargs:0,get:function(t){SYSCALLS.varargs+=4;var e=HEAP32[SYSCALLS.varargs-4>>2];return e},getStr:function(){var t=Pointer_stringify(SYSCALLS.get());return t},get64:function(){var t=SYSCALLS.get(),e=SYSCALLS.get();return t>=0?assert(e===0):assert(e===-1),t},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall6(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(s){return(typeof FS>\"u\"||!(s instanceof FS.ErrnoError))&&abort(s),-s.errno}}function ___syscall54(t,e){SYSCALLS.varargs=e;try{return 0}catch(r){return(typeof FS>\"u\"||!(r instanceof FS.ErrnoError))&&abort(r),-r.errno}}function _typeModule(t){var e=[[0,1,\"X\"],[1,1,\"const X\"],[128,1,\"X *\"],[256,1,\"X &\"],[384,1,\"X &&\"],[512,1,\"std::shared_ptr<X>\"],[640,1,\"std::unique_ptr<X>\"],[5120,1,\"std::vector<X>\"],[6144,2,\"std::array<X, Y>\"],[9216,-1,\"std::function<X (Y)>\"]];function r(p,h,E,C,S,P){if(h==1){var I=C&896;(I==128||I==256||I==384)&&(p=\"X const\")}var R;return P?R=E.replace(\"X\",p).replace(\"Y\",S):R=p.replace(\"X\",E).replace(\"Y\",S),R.replace(/([*&]) (?=[*&])/g,\"$1\")}function s(p,h,E,C,S){throw new Error(p+\" type \"+E.replace(\"X\",h+\"?\")+(C?\" with flag \"+C:\"\")+\" in \"+S)}function a(p,h,E,C,S,P,I,R){P===void 0&&(P=\"X\"),R===void 0&&(R=1);var N=E(p);if(N)return N;var U=C(p),W=U.placeholderFlag,ee=e[W];I&&ee&&(P=r(I[2],I[0],P,ee[0],\"?\",!0));var ie;W==0&&(ie=\"Unbound\"),W>=10&&(ie=\"Corrupt\"),R>20&&(ie=\"Deeply nested\"),ie&&s(ie,p,P,W,S||\"?\");var ue=U.paramList[0],le=a(ue,h,E,C,S,P,ee,R+1),me,pe={flags:ee[0],id:p,name:\"\",paramList:[le]},Be=[],Ce=\"?\";switch(U.placeholderFlag){case 1:me=le.spec;break;case 2:if((le.flags&15360)==1024&&le.spec.ptrSize==1){pe.flags=7168;break}case 3:case 6:case 5:me=le.spec,le.flags&15360;break;case 8:Ce=\"\"+U.paramList[1],pe.paramList.push(U.paramList[1]);break;case 9:for(var g=0,we=U.paramList[1];g<we.length;g++){var ye=we[g],Ae=a(ye,h,E,C,S,P,ee,R+1);Be.push(Ae.name),pe.paramList.push(Ae)}Ce=Be.join(\", \");break;default:break}if(pe.name=r(ee[2],ee[0],le.name,le.flags,Ce),me){for(var se=0,Z=Object.keys(me);se<Z.length;se++){var De=Z[se];pe[De]=pe[De]||me[De]}pe.flags|=me.flags}return n(h,pe)}function n(p,h){var E=h.flags,C=E&896,S=E&15360;return!h.name&&S==1024&&(h.ptrSize==1?h.name=(E&16?\"\":(E&8?\"un\":\"\")+\"signed \")+\"char\":h.name=(E&8?\"u\":\"\")+(E&32?\"float\":\"int\")+(h.ptrSize*8+\"_t\")),h.ptrSize==8&&!(E&32)&&(S=64),S==2048&&(C==512||C==640?S=4096:C&&(S=3072)),p(S,h)}var c=function(){function p(h){this.id=h.id,this.name=h.name,this.flags=h.flags,this.spec=h}return p.prototype.toString=function(){return this.name},p}(),f={Type:c,getComplexType:a,makeType:n,structureList:e};return t.output=f,t.output||f}function __nbind_register_type(t,e){var r=_nbind.readAsciiString(e),s={flags:10240,id:t,name:r};_nbind.makeType(_nbind.constructType,s)}function __nbind_register_callback_signature(t,e){var r=_nbind.readTypeIdList(t,e),s=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[s]=_nbind.makeJSCaller(r),s}function __extends(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s}function __nbind_register_class(t,e,r,s,a,n,c){var f=_nbind.readAsciiString(c),p=_nbind.readPolicyList(e),h=HEAPU32.subarray(t/4,t/4+2),E={flags:2048|(p.Value?2:0),id:h[0],name:f},C=_nbind.makeType(_nbind.constructType,E);C.ptrType=_nbind.getComplexType(h[1],_nbind.constructType,_nbind.getType,_nbind.queryType),C.destroy=_nbind.makeMethodCaller(C.ptrType,{boundID:E.id,flags:0,name:\"destroy\",num:0,ptr:n,title:C.name+\".free\",typeList:[\"void\",\"uint32_t\",\"uint32_t\"]}),a&&(C.superIdList=Array.prototype.slice.call(HEAPU32.subarray(r/4,r/4+a)),C.upcastList=Array.prototype.slice.call(HEAPU32.subarray(s/4,s/4+a))),Module[C.name]=C.makeBound(p),_nbind.BindClass.list.push(C)}function _removeAccessorPrefix(t){var e=/^[Gg]et_?([A-Z]?([A-Z]?))/;return t.replace(e,function(r,s,a){return a?s:s.toLowerCase()})}function __nbind_register_function(t,e,r,s,a,n,c,f,p,h){var E=_nbind.getType(t),C=_nbind.readPolicyList(e),S=_nbind.readTypeIdList(r,s),P;if(c==5)P=[{direct:a,name:\"__nbindConstructor\",ptr:0,title:E.name+\" constructor\",typeList:[\"uint32_t\"].concat(S.slice(1))},{direct:n,name:\"__nbindValueConstructor\",ptr:0,title:E.name+\" value constructor\",typeList:[\"void\",\"uint32_t\"].concat(S.slice(1))}];else{var I=_nbind.readAsciiString(f),R=(E.name&&E.name+\".\")+I;(c==3||c==4)&&(I=_removeAccessorPrefix(I)),P=[{boundID:t,direct:n,name:I,ptr:a,title:R,typeList:S}]}for(var N=0,U=P;N<U.length;N++){var W=U[N];W.signatureType=c,W.policyTbl=C,W.num=p,W.flags=h,E.addMethod(W)}}function _nbind_value(t,e){_nbind.typeNameTbl[t]||_nbind.throwError(\"Unknown value type \"+t),Module.NBind.bind_value(t,e),_defineHidden(_nbind.typeNameTbl[t].proto.prototype.__nbindValueConstructor)(e.prototype,\"__nbindValueConstructor\")}Module._nbind_value=_nbind_value;function __nbind_get_value_object(t,e){var r=_nbind.popValue(t);if(!r.fromJS)throw new Error(\"Object \"+r+\" has no fromJS function\");r.fromJS(function(){r.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([e],arguments))})}function _emscripten_memcpy_big(t,e,r){return HEAPU8.set(HEAPU8.subarray(e,e+r),t),t}function __nbind_register_primitive(t,e,r){var s={flags:1024|r,id:t,ptrSize:e};_nbind.makeType(_nbind.constructType,s)}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\"i8\",ALLOC_STATIC);function ___setErrNo(t){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=t),t}function _llvm_stacksave(){var t=_llvm_stacksave;return t.LLVM_SAVEDSTACKS||(t.LLVM_SAVEDSTACKS=[]),t.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),t.LLVM_SAVEDSTACKS.length-1}function ___syscall140(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD(),s=SYSCALLS.get(),a=SYSCALLS.get(),n=SYSCALLS.get(),c=SYSCALLS.get(),f=a;return FS.llseek(r,f,c),HEAP32[n>>2]=r.position,r.getdents&&f===0&&c===0&&(r.getdents=null),0}catch(p){return(typeof FS>\"u\"||!(p instanceof FS.ErrnoError))&&abort(p),-p.errno}}function ___syscall146(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.get(),s=SYSCALLS.get(),a=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(E,C){var S=___syscall146.buffers[E];assert(S),C===0||C===10?((E===1?Module.print:Module.printErr)(UTF8ArrayToString(S,0)),S.length=0):S.push(C)});for(var c=0;c<a;c++){for(var f=HEAP32[s+c*8>>2],p=HEAP32[s+(c*8+4)>>2],h=0;h<p;h++)___syscall146.printChar(r,HEAPU8[f+h]);n+=p}return n}catch(E){return(typeof FS>\"u\"||!(E instanceof FS.ErrnoError))&&abort(E),-E.errno}}function __nbind_finish(){for(var t=0,e=_nbind.BindClass.list;t<e.length;t++){var r=e[t];r.finish()}}var ___dso_handle=STATICTOP;STATICTOP+=16,function(_nbind){var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function t(){}return t.lalloc=function(e){e=e+7&-8;var r=HEAPU32[t.usedPtr];if(e>t.pageSize/2||e>t.pageSize-r){var s=_nbind.typeNameTbl.NBind.proto;return s.lalloc(e)}else return HEAPU32[t.usedPtr]=r+e,t.rootPtr+r},t.lreset=function(e,r){var s=HEAPU32[t.pagePtr];if(s){var a=_nbind.typeNameTbl.NBind.proto;a.lreset(e,r)}else HEAPU32[t.usedPtr]=e},t}();_nbind.Pool=Pool;function constructType(t,e){var r=t==10240?_nbind.makeTypeNameTbl[e.name]||_nbind.BindType:_nbind.makeTypeKindTbl[t],s=new r(e);return typeIdTbl[e.id]=s,_nbind.typeNameTbl[e.name]=s,s}_nbind.constructType=constructType;function getType(t){return typeIdTbl[t]}_nbind.getType=getType;function queryType(t){var e=HEAPU8[t],r=_nbind.structureList[e][1];t/=4,r<0&&(++t,r=HEAPU32[t]+1);var s=Array.prototype.slice.call(HEAPU32.subarray(t+1,t+1+r));return e==9&&(s=[s[0],s.slice(1)]),{paramList:s,placeholderFlag:e}}_nbind.queryType=queryType;function getTypes(t,e){return t.map(function(r){return typeof r==\"number\"?_nbind.getComplexType(r,constructType,getType,queryType,e):_nbind.typeNameTbl[r]})}_nbind.getTypes=getTypes;function readTypeIdList(t,e){return Array.prototype.slice.call(HEAPU32,t/4,t/4+e)}_nbind.readTypeIdList=readTypeIdList;function readAsciiString(t){for(var e=t;HEAPU8[e++];);return String.fromCharCode.apply(\"\",HEAPU8.subarray(t,e-1))}_nbind.readAsciiString=readAsciiString;function readPolicyList(t){var e={};if(t)for(;;){var r=HEAPU32[t/4];if(!r)break;e[readAsciiString(r)]=!0,t+=4}return e}_nbind.readPolicyList=readPolicyList;function getDynCall(t,e){var r={float32_t:\"d\",float64_t:\"d\",int64_t:\"d\",uint64_t:\"d\",void:\"v\"},s=t.map(function(n){return r[n.name]||\"i\"}).join(\"\"),a=Module[\"dynCall_\"+s];if(!a)throw new Error(\"dynCall_\"+s+\" not found for \"+e+\"(\"+t.map(function(n){return n.name}).join(\", \")+\")\");return a}_nbind.getDynCall=getDynCall;function addMethod(t,e,r,s){var a=t[e];t.hasOwnProperty(e)&&a?((a.arity||a.arity===0)&&(a=_nbind.makeOverloader(a,a.arity),t[e]=a),a.addMethod(r,s)):(r.arity=s,t[e]=r)}_nbind.addMethod=addMethod;function throwError(t){throw new Error(t)}_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.heap=HEAPU32,r.ptrSize=4,r}return e.prototype.needsWireRead=function(r){return!!this.wireRead||!!this.makeWireRead},e.prototype.needsWireWrite=function(r){return!!this.wireWrite||!!this.makeWireWrite},e}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this,a=r.flags&32?{32:HEAPF32,64:HEAPF64}:r.flags&8?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return s.heap=a[r.ptrSize*8],s.ptrSize=r.ptrSize,s}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireWrite=function(r,s){return s&&s.Strict&&function(a){if(typeof a==\"number\")return a;throw new Error(\"Type mismatch\")}},e}(BindType);_nbind.PrimitiveType=PrimitiveType;function pushCString(t,e){if(t==null){if(e&&e.Nullable)return 0;throw new Error(\"Type mismatch\")}if(e&&e.Strict){if(typeof t!=\"string\")throw new Error(\"Type mismatch\")}else t=t.toString();var r=Module.lengthBytesUTF8(t)+1,s=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(t,HEAPU8,s,r),s}_nbind.pushCString=pushCString;function popCString(t){return t===0?null:Module.Pointer_stringify(t)}_nbind.popCString=popCString;var CStringType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popCString,r.wireWrite=pushCString,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushCString(a,s)}},e}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=function(s){return!!s},r}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireRead=function(r){return\"!!(\"+r+\")\"},e.prototype.makeWireWrite=function(r,s){return s&&s.Strict&&function(a){if(typeof a==\"boolean\")return a;throw new Error(\"Type mismatch\")}||r},e}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function t(){}return t.prototype.persist=function(){this.__nbindState|=1},t}();_nbind.Wrapper=Wrapper;function makeBound(t,e){var r=function(s){__extends(a,s);function a(n,c,f,p){var h=s.call(this)||this;if(!(h instanceof a))return new(Function.prototype.bind.apply(a,Array.prototype.concat.apply([null],arguments)));var E=c,C=f,S=p;if(n!==_nbind.ptrMarker){var P=h.__nbindConstructor.apply(h,arguments);E=4608,S=HEAPU32[P/4],C=HEAPU32[P/4+1]}var I={configurable:!0,enumerable:!1,value:null,writable:!1},R={__nbindFlags:E,__nbindPtr:C};S&&(R.__nbindShared=S,_nbind.mark(h));for(var N=0,U=Object.keys(R);N<U.length;N++){var W=U[N];I.value=R[W],Object.defineProperty(h,W,I)}return _defineHidden(0)(h,\"__nbindState\"),h}return a.prototype.free=function(){e.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,\"__nbindShared\"),disableMember(this,\"__nbindPtr\")},a}(Wrapper);return __decorate([_defineHidden()],r.prototype,\"__nbindConstructor\",void 0),__decorate([_defineHidden()],r.prototype,\"__nbindValueConstructor\",void 0),__decorate([_defineHidden(t)],r.prototype,\"__nbindPolicies\",void 0),r}_nbind.makeBound=makeBound;function disableMember(t,e){function r(){throw new Error(\"Accessing deleted object\")}Object.defineProperty(t,e,{configurable:!1,enumerable:!1,get:r,set:r})}_nbind.ptrMarker={};var BindClass=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;return s.wireRead=function(a){return _nbind.popValue(a,s.ptrType)},s.wireWrite=function(a){return pushPointer(a,s.ptrType,!0)},s.pendingSuperCount=0,s.ready=!1,s.methodTbl={},r.paramList?(s.classType=r.paramList[0].classType,s.proto=s.classType.proto):s.classType=s,s}return e.prototype.makeBound=function(r){var s=_nbind.makeBound(r,this);return this.proto=s,this.ptrType.proto=s,s},e.prototype.addMethod=function(r){var s=this.methodTbl[r.name]||[];s.push(r),this.methodTbl[r.name]=s},e.prototype.registerMethods=function(r,s){for(var a,n=0,c=Object.keys(r.methodTbl);n<c.length;n++)for(var f=c[n],p=r.methodTbl[f],h=0,E=p;h<E.length;h++){var C=E[h],S=void 0,P=void 0;if(S=this.proto.prototype,!(s&&C.signatureType!=1))switch(C.signatureType){case 1:S=this.proto;case 5:P=_nbind.makeCaller(C),_nbind.addMethod(S,C.name,P,C.typeList.length-1);break;case 4:a=_nbind.makeMethodCaller(r.ptrType,C);break;case 3:Object.defineProperty(S,C.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(r.ptrType,C),set:a});break;case 2:P=_nbind.makeMethodCaller(r.ptrType,C),_nbind.addMethod(S,C.name,P,C.typeList.length-1);break;default:break}}},e.prototype.registerSuperMethods=function(r,s,a){if(!a[r.name]){a[r.name]=!0;for(var n=0,c,f=0,p=r.superIdList||[];f<p.length;f++){var h=p[f],E=_nbind.getType(h);n++<s||s<0?c=-1:c=0,this.registerSuperMethods(E,c,a)}this.registerMethods(r,s<0)}},e.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map(function(a){return _nbind.getType(a).finish()});var r=this.proto;if(this.superList.length){var s=function(){this.constructor=r};s.prototype=this.superList[0].proto.prototype,r.prototype=new s}return r!=Module&&(r.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},e.prototype.upcastStep=function(r,s){if(r==this)return s;for(var a=0;a<this.superList.length;++a){var n=this.superList[a].upcastStep(r,_nbind.callUpcast(this.upcastList[a],s));if(n)return n}return 0},e}(_nbind.BindType);BindClass.list=[],_nbind.BindClass=BindClass;function popPointer(t,e){return t?new e.proto(_nbind.ptrMarker,e.flags,t):null}_nbind.popPointer=popPointer;function pushPointer(t,e,r){if(!(t instanceof _nbind.Wrapper)){if(r)return _nbind.pushValue(t);throw new Error(\"Type mismatch\")}var s=t.__nbindPtr,a=t.__nbindType.classType,n=e.classType;if(t instanceof e.proto)for(;a!=n;)s=_nbind.callUpcast(a.upcastList[0],s),a=a.superList[0];else if(s=a.upcastStep(n,s),!s)throw new Error(\"Type mismatch\");return s}_nbind.pushPointer=pushPointer;function pushMutablePointer(t,e){var r=pushPointer(t,e);if(t.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return r}var BindClassPtr=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;s.classType=r.paramList[0].classType,s.proto=s.classType.proto;var a=r.flags&1,n=(s.flags&896)==256&&r.flags&2,c=a?pushPointer:pushMutablePointer,f=n?_nbind.popValue:popPointer;return s.makeWireWrite=function(p,h){return h.Nullable?function(E){return E?c(E,s):0}:function(E){return c(E,s)}},s.wireRead=function(p){return f(p,s)},s.wireWrite=function(p){return c(p,s)},s}return e}(_nbind.BindType);_nbind.BindClassPtr=BindClassPtr;function popShared(t,e){var r=HEAPU32[t/4],s=HEAPU32[t/4+1];return s?new e.proto(_nbind.ptrMarker,e.flags,s,r):null}_nbind.popShared=popShared;function pushShared(t,e){if(!(t instanceof e.proto))throw new Error(\"Type mismatch\");return t.__nbindShared}function pushMutableShared(t,e){if(!(t instanceof e.proto))throw new Error(\"Type mismatch\");if(t.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return t.__nbindShared}var SharedClassPtr=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;s.readResources=[_nbind.resources.pool],s.classType=r.paramList[0].classType,s.proto=s.classType.proto;var a=r.flags&1,n=a?pushShared:pushMutableShared;return s.wireRead=function(c){return popShared(c,s)},s.wireWrite=function(c){return n(c,s)},s}return e}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function t(e){this.refCount=1,this.data=e}return t.prototype.register=function(){var e=firstFreeExternal;return e?firstFreeExternal=_nbind.externalList[e]:e=_nbind.externalList.length,_nbind.externalList[e]=this,e},t.prototype.reference=function(){++this.refCount},t.prototype.dereference=function(e){--this.refCount==0&&(this.free&&this.free(),_nbind.externalList[e]=firstFreeExternal,firstFreeExternal=e)},t}();_nbind.External=External;function popExternal(t){var e=_nbind.externalList[t];return e.dereference(t),e.data}function pushExternal(t){var e=new External(t);return e.reference(),e.register()}var ExternalType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popExternal,r.wireWrite=pushExternal,r}return e}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=function(s){return typeof s!=\"function\"&&_nbind.throwError(\"Type mismatch\"),new _nbind.External(s).register()},r}return e}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;function pushValue(t){var e=firstFreeValue;return e?firstFreeValue=_nbind.valueList[e]:e=_nbind.valueList.length,_nbind.valueList[e]=t,e*2+1}_nbind.pushValue=pushValue;function popValue(t,e){if(t||_nbind.throwError(\"Value type JavaScript class is missing or not registered\"),t&1){t>>=1;var r=_nbind.valueList[t];return _nbind.valueList[t]=firstFreeValue,firstFreeValue=t,r}else{if(e)return _nbind.popShared(t,e);throw new Error(\"Invalid value slot \"+t)}}_nbind.popValue=popValue;var valueBase=18446744073709552e3;function push64(t){return typeof t==\"number\"?t:pushValue(t)*4096+valueBase}function pop64(t){return t<valueBase?t:popValue((t-valueBase)/4096)}var CreateValueType=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeWireWrite=function(r){return\"(_nbind.pushValue(new \"+r+\"))\"},e}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=push64,r.wireRead=pop64,r}return e}(_nbind.BindType);_nbind.Int64Type=Int64Type;function pushArray(t,e){if(!t)return 0;var r=t.length;if((e.size||e.size===0)&&r<e.size)throw new Error(\"Type mismatch\");var s=e.memberType.ptrSize,a=_nbind.Pool.lalloc(4+r*s);HEAPU32[a/4]=r;var n=e.memberType.heap,c=(a+4)/s,f=e.memberType.wireWrite,p=0;if(f)for(;p<r;)n[c++]=f(t[p++]);else for(;p<r;)n[c++]=t[p++];return a}_nbind.pushArray=pushArray;function popArray(t,e){if(t===0)return null;var r=HEAPU32[t/4],s=new Array(r),a=e.memberType.heap;t=(t+4)/e.memberType.ptrSize;var n=e.memberType.wireRead,c=0;if(n)for(;c<r;)s[c++]=n(a[t++]);else for(;c<r;)s[c++]=a[t++];return s}_nbind.popArray=popArray;var ArrayType=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;return s.wireRead=function(a){return popArray(a,s)},s.wireWrite=function(a){return pushArray(a,s)},s.readResources=[_nbind.resources.pool],s.writeResources=[_nbind.resources.pool],s.memberType=r.paramList[0],r.paramList[1]&&(s.size=r.paramList[1]),s}return e}(_nbind.BindType);_nbind.ArrayType=ArrayType;function pushString(t,e){if(t==null)if(e&&e.Nullable)t=\"\";else throw new Error(\"Type mismatch\");if(e&&e.Strict){if(typeof t!=\"string\")throw new Error(\"Type mismatch\")}else t=t.toString();var r=Module.lengthBytesUTF8(t),s=_nbind.Pool.lalloc(4+r+1);return HEAPU32[s/4]=r,Module.stringToUTF8Array(t,HEAPU8,s+4,r+1),s}_nbind.pushString=pushString;function popString(t){if(t===0)return null;var e=HEAPU32[t/4];return Module.Pointer_stringify(t+4,e)}_nbind.popString=popString;var StringType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popString,r.wireWrite=pushString,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushString(a,s)}},e}(_nbind.BindType);_nbind.StringType=StringType;function makeArgList(t){return Array.apply(null,Array(t)).map(function(e,r){return\"a\"+(r+1)})}function anyNeedsWireWrite(t,e){return t.reduce(function(r,s){return r||s.needsWireWrite(e)},!1)}function anyNeedsWireRead(t,e){return t.reduce(function(r,s){return r||!!s.needsWireRead(e)},!1)}function makeWireRead(t,e,r,s){var a=t.length;return r.makeWireRead?r.makeWireRead(s,t,a):r.wireRead?(t[a]=r.wireRead,\"(convertParamList[\"+a+\"](\"+s+\"))\"):s}function makeWireWrite(t,e,r,s){var a,n=t.length;return r.makeWireWrite?a=r.makeWireWrite(s,e,t,n):a=r.wireWrite,a?typeof a==\"string\"?a:(t[n]=a,\"(convertParamList[\"+n+\"](\"+s+\"))\"):s}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,\"dynCall(\"+[prefix].concat(argList.map(function(t,e){return makeWireWrite(convertParamList,policyTbl,argTypeList[e],t)})).join(\",\")+\")\"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode=\"function(\"+argList.join(\",\")+\"){\"+(mask?\"this.__nbindFlags&mask&&err();\":\"\")+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,\"_nbind.externalList[num].data(\"+argList.map(function(t,e){return makeWireRead(convertParamList,null,argTypeList[e],t)}).join(\",\")+\")\"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode=\"function(\"+[\"dummy\",\"num\"].concat(argList).join(\",\")+\"){\"+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}_nbind.buildJSCallerFunction=buildJSCallerFunction;function makeJSCaller(t){var e=t.length-1,r=_nbind.getTypes(t,\"callback\"),s=r[0],a=r.slice(1),n=anyNeedsWireRead(a,null),c=s.needsWireWrite(null);if(!c&&!n)switch(e){case 0:return function(f,p){return _nbind.externalList[p].data()};case 1:return function(f,p,h){return _nbind.externalList[p].data(h)};case 2:return function(f,p,h,E){return _nbind.externalList[p].data(h,E)};case 3:return function(f,p,h,E,C){return _nbind.externalList[p].data(h,E,C)};default:break}return buildJSCallerFunction(s,a)}_nbind.makeJSCaller=makeJSCaller;function makeMethodCaller(t,e){var r=e.typeList.length-1,s=e.typeList.slice(0);s.splice(1,0,\"uint32_t\",e.boundID);var a=_nbind.getTypes(s,e.title),n=a[0],c=a.slice(3),f=n.needsWireRead(e.policyTbl),p=anyNeedsWireWrite(c,e.policyTbl),h=e.ptr,E=e.num,C=_nbind.getDynCall(a,e.title),S=~e.flags&1;function P(){throw new Error(\"Calling a non-const method on a const object\")}if(!f&&!p)switch(r){case 0:return function(){return this.__nbindFlags&S?P():C(h,E,_nbind.pushPointer(this,t))};case 1:return function(I){return this.__nbindFlags&S?P():C(h,E,_nbind.pushPointer(this,t),I)};case 2:return function(I,R){return this.__nbindFlags&S?P():C(h,E,_nbind.pushPointer(this,t),I,R)};case 3:return function(I,R,N){return this.__nbindFlags&S?P():C(h,E,_nbind.pushPointer(this,t),I,R,N)};default:break}return buildCallerFunction(C,t,h,E,e.policyTbl,p,\"ptr,num,pushPointer(this,ptrType)\",n,c,S,P)}_nbind.makeMethodCaller=makeMethodCaller;function makeCaller(t){var e=t.typeList.length-1,r=_nbind.getTypes(t.typeList,t.title),s=r[0],a=r.slice(1),n=s.needsWireRead(t.policyTbl),c=anyNeedsWireWrite(a,t.policyTbl),f=t.direct,p=t.ptr;if(t.direct&&!n&&!c){var h=_nbind.getDynCall(r,t.title);switch(e){case 0:return function(){return h(f)};case 1:return function(P){return h(f,P)};case 2:return function(P,I){return h(f,P,I)};case 3:return function(P,I,R){return h(f,P,I,R)};default:break}p=0}var E;if(p){var C=t.typeList.slice(0);C.splice(1,0,\"uint32_t\"),r=_nbind.getTypes(C,t.title),E=\"ptr,num\"}else p=f,E=\"ptr\";var S=_nbind.getDynCall(r,t.title);return buildCallerFunction(S,null,p,t.num,t.policyTbl,c,E,s,a)}_nbind.makeCaller=makeCaller;function makeOverloader(t,e){var r=[];function s(){return r[arguments.length].apply(this,arguments)}return s.addMethod=function(a,n){r[n]=a},s.addMethod(t,e),s}_nbind.makeOverloader=makeOverloader;var Resource=function(){function t(e,r){var s=this;this.makeOpen=function(){return Object.keys(s.openTbl).join(\"\")},this.makeClose=function(){return Object.keys(s.closeTbl).join(\"\")},this.openTbl={},this.closeTbl={},e&&(this.openTbl[e]=!0),r&&(this.closeTbl[r]=!0)}return t.prototype.add=function(e){for(var r=0,s=Object.keys(e.openTbl);r<s.length;r++){var a=s[r];this.openTbl[a]=!0}for(var n=0,c=Object.keys(e.closeTbl);n<c.length;n++){var a=c[n];this.closeTbl[a]=!0}},t.prototype.remove=function(e){for(var r=0,s=Object.keys(e.openTbl);r<s.length;r++){var a=s[r];delete this.openTbl[a]}for(var n=0,c=Object.keys(e.closeTbl);n<c.length;n++){var a=c[n];delete this.closeTbl[a]}},t}();_nbind.Resource=Resource;function listResources(t,e){for(var r=new Resource,s=0,a=t;s<a.length;s++)for(var n=a[s],c=0,f=n.readResources||[];c<f.length;c++){var p=f[c];r.add(p)}for(var h=0,E=e;h<E.length;h++)for(var n=E[h],C=0,S=n.writeResources||[];C<S.length;C++){var p=S[C];r.add(p)}return r}_nbind.listResources=listResources,_nbind.resources={pool:new Resource(\"var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];\",\"_nbind.Pool.lreset(used,page);\")};var ExternalBuffer=function(t){__extends(e,t);function e(r,s){var a=t.call(this,r)||this;return a.ptr=s,a}return e.prototype.free=function(){_free(this.ptr)},e}(_nbind.External);function getBuffer(t){return t instanceof ArrayBuffer?new Uint8Array(t):t instanceof DataView?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function pushBuffer(t,e){if(t==null&&e&&e.Nullable&&(t=[]),typeof t!=\"object\")throw new Error(\"Type mismatch\");var r=t,s=r.byteLength||r.length;if(!s&&s!==0&&r.byteLength!==0)throw new Error(\"Type mismatch\");var a=_nbind.Pool.lalloc(8),n=_malloc(s),c=a/4;return HEAPU32[c++]=s,HEAPU32[c++]=n,HEAPU32[c++]=new ExternalBuffer(t,n).register(),HEAPU8.set(getBuffer(t),n),a}var BufferType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=pushBuffer,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushBuffer(a,s)}},e}(_nbind.BindType);_nbind.BufferType=BufferType;function commitBuffer(t,e,r){var s=_nbind.externalList[t].data,a=Buffer;if(typeof Buffer!=\"function\"&&(a=function(){}),!(s instanceof Array)){var n=HEAPU8.subarray(e,e+r);if(s instanceof a){var c=void 0;typeof Buffer.from==\"function\"&&Buffer.from.length>=3?c=Buffer.from(n):c=new Buffer(n),c.copy(s)}else getBuffer(s).set(n)}}_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var t=0,e=dirtyList;t<e.length;t++){var r=e[t];r.__nbindState&3||r.free()}dirtyList=[],gcTimer=0}_nbind.mark=function(t){};function toggleLightGC(t){t?_nbind.mark=function(e){dirtyList.push(e),gcTimer||(gcTimer=setTimeout(sweep,0))}:_nbind.mark=function(e){}}_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function t(e,r,s){Module.printErr(\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\"),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(e,r,s)},Module.requestFullscreen=function t(e,r,s){Browser.requestFullscreen(e,r,s)},Module.requestAnimationFrame=function t(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function t(e,r,s){Browser.setCanvasSize(e,r,s)},Module.pauseMainLoop=function t(){Browser.mainLoop.pause()},Module.resumeMainLoop=function t(){Browser.mainLoop.resume()},Module.getUserMedia=function t(){Browser.getUserMedia()},Module.createContext=function t(e,r,s,a){return Browser.createContext(e,r,s,a)},ENVIRONMENT_IS_NODE?_emscripten_get_now=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof dateNow<\"u\"?_emscripten_get_now=dateNow:typeof self==\"object\"&&self.performance&&typeof self.performance.now==\"function\"?_emscripten_get_now=function(){return self.performance.now()}:typeof performance==\"object\"&&typeof performance.now==\"function\"?_emscripten_get_now=function(){return performance.now()}:_emscripten_get_now=Date.now,__ATEXIT__.push(function(){var t=Module._fflush;t&&t(0);var e=___syscall146.printChar;if(e){var r=___syscall146.buffers;r[1].length&&e(1,10),r[2].length&&e(2,10)}}),DYNAMICTOP_PTR=allocate(1,\"i32\",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0;function invoke_viiiii(t,e,r,s,a,n){try{Module.dynCall_viiiii(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_vif(t,e,r){try{Module.dynCall_vif(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_vid(t,e,r){try{Module.dynCall_vid(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_fiff(t,e,r,s){try{return Module.dynCall_fiff(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_vi(t,e){try{Module.dynCall_vi(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_vii(t,e,r){try{Module.dynCall_vii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_ii(t,e){try{return Module.dynCall_ii(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_viddi(t,e,r,s,a){try{Module.dynCall_viddi(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}function invoke_vidd(t,e,r,s){try{Module.dynCall_vidd(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_iiii(t,e,r,s){try{return Module.dynCall_iiii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_diii(t,e,r,s){try{return Module.dynCall_diii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_di(t,e){try{return Module.dynCall_di(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_iid(t,e,r){try{return Module.dynCall_iid(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_iii(t,e,r){try{return Module.dynCall_iii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_viiddi(t,e,r,s,a,n){try{Module.dynCall_viiddi(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiiiii(t,e,r,s,a,n,c){try{Module.dynCall_viiiiii(t,e,r,s,a,n,c)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_dii(t,e,r){try{return Module.dynCall_dii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_i(t){try{return Module.dynCall_i(t)}catch(e){if(typeof e!=\"number\"&&e!==\"longjmp\")throw e;Module.setThrew(1,0)}}function invoke_iiiiii(t,e,r,s,a,n){try{return Module.dynCall_iiiiii(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiid(t,e,r,s,a){try{Module.dynCall_viiid(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}function invoke_viififi(t,e,r,s,a,n,c){try{Module.dynCall_viififi(t,e,r,s,a,n,c)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_viii(t,e,r,s){try{Module.dynCall_viii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_v(t){try{Module.dynCall_v(t)}catch(e){if(typeof e!=\"number\"&&e!==\"longjmp\")throw e;Module.setThrew(1,0)}}function invoke_viid(t,e,r,s){try{Module.dynCall_viid(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_idd(t,e,r){try{return Module.dynCall_idd(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_viiii(t,e,r,s,a){try{Module.dynCall_viiii(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(t,e,r){var s=new t.Int8Array(r),a=new t.Int16Array(r),n=new t.Int32Array(r),c=new t.Uint8Array(r),f=new t.Uint16Array(r),p=new t.Uint32Array(r),h=new t.Float32Array(r),E=new t.Float64Array(r),C=e.DYNAMICTOP_PTR|0,S=e.tempDoublePtr|0,P=e.ABORT|0,I=e.STACKTOP|0,R=e.STACK_MAX|0,N=e.cttz_i8|0,U=e.___dso_handle|0,W=0,ee=0,ie=0,ue=0,le=t.NaN,me=t.Infinity,pe=0,Be=0,Ce=0,g=0,we=0,ye=0,Ae=t.Math.floor,se=t.Math.abs,Z=t.Math.sqrt,De=t.Math.pow,Re=t.Math.cos,mt=t.Math.sin,j=t.Math.tan,rt=t.Math.acos,Fe=t.Math.asin,Ne=t.Math.atan,Pe=t.Math.atan2,Ve=t.Math.exp,ke=t.Math.log,it=t.Math.ceil,Ue=t.Math.imul,x=t.Math.min,w=t.Math.max,b=t.Math.clz32,y=t.Math.fround,F=e.abort,z=e.assert,X=e.enlargeMemory,$=e.getTotalMemory,oe=e.abortOnCannotGrowMemory,xe=e.invoke_viiiii,Te=e.invoke_vif,lt=e.invoke_vid,Ct=e.invoke_fiff,qt=e.invoke_vi,ir=e.invoke_vii,Pt=e.invoke_ii,gn=e.invoke_viddi,Pr=e.invoke_vidd,Ir=e.invoke_iiii,Or=e.invoke_diii,on=e.invoke_di,ai=e.invoke_iid,Io=e.invoke_iii,rs=e.invoke_viiddi,$s=e.invoke_viiiiii,Co=e.invoke_dii,ji=e.invoke_i,eo=e.invoke_iiiiii,wo=e.invoke_viiid,QA=e.invoke_viififi,Af=e.invoke_viii,dh=e.invoke_v,mh=e.invoke_viid,to=e.invoke_idd,jn=e.invoke_viiii,Ts=e._emscripten_asm_const_iiiii,ro=e._emscripten_asm_const_iiidddddd,ou=e._emscripten_asm_const_iiiid,au=e.__nbind_reference_external,lu=e._emscripten_asm_const_iiiiiiii,TA=e._removeAccessorPrefix,RA=e._typeModule,oa=e.__nbind_register_pool,aa=e.__decorate,FA=e._llvm_stackrestore,gr=e.___cxa_atexit,Bo=e.__extends,Me=e.__nbind_get_value_object,cu=e.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,Cr=e._emscripten_set_main_loop_timing,pf=e.__nbind_register_primitive,NA=e.__nbind_register_type,OA=e._emscripten_memcpy_big,uu=e.__nbind_register_function,fu=e.___setErrNo,oc=e.__nbind_register_class,ve=e.__nbind_finish,Nt=e._abort,ac=e._nbind_value,Oi=e._llvm_stacksave,no=e.___syscall54,Rt=e._defineHidden,xn=e._emscripten_set_main_loop,la=e._emscripten_get_now,Gi=e.__nbind_register_callback_signature,Li=e._emscripten_asm_const_iiiiii,Na=e.__nbind_free_external,dn=e._emscripten_asm_const_iiii,Kn=e._emscripten_asm_const_iiididi,Au=e.___syscall6,yh=e._atexit,Oa=e.___syscall140,La=e.___syscall146,Ma=y(0);let $e=y(0);function Ua(o){o=o|0;var l=0;return l=I,I=I+o|0,I=I+15&-16,l|0}function hf(){return I|0}function lc(o){o=o|0,I=o}function wn(o,l){o=o|0,l=l|0,I=o,R=l}function ca(o,l){o=o|0,l=l|0,W||(W=o,ee=l)}function LA(o){o=o|0,ye=o}function MA(){return ye|0}function ua(){var o=0,l=0;Qr(8104,8,400)|0,Qr(8504,408,540)|0,o=9044,l=o+44|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));s[9088]=0,s[9089]=1,n[2273]=0,n[2274]=948,n[2275]=948,gr(17,8104,U|0)|0}function Bl(o){o=o|0,dt(o+948|0)}function Mt(o){return o=y(o),((fP(o)|0)&2147483647)>>>0>2139095040|0}function kn(o,l,u){o=o|0,l=l|0,u=u|0;e:do if(n[o+(l<<3)+4>>2]|0)o=o+(l<<3)|0;else{if((l|2|0)==3&&n[o+60>>2]|0){o=o+56|0;break}switch(l|0){case 0:case 2:case 4:case 5:{if(n[o+52>>2]|0){o=o+48|0;break e}break}default:}if(n[o+68>>2]|0){o=o+64|0;break}else{o=(l|1|0)==5?948:u;break}}while(!1);return o|0}function fa(o){o=o|0;var l=0;return l=_P(1e3)|0,Ha(o,(l|0)!=0,2456),n[2276]=(n[2276]|0)+1,Qr(l|0,8104,1e3)|0,s[o+2>>0]|0&&(n[l+4>>2]=2,n[l+12>>2]=4),n[l+976>>2]=o,l|0}function Ha(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;d=I,I=I+16|0,A=d,l||(n[A>>2]=u,Wg(o,5,3197,A)),I=d}function ns(){return fa(956)|0}function cc(o){o=o|0;var l=0;return l=Kt(1e3)|0,pu(l,o),Ha(n[o+976>>2]|0,1,2456),n[2276]=(n[2276]|0)+1,n[l+944>>2]=0,l|0}function pu(o,l){o=o|0,l=l|0;var u=0;Qr(o|0,l|0,948)|0,Dy(o+948|0,l+948|0),u=o+960|0,o=l+960|0,l=u+40|0;do n[u>>2]=n[o>>2],u=u+4|0,o=o+4|0;while((u|0)<(l|0))}function uc(o){o=o|0;var l=0,u=0,A=0,d=0;if(l=o+944|0,u=n[l>>2]|0,u|0&&(ja(u+948|0,o)|0,n[l>>2]=0),u=Mi(o)|0,u|0){l=0;do n[(Is(o,l)|0)+944>>2]=0,l=l+1|0;while((l|0)!=(u|0))}u=o+948|0,A=n[u>>2]|0,d=o+952|0,l=n[d>>2]|0,(l|0)!=(A|0)&&(n[d>>2]=l+(~((l+-4-A|0)>>>2)<<2)),vl(u),HP(o),n[2276]=(n[2276]|0)+-1}function ja(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0;A=n[o>>2]|0,k=o+4|0,u=n[k>>2]|0,m=u;e:do if((A|0)==(u|0))d=A,B=4;else for(o=A;;){if((n[o>>2]|0)==(l|0)){d=o,B=4;break e}if(o=o+4|0,(o|0)==(u|0)){o=0;break}}while(!1);return(B|0)==4&&((d|0)!=(u|0)?(A=d+4|0,o=m-A|0,l=o>>2,l&&(Q2(d|0,A|0,o|0)|0,u=n[k>>2]|0),o=d+(l<<2)|0,(u|0)==(o|0)||(n[k>>2]=u+(~((u+-4-o|0)>>>2)<<2)),o=1):o=0),o|0}function Mi(o){return o=o|0,(n[o+952>>2]|0)-(n[o+948>>2]|0)>>2|0}function Is(o,l){o=o|0,l=l|0;var u=0;return u=n[o+948>>2]|0,(n[o+952>>2]|0)-u>>2>>>0>l>>>0?o=n[u+(l<<2)>>2]|0:o=0,o|0}function vl(o){o=o|0;var l=0,u=0,A=0,d=0;A=I,I=I+32|0,l=A,d=n[o>>2]|0,u=(n[o+4>>2]|0)-d|0,((n[o+8>>2]|0)-d|0)>>>0>u>>>0&&(d=u>>2,ky(l,d,d,o+8|0),AP(o,l),Qy(l)),I=A}function gf(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0;M=Mi(o)|0;do if(M|0){if((n[(Is(o,0)|0)+944>>2]|0)==(o|0)){if(!(ja(o+948|0,l)|0))break;Qr(l+400|0,8504,540)|0,n[l+944>>2]=0,Oe(o);break}B=n[(n[o+976>>2]|0)+12>>2]|0,k=o+948|0,T=(B|0)==0,u=0,m=0;do A=n[(n[k>>2]|0)+(m<<2)>>2]|0,(A|0)==(l|0)?Oe(o):(d=cc(A)|0,n[(n[k>>2]|0)+(u<<2)>>2]=d,n[d+944>>2]=o,T||dU[B&15](A,d,o,u),u=u+1|0),m=m+1|0;while((m|0)!=(M|0));if(u>>>0<M>>>0){T=o+948|0,k=o+952|0,B=u,u=n[k>>2]|0;do m=(n[T>>2]|0)+(B<<2)|0,A=m+4|0,d=u-A|0,l=d>>2,l&&(Q2(m|0,A|0,d|0)|0,u=n[k>>2]|0),d=u,A=m+(l<<2)|0,(d|0)!=(A|0)&&(u=d+(~((d+-4-A|0)>>>2)<<2)|0,n[k>>2]=u),B=B+1|0;while((B|0)!=(M|0))}}while(!1)}function fc(o){o=o|0;var l=0,u=0,A=0,d=0;wi(o,(Mi(o)|0)==0,2491),wi(o,(n[o+944>>2]|0)==0,2545),l=o+948|0,u=n[l>>2]|0,A=o+952|0,d=n[A>>2]|0,(d|0)!=(u|0)&&(n[A>>2]=d+(~((d+-4-u|0)>>>2)<<2)),vl(l),l=o+976|0,u=n[l>>2]|0,Qr(o|0,8104,1e3)|0,s[u+2>>0]|0&&(n[o+4>>2]=2,n[o+12>>2]=4),n[l>>2]=u}function wi(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;d=I,I=I+16|0,A=d,l||(n[A>>2]=u,xo(o,5,3197,A)),I=d}function Qn(){return n[2276]|0}function Ac(){var o=0;return o=_P(20)|0,Ke((o|0)!=0,2592),n[2277]=(n[2277]|0)+1,n[o>>2]=n[239],n[o+4>>2]=n[240],n[o+8>>2]=n[241],n[o+12>>2]=n[242],n[o+16>>2]=n[243],o|0}function Ke(o,l){o=o|0,l=l|0;var u=0,A=0;A=I,I=I+16|0,u=A,o||(n[u>>2]=l,xo(0,5,3197,u)),I=A}function st(o){o=o|0,HP(o),n[2277]=(n[2277]|0)+-1}function St(o,l){o=o|0,l=l|0;var u=0;l?(wi(o,(Mi(o)|0)==0,2629),u=1):(u=0,l=0),n[o+964>>2]=l,n[o+988>>2]=u}function lr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,m=A+8|0,d=A+4|0,B=A,n[d>>2]=l,wi(o,(n[l+944>>2]|0)==0,2709),wi(o,(n[o+964>>2]|0)==0,2763),te(o),l=o+948|0,n[B>>2]=(n[l>>2]|0)+(u<<2),n[m>>2]=n[B>>2],Ee(l,m,d)|0,n[(n[d>>2]|0)+944>>2]=o,Oe(o),I=A}function te(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;if(u=Mi(o)|0,u|0&&(n[(Is(o,0)|0)+944>>2]|0)!=(o|0)){A=n[(n[o+976>>2]|0)+12>>2]|0,d=o+948|0,m=(A|0)==0,l=0;do B=n[(n[d>>2]|0)+(l<<2)>>2]|0,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ze=n[m>>2]|0,n[m>>2]=n[A>>2],n[A>>2]=Ze,Qy(ae),A=n[L>>2]|0;break}m=A,B=((m-d>>2)+1|0)/-2|0,k=A+(B<<2)|0,d=T-m|0,m=d>>2,m&&(Q2(k|0,A|0,d|0)|0,A=n[M>>2]|0),Ze=k+(m<<2)|0,n[L>>2]=Ze,n[M>>2]=A+(B<<2),A=Ze}while(!1);n[A>>2]=n[u>>2],n[L>>2]=(n[L>>2]|0)+4,l=hP(o,Qe,l)|0,Qy(Qe)}while(!1);return I=tt,l|0}function Oe(o){o=o|0;var l=0;do{if(l=o+984|0,s[l>>0]|0)break;s[l>>0]=1,h[o+504>>2]=y(le),o=n[o+944>>2]|0}while(o|0)}function dt(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-4-A|0)>>>2)<<2)),It(u))}function Et(o){return o=o|0,n[o+944>>2]|0}function bt(o){o=o|0,wi(o,(n[o+964>>2]|0)!=0,2832),Oe(o)}function tr(o){return o=o|0,(s[o+984>>0]|0)!=0|0}function An(o,l){o=o|0,l=l|0,l6e(o,l,400)|0&&(Qr(o|0,l|0,400)|0,Oe(o))}function li(o){o=o|0;var l=$e;return l=y(h[o+44>>2]),o=Mt(l)|0,y(o?y(0):l)}function qi(o){o=o|0;var l=$e;return l=y(h[o+48>>2]),Mt(l)|0&&(l=s[(n[o+976>>2]|0)+2>>0]|0?y(1):y(0)),y(l)}function Tn(o,l){o=o|0,l=l|0,n[o+980>>2]=l}function Ga(o){return o=o|0,n[o+980>>2]|0}function my(o,l){o=o|0,l=l|0;var u=0;u=o+4|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Z1(o){return o=o|0,n[o+4>>2]|0}function vo(o,l){o=o|0,l=l|0;var u=0;u=o+8|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function yy(o){return o=o|0,n[o+8>>2]|0}function Eh(o,l){o=o|0,l=l|0;var u=0;u=o+12|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function $1(o){return o=o|0,n[o+12>>2]|0}function So(o,l){o=o|0,l=l|0;var u=0;u=o+16|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Ih(o){return o=o|0,n[o+16>>2]|0}function Ch(o,l){o=o|0,l=l|0;var u=0;u=o+20|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function hu(o){return o=o|0,n[o+20>>2]|0}function wh(o,l){o=o|0,l=l|0;var u=0;u=o+24|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Fg(o){return o=o|0,n[o+24>>2]|0}function Ng(o,l){o=o|0,l=l|0;var u=0;u=o+28|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Og(o){return o=o|0,n[o+28>>2]|0}function Ey(o,l){o=o|0,l=l|0;var u=0;u=o+32|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function df(o){return o=o|0,n[o+32>>2]|0}function Do(o,l){o=o|0,l=l|0;var u=0;u=o+36|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Sl(o){return o=o|0,n[o+36>>2]|0}function Bh(o,l){o=o|0,l=y(l);var u=0;u=o+40|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function Lg(o,l){o=o|0,l=y(l);var u=0;u=o+44|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function Dl(o,l){o=o|0,l=y(l);var u=0;u=o+48|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function bl(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+52|0,d=o+56|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Iy(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+52|0,u=o+56|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function UA(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+52|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Cy(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+132+(l<<3)|0,l=o+132+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function wy(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+132+(l<<3)|0,l=o+132+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function _A(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+132+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function HA(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+60+(l<<3)|0,l=o+60+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function Y(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+60+(l<<3)|0,l=o+60+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function xt(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+60+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function jA(o,l){o=o|0,l=l|0;var u=0;u=o+60+(l<<3)+4|0,(n[u>>2]|0)!=3&&(h[o+60+(l<<3)>>2]=y(le),n[u>>2]=3,Oe(o))}function bo(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+204+(l<<3)|0,l=o+204+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function mf(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+204+(l<<3)|0,l=o+204+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function yt(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+204+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function gu(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+276+(l<<3)|0,l=o+276+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function By(o,l){return o=o|0,l=l|0,y(h[o+276+(l<<3)>>2])}function Mg(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+348|0,d=o+352|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function e2(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+348|0,u=o+352|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function vh(o){o=o|0;var l=0;l=o+352|0,(n[l>>2]|0)!=3&&(h[o+348>>2]=y(le),n[l>>2]=3,Oe(o))}function ur(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+348|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function zi(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+356|0,d=o+360|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function yf(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+356|0,u=o+360|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function qa(o){o=o|0;var l=0;l=o+360|0,(n[l>>2]|0)!=3&&(h[o+356>>2]=y(le),n[l>>2]=3,Oe(o))}function Ug(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+356|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function du(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+364|0,d=o+368|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Ef(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+364|0,d=o+368|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function wt(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+364|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function di(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+372|0,d=o+376|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function GA(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+372|0,d=o+376|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Wa(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+372|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Aa(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+380|0,d=o+384|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Ya(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+380|0,d=o+384|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function _g(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+380|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Sh(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+388|0,d=o+392|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Hg(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+388|0,d=o+392|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function vy(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+388|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function qA(o,l){o=o|0,l=y(l);var u=0;u=o+396|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function jg(o){return o=o|0,y(h[o+396>>2])}function mu(o){return o=o|0,y(h[o+400>>2])}function yu(o){return o=o|0,y(h[o+404>>2])}function If(o){return o=o|0,y(h[o+408>>2])}function Rs(o){return o=o|0,y(h[o+412>>2])}function Eu(o){return o=o|0,y(h[o+416>>2])}function Gn(o){return o=o|0,y(h[o+420>>2])}function is(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+424+(l<<2)>>2])}function Pi(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+448+(l<<2)>>2])}function WA(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+472+(l<<2)>>2])}function Cf(o,l){o=o|0,l=l|0;var u=0,A=$e;return u=n[o+4>>2]|0,(u|0)==(n[l+4>>2]|0)?u?(A=y(h[o>>2]),o=y(se(y(A-y(h[l>>2]))))<y(999999974e-13)):o=1:o=0,o|0}function mn(o,l){o=y(o),l=y(l);var u=0;return Mt(o)|0?u=Mt(l)|0:u=y(se(y(o-l)))<y(999999974e-13),u|0}function Gg(o,l){o=o|0,l=l|0,qg(o,l)}function qg(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u+4|0,n[A>>2]=0,n[A+4>>2]=0,n[A+8>>2]=0,cu(A|0,o|0,l|0,0),xo(o,3,(s[A+11>>0]|0)<0?n[A>>2]|0:A,u),Q6e(A),I=u}function ss(o,l,u,A){o=y(o),l=y(l),u=u|0,A=A|0;var d=$e;o=y(o*l),d=y(uU(o,y(1)));do if(mn(d,y(0))|0)o=y(o-d);else{if(o=y(o-d),mn(d,y(1))|0){o=y(o+y(1));break}if(u){o=y(o+y(1));break}A||(d>y(.5)?d=y(1):(A=mn(d,y(.5))|0,d=y(A?1:0)),o=y(o+d))}while(!1);return y(o/l)}function Pl(o,l,u,A,d,m,B,k,T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r+56|0,Lt=cr+8|0,ct=cr,We=(n[2279]|0)+1|0,n[2279]=We,Tr=o+984|0,s[Tr>>0]|0&&(n[o+512>>2]|0)!=(n[2278]|0)?Ze=4:(n[o+516>>2]|0)==(A|0)?Hr=0:Ze=4,(Ze|0)==4&&(n[o+520>>2]=0,n[o+924>>2]=-1,n[o+928>>2]=-1,h[o+932>>2]=y(-1),h[o+936>>2]=y(-1),Hr=1);e:do if(n[o+964>>2]|0)if(Qe=y(yn(o,2,B)),tt=y(yn(o,0,B)),q=o+916|0,Ro=y(h[q>>2]),To=y(h[o+920>>2]),Hn=y(h[o+932>>2]),Pl(d,l,m,u,n[o+924>>2]|0,Ro,n[o+928>>2]|0,To,Hn,y(h[o+936>>2]),Qe,tt,L)|0)Ze=22;else if(Ye=n[o+520>>2]|0,!Ye)Ze=21;else for(ae=0;;){if(q=o+524+(ae*24|0)|0,Hn=y(h[q>>2]),To=y(h[o+524+(ae*24|0)+4>>2]),Ro=y(h[o+524+(ae*24|0)+16>>2]),Pl(d,l,m,u,n[o+524+(ae*24|0)+8>>2]|0,Hn,n[o+524+(ae*24|0)+12>>2]|0,To,Ro,y(h[o+524+(ae*24|0)+20>>2]),Qe,tt,L)|0){Ze=22;break e}if(ae=ae+1|0,ae>>>0>=Ye>>>0){Ze=21;break}}else{if(T){if(q=o+916|0,!(mn(y(h[q>>2]),l)|0)){Ze=21;break}if(!(mn(y(h[o+920>>2]),u)|0)){Ze=21;break}if((n[o+924>>2]|0)!=(d|0)){Ze=21;break}q=(n[o+928>>2]|0)==(m|0)?q:0,Ze=22;break}if(Ye=n[o+520>>2]|0,!Ye)Ze=21;else for(ae=0;;){if(q=o+524+(ae*24|0)|0,mn(y(h[q>>2]),l)|0&&mn(y(h[o+524+(ae*24|0)+4>>2]),u)|0&&(n[o+524+(ae*24|0)+8>>2]|0)==(d|0)&&(n[o+524+(ae*24|0)+12>>2]|0)==(m|0)){Ze=22;break e}if(ae=ae+1|0,ae>>>0>=Ye>>>0){Ze=21;break}}}while(!1);do if((Ze|0)==21)s[11697]|0?(q=0,Ze=28):(q=0,Ze=31);else if((Ze|0)==22){if(ae=(s[11697]|0)!=0,!((q|0)!=0&(Hr^1)))if(ae){Ze=28;break}else{Ze=31;break}Le=q+16|0,n[o+908>>2]=n[Le>>2],Ye=q+20|0,n[o+912>>2]=n[Ye>>2],(s[11698]|0)==0|ae^1||(n[ct>>2]=Iu(We)|0,n[ct+4>>2]=We,xo(o,4,2972,ct),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),d=pa(d,T)|0,m=pa(m,T)|0,Za=+y(h[Le>>2]),Fo=+y(h[Ye>>2]),n[Lt>>2]=d,n[Lt+4>>2]=m,E[Lt+8>>3]=+l,E[Lt+16>>3]=+u,E[Lt+24>>3]=Za,E[Lt+32>>3]=Fo,n[Lt+40>>2]=M,xo(o,4,2989,Lt))}while(!1);return(Ze|0)==28&&(ae=Iu(We)|0,n[Le>>2]=ae,n[Le+4>>2]=We,n[Le+8>>2]=Hr?3047:11699,xo(o,4,3038,Le),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),Lt=pa(d,T)|0,Ze=pa(m,T)|0,n[He>>2]=Lt,n[He+4>>2]=Ze,E[He+8>>3]=+l,E[He+16>>3]=+u,n[He+24>>2]=M,xo(o,4,3049,He),Ze=31),(Ze|0)==31&&(Fs(o,l,u,A,d,m,B,k,T,L),s[11697]|0&&(ae=n[2279]|0,Lt=Iu(ae)|0,n[Gr>>2]=Lt,n[Gr+4>>2]=ae,n[Gr+8>>2]=Hr?3047:11699,xo(o,4,3083,Gr),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),Lt=pa(d,T)|0,Gr=pa(m,T)|0,Fo=+y(h[o+908>>2]),Za=+y(h[o+912>>2]),n[fr>>2]=Lt,n[fr+4>>2]=Gr,E[fr+8>>3]=Fo,E[fr+16>>3]=Za,n[fr+24>>2]=M,xo(o,4,3092,fr)),n[o+516>>2]=A,q||(ae=o+520|0,q=n[ae>>2]|0,(q|0)==16&&(s[11697]|0&&xo(o,4,3124,$t),n[ae>>2]=0,q=0),T?q=o+916|0:(n[ae>>2]=q+1,q=o+524+(q*24|0)|0),h[q>>2]=l,h[q+4>>2]=u,n[q+8>>2]=d,n[q+12>>2]=m,n[q+16>>2]=n[o+908>>2],n[q+20>>2]=n[o+912>>2],q=0)),T&&(n[o+416>>2]=n[o+908>>2],n[o+420>>2]=n[o+912>>2],s[o+985>>0]=1,s[Tr>>0]=0),n[2279]=(n[2279]|0)+-1,n[o+512>>2]=n[2278],I=cr,Hr|(q|0)==0|0}function yn(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(K(o,l,u)),y(A+y(re(o,l,u)))}function xo(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=I,I=I+16|0,d=m,n[d>>2]=A,o?A=n[o+976>>2]|0:A=0,Ph(A,o,l,u,d),I=m}function Iu(o){return o=o|0,(o>>>0>60?3201:3201+(60-o)|0)|0}function pa(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+32|0,u=d+12|0,A=d,n[u>>2]=n[254],n[u+4>>2]=n[255],n[u+8>>2]=n[256],n[A>>2]=n[257],n[A+4>>2]=n[258],n[A+8>>2]=n[259],(o|0)>2?o=11699:o=n[(l?A:u)+(o<<2)>>2]|0,I=d,o|0}function Fs(o,l,u,A,d,m,B,k,T,M){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=m|0,B=y(B),k=y(k),T=T|0,M=M|0;var L=0,q=0,ae=0,Ye=0,Le=$e,Qe=$e,tt=$e,Ze=$e,ct=$e,He=$e,We=$e,Lt=0,Gr=0,fr=0,$t=$e,Tr=$e,Hr=0,cr=$e,Hn=0,To=0,Ro=0,Fo=0,Za=0,Wh=0,Yh=0,gc=0,Vh=0,Rf=0,Ff=0,Jh=0,Kh=0,zh=0,ln=0,dc=0,Xh=0,Pu=0,Zh=$e,$h=$e,Nf=$e,Of=$e,xu=$e,oo=0,Ll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ui?m:d,Nr=ui?Qu:lo,ct=ui?lo:Qu,ku=y(yn(o,2,B)),Ze=y(yn(o,0,B)),Qe=y(y(Zr(o+364|0,B))-Nr),tt=y(y(Zr(o+380|0,B))-Nr),He=y(y(Zr(o+372|0,k))-ct),We=y(y(Zr(o+388|0,k))-ct),Nf=ui?Qe:He,Of=ui?tt:We,ku=y(l-ku),l=y(ku-Nr),Mt(l)|0?Nr=l:Nr=y($n(y(pd(l,tt)),Qe)),up=y(u-Ze),l=y(up-ct),Mt(l)|0?No=l:No=y($n(y(pd(l,We)),He)),Qe=ui?Nr:No,Wn=ui?No:Nr;e:do if((fr|0)==1)for(A=0,q=0;;){if(L=Is(o,q)|0,!A)y(KA(L))>y(0)&&y(Qh(L))>y(0)?A=L:A=0;else if(n2(L)|0){Ye=0;break e}if(q=q+1|0,q>>>0>=co>>>0){Ye=A;break}}else Ye=0;while(!1);Lt=Ye+500|0,Gr=Ye+504|0,A=0,L=0,l=y(0),ae=0;do{if(q=n[(n[Lo>>2]|0)+(ae<<2)>>2]|0,(n[q+36>>2]|0)==1)Py(q),s[q+985>>0]=1,s[q+984>>0]=0;else{vf(q),T&&bh(q,At(q,Us)|0,Qe,Wn,Nr);do if((n[q+24>>2]|0)!=1)if((q|0)==(Ye|0)){n[Lt>>2]=n[2278],h[Gr>>2]=y(0);break}else{cP(o,q,Nr,d,No,Nr,No,m,Us,M);break}else L|0&&(n[L+960>>2]=q),n[q+960>>2]=0,L=q,A=A|0?A:q;while(!1);Ms=y(h[q+504>>2]),l=y(l+y(Ms+y(yn(q,Mr,Nr))))}ae=ae+1|0}while((ae|0)!=(co|0));for(Ro=l>Qe,yc=Pu&((fr|0)==2&Ro)?1:fr,Hn=(Ec|0)==1,Za=Hn&(T^1),Wh=(yc|0)==1,Yh=(yc|0)==2,gc=976+(Mr<<2)|0,Vh=(Ec|2|0)==2,zh=Hn&(Pu^1),Rf=1040+(Ar<<2)|0,Ff=1040+(Mr<<2)|0,Jh=976+(Ar<<2)|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=(fr|0));L?(Ze=y(0),u=y(0)):ln=101}else ln=101;e:do if((ln|0)==101)switch(ln=0,Xh|0){case 1:{L=0,Ze=y(Qe*y(.5)),u=y(0);break e}case 2:{L=0,Ze=Qe,u=y(0);break e}case 3:{if(m>>>0<=1){L=0,Ze=y(0),u=y(0);break e}u=y((m+-1|0)>>>0),L=0,Ze=y(0),u=y(y($n(Qe,y(0)))/u);break e}case 5:{u=y(Qe/y((m+1|0)>>>0)),L=0,Ze=u;break e}case 4:{u=y(Qe/y(m>>>0)),L=0,Ze=y(u*y(.5));break e}default:{L=0,Ze=y(0),u=y(0);break e}}while(!1);if(l=y(Zh+Ze),Lt){tt=y(Qe/y(L|0)),ae=n[Lo>>2]|0,q=Hr,Qe=y(0);do{L=n[ae+(q<<2)>>2]|0;e:do if((n[L+36>>2]|0)!=1){switch(n[L+24>>2]|0){case 1:{if(ha(L,Mr)|0){if(!T)break e;zt=y(zA(L,Mr,cr)),zt=y(zt+y(vr(o,Mr))),zt=y(zt+y(K(L,Mr,Nr))),h[L+400+(n[Ff>>2]<<2)>>2]=zt;break e}break}case 0:if(Bi=(n[(kl(L,Mr)|0)+4>>2]|0)==3,zt=y(tt+l),l=Bi?zt:l,T&&(Bi=L+400+(n[Ff>>2]<<2)|0,h[Bi>>2]=y(l+y(h[Bi>>2]))),Bi=(n[(Ql(L,Mr)|0)+4>>2]|0)==3,zt=y(tt+l),l=Bi?zt:l,Za){zt=y(u+y(yn(L,Mr,Nr))),Qe=Wn,l=y(l+y(zt+y(h[L+504>>2])));break e}else{l=y(l+y(u+y(XA(L,Mr,Nr)))),Qe=y($n(Qe,y(XA(L,Ar,Nr))));break e}default:}T&&(zt=y(Ze+y(vr(o,Mr))),Bi=L+400+(n[Ff>>2]<<2)|0,h[Bi>>2]=y(zt+y(h[Bi>>2])))}while(!1);q=q+1|0}while((q|0)!=(fr|0))}else Qe=y(0);if(u=y($h+l),Vh?Ze=y(y(qn(o,Ar,y(lo+Qe),Tu,B))-lo):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(Ql(ae,Ar)|0)+4>>2]|0)==3){l=Le;break}if((n[(kl(ae,Ar)|0)+4>>2]|0)==3){l=y(Le+y($n(y(0),l)));break}switch(L|0){case 1:{l=Le;break e}case 2:{l=y(Le+y(l*y(.5)));break e}default:{l=y(Le+l);break e}}}while(!1);zt=y(Ms+l),Bi=ae+400+(n[Rf>>2]<<2)|0,h[Bi>>2]=y(zt+y(h[Bi>>2]))}while(!1);q=q+1|0}while((q|0)!=(fr|0))}if(Ms=y(Ms+tt),xu=y($n(xu,u)),m=Fo+1|0,fr>>>0>=co>>>0)break;l=cr,Hr=fr,Fo=m}do if(T){if(L=m>>>0>1,!L&&!(jL(o)|0))break;if(!(Mt(Wn)|0)){l=y(Wn-Ms);e:do switch(n[o+12>>2]|0){case 3:{Le=y(Le+l),He=y(0);break}case 2:{Le=y(Le+y(l*y(.5))),He=y(0);break}case 4:{Wn>Ms?He=y(l/y(m>>>0)):He=y(0);break}case 7:if(Wn>Ms){Le=y(Le+y(l/y(m<<1>>>0))),He=y(l/y(m>>>0)),He=L?He:y(0);break e}else{Le=y(Le+y(l*y(.5))),He=y(0);break e}case 6:{He=y(l/y(Fo>>>0)),He=Wn>Ms&L?He:y(0);break}default:He=y(0)}while(!1);if(m|0)for(Lt=1040+(Ar<<2)|0,Gr=976+(Ar<<2)|0,Ye=0,q=0;;){e:do if(q>>>0<co>>>0)for(Qe=y(0),tt=y(0),l=y(0),ae=q;;){L=n[(n[Lo>>2]|0)+(ae<<2)>>2]|0;do if((n[L+36>>2]|0)!=1&&!(n[L+24>>2]|0)){if((n[L+940>>2]|0)!=(Ye|0))break e;if(qL(L,Ar)|0&&(zt=y(h[L+908+(n[Gr>>2]<<2)>>2]),l=y($n(l,y(zt+y(yn(L,Ar,Nr)))))),(os(o,L)|0)!=5)break;ao=y(Yg(L)),ao=y(ao+y(K(L,0,Nr))),zt=y(h[L+912>>2]),zt=y(y(zt+y(yn(L,0,Nr)))-ao),ao=y($n(tt,ao)),zt=y($n(Qe,zt)),Qe=zt,tt=ao,l=y($n(l,y(ao+zt)))}while(!1);if(L=ae+1|0,L>>>0<co>>>0)ae=L;else{ae=L;break}}else tt=y(0),l=y(0),ae=q;while(!1);if(ct=y(He+l),u=Le,Le=y(Le+ct),q>>>0<ae>>>0){Ze=y(u+tt),L=q;do{q=n[(n[Lo>>2]|0)+(L<<2)>>2]|0;e:do if((n[q+36>>2]|0)!=1&&!(n[q+24>>2]|0))switch(os(o,q)|0){case 1:{zt=y(u+y(K(q,Ar,Nr))),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 3:{zt=y(y(Le-y(re(q,Ar,Nr)))-y(h[q+908+(n[Gr>>2]<<2)>>2])),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 2:{zt=y(u+y(y(ct-y(h[q+908+(n[Gr>>2]<<2)>>2]))*y(.5))),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 4:{if(zt=y(u+y(K(q,Ar,Nr))),h[q+400+(n[Lt>>2]<<2)>>2]=zt,io(q,Ar,Wn)|0||(ui?(Qe=y(h[q+908>>2]),l=y(Qe+y(yn(q,Mr,Nr))),tt=ct):(tt=y(h[q+912>>2]),tt=y(tt+y(yn(q,Ar,Nr))),l=ct,Qe=y(h[q+908>>2])),mn(l,Qe)|0&&mn(tt,y(h[q+912>>2]))|0))break e;xl(q,l,tt,Us,1,1,Nr,No,1,3501,M)|0;break e}case 5:{h[q+404>>2]=y(y(Ze-y(Yg(q)))+y(zA(q,0,Wn)));break e}default:break e}while(!1);L=L+1|0}while((L|0)!=(ae|0))}if(Ye=Ye+1|0,(Ye|0)==(m|0))break;q=ae}}}while(!1);if(h[o+908>>2]=y(qn(o,2,ku,B,B)),h[o+912>>2]=y(qn(o,0,up,k,B)),yc|0&&(fp=n[o+32>>2]|0,Ap=(yc|0)==2,!(Ap&(fp|0)!=2))?Ap&(fp|0)==2&&(l=y(Qu+cr),l=y($n(y(pd(l,y(Vg(o,Mr,xu,Oo)))),Qu)),ln=198):(l=y(qn(o,Mr,xu,Oo,B)),ln=198),(ln|0)==198&&(h[o+908+(n[976+(Mr<<2)>>2]<<2)>>2]=l),Ec|0&&(hp=n[o+32>>2]|0,gp=(Ec|0)==2,!(gp&(hp|0)!=2))?gp&(hp|0)==2&&(l=y(lo+Wn),l=y($n(y(pd(l,y(Vg(o,Ar,y(lo+Ms),Tu)))),lo)),ln=204):(l=y(qn(o,Ar,y(lo+Ms),Tu,B)),ln=204),(ln|0)==204&&(h[o+908+(n[976+(Ar<<2)>>2]<<2)>>2]=l),T){if((n[pp>>2]|0)==2){q=976+(Ar<<2)|0,ae=1040+(Ar<<2)|0,L=0;do Ye=Is(o,L)|0,n[Ye+24>>2]|0||(dp=n[q>>2]|0,zt=y(h[o+908+(dp<<2)>>2]),Bi=Ye+400+(n[ae>>2]<<2)|0,zt=y(zt-y(h[Bi>>2])),h[Bi>>2]=y(zt-y(h[Ye+908+(dp<<2)>>2]))),L=L+1|0;while((L|0)!=(co|0))}if(A|0){L=ui?yc:d;do WL(o,A,Nr,L,No,Us,M),A=n[A+960>>2]|0;while(A|0)}if(L=(Mr|2|0)==3,q=(Ar|2|0)==3,L|q){A=0;do ae=n[(n[Lo>>2]|0)+(A<<2)>>2]|0,(n[ae+36>>2]|0)!=1&&(L&&i2(o,ae,Mr),q&&i2(o,ae,Ar)),A=A+1|0;while((A|0)!=(co|0))}}}while(!1);I=Ic}function Dh(o,l){o=o|0,l=y(l);var u=0;Ha(o,l>=y(0),3147),u=l==y(0),h[o+4>>2]=u?y(0):l}function YA(o,l,u,A){o=o|0,l=y(l),u=y(u),A=A|0;var d=$e,m=$e,B=0,k=0,T=0;n[2278]=(n[2278]|0)+1,vf(o),io(o,2,l)|0?(d=y(Zr(n[o+992>>2]|0,l)),T=1,d=y(d+y(yn(o,2,l)))):(d=y(Zr(o+380|0,l)),d>=y(0)?T=2:(T=((Mt(l)|0)^1)&1,d=l)),io(o,0,u)|0?(m=y(Zr(n[o+996>>2]|0,u)),k=1,m=y(m+y(yn(o,0,l)))):(m=y(Zr(o+388|0,u)),m>=y(0)?k=2:(k=((Mt(u)|0)^1)&1,m=u)),B=o+976|0,xl(o,d,m,A,T,k,l,u,1,3189,n[B>>2]|0)|0&&(bh(o,n[o+496>>2]|0,l,u,l),VA(o,y(h[(n[B>>2]|0)+4>>2]),y(0),y(0)),s[11696]|0)&&Gg(o,7)}function vf(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;k=I,I=I+32|0,B=k+24|0,m=k+16|0,A=k+8|0,d=k,u=0;do l=o+380+(u<<3)|0,n[o+380+(u<<3)+4>>2]|0&&(T=l,M=n[T+4>>2]|0,L=A,n[L>>2]=n[T>>2],n[L+4>>2]=M,L=o+364+(u<<3)|0,M=n[L+4>>2]|0,T=d,n[T>>2]=n[L>>2],n[T+4>>2]=M,n[m>>2]=n[A>>2],n[m+4>>2]=n[A+4>>2],n[B>>2]=n[d>>2],n[B+4>>2]=n[d+4>>2],Cf(m,B)|0)||(l=o+348+(u<<3)|0),n[o+992+(u<<2)>>2]=l,u=u+1|0;while((u|0)!=2);I=k}function io(o,l,u){o=o|0,l=l|0,u=y(u);var A=0;switch(o=n[o+992+(n[976+(l<<2)>>2]<<2)>>2]|0,n[o+4>>2]|0){case 0:case 3:{o=0;break}case 1:{y(h[o>>2])<y(0)?o=0:A=5;break}case 2:{y(h[o>>2])<y(0)?o=0:o=(Mt(u)|0)^1;break}default:A=5}return(A|0)==5&&(o=1),o|0}function Zr(o,l){switch(o=o|0,l=y(l),n[o+4>>2]|0){case 2:{l=y(y(y(h[o>>2])*l)/y(100));break}case 1:{l=y(h[o>>2]);break}default:l=y(le)}return y(l)}function bh(o,l,u,A,d){o=o|0,l=l|0,u=y(u),A=y(A),d=y(d);var m=0,B=$e;l=n[o+944>>2]|0?l:1,m=dr(n[o+4>>2]|0,l)|0,l=by(m,l)|0,u=y(uP(o,m,u)),A=y(uP(o,l,A)),B=y(u+y(K(o,m,d))),h[o+400+(n[1040+(m<<2)>>2]<<2)>>2]=B,u=y(u+y(re(o,m,d))),h[o+400+(n[1e3+(m<<2)>>2]<<2)>>2]=u,u=y(A+y(K(o,l,d))),h[o+400+(n[1040+(l<<2)>>2]<<2)>>2]=u,d=y(A+y(re(o,l,d))),h[o+400+(n[1e3+(l<<2)>>2]<<2)>>2]=d}function VA(o,l,u,A){o=o|0,l=y(l),u=y(u),A=y(A);var d=0,m=0,B=$e,k=$e,T=0,M=0,L=$e,q=0,ae=$e,Ye=$e,Le=$e,Qe=$e;if(l!=y(0)&&(d=o+400|0,Qe=y(h[d>>2]),m=o+404|0,Le=y(h[m>>2]),q=o+416|0,Ye=y(h[q>>2]),M=o+420|0,B=y(h[M>>2]),ae=y(Qe+u),L=y(Le+A),A=y(ae+Ye),k=y(L+B),T=(n[o+988>>2]|0)==1,h[d>>2]=y(ss(Qe,l,0,T)),h[m>>2]=y(ss(Le,l,0,T)),u=y(uU(y(Ye*l),y(1))),mn(u,y(0))|0?m=0:m=(mn(u,y(1))|0)^1,u=y(uU(y(B*l),y(1))),mn(u,y(0))|0?d=0:d=(mn(u,y(1))|0)^1,Qe=y(ss(A,l,T&m,T&(m^1))),h[q>>2]=y(Qe-y(ss(ae,l,0,T))),Qe=y(ss(k,l,T&d,T&(d^1))),h[M>>2]=y(Qe-y(ss(L,l,0,T))),m=(n[o+952>>2]|0)-(n[o+948>>2]|0)>>2,m|0)){d=0;do VA(Is(o,d)|0,l,ae,L),d=d+1|0;while((d|0)!=(m|0))}}function Sy(o,l,u,A,d){switch(o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,u|0){case 5:case 0:{o=IZ(n[489]|0,A,d)|0;break}default:o=b6e(A,d)|0}return o|0}function Wg(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;d=I,I=I+16|0,m=d,n[m>>2]=A,Ph(o,0,l,u,m),I=d}function Ph(o,l,u,A,d){if(o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,o=o|0?o:956,HZ[n[o+8>>2]&1](o,l,u,A,d)|0,(u|0)==5)Nt();else return}function pc(o,l,u){o=o|0,l=l|0,u=u|0,s[o+l>>0]=u&1}function Dy(o,l){o=o|0,l=l|0;var u=0,A=0;n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,u=l+4|0,A=(n[u>>2]|0)-(n[l>>2]|0)>>2,A|0&&(xh(o,A),kt(o,n[l>>2]|0,n[u>>2]|0,A))}function xh(o,l){o=o|0,l=l|0;var u=0;if((O(o)|0)>>>0<l>>>0&&an(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function kt(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function O(o){return o=o|0,1073741823}function K(o,l,u){return o=o|0,l=l|0,u=y(u),de(l)|0&&n[o+96>>2]|0?o=o+92|0:o=kn(o+60|0,n[1040+(l<<2)>>2]|0,992)|0,y(Je(o,u))}function re(o,l,u){return o=o|0,l=l|0,u=y(u),de(l)|0&&n[o+104>>2]|0?o=o+100|0:o=kn(o+60|0,n[1e3+(l<<2)>>2]|0,992)|0,y(Je(o,u))}function de(o){return o=o|0,(o|1|0)==3|0}function Je(o,l){return o=o|0,l=y(l),(n[o+4>>2]|0)==3?l=y(0):l=y(Zr(o,l)),y(l)}function At(o,l){return o=o|0,l=l|0,o=n[o>>2]|0,(o|0?o:(l|0)>1?l:1)|0}function dr(o,l){o=o|0,l=l|0;var u=0;e:do if((l|0)==2){switch(o|0){case 2:{o=3;break e}case 3:break;default:{u=4;break e}}o=2}else u=4;while(!1);return o|0}function vr(o,l){o=o|0,l=l|0;var u=$e;return de(l)|0&&n[o+312>>2]|0&&(u=y(h[o+308>>2]),u>=y(0))||(u=y($n(y(h[(kn(o+276|0,n[1040+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(u)}function Un(o,l){o=o|0,l=l|0;var u=$e;return de(l)|0&&n[o+320>>2]|0&&(u=y(h[o+316>>2]),u>=y(0))||(u=y($n(y(h[(kn(o+276|0,n[1e3+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(u)}function mi(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return de(l)|0&&n[o+240>>2]|0&&(A=y(Zr(o+236|0,u)),A>=y(0))||(A=y($n(y(Zr(kn(o+204|0,n[1040+(l<<2)>>2]|0,992)|0,u)),y(0)))),y(A)}function Cs(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return de(l)|0&&n[o+248>>2]|0&&(A=y(Zr(o+244|0,u)),A>=y(0))||(A=y($n(y(Zr(kn(o+204|0,n[1e3+(l<<2)>>2]|0,992)|0,u)),y(0)))),y(A)}function JA(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=$e,T=$e,M=$e,L=$e,q=$e,ae=$e,Ye=0,Le=0,Qe=0;Qe=I,I=I+16|0,Ye=Qe,Le=o+964|0,wi(o,(n[Le>>2]|0)!=0,3519),k=y(Va(o,2,l)),T=y(Va(o,0,l)),M=y(yn(o,2,l)),L=y(yn(o,0,l)),Mt(l)|0?q=l:q=y($n(y(0),y(y(l-M)-k))),Mt(u)|0?ae=u:ae=y($n(y(0),y(y(u-L)-T))),(A|0)==1&(d|0)==1?(h[o+908>>2]=y(qn(o,2,y(l-M),m,m)),l=y(qn(o,0,y(u-L),B,m))):(jZ[n[Le>>2]&1](Ye,o,q,A,ae,d),q=y(k+y(h[Ye>>2])),ae=y(l-M),h[o+908>>2]=y(qn(o,2,(A|2|0)==2?q:ae,m,m)),ae=y(T+y(h[Ye+4>>2])),l=y(u-L),l=y(qn(o,0,(d|2|0)==2?ae:l,B,m))),h[o+912>>2]=l,I=Qe}function lP(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=$e,T=$e,M=$e,L=$e;M=y(Va(o,2,m)),k=y(Va(o,0,m)),L=y(yn(o,2,m)),T=y(yn(o,0,m)),l=y(l-L),h[o+908>>2]=y(qn(o,2,(A|2|0)==2?M:l,m,m)),u=y(u-T),h[o+912>>2]=y(qn(o,0,(d|2|0)==2?k:u,B,m))}function t2(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=0,T=$e,M=$e;return k=(A|0)==2,!(l<=y(0)&k)&&!(u<=y(0)&(d|0)==2)&&!((A|0)==1&(d|0)==1)?o=0:(T=y(yn(o,0,m)),M=y(yn(o,2,m)),k=l<y(0)&k|(Mt(l)|0),l=y(l-M),h[o+908>>2]=y(qn(o,2,k?y(0):l,m,m)),l=y(u-T),k=u<y(0)&(d|0)==2|(Mt(u)|0),h[o+912>>2]=y(qn(o,0,k?y(0):l,B,m)),o=1),o|0}function by(o,l){return o=o|0,l=l|0,Jg(o)|0?o=dr(2,l)|0:o=0,o|0}function kh(o,l,u){return o=o|0,l=l|0,u=y(u),u=y(mi(o,l,u)),y(u+y(vr(o,l)))}function r2(o,l,u){return o=o|0,l=l|0,u=y(u),u=y(Cs(o,l,u)),y(u+y(Un(o,l)))}function Va(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(kh(o,l,u)),y(A+y(r2(o,l,u)))}function n2(o){return o=o|0,n[o+24>>2]|0?o=0:y(KA(o))!=y(0)?o=1:o=y(Qh(o))!=y(0),o|0}function KA(o){o=o|0;var l=$e;if(n[o+944>>2]|0){if(l=y(h[o+44>>2]),Mt(l)|0)return l=y(h[o+40>>2]),o=l>y(0)&((Mt(l)|0)^1),y(o?l:y(0))}else l=y(0);return y(l)}function Qh(o){o=o|0;var l=$e,u=0,A=$e;do if(n[o+944>>2]|0){if(l=y(h[o+48>>2]),Mt(l)|0){if(u=s[(n[o+976>>2]|0)+2>>0]|0,!(u<<24>>24)&&(A=y(h[o+40>>2]),A<y(0)&((Mt(A)|0)^1))){l=y(-A);break}l=u<<24>>24?y(1):y(0)}}else l=y(0);while(!1);return y(l)}function Py(o){o=o|0;var l=0,u=0;if(eE(o+400|0,0,540)|0,s[o+985>>0]=1,te(o),u=Mi(o)|0,u|0){l=o+948|0,o=0;do Py(n[(n[l>>2]|0)+(o<<2)>>2]|0),o=o+1|0;while((o|0)!=(u|0))}}function cP(o,l,u,A,d,m,B,k,T,M){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=y(m),B=y(B),k=k|0,T=T|0,M=M|0;var L=0,q=$e,ae=0,Ye=0,Le=$e,Qe=$e,tt=0,Ze=$e,ct=0,He=$e,We=0,Lt=0,Gr=0,fr=0,$t=0,Tr=0,Hr=0,cr=0,Hn=0,To=0;Hn=I,I=I+16|0,Gr=Hn+12|0,fr=Hn+8|0,$t=Hn+4|0,Tr=Hn,cr=dr(n[o+4>>2]|0,T)|0,We=de(cr)|0,q=y(Zr(YL(l)|0,We?m:B)),Lt=io(l,2,m)|0,Hr=io(l,0,B)|0;do if(!(Mt(q)|0)&&!(Mt(We?u:d)|0)){if(L=l+504|0,!(Mt(y(h[L>>2]))|0)&&(!(s2(n[l+976>>2]|0,0)|0)||(n[l+500>>2]|0)==(n[2278]|0)))break;h[L>>2]=y($n(q,y(Va(l,cr,m))))}else ae=7;while(!1);do if((ae|0)==7){if(ct=We^1,!(ct|Lt^1)){B=y(Zr(n[l+992>>2]|0,m)),h[l+504>>2]=y($n(B,y(Va(l,2,m))));break}if(!(We|Hr^1)){B=y(Zr(n[l+996>>2]|0,B)),h[l+504>>2]=y($n(B,y(Va(l,0,m))));break}h[Gr>>2]=y(le),h[fr>>2]=y(le),n[$t>>2]=0,n[Tr>>2]=0,Ze=y(yn(l,2,m)),He=y(yn(l,0,m)),Lt?(Le=y(Ze+y(Zr(n[l+992>>2]|0,m))),h[Gr>>2]=Le,n[$t>>2]=1,Ye=1):(Ye=0,Le=y(le)),Hr?(q=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kl(o,l){return o=o|0,l=l|0,de(l)|0&&n[o+96>>2]|0?l=4:l=n[1040+(l<<2)>>2]|0,o+60+(l<<3)|0}function Ql(o,l){return o=o|0,l=l|0,de(l)|0&&n[o+104>>2]|0?l=5:l=n[1e3+(l<<2)>>2]|0,o+60+(l<<3)|0}function Cu(o,l,u,A,d,m){switch(o=o|0,l=l|0,u=y(u),A=y(A),d=d|0,m=m|0,u=y(Zr(o+380+(n[976+(l<<2)>>2]<<3)|0,u)),u=y(u+y(yn(o,l,A))),n[d>>2]|0){case 2:case 1:{d=Mt(u)|0,A=y(h[m>>2]),h[m>>2]=d|A<u?A:u;break}case 0:{Mt(u)|0||(n[d>>2]=2,h[m>>2]=u);break}default:}}function ha(o,l){return o=o|0,l=l|0,o=o+132|0,de(l)|0&&n[(kn(o,4,948)|0)+4>>2]|0?o=1:o=(n[(kn(o,n[1040+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,o|0}function zA(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0;return o=o+132|0,de(l)|0&&(A=kn(o,4,948)|0,(n[A+4>>2]|0)!=0)?d=4:(A=kn(o,n[1040+(l<<2)>>2]|0,948)|0,n[A+4>>2]|0?d=4:u=y(0)),(d|0)==4&&(u=y(Zr(A,u))),y(u)}function XA(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(h[o+908+(n[976+(l<<2)>>2]<<2)>>2]),A=y(A+y(K(o,l,u))),y(A+y(re(o,l,u)))}function jL(o){o=o|0;var l=0,u=0,A=0;e:do if(Jg(n[o+4>>2]|0)|0)l=0;else if((n[o+16>>2]|0)!=5)if(u=Mi(o)|0,!u)l=0;else for(l=0;;){if(A=Is(o,l)|0,!(n[A+24>>2]|0)&&(n[A+20>>2]|0)==5){l=1;break e}if(l=l+1|0,l>>>0>=u>>>0){l=0;break}}else l=1;while(!1);return l|0}function qL(o,l){o=o|0,l=l|0;var u=$e;return u=y(h[o+908+(n[976+(l<<2)>>2]<<2)>>2]),u>=y(0)&((Mt(u)|0)^1)|0}function Yg(o){o=o|0;var l=$e,u=0,A=0,d=0,m=0,B=0,k=0,T=$e;if(u=n[o+968>>2]|0,u)T=y(h[o+908>>2]),l=y(h[o+912>>2]),l=y(LZ[u&0](o,T,l)),wi(o,(Mt(l)|0)^1,3573);else{m=Mi(o)|0;do if(m|0){for(u=0,d=0;;){if(A=Is(o,d)|0,n[A+940>>2]|0){B=8;break}if((n[A+24>>2]|0)!=1)if(k=(os(o,A)|0)==5,k){u=A;break}else u=u|0?u:A;if(d=d+1|0,d>>>0>=m>>>0){B=8;break}}if((B|0)==8&&!u)break;return l=y(Yg(u)),y(l+y(h[u+404>>2]))}while(!1);l=y(h[o+912>>2])}return y(l)}function Vg(o,l,u,A){o=o|0,l=l|0,u=y(u),A=y(A);var d=$e,m=0;return Jg(l)|0?(l=1,m=3):de(l)|0?(l=0,m=3):(A=y(le),d=y(le)),(m|0)==3&&(d=y(Zr(o+364+(l<<3)|0,A)),A=y(Zr(o+380+(l<<3)|0,A))),m=A<u&(A>=y(0)&((Mt(A)|0)^1)),u=m?A:u,m=d>=y(0)&((Mt(d)|0)^1)&u<d,y(m?d:u)}function WL(o,l,u,A,d,m,B){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0,B=B|0;var k=$e,T=$e,M=0,L=0,q=$e,ae=$e,Ye=$e,Le=0,Qe=0,tt=0,Ze=0,ct=$e,He=0;tt=dr(n[o+4>>2]|0,m)|0,Le=by(tt,m)|0,Qe=de(tt)|0,q=y(yn(l,2,u)),ae=y(yn(l,0,u)),io(l,2,u)|0?k=y(q+y(Zr(n[l+992>>2]|0,u))):ha(l,2)|0&&xy(l,2)|0?(k=y(h[o+908>>2]),T=y(vr(o,2)),T=y(k-y(T+y(Un(o,2)))),k=y(zA(l,2,u)),k=y(qn(l,2,y(T-y(k+y(Th(l,2,u)))),u,u))):k=y(le),io(l,0,d)|0?T=y(ae+y(Zr(n[l+996>>2]|0,d))):ha(l,0)|0&&xy(l,0)|0?(T=y(h[o+912>>2]),ct=y(vr(o,0)),ct=y(T-y(ct+y(Un(o,0)))),T=y(zA(l,0,d)),T=y(qn(l,0,y(ct-y(T+y(Th(l,0,d)))),d,u))):T=y(le),M=Mt(k)|0,L=Mt(T)|0;do if(M^L&&(Ye=y(h[l+396>>2]),!(Mt(Ye)|0)))if(M){k=y(q+y(y(T-ae)*Ye));break}else{ct=y(ae+y(y(k-q)/Ye)),T=L?ct:T;break}while(!1);L=Mt(k)|0,M=Mt(T)|0,L|M&&(He=(L^1)&1,A=u>y(0)&((A|0)!=0&L),k=Qe?k:A?u:k,xl(l,k,T,m,Qe?He:A?2:He,L&(M^1)&1,k,T,0,3623,B)|0,k=y(h[l+908>>2]),k=y(k+y(yn(l,2,u))),T=y(h[l+912>>2]),T=y(T+y(yn(l,0,u)))),xl(l,k,T,m,1,1,k,T,1,3635,B)|0,xy(l,tt)|0&&!(ha(l,tt)|0)?(He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),ct=y(ct-y(Un(o,tt))),ct=y(ct-y(re(l,tt,u))),ct=y(ct-y(Th(l,tt,Qe?u:d))),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct):Ze=21;do if((Ze|0)==21){if(!(ha(l,tt)|0)&&(n[o+8>>2]|0)==1){He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(y(ct-y(h[l+908+(He<<2)>>2]))*y(.5)),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct;break}!(ha(l,tt)|0)&&(n[o+8>>2]|0)==2&&(He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct)}while(!1);xy(l,Le)|0&&!(ha(l,Le)|0)?(He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),ct=y(ct-y(Un(o,Le))),ct=y(ct-y(re(l,Le,u))),ct=y(ct-y(Th(l,Le,Qe?d:u))),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct):Ze=30;do if((Ze|0)==30&&!(ha(l,Le)|0)){if((os(o,l)|0)==2){He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(y(ct-y(h[l+908+(He<<2)>>2]))*y(.5)),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct;break}He=(os(o,l)|0)==3,He^(n[o+28>>2]|0)==2&&(He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct)}while(!1)}function i2(o,l,u){o=o|0,l=l|0,u=u|0;var A=$e,d=0;d=n[976+(u<<2)>>2]|0,A=y(h[l+908+(d<<2)>>2]),A=y(y(h[o+908+(d<<2)>>2])-A),A=y(A-y(h[l+400+(n[1040+(u<<2)>>2]<<2)>>2])),h[l+400+(n[1e3+(u<<2)>>2]<<2)>>2]=A}function Jg(o){return o=o|0,(o|1|0)==1|0}function YL(o){o=o|0;var l=$e;switch(n[o+56>>2]|0){case 0:case 3:{l=y(h[o+40>>2]),l>y(0)&((Mt(l)|0)^1)?o=s[(n[o+976>>2]|0)+2>>0]|0?1056:992:o=1056;break}default:o=o+52|0}return o|0}function s2(o,l){return o=o|0,l=l|0,(s[o+l>>0]|0)!=0|0}function xy(o,l){return o=o|0,l=l|0,o=o+132|0,de(l)|0&&n[(kn(o,5,948)|0)+4>>2]|0?o=1:o=(n[(kn(o,n[1e3+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,o|0}function Th(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0;return o=o+132|0,de(l)|0&&(A=kn(o,5,948)|0,(n[A+4>>2]|0)!=0)?d=4:(A=kn(o,n[1e3+(l<<2)>>2]|0,948)|0,n[A+4>>2]|0?d=4:u=y(0)),(d|0)==4&&(u=y(Zr(A,u))),y(u)}function uP(o,l,u){return o=o|0,l=l|0,u=y(u),ha(o,l)|0?u=y(zA(o,l,u)):u=y(-y(Th(o,l,u))),y(u)}function fP(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function ky(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>1073741823)Nt();else{d=Kt(l<<2)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<2)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<2)}function AP(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>2)<<2)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function Qy(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-4-l|0)>>>2)<<2)),o=n[o>>2]|0,o|0&&It(o)}function pP(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;if(B=o+4|0,k=n[B>>2]|0,d=k-A|0,m=d>>2,o=l+(m<<2)|0,o>>>0<u>>>0){A=k;do n[A>>2]=n[o>>2],o=o+4|0,A=(n[B>>2]|0)+4|0,n[B>>2]=A;while(o>>>0<u>>>0)}m|0&&Q2(k+(0-m<<2)|0,l|0,d|0)|0}function hP(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0;return k=l+4|0,T=n[k>>2]|0,d=n[o>>2]|0,B=u,m=B-d|0,A=T+(0-(m>>2)<<2)|0,n[k>>2]=A,(m|0)>0&&Qr(A|0,d|0,m|0)|0,d=o+4|0,m=l+8|0,A=(n[d>>2]|0)-B|0,(A|0)>0&&(Qr(n[m>>2]|0,u|0,A|0)|0,n[m>>2]=(n[m>>2]|0)+(A>>>2<<2)),B=n[o>>2]|0,n[o>>2]=n[k>>2],n[k>>2]=B,B=n[d>>2]|0,n[d>>2]=n[m>>2],n[m>>2]=B,B=o+8|0,u=l+12|0,o=n[B>>2]|0,n[B>>2]=n[u>>2],n[u>>2]=o,n[l>>2]=n[k>>2],T|0}function o2(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;if(B=n[l>>2]|0,m=n[u>>2]|0,(B|0)!=(m|0)){d=o+8|0,u=((m+-4-B|0)>>>2)+1|0,o=B,A=n[d>>2]|0;do n[A>>2]=n[o>>2],A=(n[d>>2]|0)+4|0,n[d>>2]=A,o=o+4|0;while((o|0)!=(m|0));n[l>>2]=B+(u<<2)}}function a2(){ua()}function gP(){var o=0;return o=Kt(4)|0,l2(o),o|0}function l2(o){o=o|0,n[o>>2]=Ac()|0}function dP(o){o=o|0,o|0&&(Kg(o),It(o))}function Kg(o){o=o|0,st(n[o>>2]|0)}function VL(o,l,u){o=o|0,l=l|0,u=u|0,pc(n[o>>2]|0,l,u)}function Ty(o,l){o=o|0,l=y(l),Dh(n[o>>2]|0,l)}function Ry(o,l){return o=o|0,l=l|0,s2(n[o>>2]|0,l)|0}function Fy(){var o=0;return o=Kt(8)|0,zg(o,0),o|0}function zg(o,l){o=o|0,l=l|0,l?l=fa(n[l>>2]|0)|0:l=ns()|0,n[o>>2]=l,n[o+4>>2]=0,Tn(l,o)}function Ny(o){o=o|0;var l=0;return l=Kt(8)|0,zg(l,o),l|0}function Xg(o){o=o|0,o|0&&(Oy(o),It(o))}function Oy(o){o=o|0;var l=0;uc(n[o>>2]|0),l=o+4|0,o=n[l>>2]|0,n[l>>2]=0,o|0&&(Sf(o),It(o))}function Sf(o){o=o|0,Df(o)}function Df(o){o=o|0,o=n[o>>2]|0,o|0&&Na(o|0)}function c2(o){return o=o|0,Ga(o)|0}function u2(o){o=o|0;var l=0,u=0;u=o+4|0,l=n[u>>2]|0,n[u>>2]=0,l|0&&(Sf(l),It(l)),fc(n[o>>2]|0)}function Ly(o,l){o=o|0,l=l|0,An(n[o>>2]|0,n[l>>2]|0)}function JL(o,l){o=o|0,l=l|0,wh(n[o>>2]|0,l)}function KL(o,l,u){o=o|0,l=l|0,u=+u,Cy(n[o>>2]|0,l,y(u))}function My(o,l,u){o=o|0,l=l|0,u=+u,wy(n[o>>2]|0,l,y(u))}function f2(o,l){o=o|0,l=l|0,Eh(n[o>>2]|0,l)}function A2(o,l){o=o|0,l=l|0,So(n[o>>2]|0,l)}function xr(o,l){o=o|0,l=l|0,Ch(n[o>>2]|0,l)}function so(o,l){o=o|0,l=l|0,my(n[o>>2]|0,l)}function Xi(o,l){o=o|0,l=l|0,Ng(n[o>>2]|0,l)}function Ns(o,l){o=o|0,l=l|0,vo(n[o>>2]|0,l)}function ZA(o,l,u){o=o|0,l=l|0,u=+u,HA(n[o>>2]|0,l,y(u))}function p2(o,l,u){o=o|0,l=l|0,u=+u,Y(n[o>>2]|0,l,y(u))}function ws(o,l){o=o|0,l=l|0,jA(n[o>>2]|0,l)}function Uy(o,l){o=o|0,l=l|0,Ey(n[o>>2]|0,l)}function Rh(o,l){o=o|0,l=l|0,Do(n[o>>2]|0,l)}function Zg(o,l){o=o|0,l=+l,Bh(n[o>>2]|0,y(l))}function Fh(o,l){o=o|0,l=+l,bl(n[o>>2]|0,y(l))}function h2(o,l){o=o|0,l=+l,Iy(n[o>>2]|0,y(l))}function g2(o,l){o=o|0,l=+l,Lg(n[o>>2]|0,y(l))}function d2(o,l){o=o|0,l=+l,Dl(n[o>>2]|0,y(l))}function m2(o,l){o=o|0,l=+l,Mg(n[o>>2]|0,y(l))}function bf(o,l){o=o|0,l=+l,e2(n[o>>2]|0,y(l))}function sr(o){o=o|0,vh(n[o>>2]|0)}function _y(o,l){o=o|0,l=+l,zi(n[o>>2]|0,y(l))}function y2(o,l){o=o|0,l=+l,yf(n[o>>2]|0,y(l))}function hc(o){o=o|0,qa(n[o>>2]|0)}function Pf(o,l){o=o|0,l=+l,du(n[o>>2]|0,y(l))}function $g(o,l){o=o|0,l=+l,Ef(n[o>>2]|0,y(l))}function ed(o,l){o=o|0,l=+l,di(n[o>>2]|0,y(l))}function E2(o,l){o=o|0,l=+l,GA(n[o>>2]|0,y(l))}function I2(o,l){o=o|0,l=+l,Aa(n[o>>2]|0,y(l))}function wu(o,l){o=o|0,l=+l,Ya(n[o>>2]|0,y(l))}function td(o,l){o=o|0,l=+l,Sh(n[o>>2]|0,y(l))}function C2(o,l){o=o|0,l=+l,Hg(n[o>>2]|0,y(l))}function Hy(o,l){o=o|0,l=+l,qA(n[o>>2]|0,y(l))}function Bu(o,l,u){o=o|0,l=l|0,u=+u,gu(n[o>>2]|0,l,y(u))}function jy(o,l,u){o=o|0,l=l|0,u=+u,bo(n[o>>2]|0,l,y(u))}function rd(o,l,u){o=o|0,l=l|0,u=+u,mf(n[o>>2]|0,l,y(u))}function nd(o){return o=o|0,Fg(n[o>>2]|0)|0}function ko(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,_A(d,n[l>>2]|0,u),Bs(o,d),I=A}function Bs(o,l){o=o|0,l=l|0,Tl(o,n[l+4>>2]|0,+y(h[l>>2]))}function Tl(o,l,u){o=o|0,l=l|0,u=+u,n[o>>2]=l,E[o+8>>3]=u}function Gy(o){return o=o|0,$1(n[o>>2]|0)|0}function ga(o){return o=o|0,Ih(n[o>>2]|0)|0}function mP(o){return o=o|0,hu(n[o>>2]|0)|0}function Nh(o){return o=o|0,Z1(n[o>>2]|0)|0}function w2(o){return o=o|0,Og(n[o>>2]|0)|0}function zL(o){return o=o|0,yy(n[o>>2]|0)|0}function yP(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,xt(d,n[l>>2]|0,u),Bs(o,d),I=A}function EP(o){return o=o|0,df(n[o>>2]|0)|0}function qy(o){return o=o|0,Sl(n[o>>2]|0)|0}function B2(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,UA(A,n[l>>2]|0),Bs(o,A),I=u}function Oh(o){return o=o|0,+ +y(li(n[o>>2]|0))}function IP(o){return o=o|0,+ +y(qi(n[o>>2]|0))}function CP(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,ur(A,n[l>>2]|0),Bs(o,A),I=u}function id(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,Ug(A,n[l>>2]|0),Bs(o,A),I=u}function XL(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,wt(A,n[l>>2]|0),Bs(o,A),I=u}function ZL(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,Wa(A,n[l>>2]|0),Bs(o,A),I=u}function wP(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,_g(A,n[l>>2]|0),Bs(o,A),I=u}function BP(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,vy(A,n[l>>2]|0),Bs(o,A),I=u}function $A(o){return o=o|0,+ +y(jg(n[o>>2]|0))}function $L(o,l){return o=o|0,l=l|0,+ +y(By(n[o>>2]|0,l))}function eM(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,yt(d,n[l>>2]|0,u),Bs(o,d),I=A}function vu(o,l,u){o=o|0,l=l|0,u=u|0,lr(n[o>>2]|0,n[l>>2]|0,u)}function tM(o,l){o=o|0,l=l|0,gf(n[o>>2]|0,n[l>>2]|0)}function vP(o){return o=o|0,Mi(n[o>>2]|0)|0}function rM(o){return o=o|0,o=Et(n[o>>2]|0)|0,o?o=c2(o)|0:o=0,o|0}function SP(o,l){return o=o|0,l=l|0,o=Is(n[o>>2]|0,l)|0,o?o=c2(o)|0:o=0,o|0}function xf(o,l){o=o|0,l=l|0;var u=0,A=0;A=Kt(4)|0,DP(A,l),u=o+4|0,l=n[u>>2]|0,n[u>>2]=A,l|0&&(Sf(l),It(l)),St(n[o>>2]|0,1)}function DP(o,l){o=o|0,l=l|0,oM(o,l)}function nM(o,l,u,A,d,m){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0;var B=0,k=0;B=I,I=I+16|0,k=B,bP(k,Ga(l)|0,+u,A,+d,m),h[o>>2]=y(+E[k>>3]),h[o+4>>2]=y(+E[k+8>>3]),I=B}function bP(o,l,u,A,d,m){o=o|0,l=l|0,u=+u,A=A|0,d=+d,m=m|0;var B=0,k=0,T=0,M=0,L=0;B=I,I=I+32|0,L=B+8|0,M=B+20|0,T=B,k=B+16|0,E[L>>3]=u,n[M>>2]=A,E[T>>3]=d,n[k>>2]=m,Wy(o,n[l+4>>2]|0,L,M,T,k),I=B}function Wy(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0;B=I,I=I+16|0,k=B,Fl(k),l=Os(l)|0,PP(o,l,+E[u>>3],n[A>>2]|0,+E[d>>3],n[m>>2]|0),Nl(k),I=B}function Os(o){return o=o|0,n[o>>2]|0}function PP(o,l,u,A,d,m){o=o|0,l=l|0,u=+u,A=A|0,d=+d,m=m|0;var B=0;B=da(v2()|0)|0,u=+Ja(u),A=Yy(A)|0,d=+Ja(d),iM(o,Kn(0,B|0,l|0,+u,A|0,+d,Yy(m)|0)|0)}function v2(){var o=0;return s[7608]|0||(D2(9120),o=7608,n[o>>2]=1,n[o+4>>2]=0),9120}function da(o){return o=o|0,n[o+8>>2]|0}function Ja(o){return o=+o,+ +kf(o)}function Yy(o){return o=o|0,sd(o)|0}function iM(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;d=I,I=I+32|0,u=d,A=l,A&1?(Ka(u,0),Me(A|0,u|0)|0,S2(o,u),sM(u)):(n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2]),I=d}function Ka(o,l){o=o|0,l=l|0,Su(o,l),n[o+8>>2]=0,s[o+24>>0]=0}function S2(o,l){o=o|0,l=l|0,l=l+8|0,n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2]}function sM(o){o=o|0,s[o+24>>0]=0}function Su(o,l){o=o|0,l=l|0,n[o>>2]=l}function sd(o){return o=o|0,o|0}function kf(o){return o=+o,+o}function D2(o){o=o|0,Qo(o,b2()|0,4)}function b2(){return 1064}function Qo(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=Gi(l|0,u+1|0)|0}function oM(o,l){o=o|0,l=l|0,l=n[l>>2]|0,n[o>>2]=l,au(l|0)}function xP(o){o=o|0;var l=0,u=0;u=o+4|0,l=n[u>>2]|0,n[u>>2]=0,l|0&&(Sf(l),It(l)),St(n[o>>2]|0,0)}function kP(o){o=o|0,bt(n[o>>2]|0)}function Vy(o){return o=o|0,tr(n[o>>2]|0)|0}function aM(o,l,u,A){o=o|0,l=+l,u=+u,A=A|0,YA(n[o>>2]|0,y(l),y(u),A)}function lM(o){return o=o|0,+ +y(mu(n[o>>2]|0))}function v(o){return o=o|0,+ +y(If(n[o>>2]|0))}function D(o){return o=o|0,+ +y(yu(n[o>>2]|0))}function Q(o){return o=o|0,+ +y(Rs(n[o>>2]|0))}function H(o){return o=o|0,+ +y(Eu(n[o>>2]|0))}function V(o){return o=o|0,+ +y(Gn(n[o>>2]|0))}function ne(o,l){o=o|0,l=l|0,E[o>>3]=+y(mu(n[l>>2]|0)),E[o+8>>3]=+y(If(n[l>>2]|0)),E[o+16>>3]=+y(yu(n[l>>2]|0)),E[o+24>>3]=+y(Rs(n[l>>2]|0)),E[o+32>>3]=+y(Eu(n[l>>2]|0)),E[o+40>>3]=+y(Gn(n[l>>2]|0))}function Se(o,l){return o=o|0,l=l|0,+ +y(is(n[o>>2]|0,l))}function _e(o,l){return o=o|0,l=l|0,+ +y(Pi(n[o>>2]|0,l))}function pt(o,l){return o=o|0,l=l|0,+ +y(WA(n[o>>2]|0,l))}function Wt(){return Qn()|0}function Sr(){Lr(),Zt(),zn(),yi(),za(),et()}function Lr(){p4e(11713,4938,1)}function Zt(){T_e(10448)}function zn(){p_e(10408)}function yi(){OUe(10324)}function za(){qLe(10096)}function et(){qe(9132)}function qe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Ze=0,ct=0,He=0,We=0,Lt=0,Gr=0,fr=0,$t=0,Tr=0,Hr=0,cr=0,Hn=0,To=0,Ro=0,Fo=0,Za=0,Wh=0,Yh=0,gc=0,Vh=0,Rf=0,Ff=0,Jh=0,Kh=0,zh=0,ln=0,dc=0,Xh=0,Pu=0,Zh=0,$h=0,Nf=0,Of=0,xu=0,oo=0,Ll=0,ma=0,mc=0,op=0,ap=0,Lf=0,lp=0,cp=0,ao=0,Ms=0,yc=0,Wn=0,up=0,No=0,ku=0,Oo=0,Qu=0,fp=0,Ap=0,Tu=0,lo=0,Ec=0,pp=0,hp=0,gp=0,Nr=0,ui=0,Us=0,Lo=0,co=0,Mr=0,Ar=0,Ic=0;l=I,I=I+672|0,u=l+656|0,Ic=l+648|0,Ar=l+640|0,Mr=l+632|0,co=l+624|0,Lo=l+616|0,Us=l+608|0,ui=l+600|0,Nr=l+592|0,gp=l+584|0,hp=l+576|0,pp=l+568|0,Ec=l+560|0,lo=l+552|0,Tu=l+544|0,Ap=l+536|0,fp=l+528|0,Qu=l+520|0,Oo=l+512|0,ku=l+504|0,No=l+496|0,up=l+488|0,Wn=l+480|0,yc=l+472|0,Ms=l+464|0,ao=l+456|0,cp=l+448|0,lp=l+440|0,Lf=l+432|0,ap=l+424|0,op=l+416|0,mc=l+408|0,ma=l+400|0,Ll=l+392|0,oo=l+384|0,xu=l+376|0,Of=l+368|0,Nf=l+360|0,$h=l+352|0,Zh=l+344|0,Pu=l+336|0,Xh=l+328|0,dc=l+320|0,ln=l+312|0,zh=l+304|0,Kh=l+296|0,Jh=l+288|0,Ff=l+280|0,Rf=l+272|0,Vh=l+264|0,gc=l+256|0,Yh=l+248|0,Wh=l+240|0,Za=l+232|0,Fo=l+224|0,Ro=l+216|0,To=l+208|0,Hn=l+200|0,cr=l+192|0,Hr=l+184|0,Tr=l+176|0,$t=l+168|0,fr=l+160|0,Gr=l+152|0,Lt=l+144|0,We=l+136|0,He=l+128|0,ct=l+120|0,Ze=l+112|0,tt=l+104|0,Qe=l+96|0,Le=l+88|0,Ye=l+80|0,ae=l+72|0,q=l+64|0,L=l+56|0,M=l+48|0,T=l+40|0,k=l+32|0,B=l+24|0,m=l+16|0,d=l+8|0,A=l,gt(o,3646),Xt(o,3651,2)|0,Dr(o,3665,2)|0,Zn(o,3682,18)|0,n[Ic>>2]=19,n[Ic+4>>2]=0,n[u>>2]=n[Ic>>2],n[u+4>>2]=n[Ic+4>>2],kr(o,3690,u)|0,n[Ar>>2]=1,n[Ar+4>>2]=0,n[u>>2]=n[Ar>>2],n[u+4>>2]=n[Ar+4>>2],Rn(o,3696,u)|0,n[Mr>>2]=2,n[Mr+4>>2]=0,n[u>>2]=n[Mr>>2],n[u+4>>2]=n[Mr+4>>2],_n(o,3706,u)|0,n[co>>2]=1,n[co+4>>2]=0,n[u>>2]=n[co>>2],n[u+4>>2]=n[co+4>>2],zr(o,3722,u)|0,n[Lo>>2]=2,n[Lo+4>>2]=0,n[u>>2]=n[Lo>>2],n[u+4>>2]=n[Lo+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+4>>2]=n[q+4>>2],ep(o,4669,u)|0,n[L>>2]=6,n[L+4>>2]=0,n[u>>2]=n[L>>2],n[u+4>>2]=n[L+4>>2],ep(o,4686,u)|0,n[M>>2]=7,n[M+4>>2]=0,n[u>>2]=n[M>>2],n[u+4>>2]=n[M+4>>2],ep(o,4701,u)|0,n[T>>2]=8,n[T+4>>2]=0,n[u>>2]=n[T>>2],n[u+4>>2]=n[T+4>>2],ep(o,4719,u)|0,n[k>>2]=9,n[k+4>>2]=0,n[u>>2]=n[k>>2],n[u+4>>2]=n[k+4>>2],ep(o,4736,u)|0,n[B>>2]=21,n[B+4>>2]=0,n[u>>2]=n[B>>2],n[u+4>>2]=n[B+4>>2],xke(o,4754,u)|0,n[m>>2]=2,n[m+4>>2]=0,n[u>>2]=n[m>>2],n[u+4>>2]=n[m+4>>2],QP(o,4772,u)|0,n[d>>2]=3,n[d+4>>2]=0,n[u>>2]=n[d>>2],n[u+4>>2]=n[d+4>>2],QP(o,4790,u)|0,n[A>>2]=4,n[A+4>>2]=0,n[u>>2]=n[A>>2],n[u+4>>2]=n[A+4>>2],QP(o,4808,u)|0,I=l}function gt(o,l){o=o|0,l=l|0;var u=0;u=NLe()|0,n[o>>2]=u,OLe(u,l),jh(n[o>>2]|0)}function Xt(o,l,u){return o=o|0,l=l|0,u=u|0,CLe(o,Bn(l)|0,u,0),o|0}function Dr(o,l,u){return o=o|0,l=l|0,u=u|0,sLe(o,Bn(l)|0,u,0),o|0}function Zn(o,l,u){return o=o|0,l=l|0,u=u|0,WOe(o,Bn(l)|0,u,0),o|0}function kr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xOe(o,l,d),I=A,o|0}function Rn(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],uOe(o,l,d),I=A,o|0}function _n(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],JNe(o,l,d),I=A,o|0}function zr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],TNe(o,l,d),I=A,o|0}function ci(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],dNe(o,l,d),I=A,o|0}function Du(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],eNe(o,l,d),I=A,o|0}function cM(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],MFe(o,l,d),I=A,o|0}function od(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],uFe(o,l,d),I=A,o|0}function ep(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],JRe(o,l,d),I=A,o|0}function QP(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],TRe(o,l,d),I=A,o|0}function Cke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],dRe(o,l,d),I=A,o|0}function wke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],eRe(o,l,d),I=A,o|0}function Bke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],UTe(o,l,d),I=A,o|0}function vke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],vTe(o,l,d),I=A,o|0}function Ske(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],aTe(o,l,d),I=A,o|0}function Dke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],qQe(o,l,d),I=A,o|0}function bke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],PQe(o,l,d),I=A,o|0}function Pke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],uQe(o,l,d),I=A,o|0}function xke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kke(o,l,d),I=A,o|0}function kke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Qke(o,u,d,1),I=A}function Bn(o){return o=o|0,o|0}function Qke(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=uM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=Tke(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,Rke(m,A)|0,A),I=d}function uM(){var o=0,l=0;if(s[7616]|0||(mz(9136),gr(24,9136,U|0)|0,l=7616,n[l>>2]=1,n[l+4>>2]=0),!(_r(9136)|0)){o=9136,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));mz(9136)}return 9136}function Tke(o){return o=o|0,0}function Rke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=uM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],dz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(Oke(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function vn(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0;B=I,I=I+32|0,ae=B+24|0,q=B+20|0,T=B+16|0,L=B+12|0,M=B+8|0,k=B+4|0,Ye=B,n[q>>2]=l,n[T>>2]=u,n[L>>2]=A,n[M>>2]=d,n[k>>2]=m,m=o+28|0,n[Ye>>2]=n[m>>2],n[ae>>2]=n[Ye>>2],Fke(o+24|0,ae,q,L,M,T,k)|0,n[m>>2]=n[n[m>>2]>>2],I=B}function Fke(o,l,u,A,d,m,B){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,o=Nke(l)|0,l=Kt(24)|0,gz(l+4|0,n[u>>2]|0,n[A>>2]|0,n[d>>2]|0,n[m>>2]|0,n[B>>2]|0),n[l>>2]=n[o>>2],n[o>>2]=l,l|0}function Nke(o){return o=o|0,n[o>>2]|0}function gz(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=A,n[o+12>>2]=d,n[o+16>>2]=m}function yr(o,l){return o=o|0,l=l|0,l|o|0}function dz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function Oke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=Lke(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,Mke(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],dz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,Uke(o,k),_ke(k),I=M;return}}function Lke(o){return o=o|0,357913941}function Mke(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function Uke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function _ke(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function mz(o){o=o|0,Gke(o)}function Hke(o){o=o|0,jke(o+24|0)}function _r(o){return o=o|0,n[o>>2]|0}function jke(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function Gke(o){o=o|0;var l=0;l=tn()|0,rn(o,2,3,l,qke()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function tn(){return 9228}function qke(){return 1140}function Wke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=Yke(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=Vke(l,A)|0,I=u,l|0}function rn(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=A,n[o+12>>2]=d,n[o+16>>2]=m}function Yke(o){return o=o|0,(n[(uM()|0)+24>>2]|0)+(o*12|0)|0}function Vke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+48|0,A=d,u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sp[u&31](A,o),A=Jke(A)|0,I=d,A|0}function Jke(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=fM(yz()|0)|0,A?(AM(l,A),pM(u,l),Kke(o,u),o=hM(l)|0):o=zke(o)|0,I=d,o|0}function yz(){var o=0;return s[7632]|0||(oQe(9184),gr(25,9184,U|0)|0,o=7632,n[o>>2]=1,n[o+4>>2]=0),9184}function fM(o){return o=o|0,n[o+36>>2]|0}function AM(o,l){o=o|0,l=l|0,n[o>>2]=l,n[o+4>>2]=o,n[o+8>>2]=0}function pM(o,l){o=o|0,l=l|0,n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=0}function Kke(o,l){o=o|0,l=l|0,eQe(l,o,o+8|0,o+16|0,o+24|0,o+32|0,o+40|0)|0}function hM(o){return o=o|0,n[(n[o+4>>2]|0)+8>>2]|0}function zke(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0;T=I,I=I+16|0,u=T+4|0,A=T,d=Rl(8)|0,m=d,B=Kt(48)|0,k=B,l=k+48|0;do n[k>>2]=n[o>>2],k=k+4|0,o=o+4|0;while((k|0)<(l|0));return l=m+4|0,n[l>>2]=B,k=Kt(8)|0,B=n[l>>2]|0,n[A>>2]=0,n[u>>2]=n[A>>2],Ez(k,B,u),n[d>>2]=k,I=T,m|0}function Ez(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1092,n[u+12>>2]=l,n[o+4>>2]=u}function Xke(o){o=o|0,$y(o),It(o)}function Zke(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function $ke(o){o=o|0,It(o)}function eQe(o,l,u,A,d,m,B){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,m=tQe(n[o>>2]|0,l,u,A,d,m,B)|0,B=o+4|0,n[(n[B>>2]|0)+8>>2]=m,n[(n[B>>2]|0)+8>>2]|0}function tQe(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0;var k=0,T=0;return k=I,I=I+16|0,T=k,Fl(T),o=Os(o)|0,B=rQe(o,+E[l>>3],+E[u>>3],+E[A>>3],+E[d>>3],+E[m>>3],+E[B>>3])|0,Nl(T),I=k,B|0}function rQe(o,l,u,A,d,m,B){o=o|0,l=+l,u=+u,A=+A,d=+d,m=+m,B=+B;var k=0;return k=da(nQe()|0)|0,l=+Ja(l),u=+Ja(u),A=+Ja(A),d=+Ja(d),m=+Ja(m),ro(0,k|0,o|0,+l,+u,+A,+d,+m,+ +Ja(B))|0}function nQe(){var o=0;return s[7624]|0||(iQe(9172),o=7624,n[o>>2]=1,n[o+4>>2]=0),9172}function iQe(o){o=o|0,Qo(o,sQe()|0,6)}function sQe(){return 1112}function oQe(o){o=o|0,Lh(o)}function aQe(o){o=o|0,Iz(o+24|0),Cz(o+16|0)}function Iz(o){o=o|0,cQe(o)}function Cz(o){o=o|0,lQe(o)}function lQe(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function cQe(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function Lh(o){o=o|0;var l=0;n[o+16>>2]=0,n[o+20>>2]=0,l=o+24|0,n[l>>2]=0,n[o+28>>2]=l,n[o+36>>2]=0,s[o+40>>0]=0,s[o+41>>0]=0}function uQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fQe(o,u,d,0),I=A}function fQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=gM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=AQe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,pQe(m,A)|0,A),I=d}function gM(){var o=0,l=0;if(s[7640]|0||(Bz(9232),gr(26,9232,U|0)|0,l=7640,n[l>>2]=1,n[l+4>>2]=0),!(_r(9232)|0)){o=9232,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Bz(9232)}return 9232}function AQe(o){return o=o|0,0}function pQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=gM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],wz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(hQe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function wz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function hQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=gQe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,dQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],wz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,mQe(o,k),yQe(k),I=M;return}}function gQe(o){return o=o|0,357913941}function dQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function mQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function yQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Bz(o){o=o|0,CQe(o)}function EQe(o){o=o|0,IQe(o+24|0)}function IQe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function CQe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,1,l,wQe()|0,3),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function wQe(){return 1144}function BQe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0;var m=0,B=0,k=0,T=0;m=I,I=I+16|0,B=m+8|0,k=m,T=vQe(o)|0,o=n[T+4>>2]|0,n[k>>2]=n[T>>2],n[k+4>>2]=o,n[B>>2]=n[k>>2],n[B+4>>2]=n[k+4>>2],SQe(l,B,u,A,d),I=m}function vQe(o){return o=o|0,(n[(gM()|0)+24>>2]|0)+(o*12|0)|0}function SQe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0;var m=0,B=0,k=0,T=0,M=0;M=I,I=I+16|0,B=M+2|0,k=M+1|0,T=M,m=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(m=n[(n[o>>2]|0)+m>>2]|0),Qf(B,u),u=+Tf(B,u),Qf(k,A),A=+Tf(k,A),tp(T,d),T=rp(T,d)|0,MZ[m&1](o,u,A,T),I=M}function Qf(o,l){o=o|0,l=+l}function Tf(o,l){return o=o|0,l=+l,+ +bQe(l)}function tp(o,l){o=o|0,l=l|0}function rp(o,l){return o=o|0,l=l|0,DQe(l)|0}function DQe(o){return o=o|0,o|0}function bQe(o){return o=+o,+o}function PQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xQe(o,u,d,1),I=A}function xQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=dM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=kQe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,QQe(m,A)|0,A),I=d}function dM(){var o=0,l=0;if(s[7648]|0||(Sz(9268),gr(27,9268,U|0)|0,l=7648,n[l>>2]=1,n[l+4>>2]=0),!(_r(9268)|0)){o=9268,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Sz(9268)}return 9268}function kQe(o){return o=o|0,0}function QQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=dM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],vz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(TQe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function vz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function TQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=RQe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,FQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],vz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,NQe(o,k),OQe(k),I=M;return}}function RQe(o){return o=o|0,357913941}function FQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function NQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function OQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Sz(o){o=o|0,UQe(o)}function LQe(o){o=o|0,MQe(o+24|0)}function MQe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function UQe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,4,l,_Qe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function _Qe(){return 1160}function HQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=jQe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=GQe(l,A)|0,I=u,l|0}function jQe(o){return o=o|0,(n[(dM()|0)+24>>2]|0)+(o*12|0)|0}function GQe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),Dz(gd[u&31](o)|0)|0}function Dz(o){return o=o|0,o&1|0}function qQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],WQe(o,u,d,0),I=A}function WQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=mM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=YQe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,VQe(m,A)|0,A),I=d}function mM(){var o=0,l=0;if(s[7656]|0||(Pz(9304),gr(28,9304,U|0)|0,l=7656,n[l>>2]=1,n[l+4>>2]=0),!(_r(9304)|0)){o=9304,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Pz(9304)}return 9304}function YQe(o){return o=o|0,0}function VQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=mM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],bz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(JQe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function bz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function JQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=KQe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,zQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],bz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,XQe(o,k),ZQe(k),I=M;return}}function KQe(o){return o=o|0,357913941}function zQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function XQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function ZQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Pz(o){o=o|0,tTe(o)}function $Qe(o){o=o|0,eTe(o+24|0)}function eTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function tTe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,5,l,rTe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function rTe(){return 1164}function nTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=iTe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],sTe(l,d,u),I=A}function iTe(o){return o=o|0,(n[(mM()|0)+24>>2]|0)+(o*12|0)|0}function sTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),Mh(d,u),u=Uh(d,u)|0,sp[A&31](o,u),_h(d),I=m}function Mh(o,l){o=o|0,l=l|0,oTe(o,l)}function Uh(o,l){return o=o|0,l=l|0,o|0}function _h(o){o=o|0,Sf(o)}function oTe(o,l){o=o|0,l=l|0,yM(o,l)}function yM(o,l){o=o|0,l=l|0,n[o>>2]=l}function aTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lTe(o,u,d,0),I=A}function lTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=EM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=cTe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,uTe(m,A)|0,A),I=d}function EM(){var o=0,l=0;if(s[7664]|0||(kz(9340),gr(29,9340,U|0)|0,l=7664,n[l>>2]=1,n[l+4>>2]=0),!(_r(9340)|0)){o=9340,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));kz(9340)}return 9340}function cTe(o){return o=o|0,0}function uTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=EM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],xz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(fTe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function xz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function fTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=ATe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,pTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],xz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,hTe(o,k),gTe(k),I=M;return}}function ATe(o){return o=o|0,357913941}function pTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function hTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function gTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function kz(o){o=o|0,yTe(o)}function dTe(o){o=o|0,mTe(o+24|0)}function mTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function yTe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,4,l,ETe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function ETe(){return 1180}function ITe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=CTe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=wTe(l,d,u)|0,I=A,u|0}function CTe(o){return o=o|0,(n[(EM()|0)+24>>2]|0)+(o*12|0)|0}function wTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),ad(d,u),d=ld(d,u)|0,d=TP(gU[A&15](o,d)|0)|0,I=m,d|0}function ad(o,l){o=o|0,l=l|0}function ld(o,l){return o=o|0,l=l|0,BTe(l)|0}function TP(o){return o=o|0,o|0}function BTe(o){return o=o|0,o|0}function vTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],STe(o,u,d,0),I=A}function STe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=IM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=DTe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,bTe(m,A)|0,A),I=d}function IM(){var o=0,l=0;if(s[7672]|0||(Tz(9376),gr(30,9376,U|0)|0,l=7672,n[l>>2]=1,n[l+4>>2]=0),!(_r(9376)|0)){o=9376,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Tz(9376)}return 9376}function DTe(o){return o=o|0,0}function bTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=IM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Qz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(PTe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Qz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function PTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=xTe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,kTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Qz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,QTe(o,k),TTe(k),I=M;return}}function xTe(o){return o=o|0,357913941}function kTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function QTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function TTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Tz(o){o=o|0,NTe(o)}function RTe(o){o=o|0,FTe(o+24|0)}function FTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function NTe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,5,l,Rz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Rz(){return 1196}function OTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=LTe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=MTe(l,A)|0,I=u,l|0}function LTe(o){return o=o|0,(n[(IM()|0)+24>>2]|0)+(o*12|0)|0}function MTe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),TP(gd[u&31](o)|0)|0}function UTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],_Te(o,u,d,1),I=A}function _Te(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=CM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=HTe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,jTe(m,A)|0,A),I=d}function CM(){var o=0,l=0;if(s[7680]|0||(Nz(9412),gr(31,9412,U|0)|0,l=7680,n[l>>2]=1,n[l+4>>2]=0),!(_r(9412)|0)){o=9412,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Nz(9412)}return 9412}function HTe(o){return o=o|0,0}function jTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=CM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Fz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(GTe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Fz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function GTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=qTe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,WTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Fz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,YTe(o,k),VTe(k),I=M;return}}function qTe(o){return o=o|0,357913941}function WTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function YTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function VTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Nz(o){o=o|0,zTe(o)}function JTe(o){o=o|0,KTe(o+24|0)}function KTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function zTe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,6,l,Oz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Oz(){return 1200}function XTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=ZTe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=$Te(l,A)|0,I=u,l|0}function ZTe(o){return o=o|0,(n[(CM()|0)+24>>2]|0)+(o*12|0)|0}function $Te(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),RP(gd[u&31](o)|0)|0}function RP(o){return o=o|0,o|0}function eRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],tRe(o,u,d,0),I=A}function tRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=wM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=rRe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,nRe(m,A)|0,A),I=d}function wM(){var o=0,l=0;if(s[7688]|0||(Mz(9448),gr(32,9448,U|0)|0,l=7688,n[l>>2]=1,n[l+4>>2]=0),!(_r(9448)|0)){o=9448,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Mz(9448)}return 9448}function rRe(o){return o=o|0,0}function nRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=wM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Lz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(iRe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Lz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function iRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=sRe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,oRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Lz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,aRe(o,k),lRe(k),I=M;return}}function sRe(o){return o=o|0,357913941}function oRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function aRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function lRe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Mz(o){o=o|0,fRe(o)}function cRe(o){o=o|0,uRe(o+24|0)}function uRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function fRe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,6,l,Uz()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Uz(){return 1204}function ARe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=pRe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hRe(l,d,u),I=A}function pRe(o){return o=o|0,(n[(wM()|0)+24>>2]|0)+(o*12|0)|0}function hRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),BM(d,u),d=vM(d,u)|0,sp[A&31](o,d),I=m}function BM(o,l){o=o|0,l=l|0}function vM(o,l){return o=o|0,l=l|0,gRe(l)|0}function gRe(o){return o=o|0,o|0}function dRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],mRe(o,u,d,0),I=A}function mRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=SM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=yRe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,ERe(m,A)|0,A),I=d}function SM(){var o=0,l=0;if(s[7696]|0||(Hz(9484),gr(33,9484,U|0)|0,l=7696,n[l>>2]=1,n[l+4>>2]=0),!(_r(9484)|0)){o=9484,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Hz(9484)}return 9484}function yRe(o){return o=o|0,0}function ERe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=SM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],_z(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(IRe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function _z(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function IRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=CRe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,wRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],_z(m,A,u),n[T>>2]=(n[T>>2]|0)+12,BRe(o,k),vRe(k),I=M;return}}function CRe(o){return o=o|0,357913941}function wRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function BRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function vRe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Hz(o){o=o|0,bRe(o)}function SRe(o){o=o|0,DRe(o+24|0)}function DRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function bRe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,1,l,PRe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function PRe(){return 1212}function xRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=kRe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],QRe(l,m,u,A),I=d}function kRe(o){return o=o|0,(n[(SM()|0)+24>>2]|0)+(o*12|0)|0}function QRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),BM(m,u),m=vM(m,u)|0,ad(B,A),B=ld(B,A)|0,F2[d&15](o,m,B),I=k}function TRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],RRe(o,u,d,1),I=A}function RRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=DM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=FRe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,NRe(m,A)|0,A),I=d}function DM(){var o=0,l=0;if(s[7704]|0||(Gz(9520),gr(34,9520,U|0)|0,l=7704,n[l>>2]=1,n[l+4>>2]=0),!(_r(9520)|0)){o=9520,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Gz(9520)}return 9520}function FRe(o){return o=o|0,0}function NRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=DM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],jz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(ORe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function jz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function ORe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=LRe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,MRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],jz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,URe(o,k),_Re(k),I=M;return}}function LRe(o){return o=o|0,357913941}function MRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function URe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function _Re(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Gz(o){o=o|0,GRe(o)}function HRe(o){o=o|0,jRe(o+24|0)}function jRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function GRe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,1,l,qRe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function qRe(){return 1224}function WRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;return d=I,I=I+16|0,m=d+8|0,B=d,k=YRe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],A=+VRe(l,m,u),I=d,+A}function YRe(o){return o=o|0,(n[(DM()|0)+24>>2]|0)+(o*12|0)|0}function VRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,B=+kf(+_Z[A&7](o,d)),I=m,+B}function JRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],KRe(o,u,d,1),I=A}function KRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=bM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=zRe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,XRe(m,A)|0,A),I=d}function bM(){var o=0,l=0;if(s[7712]|0||(Wz(9556),gr(35,9556,U|0)|0,l=7712,n[l>>2]=1,n[l+4>>2]=0),!(_r(9556)|0)){o=9556,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Wz(9556)}return 9556}function zRe(o){return o=o|0,0}function XRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=bM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],qz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(ZRe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function qz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function ZRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=$Re(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,eFe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],qz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,tFe(o,k),rFe(k),I=M;return}}function $Re(o){return o=o|0,357913941}function eFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function tFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function rFe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Wz(o){o=o|0,sFe(o)}function nFe(o){o=o|0,iFe(o+24|0)}function iFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function sFe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,5,l,oFe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function oFe(){return 1232}function aFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=lFe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=+cFe(l,d),I=A,+u}function lFe(o){return o=o|0,(n[(bM()|0)+24>>2]|0)+(o*12|0)|0}function cFe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),+ +kf(+UZ[u&15](o))}function uFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fFe(o,u,d,1),I=A}function fFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=PM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=AFe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,pFe(m,A)|0,A),I=d}function PM(){var o=0,l=0;if(s[7720]|0||(Vz(9592),gr(36,9592,U|0)|0,l=7720,n[l>>2]=1,n[l+4>>2]=0),!(_r(9592)|0)){o=9592,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Vz(9592)}return 9592}function AFe(o){return o=o|0,0}function pFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=PM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Yz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(hFe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Yz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function hFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=gFe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,dFe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Yz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,mFe(o,k),yFe(k),I=M;return}}function gFe(o){return o=o|0,357913941}function dFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function mFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function yFe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Vz(o){o=o|0,CFe(o)}function EFe(o){o=o|0,IFe(o+24|0)}function IFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function CFe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,7,l,wFe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function wFe(){return 1276}function BFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=vFe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=SFe(l,A)|0,I=u,l|0}function vFe(o){return o=o|0,(n[(PM()|0)+24>>2]|0)+(o*12|0)|0}function SFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+16|0,A=d,u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sp[u&31](A,o),A=Jz(A)|0,I=d,A|0}function Jz(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=fM(Kz()|0)|0,A?(AM(l,A),pM(u,l),DFe(o,u),o=hM(l)|0):o=bFe(o)|0,I=d,o|0}function Kz(){var o=0;return s[7736]|0||(LFe(9640),gr(25,9640,U|0)|0,o=7736,n[o>>2]=1,n[o+4>>2]=0),9640}function DFe(o,l){o=o|0,l=l|0,QFe(l,o,o+8|0)|0}function bFe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Rl(8)|0,l=A,k=Kt(16)|0,n[k>>2]=n[o>>2],n[k+4>>2]=n[o+4>>2],n[k+8>>2]=n[o+8>>2],n[k+12>>2]=n[o+12>>2],m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],xM(o,m,d),n[A>>2]=o,I=u,l|0}function xM(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1244,n[u+12>>2]=l,n[o+4>>2]=u}function PFe(o){o=o|0,$y(o),It(o)}function xFe(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function kFe(o){o=o|0,It(o)}function QFe(o,l,u){return o=o|0,l=l|0,u=u|0,l=TFe(n[o>>2]|0,l,u)|0,u=o+4|0,n[(n[u>>2]|0)+8>>2]=l,n[(n[u>>2]|0)+8>>2]|0}function TFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;return A=I,I=I+16|0,d=A,Fl(d),o=Os(o)|0,u=RFe(o,n[l>>2]|0,+E[u>>3])|0,Nl(d),I=A,u|0}function RFe(o,l,u){o=o|0,l=l|0,u=+u;var A=0;return A=da(FFe()|0)|0,l=Yy(l)|0,ou(0,A|0,o|0,l|0,+ +Ja(u))|0}function FFe(){var o=0;return s[7728]|0||(NFe(9628),o=7728,n[o>>2]=1,n[o+4>>2]=0),9628}function NFe(o){o=o|0,Qo(o,OFe()|0,2)}function OFe(){return 1264}function LFe(o){o=o|0,Lh(o)}function MFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],UFe(o,u,d,1),I=A}function UFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=kM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=_Fe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,HFe(m,A)|0,A),I=d}function kM(){var o=0,l=0;if(s[7744]|0||(Xz(9684),gr(37,9684,U|0)|0,l=7744,n[l>>2]=1,n[l+4>>2]=0),!(_r(9684)|0)){o=9684,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Xz(9684)}return 9684}function _Fe(o){return o=o|0,0}function HFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=kM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],zz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(jFe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function zz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function jFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=GFe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,qFe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],zz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,WFe(o,k),YFe(k),I=M;return}}function GFe(o){return o=o|0,357913941}function qFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function WFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function YFe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Xz(o){o=o|0,KFe(o)}function VFe(o){o=o|0,JFe(o+24|0)}function JFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function KFe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,5,l,zFe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function zFe(){return 1280}function XFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=ZFe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=$Fe(l,d,u)|0,I=A,u|0}function ZFe(o){return o=o|0,(n[(kM()|0)+24>>2]|0)+(o*12|0)|0}function $Fe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return B=I,I=I+32|0,d=B,m=B+16|0,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(m,u),m=rp(m,u)|0,F2[A&15](d,o,m),m=Jz(d)|0,I=B,m|0}function eNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],tNe(o,u,d,1),I=A}function tNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=QM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=rNe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,nNe(m,A)|0,A),I=d}function QM(){var o=0,l=0;if(s[7752]|0||($z(9720),gr(38,9720,U|0)|0,l=7752,n[l>>2]=1,n[l+4>>2]=0),!(_r(9720)|0)){o=9720,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));$z(9720)}return 9720}function rNe(o){return o=o|0,0}function nNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=QM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Zz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(iNe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Zz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function iNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=sNe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,oNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Zz(m,A,u),n[T>>2]=(n[T>>2]|0)+12,aNe(o,k),lNe(k),I=M;return}}function sNe(o){return o=o|0,357913941}function oNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function aNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function lNe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function $z(o){o=o|0,fNe(o)}function cNe(o){o=o|0,uNe(o+24|0)}function uNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function fNe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,8,l,ANe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function ANe(){return 1288}function pNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=hNe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=gNe(l,A)|0,I=u,l|0}function hNe(o){return o=o|0,(n[(QM()|0)+24>>2]|0)+(o*12|0)|0}function gNe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sd(gd[u&31](o)|0)|0}function dNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],mNe(o,u,d,0),I=A}function mNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=TM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=yNe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,ENe(m,A)|0,A),I=d}function TM(){var o=0,l=0;if(s[7760]|0||(tX(9756),gr(39,9756,U|0)|0,l=7760,n[l>>2]=1,n[l+4>>2]=0),!(_r(9756)|0)){o=9756,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));tX(9756)}return 9756}function yNe(o){return o=o|0,0}function ENe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=TM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],eX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(INe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function eX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function INe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=CNe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,wNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],eX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,BNe(o,k),vNe(k),I=M;return}}function CNe(o){return o=o|0,357913941}function wNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function BNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function vNe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function tX(o){o=o|0,bNe(o)}function SNe(o){o=o|0,DNe(o+24|0)}function DNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function bNe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,8,l,PNe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function PNe(){return 1292}function xNe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=kNe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],QNe(l,d,u),I=A}function kNe(o){return o=o|0,(n[(TM()|0)+24>>2]|0)+(o*12|0)|0}function QNe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),Qf(d,u),u=+Tf(d,u),OZ[A&31](o,u),I=m}function TNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],RNe(o,u,d,0),I=A}function RNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=RM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=FNe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,NNe(m,A)|0,A),I=d}function RM(){var o=0,l=0;if(s[7768]|0||(nX(9792),gr(40,9792,U|0)|0,l=7768,n[l>>2]=1,n[l+4>>2]=0),!(_r(9792)|0)){o=9792,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));nX(9792)}return 9792}function FNe(o){return o=o|0,0}function NNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=RM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],rX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(ONe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function rX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function ONe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=LNe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,MNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],rX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,UNe(o,k),_Ne(k),I=M;return}}function LNe(o){return o=o|0,357913941}function MNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function UNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function _Ne(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function nX(o){o=o|0,GNe(o)}function HNe(o){o=o|0,jNe(o+24|0)}function jNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function GNe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,1,l,qNe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function qNe(){return 1300}function WNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=YNe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],VNe(l,m,u,A),I=d}function YNe(o){return o=o|0,(n[(RM()|0)+24>>2]|0)+(o*12|0)|0}function VNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),tp(m,u),m=rp(m,u)|0,Qf(B,A),A=+Tf(B,A),qZ[d&15](o,m,A),I=k}function JNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],KNe(o,u,d,0),I=A}function KNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=FM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=zNe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,XNe(m,A)|0,A),I=d}function FM(){var o=0,l=0;if(s[7776]|0||(sX(9828),gr(41,9828,U|0)|0,l=7776,n[l>>2]=1,n[l+4>>2]=0),!(_r(9828)|0)){o=9828,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));sX(9828)}return 9828}function zNe(o){return o=o|0,0}function XNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=FM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],iX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(ZNe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function iX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function ZNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=$Ne(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,eOe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],iX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,tOe(o,k),rOe(k),I=M;return}}function $Ne(o){return o=o|0,357913941}function eOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function tOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function rOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function sX(o){o=o|0,sOe(o)}function nOe(o){o=o|0,iOe(o+24|0)}function iOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function sOe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,7,l,oOe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function oOe(){return 1312}function aOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=lOe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],cOe(l,d,u),I=A}function lOe(o){return o=o|0,(n[(FM()|0)+24>>2]|0)+(o*12|0)|0}function cOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,sp[A&31](o,d),I=m}function uOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fOe(o,u,d,0),I=A}function fOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=NM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=AOe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,pOe(m,A)|0,A),I=d}function NM(){var o=0,l=0;if(s[7784]|0||(aX(9864),gr(42,9864,U|0)|0,l=7784,n[l>>2]=1,n[l+4>>2]=0),!(_r(9864)|0)){o=9864,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));aX(9864)}return 9864}function AOe(o){return o=o|0,0}function pOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=NM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],oX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(hOe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function oX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function hOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=gOe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,dOe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],oX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,mOe(o,k),yOe(k),I=M;return}}function gOe(o){return o=o|0,357913941}function dOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function mOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function yOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function aX(o){o=o|0,COe(o)}function EOe(o){o=o|0,IOe(o+24|0)}function IOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function COe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,8,l,wOe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function wOe(){return 1320}function BOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=vOe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],SOe(l,d,u),I=A}function vOe(o){return o=o|0,(n[(NM()|0)+24>>2]|0)+(o*12|0)|0}function SOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),DOe(d,u),d=bOe(d,u)|0,sp[A&31](o,d),I=m}function DOe(o,l){o=o|0,l=l|0}function bOe(o,l){return o=o|0,l=l|0,POe(l)|0}function POe(o){return o=o|0,o|0}function xOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kOe(o,u,d,0),I=A}function kOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=OM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=QOe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,TOe(m,A)|0,A),I=d}function OM(){var o=0,l=0;if(s[7792]|0||(cX(9900),gr(43,9900,U|0)|0,l=7792,n[l>>2]=1,n[l+4>>2]=0),!(_r(9900)|0)){o=9900,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));cX(9900)}return 9900}function QOe(o){return o=o|0,0}function TOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=OM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],lX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(ROe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function lX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function ROe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=FOe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,NOe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],lX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,OOe(o,k),LOe(k),I=M;return}}function FOe(o){return o=o|0,357913941}function NOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function OOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function LOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function cX(o){o=o|0,_Oe(o)}function MOe(o){o=o|0,UOe(o+24|0)}function UOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function _Oe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,22,l,HOe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function HOe(){return 1344}function jOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;u=I,I=I+16|0,A=u+8|0,d=u,m=GOe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],qOe(l,A),I=u}function GOe(o){return o=o|0,(n[(OM()|0)+24>>2]|0)+(o*12|0)|0}function qOe(o,l){o=o|0,l=l|0;var u=0;u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),ip[u&127](o)}function WOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=LM()|0,o=YOe(u)|0,vn(m,l,d,o,VOe(u,A)|0,A)}function LM(){var o=0,l=0;if(s[7800]|0||(fX(9936),gr(44,9936,U|0)|0,l=7800,n[l>>2]=1,n[l+4>>2]=0),!(_r(9936)|0)){o=9936,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));fX(9936)}return 9936}function YOe(o){return o=o|0,o|0}function VOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=LM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(uX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(JOe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function uX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function JOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=KOe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,zOe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,uX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,XOe(o,d),ZOe(d),I=k;return}}function KOe(o){return o=o|0,536870911}function zOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function XOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function ZOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function fX(o){o=o|0,tLe(o)}function $Oe(o){o=o|0,eLe(o+24|0)}function eLe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function tLe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,23,l,Uz()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function rLe(o,l){o=o|0,l=l|0,iLe(n[(nLe(o)|0)>>2]|0,l)}function nLe(o){return o=o|0,(n[(LM()|0)+24>>2]|0)+(o<<3)|0}function iLe(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,BM(A,l),l=vM(A,l)|0,ip[o&127](l),I=u}function sLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=MM()|0,o=oLe(u)|0,vn(m,l,d,o,aLe(u,A)|0,A)}function MM(){var o=0,l=0;if(s[7808]|0||(pX(9972),gr(45,9972,U|0)|0,l=7808,n[l>>2]=1,n[l+4>>2]=0),!(_r(9972)|0)){o=9972,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));pX(9972)}return 9972}function oLe(o){return o=o|0,o|0}function aLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=MM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(AX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(lLe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function AX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function lLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=cLe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,uLe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,AX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,fLe(o,d),ALe(d),I=k;return}}function cLe(o){return o=o|0,536870911}function uLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function fLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function ALe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function pX(o){o=o|0,gLe(o)}function pLe(o){o=o|0,hLe(o+24|0)}function hLe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function gLe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,9,l,dLe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function dLe(){return 1348}function mLe(o,l){return o=o|0,l=l|0,ELe(n[(yLe(o)|0)>>2]|0,l)|0}function yLe(o){return o=o|0,(n[(MM()|0)+24>>2]|0)+(o<<3)|0}function ELe(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,hX(A,l),l=gX(A,l)|0,l=TP(gd[o&31](l)|0)|0,I=u,l|0}function hX(o,l){o=o|0,l=l|0}function gX(o,l){return o=o|0,l=l|0,ILe(l)|0}function ILe(o){return o=o|0,o|0}function CLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=UM()|0,o=wLe(u)|0,vn(m,l,d,o,BLe(u,A)|0,A)}function UM(){var o=0,l=0;if(s[7816]|0||(mX(10008),gr(46,10008,U|0)|0,l=7816,n[l>>2]=1,n[l+4>>2]=0),!(_r(10008)|0)){o=10008,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));mX(10008)}return 10008}function wLe(o){return o=o|0,o|0}function BLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=UM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(dX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(vLe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function dX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function vLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=SLe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,DLe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,dX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,bLe(o,d),PLe(d),I=k;return}}function SLe(o){return o=o|0,536870911}function DLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function bLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function PLe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function mX(o){o=o|0,QLe(o)}function xLe(o){o=o|0,kLe(o+24|0)}function kLe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function QLe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,15,l,Rz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function TLe(o){return o=o|0,FLe(n[(RLe(o)|0)>>2]|0)|0}function RLe(o){return o=o|0,(n[(UM()|0)+24>>2]|0)+(o<<3)|0}function FLe(o){return o=o|0,TP(VP[o&7]()|0)|0}function NLe(){var o=0;return s[7832]|0||(GLe(10052),gr(25,10052,U|0)|0,o=7832,n[o>>2]=1,n[o+4>>2]=0),10052}function OLe(o,l){o=o|0,l=l|0,n[o>>2]=LLe()|0,n[o+4>>2]=MLe()|0,n[o+12>>2]=l,n[o+8>>2]=ULe()|0,n[o+32>>2]=2}function LLe(){return 11709}function MLe(){return 1188}function ULe(){return FP()|0}function _Le(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(HLe(u),It(u)):l|0&&(Oy(l),It(l))}function Hh(o,l){return o=o|0,l=l|0,l&o|0}function HLe(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function FP(){var o=0;return s[7824]|0||(n[2511]=jLe()|0,n[2512]=0,o=7824,n[o>>2]=1,n[o+4>>2]=0),10044}function jLe(){return 0}function GLe(o){o=o|0,Lh(o)}function qLe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0;l=I,I=I+32|0,u=l+24|0,m=l+16|0,d=l+8|0,A=l,WLe(o,4827),YLe(o,4834,3)|0,VLe(o,3682,47)|0,n[m>>2]=9,n[m+4>>2]=0,n[u>>2]=n[m>>2],n[u+4>>2]=n[m+4>>2],JLe(o,4841,u)|0,n[d>>2]=1,n[d+4>>2]=0,n[u>>2]=n[d>>2],n[u+4>>2]=n[d+4>>2],KLe(o,4871,u)|0,n[A>>2]=10,n[A+4>>2]=0,n[u>>2]=n[A>>2],n[u+4>>2]=n[A+4>>2],zLe(o,4891,u)|0,I=l}function WLe(o,l){o=o|0,l=l|0;var u=0;u=PUe()|0,n[o>>2]=u,xUe(u,l),jh(n[o>>2]|0)}function YLe(o,l,u){return o=o|0,l=l|0,u=u|0,AUe(o,Bn(l)|0,u,0),o|0}function VLe(o,l,u){return o=o|0,l=l|0,u=u|0,XMe(o,Bn(l)|0,u,0),o|0}function JLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],TMe(o,l,d),I=A,o|0}function KLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],pMe(o,l,d),I=A,o|0}function zLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],XLe(o,l,d),I=A,o|0}function XLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],ZLe(o,u,d,1),I=A}function ZLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=_M()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=$Le(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,eMe(m,A)|0,A),I=d}function _M(){var o=0,l=0;if(s[7840]|0||(EX(10100),gr(48,10100,U|0)|0,l=7840,n[l>>2]=1,n[l+4>>2]=0),!(_r(10100)|0)){o=10100,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));EX(10100)}return 10100}function $Le(o){return o=o|0,0}function eMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=_M()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],yX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(tMe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function yX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function tMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=rMe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,nMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],yX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,iMe(o,k),sMe(k),I=M;return}}function rMe(o){return o=o|0,357913941}function nMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function iMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function sMe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function EX(o){o=o|0,lMe(o)}function oMe(o){o=o|0,aMe(o+24|0)}function aMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function lMe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,6,l,cMe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function cMe(){return 1364}function uMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=fMe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=AMe(l,d,u)|0,I=A,u|0}function fMe(o){return o=o|0,(n[(_M()|0)+24>>2]|0)+(o*12|0)|0}function AMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,d=Dz(gU[A&15](o,d)|0)|0,I=m,d|0}function pMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hMe(o,u,d,0),I=A}function hMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=HM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=gMe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,dMe(m,A)|0,A),I=d}function HM(){var o=0,l=0;if(s[7848]|0||(CX(10136),gr(49,10136,U|0)|0,l=7848,n[l>>2]=1,n[l+4>>2]=0),!(_r(10136)|0)){o=10136,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));CX(10136)}return 10136}function gMe(o){return o=o|0,0}function dMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=HM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],IX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(mMe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function IX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function mMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=yMe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,EMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],IX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,IMe(o,k),CMe(k),I=M;return}}function yMe(o){return o=o|0,357913941}function EMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function IMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function CMe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function CX(o){o=o|0,vMe(o)}function wMe(o){o=o|0,BMe(o+24|0)}function BMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function vMe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,9,l,SMe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function SMe(){return 1372}function DMe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=bMe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],PMe(l,d,u),I=A}function bMe(o){return o=o|0,(n[(HM()|0)+24>>2]|0)+(o*12|0)|0}function PMe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=$e;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),xMe(d,u),B=y(kMe(d,u)),NZ[A&1](o,B),I=m}function xMe(o,l){o=o|0,l=+l}function kMe(o,l){return o=o|0,l=+l,y(QMe(l))}function QMe(o){return o=+o,y(o)}function TMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],RMe(o,u,d,0),I=A}function RMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,T=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,T=n[u+4>>2]|0,B=n[o>>2]|0,o=jM()|0,n[L>>2]=M,n[L+4>>2]=T,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=FMe(m)|0,n[k>>2]=M,n[k+4>>2]=T,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,NMe(m,A)|0,A),I=d}function jM(){var o=0,l=0;if(s[7856]|0||(BX(10172),gr(50,10172,U|0)|0,l=7856,n[l>>2]=1,n[l+4>>2]=0),!(_r(10172)|0)){o=10172,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));BX(10172)}return 10172}function FMe(o){return o=o|0,0}function NMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,T=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=jM()|0,M=q+24|0,o=yr(l,4)|0,n[T>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],wX(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(OMe(M,k,T),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function wX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function OMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,T=o+4|0,d=(((n[T>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=LMe(o)|0,m>>>0<d>>>0)an(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,MMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[T>>2]|0)-L|0)/12|0,o+8|0),T=k+8|0,m=n[T>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],wX(m,A,u),n[T>>2]=(n[T>>2]|0)+12,UMe(o,k),_Me(k),I=M;return}}function LMe(o){return o=o|0,357913941}function MMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function UMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function _Me(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function BX(o){o=o|0,GMe(o)}function HMe(o){o=o|0,jMe(o+24|0)}function jMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function GMe(o){o=o|0;var l=0;l=tn()|0,rn(o,2,3,l,qMe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function qMe(){return 1380}function WMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=YMe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],VMe(l,m,u,A),I=d}function YMe(o){return o=o|0,(n[(jM()|0)+24>>2]|0)+(o*12|0)|0}function VMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),tp(m,u),m=rp(m,u)|0,JMe(B,A),B=KMe(B,A)|0,F2[d&15](o,m,B),I=k}function JMe(o,l){o=o|0,l=l|0}function KMe(o,l){return o=o|0,l=l|0,zMe(l)|0}function zMe(o){return o=o|0,(o|0)!=0|0}function XMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=GM()|0,o=ZMe(u)|0,vn(m,l,d,o,$Me(u,A)|0,A)}function GM(){var o=0,l=0;if(s[7864]|0||(SX(10208),gr(51,10208,U|0)|0,l=7864,n[l>>2]=1,n[l+4>>2]=0),!(_r(10208)|0)){o=10208,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));SX(10208)}return 10208}function ZMe(o){return o=o|0,o|0}function $Me(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=GM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(vX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(eUe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function vX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function eUe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=tUe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,rUe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,vX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,nUe(o,d),iUe(d),I=k;return}}function tUe(o){return o=o|0,536870911}function rUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function nUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function iUe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function SX(o){o=o|0,aUe(o)}function sUe(o){o=o|0,oUe(o+24|0)}function oUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function aUe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,24,l,lUe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function lUe(){return 1392}function cUe(o,l){o=o|0,l=l|0,fUe(n[(uUe(o)|0)>>2]|0,l)}function uUe(o){return o=o|0,(n[(GM()|0)+24>>2]|0)+(o<<3)|0}function fUe(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,hX(A,l),l=gX(A,l)|0,ip[o&127](l),I=u}function AUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=qM()|0,o=pUe(u)|0,vn(m,l,d,o,hUe(u,A)|0,A)}function qM(){var o=0,l=0;if(s[7872]|0||(bX(10244),gr(52,10244,U|0)|0,l=7872,n[l>>2]=1,n[l+4>>2]=0),!(_r(10244)|0)){o=10244,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));bX(10244)}return 10244}function pUe(o){return o=o|0,o|0}function hUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=qM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(DX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(gUe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function DX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function gUe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=dUe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,mUe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,DX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,yUe(o,d),EUe(d),I=k;return}}function dUe(o){return o=o|0,536870911}function mUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function yUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function EUe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function bX(o){o=o|0,wUe(o)}function IUe(o){o=o|0,CUe(o+24|0)}function CUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function wUe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,16,l,BUe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function BUe(){return 1400}function vUe(o){return o=o|0,DUe(n[(SUe(o)|0)>>2]|0)|0}function SUe(o){return o=o|0,(n[(qM()|0)+24>>2]|0)+(o<<3)|0}function DUe(o){return o=o|0,bUe(VP[o&7]()|0)|0}function bUe(o){return o=o|0,o|0}function PUe(){var o=0;return s[7880]|0||(NUe(10280),gr(25,10280,U|0)|0,o=7880,n[o>>2]=1,n[o+4>>2]=0),10280}function xUe(o,l){o=o|0,l=l|0,n[o>>2]=kUe()|0,n[o+4>>2]=QUe()|0,n[o+12>>2]=l,n[o+8>>2]=TUe()|0,n[o+32>>2]=4}function kUe(){return 11711}function QUe(){return 1356}function TUe(){return FP()|0}function RUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(FUe(u),It(u)):l|0&&(Kg(l),It(l))}function FUe(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function NUe(o){o=o|0,Lh(o)}function OUe(o){o=o|0,LUe(o,4920),MUe(o)|0,UUe(o)|0}function LUe(o,l){o=o|0,l=l|0;var u=0;u=Kz()|0,n[o>>2]=u,o_e(u,l),jh(n[o>>2]|0)}function MUe(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,zUe()|0),o|0}function UUe(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,_Ue()|0),o|0}function _Ue(){var o=0;return s[7888]|0||(PX(10328),gr(53,10328,U|0)|0,o=7888,n[o>>2]=1,n[o+4>>2]=0),_r(10328)|0||PX(10328),10328}function cd(o,l){o=o|0,l=l|0,vn(o,0,l,0,0,0)}function PX(o){o=o|0,GUe(o),ud(o,10)}function HUe(o){o=o|0,jUe(o+24|0)}function jUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function GUe(o){o=o|0;var l=0;l=tn()|0,rn(o,5,1,l,VUe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function qUe(o,l,u){o=o|0,l=l|0,u=+u,WUe(o,l,u)}function ud(o,l){o=o|0,l=l|0,n[o+20>>2]=l}function WUe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,m=A+8|0,k=A+13|0,d=A,B=A+12|0,tp(k,l),n[m>>2]=rp(k,l)|0,Qf(B,u),E[d>>3]=+Tf(B,u),YUe(o,m,d),I=A}function YUe(o,l,u){o=o|0,l=l|0,u=u|0,Tl(o+8|0,n[l>>2]|0,+E[u>>3]),s[o+24>>0]=1}function VUe(){return 1404}function JUe(o,l){return o=o|0,l=+l,KUe(o,l)|0}function KUe(o,l){o=o|0,l=+l;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return A=I,I=I+16|0,m=A+4|0,B=A+8|0,k=A,d=Rl(8)|0,u=d,T=Kt(16)|0,tp(m,o),o=rp(m,o)|0,Qf(B,l),Tl(T,o,+Tf(B,l)),B=u+4|0,n[B>>2]=T,o=Kt(8)|0,B=n[B>>2]|0,n[k>>2]=0,n[m>>2]=n[k>>2],xM(o,B,m),n[d>>2]=o,I=A,u|0}function zUe(){var o=0;return s[7896]|0||(xX(10364),gr(54,10364,U|0)|0,o=7896,n[o>>2]=1,n[o+4>>2]=0),_r(10364)|0||xX(10364),10364}function xX(o){o=o|0,$Ue(o),ud(o,55)}function XUe(o){o=o|0,ZUe(o+24|0)}function ZUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function $Ue(o){o=o|0;var l=0;l=tn()|0,rn(o,5,4,l,n_e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function e_e(o){o=o|0,t_e(o)}function t_e(o){o=o|0,r_e(o)}function r_e(o){o=o|0,kX(o+8|0),s[o+24>>0]=1}function kX(o){o=o|0,n[o>>2]=0,E[o+8>>3]=0}function n_e(){return 1424}function i_e(){return s_e()|0}function s_e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Rl(8)|0,o=u,A=Kt(16)|0,kX(A),m=o+4|0,n[m>>2]=A,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],xM(A,m,d),n[u>>2]=A,I=l,o|0}function o_e(o,l){o=o|0,l=l|0,n[o>>2]=a_e()|0,n[o+4>>2]=l_e()|0,n[o+12>>2]=l,n[o+8>>2]=c_e()|0,n[o+32>>2]=5}function a_e(){return 11710}function l_e(){return 1416}function c_e(){return NP()|0}function u_e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(f_e(u),It(u)):l|0&&It(l)}function f_e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function NP(){var o=0;return s[7904]|0||(n[2600]=A_e()|0,n[2601]=0,o=7904,n[o>>2]=1,n[o+4>>2]=0),10400}function A_e(){return n[357]|0}function p_e(o){o=o|0,h_e(o,4926),g_e(o)|0}function h_e(o,l){o=o|0,l=l|0;var u=0;u=yz()|0,n[o>>2]=u,D_e(u,l),jh(n[o>>2]|0)}function g_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,d_e()|0),o|0}function d_e(){var o=0;return s[7912]|0||(QX(10412),gr(56,10412,U|0)|0,o=7912,n[o>>2]=1,n[o+4>>2]=0),_r(10412)|0||QX(10412),10412}function QX(o){o=o|0,E_e(o),ud(o,57)}function m_e(o){o=o|0,y_e(o+24|0)}function y_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function E_e(o){o=o|0;var l=0;l=tn()|0,rn(o,5,5,l,B_e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function I_e(o){o=o|0,C_e(o)}function C_e(o){o=o|0,w_e(o)}function w_e(o){o=o|0;var l=0,u=0;l=o+8|0,u=l+48|0;do n[l>>2]=0,l=l+4|0;while((l|0)<(u|0));s[o+56>>0]=1}function B_e(){return 1432}function v_e(){return S_e()|0}function S_e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0,k=0;B=I,I=I+16|0,o=B+4|0,l=B,u=Rl(8)|0,A=u,d=Kt(48)|0,m=d,k=m+48|0;do n[m>>2]=0,m=m+4|0;while((m|0)<(k|0));return m=A+4|0,n[m>>2]=d,k=Kt(8)|0,m=n[m>>2]|0,n[l>>2]=0,n[o>>2]=n[l>>2],Ez(k,m,o),n[u>>2]=k,I=B,A|0}function D_e(o,l){o=o|0,l=l|0,n[o>>2]=b_e()|0,n[o+4>>2]=P_e()|0,n[o+12>>2]=l,n[o+8>>2]=x_e()|0,n[o+32>>2]=6}function b_e(){return 11704}function P_e(){return 1436}function x_e(){return NP()|0}function k_e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(Q_e(u),It(u)):l|0&&It(l)}function Q_e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function T_e(o){o=o|0,R_e(o,4933),F_e(o)|0,N_e(o)|0}function R_e(o,l){o=o|0,l=l|0;var u=0;u=s4e()|0,n[o>>2]=u,o4e(u,l),jh(n[o>>2]|0)}function F_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,K_e()|0),o|0}function N_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,O_e()|0),o|0}function O_e(){var o=0;return s[7920]|0||(TX(10452),gr(58,10452,U|0)|0,o=7920,n[o>>2]=1,n[o+4>>2]=0),_r(10452)|0||TX(10452),10452}function TX(o){o=o|0,U_e(o),ud(o,1)}function L_e(o){o=o|0,M_e(o+24|0)}function M_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function U_e(o){o=o|0;var l=0;l=tn()|0,rn(o,5,1,l,G_e()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function __e(o,l,u){o=o|0,l=+l,u=+u,H_e(o,l,u)}function H_e(o,l,u){o=o|0,l=+l,u=+u;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,m=A+8|0,k=A+17|0,d=A,B=A+16|0,Qf(k,l),E[m>>3]=+Tf(k,l),Qf(B,u),E[d>>3]=+Tf(B,u),j_e(o,m,d),I=A}function j_e(o,l,u){o=o|0,l=l|0,u=u|0,RX(o+8|0,+E[l>>3],+E[u>>3]),s[o+24>>0]=1}function RX(o,l,u){o=o|0,l=+l,u=+u,E[o>>3]=l,E[o+8>>3]=u}function G_e(){return 1472}function q_e(o,l){return o=+o,l=+l,W_e(o,l)|0}function W_e(o,l){o=+o,l=+l;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return A=I,I=I+16|0,B=A+4|0,k=A+8|0,T=A,d=Rl(8)|0,u=d,m=Kt(16)|0,Qf(B,o),o=+Tf(B,o),Qf(k,l),RX(m,o,+Tf(k,l)),k=u+4|0,n[k>>2]=m,m=Kt(8)|0,k=n[k>>2]|0,n[T>>2]=0,n[B>>2]=n[T>>2],FX(m,k,B),n[d>>2]=m,I=A,u|0}function FX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1452,n[u+12>>2]=l,n[o+4>>2]=u}function Y_e(o){o=o|0,$y(o),It(o)}function V_e(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function J_e(o){o=o|0,It(o)}function K_e(){var o=0;return s[7928]|0||(NX(10488),gr(59,10488,U|0)|0,o=7928,n[o>>2]=1,n[o+4>>2]=0),_r(10488)|0||NX(10488),10488}function NX(o){o=o|0,Z_e(o),ud(o,60)}function z_e(o){o=o|0,X_e(o+24|0)}function X_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function Z_e(o){o=o|0;var l=0;l=tn()|0,rn(o,5,6,l,r4e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function $_e(o){o=o|0,e4e(o)}function e4e(o){o=o|0,t4e(o)}function t4e(o){o=o|0,OX(o+8|0),s[o+24>>0]=1}function OX(o){o=o|0,n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,n[o+12>>2]=0}function r4e(){return 1492}function n4e(){return i4e()|0}function i4e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Rl(8)|0,o=u,A=Kt(16)|0,OX(A),m=o+4|0,n[m>>2]=A,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],FX(A,m,d),n[u>>2]=A,I=l,o|0}function s4e(){var o=0;return s[7936]|0||(A4e(10524),gr(25,10524,U|0)|0,o=7936,n[o>>2]=1,n[o+4>>2]=0),10524}function o4e(o,l){o=o|0,l=l|0,n[o>>2]=a4e()|0,n[o+4>>2]=l4e()|0,n[o+12>>2]=l,n[o+8>>2]=c4e()|0,n[o+32>>2]=7}function a4e(){return 11700}function l4e(){return 1484}function c4e(){return NP()|0}function u4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(f4e(u),It(u)):l|0&&It(l)}function f4e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function A4e(o){o=o|0,Lh(o)}function p4e(o,l,u){o=o|0,l=l|0,u=u|0,o=Bn(l)|0,l=h4e(u)|0,u=g4e(u,0)|0,W4e(o,l,u,WM()|0,0)}function h4e(o){return o=o|0,o|0}function g4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=WM()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(MX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(w4e(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function WM(){var o=0,l=0;if(s[7944]|0||(LX(10568),gr(61,10568,U|0)|0,l=7944,n[l>>2]=1,n[l+4>>2]=0),!(_r(10568)|0)){o=10568,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));LX(10568)}return 10568}function LX(o){o=o|0,y4e(o)}function d4e(o){o=o|0,m4e(o+24|0)}function m4e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function y4e(o){o=o|0;var l=0;l=tn()|0,rn(o,1,17,l,Oz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function E4e(o){return o=o|0,C4e(n[(I4e(o)|0)>>2]|0)|0}function I4e(o){return o=o|0,(n[(WM()|0)+24>>2]|0)+(o<<3)|0}function C4e(o){return o=o|0,RP(VP[o&7]()|0)|0}function MX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function w4e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=B4e(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,v4e(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,MX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,S4e(o,d),D4e(d),I=k;return}}function B4e(o){return o=o|0,536870911}function v4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function S4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function D4e(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function b4e(){P4e()}function P4e(){x4e(10604)}function x4e(o){o=o|0,k4e(o,4955)}function k4e(o,l){o=o|0,l=l|0;var u=0;u=Q4e()|0,n[o>>2]=u,T4e(u,l),jh(n[o>>2]|0)}function Q4e(){var o=0;return s[7952]|0||(H4e(10612),gr(25,10612,U|0)|0,o=7952,n[o>>2]=1,n[o+4>>2]=0),10612}function T4e(o,l){o=o|0,l=l|0,n[o>>2]=O4e()|0,n[o+4>>2]=L4e()|0,n[o+12>>2]=l,n[o+8>>2]=M4e()|0,n[o+32>>2]=8}function jh(o){o=o|0;var l=0,u=0;l=I,I=I+16|0,u=l,Jy()|0,n[u>>2]=o,R4e(10608,u),I=l}function Jy(){return s[11714]|0||(n[2652]=0,gr(62,10608,U|0)|0,s[11714]=1),10608}function R4e(o,l){o=o|0,l=l|0;var u=0;u=Kt(8)|0,n[u+4>>2]=n[l>>2],n[u>>2]=n[o>>2],n[o>>2]=u}function F4e(o){o=o|0,N4e(o)}function N4e(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function O4e(){return 11715}function L4e(){return 1496}function M4e(){return FP()|0}function U4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(_4e(u),It(u)):l|0&&It(l)}function _4e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function H4e(o){o=o|0,Lh(o)}function j4e(o,l){o=o|0,l=l|0;var u=0,A=0;Jy()|0,u=n[2652]|0;e:do if(u|0){for(;A=n[u+4>>2]|0,!(A|0&&!(EZ(YM(A)|0,o)|0));)if(u=n[u>>2]|0,!u)break e;G4e(A,l)}while(!1)}function YM(o){return o=o|0,n[o+12>>2]|0}function G4e(o,l){o=o|0,l=l|0;var u=0;o=o+36|0,u=n[o>>2]|0,u|0&&(Sf(u),It(u)),u=Kt(4)|0,DP(u,l),n[o>>2]=u}function VM(){return s[11716]|0||(n[2664]=0,gr(63,10656,U|0)|0,s[11716]=1),10656}function UX(){var o=0;return s[11717]|0?o=n[2665]|0:(q4e(),n[2665]=1504,s[11717]=1,o=1504),o|0}function q4e(){s[11740]|0||(s[11718]=yr(yr(8,0)|0,0)|0,s[11719]=yr(yr(0,0)|0,0)|0,s[11720]=yr(yr(0,16)|0,0)|0,s[11721]=yr(yr(8,0)|0,0)|0,s[11722]=yr(yr(0,0)|0,0)|0,s[11723]=yr(yr(8,0)|0,0)|0,s[11724]=yr(yr(0,0)|0,0)|0,s[11725]=yr(yr(8,0)|0,0)|0,s[11726]=yr(yr(0,0)|0,0)|0,s[11727]=yr(yr(8,0)|0,0)|0,s[11728]=yr(yr(0,0)|0,0)|0,s[11729]=yr(yr(0,0)|0,32)|0,s[11730]=yr(yr(0,0)|0,32)|0,s[11740]=1)}function _X(){return 1572}function W4e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,T=0,M=0,L=0;m=I,I=I+32|0,L=m+16|0,M=m+12|0,T=m+8|0,k=m+4|0,B=m,n[L>>2]=o,n[M>>2]=l,n[T>>2]=u,n[k>>2]=A,n[B>>2]=d,VM()|0,Y4e(10656,L,M,T,k,B),I=m}function Y4e(o,l,u,A,d,m){o=o|0,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>>>0<l>>>0&&(KX(u,l,(n[o+4>>2]|0)-A>>2,o+8|0),zX(o,u),XX(u)),I=d}function KM(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0;if(B=I,I=I+32|0,u=B,A=o+4|0,d=((n[A>>2]|0)-(n[o>>2]|0)>>2)+1|0,m=JX(o)|0,m>>>0<d>>>0)an(o);else{k=n[o>>2]|0,M=(n[o+8>>2]|0)-k|0,T=M>>1,KX(u,M>>2>>>0<m>>>1>>>0?T>>>0<d>>>0?d:T:m,(n[A>>2]|0)-k>>2,o+8|0),m=u+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,zX(o,u),XX(u),I=B;return}}function k2(o){return o=o|0,n[o+8>>2]|0}function J4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0;if(B=I,I=I+32|0,u=B,A=o+4|0,d=((n[A>>2]|0)-(n[o>>2]|0)>>2)+1|0,m=VX(o)|0,m>>>0<d>>>0)an(o);else{k=n[o>>2]|0,M=(n[o+8>>2]|0)-k|0,T=M>>1,h3e(u,M>>2>>>0<m>>>1>>>0?T>>>0<d>>>0?d:T:m,(n[A>>2]|0)-k>>2,o+8|0),m=u+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,g3e(o,u),d3e(u),I=B;return}}function OP(o){return o=o|0,n[o>>2]|0}function K4e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,z4e(o,l,u,A,d,m)}function zM(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-4-A|0)>>>2)<<2)),It(u))}function np(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-4-A|0)>>>2)<<2)),It(u))}function z4e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,T=0,M=0,L=0,q=0;B=I,I=I+48|0,L=B+40|0,k=B+32|0,q=B+24|0,T=B+12|0,M=B,Fl(k),o=Os(o)|0,n[q>>2]=n[l>>2],u=n[u>>2]|0,A=n[A>>2]|0,XM(T,d),X4e(M,m),n[L>>2]=n[q>>2],Z4e(o,L,u,A,T,M),zM(M),np(T),Nl(k),I=B}function XM(o,l){o=o|0,l=l|0;var u=0,A=0;n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,u=l+4|0,A=(n[u>>2]|0)-(n[l>>2]|0)>>2,A|0&&(A3e(o,A),p3e(o,n[l>>2]|0,n[u>>2]|0,A))}function X4e(o,l){o=o|0,l=l|0;var u=0,A=0;n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,u=l+4|0,A=(n[u>>2]|0)-(n[l>>2]|0)>>2,A|0&&(u3e(o,A),f3e(o,n[l>>2]|0,n[u>>2]|0,A))}function Z4e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,T=0,M=0,L=0,q=0;B=I,I=I+32|0,L=B+28|0,q=B+24|0,k=B+12|0,T=B,M=da($4e()|0)|0,n[q>>2]=n[l>>2],n[L>>2]=n[q>>2],l=fd(L)|0,u=jX(u)|0,A=ZM(A)|0,n[k>>2]=n[d>>2],L=d+4|0,n[k+4>>2]=n[L>>2],q=d+8|0,n[k+8>>2]=n[q>>2],n[q>>2]=0,n[L>>2]=0,n[d>>2]=0,d=$M(k)|0,n[T>>2]=n[m>>2],L=m+4|0,n[T+4>>2]=n[L>>2],q=m+8|0,n[T+8>>2]=n[q>>2],n[q>>2]=0,n[L>>2]=0,n[m>>2]=0,lu(0,M|0,o|0,l|0,u|0,A|0,d|0,e3e(T)|0)|0,zM(T),np(k),I=B}function $4e(){var o=0;return s[7968]|0||(l3e(10708),o=7968,n[o>>2]=1,n[o+4>>2]=0),10708}function fd(o){return o=o|0,qX(o)|0}function jX(o){return o=o|0,GX(o)|0}function ZM(o){return o=o|0,RP(o)|0}function $M(o){return o=o|0,r3e(o)|0}function e3e(o){return o=o|0,t3e(o)|0}function t3e(o){o=o|0;var l=0,u=0,A=0;if(A=(n[o+4>>2]|0)-(n[o>>2]|0)|0,u=A>>2,A=Rl(A+4|0)|0,n[A>>2]=u,u|0){l=0;do n[A+4+(l<<2)>>2]=GX(n[(n[o>>2]|0)+(l<<2)>>2]|0)|0,l=l+1|0;while((l|0)!=(u|0))}return A|0}function GX(o){return o=o|0,o|0}function r3e(o){o=o|0;var l=0,u=0,A=0;if(A=(n[o+4>>2]|0)-(n[o>>2]|0)|0,u=A>>2,A=Rl(A+4|0)|0,n[A>>2]=u,u|0){l=0;do n[A+4+(l<<2)>>2]=qX((n[o>>2]|0)+(l<<2)|0)|0,l=l+1|0;while((l|0)!=(u|0))}return A|0}function qX(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=fM(WX()|0)|0,A?(AM(l,A),pM(u,l),Mje(o,u),o=hM(l)|0):o=n3e(o)|0,I=d,o|0}function WX(){var o=0;return s[7960]|0||(a3e(10664),gr(25,10664,U|0)|0,o=7960,n[o>>2]=1,n[o+4>>2]=0),10664}function n3e(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Rl(8)|0,l=A,k=Kt(4)|0,n[k>>2]=n[o>>2],m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],YX(o,m,d),n[A>>2]=o,I=u,l|0}function YX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1656,n[u+12>>2]=l,n[o+4>>2]=u}function i3e(o){o=o|0,$y(o),It(o)}function s3e(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function o3e(o){o=o|0,It(o)}function a3e(o){o=o|0,Lh(o)}function l3e(o){o=o|0,Qo(o,c3e()|0,5)}function c3e(){return 1676}function u3e(o,l){o=o|0,l=l|0;var u=0;if((VX(o)|0)>>>0<l>>>0&&an(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function f3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function VX(o){return o=o|0,1073741823}function A3e(o,l){o=o|0,l=l|0;var u=0;if((JX(o)|0)>>>0<l>>>0&&an(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function p3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function JX(o){return o=o|0,1073741823}function h3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>1073741823)Nt();else{d=Kt(l<<2)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<2)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<2)}function g3e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>2)<<2)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|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|0,M=Qe+16|0,ae=Qe+4|0,Ye=Qe,Le=Qe+8|0,k=UX()|0,m=n[k>>2]|0,B=n[m>>2]|0,B|0)for(T=n[k+8>>2]|0,k=n[k+4>>2]|0;bu(L,B),y3e(o,L,k,T),m=m+4|0,B=n[m>>2]|0,B;)T=T+1|0,k=k+1|0;if(m=_X()|0,B=n[m>>2]|0,B|0)do bu(L,B),n[q>>2]=n[m+4>>2],E3e(l,L,q),m=m+8|0,B=n[m>>2]|0;while(B|0);if(m=n[(Jy()|0)>>2]|0,m|0)do l=n[m+4>>2]|0,bu(L,n[(Ky(l)|0)>>2]|0),n[q>>2]=YM(l)|0,I3e(u,L,q),m=n[m>>2]|0;while(m|0);if(bu(M,0),m=VM()|0,n[L>>2]=n[M>>2],HX(L,m,d),m=n[(Jy()|0)>>2]|0,m|0){o=L+4|0,l=L+8|0,u=L+8|0;do{if(T=n[m+4>>2]|0,bu(q,n[(Ky(T)|0)>>2]|0),C3e(ae,ZX(T)|0),B=n[ae>>2]|0,B|0){n[L>>2]=0,n[o>>2]=0,n[l>>2]=0;do bu(Ye,n[(Ky(n[B+4>>2]|0)|0)>>2]|0),k=n[o>>2]|0,k>>>0<(n[u>>2]|0)>>>0?(n[k>>2]=n[Ye>>2],n[o>>2]=(n[o>>2]|0)+4):KM(L,Ye),B=n[B>>2]|0;while(B|0);w3e(A,q,L),np(L)}n[Le>>2]=n[q>>2],M=$X(T)|0,n[L>>2]=n[Le>>2],HX(L,M,d),Cz(ae),m=n[m>>2]|0}while(m|0)}I=Qe}function y3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,F3e(o,l,u,A)}function E3e(o,l,u){o=o|0,l=l|0,u=u|0,R3e(o,l,u)}function Ky(o){return o=o|0,o|0}function I3e(o,l,u){o=o|0,l=l|0,u=u|0,x3e(o,l,u)}function ZX(o){return o=o|0,o+16|0}function C3e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;if(m=I,I=I+16|0,d=m+8|0,u=m,n[o>>2]=0,A=n[l>>2]|0,n[d>>2]=A,n[u>>2]=o,u=P3e(u)|0,A|0){if(A=Kt(12)|0,B=(eZ(d)|0)+4|0,o=n[B+4>>2]|0,l=A+4|0,n[l>>2]=n[B>>2],n[l+4>>2]=o,l=n[n[d>>2]>>2]|0,n[d>>2]=l,!l)o=A;else for(l=A;o=Kt(12)|0,T=(eZ(d)|0)+4|0,k=n[T+4>>2]|0,B=o+4|0,n[B>>2]=n[T>>2],n[B+4>>2]=k,n[l>>2]=o,B=n[n[d>>2]>>2]|0,n[d>>2]=B,B;)l=o;n[o>>2]=n[u>>2],n[u>>2]=A}I=m}function w3e(o,l,u){o=o|0,l=l|0,u=u|0,B3e(o,l,u)}function $X(o){return o=o|0,o+24|0}function B3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,B=A+24|0,d=A+16|0,k=A+12|0,m=A,Fl(d),o=Os(o)|0,n[k>>2]=n[l>>2],XM(m,u),n[B>>2]=n[k>>2],v3e(o,B,m),np(m),Nl(d),I=A}function v3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,B=A+16|0,k=A+12|0,d=A,m=da(S3e()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=fd(B)|0,n[d>>2]=n[u>>2],B=u+4|0,n[d+4>>2]=n[B>>2],k=u+8|0,n[d+8>>2]=n[k>>2],n[k>>2]=0,n[B>>2]=0,n[u>>2]=0,Ts(0,m|0,o|0,l|0,$M(d)|0)|0,np(d),I=A}function S3e(){var o=0;return s[7976]|0||(D3e(10720),o=7976,n[o>>2]=1,n[o+4>>2]=0),10720}function D3e(o){o=o|0,Qo(o,b3e()|0,2)}function b3e(){return 1732}function P3e(o){return o=o|0,n[o>>2]|0}function eZ(o){return o=o|0,n[o>>2]|0}function x3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+32|0,m=A+16|0,d=A+8|0,B=A,Fl(d),o=Os(o)|0,n[B>>2]=n[l>>2],u=n[u>>2]|0,n[m>>2]=n[B>>2],tZ(o,m,u),Nl(d),I=A}function tZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,m=A+4|0,B=A,d=da(k3e()|0)|0,n[B>>2]=n[l>>2],n[m>>2]=n[B>>2],l=fd(m)|0,Ts(0,d|0,o|0,l|0,jX(u)|0)|0,I=A}function k3e(){var o=0;return s[7984]|0||(Q3e(10732),o=7984,n[o>>2]=1,n[o+4>>2]=0),10732}function Q3e(o){o=o|0,Qo(o,T3e()|0,2)}function T3e(){return 1744}function R3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+32|0,m=A+16|0,d=A+8|0,B=A,Fl(d),o=Os(o)|0,n[B>>2]=n[l>>2],u=n[u>>2]|0,n[m>>2]=n[B>>2],tZ(o,m,u),Nl(d),I=A}function F3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+32|0,B=d+16|0,m=d+8|0,k=d,Fl(m),o=Os(o)|0,n[k>>2]=n[l>>2],u=s[u>>0]|0,A=s[A>>0]|0,n[B>>2]=n[k>>2],N3e(o,B,u,A),Nl(m),I=d}function N3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,B=d+4|0,k=d,m=da(O3e()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=fd(B)|0,u=zy(u)|0,Li(0,m|0,o|0,l|0,u|0,zy(A)|0)|0,I=d}function O3e(){var o=0;return s[7992]|0||(M3e(10744),o=7992,n[o>>2]=1,n[o+4>>2]=0),10744}function zy(o){return o=o|0,L3e(o)|0}function L3e(o){return o=o|0,o&255|0}function M3e(o){o=o|0,Qo(o,U3e()|0,3)}function U3e(){return 1756}function _3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;switch(ae=I,I=I+32|0,k=ae+8|0,T=ae+4|0,M=ae+20|0,L=ae,yM(o,0),A=Lje(l)|0,n[k>>2]=0,q=k+4|0,n[q>>2]=0,n[k+8>>2]=0,A<<24>>24){case 0:{s[M>>0]=0,H3e(T,u,M),LP(o,T)|0,Df(T);break}case 8:{q=sU(l)|0,s[M>>0]=8,bu(L,n[q+4>>2]|0),j3e(T,u,M,L,q+8|0),LP(o,T)|0,Df(T);break}case 9:{if(m=sU(l)|0,l=n[m+4>>2]|0,l|0)for(B=k+8|0,d=m+12|0;l=l+-1|0,bu(T,n[d>>2]|0),A=n[q>>2]|0,A>>>0<(n[B>>2]|0)>>>0?(n[A>>2]=n[T>>2],n[q>>2]=(n[q>>2]|0)+4):KM(k,T),l;)d=d+4|0;s[M>>0]=9,bu(L,n[m+8>>2]|0),G3e(T,u,M,L,k),LP(o,T)|0,Df(T);break}default:q=sU(l)|0,s[M>>0]=A,bu(L,n[q+4>>2]|0),q3e(T,u,M,L),LP(o,T)|0,Df(T)}np(k),I=ae}function H3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,Fl(d),l=Os(l)|0,n8e(o,l,s[u>>0]|0),Nl(d),I=A}function LP(o,l){o=o|0,l=l|0;var u=0;return u=n[o>>2]|0,u|0&&Na(u|0),n[o>>2]=n[l>>2],n[l>>2]=0,o|0}function j3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,T=0;m=I,I=I+32|0,k=m+16|0,B=m+8|0,T=m,Fl(B),l=Os(l)|0,u=s[u>>0]|0,n[T>>2]=n[A>>2],d=n[d>>2]|0,n[k>>2]=n[T>>2],$3e(o,l,u,k,d),Nl(B),I=m}function G3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,T=0,M=0;m=I,I=I+32|0,T=m+24|0,B=m+16|0,M=m+12|0,k=m,Fl(B),l=Os(l)|0,u=s[u>>0]|0,n[M>>2]=n[A>>2],XM(k,d),n[T>>2]=n[M>>2],K3e(o,l,u,T,k),np(k),Nl(B),I=m}function q3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+32|0,B=d+16|0,m=d+8|0,k=d,Fl(m),l=Os(l)|0,u=s[u>>0]|0,n[k>>2]=n[A>>2],n[B>>2]=n[k>>2],W3e(o,l,u,B),Nl(m),I=d}function W3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+4|0,k=d,B=da(Y3e()|0)|0,u=zy(u)|0,n[k>>2]=n[A>>2],n[m>>2]=n[k>>2],MP(o,Ts(0,B|0,l|0,u|0,fd(m)|0)|0),I=d}function Y3e(){var o=0;return s[8e3]|0||(V3e(10756),o=8e3,n[o>>2]=1,n[o+4>>2]=0),10756}function MP(o,l){o=o|0,l=l|0,yM(o,l)}function V3e(o){o=o|0,Qo(o,J3e()|0,2)}function J3e(){return 1772}function K3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,T=0,M=0;m=I,I=I+32|0,T=m+16|0,M=m+12|0,B=m,k=da(z3e()|0)|0,u=zy(u)|0,n[M>>2]=n[A>>2],n[T>>2]=n[M>>2],A=fd(T)|0,n[B>>2]=n[d>>2],T=d+4|0,n[B+4>>2]=n[T>>2],M=d+8|0,n[B+8>>2]=n[M>>2],n[M>>2]=0,n[T>>2]=0,n[d>>2]=0,MP(o,Li(0,k|0,l|0,u|0,A|0,$M(B)|0)|0),np(B),I=m}function z3e(){var o=0;return s[8008]|0||(X3e(10768),o=8008,n[o>>2]=1,n[o+4>>2]=0),10768}function X3e(o){o=o|0,Qo(o,Z3e()|0,3)}function Z3e(){return 1784}function $3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,T=0;m=I,I=I+16|0,k=m+4|0,T=m,B=da(e8e()|0)|0,u=zy(u)|0,n[T>>2]=n[A>>2],n[k>>2]=n[T>>2],A=fd(k)|0,MP(o,Li(0,B|0,l|0,u|0,A|0,ZM(d)|0)|0),I=m}function e8e(){var o=0;return s[8016]|0||(t8e(10780),o=8016,n[o>>2]=1,n[o+4>>2]=0),10780}function t8e(o){o=o|0,Qo(o,r8e()|0,3)}function r8e(){return 1800}function n8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=da(i8e()|0)|0,MP(o,dn(0,A|0,l|0,zy(u)|0)|0)}function i8e(){var o=0;return s[8024]|0||(s8e(10792),o=8024,n[o>>2]=1,n[o+4>>2]=0),10792}function s8e(o){o=o|0,Qo(o,o8e()|0,1)}function o8e(){return 1816}function a8e(){l8e(),c8e(),u8e()}function l8e(){n[2702]=xZ(65536)|0}function c8e(){k8e(10856)}function u8e(){f8e(10816)}function f8e(o){o=o|0,A8e(o,5044),p8e(o)|0}function A8e(o,l){o=o|0,l=l|0;var u=0;u=WX()|0,n[o>>2]=u,v8e(u,l),jh(n[o>>2]|0)}function p8e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,h8e()|0),o|0}function h8e(){var o=0;return s[8032]|0||(rZ(10820),gr(64,10820,U|0)|0,o=8032,n[o>>2]=1,n[o+4>>2]=0),_r(10820)|0||rZ(10820),10820}function rZ(o){o=o|0,m8e(o),ud(o,25)}function g8e(o){o=o|0,d8e(o+24|0)}function d8e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function m8e(o){o=o|0;var l=0;l=tn()|0,rn(o,5,18,l,C8e()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function y8e(o,l){o=o|0,l=l|0,E8e(o,l)}function E8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;u=I,I=I+16|0,A=u,d=u+4|0,ad(d,l),n[A>>2]=ld(d,l)|0,I8e(o,A),I=u}function I8e(o,l){o=o|0,l=l|0,nZ(o+4|0,n[l>>2]|0),s[o+8>>0]=1}function nZ(o,l){o=o|0,l=l|0,n[o>>2]=l}function C8e(){return 1824}function w8e(o){return o=o|0,B8e(o)|0}function B8e(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Rl(8)|0,l=A,k=Kt(4)|0,ad(d,o),nZ(k,ld(d,o)|0),m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],YX(o,m,d),n[A>>2]=o,I=u,l|0}function Rl(o){o=o|0;var l=0,u=0;return o=o+7&-8,o>>>0<=32768&&(l=n[2701]|0,o>>>0<=(65536-l|0)>>>0)?(u=(n[2702]|0)+l|0,n[2701]=l+o,o=u):(o=xZ(o+8|0)|0,n[o>>2]=n[2703],n[2703]=o,o=o+8|0),o|0}function v8e(o,l){o=o|0,l=l|0,n[o>>2]=S8e()|0,n[o+4>>2]=D8e()|0,n[o+12>>2]=l,n[o+8>>2]=b8e()|0,n[o+32>>2]=9}function S8e(){return 11744}function D8e(){return 1832}function b8e(){return NP()|0}function P8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(x8e(u),It(u)):l|0&&It(l)}function x8e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function k8e(o){o=o|0,Q8e(o,5052),T8e(o)|0,R8e(o,5058,26)|0,F8e(o,5069,1)|0,N8e(o,5077,10)|0,O8e(o,5087,19)|0,L8e(o,5094,27)|0}function Q8e(o,l){o=o|0,l=l|0;var u=0;u=xje()|0,n[o>>2]=u,kje(u,l),jh(n[o>>2]|0)}function T8e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,gje()|0),o|0}function R8e(o,l,u){return o=o|0,l=l|0,u=u|0,XHe(o,Bn(l)|0,u,0),o|0}function F8e(o,l,u){return o=o|0,l=l|0,u=u|0,OHe(o,Bn(l)|0,u,0),o|0}function N8e(o,l,u){return o=o|0,l=l|0,u=u|0,hHe(o,Bn(l)|0,u,0),o|0}function O8e(o,l,u){return o=o|0,l=l|0,u=u|0,$8e(o,Bn(l)|0,u,0),o|0}function iZ(o,l){o=o|0,l=l|0;var u=0,A=0;e:for(;;){for(u=n[2703]|0;;){if((u|0)==(l|0))break e;if(A=n[u>>2]|0,n[2703]=A,!u)u=A;else break}It(u)}n[2701]=o}function L8e(o,l,u){return o=o|0,l=l|0,u=u|0,M8e(o,Bn(l)|0,u,0),o|0}function M8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=eU()|0,o=U8e(u)|0,vn(m,l,d,o,_8e(u,A)|0,A)}function eU(){var o=0,l=0;if(s[8040]|0||(oZ(10860),gr(65,10860,U|0)|0,l=8040,n[l>>2]=1,n[l+4>>2]=0),!(_r(10860)|0)){o=10860,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));oZ(10860)}return 10860}function U8e(o){return o=o|0,o|0}function _8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=eU()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(sZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(H8e(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function sZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function H8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=j8e(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,G8e(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,sZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,q8e(o,d),W8e(d),I=k;return}}function j8e(o){return o=o|0,536870911}function G8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function q8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function W8e(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function oZ(o){o=o|0,J8e(o)}function Y8e(o){o=o|0,V8e(o+24|0)}function V8e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function J8e(o){o=o|0;var l=0;l=tn()|0,rn(o,1,11,l,K8e()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function K8e(){return 1840}function z8e(o,l,u){o=o|0,l=l|0,u=u|0,Z8e(n[(X8e(o)|0)>>2]|0,l,u)}function X8e(o){return o=o|0,(n[(eU()|0)+24>>2]|0)+(o<<3)|0}function Z8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;A=I,I=I+16|0,m=A+1|0,d=A,ad(m,l),l=ld(m,l)|0,ad(d,u),u=ld(d,u)|0,sp[o&31](l,u),I=A}function $8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=tU()|0,o=eHe(u)|0,vn(m,l,d,o,tHe(u,A)|0,A)}function tU(){var o=0,l=0;if(s[8048]|0||(lZ(10896),gr(66,10896,U|0)|0,l=8048,n[l>>2]=1,n[l+4>>2]=0),!(_r(10896)|0)){o=10896,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));lZ(10896)}return 10896}function eHe(o){return o=o|0,o|0}function tHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=tU()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(aZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(rHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function aZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function rHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=nHe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,iHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,aZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,sHe(o,d),oHe(d),I=k;return}}function nHe(o){return o=o|0,536870911}function iHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function sHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function oHe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function lZ(o){o=o|0,cHe(o)}function aHe(o){o=o|0,lHe(o+24|0)}function lHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function cHe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,11,l,uHe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function uHe(){return 1852}function fHe(o,l){return o=o|0,l=l|0,pHe(n[(AHe(o)|0)>>2]|0,l)|0}function AHe(o){return o=o|0,(n[(tU()|0)+24>>2]|0)+(o<<3)|0}function pHe(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,ad(A,l),l=ld(A,l)|0,l=RP(gd[o&31](l)|0)|0,I=u,l|0}function hHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=rU()|0,o=gHe(u)|0,vn(m,l,d,o,dHe(u,A)|0,A)}function rU(){var o=0,l=0;if(s[8056]|0||(uZ(10932),gr(67,10932,U|0)|0,l=8056,n[l>>2]=1,n[l+4>>2]=0),!(_r(10932)|0)){o=10932,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));uZ(10932)}return 10932}function gHe(o){return o=o|0,o|0}function dHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=rU()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(cZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(mHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function cZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function mHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=yHe(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,EHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,cZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,IHe(o,d),CHe(d),I=k;return}}function yHe(o){return o=o|0,536870911}function EHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function IHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function CHe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function uZ(o){o=o|0,vHe(o)}function wHe(o){o=o|0,BHe(o+24|0)}function BHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function vHe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,7,l,SHe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function SHe(){return 1860}function DHe(o,l,u){return o=o|0,l=l|0,u=u|0,PHe(n[(bHe(o)|0)>>2]|0,l,u)|0}function bHe(o){return o=o|0,(n[(rU()|0)+24>>2]|0)+(o<<3)|0}function PHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0;return A=I,I=I+32|0,B=A+12|0,m=A+8|0,k=A,T=A+16|0,d=A+4|0,xHe(T,l),kHe(k,T,l),Mh(d,u),u=Uh(d,u)|0,n[B>>2]=n[k>>2],F2[o&15](m,B,u),u=QHe(m)|0,Df(m),_h(d),I=A,u|0}function xHe(o,l){o=o|0,l=l|0}function kHe(o,l,u){o=o|0,l=l|0,u=u|0,THe(o,u)}function QHe(o){return o=o|0,Os(o)|0}function THe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;d=I,I=I+16|0,u=d,A=l,A&1?(RHe(u,0),Me(A|0,u|0)|0,FHe(o,u),NHe(u)):n[o>>2]=n[l>>2],I=d}function RHe(o,l){o=o|0,l=l|0,Su(o,l),n[o+4>>2]=0,s[o+8>>0]=0}function FHe(o,l){o=o|0,l=l|0,n[o>>2]=n[l+4>>2]}function NHe(o){o=o|0,s[o+8>>0]=0}function OHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=nU()|0,o=LHe(u)|0,vn(m,l,d,o,MHe(u,A)|0,A)}function nU(){var o=0,l=0;if(s[8064]|0||(AZ(10968),gr(68,10968,U|0)|0,l=8064,n[l>>2]=1,n[l+4>>2]=0),!(_r(10968)|0)){o=10968,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));AZ(10968)}return 10968}function LHe(o){return o=o|0,o|0}function MHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=nU()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(fZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(UHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function fZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function UHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=_He(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,HHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,fZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,jHe(o,d),GHe(d),I=k;return}}function _He(o){return o=o|0,536870911}function HHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function jHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function GHe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function AZ(o){o=o|0,YHe(o)}function qHe(o){o=o|0,WHe(o+24|0)}function WHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function YHe(o){o=o|0;var l=0;l=tn()|0,rn(o,1,1,l,VHe()|0,5),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function VHe(){return 1872}function JHe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,zHe(n[(KHe(o)|0)>>2]|0,l,u,A,d,m)}function KHe(o){return o=o|0,(n[(nU()|0)+24>>2]|0)+(o<<3)|0}function zHe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,T=0,M=0,L=0,q=0;B=I,I=I+32|0,k=B+16|0,T=B+12|0,M=B+8|0,L=B+4|0,q=B,Mh(k,l),l=Uh(k,l)|0,Mh(T,u),u=Uh(T,u)|0,Mh(M,A),A=Uh(M,A)|0,Mh(L,d),d=Uh(L,d)|0,Mh(q,m),m=Uh(q,m)|0,FZ[o&1](l,u,A,d,m),_h(q),_h(L),_h(M),_h(T),_h(k),I=B}function XHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=iU()|0,o=ZHe(u)|0,vn(m,l,d,o,$He(u,A)|0,A)}function iU(){var o=0,l=0;if(s[8072]|0||(hZ(11004),gr(69,11004,U|0)|0,l=8072,n[l>>2]=1,n[l+4>>2]=0),!(_r(11004)|0)){o=11004,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));hZ(11004)}return 11004}function ZHe(o){return o=o|0,o|0}function $He(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,T=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,T=iU()|0,B=T+24|0,l=yr(l,4)|0,n[m>>2]=l,u=T+28|0,A=n[u>>2]|0,A>>>0<(n[T+32>>2]|0)>>>0?(pZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(eje(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function pZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function eje(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=tje(o)|0,A>>>0<B>>>0)an(o);else{T=n[o>>2]|0,L=(n[o+8>>2]|0)-T|0,M=L>>2,rje(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-T>>3,o+8|0),B=d+8|0,pZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,nje(o,d),ije(d),I=k;return}}function tje(o){return o=o|0,536870911}function rje(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function nje(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function ije(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function hZ(o){o=o|0,aje(o)}function sje(o){o=o|0,oje(o+24|0)}function oje(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function aje(o){o=o|0;var l=0;l=tn()|0,rn(o,1,12,l,lje()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function lje(){return 1896}function cje(o,l,u){o=o|0,l=l|0,u=u|0,fje(n[(uje(o)|0)>>2]|0,l,u)}function uje(o){return o=o|0,(n[(iU()|0)+24>>2]|0)+(o<<3)|0}function fje(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;A=I,I=I+16|0,m=A+4|0,d=A,Aje(m,l),l=pje(m,l)|0,Mh(d,u),u=Uh(d,u)|0,sp[o&31](l,u),_h(d),I=A}function Aje(o,l){o=o|0,l=l|0}function pje(o,l){return o=o|0,l=l|0,hje(l)|0}function hje(o){return o=o|0,o|0}function gje(){var o=0;return s[8080]|0||(gZ(11040),gr(70,11040,U|0)|0,o=8080,n[o>>2]=1,n[o+4>>2]=0),_r(11040)|0||gZ(11040),11040}function gZ(o){o=o|0,yje(o),ud(o,71)}function dje(o){o=o|0,mje(o+24|0)}function mje(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function yje(o){o=o|0;var l=0;l=tn()|0,rn(o,5,7,l,wje()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Eje(o){o=o|0,Ije(o)}function Ije(o){o=o|0,Cje(o)}function Cje(o){o=o|0,s[o+8>>0]=1}function wje(){return 1936}function Bje(){return vje()|0}function vje(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Rl(8)|0,o=u,m=o+4|0,n[m>>2]=Kt(1)|0,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],Sje(A,m,d),n[u>>2]=A,I=l,o|0}function Sje(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1916,n[u+12>>2]=l,n[o+4>>2]=u}function Dje(o){o=o|0,$y(o),It(o)}function bje(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function Pje(o){o=o|0,It(o)}function xje(){var o=0;return s[8088]|0||(Oje(11076),gr(25,11076,U|0)|0,o=8088,n[o>>2]=1,n[o+4>>2]=0),11076}function kje(o,l){o=o|0,l=l|0,n[o>>2]=Qje()|0,n[o+4>>2]=Tje()|0,n[o+12>>2]=l,n[o+8>>2]=Rje()|0,n[o+32>>2]=10}function Qje(){return 11745}function Tje(){return 1940}function Rje(){return FP()|0}function Fje(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(Nje(u),It(u)):l|0&&It(l)}function Nje(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function Oje(o){o=o|0,Lh(o)}function bu(o,l){o=o|0,l=l|0,n[o>>2]=l}function sU(o){return o=o|0,n[o>>2]|0}function Lje(o){return o=o|0,s[n[o>>2]>>0]|0}function Mje(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,n[A>>2]=n[o>>2],Uje(l,A)|0,I=u}function Uje(o,l){o=o|0,l=l|0;var u=0;return u=_je(n[o>>2]|0,l)|0,l=o+4|0,n[(n[l>>2]|0)+8>>2]=u,n[(n[l>>2]|0)+8>>2]|0}function _je(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,Fl(A),o=Os(o)|0,l=Hje(o,n[l>>2]|0)|0,Nl(A),I=u,l|0}function Fl(o){o=o|0,n[o>>2]=n[2701],n[o+4>>2]=n[2703]}function Hje(o,l){o=o|0,l=l|0;var u=0;return u=da(jje()|0)|0,dn(0,u|0,o|0,ZM(l)|0)|0}function Nl(o){o=o|0,iZ(n[o>>2]|0,n[o+4>>2]|0)}function jje(){var o=0;return s[8096]|0||(Gje(11120),o=8096,n[o>>2]=1,n[o+4>>2]=0),11120}function Gje(o){o=o|0,Qo(o,qje()|0,1)}function qje(){return 1948}function Wje(){Yje()}function Yje(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0;if(Le=I,I=I+16|0,L=Le+4|0,q=Le,oa(65536,10804,n[2702]|0,10812),u=UX()|0,l=n[u>>2]|0,o=n[l>>2]|0,o|0)for(A=n[u+8>>2]|0,u=n[u+4>>2]|0;pf(o|0,c[u>>0]|0|0,s[A>>0]|0),l=l+4|0,o=n[l>>2]|0,o;)A=A+1|0,u=u+1|0;if(o=_X()|0,l=n[o>>2]|0,l|0)do NA(l|0,n[o+4>>2]|0),o=o+8|0,l=n[o>>2]|0;while(l|0);NA(Vje()|0,5167),M=Jy()|0,o=n[M>>2]|0;e:do if(o|0){do Jje(n[o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r(A)|0,Qe=OP(l)|0,uu(ae|0,B|0,k|0,T|0,M|0,L|0,q|0,Qe|0,oU(l)|0,aU(l)|0);break r}case 5:{M=k2(A)|0,L=P2(A)|0,q=(x2(A)|0)+1|0,Qe=UP(A)|0,uu(ae|0,M|0,L|0,q|0,Qe|0,e6e(A)|0,_r(A)|0,0,0,0);break r}default:break r}while(!1);u=n[u>>2]|0}while(u|0)}if(o=n[o>>2]|0,!o)break e}Nt()}while(!1);ve(),I=Le}function Vje(){return 11703}function Jje(o){o=o|0,s[o+40>>0]=0}function Kje(o){return o=o|0,(s[o+40>>0]|0)!=0|0}function zje(o,l){return o=o|0,l=l|0,l=t6e(l)|0,o=n[l>>2]|0,n[l>>2]=n[o>>2],It(o),n[l>>2]|0}function Xje(o){o=o|0,s[o+40>>0]=1}function dZ(o){return o=o|0,n[o+20>>2]|0}function Zje(o){return o=o|0,n[o+8>>2]|0}function $je(o){return o=o|0,n[o+32>>2]|0}function UP(o){return o=o|0,n[o+4>>2]|0}function mZ(o){return o=o|0,n[o+4>>2]|0}function oU(o){return o=o|0,n[o+8>>2]|0}function aU(o){return o=o|0,n[o+16>>2]|0}function e6e(o){return o=o|0,n[o+20>>2]|0}function t6e(o){return o=o|0,n[o>>2]|0}function _P(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Ze=0,ct=0,He=0,We=0,Lt=0;Lt=I,I=I+16|0,ae=Lt;do if(o>>>0<245){if(M=o>>>0<11?16:o+11&-8,o=M>>>3,q=n[2783]|0,u=q>>>o,u&3|0)return l=(u&1^1)+o|0,o=11172+(l<<1<<2)|0,u=o+8|0,A=n[u>>2]|0,d=A+8|0,m=n[d>>2]|0,(o|0)==(m|0)?n[2783]=q&~(1<<l):(n[m+12>>2]=o,n[u>>2]=m),We=l<<3,n[A+4>>2]=We|3,We=A+We+4|0,n[We>>2]=n[We>>2]|1,We=d,I=Lt,We|0;if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u>>2]|0,A)l=A,o=u;else break}n[o>>2]=0,u=l}else u=n[T+8>>2]|0,n[u+12>>2]=l,n[l+8>>2]=u,u=l;while(!1);do if(d|0){if(l=n[T+28>>2]|0,o=11436+(l<<2)|0,(T|0)==(n[o>>2]|0)){if(n[o>>2]=u,!u){n[2784]=k&~(1<<l);break}}else if(n[d+16+(((n[d+16>>2]|0)!=(T|0)&1)<<2)>>2]=u,!u)break;n[u+24>>2]=d,l=n[T+16>>2]|0,l|0&&(n[u+16>>2]=l,n[l+24>>2]=u),l=n[T+20>>2]|0,l|0&&(n[u+20>>2]=l,n[l+24>>2]=u)}while(!1);return m>>>0<16?(We=m+M|0,n[T+4>>2]=We|3,We=T+We+4|0,n[We>>2]=n[We>>2]|1):(n[T+4>>2]=M|3,n[B+4>>2]=m|1,n[B+m>>2]=m,L|0&&(A=n[2788]|0,l=L>>>3,u=11172+(l<<1<<2)|0,l=1<<l,q&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=q|l,l=u,o=u+8|0),n[o>>2]=A,n[l+12>>2]=A,n[A+8>>2]=l,n[A+12>>2]=u),n[2785]=m,n[2788]=B),We=T+8|0,I=Lt,We|0}else q=M}else q=M}else q=M}else if(o>>>0<=4294967231)if(o=o+11|0,M=o&-8,T=n[2784]|0,T){A=0-M|0,o=o>>>8,o?M>>>0>16777215?k=31:(q=(o+1048320|0)>>>16&8,He=o<<q,L=(He+520192|0)>>>16&4,He=He<<L,k=(He+245760|0)>>>16&2,k=14-(L|q|k)+(He<<k>>>15)|0,k=M>>>(k+7|0)&1|k<<1):k=0,u=n[11436+(k<<2)>>2]|0;e:do if(!u)u=0,o=0,He=57;else for(o=0,B=M<<((k|0)==31?0:25-(k>>>1)|0),m=0;;){if(d=(n[u+4>>2]&-8)-M|0,d>>>0<A>>>0)if(d)o=u,A=d;else{o=u,A=0,d=u,He=61;break e}if(d=n[u+20>>2]|0,u=n[u+16+(B>>>31<<2)>>2]|0,m=(d|0)==0|(d|0)==(u|0)?m:d,d=(u|0)==0,d){u=m,He=57;break}else B=B<<((d^1)&1)}while(!1);if((He|0)==57){if((u|0)==0&(o|0)==0){if(o=2<<k,o=T&(o|0-o),!o){q=M;break}q=(o&0-o)+-1|0,B=q>>>12&16,q=q>>>B,m=q>>>5&8,q=q>>>m,k=q>>>2&4,q=q>>>k,L=q>>>1&2,q=q>>>L,u=q>>>1&1,o=0,u=n[11436+((m|B|k|L|u)+(q>>>u)<<2)>>2]|0}u?(d=u,He=61):(k=o,B=A)}if((He|0)==61)for(;;)if(He=0,u=(n[d+4>>2]&-8)-M|0,q=u>>>0<A>>>0,u=q?u:A,o=q?d:o,d=n[d+16+(((n[d+16>>2]|0)==0&1)<<2)>>2]|0,d)A=u,He=61;else{k=o,B=u;break}if(k|0&&B>>>0<((n[2785]|0)-M|0)>>>0){if(m=k+M|0,k>>>0>=m>>>0)return We=0,I=Lt,We|0;d=n[k+24>>2]|0,l=n[k+12>>2]|0;do if((l|0)==(k|0)){if(o=k+20|0,l=n[o>>2]|0,!l&&(o=k+16|0,l=n[o>>2]|0,!l)){l=0;break}for(;;){if(u=l+20|0,A=n[u>>2]|0,A|0){l=A,o=u;continue}if(u=l+16|0,A=n[u>>2]|0,A)l=A,o=u;else break}n[o>>2]=0}else We=n[k+8>>2]|0,n[We+12>>2]=l,n[l+8>>2]=We;while(!1);do if(d){if(o=n[k+28>>2]|0,u=11436+(o<<2)|0,(k|0)==(n[u>>2]|0)){if(n[u>>2]=l,!l){A=T&~(1<<o),n[2784]=A;break}}else if(n[d+16+(((n[d+16>>2]|0)!=(k|0)&1)<<2)>>2]=l,!l){A=T;break}n[l+24>>2]=d,o=n[k+16>>2]|0,o|0&&(n[l+16>>2]=o,n[o+24>>2]=l),o=n[k+20>>2]|0,o&&(n[l+20>>2]=o,n[o+24>>2]=l),A=T}else A=T;while(!1);do if(B>>>0>=16){if(n[k+4>>2]=M|3,n[m+4>>2]=B|1,n[m+B>>2]=B,l=B>>>3,B>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=m,n[l+12>>2]=m,n[m+8>>2]=l,n[m+12>>2]=u;break}if(l=B>>>8,l?B>>>0>16777215?l=31:(He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,l=(We+245760|0)>>>16&2,l=14-(ct|He|l)+(We<<l>>>15)|0,l=B>>>(l+7|0)&1|l<<1):l=0,u=11436+(l<<2)|0,n[m+28>>2]=l,o=m+16|0,n[o+4>>2]=0,n[o>>2]=0,o=1<<l,!(A&o)){n[2784]=A|o,n[u>>2]=m,n[m+24>>2]=u,n[m+12>>2]=m,n[m+8>>2]=m;break}for(o=B<<((l|0)==31?0:25-(l>>>1)|0),u=n[u>>2]|0;;){if((n[u+4>>2]&-8|0)==(B|0)){He=97;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=96;break}}if((He|0)==96){n[A>>2]=m,n[m+24>>2]=u,n[m+12>>2]=m,n[m+8>>2]=m;break}else if((He|0)==97){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=m,n[He>>2]=m,n[m+8>>2]=We,n[m+12>>2]=u,n[m+24>>2]=0;break}}else We=B+M|0,n[k+4>>2]=We|3,We=k+We+4|0,n[We>>2]=n[We>>2]|1;while(!1);return We=k+8|0,I=Lt,We|0}else q=M}else q=M;else q=-1;while(!1);if(u=n[2785]|0,u>>>0>=q>>>0)return l=u-q|0,o=n[2788]|0,l>>>0>15?(We=o+q|0,n[2788]=We,n[2785]=l,n[We+4>>2]=l|1,n[We+l>>2]=l,n[o+4>>2]=q|3):(n[2785]=0,n[2788]=0,n[o+4>>2]=u|3,We=o+u+4|0,n[We>>2]=n[We>>2]|1),We=o+8|0,I=Lt,We|0;if(B=n[2786]|0,B>>>0>q>>>0)return ct=B-q|0,n[2786]=ct,We=n[2789]|0,He=We+q|0,n[2789]=He,n[He+4>>2]=ct|1,n[We+4>>2]=q|3,We=We+8|0,I=Lt,We|0;if(n[2901]|0?o=n[2903]|0:(n[2903]=4096,n[2902]=4096,n[2904]=-1,n[2905]=-1,n[2906]=0,n[2894]=0,o=ae&-16^1431655768,n[ae>>2]=o,n[2901]=o,o=4096),k=q+48|0,T=q+47|0,m=o+T|0,d=0-o|0,M=m&d,M>>>0<=q>>>0||(o=n[2893]|0,o|0&&(L=n[2891]|0,ae=L+M|0,ae>>>0<=L>>>0|ae>>>0>o>>>0)))return We=0,I=Lt,We|0;e:do if(n[2894]&4)l=0,He=133;else{u=n[2789]|0;t:do if(u){for(A=11580;o=n[A>>2]|0,!(o>>>0<=u>>>0&&(Qe=A+4|0,(o+(n[Qe>>2]|0)|0)>>>0>u>>>0));)if(o=n[A+8>>2]|0,o)A=o;else{He=118;break t}if(l=m-B&d,l>>>0<2147483647)if(o=qh(l|0)|0,(o|0)==((n[A>>2]|0)+(n[Qe>>2]|0)|0)){if((o|0)!=-1){B=l,m=o,He=135;break e}}else A=o,He=126;else l=0}else He=118;while(!1);do if((He|0)==118)if(u=qh(0)|0,(u|0)!=-1&&(l=u,Ye=n[2902]|0,Le=Ye+-1|0,l=(Le&l|0?(Le+l&0-Ye)-l|0:0)+M|0,Ye=n[2891]|0,Le=l+Ye|0,l>>>0>q>>>0&l>>>0<2147483647)){if(Qe=n[2893]|0,Qe|0&&Le>>>0<=Ye>>>0|Le>>>0>Qe>>>0){l=0;break}if(o=qh(l|0)|0,(o|0)==(u|0)){B=l,m=u,He=135;break e}else A=o,He=126}else l=0;while(!1);do if((He|0)==126){if(u=0-l|0,!(k>>>0>l>>>0&(l>>>0<2147483647&(A|0)!=-1)))if((A|0)==-1){l=0;break}else{B=l,m=A,He=135;break e}if(o=n[2903]|0,o=T-l+o&0-o,o>>>0>=2147483647){B=l,m=A,He=135;break e}if((qh(o|0)|0)==-1){qh(u|0)|0,l=0;break}else{B=o+l|0,m=A,He=135;break e}}while(!1);n[2894]=n[2894]|4,He=133}while(!1);if((He|0)==133&&M>>>0<2147483647&&(ct=qh(M|0)|0,Qe=qh(0)|0,tt=Qe-ct|0,Ze=tt>>>0>(q+40|0)>>>0,!((ct|0)==-1|Ze^1|ct>>>0<Qe>>>0&((ct|0)!=-1&(Qe|0)!=-1)^1))&&(B=Ze?tt:l,m=ct,He=135),(He|0)==135){l=(n[2891]|0)+B|0,n[2891]=l,l>>>0>(n[2892]|0)>>>0&&(n[2892]=l),T=n[2789]|0;do if(T){for(l=11580;;){if(o=n[l>>2]|0,u=l+4|0,A=n[u>>2]|0,(m|0)==(o+A|0)){He=145;break}if(d=n[l+8>>2]|0,d)l=d;else break}if((He|0)==145&&!(n[l+12>>2]&8|0)&&T>>>0<m>>>0&T>>>0>=o>>>0){n[u>>2]=A+B,We=T+8|0,We=We&7|0?0-We&7:0,He=T+We|0,We=(n[2786]|0)+(B-We)|0,n[2789]=He,n[2786]=We,n[He+4>>2]=We|1,n[He+We+4>>2]=40,n[2790]=n[2905];break}for(m>>>0<(n[2787]|0)>>>0&&(n[2787]=m),u=m+B|0,l=11580;;){if((n[l>>2]|0)==(u|0)){He=153;break}if(o=n[l+8>>2]|0,o)l=o;else break}if((He|0)==153&&!(n[l+12>>2]&8|0)){n[l>>2]=m,L=l+4|0,n[L>>2]=(n[L>>2]|0)+B,L=m+8|0,L=m+(L&7|0?0-L&7:0)|0,l=u+8|0,l=u+(l&7|0?0-l&7:0)|0,M=L+q|0,k=l-L-q|0,n[L+4>>2]=q|3;do if((l|0)!=(T|0)){if((l|0)==(n[2788]|0)){We=(n[2785]|0)+k|0,n[2785]=We,n[2788]=M,n[M+4>>2]=We|1,n[M+We>>2]=We;break}if(o=n[l+4>>2]|0,(o&3|0)==1){B=o&-8,A=o>>>3;e:do if(o>>>0<256)if(o=n[l+8>>2]|0,u=n[l+12>>2]|0,(u|0)==(o|0)){n[2783]=n[2783]&~(1<<A);break}else{n[o+12>>2]=u,n[u+8>>2]=o;break}else{m=n[l+24>>2]|0,o=n[l+12>>2]|0;do if((o|0)==(l|0)){if(A=l+16|0,u=A+4|0,o=n[u>>2]|0,!o)if(o=n[A>>2]|0,o)u=A;else{o=0;break}for(;;){if(A=o+20|0,d=n[A>>2]|0,d|0){o=d,u=A;continue}if(A=o+16|0,d=n[A>>2]|0,d)o=d,u=A;else break}n[u>>2]=0}else We=n[l+8>>2]|0,n[We+12>>2]=o,n[o+8>>2]=We;while(!1);if(!m)break;u=n[l+28>>2]|0,A=11436+(u<<2)|0;do if((l|0)!=(n[A>>2]|0)){if(n[m+16+(((n[m+16>>2]|0)!=(l|0)&1)<<2)>>2]=o,!o)break e}else{if(n[A>>2]=o,o|0)break;n[2784]=n[2784]&~(1<<u);break e}while(!1);if(n[o+24>>2]=m,u=l+16|0,A=n[u>>2]|0,A|0&&(n[o+16>>2]=A,n[A+24>>2]=o),u=n[u+4>>2]|0,!u)break;n[o+20>>2]=u,n[u+24>>2]=o}while(!1);l=l+B|0,d=B+k|0}else d=k;if(l=l+4|0,n[l>>2]=n[l>>2]&-2,n[M+4>>2]=d|1,n[M+d>>2]=d,l=d>>>3,d>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=M,n[l+12>>2]=M,n[M+8>>2]=l,n[M+12>>2]=u;break}l=d>>>8;do if(!l)l=0;else{if(d>>>0>16777215){l=31;break}He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,l=(We+245760|0)>>>16&2,l=14-(ct|He|l)+(We<<l>>>15)|0,l=d>>>(l+7|0)&1|l<<1}while(!1);if(A=11436+(l<<2)|0,n[M+28>>2]=l,o=M+16|0,n[o+4>>2]=0,n[o>>2]=0,o=n[2784]|0,u=1<<l,!(o&u)){n[2784]=o|u,n[A>>2]=M,n[M+24>>2]=A,n[M+12>>2]=M,n[M+8>>2]=M;break}for(o=d<<((l|0)==31?0:25-(l>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(d|0)){He=194;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=193;break}}if((He|0)==193){n[A>>2]=M,n[M+24>>2]=u,n[M+12>>2]=M,n[M+8>>2]=M;break}else if((He|0)==194){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=M,n[He>>2]=M,n[M+8>>2]=We,n[M+12>>2]=u,n[M+24>>2]=0;break}}else We=(n[2786]|0)+k|0,n[2786]=We,n[2789]=M,n[M+4>>2]=We|1;while(!1);return We=L+8|0,I=Lt,We|0}for(l=11580;o=n[l>>2]|0,!(o>>>0<=T>>>0&&(We=o+(n[l+4>>2]|0)|0,We>>>0>T>>>0));)l=n[l+8>>2]|0;d=We+-47|0,o=d+8|0,o=d+(o&7|0?0-o&7:0)|0,d=T+16|0,o=o>>>0<d>>>0?T:o,l=o+8|0,u=m+8|0,u=u&7|0?0-u&7:0,He=m+u|0,u=B+-40-u|0,n[2789]=He,n[2786]=u,n[He+4>>2]=u|1,n[He+u+4>>2]=40,n[2790]=n[2905],u=o+4|0,n[u>>2]=27,n[l>>2]=n[2895],n[l+4>>2]=n[2896],n[l+8>>2]=n[2897],n[l+12>>2]=n[2898],n[2895]=m,n[2896]=B,n[2898]=0,n[2897]=l,l=o+24|0;do He=l,l=l+4|0,n[l>>2]=7;while((He+8|0)>>>0<We>>>0);if((o|0)!=(T|0)){if(m=o-T|0,n[u>>2]=n[u>>2]&-2,n[T+4>>2]=m|1,n[o>>2]=m,l=m>>>3,m>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=T,n[l+12>>2]=T,n[T+8>>2]=l,n[T+12>>2]=u;break}if(l=m>>>8,l?m>>>0>16777215?u=31:(He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,u=(We+245760|0)>>>16&2,u=14-(ct|He|u)+(We<<u>>>15)|0,u=m>>>(u+7|0)&1|u<<1):u=0,A=11436+(u<<2)|0,n[T+28>>2]=u,n[T+20>>2]=0,n[d>>2]=0,l=n[2784]|0,o=1<<u,!(l&o)){n[2784]=l|o,n[A>>2]=T,n[T+24>>2]=A,n[T+12>>2]=T,n[T+8>>2]=T;break}for(o=m<<((u|0)==31?0:25-(u>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(m|0)){He=216;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=215;break}}if((He|0)==215){n[A>>2]=T,n[T+24>>2]=u,n[T+12>>2]=T,n[T+8>>2]=T;break}else if((He|0)==216){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=T,n[He>>2]=T,n[T+8>>2]=We,n[T+12>>2]=u,n[T+24>>2]=0;break}}}else{We=n[2787]|0,(We|0)==0|m>>>0<We>>>0&&(n[2787]=m),n[2895]=m,n[2896]=B,n[2898]=0,n[2792]=n[2901],n[2791]=-1,l=0;do We=11172+(l<<1<<2)|0,n[We+12>>2]=We,n[We+8>>2]=We,l=l+1|0;while((l|0)!=32);We=m+8|0,We=We&7|0?0-We&7:0,He=m+We|0,We=B+-40-We|0,n[2789]=He,n[2786]=We,n[He+4>>2]=We|1,n[He+We+4>>2]=40,n[2790]=n[2905]}while(!1);if(l=n[2786]|0,l>>>0>q>>>0)return ct=l-q|0,n[2786]=ct,We=n[2789]|0,He=We+q|0,n[2789]=He,n[He+4>>2]=ct|1,n[We+4>>2]=q|3,We=We+8|0,I=Lt,We|0}return n[(Xy()|0)>>2]=12,We=0,I=Lt,We|0}function HP(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,T=0;if(o){u=o+-8|0,d=n[2787]|0,o=n[o+-4>>2]|0,l=o&-8,T=u+l|0;do if(o&1)k=u,B=u;else{if(A=n[u>>2]|0,!(o&3)||(B=u+(0-A)|0,m=A+l|0,B>>>0<d>>>0))return;if((B|0)==(n[2788]|0)){if(o=T+4|0,l=n[o>>2]|0,(l&3|0)!=3){k=B,l=m;break}n[2785]=m,n[o>>2]=l&-2,n[B+4>>2]=m|1,n[B+m>>2]=m;return}if(u=A>>>3,A>>>0<256)if(o=n[B+8>>2]|0,l=n[B+12>>2]|0,(l|0)==(o|0)){n[2783]=n[2783]&~(1<<u),k=B,l=m;break}else{n[o+12>>2]=l,n[l+8>>2]=o,k=B,l=m;break}d=n[B+24>>2]|0,o=n[B+12>>2]|0;do if((o|0)==(B|0)){if(u=B+16|0,l=u+4|0,o=n[l>>2]|0,!o)if(o=n[u>>2]|0,o)l=u;else{o=0;break}for(;;){if(u=o+20|0,A=n[u>>2]|0,A|0){o=A,l=u;continue}if(u=o+16|0,A=n[u>>2]|0,A)o=A,l=u;else break}n[l>>2]=0}else k=n[B+8>>2]|0,n[k+12>>2]=o,n[o+8>>2]=k;while(!1);if(d){if(l=n[B+28>>2]|0,u=11436+(l<<2)|0,(B|0)==(n[u>>2]|0)){if(n[u>>2]=o,!o){n[2784]=n[2784]&~(1<<l),k=B,l=m;break}}else if(n[d+16+(((n[d+16>>2]|0)!=(B|0)&1)<<2)>>2]=o,!o){k=B,l=m;break}n[o+24>>2]=d,l=B+16|0,u=n[l>>2]|0,u|0&&(n[o+16>>2]=u,n[u+24>>2]=o),l=n[l+4>>2]|0,l?(n[o+20>>2]=l,n[l+24>>2]=o,k=B,l=m):(k=B,l=m)}else k=B,l=m}while(!1);if(!(B>>>0>=T>>>0)&&(o=T+4|0,A=n[o>>2]|0,!!(A&1))){if(A&2)n[o>>2]=A&-2,n[k+4>>2]=l|1,n[B+l>>2]=l,d=l;else{if(o=n[2788]|0,(T|0)==(n[2789]|0)){if(T=(n[2786]|0)+l|0,n[2786]=T,n[2789]=k,n[k+4>>2]=T|1,(k|0)!=(o|0))return;n[2788]=0,n[2785]=0;return}if((T|0)==(o|0)){T=(n[2785]|0)+l|0,n[2785]=T,n[2788]=B,n[k+4>>2]=T|1,n[B+T>>2]=T;return}d=(A&-8)+l|0,u=A>>>3;do if(A>>>0<256)if(l=n[T+8>>2]|0,o=n[T+12>>2]|0,(o|0)==(l|0)){n[2783]=n[2783]&~(1<<u);break}else{n[l+12>>2]=o,n[o+8>>2]=l;break}else{m=n[T+24>>2]|0,o=n[T+12>>2]|0;do if((o|0)==(T|0)){if(u=T+16|0,l=u+4|0,o=n[l>>2]|0,!o)if(o=n[u>>2]|0,o)l=u;else{u=0;break}for(;;){if(u=o+20|0,A=n[u>>2]|0,A|0){o=A,l=u;continue}if(u=o+16|0,A=n[u>>2]|0,A)o=A,l=u;else break}n[l>>2]=0,u=o}else u=n[T+8>>2]|0,n[u+12>>2]=o,n[o+8>>2]=u,u=o;while(!1);if(m|0){if(o=n[T+28>>2]|0,l=11436+(o<<2)|0,(T|0)==(n[l>>2]|0)){if(n[l>>2]=u,!u){n[2784]=n[2784]&~(1<<o);break}}else if(n[m+16+(((n[m+16>>2]|0)!=(T|0)&1)<<2)>>2]=u,!u)break;n[u+24>>2]=m,o=T+16|0,l=n[o>>2]|0,l|0&&(n[u+16>>2]=l,n[l+24>>2]=u),o=n[o+4>>2]|0,o|0&&(n[u+20>>2]=o,n[o+24>>2]=u)}}while(!1);if(n[k+4>>2]=d|1,n[B+d>>2]=d,(k|0)==(n[2788]|0)){n[2785]=d;return}}if(o=d>>>3,d>>>0<256){u=11172+(o<<1<<2)|0,l=n[2783]|0,o=1<<o,l&o?(l=u+8|0,o=n[l>>2]|0):(n[2783]=l|o,o=u,l=u+8|0),n[l>>2]=k,n[o+12>>2]=k,n[k+8>>2]=o,n[k+12>>2]=u;return}o=d>>>8,o?d>>>0>16777215?o=31:(B=(o+1048320|0)>>>16&8,T=o<<B,m=(T+520192|0)>>>16&4,T=T<<m,o=(T+245760|0)>>>16&2,o=14-(m|B|o)+(T<<o>>>15)|0,o=d>>>(o+7|0)&1|o<<1):o=0,A=11436+(o<<2)|0,n[k+28>>2]=o,n[k+20>>2]=0,n[k+16>>2]=0,l=n[2784]|0,u=1<<o;do if(l&u){for(l=d<<((o|0)==31?0:25-(o>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(d|0)){o=73;break}if(A=u+16+(l>>>31<<2)|0,o=n[A>>2]|0,o)l=l<<1,u=o;else{o=72;break}}if((o|0)==72){n[A>>2]=k,n[k+24>>2]=u,n[k+12>>2]=k,n[k+8>>2]=k;break}else if((o|0)==73){B=u+8|0,T=n[B>>2]|0,n[T+12>>2]=k,n[B>>2]=k,n[k+8>>2]=T,n[k+12>>2]=u,n[k+24>>2]=0;break}}else n[2784]=l|u,n[A>>2]=k,n[k+24>>2]=A,n[k+12>>2]=k,n[k+8>>2]=k;while(!1);if(T=(n[2791]|0)+-1|0,n[2791]=T,!T)o=11588;else return;for(;o=n[o>>2]|0,o;)o=o+8|0;n[2791]=-1}}}function r6e(){return 11628}function n6e(o){o=o|0;var l=0,u=0;return l=I,I=I+16|0,u=l,n[u>>2]=o6e(n[o+60>>2]|0)|0,o=jP(Au(6,u|0)|0)|0,I=l,o|0}function yZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0;q=I,I=I+48|0,M=q+16|0,m=q,d=q+32|0,k=o+28|0,A=n[k>>2]|0,n[d>>2]=A,T=o+20|0,A=(n[T>>2]|0)-A|0,n[d+4>>2]=A,n[d+8>>2]=l,n[d+12>>2]=u,A=A+u|0,B=o+60|0,n[m>>2]=n[B>>2],n[m+4>>2]=d,n[m+8>>2]=2,m=jP(La(146,m|0)|0)|0;e:do if((A|0)!=(m|0)){for(l=2;!((m|0)<0);)if(A=A-m|0,Ye=n[d+4>>2]|0,ae=m>>>0>Ye>>>0,d=ae?d+8|0:d,l=(ae<<31>>31)+l|0,Ye=m-(ae?Ye:0)|0,n[d>>2]=(n[d>>2]|0)+Ye,ae=d+4|0,n[ae>>2]=(n[ae>>2]|0)-Ye,n[M>>2]=n[B>>2],n[M+4>>2]=d,n[M+8>>2]=l,m=jP(La(146,M|0)|0)|0,(A|0)==(m|0)){L=3;break e}n[o+16>>2]=0,n[k>>2]=0,n[T>>2]=0,n[o>>2]=n[o>>2]|32,(l|0)==2?u=0:u=u-(n[d+4>>2]|0)|0}else L=3;while(!1);return(L|0)==3&&(Ye=n[o+44>>2]|0,n[o+16>>2]=Ye+(n[o+48>>2]|0),n[k>>2]=Ye,n[T>>2]=Ye),I=q,u|0}function i6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return d=I,I=I+32|0,m=d,A=d+20|0,n[m>>2]=n[o+60>>2],n[m+4>>2]=0,n[m+8>>2]=l,n[m+12>>2]=A,n[m+16>>2]=u,(jP(Oa(140,m|0)|0)|0)<0?(n[A>>2]=-1,o=-1):o=n[A>>2]|0,I=d,o|0}function jP(o){return o=o|0,o>>>0>4294963200&&(n[(Xy()|0)>>2]=0-o,o=-1),o|0}function Xy(){return(s6e()|0)+64|0}function s6e(){return lU()|0}function lU(){return 2084}function o6e(o){return o=o|0,o|0}function a6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;return d=I,I=I+32|0,A=d,n[o+36>>2]=1,!(n[o>>2]&64|0)&&(n[A>>2]=n[o+60>>2],n[A+4>>2]=21523,n[A+8>>2]=d+16,no(54,A|0)|0)&&(s[o+75>>0]=-1),A=yZ(o,l,u)|0,I=d,A|0}function EZ(o,l){o=o|0,l=l|0;var u=0,A=0;if(u=s[o>>0]|0,A=s[l>>0]|0,!(u<<24>>24)||u<<24>>24!=A<<24>>24)o=A;else{do o=o+1|0,l=l+1|0,u=s[o>>0]|0,A=s[l>>0]|0;while(!(!(u<<24>>24)||u<<24>>24!=A<<24>>24));o=A}return(u&255)-(o&255)|0}function l6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;e:do if(!u)o=0;else{for(;A=s[o>>0]|0,d=s[l>>0]|0,A<<24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-m|0)){n[(Xy()|0)>>2]=75,m=-1;break}else{m=B+m|0;break}while(!1);if(B=s[l>>0]|0,B<<24>>24)k=l;else{Ze=87;break}t:for(;;){switch(B<<24>>24){case 37:{B=k,Ze=9;break t}case 0:{B=k;break t}default:}tt=k+1|0,n[fr>>2]=tt,B=s[tt>>0]|0,k=tt}t:do if((Ze|0)==9)for(;;){if(Ze=0,(s[k+1>>0]|0)!=37)break t;if(B=B+1|0,k=k+2|0,n[fr>>2]=k,(s[k>>0]|0)==37)Ze=9;else break}while(!1);if(B=B-l|0,ct&&vs(o,l,B),B|0){l=k;continue}T=k+1|0,B=(s[T>>0]|0)+-48|0,B>>>0<10?(tt=(s[k+2>>0]|0)==36,Qe=tt?B:-1,L=tt?1:L,T=tt?k+3|0:T):Qe=-1,n[fr>>2]=T,B=s[T>>0]|0,k=(B<<24>>24)+-32|0;t:do if(k>>>0<32)for(M=0,q=B;;){if(B=1<<k,!(B&75913)){B=q;break t}if(M=B|M,T=T+1|0,n[fr>>2]=T,B=s[T>>0]|0,k=(B<<24>>24)+-32|0,k>>>0>=32)break;q=B}else M=0;while(!1);if(B<<24>>24==42){if(k=T+1|0,B=(s[k>>0]|0)+-48|0,B>>>0<10&&(s[T+2>>0]|0)==36)n[d+(B<<2)>>2]=10,B=n[A+((s[k>>0]|0)+-48<<3)>>2]|0,L=1,T=T+3|0;else{if(L|0){m=-1;break}ct?(L=(n[u>>2]|0)+3&-4,B=n[L>>2]|0,n[u>>2]=L+4,L=0,T=k):(B=0,L=0,T=k)}n[fr>>2]=T,tt=(B|0)<0,B=tt?0-B|0:B,M=tt?M|8192:M}else{if(B=CZ(fr)|0,(B|0)<0){m=-1;break}T=n[fr>>2]|0}do if((s[T>>0]|0)==46){if((s[T+1>>0]|0)!=42){n[fr>>2]=T+1,k=CZ(fr)|0,T=n[fr>>2]|0;break}if(q=T+2|0,k=(s[q>>0]|0)+-48|0,k>>>0<10&&(s[T+3>>0]|0)==36){n[d+(k<<2)>>2]=10,k=n[A+((s[q>>0]|0)+-48<<3)>>2]|0,T=T+4|0,n[fr>>2]=T;break}if(L|0){m=-1;break e}ct?(tt=(n[u>>2]|0)+3&-4,k=n[tt>>2]|0,n[u>>2]=tt+4):k=0,n[fr>>2]=q,T=q}else k=-1;while(!1);for(Le=0;;){if(((s[T>>0]|0)+-65|0)>>>0>57){m=-1;break e}if(tt=T+1|0,n[fr>>2]=tt,q=s[(s[T>>0]|0)+-65+(5178+(Le*58|0))>>0]|0,ae=q&255,(ae+-1|0)>>>0<8)Le=ae,T=tt;else break}if(!(q<<24>>24)){m=-1;break}Ye=(Qe|0)>-1;do if(q<<24>>24==19)if(Ye){m=-1;break e}else Ze=49;else{if(Ye){n[d+(Qe<<2)>>2]=ae,Ye=A+(Qe<<3)|0,Qe=n[Ye+4>>2]|0,Ze=$t,n[Ze>>2]=n[Ye>>2],n[Ze+4>>2]=Qe,Ze=49;break}if(!ct){m=0;break e}wZ($t,ae,u)}while(!1);if((Ze|0)==49&&(Ze=0,!ct)){B=0,l=tt;continue}T=s[T>>0]|0,T=(Le|0)!=0&(T&15|0)==3?T&-33:T,Ye=M&-65537,Qe=M&8192|0?Ye:M;t:do switch(T|0){case 110:switch((Le&255)<<24>>24){case 0:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 1:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 2:{B=n[$t>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=tt;continue e}case 3:{a[n[$t>>2]>>1]=m,B=0,l=tt;continue e}case 4:{s[n[$t>>2]>>0]=m,B=0,l=tt;continue e}case 6:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 7:{B=n[$t>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=tt;continue e}default:{B=0,l=tt;continue e}}case 112:{T=120,k=k>>>0>8?k:8,l=Qe|8,Ze=61;break}case 88:case 120:{l=Qe,Ze=61;break}case 111:{T=$t,l=n[T>>2]|0,T=n[T+4>>2]|0,ae=A6e(l,T,He)|0,Ye=We-ae|0,M=0,q=5642,k=(Qe&8|0)==0|(k|0)>(Ye|0)?k:Ye+1|0,Ye=Qe,Ze=67;break}case 105:case 100:if(T=$t,l=n[T>>2]|0,T=n[T+4>>2]|0,(T|0)<0){l=GP(0,0,l|0,T|0)|0,T=ye,M=$t,n[M>>2]=l,n[M+4>>2]=T,M=1,q=5642,Ze=66;break t}else{M=(Qe&2049|0)!=0&1,q=Qe&2048|0?5643:Qe&1|0?5644:5642,Ze=66;break t}case 117:{T=$t,M=0,q=5642,l=n[T>>2]|0,T=n[T+4>>2]|0,Ze=66;break}case 99:{s[Lt>>0]=n[$t>>2],l=Lt,M=0,q=5642,ae=He,T=1,k=Ye;break}case 109:{T=p6e(n[(Xy()|0)>>2]|0)|0,Ze=71;break}case 115:{T=n[$t>>2]|0,T=T|0?T:5652,Ze=71;break}case 67:{n[Tr>>2]=n[$t>>2],n[Gr>>2]=0,n[$t>>2]=Tr,ae=-1,T=Tr,Ze=75;break}case 83:{l=n[$t>>2]|0,k?(ae=k,T=l,Ze=75):(Ls(o,32,B,0,Qe),l=0,Ze=84);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{B=g6e(o,+E[$t>>3],B,k,Qe,T)|0,l=tt;continue e}default:M=0,q=5642,ae=He,T=k,k=Qe}while(!1);t:do if((Ze|0)==61)Qe=$t,Le=n[Qe>>2]|0,Qe=n[Qe+4>>2]|0,ae=f6e(Le,Qe,He,T&32)|0,q=(l&8|0)==0|(Le|0)==0&(Qe|0)==0,M=q?0:2,q=q?5642:5642+(T>>4)|0,Ye=l,l=Le,T=Qe,Ze=67;else if((Ze|0)==66)ae=Zy(l,T,He)|0,Ye=Qe,Ze=67;else if((Ze|0)==71)Ze=0,Qe=h6e(T,0,k)|0,Le=(Qe|0)==0,l=T,M=0,q=5642,ae=Le?T+k|0:Qe,T=Le?k:Qe-T|0,k=Ye;else if((Ze|0)==75){for(Ze=0,q=T,l=0,k=0;M=n[q>>2]|0,!(!M||(k=BZ(Hr,M)|0,(k|0)<0|k>>>0>(ae-l|0)>>>0));)if(l=k+l|0,ae>>>0>l>>>0)q=q+4|0;else break;if((k|0)<0){m=-1;break e}if(Ls(o,32,B,l,Qe),!l)l=0,Ze=84;else for(M=0;;){if(k=n[T>>2]|0,!k){Ze=84;break t}if(k=BZ(Hr,k)|0,M=k+M|0,(M|0)>(l|0)){Ze=84;break t}if(vs(o,Hr,k),M>>>0>=l>>>0){Ze=84;break}else T=T+4|0}}while(!1);if((Ze|0)==67)Ze=0,T=(l|0)!=0|(T|0)!=0,Qe=(k|0)!=0|T,T=((T^1)&1)+(We-ae)|0,l=Qe?ae:He,ae=He,T=Qe?(k|0)>(T|0)?k:T:k,k=(k|0)>-1?Ye&-65537:Ye;else if((Ze|0)==84){Ze=0,Ls(o,32,B,l,Qe^8192),B=(B|0)>(l|0)?B:l,l=tt;continue}Le=ae-l|0,Ye=(T|0)<(Le|0)?Le:T,Qe=Ye+M|0,B=(B|0)<(Qe|0)?Qe:B,Ls(o,32,B,Qe,k),vs(o,q,M),Ls(o,48,B,Qe,k^65536),Ls(o,48,Ye,Le,0),vs(o,l,Le),Ls(o,32,B,Qe,k^8192),l=tt}e:do if((Ze|0)==87&&!o)if(!L)m=0;else{for(m=1;l=n[d+(m<<2)>>2]|0,!!l;)if(wZ(A+(m<<3)|0,l,u),m=m+1|0,(m|0)>=10){m=1;break e}for(;;){if(n[d+(m<<2)>>2]|0){m=-1;break e}if(m=m+1|0,(m|0)>=10){m=1;break}}}while(!1);return I=cr,m|0}function c6e(o){return o=o|0,0}function u6e(o){o=o|0}function vs(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]&32||v6e(l,u,o)|0}function CZ(o){o=o|0;var l=0,u=0,A=0;if(u=n[o>>2]|0,A=(s[u>>0]|0)+-48|0,A>>>0<10){l=0;do l=A+(l*10|0)|0,u=u+1|0,n[o>>2]=u,A=(s[u>>0]|0)+-48|0;while(A>>>0<10)}else l=0;return l|0}function wZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;e:do if(l>>>0<=20)do switch(l|0){case 9:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,n[o>>2]=l;break e}case 10:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,A=o,n[A>>2]=l,n[A+4>>2]=((l|0)<0)<<31>>31;break e}case 11:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,A=o,n[A>>2]=l,n[A+4>>2]=0;break e}case 12:{A=(n[u>>2]|0)+7&-8,l=A,d=n[l>>2]|0,l=n[l+4>>2]|0,n[u>>2]=A+8,A=o,n[A>>2]=d,n[A+4>>2]=l;break e}case 13:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,A=(A&65535)<<16>>16,d=o,n[d>>2]=A,n[d+4>>2]=((A|0)<0)<<31>>31;break e}case 14:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,d=o,n[d>>2]=A&65535,n[d+4>>2]=0;break e}case 15:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,A=(A&255)<<24>>24,d=o,n[d>>2]=A,n[d+4>>2]=((A|0)<0)<<31>>31;break e}case 16:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,d=o,n[d>>2]=A&255,n[d+4>>2]=0;break e}case 17:{d=(n[u>>2]|0)+7&-8,m=+E[d>>3],n[u>>2]=d+8,E[o>>3]=m;break e}case 18:{d=(n[u>>2]|0)+7&-8,m=+E[d>>3],n[u>>2]=d+8,E[o>>3]=m;break e}default:break e}while(!1);while(!1)}function f6e(o,l,u,A){if(o=o|0,l=l|0,u=u|0,A=A|0,!((o|0)==0&(l|0)==0))do u=u+-1|0,s[u>>0]=c[5694+(o&15)>>0]|0|A,o=qP(o|0,l|0,4)|0,l=ye;while(!((o|0)==0&(l|0)==0));return u|0}function A6e(o,l,u){if(o=o|0,l=l|0,u=u|0,!((o|0)==0&(l|0)==0))do u=u+-1|0,s[u>>0]=o&7|48,o=qP(o|0,l|0,3)|0,l=ye;while(!((o|0)==0&(l|0)==0));return u|0}function Zy(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;if(l>>>0>0|(l|0)==0&o>>>0>4294967295){for(;A=pU(o|0,l|0,10,0)|0,u=u+-1|0,s[u>>0]=A&255|48,A=o,o=AU(o|0,l|0,10,0)|0,l>>>0>9|(l|0)==9&A>>>0>4294967295;)l=ye;l=o}else l=o;if(l)for(;u=u+-1|0,s[u>>0]=(l>>>0)%10|0|48,!(l>>>0<10);)l=(l>>>0)/10|0;return u|0}function p6e(o){return o=o|0,I6e(o,n[(E6e()|0)+188>>2]|0)|0}function h6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;m=l&255,A=(u|0)!=0;e:do if(A&(o&3|0)!=0)for(d=l&255;;){if((s[o>>0]|0)==d<<24>>24){B=6;break e}if(o=o+1|0,u=u+-1|0,A=(u|0)!=0,!(A&(o&3|0)!=0)){B=5;break}}else B=5;while(!1);(B|0)==5&&(A?B=6:u=0);e:do if((B|0)==6&&(d=l&255,(s[o>>0]|0)!=d<<24>>24)){A=Ue(m,16843009)|0;t:do if(u>>>0>3){for(;m=n[o>>2]^A,!((m&-2139062144^-2139062144)&m+-16843009|0);)if(o=o+4|0,u=u+-4|0,u>>>0<=3){B=11;break t}}else B=11;while(!1);if((B|0)==11&&!u){u=0;break}for(;;){if((s[o>>0]|0)==d<<24>>24)break e;if(o=o+1|0,u=u+-1|0,!u){u=0;break}}}while(!1);return(u|0?o:0)|0}function Ls(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0;if(B=I,I=I+256|0,m=B,(u|0)>(A|0)&(d&73728|0)==0){if(d=u-A|0,eE(m|0,l|0,(d>>>0<256?d:256)|0)|0,d>>>0>255){l=u-A|0;do vs(o,m,256),d=d+-256|0;while(d>>>0>255);d=l&255}vs(o,m,d)}I=B}function BZ(o,l){return o=o|0,l=l|0,o?o=m6e(o,l,0)|0:o=0,o|0}function g6e(o,l,u,A,d,m){o=o|0,l=+l,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,T=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Ze=0,ct=0,He=0,We=0,Lt=0,Gr=0,fr=0,$t=0,Tr=0,Hr=0,cr=0,Hn=0;Hn=I,I=I+560|0,T=Hn+8|0,tt=Hn,cr=Hn+524|0,Hr=cr,M=Hn+512|0,n[tt>>2]=0,Tr=M+12|0,vZ(l)|0,(ye|0)<0?(l=-l,fr=1,Gr=5659):(fr=(d&2049|0)!=0&1,Gr=d&2048|0?5662:d&1|0?5665:5660),vZ(l)|0,$t=ye&2146435072;do if($t>>>0<2146435072|($t|0)==2146435072&!1){if(Ye=+d6e(l,tt)*2,B=Ye!=0,B&&(n[tt>>2]=(n[tt>>2]|0)+-1),ct=m|32,(ct|0)==97){Le=m&32,ae=Le|0?Gr+9|0:Gr,q=fr|2,B=12-A|0;do if(A>>>0>11|(B|0)==0)l=Ye;else{l=8;do B=B+-1|0,l=l*16;while(B|0);if((s[ae>>0]|0)==45){l=-(l+(-Ye-l));break}else{l=Ye+l-l;break}}while(!1);k=n[tt>>2]|0,B=(k|0)<0?0-k|0:k,B=Zy(B,((B|0)<0)<<31>>31,Tr)|0,(B|0)==(Tr|0)&&(B=M+11|0,s[B>>0]=48),s[B+-1>>0]=(k>>31&2)+43,L=B+-2|0,s[L>>0]=m+15,M=(A|0)<1,T=(d&8|0)==0,B=cr;do $t=~~l,k=B+1|0,s[B>>0]=c[5694+$t>>0]|Le,l=(l-+($t|0))*16,(k-Hr|0)==1&&!(T&(M&l==0))?(s[k>>0]=46,B=B+2|0):B=k;while(l!=0);$t=B-Hr|0,Hr=Tr-L|0,Tr=(A|0)!=0&($t+-2|0)<(A|0)?A+2|0:$t,B=Hr+q+Tr|0,Ls(o,32,u,B,d),vs(o,ae,q),Ls(o,48,u,B,d^65536),vs(o,cr,$t),Ls(o,48,Tr-$t|0,0,0),vs(o,L,Hr),Ls(o,32,u,B,d^8192);break}k=(A|0)<0?6:A,B?(B=(n[tt>>2]|0)+-28|0,n[tt>>2]=B,l=Ye*268435456):(l=Ye,B=n[tt>>2]|0),$t=(B|0)<0?T:T+288|0,T=$t;do We=~~l>>>0,n[T>>2]=We,T=T+4|0,l=(l-+(We>>>0))*1e9;while(l!=0);if((B|0)>0)for(M=$t,q=T;;){if(L=(B|0)<29?B:29,B=q+-4|0,B>>>0>=M>>>0){T=0;do He=kZ(n[B>>2]|0,0,L|0)|0,He=fU(He|0,ye|0,T|0,0)|0,We=ye,Ze=pU(He|0,We|0,1e9,0)|0,n[B>>2]=Ze,T=AU(He|0,We|0,1e9,0)|0,B=B+-4|0;while(B>>>0>=M>>>0);T&&(M=M+-4|0,n[M>>2]=T)}for(T=q;!(T>>>0<=M>>>0);)if(B=T+-4|0,!(n[B>>2]|0))T=B;else break;if(B=(n[tt>>2]|0)-L|0,n[tt>>2]=B,(B|0)>0)q=T;else break}else M=$t;if((B|0)<0){A=((k+25|0)/9|0)+1|0,Qe=(ct|0)==102;do{if(Le=0-B|0,Le=(Le|0)<9?Le:9,M>>>0<T>>>0){L=(1<<Le)+-1|0,q=1e9>>>Le,ae=0,B=M;do We=n[B>>2]|0,n[B>>2]=(We>>>Le)+ae,ae=Ue(We&L,q)|0,B=B+4|0;while(B>>>0<T>>>0);B=n[M>>2]|0?M:M+4|0,ae?(n[T>>2]=ae,M=B,B=T+4|0):(M=B,B=T)}else M=n[M>>2]|0?M:M+4|0,B=T;T=Qe?$t:M,T=(B-T>>2|0)>(A|0)?T+(A<<2)|0:B,B=(n[tt>>2]|0)+Le|0,n[tt>>2]=B}while((B|0)<0);B=M,A=T}else B=M,A=T;if(We=$t,B>>>0<A>>>0){if(T=(We-B>>2)*9|0,L=n[B>>2]|0,L>>>0>=10){M=10;do M=M*10|0,T=T+1|0;while(L>>>0>=M>>>0)}}else T=0;if(Qe=(ct|0)==103,Ze=(k|0)!=0,M=k-((ct|0)!=102?T:0)+((Ze&Qe)<<31>>31)|0,(M|0)<(((A-We>>2)*9|0)+-9|0)){if(M=M+9216|0,Le=$t+4+(((M|0)/9|0)+-1024<<2)|0,M=((M|0)%9|0)+1|0,(M|0)<9){L=10;do L=L*10|0,M=M+1|0;while((M|0)!=9)}else L=10;if(q=n[Le>>2]|0,ae=(q>>>0)%(L>>>0)|0,M=(Le+4|0)==(A|0),M&(ae|0)==0)M=Le;else if(Ye=((q>>>0)/(L>>>0)|0)&1|0?9007199254740994:9007199254740992,He=(L|0)/2|0,l=ae>>>0<He>>>0?.5:M&(ae|0)==(He|0)?1:1.5,fr&&(He=(s[Gr>>0]|0)==45,l=He?-l:l,Ye=He?-Ye:Ye),M=q-ae|0,n[Le>>2]=M,Ye+l!=Ye){if(He=M+L|0,n[Le>>2]=He,He>>>0>999999999)for(T=Le;M=T+-4|0,n[T>>2]=0,M>>>0<B>>>0&&(B=B+-4|0,n[B>>2]=0),He=(n[M>>2]|0)+1|0,n[M>>2]=He,He>>>0>999999999;)T=M;else M=Le;if(T=(We-B>>2)*9|0,q=n[B>>2]|0,q>>>0>=10){L=10;do L=L*10|0,T=T+1|0;while(q>>>0>=L>>>0)}}else M=Le;M=M+4|0,M=A>>>0>M>>>0?M:A,He=B}else M=A,He=B;for(ct=M;;){if(ct>>>0<=He>>>0){tt=0;break}if(B=ct+-4|0,!(n[B>>2]|0))ct=B;else{tt=1;break}}A=0-T|0;do if(Qe)if(B=((Ze^1)&1)+k|0,(B|0)>(T|0)&(T|0)>-5?(L=m+-1|0,k=B+-1-T|0):(L=m+-2|0,k=B+-1|0),B=d&8,B)Le=B;else{if(tt&&(Lt=n[ct+-4>>2]|0,(Lt|0)!=0))if((Lt>>>0)%10|0)M=0;else{M=0,B=10;do B=B*10|0,M=M+1|0;while(!((Lt>>>0)%(B>>>0)|0|0))}else M=9;if(B=((ct-We>>2)*9|0)+-9|0,(L|32|0)==102){Le=B-M|0,Le=(Le|0)>0?Le:0,k=(k|0)<(Le|0)?k:Le,Le=0;break}else{Le=B+T-M|0,Le=(Le|0)>0?Le:0,k=(k|0)<(Le|0)?k:Le,Le=0;break}}else L=m,Le=d&8;while(!1);if(Qe=k|Le,q=(Qe|0)!=0&1,ae=(L|32|0)==102,ae)Ze=0,B=(T|0)>0?T:0;else{if(B=(T|0)<0?A:T,B=Zy(B,((B|0)<0)<<31>>31,Tr)|0,M=Tr,(M-B|0)<2)do B=B+-1|0,s[B>>0]=48;while((M-B|0)<2);s[B+-1>>0]=(T>>31&2)+43,B=B+-2|0,s[B>>0]=L,Ze=B,B=M-B|0}if(B=fr+1+k+q+B|0,Ls(o,32,u,B,d),vs(o,Gr,fr),Ls(o,48,u,B,d^65536),ae){L=He>>>0>$t>>>0?$t:He,Le=cr+9|0,q=Le,ae=cr+8|0,M=L;do{if(T=Zy(n[M>>2]|0,0,Le)|0,(M|0)==(L|0))(T|0)==(Le|0)&&(s[ae>>0]=48,T=ae);else if(T>>>0>cr>>>0){eE(cr|0,48,T-Hr|0)|0;do T=T+-1|0;while(T>>>0>cr>>>0)}vs(o,T,q-T|0),M=M+4|0}while(M>>>0<=$t>>>0);if(Qe|0&&vs(o,5710,1),M>>>0<ct>>>0&(k|0)>0)for(;;){if(T=Zy(n[M>>2]|0,0,Le)|0,T>>>0>cr>>>0){eE(cr|0,48,T-Hr|0)|0;do T=T+-1|0;while(T>>>0>cr>>>0)}if(vs(o,T,(k|0)<9?k:9),M=M+4|0,T=k+-9|0,M>>>0<ct>>>0&(k|0)>9)k=T;else{k=T;break}}Ls(o,48,k+9|0,9,0)}else{if(Qe=tt?ct:He+4|0,(k|0)>-1){tt=cr+9|0,Le=(Le|0)==0,A=tt,q=0-Hr|0,ae=cr+8|0,L=He;do{T=Zy(n[L>>2]|0,0,tt)|0,(T|0)==(tt|0)&&(s[ae>>0]=48,T=ae);do if((L|0)==(He|0)){if(M=T+1|0,vs(o,T,1),Le&(k|0)<1){T=M;break}vs(o,5710,1),T=M}else{if(T>>>0<=cr>>>0)break;eE(cr|0,48,T+q|0)|0;do T=T+-1|0;while(T>>>0>cr>>>0)}while(!1);Hr=A-T|0,vs(o,T,(k|0)>(Hr|0)?Hr:k),k=k-Hr|0,L=L+4|0}while(L>>>0<Qe>>>0&(k|0)>-1)}Ls(o,48,k+18|0,18,0),vs(o,Ze,Tr-Ze|0)}Ls(o,32,u,B,d^8192)}else cr=(m&32|0)!=0,B=fr+3|0,Ls(o,32,u,B,d&-65537),vs(o,Gr,fr),vs(o,l!=l|!1?cr?5686:5690:cr?5678:5682,3),Ls(o,32,u,B,d^8192);while(!1);return I=Hn,((B|0)<(u|0)?u:B)|0}function vZ(o){o=+o;var l=0;return E[S>>3]=o,l=n[S>>2]|0,ye=n[S+4>>2]|0,l|0}function d6e(o,l){return o=+o,l=l|0,+ +SZ(o,l)}function SZ(o,l){o=+o,l=l|0;var u=0,A=0,d=0;switch(E[S>>3]=o,u=n[S>>2]|0,A=n[S+4>>2]|0,d=qP(u|0,A|0,52)|0,d&2047){case 0:{o!=0?(o=+SZ(o*18446744073709552e3,l),u=(n[l>>2]|0)+-64|0):u=0,n[l>>2]=u;break}case 2047:break;default:n[l>>2]=(d&2047)+-1022,n[S>>2]=u,n[S+4>>2]=A&-2146435073|1071644672,o=+E[S>>3]}return+o}function m6e(o,l,u){o=o|0,l=l|0,u=u|0;do if(o){if(l>>>0<128){s[o>>0]=l,o=1;break}if(!(n[n[(y6e()|0)+188>>2]>>2]|0))if((l&-128|0)==57216){s[o>>0]=l,o=1;break}else{n[(Xy()|0)>>2]=84,o=-1;break}if(l>>>0<2048){s[o>>0]=l>>>6|192,s[o+1>>0]=l&63|128,o=2;break}if(l>>>0<55296|(l&-8192|0)==57344){s[o>>0]=l>>>12|224,s[o+1>>0]=l>>>6&63|128,s[o+2>>0]=l&63|128,o=3;break}if((l+-65536|0)>>>0<1048576){s[o>>0]=l>>>18|240,s[o+1>>0]=l>>>12&63|128,s[o+2>>0]=l>>>6&63|128,s[o+3>>0]=l&63|128,o=4;break}else{n[(Xy()|0)>>2]=84,o=-1;break}}else o=1;while(!1);return o|0}function y6e(){return lU()|0}function E6e(){return lU()|0}function I6e(o,l){o=o|0,l=l|0;var u=0,A=0;for(A=0;;){if((c[5712+A>>0]|0)==(o|0)){o=2;break}if(u=A+1|0,(u|0)==87){u=5800,A=87,o=5;break}else A=u}if((o|0)==2&&(A?(u=5800,o=5):u=5800),(o|0)==5)for(;;){do o=u,u=u+1|0;while(s[o>>0]|0);if(A=A+-1|0,A)o=5;else break}return C6e(u,n[l+20>>2]|0)|0}function C6e(o,l){return o=o|0,l=l|0,w6e(o,l)|0}function w6e(o,l){return o=o|0,l=l|0,l?l=B6e(n[l>>2]|0,n[l+4>>2]|0,o)|0:l=0,(l|0?l:o)|0}function B6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,T=0,M=0,L=0,q=0,ae=0;ae=(n[o>>2]|0)+1794895138|0,m=Ad(n[o+8>>2]|0,ae)|0,A=Ad(n[o+12>>2]|0,ae)|0,d=Ad(n[o+16>>2]|0,ae)|0;e:do if(m>>>0<l>>>2>>>0&&(q=l-(m<<2)|0,A>>>0<q>>>0&d>>>0<q>>>0)&&!((d|A)&3|0)){for(q=A>>>2,L=d>>>2,M=0;;){if(k=m>>>1,T=M+k|0,B=T<<1,d=B+q|0,A=Ad(n[o+(d<<2)>>2]|0,ae)|0,d=Ad(n[o+(d+1<<2)>>2]|0,ae)|0,!(d>>>0<l>>>0&A>>>0<(l-d|0)>>>0)){A=0;break e}if(s[o+(d+A)>>0]|0){A=0;break e}if(A=EZ(u,o+d|0)|0,!A)break;if(A=(A|0)<0,(m|0)==1){A=0;break e}else M=A?M:T,m=A?k:m-k|0}A=B+L|0,d=Ad(n[o+(A<<2)>>2]|0,ae)|0,A=Ad(n[o+(A+1<<2)>>2]|0,ae)|0,A>>>0<l>>>0&d>>>0<(l-A|0)>>>0?A=s[o+(A+d)>>0]|0?0:o+A|0:A=0}else A=0;while(!1);return A|0}function Ad(o,l){o=o|0,l=l|0;var u=0;return u=RZ(o|0)|0,(l|0?u:o)|0}function v6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=u+16|0,d=n[A>>2]|0,d?m=5:S6e(u)|0?A=0:(d=n[A>>2]|0,m=5);e:do if((m|0)==5){if(k=u+20|0,B=n[k>>2]|0,A=B,(d-B|0)>>>0<l>>>0){A=YP[n[u+36>>2]&7](u,o,l)|0;break}t:do if((s[u+75>>0]|0)>-1){for(B=l;;){if(!B){m=0,d=o;break t}if(d=B+-1|0,(s[o+d>>0]|0)==10)break;B=d}if(A=YP[n[u+36>>2]&7](u,o,B)|0,A>>>0<B>>>0)break e;m=B,d=o+B|0,l=l-B|0,A=n[k>>2]|0}else m=0,d=o;while(!1);Qr(A|0,d|0,l|0)|0,n[k>>2]=(n[k>>2]|0)+l,A=m+l|0}while(!1);return A|0}function S6e(o){o=o|0;var l=0,u=0;return l=o+74|0,u=s[l>>0]|0,s[l>>0]=u+255|u,l=n[o>>2]|0,l&8?(n[o>>2]=l|32,o=-1):(n[o+8>>2]=0,n[o+4>>2]=0,u=n[o+44>>2]|0,n[o+28>>2]=u,n[o+20>>2]=u,n[o+16>>2]=u+(n[o+48>>2]|0),o=0),o|0}function $n(o,l){o=y(o),l=y(l);var u=0,A=0;u=DZ(o)|0;do if((u&2147483647)>>>0<=2139095040){if(A=DZ(l)|0,(A&2147483647)>>>0<=2139095040)if((A^u|0)<0){o=(u|0)<0?l:o;break}else{o=o<l?l:o;break}}else o=l;while(!1);return y(o)}function DZ(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function pd(o,l){o=y(o),l=y(l);var u=0,A=0;u=bZ(o)|0;do if((u&2147483647)>>>0<=2139095040){if(A=bZ(l)|0,(A&2147483647)>>>0<=2139095040)if((A^u|0)<0){o=(u|0)<0?o:l;break}else{o=o<l?o:l;break}}else o=l;while(!1);return y(o)}function bZ(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function uU(o,l){o=y(o),l=y(l);var u=0,A=0,d=0,m=0,B=0,k=0,T=0,M=0;m=(h[S>>2]=o,n[S>>2]|0),k=(h[S>>2]=l,n[S>>2]|0),u=m>>>23&255,B=k>>>23&255,T=m&-2147483648,d=k<<1;e:do if(d|0&&!((u|0)==255|((D6e(l)|0)&2147483647)>>>0>2139095040)){if(A=m<<1,A>>>0<=d>>>0)return l=y(o*y(0)),y((A|0)==(d|0)?l:o);if(u)A=m&8388607|8388608;else{if(u=m<<9,(u|0)>-1){A=u,u=0;do u=u+-1|0,A=A<<1;while((A|0)>-1)}else u=0;A=m<<1-u}if(B)k=k&8388607|8388608;else{if(m=k<<9,(m|0)>-1){d=0;do d=d+-1|0,m=m<<1;while((m|0)>-1)}else d=0;B=d,k=k<<1-d}d=A-k|0,m=(d|0)>-1;t:do if((u|0)>(B|0)){for(;;){if(m)if(d)A=d;else break;if(A=A<<1,u=u+-1|0,d=A-k|0,m=(d|0)>-1,(u|0)<=(B|0))break t}l=y(o*y(0));break e}while(!1);if(m)if(d)A=d;else{l=y(o*y(0));break}if(A>>>0<8388608)do A=A<<1,u=u+-1|0;while(A>>>0<8388608);(u|0)>0?u=A+-8388608|u<<23:u=A>>>(1-u|0),l=(n[S>>2]=u|T,y(h[S>>2]))}else M=3;while(!1);return(M|0)==3&&(l=y(o*l),l=y(l/l)),y(l)}function D6e(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function b6e(o,l){return o=o|0,l=l|0,IZ(n[582]|0,o,l)|0}function an(o){o=o|0,Nt()}function $y(o){o=o|0}function P6e(o,l){return o=o|0,l=l|0,0}function x6e(o){return o=o|0,(PZ(o+4|0)|0)==-1?(ip[n[(n[o>>2]|0)+8>>2]&127](o),o=1):o=0,o|0}function PZ(o){o=o|0;var l=0;return l=n[o>>2]|0,n[o>>2]=l+-1,l+-1|0}function Gh(o){o=o|0,x6e(o)|0&&k6e(o)}function k6e(o){o=o|0;var l=0;l=o+8|0,n[l>>2]|0&&(PZ(l)|0)!=-1||ip[n[(n[o>>2]|0)+16>>2]&127](o)}function Kt(o){o=o|0;var l=0;for(l=o|0?o:1;o=_P(l)|0,!(o|0);){if(o=T6e()|0,!o){o=0;break}GZ[o&0]()}return o|0}function xZ(o){return o=o|0,Kt(o)|0}function It(o){o=o|0,HP(o)}function Q6e(o){o=o|0,(s[o+11>>0]|0)<0&&It(n[o>>2]|0)}function T6e(){var o=0;return o=n[2923]|0,n[2923]=o+0,o|0}function R6e(){}function GP(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,A=l-A-(u>>>0>o>>>0|0)>>>0,ye=A,o-u>>>0|0|0}function fU(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,u=o+u>>>0,ye=l+A+(u>>>0<o>>>0|0)>>>0,u|0|0}function eE(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;if(m=o+u|0,l=l&255,(u|0)>=67){for(;o&3;)s[o>>0]=l,o=o+1|0;for(A=m&-4|0,d=A-64|0,B=l|l<<8|l<<16|l<<24;(o|0)<=(d|0);)n[o>>2]=B,n[o+4>>2]=B,n[o+8>>2]=B,n[o+12>>2]=B,n[o+16>>2]=B,n[o+20>>2]=B,n[o+24>>2]=B,n[o+28>>2]=B,n[o+32>>2]=B,n[o+36>>2]=B,n[o+40>>2]=B,n[o+44>>2]=B,n[o+48>>2]=B,n[o+52>>2]=B,n[o+56>>2]=B,n[o+60>>2]=B,o=o+64|0;for(;(o|0)<(A|0);)n[o>>2]=B,o=o+4|0}for(;(o|0)<(m|0);)s[o>>0]=l,o=o+1|0;return m-u|0}function kZ(o,l,u){return o=o|0,l=l|0,u=u|0,(u|0)<32?(ye=l<<u|(o&(1<<u)-1<<32-u)>>>32-u,o<<u):(ye=o<<u-32,0)}function qP(o,l,u){return o=o|0,l=l|0,u=u|0,(u|0)<32?(ye=l>>>u,o>>>u|(l&(1<<u)-1)<<32-u):(ye=0,l>>>u-32|0)}function Qr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;if((u|0)>=8192)return OA(o|0,l|0,u|0)|0;if(m=o|0,d=o+u|0,(o&3)==(l&3)){for(;o&3;){if(!u)return m|0;s[o>>0]=s[l>>0]|0,o=o+1|0,l=l+1|0,u=u-1|0}for(u=d&-4|0,A=u-64|0;(o|0)<=(A|0);)n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2],n[o+16>>2]=n[l+16>>2],n[o+20>>2]=n[l+20>>2],n[o+24>>2]=n[l+24>>2],n[o+28>>2]=n[l+28>>2],n[o+32>>2]=n[l+32>>2],n[o+36>>2]=n[l+36>>2],n[o+40>>2]=n[l+40>>2],n[o+44>>2]=n[l+44>>2],n[o+48>>2]=n[l+48>>2],n[o+52>>2]=n[l+52>>2],n[o+56>>2]=n[l+56>>2],n[o+60>>2]=n[l+60>>2],o=o+64|0,l=l+64|0;for(;(o|0)<(u|0);)n[o>>2]=n[l>>2],o=o+4|0,l=l+4|0}else for(u=d-4|0;(o|0)<(u|0);)s[o>>0]=s[l>>0]|0,s[o+1>>0]=s[l+1>>0]|0,s[o+2>>0]=s[l+2>>0]|0,s[o+3>>0]=s[l+3>>0]|0,o=o+4|0,l=l+4|0;for(;(o|0)<(d|0);)s[o>>0]=s[l>>0]|0,o=o+1|0,l=l+1|0;return m|0}function QZ(o){o=o|0;var l=0;return l=s[N+(o&255)>>0]|0,(l|0)<8?l|0:(l=s[N+(o>>8&255)>>0]|0,(l|0)<8?l+8|0:(l=s[N+(o>>16&255)>>0]|0,(l|0)<8?l+16|0:(s[N+(o>>>24)>>0]|0)+24|0))}function TZ(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B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QZ(k|0)|0)>>>0),ye=Ye,Le|0;if(m=(b(k|0)|0)-(b(M|0)|0)|0,m>>>0<=30){l=m+1|0,k=31-m|0,B=l,o=M<<k|L>>>(l>>>0),l=M>>>(l>>>0),m=0,k=L<<k;break}return d?(n[d>>2]=o|0,n[d+4>>2]=T|l&0,Ye=0,Le=0,ye=Ye,Le|0):(Ye=0,Le=0,ye=Ye,Le|0)}while(!1);if(!B)M=k,T=0,k=0;else{q=u|0|0,L=ae|A&0,M=fU(q|0,L|0,-1,-1)|0,u=ye,T=k,k=0;do A=T,T=m>>>31|T<<1,m=k|m<<1,A=o<<1|A>>>31|0,ae=o>>>31|l<<1|0,GP(M|0,u|0,A|0,ae|0)|0,Le=ye,Ye=Le>>31|((Le|0)<0?-1:0)<<1,k=Ye&1,o=GP(A|0,ae|0,Ye&q|0,(((Le|0)<0?-1:0)>>31|((Le|0)<0?-1:0)<<1)&L|0)|0,l=ye,B=B-1|0;while(B|0);M=T,T=0}return B=0,d|0&&(n[d>>2]=o,n[d+4>>2]=l),Ye=(m|0)>>>31|(M|B)<<1|(B<<1|m>>>31)&0|T,Le=(m<<1|0)&-2|k,ye=Ye,Le|0}function AU(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,TZ(o,l,u,A,0)|0}function qh(o){o=o|0;var l=0,u=0;return u=o+15&-16|0,l=n[C>>2]|0,o=l+u|0,(u|0)>0&(o|0)<(l|0)|(o|0)<0?(oe()|0,fu(12),-1):(n[C>>2]=o,(o|0)>($()|0)&&!(X()|0)?(n[C>>2]=l,fu(12),-1):l|0)}function Q2(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;if((l|0)<(o|0)&(o|0)<(l+u|0)){for(A=o,l=l+u|0,o=o+u|0;(u|0)>0;)o=o-1|0,l=l-1|0,u=u-1|0,s[o>>0]=s[l>>0]|0;o=A}else Qr(o,l,u)|0;return o|0}function pU(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;return m=I,I=I+16|0,d=m|0,TZ(o,l,u,A,d)|0,I=m,ye=n[d+4>>2]|0,n[d>>2]|0|0}function RZ(o){return o=o|0,(o&255)<<24|(o>>8&255)<<16|(o>>16&255)<<8|o>>>24|0}function F6e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,FZ[o&1](l|0,u|0,A|0,d|0,m|0)}function N6e(o,l,u){o=o|0,l=l|0,u=y(u),NZ[o&1](l|0,y(u))}function O6e(o,l,u){o=o|0,l=l|0,u=+u,OZ[o&31](l|0,+u)}function L6e(o,l,u,A){return o=o|0,l=l|0,u=y(u),A=y(A),y(LZ[o&0](l|0,y(u),y(A)))}function M6e(o,l){o=o|0,l=l|0,ip[o&127](l|0)}function U6e(o,l,u){o=o|0,l=l|0,u=u|0,sp[o&31](l|0,u|0)}function _6e(o,l){return o=o|0,l=l|0,gd[o&31](l|0)|0}function H6e(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0,MZ[o&1](l|0,+u,+A,d|0)}function j6e(o,l,u,A){o=o|0,l=l|0,u=+u,A=+A,wGe[o&1](l|0,+u,+A)}function G6e(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,YP[o&7](l|0,u|0,A|0)|0}function q6e(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,+BGe[o&1](l|0,u|0,A|0)}function W6e(o,l){return o=o|0,l=l|0,+UZ[o&15](l|0)}function Y6e(o,l,u){return o=o|0,l=l|0,u=+u,vGe[o&1](l|0,+u)|0}function V6e(o,l,u){return o=o|0,l=l|0,u=u|0,gU[o&15](l|0,u|0)|0}function J6e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=+A,d=+d,m=m|0,SGe[o&1](l|0,u|0,+A,+d,m|0)}function K6e(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,DGe[o&1](l|0,u|0,A|0,d|0,m|0,B|0)}function z6e(o,l,u){return o=o|0,l=l|0,u=u|0,+_Z[o&7](l|0,u|0)}function X6e(o){return o=o|0,VP[o&7]()|0}function Z6e(o,l,u,A,d,m){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,HZ[o&1](l|0,u|0,A|0,d|0,m|0)|0}function $6e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=+d,bGe[o&1](l|0,u|0,A|0,+d)}function eGe(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=y(A),d=d|0,m=y(m),B=B|0,jZ[o&1](l|0,u|0,y(A),d|0,y(m),B|0)}function tGe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,F2[o&15](l|0,u|0,A|0)}function rGe(o){o=o|0,GZ[o&0]()}function nGe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A,qZ[o&15](l|0,u|0,+A)}function iGe(o,l,u){return o=o|0,l=+l,u=+u,PGe[o&1](+l,+u)|0}function sGe(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,dU[o&15](l|0,u|0,A|0,d|0)}function oGe(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,F(0)}function aGe(o,l){o=o|0,l=y(l),F(1)}function Xa(o,l){o=o|0,l=+l,F(2)}function lGe(o,l,u){return o=o|0,l=y(l),u=y(u),F(3),$e}function wr(o){o=o|0,F(4)}function T2(o,l){o=o|0,l=l|0,F(5)}function Ol(o){return o=o|0,F(6),0}function cGe(o,l,u,A){o=o|0,l=+l,u=+u,A=A|0,F(7)}function uGe(o,l,u){o=o|0,l=+l,u=+u,F(8)}function fGe(o,l,u){return o=o|0,l=l|0,u=u|0,F(9),0}function AGe(o,l,u){return o=o|0,l=l|0,u=u|0,F(10),0}function hd(o){return o=o|0,F(11),0}function pGe(o,l){return o=o|0,l=+l,F(12),0}function R2(o,l){return o=o|0,l=l|0,F(13),0}function hGe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0,F(14)}function gGe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,F(15)}function hU(o,l){return o=o|0,l=l|0,F(16),0}function dGe(){return F(17),0}function mGe(o,l,u,A,d){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,F(18),0}function yGe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A,F(19)}function EGe(o,l,u,A,d,m){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0,F(20)}function WP(o,l,u){o=o|0,l=l|0,u=u|0,F(21)}function IGe(){F(22)}function tE(o,l,u){o=o|0,l=l|0,u=+u,F(23)}function CGe(o,l){return o=+o,l=+l,F(24),0}function rE(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,F(25)}var FZ=[oGe,m3e],NZ=[aGe,Ty],OZ=[Xa,Zg,Fh,h2,g2,d2,m2,bf,_y,y2,Pf,$g,ed,E2,I2,wu,td,C2,Hy,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa,Xa],LZ=[lGe],ip=[wr,$y,Xke,Zke,$ke,PFe,xFe,kFe,Y_e,V_e,J_e,i3e,s3e,o3e,Dje,bje,Pje,Bl,Xg,u2,sr,hc,xP,kP,Hke,aQe,EQe,LQe,$Qe,dTe,RTe,JTe,cRe,SRe,HRe,nFe,EFe,VFe,cNe,SNe,HNe,nOe,EOe,MOe,$Oe,pLe,xLe,dP,oMe,wMe,HMe,sUe,IUe,HUe,XUe,e_e,m_e,I_e,L_e,z_e,$_e,d4e,F4e,Iz,g8e,Y8e,aHe,wHe,qHe,sje,dje,Eje,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr],sp=[T2,Ly,JL,f2,A2,xr,so,Xi,Ns,ws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dynCall_iid:Y6e,setTempRet0:LA,_i64Add:fU,dynCall_fiff:L6e,dynCall_iiii:G6e,_emscripten_get_global_libc:r6e,dynCall_viid:nGe,dynCall_viiid:$6e,dynCall_viififi:eGe,dynCall_ii:_6e,__GLOBAL__sub_I_Binding_cc:a8e,dynCall_viiii:sGe,dynCall_iiiiii:Z6e,stackSave:hf,dynCall_viiiii:F6e,__GLOBAL__sub_I_nbind_cc:Sr,dynCall_vidd:j6e,_free:HP,runPostSets:R6e,dynCall_viiiiii:K6e,establishStackSpace:wn,_memmove:Q2,stackRestore:lc,_malloc:_P,__GLOBAL__sub_I_common_cc:b4e,dynCall_viddi:H6e,dynCall_dii:z6e,dynCall_v:rGe}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm;function ExitStatus(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function t(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=t)},Module.callMain=Module.callMain=function t(e){e=e||[],ensureInitRuntime();var r=e.length+1;function s(){for(var p=0;p<3;p++)a.push(0)}var a=[allocate(intArrayFromString(Module.thisProgram),\"i8\",ALLOC_NORMAL)];s();for(var n=0;n<r-1;n=n+1)a.push(allocate(intArrayFromString(e[n]),\"i8\",ALLOC_NORMAL)),s();a.push(0),a=allocate(a,\"i32\",ALLOC_NORMAL);try{var c=Module._main(r,a,0);exit(c,!0)}catch(p){if(p instanceof ExitStatus)return;if(p==\"SimulateInfiniteLoop\"){Module.noExitRuntime=!0;return}else{var f=p;p&&typeof p==\"object\"&&p.stack&&(f=[p,p.stack]),Module.printErr(\"exception thrown: \"+f),Module.quit(1,p)}}finally{calledMain=!0}};function run(t){if(t=t||Module.arguments,preloadStartTime===null&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0)||Module.calledRun)return;function e(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(t),postRun()))}Module.setStatus?(Module.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){Module.setStatus(\"\")},1),e()},1)):e()}Module.run=Module.run=run;function exit(t,e){e&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=t,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(t)),ENVIRONMENT_IS_NODE&&process.exit(t),Module.quit(t,new ExitStatus(t)))}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(t){Module.onAbort&&Module.onAbort(t),t!==void 0?(Module.print(t),Module.printErr(t),t=JSON.stringify(t)):t=\"\",ABORT=!0,EXITSTATUS=1;var e=`\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r=\"abort(\"+t+\") at \"+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(s){r=s(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit==\"function\"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var Fm=_((PKt,Rwe)=>{\"use strict\";var Ppt=Qwe(),xpt=Twe(),K9=!1,z9=null;xpt({},function(t,e){if(!K9){if(K9=!0,t)throw t;z9=e}});if(!K9)throw new Error(\"Failed to load the yoga module - it needed to be loaded synchronously, but didn't\");Rwe.exports=Ppt(z9.bind,z9.lib)});var Z9=_((xKt,X9)=>{\"use strict\";var Fwe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);X9.exports=Fwe;X9.exports.default=Fwe});var Owe=_((kKt,Nwe)=>{\"use strict\";Nwe.exports=function(){return/\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73)\\uDB40\\uDC7F|\\uD83D\\uDC68(?:\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83D[\\uDC66\\uDC67]|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C[\\uDFFB-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)\\uD83C\\uDFFB|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83D\\uDC69(?:\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|(?:(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)\\uFE0F|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\u200D[\\u2640\\u2642])|\\uD83C\\uDFF4\\u200D\\u2620)\\uFE0F|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF6\\uD83C\\uDDE6|[#\\*0-9]\\uFE0F\\u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\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC70\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDCAA\\uDD74\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD36\\uDDB5\\uDDB6\\uDDBB\\uDDD2-\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5\\uDEEB\\uDEEC\\uDEF4-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\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DE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g}});var GS=_((QKt,$9)=>{\"use strict\";var kpt=dk(),Qpt=Z9(),Tpt=Owe(),Lwe=t=>{if(typeof t!=\"string\"||t.length===0||(t=kpt(t),t.length===0))return 0;t=t.replace(Tpt(),\"  \");let e=0;for(let r=0;r<t.length;r++){let s=t.codePointAt(r);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&r++,e+=Qpt(s)?2:1)}return e};$9.exports=Lwe;$9.exports.default=Lwe});var tW=_((TKt,eW)=>{\"use strict\";var Rpt=GS(),Mwe=t=>{let e=0;for(let r of t.split(`\n`))e=Math.max(e,Rpt(r));return e};eW.exports=Mwe;eW.exports.default=Mwe});var Uwe=_(qS=>{\"use strict\";var Fpt=qS&&qS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qS,\"__esModule\",{value:!0});var Npt=Fpt(tW()),rW={};qS.default=t=>{if(t.length===0)return{width:0,height:0};if(rW[t])return rW[t];let e=Npt.default(t),r=t.split(`\n`).length;return rW[t]={width:e,height:r},{width:e,height:r}}});var _we=_(WS=>{\"use strict\";var Opt=WS&&WS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(WS,\"__esModule\",{value:!0});var bn=Opt(Fm()),Lpt=(t,e)=>{\"position\"in e&&t.setPositionType(e.position===\"absolute\"?bn.default.POSITION_TYPE_ABSOLUTE:bn.default.POSITION_TYPE_RELATIVE)},Mpt=(t,e)=>{\"marginLeft\"in e&&t.setMargin(bn.default.EDGE_START,e.marginLeft||0),\"marginRight\"in e&&t.setMargin(bn.default.EDGE_END,e.marginRight||0),\"marginTop\"in e&&t.setMargin(bn.default.EDGE_TOP,e.marginTop||0),\"marginBottom\"in e&&t.setMargin(bn.default.EDGE_BOTTOM,e.marginBottom||0)},Upt=(t,e)=>{\"paddingLeft\"in e&&t.setPadding(bn.default.EDGE_LEFT,e.paddingLeft||0),\"paddingRight\"in e&&t.setPadding(bn.default.EDGE_RIGHT,e.paddingRight||0),\"paddingTop\"in e&&t.setPadding(bn.default.EDGE_TOP,e.paddingTop||0),\"paddingBottom\"in e&&t.setPadding(bn.default.EDGE_BOTTOM,e.paddingBottom||0)},_pt=(t,e)=>{var r;\"flexGrow\"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),\"flexShrink\"in e&&t.setFlexShrink(typeof e.flexShrink==\"number\"?e.flexShrink:1),\"flexDirection\"in e&&(e.flexDirection===\"row\"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_ROW),e.flexDirection===\"row-reverse\"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection===\"column\"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_COLUMN),e.flexDirection===\"column-reverse\"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_COLUMN_REVERSE)),\"flexBasis\"in e&&(typeof e.flexBasis==\"number\"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis==\"string\"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),\"alignItems\"in e&&((e.alignItems===\"stretch\"||!e.alignItems)&&t.setAlignItems(bn.default.ALIGN_STRETCH),e.alignItems===\"flex-start\"&&t.setAlignItems(bn.default.ALIGN_FLEX_START),e.alignItems===\"center\"&&t.setAlignItems(bn.default.ALIGN_CENTER),e.alignItems===\"flex-end\"&&t.setAlignItems(bn.default.ALIGN_FLEX_END)),\"alignSelf\"in e&&((e.alignSelf===\"auto\"||!e.alignSelf)&&t.setAlignSelf(bn.default.ALIGN_AUTO),e.alignSelf===\"flex-start\"&&t.setAlignSelf(bn.default.ALIGN_FLEX_START),e.alignSelf===\"center\"&&t.setAlignSelf(bn.default.ALIGN_CENTER),e.alignSelf===\"flex-end\"&&t.setAlignSelf(bn.default.ALIGN_FLEX_END)),\"justifyContent\"in e&&((e.justifyContent===\"flex-start\"||!e.justifyContent)&&t.setJustifyContent(bn.default.JUSTIFY_FLEX_START),e.justifyContent===\"center\"&&t.setJustifyContent(bn.default.JUSTIFY_CENTER),e.justifyContent===\"flex-end\"&&t.setJustifyContent(bn.default.JUSTIFY_FLEX_END),e.justifyContent===\"space-between\"&&t.setJustifyContent(bn.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent===\"space-around\"&&t.setJustifyContent(bn.default.JUSTIFY_SPACE_AROUND))},Hpt=(t,e)=>{var r,s;\"width\"in e&&(typeof e.width==\"number\"?t.setWidth(e.width):typeof e.width==\"string\"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),\"height\"in e&&(typeof e.height==\"number\"?t.setHeight(e.height):typeof e.height==\"string\"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),\"minWidth\"in e&&(typeof e.minWidth==\"string\"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),\"minHeight\"in e&&(typeof e.minHeight==\"string\"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((s=e.minHeight)!==null&&s!==void 0?s:0))},jpt=(t,e)=>{\"display\"in e&&t.setDisplay(e.display===\"flex\"?bn.default.DISPLAY_FLEX:bn.default.DISPLAY_NONE)},Gpt=(t,e)=>{if(\"borderStyle\"in e){let r=typeof e.borderStyle==\"string\"?1:0;t.setBorder(bn.default.EDGE_TOP,r),t.setBorder(bn.default.EDGE_BOTTOM,r),t.setBorder(bn.default.EDGE_LEFT,r),t.setBorder(bn.default.EDGE_RIGHT,r)}};WS.default=(t,e={})=>{Lpt(t,e),Mpt(t,e),Upt(t,e),_pt(t,e),Hpt(t,e),jpt(t,e),Gpt(t,e)}});var Gwe=_((NKt,jwe)=>{\"use strict\";var YS=GS(),qpt=dk(),Wpt=sk(),iW=new Set([\"\\x1B\",\"\\x9B\"]),Ypt=39,Hwe=t=>`${iW.values().next().value}[${t}m`,Vpt=t=>t.split(\" \").map(e=>YS(e)),nW=(t,e,r)=>{let s=[...e],a=!1,n=YS(qpt(t[t.length-1]));for(let[c,f]of s.entries()){let p=YS(f);if(n+p<=r?t[t.length-1]+=f:(t.push(f),n=0),iW.has(f))a=!0;else if(a&&f===\"m\"){a=!1;continue}a||(n+=p,n===r&&c<s.length-1&&(t.push(\"\"),n=0))}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Jpt=t=>{let e=t.split(\" \"),r=e.length;for(;r>0&&!(YS(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(\" \")+e.slice(r).join(\"\")},Kpt=(t,e,r={})=>{if(r.trim!==!1&&t.trim()===\"\")return\"\";let s=\"\",a=\"\",n,c=Vpt(t),f=[\"\"];for(let[p,h]of t.split(\" \").entries()){r.trim!==!1&&(f[f.length-1]=f[f.length-1].trimLeft());let E=YS(f[f.length-1]);if(p!==0&&(E>=e&&(r.wordWrap===!1||r.trim===!1)&&(f.push(\"\"),E=0),(E>0||r.trim===!1)&&(f[f.length-1]+=\" \",E++)),r.hard&&c[p]>e){let C=e-E,S=1+Math.floor((c[p]-C-1)/e);Math.floor((c[p]-1)/e)<S&&f.push(\"\"),nW(f,h,e);continue}if(E+c[p]>e&&E>0&&c[p]>0){if(r.wordWrap===!1&&E<e){nW(f,h,e);continue}f.push(\"\")}if(E+c[p]>e&&r.wordWrap===!1){nW(f,h,e);continue}f[f.length-1]+=h}r.trim!==!1&&(f=f.map(Jpt)),s=f.join(`\n`);for(let[p,h]of[...s].entries()){if(a+=h,iW.has(h)){let C=parseFloat(/\\d[^m]*/.exec(s.slice(p,p+4)));n=C===Ypt?null:C}let E=Wpt.codes.get(Number(n));n&&E&&(s[p+1]===`\n`?a+=Hwe(E):h===`\n`&&(a+=Hwe(n)))}return a};jwe.exports=(t,e,r)=>String(t).normalize().replace(/\\r\\n/g,`\n`).split(`\n`).map(s=>Kpt(s,e,r)).join(`\n`)});var Ywe=_((OKt,Wwe)=>{\"use strict\";var qwe=\"[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]\",zpt=t=>t&&t.exact?new RegExp(`^${qwe}$`):new RegExp(qwe,\"g\");Wwe.exports=zpt});var sW=_((LKt,zwe)=>{\"use strict\";var Xpt=Z9(),Zpt=Ywe(),Vwe=sk(),Kwe=[\"\\x1B\",\"\\x9B\"],NF=t=>`${Kwe[0]}[${t}m`,Jwe=(t,e,r)=>{let s=[];t=[...t];for(let a of t){let n=a;a.match(\";\")&&(a=a.split(\";\")[0][0]+\"0\");let c=Vwe.codes.get(parseInt(a,10));if(c){let f=t.indexOf(c.toString());f>=0?t.splice(f,1):s.push(NF(e?c:n))}else if(e){s.push(NF(0));break}else s.push(NF(n))}if(e&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=NF(Vwe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join(\"\")};zwe.exports=(t,e,r)=>{let s=[...t.normalize()],a=[];r=typeof r==\"number\"?r:s.length;let n=!1,c,f=0,p=\"\";for(let[h,E]of s.entries()){let C=!1;if(Kwe.includes(E)){let S=/\\d[^m]*/.exec(t.slice(h,h+18));c=S&&S.length>0?S[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&E===\"m\"&&(n=!1,C=!0);if(!n&&!C&&++f,!Zpt({exact:!0}).test(E)&&Xpt(E.codePointAt())&&++f,f>e&&f<=r)p+=E;else if(f===e&&!n&&c!==void 0)p=Jwe(a);else if(f>=r){p+=Jwe(a,!0,c);break}}return p}});var Zwe=_((MKt,Xwe)=>{\"use strict\";var $0=sW(),$pt=GS();function OF(t,e,r){if(t.charAt(e)===\" \")return e;for(let s=1;s<=3;s++)if(r){if(t.charAt(e+s)===\" \")return e+s}else if(t.charAt(e-s)===\" \")return e-s;return e}Xwe.exports=(t,e,r)=>{r={position:\"end\",preferTruncationOnSpace:!1,...r};let{position:s,space:a,preferTruncationOnSpace:n}=r,c=\"\\u2026\",f=1;if(typeof t!=\"string\")throw new TypeError(`Expected \\`input\\` to be a string, got ${typeof t}`);if(typeof e!=\"number\")throw new TypeError(`Expected \\`columns\\` to be a number, got ${typeof e}`);if(e<1)return\"\";if(e===1)return c;let p=$pt(t);if(p<=e)return t;if(s===\"start\"){if(n){let h=OF(t,p-e+1,!0);return c+$0(t,h,p).trim()}return a===!0&&(c+=\" \",f=2),c+$0(t,p-e+f,p)}if(s===\"middle\"){a===!0&&(c=\" \"+c+\" \",f=3);let h=Math.floor(e/2);if(n){let E=OF(t,h),C=OF(t,p-(e-h)+1,!0);return $0(t,0,E)+c+$0(t,C,p).trim()}return $0(t,0,h)+c+$0(t,p-(e-h)+f,p)}if(s===\"end\"){if(n){let h=OF(t,e-1);return $0(t,0,h)+c}return a===!0&&(c=\" \"+c,f=2),$0(t,0,e-f)+c}throw new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${s}`)}});var aW=_(VS=>{\"use strict\";var $we=VS&&VS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(VS,\"__esModule\",{value:!0});var eht=$we(Gwe()),tht=$we(Zwe()),oW={};VS.default=(t,e,r)=>{let s=t+String(e)+String(r);if(oW[s])return oW[s];let a=t;if(r===\"wrap\"&&(a=eht.default(t,e,{trim:!1,hard:!0})),r.startsWith(\"truncate\")){let n=\"end\";r===\"truncate-middle\"&&(n=\"middle\"),r===\"truncate-start\"&&(n=\"start\"),a=tht.default(t,e,{position:n})}return oW[s]=a,a}});var cW=_(lW=>{\"use strict\";Object.defineProperty(lW,\"__esModule\",{value:!0});var e1e=t=>{let e=\"\";if(t.childNodes.length>0)for(let r of t.childNodes){let s=\"\";r.nodeName===\"#text\"?s=r.nodeValue:((r.nodeName===\"ink-text\"||r.nodeName===\"ink-virtual-text\")&&(s=e1e(r)),s.length>0&&typeof r.internal_transform==\"function\"&&(s=r.internal_transform(s))),e+=s}return e};lW.default=e1e});var uW=_(bi=>{\"use strict\";var JS=bi&&bi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bi,\"__esModule\",{value:!0});bi.setTextNodeValue=bi.createTextNode=bi.setStyle=bi.setAttribute=bi.removeChildNode=bi.insertBeforeNode=bi.appendChildNode=bi.createNode=bi.TEXT_NAME=void 0;var rht=JS(Fm()),t1e=JS(Uwe()),nht=JS(_we()),iht=JS(aW()),sht=JS(cW());bi.TEXT_NAME=\"#text\";bi.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t===\"ink-virtual-text\"?void 0:rht.default.Node.create()};return t===\"ink-text\"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(oht.bind(null,r))),r};bi.appendChildNode=(t,e)=>{var r;e.parentNode&&bi.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&LF(t)};bi.insertBeforeNode=(t,e,r)=>{var s,a;e.parentNode&&bi.removeChildNode(e.parentNode,e),e.parentNode=t;let n=t.childNodes.indexOf(r);if(n>=0){t.childNodes.splice(n,0,e),e.yogaNode&&((s=t.yogaNode)===null||s===void 0||s.insertChild(e.yogaNode,n));return}t.childNodes.push(e),e.yogaNode&&((a=t.yogaNode)===null||a===void 0||a.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&LF(t)};bi.removeChildNode=(t,e)=>{var r,s;e.yogaNode&&((s=(r=e.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||s===void 0||s.removeChild(e.yogaNode)),e.parentNode=null;let a=t.childNodes.indexOf(e);a>=0&&t.childNodes.splice(a,1),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&LF(t)};bi.setAttribute=(t,e,r)=>{t.attributes[e]=r};bi.setStyle=(t,e)=>{t.style=e,t.yogaNode&&nht.default(t.yogaNode,e)};bi.createTextNode=t=>{let e={nodeName:\"#text\",nodeValue:t,yogaNode:void 0,parentNode:null,style:{}};return bi.setTextNodeValue(e,t),e};var oht=function(t,e){var r,s;let a=t.nodeName===\"#text\"?t.nodeValue:sht.default(t),n=t1e.default(a);if(n.width<=e||n.width>=1&&e>0&&e<1)return n;let c=(s=(r=t.style)===null||r===void 0?void 0:r.textWrap)!==null&&s!==void 0?s:\"wrap\",f=iht.default(a,e,c);return t1e.default(f)},r1e=t=>{var e;if(!(!t||!t.parentNode))return(e=t.yogaNode)!==null&&e!==void 0?e:r1e(t.parentNode)},LF=t=>{let e=r1e(t);e?.markDirty()};bi.setTextNodeValue=(t,e)=>{typeof e!=\"string\"&&(e=String(e)),t.nodeValue=e,LF(t)}});var a1e=_(KS=>{\"use strict\";var o1e=KS&&KS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(KS,\"__esModule\",{value:!0});var n1e=Y9(),aht=o1e(Swe()),i1e=o1e(Fm()),ea=uW(),s1e=t=>{t?.unsetMeasureFunc(),t?.freeRecursive()};KS.default=aht.default({schedulePassiveEffects:n1e.unstable_scheduleCallback,cancelPassiveEffects:n1e.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,shouldDeprioritizeSubtree:()=>!1,resetAfterCommit:t=>{if(t.isStaticDirty){t.isStaticDirty=!1,typeof t.onImmediateRender==\"function\"&&t.onImmediateRender();return}typeof t.onRender==\"function\"&&t.onRender()},getChildHostContext:(t,e)=>{let r=t.isInsideText,s=e===\"ink-text\"||e===\"ink-virtual-text\";return r===s?t:{isInsideText:s}},shouldSetTextContent:()=>!1,createInstance:(t,e,r,s)=>{if(s.isInsideText&&t===\"ink-box\")throw new Error(\"<Box> can\\u2019t be nested inside <Text> component\");let a=t===\"ink-text\"&&s.isInsideText?\"ink-virtual-text\":t,n=ea.createNode(a);for(let[c,f]of Object.entries(e))c!==\"children\"&&(c===\"style\"?ea.setStyle(n,f):c===\"internal_transform\"?n.internal_transform=f:c===\"internal_static\"?n.internal_static=!0:ea.setAttribute(n,c,f));return n},createTextInstance:(t,e,r)=>{if(!r.isInsideText)throw new Error(`Text string \"${t}\" must be rendered inside <Text> component`);return ea.createTextNode(t)},resetTextContent:()=>{},hideTextInstance:t=>{ea.setTextNodeValue(t,\"\")},unhideTextInstance:(t,e)=>{ea.setTextNodeValue(t,e)},getPublicInstance:t=>t,hideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay(i1e.default.DISPLAY_NONE)},unhideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay(i1e.default.DISPLAY_FLEX)},appendInitialChild:ea.appendChildNode,appendChild:ea.appendChildNode,insertBefore:ea.insertBeforeNode,finalizeInitialChildren:(t,e,r,s)=>(t.internal_static&&(s.isStaticDirty=!0,s.staticNode=t),!1),supportsMutation:!0,appendChildToContainer:ea.appendChildNode,insertInContainerBefore:ea.insertBeforeNode,removeChildFromContainer:(t,e)=>{ea.removeChildNode(t,e),s1e(e.yogaNode)},prepareUpdate:(t,e,r,s,a)=>{t.internal_static&&(a.isStaticDirty=!0);let n={},c=Object.keys(s);for(let f of c)if(s[f]!==r[f]){if(f===\"style\"&&typeof s.style==\"object\"&&typeof r.style==\"object\"){let h=s.style,E=r.style,C=Object.keys(h);for(let S of C){if(S===\"borderStyle\"||S===\"borderColor\"){if(typeof n.style!=\"object\"){let P={};n.style=P}n.style.borderStyle=h.borderStyle,n.style.borderColor=h.borderColor}if(h[S]!==E[S]){if(typeof n.style!=\"object\"){let P={};n.style=P}n.style[S]=h[S]}}continue}n[f]=s[f]}return n},commitUpdate:(t,e)=>{for(let[r,s]of Object.entries(e))r!==\"children\"&&(r===\"style\"?ea.setStyle(t,s):r===\"internal_transform\"?t.internal_transform=s:r===\"internal_static\"?t.internal_static=!0:ea.setAttribute(t,r,s))},commitTextUpdate:(t,e,r)=>{ea.setTextNodeValue(t,r)},removeChild:(t,e)=>{ea.removeChildNode(t,e),s1e(e.yogaNode)}})});var c1e=_((GKt,l1e)=>{\"use strict\";l1e.exports=(t,e=1,r)=>{if(r={indent:\" \",includeEmptyLines:!1,...r},typeof t!=\"string\")throw new TypeError(`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof t}\\``);if(typeof e!=\"number\")throw new TypeError(`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof e}\\``);if(typeof r.indent!=\"string\")throw new TypeError(`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof r.indent}\\``);if(e===0)return t;let s=r.includeEmptyLines?/^/gm:/^(?!\\s*$)/gm;return t.replace(s,r.indent.repeat(e))}});var u1e=_(zS=>{\"use strict\";var lht=zS&&zS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zS,\"__esModule\",{value:!0});var MF=lht(Fm());zS.default=t=>t.getComputedWidth()-t.getComputedPadding(MF.default.EDGE_LEFT)-t.getComputedPadding(MF.default.EDGE_RIGHT)-t.getComputedBorder(MF.default.EDGE_LEFT)-t.getComputedBorder(MF.default.EDGE_RIGHT)});var f1e=_((WKt,cht)=>{cht.exports={single:{topLeft:\"\\u250C\",topRight:\"\\u2510\",bottomRight:\"\\u2518\",bottomLeft:\"\\u2514\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},double:{topLeft:\"\\u2554\",topRight:\"\\u2557\",bottomRight:\"\\u255D\",bottomLeft:\"\\u255A\",vertical:\"\\u2551\",horizontal:\"\\u2550\"},round:{topLeft:\"\\u256D\",topRight:\"\\u256E\",bottomRight:\"\\u256F\",bottomLeft:\"\\u2570\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},bold:{topLeft:\"\\u250F\",topRight:\"\\u2513\",bottomRight:\"\\u251B\",bottomLeft:\"\\u2517\",vertical:\"\\u2503\",horizontal:\"\\u2501\"},singleDouble:{topLeft:\"\\u2553\",topRight:\"\\u2556\",bottomRight:\"\\u255C\",bottomLeft:\"\\u2559\",vertical:\"\\u2551\",horizontal:\"\\u2500\"},doubleSingle:{topLeft:\"\\u2552\",topRight:\"\\u2555\",bottomRight:\"\\u255B\",bottomLeft:\"\\u2558\",vertical:\"\\u2502\",horizontal:\"\\u2550\"},classic:{topLeft:\"+\",topRight:\"+\",bottomRight:\"+\",bottomLeft:\"+\",vertical:\"|\",horizontal:\"-\"}}});var p1e=_((YKt,fW)=>{\"use strict\";var A1e=f1e();fW.exports=A1e;fW.exports.default=A1e});var AW=_(ZS=>{\"use strict\";var uht=ZS&&ZS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ZS,\"__esModule\",{value:!0});var XS=uht(TE()),fht=/^(rgb|hsl|hsv|hwb)\\(\\s?(\\d+),\\s?(\\d+),\\s?(\\d+)\\s?\\)$/,Aht=/^(ansi|ansi256)\\(\\s?(\\d+)\\s?\\)$/,UF=(t,e)=>e===\"foreground\"?t:\"bg\"+t[0].toUpperCase()+t.slice(1);ZS.default=(t,e,r)=>{if(!e)return t;if(e in XS.default){let a=UF(e,r);return XS.default[a](t)}if(e.startsWith(\"#\")){let a=UF(\"hex\",r);return XS.default[a](e)(t)}if(e.startsWith(\"ansi\")){let a=Aht.exec(e);if(!a)return t;let n=UF(a[1],r),c=Number(a[2]);return XS.default[n](c)(t)}if(e.startsWith(\"rgb\")||e.startsWith(\"hsl\")||e.startsWith(\"hsv\")||e.startsWith(\"hwb\")){let a=fht.exec(e);if(!a)return t;let n=UF(a[1],r),c=Number(a[2]),f=Number(a[3]),p=Number(a[4]);return XS.default[n](c,f,p)(t)}return t}});var g1e=_($S=>{\"use strict\";var h1e=$S&&$S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($S,\"__esModule\",{value:!0});var pht=h1e(p1e()),pW=h1e(AW());$S.default=(t,e,r,s)=>{if(typeof r.style.borderStyle==\"string\"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),c=r.style.borderColor,f=pht.default[r.style.borderStyle],p=pW.default(f.topLeft+f.horizontal.repeat(a-2)+f.topRight,c,\"foreground\"),h=(pW.default(f.vertical,c,\"foreground\")+`\n`).repeat(n-2),E=pW.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,\"foreground\");s.write(t,e,p,{transformers:[]}),s.write(t,e+1,h,{transformers:[]}),s.write(t+a-1,e+1,h,{transformers:[]}),s.write(t,e+n-1,E,{transformers:[]})}}});var m1e=_(eD=>{\"use strict\";var Nm=eD&&eD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eD,\"__esModule\",{value:!0});var hht=Nm(Fm()),ght=Nm(tW()),dht=Nm(c1e()),mht=Nm(aW()),yht=Nm(u1e()),Eht=Nm(cW()),Iht=Nm(g1e()),Cht=(t,e)=>{var r;let s=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(s){let a=s.getComputedLeft(),n=s.getComputedTop();e=`\n`.repeat(n)+dht.default(e,a)}return e},d1e=(t,e,r)=>{var s;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&t.internal_static)return;let{yogaNode:p}=t;if(p){if(p.getDisplay()===hht.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),C=c;if(typeof t.internal_transform==\"function\"&&(C=[t.internal_transform,...c]),t.nodeName===\"ink-text\"){let S=Eht.default(t);if(S.length>0){let P=ght.default(S),I=yht.default(p);if(P>I){let R=(s=t.style.textWrap)!==null&&s!==void 0?s:\"wrap\";S=mht.default(S,I,R)}S=Cht(t,S),e.write(h,E,S,{transformers:C})}return}if(t.nodeName===\"ink-box\"&&Iht.default(h,E,t,e),t.nodeName===\"ink-root\"||t.nodeName===\"ink-box\")for(let S of t.childNodes)d1e(S,e,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};eD.default=d1e});var I1e=_(tD=>{\"use strict\";var E1e=tD&&tD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tD,\"__esModule\",{value:!0});var y1e=E1e(sW()),wht=E1e(GS()),hW=class{constructor(e){this.writes=[];let{width:r,height:s}=e;this.width=r,this.height=s}write(e,r,s,a){let{transformers:n}=a;s&&this.writes.push({x:e,y:r,text:s,transformers:n})}get(){let e=[];for(let s=0;s<this.height;s++)e.push(\" \".repeat(this.width));for(let s of this.writes){let{x:a,y:n,text:c,transformers:f}=s,p=c.split(`\n`),h=0;for(let E of p){let C=e[n+h];if(!C)continue;let S=wht.default(E);for(let P of f)E=P(E);e[n+h]=y1e.default(C,0,a)+E+y1e.default(C,a+S),h++}}return{output:e.map(s=>s.trimRight()).join(`\n`),height:e.length}}};tD.default=hW});var B1e=_(rD=>{\"use strict\";var gW=rD&&rD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rD,\"__esModule\",{value:!0});var Bht=gW(Fm()),C1e=gW(m1e()),w1e=gW(I1e());rD.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,Bht.default.DIRECTION_LTR);let s=new w1e.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});C1e.default(t,s,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new w1e.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),C1e.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=s.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}\n`:\"\"}}return{output:\"\",outputHeight:0,staticOutput:\"\"}}});var b1e=_((ZKt,D1e)=>{\"use strict\";var v1e=Ie(\"stream\"),S1e=[\"assert\",\"count\",\"countReset\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"table\",\"time\",\"timeEnd\",\"timeLog\",\"trace\",\"warn\"],dW={},vht=t=>{let e=new v1e.PassThrough,r=new v1e.PassThrough;e.write=a=>t(\"stdout\",a),r.write=a=>t(\"stderr\",a);let s=new console.Console(e,r);for(let a of S1e)dW[a]=console[a],console[a]=s[a];return()=>{for(let a of S1e)console[a]=dW[a];dW={}}};D1e.exports=vht});var yW=_(mW=>{\"use strict\";Object.defineProperty(mW,\"__esModule\",{value:!0});mW.default=new WeakMap});var IW=_(EW=>{\"use strict\";Object.defineProperty(EW,\"__esModule\",{value:!0});var Sht=hn(),P1e=Sht.createContext({exit:()=>{}});P1e.displayName=\"InternalAppContext\";EW.default=P1e});var wW=_(CW=>{\"use strict\";Object.defineProperty(CW,\"__esModule\",{value:!0});var Dht=hn(),x1e=Dht.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});x1e.displayName=\"InternalStdinContext\";CW.default=x1e});var vW=_(BW=>{\"use strict\";Object.defineProperty(BW,\"__esModule\",{value:!0});var bht=hn(),k1e=bht.createContext({stdout:void 0,write:()=>{}});k1e.displayName=\"InternalStdoutContext\";BW.default=k1e});var DW=_(SW=>{\"use strict\";Object.defineProperty(SW,\"__esModule\",{value:!0});var Pht=hn(),Q1e=Pht.createContext({stderr:void 0,write:()=>{}});Q1e.displayName=\"InternalStderrContext\";SW.default=Q1e});var _F=_(bW=>{\"use strict\";Object.defineProperty(bW,\"__esModule\",{value:!0});var xht=hn(),T1e=xht.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});T1e.displayName=\"InternalFocusContext\";bW.default=T1e});var F1e=_((szt,R1e)=>{\"use strict\";var kht=/[|\\\\{}()[\\]^$+*?.-]/g;R1e.exports=t=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return t.replace(kht,\"\\\\$&\")}});var M1e=_((ozt,L1e)=>{\"use strict\";var Qht=F1e(),Tht=typeof process==\"object\"&&process&&typeof process.cwd==\"function\"?process.cwd():\".\",O1e=[].concat(Ie(\"module\").builtinModules,\"bootstrap_node\",\"node\").map(t=>new RegExp(`(?:\\\\((?:node:)?${t}(?:\\\\.js)?:\\\\d+:\\\\d+\\\\)$|^\\\\s*at (?:node:)?${t}(?:\\\\.js)?:\\\\d+:\\\\d+$)`));O1e.push(/\\((?:node:)?internal\\/[^:]+:\\d+:\\d+\\)$/,/\\s*at (?:node:)?internal\\/[^:]+:\\d+:\\d+$/,/\\/\\.node-spawn-wrap-\\w+-\\w+\\/node:\\d+:\\d+\\)?$/);var PW=class t{constructor(e){e={ignoredPackages:[],...e},\"internals\"in e||(e.internals=t.nodeInternals()),\"cwd\"in e||(e.cwd=Tht),this._cwd=e.cwd.replace(/\\\\/g,\"/\"),this._internals=[].concat(e.internals,Rht(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...O1e]}clean(e,r=0){r=\" \".repeat(r),Array.isArray(e)||(e=e.split(`\n`)),!/^\\s*at /.test(e[0])&&/^\\s*at /.test(e[1])&&(e=e.slice(1));let s=!1,a=null,n=[];return e.forEach(c=>{if(c=c.replace(/\\\\/g,\"/\"),this._internals.some(p=>p.test(c)))return;let f=/^\\s*at /.test(c);s?c=c.trimEnd().replace(/^(\\s+)at /,\"$1\"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,\"\"),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(s=!0,a=c))}),n.map(c=>`${r}${c}\n`).join(\"\")}captureString(e,r=this.captureString){typeof e==\"function\"&&(r=e,e=1/0);let{stackTraceLimit:s}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=s,this.clean(n)}capture(e,r=this.capture){typeof e==\"function\"&&(r=e,e=1/0);let{prepareStackTrace:s,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:a}),c}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let s={line:r.getLineNumber(),column:r.getColumnNumber()};N1e(s,r.getFileName(),this._cwd),r.isConstructor()&&(s.constructor=!0),r.isEval()&&(s.evalOrigin=r.getEvalOrigin()),r.isNative()&&(s.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!==\"Object\"&&a!==\"[object Object]\"&&(s.type=a);let n=r.getFunctionName();n&&(s.function=n);let c=r.getMethodName();return c&&n!==c&&(s.method=c),s}parseLine(e){let r=e&&e.match(Fht);if(!r)return null;let s=r[1]===\"new\",a=r[2],n=r[3],c=r[4],f=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],C=r[9],S=r[10]===\"native\",P=r[11]===\")\",I,R={};if(E&&(R.line=Number(E)),C&&(R.column=Number(C)),P&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===\")\")N++;else if(h.charAt(U)===\"(\"&&h.charAt(U-1)===\" \"&&(N--,N===-1&&h.charAt(U-1)===\" \")){let W=h.slice(0,U-1);h=h.slice(U+1),a+=` (${W}`;break}}if(a){let N=a.match(Nht);N&&(a=N[1],I=N[2])}return N1e(R,h,this._cwd),s&&(R.constructor=!0),n&&(R.evalOrigin=n,R.evalLine=f,R.evalColumn=p,R.evalFile=c&&c.replace(/\\\\/g,\"/\")),S&&(R.native=!0),a&&(R.function=a),I&&a!==I&&(R.method=I),R}};function N1e(t,e,r){e&&(e=e.replace(/\\\\/g,\"/\"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function Rht(t){if(t.length===0)return[];let e=t.map(r=>Qht(r));return new RegExp(`[/\\\\\\\\]node_modules[/\\\\\\\\](?:${e.join(\"|\")})[/\\\\\\\\][^:]+:\\\\d+:\\\\d+`)}var Fht=new RegExp(\"^(?:\\\\s*at )?(?:(new) )?(?:(.*?) \\\\()?(?:eval at ([^ ]+) \\\\((.+?):(\\\\d+):(\\\\d+)\\\\), )?(?:(.+?):(\\\\d+):(\\\\d+)|(native))(\\\\)?)$\"),Nht=/^(.*?) \\[as (.*?)\\]$/;L1e.exports=PW});var _1e=_((azt,U1e)=>{\"use strict\";U1e.exports=(t,e)=>t.replace(/^\\t+/gm,r=>\" \".repeat(r.length*(e||2)))});var j1e=_((lzt,H1e)=>{\"use strict\";var Oht=_1e(),Lht=(t,e)=>{let r=[],s=t-e,a=t+e;for(let n=s;n<=a;n++)r.push(n);return r};H1e.exports=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(\"Source code is missing.\");if(!e||e<1)throw new TypeError(\"Line number must start from `1`.\");if(t=Oht(t).split(/\\r?\\n/),!(e>t.length))return r={around:3,...r},Lht(e,r.around).filter(s=>t[s-1]!==void 0).map(s=>({line:s,value:t[s-1]}))}});var HF=_(rf=>{\"use strict\";var Mht=rf&&rf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Uht=rf&&rf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_ht=rf&&rf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&Mht(e,t,r);return Uht(e,t),e},Hht=rf&&rf.__rest||function(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(r[s[a]]=t[s[a]]);return r};Object.defineProperty(rf,\"__esModule\",{value:!0});var G1e=_ht(hn()),xW=G1e.forwardRef((t,e)=>{var{children:r}=t,s=Hht(t,[\"children\"]);let a=Object.assign(Object.assign({},s),{marginLeft:s.marginLeft||s.marginX||s.margin||0,marginRight:s.marginRight||s.marginX||s.margin||0,marginTop:s.marginTop||s.marginY||s.margin||0,marginBottom:s.marginBottom||s.marginY||s.margin||0,paddingLeft:s.paddingLeft||s.paddingX||s.padding||0,paddingRight:s.paddingRight||s.paddingX||s.padding||0,paddingTop:s.paddingTop||s.paddingY||s.padding||0,paddingBottom:s.paddingBottom||s.paddingY||s.padding||0});return G1e.default.createElement(\"ink-box\",{ref:e,style:a},r)});xW.displayName=\"Box\";xW.defaultProps={flexDirection:\"row\",flexGrow:0,flexShrink:1};rf.default=xW});var TW=_(nD=>{\"use strict\";var kW=nD&&nD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nD,\"__esModule\",{value:!0});var jht=kW(hn()),yw=kW(TE()),q1e=kW(AW()),QW=({color:t,backgroundColor:e,dimColor:r,bold:s,italic:a,underline:n,strikethrough:c,inverse:f,wrap:p,children:h})=>{if(h==null)return null;let E=C=>(r&&(C=yw.default.dim(C)),t&&(C=q1e.default(C,t,\"foreground\")),e&&(C=q1e.default(C,e,\"background\")),s&&(C=yw.default.bold(C)),a&&(C=yw.default.italic(C)),n&&(C=yw.default.underline(C)),c&&(C=yw.default.strikethrough(C)),f&&(C=yw.default.inverse(C)),C);return jht.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\",textWrap:p},internal_transform:E},h)};QW.displayName=\"Text\";QW.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:\"wrap\"};nD.default=QW});var J1e=_(nf=>{\"use strict\";var Ght=nf&&nf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),qht=nf&&nf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wht=nf&&nf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&Ght(e,t,r);return qht(e,t),e},iD=nf&&nf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nf,\"__esModule\",{value:!0});var W1e=Wht(Ie(\"fs\")),Qs=iD(hn()),Y1e=iD(M1e()),Yht=iD(j1e()),$p=iD(HF()),AA=iD(TW()),V1e=new Y1e.default({cwd:process.cwd(),internals:Y1e.default.nodeInternals()}),Vht=({error:t})=>{let e=t.stack?t.stack.split(`\n`).slice(1):void 0,r=e?V1e.parseLine(e[0]):void 0,s,a=0;if(r?.file&&r?.line&&W1e.existsSync(r.file)){let n=W1e.readFileSync(r.file,\"utf8\");if(s=Yht.default(n,r.line),s)for(let{line:c}of s)a=Math.max(a,String(c).length)}return Qs.default.createElement($p.default,{flexDirection:\"column\",padding:1},Qs.default.createElement($p.default,null,Qs.default.createElement(AA.default,{backgroundColor:\"red\",color:\"white\"},\" \",\"ERROR\",\" \"),Qs.default.createElement(AA.default,null,\" \",t.message)),r&&Qs.default.createElement($p.default,{marginTop:1},Qs.default.createElement(AA.default,{dimColor:!0},r.file,\":\",r.line,\":\",r.column)),r&&s&&Qs.default.createElement($p.default,{marginTop:1,flexDirection:\"column\"},s.map(({line:n,value:c})=>Qs.default.createElement($p.default,{key:n},Qs.default.createElement($p.default,{width:a+1},Qs.default.createElement(AA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?\"red\":void 0,color:n===r.line?\"white\":void 0},String(n).padStart(a,\" \"),\":\")),Qs.default.createElement(AA.default,{key:n,backgroundColor:n===r.line?\"red\":void 0,color:n===r.line?\"white\":void 0},\" \"+c)))),t.stack&&Qs.default.createElement($p.default,{marginTop:1,flexDirection:\"column\"},t.stack.split(`\n`).slice(1).map(n=>{let c=V1e.parseLine(n);return c?Qs.default.createElement($p.default,{key:n},Qs.default.createElement(AA.default,{dimColor:!0},\"- \"),Qs.default.createElement(AA.default,{dimColor:!0,bold:!0},c.function),Qs.default.createElement(AA.default,{dimColor:!0,color:\"gray\"},\" \",\"(\",c.file,\":\",c.line,\":\",c.column,\")\")):Qs.default.createElement($p.default,{key:n},Qs.default.createElement(AA.default,{dimColor:!0},\"- \"),Qs.default.createElement(AA.default,{dimColor:!0,bold:!0},n))})))};nf.default=Vht});var z1e=_(sf=>{\"use strict\";var Jht=sf&&sf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Kht=sf&&sf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zht=sf&&sf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&Jht(e,t,r);return Kht(e,t),e},Lm=sf&&sf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sf,\"__esModule\",{value:!0});var Om=zht(hn()),K1e=Lm(F9()),Xht=Lm(IW()),Zht=Lm(wW()),$ht=Lm(vW()),e0t=Lm(DW()),t0t=Lm(_F()),r0t=Lm(J1e()),n0t=\"\t\",i0t=\"\\x1B[Z\",s0t=\"\\x1B\",jF=class extends Om.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding(\"utf8\"),e){this.rawModeEnabledCount===0&&(r.addListener(\"data\",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener(\"data\",this.handleInput),r.pause())},this.handleInput=e=>{e===\"\u0003\"&&this.props.exitOnCtrlC&&this.handleExit(),e===s0t&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===n0t&&this.focusNext(),e===i0t&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=e=>{this.setState(r=>r.focusables.some(a=>a?.id===e)?{activeFocusId:e}:r)},this.focusNext=()=>{this.setState(e=>{var r;let s=(r=e.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(e)||s}})},this.focusPrevious=()=>{this.setState(e=>{var r;let s=(r=e.focusables[e.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(e)||s}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(s=>{let a=s.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...s.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(s=>s.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s+1;a<e.focusables.length;a++)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id},this.findPreviousFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s-1;a>=0;a--)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return Om.default.createElement(Xht.default.Provider,{value:{exit:this.handleExit}},Om.default.createElement(Zht.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},Om.default.createElement($ht.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},Om.default.createElement(e0t.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},Om.default.createElement(t0t.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?Om.default.createElement(r0t.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){K1e.default.hide(this.props.stdout)}componentWillUnmount(){K1e.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};sf.default=jF;jF.displayName=\"InternalApp\"});var $1e=_(of=>{\"use strict\";var o0t=of&&of.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),a0t=of&&of.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),l0t=of&&of.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&o0t(e,t,r);return a0t(e,t),e},af=of&&of.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(of,\"__esModule\",{value:!0});var c0t=af(hn()),X1e=WCe(),u0t=af(awe()),f0t=af(x9()),A0t=af(pwe()),p0t=af(gwe()),RW=af(a1e()),h0t=af(B1e()),g0t=af(R9()),d0t=af(b1e()),m0t=l0t(uW()),y0t=af(yW()),E0t=af(z1e()),Ew=process.env.CI===\"false\"?!1:A0t.default,Z1e=()=>{},FW=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:s,staticOutput:a}=h0t.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==`\n`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(Ew){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(f0t.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},p0t.default(this),this.options=e,this.rootNode=m0t.createNode(\"ink-root\"),this.rootNode.onRender=e.debug?this.onRender:X1e(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=u0t.default.create(e.stdout),this.throttledLog=e.debug?this.log:X1e(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput=\"\",this.fullStaticOutput=\"\",this.container=RW.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=g0t.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),Ew||(e.stdout.on(\"resize\",this.onRender),this.unsubscribeResize=()=>{e.stdout.off(\"resize\",this.onRender)})}render(e){let r=c0t.default.createElement(E0t.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);RW.default.updateContainer(r,this.container,null,Z1e)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(Ew){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Ew){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==\"function\"&&this.restoreConsole(),typeof this.unsubscribeResize==\"function\"&&this.unsubscribeResize(),Ew?this.options.stdout.write(this.lastOutput+`\n`):this.options.debug||this.log.done(),this.isUnmounted=!0,RW.default.updateContainer(null,this.container,null,Z1e),y0t.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!Ew&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=d0t.default((e,r)=>{e===\"stdout\"&&this.writeToStdout(r),e===\"stderr\"&&(r.startsWith(\"The above error occurred\")||this.writeToStderr(r))}))}};of.default=FW});var t2e=_(sD=>{\"use strict\";var e2e=sD&&sD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sD,\"__esModule\",{value:!0});var I0t=e2e($1e()),GF=e2e(yW()),C0t=Ie(\"stream\"),w0t=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},B0t(e)),s=v0t(r.stdout,()=>new I0t.default(r));return s.render(t),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>GF.default.delete(r.stdout),clear:s.clear}};sD.default=w0t;var B0t=(t={})=>t instanceof C0t.Stream?{stdout:t,stdin:process.stdin}:t,v0t=(t,e)=>{let r;return GF.default.has(t)?r=GF.default.get(t):(r=e(),GF.default.set(t,r)),r}});var n2e=_(eh=>{\"use strict\";var S0t=eh&&eh.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),D0t=eh&&eh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b0t=eh&&eh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&S0t(e,t,r);return D0t(e,t),e};Object.defineProperty(eh,\"__esModule\",{value:!0});var oD=b0t(hn()),r2e=t=>{let{items:e,children:r,style:s}=t,[a,n]=oD.useState(0),c=oD.useMemo(()=>e.slice(a),[e,a]);oD.useLayoutEffect(()=>{n(e.length)},[e.length]);let f=c.map((h,E)=>r(h,a+E)),p=oD.useMemo(()=>Object.assign({position:\"absolute\",flexDirection:\"column\"},s),[s]);return oD.default.createElement(\"ink-box\",{internal_static:!0,style:p},f)};r2e.displayName=\"Static\";eh.default=r2e});var s2e=_(aD=>{\"use strict\";var P0t=aD&&aD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aD,\"__esModule\",{value:!0});var x0t=P0t(hn()),i2e=({children:t,transform:e})=>t==null?null:x0t.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\"},internal_transform:e},t);i2e.displayName=\"Transform\";aD.default=i2e});var a2e=_(lD=>{\"use strict\";var k0t=lD&&lD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lD,\"__esModule\",{value:!0});var Q0t=k0t(hn()),o2e=({count:t=1})=>Q0t.default.createElement(\"ink-text\",null,`\n`.repeat(t));o2e.displayName=\"Newline\";lD.default=o2e});var u2e=_(cD=>{\"use strict\";var l2e=cD&&cD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cD,\"__esModule\",{value:!0});var T0t=l2e(hn()),R0t=l2e(HF()),c2e=()=>T0t.default.createElement(R0t.default,{flexGrow:1});c2e.displayName=\"Spacer\";cD.default=c2e});var qF=_(uD=>{\"use strict\";var F0t=uD&&uD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uD,\"__esModule\",{value:!0});var N0t=hn(),O0t=F0t(wW()),L0t=()=>N0t.useContext(O0t.default);uD.default=L0t});var A2e=_(fD=>{\"use strict\";var M0t=fD&&fD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fD,\"__esModule\",{value:!0});var f2e=hn(),U0t=M0t(qF()),_0t=(t,e={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=U0t.default();f2e.useEffect(()=>{if(e.isActive!==!1)return s(!0),()=>{s(!1)}},[e.isActive,s]),f2e.useEffect(()=>{if(e.isActive===!1)return;let n=c=>{let f=String(c),p={upArrow:f===\"\\x1B[A\",downArrow:f===\"\\x1B[B\",leftArrow:f===\"\\x1B[D\",rightArrow:f===\"\\x1B[C\",pageDown:f===\"\\x1B[6~\",pageUp:f===\"\\x1B[5~\",return:f===\"\\r\",escape:f===\"\\x1B\",ctrl:!1,shift:!1,tab:f===\"\t\"||f===\"\\x1B[Z\",backspace:f===\"\\b\",delete:f===\"\\x7F\"||f===\"\\x1B[3~\",meta:!1};f<=\"\u001a\"&&!p.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),p.ctrl=!0),f.startsWith(\"\\x1B\")&&(f=f.slice(1),p.meta=!0);let h=f>=\"A\"&&f<=\"Z\",E=f>=\"\\u0410\"&&f<=\"\\u042F\";f.length===1&&(h||E)&&(p.shift=!0),p.tab&&f===\"[Z\"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(f=\"\"),(!(f===\"c\"&&p.ctrl)||!a)&&t(f,p)};return r?.on(\"data\",n),()=>{r?.off(\"data\",n)}},[e.isActive,r,a,t])};fD.default=_0t});var p2e=_(AD=>{\"use strict\";var H0t=AD&&AD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AD,\"__esModule\",{value:!0});var j0t=hn(),G0t=H0t(IW()),q0t=()=>j0t.useContext(G0t.default);AD.default=q0t});var h2e=_(pD=>{\"use strict\";var W0t=pD&&pD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pD,\"__esModule\",{value:!0});var Y0t=hn(),V0t=W0t(vW()),J0t=()=>Y0t.useContext(V0t.default);pD.default=J0t});var g2e=_(hD=>{\"use strict\";var K0t=hD&&hD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hD,\"__esModule\",{value:!0});var z0t=hn(),X0t=K0t(DW()),Z0t=()=>z0t.useContext(X0t.default);hD.default=Z0t});var m2e=_(dD=>{\"use strict\";var d2e=dD&&dD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dD,\"__esModule\",{value:!0});var gD=hn(),$0t=d2e(_F()),egt=d2e(qF()),tgt=({isActive:t=!0,autoFocus:e=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=egt.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=gD.useContext($0t.default),C=gD.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return gD.useEffect(()=>(c(C,{autoFocus:e}),()=>{f(C)}),[C,e]),gD.useEffect(()=>{t?p(C):h(C)},[t,C]),gD.useEffect(()=>{if(!(!s||!t))return a(!0),()=>{a(!1)}},[t]),{isFocused:!!C&&n===C,focus:E}};dD.default=tgt});var y2e=_(mD=>{\"use strict\";var rgt=mD&&mD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mD,\"__esModule\",{value:!0});var ngt=hn(),igt=rgt(_F()),sgt=()=>{let t=ngt.useContext(igt.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious,focus:t.focus}};mD.default=sgt});var E2e=_(NW=>{\"use strict\";Object.defineProperty(NW,\"__esModule\",{value:!0});NW.default=t=>{var e,r,s,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=t.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var Wc=_(mo=>{\"use strict\";Object.defineProperty(mo,\"__esModule\",{value:!0});var ogt=t2e();Object.defineProperty(mo,\"render\",{enumerable:!0,get:function(){return ogt.default}});var agt=HF();Object.defineProperty(mo,\"Box\",{enumerable:!0,get:function(){return agt.default}});var lgt=TW();Object.defineProperty(mo,\"Text\",{enumerable:!0,get:function(){return lgt.default}});var cgt=n2e();Object.defineProperty(mo,\"Static\",{enumerable:!0,get:function(){return cgt.default}});var ugt=s2e();Object.defineProperty(mo,\"Transform\",{enumerable:!0,get:function(){return ugt.default}});var fgt=a2e();Object.defineProperty(mo,\"Newline\",{enumerable:!0,get:function(){return fgt.default}});var Agt=u2e();Object.defineProperty(mo,\"Spacer\",{enumerable:!0,get:function(){return Agt.default}});var pgt=A2e();Object.defineProperty(mo,\"useInput\",{enumerable:!0,get:function(){return pgt.default}});var hgt=p2e();Object.defineProperty(mo,\"useApp\",{enumerable:!0,get:function(){return hgt.default}});var ggt=qF();Object.defineProperty(mo,\"useStdin\",{enumerable:!0,get:function(){return ggt.default}});var dgt=h2e();Object.defineProperty(mo,\"useStdout\",{enumerable:!0,get:function(){return dgt.default}});var mgt=g2e();Object.defineProperty(mo,\"useStderr\",{enumerable:!0,get:function(){return mgt.default}});var ygt=m2e();Object.defineProperty(mo,\"useFocus\",{enumerable:!0,get:function(){return ygt.default}});var Egt=y2e();Object.defineProperty(mo,\"useFocusManager\",{enumerable:!0,get:function(){return Egt.default}});var Igt=E2e();Object.defineProperty(mo,\"measureElement\",{enumerable:!0,get:function(){return Igt.default}})});var LW={};Vt(LW,{Gem:()=>OW});var I2e,Mm,OW,WF=Xe(()=>{I2e=ut(Wc()),Mm=ut(hn()),OW=(0,Mm.memo)(({active:t})=>{let e=(0,Mm.useMemo)(()=>t?\"\\u25C9\":\"\\u25EF\",[t]),r=(0,Mm.useMemo)(()=>t?\"green\":\"yellow\",[t]);return Mm.default.createElement(I2e.Text,{color:r},e)})});var w2e={};Vt(w2e,{useKeypress:()=>Um});function Um({active:t},e,r){let{stdin:s}=(0,C2e.useStdin)(),a=(0,YF.useCallback)((n,c)=>e(n,c),r);(0,YF.useEffect)(()=>{if(!(!t||!s))return s.on(\"keypress\",a),()=>{s.off(\"keypress\",a)}},[t,a,s])}var C2e,YF,yD=Xe(()=>{C2e=ut(Wc()),YF=ut(hn())});var v2e={};Vt(v2e,{FocusRequest:()=>B2e,useFocusRequest:()=>MW});var B2e,MW,UW=Xe(()=>{yD();B2e=(r=>(r.BEFORE=\"before\",r.AFTER=\"after\",r))(B2e||{}),MW=function({active:t},e,r){Um({active:t},(s,a)=>{a.name===\"tab\"&&(a.shift?e(\"before\"):e(\"after\"))},r)}});var S2e={};Vt(S2e,{useListInput:()=>ED});var ED,VF=Xe(()=>{yD();ED=function(t,e,{active:r,minus:s,plus:a,set:n,loop:c=!0}){Um({active:r},(f,p)=>{let h=e.indexOf(t);switch(p.name){case s:{let E=h-1;if(c){n(e[(e.length+E)%e.length]);return}if(E<0)return;n(e[E])}break;case a:{let E=h+1;if(c){n(e[E%e.length]);return}if(E>=e.length)return;n(e[E])}break}},[e,t,a,n,c])}});var JF={};Vt(JF,{ScrollableItems:()=>Cgt});var eg,dl,Cgt,KF=Xe(()=>{eg=ut(Wc()),dl=ut(hn());UW();VF();Cgt=({active:t=!0,children:e=[],radius:r=10,size:s=1,loop:a=!0,onFocusRequest:n,willReachEnd:c})=>{let f=N=>{if(N.key===null)throw new Error(\"Expected all children to have a key\");return N.key},p=dl.default.Children.map(e,N=>f(N)),h=p[0],[E,C]=(0,dl.useState)(h),S=p.indexOf(E);(0,dl.useEffect)(()=>{p.includes(E)||C(h)},[e]),(0,dl.useEffect)(()=>{c&&S>=p.length-2&&c()},[S]),MW({active:t&&!!n},N=>{n?.(N)},[n]),ED(E,p,{active:t,minus:\"up\",plus:\"down\",set:C,loop:a});let P=S-r,I=S+r;I>p.length&&(P-=I-p.length,I=p.length),P<0&&(I+=-P,P=0),I>=p.length&&(I=p.length-1);let R=[];for(let N=P;N<=I;++N){let U=p[N],W=t&&U===E;R.push(dl.default.createElement(eg.Box,{key:U,height:s},dl.default.createElement(eg.Box,{marginLeft:1,marginRight:1},dl.default.createElement(eg.Text,null,W?dl.default.createElement(eg.Text,{color:\"cyan\",bold:!0},\">\"):\" \")),dl.default.createElement(eg.Box,null,dl.default.cloneElement(e[N],{active:W}))))}return dl.default.createElement(eg.Box,{flexDirection:\"column\",width:\"100%\"},R)}});var D2e,th,b2e,_W,P2e,HW=Xe(()=>{D2e=ut(Wc()),th=ut(hn()),b2e=Ie(\"readline\"),_W=th.default.createContext(null),P2e=({children:t})=>{let{stdin:e,setRawMode:r}=(0,D2e.useStdin)();(0,th.useEffect)(()=>{r&&r(!0),e&&(0,b2e.emitKeypressEvents)(e)},[e,r]);let[s,a]=(0,th.useState)(new Map),n=(0,th.useMemo)(()=>({getAll:()=>s,get:c=>s.get(c),set:(c,f)=>a(new Map([...s,[c,f]]))}),[s,a]);return th.default.createElement(_W.Provider,{value:n,children:t})}});var jW={};Vt(jW,{useMinistore:()=>wgt});function wgt(t,e){let r=(0,zF.useContext)(_W);if(r===null)throw new Error(\"Expected this hook to run with a ministore context attached\");if(typeof t>\"u\")return r.getAll();let s=(0,zF.useCallback)(n=>{r.set(t,n)},[t,r.set]),a=r.get(t);return typeof a>\"u\"&&(a=e),[a,s]}var zF,GW=Xe(()=>{zF=ut(hn());HW()});var ZF={};Vt(ZF,{renderForm:()=>Bgt});async function Bgt(t,e,{stdin:r,stdout:s,stderr:a}){let n,c=p=>{let{exit:h}=(0,XF.useApp)();Um({active:!0},(E,C)=>{C.name===\"return\"&&(n=p,h())},[h,p])},{waitUntilExit:f}=(0,XF.render)(qW.default.createElement(P2e,null,qW.default.createElement(t,{...e,useSubmit:c})),{stdin:r,stdout:s,stderr:a});return await f(),n}var XF,qW,$F=Xe(()=>{XF=ut(Wc()),qW=ut(hn());HW();yD()});var T2e=_(ID=>{\"use strict\";Object.defineProperty(ID,\"__esModule\",{value:!0});ID.UncontrolledTextInput=void 0;var k2e=hn(),WW=hn(),x2e=Wc(),_m=TE(),Q2e=({value:t,placeholder:e=\"\",focus:r=!0,mask:s,highlightPastedText:a=!1,showCursor:n=!0,onChange:c,onSubmit:f})=>{let[{cursorOffset:p,cursorWidth:h},E]=WW.useState({cursorOffset:(t||\"\").length,cursorWidth:0});WW.useEffect(()=>{E(R=>{if(!r||!n)return R;let N=t||\"\";return R.cursorOffset>N.length-1?{cursorOffset:N.length,cursorWidth:0}:R})},[t,r,n]);let C=a?h:0,S=s?s.repeat(t.length):t,P=S,I=e?_m.grey(e):void 0;if(n&&r){I=e.length>0?_m.inverse(e[0])+_m.grey(e.slice(1)):_m.inverse(\" \"),P=S.length>0?\"\":_m.inverse(\" \");let R=0;for(let N of S)R>=p-C&&R<=p?P+=_m.inverse(N):P+=N,R++;S.length>0&&p===S.length&&(P+=_m.inverse(\" \"))}return x2e.useInput((R,N)=>{if(N.upArrow||N.downArrow||N.ctrl&&R===\"c\"||N.tab||N.shift&&N.tab)return;if(N.return){f&&f(t);return}let U=p,W=t,ee=0;N.leftArrow?n&&U--:N.rightArrow?n&&U++:N.backspace||N.delete?p>0&&(W=t.slice(0,p-1)+t.slice(p,t.length),U--):(W=t.slice(0,p)+R+t.slice(p,t.length),U+=R.length,R.length>1&&(ee=R.length)),p<0&&(U=0),p>t.length&&(U=t.length),E({cursorOffset:U,cursorWidth:ee}),W!==t&&c(W)},{isActive:r}),k2e.createElement(x2e.Text,null,e?S.length>0?P:I:P)};ID.default=Q2e;ID.UncontrolledTextInput=({initialValue:t=\"\",...e})=>{let[r,s]=WW.useState(t);return k2e.createElement(Q2e,Object.assign({},e,{value:r,onChange:s}))}});var N2e={};Vt(N2e,{Pad:()=>YW});var R2e,F2e,YW,VW=Xe(()=>{R2e=ut(Wc()),F2e=ut(hn()),YW=({length:t,active:e})=>{if(t===0)return null;let r=t>1?` ${\"-\".repeat(t-1)}`:\" \";return F2e.default.createElement(R2e.Text,{dimColor:!e},r)}});var O2e={};Vt(O2e,{ItemOptions:()=>vgt});var wD,tg,vgt,L2e=Xe(()=>{wD=ut(Wc()),tg=ut(hn());VF();WF();VW();vgt=function({active:t,skewer:e,options:r,value:s,onChange:a,sizes:n=[]}){let c=r.filter(({label:p})=>!!p).map(({value:p})=>p),f=r.findIndex(p=>p.value===s&&p.label!=\"\");return ED(s,c,{active:t,minus:\"left\",plus:\"right\",set:a}),tg.default.createElement(tg.default.Fragment,null,r.map(({label:p},h)=>{let E=h===f,C=n[h]-1||0,S=p.replace(/[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\"\"),P=Math.max(0,C-S.length-2);return p?tg.default.createElement(wD.Box,{key:p,width:C,marginLeft:1},tg.default.createElement(wD.Text,{wrap:\"truncate\"},tg.default.createElement(OW,{active:E}),\" \",p),e?tg.default.createElement(YW,{active:t,length:P}):null):tg.default.createElement(wD.Box,{key:`spacer-${h}`,width:C,marginLeft:1})}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ei8ztHJ0dmOZOOIh+T4pePnl64AXRiO/N0yCNNHZNYVLd8iXyVfBjcqW6ihDQZZOJOPf+XEwy9lYUJZTZ/FGc+IpfkXeYlM4zrjrpjSwqjMdXwiT5GTK2up+AFUH7CC0WESZcNZLXcjFRuI/XQTHh0z4Nq/e38fbv7BV4kVhOWUunfwFU7fPLsvWpgVy3/pfVawHdNTRJH9tazLoblV/NDtmypiNuiQaEok4V4pZI4XLeMIofh3Uv4ZkVlSBVhlAOHEd0H0jiBazhAbMyg7xscTo1/ZBY14ZnvF1Tjepad282nsQfcwDvIGv8nvmOdOvtf99H4GtPhNA5SKQrRnsgxYNZb9eeqx8thAf9Diw/QBUXbhHu4bB6eSYyFGFD3JxBvOBSWXNnUqsKuwLXoIcAbuE7s25MQHrQoSWuw/AklHFvcXEQodRBqjvYnQPjM0cWW9dbguGovmVf0ncdmPUJti5L4GQfTJH+U1x7vII7T3VWtu9pwdAwPB8Lj+v+cDh5vTjOvtbqJ17n+JhTpuj3DIKjI3xWrRXnom6zv/9neYg4H7CEvf0/Qu0OsPHo3OcaVbncU/7ru6MOHKxdyjIlJzjWV398Xqzry9np1Yj4SqnuOz5WypqTsrv7FSWPCWZjlp0Oqb4+1wcft0yIHShagyc0G4PsKWZJTzOUQCbXrybrV1DP78JdXSBu73hBT8wlTtND+iHyNaBsN/sKNUtkCUcnuvLZu4Nv2l7/J/WRZel3F8H\",\"base64\")).toString()),iY)});var EBe=_((LZt,yBe)=>{var pY=Symbol(\"arg flag\"),Yc=class t extends Error{constructor(e,r){super(e),this.name=\"ArgError\",this.code=r,Object.setPrototypeOf(this,t.prototype)}};function UD(t,{argv:e=process.argv.slice(2),permissive:r=!1,stopAtPositional:s=!1}={}){if(!t)throw new Yc(\"argument specification object is required\",\"ARG_CONFIG_NO_SPEC\");let a={_:[]},n={},c={};for(let f of Object.keys(t)){if(!f)throw new Yc(\"argument key cannot be an empty string\",\"ARG_CONFIG_EMPTY_KEY\");if(f[0]!==\"-\")throw new Yc(`argument key must start with '-' but found: '${f}'`,\"ARG_CONFIG_NONOPT_KEY\");if(f.length===1)throw new Yc(`argument key must have a name; singular '-' keys are not allowed: ${f}`,\"ARG_CONFIG_NONAME_KEY\");if(typeof t[f]==\"string\"){n[f]=t[f];continue}let p=t[f],h=!1;if(Array.isArray(p)&&p.length===1&&typeof p[0]==\"function\"){let[E]=p;p=(C,S,P=[])=>(P.push(E(C,S,P[P.length-1])),P),h=E===Boolean||E[pY]===!0}else if(typeof p==\"function\")h=p===Boolean||p[pY]===!0;else throw new Yc(`type missing or not a function or valid array type: ${f}`,\"ARG_CONFIG_VAD_TYPE\");if(f[1]!==\"-\"&&f.length>2)throw new Yc(`short argument keys (with a single hyphen) must have only one character: ${f}`,\"ARG_CONFIG_SHORTOPT_TOOLONG\");c[f]=[p,h]}for(let f=0,p=e.length;f<p;f++){let h=e[f];if(s&&a._.length>0){a._=a._.concat(e.slice(f));break}if(h===\"--\"){a._=a._.concat(e.slice(f+1));break}if(h.length>1&&h[0]===\"-\"){let E=h[1]===\"-\"||h.length===2?[h]:h.slice(1).split(\"\").map(C=>`-${C}`);for(let C=0;C<E.length;C++){let S=E[C],[P,I]=S[1]===\"-\"?S.split(/=(.*)/,2):[S,void 0],R=P;for(;R in n;)R=n[R];if(!(R in c))if(r){a._.push(S);continue}else throw new Yc(`unknown or unexpected option: ${P}`,\"ARG_UNKNOWN_OPTION\");let[N,U]=c[R];if(!U&&C+1<E.length)throw new Yc(`option requires argument (but was followed by another short argument): ${P}`,\"ARG_MISSING_REQUIRED_SHORTARG\");if(U)a[R]=N(!0,R,a[R]);else if(I===void 0){if(e.length<f+2||e[f+1].length>1&&e[f+1][0]===\"-\"&&!(e[f+1].match(/^-?\\d*(\\.(?=\\d))?\\d*$/)&&(N===Number||typeof BigInt<\"u\"&&N===BigInt))){let W=P===R?\"\":` (alias for ${R})`;throw new Yc(`option requires argument: ${P}${W}`,\"ARG_MISSING_REQUIRED_LONGARG\")}a[R]=N(e[f+1],R,a[R]),++f}else a[R]=N(I,R,a[R])}}else a._.push(h)}return a}UD.flag=t=>(t[pY]=!0,t);UD.COUNT=UD.flag((t,e,r)=>(r||0)+1);UD.ArgError=Yc;yBe.exports=UD});var bBe=_((p$t,DBe)=>{var mY;DBe.exports=()=>(typeof mY>\"u\"&&(mY=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"W7YZIYpg4/ADhvxMjEQIGwcAGt8pgGWBbYj0o7UviYayJiw3vPFeTWWzdDZyI4g/zgB3ckSMeng+3aqqyQXxrRke/8Sqq0wDa5K1CuJ/ezX/3z9fZ50Gk2s5pcrpxSnVo3lixZWXGAHDxdl15uF/qnNnmbDSZHOomC6KSBu2bPKR50q1+UC6iJWq1rOp1jRMYxXuzFYYDpzTV4Je9yHEA03SbVpbvGIj/FQJeL7mh66qm3q9nguUEq1qZdc5Bn12j6J2/kKrr2lzEef375uWG0mAuCZIlekoidc4xutCHUUBu+q+d8U26Bl0A9ACxME4cD051ryqev+hu9GDRYNcCVxyjXWRjAtdFk8QbxhxKJvFUmkvPyEM1vBe/pU5naPXNGFth1H+DrZxgMyxYUJtZhbCaRtLz27ruqft3aYkgfCKiCF2X2y+j35IelDY2sSHrMOWZSUQ/ub3Y5mPrFirEXvpHAx4f9Rs/55yglK8C2Wx18DfjESbpWL5Uxafo02ms1ZJqz/dtngtnMql1YJ+v71s08jzoZlHGNE7NvPPiEXF3le+xheXLcUhOThn/6HG0jL516CHg6SeKYP/iC4fUokGT71K5LM7212ZyHT2QzO2dMJGJ1tpT7XjAjQYVWBIR2RJBjCjJxuzntxFq6x96E/kH0A/snZ/1w3kBnPChH8d4GdAjrG0oDZrAfb/C4KgIV+fEmjqxTLdJnB4PF7VGbJgQxu7OPuYJkVxZ7Bi+rub4dQCXGP+EAZk/mUFvUvi4pxd/N0U/HHhuh3F4lj5iO6bVyhvIQyNSyZRtBrzQOMO7JFSRbHsfiNEDB8IXTG4CSDMi3KKtNtQqRCwbDtpfUezkpqP+JuqmwsuZcL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FJi1+ndJekdhnWAhnveiA6icBgsxQzkEVrAjZALn3tw/1UmTqKt8m1OdOY/v38fB3j4mcnBX2rrU1uGtLz+9jTF4/o6Ytlk4O5NiiyTKBCLOwKP7HhZqG1fQnBYtxks9dVZRHYDpVvtIokwERT7NPeSwnKqAWGHxPsiAL6YvVI+BBMtunYk+99NOWWtyiadeaGwCbDFz+OFqnQM9GPHlQ5/Lnt3tnrRWyXyaR/4mO/E/fv65K911gFohqGSVGLnzgM71eBIw8LF2+BLqq+mPqi8ovIVdliBIwN+MDY4zKOxfyM4zPjWIdHsZM19d1SrB7nmiLRA8+AP2XBcFaAm6B/sJ2iJA8=\",\"base64\")).toString()),mY)});var TBe=_((BY,vY)=>{(function(t){BY&&typeof BY==\"object\"&&typeof vY<\"u\"?vY.exports=t():typeof define==\"function\"&&define.amd?define([],t):typeof window<\"u\"?window.isWindows=t():typeof global<\"u\"?global.isWindows=t():typeof self<\"u\"?self.isWindows=t():this.isWindows=t()})(function(){\"use strict\";return function(){return process&&(process.platform===\"win32\"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var OBe=_((fer,NBe)=>{\"use strict\";SY.ifExists=Sdt;var Dw=Ie(\"util\"),Vc=Ie(\"path\"),RBe=TBe(),wdt=/^#!\\s*(?:\\/usr\\/bin\\/env)?\\s*([^ \\t]+)(.*)$/,Bdt={createPwshFile:!0,createCmdFile:RBe(),fs:Ie(\"fs\")},vdt=new Map([[\".js\",\"node\"],[\".cjs\",\"node\"],[\".mjs\",\"node\"],[\".cmd\",\"cmd\"],[\".bat\",\"cmd\"],[\".ps1\",\"pwsh\"],[\".sh\",\"sh\"]]);function FBe(t){let e={...Bdt,...t},r=e.fs;return e.fs_={chmod:r.chmod?Dw.promisify(r.chmod):async()=>{},mkdir:Dw.promisify(r.mkdir),readFile:Dw.promisify(r.readFile),stat:Dw.promisify(r.stat),unlink:Dw.promisify(r.unlink),writeFile:Dw.promisify(r.writeFile)},e}async function SY(t,e,r){let s=FBe(r);await s.fs_.stat(t),await bdt(t,e,s)}function Sdt(t,e,r){return SY(t,e,r).catch(()=>{})}function Ddt(t,e){return e.fs_.unlink(t).catch(()=>{})}async function bdt(t,e,r){let s=await Tdt(t,r);return await Pdt(e,r),xdt(t,e,s,r)}function Pdt(t,e){return e.fs_.mkdir(Vc.dirname(t),{recursive:!0})}function xdt(t,e,r,s){let a=FBe(s),n=[{generator:Ndt,extension:\"\"}];return a.createCmdFile&&n.push({generator:Fdt,extension:\".cmd\"}),a.createPwshFile&&n.push({generator:Odt,extension:\".ps1\"}),Promise.all(n.map(c=>Rdt(t,e+c.extension,r,c.generator,a)))}function kdt(t,e){return Ddt(t,e)}function Qdt(t,e){return Ldt(t,e)}async function Tdt(t,e){let a=(await e.fs_.readFile(t,\"utf8\")).trim().split(/\\r*\\n/)[0].match(wdt);if(!a){let n=Vc.extname(t).toLowerCase();return{program:vdt.get(n)||null,additionalArgs:\"\"}}return{program:a[1],additionalArgs:a[2]}}async function Rdt(t,e,r,s,a){let n=a.preserveSymlinks?\"--preserve-symlinks\":\"\",c=[r.additionalArgs,n].filter(f=>f).join(\" \");return a=Object.assign({},a,{prog:r.program,args:c}),await kdt(e,a),await a.fs_.writeFile(e,s(t,e,a),\"utf8\"),Qdt(e,a)}function Fdt(t,e,r){let a=Vc.relative(Vc.dirname(e),t).split(\"/\").join(\"\\\\\"),n=Vc.isAbsolute(a)?`\"${a}\"`:`\"%~dp0\\\\${a}\"`,c,f=r.prog,p=r.args||\"\",h=DY(r.nodePath).win32;f?(c=`\"%~dp0\\\\${f}.exe\"`,a=n):(f=n,p=\"\",a=\"\");let E=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",C=h?`@SET NODE_PATH=${h}\\r\n`:\"\";return c?C+=`@IF EXIST ${c} (\\r\n  ${c} ${p} ${a} ${E}%*\\r\n) ELSE (\\r\n  @SETLOCAL\\r\n  @SET PATHEXT=%PATHEXT:;.JS;=;%\\r\n  ${f} ${p} ${a} ${E}%*\\r\n)\\r\n`:C+=`@${f} ${p} ${a} ${E}%*\\r\n`,C}function Ndt(t,e,r){let s=Vc.relative(Vc.dirname(e),t),a=r.prog&&r.prog.split(\"\\\\\").join(\"/\"),n;s=s.split(\"\\\\\").join(\"/\");let c=Vc.isAbsolute(s)?`\"${s}\"`:`\"$basedir/${s}\"`,f=r.args||\"\",p=DY(r.nodePath).posix;a?(n=`\"$basedir/${r.prog}\"`,s=c):(a=c,f=\"\",s=\"\");let h=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",E=`#!/bin/sh\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\\\\\,/,g')\")\n\ncase \\`uname\\` in\n    *CYGWIN*) basedir=\\`cygpath -w \"$basedir\"\\`;;\nesac\n\n`,C=r.nodePath?`export NODE_PATH=\"${p}\"\n`:\"\";return n?E+=`${C}if [ -x ${n} ]; then\n  exec ${n} ${f} ${s} ${h}\"$@\"\nelse\n  exec ${a} ${f} ${s} ${h}\"$@\"\nfi\n`:E+=`${C}${a} ${f} ${s} ${h}\"$@\"\nexit $?\n`,E}function Odt(t,e,r){let s=Vc.relative(Vc.dirname(e),t),a=r.prog&&r.prog.split(\"\\\\\").join(\"/\"),n=a&&`\"${a}$exe\"`,c;s=s.split(\"\\\\\").join(\"/\");let f=Vc.isAbsolute(s)?`\"${s}\"`:`\"$basedir/${s}\"`,p=r.args||\"\",h=DY(r.nodePath),E=h.win32,C=h.posix;n?(c=`\"$basedir/${r.prog}$exe\"`,s=f):(n=f,p=\"\",s=\"\");let S=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",P=`#!/usr/bin/env pwsh\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n\n$exe=\"\"\n${r.nodePath?`$env_node_path=$env:NODE_PATH\n$env:NODE_PATH=\"${E}\"\n`:\"\"}if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n  # Fix case when both the Windows and Linux builds of Node\n  # are installed in the same directory\n  $exe=\".exe\"\n}`;return r.nodePath&&(P+=` else {\n  $env:NODE_PATH=\"${C}\"\n}`),c?P+=`\n$ret=0\nif (Test-Path ${c}) {\n  # Support pipeline input\n  if ($MyInvocation.ExpectingInput) {\n    $input | & ${c} ${p} ${s} ${S}$args\n  } else {\n    & ${c} ${p} ${s} ${S}$args\n  }\n  $ret=$LASTEXITCODE\n} else {\n  # Support pipeline input\n  if ($MyInvocation.ExpectingInput) {\n    $input | & ${n} ${p} ${s} ${S}$args\n  } else {\n    & ${n} ${p} ${s} ${S}$args\n  }\n  $ret=$LASTEXITCODE\n}\n${r.nodePath?`$env:NODE_PATH=$env_node_path\n`:\"\"}exit $ret\n`:P+=`\n# Support pipeline input\nif ($MyInvocation.ExpectingInput) {\n  $input | & ${n} ${p} ${s} ${S}$args\n} else {\n  & ${n} ${p} ${s} ${S}$args\n}\n${r.nodePath?`$env:NODE_PATH=$env_node_path\n`:\"\"}exit $LASTEXITCODE\n`,P}function Ldt(t,e){return e.fs_.chmod(t,493)}function DY(t){if(!t)return{win32:\"\",posix:\"\"};let e=typeof t==\"string\"?t.split(Vc.delimiter):Array.from(t),r={};for(let s=0;s<e.length;s++){let a=e[s].split(\"/\").join(\"\\\\\"),n=RBe()?e[s].split(\"\\\\\").join(\"/\").replace(/^([^:\\\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):e[s];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[s]={win32:a,posix:n}}return r}NBe.exports=SY});var _Y=_((_tr,tve)=>{tve.exports=Ie(\"stream\")});var sve=_((Htr,ive)=>{\"use strict\";function rve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,s)}return r}function mmt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rve(Object(r),!0).forEach(function(s){ymt(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rve(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function ymt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Emt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function nve(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,\"value\"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function Imt(t,e,r){return e&&nve(t.prototype,e),r&&nve(t,r),t}var Cmt=Ie(\"buffer\"),pN=Cmt.Buffer,wmt=Ie(\"util\"),HY=wmt.inspect,Bmt=HY&&HY.custom||\"inspect\";function vmt(t,e,r){pN.prototype.copy.call(t,e,r)}ive.exports=function(){function t(){Emt(this,t),this.head=null,this.tail=null,this.length=0}return Imt(t,[{key:\"push\",value:function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:\"unshift\",value:function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:\"shift\",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:\"clear\",value:function(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function(r){if(this.length===0)return\"\";for(var s=this.head,a=\"\"+s.data;s=s.next;)a+=r+s.data;return a}},{key:\"concat\",value:function(r){if(this.length===0)return pN.alloc(0);for(var s=pN.allocUnsafe(r>>>0),a=this.head,n=0;a;)vmt(a.data,s,n),n+=a.data.length,a=a.next;return s}},{key:\"consume\",value:function(r,s){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=s?this._getString(r):this._getBuffer(r),a}},{key:\"first\",value:function(){return this.head.data}},{key:\"_getString\",value:function(r){var s=this.head,a=1,n=s.data;for(r-=n.length;s=s.next;){var c=s.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=c.slice(f));break}++a}return this.length-=a,n}},{key:\"_getBuffer\",value:function(r){var s=pN.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(s),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(s,s.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,s}},{key:Bmt,value:function(r,s){return HY(this,mmt({},s,{depth:0,customInspect:!1}))}}]),t}()});var GY=_((jtr,ave)=>{\"use strict\";function Smt(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(jY,this,t)):process.nextTick(jY,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(n){!e&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(hN,r):(r._writableState.errorEmitted=!0,process.nextTick(ove,r,n)):process.nextTick(ove,r,n):e?(process.nextTick(hN,r),e(n)):process.nextTick(hN,r)}),this)}function ove(t,e){jY(t,e),hN(t)}function hN(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit(\"close\")}function Dmt(){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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function jY(t,e){t.emit(\"error\",e)}function bmt(t,e){var r=t._readableState,s=t._writableState;r&&r.autoDestroy||s&&s.autoDestroy?t.destroy(e):t.emit(\"error\",e)}ave.exports={destroy:Smt,undestroy:Dmt,errorOrDestroy:bmt}});var lg=_((Gtr,uve)=>{\"use strict\";var cve={};function Kc(t,e,r){r||(r=Error);function s(n,c,f){return typeof e==\"string\"?e:e(n,c,f)}class a extends r{constructor(c,f,p){super(s(c,f,p))}}a.prototype.name=r.name,a.prototype.code=t,cve[t]=a}function lve(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(s=>String(s)),r>2?`one of ${e} ${t.slice(0,r-1).join(\", \")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Pmt(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function xmt(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function kmt(t,e,r){return typeof r!=\"number\"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Kc(\"ERR_INVALID_OPT_VALUE\",function(t,e){return'The value \"'+e+'\" is invalid for option \"'+t+'\"'},TypeError);Kc(\"ERR_INVALID_ARG_TYPE\",function(t,e,r){let s;typeof e==\"string\"&&Pmt(e,\"not \")?(s=\"must not be\",e=e.replace(/^not /,\"\")):s=\"must be\";let a;if(xmt(t,\" argument\"))a=`The ${t} ${s} ${lve(e,\"type\")}`;else{let n=kmt(t,\".\")?\"property\":\"argument\";a=`The \"${t}\" ${n} ${s} ${lve(e,\"type\")}`}return a+=`. Received type ${typeof r}`,a},TypeError);Kc(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\");Kc(\"ERR_METHOD_NOT_IMPLEMENTED\",function(t){return\"The \"+t+\" method is not implemented\"});Kc(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\");Kc(\"ERR_STREAM_DESTROYED\",function(t){return\"Cannot call \"+t+\" after a stream was destroyed\"});Kc(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\");Kc(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\");Kc(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\");Kc(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError);Kc(\"ERR_UNKNOWN_ENCODING\",function(t){return\"Unknown encoding: \"+t},TypeError);Kc(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\");uve.exports.codes=cve});var qY=_((qtr,fve)=>{\"use strict\";var Qmt=lg().codes.ERR_INVALID_OPT_VALUE;function Tmt(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Rmt(t,e,r,s){var a=Tmt(e,s,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var n=s?r:\"highWaterMark\";throw new Qmt(n,a)}return Math.floor(a)}return t.objectMode?16:16*1024}fve.exports={getHighWaterMark:Rmt}});var Ave=_((Wtr,WY)=>{typeof Object.create==\"function\"?WY.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:WY.exports=function(e,r){if(r){e.super_=r;var s=function(){};s.prototype=r.prototype,e.prototype=new s,e.prototype.constructor=e}}});var cg=_((Ytr,VY)=>{try{if(YY=Ie(\"util\"),typeof YY.inherits!=\"function\")throw\"\";VY.exports=YY.inherits}catch{VY.exports=Ave()}var YY});var hve=_((Vtr,pve)=>{pve.exports=Ie(\"util\").deprecate});var zY=_((Jtr,Ive)=>{\"use strict\";Ive.exports=Vi;function dve(t){var e=this;this.next=null,this.entry=null,this.finish=function(){oyt(e,t)}}var Tw;Vi.WritableState=ZD;var Fmt={deprecate:hve()},mve=_Y(),dN=Ie(\"buffer\").Buffer,Nmt=global.Uint8Array||function(){};function Omt(t){return dN.from(t)}function Lmt(t){return dN.isBuffer(t)||t instanceof Nmt}var KY=GY(),Mmt=qY(),Umt=Mmt.getHighWaterMark,ug=lg().codes,_mt=ug.ERR_INVALID_ARG_TYPE,Hmt=ug.ERR_METHOD_NOT_IMPLEMENTED,jmt=ug.ERR_MULTIPLE_CALLBACK,Gmt=ug.ERR_STREAM_CANNOT_PIPE,qmt=ug.ERR_STREAM_DESTROYED,Wmt=ug.ERR_STREAM_NULL_VALUES,Ymt=ug.ERR_STREAM_WRITE_AFTER_END,Vmt=ug.ERR_UNKNOWN_ENCODING,Rw=KY.errorOrDestroy;cg()(Vi,mve);function Jmt(){}function ZD(t,e,r){Tw=Tw||Ym(),t=t||{},typeof r!=\"boolean\"&&(r=e instanceof Tw),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Umt(this,t,\"writableHighWaterMark\",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){tyt(e,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new dve(this)}ZD.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(ZD.prototype,\"buffer\",{get:Fmt.deprecate(function(){return this.getBuffer()},\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch{}})();var gN;typeof Symbol==\"function\"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==\"function\"?(gN=Function.prototype[Symbol.hasInstance],Object.defineProperty(Vi,Symbol.hasInstance,{value:function(e){return gN.call(this,e)?!0:this!==Vi?!1:e&&e._writableState instanceof ZD}})):gN=function(e){return e instanceof this};function Vi(t){Tw=Tw||Ym();var e=this instanceof Tw;if(!e&&!gN.call(Vi,this))return new Vi(t);this._writableState=new ZD(t,this,e),this.writable=!0,t&&(typeof t.write==\"function\"&&(this._write=t.write),typeof t.writev==\"function\"&&(this._writev=t.writev),typeof t.destroy==\"function\"&&(this._destroy=t.destroy),typeof t.final==\"function\"&&(this._final=t.final)),mve.call(this)}Vi.prototype.pipe=function(){Rw(this,new Gmt)};function Kmt(t,e){var r=new Ymt;Rw(t,r),process.nextTick(e,r)}function zmt(t,e,r,s){var a;return r===null?a=new Wmt:typeof r!=\"string\"&&!e.objectMode&&(a=new _mt(\"chunk\",[\"string\",\"Buffer\"],r)),a?(Rw(t,a),process.nextTick(s,a),!1):!0}Vi.prototype.write=function(t,e,r){var s=this._writableState,a=!1,n=!s.objectMode&&Lmt(t);return n&&!dN.isBuffer(t)&&(t=Omt(t)),typeof e==\"function\"&&(r=e,e=null),n?e=\"buffer\":e||(e=s.defaultEncoding),typeof r!=\"function\"&&(r=Jmt),s.ending?Kmt(this,r):(n||zmt(this,s,t,r))&&(s.pendingcb++,a=Zmt(this,s,n,t,e,r)),a};Vi.prototype.cork=function(){this._writableState.corked++};Vi.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&yve(this,t))};Vi.prototype.setDefaultEncoding=function(e){if(typeof e==\"string\"&&(e=e.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((e+\"\").toLowerCase())>-1))throw new Vmt(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Vi.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Xmt(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e==\"string\"&&(e=dN.from(e,r)),e}Object.defineProperty(Vi.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Zmt(t,e,r,s,a,n){if(!r){var c=Xmt(e,s,a);s!==c&&(r=!0,a=\"buffer\",s=c)}var f=e.objectMode?1:s.length;e.length+=f;var p=e.length<e.highWaterMark;if(p||(e.needDrain=!0),e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:s,encoding:a,isBuf:r,callback:n,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else JY(t,e,!1,f,s,a,n);return p}function JY(t,e,r,s,a,n,c){e.writelen=s,e.writecb=c,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new qmt(\"write\")):r?t._writev(a,e.onwrite):t._write(a,n,e.onwrite),e.sync=!1}function $mt(t,e,r,s,a){--e.pendingcb,r?(process.nextTick(a,s),process.nextTick(XD,t,e),t._writableState.errorEmitted=!0,Rw(t,s)):(a(s),t._writableState.errorEmitted=!0,Rw(t,s),XD(t,e))}function eyt(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function tyt(t,e){var r=t._writableState,s=r.sync,a=r.writecb;if(typeof a!=\"function\")throw new jmt;if(eyt(r),e)$mt(t,r,s,e,a);else{var n=Eve(r)||t.destroyed;!n&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&yve(t,r),s?process.nextTick(gve,t,r,n,a):gve(t,r,n,a)}}function gve(t,e,r,s){r||ryt(t,e),e.pendingcb--,s(),XD(t,e)}function ryt(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit(\"drain\"))}function yve(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var s=e.bufferedRequestCount,a=new Array(s),n=e.corkedRequestsFree;n.entry=r;for(var c=0,f=!0;r;)a[c]=r,r.isBuf||(f=!1),r=r.next,c+=1;a.allBuffers=f,JY(t,e,!0,e.length,a,\"\",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new dve(e),e.bufferedRequestCount=0}else{for(;r;){var p=r.chunk,h=r.encoding,E=r.callback,C=e.objectMode?1:p.length;if(JY(t,e,!1,C,p,h,E),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Vi.prototype._write=function(t,e,r){r(new Hmt(\"_write()\"))};Vi.prototype._writev=null;Vi.prototype.end=function(t,e,r){var s=this._writableState;return typeof t==\"function\"?(r=t,t=null,e=null):typeof e==\"function\"&&(r=e,e=null),t!=null&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||syt(this,s,r),this};Object.defineProperty(Vi.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}});function Eve(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function nyt(t,e){t._final(function(r){e.pendingcb--,r&&Rw(t,r),e.prefinished=!0,t.emit(\"prefinish\"),XD(t,e)})}function iyt(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final==\"function\"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(nyt,t,e)):(e.prefinished=!0,t.emit(\"prefinish\")))}function XD(t,e){var r=Eve(e);if(r&&(iyt(t,e),e.pendingcb===0&&(e.finished=!0,t.emit(\"finish\"),e.autoDestroy))){var s=t._readableState;(!s||s.autoDestroy&&s.endEmitted)&&t.destroy()}return r}function syt(t,e,r){e.ending=!0,XD(t,e),r&&(e.finished?process.nextTick(r):t.once(\"finish\",r)),e.ended=!0,t.writable=!1}function oyt(t,e,r){var s=t.entry;for(t.entry=null;s;){var a=s.callback;e.pendingcb--,a(r),s=s.next}e.corkedRequestsFree.next=t}Object.defineProperty(Vi.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Vi.prototype.destroy=KY.destroy;Vi.prototype._undestroy=KY.undestroy;Vi.prototype._destroy=function(t,e){e(t)}});var Ym=_((Ktr,wve)=>{\"use strict\";var ayt=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};wve.exports=dA;var Cve=$Y(),ZY=zY();cg()(dA,Cve);for(XY=ayt(ZY.prototype),mN=0;mN<XY.length;mN++)yN=XY[mN],dA.prototype[yN]||(dA.prototype[yN]=ZY.prototype[yN]);var XY,yN,mN;function dA(t){if(!(this instanceof dA))return new dA(t);Cve.call(this,t),ZY.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(\"end\",lyt)))}Object.defineProperty(dA.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(dA.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(dA.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}});function lyt(){this._writableState.ended||process.nextTick(cyt,this)}function cyt(t){t.end()}Object.defineProperty(dA.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Sve=_((eV,vve)=>{var EN=Ie(\"buffer\"),ah=EN.Buffer;function Bve(t,e){for(var r in t)e[r]=t[r]}ah.from&&ah.alloc&&ah.allocUnsafe&&ah.allocUnsafeSlow?vve.exports=EN:(Bve(EN,eV),eV.Buffer=Fw);function Fw(t,e,r){return ah(t,e,r)}Bve(ah,Fw);Fw.from=function(t,e,r){if(typeof t==\"number\")throw new TypeError(\"Argument must not be a number\");return ah(t,e,r)};Fw.alloc=function(t,e,r){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");var s=ah(t);return e!==void 0?typeof r==\"string\"?s.fill(e,r):s.fill(e):s.fill(0),s};Fw.allocUnsafe=function(t){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");return ah(t)};Fw.allocUnsafeSlow=function(t){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");return EN.SlowBuffer(t)}});var nV=_(bve=>{\"use strict\";var rV=Sve().Buffer,Dve=rV.isEncoding||function(t){switch(t=\"\"+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 uyt(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}}function fyt(t){var e=uyt(t);if(typeof e!=\"string\"&&(rV.isEncoding===Dve||!Dve(t)))throw new Error(\"Unknown encoding: \"+t);return e||t}bve.StringDecoder=$D;function $D(t){this.encoding=fyt(t);var e;switch(this.encoding){case\"utf16le\":this.text=myt,this.end=yyt,e=4;break;case\"utf8\":this.fillLast=hyt,e=4;break;case\"base64\":this.text=Eyt,this.end=Iyt,e=3;break;default:this.write=Cyt,this.end=wyt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=rV.allocUnsafe(e)}$D.prototype.write=function(t){if(t.length===0)return\"\";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||\"\"};$D.prototype.end=dyt;$D.prototype.text=gyt;$D.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};function tV(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Ayt(t,e,r){var s=e.length-1;if(s<r)return 0;var a=tV(e[s]);return a>=0?(a>0&&(t.lastNeed=a-1),a):--s<r||a===-2?0:(a=tV(e[s]),a>=0?(a>0&&(t.lastNeed=a-2),a):--s<r||a===-2?0:(a=tV(e[s]),a>=0?(a>0&&(a===2?a=0:t.lastNeed=a-3),a):0))}function pyt(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,\"\\uFFFD\";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,\"\\uFFFD\";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,\"\\uFFFD\"}}function hyt(t){var e=this.lastTotal-this.lastNeed,r=pyt(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function gyt(t,e){var r=Ayt(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=r;var s=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,s),t.toString(\"utf8\",e,s)}function dyt(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+\"\\uFFFD\":e}function myt(t,e){if((t.length-e)%2===0){var r=t.toString(\"utf16le\",e);if(r){var s=r.charCodeAt(r.length-1);if(s>=55296&&s<=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 yyt(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 Eyt(t,e){var r=(t.length-e)%3;return r===0?t.toString(\"base64\",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?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 Iyt(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function Cyt(t){return t.toString(this.encoding)}function wyt(t){return t&&t.length?this.write(t):\"\"}});var IN=_((Xtr,kve)=>{\"use strict\";var Pve=lg().codes.ERR_STREAM_PREMATURE_CLOSE;function Byt(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];t.apply(this,s)}}}function vyt(){}function Syt(t){return t.setHeader&&typeof t.abort==\"function\"}function xve(t,e,r){if(typeof e==\"function\")return xve(t,null,e);e||(e={}),r=Byt(r||vyt);var s=e.readable||e.readable!==!1&&t.readable,a=e.writable||e.writable!==!1&&t.writable,n=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){a=!1,c=!0,s||r.call(t)},p=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,p=!0,a||r.call(t)},E=function(I){r.call(t,I)},C=function(){var I;if(s&&!p)return(!t._readableState||!t._readableState.ended)&&(I=new Pve),r.call(t,I);if(a&&!c)return(!t._writableState||!t._writableState.ended)&&(I=new Pve),r.call(t,I)},S=function(){t.req.on(\"finish\",f)};return Syt(t)?(t.on(\"complete\",f),t.on(\"abort\",C),t.req?S():t.on(\"request\",S)):a&&!t._writableState&&(t.on(\"end\",n),t.on(\"close\",n)),t.on(\"end\",h),t.on(\"finish\",f),e.error!==!1&&t.on(\"error\",E),t.on(\"close\",C),function(){t.removeListener(\"complete\",f),t.removeListener(\"abort\",C),t.removeListener(\"request\",S),t.req&&t.req.removeListener(\"finish\",f),t.removeListener(\"end\",n),t.removeListener(\"close\",n),t.removeListener(\"finish\",f),t.removeListener(\"end\",h),t.removeListener(\"error\",E),t.removeListener(\"close\",C)}}kve.exports=xve});var Tve=_((Ztr,Qve)=>{\"use strict\";var CN;function fg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Dyt=IN(),Ag=Symbol(\"lastResolve\"),Vm=Symbol(\"lastReject\"),eb=Symbol(\"error\"),wN=Symbol(\"ended\"),Jm=Symbol(\"lastPromise\"),iV=Symbol(\"handlePromise\"),Km=Symbol(\"stream\");function pg(t,e){return{value:t,done:e}}function byt(t){var e=t[Ag];if(e!==null){var r=t[Km].read();r!==null&&(t[Jm]=null,t[Ag]=null,t[Vm]=null,e(pg(r,!1)))}}function Pyt(t){process.nextTick(byt,t)}function xyt(t,e){return function(r,s){t.then(function(){if(e[wN]){r(pg(void 0,!0));return}e[iV](r,s)},s)}}var kyt=Object.getPrototypeOf(function(){}),Qyt=Object.setPrototypeOf((CN={get stream(){return this[Km]},next:function(){var e=this,r=this[eb];if(r!==null)return Promise.reject(r);if(this[wN])return Promise.resolve(pg(void 0,!0));if(this[Km].destroyed)return new Promise(function(c,f){process.nextTick(function(){e[eb]?f(e[eb]):c(pg(void 0,!0))})});var s=this[Jm],a;if(s)a=new Promise(xyt(s,this));else{var n=this[Km].read();if(n!==null)return Promise.resolve(pg(n,!1));a=new Promise(this[iV])}return this[Jm]=a,a}},fg(CN,Symbol.asyncIterator,function(){return this}),fg(CN,\"return\",function(){var e=this;return new Promise(function(r,s){e[Km].destroy(null,function(a){if(a){s(a);return}r(pg(void 0,!0))})})}),CN),kyt),Tyt=function(e){var r,s=Object.create(Qyt,(r={},fg(r,Km,{value:e,writable:!0}),fg(r,Ag,{value:null,writable:!0}),fg(r,Vm,{value:null,writable:!0}),fg(r,eb,{value:null,writable:!0}),fg(r,wN,{value:e._readableState.endEmitted,writable:!0}),fg(r,iV,{value:function(n,c){var f=s[Km].read();f?(s[Jm]=null,s[Ag]=null,s[Vm]=null,n(pg(f,!1))):(s[Ag]=n,s[Vm]=c)},writable:!0}),r));return s[Jm]=null,Dyt(e,function(a){if(a&&a.code!==\"ERR_STREAM_PREMATURE_CLOSE\"){var n=s[Vm];n!==null&&(s[Jm]=null,s[Ag]=null,s[Vm]=null,n(a)),s[eb]=a;return}var c=s[Ag];c!==null&&(s[Jm]=null,s[Ag]=null,s[Vm]=null,c(pg(void 0,!0))),s[wN]=!0}),e.on(\"readable\",Pyt.bind(null,s)),s};Qve.exports=Tyt});var Ove=_(($tr,Nve)=>{\"use strict\";function Rve(t,e,r,s,a,n,c){try{var f=t[n](c),p=f.value}catch(h){r(h);return}f.done?e(p):Promise.resolve(p).then(s,a)}function Ryt(t){return function(){var e=this,r=arguments;return new Promise(function(s,a){var n=t.apply(e,r);function c(p){Rve(n,s,a,c,f,\"next\",p)}function f(p){Rve(n,s,a,c,f,\"throw\",p)}c(void 0)})}}function Fve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,s)}return r}function Fyt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fve(Object(r),!0).forEach(function(s){Nyt(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fve(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function Nyt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Oyt=lg().codes.ERR_INVALID_ARG_TYPE;function Lyt(t,e,r){var s;if(e&&typeof e.next==\"function\")s=e;else if(e&&e[Symbol.asyncIterator])s=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])s=e[Symbol.iterator]();else throw new Oyt(\"iterable\",[\"Iterable\"],e);var a=new t(Fyt({objectMode:!0},r)),n=!1;a._read=function(){n||(n=!0,c())};function c(){return f.apply(this,arguments)}function f(){return f=Ryt(function*(){try{var p=yield s.next(),h=p.value,E=p.done;E?a.push(null):a.push(yield h)?c():n=!1}catch(C){a.destroy(C)}}),f.apply(this,arguments)}return a}Nve.exports=Lyt});var $Y=_((rrr,Yve)=>{\"use strict\";Yve.exports=Pn;var Nw;Pn.ReadableState=_ve;var trr=Ie(\"events\").EventEmitter,Uve=function(e,r){return e.listeners(r).length},rb=_Y(),BN=Ie(\"buffer\").Buffer,Myt=global.Uint8Array||function(){};function Uyt(t){return BN.from(t)}function _yt(t){return BN.isBuffer(t)||t instanceof Myt}var sV=Ie(\"util\"),cn;sV&&sV.debuglog?cn=sV.debuglog(\"stream\"):cn=function(){};var Hyt=sve(),AV=GY(),jyt=qY(),Gyt=jyt.getHighWaterMark,vN=lg().codes,qyt=vN.ERR_INVALID_ARG_TYPE,Wyt=vN.ERR_STREAM_PUSH_AFTER_EOF,Yyt=vN.ERR_METHOD_NOT_IMPLEMENTED,Vyt=vN.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ow,oV,aV;cg()(Pn,rb);var tb=AV.errorOrDestroy,lV=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function Jyt(t,e,r){if(typeof t.prependListener==\"function\")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function _ve(t,e,r){Nw=Nw||Ym(),t=t||{},typeof r!=\"boolean\"&&(r=e instanceof Nw),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Gyt(this,t,\"readableHighWaterMark\",r),this.buffer=new Hyt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Ow||(Ow=nV().StringDecoder),this.decoder=new Ow(t.encoding),this.encoding=t.encoding)}function Pn(t){if(Nw=Nw||Ym(),!(this instanceof Pn))return new Pn(t);var e=this instanceof Nw;this._readableState=new _ve(t,this,e),this.readable=!0,t&&(typeof t.read==\"function\"&&(this._read=t.read),typeof t.destroy==\"function\"&&(this._destroy=t.destroy)),rb.call(this)}Object.defineProperty(Pn.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Pn.prototype.destroy=AV.destroy;Pn.prototype._undestroy=AV.undestroy;Pn.prototype._destroy=function(t,e){e(t)};Pn.prototype.push=function(t,e){var r=this._readableState,s;return r.objectMode?s=!0:typeof t==\"string\"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=BN.from(t,e),e=\"\"),s=!0),Hve(this,t,e,!1,s)};Pn.prototype.unshift=function(t){return Hve(this,t,null,!0,!1)};function Hve(t,e,r,s,a){cn(\"readableAddChunk\",e);var n=t._readableState;if(e===null)n.reading=!1,Xyt(t,n);else{var c;if(a||(c=Kyt(n,e)),c)tb(t,c);else if(n.objectMode||e&&e.length>0)if(typeof e!=\"string\"&&!n.objectMode&&Object.getPrototypeOf(e)!==BN.prototype&&(e=Uyt(e)),s)n.endEmitted?tb(t,new Vyt):cV(t,n,e,!0);else if(n.ended)tb(t,new Wyt);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?cV(t,n,e,!1):fV(t,n)):cV(t,n,e,!1)}else s||(n.reading=!1,fV(t,n))}return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function cV(t,e,r,s){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit(\"data\",r)):(e.length+=e.objectMode?1:r.length,s?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&SN(t)),fV(t,e)}function Kyt(t,e){var r;return!_yt(e)&&typeof e!=\"string\"&&e!==void 0&&!t.objectMode&&(r=new qyt(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],e)),r}Pn.prototype.isPaused=function(){return this._readableState.flowing===!1};Pn.prototype.setEncoding=function(t){Ow||(Ow=nV().StringDecoder);var e=new Ow(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,s=\"\";r!==null;)s+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),s!==\"\"&&this._readableState.buffer.push(s),this._readableState.length=s.length,this};var Lve=1073741824;function zyt(t){return t>=Lve?t=Lve:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Mve(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=zyt(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Pn.prototype.read=function(t){cn(\"read\",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return cn(\"read: emitReadable\",e.length,e.ended),e.length===0&&e.ended?uV(this):SN(this),null;if(t=Mve(t,e),t===0&&e.ended)return e.length===0&&uV(this),null;var s=e.needReadable;cn(\"need readable\",s),(e.length===0||e.length-t<e.highWaterMark)&&(s=!0,cn(\"length less than watermark\",s)),e.ended||e.reading?(s=!1,cn(\"reading or ended\",s)):s&&(cn(\"do read\"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Mve(r,e)));var a;return t>0?a=qve(t,e):a=null,a===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&uV(this)),a!==null&&this.emit(\"data\",a),a};function Xyt(t,e){if(cn(\"onEofChunk\"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?SN(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,jve(t)))}}function SN(t){var e=t._readableState;cn(\"emitReadable\",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(cn(\"emitReadable\",e.flowing),e.emittedReadable=!0,process.nextTick(jve,t))}function jve(t){var e=t._readableState;cn(\"emitReadable_\",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit(\"readable\"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,pV(t)}function fV(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(Zyt,t,e))}function Zyt(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(cn(\"maybeReadMore read 0\"),t.read(0),r===e.length)break}e.readingMore=!1}Pn.prototype._read=function(t){tb(this,new Yyt(\"_read()\"))};Pn.prototype.pipe=function(t,e){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t);break}s.pipesCount+=1,cn(\"pipe count=%d opts=%j\",s.pipesCount,e);var a=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,n=a?f:R;s.endEmitted?process.nextTick(n):r.once(\"end\",n),t.on(\"unpipe\",c);function c(N,U){cn(\"onunpipe\"),N===r&&U&&U.hasUnpiped===!1&&(U.hasUnpiped=!0,E())}function f(){cn(\"onend\"),t.end()}var p=$yt(r);t.on(\"drain\",p);var h=!1;function E(){cn(\"cleanup\"),t.removeListener(\"close\",P),t.removeListener(\"finish\",I),t.removeListener(\"drain\",p),t.removeListener(\"error\",S),t.removeListener(\"unpipe\",c),r.removeListener(\"end\",f),r.removeListener(\"end\",R),r.removeListener(\"data\",C),h=!0,s.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&p()}r.on(\"data\",C);function C(N){cn(\"ondata\");var U=t.write(N);cn(\"dest.write\",U),U===!1&&((s.pipesCount===1&&s.pipes===t||s.pipesCount>1&&Wve(s.pipes,t)!==-1)&&!h&&(cn(\"false write response, pause\",s.awaitDrain),s.awaitDrain++),r.pause())}function S(N){cn(\"onerror\",N),R(),t.removeListener(\"error\",S),Uve(t,\"error\")===0&&tb(t,N)}Jyt(t,\"error\",S);function P(){t.removeListener(\"finish\",I),R()}t.once(\"close\",P);function I(){cn(\"onfinish\"),t.removeListener(\"close\",P),R()}t.once(\"finish\",I);function R(){cn(\"unpipe\"),r.unpipe(t)}return t.emit(\"pipe\",r),s.flowing||(cn(\"pipe resume\"),r.resume()),t};function $yt(t){return function(){var r=t._readableState;cn(\"pipeOnDrain\",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Uve(t,\"data\")&&(r.flowing=!0,pV(t))}}Pn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)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 s=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<a;n++)s[n].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var c=Wve(e.pipes,t);return c===-1?this:(e.pipes.splice(c,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit(\"unpipe\",this,r),this)};Pn.prototype.on=function(t,e){var r=rb.prototype.on.call(this,t,e),s=this._readableState;return t===\"data\"?(s.readableListening=this.listenerCount(\"readable\")>0,s.flowing!==!1&&this.resume()):t===\"readable\"&&!s.endEmitted&&!s.readableListening&&(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,cn(\"on readable\",s.length,s.reading),s.length?SN(this):s.reading||process.nextTick(eEt,this)),r};Pn.prototype.addListener=Pn.prototype.on;Pn.prototype.removeListener=function(t,e){var r=rb.prototype.removeListener.call(this,t,e);return t===\"readable\"&&process.nextTick(Gve,this),r};Pn.prototype.removeAllListeners=function(t){var e=rb.prototype.removeAllListeners.apply(this,arguments);return(t===\"readable\"||t===void 0)&&process.nextTick(Gve,this),e};function Gve(t){var e=t._readableState;e.readableListening=t.listenerCount(\"readable\")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount(\"data\")>0&&t.resume()}function eEt(t){cn(\"readable nexttick read 0\"),t.read(0)}Pn.prototype.resume=function(){var t=this._readableState;return t.flowing||(cn(\"resume\"),t.flowing=!t.readableListening,tEt(this,t)),t.paused=!1,this};function tEt(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(rEt,t,e))}function rEt(t,e){cn(\"resume\",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit(\"resume\"),pV(t),e.flowing&&!e.reading&&t.read(0)}Pn.prototype.pause=function(){return cn(\"call pause flowing=%j\",this._readableState.flowing),this._readableState.flowing!==!1&&(cn(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this};function pV(t){var e=t._readableState;for(cn(\"flow\",e.flowing);e.flowing&&t.read()!==null;);}Pn.prototype.wrap=function(t){var e=this,r=this._readableState,s=!1;t.on(\"end\",function(){if(cn(\"wrapped end\"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on(\"data\",function(c){if(cn(\"wrapped data\"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var f=e.push(c);f||(s=!0,t.pause())}});for(var a in t)this[a]===void 0&&typeof t[a]==\"function\"&&(this[a]=function(f){return function(){return t[f].apply(t,arguments)}}(a));for(var n=0;n<lV.length;n++)t.on(lV[n],this.emit.bind(this,lV[n]));return this._read=function(c){cn(\"wrapped _read\",c),s&&(s=!1,t.resume())},this};typeof Symbol==\"function\"&&(Pn.prototype[Symbol.asyncIterator]=function(){return oV===void 0&&(oV=Tve()),oV(this)});Object.defineProperty(Pn.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Pn.prototype,\"readableBuffer\",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Pn.prototype,\"readableFlowing\",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Pn._fromList=qve;Object.defineProperty(Pn.prototype,\"readableLength\",{enumerable:!1,get:function(){return this._readableState.length}});function qve(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(\"\"):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function uV(t){var e=t._readableState;cn(\"endReadable\",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(nEt,e,t))}function nEt(t,e){if(cn(\"endReadableNT\",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol==\"function\"&&(Pn.from=function(t,e){return aV===void 0&&(aV=Ove()),aV(Pn,t,e)});function Wve(t,e){for(var r=0,s=t.length;r<s;r++)if(t[r]===e)return r;return-1}});var hV=_((nrr,Jve)=>{\"use strict\";Jve.exports=lh;var DN=lg().codes,iEt=DN.ERR_METHOD_NOT_IMPLEMENTED,sEt=DN.ERR_MULTIPLE_CALLBACK,oEt=DN.ERR_TRANSFORM_ALREADY_TRANSFORMING,aEt=DN.ERR_TRANSFORM_WITH_LENGTH_0,bN=Ym();cg()(lh,bN);function lEt(t,e){var r=this._transformState;r.transforming=!1;var s=r.writecb;if(s===null)return this.emit(\"error\",new sEt);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),s(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function lh(t){if(!(this instanceof lh))return new lh(t);bN.call(this,t),this._transformState={afterTransform:lEt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform==\"function\"&&(this._transform=t.transform),typeof t.flush==\"function\"&&(this._flush=t.flush)),this.on(\"prefinish\",cEt)}function cEt(){var t=this;typeof this._flush==\"function\"&&!this._readableState.destroyed?this._flush(function(e,r){Vve(t,e,r)}):Vve(this,null,null)}lh.prototype.push=function(t,e){return this._transformState.needTransform=!1,bN.prototype.push.call(this,t,e)};lh.prototype._transform=function(t,e,r){r(new iEt(\"_transform()\"))};lh.prototype._write=function(t,e,r){var s=this._transformState;if(s.writecb=r,s.writechunk=t,s.writeencoding=e,!s.transforming){var a=this._readableState;(s.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};lh.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};lh.prototype._destroy=function(t,e){bN.prototype._destroy.call(this,t,function(r){e(r)})};function Vve(t,e,r){if(e)return t.emit(\"error\",e);if(r!=null&&t.push(r),t._writableState.length)throw new aEt;if(t._transformState.transforming)throw new oEt;return t.push(null)}});var Xve=_((irr,zve)=>{\"use strict\";zve.exports=nb;var Kve=hV();cg()(nb,Kve);function nb(t){if(!(this instanceof nb))return new nb(t);Kve.call(this,t)}nb.prototype._transform=function(t,e,r){r(null,t)}});var rSe=_((srr,tSe)=>{\"use strict\";var gV;function uEt(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var eSe=lg().codes,fEt=eSe.ERR_MISSING_ARGS,AEt=eSe.ERR_STREAM_DESTROYED;function Zve(t){if(t)throw t}function pEt(t){return t.setHeader&&typeof t.abort==\"function\"}function hEt(t,e,r,s){s=uEt(s);var a=!1;t.on(\"close\",function(){a=!0}),gV===void 0&&(gV=IN()),gV(t,{readable:e,writable:r},function(c){if(c)return s(c);a=!0,s()});var n=!1;return function(c){if(!a&&!n){if(n=!0,pEt(t))return t.abort();if(typeof t.destroy==\"function\")return t.destroy();s(c||new AEt(\"pipe\"))}}}function $ve(t){t()}function gEt(t,e){return t.pipe(e)}function dEt(t){return!t.length||typeof t[t.length-1]!=\"function\"?Zve:t.pop()}function mEt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var s=dEt(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new fEt(\"streams\");var a,n=e.map(function(c,f){var p=f<e.length-1,h=f>0;return hEt(c,p,h,function(E){a||(a=E),E&&n.forEach($ve),!p&&(n.forEach($ve),s(a))})});return e.reduce(gEt)}tSe.exports=mEt});var Lw=_((zc,sb)=>{var ib=Ie(\"stream\");process.env.READABLE_STREAM===\"disable\"&&ib?(sb.exports=ib.Readable,Object.assign(sb.exports,ib),sb.exports.Stream=ib):(zc=sb.exports=$Y(),zc.Stream=ib||zc,zc.Readable=zc,zc.Writable=zY(),zc.Duplex=Ym(),zc.Transform=hV(),zc.PassThrough=Xve(),zc.finished=IN(),zc.pipeline=rSe())});var sSe=_((orr,iSe)=>{\"use strict\";var{Buffer:cf}=Ie(\"buffer\"),nSe=Symbol.for(\"BufferList\");function Ci(t){if(!(this instanceof Ci))return new Ci(t);Ci._init.call(this,t)}Ci._init=function(e){Object.defineProperty(this,nSe,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};Ci.prototype._new=function(e){return new Ci(e)};Ci.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let s=0;s<this._bufs.length;s++){let a=r+this._bufs[s].length;if(e<a||s===this._bufs.length-1)return[s,e-r];r=a}};Ci.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let s=0;s<e;s++)r+=this._bufs[s].length;return r};Ci.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};Ci.prototype.slice=function(e,r){return typeof e==\"number\"&&e<0&&(e+=this.length),typeof r==\"number\"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};Ci.prototype.copy=function(e,r,s,a){if((typeof s!=\"number\"||s<0)&&(s=0),(typeof a!=\"number\"||a>this.length)&&(a=this.length),s>=this.length||a<=0)return e||cf.alloc(0);let n=!!e,c=this._offset(s),f=a-s,p=f,h=n&&r||0,E=c[1];if(s===0&&a===this.length){if(!n)return this._bufs.length===1?this._bufs[0]:cf.concat(this._bufs,this.length);for(let C=0;C<this._bufs.length;C++)this._bufs[C].copy(e,h),h+=this._bufs[C].length;return e}if(p<=this._bufs[c[0]].length-E)return n?this._bufs[c[0]].copy(e,r,E,E+p):this._bufs[c[0]].slice(E,E+p);n||(e=cf.allocUnsafe(f));for(let C=c[0];C<this._bufs.length;C++){let S=this._bufs[C].length-E;if(p>S)this._bufs[C].copy(e,h,E),h+=S;else{this._bufs[C].copy(e,h,E,E+p),h+=S;break}p-=S,E&&(E=0)}return e.length>h?e.slice(0,h):e};Ci.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!=\"number\"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let s=this._offset(e),a=this._offset(r),n=this._bufs.slice(s[0],a[0]+1);return a[1]===0?n.pop():n[n.length-1]=n[n.length-1].slice(0,a[1]),s[1]!==0&&(n[0]=n[0].slice(s[1])),this._new(n)};Ci.prototype.toString=function(e,r,s){return this.slice(r,s).toString(e)};Ci.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};Ci.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};Ci.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(cf.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e==\"number\"&&(e=e.toString()),this._appendBuffer(cf.from(e));return this};Ci.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};Ci.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e==\"string\"&&(r=e,e=void 0),typeof t==\"function\"||Array.isArray(t))throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t==\"number\"?t=cf.from([t]):typeof t==\"string\"?t=cf.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=cf.from(t.buffer,t.byteOffset,t.byteLength):cf.isBuffer(t)||(t=cf.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let s=this._offset(e),a=s[0],n=s[1];for(;a<this._bufs.length;a++){let c=this._bufs[a];for(;n<c.length;)if(c.length-n>=t.length){let p=c.indexOf(t,n);if(p!==-1)return this._reverseOffset([a,p]);n=c.length-t.length+1}else{let p=this._reverseOffset([a,n]);if(this._match(p,t))return p;n++}n=0}return-1};Ci.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?Ci.prototype[r]=function(s,a){return this.slice(s,s+a)[r](0,a)}:Ci.prototype[r]=function(s=0){return this.slice(s,s+t[r])[r](0)}})(e)})();Ci.prototype._isBufferList=function(e){return e instanceof Ci||Ci.isBufferList(e)};Ci.isBufferList=function(e){return e!=null&&e[nSe]};iSe.exports=Ci});var oSe=_((arr,PN)=>{\"use strict\";var dV=Lw().Duplex,yEt=cg(),ob=sSe();function ra(t){if(!(this instanceof ra))return new ra(t);if(typeof t==\"function\"){this._callback=t;let e=function(s){this._callback&&(this._callback(s),this._callback=null)}.bind(this);this.on(\"pipe\",function(s){s.on(\"error\",e)}),this.on(\"unpipe\",function(s){s.removeListener(\"error\",e)}),t=null}ob._init.call(this,t),dV.call(this)}yEt(ra,dV);Object.assign(ra.prototype,ob.prototype);ra.prototype._new=function(e){return new ra(e)};ra.prototype._write=function(e,r,s){this._appendBuffer(e),typeof s==\"function\"&&s()};ra.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};ra.prototype.end=function(e){dV.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};ra.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};ra.prototype._isBufferList=function(e){return e instanceof ra||e instanceof ob||ra.isBufferList(e)};ra.isBufferList=ob.isBufferList;PN.exports=ra;PN.exports.BufferListStream=ra;PN.exports.BufferList=ob});var EV=_(Uw=>{var EEt=Buffer.alloc,IEt=\"0000000000000000000\",CEt=\"7777777777777777777\",aSe=48,lSe=Buffer.from(\"ustar\\0\",\"binary\"),wEt=Buffer.from(\"00\",\"binary\"),BEt=Buffer.from(\"ustar \",\"binary\"),vEt=Buffer.from(\" \\0\",\"binary\"),SEt=parseInt(\"7777\",8),ab=257,yV=263,DEt=function(t,e,r){return typeof t!=\"number\"?r:(t=~~t,t>=e?e:t>=0||(t+=e,t>=0)?t:0)},bEt=function(t){switch(t){case 0:return\"file\";case 1:return\"link\";case 2:return\"symlink\";case 3:return\"character-device\";case 4:return\"block-device\";case 5:return\"directory\";case 6:return\"fifo\";case 7:return\"contiguous-file\";case 72:return\"pax-header\";case 55:return\"pax-global-header\";case 27:return\"gnu-long-link-path\";case 28:case 30:return\"gnu-long-path\"}return null},PEt=function(t){switch(t){case\"file\":return 0;case\"link\":return 1;case\"symlink\":return 2;case\"character-device\":return 3;case\"block-device\":return 4;case\"directory\":return 5;case\"fifo\":return 6;case\"contiguous-file\":return 7;case\"pax-header\":return 72}return 0},cSe=function(t,e,r,s){for(;r<s;r++)if(t[r]===e)return r;return s},uSe=function(t){for(var e=256,r=0;r<148;r++)e+=t[r];for(var s=156;s<512;s++)e+=t[s];return e},hg=function(t,e){return t=t.toString(8),t.length>e?CEt.slice(0,e)+\" \":IEt.slice(0,e-t.length)+t+\" \"};function xEt(t){var e;if(t[0]===128)e=!0;else if(t[0]===255)e=!1;else return null;for(var r=[],s=t.length-1;s>0;s--){var a=t[s];e?r.push(a):r.push(255-a)}var n=0,c=r.length;for(s=0;s<c;s++)n+=r[s]*Math.pow(256,s);return e?n:-1*n}var gg=function(t,e,r){if(t=t.slice(e,e+r),e=0,t[e]&128)return xEt(t);for(;e<t.length&&t[e]===32;)e++;for(var s=DEt(cSe(t,32,e,t.length),t.length,t.length);e<s&&t[e]===0;)e++;return s===e?0:parseInt(t.slice(e,s).toString(),8)},Mw=function(t,e,r,s){return t.slice(e,cSe(t,0,e,e+r)).toString(s)},mV=function(t){var e=Buffer.byteLength(t),r=Math.floor(Math.log(e)/Math.log(10))+1;return e+r>=Math.pow(10,r)&&r++,e+r+t};Uw.decodeLongPath=function(t,e){return Mw(t,0,t.length,e)};Uw.encodePax=function(t){var e=\"\";t.name&&(e+=mV(\" path=\"+t.name+`\n`)),t.linkname&&(e+=mV(\" linkpath=\"+t.linkname+`\n`));var r=t.pax;if(r)for(var s in r)e+=mV(\" \"+s+\"=\"+r[s]+`\n`);return Buffer.from(e)};Uw.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var s=parseInt(t.slice(0,r).toString(),10);if(!s)return e;var a=t.slice(r+1,s-1).toString(),n=a.indexOf(\"=\");if(n===-1)return e;e[a.slice(0,n)]=a.slice(n+1),t=t.slice(s)}return e};Uw.encode=function(t){var e=EEt(512),r=t.name,s=\"\";if(t.typeflag===5&&r[r.length-1]!==\"/\"&&(r+=\"/\"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf(\"/\");if(a===-1)return null;s+=s?\"/\"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(s)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(hg(t.mode&SEt,6),100),e.write(hg(t.uid,6),108),e.write(hg(t.gid,6),116),e.write(hg(t.size,11),124),e.write(hg(t.mtime.getTime()/1e3|0,11),136),e[156]=aSe+PEt(t.type),t.linkname&&e.write(t.linkname,157),lSe.copy(e,ab),wEt.copy(e,yV),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(hg(t.devmajor||0,6),329),e.write(hg(t.devminor||0,6),337),s&&e.write(s,345),e.write(hg(uSe(e),6),148),e)};Uw.decode=function(t,e,r){var s=t[156]===0?0:t[156]-aSe,a=Mw(t,0,100,e),n=gg(t,100,8),c=gg(t,108,8),f=gg(t,116,8),p=gg(t,124,12),h=gg(t,136,12),E=bEt(s),C=t[157]===0?null:Mw(t,157,100,e),S=Mw(t,265,32),P=Mw(t,297,32),I=gg(t,329,8),R=gg(t,337,8),N=uSe(t);if(N===8*32)return null;if(N!==gg(t,148,8))throw new Error(\"Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?\");if(lSe.compare(t,ab,ab+6)===0)t[345]&&(a=Mw(t,345,155,e)+\"/\"+a);else if(!(BEt.compare(t,ab,ab+6)===0&&vEt.compare(t,yV,yV+2)===0)){if(!r)throw new Error(\"Invalid tar header: unknown format.\")}return s===0&&a&&a[a.length-1]===\"/\"&&(s=5),{name:a,mode:n,uid:c,gid:f,size:p,mtime:new Date(1e3*h),type:E,linkname:C,uname:S,gname:P,devmajor:I,devminor:R}}});var mSe=_((crr,dSe)=>{var ASe=Ie(\"util\"),kEt=oSe(),lb=EV(),pSe=Lw().Writable,hSe=Lw().PassThrough,gSe=function(){},fSe=function(t){return t&=511,t&&512-t},QEt=function(t,e){var r=new xN(t,e);return r.end(),r},TEt=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},xN=function(t,e){this._parent=t,this.offset=e,hSe.call(this,{autoDestroy:!1})};ASe.inherits(xN,hSe);xN.prototype.destroy=function(t){this._parent.destroy(t)};var ch=function(t){if(!(this instanceof ch))return new ch(t);pSe.call(this,t),t=t||{},this._offset=0,this._buffer=kEt(),this._missing=0,this._partial=!1,this._onparse=gSe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,s=function(){e._continue()},a=function(S){if(e._locked=!1,S)return e.destroy(S);e._stream||s()},n=function(){e._stream=null;var S=fSe(e._header.size);S?e._parse(S,c):e._parse(512,C),e._locked||s()},c=function(){e._buffer.consume(fSe(e._header.size)),e._parse(512,C),s()},f=function(){var S=e._header.size;e._paxGlobal=lb.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=e._header.size;e._pax=lb.decodePax(r.slice(0,S)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(S),n()},h=function(){var S=e._header.size;this._gnuLongPath=lb.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},E=function(){var S=e._header.size;this._gnuLongLinkPath=lb.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},C=function(){var S=e._offset,P;try{P=e._header=lb.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(I){e.emit(\"error\",I)}if(r.consume(512),!P){e._parse(512,C),s();return}if(P.type===\"gnu-long-path\"){e._parse(P.size,h),s();return}if(P.type===\"gnu-long-link-path\"){e._parse(P.size,E),s();return}if(P.type===\"pax-global-header\"){e._parse(P.size,f),s();return}if(P.type===\"pax-header\"){e._parse(P.size,p),s();return}if(e._gnuLongPath&&(P.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(P.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=P=TEt(P,e._pax),e._pax=null),e._locked=!0,!P.size||P.type===\"directory\"){e._parse(512,C),e.emit(\"entry\",P,QEt(e,S),a);return}e._stream=new xN(e,S),e.emit(\"entry\",P,e._stream,a),e._parse(P.size,n),s()};this._onheader=C,this._parse(512,C)};ASe.inherits(ch,pSe);ch.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit(\"error\",t),this.emit(\"close\"),this._stream&&this._stream.emit(\"close\"))};ch.prototype._parse=function(t,e){this._destroyed||(this._offset+=t,this._missing=t,e===this._onheader&&(this._partial=!1),this._onparse=e)};ch.prototype._continue=function(){if(!this._destroyed){var t=this._cb;this._cb=gSe,this._overflow?this._write(this._overflow,void 0,t):t()}};ch.prototype._write=function(t,e,r){if(!this._destroyed){var s=this._stream,a=this._buffer,n=this._missing;if(t.length&&(this._partial=!0),t.length<n)return this._missing-=t.length,this._overflow=null,s?s.write(t,r):(a.append(t),r());this._cb=r,this._missing=0;var c=null;t.length>n&&(c=t.slice(n),t=t.slice(0,n)),s?s.end(t):a.append(t),this._overflow=c,this._onparse()}};ch.prototype._final=function(t){if(this._partial)return this.destroy(new Error(\"Unexpected end of data\"));t()};dSe.exports=ch});var ESe=_((urr,ySe)=>{ySe.exports=Ie(\"fs\").constants||Ie(\"constants\")});var vSe=_((frr,BSe)=>{var _w=ESe(),ISe=cH(),QN=cg(),REt=Buffer.alloc,CSe=Lw().Readable,Hw=Lw().Writable,FEt=Ie(\"string_decoder\").StringDecoder,kN=EV(),NEt=parseInt(\"755\",8),OEt=parseInt(\"644\",8),wSe=REt(1024),CV=function(){},IV=function(t,e){e&=511,e&&t.push(wSe.slice(0,512-e))};function LEt(t){switch(t&_w.S_IFMT){case _w.S_IFBLK:return\"block-device\";case _w.S_IFCHR:return\"character-device\";case _w.S_IFDIR:return\"directory\";case _w.S_IFIFO:return\"fifo\";case _w.S_IFLNK:return\"symlink\"}return\"file\"}var TN=function(t){Hw.call(this),this.written=0,this._to=t,this._destroyed=!1};QN(TN,Hw);TN.prototype._write=function(t,e,r){if(this.written+=t.length,this._to.push(t))return r();this._to._drain=r};TN.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var RN=function(){Hw.call(this),this.linkname=\"\",this._decoder=new FEt(\"utf-8\"),this._destroyed=!1};QN(RN,Hw);RN.prototype._write=function(t,e,r){this.linkname+=this._decoder.write(t),r()};RN.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var ub=function(){Hw.call(this),this._destroyed=!1};QN(ub,Hw);ub.prototype._write=function(t,e,r){r(new Error(\"No body allowed for this entry\"))};ub.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var mA=function(t){if(!(this instanceof mA))return new mA(t);CSe.call(this,t),this._drain=CV,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};QN(mA,CSe);mA.prototype.entry=function(t,e,r){if(this._stream)throw new Error(\"already piping an entry\");if(!(this._finalized||this._destroyed)){typeof e==\"function\"&&(r=e,e=null),r||(r=CV);var s=this;if((!t.size||t.type===\"symlink\")&&(t.size=0),t.type||(t.type=LEt(t.mode)),t.mode||(t.mode=t.type===\"directory\"?NEt:OEt),t.uid||(t.uid=0),t.gid||(t.gid=0),t.mtime||(t.mtime=new Date),typeof e==\"string\"&&(e=Buffer.from(e)),Buffer.isBuffer(e)){t.size=e.length,this._encode(t);var a=this.push(e);return IV(s,t.size),a?process.nextTick(r):this._drain=r,new ub}if(t.type===\"symlink\"&&!t.linkname){var n=new RN;return ISe(n,function(f){if(f)return s.destroy(),r(f);t.linkname=n.linkname,s._encode(t),r()}),n}if(this._encode(t),t.type!==\"file\"&&t.type!==\"contiguous-file\")return process.nextTick(r),new ub;var c=new TN(this);return this._stream=c,ISe(c,function(f){if(s._stream=null,f)return s.destroy(),r(f);if(c.written!==t.size)return s.destroy(),r(new Error(\"size mismatch\"));IV(s,t.size),s._finalizing&&s.finalize(),r()}),c}};mA.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(wSe),this.push(null))};mA.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit(\"error\",t),this.emit(\"close\"),this._stream&&this._stream.destroy&&this._stream.destroy())};mA.prototype._encode=function(t){if(!t.pax){var e=kN.encode(t);if(e){this.push(e);return}}this._encodePax(t)};mA.prototype._encodePax=function(t){var e=kN.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:\"PaxHeader\",mode:t.mode,uid:t.uid,gid:t.gid,size:e.length,mtime:t.mtime,type:\"pax-header\",linkname:t.linkname&&\"PaxHeader\",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(kN.encode(r)),this.push(e),IV(this,e.length),r.size=t.size,r.type=t.type,this.push(kN.encode(r))};mA.prototype._read=function(t){var e=this._drain;this._drain=CV,e()};BSe.exports=mA});var SSe=_(wV=>{wV.extract=mSe();wV.pack=vSe()});var MSe=_(Ta=>{\"use strict\";var zEt=Ta&&Ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ta,\"__esModule\",{value:!0});Ta.Minipass=Ta.isWritable=Ta.isReadable=Ta.isStream=void 0;var RSe=typeof process==\"object\"&&process?process:{stdout:null,stderr:null},FV=Ie(\"node:events\"),LSe=zEt(Ie(\"node:stream\")),XEt=Ie(\"node:string_decoder\"),ZEt=t=>!!t&&typeof t==\"object\"&&(t instanceof jN||t instanceof LSe.default||(0,Ta.isReadable)(t)||(0,Ta.isWritable)(t));Ta.isStream=ZEt;var $Et=t=>!!t&&typeof t==\"object\"&&t instanceof FV.EventEmitter&&typeof t.pipe==\"function\"&&t.pipe!==LSe.default.Writable.prototype.pipe;Ta.isReadable=$Et;var eIt=t=>!!t&&typeof t==\"object\"&&t instanceof FV.EventEmitter&&typeof t.write==\"function\"&&typeof t.end==\"function\";Ta.isWritable=eIt;var uh=Symbol(\"EOF\"),fh=Symbol(\"maybeEmitEnd\"),dg=Symbol(\"emittedEnd\"),ON=Symbol(\"emittingEnd\"),fb=Symbol(\"emittedError\"),LN=Symbol(\"closed\"),FSe=Symbol(\"read\"),MN=Symbol(\"flush\"),NSe=Symbol(\"flushChunk\"),uf=Symbol(\"encoding\"),Gw=Symbol(\"decoder\"),Ks=Symbol(\"flowing\"),Ab=Symbol(\"paused\"),qw=Symbol(\"resume\"),zs=Symbol(\"buffer\"),Qa=Symbol(\"pipes\"),Xs=Symbol(\"bufferLength\"),PV=Symbol(\"bufferPush\"),UN=Symbol(\"bufferShift\"),na=Symbol(\"objectMode\"),ts=Symbol(\"destroyed\"),xV=Symbol(\"error\"),kV=Symbol(\"emitData\"),OSe=Symbol(\"emitEnd\"),QV=Symbol(\"emitEnd2\"),EA=Symbol(\"async\"),TV=Symbol(\"abort\"),_N=Symbol(\"aborted\"),pb=Symbol(\"signal\"),zm=Symbol(\"dataListeners\"),rc=Symbol(\"discarded\"),hb=t=>Promise.resolve().then(t),tIt=t=>t(),rIt=t=>t===\"end\"||t===\"finish\"||t===\"prefinish\",nIt=t=>t instanceof ArrayBuffer||!!t&&typeof t==\"object\"&&t.constructor&&t.constructor.name===\"ArrayBuffer\"&&t.byteLength>=0,iIt=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),HN=class{src;dest;opts;ondrain;constructor(e,r,s){this.src=e,this.dest=r,this.opts=s,this.ondrain=()=>e[qw](),this.dest.on(\"drain\",this.ondrain)}unpipe(){this.dest.removeListener(\"drain\",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},RV=class extends HN{unpipe(){this.src.removeListener(\"error\",this.proxyErrors),super.unpipe()}constructor(e,r,s){super(e,r,s),this.proxyErrors=a=>r.emit(\"error\",a),e.on(\"error\",this.proxyErrors)}},sIt=t=>!!t.objectMode,oIt=t=>!t.objectMode&&!!t.encoding&&t.encoding!==\"buffer\",jN=class extends FV.EventEmitter{[Ks]=!1;[Ab]=!1;[Qa]=[];[zs]=[];[na];[uf];[EA];[Gw];[uh]=!1;[dg]=!1;[ON]=!1;[LN]=!1;[fb]=null;[Xs]=0;[ts]=!1;[pb];[_N]=!1;[zm]=0;[rc]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding==\"string\")throw new TypeError(\"Encoding and objectMode may not be used together\");sIt(r)?(this[na]=!0,this[uf]=null):oIt(r)?(this[uf]=r.encoding,this[na]=!1):(this[na]=!1,this[uf]=null),this[EA]=!!r.async,this[Gw]=this[uf]?new XEt.StringDecoder(this[uf]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,\"buffer\",{get:()=>this[zs]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,\"pipes\",{get:()=>this[Qa]});let{signal:s}=r;s&&(this[pb]=s,s.aborted?this[TV]():s.addEventListener(\"abort\",()=>this[TV]()))}get bufferLength(){return this[Xs]}get encoding(){return this[uf]}set encoding(e){throw new Error(\"Encoding must be set at instantiation time\")}setEncoding(e){throw new Error(\"Encoding must be set at instantiation time\")}get objectMode(){return this[na]}set objectMode(e){throw new Error(\"objectMode must be set at instantiation time\")}get async(){return this[EA]}set async(e){this[EA]=this[EA]||!!e}[TV](){this[_N]=!0,this.emit(\"abort\",this[pb]?.reason),this.destroy(this[pb]?.reason)}get aborted(){return this[_N]}set aborted(e){}write(e,r,s){if(this[_N])return!1;if(this[uh])throw new Error(\"write after end\");if(this[ts])return this.emit(\"error\",Object.assign(new Error(\"Cannot call write after a stream was destroyed\"),{code:\"ERR_STREAM_DESTROYED\"})),!0;typeof r==\"function\"&&(s=r,r=\"utf8\"),r||(r=\"utf8\");let a=this[EA]?hb:tIt;if(!this[na]&&!Buffer.isBuffer(e)){if(iIt(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(nIt(e))e=Buffer.from(e);else if(typeof e!=\"string\")throw new Error(\"Non-contiguous data written to non-objectMode stream\")}return this[na]?(this[Ks]&&this[Xs]!==0&&this[MN](!0),this[Ks]?this.emit(\"data\",e):this[PV](e),this[Xs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks]):e.length?(typeof e==\"string\"&&!(r===this[uf]&&!this[Gw]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[uf]&&(e=this[Gw].write(e)),this[Ks]&&this[Xs]!==0&&this[MN](!0),this[Ks]?this.emit(\"data\",e):this[PV](e),this[Xs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks]):(this[Xs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks])}read(e){if(this[ts])return null;if(this[rc]=!1,this[Xs]===0||e===0||e&&e>this[Xs])return this[fh](),null;this[na]&&(e=null),this[zs].length>1&&!this[na]&&(this[zs]=[this[uf]?this[zs].join(\"\"):Buffer.concat(this[zs],this[Xs])]);let r=this[FSe](e||null,this[zs][0]);return this[fh](),r}[FSe](e,r){if(this[na])this[UN]();else{let s=r;e===s.length||e===null?this[UN]():typeof s==\"string\"?(this[zs][0]=s.slice(e),r=s.slice(0,e),this[Xs]-=e):(this[zs][0]=s.subarray(e),r=s.subarray(0,e),this[Xs]-=e)}return this.emit(\"data\",r),!this[zs].length&&!this[uh]&&this.emit(\"drain\"),r}end(e,r,s){return typeof e==\"function\"&&(s=e,e=void 0),typeof r==\"function\"&&(s=r,r=\"utf8\"),e!==void 0&&this.write(e,r),s&&this.once(\"end\",s),this[uh]=!0,this.writable=!1,(this[Ks]||!this[Ab])&&this[fh](),this}[qw](){this[ts]||(!this[zm]&&!this[Qa].length&&(this[rc]=!0),this[Ab]=!1,this[Ks]=!0,this.emit(\"resume\"),this[zs].length?this[MN]():this[uh]?this[fh]():this.emit(\"drain\"))}resume(){return this[qw]()}pause(){this[Ks]=!1,this[Ab]=!0,this[rc]=!1}get destroyed(){return this[ts]}get flowing(){return this[Ks]}get paused(){return this[Ab]}[PV](e){this[na]?this[Xs]+=1:this[Xs]+=e.length,this[zs].push(e)}[UN](){return this[na]?this[Xs]-=1:this[Xs]-=this[zs][0].length,this[zs].shift()}[MN](e=!1){do;while(this[NSe](this[UN]())&&this[zs].length);!e&&!this[zs].length&&!this[uh]&&this.emit(\"drain\")}[NSe](e){return this.emit(\"data\",e),this[Ks]}pipe(e,r){if(this[ts])return e;this[rc]=!1;let s=this[dg];return r=r||{},e===RSe.stdout||e===RSe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,s?r.end&&e.end():(this[Qa].push(r.proxyErrors?new RV(this,e,r):new HN(this,e,r)),this[EA]?hb(()=>this[qw]()):this[qw]()),e}unpipe(e){let r=this[Qa].find(s=>s.dest===e);r&&(this[Qa].length===1?(this[Ks]&&this[zm]===0&&(this[Ks]=!1),this[Qa]=[]):this[Qa].splice(this[Qa].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let s=super.on(e,r);if(e===\"data\")this[rc]=!1,this[zm]++,!this[Qa].length&&!this[Ks]&&this[qw]();else if(e===\"readable\"&&this[Xs]!==0)super.emit(\"readable\");else if(rIt(e)&&this[dg])super.emit(e),this.removeAllListeners(e);else if(e===\"error\"&&this[fb]){let a=r;this[EA]?hb(()=>a.call(this,this[fb])):a.call(this,this[fb])}return s}removeListener(e,r){return this.off(e,r)}off(e,r){let s=super.off(e,r);return e===\"data\"&&(this[zm]=this.listeners(\"data\").length,this[zm]===0&&!this[rc]&&!this[Qa].length&&(this[Ks]=!1)),s}removeAllListeners(e){let r=super.removeAllListeners(e);return(e===\"data\"||e===void 0)&&(this[zm]=0,!this[rc]&&!this[Qa].length&&(this[Ks]=!1)),r}get emittedEnd(){return this[dg]}[fh](){!this[ON]&&!this[dg]&&!this[ts]&&this[zs].length===0&&this[uh]&&(this[ON]=!0,this.emit(\"end\"),this.emit(\"prefinish\"),this.emit(\"finish\"),this[LN]&&this.emit(\"close\"),this[ON]=!1)}emit(e,...r){let s=r[0];if(e!==\"error\"&&e!==\"close\"&&e!==ts&&this[ts])return!1;if(e===\"data\")return!this[na]&&!s?!1:this[EA]?(hb(()=>this[kV](s)),!0):this[kV](s);if(e===\"end\")return this[OSe]();if(e===\"close\"){if(this[LN]=!0,!this[dg]&&!this[ts])return!1;let n=super.emit(\"close\");return this.removeAllListeners(\"close\"),n}else if(e===\"error\"){this[fb]=s,super.emit(xV,s);let n=!this[pb]||this.listeners(\"error\").length?super.emit(\"error\",s):!1;return this[fh](),n}else if(e===\"resume\"){let n=super.emit(\"resume\");return this[fh](),n}else if(e===\"finish\"||e===\"prefinish\"){let n=super.emit(e);return this.removeAllListeners(e),n}let a=super.emit(e,...r);return this[fh](),a}[kV](e){for(let s of this[Qa])s.dest.write(e)===!1&&this.pause();let r=this[rc]?!1:super.emit(\"data\",e);return this[fh](),r}[OSe](){return this[dg]?!1:(this[dg]=!0,this.readable=!1,this[EA]?(hb(()=>this[QV]()),!0):this[QV]())}[QV](){if(this[Gw]){let r=this[Gw].end();if(r){for(let s of this[Qa])s.dest.write(r);this[rc]||super.emit(\"data\",r)}}for(let r of this[Qa])r.end();let e=super.emit(\"end\");return this.removeAllListeners(\"end\"),e}async collect(){let e=Object.assign([],{dataLength:0});this[na]||(e.dataLength=0);let r=this.promise();return this.on(\"data\",s=>{e.push(s),this[na]||(e.dataLength+=s.length)}),await r,e}async concat(){if(this[na])throw new Error(\"cannot concat in objectMode\");let e=await this.collect();return this[uf]?e.join(\"\"):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ts,()=>r(new Error(\"stream destroyed\"))),this.on(\"error\",s=>r(s)),this.on(\"end\",()=>e())})}[Symbol.asyncIterator](){this[rc]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let a=this.read();if(a!==null)return Promise.resolve({done:!1,value:a});if(this[uh])return r();let n,c,f=C=>{this.off(\"data\",p),this.off(\"end\",h),this.off(ts,E),r(),c(C)},p=C=>{this.off(\"error\",f),this.off(\"end\",h),this.off(ts,E),this.pause(),n({value:C,done:!!this[uh]})},h=()=>{this.off(\"error\",f),this.off(\"data\",p),this.off(ts,E),r(),n({done:!0,value:void 0})},E=()=>f(new Error(\"stream destroyed\"));return new Promise((C,S)=>{c=S,n=C,this.once(ts,E),this.once(\"error\",f),this.once(\"end\",h),this.once(\"data\",p)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[rc]=!1;let e=!1,r=()=>(this.pause(),this.off(xV,r),this.off(ts,r),this.off(\"end\",r),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return r();let a=this.read();return a===null?r():{done:!1,value:a}};return this.once(\"end\",r),this.once(xV,r),this.once(ts,r),{next:s,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ts])return e?this.emit(\"error\",e):this.emit(ts),this;this[ts]=!0,this[rc]=!0,this[zs].length=0,this[Xs]=0;let r=this;return typeof r.close==\"function\"&&!this[LN]&&r.close(),e?this.emit(\"error\",e):this.emit(ts),this}static get isStream(){return Ta.isStream}};Ta.Minipass=jN});var HSe=_((Trr,IA)=>{\"use strict\";var db=Ie(\"crypto\"),{Minipass:aIt}=MSe(),OV=[\"sha512\",\"sha384\",\"sha256\"],MV=[\"sha512\"],lIt=/^[a-z0-9+/]+(?:=?=?)$/i,cIt=/^([a-z0-9]+)-([^?]+)([?\\S*]*)$/,uIt=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\\?[\\x21-\\x7E]*)?$/,fIt=/^[\\x21-\\x7E]+$/,mb=t=>t?.length?`?${t.join(\"?\")}`:\"\",LV=class extends aIt{#t;#r;#i;constructor(e){super(),this.size=0,this.opts=e,this.#e(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...MV],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(db.createHash)}#e(){this.sri=this.opts?.integrity?nc(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=mb(this.opts?.options)}on(e,r){return e===\"size\"&&this.#r?r(this.#r):e===\"integrity\"&&this.#t?r(this.#t):e===\"verified\"&&this.#i?r(this.#i):super.on(e,r)}emit(e,r){return e===\"end\"&&this.#n(),super.emit(e,r)}write(e){return this.size+=e.length,this.hashes.forEach(r=>r.update(e)),super.write(e)}#n(){this.goodSri||this.#e();let e=nc(this.hashes.map((s,a)=>`${this.algorithms[a]}-${s.digest(\"base64\")}${this.optString}`).join(\" \"),this.opts),r=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize==\"number\"&&this.size!==this.expectedSize){let s=new Error(`stream size mismatch when checking ${this.sri}.\n  Wanted: ${this.expectedSize}\n  Found: ${this.size}`);s.code=\"EBADSIZE\",s.found=this.size,s.expected=this.expectedSize,s.sri=this.sri,this.emit(\"error\",s)}else if(this.sri&&!r){let s=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);s.code=\"EINTEGRITY\",s.found=e,s.expected=this.digests,s.algorithm=this.algorithm,s.sri=this.sri,this.emit(\"error\",s)}else this.#r=this.size,this.emit(\"size\",this.size),this.#t=e,this.emit(\"integrity\",e),r&&(this.#i=r,this.emit(\"verified\",r))}},Ah=class{get isHash(){return!0}constructor(e,r){let s=r?.strict;this.source=e.trim(),this.digest=\"\",this.algorithm=\"\",this.options=[];let a=this.source.match(s?uIt:cIt);if(!a||s&&!OV.includes(a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];n&&(this.options=n.slice(1).split(\"?\"))}hexDigest(){return this.digest&&Buffer.from(this.digest,\"base64\").toString(\"hex\")}toJSON(){return this.toString()}match(e,r){let s=nc(e,r);if(!s)return!1;if(s.isIntegrity){let a=s.pickAlgorithm(r,[this.algorithm]);if(!a)return!1;let n=s[a].find(c=>c.digest===this.digest);return n||!1}return s.digest===this.digest?s:!1}toString(e){return e?.strict&&!(OV.includes(this.algorithm)&&this.digest.match(lIt)&&this.options.every(r=>r.match(fIt)))?\"\":`${this.algorithm}-${this.digest}${mb(this.options)}`}};function USe(t,e,r,s){let a=t!==\"\",n=!1,c=\"\",f=s.length-1;for(let h=0;h<f;h++){let E=Ah.prototype.toString.call(s[h],r);E&&(n=!0,c+=E,c+=e)}let p=Ah.prototype.toString.call(s[f],r);return p&&(n=!0,c+=p),a&&n?t+e+c:t+c}var Xm=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let r=e?.sep||\" \",s=\"\";if(e?.strict){r=r.replace(/\\S+/g,\" \");for(let a of OV)this[a]&&(s=USe(s,r,e,this[a]))}else for(let a of Object.keys(this))s=USe(s,r,e,this[a]);return s}concat(e,r){let s=typeof e==\"string\"?e:gb(e,r);return nc(`${this.toString(r)} ${s}`,r)}hexDigest(){return nc(this,{single:!0}).hexDigest()}merge(e,r){let s=nc(e,r);for(let a in s)if(this[a]){if(!this[a].find(n=>s[a].find(c=>n.digest===c.digest)))throw new Error(\"hashes do not match, cannot update integrity\")}else this[a]=s[a]}match(e,r){let s=nc(e,r);if(!s)return!1;let a=s.pickAlgorithm(r,Object.keys(this));return!!a&&this[a]&&s[a]&&this[a].find(n=>s[a].find(c=>n.digest===c.digest))||!1}pickAlgorithm(e,r){let s=e?.pickAlgorithm||EIt,a=Object.keys(this).filter(n=>r?.length?r.includes(n):!0);return a.length?a.reduce((n,c)=>s(n,c)||n):null}};IA.exports.parse=nc;function nc(t,e){if(!t)return null;if(typeof t==\"string\")return NV(t,e);if(t.algorithm&&t.digest){let r=new Xm;return r[t.algorithm]=[t],NV(gb(r,e),e)}else return NV(gb(t,e),e)}function NV(t,e){if(e?.single)return new Ah(t,e);let r=t.trim().split(/\\s+/).reduce((s,a)=>{let n=new Ah(a,e);if(n.algorithm&&n.digest){let c=n.algorithm;s[c]||(s[c]=[]),s[c].push(n)}return s},new Xm);return r.isEmpty()?null:r}IA.exports.stringify=gb;function gb(t,e){return t.algorithm&&t.digest?Ah.prototype.toString.call(t,e):typeof t==\"string\"?gb(nc(t,e),e):Xm.prototype.toString.call(t,e)}IA.exports.fromHex=AIt;function AIt(t,e,r){let s=mb(r?.options);return nc(`${e}-${Buffer.from(t,\"hex\").toString(\"base64\")}${s}`,r)}IA.exports.fromData=pIt;function pIt(t,e){let r=e?.algorithms||[...MV],s=mb(e?.options);return r.reduce((a,n)=>{let c=db.createHash(n).update(t).digest(\"base64\"),f=new Ah(`${n}-${c}${s}`,e);if(f.algorithm&&f.digest){let p=f.algorithm;a[p]||(a[p]=[]),a[p].push(f)}return a},new Xm)}IA.exports.fromStream=hIt;function hIt(t,e){let r=UV(e);return new Promise((s,a)=>{t.pipe(r),t.on(\"error\",a),r.on(\"error\",a);let n;r.on(\"integrity\",c=>{n=c}),r.on(\"end\",()=>s(n)),r.resume()})}IA.exports.checkData=gIt;function gIt(t,e,r){if(e=nc(e,r),!e||!Object.keys(e).length){if(r?.error)throw Object.assign(new Error(\"No valid integrity hashes to check against\"),{code:\"EINTEGRITY\"});return!1}let s=e.pickAlgorithm(r),a=db.createHash(s).update(t).digest(\"base64\"),n=nc({algorithm:s,digest:a}),c=n.match(e,r);if(r=r||{},c||!r.error)return c;if(typeof r.size==\"number\"&&t.length!==r.size){let f=new Error(`data size mismatch when checking ${e}.\n  Wanted: ${r.size}\n  Found: ${t.length}`);throw f.code=\"EBADSIZE\",f.found=t.length,f.expected=r.size,f.sri=e,f}else{let f=new Error(`Integrity checksum failed when using ${s}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw f.code=\"EINTEGRITY\",f.found=n,f.expected=e,f.algorithm=s,f.sri=e,f}}IA.exports.checkStream=dIt;function dIt(t,e,r){if(r=r||Object.create(null),r.integrity=e,e=nc(e,r),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error(\"No valid integrity hashes to check against\"),{code:\"EINTEGRITY\"}));let s=UV(r);return new Promise((a,n)=>{t.pipe(s),t.on(\"error\",n),s.on(\"error\",n);let c;s.on(\"verified\",f=>{c=f}),s.on(\"end\",()=>a(c)),s.resume()})}IA.exports.integrityStream=UV;function UV(t=Object.create(null)){return new LV(t)}IA.exports.create=mIt;function mIt(t){let e=t?.algorithms||[...MV],r=mb(t?.options),s=e.map(db.createHash);return{update:function(a,n){return s.forEach(c=>c.update(a,n)),this},digest:function(){return e.reduce((n,c)=>{let f=s.shift().digest(\"base64\"),p=new Ah(`${c}-${f}${r}`,t);if(p.algorithm&&p.digest){let h=p.algorithm;n[h]||(n[h]=[]),n[h].push(p)}return n},new Xm)}}}var yIt=db.getHashes(),_Se=[\"md5\",\"whirlpool\",\"sha1\",\"sha224\",\"sha256\",\"sha384\",\"sha512\",\"sha3\",\"sha3-256\",\"sha3-384\",\"sha3-512\",\"sha3_256\",\"sha3_384\",\"sha3_512\"].filter(t=>yIt.includes(t));function EIt(t,e){return _Se.indexOf(t.toLowerCase())>=_Se.indexOf(e.toLowerCase())?t:e}});var _V=_(mg=>{\"use strict\";Object.defineProperty(mg,\"__esModule\",{value:!0});mg.Signature=mg.Envelope=void 0;mg.Envelope={fromJSON(t){return{payload:GN(t.payload)?Buffer.from(jSe(t.payload)):Buffer.alloc(0),payloadType:GN(t.payloadType)?globalThis.String(t.payloadType):\"\",signatures:globalThis.Array.isArray(t?.signatures)?t.signatures.map(e=>mg.Signature.fromJSON(e)):[]}},toJSON(t){let e={};return t.payload.length!==0&&(e.payload=GSe(t.payload)),t.payloadType!==\"\"&&(e.payloadType=t.payloadType),t.signatures?.length&&(e.signatures=t.signatures.map(r=>mg.Signature.toJSON(r))),e}};mg.Signature={fromJSON(t){return{sig:GN(t.sig)?Buffer.from(jSe(t.sig)):Buffer.alloc(0),keyid:GN(t.keyid)?globalThis.String(t.keyid):\"\"}},toJSON(t){let e={};return t.sig.length!==0&&(e.sig=GSe(t.sig)),t.keyid!==\"\"&&(e.keyid=t.keyid),e}};function jSe(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function GSe(t){return globalThis.Buffer.from(t).toString(\"base64\")}function GN(t){return t!=null}});var WSe=_(qN=>{\"use strict\";Object.defineProperty(qN,\"__esModule\",{value:!0});qN.Timestamp=void 0;qN.Timestamp={fromJSON(t){return{seconds:qSe(t.seconds)?globalThis.String(t.seconds):\"0\",nanos:qSe(t.nanos)?globalThis.Number(t.nanos):0}},toJSON(t){let e={};return t.seconds!==\"0\"&&(e.seconds=t.seconds),t.nanos!==0&&(e.nanos=Math.round(t.nanos)),e}};function qSe(t){return t!=null}});var Ww=_(Ur=>{\"use strict\";Object.defineProperty(Ur,\"__esModule\",{value:!0});Ur.TimeRange=Ur.X509CertificateChain=Ur.SubjectAlternativeName=Ur.X509Certificate=Ur.DistinguishedName=Ur.ObjectIdentifierValuePair=Ur.ObjectIdentifier=Ur.PublicKeyIdentifier=Ur.PublicKey=Ur.RFC3161SignedTimestamp=Ur.LogId=Ur.MessageSignature=Ur.HashOutput=Ur.SubjectAlternativeNameType=Ur.PublicKeyDetails=Ur.HashAlgorithm=void 0;Ur.hashAlgorithmFromJSON=VSe;Ur.hashAlgorithmToJSON=JSe;Ur.publicKeyDetailsFromJSON=KSe;Ur.publicKeyDetailsToJSON=zSe;Ur.subjectAlternativeNameTypeFromJSON=XSe;Ur.subjectAlternativeNameTypeToJSON=ZSe;var IIt=WSe(),yl;(function(t){t[t.HASH_ALGORITHM_UNSPECIFIED=0]=\"HASH_ALGORITHM_UNSPECIFIED\",t[t.SHA2_256=1]=\"SHA2_256\",t[t.SHA2_384=2]=\"SHA2_384\",t[t.SHA2_512=3]=\"SHA2_512\",t[t.SHA3_256=4]=\"SHA3_256\",t[t.SHA3_384=5]=\"SHA3_384\"})(yl||(Ur.HashAlgorithm=yl={}));function VSe(t){switch(t){case 0:case\"HASH_ALGORITHM_UNSPECIFIED\":return yl.HASH_ALGORITHM_UNSPECIFIED;case 1:case\"SHA2_256\":return yl.SHA2_256;case 2:case\"SHA2_384\":return yl.SHA2_384;case 3:case\"SHA2_512\":return yl.SHA2_512;case 4:case\"SHA3_256\":return yl.SHA3_256;case 5:case\"SHA3_384\":return yl.SHA3_384;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum HashAlgorithm\")}}function JSe(t){switch(t){case yl.HASH_ALGORITHM_UNSPECIFIED:return\"HASH_ALGORITHM_UNSPECIFIED\";case yl.SHA2_256:return\"SHA2_256\";case yl.SHA2_384:return\"SHA2_384\";case yl.SHA2_512:return\"SHA2_512\";case yl.SHA3_256:return\"SHA3_256\";case yl.SHA3_384:return\"SHA3_384\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum HashAlgorithm\")}}var sn;(function(t){t[t.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]=\"PUBLIC_KEY_DETAILS_UNSPECIFIED\",t[t.PKCS1_RSA_PKCS1V5=1]=\"PKCS1_RSA_PKCS1V5\",t[t.PKCS1_RSA_PSS=2]=\"PKCS1_RSA_PSS\",t[t.PKIX_RSA_PKCS1V5=3]=\"PKIX_RSA_PKCS1V5\",t[t.PKIX_RSA_PSS=4]=\"PKIX_RSA_PSS\",t[t.PKIX_RSA_PKCS1V15_2048_SHA256=9]=\"PKIX_RSA_PKCS1V15_2048_SHA256\",t[t.PKIX_RSA_PKCS1V15_3072_SHA256=10]=\"PKIX_RSA_PKCS1V15_3072_SHA256\",t[t.PKIX_RSA_PKCS1V15_4096_SHA256=11]=\"PKIX_RSA_PKCS1V15_4096_SHA256\",t[t.PKIX_RSA_PSS_2048_SHA256=16]=\"PKIX_RSA_PSS_2048_SHA256\",t[t.PKIX_RSA_PSS_3072_SHA256=17]=\"PKIX_RSA_PSS_3072_SHA256\",t[t.PKIX_RSA_PSS_4096_SHA256=18]=\"PKIX_RSA_PSS_4096_SHA256\",t[t.PKIX_ECDSA_P256_HMAC_SHA_256=6]=\"PKIX_ECDSA_P256_HMAC_SHA_256\",t[t.PKIX_ECDSA_P256_SHA_256=5]=\"PKIX_ECDSA_P256_SHA_256\",t[t.PKIX_ECDSA_P384_SHA_384=12]=\"PKIX_ECDSA_P384_SHA_384\",t[t.PKIX_ECDSA_P521_SHA_512=13]=\"PKIX_ECDSA_P521_SHA_512\",t[t.PKIX_ED25519=7]=\"PKIX_ED25519\",t[t.PKIX_ED25519_PH=8]=\"PKIX_ED25519_PH\",t[t.LMS_SHA256=14]=\"LMS_SHA256\",t[t.LMOTS_SHA256=15]=\"LMOTS_SHA256\"})(sn||(Ur.PublicKeyDetails=sn={}));function KSe(t){switch(t){case 0:case\"PUBLIC_KEY_DETAILS_UNSPECIFIED\":return sn.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case\"PKCS1_RSA_PKCS1V5\":return sn.PKCS1_RSA_PKCS1V5;case 2:case\"PKCS1_RSA_PSS\":return sn.PKCS1_RSA_PSS;case 3:case\"PKIX_RSA_PKCS1V5\":return sn.PKIX_RSA_PKCS1V5;case 4:case\"PKIX_RSA_PSS\":return sn.PKIX_RSA_PSS;case 9:case\"PKIX_RSA_PKCS1V15_2048_SHA256\":return sn.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case\"PKIX_RSA_PKCS1V15_3072_SHA256\":return sn.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case\"PKIX_RSA_PKCS1V15_4096_SHA256\":return sn.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case\"PKIX_RSA_PSS_2048_SHA256\":return sn.PKIX_RSA_PSS_2048_SHA256;case 17:case\"PKIX_RSA_PSS_3072_SHA256\":return sn.PKIX_RSA_PSS_3072_SHA256;case 18:case\"PKIX_RSA_PSS_4096_SHA256\":return sn.PKIX_RSA_PSS_4096_SHA256;case 6:case\"PKIX_ECDSA_P256_HMAC_SHA_256\":return sn.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case\"PKIX_ECDSA_P256_SHA_256\":return sn.PKIX_ECDSA_P256_SHA_256;case 12:case\"PKIX_ECDSA_P384_SHA_384\":return sn.PKIX_ECDSA_P384_SHA_384;case 13:case\"PKIX_ECDSA_P521_SHA_512\":return sn.PKIX_ECDSA_P521_SHA_512;case 7:case\"PKIX_ED25519\":return sn.PKIX_ED25519;case 8:case\"PKIX_ED25519_PH\":return sn.PKIX_ED25519_PH;case 14:case\"LMS_SHA256\":return sn.LMS_SHA256;case 15:case\"LMOTS_SHA256\":return sn.LMOTS_SHA256;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum PublicKeyDetails\")}}function zSe(t){switch(t){case sn.PUBLIC_KEY_DETAILS_UNSPECIFIED:return\"PUBLIC_KEY_DETAILS_UNSPECIFIED\";case sn.PKCS1_RSA_PKCS1V5:return\"PKCS1_RSA_PKCS1V5\";case sn.PKCS1_RSA_PSS:return\"PKCS1_RSA_PSS\";case sn.PKIX_RSA_PKCS1V5:return\"PKIX_RSA_PKCS1V5\";case sn.PKIX_RSA_PSS:return\"PKIX_RSA_PSS\";case sn.PKIX_RSA_PKCS1V15_2048_SHA256:return\"PKIX_RSA_PKCS1V15_2048_SHA256\";case sn.PKIX_RSA_PKCS1V15_3072_SHA256:return\"PKIX_RSA_PKCS1V15_3072_SHA256\";case sn.PKIX_RSA_PKCS1V15_4096_SHA256:return\"PKIX_RSA_PKCS1V15_4096_SHA256\";case sn.PKIX_RSA_PSS_2048_SHA256:return\"PKIX_RSA_PSS_2048_SHA256\";case sn.PKIX_RSA_PSS_3072_SHA256:return\"PKIX_RSA_PSS_3072_SHA256\";case sn.PKIX_RSA_PSS_4096_SHA256:return\"PKIX_RSA_PSS_4096_SHA256\";case sn.PKIX_ECDSA_P256_HMAC_SHA_256:return\"PKIX_ECDSA_P256_HMAC_SHA_256\";case sn.PKIX_ECDSA_P256_SHA_256:return\"PKIX_ECDSA_P256_SHA_256\";case sn.PKIX_ECDSA_P384_SHA_384:return\"PKIX_ECDSA_P384_SHA_384\";case sn.PKIX_ECDSA_P521_SHA_512:return\"PKIX_ECDSA_P521_SHA_512\";case sn.PKIX_ED25519:return\"PKIX_ED25519\";case sn.PKIX_ED25519_PH:return\"PKIX_ED25519_PH\";case sn.LMS_SHA256:return\"LMS_SHA256\";case sn.LMOTS_SHA256:return\"LMOTS_SHA256\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum PublicKeyDetails\")}}var CA;(function(t){t[t.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]=\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\",t[t.EMAIL=1]=\"EMAIL\",t[t.URI=2]=\"URI\",t[t.OTHER_NAME=3]=\"OTHER_NAME\"})(CA||(Ur.SubjectAlternativeNameType=CA={}));function XSe(t){switch(t){case 0:case\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\":return CA.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case\"EMAIL\":return CA.EMAIL;case 2:case\"URI\":return CA.URI;case 3:case\"OTHER_NAME\":return CA.OTHER_NAME;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum SubjectAlternativeNameType\")}}function ZSe(t){switch(t){case CA.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\";case CA.EMAIL:return\"EMAIL\";case CA.URI:return\"URI\";case CA.OTHER_NAME:return\"OTHER_NAME\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum SubjectAlternativeNameType\")}}Ur.HashOutput={fromJSON(t){return{algorithm:ds(t.algorithm)?VSe(t.algorithm):0,digest:ds(t.digest)?Buffer.from(Zm(t.digest)):Buffer.alloc(0)}},toJSON(t){let e={};return t.algorithm!==0&&(e.algorithm=JSe(t.algorithm)),t.digest.length!==0&&(e.digest=$m(t.digest)),e}};Ur.MessageSignature={fromJSON(t){return{messageDigest:ds(t.messageDigest)?Ur.HashOutput.fromJSON(t.messageDigest):void 0,signature:ds(t.signature)?Buffer.from(Zm(t.signature)):Buffer.alloc(0)}},toJSON(t){let e={};return t.messageDigest!==void 0&&(e.messageDigest=Ur.HashOutput.toJSON(t.messageDigest)),t.signature.length!==0&&(e.signature=$m(t.signature)),e}};Ur.LogId={fromJSON(t){return{keyId:ds(t.keyId)?Buffer.from(Zm(t.keyId)):Buffer.alloc(0)}},toJSON(t){let e={};return t.keyId.length!==0&&(e.keyId=$m(t.keyId)),e}};Ur.RFC3161SignedTimestamp={fromJSON(t){return{signedTimestamp:ds(t.signedTimestamp)?Buffer.from(Zm(t.signedTimestamp)):Buffer.alloc(0)}},toJSON(t){let e={};return t.signedTimestamp.length!==0&&(e.signedTimestamp=$m(t.signedTimestamp)),e}};Ur.PublicKey={fromJSON(t){return{rawBytes:ds(t.rawBytes)?Buffer.from(Zm(t.rawBytes)):void 0,keyDetails:ds(t.keyDetails)?KSe(t.keyDetails):0,validFor:ds(t.validFor)?Ur.TimeRange.fromJSON(t.validFor):void 0}},toJSON(t){let e={};return t.rawBytes!==void 0&&(e.rawBytes=$m(t.rawBytes)),t.keyDetails!==0&&(e.keyDetails=zSe(t.keyDetails)),t.validFor!==void 0&&(e.validFor=Ur.TimeRange.toJSON(t.validFor)),e}};Ur.PublicKeyIdentifier={fromJSON(t){return{hint:ds(t.hint)?globalThis.String(t.hint):\"\"}},toJSON(t){let e={};return t.hint!==\"\"&&(e.hint=t.hint),e}};Ur.ObjectIdentifier={fromJSON(t){return{id:globalThis.Array.isArray(t?.id)?t.id.map(e=>globalThis.Number(e)):[]}},toJSON(t){let e={};return t.id?.length&&(e.id=t.id.map(r=>Math.round(r))),e}};Ur.ObjectIdentifierValuePair={fromJSON(t){return{oid:ds(t.oid)?Ur.ObjectIdentifier.fromJSON(t.oid):void 0,value:ds(t.value)?Buffer.from(Zm(t.value)):Buffer.alloc(0)}},toJSON(t){let e={};return t.oid!==void 0&&(e.oid=Ur.ObjectIdentifier.toJSON(t.oid)),t.value.length!==0&&(e.value=$m(t.value)),e}};Ur.DistinguishedName={fromJSON(t){return{organization:ds(t.organization)?globalThis.String(t.organization):\"\",commonName:ds(t.commonName)?globalThis.String(t.commonName):\"\"}},toJSON(t){let e={};return t.organization!==\"\"&&(e.organization=t.organization),t.commonName!==\"\"&&(e.commonName=t.commonName),e}};Ur.X509Certificate={fromJSON(t){return{rawBytes:ds(t.rawBytes)?Buffer.from(Zm(t.rawBytes)):Buffer.alloc(0)}},toJSON(t){let e={};return t.rawBytes.length!==0&&(e.rawBytes=$m(t.rawBytes)),e}};Ur.SubjectAlternativeName={fromJSON(t){return{type:ds(t.type)?XSe(t.type):0,identity:ds(t.regexp)?{$case:\"regexp\",regexp:globalThis.String(t.regexp)}:ds(t.value)?{$case:\"value\",value:globalThis.String(t.value)}:void 0}},toJSON(t){let e={};return t.type!==0&&(e.type=ZSe(t.type)),t.identity?.$case===\"regexp\"?e.regexp=t.identity.regexp:t.identity?.$case===\"value\"&&(e.value=t.identity.value),e}};Ur.X509CertificateChain={fromJSON(t){return{certificates:globalThis.Array.isArray(t?.certificates)?t.certificates.map(e=>Ur.X509Certificate.fromJSON(e)):[]}},toJSON(t){let e={};return t.certificates?.length&&(e.certificates=t.certificates.map(r=>Ur.X509Certificate.toJSON(r))),e}};Ur.TimeRange={fromJSON(t){return{start:ds(t.start)?YSe(t.start):void 0,end:ds(t.end)?YSe(t.end):void 0}},toJSON(t){let e={};return t.start!==void 0&&(e.start=t.start.toISOString()),t.end!==void 0&&(e.end=t.end.toISOString()),e}};function Zm(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function $m(t){return globalThis.Buffer.from(t).toString(\"base64\")}function CIt(t){let e=(globalThis.Number(t.seconds)||0)*1e3;return e+=(t.nanos||0)/1e6,new globalThis.Date(e)}function YSe(t){return t instanceof globalThis.Date?t:typeof t==\"string\"?new globalThis.Date(t):CIt(IIt.Timestamp.fromJSON(t))}function ds(t){return t!=null}});var HV=_(ms=>{\"use strict\";Object.defineProperty(ms,\"__esModule\",{value:!0});ms.TransparencyLogEntry=ms.InclusionPromise=ms.InclusionProof=ms.Checkpoint=ms.KindVersion=void 0;var $Se=Ww();ms.KindVersion={fromJSON(t){return{kind:Ra(t.kind)?globalThis.String(t.kind):\"\",version:Ra(t.version)?globalThis.String(t.version):\"\"}},toJSON(t){let e={};return t.kind!==\"\"&&(e.kind=t.kind),t.version!==\"\"&&(e.version=t.version),e}};ms.Checkpoint={fromJSON(t){return{envelope:Ra(t.envelope)?globalThis.String(t.envelope):\"\"}},toJSON(t){let e={};return t.envelope!==\"\"&&(e.envelope=t.envelope),e}};ms.InclusionProof={fromJSON(t){return{logIndex:Ra(t.logIndex)?globalThis.String(t.logIndex):\"0\",rootHash:Ra(t.rootHash)?Buffer.from(WN(t.rootHash)):Buffer.alloc(0),treeSize:Ra(t.treeSize)?globalThis.String(t.treeSize):\"0\",hashes:globalThis.Array.isArray(t?.hashes)?t.hashes.map(e=>Buffer.from(WN(e))):[],checkpoint:Ra(t.checkpoint)?ms.Checkpoint.fromJSON(t.checkpoint):void 0}},toJSON(t){let e={};return t.logIndex!==\"0\"&&(e.logIndex=t.logIndex),t.rootHash.length!==0&&(e.rootHash=YN(t.rootHash)),t.treeSize!==\"0\"&&(e.treeSize=t.treeSize),t.hashes?.length&&(e.hashes=t.hashes.map(r=>YN(r))),t.checkpoint!==void 0&&(e.checkpoint=ms.Checkpoint.toJSON(t.checkpoint)),e}};ms.InclusionPromise={fromJSON(t){return{signedEntryTimestamp:Ra(t.signedEntryTimestamp)?Buffer.from(WN(t.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(t){let e={};return t.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=YN(t.signedEntryTimestamp)),e}};ms.TransparencyLogEntry={fromJSON(t){return{logIndex:Ra(t.logIndex)?globalThis.String(t.logIndex):\"0\",logId:Ra(t.logId)?$Se.LogId.fromJSON(t.logId):void 0,kindVersion:Ra(t.kindVersion)?ms.KindVersion.fromJSON(t.kindVersion):void 0,integratedTime:Ra(t.integratedTime)?globalThis.String(t.integratedTime):\"0\",inclusionPromise:Ra(t.inclusionPromise)?ms.InclusionPromise.fromJSON(t.inclusionPromise):void 0,inclusionProof:Ra(t.inclusionProof)?ms.InclusionProof.fromJSON(t.inclusionProof):void 0,canonicalizedBody:Ra(t.canonicalizedBody)?Buffer.from(WN(t.canonicalizedBody)):Buffer.alloc(0)}},toJSON(t){let e={};return t.logIndex!==\"0\"&&(e.logIndex=t.logIndex),t.logId!==void 0&&(e.logId=$Se.LogId.toJSON(t.logId)),t.kindVersion!==void 0&&(e.kindVersion=ms.KindVersion.toJSON(t.kindVersion)),t.integratedTime!==\"0\"&&(e.integratedTime=t.integratedTime),t.inclusionPromise!==void 0&&(e.inclusionPromise=ms.InclusionPromise.toJSON(t.inclusionPromise)),t.inclusionProof!==void 0&&(e.inclusionProof=ms.InclusionProof.toJSON(t.inclusionProof)),t.canonicalizedBody.length!==0&&(e.canonicalizedBody=YN(t.canonicalizedBody)),e}};function WN(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function YN(t){return globalThis.Buffer.from(t).toString(\"base64\")}function Ra(t){return t!=null}});var jV=_(Xc=>{\"use strict\";Object.defineProperty(Xc,\"__esModule\",{value:!0});Xc.Bundle=Xc.VerificationMaterial=Xc.TimestampVerificationData=void 0;var eDe=_V(),wA=Ww(),tDe=HV();Xc.TimestampVerificationData={fromJSON(t){return{rfc3161Timestamps:globalThis.Array.isArray(t?.rfc3161Timestamps)?t.rfc3161Timestamps.map(e=>wA.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(t){let e={};return t.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=t.rfc3161Timestamps.map(r=>wA.RFC3161SignedTimestamp.toJSON(r))),e}};Xc.VerificationMaterial={fromJSON(t){return{content:yg(t.publicKey)?{$case:\"publicKey\",publicKey:wA.PublicKeyIdentifier.fromJSON(t.publicKey)}:yg(t.x509CertificateChain)?{$case:\"x509CertificateChain\",x509CertificateChain:wA.X509CertificateChain.fromJSON(t.x509CertificateChain)}:yg(t.certificate)?{$case:\"certificate\",certificate:wA.X509Certificate.fromJSON(t.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(t?.tlogEntries)?t.tlogEntries.map(e=>tDe.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:yg(t.timestampVerificationData)?Xc.TimestampVerificationData.fromJSON(t.timestampVerificationData):void 0}},toJSON(t){let e={};return t.content?.$case===\"publicKey\"?e.publicKey=wA.PublicKeyIdentifier.toJSON(t.content.publicKey):t.content?.$case===\"x509CertificateChain\"?e.x509CertificateChain=wA.X509CertificateChain.toJSON(t.content.x509CertificateChain):t.content?.$case===\"certificate\"&&(e.certificate=wA.X509Certificate.toJSON(t.content.certificate)),t.tlogEntries?.length&&(e.tlogEntries=t.tlogEntries.map(r=>tDe.TransparencyLogEntry.toJSON(r))),t.timestampVerificationData!==void 0&&(e.timestampVerificationData=Xc.TimestampVerificationData.toJSON(t.timestampVerificationData)),e}};Xc.Bundle={fromJSON(t){return{mediaType:yg(t.mediaType)?globalThis.String(t.mediaType):\"\",verificationMaterial:yg(t.verificationMaterial)?Xc.VerificationMaterial.fromJSON(t.verificationMaterial):void 0,content:yg(t.messageSignature)?{$case:\"messageSignature\",messageSignature:wA.MessageSignature.fromJSON(t.messageSignature)}:yg(t.dsseEnvelope)?{$case:\"dsseEnvelope\",dsseEnvelope:eDe.Envelope.fromJSON(t.dsseEnvelope)}:void 0}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.verificationMaterial!==void 0&&(e.verificationMaterial=Xc.VerificationMaterial.toJSON(t.verificationMaterial)),t.content?.$case===\"messageSignature\"?e.messageSignature=wA.MessageSignature.toJSON(t.content.messageSignature):t.content?.$case===\"dsseEnvelope\"&&(e.dsseEnvelope=eDe.Envelope.toJSON(t.content.dsseEnvelope)),e}};function yg(t){return t!=null}});var GV=_(Ri=>{\"use strict\";Object.defineProperty(Ri,\"__esModule\",{value:!0});Ri.ClientTrustConfig=Ri.SigningConfig=Ri.TrustedRoot=Ri.CertificateAuthority=Ri.TransparencyLogInstance=void 0;var El=Ww();Ri.TransparencyLogInstance={fromJSON(t){return{baseUrl:ia(t.baseUrl)?globalThis.String(t.baseUrl):\"\",hashAlgorithm:ia(t.hashAlgorithm)?(0,El.hashAlgorithmFromJSON)(t.hashAlgorithm):0,publicKey:ia(t.publicKey)?El.PublicKey.fromJSON(t.publicKey):void 0,logId:ia(t.logId)?El.LogId.fromJSON(t.logId):void 0,checkpointKeyId:ia(t.checkpointKeyId)?El.LogId.fromJSON(t.checkpointKeyId):void 0}},toJSON(t){let e={};return t.baseUrl!==\"\"&&(e.baseUrl=t.baseUrl),t.hashAlgorithm!==0&&(e.hashAlgorithm=(0,El.hashAlgorithmToJSON)(t.hashAlgorithm)),t.publicKey!==void 0&&(e.publicKey=El.PublicKey.toJSON(t.publicKey)),t.logId!==void 0&&(e.logId=El.LogId.toJSON(t.logId)),t.checkpointKeyId!==void 0&&(e.checkpointKeyId=El.LogId.toJSON(t.checkpointKeyId)),e}};Ri.CertificateAuthority={fromJSON(t){return{subject:ia(t.subject)?El.DistinguishedName.fromJSON(t.subject):void 0,uri:ia(t.uri)?globalThis.String(t.uri):\"\",certChain:ia(t.certChain)?El.X509CertificateChain.fromJSON(t.certChain):void 0,validFor:ia(t.validFor)?El.TimeRange.fromJSON(t.validFor):void 0}},toJSON(t){let e={};return t.subject!==void 0&&(e.subject=El.DistinguishedName.toJSON(t.subject)),t.uri!==\"\"&&(e.uri=t.uri),t.certChain!==void 0&&(e.certChain=El.X509CertificateChain.toJSON(t.certChain)),t.validFor!==void 0&&(e.validFor=El.TimeRange.toJSON(t.validFor)),e}};Ri.TrustedRoot={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",tlogs:globalThis.Array.isArray(t?.tlogs)?t.tlogs.map(e=>Ri.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(t?.certificateAuthorities)?t.certificateAuthorities.map(e=>Ri.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(t?.ctlogs)?t.ctlogs.map(e=>Ri.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(t?.timestampAuthorities)?t.timestampAuthorities.map(e=>Ri.CertificateAuthority.fromJSON(e)):[]}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.tlogs?.length&&(e.tlogs=t.tlogs.map(r=>Ri.TransparencyLogInstance.toJSON(r))),t.certificateAuthorities?.length&&(e.certificateAuthorities=t.certificateAuthorities.map(r=>Ri.CertificateAuthority.toJSON(r))),t.ctlogs?.length&&(e.ctlogs=t.ctlogs.map(r=>Ri.TransparencyLogInstance.toJSON(r))),t.timestampAuthorities?.length&&(e.timestampAuthorities=t.timestampAuthorities.map(r=>Ri.CertificateAuthority.toJSON(r))),e}};Ri.SigningConfig={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",caUrl:ia(t.caUrl)?globalThis.String(t.caUrl):\"\",oidcUrl:ia(t.oidcUrl)?globalThis.String(t.oidcUrl):\"\",tlogUrls:globalThis.Array.isArray(t?.tlogUrls)?t.tlogUrls.map(e=>globalThis.String(e)):[],tsaUrls:globalThis.Array.isArray(t?.tsaUrls)?t.tsaUrls.map(e=>globalThis.String(e)):[]}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.caUrl!==\"\"&&(e.caUrl=t.caUrl),t.oidcUrl!==\"\"&&(e.oidcUrl=t.oidcUrl),t.tlogUrls?.length&&(e.tlogUrls=t.tlogUrls),t.tsaUrls?.length&&(e.tsaUrls=t.tsaUrls),e}};Ri.ClientTrustConfig={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",trustedRoot:ia(t.trustedRoot)?Ri.TrustedRoot.fromJSON(t.trustedRoot):void 0,signingConfig:ia(t.signingConfig)?Ri.SigningConfig.fromJSON(t.signingConfig):void 0}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.trustedRoot!==void 0&&(e.trustedRoot=Ri.TrustedRoot.toJSON(t.trustedRoot)),t.signingConfig!==void 0&&(e.signingConfig=Ri.SigningConfig.toJSON(t.signingConfig)),e}};function ia(t){return t!=null}});var iDe=_(Vr=>{\"use strict\";Object.defineProperty(Vr,\"__esModule\",{value:!0});Vr.Input=Vr.Artifact=Vr.ArtifactVerificationOptions_ObserverTimestampOptions=Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=Vr.ArtifactVerificationOptions_TimestampAuthorityOptions=Vr.ArtifactVerificationOptions_CtlogOptions=Vr.ArtifactVerificationOptions_TlogOptions=Vr.ArtifactVerificationOptions=Vr.PublicKeyIdentities=Vr.CertificateIdentities=Vr.CertificateIdentity=void 0;var rDe=jV(),Eg=Ww(),nDe=GV();Vr.CertificateIdentity={fromJSON(t){return{issuer:gi(t.issuer)?globalThis.String(t.issuer):\"\",san:gi(t.san)?Eg.SubjectAlternativeName.fromJSON(t.san):void 0,oids:globalThis.Array.isArray(t?.oids)?t.oids.map(e=>Eg.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(t){let e={};return t.issuer!==\"\"&&(e.issuer=t.issuer),t.san!==void 0&&(e.san=Eg.SubjectAlternativeName.toJSON(t.san)),t.oids?.length&&(e.oids=t.oids.map(r=>Eg.ObjectIdentifierValuePair.toJSON(r))),e}};Vr.CertificateIdentities={fromJSON(t){return{identities:globalThis.Array.isArray(t?.identities)?t.identities.map(e=>Vr.CertificateIdentity.fromJSON(e)):[]}},toJSON(t){let e={};return t.identities?.length&&(e.identities=t.identities.map(r=>Vr.CertificateIdentity.toJSON(r))),e}};Vr.PublicKeyIdentities={fromJSON(t){return{publicKeys:globalThis.Array.isArray(t?.publicKeys)?t.publicKeys.map(e=>Eg.PublicKey.fromJSON(e)):[]}},toJSON(t){let e={};return t.publicKeys?.length&&(e.publicKeys=t.publicKeys.map(r=>Eg.PublicKey.toJSON(r))),e}};Vr.ArtifactVerificationOptions={fromJSON(t){return{signers:gi(t.certificateIdentities)?{$case:\"certificateIdentities\",certificateIdentities:Vr.CertificateIdentities.fromJSON(t.certificateIdentities)}:gi(t.publicKeys)?{$case:\"publicKeys\",publicKeys:Vr.PublicKeyIdentities.fromJSON(t.publicKeys)}:void 0,tlogOptions:gi(t.tlogOptions)?Vr.ArtifactVerificationOptions_TlogOptions.fromJSON(t.tlogOptions):void 0,ctlogOptions:gi(t.ctlogOptions)?Vr.ArtifactVerificationOptions_CtlogOptions.fromJSON(t.ctlogOptions):void 0,tsaOptions:gi(t.tsaOptions)?Vr.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(t.tsaOptions):void 0,integratedTsOptions:gi(t.integratedTsOptions)?Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(t.integratedTsOptions):void 0,observerOptions:gi(t.observerOptions)?Vr.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(t.observerOptions):void 0}},toJSON(t){let e={};return t.signers?.$case===\"certificateIdentities\"?e.certificateIdentities=Vr.CertificateIdentities.toJSON(t.signers.certificateIdentities):t.signers?.$case===\"publicKeys\"&&(e.publicKeys=Vr.PublicKeyIdentities.toJSON(t.signers.publicKeys)),t.tlogOptions!==void 0&&(e.tlogOptions=Vr.ArtifactVerificationOptions_TlogOptions.toJSON(t.tlogOptions)),t.ctlogOptions!==void 0&&(e.ctlogOptions=Vr.ArtifactVerificationOptions_CtlogOptions.toJSON(t.ctlogOptions)),t.tsaOptions!==void 0&&(e.tsaOptions=Vr.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(t.tsaOptions)),t.integratedTsOptions!==void 0&&(e.integratedTsOptions=Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(t.integratedTsOptions)),t.observerOptions!==void 0&&(e.observerOptions=Vr.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(t.observerOptions)),e}};Vr.ArtifactVerificationOptions_TlogOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,performOnlineVerification:gi(t.performOnlineVerification)?globalThis.Boolean(t.performOnlineVerification):!1,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.performOnlineVerification!==!1&&(e.performOnlineVerification=t.performOnlineVerification),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_CtlogOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.Artifact={fromJSON(t){return{data:gi(t.artifactUri)?{$case:\"artifactUri\",artifactUri:globalThis.String(t.artifactUri)}:gi(t.artifact)?{$case:\"artifact\",artifact:Buffer.from(wIt(t.artifact))}:gi(t.artifactDigest)?{$case:\"artifactDigest\",artifactDigest:Eg.HashOutput.fromJSON(t.artifactDigest)}:void 0}},toJSON(t){let e={};return t.data?.$case===\"artifactUri\"?e.artifactUri=t.data.artifactUri:t.data?.$case===\"artifact\"?e.artifact=BIt(t.data.artifact):t.data?.$case===\"artifactDigest\"&&(e.artifactDigest=Eg.HashOutput.toJSON(t.data.artifactDigest)),e}};Vr.Input={fromJSON(t){return{artifactTrustRoot:gi(t.artifactTrustRoot)?nDe.TrustedRoot.fromJSON(t.artifactTrustRoot):void 0,artifactVerificationOptions:gi(t.artifactVerificationOptions)?Vr.ArtifactVerificationOptions.fromJSON(t.artifactVerificationOptions):void 0,bundle:gi(t.bundle)?rDe.Bundle.fromJSON(t.bundle):void 0,artifact:gi(t.artifact)?Vr.Artifact.fromJSON(t.artifact):void 0}},toJSON(t){let e={};return t.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=nDe.TrustedRoot.toJSON(t.artifactTrustRoot)),t.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=Vr.ArtifactVerificationOptions.toJSON(t.artifactVerificationOptions)),t.bundle!==void 0&&(e.bundle=rDe.Bundle.toJSON(t.bundle)),t.artifact!==void 0&&(e.artifact=Vr.Artifact.toJSON(t.artifact)),e}};function wIt(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function BIt(t){return globalThis.Buffer.from(t).toString(\"base64\")}function gi(t){return t!=null}});var yb=_(Zc=>{\"use strict\";var vIt=Zc&&Zc.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Yw=Zc&&Zc.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&vIt(e,t,r)};Object.defineProperty(Zc,\"__esModule\",{value:!0});Yw(_V(),Zc);Yw(jV(),Zc);Yw(Ww(),Zc);Yw(HV(),Zc);Yw(GV(),Zc);Yw(iDe(),Zc)});var VN=_(Il=>{\"use strict\";Object.defineProperty(Il,\"__esModule\",{value:!0});Il.BUNDLE_V03_MEDIA_TYPE=Il.BUNDLE_V03_LEGACY_MEDIA_TYPE=Il.BUNDLE_V02_MEDIA_TYPE=Il.BUNDLE_V01_MEDIA_TYPE=void 0;Il.isBundleWithCertificateChain=SIt;Il.isBundleWithPublicKey=DIt;Il.isBundleWithMessageSignature=bIt;Il.isBundleWithDsseEnvelope=PIt;Il.BUNDLE_V01_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.1\";Il.BUNDLE_V02_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.2\";Il.BUNDLE_V03_LEGACY_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.3\";Il.BUNDLE_V03_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle.v0.3+json\";function SIt(t){return t.verificationMaterial.content.$case===\"x509CertificateChain\"}function DIt(t){return t.verificationMaterial.content.$case===\"publicKey\"}function bIt(t){return t.content.$case===\"messageSignature\"}function PIt(t){return t.content.$case===\"dsseEnvelope\"}});var oDe=_(KN=>{\"use strict\";Object.defineProperty(KN,\"__esModule\",{value:!0});KN.toMessageSignatureBundle=kIt;KN.toDSSEBundle=QIt;var xIt=yb(),JN=VN();function kIt(t){return{mediaType:t.certificateChain?JN.BUNDLE_V02_MEDIA_TYPE:JN.BUNDLE_V03_MEDIA_TYPE,content:{$case:\"messageSignature\",messageSignature:{messageDigest:{algorithm:xIt.HashAlgorithm.SHA2_256,digest:t.digest},signature:t.signature}},verificationMaterial:sDe(t)}}function QIt(t){return{mediaType:t.certificateChain?JN.BUNDLE_V02_MEDIA_TYPE:JN.BUNDLE_V03_MEDIA_TYPE,content:{$case:\"dsseEnvelope\",dsseEnvelope:TIt(t)},verificationMaterial:sDe(t)}}function TIt(t){return{payloadType:t.artifactType,payload:t.artifact,signatures:[RIt(t)]}}function RIt(t){return{keyid:t.keyHint||\"\",sig:t.signature}}function sDe(t){return{content:FIt(t),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}function FIt(t){return t.certificate?t.certificateChain?{$case:\"x509CertificateChain\",x509CertificateChain:{certificates:[{rawBytes:t.certificate}]}}:{$case:\"certificate\",certificate:{rawBytes:t.certificate}}:{$case:\"publicKey\",publicKey:{hint:t.keyHint||\"\"}}}});var WV=_(zN=>{\"use strict\";Object.defineProperty(zN,\"__esModule\",{value:!0});zN.ValidationError=void 0;var qV=class extends Error{constructor(e,r){super(e),this.fields=r}};zN.ValidationError=qV});var YV=_(ey=>{\"use strict\";Object.defineProperty(ey,\"__esModule\",{value:!0});ey.assertBundle=NIt;ey.assertBundleV01=aDe;ey.isBundleV01=OIt;ey.assertBundleV02=LIt;ey.assertBundleLatest=MIt;var XN=WV();function NIt(t){let e=ZN(t);if(e.length>0)throw new XN.ValidationError(\"invalid bundle\",e)}function aDe(t){let e=[];if(e.push(...ZN(t)),e.push(...UIt(t)),e.length>0)throw new XN.ValidationError(\"invalid v0.1 bundle\",e)}function OIt(t){try{return aDe(t),!0}catch{return!1}}function LIt(t){let e=[];if(e.push(...ZN(t)),e.push(...lDe(t)),e.length>0)throw new XN.ValidationError(\"invalid v0.2 bundle\",e)}function MIt(t){let e=[];if(e.push(...ZN(t)),e.push(...lDe(t)),e.push(..._It(t)),e.length>0)throw new XN.ValidationError(\"invalid bundle\",e)}function ZN(t){let e=[];if((t.mediaType===void 0||!t.mediaType.match(/^application\\/vnd\\.dev\\.sigstore\\.bundle\\+json;version=\\d\\.\\d/)&&!t.mediaType.match(/^application\\/vnd\\.dev\\.sigstore\\.bundle\\.v\\d\\.\\d\\+json/))&&e.push(\"mediaType\"),t.content===void 0)e.push(\"content\");else switch(t.content.$case){case\"messageSignature\":t.content.messageSignature.messageDigest===void 0?e.push(\"content.messageSignature.messageDigest\"):t.content.messageSignature.messageDigest.digest.length===0&&e.push(\"content.messageSignature.messageDigest.digest\"),t.content.messageSignature.signature.length===0&&e.push(\"content.messageSignature.signature\");break;case\"dsseEnvelope\":t.content.dsseEnvelope.payload.length===0&&e.push(\"content.dsseEnvelope.payload\"),t.content.dsseEnvelope.signatures.length!==1?e.push(\"content.dsseEnvelope.signatures\"):t.content.dsseEnvelope.signatures[0].sig.length===0&&e.push(\"content.dsseEnvelope.signatures[0].sig\");break}if(t.verificationMaterial===void 0)e.push(\"verificationMaterial\");else{if(t.verificationMaterial.content===void 0)e.push(\"verificationMaterial.content\");else switch(t.verificationMaterial.content.$case){case\"x509CertificateChain\":t.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push(\"verificationMaterial.content.x509CertificateChain.certificates\"),t.verificationMaterial.content.x509CertificateChain.certificates.forEach((r,s)=>{r.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${s}].rawBytes`)});break;case\"certificate\":t.verificationMaterial.content.certificate.rawBytes.length===0&&e.push(\"verificationMaterial.content.certificate.rawBytes\");break}t.verificationMaterial.tlogEntries===void 0?e.push(\"verificationMaterial.tlogEntries\"):t.verificationMaterial.tlogEntries.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].logId`),r.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].kindVersion`)})}return e}function UIt(t){let e=[];return t.verificationMaterial&&t.verificationMaterial.tlogEntries?.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].inclusionPromise`)}),e}function lDe(t){let e=[];return t.verificationMaterial&&t.verificationMaterial.tlogEntries?.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${s}].inclusionProof`):r.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].inclusionProof.checkpoint`)}),e}function _It(t){let e=[];return t.verificationMaterial?.content?.$case===\"x509CertificateChain\"&&e.push(\"verificationMaterial.content.$case\"),e}});var uDe=_(BA=>{\"use strict\";Object.defineProperty(BA,\"__esModule\",{value:!0});BA.envelopeToJSON=BA.envelopeFromJSON=BA.bundleToJSON=BA.bundleFromJSON=void 0;var $N=yb(),cDe=VN(),VV=YV(),HIt=t=>{let e=$N.Bundle.fromJSON(t);switch(e.mediaType){case cDe.BUNDLE_V01_MEDIA_TYPE:(0,VV.assertBundleV01)(e);break;case cDe.BUNDLE_V02_MEDIA_TYPE:(0,VV.assertBundleV02)(e);break;default:(0,VV.assertBundleLatest)(e);break}return e};BA.bundleFromJSON=HIt;var jIt=t=>$N.Bundle.toJSON(t);BA.bundleToJSON=jIt;var GIt=t=>$N.Envelope.fromJSON(t);BA.envelopeFromJSON=GIt;var qIt=t=>$N.Envelope.toJSON(t);BA.envelopeToJSON=qIt});var Ib=_(Xr=>{\"use strict\";Object.defineProperty(Xr,\"__esModule\",{value:!0});Xr.isBundleV01=Xr.assertBundleV02=Xr.assertBundleV01=Xr.assertBundleLatest=Xr.assertBundle=Xr.envelopeToJSON=Xr.envelopeFromJSON=Xr.bundleToJSON=Xr.bundleFromJSON=Xr.ValidationError=Xr.isBundleWithPublicKey=Xr.isBundleWithMessageSignature=Xr.isBundleWithDsseEnvelope=Xr.isBundleWithCertificateChain=Xr.BUNDLE_V03_MEDIA_TYPE=Xr.BUNDLE_V03_LEGACY_MEDIA_TYPE=Xr.BUNDLE_V02_MEDIA_TYPE=Xr.BUNDLE_V01_MEDIA_TYPE=Xr.toMessageSignatureBundle=Xr.toDSSEBundle=void 0;var fDe=oDe();Object.defineProperty(Xr,\"toDSSEBundle\",{enumerable:!0,get:function(){return fDe.toDSSEBundle}});Object.defineProperty(Xr,\"toMessageSignatureBundle\",{enumerable:!0,get:function(){return fDe.toMessageSignatureBundle}});var Ig=VN();Object.defineProperty(Xr,\"BUNDLE_V01_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V01_MEDIA_TYPE}});Object.defineProperty(Xr,\"BUNDLE_V02_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V02_MEDIA_TYPE}});Object.defineProperty(Xr,\"BUNDLE_V03_LEGACY_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V03_LEGACY_MEDIA_TYPE}});Object.defineProperty(Xr,\"BUNDLE_V03_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V03_MEDIA_TYPE}});Object.defineProperty(Xr,\"isBundleWithCertificateChain\",{enumerable:!0,get:function(){return Ig.isBundleWithCertificateChain}});Object.defineProperty(Xr,\"isBundleWithDsseEnvelope\",{enumerable:!0,get:function(){return Ig.isBundleWithDsseEnvelope}});Object.defineProperty(Xr,\"isBundleWithMessageSignature\",{enumerable:!0,get:function(){return Ig.isBundleWithMessageSignature}});Object.defineProperty(Xr,\"isBundleWithPublicKey\",{enumerable:!0,get:function(){return Ig.isBundleWithPublicKey}});var WIt=WV();Object.defineProperty(Xr,\"ValidationError\",{enumerable:!0,get:function(){return WIt.ValidationError}});var eO=uDe();Object.defineProperty(Xr,\"bundleFromJSON\",{enumerable:!0,get:function(){return eO.bundleFromJSON}});Object.defineProperty(Xr,\"bundleToJSON\",{enumerable:!0,get:function(){return eO.bundleToJSON}});Object.defineProperty(Xr,\"envelopeFromJSON\",{enumerable:!0,get:function(){return eO.envelopeFromJSON}});Object.defineProperty(Xr,\"envelopeToJSON\",{enumerable:!0,get:function(){return eO.envelopeToJSON}});var Eb=YV();Object.defineProperty(Xr,\"assertBundle\",{enumerable:!0,get:function(){return Eb.assertBundle}});Object.defineProperty(Xr,\"assertBundleLatest\",{enumerable:!0,get:function(){return Eb.assertBundleLatest}});Object.defineProperty(Xr,\"assertBundleV01\",{enumerable:!0,get:function(){return Eb.assertBundleV01}});Object.defineProperty(Xr,\"assertBundleV02\",{enumerable:!0,get:function(){return Eb.assertBundleV02}});Object.defineProperty(Xr,\"isBundleV01\",{enumerable:!0,get:function(){return Eb.isBundleV01}})});var Cb=_(rO=>{\"use strict\";Object.defineProperty(rO,\"__esModule\",{value:!0});rO.ByteStream=void 0;var JV=class extends Error{},tO=class t{constructor(e){this.start=0,e?(this.buf=e,this.view=Buffer.from(e)):(this.buf=new ArrayBuffer(0),this.view=Buffer.from(this.buf))}get buffer(){return this.view.subarray(0,this.start)}get length(){return this.view.byteLength}get position(){return this.start}seek(e){this.start=e}slice(e,r){let s=e+r;if(s>this.length)throw new JV(\"request past end of buffer\");return this.view.subarray(e,s)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let r=new Uint16Array([e]),s=new Uint8Array(r.buffer);this.view[this.start]=s[1],this.view[this.start+1]=s[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let r=new Uint32Array([e]),s=new Uint8Array(r.buffer);this.view[this.start]=s[2],this.view[this.start+1]=s[1],this.view[this.start+2]=s[0],this.start+=3}appendView(e){this.ensureCapacity(e.length),this.view.set(e,this.start),this.start+=e.length}getBlock(e){if(e<=0)return Buffer.alloc(0);if(this.start+e>this.view.length)throw new Error(\"request past end of buffer\");let r=this.view.subarray(this.start,this.start+e);return this.start+=e,r}getUint8(){return this.getBlock(1)[0]}getUint16(){let e=this.getBlock(2);return e[0]<<8|e[1]}ensureCapacity(e){if(this.start+e>this.view.byteLength){let r=t.BLOCK_SIZE+(e>t.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+r)}}realloc(e){let r=new ArrayBuffer(e),s=Buffer.from(r);s.set(this.view),this.buf=r,this.view=s}};rO.ByteStream=tO;tO.BLOCK_SIZE=1024});var nO=_(Vw=>{\"use strict\";Object.defineProperty(Vw,\"__esModule\",{value:!0});Vw.ASN1TypeError=Vw.ASN1ParseError=void 0;var KV=class extends Error{};Vw.ASN1ParseError=KV;var zV=class extends Error{};Vw.ASN1TypeError=zV});var pDe=_(iO=>{\"use strict\";Object.defineProperty(iO,\"__esModule\",{value:!0});iO.decodeLength=YIt;iO.encodeLength=VIt;var ADe=nO();function YIt(t){let e=t.getUint8();if(!(e&128))return e;let r=e&127;if(r>6)throw new ADe.ASN1ParseError(\"length exceeds 6 byte limit\");let s=0;for(let a=0;a<r;a++)s=s*256+t.getUint8();if(s===0)throw new ADe.ASN1ParseError(\"indefinite length encoding not supported\");return s}function VIt(t){if(t<128)return Buffer.from([t]);let e=BigInt(t),r=[];for(;e>0n;)r.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|r.length,...r])}});var gDe=_(Cg=>{\"use strict\";Object.defineProperty(Cg,\"__esModule\",{value:!0});Cg.parseInteger=zIt;Cg.parseStringASCII=hDe;Cg.parseTime=XIt;Cg.parseOID=ZIt;Cg.parseBoolean=$It;Cg.parseBitString=eCt;var JIt=/^(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\.\\d{3})?Z$/,KIt=/^(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\.\\d{3})?Z$/;function zIt(t){let e=0,r=t.length,s=t[e],a=s>127,n=a?255:0;for(;s==n&&++e<r;)s=t[e];if(r-e===0)return BigInt(a?-1:0);s=a?s-256:s;let f=BigInt(s);for(let p=e+1;p<r;++p)f=f*BigInt(256)+BigInt(t[p]);return f}function hDe(t){return t.toString(\"ascii\")}function XIt(t,e){let r=hDe(t),s=e?JIt.exec(r):KIt.exec(r);if(!s)throw new Error(\"invalid time\");if(e){let a=Number(s[1]);a+=a>=50?1900:2e3,s[1]=a.toString()}return new Date(`${s[1]}-${s[2]}-${s[3]}T${s[4]}:${s[5]}:${s[6]}Z`)}function ZIt(t){let e=0,r=t.length,s=t[e++],a=Math.floor(s/40),n=s%40,c=`${a}.${n}`,f=0;for(;e<r;++e)s=t[e],f=(f<<7)+(s&127),s&128||(c+=`.${f}`,f=0);return c}function $It(t){return t[0]!==0}function eCt(t){let e=t[0],r=1,s=t.length,a=[];for(let n=r;n<s;++n){let c=t[n],f=n===s-1?e:0;for(let p=7;p>=f;--p)a.push(c>>p&1)}return a}});var mDe=_(sO=>{\"use strict\";Object.defineProperty(sO,\"__esModule\",{value:!0});sO.ASN1Tag=void 0;var dDe=nO(),ty={BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,OBJECT_IDENTIFIER:6,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,UTC_TIME:23,GENERALIZED_TIME:24},XV={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},ZV=class{constructor(e){if(this.number=e&31,this.constructed=(e&32)===32,this.class=e>>6,this.number===31)throw new dDe.ASN1ParseError(\"long form tags not supported\");if(this.class===XV.UNIVERSAL&&this.number===0)throw new dDe.ASN1ParseError(\"unsupported tag 0x00\")}isUniversal(){return this.class===XV.UNIVERSAL}isContextSpecific(e){let r=this.class===XV.CONTEXT_SPECIFIC;return e!==void 0?r&&this.number===e:r}isBoolean(){return this.isUniversal()&&this.number===ty.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===ty.INTEGER}isBitString(){return this.isUniversal()&&this.number===ty.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===ty.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===ty.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===ty.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===ty.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};sO.ASN1Tag=ZV});var CDe=_(aO=>{\"use strict\";Object.defineProperty(aO,\"__esModule\",{value:!0});aO.ASN1Obj=void 0;var $V=Cb(),ry=nO(),EDe=pDe(),Jw=gDe(),tCt=mDe(),oO=class{constructor(e,r,s){this.tag=e,this.value=r,this.subs=s}static parseBuffer(e){return IDe(new $V.ByteStream(e))}toDER(){let e=new $V.ByteStream;if(this.subs.length>0)for(let a of this.subs)e.appendView(a.toDER());else e.appendView(this.value);let r=e.buffer,s=new $V.ByteStream;return s.appendChar(this.tag.toDER()),s.appendView((0,EDe.encodeLength)(r.length)),s.appendView(r),s.buffer}toBoolean(){if(!this.tag.isBoolean())throw new ry.ASN1TypeError(\"not a boolean\");return(0,Jw.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new ry.ASN1TypeError(\"not an integer\");return(0,Jw.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new ry.ASN1TypeError(\"not an OID\");return(0,Jw.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,Jw.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,Jw.parseTime)(this.value,!1);default:throw new ry.ASN1TypeError(\"not a date\")}}toBitString(){if(!this.tag.isBitString())throw new ry.ASN1TypeError(\"not a bit string\");return(0,Jw.parseBitString)(this.value)}};aO.ASN1Obj=oO;function IDe(t){let e=new tCt.ASN1Tag(t.getUint8()),r=(0,EDe.decodeLength)(t),s=t.slice(t.position,r),a=t.position,n=[];if(e.constructed)n=yDe(t,r);else if(e.isOctetString())try{n=yDe(t,r)}catch{}return n.length===0&&t.seek(a+r),new oO(e,s,n)}function yDe(t,e){let r=t.position+e;if(r>t.length)throw new ry.ASN1ParseError(\"invalid length\");let s=[];for(;t.position<r;)s.push(IDe(t));if(t.position!==r)throw new ry.ASN1ParseError(\"invalid length\");return s}});var cO=_(lO=>{\"use strict\";Object.defineProperty(lO,\"__esModule\",{value:!0});lO.ASN1Obj=void 0;var rCt=CDe();Object.defineProperty(lO,\"ASN1Obj\",{enumerable:!0,get:function(){return rCt.ASN1Obj}})});var Kw=_(wg=>{\"use strict\";var nCt=wg&&wg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wg,\"__esModule\",{value:!0});wg.createPublicKey=iCt;wg.digest=sCt;wg.verify=oCt;wg.bufferEqual=aCt;var wb=nCt(Ie(\"crypto\"));function iCt(t,e=\"spki\"){return typeof t==\"string\"?wb.default.createPublicKey(t):wb.default.createPublicKey({key:t,format:\"der\",type:e})}function sCt(t,...e){let r=wb.default.createHash(t);for(let s of e)r.update(s);return r.digest()}function oCt(t,e,r,s){try{return wb.default.verify(s,t,e,r)}catch{return!1}}function aCt(t,e){try{return wb.default.timingSafeEqual(t,e)}catch{return!1}}});var wDe=_(e7=>{\"use strict\";Object.defineProperty(e7,\"__esModule\",{value:!0});e7.preAuthEncoding=cCt;var lCt=\"DSSEv1\";function cCt(t,e){let r=[lCt,t.length,t,e.length,\"\"].join(\" \");return Buffer.concat([Buffer.from(r,\"ascii\"),e])}});var SDe=_(uO=>{\"use strict\";Object.defineProperty(uO,\"__esModule\",{value:!0});uO.base64Encode=uCt;uO.base64Decode=fCt;var BDe=\"base64\",vDe=\"utf-8\";function uCt(t){return Buffer.from(t,vDe).toString(BDe)}function fCt(t){return Buffer.from(t,BDe).toString(vDe)}});var DDe=_(r7=>{\"use strict\";Object.defineProperty(r7,\"__esModule\",{value:!0});r7.canonicalize=t7;function t7(t){let e=\"\";if(t===null||typeof t!=\"object\"||t.toJSON!=null)e+=JSON.stringify(t);else if(Array.isArray(t)){e+=\"[\";let r=!0;t.forEach(s=>{r||(e+=\",\"),r=!1,e+=t7(s)}),e+=\"]\"}else{e+=\"{\";let r=!0;Object.keys(t).sort().forEach(s=>{r||(e+=\",\"),r=!1,e+=JSON.stringify(s),e+=\":\",e+=t7(t[s])}),e+=\"}\"}return e}});var n7=_(fO=>{\"use strict\";Object.defineProperty(fO,\"__esModule\",{value:!0});fO.toDER=hCt;fO.fromDER=gCt;var ACt=/-----BEGIN (.*)-----/,pCt=/-----END (.*)-----/;function hCt(t){let e=\"\";return t.split(`\n`).forEach(r=>{r.match(ACt)||r.match(pCt)||(e+=r)}),Buffer.from(e,\"base64\")}function gCt(t,e=\"CERTIFICATE\"){let s=t.toString(\"base64\").match(/.{1,64}/g)||\"\";return[`-----BEGIN ${e}-----`,...s,`-----END ${e}-----`].join(`\n`).concat(`\n`)}});var AO=_(zw=>{\"use strict\";Object.defineProperty(zw,\"__esModule\",{value:!0});zw.SHA2_HASH_ALGOS=zw.ECDSA_SIGNATURE_ALGOS=void 0;zw.ECDSA_SIGNATURE_ALGOS={\"1.2.840.10045.4.3.1\":\"sha224\",\"1.2.840.10045.4.3.2\":\"sha256\",\"1.2.840.10045.4.3.3\":\"sha384\",\"1.2.840.10045.4.3.4\":\"sha512\"};zw.SHA2_HASH_ALGOS={\"2.16.840.1.101.3.4.2.1\":\"sha256\",\"2.16.840.1.101.3.4.2.2\":\"sha384\",\"2.16.840.1.101.3.4.2.3\":\"sha512\"}});var s7=_(pO=>{\"use strict\";Object.defineProperty(pO,\"__esModule\",{value:!0});pO.RFC3161TimestampVerificationError=void 0;var i7=class extends Error{};pO.RFC3161TimestampVerificationError=i7});var PDe=_(vA=>{\"use strict\";var dCt=vA&&vA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),mCt=vA&&vA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yCt=vA&&vA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&dCt(e,t,r);return mCt(e,t),e};Object.defineProperty(vA,\"__esModule\",{value:!0});vA.TSTInfo=void 0;var bDe=yCt(Kw()),ECt=AO(),ICt=s7(),o7=class{constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return ECt.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let r=bDe.digest(this.messageImprintHashAlgorithm,e);if(!bDe.bufferEqual(r,this.messageImprintHashedMessage))throw new ICt.RFC3161TimestampVerificationError(\"message imprint does not match artifact\")}get messageImprintObj(){return this.root.subs[2]}};vA.TSTInfo=o7});var kDe=_(SA=>{\"use strict\";var CCt=SA&&SA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),wCt=SA&&SA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BCt=SA&&SA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&CCt(e,t,r);return wCt(e,t),e};Object.defineProperty(SA,\"__esModule\",{value:!0});SA.RFC3161Timestamp=void 0;var vCt=cO(),a7=BCt(Kw()),xDe=AO(),Bb=s7(),SCt=PDe(),DCt=\"1.2.840.113549.1.7.2\",bCt=\"1.2.840.113549.1.9.16.1.4\",PCt=\"1.2.840.113549.1.9.4\",l7=class t{constructor(e){this.root=e}static parse(e){let r=vCt.ASN1Obj.parseBuffer(e);return new t(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return xDe.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return xDe.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new SCt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,r){if(!this.timeStampTokenObj)throw new Bb.RFC3161TimestampVerificationError(\"timeStampToken is missing\");if(this.contentType!==DCt)throw new Bb.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==bCt)throw new Bb.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let e=a7.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!a7.bufferEqual(e,r))throw new Bb.RFC3161TimestampVerificationError(\"signed data does not match tstInfo\")}verifySignature(e){let r=this.signedAttrsObj.toDER();if(r[0]=49,!a7.verify(r,e,this.signatureValue,this.signatureAlgorithm))throw new Bb.RFC3161TimestampVerificationError(\"signature verification failed\")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(r=>r.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let e=this.signedDataObj;return e.subs[e.subs.length-1]}get signerInfoObj(){return this.signerInfosObj.subs[0]}get eContentTypeObj(){return this.encapContentInfoObj.subs[0]}get eContentObj(){return this.encapContentInfoObj.subs[1]}get signedAttrsObj(){return this.signerInfoObj.subs.find(r=>r.tag.isContextSpecific(0))}get messageDigestAttributeObj(){return this.signedAttrsObj.subs.find(r=>r.subs[0].tag.isOID()&&r.subs[0].toOID()===PCt)}get signerSidObj(){return this.signerInfoObj.subs[1]}get signerDigestAlgorithmObj(){return this.signerInfoObj.subs[2]}get signatureAlgorithmObj(){return this.signerInfoObj.subs[4]}get signatureValueObj(){return this.signerInfoObj.subs[5]}};SA.RFC3161Timestamp=l7});var QDe=_(hO=>{\"use strict\";Object.defineProperty(hO,\"__esModule\",{value:!0});hO.RFC3161Timestamp=void 0;var xCt=kDe();Object.defineProperty(hO,\"RFC3161Timestamp\",{enumerable:!0,get:function(){return xCt.RFC3161Timestamp}})});var RDe=_(DA=>{\"use strict\";var kCt=DA&&DA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),QCt=DA&&DA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TCt=DA&&DA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&kCt(e,t,r);return QCt(e,t),e};Object.defineProperty(DA,\"__esModule\",{value:!0});DA.SignedCertificateTimestamp=void 0;var RCt=TCt(Kw()),TDe=Cb(),c7=class t{constructor(e){this.version=e.version,this.logID=e.logID,this.timestamp=e.timestamp,this.extensions=e.extensions,this.hashAlgorithm=e.hashAlgorithm,this.signatureAlgorithm=e.signatureAlgorithm,this.signature=e.signature}get datetime(){return new Date(Number(this.timestamp.readBigInt64BE()))}get algorithm(){switch(this.hashAlgorithm){case 0:return\"none\";case 1:return\"md5\";case 2:return\"sha1\";case 3:return\"sha224\";case 4:return\"sha256\";case 5:return\"sha384\";case 6:return\"sha512\";default:return\"unknown\"}}verify(e,r){let s=new TDe.ByteStream;return s.appendChar(this.version),s.appendChar(0),s.appendView(this.timestamp),s.appendUint16(1),s.appendView(e),s.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&s.appendView(this.extensions),RCt.verify(s.buffer,r,this.signature,this.algorithm)}static parse(e){let r=new TDe.ByteStream(e),s=r.getUint8(),a=r.getBlock(32),n=r.getBlock(8),c=r.getUint16(),f=r.getBlock(c),p=r.getUint8(),h=r.getUint8(),E=r.getUint16(),C=r.getBlock(E);if(r.position!==e.length)throw new Error(\"SCT buffer length mismatch\");return new t({version:s,logID:a,timestamp:n,extensions:f,hashAlgorithm:p,signatureAlgorithm:h,signature:C})}};DA.SignedCertificateTimestamp=c7});var d7=_(sa=>{\"use strict\";Object.defineProperty(sa,\"__esModule\",{value:!0});sa.X509SCTExtension=sa.X509SubjectKeyIDExtension=sa.X509AuthorityKeyIDExtension=sa.X509SubjectAlternativeNameExtension=sa.X509KeyUsageExtension=sa.X509BasicConstraintsExtension=sa.X509Extension=void 0;var FCt=Cb(),NCt=RDe(),ph=class{constructor(e){this.root=e}get oid(){return this.root.subs[0].toOID()}get critical(){return this.root.subs.length===3?this.root.subs[1].toBoolean():!1}get value(){return this.extnValueObj.value}get valueObj(){return this.extnValueObj}get extnValueObj(){return this.root.subs[this.root.subs.length-1]}};sa.X509Extension=ph;var u7=class extends ph{get isCA(){return this.sequence.subs[0]?.toBoolean()??!1}get pathLenConstraint(){return this.sequence.subs.length>1?this.sequence.subs[1].toInteger():void 0}get sequence(){return this.extnValueObj.subs[0]}};sa.X509BasicConstraintsExtension=u7;var f7=class extends ph{get digitalSignature(){return this.bitString[0]===1}get keyCertSign(){return this.bitString[5]===1}get crlSign(){return this.bitString[6]===1}get bitString(){return this.extnValueObj.subs[0].toBitString()}};sa.X509KeyUsageExtension=f7;var A7=class extends ph{get rfc822Name(){return this.findGeneralName(1)?.value.toString(\"ascii\")}get uri(){return this.findGeneralName(6)?.value.toString(\"ascii\")}otherName(e){let r=this.findGeneralName(0);return r===void 0||r.subs[0].toOID()!==e?void 0:r.subs[1].subs[0].value.toString(\"ascii\")}findGeneralName(e){return this.generalNames.find(r=>r.tag.isContextSpecific(e))}get generalNames(){return this.extnValueObj.subs[0].subs}};sa.X509SubjectAlternativeNameExtension=A7;var p7=class extends ph{get keyIdentifier(){return this.findSequenceMember(0)?.value}findSequenceMember(e){return this.sequence.subs.find(r=>r.tag.isContextSpecific(e))}get sequence(){return this.extnValueObj.subs[0]}};sa.X509AuthorityKeyIDExtension=p7;var h7=class extends ph{get keyIdentifier(){return this.extnValueObj.subs[0].value}};sa.X509SubjectKeyIDExtension=h7;var g7=class extends ph{constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,r=new FCt.ByteStream(e),s=r.getUint16()+2,a=[];for(;r.position<s;){let n=r.getUint16(),c=r.getBlock(n);a.push(NCt.SignedCertificateTimestamp.parse(c))}if(r.position!==s)throw new Error(\"SCT list length does not match actual length\");return a}};sa.X509SCTExtension=g7});var ODe=_(ic=>{\"use strict\";var OCt=ic&&ic.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),LCt=ic&&ic.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NDe=ic&&ic.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&OCt(e,t,r);return LCt(e,t),e};Object.defineProperty(ic,\"__esModule\",{value:!0});ic.X509Certificate=ic.EXTENSION_OID_SCT=void 0;var MCt=cO(),FDe=NDe(Kw()),UCt=AO(),_Ct=NDe(n7()),ny=d7(),HCt=\"2.5.29.14\",jCt=\"2.5.29.15\",GCt=\"2.5.29.17\",qCt=\"2.5.29.19\",WCt=\"2.5.29.35\";ic.EXTENSION_OID_SCT=\"1.3.6.1.4.1.11129.2.4.2\";var m7=class t{constructor(e){this.root=e}static parse(e){let r=typeof e==\"string\"?_Ct.toDER(e):e,s=MCt.ASN1Obj.parseBuffer(r);return new t(s)}get tbsCertificate(){return this.tbsCertificateObj}get version(){return`v${(this.versionObj.subs[0].toInteger()+BigInt(1)).toString()}`}get serialNumber(){return this.serialNumberObj.value}get notBefore(){return this.validityObj.subs[0].toDate()}get notAfter(){return this.validityObj.subs[1].toDate()}get issuer(){return this.issuerObj.value}get subject(){return this.subjectObj.value}get publicKey(){return this.subjectPublicKeyInfoObj.toDER()}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return UCt.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value.subarray(1)}get subjectAltName(){let e=this.extSubjectAltName;return e?.uri||e?.rfc822Name}get extensions(){return this.extensionsObj?.subs[0]?.subs||[]}get extKeyUsage(){let e=this.findExtension(jCt);return e?new ny.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(qCt);return e?new ny.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(GCt);return e?new ny.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(WCt);return e?new ny.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(HCt);return e?new ny.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(ic.EXTENSION_OID_SCT);return e?new ny.X509SCTExtension(e):void 0}get isCA(){let e=this.extBasicConstraints?.isCA||!1;return this.extKeyUsage?e&&this.extKeyUsage.keyCertSign:e}extension(e){let r=this.findExtension(e);return r?new ny.X509Extension(r):void 0}verify(e){let r=e?.publicKey||this.publicKey,s=FDe.createPublicKey(r);return FDe.verify(this.tbsCertificate.toDER(),s,this.signatureValue,this.signatureAlgorithm)}validForDate(e){return this.notBefore<=e&&e<=this.notAfter}equals(e){return this.root.toDER().equals(e.root.toDER())}clone(){let e=this.root.toDER(),r=Buffer.alloc(e.length);return e.copy(r),t.parse(r)}findExtension(e){return this.extensions.find(r=>r.subs[0].toOID()===e)}get tbsCertificateObj(){return this.root.subs[0]}get signatureAlgorithmObj(){return this.root.subs[1]}get signatureValueObj(){return this.root.subs[2]}get versionObj(){return this.tbsCertificateObj.subs[0]}get serialNumberObj(){return this.tbsCertificateObj.subs[1]}get issuerObj(){return this.tbsCertificateObj.subs[3]}get validityObj(){return this.tbsCertificateObj.subs[4]}get subjectObj(){return this.tbsCertificateObj.subs[5]}get subjectPublicKeyInfoObj(){return this.tbsCertificateObj.subs[6]}get extensionsObj(){return this.tbsCertificateObj.subs.find(e=>e.tag.isContextSpecific(3))}};ic.X509Certificate=m7});var MDe=_(Bg=>{\"use strict\";Object.defineProperty(Bg,\"__esModule\",{value:!0});Bg.X509SCTExtension=Bg.X509Certificate=Bg.EXTENSION_OID_SCT=void 0;var LDe=ODe();Object.defineProperty(Bg,\"EXTENSION_OID_SCT\",{enumerable:!0,get:function(){return LDe.EXTENSION_OID_SCT}});Object.defineProperty(Bg,\"X509Certificate\",{enumerable:!0,get:function(){return LDe.X509Certificate}});var YCt=d7();Object.defineProperty(Bg,\"X509SCTExtension\",{enumerable:!0,get:function(){return YCt.X509SCTExtension}})});var Cl=_(Jn=>{\"use strict\";var VCt=Jn&&Jn.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),JCt=Jn&&Jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vb=Jn&&Jn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&VCt(e,t,r);return JCt(e,t),e};Object.defineProperty(Jn,\"__esModule\",{value:!0});Jn.X509SCTExtension=Jn.X509Certificate=Jn.EXTENSION_OID_SCT=Jn.ByteStream=Jn.RFC3161Timestamp=Jn.pem=Jn.json=Jn.encoding=Jn.dsse=Jn.crypto=Jn.ASN1Obj=void 0;var KCt=cO();Object.defineProperty(Jn,\"ASN1Obj\",{enumerable:!0,get:function(){return KCt.ASN1Obj}});Jn.crypto=vb(Kw());Jn.dsse=vb(wDe());Jn.encoding=vb(SDe());Jn.json=vb(DDe());Jn.pem=vb(n7());var zCt=QDe();Object.defineProperty(Jn,\"RFC3161Timestamp\",{enumerable:!0,get:function(){return zCt.RFC3161Timestamp}});var XCt=Cb();Object.defineProperty(Jn,\"ByteStream\",{enumerable:!0,get:function(){return XCt.ByteStream}});var y7=MDe();Object.defineProperty(Jn,\"EXTENSION_OID_SCT\",{enumerable:!0,get:function(){return y7.EXTENSION_OID_SCT}});Object.defineProperty(Jn,\"X509Certificate\",{enumerable:!0,get:function(){return y7.X509Certificate}});Object.defineProperty(Jn,\"X509SCTExtension\",{enumerable:!0,get:function(){return y7.X509SCTExtension}})});var UDe=_(E7=>{\"use strict\";Object.defineProperty(E7,\"__esModule\",{value:!0});E7.extractJWTSubject=$Ct;var ZCt=Cl();function $Ct(t){let e=t.split(\".\",3),r=JSON.parse(ZCt.encoding.base64Decode(e[1]));switch(r.iss){case\"https://accounts.google.com\":case\"https://oauth2.sigstore.dev/auth\":return r.email;default:return r.sub}}});var _De=_((dnr,ewt)=>{ewt.exports={name:\"@sigstore/sign\",version:\"3.1.0\",description:\"Sigstore signing library\",main:\"dist/index.js\",types:\"dist/index.d.ts\",scripts:{clean:\"shx rm -rf dist *.tsbuildinfo\",build:\"tsc --build\",test:\"jest\"},files:[\"dist\"],author:\"bdehamer@github.com\",license:\"Apache-2.0\",repository:{type:\"git\",url:\"git+https://github.com/sigstore/sigstore-js.git\"},bugs:{url:\"https://github.com/sigstore/sigstore-js/issues\"},homepage:\"https://github.com/sigstore/sigstore-js/tree/main/packages/sign#readme\",publishConfig:{provenance:!0},devDependencies:{\"@sigstore/jest\":\"^0.0.0\",\"@sigstore/mock\":\"^0.10.0\",\"@sigstore/rekor-types\":\"^3.0.0\",\"@types/make-fetch-happen\":\"^10.0.4\",\"@types/promise-retry\":\"^1.1.6\"},dependencies:{\"@sigstore/bundle\":\"^3.1.0\",\"@sigstore/core\":\"^2.0.0\",\"@sigstore/protobuf-specs\":\"^0.4.0\",\"make-fetch-happen\":\"^14.0.2\",\"proc-log\":\"^5.0.0\",\"promise-retry\":\"^2.0.1\"},engines:{node:\"^18.17.0 || >=20.5.0\"}}});var jDe=_(Xw=>{\"use strict\";var twt=Xw&&Xw.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xw,\"__esModule\",{value:!0});Xw.getUserAgent=void 0;var HDe=twt(Ie(\"os\")),rwt=()=>{let t=_De().version,e=process.version,r=HDe.default.platform(),s=HDe.default.arch();return`sigstore-js/${t} (Node ${e}) (${r}/${s})`};Xw.getUserAgent=rwt});var vg=_(Ji=>{\"use strict\";var nwt=Ji&&Ji.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),iwt=Ji&&Ji.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GDe=Ji&&Ji.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&nwt(r,e,s[a]);return iwt(r,e),r}}();Object.defineProperty(Ji,\"__esModule\",{value:!0});Ji.ua=Ji.oidc=Ji.pem=Ji.json=Ji.encoding=Ji.dsse=Ji.crypto=void 0;var Sb=Cl();Object.defineProperty(Ji,\"crypto\",{enumerable:!0,get:function(){return Sb.crypto}});Object.defineProperty(Ji,\"dsse\",{enumerable:!0,get:function(){return Sb.dsse}});Object.defineProperty(Ji,\"encoding\",{enumerable:!0,get:function(){return Sb.encoding}});Object.defineProperty(Ji,\"json\",{enumerable:!0,get:function(){return Sb.json}});Object.defineProperty(Ji,\"pem\",{enumerable:!0,get:function(){return Sb.pem}});Ji.oidc=GDe(UDe());Ji.ua=GDe(jDe())});var C7=_(gO=>{\"use strict\";Object.defineProperty(gO,\"__esModule\",{value:!0});gO.BaseBundleBuilder=void 0;var I7=class{constructor(e){this.signer=e.signer,this.witnesses=e.witnesses}async create(e){let r=await this.prepare(e).then(f=>this.signer.sign(f)),s=await this.package(e,r),a=await Promise.all(this.witnesses.map(f=>f.testify(s.content,swt(r.key)))),n=[],c=[];return a.forEach(({tlogEntries:f,rfc3161Timestamps:p})=>{n.push(...f??[]),c.push(...p??[])}),s.verificationMaterial.tlogEntries=n,s.verificationMaterial.timestampVerificationData={rfc3161Timestamps:c},s}async prepare(e){return e.data}};gO.BaseBundleBuilder=I7;function swt(t){switch(t.$case){case\"publicKey\":return t.publicKey;case\"x509Certificate\":return t.certificate}}});var B7=_(bA=>{\"use strict\";var owt=bA&&bA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),awt=bA&&bA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lwt=bA&&bA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&owt(r,e,s[a]);return awt(r,e),r}}();Object.defineProperty(bA,\"__esModule\",{value:!0});bA.toMessageSignatureBundle=cwt;bA.toDSSEBundle=uwt;var qDe=lwt(Ib()),w7=vg();function cwt(t,e){let r=w7.crypto.digest(\"sha256\",t.data);return qDe.toMessageSignatureBundle({digest:r,signature:e.signature,certificate:e.key.$case===\"x509Certificate\"?w7.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case===\"publicKey\"?e.key.hint:void 0,certificateChain:!0})}function uwt(t,e,r){return qDe.toDSSEBundle({artifact:t.data,artifactType:t.type,signature:e.signature,certificate:e.key.$case===\"x509Certificate\"?w7.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case===\"publicKey\"?e.key.hint:void 0,certificateChain:r})}});var YDe=_(dO=>{\"use strict\";Object.defineProperty(dO,\"__esModule\",{value:!0});dO.DSSEBundleBuilder=void 0;var fwt=vg(),Awt=C7(),pwt=B7(),v7=class extends Awt.BaseBundleBuilder{constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let r=WDe(e);return fwt.dsse.preAuthEncoding(r.type,r.data)}async package(e,r){return(0,pwt.toDSSEBundle)(WDe(e),r,this.certificateChain)}};dO.DSSEBundleBuilder=v7;function WDe(t){return{...t,type:t.type??\"\"}}});var VDe=_(mO=>{\"use strict\";Object.defineProperty(mO,\"__esModule\",{value:!0});mO.MessageSignatureBundleBuilder=void 0;var hwt=C7(),gwt=B7(),S7=class extends hwt.BaseBundleBuilder{constructor(e){super(e)}async package(e,r){return(0,gwt.toMessageSignatureBundle)(e,r)}};mO.MessageSignatureBundleBuilder=S7});var JDe=_(Zw=>{\"use strict\";Object.defineProperty(Zw,\"__esModule\",{value:!0});Zw.MessageSignatureBundleBuilder=Zw.DSSEBundleBuilder=void 0;var dwt=YDe();Object.defineProperty(Zw,\"DSSEBundleBuilder\",{enumerable:!0,get:function(){return dwt.DSSEBundleBuilder}});var mwt=VDe();Object.defineProperty(Zw,\"MessageSignatureBundleBuilder\",{enumerable:!0,get:function(){return mwt.MessageSignatureBundleBuilder}})});var EO=_(yO=>{\"use strict\";Object.defineProperty(yO,\"__esModule\",{value:!0});yO.HTTPError=void 0;var D7=class extends Error{constructor({status:e,message:r,location:s}){super(`(${e}) ${r}`),this.statusCode=e,this.location=s}};yO.HTTPError=D7});var $w=_(Db=>{\"use strict\";Object.defineProperty(Db,\"__esModule\",{value:!0});Db.InternalError=void 0;Db.internalError=Ewt;var ywt=EO(),IO=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.name=this.constructor.name,this.cause=s,this.code=e}};Db.InternalError=IO;function Ewt(t,e,r){throw t instanceof ywt.HTTPError&&(r+=` - ${t.message}`),new IO({code:e,message:r,cause:t})}});var CO=_((Dnr,KDe)=>{KDe.exports=fetch});var zDe=_(e1=>{\"use strict\";var Iwt=e1&&e1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e1,\"__esModule\",{value:!0});e1.CIContextProvider=void 0;var Cwt=Iwt(CO()),wwt=[Bwt,vwt],b7=class{constructor(e=\"sigstore\"){this.audience=e}async getToken(){return Promise.any(wwt.map(e=>e(this.audience))).catch(()=>Promise.reject(\"CI: no tokens available\"))}};e1.CIContextProvider=b7;async function Bwt(t){if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL||!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN)return Promise.reject(\"no token available\");let e=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);return e.searchParams.append(\"audience\",t),(await(0,Cwt.default)(e.href,{retry:2,headers:{Accept:\"application/json\",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(s=>s.value)}async function vwt(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject(\"no token available\")}});var XDe=_(wO=>{\"use strict\";Object.defineProperty(wO,\"__esModule\",{value:!0});wO.CIContextProvider=void 0;var Swt=zDe();Object.defineProperty(wO,\"CIContextProvider\",{enumerable:!0,get:function(){return Swt.CIContextProvider}})});var $De=_((xnr,ZDe)=>{var Dwt=Symbol(\"proc-log.meta\");ZDe.exports={META:Dwt,output:{LEVELS:[\"standard\",\"error\",\"buffer\",\"flush\"],KEYS:{standard:\"standard\",error:\"error\",buffer:\"buffer\",flush:\"flush\"},standard:function(...t){return process.emit(\"output\",\"standard\",...t)},error:function(...t){return process.emit(\"output\",\"error\",...t)},buffer:function(...t){return process.emit(\"output\",\"buffer\",...t)},flush:function(...t){return process.emit(\"output\",\"flush\",...t)}},log:{LEVELS:[\"notice\",\"error\",\"warn\",\"info\",\"verbose\",\"http\",\"silly\",\"timing\",\"pause\",\"resume\"],KEYS:{notice:\"notice\",error:\"error\",warn:\"warn\",info:\"info\",verbose:\"verbose\",http:\"http\",silly:\"silly\",timing:\"timing\",pause:\"pause\",resume:\"resume\"},error:function(...t){return process.emit(\"log\",\"error\",...t)},notice:function(...t){return process.emit(\"log\",\"notice\",...t)},warn:function(...t){return process.emit(\"log\",\"warn\",...t)},info:function(...t){return process.emit(\"log\",\"info\",...t)},verbose:function(...t){return process.emit(\"log\",\"verbose\",...t)},http:function(...t){return process.emit(\"log\",\"http\",...t)},silly:function(...t){return process.emit(\"log\",\"silly\",...t)},timing:function(...t){return process.emit(\"log\",\"timing\",...t)},pause:function(){return process.emit(\"log\",\"pause\")},resume:function(){return process.emit(\"log\",\"resume\")}},time:{LEVELS:[\"start\",\"end\"],KEYS:{start:\"start\",end:\"end\"},start:function(t,e){process.emit(\"time\",\"start\",t);function r(){return process.emit(\"time\",\"end\",t)}if(typeof e==\"function\"){let s=e();return s&&s.finally?s.finally(r):(r(),s)}return r},end:function(t){return process.emit(\"time\",\"end\",t)}},input:{LEVELS:[\"start\",\"end\",\"read\"],KEYS:{start:\"start\",end:\"end\",read:\"read\"},start:function(t){process.emit(\"input\",\"start\");function e(){return process.emit(\"input\",\"end\")}if(typeof t==\"function\"){let r=t();return r&&r.finally?r.finally(e):(e(),r)}return e},end:function(){return process.emit(\"input\",\"end\")},read:function(...t){let e,r,s=new Promise((a,n)=>{e=a,r=n});return process.emit(\"input\",\"read\",e,r,...t),s}}}});var rbe=_((knr,tbe)=>{\"use strict\";function ebe(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function bwt(t,e,r){if(!t||typeof t==\"string\")throw new TypeError(\"Please pass an Error to err-code\");r||(r={}),typeof e==\"object\"&&(r=e,e=void 0),e!=null&&(r.code=e);try{return ebe(t,r)}catch{r.message=t.message,r.stack=t.stack;let a=function(){};return a.prototype=Object.create(Object.getPrototypeOf(t)),ebe(new a,r)}}tbe.exports=bwt});var ibe=_((Qnr,nbe)=>{function $c(t,e){typeof e==\"boolean\"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}nbe.exports=$c;$c.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};$c.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};$c.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error(\"RetryOperation timeout occurred\")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var s=this,a=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},r);return this._options.unref&&a.unref(),!0};$c.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};$c.prototype.try=function(t){console.log(\"Using RetryOperation.try() is deprecated\"),this.attempt(t)};$c.prototype.start=function(t){console.log(\"Using RetryOperation.start() is deprecated\"),this.attempt(t)};$c.prototype.start=$c.prototype.try;$c.prototype.errors=function(){return this._errors};$c.prototype.attempts=function(){return this._attempts};$c.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,s=0;s<this._errors.length;s++){var a=this._errors[s],n=a.message,c=(t[n]||0)+1;t[n]=c,c>=r&&(e=a,r=c)}return e}});var sbe=_(iy=>{var Pwt=ibe();iy.operation=function(t){var e=iy.timeouts(t);return new Pwt(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};iy.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error(\"minTimeout is greater than maxTimeout\");for(var s=[],a=0;a<e.retries;a++)s.push(this.createTimeout(a,e));return t&&t.forever&&!s.length&&s.push(this.createTimeout(a,e)),s.sort(function(n,c){return n-c}),s};iy.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,s=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return s=Math.min(s,e.maxTimeout),s};iy.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var s in t)typeof t[s]==\"function\"&&r.push(s)}for(var a=0;a<r.length;a++){var n=r[a],c=t[n];t[n]=function(p){var h=iy.operation(e),E=Array.prototype.slice.call(arguments,1),C=E.pop();E.push(function(S){h.retry(S)||(S&&(arguments[0]=h.mainError()),C.apply(this,arguments))}),h.attempt(function(){p.apply(t,E)})}.bind(t,c),t[n].options=e}}});var abe=_((Rnr,obe)=>{obe.exports=sbe()});var ube=_((Fnr,cbe)=>{\"use strict\";var xwt=rbe(),kwt=abe(),Qwt=Object.prototype.hasOwnProperty;function lbe(t){return t&&t.code===\"EPROMISERETRY\"&&Qwt.call(t,\"retried\")}function Twt(t,e){var r,s;return typeof t==\"object\"&&typeof e==\"function\"&&(r=e,e=t,t=r),s=kwt.operation(e),new Promise(function(a,n){s.attempt(function(c){Promise.resolve().then(function(){return t(function(f){throw lbe(f)&&(f=f.retried),xwt(new Error(\"Retrying\"),\"EPROMISERETRY\",{retried:f})},c)}).then(a,function(f){lbe(f)&&(f=f.retried,s.retry(f||new Error))||n(f)})})})}cbe.exports=Twt});var BO=_(bb=>{\"use strict\";var Abe=bb&&bb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bb,\"__esModule\",{value:!0});bb.fetchWithRetry=qwt;var Rwt=Ie(\"http2\"),Fwt=Abe(CO()),fbe=$De(),Nwt=Abe(ube()),Owt=vg(),Lwt=EO(),{HTTP2_HEADER_LOCATION:Mwt,HTTP2_HEADER_CONTENT_TYPE:Uwt,HTTP2_HEADER_USER_AGENT:_wt,HTTP_STATUS_INTERNAL_SERVER_ERROR:Hwt,HTTP_STATUS_TOO_MANY_REQUESTS:jwt,HTTP_STATUS_REQUEST_TIMEOUT:Gwt}=Rwt.constants;async function qwt(t,e){return(0,Nwt.default)(async(r,s)=>{let a=e.method||\"POST\",n={[_wt]:Owt.ua.getUserAgent(),...e.headers},c=await(0,Fwt.default)(t,{method:a,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(f=>(fbe.log.http(\"fetch\",`${a} ${t} attempt ${s} failed with ${f}`),r(f)));if(c.ok)return c;{let f=await Wwt(c);if(fbe.log.http(\"fetch\",`${a} ${t} attempt ${s} failed with ${c.status}`),Ywt(c.status))return r(f);throw f}},Vwt(e.retry))}var Wwt=async t=>{let e=t.statusText,r=t.headers.get(Mwt)||void 0;if(t.headers.get(Uwt)?.includes(\"application/json\"))try{e=(await t.json()).message||e}catch{}return new Lwt.HTTPError({status:t.status,message:e,location:r})},Ywt=t=>[Gwt,jwt].includes(t)||t>=Hwt,Vwt=t=>typeof t==\"boolean\"?{retries:t?1:0}:typeof t==\"number\"?{retries:t}:{retries:0,...t}});var pbe=_(vO=>{\"use strict\";Object.defineProperty(vO,\"__esModule\",{value:!0});vO.Fulcio=void 0;var Jwt=BO(),P7=class{constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:r,retry:s,timeout:a}=this.options,n=`${r}/api/v2/signingCert`;return(await(0,Jwt.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(e),timeout:a,retry:s})).json()}};vO.Fulcio=P7});var hbe=_(SO=>{\"use strict\";Object.defineProperty(SO,\"__esModule\",{value:!0});SO.CAClient=void 0;var Kwt=$w(),zwt=pbe(),x7=class{constructor(e){this.fulcio=new zwt.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,r,s){let a=Xwt(e,r,s);try{let n=await this.fulcio.createSigningCertificate(a);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Kwt.internalError)(n,\"CA_CREATE_SIGNING_CERTIFICATE_ERROR\",\"error creating signing certificate\")}}};SO.CAClient=x7;function Xwt(t,e,r){return{credentials:{oidcIdentityToken:t},publicKeyRequest:{publicKey:{algorithm:\"ECDSA\",content:e},proofOfPossession:r.toString(\"base64\")}}}});var dbe=_(t1=>{\"use strict\";var Zwt=t1&&t1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t1,\"__esModule\",{value:!0});t1.EphemeralSigner=void 0;var gbe=Zwt(Ie(\"crypto\")),$wt=\"ec\",e1t=\"P-256\",k7=class{constructor(){this.keypair=gbe.default.generateKeyPairSync($wt,{namedCurve:e1t})}async sign(e){let r=gbe.default.sign(null,e,this.keypair.privateKey),s=this.keypair.publicKey.export({format:\"pem\",type:\"spki\"}).toString(\"ascii\");return{signature:r,key:{$case:\"publicKey\",publicKey:s}}}};t1.EphemeralSigner=k7});var mbe=_(sy=>{\"use strict\";Object.defineProperty(sy,\"__esModule\",{value:!0});sy.FulcioSigner=sy.DEFAULT_FULCIO_URL=void 0;var Q7=$w(),t1t=vg(),r1t=hbe(),n1t=dbe();sy.DEFAULT_FULCIO_URL=\"https://fulcio.sigstore.dev\";var T7=class{constructor(e){this.ca=new r1t.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||sy.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new n1t.EphemeralSigner}async sign(e){let r=await this.getIdentityToken(),s;try{s=t1t.oidc.extractJWTSubject(r)}catch(f){throw new Q7.InternalError({code:\"IDENTITY_TOKEN_PARSE_ERROR\",message:`invalid identity token: ${r}`,cause:f})}let a=await this.keyHolder.sign(Buffer.from(s));if(a.key.$case!==\"publicKey\")throw new Q7.InternalError({code:\"CA_CREATE_SIGNING_CERTIFICATE_ERROR\",message:\"unexpected format for signing key\"});let n=await this.ca.createSigningCertificate(r,a.key.publicKey,a.signature);return{signature:(await this.keyHolder.sign(e)).signature,key:{$case:\"x509Certificate\",certificate:n[0]}}}async getIdentityToken(){try{return await this.identityProvider.getToken()}catch(e){throw new Q7.InternalError({code:\"IDENTITY_TOKEN_READ_ERROR\",message:\"error retrieving identity token\",cause:e})}}};sy.FulcioSigner=T7});var Ebe=_(r1=>{\"use strict\";Object.defineProperty(r1,\"__esModule\",{value:!0});r1.FulcioSigner=r1.DEFAULT_FULCIO_URL=void 0;var ybe=mbe();Object.defineProperty(r1,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return ybe.DEFAULT_FULCIO_URL}});Object.defineProperty(r1,\"FulcioSigner\",{enumerable:!0,get:function(){return ybe.FulcioSigner}})});var wbe=_(DO=>{\"use strict\";Object.defineProperty(DO,\"__esModule\",{value:!0});DO.Rekor=void 0;var Ibe=BO(),R7=class{constructor(e){this.options=e}async createEntry(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/log/entries`,f=await(await(0,Ibe.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\",Accept:\"application/json\"},body:JSON.stringify(e),timeout:s,retry:a})).json();return Cbe(f)}async getEntry(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/log/entries/${e}`,f=await(await(0,Ibe.fetchWithRetry)(n,{method:\"GET\",headers:{Accept:\"application/json\"},timeout:s,retry:a})).json();return Cbe(f)}};DO.Rekor=R7;function Cbe(t){let e=Object.entries(t);if(e.length!=1)throw new Error(\"Received multiple entries in Rekor response\");let[r,s]=e[0];return{...s,uuid:r}}});var vbe=_(bO=>{\"use strict\";Object.defineProperty(bO,\"__esModule\",{value:!0});bO.TLogClient=void 0;var Bbe=$w(),i1t=EO(),s1t=wbe(),F7=class{constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new s1t.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let r;try{r=await this.rekor.createEntry(e)}catch(s){if(o1t(s)&&this.fetchOnConflict){let a=s.location.split(\"/\").pop()||\"\";try{r=await this.rekor.getEntry(a)}catch(n){(0,Bbe.internalError)(n,\"TLOG_FETCH_ENTRY_ERROR\",\"error fetching tlog entry\")}}else(0,Bbe.internalError)(s,\"TLOG_CREATE_ENTRY_ERROR\",\"error creating tlog entry\")}return r}};bO.TLogClient=F7;function o1t(t){return t instanceof i1t.HTTPError&&t.statusCode===409&&t.location!==void 0}});var Sbe=_(N7=>{\"use strict\";Object.defineProperty(N7,\"__esModule\",{value:!0});N7.toProposedEntry=l1t;var a1t=Ib(),Sg=vg(),Pb=\"sha256\";function l1t(t,e,r=\"dsse\"){switch(t.$case){case\"dsseEnvelope\":return r===\"intoto\"?f1t(t.dsseEnvelope,e):u1t(t.dsseEnvelope,e);case\"messageSignature\":return c1t(t.messageSignature,e)}}function c1t(t,e){let r=t.messageDigest.digest.toString(\"hex\"),s=t.signature.toString(\"base64\"),a=Sg.encoding.base64Encode(e);return{apiVersion:\"0.0.1\",kind:\"hashedrekord\",spec:{data:{hash:{algorithm:Pb,value:r}},signature:{content:s,publicKey:{content:a}}}}}function u1t(t,e){let r=JSON.stringify((0,a1t.envelopeToJSON)(t)),s=Sg.encoding.base64Encode(e);return{apiVersion:\"0.0.1\",kind:\"dsse\",spec:{proposedContent:{envelope:r,verifiers:[s]}}}}function f1t(t,e){let r=Sg.crypto.digest(Pb,t.payload).toString(\"hex\"),s=A1t(t,e),a=Sg.encoding.base64Encode(t.payload.toString(\"base64\")),n=Sg.encoding.base64Encode(t.signatures[0].sig.toString(\"base64\")),c=t.signatures[0].keyid,f=Sg.encoding.base64Encode(e),p={payloadType:t.payloadType,payload:a,signatures:[{sig:n,publicKey:f}]};return c.length>0&&(p.signatures[0].keyid=c),{apiVersion:\"0.0.2\",kind:\"intoto\",spec:{content:{envelope:p,hash:{algorithm:Pb,value:s},payloadHash:{algorithm:Pb,value:r}}}}}function A1t(t,e){let r={payloadType:t.payloadType,payload:t.payload.toString(\"base64\"),signatures:[{sig:t.signatures[0].sig.toString(\"base64\"),publicKey:e}]};return t.signatures[0].keyid.length>0&&(r.signatures[0].keyid=t.signatures[0].keyid),Sg.crypto.digest(Pb,Sg.json.canonicalize(r)).toString(\"hex\")}});var Dbe=_(oy=>{\"use strict\";Object.defineProperty(oy,\"__esModule\",{value:!0});oy.RekorWitness=oy.DEFAULT_REKOR_URL=void 0;var p1t=vg(),h1t=vbe(),g1t=Sbe();oy.DEFAULT_REKOR_URL=\"https://rekor.sigstore.dev\";var O7=class{constructor(e){this.entryType=e.entryType,this.tlog=new h1t.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||oy.DEFAULT_REKOR_URL})}async testify(e,r){let s=(0,g1t.toProposedEntry)(e,r,this.entryType),a=await this.tlog.createEntry(s);return d1t(a)}};oy.RekorWitness=O7;function d1t(t){let e=Buffer.from(t.logID,\"hex\"),r=p1t.encoding.base64Decode(t.body),s=JSON.parse(r),a=t?.verification?.signedEntryTimestamp?m1t(t.verification.signedEntryTimestamp):void 0,n=t?.verification?.inclusionProof?y1t(t.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:t.logIndex.toString(),logId:{keyId:e},integratedTime:t.integratedTime.toString(),kindVersion:{kind:s.kind,version:s.apiVersion},inclusionPromise:a,inclusionProof:n,canonicalizedBody:Buffer.from(t.body,\"base64\")}]}}function m1t(t){return{signedEntryTimestamp:Buffer.from(t,\"base64\")}}function y1t(t){return{logIndex:t.logIndex.toString(),treeSize:t.treeSize.toString(),rootHash:Buffer.from(t.rootHash,\"hex\"),hashes:t.hashes.map(e=>Buffer.from(e,\"hex\")),checkpoint:{envelope:t.checkpoint}}}});var bbe=_(PO=>{\"use strict\";Object.defineProperty(PO,\"__esModule\",{value:!0});PO.TimestampAuthority=void 0;var E1t=BO(),L7=class{constructor(e){this.options=e}async createTimestamp(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/timestamp`;return(await(0,E1t.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(e),timeout:s,retry:a})).buffer()}};PO.TimestampAuthority=L7});var xbe=_(xO=>{\"use strict\";Object.defineProperty(xO,\"__esModule\",{value:!0});xO.TSAClient=void 0;var I1t=$w(),C1t=bbe(),w1t=vg(),Pbe=\"sha256\",M7=class{constructor(e){this.tsa=new C1t.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let r={artifactHash:w1t.crypto.digest(Pbe,e).toString(\"base64\"),hashAlgorithm:Pbe};try{return await this.tsa.createTimestamp(r)}catch(s){(0,I1t.internalError)(s,\"TSA_CREATE_TIMESTAMP_ERROR\",\"error creating timestamp\")}}};xO.TSAClient=M7});var kbe=_(kO=>{\"use strict\";Object.defineProperty(kO,\"__esModule\",{value:!0});kO.TSAWitness=void 0;var B1t=xbe(),U7=class{constructor(e){this.tsa=new B1t.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let r=v1t(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(r)}]}}};kO.TSAWitness=U7;function v1t(t){switch(t.$case){case\"dsseEnvelope\":return t.dsseEnvelope.signatures[0].sig;case\"messageSignature\":return t.messageSignature.signature}}});var Tbe=_(Dg=>{\"use strict\";Object.defineProperty(Dg,\"__esModule\",{value:!0});Dg.TSAWitness=Dg.RekorWitness=Dg.DEFAULT_REKOR_URL=void 0;var Qbe=Dbe();Object.defineProperty(Dg,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return Qbe.DEFAULT_REKOR_URL}});Object.defineProperty(Dg,\"RekorWitness\",{enumerable:!0,get:function(){return Qbe.RekorWitness}});var S1t=kbe();Object.defineProperty(Dg,\"TSAWitness\",{enumerable:!0,get:function(){return S1t.TSAWitness}})});var H7=_(ys=>{\"use strict\";Object.defineProperty(ys,\"__esModule\",{value:!0});ys.TSAWitness=ys.RekorWitness=ys.DEFAULT_REKOR_URL=ys.FulcioSigner=ys.DEFAULT_FULCIO_URL=ys.CIContextProvider=ys.InternalError=ys.MessageSignatureBundleBuilder=ys.DSSEBundleBuilder=void 0;var Rbe=JDe();Object.defineProperty(ys,\"DSSEBundleBuilder\",{enumerable:!0,get:function(){return Rbe.DSSEBundleBuilder}});Object.defineProperty(ys,\"MessageSignatureBundleBuilder\",{enumerable:!0,get:function(){return Rbe.MessageSignatureBundleBuilder}});var D1t=$w();Object.defineProperty(ys,\"InternalError\",{enumerable:!0,get:function(){return D1t.InternalError}});var b1t=XDe();Object.defineProperty(ys,\"CIContextProvider\",{enumerable:!0,get:function(){return b1t.CIContextProvider}});var Fbe=Ebe();Object.defineProperty(ys,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return Fbe.DEFAULT_FULCIO_URL}});Object.defineProperty(ys,\"FulcioSigner\",{enumerable:!0,get:function(){return Fbe.FulcioSigner}});var _7=Tbe();Object.defineProperty(ys,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return _7.DEFAULT_REKOR_URL}});Object.defineProperty(ys,\"RekorWitness\",{enumerable:!0,get:function(){return _7.RekorWitness}});Object.defineProperty(ys,\"TSAWitness\",{enumerable:!0,get:function(){return _7.TSAWitness}})});var Obe=_(xb=>{\"use strict\";var Nbe=xb&&xb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xb,\"__esModule\",{value:!0});xb.appDataPath=x1t;var P1t=Nbe(Ie(\"os\")),n1=Nbe(Ie(\"path\"));function x1t(t){let e=P1t.default.homedir();switch(process.platform){case\"darwin\":{let r=n1.default.join(e,\"Library\",\"Application Support\");return n1.default.join(r,t)}case\"win32\":{let r=process.env.LOCALAPPDATA||n1.default.join(e,\"AppData\",\"Local\");return n1.default.join(r,t,\"Data\")}default:{let r=process.env.XDG_DATA_HOME||n1.default.join(e,\".local\",\"share\");return n1.default.join(r,t)}}}});var PA=_(wl=>{\"use strict\";Object.defineProperty(wl,\"__esModule\",{value:!0});wl.UnsupportedAlgorithmError=wl.CryptoError=wl.LengthOrHashMismatchError=wl.UnsignedMetadataError=wl.RepositoryError=wl.ValueError=void 0;var j7=class extends Error{};wl.ValueError=j7;var kb=class extends Error{};wl.RepositoryError=kb;var G7=class extends kb{};wl.UnsignedMetadataError=G7;var q7=class extends kb{};wl.LengthOrHashMismatchError=q7;var QO=class extends Error{};wl.CryptoError=QO;var W7=class extends QO{};wl.UnsupportedAlgorithmError=W7});var Mbe=_(bg=>{\"use strict\";Object.defineProperty(bg,\"__esModule\",{value:!0});bg.isDefined=k1t;bg.isObject=Lbe;bg.isStringArray=Q1t;bg.isObjectArray=T1t;bg.isStringRecord=R1t;bg.isObjectRecord=F1t;function k1t(t){return t!==void 0}function Lbe(t){return typeof t==\"object\"&&t!==null}function Q1t(t){return Array.isArray(t)&&t.every(e=>typeof e==\"string\")}function T1t(t){return Array.isArray(t)&&t.every(Lbe)}function R1t(t){return typeof t==\"object\"&&t!==null&&Object.keys(t).every(e=>typeof e==\"string\")&&Object.values(t).every(e=>typeof e==\"string\")}function F1t(t){return typeof t==\"object\"&&t!==null&&Object.keys(t).every(e=>typeof e==\"string\")&&Object.values(t).every(e=>typeof e==\"object\"&&e!==null)}});var V7=_(($nr,Hbe)=>{var Ube=\",\",N1t=\":\",O1t=\"[\",L1t=\"]\",M1t=\"{\",U1t=\"}\";function Y7(t){let e=[];if(typeof t==\"string\")e.push(_be(t));else if(typeof t==\"boolean\")e.push(JSON.stringify(t));else if(Number.isInteger(t))e.push(JSON.stringify(t));else if(t===null)e.push(JSON.stringify(t));else if(Array.isArray(t)){e.push(O1t);let r=!0;t.forEach(s=>{r||e.push(Ube),r=!1,e.push(Y7(s))}),e.push(L1t)}else if(typeof t==\"object\"){e.push(M1t);let r=!0;Object.keys(t).sort().forEach(s=>{r||e.push(Ube),r=!1,e.push(_be(s)),e.push(N1t),e.push(Y7(t[s]))}),e.push(U1t)}else throw new TypeError(\"cannot encode \"+t.toString());return e.join(\"\")}function _be(t){return'\"'+t.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"')+'\"'}Hbe.exports={canonicalize:Y7}});var jbe=_(i1=>{\"use strict\";var _1t=i1&&i1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i1,\"__esModule\",{value:!0});i1.verifySignature=void 0;var H1t=V7(),j1t=_1t(Ie(\"crypto\")),G1t=(t,e,r)=>{let s=Buffer.from((0,H1t.canonicalize)(t));return j1t.default.verify(void 0,s,e,Buffer.from(r,\"hex\"))};i1.verifySignature=G1t});var ff=_(eu=>{\"use strict\";var q1t=eu&&eu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),W1t=eu&&eu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Gbe=eu&&eu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&q1t(e,t,r);return W1t(e,t),e};Object.defineProperty(eu,\"__esModule\",{value:!0});eu.crypto=eu.guard=void 0;eu.guard=Gbe(Mbe());eu.crypto=Gbe(jbe())});var ay=_(hh=>{\"use strict\";var Y1t=hh&&hh.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hh,\"__esModule\",{value:!0});hh.Signed=hh.MetadataKind=void 0;hh.isMetadataKind=J1t;var V1t=Y1t(Ie(\"util\")),Qb=PA(),J7=ff(),qbe=[\"1\",\"0\",\"31\"],K7;(function(t){t.Root=\"root\",t.Timestamp=\"timestamp\",t.Snapshot=\"snapshot\",t.Targets=\"targets\"})(K7||(hh.MetadataKind=K7={}));function J1t(t){return typeof t==\"string\"&&Object.values(K7).includes(t)}var z7=class t{constructor(e){this.specVersion=e.specVersion||qbe.join(\".\");let r=this.specVersion.split(\".\");if(!(r.length===2||r.length===3)||!r.every(s=>K1t(s)))throw new Qb.ValueError(\"Failed to parse specVersion\");if(r[0]!=qbe[0])throw new Qb.ValueError(\"Unsupported specVersion\");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof t?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&V1t.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}isExpired(e){return e||(e=new Date),e>=new Date(this.expires)}static commonFieldsFromJSON(e){let{spec_version:r,expires:s,version:a,...n}=e;if(J7.guard.isDefined(r)){if(typeof r!=\"string\")throw new TypeError(\"spec_version must be a string\")}else throw new Qb.ValueError(\"spec_version is not defined\");if(J7.guard.isDefined(s)){if(typeof s!=\"string\")throw new TypeError(\"expires must be a string\")}else throw new Qb.ValueError(\"expires is not defined\");if(J7.guard.isDefined(a)){if(typeof a!=\"number\")throw new TypeError(\"version must be a number\")}else throw new Qb.ValueError(\"version is not defined\");return{specVersion:r,expires:s,version:a,unrecognizedFields:n}}};hh.Signed=z7;function K1t(t){return!isNaN(Number(t))}});var Tb=_(xg=>{\"use strict\";var Wbe=xg&&xg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xg,\"__esModule\",{value:!0});xg.TargetFile=xg.MetaFile=void 0;var Ybe=Wbe(Ie(\"crypto\")),RO=Wbe(Ie(\"util\")),Pg=PA(),TO=ff(),X7=class t{constructor(e){if(e.version<=0)throw new Pg.ValueError(\"Metafile version must be at least 1\");e.length!==void 0&&Vbe(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof t?this.version===e.version&&this.length===e.length&&RO.default.isDeepStrictEqual(this.hashes,e.hashes)&&RO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new Pg.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([r,s])=>{let a;try{a=Ybe.default.createHash(r)}catch{throw new Pg.LengthOrHashMismatchError(`Hash algorithm ${r} not supported`)}let n=a.update(e).digest(\"hex\");if(n!==s)throw new Pg.LengthOrHashMismatchError(`Expected hash ${s} but got ${n}`)})}toJSON(){let e={version:this.version,...this.unrecognizedFields};return this.length!==void 0&&(e.length=this.length),this.hashes&&(e.hashes=this.hashes),e}static fromJSON(e){let{version:r,length:s,hashes:a,...n}=e;if(typeof r!=\"number\")throw new TypeError(\"version must be a number\");if(TO.guard.isDefined(s)&&typeof s!=\"number\")throw new TypeError(\"length must be a number\");if(TO.guard.isDefined(a)&&!TO.guard.isStringRecord(a))throw new TypeError(\"hashes must be string keys and values\");return new t({version:r,length:s,hashes:a,unrecognizedFields:n})}};xg.MetaFile=X7;var Z7=class t{constructor(e){Vbe(e.length),this.length=e.length,this.path=e.path,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}get custom(){let e=this.unrecognizedFields.custom;return!e||Array.isArray(e)||typeof e!=\"object\"?{}:e}equals(e){return e instanceof t?this.length===e.length&&this.path===e.path&&RO.default.isDeepStrictEqual(this.hashes,e.hashes)&&RO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let r=0,s=Object.keys(this.hashes).reduce((a,n)=>{try{a[n]=Ybe.default.createHash(n)}catch{throw new Pg.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return a},{});for await(let a of e)r+=a.length,Object.values(s).forEach(n=>{n.update(a)});if(r!==this.length)throw new Pg.LengthOrHashMismatchError(`Expected length ${this.length} but got ${r}`);Object.entries(s).forEach(([a,n])=>{let c=this.hashes[a],f=n.digest(\"hex\");if(f!==c)throw new Pg.LengthOrHashMismatchError(`Expected hash ${c} but got ${f}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,r){let{length:s,hashes:a,...n}=r;if(typeof s!=\"number\")throw new TypeError(\"length must be a number\");if(!TO.guard.isStringRecord(a))throw new TypeError(\"hashes must have string keys and values\");return new t({length:s,path:e,hashes:a,unrecognizedFields:n})}};xg.TargetFile=Z7;function Vbe(t){if(t<0)throw new Pg.ValueError(\"Length must be at least 0\")}});var Jbe=_($7=>{\"use strict\";Object.defineProperty($7,\"__esModule\",{value:!0});$7.encodeOIDString=X1t;var z1t=6;function X1t(t){let e=t.split(\".\"),r=parseInt(e[0],10)*40+parseInt(e[1],10),s=[];e.slice(2).forEach(n=>{let c=Z1t(parseInt(n,10));s.push(...c)});let a=Buffer.from([r,...s]);return Buffer.from([z1t,a.length,...a])}function Z1t(t){let e=[],r=0;for(;t>0;)e.unshift(t&127|r),t>>=7,r=128;return e}});var Zbe=_(Fb=>{\"use strict\";var $1t=Fb&&Fb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fb,\"__esModule\",{value:!0});Fb.getPublicKey=n2t;var s1=$1t(Ie(\"crypto\")),Rb=PA(),eJ=Jbe(),FO=48,Kbe=3,zbe=0,e2t=\"1.3.101.112\",t2t=\"1.2.840.10045.2.1\",r2t=\"1.2.840.10045.3.1.7\",tJ=\"-----BEGIN PUBLIC KEY-----\";function n2t(t){switch(t.keyType){case\"rsa\":return i2t(t);case\"ed25519\":return s2t(t);case\"ecdsa\":case\"ecdsa-sha2-nistp256\":case\"ecdsa-sha2-nistp384\":return o2t(t);default:throw new Rb.UnsupportedAlgorithmError(`Unsupported key type: ${t.keyType}`)}}function i2t(t){if(!t.keyVal.startsWith(tJ))throw new Rb.CryptoError(\"Invalid key format\");let e=s1.default.createPublicKey(t.keyVal);switch(t.scheme){case\"rsassa-pss-sha256\":return{key:e,padding:s1.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Rb.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${t.scheme}`)}}function s2t(t){let e;if(t.keyVal.startsWith(tJ))e=s1.default.createPublicKey(t.keyVal);else{if(!Xbe(t.keyVal))throw new Rb.CryptoError(\"Invalid key format\");e=s1.default.createPublicKey({key:a2t.hexToDER(t.keyVal),format:\"der\",type:\"spki\"})}return{key:e}}function o2t(t){let e;if(t.keyVal.startsWith(tJ))e=s1.default.createPublicKey(t.keyVal);else{if(!Xbe(t.keyVal))throw new Rb.CryptoError(\"Invalid key format\");e=s1.default.createPublicKey({key:l2t.hexToDER(t.keyVal),format:\"der\",type:\"spki\"})}return{key:e}}var a2t={hexToDER:t=>{let e=Buffer.from(t,\"hex\"),r=(0,eJ.encodeOIDString)(e2t),s=Buffer.concat([Buffer.concat([Buffer.from([FO]),Buffer.from([r.length]),r]),Buffer.concat([Buffer.from([Kbe]),Buffer.from([e.length+1]),Buffer.from([zbe]),e])]);return Buffer.concat([Buffer.from([FO]),Buffer.from([s.length]),s])}},l2t={hexToDER:t=>{let e=Buffer.from(t,\"hex\"),r=Buffer.concat([Buffer.from([Kbe]),Buffer.from([e.length+1]),Buffer.from([zbe]),e]),s=Buffer.concat([(0,eJ.encodeOIDString)(t2t),(0,eJ.encodeOIDString)(r2t)]),a=Buffer.concat([Buffer.from([FO]),Buffer.from([s.length]),s]);return Buffer.concat([Buffer.from([FO]),Buffer.from([a.length+r.length]),a,r])}},Xbe=t=>/^[0-9a-fA-F]+$/.test(t)});var NO=_(o1=>{\"use strict\";var c2t=o1&&o1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o1,\"__esModule\",{value:!0});o1.Key=void 0;var $be=c2t(Ie(\"util\")),Nb=PA(),ePe=ff(),u2t=Zbe(),rJ=class t{constructor(e){let{keyID:r,keyType:s,scheme:a,keyVal:n,unrecognizedFields:c}=e;this.keyID=r,this.keyType=s,this.scheme=a,this.keyVal=n,this.unrecognizedFields=c||{}}verifySignature(e){let r=e.signatures[this.keyID];if(!r)throw new Nb.UnsignedMetadataError(\"no signature for key found in metadata\");if(!this.keyVal.public)throw new Nb.UnsignedMetadataError(\"no public key found\");let s=(0,u2t.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),a=e.signed.toJSON();try{if(!ePe.crypto.verifySignature(a,s,r.sig))throw new Nb.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof Nb.UnsignedMetadataError?n:new Nb.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof t?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&$be.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&$be.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keytype:this.keyType,scheme:this.scheme,keyval:this.keyVal,...this.unrecognizedFields}}static fromJSON(e,r){let{keytype:s,scheme:a,keyval:n,...c}=r;if(typeof s!=\"string\")throw new TypeError(\"keytype must be a string\");if(typeof a!=\"string\")throw new TypeError(\"scheme must be a string\");if(!ePe.guard.isStringRecord(n))throw new TypeError(\"keyval must be a string record\");return new t({keyID:e,keyType:s,scheme:a,keyVal:n,unrecognizedFields:c})}};o1.Key=rJ});var sPe=_((air,iPe)=>{\"use strict\";iPe.exports=rPe;function rPe(t,e,r){t instanceof RegExp&&(t=tPe(t,r)),e instanceof RegExp&&(e=tPe(e,r));var s=nPe(t,e,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+t.length,s[1]),post:r.slice(s[1]+e.length)}}function tPe(t,e){var r=e.match(t);return r?r[0]:null}rPe.range=nPe;function nPe(t,e,r){var s,a,n,c,f,p=r.indexOf(t),h=r.indexOf(e,p+1),E=p;if(p>=0&&h>0){for(s=[],n=r.length;E>=0&&!f;)E==p?(s.push(E),p=r.indexOf(t,E+1)):s.length==1?f=[s.pop(),h]:(a=s.pop(),a<n&&(n=a,c=h),h=r.indexOf(e,E+1)),E=p<h&&p>=0?p:h;s.length&&(f=[n,c])}return f}});var pPe=_((lir,APe)=>{var oPe=sPe();APe.exports=p2t;var aPe=\"\\0SLASH\"+Math.random()+\"\\0\",lPe=\"\\0OPEN\"+Math.random()+\"\\0\",iJ=\"\\0CLOSE\"+Math.random()+\"\\0\",cPe=\"\\0COMMA\"+Math.random()+\"\\0\",uPe=\"\\0PERIOD\"+Math.random()+\"\\0\";function nJ(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function f2t(t){return t.split(\"\\\\\\\\\").join(aPe).split(\"\\\\{\").join(lPe).split(\"\\\\}\").join(iJ).split(\"\\\\,\").join(cPe).split(\"\\\\.\").join(uPe)}function A2t(t){return t.split(aPe).join(\"\\\\\").split(lPe).join(\"{\").split(iJ).join(\"}\").split(cPe).join(\",\").split(uPe).join(\".\")}function fPe(t){if(!t)return[\"\"];var e=[],r=oPe(\"{\",\"}\",t);if(!r)return t.split(\",\");var s=r.pre,a=r.body,n=r.post,c=s.split(\",\");c[c.length-1]+=\"{\"+a+\"}\";var f=fPe(n);return n.length&&(c[c.length-1]+=f.shift(),c.push.apply(c,f)),e.push.apply(e,c),e}function p2t(t){return t?(t.substr(0,2)===\"{}\"&&(t=\"\\\\{\\\\}\"+t.substr(2)),Ob(f2t(t),!0).map(A2t)):[]}function h2t(t){return\"{\"+t+\"}\"}function g2t(t){return/^-?0\\d/.test(t)}function d2t(t,e){return t<=e}function m2t(t,e){return t>=e}function Ob(t,e){var r=[],s=oPe(\"{\",\"}\",t);if(!s)return[t];var a=s.pre,n=s.post.length?Ob(s.post,!1):[\"\"];if(/\\$$/.test(s.pre))for(var c=0;c<n.length;c++){var f=a+\"{\"+s.body+\"}\"+n[c];r.push(f)}else{var p=/^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(s.body),h=/^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(s.body),E=p||h,C=s.body.indexOf(\",\")>=0;if(!E&&!C)return s.post.match(/,.*\\}/)?(t=s.pre+\"{\"+s.body+iJ+s.post,Ob(t)):[t];var S;if(E)S=s.body.split(/\\.\\./);else if(S=fPe(s.body),S.length===1&&(S=Ob(S[0],!1).map(h2t),S.length===1))return n.map(function(Ce){return s.pre+S[0]+Ce});var P;if(E){var I=nJ(S[0]),R=nJ(S[1]),N=Math.max(S[0].length,S[1].length),U=S.length==3?Math.abs(nJ(S[2])):1,W=d2t,ee=R<I;ee&&(U*=-1,W=m2t);var ie=S.some(g2t);P=[];for(var ue=I;W(ue,R);ue+=U){var le;if(h)le=String.fromCharCode(ue),le===\"\\\\\"&&(le=\"\");else if(le=String(ue),ie){var me=N-le.length;if(me>0){var pe=new Array(me+1).join(\"0\");ue<0?le=\"-\"+pe+le.slice(1):le=pe+le}}P.push(le)}}else{P=[];for(var Be=0;Be<S.length;Be++)P.push.apply(P,Ob(S[Be],!1))}for(var Be=0;Be<P.length;Be++)for(var c=0;c<n.length;c++){var f=a+P[Be]+n[c];(!e||E||f)&&r.push(f)}}return r}});var hPe=_(OO=>{\"use strict\";Object.defineProperty(OO,\"__esModule\",{value:!0});OO.assertValidPattern=void 0;var y2t=1024*64,E2t=t=>{if(typeof t!=\"string\")throw new TypeError(\"invalid pattern\");if(t.length>y2t)throw new TypeError(\"pattern is too long\")};OO.assertValidPattern=E2t});var dPe=_(LO=>{\"use strict\";Object.defineProperty(LO,\"__esModule\",{value:!0});LO.parseClass=void 0;var I2t={\"[:alnum:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\",!0],\"[:alpha:]\":[\"\\\\p{L}\\\\p{Nl}\",!0],\"[:ascii:]\":[\"\\\\x00-\\\\x7f\",!1],\"[:blank:]\":[\"\\\\p{Zs}\\\\t\",!0],\"[:cntrl:]\":[\"\\\\p{Cc}\",!0],\"[:digit:]\":[\"\\\\p{Nd}\",!0],\"[:graph:]\":[\"\\\\p{Z}\\\\p{C}\",!0,!0],\"[:lower:]\":[\"\\\\p{Ll}\",!0],\"[:print:]\":[\"\\\\p{C}\",!0],\"[:punct:]\":[\"\\\\p{P}\",!0],\"[:space:]\":[\"\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f\",!0],\"[:upper:]\":[\"\\\\p{Lu}\",!0],\"[:word:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}\",!0],\"[:xdigit:]\":[\"A-Fa-f0-9\",!1]},Lb=t=>t.replace(/[[\\]\\\\-]/g,\"\\\\$&\"),C2t=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),gPe=t=>t.join(\"\"),w2t=(t,e)=>{let r=e;if(t.charAt(r)!==\"[\")throw new Error(\"not in a brace expression\");let s=[],a=[],n=r+1,c=!1,f=!1,p=!1,h=!1,E=r,C=\"\";e:for(;n<t.length;){let R=t.charAt(n);if((R===\"!\"||R===\"^\")&&n===r+1){h=!0,n++;continue}if(R===\"]\"&&c&&!p){E=n+1;break}if(c=!0,R===\"\\\\\"&&!p){p=!0,n++;continue}if(R===\"[\"&&!p){for(let[N,[U,W,ee]]of Object.entries(I2t))if(t.startsWith(N,n)){if(C)return[\"$.\",!1,t.length-r,!0];n+=N.length,ee?a.push(U):s.push(U),f=f||W;continue e}}if(p=!1,C){R>C?s.push(Lb(C)+\"-\"+Lb(R)):R===C&&s.push(Lb(R)),C=\"\",n++;continue}if(t.startsWith(\"-]\",n+1)){s.push(Lb(R+\"-\")),n+=2;continue}if(t.startsWith(\"-\",n+1)){C=R,n+=2;continue}s.push(Lb(R)),n++}if(E<n)return[\"\",!1,0,!1];if(!s.length&&!a.length)return[\"$.\",!1,t.length-r,!0];if(a.length===0&&s.length===1&&/^\\\\?.$/.test(s[0])&&!h){let R=s[0].length===2?s[0].slice(-1):s[0];return[C2t(R),!1,E-r,!1]}let S=\"[\"+(h?\"^\":\"\")+gPe(s)+\"]\",P=\"[\"+(h?\"\":\"^\")+gPe(a)+\"]\";return[s.length&&a.length?\"(\"+S+\"|\"+P+\")\":s.length?S:P,f,E-r,!0]};LO.parseClass=w2t});var UO=_(MO=>{\"use strict\";Object.defineProperty(MO,\"__esModule\",{value:!0});MO.unescape=void 0;var B2t=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\\[([^\\/\\\\])\\]/g,\"$1\"):t.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g,\"$1$2\").replace(/\\\\([^\\/])/g,\"$1\");MO.unescape=B2t});var aJ=_(jO=>{\"use strict\";Object.defineProperty(jO,\"__esModule\",{value:!0});jO.AST=void 0;var v2t=dPe(),_O=UO(),S2t=new Set([\"!\",\"?\",\"+\",\"*\",\"@\"]),mPe=t=>S2t.has(t),D2t=\"(?!(?:^|/)\\\\.\\\\.?(?:$|/))\",HO=\"(?!\\\\.)\",b2t=new Set([\"[\",\".\"]),P2t=new Set([\"..\",\".\"]),x2t=new Set(\"().*{}+?[]^$\\\\!\"),k2t=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),oJ=\"[^/]\",yPe=oJ+\"*?\",EPe=oJ+\"+?\",sJ=class t{type;#t;#r;#i=!1;#e=[];#n;#o;#l;#a=!1;#s;#c;#f=!1;constructor(e,r,s={}){this.type=e,e&&(this.#r=!0),this.#n=r,this.#t=this.#n?this.#n.#t:this,this.#s=this.#t===this?s:this.#t.#s,this.#l=this.#t===this?[]:this.#t.#l,e===\"!\"&&!this.#t.#a&&this.#l.push(this),this.#o=this.#n?this.#n.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!=\"string\"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+\"(\"+this.#e.map(e=>String(e)).join(\"|\")+\")\":this.#c=this.#e.map(e=>String(e)).join(\"\")}#p(){if(this!==this.#t)throw new Error(\"should only call on root\");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#l.pop();){if(e.type!==\"!\")continue;let r=e,s=r.#n;for(;s;){for(let a=r.#o+1;!s.type&&a<s.#e.length;a++)for(let n of e.#e){if(typeof n==\"string\")throw new Error(\"string part in extglob AST??\");n.copyIn(s.#e[a])}r=s,s=r.#n}}return this}push(...e){for(let r of e)if(r!==\"\"){if(typeof r!=\"string\"&&!(r instanceof t&&r.#n===this))throw new Error(\"invalid part: \"+r);this.#e.push(r)}}toJSON(){let e=this.type===null?this.#e.slice().map(r=>typeof r==\"string\"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#n?.type===\"!\")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#n?.isStart())return!1;if(this.#o===0)return!0;let e=this.#n;for(let r=0;r<this.#o;r++){let s=e.#e[r];if(!(s instanceof t&&s.type===\"!\"))return!1}return!0}isEnd(){if(this.#t===this||this.#n?.type===\"!\")return!0;if(!this.#n?.isEnd())return!1;if(!this.type)return this.#n?.isEnd();let e=this.#n?this.#n.#e.length:0;return this.#o===e-1}copyIn(e){typeof e==\"string\"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let s of this.#e)r.copyIn(s);return r}static#u(e,r,s,a){let n=!1,c=!1,f=-1,p=!1;if(r.type===null){let P=s,I=\"\";for(;P<e.length;){let R=e.charAt(P++);if(n||R===\"\\\\\"){n=!n,I+=R;continue}if(c){P===f+1?(R===\"^\"||R===\"!\")&&(p=!0):R===\"]\"&&!(P===f+2&&p)&&(c=!1),I+=R;continue}else if(R===\"[\"){c=!0,f=P,p=!1,I+=R;continue}if(!a.noext&&mPe(R)&&e.charAt(P)===\"(\"){r.push(I),I=\"\";let N=new t(R,r);P=t.#u(e,N,P,a),r.push(N);continue}I+=R}return r.push(I),P}let h=s+1,E=new t(null,r),C=[],S=\"\";for(;h<e.length;){let P=e.charAt(h++);if(n||P===\"\\\\\"){n=!n,S+=P;continue}if(c){h===f+1?(P===\"^\"||P===\"!\")&&(p=!0):P===\"]\"&&!(h===f+2&&p)&&(c=!1),S+=P;continue}else if(P===\"[\"){c=!0,f=h,p=!1,S+=P;continue}if(mPe(P)&&e.charAt(h)===\"(\"){E.push(S),S=\"\";let I=new t(P,E);E.push(I),h=t.#u(e,I,h,a);continue}if(P===\"|\"){E.push(S),S=\"\",C.push(E),E=new t(null,r);continue}if(P===\")\")return S===\"\"&&r.#e.length===0&&(r.#f=!0),E.push(S),S=\"\",r.push(...C,E),h;S+=P}return r.type=null,r.#r=void 0,r.#e=[e.substring(s-1)],h}static fromGlob(e,r={}){let s=new t(null,void 0,r);return t.#u(e,s,0,r),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,s,a,n]=this.toRegExpSource();if(!(a||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let f=(this.#s.nocase?\"i\":\"\")+(n?\"u\":\"\");return Object.assign(new RegExp(`^${r}$`,f),{_src:r,_glob:e})}get options(){return this.#s}toRegExpSource(e){let r=e??!!this.#s.dot;if(this.#t===this&&this.#p(),!this.type){let p=this.isStart()&&this.isEnd(),h=this.#e.map(P=>{let[I,R,N,U]=typeof P==\"string\"?t.#h(P,this.#r,p):P.toRegExpSource(e);return this.#r=this.#r||N,this.#i=this.#i||U,I}).join(\"\"),E=\"\";if(this.isStart()&&typeof this.#e[0]==\"string\"&&!(this.#e.length===1&&P2t.has(this.#e[0]))){let I=b2t,R=r&&I.has(h.charAt(0))||h.startsWith(\"\\\\.\")&&I.has(h.charAt(2))||h.startsWith(\"\\\\.\\\\.\")&&I.has(h.charAt(4)),N=!r&&!e&&I.has(h.charAt(0));E=R?D2t:N?HO:\"\"}let C=\"\";return this.isEnd()&&this.#t.#a&&this.#n?.type===\"!\"&&(C=\"(?:$|\\\\/)\"),[E+h+C,(0,_O.unescape)(h),this.#r=!!this.#r,this.#i]}let s=this.type===\"*\"||this.type===\"+\",a=this.type===\"!\"?\"(?:(?!(?:\":\"(?:\",n=this.#A(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!==\"!\"){let p=this.toString();return this.#e=[p],this.type=null,this.#r=void 0,[p,(0,_O.unescape)(this.toString()),!1,!1]}let c=!s||e||r||!HO?\"\":this.#A(!0);c===n&&(c=\"\"),c&&(n=`(?:${n})(?:${c})*?`);let f=\"\";if(this.type===\"!\"&&this.#f)f=(this.isStart()&&!r?HO:\"\")+EPe;else{let p=this.type===\"!\"?\"))\"+(this.isStart()&&!r&&!e?HO:\"\")+yPe+\")\":this.type===\"@\"?\")\":this.type===\"?\"?\")?\":this.type===\"+\"&&c?\")\":this.type===\"*\"&&c?\")?\":`)${this.type}`;f=a+n+p}return[f,(0,_O.unescape)(n),this.#r=!!this.#r,this.#i]}#A(e){return this.#e.map(r=>{if(typeof r==\"string\")throw new Error(\"string type in extglob ast??\");let[s,a,n,c]=r.toRegExpSource(e);return this.#i=this.#i||c,s}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join(\"|\")}static#h(e,r,s=!1){let a=!1,n=\"\",c=!1;for(let f=0;f<e.length;f++){let p=e.charAt(f);if(a){a=!1,n+=(x2t.has(p)?\"\\\\\":\"\")+p;continue}if(p===\"\\\\\"){f===e.length-1?n+=\"\\\\\\\\\":a=!0;continue}if(p===\"[\"){let[h,E,C,S]=(0,v2t.parseClass)(e,f);if(C){n+=h,c=c||E,f+=C-1,r=r||S;continue}}if(p===\"*\"){s&&e===\"*\"?n+=EPe:n+=yPe,r=!0;continue}if(p===\"?\"){n+=oJ,r=!0;continue}n+=k2t(p)}return[n,(0,_O.unescape)(e),!!r,c]}};jO.AST=sJ});var lJ=_(GO=>{\"use strict\";Object.defineProperty(GO,\"__esModule\",{value:!0});GO.escape=void 0;var Q2t=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\\]]/g,\"[$&]\"):t.replace(/[?*()[\\]\\\\]/g,\"\\\\$&\");GO.escape=Q2t});var DPe=_(pr=>{\"use strict\";var T2t=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,\"__esModule\",{value:!0});pr.unescape=pr.escape=pr.AST=pr.Minimatch=pr.match=pr.makeRe=pr.braceExpand=pr.defaults=pr.filter=pr.GLOBSTAR=pr.sep=pr.minimatch=void 0;var R2t=T2t(pPe()),qO=hPe(),wPe=aJ(),F2t=lJ(),N2t=UO(),O2t=(t,e,r={})=>((0,qO.assertValidPattern)(e),!r.nocomment&&e.charAt(0)===\"#\"?!1:new ly(e,r).match(t));pr.minimatch=O2t;var L2t=/^\\*+([^+@!?\\*\\[\\(]*)$/,M2t=t=>e=>!e.startsWith(\".\")&&e.endsWith(t),U2t=t=>e=>e.endsWith(t),_2t=t=>(t=t.toLowerCase(),e=>!e.startsWith(\".\")&&e.toLowerCase().endsWith(t)),H2t=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),j2t=/^\\*+\\.\\*+$/,G2t=t=>!t.startsWith(\".\")&&t.includes(\".\"),q2t=t=>t!==\".\"&&t!==\"..\"&&t.includes(\".\"),W2t=/^\\.\\*+$/,Y2t=t=>t!==\".\"&&t!==\"..\"&&t.startsWith(\".\"),V2t=/^\\*+$/,J2t=t=>t.length!==0&&!t.startsWith(\".\"),K2t=t=>t.length!==0&&t!==\".\"&&t!==\"..\",z2t=/^\\?+([^+@!?\\*\\[\\(]*)?$/,X2t=([t,e=\"\"])=>{let r=BPe([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},Z2t=([t,e=\"\"])=>{let r=vPe([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},$2t=([t,e=\"\"])=>{let r=vPe([t]);return e?s=>r(s)&&s.endsWith(e):r},eBt=([t,e=\"\"])=>{let r=BPe([t]);return e?s=>r(s)&&s.endsWith(e):r},BPe=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(\".\")},vPe=([t])=>{let e=t.length;return r=>r.length===e&&r!==\".\"&&r!==\"..\"},SPe=typeof process==\"object\"&&process?typeof process.env==\"object\"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:\"posix\",IPe={win32:{sep:\"\\\\\"},posix:{sep:\"/\"}};pr.sep=SPe===\"win32\"?IPe.win32.sep:IPe.posix.sep;pr.minimatch.sep=pr.sep;pr.GLOBSTAR=Symbol(\"globstar **\");pr.minimatch.GLOBSTAR=pr.GLOBSTAR;var tBt=\"[^/]\",rBt=tBt+\"*?\",nBt=\"(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?\",iBt=\"(?:(?!(?:\\\\/|^)\\\\.).)*?\",sBt=(t,e={})=>r=>(0,pr.minimatch)(r,t,e);pr.filter=sBt;pr.minimatch.filter=pr.filter;var tu=(t,e={})=>Object.assign({},t,e),oBt=t=>{if(!t||typeof t!=\"object\"||!Object.keys(t).length)return pr.minimatch;let e=pr.minimatch;return Object.assign((s,a,n={})=>e(s,a,tu(t,n)),{Minimatch:class extends e.Minimatch{constructor(a,n={}){super(a,tu(t,n))}static defaults(a){return e.defaults(tu(t,a)).Minimatch}},AST:class extends e.AST{constructor(a,n,c={}){super(a,n,tu(t,c))}static fromGlob(a,n={}){return e.AST.fromGlob(a,tu(t,n))}},unescape:(s,a={})=>e.unescape(s,tu(t,a)),escape:(s,a={})=>e.escape(s,tu(t,a)),filter:(s,a={})=>e.filter(s,tu(t,a)),defaults:s=>e.defaults(tu(t,s)),makeRe:(s,a={})=>e.makeRe(s,tu(t,a)),braceExpand:(s,a={})=>e.braceExpand(s,tu(t,a)),match:(s,a,n={})=>e.match(s,a,tu(t,n)),sep:e.sep,GLOBSTAR:pr.GLOBSTAR})};pr.defaults=oBt;pr.minimatch.defaults=pr.defaults;var aBt=(t,e={})=>((0,qO.assertValidPattern)(t),e.nobrace||!/\\{(?:(?!\\{).)*\\}/.test(t)?[t]:(0,R2t.default)(t));pr.braceExpand=aBt;pr.minimatch.braceExpand=pr.braceExpand;var lBt=(t,e={})=>new ly(t,e).makeRe();pr.makeRe=lBt;pr.minimatch.makeRe=pr.makeRe;var cBt=(t,e,r={})=>{let s=new ly(e,r);return t=t.filter(a=>s.match(a)),s.options.nonull&&!t.length&&t.push(e),t};pr.match=cBt;pr.minimatch.match=pr.match;var CPe=/[?*]|[+@!]\\(.*?\\)|\\[|\\]/,uBt=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),ly=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){(0,qO.assertValidPattern)(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||SPe,this.isWindows=this.platform===\"win32\",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\\\/g,\"/\")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!=\"string\")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)===\"#\"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let a=this.globParts.map((n,c,f)=>{if(this.isWindows&&this.windowsNoMagicRoot){let p=n[0]===\"\"&&n[1]===\"\"&&(n[2]===\"?\"||!CPe.test(n[2]))&&!CPe.test(n[3]),h=/^[a-z]:/i.test(n[0]);if(p)return[...n.slice(0,4),...n.slice(4).map(E=>this.parse(E))];if(h)return[n[0],...n.slice(1).map(E=>this.parse(E))]}return n.map(p=>this.parse(p))});if(this.debug(this.pattern,a),this.set=a.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let c=this.set[n];c[0]===\"\"&&c[1]===\"\"&&this.globParts[n][2]===\"?\"&&typeof c[3]==\"string\"&&/^[a-z]:$/i.test(c[3])&&(c[2]=\"?\")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let a=0;a<e[s].length;a++)e[s][a]===\"**\"&&(e[s][a]=\"*\");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let s=-1;for(;(s=r.indexOf(\"**\",s+1))!==-1;){let a=s;for(;r[a+1]===\"**\";)a++;a!==s&&r.splice(s,a-s)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((s,a)=>{let n=s[s.length-1];return a===\"**\"&&n===\"**\"?s:a===\"..\"&&n&&n!==\"..\"&&n!==\".\"&&n!==\"**\"?(s.pop(),s):(s.push(a),s)},[]),r.length===0?[\"\"]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let a=1;a<e.length-1;a++){let n=e[a];a===1&&n===\"\"&&e[0]===\"\"||(n===\".\"||n===\"\")&&(r=!0,e.splice(a,1),a--)}e[0]===\".\"&&e.length===2&&(e[1]===\".\"||e[1]===\"\")&&(r=!0,e.pop())}let s=0;for(;(s=e.indexOf(\"..\",s+1))!==-1;){let a=e[s-1];a&&a!==\".\"&&a!==\"..\"&&a!==\"**\"&&(r=!0,e.splice(s-1,2),s-=2)}}while(r);return e.length===0?[\"\"]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let s of e){let a=-1;for(;(a=s.indexOf(\"**\",a+1))!==-1;){let c=a;for(;s[c+1]===\"**\";)c++;c>a&&s.splice(a+1,c-a);let f=s[a+1],p=s[a+2],h=s[a+3];if(f!==\"..\"||!p||p===\".\"||p===\"..\"||!h||h===\".\"||h===\"..\")continue;r=!0,s.splice(a,1);let E=s.slice(0);E[a]=\"**\",e.push(E),a--}if(!this.preserveMultipleSlashes){for(let c=1;c<s.length-1;c++){let f=s[c];c===1&&f===\"\"&&s[0]===\"\"||(f===\".\"||f===\"\")&&(r=!0,s.splice(c,1),c--)}s[0]===\".\"&&s.length===2&&(s[1]===\".\"||s[1]===\"\")&&(r=!0,s.pop())}let n=0;for(;(n=s.indexOf(\"..\",n+1))!==-1;){let c=s[n-1];if(c&&c!==\".\"&&c!==\"..\"&&c!==\"**\"){r=!0;let p=n===1&&s[n+1]===\"**\"?[\".\"]:[];s.splice(n-1,2,...p),s.length===0&&s.push(\"\"),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let s=r+1;s<e.length;s++){let a=this.partsMatch(e[r],e[s],!this.preserveMultipleSlashes);if(a){e[r]=[],e[s]=a;break}}return e.filter(r=>r.length)}partsMatch(e,r,s=!1){let a=0,n=0,c=[],f=\"\";for(;a<e.length&&n<r.length;)if(e[a]===r[n])c.push(f===\"b\"?r[n]:e[a]),a++,n++;else if(s&&e[a]===\"**\"&&r[n]===e[a+1])c.push(e[a]),a++;else if(s&&r[n]===\"**\"&&e[a]===r[n+1])c.push(r[n]),n++;else if(e[a]===\"*\"&&r[n]&&(this.options.dot||!r[n].startsWith(\".\"))&&r[n]!==\"**\"){if(f===\"b\")return!1;f=\"a\",c.push(e[a]),a++,n++}else if(r[n]===\"*\"&&e[a]&&(this.options.dot||!e[a].startsWith(\".\"))&&e[a]!==\"**\"){if(f===\"a\")return!1;f=\"b\",c.push(r[n]),a++,n++}else return!1;return e.length===r.length&&c}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,s=0;for(let a=0;a<e.length&&e.charAt(a)===\"!\";a++)r=!r,s++;s&&(this.pattern=e.slice(s)),this.negate=r}matchOne(e,r,s=!1){let a=this.options;if(this.isWindows){let R=typeof e[0]==\"string\"&&/^[a-z]:$/i.test(e[0]),N=!R&&e[0]===\"\"&&e[1]===\"\"&&e[2]===\"?\"&&/^[a-z]:$/i.test(e[3]),U=typeof r[0]==\"string\"&&/^[a-z]:$/i.test(r[0]),W=!U&&r[0]===\"\"&&r[1]===\"\"&&r[2]===\"?\"&&typeof r[3]==\"string\"&&/^[a-z]:$/i.test(r[3]),ee=N?3:R?0:void 0,ie=W?3:U?0:void 0;if(typeof ee==\"number\"&&typeof ie==\"number\"){let[ue,le]=[e[ee],r[ie]];ue.toLowerCase()===le.toLowerCase()&&(r[ie]=ue,ie>ee?r=r.slice(ie):ee>ie&&(e=e.slice(ee)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug(\"matchOne\",this,{file:e,pattern:r}),this.debug(\"matchOne\",e.length,r.length);for(var c=0,f=0,p=e.length,h=r.length;c<p&&f<h;c++,f++){this.debug(\"matchOne loop\");var E=r[f],C=e[c];if(this.debug(r,E,C),E===!1)return!1;if(E===pr.GLOBSTAR){this.debug(\"GLOBSTAR\",[r,E,C]);var S=c,P=f+1;if(P===h){for(this.debug(\"** at the end\");c<p;c++)if(e[c]===\".\"||e[c]===\"..\"||!a.dot&&e[c].charAt(0)===\".\")return!1;return!0}for(;S<p;){var I=e[S];if(this.debug(`\nglobstar while`,e,S,r,P,I),this.matchOne(e.slice(S),r.slice(P),s))return this.debug(\"globstar found match!\",S,p,I),!0;if(I===\".\"||I===\"..\"||!a.dot&&I.charAt(0)===\".\"){this.debug(\"dot detected!\",e,S,r,P);break}this.debug(\"globstar swallow a segment, and continue\"),S++}return!!(s&&(this.debug(`\n>>> no match, partial?`,e,S,r,P),S===p))}let R;if(typeof E==\"string\"?(R=C===E,this.debug(\"string match\",E,C,R)):(R=E.test(C),this.debug(\"pattern match\",E,C,R)),!R)return!1}if(c===p&&f===h)return!0;if(c===p)return s;if(f===h)return c===p-1&&e[c]===\"\";throw new Error(\"wtf?\")}braceExpand(){return(0,pr.braceExpand)(this.pattern,this.options)}parse(e){(0,qO.assertValidPattern)(e);let r=this.options;if(e===\"**\")return pr.GLOBSTAR;if(e===\"\")return\"\";let s,a=null;(s=e.match(V2t))?a=r.dot?K2t:J2t:(s=e.match(L2t))?a=(r.nocase?r.dot?H2t:_2t:r.dot?U2t:M2t)(s[1]):(s=e.match(z2t))?a=(r.nocase?r.dot?Z2t:X2t:r.dot?$2t:eBt)(s):(s=e.match(j2t))?a=r.dot?q2t:G2t:(s=e.match(W2t))&&(a=Y2t);let n=wPe.AST.fromGlob(e,this.options).toMMPattern();return a&&typeof n==\"object\"&&Reflect.defineProperty(n,\"test\",{value:a}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?rBt:r.dot?nBt:iBt,a=new Set(r.nocase?[\"i\"]:[]),n=e.map(p=>{let h=p.map(E=>{if(E instanceof RegExp)for(let C of E.flags.split(\"\"))a.add(C);return typeof E==\"string\"?uBt(E):E===pr.GLOBSTAR?pr.GLOBSTAR:E._src});return h.forEach((E,C)=>{let S=h[C+1],P=h[C-1];E!==pr.GLOBSTAR||P===pr.GLOBSTAR||(P===void 0?S!==void 0&&S!==pr.GLOBSTAR?h[C+1]=\"(?:\\\\/|\"+s+\"\\\\/)?\"+S:h[C]=s:S===void 0?h[C-1]=P+\"(?:\\\\/|\"+s+\")?\":S!==pr.GLOBSTAR&&(h[C-1]=P+\"(?:\\\\/|\\\\/\"+s+\"\\\\/)\"+S,h[C+1]=pr.GLOBSTAR))}),h.filter(E=>E!==pr.GLOBSTAR).join(\"/\")}).join(\"|\"),[c,f]=e.length>1?[\"(?:\",\")\"]:[\"\",\"\"];n=\"^\"+c+n+f+\"$\",this.negate&&(n=\"^(?!\"+n+\").+$\");try{this.regexp=new RegExp(n,[...a].join(\"\"))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(\"/\"):this.isWindows&&/^\\/\\/[^\\/]+/.test(e)?[\"\",...e.split(/\\/+/)]:e.split(/\\/+/)}match(e,r=this.partial){if(this.debug(\"match\",e,this.pattern),this.comment)return!1;if(this.empty)return e===\"\";if(e===\"/\"&&r)return!0;let s=this.options;this.isWindows&&(e=e.split(\"\\\\\").join(\"/\"));let a=this.slashSplit(e);this.debug(this.pattern,\"split\",a);let n=this.set;this.debug(this.pattern,\"set\",n);let c=a[a.length-1];if(!c)for(let f=a.length-2;!c&&f>=0;f--)c=a[f];for(let f=0;f<n.length;f++){let p=n[f],h=a;if(s.matchBase&&p.length===1&&(h=[c]),this.matchOne(h,p,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return pr.minimatch.defaults(e).Minimatch}};pr.Minimatch=ly;var fBt=aJ();Object.defineProperty(pr,\"AST\",{enumerable:!0,get:function(){return fBt.AST}});var ABt=lJ();Object.defineProperty(pr,\"escape\",{enumerable:!0,get:function(){return ABt.escape}});var pBt=UO();Object.defineProperty(pr,\"unescape\",{enumerable:!0,get:function(){return pBt.unescape}});pr.minimatch.AST=wPe.AST;pr.minimatch.Minimatch=ly;pr.minimatch.escape=F2t.escape;pr.minimatch.unescape=N2t.unescape});var fJ=_(ru=>{\"use strict\";var bPe=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,\"__esModule\",{value:!0});ru.SuccinctRoles=ru.DelegatedRole=ru.Role=ru.TOP_LEVEL_ROLE_NAMES=void 0;var PPe=bPe(Ie(\"crypto\")),hBt=DPe(),WO=bPe(Ie(\"util\")),YO=PA(),cy=ff();ru.TOP_LEVEL_ROLE_NAMES=[\"root\",\"targets\",\"snapshot\",\"timestamp\"];var Mb=class t{constructor(e){let{keyIDs:r,threshold:s,unrecognizedFields:a}=e;if(gBt(r))throw new YO.ValueError(\"duplicate key IDs found\");if(s<1)throw new YO.ValueError(\"threshold must be at least 1\");this.keyIDs=r,this.threshold=s,this.unrecognizedFields=a||{}}equals(e){return e instanceof t?this.threshold===e.threshold&&WO.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&WO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:r,threshold:s,...a}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");return new t({keyIDs:r,threshold:s,unrecognizedFields:a})}};ru.Role=Mb;function gBt(t){return new Set(t).size!==t.length}var cJ=class t extends Mb{constructor(e){super(e);let{name:r,terminating:s,paths:a,pathHashPrefixes:n}=e;if(this.name=r,this.terminating=s,e.paths&&e.pathHashPrefixes)throw new YO.ValueError(\"paths and pathHashPrefixes are mutually exclusive\");this.paths=a,this.pathHashPrefixes=n}equals(e){return e instanceof t?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&WO.default.isDeepStrictEqual(this.paths,e.paths)&&WO.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(r=>mBt(e,r));if(this.pathHashPrefixes){let s=PPe.default.createHash(\"sha256\").update(e).digest(\"hex\");return this.pathHashPrefixes.some(a=>s.startsWith(a))}return!1}toJSON(){let e={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(e.paths=this.paths),this.pathHashPrefixes&&(e.path_hash_prefixes=this.pathHashPrefixes),e}static fromJSON(e){let{keyids:r,threshold:s,name:a,terminating:n,paths:c,path_hash_prefixes:f,...p}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array of strings\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");if(typeof a!=\"string\")throw new TypeError(\"name must be a string\");if(typeof n!=\"boolean\")throw new TypeError(\"terminating must be a boolean\");if(cy.guard.isDefined(c)&&!cy.guard.isStringArray(c))throw new TypeError(\"paths must be an array of strings\");if(cy.guard.isDefined(f)&&!cy.guard.isStringArray(f))throw new TypeError(\"path_hash_prefixes must be an array of strings\");return new t({keyIDs:r,threshold:s,name:a,terminating:n,paths:c,pathHashPrefixes:f,unrecognizedFields:p})}};ru.DelegatedRole=cJ;var dBt=(t,e)=>t.map((r,s)=>[r,e[s]]);function mBt(t,e){let r=t.split(\"/\"),s=e.split(\"/\");return s.length!=r.length?!1:dBt(r,s).every(([a,n])=>(0,hBt.minimatch)(a,n))}var uJ=class t extends Mb{constructor(e){super(e);let{bitLength:r,namePrefix:s}=e;if(r<=0||r>32)throw new YO.ValueError(\"bitLength must be between 1 and 32\");this.bitLength=r,this.namePrefix=s,this.numberOfBins=Math.pow(2,r),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof t?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let a=PPe.default.createHash(\"sha256\").update(e).digest().subarray(0,4),n=32-this.bitLength,f=(a.readUInt32BE()>>>n).toString(16).padStart(this.suffixLen,\"0\");return`${this.namePrefix}-${f}`}*getRoles(){for(let e=0;e<this.numberOfBins;e++){let r=e.toString(16).padStart(this.suffixLen,\"0\");yield`${this.namePrefix}-${r}`}}isDelegatedRole(e){let r=this.namePrefix+\"-\";if(!e.startsWith(r))return!1;let s=e.slice(r.length,e.length);if(s.length!=this.suffixLen||!s.match(/^[0-9a-fA-F]+$/))return!1;let a=parseInt(s,16);return 0<=a&&a<this.numberOfBins}toJSON(){return{...super.toJSON(),bit_length:this.bitLength,name_prefix:this.namePrefix}}static fromJSON(e){let{keyids:r,threshold:s,bit_length:a,name_prefix:n,...c}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array of strings\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");if(typeof a!=\"number\")throw new TypeError(\"bit_length must be a number\");if(typeof n!=\"string\")throw new TypeError(\"name_prefix must be a string\");return new t({keyIDs:r,threshold:s,bitLength:a,namePrefix:n,unrecognizedFields:c})}};ru.SuccinctRoles=uJ});var hJ=_(a1=>{\"use strict\";var yBt=a1&&a1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a1,\"__esModule\",{value:!0});a1.Root=void 0;var xPe=yBt(Ie(\"util\")),AJ=ay(),kPe=PA(),EBt=NO(),VO=fJ(),JO=ff(),pJ=class t extends AJ.Signed{constructor(e){if(super(e),this.type=AJ.MetadataKind.Root,this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=VO.TOP_LEVEL_ROLE_NAMES.reduce((r,s)=>({...r,[s]:new VO.Role({keyIDs:[],threshold:1})}),{});else{let r=new Set(Object.keys(e.roles));if(!VO.TOP_LEVEL_ROLE_NAMES.every(s=>r.has(s)))throw new kPe.ValueError(\"missing top-level role\");this.roles=e.roles}}addKey(e,r){if(!this.roles[r])throw new kPe.ValueError(`role ${r} does not exist`);this.roles[r].keyIDs.includes(e.keyID)||this.roles[r].keyIDs.push(e.keyID),this.keys[e.keyID]=e}equals(e){return e instanceof t?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&xPe.default.isDeepStrictEqual(this.keys,e.keys)&&xPe.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:IBt(this.keys),roles:CBt(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=AJ.Signed.commonFieldsFromJSON(e),{keys:a,roles:n,consistent_snapshot:c,...f}=r;if(typeof c!=\"boolean\")throw new TypeError(\"consistent_snapshot must be a boolean\");return new t({...s,keys:wBt(a),roles:BBt(n),consistentSnapshot:c,unrecognizedFields:f})}};a1.Root=pJ;function IBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function CBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function wBt(t){let e;if(JO.guard.isDefined(t)){if(!JO.guard.isObjectRecord(t))throw new TypeError(\"keys must be an object\");e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:EBt.Key.fromJSON(s,a)}),{})}return e}function BBt(t){let e;if(JO.guard.isDefined(t)){if(!JO.guard.isObjectRecord(t))throw new TypeError(\"roles must be an object\");e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:VO.Role.fromJSON(a)}),{})}return e}});var dJ=_(KO=>{\"use strict\";Object.defineProperty(KO,\"__esModule\",{value:!0});KO.Signature=void 0;var gJ=class t{constructor(e){let{keyID:r,sig:s}=e;this.keyID=r,this.sig=s}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:r,sig:s}=e;if(typeof r!=\"string\")throw new TypeError(\"keyid must be a string\");if(typeof s!=\"string\")throw new TypeError(\"sig must be a string\");return new t({keyID:r,sig:s})}};KO.Signature=gJ});var EJ=_(l1=>{\"use strict\";var vBt=l1&&l1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(l1,\"__esModule\",{value:!0});l1.Snapshot=void 0;var SBt=vBt(Ie(\"util\")),mJ=ay(),TPe=Tb(),QPe=ff(),yJ=class t extends mJ.Signed{constructor(e){super(e),this.type=mJ.MetadataKind.Snapshot,this.meta=e.meta||{\"targets.json\":new TPe.MetaFile({version:1})}}equals(e){return e instanceof t?super.equals(e)&&SBt.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:DBt(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=mJ.Signed.commonFieldsFromJSON(e),{meta:a,...n}=r;return new t({...s,meta:bBt(a),unrecognizedFields:n})}};l1.Snapshot=yJ;function DBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function bBt(t){let e;if(QPe.guard.isDefined(t))if(QPe.guard.isObjectRecord(t))e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:TPe.MetaFile.fromJSON(a)}),{});else throw new TypeError(\"meta field is malformed\");return e}});var RPe=_(c1=>{\"use strict\";var PBt=c1&&c1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(c1,\"__esModule\",{value:!0});c1.Delegations=void 0;var zO=PBt(Ie(\"util\")),xBt=PA(),kBt=NO(),IJ=fJ(),XO=ff(),CJ=class t{constructor(e){if(this.keys=e.keys,this.unrecognizedFields=e.unrecognizedFields||{},e.roles&&Object.keys(e.roles).some(r=>IJ.TOP_LEVEL_ROLE_NAMES.includes(r)))throw new xBt.ValueError(\"Delegated role name conflicts with top-level role name\");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof t?zO.default.isDeepStrictEqual(this.keys,e.keys)&&zO.default.isDeepStrictEqual(this.roles,e.roles)&&zO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&zO.default.isDeepStrictEqual(this.succinctRoles,e.succinctRoles):!1}*rolesForTarget(e){if(this.roles)for(let r of Object.values(this.roles))r.isDelegatedPath(e)&&(yield{role:r.name,terminating:r.terminating});else this.succinctRoles&&(yield{role:this.succinctRoles.getRoleForTarget(e),terminating:!0})}toJSON(){let e={keys:QBt(this.keys),...this.unrecognizedFields};return this.roles?e.roles=TBt(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:r,roles:s,succinct_roles:a,...n}=e,c;return XO.guard.isObject(a)&&(c=IJ.SuccinctRoles.fromJSON(a)),new t({keys:RBt(r),roles:FBt(s),unrecognizedFields:n,succinctRoles:c})}};c1.Delegations=CJ;function QBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function TBt(t){return Object.values(t).map(e=>e.toJSON())}function RBt(t){if(!XO.guard.isObjectRecord(t))throw new TypeError(\"keys is malformed\");return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:kBt.Key.fromJSON(r,s)}),{})}function FBt(t){let e;if(XO.guard.isDefined(t)){if(!XO.guard.isObjectArray(t))throw new TypeError(\"roles is malformed\");e=t.reduce((r,s)=>{let a=IJ.DelegatedRole.fromJSON(s);return{...r,[a.name]:a}},{})}return e}});var vJ=_(u1=>{\"use strict\";var NBt=u1&&u1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(u1,\"__esModule\",{value:!0});u1.Targets=void 0;var FPe=NBt(Ie(\"util\")),wJ=ay(),OBt=RPe(),LBt=Tb(),ZO=ff(),BJ=class t extends wJ.Signed{constructor(e){super(e),this.type=wJ.MetadataKind.Targets,this.targets=e.targets||{},this.delegations=e.delegations}addTarget(e){this.targets[e.path]=e}equals(e){return e instanceof t?super.equals(e)&&FPe.default.isDeepStrictEqual(this.targets,e.targets)&&FPe.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:MBt(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:r,...s}=wJ.Signed.commonFieldsFromJSON(e),{targets:a,delegations:n,...c}=r;return new t({...s,targets:UBt(a),delegations:_Bt(n),unrecognizedFields:c})}};u1.Targets=BJ;function MBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function UBt(t){let e;if(ZO.guard.isDefined(t))if(ZO.guard.isObjectRecord(t))e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:LBt.TargetFile.fromJSON(s,a)}),{});else throw new TypeError(\"targets must be an object\");return e}function _Bt(t){let e;if(ZO.guard.isDefined(t))if(ZO.guard.isObject(t))e=OBt.Delegations.fromJSON(t);else throw new TypeError(\"delegations must be an object\");return e}});var PJ=_($O=>{\"use strict\";Object.defineProperty($O,\"__esModule\",{value:!0});$O.Timestamp=void 0;var SJ=ay(),NPe=Tb(),DJ=ff(),bJ=class t extends SJ.Signed{constructor(e){super(e),this.type=SJ.MetadataKind.Timestamp,this.snapshotMeta=e.snapshotMeta||new NPe.MetaFile({version:1})}equals(e){return e instanceof t?super.equals(e)&&this.snapshotMeta.equals(e.snapshotMeta):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,meta:{\"snapshot.json\":this.snapshotMeta.toJSON()},...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=SJ.Signed.commonFieldsFromJSON(e),{meta:a,...n}=r;return new t({...s,snapshotMeta:HBt(a),unrecognizedFields:n})}};$O.Timestamp=bJ;function HBt(t){let e;if(DJ.guard.isDefined(t)){let r=t[\"snapshot.json\"];if(!DJ.guard.isDefined(r)||!DJ.guard.isObject(r))throw new TypeError(\"missing snapshot.json in meta\");e=NPe.MetaFile.fromJSON(r)}return e}});var LPe=_(A1=>{\"use strict\";var jBt=A1&&A1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A1,\"__esModule\",{value:!0});A1.Metadata=void 0;var GBt=V7(),OPe=jBt(Ie(\"util\")),f1=ay(),Ub=PA(),qBt=hJ(),WBt=dJ(),YBt=EJ(),VBt=vJ(),JBt=PJ(),xJ=ff(),kJ=class t{constructor(e,r,s){this.signed=e,this.signatures=r||{},this.unrecognizedFields=s||{}}sign(e,r=!0){let s=Buffer.from((0,GBt.canonicalize)(this.signed.toJSON())),a=e(s);r||(this.signatures={}),this.signatures[a.keyID]=a}verifyDelegate(e,r){let s,a={};switch(this.signed.type){case f1.MetadataKind.Root:a=this.signed.keys,s=this.signed.roles[e];break;case f1.MetadataKind.Targets:if(!this.signed.delegations)throw new Ub.ValueError(`No delegations found for ${e}`);a=this.signed.delegations.keys,this.signed.delegations.roles?s=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(s=this.signed.delegations.succinctRoles);break;default:throw new TypeError(\"invalid metadata type\")}if(!s)throw new Ub.ValueError(`no delegation found for ${e}`);let n=new Set;if(s.keyIDs.forEach(c=>{let f=a[c];if(f)try{f.verifySignature(r),n.add(f.keyID)}catch{}}),n.size<s.threshold)throw new Ub.UnsignedMetadataError(`${e} was signed by ${n.size}/${s.threshold} keys`)}equals(e){return e instanceof t?this.signed.equals(e.signed)&&OPe.default.isDeepStrictEqual(this.signatures,e.signatures)&&OPe.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{signatures:Object.values(this.signatures).map(r=>r.toJSON()),signed:this.signed.toJSON(),...this.unrecognizedFields}}static fromJSON(e,r){let{signed:s,signatures:a,...n}=r;if(!xJ.guard.isDefined(s)||!xJ.guard.isObject(s))throw new TypeError(\"signed is not defined\");if(e!==s._type)throw new Ub.ValueError(`expected '${e}', got ${s._type}`);if(!xJ.guard.isObjectArray(a))throw new TypeError(\"signatures is not an array\");let c;switch(e){case f1.MetadataKind.Root:c=qBt.Root.fromJSON(s);break;case f1.MetadataKind.Timestamp:c=JBt.Timestamp.fromJSON(s);break;case f1.MetadataKind.Snapshot:c=YBt.Snapshot.fromJSON(s);break;case f1.MetadataKind.Targets:c=VBt.Targets.fromJSON(s);break;default:throw new TypeError(\"invalid metadata type\")}let f={};return a.forEach(p=>{let h=WBt.Signature.fromJSON(p);if(f[h.keyID])throw new Ub.ValueError(`multiple signatures found for keyid: ${h.keyID}`);f[h.keyID]=h}),new t(c,f,n)}};A1.Metadata=kJ});var eL=_(Fi=>{\"use strict\";Object.defineProperty(Fi,\"__esModule\",{value:!0});Fi.Timestamp=Fi.Targets=Fi.Snapshot=Fi.Signature=Fi.Root=Fi.Metadata=Fi.Key=Fi.TargetFile=Fi.MetaFile=Fi.ValueError=Fi.MetadataKind=void 0;var KBt=ay();Object.defineProperty(Fi,\"MetadataKind\",{enumerable:!0,get:function(){return KBt.MetadataKind}});var zBt=PA();Object.defineProperty(Fi,\"ValueError\",{enumerable:!0,get:function(){return zBt.ValueError}});var MPe=Tb();Object.defineProperty(Fi,\"MetaFile\",{enumerable:!0,get:function(){return MPe.MetaFile}});Object.defineProperty(Fi,\"TargetFile\",{enumerable:!0,get:function(){return MPe.TargetFile}});var XBt=NO();Object.defineProperty(Fi,\"Key\",{enumerable:!0,get:function(){return XBt.Key}});var ZBt=LPe();Object.defineProperty(Fi,\"Metadata\",{enumerable:!0,get:function(){return ZBt.Metadata}});var $Bt=hJ();Object.defineProperty(Fi,\"Root\",{enumerable:!0,get:function(){return $Bt.Root}});var evt=dJ();Object.defineProperty(Fi,\"Signature\",{enumerable:!0,get:function(){return evt.Signature}});var tvt=EJ();Object.defineProperty(Fi,\"Snapshot\",{enumerable:!0,get:function(){return tvt.Snapshot}});var rvt=vJ();Object.defineProperty(Fi,\"Targets\",{enumerable:!0,get:function(){return rvt.Targets}});var nvt=PJ();Object.defineProperty(Fi,\"Timestamp\",{enumerable:!0,get:function(){return nvt.Timestamp}})});var _Pe=_((Dir,UPe)=>{var p1=1e3,h1=p1*60,g1=h1*60,uy=g1*24,ivt=uy*7,svt=uy*365.25;UPe.exports=function(t,e){e=e||{};var r=typeof t;if(r===\"string\"&&t.length>0)return ovt(t);if(r===\"number\"&&isFinite(t))return e.long?lvt(t):avt(t);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(t))};function ovt(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),s=(e[2]||\"ms\").toLowerCase();switch(s){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return r*svt;case\"weeks\":case\"week\":case\"w\":return r*ivt;case\"days\":case\"day\":case\"d\":return r*uy;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return r*g1;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return r*h1;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return r*p1;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return r;default:return}}}}function avt(t){var e=Math.abs(t);return e>=uy?Math.round(t/uy)+\"d\":e>=g1?Math.round(t/g1)+\"h\":e>=h1?Math.round(t/h1)+\"m\":e>=p1?Math.round(t/p1)+\"s\":t+\"ms\"}function lvt(t){var e=Math.abs(t);return e>=uy?tL(t,e,uy,\"day\"):e>=g1?tL(t,e,g1,\"hour\"):e>=h1?tL(t,e,h1,\"minute\"):e>=p1?tL(t,e,p1,\"second\"):t+\" ms\"}function tL(t,e,r,s){var a=e>=r*1.5;return Math.round(t/r)+\" \"+s+(a?\"s\":\"\")}});var QJ=_((bir,HPe)=>{function cvt(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=a,r.enabled=f,r.humanize=_Pe(),r.destroy=h,Object.keys(t).forEach(E=>{r[E]=t[E]}),r.names=[],r.skips=[],r.formatters={};function e(E){let C=0;for(let S=0;S<E.length;S++)C=(C<<5)-C+E.charCodeAt(S),C|=0;return r.colors[Math.abs(C)%r.colors.length]}r.selectColor=e;function r(E){let C,S=null,P,I;function R(...N){if(!R.enabled)return;let U=R,W=Number(new Date),ee=W-(C||W);U.diff=ee,U.prev=C,U.curr=W,C=W,N[0]=r.coerce(N[0]),typeof N[0]!=\"string\"&&N.unshift(\"%O\");let ie=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(le,me)=>{if(le===\"%%\")return\"%\";ie++;let pe=r.formatters[me];if(typeof pe==\"function\"){let Be=N[ie];le=pe.call(U,Be),N.splice(ie,1),ie--}return le}),r.formatArgs.call(U,N),(U.log||r.log).apply(U,N)}return R.namespace=E,R.useColors=r.useColors(),R.color=r.selectColor(E),R.extend=s,R.destroy=r.destroy,Object.defineProperty(R,\"enabled\",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(P!==r.namespaces&&(P=r.namespaces,I=r.enabled(E)),I),set:N=>{S=N}}),typeof r.init==\"function\"&&r.init(R),R}function s(E,C){let S=r(this.namespace+(typeof C>\"u\"?\":\":C)+E);return S.log=this.log,S}function a(E){r.save(E),r.namespaces=E,r.names=[],r.skips=[];let C=(typeof E==\"string\"?E:\"\").trim().replace(\" \",\",\").split(\",\").filter(Boolean);for(let S of C)S[0]===\"-\"?r.skips.push(S.slice(1)):r.names.push(S)}function n(E,C){let S=0,P=0,I=-1,R=0;for(;S<E.length;)if(P<C.length&&(C[P]===E[S]||C[P]===\"*\"))C[P]===\"*\"?(I=P,R=S,P++):(S++,P++);else if(I!==-1)P=I+1,R++,S=R;else return!1;for(;P<C.length&&C[P]===\"*\";)P++;return P===C.length}function c(){let E=[...r.names,...r.skips.map(C=>\"-\"+C)].join(\",\");return r.enable(\"\"),E}function f(E){for(let C of r.skips)if(n(E,C))return!1;for(let C of r.names)if(n(E,C))return!0;return!1}function p(E){return E instanceof Error?E.stack||E.message:E}function h(){console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\")}return r.enable(r.load()),r}HPe.exports=cvt});var jPe=_((sc,rL)=>{sc.formatArgs=fvt;sc.save=Avt;sc.load=pvt;sc.useColors=uvt;sc.storage=hvt();sc.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})();sc.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"];function uvt(){if(typeof window<\"u\"&&window.process&&(window.process.type===\"renderer\"||window.process.__nwjs))return!0;if(typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))return!1;let t;return typeof document<\"u\"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<\"u\"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<\"u\"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)}function fvt(t){if(t[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+t[0]+(this.useColors?\"%c \":\" \")+\"+\"+rL.exports.humanize(this.diff),!this.useColors)return;let e=\"color: \"+this.color;t.splice(1,0,e,\"color: inherit\");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,a=>{a!==\"%%\"&&(r++,a===\"%c\"&&(s=r))}),t.splice(s,0,e)}sc.log=console.debug||console.log||(()=>{});function Avt(t){try{t?sc.storage.setItem(\"debug\",t):sc.storage.removeItem(\"debug\")}catch{}}function pvt(){let t;try{t=sc.storage.getItem(\"debug\")}catch{}return!t&&typeof process<\"u\"&&\"env\"in process&&(t=process.env.DEBUG),t}function hvt(){try{return localStorage}catch{}}rL.exports=QJ()(sc);var{formatters:gvt}=rL.exports;gvt.j=function(t){try{return JSON.stringify(t)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}});var qPe=_((Zs,iL)=>{var dvt=Ie(\"tty\"),nL=Ie(\"util\");Zs.init=Bvt;Zs.log=Ivt;Zs.formatArgs=yvt;Zs.save=Cvt;Zs.load=wvt;Zs.useColors=mvt;Zs.destroy=nL.deprecate(()=>{},\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");Zs.colors=[6,2,3,4,5,1];try{let t=Ie(\"supports-color\");t&&(t.stderr||t).level>=2&&(Zs.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Zs.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(a,n)=>n.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s===\"null\"?s=null:s=Number(s),t[r]=s,t},{});function mvt(){return\"colors\"in Zs.inspectOpts?!!Zs.inspectOpts.colors:dvt.isatty(process.stderr.fd)}function yvt(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,a=\"\\x1B[3\"+(s<8?s:\"8;5;\"+s),n=`  ${a};1m${e} \\x1B[0m`;t[0]=n+t[0].split(`\n`).join(`\n`+n),t.push(a+\"m+\"+iL.exports.humanize(this.diff)+\"\\x1B[0m\")}else t[0]=Evt()+e+\" \"+t[0]}function Evt(){return Zs.inspectOpts.hideDate?\"\":new Date().toISOString()+\" \"}function Ivt(...t){return process.stderr.write(nL.formatWithOptions(Zs.inspectOpts,...t)+`\n`)}function Cvt(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wvt(){return process.env.DEBUG}function Bvt(t){t.inspectOpts={};let e=Object.keys(Zs.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Zs.inspectOpts[e[r]]}iL.exports=QJ()(Zs);var{formatters:GPe}=iL.exports;GPe.o=function(t){return this.inspectOpts.colors=this.useColors,nL.inspect(t,this.inspectOpts).split(`\n`).map(e=>e.trim()).join(\" \")};GPe.O=function(t){return this.inspectOpts.colors=this.useColors,nL.inspect(t,this.inspectOpts)}});var RJ=_((Pir,TJ)=>{typeof process>\"u\"||process.type===\"renderer\"||process.browser===!0||process.__nwjs?TJ.exports=jPe():TJ.exports=qPe()});var oL=_(Ki=>{\"use strict\";Object.defineProperty(Ki,\"__esModule\",{value:!0});Ki.DownloadHTTPError=Ki.DownloadLengthMismatchError=Ki.DownloadError=Ki.ExpiredMetadataError=Ki.EqualVersionError=Ki.BadVersionError=Ki.RepositoryError=Ki.PersistError=Ki.RuntimeError=Ki.ValueError=void 0;var FJ=class extends Error{};Ki.ValueError=FJ;var NJ=class extends Error{};Ki.RuntimeError=NJ;var OJ=class extends Error{};Ki.PersistError=OJ;var _b=class extends Error{};Ki.RepositoryError=_b;var sL=class extends _b{};Ki.BadVersionError=sL;var LJ=class extends sL{};Ki.EqualVersionError=LJ;var MJ=class extends _b{};Ki.ExpiredMetadataError=MJ;var Hb=class extends Error{};Ki.DownloadError=Hb;var UJ=class extends Hb{};Ki.DownloadLengthMismatchError=UJ;var _J=class extends Hb{constructor(e,r){super(e),this.statusCode=r}};Ki.DownloadHTTPError=_J});var YPe=_(d1=>{\"use strict\";var jJ=d1&&d1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d1,\"__esModule\",{value:!0});d1.withTempFile=void 0;var HJ=jJ(Ie(\"fs/promises\")),vvt=jJ(Ie(\"os\")),WPe=jJ(Ie(\"path\")),Svt=async t=>Dvt(async e=>t(WPe.default.join(e,\"tempfile\")));d1.withTempFile=Svt;var Dvt=async t=>{let e=await HJ.default.realpath(vvt.default.tmpdir()),r=await HJ.default.mkdtemp(e+WPe.default.sep);try{return await t(r)}finally{await HJ.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var qJ=_(kg=>{\"use strict\";var lL=kg&&kg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kg,\"__esModule\",{value:!0});kg.DefaultFetcher=kg.BaseFetcher=void 0;var bvt=lL(RJ()),VPe=lL(Ie(\"fs\")),Pvt=lL(CO()),xvt=lL(Ie(\"util\")),JPe=oL(),kvt=YPe(),Qvt=(0,bvt.default)(\"tuf:fetch\"),aL=class{async downloadFile(e,r,s){return(0,kvt.withTempFile)(async a=>{let n=await this.fetch(e),c=0,f=VPe.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new JPe.DownloadLengthMismatchError(\"Max length reached\");await Tvt(f,h)}}finally{await xvt.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(e,r){return this.downloadFile(e,r,async s=>{let a=VPe.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};kg.BaseFetcher=aL;var GJ=class extends aL{constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Qvt(\"GET %s\",e);let r=await(0,Pvt.default)(e,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new JPe.DownloadHTTPError(\"Failed to download\",r.status);return r.body}};kg.DefaultFetcher=GJ;var Tvt=async(t,e)=>new Promise((r,s)=>{t.write(e,a=>{a&&s(a),r(!0)})})});var KPe=_(cL=>{\"use strict\";Object.defineProperty(cL,\"__esModule\",{value:!0});cL.defaultConfig=void 0;cL.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var zPe=_(uL=>{\"use strict\";Object.defineProperty(uL,\"__esModule\",{value:!0});uL.TrustedMetadataStore=void 0;var Es=eL(),Hi=oL(),WJ=class{constructor(e){this.trustedSet={},this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError(\"No trusted root metadata\");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Root,r);if(s.signed.type!=Es.MetadataKind.Root)throw new Hi.RepositoryError(`Expected 'root', got ${s.signed.type}`);if(this.root.verifyDelegate(Es.MetadataKind.Root,s),s.signed.version!=this.root.signed.version+1)throw new Hi.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${s.signed.version}`);return s.verifyDelegate(Es.MetadataKind.Root,s),this.trustedSet.root=s,s}updateTimestamp(e){if(this.snapshot)throw new Hi.RuntimeError(\"Cannot update timestamp after snapshot\");if(this.root.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError(\"Final root.json is expired\");let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Timestamp,r);if(s.signed.type!=Es.MetadataKind.Timestamp)throw new Hi.RepositoryError(`Expected 'timestamp', got ${s.signed.type}`);if(this.root.verifyDelegate(Es.MetadataKind.Timestamp,s),this.timestamp){if(s.signed.version<this.timestamp.signed.version)throw new Hi.BadVersionError(`New timestamp version ${s.signed.version} is less than current version ${this.timestamp.signed.version}`);if(s.signed.version===this.timestamp.signed.version)throw new Hi.EqualVersionError(`New timestamp version ${s.signed.version} is equal to current version ${this.timestamp.signed.version}`);let a=this.timestamp.signed.snapshotMeta,n=s.signed.snapshotMeta;if(n.version<a.version)throw new Hi.BadVersionError(`New snapshot version ${n.version} is less than current version ${a.version}`)}return this.trustedSet.timestamp=s,this.checkFinalTimestamp(),s}updateSnapshot(e,r=!1){if(!this.timestamp)throw new Hi.RuntimeError(\"Cannot update snapshot before timestamp\");if(this.targets)throw new Hi.RuntimeError(\"Cannot update snapshot after targets\");this.checkFinalTimestamp();let s=this.timestamp.signed.snapshotMeta;r||s.verify(e);let a=JSON.parse(e.toString(\"utf8\")),n=Es.Metadata.fromJSON(Es.MetadataKind.Snapshot,a);if(n.signed.type!=Es.MetadataKind.Snapshot)throw new Hi.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Es.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([c,f])=>{let p=n.signed.meta[c];if(!p)throw new Hi.RepositoryError(`Missing file ${c} in new snapshot`);if(p.version<f.version)throw new Hi.BadVersionError(`New version ${p.version} of ${c} is less than current version ${f.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,r,s){if(!this.snapshot)throw new Hi.RuntimeError(\"Cannot update delegated targets before snapshot\");this.checkFinalSnapsnot();let a=this.trustedSet[s];if(!a)throw new Hi.RuntimeError(`No trusted ${s} metadata`);let n=this.snapshot.signed.meta?.[`${r}.json`];if(!n)throw new Hi.RepositoryError(`Missing ${r}.json in snapshot`);n.verify(e);let c=JSON.parse(e.toString(\"utf8\")),f=Es.Metadata.fromJSON(Es.MetadataKind.Targets,c);if(f.signed.type!=Es.MetadataKind.Targets)throw new Hi.RepositoryError(`Expected 'targets', got ${f.signed.type}`);a.verifyDelegate(r,f);let p=f.signed.version;if(p!=n.version)throw new Hi.BadVersionError(`Version ${p} of ${r} does not match snapshot version ${n.version}`);if(f.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError(`${r}.json is expired`);this.trustedSet[r]=f}loadTrustedRoot(e){let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Root,r);if(s.signed.type!=Es.MetadataKind.Root)throw new Hi.RepositoryError(`Expected 'root', got ${s.signed.type}`);s.verifyDelegate(Es.MetadataKind.Root,s),this.trustedSet.root=s}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError(\"No trusted timestamp metadata\");if(this.timestamp.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError(\"Final timestamp.json is expired\")}checkFinalSnapsnot(){if(!this.snapshot)throw new ReferenceError(\"No trusted snapshot metadata\");if(!this.timestamp)throw new ReferenceError(\"No trusted timestamp metadata\");if(this.snapshot.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError(\"snapshot.json is expired\");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new Hi.BadVersionError(\"Snapshot version doesn't match timestamp\")}};uL.TrustedMetadataStore=WJ});var XPe=_(YJ=>{\"use strict\";Object.defineProperty(YJ,\"__esModule\",{value:!0});YJ.join=Fvt;var Rvt=Ie(\"url\");function Fvt(t,e){return new Rvt.URL(Nvt(t)+Ovt(e)).toString()}function Nvt(t){return t.endsWith(\"/\")?t:t+\"/\"}function Ovt(t){return t.startsWith(\"/\")?t.slice(1):t}});var ZPe=_(nu=>{\"use strict\";var Lvt=nu&&nu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Mvt=nu&&nu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KJ=nu&&nu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&Lvt(e,t,r);return Mvt(e,t),e},Uvt=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,\"__esModule\",{value:!0});nu.Updater=void 0;var xA=eL(),_vt=Uvt(RJ()),m1=KJ(Ie(\"fs\")),fL=KJ(Ie(\"path\")),Hvt=KPe(),fy=oL(),jvt=qJ(),Gvt=zPe(),jb=KJ(XPe()),VJ=(0,_vt.default)(\"tuf:cache\"),JJ=class{constructor(e){let{metadataDir:r,metadataBaseUrl:s,targetDir:a,targetBaseUrl:n,fetcher:c,config:f}=e;this.dir=r,this.metadataBaseUrl=s,this.targetDir=a,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let p=this.loadLocalMetadata(xA.MetadataKind.Root);this.trustedSet=new Gvt.TrustedMetadataStore(p),this.config={...Hvt.defaultConfig,...f},this.fetcher=c||new jvt.DefaultFetcher({timeout:this.config.fetchTimeout,retry:this.config.fetchRetries??this.config.fetchRetry})}async refresh(){if(this.forceCache)try{await this.loadTimestamp({checkRemote:!1})}catch{await this.loadRoot(),await this.loadTimestamp()}else await this.loadRoot(),await this.loadTimestamp();await this.loadSnapshot(),await this.loadTargets(xA.MetadataKind.Targets,xA.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,r,s){let a=r||this.generateTargetPath(e);if(!s){if(!this.targetBaseUrl)throw new fy.ValueError(\"Target base URL not set\");s=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let p=Object.values(e.hashes),{dir:h,base:E}=fL.parse(n),C=`${p[0]}.${E}`;n=h?`${h}/${C}`:C}let f=jb.join(s,n);return await this.fetcher.downloadFile(f,e.length,async p=>{await e.verify(m1.createReadStream(p)),VJ(\"WRITE %s\",a),m1.copyFileSync(p,a)}),a}async findCachedTarget(e,r){r||(r=this.generateTargetPath(e));try{if(m1.existsSync(r))return await e.verify(m1.createReadStream(r)),r}catch{return}}loadLocalMetadata(e){let r=fL.join(this.dir,`${e}.json`);return VJ(\"READ %s\",r),m1.readFileSync(r)}async loadRoot(){let r=this.trustedSet.root.signed.version+1,s=r+this.config.maxRootRotations;for(let a=r;a<s;a++){let n=jb.join(this.metadataBaseUrl,`${a}.root.json`);try{let c=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(c),this.persistMetadata(xA.MetadataKind.Root,c)}catch(c){if(c instanceof fy.DownloadHTTPError&&[403,404].includes(c.statusCode))break;throw c}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let a=this.loadLocalMetadata(xA.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(a),!e)return}catch{}let r=jb.join(this.metadataBaseUrl,\"timestamp.json\"),s=await this.fetcher.downloadBytes(r,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(s)}catch(a){if(a instanceof fy.EqualVersionError)return;throw a}this.persistMetadata(xA.MetadataKind.Timestamp,s)}async loadSnapshot(){try{let e=this.loadLocalMetadata(xA.MetadataKind.Snapshot);this.trustedSet.updateSnapshot(e,!0)}catch{if(!this.trustedSet.timestamp)throw new ReferenceError(\"No timestamp metadata\");let r=this.trustedSet.timestamp.signed.snapshotMeta,s=r.length||this.config.snapshotMaxLength,a=this.trustedSet.root.signed.consistentSnapshot?r.version:void 0,n=jb.join(this.metadataBaseUrl,a?`${a}.snapshot.json`:\"snapshot.json\");try{let c=await this.fetcher.downloadBytes(n,s);this.trustedSet.updateSnapshot(c),this.persistMetadata(xA.MetadataKind.Snapshot,c)}catch(c){throw new fy.RuntimeError(`Unable to load snapshot metadata error ${c}`)}}}async loadTargets(e,r){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let s=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(s,e,r)}catch{if(!this.trustedSet.snapshot)throw new ReferenceError(\"No snapshot metadata\");let a=this.trustedSet.snapshot.signed.meta[`${e}.json`],n=a.length||this.config.targetsMaxLength,c=this.trustedSet.root.signed.consistentSnapshot?a.version:void 0,f=encodeURIComponent(e),p=jb.join(this.metadataBaseUrl,c?`${c}.${f}.json`:`${f}.json`);try{let h=await this.fetcher.downloadBytes(p,n);this.trustedSet.updateDelegatedTargets(h,e,r),this.persistMetadata(e,h)}catch(h){throw new fy.RuntimeError(`Unable to load targets error ${h}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let r=[{roleName:xA.MetadataKind.Targets,parentRoleName:xA.MetadataKind.Root}],s=new Set;for(;s.size<=this.config.maxDelegations&&r.length>0;){let{roleName:a,parentRoleName:n}=r.pop();if(s.has(a))continue;let c=(await this.loadTargets(a,n))?.signed;if(!c)continue;let f=c.targets?.[e];if(f)return f;if(s.add(a),c.delegations){let p=[],h=c.delegations.rolesForTarget(e);for(let{role:E,terminating:C}of h)if(p.push({roleName:E,parentRoleName:a}),C){r.splice(0);break}p.reverse(),r.push(...p)}}}generateTargetPath(e){if(!this.targetDir)throw new fy.ValueError(\"Target directory not set\");let r=encodeURIComponent(e.path);return fL.join(this.targetDir,r)}persistMetadata(e,r){let s=encodeURIComponent(e);try{let a=fL.join(this.dir,`${s}.json`);VJ(\"WRITE %s\",a),m1.writeFileSync(a,r.toString(\"utf8\"))}catch(a){throw new fy.PersistError(`Failed to persist metadata ${s} error: ${a}`)}}};nu.Updater=JJ});var $Pe=_(Qg=>{\"use strict\";Object.defineProperty(Qg,\"__esModule\",{value:!0});Qg.Updater=Qg.BaseFetcher=Qg.TargetFile=void 0;var qvt=eL();Object.defineProperty(Qg,\"TargetFile\",{enumerable:!0,get:function(){return qvt.TargetFile}});var Wvt=qJ();Object.defineProperty(Qg,\"BaseFetcher\",{enumerable:!0,get:function(){return Wvt.BaseFetcher}});var Yvt=ZPe();Object.defineProperty(Qg,\"Updater\",{enumerable:!0,get:function(){return Yvt.Updater}})});var XJ=_(AL=>{\"use strict\";Object.defineProperty(AL,\"__esModule\",{value:!0});AL.TUFError=void 0;var zJ=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.code=e,this.cause=s,this.name=this.constructor.name}};AL.TUFError=zJ});var exe=_(Gb=>{\"use strict\";var Vvt=Gb&&Gb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gb,\"__esModule\",{value:!0});Gb.readTarget=Kvt;var Jvt=Vvt(Ie(\"fs\")),pL=XJ();async function Kvt(t,e){let r=await zvt(t,e);return new Promise((s,a)=>{Jvt.default.readFile(r,\"utf-8\",(n,c)=>{n?a(new pL.TUFError({code:\"TUF_READ_TARGET_ERROR\",message:`error reading target ${r}`,cause:n})):s(c)})})}async function zvt(t,e){let r;try{r=await t.getTargetInfo(e)}catch(a){throw new pL.TUFError({code:\"TUF_REFRESH_METADATA_ERROR\",message:\"error refreshing TUF metadata\",cause:a})}if(!r)throw new pL.TUFError({code:\"TUF_FIND_TARGET_ERROR\",message:`target ${e} not found`});let s=await t.findCachedTarget(r);if(!s)try{s=await t.downloadTarget(r)}catch(a){throw new pL.TUFError({code:\"TUF_DOWNLOAD_TARGET_ERROR\",message:`error downloading target ${s}`,cause:a})}return s}});var txe=_((Uir,Xvt)=>{Xvt.exports={\"https://tuf-repo-cdn.sigstore.dev\":{\"root.json\":\"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiMzA0NjAyMjEwMDhhYjFmNmYxN2Q0ZjllNmQ3ZGNmMWM4ODkxMmI2YjUzY2MxMDM4ODY0NGFlMWYwOWJjMzdhMDgyY2QwNjAwM2UwMjIxMDBlMTQ1ZWY0YzdiNzgyZDRlODEw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OiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K\"}}}});var nxe=_(y1=>{\"use strict\";var rxe=y1&&y1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(y1,\"__esModule\",{value:!0});y1.TUFClient=void 0;var Tg=rxe(Ie(\"fs\")),qb=rxe(Ie(\"path\")),Zvt=$Pe(),$vt=hL(),eSt=exe(),$J=\"targets\",ZJ=class{constructor(e){let r=new URL(e.mirrorURL),s=encodeURIComponent(r.host+r.pathname.replace(/\\/$/,\"\")),a=qb.default.join(e.cachePath,s);tSt(a),rSt({cachePath:a,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=nSt({mirrorURL:e.mirrorURL,cachePath:a,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,eSt.readTarget)(this.updater,e)}};y1.TUFClient=ZJ;function tSt(t){let e=qb.default.join(t,$J);Tg.default.existsSync(t)||Tg.default.mkdirSync(t,{recursive:!0}),Tg.default.existsSync(e)||Tg.default.mkdirSync(e)}function rSt({cachePath:t,mirrorURL:e,tufRootPath:r,forceInit:s}){let a=qb.default.join(t,\"root.json\");if(!Tg.default.existsSync(a)||s)if(r)Tg.default.copyFileSync(r,a);else{let c=txe()[e];if(!c)throw new $vt.TUFError({code:\"TUF_INIT_CACHE_ERROR\",message:`No root.json found for mirror: ${e}`});Tg.default.writeFileSync(a,Buffer.from(c[\"root.json\"],\"base64\")),Object.entries(c.targets).forEach(([f,p])=>{Tg.default.writeFileSync(qb.default.join(t,$J,f),Buffer.from(p,\"base64\"))})}}function nSt(t){let e={fetchTimeout:t.timeout,fetchRetry:t.retry};return new Zvt.Updater({metadataBaseUrl:t.mirrorURL,targetBaseUrl:`${t.mirrorURL}/targets`,metadataDir:t.cachePath,targetDir:qb.default.join(t.cachePath,$J),forceCache:t.forceCache,config:e})}});var hL=_(gh=>{\"use strict\";Object.defineProperty(gh,\"__esModule\",{value:!0});gh.TUFError=gh.DEFAULT_MIRROR_URL=void 0;gh.getTrustedRoot=fSt;gh.initTUF=ASt;var iSt=yb(),sSt=Obe(),oSt=nxe();gh.DEFAULT_MIRROR_URL=\"https://tuf-repo-cdn.sigstore.dev\";var aSt=\"sigstore-js\",lSt={retries:2},cSt=5e3,uSt=\"trusted_root.json\";async function fSt(t={}){let r=await ixe(t).getTarget(uSt);return iSt.TrustedRoot.fromJSON(JSON.parse(r))}async function ASt(t={}){let e=ixe(t);return e.refresh().then(()=>e)}function ixe(t){return new oSt.TUFClient({cachePath:t.cachePath||(0,sSt.appDataPath)(aSt),rootPath:t.rootPath,mirrorURL:t.mirrorURL||gh.DEFAULT_MIRROR_URL,retry:t.retry??lSt,timeout:t.timeout??cSt,forceCache:t.forceCache??!1,forceInit:t.forceInit??t.force??!1})}var pSt=XJ();Object.defineProperty(gh,\"TUFError\",{enumerable:!0,get:function(){return pSt.TUFError}})});var sxe=_(gL=>{\"use strict\";Object.defineProperty(gL,\"__esModule\",{value:!0});gL.DSSESignatureContent=void 0;var Wb=Cl(),eK=class{constructor(e){this.env=e}compareDigest(e){return Wb.crypto.bufferEqual(e,Wb.crypto.digest(\"sha256\",this.env.payload))}compareSignature(e){return Wb.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Wb.crypto.verify(this.preAuthEncoding,e,this.signature)}get signature(){return this.env.signatures.length>0?this.env.signatures[0].sig:Buffer.from(\"\")}get preAuthEncoding(){return Wb.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};gL.DSSESignatureContent=eK});var oxe=_(dL=>{\"use strict\";Object.defineProperty(dL,\"__esModule\",{value:!0});dL.MessageSignatureContent=void 0;var tK=Cl(),rK=class{constructor(e,r){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=r}compareSignature(e){return tK.crypto.bufferEqual(e,this.signature)}compareDigest(e){return tK.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return tK.crypto.verify(this.artifact,e,this.signature)}};dL.MessageSignatureContent=rK});var lxe=_(mL=>{\"use strict\";Object.defineProperty(mL,\"__esModule\",{value:!0});mL.toSignedEntity=dSt;mL.signatureContent=axe;var nK=Cl(),hSt=sxe(),gSt=oxe();function dSt(t,e){let{tlogEntries:r,timestampVerificationData:s}=t.verificationMaterial,a=[];for(let n of r)a.push({$case:\"transparency-log\",tlogEntry:n});for(let n of s?.rfc3161Timestamps??[])a.push({$case:\"timestamp-authority\",timestamp:nK.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:axe(t,e),key:mSt(t),tlogEntries:r,timestamps:a}}function axe(t,e){switch(t.content.$case){case\"dsseEnvelope\":return new hSt.DSSESignatureContent(t.content.dsseEnvelope);case\"messageSignature\":return new gSt.MessageSignatureContent(t.content.messageSignature,e)}}function mSt(t){switch(t.verificationMaterial.content.$case){case\"publicKey\":return{$case:\"public-key\",hint:t.verificationMaterial.content.publicKey.hint};case\"x509CertificateChain\":return{$case:\"certificate\",certificate:nK.X509Certificate.parse(t.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case\"certificate\":return{$case:\"certificate\",certificate:nK.X509Certificate.parse(t.verificationMaterial.content.certificate.rawBytes)}}}});var Eo=_(E1=>{\"use strict\";Object.defineProperty(E1,\"__esModule\",{value:!0});E1.PolicyError=E1.VerificationError=void 0;var yL=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.code=e,this.cause=s,this.name=this.constructor.name}},iK=class extends yL{};E1.VerificationError=iK;var sK=class extends yL{};E1.PolicyError=sK});var cxe=_(EL=>{\"use strict\";Object.defineProperty(EL,\"__esModule\",{value:!0});EL.filterCertAuthorities=ySt;EL.filterTLogAuthorities=ESt;function ySt(t,e){return t.filter(r=>r.validFor.start<=e.start&&r.validFor.end>=e.end)}function ESt(t,e){return t.filter(r=>e.logID&&!r.logID.equals(e.logID)?!1:r.validFor.start<=e.targetDate&&e.targetDate<=r.validFor.end)}});var py=_(Ay=>{\"use strict\";Object.defineProperty(Ay,\"__esModule\",{value:!0});Ay.filterTLogAuthorities=Ay.filterCertAuthorities=void 0;Ay.toTrustMaterial=CSt;var oK=Cl(),Yb=yb(),ISt=Eo(),aK=new Date(0),lK=new Date(864e13),Axe=cxe();Object.defineProperty(Ay,\"filterCertAuthorities\",{enumerable:!0,get:function(){return Axe.filterCertAuthorities}});Object.defineProperty(Ay,\"filterTLogAuthorities\",{enumerable:!0,get:function(){return Axe.filterTLogAuthorities}});function CSt(t,e){let r=typeof e==\"function\"?e:wSt(e);return{certificateAuthorities:t.certificateAuthorities.map(fxe),timestampAuthorities:t.timestampAuthorities.map(fxe),tlogs:t.tlogs.map(uxe),ctlogs:t.ctlogs.map(uxe),publicKey:r}}function uxe(t){let e=t.publicKey.keyDetails,r=e===Yb.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===Yb.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===Yb.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===Yb.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===Yb.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?\"pkcs1\":\"spki\";return{logID:t.logId.keyId,publicKey:oK.crypto.createPublicKey(t.publicKey.rawBytes,r),validFor:{start:t.publicKey.validFor?.start||aK,end:t.publicKey.validFor?.end||lK}}}function fxe(t){return{certChain:t.certChain.certificates.map(e=>oK.X509Certificate.parse(e.rawBytes)),validFor:{start:t.validFor?.start||aK,end:t.validFor?.end||lK}}}function wSt(t){return e=>{let r=(t||{})[e];if(!r)throw new ISt.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`key not found: ${e}`});return{publicKey:oK.crypto.createPublicKey(r.rawBytes),validFor:s=>(r.validFor?.start||aK)<=s&&(r.validFor?.end||lK)>=s}}}});var cK=_(Vb=>{\"use strict\";Object.defineProperty(Vb,\"__esModule\",{value:!0});Vb.CertificateChainVerifier=void 0;Vb.verifyCertificateChain=vSt;var hy=Eo(),BSt=py();function vSt(t,e){let r=(0,BSt.filterCertAuthorities)(e,{start:t.notBefore,end:t.notAfter}),s;for(let a of r)try{return new IL({trustedCerts:a.certChain,untrustedCert:t}).verify()}catch(n){s=n}throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"Failed to verify certificate chain\",cause:s})}var IL=class{constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=SSt([...e.trustedCerts,e.untrustedCert])}verify(){let e=this.sort();return this.checkPath(e),e}sort(){let e=this.untrustedCert,r=this.buildPaths(e);if(r=r.filter(a=>a.some(n=>this.trustedCerts.includes(n))),r.length===0)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"no trusted certificate path found\"});let s=r.reduce((a,n)=>a.length<n.length?a:n);return[e,...s].slice(0,-1)}buildPaths(e){let r=[],s=this.findIssuer(e);if(s.length===0)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"no valid certificate path found\"});for(let a=0;a<s.length;a++){let n=s[a];if(n.equals(e)){r.push([e]);continue}let c=this.buildPaths(n);for(let f=0;f<c.length;f++)r.push([n,...c[f]])}return r}findIssuer(e){let r=[],s;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(s=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(a=>{if(s&&a.extSubjectKeyID){a.extSubjectKeyID.keyIdentifier.equals(s)&&r.push(a);return}a.subject.equals(e.issuer)&&r.push(a)}),r=r.filter(a=>{try{return e.verify(a)}catch{return!1}}),r)}checkPath(e){if(e.length<1)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"certificate chain must contain at least one certificate\"});if(!e.slice(1).every(s=>s.isCA))throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"intermediate certificate is not a CA\"});for(let s=e.length-2;s>=0;s--)if(!e[s].issuer.equals(e[s+1].subject))throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"incorrect certificate name chaining\"});for(let s=0;s<e.length;s++){let a=e[s];if(a.extBasicConstraints?.isCA){let n=a.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<s-1)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"path length constraint exceeded\"})}}}};Vb.CertificateChainVerifier=IL;function SSt(t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)t[e].equals(t[r])&&(t.splice(r,1),r--);return t}});var pxe=_(uK=>{\"use strict\";Object.defineProperty(uK,\"__esModule\",{value:!0});uK.verifySCTs=PSt;var CL=Cl(),DSt=Eo(),bSt=py();function PSt(t,e,r){let s,a=t.clone();for(let p=0;p<a.extensions.length;p++){let h=a.extensions[p];if(h.subs[0].toOID()===CL.EXTENSION_OID_SCT){s=new CL.X509SCTExtension(h),a.extensions.splice(p,1);break}}if(!s)return[];if(s.signedCertificateTimestamps.length===0)return[];let n=new CL.ByteStream,c=CL.crypto.digest(\"sha256\",e.publicKey);n.appendView(c);let f=a.tbsCertificate.toDER();return n.appendUint24(f.length),n.appendView(f),s.signedCertificateTimestamps.map(p=>{if(!(0,bSt.filterTLogAuthorities)(r,{logID:p.logID,targetDate:p.datetime}).some(C=>p.verify(n.buffer,C.publicKey)))throw new DSt.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"SCT verification failed\"});return p.logID})}});var gxe=_(wL=>{\"use strict\";Object.defineProperty(wL,\"__esModule\",{value:!0});wL.verifyPublicKey=FSt;wL.verifyCertificate=NSt;var xSt=Cl(),hxe=Eo(),kSt=cK(),QSt=pxe(),TSt=\"1.3.6.1.4.1.57264.1.1\",RSt=\"1.3.6.1.4.1.57264.1.8\";function FSt(t,e,r){let s=r.publicKey(t);return e.forEach(a=>{if(!s.validFor(a))throw new hxe.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`Public key is not valid for timestamp: ${a.toISOString()}`})}),{key:s.publicKey}}function NSt(t,e,r){let s=(0,kSt.verifyCertificateChain)(t,r.certificateAuthorities);if(!e.every(n=>s.every(c=>c.validForDate(n))))throw new hxe.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"certificate is not valid or expired at the specified date\"});return{scts:(0,QSt.verifySCTs)(s[0],s[1],r.ctlogs),signer:OSt(s[0])}}function OSt(t){let e,r=t.extension(RSt);r?e=r.valueObj.subs?.[0]?.value.toString(\"ascii\"):e=t.extension(TSt)?.value.toString(\"ascii\");let s={extensions:{issuer:e},subjectAlternativeName:t.subjectAltName};return{key:xSt.crypto.createPublicKey(t.publicKey),identity:s}}});var mxe=_(BL=>{\"use strict\";Object.defineProperty(BL,\"__esModule\",{value:!0});BL.verifySubjectAlternativeName=LSt;BL.verifyExtensions=MSt;var dxe=Eo();function LSt(t,e){if(e===void 0||!e.match(t))throw new dxe.PolicyError({code:\"UNTRUSTED_SIGNER_ERROR\",message:`certificate identity error - expected ${t}, got ${e}`})}function MSt(t,e={}){let r;for(r in t)if(e[r]!==t[r])throw new dxe.PolicyError({code:\"UNTRUSTED_SIGNER_ERROR\",message:`invalid certificate extension - expected ${r}=${t[r]}, got ${r}=${e[r]}`})}});var yxe=_(gK=>{\"use strict\";Object.defineProperty(gK,\"__esModule\",{value:!0});gK.verifyCheckpoint=HSt;var AK=Cl(),I1=Eo(),USt=py(),fK=`\n\n`,_St=/\\u2014 (\\S+) (\\S+)\\n/g;function HSt(t,e){let r=(0,USt.filterTLogAuthorities)(e,{targetDate:new Date(Number(t.integratedTime)*1e3)}),s=t.inclusionProof,a=pK.fromString(s.checkpoint.envelope),n=hK.fromString(a.note);if(!jSt(a,r))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"invalid checkpoint signature\"});if(!AK.crypto.bufferEqual(n.logHash,s.rootHash))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"root hash mismatch\"})}function jSt(t,e){let r=Buffer.from(t.note,\"utf-8\");return t.signatures.every(s=>{let a=e.find(n=>AK.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?AK.crypto.verify(r,a.publicKey,s.signature):!1})}var pK=class t{constructor(e,r){this.note=e,this.signatures=r}static fromString(e){if(!e.includes(fK))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"missing checkpoint separator\"});let r=e.indexOf(fK),s=e.slice(0,r+1),n=e.slice(r+fK.length).matchAll(_St),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,\"base64\");if(E.length<5)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"malformed checkpoint signature\"});return{name:p,keyHint:E.subarray(0,4),signature:E.subarray(4)}});if(c.length===0)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"no signatures found in checkpoint\"});return new t(s,c)}},hK=class t{constructor(e,r,s,a){this.origin=e,this.logSize=r,this.logHash=s,this.rest=a}static fromString(e){let r=e.trimEnd().split(`\n`);if(r.length<3)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"too few lines in checkpoint header\"});let s=r[0],a=BigInt(r[1]),n=Buffer.from(r[2],\"base64\"),c=r.slice(3);return new t(s,a,n,c)}}});var Exe=_(EK=>{\"use strict\";Object.defineProperty(EK,\"__esModule\",{value:!0});EK.verifyMerkleInclusion=WSt;var yK=Cl(),dK=Eo(),GSt=Buffer.from([0]),qSt=Buffer.from([1]);function WSt(t){let e=t.inclusionProof,r=BigInt(e.logIndex),s=BigInt(e.treeSize);if(r<0n||r>=s)throw new dK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:`invalid index: ${r}`});let{inner:a,border:n}=YSt(r,s);if(e.hashes.length!==a+n)throw new dK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"invalid hash count\"});let c=e.hashes.slice(0,a),f=e.hashes.slice(a),p=ZSt(t.canonicalizedBody),h=JSt(VSt(p,c,r),f);if(!yK.crypto.bufferEqual(h,e.rootHash))throw new dK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"calculated root hash does not match inclusion proof\"})}function YSt(t,e){let r=KSt(t,e),s=zSt(t>>BigInt(r));return{inner:r,border:s}}function VSt(t,e,r){return e.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?mK(a,s):mK(s,a),t)}function JSt(t,e){return e.reduce((r,s)=>mK(s,r),t)}function KSt(t,e){return XSt(t^e-BigInt(1))}function zSt(t){return t.toString(2).split(\"1\").length-1}function XSt(t){return t===0n?0:t.toString(2).length}function mK(t,e){return yK.crypto.digest(\"sha256\",qSt,t,e)}function ZSt(t){return yK.crypto.digest(\"sha256\",GSt,t)}});var Cxe=_(IK=>{\"use strict\";Object.defineProperty(IK,\"__esModule\",{value:!0});IK.verifyTLogSET=tDt;var Ixe=Cl(),$St=Eo(),eDt=py();function tDt(t,e){if(!(0,eDt.filterTLogAuthorities)(e,{logID:t.logId.keyId,targetDate:new Date(Number(t.integratedTime)*1e3)}).some(a=>{let n=rDt(t),c=Buffer.from(Ixe.json.canonicalize(n),\"utf8\"),f=t.inclusionPromise.signedEntryTimestamp;return Ixe.crypto.verify(c,a.publicKey,f)}))throw new $St.VerificationError({code:\"TLOG_INCLUSION_PROMISE_ERROR\",message:\"inclusion promise could not be verified\"})}function rDt(t){let{integratedTime:e,logIndex:r,logId:s,canonicalizedBody:a}=t;return{body:a.toString(\"base64\"),integratedTime:Number(e),logIndex:Number(r),logID:s.keyId.toString(\"hex\")}}});var wxe=_(BK=>{\"use strict\";Object.defineProperty(BK,\"__esModule\",{value:!0});BK.verifyRFC3161Timestamp=sDt;var CK=Cl(),wK=Eo(),nDt=cK(),iDt=py();function sDt(t,e,r){let s=t.signingTime;if(r=(0,iDt.filterCertAuthorities)(r,{start:s,end:s}),r=aDt(r,{serialNumber:t.signerSerialNumber,issuer:t.signerIssuer}),!r.some(n=>{try{return oDt(t,e,n),!0}catch{return!1}}))throw new wK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"timestamp could not be verified\"})}function oDt(t,e,r){let[s,...a]=r.certChain,n=CK.crypto.createPublicKey(s.publicKey),c=t.signingTime;try{new nDt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new wK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"invalid certificate chain\"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new wK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"timestamp was signed with an expired certificate\"});t.verify(e,n)}function aDt(t,e){return t.filter(r=>r.certChain.length>0&&CK.crypto.bufferEqual(r.certChain[0].serialNumber,e.serialNumber)&&CK.crypto.bufferEqual(r.certChain[0].issuer,e.issuer))}});var Bxe=_(vL=>{\"use strict\";Object.defineProperty(vL,\"__esModule\",{value:!0});vL.verifyTSATimestamp=pDt;vL.verifyTLogTimestamp=hDt;var lDt=Eo(),cDt=yxe(),uDt=Exe(),fDt=Cxe(),ADt=wxe();function pDt(t,e,r){return(0,ADt.verifyRFC3161Timestamp)(t,e,r),{type:\"timestamp-authority\",logID:t.signerSerialNumber,timestamp:t.signingTime}}function hDt(t,e){let r=!1;if(gDt(t)&&((0,fDt.verifyTLogSET)(t,e),r=!0),dDt(t)&&((0,uDt.verifyMerkleInclusion)(t),(0,cDt.verifyCheckpoint)(t,e),r=!0),!r)throw new lDt.VerificationError({code:\"TLOG_MISSING_INCLUSION_ERROR\",message:\"inclusion could not be verified\"});return{type:\"transparency-log\",logID:t.logId.keyId,timestamp:new Date(Number(t.integratedTime)*1e3)}}function gDt(t){return t.inclusionPromise!==void 0}function dDt(t){return t.inclusionProof!==void 0}});var vxe=_(vK=>{\"use strict\";Object.defineProperty(vK,\"__esModule\",{value:!0});vK.verifyDSSETLogBody=mDt;var SL=Eo();function mDt(t,e){switch(t.apiVersion){case\"0.0.1\":return yDt(t,e);default:throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported dsse version: ${t.apiVersion}`})}}function yDt(t,e){if(t.spec.signatures?.length!==1)throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature count mismatch\"});let r=t.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"tlog entry signature mismatch\"});let s=t.spec.payloadHash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"DSSE payload hash mismatch\"})}});var Sxe=_(DK=>{\"use strict\";Object.defineProperty(DK,\"__esModule\",{value:!0});DK.verifyHashedRekordTLogBody=EDt;var SK=Eo();function EDt(t,e){switch(t.apiVersion){case\"0.0.1\":return IDt(t,e);default:throw new SK.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported hashedrekord version: ${t.apiVersion}`})}}function IDt(t,e){let r=t.spec.signature.content||\"\";if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new SK.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature mismatch\"});let s=t.spec.data.hash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new SK.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"digest mismatch\"})}});var Dxe=_(bK=>{\"use strict\";Object.defineProperty(bK,\"__esModule\",{value:!0});bK.verifyIntotoTLogBody=CDt;var DL=Eo();function CDt(t,e){switch(t.apiVersion){case\"0.0.2\":return wDt(t,e);default:throw new DL.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported intoto version: ${t.apiVersion}`})}}function wDt(t,e){if(t.spec.content.envelope.signatures?.length!==1)throw new DL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature count mismatch\"});let r=BDt(t.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new DL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"tlog entry signature mismatch\"});let s=t.spec.content.payloadHash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new DL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"DSSE payload hash mismatch\"})}function BDt(t){return Buffer.from(t,\"base64\").toString(\"utf-8\")}});var Pxe=_(PK=>{\"use strict\";Object.defineProperty(PK,\"__esModule\",{value:!0});PK.verifyTLogBody=bDt;var bxe=Eo(),vDt=vxe(),SDt=Sxe(),DDt=Dxe();function bDt(t,e){let{kind:r,version:s}=t.kindVersion,a=JSON.parse(t.canonicalizedBody.toString(\"utf8\"));if(r!==a.kind||s!==a.apiVersion)throw new bxe.VerificationError({code:\"TLOG_BODY_ERROR\",message:`kind/version mismatch - expected: ${r}/${s}, received: ${a.kind}/${a.apiVersion}`});switch(a.kind){case\"dsse\":return(0,vDt.verifyDSSETLogBody)(a,e);case\"intoto\":return(0,DDt.verifyIntotoTLogBody)(a,e);case\"hashedrekord\":return(0,SDt.verifyHashedRekordTLogBody)(a,e);default:throw new bxe.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported kind: ${r}`})}}});var Rxe=_(bL=>{\"use strict\";Object.defineProperty(bL,\"__esModule\",{value:!0});bL.Verifier=void 0;var PDt=Ie(\"util\"),C1=Eo(),xxe=gxe(),kxe=mxe(),Qxe=Bxe(),xDt=Pxe(),xK=class{constructor(e,r={}){this.trustMaterial=e,this.options={ctlogThreshold:r.ctlogThreshold??1,tlogThreshold:r.tlogThreshold??1,tsaThreshold:r.tsaThreshold??0}}verify(e,r){let s=this.verifyTimestamps(e),a=this.verifySigningKey(e,s);return this.verifyTLogs(e),this.verifySignature(e,a),r&&this.verifyPolicy(r,a.identity||{}),a}verifyTimestamps(e){let r=0,s=0,a=e.timestamps.map(n=>{switch(n.$case){case\"timestamp-authority\":return s++,(0,Qxe.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case\"transparency-log\":return r++,(0,Qxe.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(Txe(a))throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"duplicate timestamp\"});if(r<this.options.tlogThreshold)throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${r}`});if(s<this.options.tsaThreshold)throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${s}`});return a.map(n=>n.timestamp)}verifySigningKey({key:e},r){switch(e.$case){case\"public-key\":return(0,xxe.verifyPublicKey)(e.hint,r,this.trustMaterial);case\"certificate\":{let s=(0,xxe.verifyCertificate)(e.certificate,r,this.trustMaterial);if(Txe(s.scts))throw new C1.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"duplicate SCT\"});if(s.scts.length<this.options.ctlogThreshold)throw new C1.VerificationError({code:\"CERTIFICATE_ERROR\",message:`expected ${this.options.ctlogThreshold} SCTs, got ${s.scts.length}`});return s.signer}}}verifyTLogs({signature:e,tlogEntries:r}){r.forEach(s=>(0,xDt.verifyTLogBody)(s,e))}verifySignature(e,r){if(!e.signature.verifySignature(r.key))throw new C1.VerificationError({code:\"SIGNATURE_ERROR\",message:\"signature verification failed\"})}verifyPolicy(e,r){e.subjectAlternativeName&&(0,kxe.verifySubjectAlternativeName)(e.subjectAlternativeName,r.subjectAlternativeName),e.extensions&&(0,kxe.verifyExtensions)(e.extensions,r.extensions)}};bL.Verifier=xK;function Txe(t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)if((0,PDt.isDeepStrictEqual)(t[e],t[r]))return!0;return!1}});var PL=_(iu=>{\"use strict\";Object.defineProperty(iu,\"__esModule\",{value:!0});iu.Verifier=iu.toTrustMaterial=iu.VerificationError=iu.PolicyError=iu.toSignedEntity=void 0;var kDt=lxe();Object.defineProperty(iu,\"toSignedEntity\",{enumerable:!0,get:function(){return kDt.toSignedEntity}});var Fxe=Eo();Object.defineProperty(iu,\"PolicyError\",{enumerable:!0,get:function(){return Fxe.PolicyError}});Object.defineProperty(iu,\"VerificationError\",{enumerable:!0,get:function(){return Fxe.VerificationError}});var QDt=py();Object.defineProperty(iu,\"toTrustMaterial\",{enumerable:!0,get:function(){return QDt.toTrustMaterial}});var TDt=Rxe();Object.defineProperty(iu,\"Verifier\",{enumerable:!0,get:function(){return TDt.Verifier}})});var Nxe=_(Fa=>{\"use strict\";Object.defineProperty(Fa,\"__esModule\",{value:!0});Fa.DEFAULT_TIMEOUT=Fa.DEFAULT_RETRY=void 0;Fa.createBundleBuilder=NDt;Fa.createKeyFinder=ODt;Fa.createVerificationPolicy=LDt;var RDt=Cl(),w1=H7(),FDt=PL();Fa.DEFAULT_RETRY={retries:2};Fa.DEFAULT_TIMEOUT=5e3;function NDt(t,e){let r={signer:MDt(e),witnesses:_Dt(e)};switch(t){case\"messageSignature\":return new w1.MessageSignatureBundleBuilder(r);case\"dsseEnvelope\":return new w1.DSSEBundleBuilder({...r,certificateChain:e.legacyCompatibility})}}function ODt(t){return e=>{let r=t(e);if(!r)throw new FDt.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`key not found: ${e}`});return{publicKey:RDt.crypto.createPublicKey(r),validFor:()=>!0}}}function LDt(t){let e={},r=t.certificateIdentityEmail||t.certificateIdentityURI;return r&&(e.subjectAlternativeName=r),t.certificateIssuer&&(e.extensions={issuer:t.certificateIssuer}),e}function MDt(t){return new w1.FulcioSigner({fulcioBaseURL:t.fulcioURL,identityProvider:t.identityProvider||UDt(t),retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})}function UDt(t){let e=t.identityToken;return e?{getToken:()=>Promise.resolve(e)}:new w1.CIContextProvider(\"sigstore\")}function _Dt(t){let e=[];return HDt(t)&&e.push(new w1.RekorWitness({rekorBaseURL:t.rekorURL,entryType:t.legacyCompatibility?\"intoto\":\"dsse\",fetchOnConflict:!1,retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})),jDt(t)&&e.push(new w1.TSAWitness({tsaBaseURL:t.tsaServerURL,retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})),e}function HDt(t){return t.tlogUpload!==!1}function jDt(t){return t.tsaServerURL!==void 0}});var Mxe=_(su=>{\"use strict\";var GDt=su&&su.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),qDt=su&&su.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Oxe=su&&su.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&GDt(r,e,s[a]);return qDt(r,e),r}}();Object.defineProperty(su,\"__esModule\",{value:!0});su.sign=YDt;su.attest=VDt;su.verify=JDt;su.createVerifier=Lxe;var QK=Ib(),WDt=Oxe(hL()),kK=PL(),B1=Oxe(Nxe());async function YDt(t,e={}){let s=await B1.createBundleBuilder(\"messageSignature\",e).create({data:t});return(0,QK.bundleToJSON)(s)}async function VDt(t,e,r={}){let a=await B1.createBundleBuilder(\"dsseEnvelope\",r).create({data:t,type:e});return(0,QK.bundleToJSON)(a)}async function JDt(t,e,r){let s;return Buffer.isBuffer(e)?s=e:r=e,Lxe(r).then(a=>a.verify(t,s))}async function Lxe(t={}){let e=await WDt.getTrustedRoot({mirrorURL:t.tufMirrorURL,rootPath:t.tufRootPath,cachePath:t.tufCachePath,forceCache:t.tufForceCache,retry:t.retry??B1.DEFAULT_RETRY,timeout:t.timeout??B1.DEFAULT_TIMEOUT}),r=t.keySelector?B1.createKeyFinder(t.keySelector):void 0,s=(0,kK.toTrustMaterial)(e,r),a={ctlogThreshold:t.ctLogThreshold,tlogThreshold:t.tlogThreshold},n=new kK.Verifier(s,a),c=B1.createVerificationPolicy(t);return{verify:(f,p)=>{let h=(0,QK.bundleFromJSON)(f),E=(0,kK.toSignedEntity)(h,p);n.verify(E,c)}}}});var _xe=_(Ni=>{\"use strict\";Object.defineProperty(Ni,\"__esModule\",{value:!0});Ni.verify=Ni.sign=Ni.createVerifier=Ni.attest=Ni.VerificationError=Ni.PolicyError=Ni.TUFError=Ni.InternalError=Ni.DEFAULT_REKOR_URL=Ni.DEFAULT_FULCIO_URL=Ni.ValidationError=void 0;var KDt=Ib();Object.defineProperty(Ni,\"ValidationError\",{enumerable:!0,get:function(){return KDt.ValidationError}});var TK=H7();Object.defineProperty(Ni,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return TK.DEFAULT_FULCIO_URL}});Object.defineProperty(Ni,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return TK.DEFAULT_REKOR_URL}});Object.defineProperty(Ni,\"InternalError\",{enumerable:!0,get:function(){return TK.InternalError}});var zDt=hL();Object.defineProperty(Ni,\"TUFError\",{enumerable:!0,get:function(){return zDt.TUFError}});var Uxe=PL();Object.defineProperty(Ni,\"PolicyError\",{enumerable:!0,get:function(){return Uxe.PolicyError}});Object.defineProperty(Ni,\"VerificationError\",{enumerable:!0,get:function(){return Uxe.VerificationError}});var xL=Mxe();Object.defineProperty(Ni,\"attest\",{enumerable:!0,get:function(){return xL.attest}});Object.defineProperty(Ni,\"createVerifier\",{enumerable:!0,get:function(){return xL.createVerifier}});Object.defineProperty(Ni,\"sign\",{enumerable:!0,get:function(){return xL.sign}});Object.defineProperty(Ni,\"verify\",{enumerable:!0,get:function(){return xL.verify}})});Dt();Ge();Dt();var dke=Ie(\"child_process\"),mke=ut(Fd());Yt();var $I=new Map([]);var Gv={};Vt(Gv,{BaseCommand:()=>ft,WorkspaceRequiredError:()=>ar,getCli:()=>bde,getDynamicLibs:()=>Dde,getPluginConfiguration:()=>tC,openWorkspace:()=>eC,pluginCommands:()=>$I,runExit:()=>VR});Yt();var ft=class extends ot{constructor(){super(...arguments);this.cwd=ge.String(\"--cwd\",{hidden:!0})}validateAndExecute(){if(typeof this.cwd<\"u\")throw new nt(\"The --cwd option is ambiguous when used anywhere else than the very first parameter provided in the command line, before even the command path\");return super.validateAndExecute()}};Ge();Dt();Yt();var ar=class extends nt{constructor(e,r){let s=J.relative(e,r),a=J.join(e,Ut.fileName);super(`This command can only be run from within a workspace of your project (${s} isn't a workspace of ${a}).`)}};Ge();Dt();eA();wc();pv();Yt();var yat=ut(Ai());Ul();var Dde=()=>new Map([[\"@yarnpkg/cli\",Gv],[\"@yarnpkg/core\",jv],[\"@yarnpkg/fslib\",_2],[\"@yarnpkg/libzip\",fv],[\"@yarnpkg/parsers\",J2],[\"@yarnpkg/shell\",mv],[\"clipanion\",oB],[\"semver\",yat],[\"typanion\",Ea]]);Ge();async function eC(t,e){let{project:r,workspace:s}=await Tt.find(t,e);if(!s)throw new ar(r.cwd,e);return s}Ge();Dt();eA();wc();pv();Yt();var IPt=ut(Ai());Ul();var hq={};Vt(hq,{AddCommand:()=>sC,BinCommand:()=>oC,CacheCleanCommand:()=>aC,ClipanionCommand:()=>pC,ConfigCommand:()=>fC,ConfigGetCommand:()=>lC,ConfigSetCommand:()=>cC,ConfigUnsetCommand:()=>uC,DedupeCommand:()=>AC,EntryCommand:()=>gC,ExecCommand:()=>mC,ExplainCommand:()=>IC,ExplainPeerRequirementsCommand:()=>yC,HelpCommand:()=>hC,InfoCommand:()=>CC,LinkCommand:()=>BC,NodeCommand:()=>vC,PluginCheckCommand:()=>SC,PluginImportCommand:()=>PC,PluginImportSourcesCommand:()=>xC,PluginListCommand:()=>DC,PluginRemoveCommand:()=>kC,PluginRuntimeCommand:()=>QC,RebuildCommand:()=>TC,RemoveCommand:()=>RC,RunCommand:()=>NC,RunIndexCommand:()=>FC,SetResolutionCommand:()=>OC,SetVersionCommand:()=>EC,SetVersionSourcesCommand:()=>bC,UnlinkCommand:()=>LC,UpCommand:()=>MC,VersionCommand:()=>dC,WhyCommand:()=>UC,WorkspaceCommand:()=>qC,WorkspacesListCommand:()=>GC,YarnCommand:()=>wC,dedupeUtils:()=>rF,default:()=>Tct,suggestUtils:()=>Xu});var zye=ut(Fd());Ge();Ge();Ge();Yt();var hye=ut(Vv());Ul();var Xu={};Vt(Xu,{Modifier:()=>W5,Strategy:()=>eF,Target:()=>Jv,WorkspaceModifier:()=>cye,applyModifier:()=>Mlt,extractDescriptorFromPath:()=>Y5,extractRangeModifier:()=>uye,fetchDescriptorFrom:()=>V5,findProjectDescriptors:()=>pye,getModifier:()=>Kv,getSuggestedDescriptors:()=>zv,makeWorkspaceDescriptor:()=>Aye,toWorkspaceModifier:()=>fye});Ge();Ge();Dt();var q5=ut(Ai()),Olt=\"workspace:\",Jv=(s=>(s.REGULAR=\"dependencies\",s.DEVELOPMENT=\"devDependencies\",s.PEER=\"peerDependencies\",s))(Jv||{}),W5=(s=>(s.CARET=\"^\",s.TILDE=\"~\",s.EXACT=\"\",s))(W5||{}),cye=(s=>(s.CARET=\"^\",s.TILDE=\"~\",s.EXACT=\"*\",s))(cye||{}),eF=(n=>(n.KEEP=\"keep\",n.REUSE=\"reuse\",n.PROJECT=\"project\",n.LATEST=\"latest\",n.CACHE=\"cache\",n))(eF||{});function Kv(t,e){return t.exact?\"\":t.caret?\"^\":t.tilde?\"~\":e.configuration.get(\"defaultSemverRangePrefix\")}var Llt=/^([\\^~]?)[0-9]+(?:\\.[0-9]+){0,2}(?:-\\S+)?$/;function uye(t,{project:e}){let r=t.match(Llt);return r?r[1]:e.configuration.get(\"defaultSemverRangePrefix\")}function Mlt(t,e){let{protocol:r,source:s,params:a,selector:n}=G.parseRange(t.range);return q5.default.valid(n)&&(n=`${e}${t.range}`),G.makeDescriptor(t,G.makeRange({protocol:r,source:s,params:a,selector:n}))}function fye(t){switch(t){case\"^\":return\"^\";case\"~\":return\"~\";case\"\":return\"*\";default:throw new Error(`Assertion failed: Unknown modifier: \"${t}\"`)}}function Aye(t,e){return G.makeDescriptor(t.anchoredDescriptor,`${Olt}${fye(e)}`)}async function pye(t,{project:e,target:r}){let s=new Map,a=n=>{let c=s.get(n.descriptorHash);return c||s.set(n.descriptorHash,c={descriptor:n,locators:[]}),c};for(let n of e.workspaces)if(r===\"peerDependencies\"){let c=n.manifest.peerDependencies.get(t.identHash);c!==void 0&&a(c).locators.push(n.anchoredLocator)}else{let c=n.manifest.dependencies.get(t.identHash),f=n.manifest.devDependencies.get(t.identHash);r===\"devDependencies\"?f!==void 0?a(f).locators.push(n.anchoredLocator):c!==void 0&&a(c).locators.push(n.anchoredLocator):c!==void 0?a(c).locators.push(n.anchoredLocator):f!==void 0&&a(f).locators.push(n.anchoredLocator)}return s}async function Y5(t,{cwd:e,workspace:r}){return await _lt(async s=>{J.isAbsolute(t)||(t=J.relative(r.cwd,J.resolve(e,t)),t.match(/^\\.{0,2}\\//)||(t=`./${t}`));let{project:a}=r,n=await V5(G.makeIdent(null,\"archive\"),t,{project:r.project,cache:s,workspace:r});if(!n)throw new Error(\"Assertion failed: The descriptor should have been found\");let c=new ki,f=a.configuration.makeResolver(),p=a.configuration.makeFetcher(),h={checksums:a.storedChecksums,project:a,cache:s,fetcher:p,report:c,resolver:f},E=f.bindDescriptor(n,r.anchoredLocator,h),C=G.convertDescriptorToLocator(E),S=await p.fetch(C,h),P=await Ut.find(S.prefixPath,{baseFs:S.packageFs});if(!P.name)throw new Error(\"Target path doesn't have a name\");return G.makeDescriptor(P.name,t)})}function Ult(t){if(t.range===\"unknown\")return{type:\"resolve\",range:\"latest\"};if(Fr.validRange(t.range))return{type:\"fixed\",range:t.range};if(Mp.test(t.range))return{type:\"resolve\",range:t.range};let e=t.range.match(/^(?:jsr:|npm:)(.*)/);if(!e)return{type:\"fixed\",range:t.range};let[,r]=e,s=`${G.stringifyIdent(t)}@`;return r.startsWith(s)&&(r=r.slice(s.length)),Fr.validRange(r)?{type:\"fixed\",range:t.range}:Mp.test(r)?{type:\"resolve\",range:t.range}:{type:\"fixed\",range:t.range}}async function zv(t,{project:e,workspace:r,cache:s,target:a,fixed:n,modifier:c,strategies:f,maxResults:p=1/0}){if(!(p>=0))throw new Error(`Invalid maxResults (${p})`);let h=!n||t.range===\"unknown\"?Ult(t):{type:\"fixed\",range:t.range};if(h.type===\"fixed\")return{suggestions:[{descriptor:t,name:`Use ${G.prettyDescriptor(e.configuration,t)}`,reason:\"(unambiguous explicit request)\"}],rejections:[]};let E=typeof r<\"u\"&&r!==null&&r.manifest[a].get(t.identHash)||null,C=[],S=[],P=async I=>{try{await I()}catch(R){S.push(R)}};for(let I of f){if(C.length>=p)break;switch(I){case\"keep\":await P(async()=>{E&&C.push({descriptor:E,name:`Keep ${G.prettyDescriptor(e.configuration,E)}`,reason:\"(no changes)\"})});break;case\"reuse\":await P(async()=>{for(let{descriptor:R,locators:N}of(await pye(t,{project:e,target:a})).values()){if(N.length===1&&N[0].locatorHash===r.anchoredLocator.locatorHash&&f.includes(\"keep\"))continue;let U=`(originally used by ${G.prettyLocator(e.configuration,N[0])}`;U+=N.length>1?` and ${N.length-1} other${N.length>2?\"s\":\"\"})`:\")\",C.push({descriptor:R,name:`Reuse ${G.prettyDescriptor(e.configuration,R)}`,reason:U})}});break;case\"cache\":await P(async()=>{for(let R of e.storedDescriptors.values())R.identHash===t.identHash&&C.push({descriptor:R,name:`Reuse ${G.prettyDescriptor(e.configuration,R)}`,reason:\"(already used somewhere in the lockfile)\"})});break;case\"project\":await P(async()=>{if(r.manifest.name!==null&&t.identHash===r.manifest.name.identHash)return;let R=e.tryWorkspaceByIdent(t);if(R===null)return;let N=Aye(R,c);C.push({descriptor:N,name:`Attach ${G.prettyDescriptor(e.configuration,N)}`,reason:`(local workspace at ${he.pretty(e.configuration,R.relativeCwd,he.Type.PATH)})`})});break;case\"latest\":{let R=e.configuration.get(\"enableNetwork\"),N=e.configuration.get(\"enableOfflineMode\");await P(async()=>{if(a===\"peerDependencies\")C.push({descriptor:G.makeDescriptor(t,\"*\"),name:\"Use *\",reason:\"(catch-all peer dependency pattern)\"});else if(!R&&!N)C.push({descriptor:null,name:\"Resolve from latest\",reason:he.pretty(e.configuration,\"(unavailable because enableNetwork is toggled off)\",\"grey\")});else{let U=await V5(t,h.range,{project:e,cache:s,workspace:r,modifier:c});U&&C.push({descriptor:U,name:`Use ${G.prettyDescriptor(e.configuration,U)}`,reason:`(resolved from ${N?\"the cache\":\"latest\"})`})}})}break}}return{suggestions:C.slice(0,p),rejections:S.slice(0,p)}}async function V5(t,e,{project:r,cache:s,workspace:a,preserveModifier:n=!0,modifier:c}){let f=r.configuration.normalizeDependency(G.makeDescriptor(t,e)),p=new ki,h=r.configuration.makeFetcher(),E=r.configuration.makeResolver(),C={project:r,fetcher:h,cache:s,checksums:r.storedChecksums,report:p,cacheOptions:{skipIntegrityCheck:!0}},S={...C,resolver:E,fetchOptions:C},P=E.bindDescriptor(f,a.anchoredLocator,S),I=await E.getCandidates(P,{},S);if(I.length===0)return null;let R=I[0],{protocol:N,source:U,params:W,selector:ee}=G.parseRange(G.convertToManifestRange(R.reference));if(N===r.configuration.get(\"defaultProtocol\")&&(N=null),q5.default.valid(ee)){let ie=ee;if(typeof c<\"u\")ee=c+ee;else if(n!==!1){let me=typeof n==\"string\"?n:f.range;ee=uye(me,{project:r})+ee}let ue=G.makeDescriptor(R,G.makeRange({protocol:N,source:U,params:W,selector:ee}));(await E.getCandidates(r.configuration.normalizeDependency(ue),{},S)).length!==1&&(ee=ie)}return G.makeDescriptor(R,G.makeRange({protocol:N,source:U,params:W,selector:ee}))}async function _lt(t){return await ce.mktempPromise(async e=>{let r=ze.create(e);return r.useWithSource(e,{enableMirror:!1,compressionLevel:0},e,{overwrite:!0}),await t(new Kr(e,{configuration:r,check:!1,immutable:!1}))})}var sC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.fixed=ge.Boolean(\"-F,--fixed\",!1,{description:\"Store dependency tags as-is instead of resolving them\"});this.exact=ge.Boolean(\"-E,--exact\",!1,{description:\"Don't use any semver modifier on the resolved range\"});this.tilde=ge.Boolean(\"-T,--tilde\",!1,{description:\"Use the `~` semver modifier on the resolved range\"});this.caret=ge.Boolean(\"-C,--caret\",!1,{description:\"Use the `^` semver modifier on the resolved range\"});this.dev=ge.Boolean(\"-D,--dev\",!1,{description:\"Add a package as a dev dependency\"});this.peer=ge.Boolean(\"-P,--peer\",!1,{description:\"Add a package as a peer dependency\"});this.optional=ge.Boolean(\"-O,--optional\",!1,{description:\"Add / upgrade a package to an optional regular / peer dependency\"});this.preferDev=ge.Boolean(\"--prefer-dev\",!1,{description:\"Add / upgrade a package to a dev dependency\"});this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Reuse the specified package from other workspaces in the project\"});this.cached=ge.Boolean(\"--cached\",!1,{description:\"Reuse the highest version already used somewhere within the project\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.packages=ge.Rest()}static{this.paths=[[\"add\"]]}static{this.usage=ot.Usage({description:\"add dependencies to the project\",details:\"\\n      This command adds a package to the package.json for the nearest workspace.\\n\\n      - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\\n\\n      - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\\n\\n      - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\\n\\n      - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\\\"peerDependenciesMeta\\\": { \\\"<package>\\\": { \\\"optional\\\": true } }`\\n\\n      - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\\n\\n      - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\\n\\n      If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\\n\\n      If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/protocols.\\n    \",examples:[[\"Add a regular package to the current workspace\",\"$0 add lodash\"],[\"Add a specific version for a package to the current workspace\",\"$0 add lodash@1.2.3\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using a URL\",\"$0 add lodash@https://github.com/lodash/lodash\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol\",\"$0 add lodash@github:lodash/lodash\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)\",\"$0 add lodash@lodash/lodash\"],[\"Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)\",\"$0 add lodash-es@lodash/lodash#es\"],[\"Add a local package (gzipped tarball format) to the current workspace\",\"$0 add local-package-name@file:../path/to/local-package-name-v0.1.2.tgz\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.fixed,f=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=f||r.get(\"preferReuse\"),h=Kv(this,s),E=[p?\"reuse\":void 0,\"project\",this.cached?\"cache\":void 0,\"latest\"].filter(W=>typeof W<\"u\"),C=f?1/0:1,S=W=>{let ee=G.tryParseDescriptor(W.slice(4));return ee?ee.range===\"unknown\"?G.makeDescriptor(ee,`jsr:${G.stringifyIdent(ee)}@latest`):G.makeDescriptor(ee,`jsr:${ee.range}`):null},P=await Promise.all(this.packages.map(async W=>{let ee=W.match(/^\\.{0,2}\\//)?await Y5(W,{cwd:this.context.cwd,workspace:a}):W.startsWith(\"jsr:\")?S(W):G.tryParseDescriptor(W),ie=W.match(/^(https?:|git@github)/);if(ie)throw new nt(`It seems you are trying to add a package using a ${he.pretty(r,`${ie[0]}...`,he.Type.RANGE)} url; we now require package names to be explicitly specified.\nTry running the command again with the package name prefixed: ${he.pretty(r,\"yarn add\",he.Type.CODE)} ${he.pretty(r,G.makeDescriptor(G.makeIdent(null,\"my-package\"),`${ie[0]}...`),he.Type.DESCRIPTOR)}`);if(!ee)throw new nt(`The ${he.pretty(r,W,he.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let ue=Hlt(a,ee,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(ue.map(async me=>{let pe=await zv(ee,{project:s,workspace:a,cache:n,fixed:c,target:me,modifier:h,strategies:E,maxResults:C});return{request:ee,suggestedDescriptors:pe,target:me}}))})).then(W=>W.flat()),I=await lA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async W=>{for(let{request:ee,suggestedDescriptors:{suggestions:ie,rejections:ue}}of P)if(ie.filter(me=>me.descriptor!==null).length===0){let[me]=ue;if(typeof me>\"u\")throw new Error(\"Assertion failed: Expected an error to have been set\");s.configuration.get(\"enableNetwork\")?W.reportError(27,`${G.prettyDescriptor(r,ee)} can't be resolved to a satisfying range`):W.reportError(27,`${G.prettyDescriptor(r,ee)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),W.reportSeparator(),W.reportExceptionOnce(me)}});if(I.hasErrors())return I.exitCode();let R=!1,N=[],U=[];for(let{suggestedDescriptors:{suggestions:W},target:ee}of P){let ie,ue=W.filter(Be=>Be.descriptor!==null),le=ue[0].descriptor,me=ue.every(Be=>G.areDescriptorsEqual(Be.descriptor,le));ue.length===1||me?ie=le:(R=!0,{answer:ie}=await(0,hye.prompt)({type:\"select\",name:\"answer\",message:\"Which range do you want to use?\",choices:W.map(({descriptor:Be,name:Ce,reason:g})=>Be?{name:Ce,hint:g,descriptor:Be}:{name:Ce,hint:g,disabled:!0}),onCancel:()=>process.exit(130),result(Be){return this.find(Be,\"descriptor\")},stdin:this.context.stdin,stdout:this.context.stdout}));let pe=a.manifest[ee].get(ie.identHash);(typeof pe>\"u\"||pe.descriptorHash!==ie.descriptorHash)&&(a.manifest[ee].set(ie.identHash,ie),this.optional&&(ee===\"dependencies\"?a.manifest.ensureDependencyMeta({...ie,range:\"unknown\"}).optional=!0:ee===\"peerDependencies\"&&(a.manifest.ensurePeerDependencyMeta({...ie,range:\"unknown\"}).optional=!0)),typeof pe>\"u\"?N.push([a,ee,ie,E]):U.push([a,ee,pe,ie]))}return await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyAddition,N),await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyReplacement,U),R&&this.context.stdout.write(`\n`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function Hlt(t,e,{dev:r,peer:s,preferDev:a,optional:n}){let c=t.manifest.dependencies.has(e.identHash),f=t.manifest.devDependencies.has(e.identHash),p=t.manifest.peerDependencies.has(e.identHash);if((r||s)&&c)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!s&&p)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&f)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!s&&p)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return s&&h.push(\"peerDependencies\"),(r||a)&&h.push(\"devDependencies\"),n&&h.push(\"dependencies\"),h.length>0?h:f?[\"devDependencies\"]:p?[\"peerDependencies\"]:[\"dependencies\"]}Ge();Ge();Yt();var oC=class extends ft{constructor(){super(...arguments);this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Print both the binary name and the locator of the package that provides the binary\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.name=ge.String({required:!1})}static{this.paths=[[\"bin\"]]}static{this.usage=ot.Usage({description:\"get the path to a binary script\",details:`\n      When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \\`-v,--verbose\\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.\n\n      When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.\n    `,examples:[[\"List all the available binaries\",\"$0 bin\"],[\"Print the path to a specific binary\",\"$0 bin eslint\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);if(await s.restoreInstallState(),this.name){let f=(await In.getPackageAccessibleBinaries(a,{project:s})).get(this.name);if(!f)throw new nt(`Couldn't find a binary named \"${this.name}\" for package \"${G.prettyLocator(r,a)}\"`);let[,p]=f;return this.context.stdout.write(`${p}\n`),0}return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await In.getPackageAccessibleBinaries(a,{project:s}),h=Array.from(f.keys()).reduce((E,C)=>Math.max(E,C.length),0);for(let[E,[C,S]]of f)c.reportJson({name:E,source:G.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h,\" \")}   ${G.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ge();Dt();Yt();var aC=class extends ft{constructor(){super(...arguments);this.mirror=ge.Boolean(\"--mirror\",!1,{description:\"Remove the global cache files instead of the local cache files\"});this.all=ge.Boolean(\"--all\",!1,{description:\"Remove both the global cache files and the local cache files of the current project\"})}static{this.paths=[[\"cache\",\"clean\"],[\"cache\",\"clear\"]]}static{this.usage=ot.Usage({description:\"remove the shared cache files\",details:`\n      This command will remove all the files from the cache.\n    `,examples:[[\"Remove all the local archives\",\"$0 cache clean\"],[\"Remove all the archives stored in the ~/.yarn directory\",\"$0 cache clean --mirror\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(!r.get(\"enableCacheClean\"))throw new nt(\"Cache cleaning is currently disabled. To enable it, set `enableCacheClean: true` in your configuration file. Note: Cache cleaning is typically not required and should be avoided when using Zero-Installs.\");let s=await Kr.find(r);return(await Ot.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&s.mirrorCwd!==null,c=!this.mirror;n&&(await ce.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await ce.removePromise(s.cwd)})).exitCode()}};Ge();Yt();ql();var J5=Ie(\"util\"),lC=class extends ft{constructor(){super(...arguments);this.why=ge.Boolean(\"--why\",!1,{description:\"Print the explanation for why a setting has its value\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.unsafe=ge.Boolean(\"--no-redacted\",!1,{description:\"Don't redact secrets (such as tokens) from the output\"});this.name=ge.String()}static{this.paths=[[\"config\",\"get\"]]}static{this.usage=ot.Usage({description:\"read a configuration settings\",details:`\n      This command will print a configuration setting.\n\n      Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \\`--no-redacted\\` to get the untransformed value.\n    `,examples:[[\"Print a simple configuration setting\",\"yarn config get yarnPath\"],[\"Print a complex configuration setting\",\"yarn config get packageExtensions\"],[\"Print a nested field from the configuration\",`yarn config get 'npmScopes[\"my-company\"].npmRegistryServer'`],[\"Print a token from the configuration\",\"yarn config get npmAuthToken --no-redacted\"],[\"Print a configuration setting as JSON\",\"yarn config get packageExtensions --json\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=this.name.replace(/[.[].*$/,\"\"),a=this.name.replace(/^[^.[]*/,\"\");if(typeof r.settings.get(s)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${s}\"`);let c=r.getSpecial(s,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=je.convertMapsToIndexableObjects(c),p=a?va(f,a):f,h=await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p==\"string\")return this.context.stdout.write(`${p}\n`),h.exitCode();J5.inspect.styles.name=\"cyan\",this.context.stdout.write(`${(0,J5.inspect)(p,{depth:1/0,colors:r.get(\"enableColors\"),compact:!1})}\n`)}return h.exitCode()}};Ge();Yt();ql();var K5=Ie(\"util\"),cC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Set complex configuration settings to JSON values\"});this.home=ge.Boolean(\"-H,--home\",!1,{description:\"Update the home configuration instead of the project configuration\"});this.name=ge.String();this.value=ge.String()}static{this.paths=[[\"config\",\"set\"]]}static{this.usage=ot.Usage({description:\"change a configuration settings\",details:`\n      This command will set a configuration setting.\n\n      When used without the \\`--json\\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).\n\n      When used with the \\`--json\\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.\n    `,examples:[[\"Set a simple configuration setting (a string, a number, or a boolean)\",\"yarn config set initScope myScope\"],[\"Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag\",'yarn config set initScope --json \\\\\"myScope\\\\\"'],[\"Set a complex configuration setting (an Array) using the `--json` flag\",`yarn config set unsafeHttpWhitelist --json '[\"*.example.com\", \"example.com\"]'`],[\"Set a complex configuration setting (an Object) using the `--json` flag\",`yarn config set packageExtensions --json '{ \"@babel/parser@*\": { \"dependencies\": { \"@babel/types\": \"*\" } } }'`],[\"Set a nested configuration setting\",'yarn config set npmScopes.company.npmRegistryServer \"https://npm.example.com\"'],[\"Set a nested configuration setting using indexed access for non-simple keys\",`yarn config set 'npmRegistries[\"//npm.example.com\"].npmAuthToken' \"ffffffff-ffff-ffff-ffff-ffffffffffff\"`]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt(\"This command must be run from within a project folder\");return r.projectCwd},a=this.name.replace(/[.[].*$/,\"\"),n=this.name.replace(/^[^.[]*\\.?/,\"\");if(typeof r.settings.get(a)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${a}\"`);if(a===\"enableStrictSettings\")throw new nt(\"This setting only affects the file it's in, and thus cannot be set from the CLI\");let f=this.json?JSON.parse(this.value):this.value;await(this.home?I=>ze.updateHomeConfiguration(I):I=>ze.updateConfiguration(s(),I))(I=>{if(n){let R=f0(I);return Jd(R,this.name,f),R}else return{...I,[a]:f}});let E=(await ze.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),C=je.convertMapsToIndexableObjects(E),S=n?va(C,n):C;return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async I=>{K5.inspect.styles.name=\"cyan\",I.reportInfo(0,`Successfully set ${this.name} to ${(0,K5.inspect)(S,{depth:1/0,colors:r.get(\"enableColors\"),compact:!1})}`)})).exitCode()}};Ge();Yt();ql();var uC=class extends ft{constructor(){super(...arguments);this.home=ge.Boolean(\"-H,--home\",!1,{description:\"Update the home configuration instead of the project configuration\"});this.name=ge.String()}static{this.paths=[[\"config\",\"unset\"]]}static{this.usage=ot.Usage({description:\"unset a configuration setting\",details:`\n      This command will unset a configuration setting.\n    `,examples:[[\"Unset a simple configuration setting\",\"yarn config unset initScope\"],[\"Unset a complex configuration setting\",\"yarn config unset packageExtensions\"],[\"Unset a nested configuration setting\",\"yarn config unset npmScopes.company.npmRegistryServer\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt(\"This command must be run from within a project folder\");return r.projectCwd},a=this.name.replace(/[.[].*$/,\"\"),n=this.name.replace(/^[^.[]*\\.?/,\"\");if(typeof r.settings.get(a)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${a}\"`);let f=this.home?h=>ze.updateHomeConfiguration(h):h=>ze.updateConfiguration(s(),h);return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await f(C=>{if(!vB(C,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,C;let S=n?f0(C):{...C};return A0(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();Dt();Yt();var tF=Ie(\"util\"),fC=class extends ft{constructor(){super(...arguments);this.noDefaults=ge.Boolean(\"--no-defaults\",!1,{description:\"Omit the default values from the display\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.verbose=ge.Boolean(\"-v,--verbose\",{hidden:!0});this.why=ge.Boolean(\"--why\",{hidden:!0});this.names=ge.Rest()}static{this.paths=[[\"config\"]]}static{this.usage=ot.Usage({description:\"display the current configuration\",details:`\n      This command prints the current active configuration settings.\n    `,examples:[[\"Print the active configuration settings\",\"$0 config\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins,{strict:!1}),s=await SI({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:\"The --verbose option is deprecated, the settings' descriptions are now always displayed\"},{option:this.why,message:\"The --why option is deprecated, the settings' sources are now always displayed\"}]);if(s!==null)return s;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async f=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)f.reportError(34,`Invalid configuration key \"${p}\" in ${h}`);f.reportSeparator()}if(this.json)for(let p of a){if(this.noDefaults&&!r.sources.has(p))continue;let h=r.settings.get(p);typeof h>\"u\"&&f.reportError(34,`No configuration key named \"${p}\"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),C=r.sources.get(p)??\"<default>\",S=C&&C[0]!==\"<\"?fe.fromPortablePath(C):C;f.reportJson({key:p,effective:E,source:S,...h})}else{let p={breakLength:1/0,colors:r.get(\"enableColors\"),maxArrayLength:2},h={},E={children:h};for(let C of a){if(this.noDefaults&&!r.sources.has(C))continue;let S=r.settings.get(C),P=r.sources.get(C)??\"<default>\",I=r.getSpecial(C,{hideSecrets:!0,getNativePaths:!0}),R={Description:{label:\"Description\",value:he.tuple(he.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:\"Source\",value:he.tuple(P[0]===\"<\"?he.Type.CODE:he.Type.PATH,P)}};h[C]={value:he.tuple(he.Type.CODE,C),children:R};let N=(U,W)=>{for(let[ee,ie]of W)if(ie instanceof Map){let ue={};U[ee]={children:ue},N(ue,ie)}else U[ee]={label:ee,value:he.tuple(he.Type.NO_HINT,(0,tF.inspect)(ie,p))}};I instanceof Map?N(R,I):R.Value={label:\"Value\",value:he.tuple(he.Type.NO_HINT,(0,tF.inspect)(I,p))}}a.length!==1&&(n=void 0),xs.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<\"u\"){let f=a[0],p=(0,tF.inspect)(r.getSpecial(f,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get(\"enableColors\")});this.context.stdout.write(`\n`),this.context.stdout.write(`${p}\n`)}return c.exitCode()}};Ge();Yt();Ul();var rF={};Vt(rF,{Strategy:()=>Xv,acceptedStrategies:()=>jlt,dedupe:()=>z5});Ge();Ge();var gye=ut(Go()),Xv=(e=>(e.HIGHEST=\"highest\",e))(Xv||{}),jlt=new Set(Object.values(Xv)),Glt={highest:async(t,e,{resolver:r,fetcher:s,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[p,h]of t.storedResolutions){let E=t.storedDescriptors.get(p);if(typeof E>\"u\")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);je.getSetWithDefault(c,E.identHash).add(h)}let f=new Map(je.mapAndFilter(t.storedDescriptors.values(),p=>G.isVirtualDescriptor(p)?je.mapAndFilter.skip:[p.descriptorHash,je.makeDeferred()]));for(let p of t.storedDescriptors.values()){let h=f.get(p.descriptorHash);if(typeof h>\"u\")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=t.storedResolutions.get(p.descriptorHash);if(typeof E>\"u\")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let C=t.originalPackages.get(E);if(typeof C>\"u\")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let S=r.getResolutionDependencies(p,a),P=Object.fromEntries(await je.allSettledSafe(Object.entries(S).map(async([ee,ie])=>{let ue=f.get(ie.descriptorHash);if(typeof ue>\"u\")throw new Error(`Assertion failed: The descriptor (${ie.descriptorHash}) should have been registered`);let le=await ue.promise;if(!le)throw new Error(\"Assertion failed: Expected the dependency to have been through the dedupe process itself\");return[ee,le.updatedPackage]})));if(e.length&&!gye.default.isMatch(G.stringifyIdent(p),e)||!r.shouldPersistResolution(C,a))return C;let I=c.get(p.identHash);if(typeof I>\"u\")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(I.size===1)return C;let R=[...I].map(ee=>{let ie=t.originalPackages.get(ee);if(typeof ie>\"u\")throw new Error(`Assertion failed: The package (${ee}) should have been registered`);return ie}),N=await r.getSatisfying(p,P,R,a),U=N.locators?.[0];if(typeof U>\"u\"||!N.sorted)return C;let W=t.originalPackages.get(U.locatorHash);if(typeof W>\"u\")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return W}).then(async S=>{let P=await t.preparePackage(S,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:C,updatedPackage:S,resolvedPackage:P})}).catch(S=>{h.reject(S)})}return[...f.values()].map(p=>p.promise)}};async function z5(t,{strategy:e,patterns:r,cache:s,report:a}){let{configuration:n}=t,c=new ki,f=n.makeResolver(),p=n.makeFetcher(),h={cache:s,checksums:t.storedChecksums,fetcher:p,project:t,report:c,cacheOptions:{skipIntegrityCheck:!0}},E={project:t,resolver:f,report:c,fetchOptions:h};return await a.startTimerPromise(\"Deduplication step\",async()=>{let C=Glt[e],S=await C(t,r,{resolver:f,resolveOptions:E,fetcher:p,fetchOptions:h}),P=Ao.progressViaCounter(S.length);await a.reportProgress(P);let I=0;await Promise.all(S.map(U=>U.then(W=>{if(W===null||W.currentPackage.locatorHash===W.updatedPackage.locatorHash)return;I++;let{descriptor:ee,currentPackage:ie,updatedPackage:ue}=W;a.reportInfo(0,`${G.prettyDescriptor(n,ee)} can be deduped from ${G.prettyLocator(n,ie)} to ${G.prettyLocator(n,ue)}`),a.reportJson({descriptor:G.stringifyDescriptor(ee),currentResolution:G.stringifyLocator(ie),updatedResolution:G.stringifyLocator(ue)}),t.storedResolutions.set(ee.descriptorHash,ue.locatorHash)}).finally(()=>P.tick())));let R;switch(I){case 0:R=\"No packages\";break;case 1:R=\"One package\";break;default:R=`${I} packages`}let N=he.pretty(n,e,he.Type.CODE);return a.reportInfo(0,`${R} can be deduped using the ${N} strategy`),I})}var AC=class extends ft{constructor(){super(...arguments);this.strategy=ge.String(\"-s,--strategy\",\"highest\",{description:\"The strategy to use when deduping dependencies\",validator:fo(Xv)});this.check=ge.Boolean(\"-c,--check\",!1,{description:\"Exit with exit code 1 when duplicates are found, without persisting the dependency tree\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"dedupe\"]]}static{this.usage=ot.Usage({description:\"deduplicate dependencies with overlapping ranges\",details:\"\\n      Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\\n\\n      This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\\n\\n      - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. It's also guaranteed that it never takes more than a single pass to dedupe the entire dependency tree.\\n\\n      **Note:** Even though it never produces a wrong dependency tree, this command should be used with caution, as it modifies the dependency tree, which can sometimes cause problems when packages don't strictly follow semver recommendations. Because of this, it is recommended to also review the changes manually.\\n\\n      If set, the `-c,--check` flag will only report the found duplicates, without persisting the modified dependency tree. If changes are found, the command will exit with a non-zero exit code, making it suitable for CI purposes.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\\n\\n      ### In-depth explanation:\\n\\n      Yarn doesn't deduplicate dependencies by default, otherwise installs wouldn't be deterministic and the lockfile would be useless. What it actually does is that it tries to not duplicate dependencies in the first place.\\n\\n      **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@*`will cause Yarn to reuse `foo@2.3.4`, even if the latest `foo` is actually `foo@2.10.14`, thus preventing unnecessary duplication.\\n\\n      Duplication happens when Yarn can't unlock dependencies that have already been locked inside the lockfile.\\n\\n      **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@2.10.14` will cause Yarn to install `foo@2.10.14` because the existing resolution doesn't satisfy the range `2.10.14`. This behavior can lead to (sometimes) unwanted duplication, since now the lockfile contains 2 separate resolutions for the 2 `foo` descriptors, even though they have overlapping ranges, which means that the lockfile can be simplified so that both descriptors resolve to `foo@2.10.14`.\\n    \",examples:[[\"Dedupe all packages\",\"$0 dedupe\"],[\"Dedupe all packages using a specific strategy\",\"$0 dedupe --strategy highest\"],[\"Dedupe a specific package\",\"$0 dedupe lodash\"],[\"Dedupe all packages with the `@babel/*` scope\",\"$0 dedupe '@babel/*'\"],[\"Check for duplicates (can be used as a CI step)\",\"$0 dedupe --check\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),a=await Kr.find(r);await s.restoreInstallState({restoreResolutions:!1});let n=0,c=await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout,json:this.json},async f=>{n=await z5(s,{strategy:this.strategy,patterns:this.patterns,cache:a,report:f})});return c.hasErrors()?c.exitCode():this.check?n?1:0:await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:a,mode:this.mode})}};Ge();Yt();var pC=class extends ft{static{this.paths=[[\"--clipanion=definitions\"]]}async execute(){let{plugins:e}=await ze.find(this.context.cwd,this.context.plugins),r=[];for(let c of e){let{commands:f}=c[1];if(f){let h=Ca.from(f).definitions();r.push([c[0],h])}}let s=this.cli.definitions(),a=(c,f)=>c.split(\" \").slice(1).join()===f.split(\" \").slice(1).join(),n=dye()[\"@yarnpkg/builder\"].bundles.standard;for(let c of r){let f=c[1];for(let p of f)s.find(h=>a(h.path,p.path)).plugin={name:c[0],isDefault:n.includes(c[0])}}this.context.stdout.write(`${JSON.stringify(s,null,2)}\n`)}};var hC=class extends ft{static{this.paths=[[\"help\"],[\"--help\"],[\"-h\"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();Dt();Yt();var gC=class extends ft{constructor(){super(...arguments);this.leadingArgument=ge.String();this.args=ge.Proxy()}async execute(){if(this.leadingArgument.match(/[\\\\/]/)&&!G.tryParseIdent(this.leadingArgument)){let r=J.resolve(this.context.cwd,fe.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run([\"run\",this.leadingArgument,...this.args])}};Ge();var dC=class extends ft{static{this.paths=[[\"-v\"],[\"--version\"]]}async execute(){this.context.stdout.write(`${fn||\"<unknown>\"}\n`)}};Ge();Ge();Yt();var mC=class extends ft{constructor(){super(...arguments);this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"exec\"]]}static{this.usage=ot.Usage({description:\"execute a shell script\",details:`\n      This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.\n\n      It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).\n    `,examples:[[\"Execute a single shell command\",\"$0 exec echo Hello World\"],[\"Execute a shell script\",'$0 exec \"tsc & babel src --out-dir lib\"']]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState(),await In.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:s})}};Ge();Yt();Ul();var yC=class extends ft{constructor(){super(...arguments);this.hash=ge.String({required:!1,validator:Nx(wE(),[Z2(/^p[0-9a-f]{6}$/)])})}static{this.paths=[[\"explain\",\"peer-requirements\"]]}static{this.usage=ot.Usage({description:\"explain a set of peer requirements\",details:`\n      A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.\n\n      When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.\n\n      When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.\n\n      **Note:** A hash is a seven-letter code consisting of the letter 'p' followed by six characters that can be obtained from peer dependency warnings or from the list of all peer requirements(\\`yarn explain peer-requirements\\`).\n    `,examples:[[\"Explain the corresponding peer requirement for a hash\",\"$0 explain peer-requirements p1a4ed\"],[\"List all peer requirements\",\"$0 explain peer-requirements\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<\"u\"?await Wlt(this.hash,s,{stdout:this.context.stdout}):await Ylt(s,{stdout:this.context.stdout})}};async function Wlt(t,e,r){let s=e.peerRequirementNodes.get(t);if(typeof s>\"u\")throw new Error(`No peerDependency requirements found for hash: \"${t}\"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:he.tuple(he.Type.NO_HINT,\"...\")}]:[]}:(a.add(p.requester.locatorHash),{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[G.stringifyLocator(h.requester),n(h)]))}),c=e.peerWarnings.find(p=>p.hash===t);return(await Ot.start({configuration:e.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=he.mark(e.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} is requested to provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,he.pretty(e.configuration,s.subject,he.Type.LOCATOR)),xs.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[G.stringifyLocator(C.requester),n(C)]))},{configuration:e.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),s.provided.range===\"missing:\"){let C=c?\"\":\" , but all peer requests are optional\";p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} does not provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)}${C}.`)}else{let C=e.storedResolutions.get(s.provided.descriptorHash);if(!C)throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let S=e.storedPackages.get(C);if(!S)throw new Error(\"Assertion failed: Expected the package to be registered\");p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} provides ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} with version ${G.prettyReference(e.configuration,S.version??\"0.0.0\")}, ${c?\"which does not satisfy all requests.\":\"which satisfies all requests\"}`),c?.type===3&&(c.range?p.reportInfo(0,`  The combined requested range is ${he.pretty(e.configuration,c.range,he.Type.RANGE)}`):p.reportInfo(0,\"  Unfortunately, the requested ranges have no overlap\"))}})).exitCode()}async function Ylt(t,e){return(await Ot.start({configuration:t.configuration,stdout:e.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=he.mark(t.configuration),n=je.sortMap(t.peerRequirementNodes,[([,c])=>G.stringifyLocator(c.subject),([,c])=>G.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=t.peerWarnings.find(E=>E.hash===c.hash),p=[...G.allPeerRequests(c)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=\" and 1 other dependency\":h=\"\",c.provided.range!==\"missing:\"){let E=t.storedResolutions.get(c.provided.descriptorHash);if(!E)throw new Error(\"Assertion failed: Expected the resolution to have been registered\");let C=t.storedPackages.get(E);if(!C)throw new Error(\"Assertion failed: Expected the provided package to have been registered\");let S=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \\u2192 ${f?a.Cross:a.Check} ${G.prettyLocator(t.configuration,c.subject)} provides ${G.prettyLocator(t.configuration,C)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \\u2192 ${f?a.Cross:a.Check} ${G.prettyLocator(t.configuration,c.subject)} doesn't provide ${G.prettyIdent(t.configuration,c.ident)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,E):s.reportInfo(0,E)}}})).exitCode()}Ge();Yt();Ul();Ge();Ge();Dt();Yt();var mye=ut(Ai()),EC=class extends ft{constructor(){super(...arguments);this.useYarnPath=ge.Boolean(\"--yarn-path\",{description:\"Set the yarnPath setting even if the version can be accessed by Corepack\"});this.onlyIfNeeded=ge.Boolean(\"--only-if-needed\",!1,{description:\"Only lock the Yarn version if it isn't already locked\"});this.version=ge.String()}static{this.paths=[[\"set\",\"version\"]]}static{this.usage=ot.Usage({description:\"lock the Yarn version used by the project\",details:\"\\n      This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\\n\\n      By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set the `--yarn-path` command line flag, then the release will also be downloaded from the Yarn GitHub repository, stored inside your project, and referenced via the `yarnPath` settings from your project `.yarnrc.yml` file.\\n\\n      A very good use case for this command is to enforce the version of Yarn used by any single member of your team inside the same project - by doing this you ensure that you have control over Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting different behavior.\\n\\n      The version specifier can be:\\n\\n      - a tag:\\n        - `latest` / `berry` / `stable` -> the most recent stable berry (`>=2.0.0`) release\\n        - `canary` -> the most recent canary (release candidate) berry (`>=2.0.0`) release\\n        - `classic` -> the most recent classic (`^0.x || ^1.x`) release\\n\\n      - a semver range (e.g. `2.x`) -> the most recent version satisfying the range (limited to berry releases)\\n\\n      - a semver version (e.g. `2.4.1`, `1.22.1`)\\n\\n      - a local file referenced through either a relative or absolute path\\n\\n      - `self` -> the version used to invoke the command\\n    \",examples:[[\"Download the latest release from the Yarn repository\",\"$0 set version latest\"],[\"Download the latest canary release from the Yarn repository\",\"$0 set version canary\"],[\"Download the latest classic release from the Yarn repository\",\"$0 set version classic\"],[\"Download the most recent Yarn 3 build\",\"$0 set version 3.x\"],[\"Download a specific Yarn 2 build\",\"$0 set version 2.0.0-rc.30\"],[\"Switch back to a specific Yarn 1 release\",\"$0 set version 1.22.1\"],[\"Use a release from the local filesystem\",\"$0 set version ./yarn.cjs\"],[\"Use a release from a URL\",\"$0 set version https://repo.yarnpkg.com/3.1.0/packages/yarnpkg-cli/bin/yarn.js\"],[\"Download the version used to invoke the command\",\"$0 set version self\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(this.onlyIfNeeded&&r.get(\"yarnPath\")){let f=r.sources.get(\"yarnPath\");if(!f)throw new Error(\"Assertion failed: Expected 'yarnPath' to have a source\");let p=r.projectCwd??r.startingCwd;if(J.contains(p,f))return 0}let s=()=>{if(typeof fn>\"u\")throw new nt(\"The --install flag can only be used without explicit version specifier from the Yarn CLI\");return`file://${process.argv[1]}`},a,n=(f,p)=>({version:p,url:f.replace(/\\{\\}/g,p)});if(this.version===\"self\")a={url:s(),version:fn??\"self\"};else if(this.version===\"latest\"||this.version===\"berry\"||this.version===\"stable\")a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Zv(r,\"stable\"));else if(this.version===\"canary\")a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Zv(r,\"canary\"));else if(this.version===\"classic\")a={url:\"https://classic.yarnpkg.com/latest.js\",version:\"classic\"};else if(this.version.match(/^https?:/))a={url:this.version,version:\"remote\"};else if(this.version.match(/^\\.{0,2}[\\\\/]/)||fe.isAbsolute(this.version))a={url:`file://${J.resolve(fe.toPortablePath(this.version))}`,version:\"file\"};else if(Fr.satisfiesWithPrereleases(this.version,\">=2.0.0\"))a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",this.version);else if(Fr.satisfiesWithPrereleases(this.version,\"^0.x || ^1.x\"))a=n(\"https://github.com/yarnpkg/yarn/releases/download/v{}/yarn-{}.js\",this.version);else if(Fr.validRange(this.version))a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Vlt(r,this.version));else throw new nt(`Invalid version descriptor \"${this.version}\"`);return(await Ot.start({configuration:r,stdout:this.context.stdout,includeLogs:!this.context.quiet},async f=>{let p=async()=>{let h=\"file://\";return a.url.startsWith(h)?(f.reportInfo(0,`Retrieving ${he.pretty(r,a.url,he.Type.PATH)}`),await ce.readFilePromise(a.url.slice(h.length))):(f.reportInfo(0,`Downloading ${he.pretty(r,a.url,he.Type.URL)}`),await nn.get(a.url,{configuration:r}))};await X5(r,a.version,p,{report:f,useYarnPath:this.useYarnPath})})).exitCode()}};async function Vlt(t,e){let s=(await nn.get(\"https://repo.yarnpkg.com/tags\",{configuration:t,jsonResponse:!0})).tags.filter(a=>Fr.satisfiesWithPrereleases(a,e));if(s.length===0)throw new nt(`No matching release found for range ${he.pretty(t,e,he.Type.RANGE)}.`);return s[0]}async function Zv(t,e){let r=await nn.get(\"https://repo.yarnpkg.com/tags\",{configuration:t,jsonResponse:!0});if(!r.latest[e])throw new nt(`Tag ${he.pretty(t,e,he.Type.RANGE)} not found`);return r.latest[e]}async function X5(t,e,r,{report:s,useYarnPath:a}){let n,c=async()=>(typeof n>\"u\"&&(n=await r()),n);if(e===null){let ee=await c();await ce.mktempPromise(async ie=>{let ue=J.join(ie,\"yarn.cjs\");await ce.writeFilePromise(ue,ee);let{stdout:le}=await qr.execvp(process.execPath,[fe.fromPortablePath(ue),\"--version\"],{cwd:ie,env:{...t.env,YARN_IGNORE_PATH:\"1\"}});if(e=le.trim(),!mye.default.valid(e))throw new Error(`Invalid semver version. ${he.pretty(t,\"yarn --version\",he.Type.CODE)} returned:\n${e}`)})}let f=t.projectCwd??t.startingCwd,p=J.resolve(f,\".yarn/releases\"),h=J.resolve(p,`yarn-${e}.cjs`),E=J.relative(t.startingCwd,h),C=je.isTaggedYarnVersion(e),S=t.get(\"yarnPath\"),P=!C,I=P||!!S||!!a;if(a===!1){if(P)throw new jt(0,\"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack\");I=!1}else!I&&!process.env.COREPACK_ROOT&&(s.reportWarning(0,`You don't seem to have ${he.applyHyperlink(t,\"Corepack\",\"https://nodejs.org/api/corepack.html\")} enabled; we'll have to rely on ${he.applyHyperlink(t,\"yarnPath\",\"https://yarnpkg.com/configuration/yarnrc#yarnPath\")} instead`),I=!0);if(I){let ee=await c();s.reportInfo(0,`Saving the new release in ${he.pretty(t,E,\"magenta\")}`),await ce.removePromise(J.dirname(h)),await ce.mkdirPromise(J.dirname(h),{recursive:!0}),await ce.writeFilePromise(h,ee,{mode:493}),await ze.updateConfiguration(f,{yarnPath:J.relative(f,h)})}else await ce.removePromise(J.dirname(h)),await ze.updateConfiguration(f,{yarnPath:ze.deleteProperty});let R=await Ut.tryFind(f)||new Ut;R.packageManager=`yarn@${C?e:await Zv(t,\"stable\")}`;let N={};R.exportTo(N);let U=J.join(f,Ut.fileName),W=`${JSON.stringify(N,null,R.indent)}\n`;return await ce.changeFilePromise(U,W,{automaticNewlines:!0}),{bundleVersion:e}}function yye(t){return Br[jx(t)]}var Jlt=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\\n\\n(?<details>(?:.(?!##))+)/gs;async function Klt(t){let r=`https://repo.yarnpkg.com/${je.isTaggedYarnVersion(fn)?fn:await Zv(t,\"canary\")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,s=await nn.get(r,{configuration:t});return new Map(Array.from(s.toString().matchAll(Jlt),({groups:a})=>{if(!a)throw new Error(\"Assertion failed: Expected the match to have been successful\");let n=yye(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected \"${a.name}\" to be named \"${n}\"`);return[a.code,a.details]}))}var IC=class extends ft{constructor(){super(...arguments);this.code=ge.String({required:!1,validator:$2(wE(),[Z2(/^YN[0-9]{4}$/)])});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"explain\"]]}static{this.usage=ot.Usage({description:\"explain an error code\",details:`\n      When the code argument is specified, this command prints its name and its details.\n\n      When used without arguments, this command lists all error codes and their names.\n    `,examples:[[\"Explain an error code\",\"$0 explain YN0006\"],[\"List all error codes\",\"$0 explain\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(typeof this.code<\"u\"){let s=yye(this.code),a=he.pretty(r,s,he.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await Klt(r)).get(this.code),p=typeof f<\"u\"?he.jsonOrPretty(this.json,r,he.tuple(he.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.\n\nYou can help us by editing this page on GitHub \\u{1F642}:\n${he.jsonOrPretty(this.json,r,he.tuple(he.Type.URL,\"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx\"))}\n`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:s,details:p})}\n`):this.context.stdout.write(`${n}\n\n${p}\n`)}else{let s={children:je.mapAndFilter(Object.entries(Br),([a,n])=>Number.isNaN(Number(a))?je.mapAndFilter.skip:{label:Yf(Number(a)),value:he.tuple(he.Type.CODE,n)})};xs.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();Dt();Yt();var Eye=ut(Go()),CC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Print versions of a package from the whole project\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Print information for all packages, including transitive dependencies\"});this.extra=ge.Array(\"-X,--extra\",[],{description:\"An array of requests of extra data provided by plugins\"});this.cache=ge.Boolean(\"--cache\",!1,{description:\"Print information about the cache entry of a package (path, size, checksum)\"});this.dependents=ge.Boolean(\"--dependents\",!1,{description:\"Print all dependents for each matching package\"});this.manifest=ge.Boolean(\"--manifest\",!1,{description:\"Print data obtained by looking at the package archive (license, homepage, ...)\"});this.nameOnly=ge.Boolean(\"--name-only\",!1,{description:\"Only print the name for the matching packages\"});this.virtuals=ge.Boolean(\"--virtuals\",!1,{description:\"Print each instance of the virtual packages\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.patterns=ge.Rest()}static{this.paths=[[\"info\"]]}static{this.usage=ot.Usage({description:\"see information related to packages\",details:\"\\n      This command prints various information related to the specified packages, accepting glob patterns.\\n\\n      By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\\n\\n      Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\\n\\n      Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\\n    \",examples:[[\"Show information about Lodash\",\"$0 info lodash\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a&&!this.all)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add(\"cache\"),this.dependents&&c.add(\"dependents\"),this.manifest&&c.add(\"manifest\");let f=(ie,{recursive:ue})=>{let le=ie.anchoredLocator.locatorHash,me=new Map,pe=[le];for(;pe.length>0;){let Be=pe.shift();if(me.has(Be))continue;let Ce=s.storedPackages.get(Be);if(typeof Ce>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");if(me.set(Be,Ce),G.isVirtualLocator(Ce)&&pe.push(G.devirtualizeLocator(Ce).locatorHash),!(!ue&&Be!==le))for(let g of Ce.dependencies.values()){let we=s.storedResolutions.get(g.descriptorHash);if(typeof we>\"u\")throw new Error(\"Assertion failed: Expected the resolution to be registered\");pe.push(we)}}return me.values()},p=({recursive:ie})=>{let ue=new Map;for(let le of s.workspaces)for(let me of f(le,{recursive:ie}))ue.set(me.locatorHash,me);return ue.values()},h=({all:ie,recursive:ue})=>ie&&ue?s.storedPackages.values():ie?p({recursive:ue}):f(a,{recursive:ue}),E=({all:ie,recursive:ue})=>{let le=h({all:ie,recursive:ue}),me=this.patterns.map(Ce=>{let g=G.parseLocator(Ce),we=Eye.default.makeRe(G.stringifyIdent(g)),ye=G.isVirtualLocator(g),Ae=ye?G.devirtualizeLocator(g):g;return se=>{let Z=G.stringifyIdent(se);if(!we.test(Z))return!1;if(g.reference===\"unknown\")return!0;let De=G.isVirtualLocator(se),Re=De?G.devirtualizeLocator(se):se;return!(ye&&De&&g.reference!==se.reference||Ae.reference!==Re.reference)}}),pe=je.sortMap([...le],Ce=>G.stringifyLocator(Ce));return{selection:pe.filter(Ce=>me.length===0||me.some(g=>g(Ce))),sortedLookup:pe}},{selection:C,sortedLookup:S}=E({all:this.all,recursive:this.recursive});if(C.length===0)throw new nt(\"No package matched your request\");let P=new Map;if(this.dependents)for(let ie of S)for(let ue of ie.dependencies.values()){let le=s.storedResolutions.get(ue.descriptorHash);if(typeof le>\"u\")throw new Error(\"Assertion failed: Expected the resolution to be registered\");je.getArrayWithDefault(P,le).push(ie)}let I=new Map;for(let ie of S){if(!G.isVirtualLocator(ie))continue;let ue=G.devirtualizeLocator(ie);je.getArrayWithDefault(I,ue.locatorHash).push(ie)}let R={},N={children:R},U=r.makeFetcher(),W={project:s,fetcher:U,cache:n,checksums:s.storedChecksums,report:new ki,cacheOptions:{skipIntegrityCheck:!0}},ee=[async(ie,ue,le)=>{if(!ue.has(\"manifest\"))return;let me=await U.fetch(ie,W),pe;try{pe=await Ut.find(me.prefixPath,{baseFs:me.packageFs})}finally{me.releaseFs?.()}le(\"Manifest\",{License:he.tuple(he.Type.NO_HINT,pe.license),Homepage:he.tuple(he.Type.URL,pe.raw.homepage??null)})},async(ie,ue,le)=>{if(!ue.has(\"cache\"))return;let me=s.storedChecksums.get(ie.locatorHash)??null,pe=n.getLocatorPath(ie,me),Be;if(pe!==null)try{Be=await ce.statPromise(pe)}catch{}let Ce=typeof Be<\"u\"?[Be.size,he.Type.SIZE]:void 0;le(\"Cache\",{Checksum:he.tuple(he.Type.NO_HINT,me),Path:he.tuple(he.Type.PATH,pe),Size:Ce})}];for(let ie of C){let ue=G.isVirtualLocator(ie);if(!this.virtuals&&ue)continue;let le={},me={value:[ie,he.Type.LOCATOR],children:le};if(R[G.stringifyLocator(ie)]=me,this.nameOnly){delete me.children;continue}let pe=I.get(ie.locatorHash);typeof pe<\"u\"&&(le.Instances={label:\"Instances\",value:he.tuple(he.Type.NUMBER,pe.length)}),le.Version={label:\"Version\",value:he.tuple(he.Type.NO_HINT,ie.version)};let Be=(g,we)=>{let ye={};if(le[g]=ye,Array.isArray(we))ye.children=we.map(Ae=>({value:Ae}));else{let Ae={};ye.children=Ae;for(let[se,Z]of Object.entries(we))typeof Z>\"u\"||(Ae[se]={label:se,value:Z})}};if(!ue){for(let g of ee)await g(ie,c,Be);await r.triggerHook(g=>g.fetchPackageInfo,ie,c,Be)}ie.bin.size>0&&!ue&&Be(\"Exported Binaries\",[...ie.bin.keys()].map(g=>he.tuple(he.Type.PATH,g)));let Ce=P.get(ie.locatorHash);typeof Ce<\"u\"&&Ce.length>0&&Be(\"Dependents\",Ce.map(g=>he.tuple(he.Type.LOCATOR,g))),ie.dependencies.size>0&&!ue&&Be(\"Dependencies\",[...ie.dependencies.values()].map(g=>{let we=s.storedResolutions.get(g.descriptorHash),ye=typeof we<\"u\"?s.storedPackages.get(we)??null:null;return he.tuple(he.Type.RESOLUTION,{descriptor:g,locator:ye})})),ie.peerDependencies.size>0&&ue&&Be(\"Peer dependencies\",[...ie.peerDependencies.values()].map(g=>{let we=ie.dependencies.get(g.identHash),ye=typeof we<\"u\"?s.storedResolutions.get(we.descriptorHash)??null:null,Ae=ye!==null?s.storedPackages.get(ye)??null:null;return he.tuple(he.Type.RESOLUTION,{descriptor:g,locator:Ae})}))}xs.emitTree(N,{configuration:r,json:this.json,stdout:this.context.stdout,separators:this.nameOnly?0:2})}};Ge();Dt();wc();var nF=ut(Fd());Yt();var Z5=ut(Ai());Ul();var zlt=[{selector:t=>t===-1,name:\"nodeLinker\",value:\"node-modules\"},{selector:t=>t!==-1&&t<8,name:\"enableGlobalCache\",value:!1},{selector:t=>t!==-1&&t<8,name:\"compressionLevel\",value:\"mixed\"}],wC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.immutable=ge.Boolean(\"--immutable\",{description:\"Abort with an error exit code if the lockfile was to be modified\"});this.immutableCache=ge.Boolean(\"--immutable-cache\",{description:\"Abort with an error exit code if the cache folder was to be modified\"});this.refreshLockfile=ge.Boolean(\"--refresh-lockfile\",{description:\"Refresh the package metadata stored in the lockfile\"});this.checkCache=ge.Boolean(\"--check-cache\",{description:\"Always refetch the packages and ensure that their checksums are consistent\"});this.checkResolutions=ge.Boolean(\"--check-resolutions\",{description:\"Validates that the package resolutions are coherent\"});this.inlineBuilds=ge.Boolean(\"--inline-builds\",{description:\"Verbosely print the output of the build steps of dependencies\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.cacheFolder=ge.String(\"--cache-folder\",{hidden:!0});this.frozenLockfile=ge.Boolean(\"--frozen-lockfile\",{hidden:!0});this.ignoreEngines=ge.Boolean(\"--ignore-engines\",{hidden:!0});this.nonInteractive=ge.Boolean(\"--non-interactive\",{hidden:!0});this.preferOffline=ge.Boolean(\"--prefer-offline\",{hidden:!0});this.production=ge.Boolean(\"--production\",{hidden:!0});this.registry=ge.String(\"--registry\",{hidden:!0});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.networkTimeout=ge.String(\"--network-timeout\",{hidden:!0})}static{this.paths=[[\"install\"],ot.Default]}static{this.usage=ot.Usage({description:\"install the project dependencies\",details:\"\\n      This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:\\n\\n      - **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).\\n\\n      - **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of `cacheFolder` in `yarn config` to see where the cache files are stored).\\n\\n      - **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the `.pnp.cjs` file you might know).\\n\\n      - **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.\\n\\n      Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your `.pnp.cjs` file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.\\n\\n      If the `--immutable` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the `immutablePatterns` configuration setting). For backward compatibility we offer an alias under the name of `--frozen-lockfile`, but it will be removed in a later release.\\n\\n      If the `--immutable-cache` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).\\n\\n      If the `--refresh-lockfile` option is set, Yarn will keep the same resolution for the packages currently in the lockfile but will refresh their metadata. If used together with `--immutable`, it can validate that the lockfile information are consistent. This flag is enabled by default when Yarn detects it runs within a pull request context.\\n\\n      If the `--check-cache` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.\\n\\n      If the `--inline-builds` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n    \",examples:[[\"Install the project\",\"$0 install\"],[\"Validate a project when using Zero-Installs\",\"$0 install --immutable --immutable-cache\"],[\"Validate a project when using Zero-Installs (slightly safer if you accept external PRs)\",\"$0 install --immutable --immutable-cache --check-cache\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);typeof this.inlineBuilds<\"u\"&&r.useWithSource(\"<cli>\",{enableInlineBuilds:this.inlineBuilds},r.startingCwd,{overwrite:!0});let s=!!process.env.FUNCTION_TARGET||!!process.env.GOOGLE_RUNTIME,a=await SI({configuration:r,stdout:this.context.stdout},[{option:this.ignoreEngines,message:\"The --ignore-engines option is deprecated; engine checking isn't a core feature anymore\",error:!nF.default.VERCEL},{option:this.registry,message:\"The --registry option is deprecated; prefer setting npmRegistryServer in your .yarnrc.yml file\"},{option:this.preferOffline,message:\"The --prefer-offline flag is deprecated; use the --cached flag with 'yarn add' instead\",error:!nF.default.VERCEL},{option:this.production,message:\"The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead\",error:!0},{option:this.nonInteractive,message:\"The --non-interactive option is deprecated\",error:!s},{option:this.frozenLockfile,message:\"The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead\",callback:()=>this.immutable=this.frozenLockfile},{option:this.cacheFolder,message:\"The cache-folder option has been deprecated; use rc settings instead\",error:!nF.default.NETLIFY}]);if(a!==null)return a;let n=this.mode===\"update-lockfile\";if(n&&(this.immutable||this.immutableCache))throw new nt(`${he.pretty(r,\"--immutable\",he.Type.CODE)} and ${he.pretty(r,\"--immutable-cache\",he.Type.CODE)} cannot be used with ${he.pretty(r,\"--mode=update-lockfile\",he.Type.CODE)}`);let c=(this.immutable??r.get(\"enableImmutableInstalls\"))&&!n,f=this.immutableCache&&!n;if(r.projectCwd!==null){let R=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U=!1;await $lt(r,c)&&(N.reportInfo(48,\"Automatically removed core plugins that are now builtins \\u{1F44D}\"),U=!0),await Zlt(r,c)&&(N.reportInfo(48,\"Automatically fixed merge conflicts \\u{1F44D}\"),U=!0),U&&N.reportSeparator()});if(R.hasErrors())return R.exitCode()}if(r.projectCwd!==null){let R=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{if(ze.telemetry?.isNew)ze.telemetry.commitTips(),N.reportInfo(65,\"Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry\"),N.reportInfo(65,`Run ${he.pretty(r,\"yarn config set --home enableTelemetry 0\",he.Type.CODE)} to disable`),N.reportSeparator();else if(ze.telemetry?.shouldShowTips){let U=await nn.get(\"https://repo.yarnpkg.com/tags\",{configuration:r,jsonResponse:!0}).catch(()=>null);if(U!==null){let W=null;if(fn!==null){let ie=Z5.default.prerelease(fn)?\"canary\":\"stable\",ue=U.latest[ie];Z5.default.gt(ue,fn)&&(W=[ie,ue])}if(W)ze.telemetry.commitTips(),N.reportInfo(88,`${he.applyStyle(r,`A new ${W[0]} version of Yarn is available:`,he.Style.BOLD)} ${G.prettyReference(r,W[1])}!`),N.reportInfo(88,`Upgrade now by running ${he.pretty(r,`yarn set version ${W[1]}`,he.Type.CODE)}`),N.reportSeparator();else{let ee=ze.telemetry.selectTip(U.tips);ee&&(N.reportInfo(89,he.pretty(r,ee.message,he.Type.MARKDOWN_INLINE)),ee.url&&N.reportInfo(89,`Learn more at ${ee.url}`),N.reportSeparator())}}}});if(R.hasErrors())return R.exitCode()}let{project:p,workspace:h}=await Tt.find(r,this.context.cwd),E=p.lockfileLastVersion;if(E!==null){let R=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U={};for(let W of zlt)W.selector(E)&&typeof r.sources.get(W.name)>\"u\"&&(r.use(\"<compat>\",{[W.name]:W.value},p.cwd,{overwrite:!0}),U[W.name]=W.value);Object.keys(U).length>0&&(await ze.updateConfiguration(p.cwd,U),N.reportInfo(87,\"Migrated your project to the latest Yarn version \\u{1F680}\"),N.reportSeparator())});if(R.hasErrors())return R.exitCode()}let C=await Kr.find(r,{immutable:f,check:this.checkCache});if(!h)throw new ar(p.cwd,this.context.cwd);await p.restoreInstallState({restoreResolutions:!1});let S=r.get(\"enableHardenedMode\");S&&typeof r.sources.get(\"enableHardenedMode\")>\"u\"&&await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async R=>{R.reportWarning(0,\"Yarn detected that the current workflow is executed from a public pull request. For safety the hardened mode has been enabled.\"),R.reportWarning(0,`It will prevent malicious lockfile manipulations, in exchange for a slower install time. You can opt-out if necessary; check our ${he.applyHyperlink(r,\"documentation\",\"https://yarnpkg.com/features/security#hardened-mode\")} for more details.`),R.reportSeparator()}),(this.refreshLockfile??S)&&(p.lockfileNeedsRefresh=!0);let P=this.checkResolutions??S;return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,forceSectionAlignment:!0,includeLogs:!0,includeVersion:!0},async R=>{await p.install({cache:C,report:R,immutable:c,checkResolutions:P,mode:this.mode})})).exitCode()}},Xlt=\"<<<<<<<\";async function Zlt(t,e){if(!t.projectCwd)return!1;let r=J.join(t.projectCwd,Er.lockfile);if(!await ce.existsPromise(r)||!(await ce.readFilePromise(r,\"utf8\")).includes(Xlt))return!1;if(e)throw new jt(47,\"Cannot autofix a lockfile when running an immutable install\");let a=await qr.execvp(\"git\",[\"rev-parse\",\"MERGE_HEAD\",\"HEAD\"],{cwd:t.projectCwd});if(a.code!==0&&(a=await qr.execvp(\"git\",[\"rev-parse\",\"REBASE_HEAD\",\"HEAD\"],{cwd:t.projectCwd})),a.code!==0&&(a=await qr.execvp(\"git\",[\"rev-parse\",\"CHERRY_PICK_HEAD\",\"HEAD\"],{cwd:t.projectCwd})),a.code!==0)throw new jt(83,\"Git returned an error when trying to find the commits pertaining to the conflict\");let n=await Promise.all(a.stdout.trim().split(/\\n/).map(async f=>{let p=await qr.execvp(\"git\",[\"show\",`${f}:./${Er.lockfile}`],{cwd:t.projectCwd});if(p.code!==0)throw new jt(83,`Git returned an error when trying to access the lockfile content in ${f}`);try{return ls(p.stdout)}catch{throw new jt(46,\"A variant of the conflicting lockfile failed to parse\")}}));n=n.filter(f=>!!f.__metadata);for(let f of n){if(f.__metadata.version<7)for(let p of Object.keys(f)){if(p===\"__metadata\")continue;let h=G.parseDescriptor(p,!0),E=t.normalizeDependency(h),C=G.stringifyDescriptor(E);C!==p&&(f[C]=f[p],delete f[p])}for(let p of Object.keys(f)){if(p===\"__metadata\")continue;let h=f[p].checksum;typeof h>\"u\"||h.includes(\"/\")||(f[p].checksum=`${f.__metadata.cacheKey}/${h}`)}}let c=Object.assign({},...n);c.__metadata.version=`${Math.min(...n.map(f=>parseInt(f.__metadata.version??0)))}`,c.__metadata.cacheKey=\"merged\";for(let[f,p]of Object.entries(c))typeof p==\"string\"&&delete c[f];return await ce.changeFilePromise(r,nl(c),{automaticNewlines:!0}),!0}async function $lt(t,e){if(!t.projectCwd)return!1;let r=[],s=J.join(t.projectCwd,\".yarn/plugins/@yarnpkg\");return await ze.updateConfiguration(t.projectCwd,{plugins:n=>{if(!Array.isArray(n))return n;let c=n.filter(f=>{if(!f.path)return!0;let p=J.resolve(t.projectCwd,f.path),h=ov.has(f.spec)&&J.contains(s,p);return h&&r.push(p),!h});return c.length===0?ze.deleteProperty:c.length===n.length?n:c}},{immutable:e})?(await Promise.all(r.map(async n=>{await ce.removePromise(n)})),!0):!1}Ge();Dt();Yt();var BC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Link all workspaces belonging to the target projects to the current one\"});this.private=ge.Boolean(\"-p,--private\",!1,{description:\"Also link private workspaces belonging to the target projects to the current one\"});this.relative=ge.Boolean(\"-r,--relative\",!1,{description:\"Link workspaces using relative paths instead of absolute paths\"});this.destinations=ge.Rest()}static{this.paths=[[\"link\"]]}static{this.usage=ot.Usage({description:\"connect the local project to another one\",details:\"\\n      This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\\n    \",examples:[[\"Register one or more remote workspaces for use in the current project\",\"$0 link ~/ts-loader ~/jest\"],[\"Register all workspaces from a remote project for use in the current project\",\"$0 link ~/jest --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=s.topLevelWorkspace,f=[];for(let p of this.destinations){let h=J.resolve(this.context.cwd,fe.toPortablePath(p)),E=await ze.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Tt.find(E,h);if(s.cwd===C.cwd)throw new nt(`Invalid destination '${p}'; Can't link the project to itself`);if(!S)throw new ar(C.cwd,h);if(this.all){let P=!1;for(let I of C.workspaces)I.manifest.name&&(!I.manifest.private||this.private)&&(f.push(I),P=!0);if(!P)throw new nt(`No workspace found to be linked in the target project: ${p}`)}else{if(!S.manifest.name)throw new nt(`The target workspace at '${p}' doesn't have a name and thus cannot be linked`);if(S.manifest.private&&!this.private)throw new nt(`The target workspace at '${p}' is marked private - use the --private flag to link it anyway`);f.push(S)}}for(let p of f){let h=G.stringifyIdent(p.anchoredLocator),E=this.relative?J.relative(s.cwd,p.cwd):p.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${E}`})}return await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Yt();var vC=class extends ft{constructor(){super(...arguments);this.args=ge.Proxy()}static{this.paths=[[\"node\"]]}static{this.usage=ot.Usage({description:\"run node with the hook already setup\",details:`\n      This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).\n\n      The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.\n    `,examples:[[\"Run a Node script\",\"$0 node ./my-script.js\"]]})}async execute(){return this.cli.run([\"exec\",\"node\",...this.args])}};Ge();Yt();var SC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"check\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"find all third-party plugins that differ from their own spec\",details:`\n      Check only the plugins from https.\n\n      If this command detects any plugin differences in the CI environment, it will throw an error.\n    `,examples:[[\"find all third-party plugins that differ from their own spec\",\"$0 plugin check\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await ze.findRcFiles(this.context.cwd);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let c of s)if(c.data?.plugins)for(let f of c.data.plugins){if(!f.checksum||!f.spec.match(/^https?:/))continue;let p=await nn.get(f.spec,{configuration:r}),h=Nn.makeHash(p);if(f.checksum===h)continue;let E=he.pretty(r,f.path,he.Type.PATH),C=he.pretty(r,f.spec,he.Type.URL),S=`${E} is different from the file provided by ${C}`;n.reportJson({...f,newChecksum:h}),n.reportError(0,S)}})).exitCode()}};Ge();Ge();Dt();Yt();var vye=Ie(\"os\");Ge();Dt();Yt();var Iye=Ie(\"os\");Ge();wc();Yt();var ect=\"https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml\";async function Sm(t,e){let r=await nn.get(ect,{configuration:t}),s=ls(r.toString());return Object.fromEntries(Object.entries(s).filter(([a,n])=>!e||Fr.satisfiesWithPrereleases(e,n.range??\"<4.0.0-rc.1\")))}var DC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"list\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"list the available official plugins\",details:\"\\n      This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\\n    \",examples:[[\"List the official plugins\",\"$0 plugin list\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Sm(r,fn);for(let[c,{experimental:f,...p}]of Object.entries(n)){let h=c;f&&(h+=\" [experimental]\"),a.reportJson({name:c,experimental:f,...p}),a.reportInfo(null,h)}})).exitCode()}};var tct=/^[0-9]+$/,rct=process.platform===\"win32\";function Cye(t){return tct.test(t)?`pull/${t}/head`:t}var nct=({repository:t,branch:e},r)=>[[\"git\",\"init\",fe.fromPortablePath(r)],[\"git\",\"remote\",\"add\",\"origin\",t],[\"git\",\"fetch\",\"origin\",\"--depth=1\",Cye(e)],[\"git\",\"reset\",\"--hard\",\"FETCH_HEAD\"]],ict=({branch:t})=>[[\"git\",\"fetch\",\"origin\",\"--depth=1\",Cye(t),\"--force\"],[\"git\",\"reset\",\"--hard\",\"FETCH_HEAD\"],[\"git\",\"clean\",\"-dfx\",\"-e\",\"packages/yarnpkg-cli/bundles\"]],sct=({plugins:t,noMinify:e},r,s)=>[[\"yarn\",\"build:cli\",...new Array().concat(...t.map(a=>[\"--plugin\",J.resolve(s,a)])),...e?[\"--no-minify\"]:[],\"|\"],[rct?\"move\":\"mv\",\"packages/yarnpkg-cli/bundles/yarn.js\",fe.fromPortablePath(r),\"|\"]],bC=class extends ft{constructor(){super(...arguments);this.installPath=ge.String(\"--path\",{description:\"The path where the repository should be cloned to\"});this.repository=ge.String(\"--repository\",\"https://github.com/yarnpkg/berry.git\",{description:\"The repository that should be cloned\"});this.branch=ge.String(\"--branch\",\"master\",{description:\"The branch of the repository that should be cloned\"});this.plugins=ge.Array(\"--plugin\",[],{description:\"An array of additional plugins that should be included in the bundle\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"If set, the bundle will be built but not added to the project\"});this.noMinify=ge.Boolean(\"--no-minify\",!1,{description:\"Build a bundle for development (debugging) - non-minified and non-mangled\"});this.force=ge.Boolean(\"-f,--force\",!1,{description:\"Always clone the repository instead of trying to fetch the latest commits\"});this.skipPlugins=ge.Boolean(\"--skip-plugins\",!1,{description:\"Skip updating the contrib plugins\"})}static{this.paths=[[\"set\",\"version\",\"from\",\"sources\"]]}static{this.usage=ot.Usage({description:\"build Yarn from master\",details:`\n      This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.\n\n      By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \\`--skip-plugins\\` flag.\n    `,examples:[[\"Build Yarn from master\",\"$0 set version from sources\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),a=typeof this.installPath<\"u\"?J.resolve(this.context.cwd,fe.toPortablePath(this.installPath)):J.resolve(fe.toPortablePath((0,Iye.tmpdir)()),\"yarnpkg-sources\",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async c=>{await $5(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,\"Building a fresh bundle\"),c.reportSeparator();let f=await qr.execvp(\"git\",[\"rev-parse\",\"--short\",\"HEAD\"],{cwd:a,strict:!0}),p=J.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);ce.existsSync(p)||(await $v(sct(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await ce.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await X5(r,null,async()=>h,{report:c});this.skipPlugins||await oct(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function $v(t,{configuration:e,context:r,target:s}){for(let[a,...n]of t){let c=n[n.length-1]===\"|\";if(c&&n.pop(),c)await qr.pipevp(a,n,{cwd:s,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${he.pretty(e,`  $ ${[a,...n].join(\" \")}`,\"grey\")}\n`);try{await qr.execvp(a,n,{cwd:s,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function $5(t,{configuration:e,report:r,target:s}){let a=!1;if(!t.force&&ce.existsSync(J.join(s,\".git\"))){r.reportInfo(0,\"Fetching the latest commits\"),r.reportSeparator();try{await $v(ict(t),{configuration:e,context:t.context,target:s}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,\"Repository update failed; we'll try to regenerate it\")}}a||(r.reportInfo(0,\"Cloning the remote repository\"),r.reportSeparator(),await ce.removePromise(s),await ce.mkdirPromise(s,{recursive:!0}),await $v(nct(t,s),{configuration:e,context:t.context,target:s}))}async function oct(t,e,{project:r,report:s,target:a}){let n=await Sm(r.configuration,e),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())c.has(f)&&await eq(f,t,{project:r,report:s,target:a})}Ge();Ge();Dt();Yt();var wye=ut(Ai()),Bye=Ie(\"vm\");var PC=class extends ft{constructor(){super(...arguments);this.name=ge.String();this.checksum=ge.Boolean(\"--checksum\",!0,{description:\"Whether to care if this plugin is modified\"})}static{this.paths=[[\"plugin\",\"import\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"download a plugin\",details:`\n      This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.\n\n      Three types of plugin references are accepted:\n\n      - If the plugin is stored within the Yarn repository, it can be referenced by name.\n      - Third-party plugins can be referenced directly through their public urls.\n      - Local plugins can be referenced by their path on the disk.\n\n      If the \\`--no-checksum\\` option is set, Yarn will no longer care if the plugin is modified.\n\n      Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \\`@yarnpkg/builder\\` package).\n    `,examples:[['Download and activate the \"@yarnpkg/plugin-exec\" plugin',\"$0 plugin import @yarnpkg/plugin-exec\"],['Download and activate the \"@yarnpkg/plugin-exec\" plugin (shorthand)',\"$0 plugin import exec\"],[\"Download and activate a community plugin\",\"$0 plugin import https://example.org/path/to/plugin.js\"],[\"Activate a local plugin\",\"$0 plugin import ./path/to/plugin.js\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Tt.find(r,this.context.cwd),c,f;if(this.name.match(/^\\.{0,2}[\\\\/]/)||fe.isAbsolute(this.name)){let p=J.resolve(this.context.cwd,fe.toPortablePath(this.name));a.reportInfo(0,`Reading ${he.pretty(r,p,he.Type.PATH)}`),c=J.relative(n.cwd,p),f=await ce.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new jt(52,`Plugin specifier \"${this.name}\" is neither a plugin name nor a valid url`)}c=this.name,p=this.name}else{let h=G.parseLocator(this.name.replace(/^((@yarnpkg\\/)?plugin-)?/,\"@yarnpkg/plugin-\"));if(h.reference!==\"unknown\"&&!wye.default.valid(h.reference))throw new jt(0,\"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.\");let E=G.stringifyIdent(h),C=await Sm(r,fn);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${G.prettyIdent(r,h)} on the remote registry.\n`;throw r.plugins.has(E)?S+=`A plugin named ${G.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${he.pretty(r,\"https://github.com/yarnpkg/berry/blob/master/plugins.yml\",he.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${he.pretty(r,\"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js\",he.Type.URL)}).`,new jt(51,S)}c=E,p=C[E].url,h.reference!==\"unknown\"?p=p.replace(/\\/master\\//,`/${E}/${h.reference}/`):fn!==null&&(p=p.replace(/\\/master\\//,`/@yarnpkg/cli/${fn}/`))}a.reportInfo(0,`Downloading ${he.pretty(r,p,\"green\")}`),f=await nn.get(p,{configuration:r})}await tq(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function tq(t,e,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,Bye.runInNewContext)(e.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=J.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${he.pretty(n,h,\"magenta\")}`),await ce.mkdirPromise(J.dirname(E),{recursive:!0}),await ce.writeFilePromise(E,e);let C={path:h,spec:t};r&&(C.checksum=Nn.makeHash(e)),await ze.addPlugin(s.cwd,[C])}var act=({pluginName:t,noMinify:e},r)=>[[\"yarn\",`build:${t}`,...e?[\"--no-minify\"]:[],\"|\"]],xC=class extends ft{constructor(){super(...arguments);this.installPath=ge.String(\"--path\",{description:\"The path where the repository should be cloned to\"});this.repository=ge.String(\"--repository\",\"https://github.com/yarnpkg/berry.git\",{description:\"The repository that should be cloned\"});this.branch=ge.String(\"--branch\",\"master\",{description:\"The branch of the repository that should be cloned\"});this.noMinify=ge.Boolean(\"--no-minify\",!1,{description:\"Build a plugin for development (debugging) - non-minified and non-mangled\"});this.force=ge.Boolean(\"-f,--force\",!1,{description:\"Always clone the repository instead of trying to fetch the latest commits\"});this.name=ge.String()}static{this.paths=[[\"plugin\",\"import\",\"from\",\"sources\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"build a plugin from sources\",details:`\n      This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.\n\n      The plugins can be referenced by their short name if sourced from the official Yarn repository.\n    `,examples:[['Build and activate the \"@yarnpkg/plugin-exec\" plugin',\"$0 plugin import from sources @yarnpkg/plugin-exec\"],['Build and activate the \"@yarnpkg/plugin-exec\" plugin (shorthand)',\"$0 plugin import from sources exec\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=typeof this.installPath<\"u\"?J.resolve(this.context.cwd,fe.toPortablePath(this.installPath)):J.resolve(fe.toPortablePath((0,vye.tmpdir)()),\"yarnpkg-sources\",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await Tt.find(r,this.context.cwd),f=G.parseIdent(this.name.replace(/^((@yarnpkg\\/)?plugin-)?/,\"@yarnpkg/plugin-\")),p=G.stringifyIdent(f),h=await Sm(r,fn);if(!Object.hasOwn(h,p))throw new jt(51,`Couldn't find a plugin named \"${p}\" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await $5(this,{configuration:r,report:n,target:s}),await eq(E,this,{project:c,report:n,target:s})})).exitCode()}};async function eq(t,{context:e,noMinify:r},{project:s,report:a,target:n}){let c=t.replace(/@yarnpkg\\//,\"\"),{configuration:f}=s;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await $v(act({pluginName:c,noMinify:r},n),{configuration:f,context:e,target:n}),a.reportSeparator();let p=J.resolve(n,`packages/${c}/bundles/${t}.js`),h=await ce.readFilePromise(p);await tq(t,h,{project:s,report:a})}Ge();Dt();Yt();var kC=class extends ft{constructor(){super(...arguments);this.name=ge.String()}static{this.paths=[[\"plugin\",\"remove\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"remove a plugin\",details:`\n      This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.\n\n      **Note:** The plugins have to be referenced by their name property, which can be obtained using the \\`yarn plugin runtime\\` command. Shorthands are not allowed.\n   `,examples:[[\"Remove a plugin imported from the Yarn repository\",\"$0 plugin remove @yarnpkg/plugin-typescript\"],[\"Remove a plugin imported from a local file\",\"$0 plugin remove my-local-plugin\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=G.parseIdent(c);if(!r.plugins.has(c))throw new nt(`${G.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=J.resolve(s.cwd,p);ce.existsSync(h)&&(n.reportInfo(0,`Removing ${he.pretty(r,p,he.Type.PATH)}...`),await ce.removePromise(h)),n.reportInfo(0,\"Updating the configuration...\"),await ze.updateConfiguration(s.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let C=E.filter(S=>S.path!==p);return C.length===0?ze.deleteProperty:C.length===E.length?E:C}})})).exitCode()}};Ge();Yt();var QC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"runtime\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"list the active plugins\",details:`\n      This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.\n    `,examples:[[\"List the currently active plugins\",\"$0 plugin runtime\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=\" [builtin]\"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};Ge();Ge();Yt();var TC=class extends ft{constructor(){super(...arguments);this.idents=ge.Rest()}static{this.paths=[[\"rebuild\"]]}static{this.usage=ot.Usage({description:\"rebuild the project's native packages\",details:`\n      This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.\n\n      Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).\n\n      By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.\n    `,examples:[[\"Rebuild all packages\",\"$0 rebuild\"],[\"Rebuild fsevents only\",\"$0 rebuild fsevents\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=new Set;for(let f of this.idents)c.add(G.parseIdent(f).identHash);if(await s.restoreInstallState({restoreResolutions:!1}),await s.resolveEverything({cache:n,report:new ki}),c.size>0)for(let f of s.storedPackages.values())c.has(f.identHash)&&(s.storedBuildState.delete(f.locatorHash),s.skippedBuilds.delete(f.locatorHash));else s.storedBuildState.clear(),s.skippedBuilds.clear();return await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();Yt();var rq=ut(Go());Ul();var RC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Apply the operation to all workspaces from the current project\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"remove\"]]}static{this.usage=ot.Usage({description:\"remove dependencies from the project\",details:`\n      This command will remove the packages matching the specified patterns from the current workspace.\n\n      If the \\`--mode=<mode>\\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n      - \\`skip-build\\` will not run the build scripts at all. Note that this is different from setting \\`enableScripts\\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n      - \\`update-lockfile\\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n      This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n    `,examples:[[\"Remove a dependency from the current project\",\"$0 remove lodash\"],[\"Remove a dependency from all workspaces at once\",\"$0 remove lodash --all\"],[\"Remove all dependencies starting with `eslint-`\",\"$0 remove 'eslint-*'\"],[\"Remove all dependencies with the `@babel` scope\",\"$0 remove '@babel/*'\"],[\"Remove all dependencies matching `react-dom` or `react-helmet`\",\"$0 remove 'react-{dom,helmet}'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.all?s.workspaces:[a],f=[\"dependencies\",\"devDependencies\",\"peerDependencies\"],p=[],h=!1,E=[];for(let I of this.patterns){let R=!1,N=G.parseIdent(I);for(let U of c){let W=[...U.manifest.peerDependenciesMeta.keys()];for(let ee of(0,rq.default)(W,I))U.manifest.peerDependenciesMeta.delete(ee),h=!0,R=!0;for(let ee of f){let ie=U.manifest.getForScope(ee),ue=[...ie.values()].map(le=>G.stringifyIdent(le));for(let le of(0,rq.default)(ue,G.stringifyIdent(N))){let{identHash:me}=G.parseIdent(le),pe=ie.get(me);if(typeof pe>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");U.manifest[ee].delete(me),E.push([U,ee,pe]),h=!0,R=!0}}}R||p.push(I)}let C=p.length>1?\"Patterns\":\"Pattern\",S=p.length>1?\"don't\":\"doesn't\",P=this.all?\"any\":\"this\";if(p.length>0)throw new nt(`${C} ${he.prettyList(r,p,he.Type.CODE)} ${S} match any packages referenced by ${P} workspace`);return h?(await r.triggerMultipleHooks(I=>I.afterWorkspaceDependencyRemoval,E),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ge();Ge();Yt();var Sye=Ie(\"util\"),FC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"run\"]]}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async c=>{let f=a.manifest.scripts,p=je.sortMap(f.keys(),C=>C),h={breakLength:1/0,colors:r.get(\"enableColors\"),maxArrayLength:2},E=p.reduce((C,S)=>Math.max(C,S.length),0);for(let[C,S]of f.entries())c.reportInfo(null,`${C.padEnd(E,\" \")}   ${(0,Sye.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ge();Ge();Yt();var NC=class extends ft{constructor(){super(...arguments);this.inspect=ge.String(\"--inspect\",!1,{tolerateBoolean:!0,description:\"Forwarded to the underlying Node process when executing a binary\"});this.inspectBrk=ge.String(\"--inspect-brk\",!1,{tolerateBoolean:!0,description:\"Forwarded to the underlying Node process when executing a binary\"});this.topLevel=ge.Boolean(\"-T,--top-level\",!1,{description:\"Check the root workspace for scripts and/or binaries instead of the current one\"});this.binariesOnly=ge.Boolean(\"-B,--binaries-only\",!1,{description:\"Ignore any user defined scripts and only check for binaries\"});this.require=ge.String(\"--require\",{description:\"Forwarded to the underlying Node process when executing a binary\"});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.scriptName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"run\"]]}static{this.usage=ot.Usage({description:\"run a script defined in the package.json\",details:`\n      This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:\n\n      - If the \\`scripts\\` field from your local package.json contains a matching script name, its definition will get executed.\n\n      - Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.\n\n      - Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.\n\n      Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).\n    `,examples:[[\"Run the tests from the local workspace\",\"$0 run test\"],['Same thing, but without the \"run\" keyword',\"$0 test\"],[\"Inspect Webpack while running\",\"$0 run --inspect-brk webpack\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a,locator:n}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let c=this.topLevel?s.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await In.hasPackageScript(c,this.scriptName,{project:s}))return await In.executePackageScript(c,this.scriptName,this.args,{project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await In.getPackageAccessibleBinaries(c,{project:s});if(f.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect==\"string\"?h.push(`--inspect=${this.inspect}`):h.push(\"--inspect\")),this.inspectBrk&&(typeof this.inspectBrk==\"string\"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push(\"--inspect-brk\")),this.require&&h.push(`--require=${this.require}`),await In.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(\":\")){let E=(await Promise.all(s.workspaces.map(async C=>C.manifest.scripts.has(this.scriptName)?C:null))).filter(C=>C!==null);if(E.length===1)return await In.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName===\"node-gyp\"?new nt(`Couldn't find a script name \"${this.scriptName}\" in the top-level (used by ${G.prettyLocator(r,n)}). This typically happens because some package depends on \"node-gyp\" to build itself, but didn't list it in their dependencies. To fix that, please run \"yarn add node-gyp\" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new nt(`Couldn't find a script name \"${this.scriptName}\" in the top-level (used by ${G.prettyLocator(r,n)}).`);{if(this.scriptName===\"global\")throw new nt(\"The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead\");let h=[this.scriptName].concat(this.args);for(let[E,C]of $I)for(let S of C)if(h.length>=S.length&&JSON.stringify(h.slice(0,S.length))===JSON.stringify(S))throw new nt(`Couldn't find a script named \"${this.scriptName}\", but a matching command can be found in the ${E} plugin. You can install it with \"yarn plugin import ${E}\".`);throw new nt(`Couldn't find a script named \"${this.scriptName}\".`)}}};Ge();Ge();Yt();var OC=class extends ft{constructor(){super(...arguments);this.descriptor=ge.String();this.resolution=ge.String()}static{this.paths=[[\"set\",\"resolution\"]]}static{this.usage=ot.Usage({description:\"enforce a package resolution\",details:'\\n      This command updates the resolution table so that `descriptor` is resolved by `resolution`.\\n\\n      Note that by default this command only affect the current resolution table - meaning that this \"manual override\" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\\n\\n      Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\\n    ',examples:[[\"Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0\",\"$0 set resolution lodash@npm:^1.2.3 npm:1.5.0\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(await s.restoreInstallState({restoreResolutions:!1}),!a)throw new ar(s.cwd,this.context.cwd);let c=G.parseDescriptor(this.descriptor,!0),f=G.makeDescriptor(c,this.resolution);return s.storedDescriptors.set(c.descriptorHash,c),s.storedDescriptors.set(f.descriptorHash,f),s.resolutionAliases.set(c.descriptorHash,f.descriptorHash),await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ge();Dt();Yt();var Dye=ut(Go()),LC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Unlink all workspaces belonging to the target project from the current one\"});this.leadingArguments=ge.Rest()}static{this.paths=[[\"unlink\"]]}static{this.usage=ot.Usage({description:\"disconnect the local project from another one\",details:`\n      This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.\n    `,examples:[[\"Unregister a remote workspace in the current project\",\"$0 unlink ~/ts-loader\"],[\"Unregister all workspaces from a remote project in the current project\",\"$0 unlink ~/jest --all\"],[\"Unregister all previously linked workspaces\",\"$0 unlink --all\"],[\"Unregister all workspaces matching a glob\",\"$0 unlink '@babel/*' 'pkg-{a,b}'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=s.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of c.manifest.resolutions)h.startsWith(\"portal:\")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=J.resolve(this.context.cwd,fe.toPortablePath(p));if(je.isPathLike(p)){let E=await ze.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Tt.find(E,h);if(!S)throw new ar(C.cwd,h);if(this.all){for(let P of C.workspaces)P.manifest.name&&f.add(G.stringifyIdent(P.anchoredLocator));if(f.size===0)throw new nt(\"No workspace found to be unlinked in the target project\")}else{if(!S.manifest.name)throw new nt(\"The target workspace doesn't have a name and thus cannot be unlinked\");f.add(G.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,Dye.default)(E,p))f.add(C)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();Yt();var bye=ut(Vv()),nq=ut(Go());Ul();var MC=class extends ft{constructor(){super(...arguments);this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Offer various choices, depending on the detected upgrade paths\"});this.fixed=ge.Boolean(\"-F,--fixed\",!1,{description:\"Store dependency tags as-is instead of resolving them\"});this.exact=ge.Boolean(\"-E,--exact\",!1,{description:\"Don't use any semver modifier on the resolved range\"});this.tilde=ge.Boolean(\"-T,--tilde\",!1,{description:\"Use the `~` semver modifier on the resolved range\"});this.caret=ge.Boolean(\"-C,--caret\",!1,{description:\"Use the `^` semver modifier on the resolved range\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Resolve again ALL resolutions for those packages\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"up\"]]}static{this.usage=ot.Usage({description:\"upgrade dependencies across the project\",details:\"\\n      This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\\n\\n      If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\\n\\n      If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\\n\\n      The, `-C,--caret`, `-E,--exact` and  `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\\n\\n      This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\\n\\n      **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\\n    \",examples:[[\"Upgrade all instances of lodash to the latest release\",\"$0 up lodash\"],[\"Upgrade all instances of lodash to the latest release, but ask confirmation for each\",\"$0 up lodash -i\"],[\"Upgrade all instances of lodash to 1.2.3\",\"$0 up lodash@1.2.3\"],[\"Upgrade all instances of packages with the `@babel` scope to the latest release\",\"$0 up '@babel/*'\"],[\"Upgrade all instances of packages containing the word `jest` to the latest release\",\"$0 up '*jest*'\"],[\"Upgrade all instances of packages with the `@babel` scope to 7.0.0\",\"$0 up '@babel/*@7.0.0'\"]]})}static{this.schema=[tB(\"recursive\",qf.Forbids,[\"interactive\",\"exact\",\"tilde\",\"caret\"],{ignore:[void 0,!1]})]}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=[...s.storedDescriptors.values()],f=c.map(E=>G.stringifyIdent(E)),p=new Set;for(let E of this.patterns){if(G.parseDescriptor(E).range!==\"unknown\")throw new nt(\"Ranges aren't allowed when using --recursive\");for(let C of(0,nq.default)(f,E)){let S=G.parseIdent(C);p.add(S.identHash)}}let h=c.filter(E=>p.has(E.identHash));for(let E of h)s.storedDescriptors.delete(E.descriptorHash),s.storedResolutions.delete(E.descriptorHash);return await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}async executeUpClassic(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.fixed,f=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=Kv(this,s),h=f?[\"keep\",\"reuse\",\"project\",\"latest\"]:[\"project\",\"latest\"],E=[],C=[];for(let N of this.patterns){let U=!1,W=G.parseDescriptor(N),ee=G.stringifyIdent(W);for(let ie of s.workspaces)for(let ue of[\"dependencies\",\"devDependencies\"]){let me=[...ie.manifest.getForScope(ue).values()].map(Be=>G.stringifyIdent(Be)),pe=ee===\"*\"?me:(0,nq.default)(me,ee);for(let Be of pe){let Ce=G.parseIdent(Be),g=ie.manifest[ue].get(Ce.identHash);if(typeof g>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let we=G.makeDescriptor(Ce,W.range);E.push(Promise.resolve().then(async()=>[ie,ue,g,await zv(we,{project:s,workspace:ie,cache:n,target:ue,fixed:c,modifier:p,strategies:h})])),U=!0}}U||C.push(N)}if(C.length>1)throw new nt(`Patterns ${he.prettyList(r,C,he.Type.CODE)} don't match any packages referenced by any workspace`);if(C.length>0)throw new nt(`Pattern ${he.prettyList(r,C,he.Type.CODE)} doesn't match any packages referenced by any workspace`);let S=await Promise.all(E),P=await lA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async N=>{for(let[,,U,{suggestions:W,rejections:ee}]of S){let ie=W.filter(ue=>ue.descriptor!==null);if(ie.length===0){let[ue]=ee;if(typeof ue>\"u\")throw new Error(\"Assertion failed: Expected an error to have been set\");let le=this.cli.error(ue);s.configuration.get(\"enableNetwork\")?N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range\n\n${le}`):N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)\n\n${le}`)}else ie.length>1&&!f&&N.reportError(27,`${G.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(P.hasErrors())return P.exitCode();let I=!1,R=[];for(let[N,U,,{suggestions:W}]of S){let ee,ie=W.filter(pe=>pe.descriptor!==null),ue=ie[0].descriptor,le=ie.every(pe=>G.areDescriptorsEqual(pe.descriptor,ue));ie.length===1||le?ee=ue:(I=!0,{answer:ee}=await(0,bye.prompt)({type:\"select\",name:\"answer\",message:`Which range do you want to use in ${G.prettyWorkspace(r,N)} \\u276F ${U}?`,choices:W.map(({descriptor:pe,name:Be,reason:Ce})=>pe?{name:Be,hint:Ce,descriptor:pe}:{name:Be,hint:Ce,disabled:!0}),onCancel:()=>process.exit(130),result(pe){return this.find(pe,\"descriptor\")},stdin:this.context.stdin,stdout:this.context.stdout}));let me=N.manifest[U].get(ee.identHash);if(typeof me>\"u\")throw new Error(\"Assertion failed: This descriptor should have a matching entry\");if(me.descriptorHash!==ee.descriptorHash)N.manifest[U].set(ee.identHash,ee),R.push([N,U,me,ee]);else{let pe=r.makeResolver(),Be={project:s,resolver:pe},Ce=r.normalizeDependency(me),g=pe.bindDescriptor(Ce,N.anchoredLocator,Be);s.forgetResolution(g)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,R),I&&this.context.stdout.write(`\n`),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ge();Ge();Ge();Yt();var UC=class extends ft{constructor(){super(...arguments);this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"List, for each workspace, what are all the paths that lead to the dependency\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.peers=ge.Boolean(\"--peers\",!1,{description:\"Also print the peer dependencies that match the specified name\"});this.package=ge.String()}static{this.paths=[[\"why\"]]}static{this.usage=ot.Usage({description:\"display the reason why a package is needed\",details:`\n      This command prints the exact reasons why a package appears in the dependency tree.\n\n      If \\`-R,--recursive\\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named \"Foo\" when looking for \"Bar\", it means that \"Foo\" already got printed higher in the tree.\n    `,examples:[[\"Explain why lodash is used in your project\",\"$0 why lodash\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=G.parseIdent(this.package).identHash,c=this.recursive?cct(s,n,{configuration:r,peers:this.peers}):lct(s,n,{configuration:r,peers:this.peers});xs.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function lct(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.storedPackages.values(),f=>G.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&f.peerDependencies.has(E.identHash))continue;let C=t.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(\"Assertion failed: The resolution should have been registered\");let S=t.storedPackages.get(C);if(!S)throw new Error(\"Assertion failed: The package should have been registered\");if(S.identHash!==e)continue;{let I=G.stringifyLocator(f);n[I]={value:[f,he.Type.LOCATOR],children:p}}let P=G.stringifyLocator(S);p[P]={value:[{descriptor:E,locator:S},he.Type.DEPENDENT]}}}return c}function cct(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.workspaces,S=>G.stringifyLocator(S.anchoredLocator)),n=new Set,c=new Set,f=S=>{if(n.has(S.locatorHash))return c.has(S.locatorHash);if(n.add(S.locatorHash),S.identHash===e)return c.add(S.locatorHash),!0;let P=!1;S.identHash===e&&(P=!0);for(let I of S.dependencies.values()){if(!s&&S.peerDependencies.has(I.identHash))continue;let R=t.storedResolutions.get(I.descriptorHash);if(!R)throw new Error(\"Assertion failed: The resolution should have been registered\");let N=t.storedPackages.get(R);if(!N)throw new Error(\"Assertion failed: The package should have been registered\");f(N)&&(P=!0)}return P&&c.add(S.locatorHash),P};for(let S of a)f(S.anchoredPackage);let p=new Set,h={},E={children:h},C=(S,P,I)=>{if(!c.has(S.locatorHash))return;let R=I!==null?he.tuple(he.Type.DEPENDENT,{locator:S,descriptor:I}):he.tuple(he.Type.LOCATOR,S),N={},U={value:R,children:N},W=G.stringifyLocator(S);if(P[W]=U,!(I!==null&&t.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let ee of S.dependencies.values()){if(!s&&S.peerDependencies.has(ee.identHash))continue;let ie=t.storedResolutions.get(ee.descriptorHash);if(!ie)throw new Error(\"Assertion failed: The resolution should have been registered\");let ue=t.storedPackages.get(ie);if(!ue)throw new Error(\"Assertion failed: The package should have been registered\");C(ue,N,ee)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}Ge();var pq={};Vt(pq,{GitFetcher:()=>tS,GitResolver:()=>rS,default:()=>kct,gitUtils:()=>ka});Ge();Dt();var ka={};Vt(ka,{TreeishProtocols:()=>eS,clone:()=>Aq,fetchBase:()=>Jye,fetchChangedFiles:()=>Kye,fetchChangedWorkspaces:()=>Pct,fetchRoot:()=>Vye,isGitUrl:()=>jC,lsRemote:()=>Yye,normalizeLocator:()=>bct,normalizeRepoUrl:()=>_C,resolveUrl:()=>fq,splitRepoUrl:()=>W0,validateRepoUrl:()=>uq});Ge();Dt();Yt();ql();var qye=ut(Hye()),HC=ut(Ie(\"querystring\")),lq=ut(Ai());function aq(t,e,r){let s=t.indexOf(r);return t.lastIndexOf(e,s>-1?s:1/0)}function jye(t){try{return new URL(t)}catch{return}}function Sct(t){let e=aq(t,\"@\",\"#\"),r=aq(t,\":\",\"#\");return r>e&&(t=`${t.slice(0,r)}/${t.slice(r+1)}`),aq(t,\":\",\"#\")===-1&&t.indexOf(\"//\")===-1&&(t=`ssh://${t}`),t}function Gye(t){return jye(t)||jye(Sct(t))}function _C(t,{git:e=!1}={}){if(t=t.replace(/^git\\+https:/,\"https:\"),t=t.replace(/^(?:github:|https:\\/\\/github\\.com\\/|git:\\/\\/github\\.com\\/)?(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\\.git)?(#.*)?$/,\"https://github.com/$1/$2.git$3\"),t=t.replace(/^https:\\/\\/github\\.com\\/(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\\/tarball\\/(.+)?$/,\"https://github.com/$1/$2.git#$3\"),e){let r=Gye(t);r&&(t=r.href),t=t.replace(/^git\\+([^:]+):/,\"$1:\")}return t}function Wye(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||\"ssh\"} -o BatchMode=yes`}}var Dct=[/^ssh:/,/^git(?:\\+[^:]+)?:/,/^(?:git\\+)?https?:[^#]+\\/[^#]+(?:\\.git)(?:#.*)?$/,/^git@[^#]+\\/[^#]+\\.git(?:#.*)?$/,/^(?:github:|https:\\/\\/github\\.com\\/)?(?!\\.{1,2}\\/)([a-zA-Z._0-9-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\\.git)?(?:#.*)?$/,/^https:\\/\\/github\\.com\\/(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\\/tarball\\/(.+)?$/],eS=(a=>(a.Commit=\"commit\",a.Head=\"head\",a.Tag=\"tag\",a.Semver=\"semver\",a))(eS||{});function jC(t){return t?Dct.some(e=>!!t.match(e)):!1}function W0(t){t=_C(t);let e=t.indexOf(\"#\");if(e===-1)return{repo:t,treeish:{protocol:\"head\",request:\"HEAD\"},extra:{}};let r=t.slice(0,e),s=t.slice(e+1);if(s.match(/^[a-z]+=/)){let a=HC.default.parse(s);for(let[p,h]of Object.entries(a))if(typeof h!=\"string\")throw new Error(`Assertion failed: The ${p} parameter must be a literal string`);let n=Object.values(eS).find(p=>Object.hasOwn(a,p)),[c,f]=typeof n<\"u\"?[n,a[n]]:[\"head\",\"HEAD\"];for(let p of Object.values(eS))delete a[p];return{repo:r,treeish:{protocol:c,request:f},extra:a}}else{let a=s.indexOf(\":\"),[n,c]=a===-1?[null,s]:[s.slice(0,a),s.slice(a+1)];return{repo:r,treeish:{protocol:n,request:c},extra:{}}}}function bct(t){return G.makeLocator(t,_C(t.reference))}function uq(t,{configuration:e}){let r=_C(t,{git:!0});if(!nn.getNetworkSettings(`https://${(0,qye.default)(r).resource}`,{configuration:e}).enableNetwork)throw new jt(80,`Request to '${r}' has been blocked because of your configuration settings`);return r}async function Yye(t,e){let r=uq(t,{configuration:e}),s=await cq(\"listing refs\",[\"ls-remote\",r],{cwd:e.startingCwd,env:Wye()},{configuration:e,normalizedRepoUrl:r}),a=new Map,n=/^([a-f0-9]{40})\\t([^\\n]+)/gm,c;for(;(c=n.exec(s.stdout))!==null;)a.set(c[2],c[1]);return a}async function fq(t,e){let{repo:r,treeish:{protocol:s,request:a},extra:n}=W0(t),c=await Yye(r,e),f=(h,E)=>{switch(h){case\"commit\":{if(!E.match(/^[a-f0-9]{40}$/))throw new Error(\"Invalid commit hash\");return HC.default.stringify({...n,commit:E})}case\"head\":{let C=c.get(E===\"HEAD\"?E:`refs/heads/${E}`);if(typeof C>\"u\")throw new Error(`Unknown head (\"${E}\")`);return HC.default.stringify({...n,commit:C})}case\"tag\":{let C=c.get(`refs/tags/${E}`);if(typeof C>\"u\")throw new Error(`Unknown tag (\"${E}\")`);return HC.default.stringify({...n,commit:C})}case\"semver\":{let C=Fr.validRange(E);if(!C)throw new Error(`Invalid range (\"${E}\")`);let S=new Map([...c.entries()].filter(([I])=>I.startsWith(\"refs/tags/\")).map(([I,R])=>[lq.default.parse(I.slice(10)),R]).filter(I=>I[0]!==null)),P=lq.default.maxSatisfying([...S.keys()],C);if(P===null)throw new Error(`No matching range (\"${E}\")`);return HC.default.stringify({...n,commit:S.get(P)})}case null:{let C;if((C=p(\"commit\",E))!==null||(C=p(\"tag\",E))!==null||(C=p(\"head\",E))!==null)return C;throw E.match(/^[a-f0-9]+$/)?new Error(`Couldn't resolve \"${E}\" as either a commit, a tag, or a head - if a commit, use the 40-characters commit hash`):new Error(`Couldn't resolve \"${E}\" as either a commit, a tag, or a head`)}default:throw new Error(`Invalid Git resolution protocol (\"${h}\")`)}},p=(h,E)=>{try{return f(h,E)}catch{return null}};return _C(`${r}#${f(s,a)}`)}async function Aq(t,e){return await e.getLimit(\"cloneConcurrency\")(async()=>{let{repo:r,treeish:{protocol:s,request:a}}=W0(t);if(s!==\"commit\")throw new Error(\"Invalid treeish protocol when cloning\");let n=uq(r,{configuration:e}),c=await ce.mktempPromise(),f={cwd:c,env:Wye()};return await cq(\"cloning the repository\",[\"clone\",\"-c\",\"core.autocrlf=false\",n,fe.fromPortablePath(c)],f,{configuration:e,normalizedRepoUrl:n}),await cq(\"switching branch\",[\"checkout\",`${a}`],f,{configuration:e,normalizedRepoUrl:n}),c})}async function Vye(t){let e,r=t;do{if(e=r,await ce.existsPromise(J.join(e,\".git\")))return e;r=J.dirname(e)}while(r!==e);return null}async function Jye(t,{baseRefs:e}){if(e.length===0)throw new nt(\"Can't run this command with zero base refs specified.\");let r=[];for(let f of e){let{code:p}=await qr.execvp(\"git\",[\"merge-base\",f,\"HEAD\"],{cwd:t});p===0&&r.push(f)}if(r.length===0)throw new nt(`No ancestor could be found between any of HEAD and ${e.join(\", \")}`);let{stdout:s}=await qr.execvp(\"git\",[\"merge-base\",\"HEAD\",...r],{cwd:t,strict:!0}),a=s.trim(),{stdout:n}=await qr.execvp(\"git\",[\"show\",\"--quiet\",\"--pretty=format:%s\",a],{cwd:t,strict:!0}),c=n.trim();return{hash:a,title:c}}async function Kye(t,{base:e,project:r}){let s=je.buildIgnorePattern(r.configuration.get(\"changesetIgnorePatterns\")),{stdout:a}=await qr.execvp(\"git\",[\"diff\",\"--name-only\",`${e}`],{cwd:t,strict:!0}),n=a.split(/\\r\\n|\\r|\\n/).filter(h=>h.length>0).map(h=>J.resolve(t,fe.toPortablePath(h))),{stdout:c}=await qr.execvp(\"git\",[\"ls-files\",\"--others\",\"--exclude-standard\"],{cwd:t,strict:!0}),f=c.split(/\\r\\n|\\r|\\n/).filter(h=>h.length>0).map(h=>J.resolve(t,fe.toPortablePath(h))),p=[...new Set([...n,...f].sort())];return s?p.filter(h=>!J.relative(r.cwd,h).match(s)):p}async function Pct({ref:t,project:e}){if(e.configuration.projectCwd===null)throw new nt(\"This command can only be run from within a Yarn project\");let r=[J.resolve(e.cwd,Er.lockfile),J.resolve(e.cwd,e.configuration.get(\"cacheFolder\")),J.resolve(e.cwd,e.configuration.get(\"installStatePath\")),J.resolve(e.cwd,e.configuration.get(\"virtualFolder\"))];await e.configuration.triggerHook(c=>c.populateYarnPaths,e,c=>{c!=null&&r.push(c)});let s=await Vye(e.configuration.projectCwd);if(s==null)throw new nt(\"This command can only be run on Git repositories\");let a=await Jye(s,{baseRefs:typeof t==\"string\"?[t]:e.configuration.get(\"changesetBaseRefs\")}),n=await Kye(s,{base:a.hash,project:e});return new Set(je.mapAndFilter(n,c=>{let f=e.tryWorkspaceByFilePath(c);return f===null?je.mapAndFilter.skip:r.some(p=>c.startsWith(p))?je.mapAndFilter.skip:f}))}async function cq(t,e,r,{configuration:s,normalizedRepoUrl:a}){try{return await qr.execvp(\"git\",e,{...r,strict:!0})}catch(n){if(!(n instanceof qr.ExecError))throw n;let c=n.reportExtra,f=n.stderr.toString();throw new jt(1,`Failed ${t}`,p=>{p.reportError(1,`  ${he.prettyField(s,{label:\"Repository URL\",value:he.tuple(he.Type.URL,a)})}`);for(let h of f.matchAll(/^(.+?): (.*)$/gm)){let[,E,C]=h;E=E.toLowerCase();let S=E===\"error\"?\"Error\":`${bB(E)} Error`;p.reportError(1,`  ${he.prettyField(s,{label:S,value:he.tuple(he.Type.NO_HINT,C)})}`)}c?.(p)})}}var tS=class{supports(e,r){return jC(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,a=new Map(r.checksums);a.set(e.locatorHash,s);let n={...r,checksums:a},c=await this.downloadHosted(e,n);if(c!==null)return c;let[f,p,h]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote repository`),loader:()=>this.cloneFromRemote(e,n),...r.cacheOptions});return{packageFs:f,releaseFs:p,prefixPath:G.getIdentVendorPath(e),checksum:h}}async downloadHosted(e,r){return r.project.configuration.reduceHook(s=>s.fetchHostedRepository,null,e,r)}async cloneFromRemote(e,r){let s=W0(e.reference),a=await Aq(e.reference,r.project.configuration),n=J.resolve(a,s.extra.cwd??vt.dot),c=J.join(n,\"package.tgz\");await In.prepareExternalProject(n,c,{configuration:r.project.configuration,report:r.report,workspace:s.extra.workspace,locator:e});let f=await ce.readFilePromise(c);return await je.releaseAfterUseAsync(async()=>await ps.convertToZip(f,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1}))}};Ge();Ge();var rS=class{supportsDescriptor(e,r){return jC(e.range)}supportsLocator(e,r){return jC(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=await fq(e.range,s.project.configuration);return[G.makeLocator(e,a)]}async getSatisfying(e,r,s,a){let n=W0(e.range);return{locators:s.filter(f=>{if(f.identHash!==e.identHash)return!1;let p=W0(f.reference);return!(n.repo!==p.repo||n.treeish.protocol===\"commit\"&&n.treeish.request!==p.treeish.request)}),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var xct={configuration:{changesetBaseRefs:{description:\"The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.\",type:\"STRING\",isArray:!0,isNullable:!1,default:[\"master\",\"origin/master\",\"upstream/master\",\"main\",\"origin/main\",\"upstream/main\"]},changesetIgnorePatterns:{description:\"Array of glob patterns; files matching them will be ignored when fetching the changed files\",type:\"STRING\",default:[],isArray:!0},cloneConcurrency:{description:\"Maximal number of concurrent clones\",type:\"NUMBER\",default:2}},fetchers:[tS],resolvers:[rS]};var kct=xct;Yt();var GC=class extends ft{constructor(){super(...arguments);this.since=ge.String(\"--since\",{description:\"Only include workspaces that have been changed since the specified ref.\",tolerateBoolean:!0});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Find packages via dependencies/devDependencies instead of using the workspaces field\"});this.noPrivate=ge.Boolean(\"--no-private\",{description:\"Exclude workspaces that have the private field set to true\"});this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Also return the cross-dependencies between workspaces\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"workspaces\",\"list\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"list all available workspaces\",details:\"\\n      This command will print the list of all workspaces in the project.\\n\\n      - If `--since` is set, Yarn will only list workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\\n\\n      - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\\n\\n      - If `--no-private` is set, Yarn will not list any workspaces that have the `private` field set to `true`.\\n\\n      - If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{let c=this.since?await ka.fetchChangedWorkspaces({ref:this.since,project:s}):s.workspaces,f=new Set(c);if(this.recursive)for(let p of[...c].map(h=>h.getRecursiveWorkspaceDependents()))for(let h of p)f.add(h);for(let p of f){let{manifest:h}=p;if(h.private&&this.noPrivate)continue;let E;if(this.verbose){let C=new Set,S=new Set;for(let P of Ut.hardDependencies)for(let[I,R]of h.getForScope(P)){let N=s.tryWorkspaceByDescriptor(R);N===null?s.workspacesByIdent.has(I)&&S.add(R):C.add(N)}E={workspaceDependencies:Array.from(C).map(P=>P.relativeCwd),mismatchedWorkspaceDependencies:Array.from(S).map(P=>G.stringifyDescriptor(P))}}n.reportInfo(null,`${p.relativeCwd}`),n.reportJson({location:p.relativeCwd,name:h.name?G.stringifyIdent(h.name):null,...E})}})).exitCode()}};Ge();Ge();Yt();var qC=class extends ft{constructor(){super(...arguments);this.workspaceName=ge.String();this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"workspace\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"run a command within the specified workspace\",details:`\n      This command will run a given sub-command on a single workspace.\n    `,examples:[[\"Add a package to a single workspace\",\"yarn workspace components add -D react\"],[\"Run build script on a single workspace\",\"yarn workspace components run build\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=s.workspaces,c=new Map(n.map(p=>[G.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new nt(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:\n  - ${p.join(`\n  - `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};var Qct={configuration:{enableImmutableInstalls:{description:\"If true (the default on CI), prevents the install command from modifying the lockfile\",type:\"BOOLEAN\",default:zye.isCI},defaultSemverRangePrefix:{description:\"The default save prefix: '^', '~' or ''\",type:\"STRING\",values:[\"^\",\"~\",\"\"],default:\"^\"},preferReuse:{description:\"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.\",type:\"BOOLEAN\",default:!1}},commands:[aC,lC,cC,uC,OC,bC,EC,GC,pC,hC,gC,dC,sC,oC,fC,AC,mC,yC,IC,CC,wC,BC,LC,vC,SC,xC,PC,kC,DC,QC,TC,RC,FC,NC,MC,UC,qC]},Tct=Qct;var yq={};Vt(yq,{default:()=>Oct});Ge();Ge();var gq=\"catalog:\";var dq=t=>t.startsWith(gq),Rct=t=>t.range.slice(gq.length)||null,Xye=t=>t===null?\"default catalog\":`catalog \"${t}\"`,Fct=t=>t.scope?`@${t.scope}/${t.name}`:t.name,mq=(t,e,r,s)=>{let a=Rct(e),n;if(a===null)n=t.configuration.get(\"catalog\");else try{let E=t.configuration.get(\"catalogs\");E&&(n=E.get(a))}catch{n=void 0}if(!n||n.size===0)throw new jt(82,`${G.prettyDescriptor(t.configuration,e)}: ${Xye(a)} not found or empty`);let c=Fct(e),f=n.get(c);if(!f)throw new jt(82,`${G.prettyDescriptor(t.configuration,e)}: entry not found in ${Xye(a)}`);let p=t.configuration.normalizeDependency(G.makeDescriptor(e,f));return r.supportsDescriptor(p,s)?r.bindDescriptor(p,t.topLevelWorkspace.anchoredLocator,s):p};var Nct={configuration:{catalog:{description:\"The default catalog of packages\",type:\"MAP\",valueDefinition:{description:\"The catalog of packages\",type:\"STRING\"}},catalogs:{description:\"Named catalogs of packages\",type:\"MAP\",valueDefinition:{description:\"A named catalog\",type:\"MAP\",valueDefinition:{description:\"Package version in the catalog\",type:\"STRING\"}}}},hooks:{beforeWorkspacePacking:(t,e)=>{let r=t.project,s=r.configuration.makeResolver(),a={project:r,resolver:s,report:new ki};for(let n of Ut.allDependencies){let c=e[n];if(c)for(let[f,p]of Object.entries(c)){if(typeof p!=\"string\"||!dq(p))continue;let h=G.parseIdent(f),E=G.makeDescriptor(h,p),C=mq(r,E,s,a),{protocol:S,source:P,params:I,selector:R}=G.parseRange(G.convertToManifestRange(C.range));S===t.project.configuration.get(\"defaultProtocol\")&&(S=null),c[f]=G.makeRange({protocol:S,source:P,params:I,selector:R})}}},reduceDependency:async(t,e,r,s,{resolver:a,resolveOptions:n})=>dq(t.range)?mq(e,t,a,n):t}},Oct=Nct;var Bq={};Vt(Bq,{default:()=>Mct});Ge();var Qt={optional:!0},Eq=[[\"@tailwindcss/aspect-ratio@<0.2.1\",{peerDependencies:{tailwindcss:\"^2.0.2\"}}],[\"@tailwindcss/line-clamp@<0.2.1\",{peerDependencies:{tailwindcss:\"^2.0.2\"}}],[\"@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0\",{peerDependencies:{postcss:\"^8.0.0\"}}],[\"@samverschueren/stream-to-observable@<0.3.1\",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],[\"any-observable@<0.5.1\",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],[\"@pm2/agent@<1.0.4\",{dependencies:{debug:\"*\"}}],[\"debug@<4.2.0\",{peerDependenciesMeta:{\"supports-color\":Qt}}],[\"got@<11\",{dependencies:{\"@types/responselike\":\"^1.0.0\",\"@types/keyv\":\"^3.1.1\"}}],[\"cacheable-lookup@<4.1.2\",{dependencies:{\"@types/keyv\":\"^3.1.1\"}}],[\"http-link-dataloader@*\",{peerDependencies:{graphql:\"^0.13.1 || ^14.0.0\"}}],[\"typescript-language-server@*\",{dependencies:{\"vscode-jsonrpc\":\"^5.0.1\",\"vscode-languageserver-protocol\":\"^3.15.0\"}}],[\"postcss-syntax@*\",{peerDependenciesMeta:{\"postcss-html\":Qt,\"postcss-jsx\":Qt,\"postcss-less\":Qt,\"postcss-markdown\":Qt,\"postcss-scss\":Qt}}],[\"jss-plugin-rule-value-function@<=10.1.1\",{dependencies:{\"tiny-warning\":\"^1.0.2\"}}],[\"ink-select-input@<4.1.0\",{peerDependencies:{react:\"^16.8.2\"}}],[\"license-webpack-plugin@<2.3.18\",{peerDependenciesMeta:{webpack:Qt}}],[\"snowpack@>=3.3.0\",{dependencies:{\"node-gyp\":\"^7.1.0\"}}],[\"promise-inflight@*\",{peerDependenciesMeta:{bluebird:Qt}}],[\"reactcss@*\",{peerDependencies:{react:\"*\"}}],[\"react-color@<=2.19.0\",{peerDependencies:{react:\"*\"}}],[\"gatsby-plugin-i18n@*\",{dependencies:{ramda:\"^0.24.1\"}}],[\"useragent@^2.0.0\",{dependencies:{request:\"^2.88.0\",yamlparser:\"0.0.x\",semver:\"5.5.x\"}}],[\"@apollographql/apollo-tools@<=0.5.2\",{peerDependencies:{graphql:\"^14.2.1 || ^15.0.0\"}}],[\"material-table@^2.0.0\",{dependencies:{\"@babel/runtime\":\"^7.11.2\"}}],[\"@babel/parser@*\",{dependencies:{\"@babel/types\":\"^7.8.3\"}}],[\"fork-ts-checker-webpack-plugin@<=6.3.4\",{peerDependencies:{eslint:\">= 6\",typescript:\">= 2.7\",webpack:\">= 4\",\"vue-template-compiler\":\"*\"},peerDependenciesMeta:{eslint:Qt,\"vue-template-compiler\":Qt}}],[\"rc-animate@<=3.1.1\",{peerDependencies:{react:\">=16.9.0\",\"react-dom\":\">=16.9.0\"}}],[\"react-bootstrap-table2-paginator@*\",{dependencies:{classnames:\"^2.2.6\"}}],[\"react-draggable@<=4.4.3\",{peerDependencies:{react:\">= 16.3.0\",\"react-dom\":\">= 16.3.0\"}}],[\"apollo-upload-client@<14\",{peerDependencies:{graphql:\"14 - 15\"}}],[\"react-instantsearch-core@<=6.7.0\",{peerDependencies:{algoliasearch:\">= 3.1 < 5\"}}],[\"react-instantsearch-dom@<=6.7.0\",{dependencies:{\"react-fast-compare\":\"^3.0.0\"}}],[\"ws@<7.2.1\",{peerDependencies:{bufferutil:\"^4.0.1\",\"utf-8-validate\":\"^5.0.2\"},peerDependenciesMeta:{bufferutil:Qt,\"utf-8-validate\":Qt}}],[\"react-portal@<4.2.2\",{peerDependencies:{\"react-dom\":\"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0\"}}],[\"react-scripts@<=4.0.1\",{peerDependencies:{react:\"*\"}}],[\"testcafe@<=1.10.1\",{dependencies:{\"@babel/plugin-transform-for-of\":\"^7.12.1\",\"@babel/runtime\":\"^7.12.5\"}}],[\"testcafe-legacy-api@<=4.2.0\",{dependencies:{\"testcafe-hammerhead\":\"^17.0.1\",\"read-file-relative\":\"^1.2.0\"}}],[\"@google-cloud/firestore@<=4.9.3\",{dependencies:{protobufjs:\"^6.8.6\"}}],[\"gatsby-source-apiserver@*\",{dependencies:{\"babel-polyfill\":\"^6.26.0\"}}],[\"@webpack-cli/package-utils@<=1.0.1-alpha.4\",{dependencies:{\"cross-spawn\":\"^7.0.3\"}}],[\"gatsby-remark-prismjs@<3.3.28\",{dependencies:{lodash:\"^4\"}}],[\"gatsby-plugin-favicon@*\",{peerDependencies:{webpack:\"*\"}}],[\"gatsby-plugin-sharp@<=4.6.0-next.3\",{dependencies:{debug:\"^4.3.1\"}}],[\"gatsby-react-router-scroll@<=5.6.0-next.0\",{dependencies:{\"prop-types\":\"^15.7.2\"}}],[\"@rebass/forms@*\",{dependencies:{\"@styled-system/should-forward-prop\":\"^5.0.0\"},peerDependencies:{react:\"^16.8.6\"}}],[\"rebass@*\",{peerDependencies:{react:\"^16.8.6\"}}],[\"@ant-design/react-slick@<=0.28.3\",{peerDependencies:{react:\">=16.0.0\"}}],[\"mqtt@<4.2.7\",{dependencies:{duplexify:\"^4.1.1\"}}],[\"vue-cli-plugin-vuetify@<=2.0.3\",{dependencies:{semver:\"^6.3.0\"},peerDependenciesMeta:{\"sass-loader\":Qt,\"vuetify-loader\":Qt}}],[\"vue-cli-plugin-vuetify@<=2.0.4\",{dependencies:{\"null-loader\":\"^3.0.0\"}}],[\"vue-cli-plugin-vuetify@>=2.4.3\",{peerDependencies:{vue:\"*\"}}],[\"@vuetify/cli-plugin-utils@<=0.0.4\",{dependencies:{semver:\"^6.3.0\"},peerDependenciesMeta:{\"sass-loader\":Qt}}],[\"@vue/cli-plugin-typescript@<=5.0.0-alpha.0\",{dependencies:{\"babel-loader\":\"^8.1.0\"}}],[\"@vue/cli-plugin-typescript@<=5.0.0-beta.0\",{dependencies:{\"@babel/core\":\"^7.12.16\"},peerDependencies:{\"vue-template-compiler\":\"^2.0.0\"},peerDependenciesMeta:{\"vue-template-compiler\":Qt}}],[\"cordova-ios@<=6.3.0\",{dependencies:{underscore:\"^1.9.2\"}}],[\"cordova-lib@<=10.0.1\",{dependencies:{underscore:\"^1.9.2\"}}],[\"git-node-fs@*\",{peerDependencies:{\"js-git\":\"^0.7.8\"},peerDependenciesMeta:{\"js-git\":Qt}}],[\"consolidate@<0.16.0\",{peerDependencies:{mustache:\"^3.0.0\"},peerDependenciesMeta:{mustache:Qt}}],[\"consolidate@<=0.16.0\",{peerDependencies:{velocityjs:\"^2.0.1\",tinyliquid:\"^0.2.34\",\"liquid-node\":\"^3.0.1\",jade:\"^1.11.0\",\"then-jade\":\"*\",dust:\"^0.3.0\",\"dustjs-helpers\":\"^1.7.4\",\"dustjs-linkedin\":\"^2.7.5\",swig:\"^1.4.2\",\"swig-templates\":\"^2.0.3\",\"razor-tmpl\":\"^1.3.1\",atpl:\">=0.7.6\",liquor:\"^0.0.5\",twig:\"^1.15.2\",ejs:\"^3.1.5\",eco:\"^1.1.0-rc-3\",jazz:\"^0.0.18\",jqtpl:\"~1.1.0\",hamljs:\"^0.6.2\",hamlet:\"^0.3.3\",whiskers:\"^0.4.0\",\"haml-coffee\":\"^1.14.1\",\"hogan.js\":\"^3.0.2\",templayed:\">=0.2.3\",handlebars:\"^4.7.6\",underscore:\"^1.11.0\",lodash:\"^4.17.20\",pug:\"^3.0.0\",\"then-pug\":\"*\",qejs:\"^3.0.5\",walrus:\"^0.10.1\",mustache:\"^4.0.1\",just:\"^0.1.8\",ect:\"^0.5.9\",mote:\"^0.2.0\",toffee:\"^0.3.6\",dot:\"^1.1.3\",\"bracket-template\":\"^1.1.5\",ractive:\"^1.3.12\",nunjucks:\"^3.2.2\",htmling:\"^0.0.8\",\"babel-core\":\"^6.26.3\",plates:\"~0.4.11\",\"react-dom\":\"^16.13.1\",react:\"^16.13.1\",\"arc-templates\":\"^0.5.3\",vash:\"^0.13.0\",slm:\"^2.0.0\",marko:\"^3.14.4\",teacup:\"^2.0.0\",\"coffee-script\":\"^1.12.7\",squirrelly:\"^5.1.0\",twing:\"^5.0.2\"},peerDependenciesMeta:{velocityjs:Qt,tinyliquid:Qt,\"liquid-node\":Qt,jade:Qt,\"then-jade\":Qt,dust:Qt,\"dustjs-helpers\":Qt,\"dustjs-linkedin\":Qt,swig:Qt,\"swig-templates\":Qt,\"razor-tmpl\":Qt,atpl:Qt,liquor:Qt,twig:Qt,ejs:Qt,eco:Qt,jazz:Qt,jqtpl:Qt,hamljs:Qt,hamlet:Qt,whiskers:Qt,\"haml-coffee\":Qt,\"hogan.js\":Qt,templayed:Qt,handlebars:Qt,underscore:Qt,lodash:Qt,pug:Qt,\"then-pug\":Qt,qejs:Qt,walrus:Qt,mustache:Qt,just:Qt,ect:Qt,mote:Qt,toffee:Qt,dot:Qt,\"bracket-template\":Qt,ractive:Qt,nunjucks:Qt,htmling:Qt,\"babel-core\":Qt,plates:Qt,\"react-dom\":Qt,react:Qt,\"arc-templates\":Qt,vash:Qt,slm:Qt,marko:Qt,teacup:Qt,\"coffee-script\":Qt,squirrelly:Qt,twing:Qt}}],[\"vue-loader@<=16.3.3\",{peerDependencies:{\"@vue/compiler-sfc\":\"^3.0.8\",webpack:\"^4.1.0 || ^5.0.0-0\"},peerDependenciesMeta:{\"@vue/compiler-sfc\":Qt}}],[\"vue-loader@^16.7.0\",{peerDependencies:{\"@vue/compiler-sfc\":\"^3.0.8\",vue:\"^3.2.13\"},peerDependenciesMeta:{\"@vue/compiler-sfc\":Qt,vue:Qt}}],[\"scss-parser@<=1.0.5\",{dependencies:{lodash:\"^4.17.21\"}}],[\"query-ast@<1.0.5\",{dependencies:{lodash:\"^4.17.21\"}}],[\"redux-thunk@<=2.3.0\",{peerDependencies:{redux:\"^4.0.0\"}}],[\"skypack@<=0.3.2\",{dependencies:{tar:\"^6.1.0\"}}],[\"@npmcli/metavuln-calculator@<2.0.0\",{dependencies:{\"json-parse-even-better-errors\":\"^2.3.1\"}}],[\"bin-links@<2.3.0\",{dependencies:{\"mkdirp-infer-owner\":\"^1.0.2\"}}],[\"rollup-plugin-polyfill-node@<=0.8.0\",{peerDependencies:{rollup:\"^1.20.0 || ^2.0.0\"}}],[\"snowpack@<3.8.6\",{dependencies:{\"magic-string\":\"^0.25.7\"}}],[\"elm-webpack-loader@*\",{dependencies:{temp:\"^0.9.4\"}}],[\"winston-transport@<=4.4.0\",{dependencies:{logform:\"^2.2.0\"}}],[\"jest-vue-preprocessor@*\",{dependencies:{\"@babel/core\":\"7.8.7\",\"@babel/template\":\"7.8.6\"},peerDependencies:{pug:\"^2.0.4\"},peerDependenciesMeta:{pug:Qt}}],[\"redux-persist@*\",{peerDependencies:{react:\">=16\"},peerDependenciesMeta:{react:Qt}}],[\"sodium@>=3\",{dependencies:{\"node-gyp\":\"^3.8.0\"}}],[\"babel-plugin-graphql-tag@<=3.1.0\",{peerDependencies:{graphql:\"^14.0.0 || ^15.0.0\"}}],[\"@playwright/test@<=1.14.1\",{dependencies:{\"jest-matcher-utils\":\"^26.4.2\"}}],...[\"babel-plugin-remove-graphql-queries@<3.14.0-next.1\",\"babel-preset-gatsby-package@<1.14.0-next.1\",\"create-gatsby@<1.14.0-next.1\",\"gatsby-admin@<0.24.0-next.1\",\"gatsby-cli@<3.14.0-next.1\",\"gatsby-core-utils@<2.14.0-next.1\",\"gatsby-design-tokens@<3.14.0-next.1\",\"gatsby-legacy-polyfills@<1.14.0-next.1\",\"gatsby-plugin-benchmark-reporting@<1.14.0-next.1\",\"gatsby-plugin-graphql-config@<0.23.0-next.1\",\"gatsby-plugin-image@<1.14.0-next.1\",\"gatsby-plugin-mdx@<2.14.0-next.1\",\"gatsby-plugin-netlify-cms@<5.14.0-next.1\",\"gatsby-plugin-no-sourcemaps@<3.14.0-next.1\",\"gatsby-plugin-page-creator@<3.14.0-next.1\",\"gatsby-plugin-preact@<5.14.0-next.1\",\"gatsby-plugin-preload-fonts@<2.14.0-next.1\",\"gatsby-plugin-schema-snapshot@<2.14.0-next.1\",\"gatsby-plugin-styletron@<6.14.0-next.1\",\"gatsby-plugin-subfont@<3.14.0-next.1\",\"gatsby-plugin-utils@<1.14.0-next.1\",\"gatsby-recipes@<0.25.0-next.1\",\"gatsby-source-shopify@<5.6.0-next.1\",\"gatsby-source-wikipedia@<3.14.0-next.1\",\"gatsby-transformer-screenshot@<3.14.0-next.1\",\"gatsby-worker@<0.5.0-next.1\"].map(t=>[t,{dependencies:{\"@babel/runtime\":\"^7.14.8\"}}]),[\"gatsby-core-utils@<2.14.0-next.1\",{dependencies:{got:\"8.3.2\"}}],[\"gatsby-plugin-gatsby-cloud@<=3.1.0-next.0\",{dependencies:{\"gatsby-core-utils\":\"^2.13.0-next.0\"}}],[\"gatsby-plugin-gatsby-cloud@<=3.2.0-next.1\",{peerDependencies:{webpack:\"*\"}}],[\"babel-plugin-remove-graphql-queries@<=3.14.0-next.1\",{dependencies:{\"gatsby-core-utils\":\"^2.8.0-next.1\"}}],[\"gatsby-plugin-netlify@3.13.0-next.1\",{dependencies:{\"gatsby-core-utils\":\"^2.13.0-next.0\"}}],[\"clipanion-v3-codemod@<=0.2.0\",{peerDependencies:{jscodeshift:\"^0.11.0\"}}],[\"react-live@*\",{peerDependencies:{\"react-dom\":\"*\",react:\"*\"}}],[\"webpack@<4.44.1\",{peerDependenciesMeta:{\"webpack-cli\":Qt,\"webpack-command\":Qt}}],[\"webpack@<5.0.0-beta.23\",{peerDependenciesMeta:{\"webpack-cli\":Qt}}],[\"webpack-dev-server@<3.10.2\",{peerDependenciesMeta:{\"webpack-cli\":Qt}}],[\"@docusaurus/responsive-loader@<1.5.0\",{peerDependenciesMeta:{sharp:Qt,jimp:Qt}}],[\"eslint-module-utils@*\",{peerDependenciesMeta:{\"eslint-import-resolver-node\":Qt,\"eslint-import-resolver-typescript\":Qt,\"eslint-import-resolver-webpack\":Qt,\"@typescript-eslint/parser\":Qt}}],[\"eslint-plugin-import@*\",{peerDependenciesMeta:{\"@typescript-eslint/parser\":Qt}}],[\"critters-webpack-plugin@<3.0.2\",{peerDependenciesMeta:{\"html-webpack-plugin\":Qt}}],[\"terser@<=5.10.0\",{dependencies:{acorn:\"^8.5.0\"}}],[\"babel-preset-react-app@10.0.x <10.0.2\",{dependencies:{\"@babel/plugin-proposal-private-property-in-object\":\"^7.16.7\"}}],[\"eslint-config-react-app@*\",{peerDependenciesMeta:{typescript:Qt}}],[\"@vue/eslint-config-typescript@<11.0.0\",{peerDependenciesMeta:{typescript:Qt}}],[\"unplugin-vue2-script-setup@<0.9.1\",{peerDependencies:{\"@vue/composition-api\":\"^1.4.3\",\"@vue/runtime-dom\":\"^3.2.26\"}}],[\"@cypress/snapshot@*\",{dependencies:{debug:\"^3.2.7\"}}],[\"auto-relay@<=0.14.0\",{peerDependencies:{\"reflect-metadata\":\"^0.1.13\"}}],[\"vue-template-babel-compiler@<1.2.0\",{peerDependencies:{\"vue-template-compiler\":\"^2.6.0\"}}],[\"@parcel/transformer-image@<2.5.0\",{peerDependencies:{\"@parcel/core\":\"*\"}}],[\"@parcel/transformer-js@<2.5.0\",{peerDependencies:{\"@parcel/core\":\"*\"}}],[\"parcel@*\",{peerDependenciesMeta:{\"@parcel/core\":Qt}}],[\"react-scripts@*\",{peerDependencies:{eslint:\"*\"}}],[\"focus-trap-react@^8.0.0\",{dependencies:{tabbable:\"^5.3.2\"}}],[\"react-rnd@<10.3.7\",{peerDependencies:{react:\">=16.3.0\",\"react-dom\":\">=16.3.0\"}}],[\"connect-mongo@<5.0.0\",{peerDependencies:{\"express-session\":\"^1.17.1\"}}],[\"vue-i18n@<9\",{peerDependencies:{vue:\"^2\"}}],[\"vue-router@<4\",{peerDependencies:{vue:\"^2\"}}],[\"unified@<10\",{dependencies:{\"@types/unist\":\"^2.0.0\"}}],[\"react-github-btn@<=1.3.0\",{peerDependencies:{react:\">=16.3.0\"}}],[\"react-dev-utils@*\",{peerDependencies:{typescript:\">=2.7\",webpack:\">=4\"},peerDependenciesMeta:{typescript:Qt}}],[\"@asyncapi/react-component@<=1.0.0-next.39\",{peerDependencies:{react:\">=16.8.0\",\"react-dom\":\">=16.8.0\"}}],[\"xo@*\",{peerDependencies:{webpack:\">=1.11.0\"},peerDependenciesMeta:{webpack:Qt}}],[\"babel-plugin-remove-graphql-queries@<=4.20.0-next.0\",{dependencies:{\"@babel/types\":\"^7.15.4\"}}],[\"gatsby-plugin-page-creator@<=4.20.0-next.1\",{dependencies:{\"fs-extra\":\"^10.1.0\"}}],[\"gatsby-plugin-utils@<=3.14.0-next.1\",{dependencies:{fastq:\"^1.13.0\"},peerDependencies:{graphql:\"^15.0.0\"}}],[\"gatsby-plugin-mdx@<3.1.0-next.1\",{dependencies:{mkdirp:\"^1.0.4\"}}],[\"gatsby-plugin-mdx@^2\",{peerDependencies:{gatsby:\"^3.0.0-next\"}}],[\"fdir@<=5.2.0\",{peerDependencies:{picomatch:\"2.x\"},peerDependenciesMeta:{picomatch:Qt}}],[\"babel-plugin-transform-typescript-metadata@<=0.3.2\",{peerDependencies:{\"@babel/core\":\"^7\",\"@babel/traverse\":\"^7\"},peerDependenciesMeta:{\"@babel/traverse\":Qt}}],[\"graphql-compose@>=9.0.10\",{peerDependencies:{graphql:\"^14.2.0 || ^15.0.0 || ^16.0.0\"}}],[\"vite-plugin-vuetify@<=1.0.2\",{peerDependencies:{vue:\"^3.0.0\"}}],[\"webpack-plugin-vuetify@<=2.0.1\",{peerDependencies:{vue:\"^3.2.6\"}}],[\"eslint-import-resolver-vite@<2.0.1\",{dependencies:{debug:\"^4.3.4\",resolve:\"^1.22.8\"}}],[\"notistack@^3.0.0\",{dependencies:{csstype:\"^3.0.10\"}}],[\"@fastify/type-provider-typebox@^5.0.0\",{peerDependencies:{fastify:\"^5.0.0\"}}],[\"@fastify/type-provider-typebox@^4.0.0\",{peerDependencies:{fastify:\"^4.0.0\"}}]];var Iq;function Zye(){return typeof Iq>\"u\"&&(Iq=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"G7weAByFTVk3Vs7UfHhq4yykgEM7pbW7TI43SG2S5tvGrwHBAzdz+s/npQ6tgEvobvxisrPIadkXeUAJotBn5bDZ5kAhcRqsIHe3F75Walet5hNalwgFDtxb0BiDUjiUQkjG0yW2hto9HPgiCkm316d6bC0kST72YN7D7rfkhCE9x4J0XwB0yavalxpUu2t9xszHrmtwalOxT7VslsxWcB1qpqZwERUra4psWhTV8BgwWeizurec82Caf1ABL11YMfbf8FJ9JBceZOkgmvrQPbC9DUldX/yMbmX06UQluCEjSwUoyO+EZPIjofr+/oAZUck2enraRD+oWLlnlYnj8xB+gwSo9lmmks4fXv574qSqcWA6z21uYkzMu3EWj+K23RxeQlLqiE35/rC8GcS4CGkKHKKq+zAIQwD9iRDNfiAqueLLpicFFrN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7F7MxWbvrPMY473ew0G+noVL8EPbkmEMftMSeL6HFub/zy+2JQ==\",\"base64\")).toString()),Iq}var Cq;function $ye(){return typeof Cq>\"u\"&&(Cq=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"G8MSIIzURnVBnObTcvb3XE6v2S9Qgc2K801Oa5otNKEtK8BINZNcaQHy+9/vf/WXBimwutXC33P2DPc64pps5rz7NGGWaOKNSPL4Y2KRE8twut2lFOIN+OXPtRmPMRhMTILib2bEQx43az2I5d3YS8Roa5UZpF/ujHb3Djd3GDvYUfvFYSUQ39vb2cmifp/rgB4J/65JK3wRBTvMBoNBmn3mbXC63/gbBkW/2IRPri0O8bcsRBsmarF328pAln04nyJFkwUAvNu934supAqLtyerZZpJ8I8suJHhf/ocMV+scKwa8NOiDKIPXw6Ex/EEZD6TEGaW8N5zvNHYF10l6Lfooj7D5W2k3dgvQSbp2Wv8TGOayS978gxlOLVjTGXs66ozewbrjwElLtyrYNnWTfzzdEutgROUFPVMhnMoy8EjJLLlWwIEoySxliim9kYW30JUHiPVyjt0iAw/ZpPmCbUCltYPnq6ZNblIKhTNhqS/oqC9iya5sGKZTOVsTEg34n92uZTf2iPpcZih8rPW8CzA+adIGmyCPcKdLMsBLShd+zuEbTrqpwuh+DLmracZcjPC5Sdf5odDAhKpFuOsQS67RT+1VgWWygSv3YwxDnylc04/PYuaMeIzhBkLrvs7e/OUzRTF56MmfY6rI63QtEjEQzq637zQqJ39nNhu3NmoRRhW/086bHGBUtx0PE0j3aEGvkdh9WJC8y8j8mqqke9/dQ5la+Q3ba4RlhvTbnfQhPDDab3tUifkjKuOsp13mXEmO00Mu88F/M67R7LXfoFDFLNtgCSWjWX+3Jn1371pJTK9xPBiMJafvDjtFyAzu8rxeQ0TKMQXNPs5xxiBOd+BRJP8KP88XPtJIbZKh/cdW8KvBUkpqKpGoiIaA32c3/JnQr4efXt85mXvidOvn/eU3Pase1typLYBalJ14mCso9h79nuMOuCa/kZAOkJHmTjP5RM2WNoPasZUAnT1TAE/NH25hUxcQv6hQWR/m1PKk4ooXMcM4SR1iYU3fUohvqk4RY2hbmTVVIXv6TvqO+0doOjgeVFAcom+RlwJQmOVH7pr1Q9LoJT6n1DeQEB+NHygsATbIwTcOKZlJsY8G4+suX1uQLjUWwLjjs0mvSvZcLTpIGAekeR7GCgl8eo3ndAqEe2XCav4huliHjdbIPBsGJuPX7lrO9HX1UbXRH5opOe1x6JsOSgHZR+EaxuXVhpLLxm6jk1LJtZfHSc6BKPun3CpYYVMJGwEUyk8MTGG0XL5MfEwaXpnc9TKnBmlGn6nHiGREc3ysn47XIBDzA+YvFdjZzVIEDcKGpS6PbUJehFRjEne8D0lVU1XuRtlgszq6pTNlQ/3MzNOEgCWPyTct22V2mEi2krizn5VDo9B19/X2DB3hCGRMM7ONbtnAcIx/OWB1u5uPbW1gsH8irXxT/IzG0PoXWYjhbMsH3KTuoOl5o17PulcgvsfTSnKFM354GWI8luqZnrswWjiXy3G+Vbyo1KMopFmmvBwNELgaS8z8dNZchx/Cl/xjddxhMcyqtzFyONb2Zdu90NkI8pAeufe7YlXrp53v8Dj/l8vWeVspRKBGXScBBPI/HinSTGmLDOGGOCIyH0JFdOZx0gWsacNlQLJMIrBhqRxXxHF/5pseWwejlAAvZ3klZSDSYY8mkToaWejXhgNomeGtx1DTLEUFMRkgF5yFB22WYdJnaWN14r1YJj81hGi45+jrADS5nYRhCiSlCJJ1nL8pYX+HDSMhdTEWyRcgHVp/IsUIZYMfT+YYncUQPgcxNGCHfZ88vDdrcUuaGIl6zhAsiaq7R5dfqrqXH/JcBhfjT8D0azayIyEz75Nxp6YkcyDxlJq3EXnJUpqDohJJOysL1t1uNiHESlvsxPb5cpbW0+ICZqJmUZus1BMW0F5IVBODLIo2zHHjA0=\",\"base64\")).toString()),Cq}var wq;function eEe(){return typeof wq>\"u\"&&(wq=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"m9XmPqMRsZ7bFo1U5CxexdgYepcdMsrcAbbqv7/rCXGM7S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2D4Qbcon3bPnDLNmLRzKJzqCt5Ps+lYuchzZfhu/7UP+Hl9g2YZmXOe1PfTU4BaSxWAADSzb7uLTXPFd7aGLxG8e7Ka2P60duYUxPgqIYwAGCKfdsWB6xcYPA2Rt4dkd5MZR4xM4ArA7QKq0uxr+YniqC4snpAsQ2CdBewJYTHQbA4DzigBqeqmNkYj/Ex+gWHh1HKDCfiYt/YBnFjC9iDgqriRCmDN7KbvaEhH7bV4/9o8iqpt0UijZeK23fqXPbwbLEu9l5qH4qOLfxsXPvOyZqOi7ptV29mkEylzceyh1rHKduSdPqEVtt98zl85h7vsomK8+M9/w++WIvOoaq8J3yCf7UYvCR8OKm+lE/yGH2CB+m5Dv6JidLoIU/mh/hiOQXtjzhatQ85YkdsD7v/8VPmJEog7ZUKj2jCxvO6LsXNCcLK7+niPQryHDEdafxurmo3xH/8VbK/jwV5rg03y/tvC9T1Rd8JKI2usEZSQgV1ss8+gJtjtpcD\",\"base64\")).toString()),wq}var tEe=new Map([[G.makeIdent(null,\"fsevents\").identHash,Zye],[G.makeIdent(null,\"resolve\").identHash,$ye],[G.makeIdent(null,\"typescript\").identHash,eEe]]),Lct={hooks:{registerPackageExtensions:async(t,e)=>{for(let[r,s]of Eq)e(G.parseDescriptor(r,!0),s)},getBuiltinPatch:async(t,e)=>{let r=\"compat/\";if(!e.startsWith(r))return;let s=G.parseIdent(e.slice(r.length)),a=tEe.get(s.identHash)?.();return typeof a<\"u\"?a:null},reduceDependency:async(t,e,r,s)=>typeof tEe.get(t.identHash)>\"u\"?t:G.makeDescriptor(t,G.makeRange({protocol:\"patch:\",source:G.stringifyDescriptor(t),selector:`optional!builtin<compat/${G.stringifyIdent(t)}>`,params:null}))}},Mct=Lct;var _q={};Vt(_q,{ConstraintsCheckCommand:()=>ZC,ConstraintsQueryCommand:()=>zC,ConstraintsSourceCommand:()=>XC,default:()=>nut});Ge();Ge();iS();var YC=class{constructor(e){this.project=e}createEnvironment(){let e=new WC([\"cwd\",\"ident\"]),r=new WC([\"workspace\",\"type\",\"ident\"]),s=new WC([\"ident\"]),a={manifestUpdates:new Map,reportedErrors:new Map},n=new Map,c=new Map;for(let f of this.project.storedPackages.values()){let p=Array.from(f.peerDependencies.values(),h=>[G.stringifyIdent(h),h.range]);n.set(f.locatorHash,{workspace:null,ident:G.stringifyIdent(f),version:f.version,dependencies:new Map,peerDependencies:new Map(p.filter(([h])=>f.peerDependenciesMeta.get(h)?.optional!==!0)),optionalPeerDependencies:new Map(p.filter(([h])=>f.peerDependenciesMeta.get(h)?.optional===!0))})}for(let f of this.project.storedPackages.values()){let p=n.get(f.locatorHash);p.dependencies=new Map(Array.from(f.dependencies.values(),h=>{let E=this.project.storedResolutions.get(h.descriptorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let C=n.get(E);if(typeof C>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");return[G.stringifyIdent(h),C]})),p.dependencies.delete(p.ident)}for(let f of this.project.workspaces){let p=G.stringifyIdent(f.anchoredLocator),h=f.manifest.exportTo({}),E=n.get(f.anchoredLocator.locatorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");let C=(R,N,{caller:U=Ui.getCaller()}={})=>{let W=nS(R),ee=je.getMapWithDefault(a.manifestUpdates,f.cwd),ie=je.getMapWithDefault(ee,W),ue=je.getSetWithDefault(ie,N);U!==null&&ue.add(U)},S=R=>C(R,void 0,{caller:Ui.getCaller()}),P=R=>{je.getArrayWithDefault(a.reportedErrors,f.cwd).push(R)},I=e.insert({cwd:f.relativeCwd,ident:p,manifest:h,pkg:E,set:C,unset:S,error:P});c.set(f,I);for(let R of Ut.allDependencies)for(let N of f.manifest[R].values()){let U=G.stringifyIdent(N),W=()=>{C([R,U],void 0,{caller:Ui.getCaller()})},ee=ue=>{C([R,U],ue,{caller:Ui.getCaller()})},ie=null;if(R!==\"peerDependencies\"&&(R!==\"dependencies\"||!f.manifest.devDependencies.has(N.identHash))){let ue=f.anchoredPackage.dependencies.get(N.identHash);if(ue){if(typeof ue>\"u\")throw new Error(\"Assertion failed: The dependency should have been registered\");let le=this.project.storedResolutions.get(ue.descriptorHash);if(typeof le>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let me=n.get(le);if(typeof me>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");ie=me}}r.insert({workspace:I,ident:U,range:N.range,type:R,resolution:ie,update:ee,delete:W,error:P})}}for(let f of this.project.storedPackages.values()){let p=this.project.tryWorkspaceByLocator(f);if(!p)continue;let h=c.get(p);if(typeof h>\"u\")throw new Error(\"Assertion failed: The workspace should have been registered\");let E=n.get(f.locatorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");E.workspace=h}return{workspaces:e,dependencies:r,packages:s,result:a}}async process(){let e=this.createEnvironment(),r={Yarn:{workspace:a=>e.workspaces.find(a)[0]??null,workspaces:a=>e.workspaces.find(a),dependency:a=>e.dependencies.find(a)[0]??null,dependencies:a=>e.dependencies.find(a),package:a=>e.packages.find(a)[0]??null,packages:a=>e.packages.find(a)}},s=await this.project.loadUserConfig();return s?.constraints?(await s.constraints(r),e.result):null}};Ge();Ge();Yt();var zC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.query=ge.String()}static{this.paths=[[\"constraints\",\"query\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"query the constraints fact database\",details:`\n      This command will output all matches to the given prolog query.\n    `,examples:[[\"List all dependencies throughout the workspace\",\"yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'\"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(lS(),aS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a),c=this.query;return c.endsWith(\".\")||(c=`${c}.`),(await Ot.start({configuration:s,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(c)){let E=Array.from(Object.entries(h)),C=E.length,S=E.reduce((P,[I])=>Math.max(P,I.length),0);for(let P=0;P<C;P++){let[I,R]=E[P];p.reportInfo(null,`${tut(P,C)}${I.padEnd(S,\" \")} = ${eut(R)}`)}p.reportJson(h)}})).exitCode()}};function eut(t){return typeof t!=\"string\"?`${t}`:t.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?t:`'${t}'`}function tut(t,e){let r=t===0,s=t===e-1;return r&&s?\"\":r?\"\\u250C \":s?\"\\u2514 \":\"\\u2502 \"}Ge();Yt();var XC=class extends ft{constructor(){super(...arguments);this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Also print the fact database automatically compiled from the workspace manifests\"})}static{this.paths=[[\"constraints\",\"source\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"print the source code for the constraints\",details:\"\\n      This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\\n    \",examples:[[\"Prints the source code\",\"yarn constraints source\"],[\"Print the source code and the fact database\",\"yarn constraints source -v\"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(lS(),aS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();Yt();iS();var ZC=class extends ft{constructor(){super(...arguments);this.fix=ge.Boolean(\"--fix\",!1,{description:\"Attempt to automatically fix unambiguous issues, following a multi-pass process\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"constraints\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"check that the project constraints are met\",details:`\n      This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.\n\n      If the \\`--fix\\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.\n\n      For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.\n    `,examples:[[\"Check that all constraints are satisfied\",\"yarn constraints\"],[\"Autofix all unmet constraints\",\"yarn constraints --fix\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new YC(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(lS(),aS));n=await h.find(s)}let c,f=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:C,remainingErrors:S}=iF(s,E,{fix:this.fix}),P=[];for(let[I,R]of C){let N=I.manifest.indent;I.manifest=new Ut,I.manifest.indent=N,I.manifest.load(R),P.push(I.persistManifest())}if(await Promise.all(P),!(C.size>0&&h>1)){c=rEe(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let R of I)R.fixable?f=!0:p=!1}}if(c.children.length===0)return 0;if(f){let h=p?`Those errors can all be fixed by running ${he.pretty(r,\"yarn constraints --fix\",he.Type.CODE)}`:`Errors prefixed by '\\u2699' can be fixed by running ${he.pretty(r,\"yarn constraints --fix\",he.Type.CODE)}`;await Ot.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return c.children=je.sortMap(c.children,h=>h.value[1]),xs.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};iS();var rut={configuration:{enableConstraintsChecks:{description:\"If true, constraints will run during installs\",type:\"BOOLEAN\",default:!1},constraintsPath:{description:\"The path of the constraints file.\",type:\"ABSOLUTE_PATH\",default:\"./constraints.pro\"}},commands:[zC,XC,ZC],hooks:{async validateProjectAfterInstall(t,{reportError:e}){if(!t.configuration.get(\"enableConstraintsChecks\"))return;let r=await t.loadUserConfig(),s;if(r?.constraints)s=new YC(t);else{let{Constraints:c}=await Promise.resolve().then(()=>(lS(),aS));s=await c.find(t)}let a=await s.process();if(!a)return;let{remainingErrors:n}=iF(t,a);if(n.size!==0)if(t.configuration.isCI)for(let[c,f]of n)for(let p of f)e(84,`${he.pretty(t.configuration,c.anchoredLocator,he.Type.IDENT)}: ${p.text}`);else e(84,`Constraint check failed; run ${he.pretty(t.configuration,\"yarn constraints\",he.Type.CODE)} for more details`)}}},nut=rut;var Hq={};Vt(Hq,{CreateCommand:()=>$C,DlxCommand:()=>ew,default:()=>sut});Ge();Yt();var $C=class extends ft{constructor(){super(...arguments);this.pkg=ge.String(\"-p,--package\",{description:\"The package to run the provided command from\"});this.quiet=ge.Boolean(\"-q,--quiet\",!1,{description:\"Only report critical errors instead of printing the full install logs\"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"create\"]]}async execute(){let r=[];this.pkg&&r.push(\"--package\",this.pkg),this.quiet&&r.push(\"--quiet\");let s=this.command.replace(/^(@[^@/]+)(@|$)/,\"$1/create$2\"),a=G.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?G.makeIdent(a.scope,`create-${a.name}`):G.makeIdent(null,`create-${a.name}`),c=G.stringifyIdent(n);return a.range!==\"unknown\"&&(c+=`@${a.range}`),this.cli.run([\"dlx\",...r,c,...this.args])}};Ge();Ge();Dt();Yt();var ew=class extends ft{constructor(){super(...arguments);this.packages=ge.Array(\"-p,--package\",{description:\"The package(s) to install before running the command\"});this.quiet=ge.Boolean(\"-q,--quiet\",!1,{description:\"Only report critical errors instead of printing the full install logs\"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"dlx\"]]}static{this.usage=ot.Usage({description:\"run a package in a temporary environment\",details:\"\\n      This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\\n\\n      By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\\n\\n      Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\\n    \",examples:[[\"Use create-vite to scaffold a new Vite project\",\"yarn dlx create-vite\"],[\"Install multiple packages for a single command\",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e \"console.log('hello!')\"`]]})}async execute(){return ze.telemetry=null,await ce.mktempPromise(async r=>{let s=J.join(r,`dlx-${process.pid}`);await ce.mkdirPromise(s),await ce.writeFilePromise(J.join(s,\"package.json\"),`{}\n`),await ce.writeFilePromise(J.join(s,\"yarn.lock\"),\"\");let a=J.join(s,\".yarnrc.yml\"),n=await ze.findProjectCwd(this.context.cwd),f={enableGlobalCache:!(await ze.find(this.context.cwd,null,{strict:!1})).get(\"enableGlobalCache\"),enableTelemetry:!1,logFilters:[{code:Yf(68),level:he.LogLevel.Discard}]},p=n!==null?J.join(n,\".yarnrc.yml\"):null;p!==null&&ce.existsSync(p)?(await ce.copyFilePromise(p,a),await ze.updateConfiguration(s,N=>{let U=je.toMerged(N,f);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(W=>{let ee=typeof W==\"string\"?W:W.path,ie=fe.isAbsolute(ee)?ee:fe.resolve(fe.fromPortablePath(n),ee);return typeof W==\"string\"?ie:{path:ie,spec:W.spec}})),U})):await ce.writeJsonPromise(a,f);let h=this.packages??[this.command],E=G.parseDescriptor(this.command).name,C=await this.cli.run([\"add\",\"--fixed\",\"--\",...h],{cwd:s,quiet:this.quiet});if(C!==0)return C;this.quiet||this.context.stdout.write(`\n`);let S=await ze.find(s,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,s);if(I===null)throw new ar(P.cwd,s);await P.restoreInstallState();let R=await In.getWorkspaceAccessibleBinaries(I);return R.has(E)===!1&&R.size===1&&typeof this.packages>\"u\"&&(E=Array.from(R)[0][0]),await In.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:R,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var iut={commands:[$C,ew]},sut=iut;var qq={};Vt(qq,{ExecFetcher:()=>uS,ExecResolver:()=>fS,default:()=>lut,execUtils:()=>lF});Ge();Ge();Dt();var cA=\"exec:\";var lF={};Vt(lF,{loadGeneratorFile:()=>cS,makeLocator:()=>Gq,makeSpec:()=>PEe,parseSpec:()=>jq});Ge();Dt();function jq(t){let{params:e,selector:r}=G.parseRange(t),s=fe.toPortablePath(r);return{parentLocator:e&&typeof e.locator==\"string\"?G.parseLocator(e.locator):null,path:s}}function PEe({parentLocator:t,path:e,generatorHash:r,protocol:s}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<\"u\"?{hash:r}:{};return G.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function Gq(t,{parentLocator:e,path:r,generatorHash:s,protocol:a}){return G.makeLocator(t,PEe({parentLocator:e,path:r,generatorHash:s,protocol:a}))}async function cS(t,e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(t,{protocol:e}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.join(c.prefixPath,a);return await f.readFilePromise(p,\"utf8\")}var uS=class{supports(e,r){return!!e.reference.startsWith(cA)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:cA});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){let s=await cS(e.reference,cA,r);return ce.mktempPromise(async a=>{let n=J.join(a,\"generator.js\");return await ce.writeFilePromise(n,s),ce.mktempPromise(async c=>{if(await this.generatePackage(c,e,n,r),!ce.existsSync(J.join(c,\"build\")))throw new Error(\"The script should have generated a build directory\");return await ps.makeArchiveFromDirectory(J.join(c,\"build\"),{prefixPath:G.getIdentVendorPath(e),compressionLevel:r.project.configuration.get(\"compressionLevel\")})})})}async generatePackage(e,r,s,a){return await ce.mktempPromise(async n=>{let c=await In.makeScriptEnv({project:a.project,binFolder:n}),f=J.join(e,\"runtime.js\");return await ce.mktempPromise(async p=>{let h=J.join(p,\"buildfile.log\"),E=J.join(e,\"generator\"),C=J.join(e,\"build\");await ce.mkdirPromise(E),await ce.mkdirPromise(C);let S={tempDir:fe.fromPortablePath(E),buildDir:fe.fromPortablePath(C),locator:G.stringifyLocator(r)};await ce.writeFilePromise(f,`\n          // Expose 'Module' as a global variable\n          Object.defineProperty(global, 'Module', {\n            get: () => require('module'),\n            configurable: true,\n            enumerable: false,\n          });\n\n          // Expose non-hidden built-in modules as global variables\n          for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {\n            Object.defineProperty(global, name, {\n              get: () => require(name),\n              configurable: true,\n              enumerable: false,\n            });\n          }\n\n          // Expose the 'execEnv' global variable\n          Object.defineProperty(global, 'execEnv', {\n            value: {\n              ...${JSON.stringify(S)},\n            },\n            enumerable: true,\n          });\n        `);let P=c.NODE_OPTIONS||\"\",I=/\\s*--require\\s+\\S*\\.pnp\\.c?js\\s*/g;P=P.replace(I,\" \").trim(),c.NODE_OPTIONS=P;let{stdout:R,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${G.stringifyLocator(r)})\n`,prefix:G.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await qr.pipevp(process.execPath,[\"--require\",fe.fromPortablePath(f),fe.fromPortablePath(s),G.stringifyIdent(r)],{cwd:e,env:c,stdin:null,stdout:R,stderr:N});if(U!==0)throw ce.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${he.pretty(a.project.configuration,h,he.Type.PATH)})`)})})}};Ge();Ge();var out=2,fS=class{supportsDescriptor(e,r){return!!e.range.startsWith(cA)}supportsLocator(e,r){return!!e.reference.startsWith(cA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=jq(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=await cS(G.makeRange({protocol:cA,source:a,selector:a,params:{locator:G.stringifyLocator(n)}}),cA,s.fetchOptions),f=Nn.makeHash(`${out}`,c).slice(0,6);return[Gq(e,{parentLocator:n,path:a,generatorHash:f,protocol:cA})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var aut={fetchers:[uS],resolvers:[fS]},lut=aut;var Yq={};Vt(Yq,{FileFetcher:()=>gS,FileResolver:()=>dS,TarballFileFetcher:()=>mS,TarballFileResolver:()=>yS,default:()=>fut,fileUtils:()=>xm});Ge();Dt();var tw=/^(?:[a-zA-Z]:[\\\\/]|\\.{0,2}\\/)/,AS=/^[^?]*\\.(?:tar\\.gz|tgz)(?:::.*)?$/,es=\"file:\";var xm={};Vt(xm,{fetchArchiveFromLocator:()=>hS,makeArchiveFromLocator:()=>cF,makeBufferFromLocator:()=>Wq,makeLocator:()=>rw,makeSpec:()=>xEe,parseSpec:()=>pS});Ge();Dt();function pS(t){let{params:e,selector:r}=G.parseRange(t),s=fe.toPortablePath(r);return{parentLocator:e&&typeof e.locator==\"string\"?G.parseLocator(e.locator):null,path:s}}function xEe({parentLocator:t,path:e,hash:r,protocol:s}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<\"u\"?{hash:r}:{};return G.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function rw(t,{parentLocator:e,path:r,hash:s,protocol:a}){return G.makeLocator(t,xEe({parentLocator:e,path:r,hash:s,protocol:a}))}async function hS(t,e){let{parentLocator:r,path:s}=G.parseFileStyleRange(t.reference,{protocol:es}),a=J.isAbsolute(s)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await e.fetcher.fetch(r,e),n=a.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=J.join(n.prefixPath,s);return await je.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function cF(t,{protocol:e,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=G.parseFileStyleRange(t.reference,{protocol:e}),c=J.isAbsolute(n)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=J.join(f.prefixPath,n);return await je.releaseAfterUseAsync(async()=>await ps.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:G.getIdentVendorPath(t),compressionLevel:r.project.configuration.get(\"compressionLevel\"),inMemory:s}),f.releaseFs)}async function Wq(t,{protocol:e,fetchOptions:r}){return(await cF(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var gS=class{supports(e,r){return!!e.reference.startsWith(es)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:es});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){return cF(e,{protocol:es,fetchOptions:r})}};Ge();Ge();var cut=2,dS=class{supportsDescriptor(e,r){return e.range.match(tw)?!0:!!e.range.startsWith(es)}supportsLocator(e,r){return!!e.reference.startsWith(es)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return tw.test(e.range)&&(e=G.makeDescriptor(e,`${es}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=pS(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=await Wq(G.makeLocator(e,G.makeRange({protocol:es,source:a,selector:a,params:{locator:G.stringifyLocator(n)}})),{protocol:es,fetchOptions:s.fetchOptions}),f=Nn.makeHash(`${cut}`,c).slice(0,6);return[rw(e,{parentLocator:n,path:a,hash:f,protocol:es})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};Ge();var mS=class{supports(e,r){return AS.test(e.reference)?!!e.reference.startsWith(es):!1}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromDisk(e,r){let s=await hS(e,r);return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();Ge();Ge();var yS=class{supportsDescriptor(e,r){return AS.test(e.range)?!!(e.range.startsWith(es)||tw.test(e.range)):!1}supportsLocator(e,r){return AS.test(e.reference)?!!e.reference.startsWith(es):!1}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return tw.test(e.range)&&(e=G.makeDescriptor(e,`${es}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=pS(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=rw(e,{parentLocator:n,path:a,hash:\"\",protocol:es}),f=await hS(c,s.fetchOptions),p=Nn.makeHash(f).slice(0,6);return[rw(e,{parentLocator:n,path:a,hash:p,protocol:es})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var uut={fetchers:[mS,gS],resolvers:[yS,dS]},fut=uut;var Kq={};Vt(Kq,{GithubFetcher:()=>ES,default:()=>put,githubUtils:()=>uF});Ge();Dt();var uF={};Vt(uF,{invalidGithubUrlMessage:()=>TEe,isGithubUrl:()=>Vq,parseGithubUrl:()=>Jq});var kEe=ut(Ie(\"querystring\")),QEe=[/^https?:\\/\\/(?:([^/]+?)@)?github.com\\/([^/#]+)\\/([^/#]+)\\/tarball\\/([^/#]+)(?:#(.*))?$/,/^https?:\\/\\/(?:([^/]+?)@)?github.com\\/([^/#]+)\\/([^/#]+?)(?:\\.git)?(?:#(.*))?$/];function Vq(t){return t?QEe.some(e=>!!t.match(e)):!1}function Jq(t){let e;for(let f of QEe)if(e=t.match(f),e)break;if(!e)throw new Error(TEe(t));let[,r,s,a,n=\"master\"]=e,{commit:c}=kEe.default.parse(n);return n=c||n.replace(/[^:]*:/,\"\"),{auth:r,username:s,reponame:a,treeish:n}}function TEe(t){return`Input cannot be parsed as a valid GitHub URL ('${t}').`}var ES=class{supports(e,r){return!!Vq(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from GitHub`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s=await nn.get(this.getLocatorUrl(e,r),{configuration:r.project.configuration});return await ce.mktempPromise(async a=>{let n=new Sn(a);await ps.extractArchiveTo(s,n,{stripComponents:1});let c=ka.splitRepoUrl(e.reference),f=J.join(a,\"package.tgz\");await In.prepareExternalProject(a,f,{configuration:r.project.configuration,report:r.report,workspace:c.extra.workspace,locator:e});let p=await ce.readFilePromise(f);return await ps.convertToZip(p,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})})}getLocatorUrl(e,r){let{auth:s,username:a,reponame:n,treeish:c}=Jq(e.reference);return`https://${s?`${s}@`:\"\"}github.com/${a}/${n}/archive/${c}.tar.gz`}};var Aut={hooks:{async fetchHostedRepository(t,e,r){if(t!==null)return t;let s=new ES;if(!s.supports(e,r))return null;try{return await s.fetch(e,r)}catch{return null}}}},put=Aut;var zq={};Vt(zq,{TarballHttpFetcher:()=>CS,TarballHttpResolver:()=>wS,default:()=>gut});Ge();function IS(t){let e;try{e=new URL(t)}catch{return!1}return!(e.protocol!==\"http:\"&&e.protocol!==\"https:\"||!e.pathname.match(/(\\.tar\\.gz|\\.tgz|\\/[^.]+)$/))}var CS=class{supports(e,r){return IS(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s=await nn.get(e.reference,{configuration:r.project.configuration});return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();Ge();var wS=class{supportsDescriptor(e,r){return IS(e.range)}supportsLocator(e,r){return IS(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){return[G.convertDescriptorToLocator(e)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var hut={fetchers:[CS],resolvers:[wS]},gut=hut;var Xq={};Vt(Xq,{InitCommand:()=>z0,InitInitializerCommand:()=>nw,default:()=>mut});Yt();Ge();Ge();Dt();Yt();var z0=class extends ft{constructor(){super(...arguments);this.private=ge.Boolean(\"-p,--private\",!1,{description:\"Initialize a private package\"});this.workspace=ge.Boolean(\"-w,--workspace\",!1,{description:\"Initialize a workspace root with a `packages/` directory\"});this.install=ge.String(\"-i,--install\",!1,{tolerateBoolean:!0,description:\"Initialize a package with a specific bundle that will be locked in the project\"});this.name=ge.String(\"-n,--name\",{description:\"Initialize a package with the given name\"});this.usev2=ge.Boolean(\"-2\",!1,{hidden:!0});this.yes=ge.Boolean(\"-y,--yes\",{hidden:!0})}static{this.paths=[[\"init\"]]}static{this.usage=ot.Usage({description:\"create a new package\",details:\"\\n      This command will setup a new package in your local directory.\\n\\n      If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\\n\\n      If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\\n\\n      If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\\n\\n      The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\\n    \",examples:[[\"Create a new package in the local directory\",\"yarn init\"],[\"Create a new private package in the local directory\",\"yarn init -p\"],[\"Create a new package and store the Yarn release inside\",\"yarn init -i=latest\"],[\"Create a new private package and defines it as a workspace root\",\"yarn init -w\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=typeof this.install==\"string\"?this.install:this.usev2||this.install===!0?\"latest\":null;return s!==null?await this.executeProxy(r,s):await this.executeRegular(r)}async executeProxy(r,s){if(r.projectCwd!==null&&r.projectCwd!==this.context.cwd)throw new nt(\"Cannot use the --install flag from within a project subdirectory\");ce.existsSync(this.context.cwd)||await ce.mkdirPromise(this.context.cwd,{recursive:!0});let a=J.join(this.context.cwd,Er.lockfile);ce.existsSync(a)||await ce.writeFilePromise(a,\"\");let n=await this.cli.run([\"set\",\"version\",s],{quiet:!0});if(n!==0)return n;let c=[];return this.private&&c.push(\"-p\"),this.workspace&&c.push(\"-w\"),this.name&&c.push(`-n=${this.name}`),this.yes&&c.push(\"-y\"),await ce.mktempPromise(async f=>{let{code:p}=await qr.pipevp(\"yarn\",[\"init\",...c],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await In.makeScriptEnv({binFolder:f})});return p})}async initialize(){}async executeRegular(r){let s=null;try{s=(await Tt.find(r,this.context.cwd)).project}catch{s=null}ce.existsSync(this.context.cwd)||await ce.mkdirPromise(this.context.cwd,{recursive:!0});let a=await Ut.tryFind(this.context.cwd),n=a??new Ut,c=Object.fromEntries(r.get(\"initFields\").entries());n.load(c),n.name=n.name??G.makeIdent(r.get(\"initScope\"),this.name??J.basename(this.context.cwd)),n.packageManager=fn&&je.isTaggedYarnVersion(fn)?`yarn@${fn}`:null,(!a&&this.workspace||this.private)&&(n.private=!0),this.workspace&&n.workspaceDefinitions.length===0&&(await ce.mkdirPromise(J.join(this.context.cwd,\"packages\"),{recursive:!0}),n.workspaceDefinitions=[{pattern:\"packages/*\"}]);let f={};n.exportTo(f);let p=J.join(this.context.cwd,Ut.fileName);await ce.changeFilePromise(p,`${JSON.stringify(f,null,2)}\n`,{automaticNewlines:!0});let h=[p],E=J.join(this.context.cwd,\"README.md\");if(ce.existsSync(E)||(await ce.writeFilePromise(E,`# ${G.stringifyIdent(n.name)}\n`),h.push(E)),!s||s.cwd===this.context.cwd){let C=J.join(this.context.cwd,Er.lockfile);ce.existsSync(C)||(await ce.writeFilePromise(C,\"\"),h.push(C));let P=[\".yarn/*\",\"!.yarn/patches\",\"!.yarn/plugins\",\"!.yarn/releases\",\"!.yarn/sdks\",\"!.yarn/versions\",\"\",\"# Whether you use PnP or not, the node_modules folder is often used to store\",\"# build artifacts that should be gitignored\",\"node_modules\",\"\",\"# Swap the comments on the following lines if you wish to use zero-installs\",\"# In that case, don't forget to run `yarn config set enableGlobalCache false`!\",\"# Documentation here: https://yarnpkg.com/features/caching#zero-installs\",\"\",\"#!.yarn/cache\",\".pnp.*\"].map(ue=>`${ue}\n`).join(\"\"),I=J.join(this.context.cwd,\".gitignore\");ce.existsSync(I)||(await ce.writeFilePromise(I,P),h.push(I));let N=[\"/.yarn/**            linguist-vendored\",\"/.yarn/releases/*    binary\",\"/.yarn/plugins/**/*  binary\",\"/.pnp.*              binary linguist-generated\"].map(ue=>`${ue}\n`).join(\"\"),U=J.join(this.context.cwd,\".gitattributes\");ce.existsSync(U)||(await ce.writeFilePromise(U,N),h.push(U));let W={\"*\":{charset:\"utf-8\",endOfLine:\"lf\",indentSize:2,indentStyle:\"space\",insertFinalNewline:!0}};je.mergeIntoTarget(W,r.get(\"initEditorConfig\"));let ee=`root = true\n`;for(let[ue,le]of Object.entries(W)){ee+=`\n[${ue}]\n`;for(let[me,pe]of Object.entries(le)){let Be=me.replace(/[A-Z]/g,Ce=>`_${Ce.toLowerCase()}`);ee+=`${Be} = ${pe}\n`}}let ie=J.join(this.context.cwd,\".editorconfig\");ce.existsSync(ie)||(await ce.writeFilePromise(ie,ee),h.push(ie)),await this.cli.run([\"install\"],{quiet:!0}),await this.initialize(),ce.existsSync(J.join(this.context.cwd,\".git\"))||(await qr.execvp(\"git\",[\"init\"],{cwd:this.context.cwd}),await qr.execvp(\"git\",[\"add\",\"--\",...h],{cwd:this.context.cwd}),await qr.execvp(\"git\",[\"commit\",\"--allow-empty\",\"-m\",\"First commit\"],{cwd:this.context.cwd}))}}};var nw=class extends z0{constructor(){super(...arguments);this.initializer=ge.String();this.argv=ge.Proxy()}static{this.paths=[[\"init\"]]}async initialize(){this.context.stdout.write(`\n`),await this.cli.run([\"dlx\",this.initializer,...this.argv],{quiet:!0})}};var dut={configuration:{initScope:{description:\"Scope used when creating packages via the init command\",type:\"STRING\",default:null},initFields:{description:\"Additional fields to set when creating packages via the init command\",type:\"MAP\",valueDefinition:{description:\"\",type:\"ANY\"}},initEditorConfig:{description:\"Extra rules to define in the generator editorconfig\",type:\"MAP\",valueDefinition:{description:\"\",type:\"ANY\"}}},commands:[z0,nw]},mut=dut;var JW={};Vt(JW,{SearchCommand:()=>Iw,UpgradeInteractiveCommand:()=>Cw,default:()=>Dgt});Ge();var FEe=ut(Ie(\"os\"));function iw({stdout:t}){if(FEe.default.endianness()===\"BE\")throw new Error(\"Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures\");if(!t.isTTY)throw new Error(\"Interactive commands can only be used inside a TTY environment\")}Yt();var YIe=ut(g9()),d9={appId:\"OFCNCOG2CU\",apiKey:\"6fe4476ee5a1832882e326b506d14126\",indexName:\"npm-search\"},hAt=(0,YIe.default)(d9.appId,d9.apiKey).initIndex(d9.indexName),m9=async(t,e=0)=>await hAt.search(t,{analyticsTags:[\"yarn-plugin-interactive-tools\"],attributesToRetrieve:[\"name\",\"version\",\"owner\",\"repository\",\"humanDownloadsLast30Days\"],page:e,hitsPerPage:10});var CD=[\"regular\",\"dev\",\"peer\"],Iw=class extends ft{static{this.paths=[[\"search\"]]}static{this.usage=ot.Usage({category:\"Interactive commands\",description:\"open the search interface\",details:`\n    This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.\n    `,examples:[[\"Open the search window\",\"yarn search\"]]})}async execute(){iw(this.context);let{Gem:e}=await Promise.resolve().then(()=>(WF(),LW)),{ScrollableItems:r}=await Promise.resolve().then(()=>(KF(),JF)),{useKeypress:s}=await Promise.resolve().then(()=>(yD(),w2e)),{useMinistore:a}=await Promise.resolve().then(()=>(GW(),jW)),{renderForm:n}=await Promise.resolve().then(()=>($F(),ZF)),{default:c}=await Promise.resolve().then(()=>ut(T2e())),{Box:f,Text:p}=await Promise.resolve().then(()=>ut(Wc())),{default:h,useEffect:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),P=()=>h.createElement(f,{flexDirection:\"row\"},h.createElement(f,{flexDirection:\"column\",width:48},h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to move between packages.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" to select a package.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" again to change the target.\"))),h.createElement(f,{flexDirection:\"column\"},h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install the selected packages.\")),h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),I=()=>h.createElement(h.Fragment,null,h.createElement(f,{width:15},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Owner\")),h.createElement(f,{width:11},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Version\")),h.createElement(f,{width:10},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Downloads\"))),R=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Target\")),N=({hit:pe,active:Be})=>{let[Ce,g]=a(pe.name,null);s({active:Be},(Ae,se)=>{if(se.name!==\"space\")return;if(!Ce){g(CD[0]);return}let Z=CD.indexOf(Ce)+1;Z===CD.length?g(null):g(CD[Z])},[Ce,g]);let we=G.parseIdent(pe.name),ye=G.prettyIdent(S,we);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:\"wrap\"},ye)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:\"truncate\"},pe.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:\"truncate\"},pe.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,pe.humanDownloadsLast30Days)))},U=({name:pe,active:Be})=>{let[Ce]=a(pe,null),g=G.parseIdent(pe);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0},\" - \",G.prettyIdent(S,g))),CD.map(we=>h.createElement(f,{key:we,width:14,marginLeft:1},h.createElement(p,null,\" \",h.createElement(e,{active:Ce===we}),\" \",h.createElement(p,{bold:!0},we)))))},W=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,\"Powered by Algolia.\")),ie=await n(({useSubmit:pe})=>{let Be=a();pe(Be);let Ce=Array.from(Be.keys()).filter(j=>Be.get(j)!==null),[g,we]=C(\"\"),[ye,Ae]=C(0),[se,Z]=C([]),De=j=>{j.match(/\\t| /)||we(j)},Re=async()=>{Ae(0);let j=await m9(g);j.query===g&&Z(j.hits)},mt=async()=>{let j=await m9(g,ye+1);j.query===g&&j.page-1===ye&&(Ae(j.page),Z([...se,...j.hits]))};return E(()=>{g?Re():Z([])},[g]),h.createElement(f,{flexDirection:\"column\"},h.createElement(P,null),h.createElement(f,{flexDirection:\"row\",marginTop:1},h.createElement(p,{bold:!0},\"Search: \"),h.createElement(f,{width:41},h.createElement(c,{value:g,onChange:De,placeholder:\"i.e. babel, webpack, react...\",showCursor:!1})),h.createElement(I,null)),se.length?h.createElement(r,{radius:2,loop:!1,children:se.map(j=>h.createElement(N,{key:j.name,hit:j,active:!1})),willReachEnd:mt}):h.createElement(p,{color:\"gray\"},\"Start typing...\"),h.createElement(f,{flexDirection:\"row\",marginTop:1},h.createElement(f,{width:49},h.createElement(p,{bold:!0},\"Selected:\")),h.createElement(R,null)),Ce.length?Ce.map(j=>h.createElement(U,{key:j,name:j,active:!1})):h.createElement(p,{color:\"gray\"},\"No selected packages...\"),h.createElement(W,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ie>\"u\")return 1;let ue=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"regular\"),le=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"dev\"),me=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"peer\");return ue.length&&await this.cli.run([\"add\",...ue]),le.length&&await this.cli.run([\"add\",\"--dev\",...le]),me&&await this.cli.run([\"add\",\"--peer\",...me]),0}};Ge();Yt();YG();var U2e=ut(Ai()),M2e=/^((?:[\\^~]|>=?)?)([0-9]+)(\\.[0-9]+)(\\.[0-9]+)((?:-\\S+)?)$/;function _2e(t,e){return t.length>0?[t.slice(0,e)].concat(_2e(t.slice(e),e)):[]}var Cw=class extends ft{static{this.paths=[[\"upgrade-interactive\"]]}static{this.usage=ot.Usage({category:\"Interactive commands\",description:\"open the upgrade interface\",details:`\n      This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.\n    `,examples:[[\"Open the upgrade window\",\"yarn upgrade-interactive\"]]})}async execute(){iw(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(L2e(),O2e)),{Pad:r}=await Promise.resolve().then(()=>(VW(),N2e)),{ScrollableItems:s}=await Promise.resolve().then(()=>(KF(),JF)),{useMinistore:a}=await Promise.resolve().then(()=>(GW(),jW)),{renderForm:n}=await Promise.resolve().then(()=>($F(),ZF)),{Box:c,Text:f}=await Promise.resolve().then(()=>ut(Wc())),{default:p,useEffect:h,useRef:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,this.context.cwd),R=await Kr.find(S);if(!I)throw new ar(P.cwd,this.context.cwd);await P.restoreInstallState({restoreResolutions:!1});let N=this.context.stdout.rows-7,U=(we,ye)=>{let Ae=mde(we,ye),se=\"\";for(let Z of Ae)Z.added?se+=he.pretty(S,Z.value,\"green\"):Z.removed||(se+=Z.value);return se},W=(we,ye)=>{if(we===ye)return ye;let Ae=G.parseRange(we),se=G.parseRange(ye),Z=Ae.selector.match(M2e),De=se.selector.match(M2e);if(!Z||!De)return U(we,ye);let Re=[\"gray\",\"red\",\"yellow\",\"green\",\"magenta\"],mt=null,j=\"\";for(let rt=1;rt<Re.length;++rt)mt!==null||Z[rt]!==De[rt]?(mt===null&&(mt=Re[rt-1]),j+=he.pretty(S,De[rt],mt)):j+=De[rt];return j},ee=async(we,ye,Ae)=>{let se=await Xu.fetchDescriptorFrom(we,Ae,{project:P,cache:R,preserveModifier:ye,workspace:I});return se!==null?se.range:we.range},ie=async we=>{let ye=U2e.default.valid(we.range)?`^${we.range}`:we.range,[Ae,se]=await Promise.all([ee(we,we.range,ye).catch(()=>null),ee(we,we.range,\"latest\").catch(()=>null)]),Z=[{value:null,label:we.range}];return Ae&&Ae!==we.range?Z.push({value:Ae,label:W(we.range,Ae)}):Z.push({value:null,label:\"\"}),se&&se!==Ae&&se!==we.range?Z.push({value:se,label:W(we.range,se)}):Z.push({value:null,label:\"\"}),Z},ue=()=>p.createElement(c,{flexDirection:\"row\"},p.createElement(c,{flexDirection:\"column\",width:49},p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to select packages.\")),p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<left>\"),\"/\",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<right>\"),\" to select versions.\"))),p.createElement(c,{flexDirection:\"column\"},p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install.\")),p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),le=()=>p.createElement(c,{flexDirection:\"row\",paddingTop:1,paddingBottom:1},p.createElement(c,{width:50},p.createElement(f,{bold:!0},p.createElement(f,{color:\"greenBright\"},\"?\"),\" Pick the packages you want to upgrade.\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Current\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Range\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Latest\"))),me=({active:we,descriptor:ye,suggestions:Ae})=>{let[se,Z]=a(ye.descriptorHash,null),De=G.stringifyIdent(ye),Re=Math.max(0,45-De.length);return p.createElement(p.Fragment,null,p.createElement(c,null,p.createElement(c,{width:45},p.createElement(f,{bold:!0},G.prettyIdent(S,ye)),p.createElement(r,{active:we,length:Re})),p.createElement(e,{active:we,options:Ae,value:se,skewer:!0,onChange:Z,sizes:[17,17,17]})))},pe=({dependencies:we})=>{let[ye,Ae]=C(we.map(()=>null)),se=E(!0),Z=async De=>{let Re=await ie(De);return Re.filter(mt=>mt.label!==\"\").length<=1?null:{descriptor:De,suggestions:Re}};return h(()=>()=>{se.current=!1},[]),h(()=>{let De=Math.trunc(N*1.75),Re=we.slice(0,De),mt=we.slice(De),j=_2e(mt,N),rt=Re.map(Z).reduce(async(Fe,Ne)=>{await Fe;let Pe=await Ne;Pe!==null&&se.current&&Ae(Ve=>{let ke=Ve.findIndex(Ue=>Ue===null),it=[...Ve];return it[ke]=Pe,it})},Promise.resolve());j.reduce((Fe,Ne)=>Promise.all(Ne.map(Pe=>Promise.resolve().then(()=>Z(Pe)))).then(async Pe=>{Pe=Pe.filter(Ve=>Ve!==null),await Fe,se.current&&Ae(Ve=>{let ke=Ve.findIndex(it=>it===null);return Ve.slice(0,ke).concat(Pe).concat(Ve.slice(ke+Pe.length))})}),rt).then(()=>{se.current&&Ae(Fe=>Fe.filter(Ne=>Ne!==null))})},[]),ye.length?p.createElement(s,{radius:N>>1,children:ye.map((De,Re)=>De!==null?p.createElement(me,{key:Re,active:!1,descriptor:De.descriptor,suggestions:De.suggestions}):p.createElement(f,{key:Re},\"Loading...\"))}):p.createElement(f,null,\"No upgrades found\")},Ce=await n(({useSubmit:we})=>{we(a());let ye=new Map;for(let se of P.workspaces)for(let Z of[\"dependencies\",\"devDependencies\"])for(let De of se.manifest[Z].values())P.tryWorkspaceByDescriptor(De)===null&&(De.range.startsWith(\"link:\")||ye.set(De.descriptorHash,De));let Ae=je.sortMap(ye.values(),se=>G.stringifyDescriptor(se));return p.createElement(c,{flexDirection:\"column\"},p.createElement(ue,null),p.createElement(le,null),p.createElement(pe,{dependencies:Ae}))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof Ce>\"u\")return 1;let g=!1;for(let we of P.workspaces)for(let ye of[\"dependencies\",\"devDependencies\"]){let Ae=we.manifest[ye];for(let se of Ae.values()){let Z=Ce.get(se.descriptorHash);typeof Z<\"u\"&&Z!==null&&(Ae.set(se.identHash,G.makeDescriptor(se,Z)),g=!0)}}return g?await P.installWithNewReport({quiet:this.context.quiet,stdout:this.context.stdout},{cache:R}):0}};var Sgt={commands:[Iw,Cw]},Dgt=Sgt;var zW={};Vt(zW,{default:()=>kgt});Ge();var BD=\"jsr:\";Ge();Ge();function ww(t){let e=t.range.slice(4);if(Fr.validRange(e))return G.makeDescriptor(t,`npm:${G.stringifyIdent(G.wrapIdentIntoScope(t,\"jsr\"))}@${e}`);let r=G.tryParseDescriptor(e,!0);if(r!==null)return G.makeDescriptor(t,`npm:${G.stringifyIdent(G.wrapIdentIntoScope(r,\"jsr\"))}@${r.range}`);throw new Error(`Invalid range: ${t.range}`)}function Bw(t){return G.makeLocator(G.wrapIdentIntoScope(t,\"jsr\"),`npm:${t.reference.slice(4)}`)}function KW(t){return G.makeLocator(G.unwrapIdentFromScope(t,\"jsr\"),`jsr:${t.reference.slice(4)}`)}var eN=class{supports(e,r){return e.reference.startsWith(BD)}getLocalPath(e,r){let s=Bw(e);return r.fetcher.getLocalPath(s,r)}fetch(e,r){let s=Bw(e);return r.fetcher.fetch(s,r)}};var tN=class{supportsDescriptor(e,r){return!!e.range.startsWith(BD)}supportsLocator(e,r){return!!e.reference.startsWith(BD)}shouldPersistResolution(e,r){let s=Bw(e);return r.resolver.shouldPersistResolution(s,r)}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{inner:ww(e)}}async getCandidates(e,r,s){let a=s.project.configuration.normalizeDependency(ww(e));return(await s.resolver.getCandidates(a,r,s)).map(c=>KW(c))}async getSatisfying(e,r,s,a){let n=a.project.configuration.normalizeDependency(ww(e));return a.resolver.getSatisfying(n,r,s,a)}async resolve(e,r){let s=Bw(e),a=await r.resolver.resolve(s,r);return{...a,...KW(a)}}};var bgt=[\"dependencies\",\"devDependencies\",\"peerDependencies\"];function Pgt(t,e){for(let r of bgt)for(let s of t.manifest.getForScope(r).values()){if(!s.range.startsWith(\"jsr:\"))continue;let a=ww(s),n=r===\"dependencies\"?G.makeDescriptor(s,\"unknown\"):null,c=n!==null&&t.manifest.ensureDependencyMeta(n).optional?\"optionalDependencies\":r;e[c][G.stringifyIdent(s)]=a.range}}var xgt={hooks:{beforeWorkspacePacking:Pgt},resolvers:[tN],fetchers:[eN]},kgt=xgt;var XW={};Vt(XW,{LinkFetcher:()=>vD,LinkResolver:()=>SD,PortalFetcher:()=>DD,PortalResolver:()=>bD,default:()=>Tgt});Ge();Dt();var rh=\"portal:\",nh=\"link:\";var vD=class{supports(e,r){return!!e.reference.startsWith(nh)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:nh});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:nh}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath),localPath:vt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Sn(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,discardFromLookup:!0,localPath:p}:{packageFs:new Hf(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,discardFromLookup:!0}}};Ge();Dt();var SD=class{supportsDescriptor(e,r){return!!e.range.startsWith(nh)}supportsLocator(e,r){return!!e.reference.startsWith(nh)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(nh.length);return[G.makeLocator(e,`${nh}${fe.toPortablePath(a)}`)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){return{...e,version:\"0.0.0\",languageName:r.project.configuration.get(\"defaultLanguageName\"),linkType:\"SOFT\",conditions:null,dependencies:new Map,peerDependencies:new Map,dependenciesMeta:new Map,peerDependenciesMeta:new Map,bin:new Map}}};Ge();Dt();var DD=class{supports(e,r){return!!e.reference.startsWith(rh)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:rh});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:rh}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath),localPath:vt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Sn(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,localPath:p}:{packageFs:new Hf(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot}}};Ge();Ge();Dt();var bD=class{supportsDescriptor(e,r){return!!e.range.startsWith(rh)}supportsLocator(e,r){return!!e.reference.startsWith(rh)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(rh.length);return[G.makeLocator(e,`${rh}${fe.toPortablePath(a)}`)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"SOFT\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var Qgt={fetchers:[vD,DD],resolvers:[SD,bD]},Tgt=Qgt;var FY={};Vt(FY,{NodeModulesLinker:()=>jD,NodeModulesMode:()=>kY,PnpLooseLinker:()=>GD,default:()=>Kdt});Dt();Ge();Dt();Dt();var $W=(t,e)=>`${t}@${e}`,H2e=(t,e)=>{let r=e.indexOf(\"#\"),s=r>=0?e.substring(r+1):e;return $W(t,s)};var G2e=(t,e={})=>{let r=e.debugLevel||Number(process.env.NM_DEBUG_LEVEL||-1),s=e.check||r>=9,a=e.hoistingLimits||new Map,n={check:s,debugLevel:r,hoistingLimits:a,fastLookupPossible:!0},c;n.debugLevel>=0&&(c=Date.now());let f=Ugt(t,n),p=!1,h=0;do{let E=eY(f,[f],new Set([f.locator]),new Map,n);p=E.anotherRoundNeeded||E.isGraphChanged,n.fastLookupPossible=!1,h++}while(p);if(n.debugLevel>=0&&console.log(`hoist time: ${Date.now()-c}ms, rounds: ${h}`),n.debugLevel>=1){let E=PD(f);if(eY(f,[f],new Set([f.locator]),new Map,n).isGraphChanged)throw new Error(`The hoisting result is not terminal, prev tree:\n${E}, next tree:\n${PD(f)}`);let S=q2e(f);if(S)throw new Error(`${S}, after hoisting finished:\n${PD(f)}`)}return n.debugLevel>=2&&console.log(PD(f)),_gt(f)},Rgt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=n=>{if(!s.has(n)){s.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(e),r},Fgt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=new Set,n=(c,f)=>{if(s.has(c))return;s.add(c);for(let h of c.hoistedDependencies.values())if(!f.has(h.name)){let E;for(let C of t)E=C.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of c.dependencies.values())p.add(h.name);for(let h of c.dependencies.values())c.peerNames.has(h.name)||n(h,p)};return n(e,a),r},j2e=(t,e)=>{if(e.decoupled)return e;let{name:r,references:s,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:C,hoistPriority:S,dependencyKind:P,hoistedFrom:I,hoistedTo:R}=e,N={name:r,references:new Set(s),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:C,hoistPriority:S,dependencyKind:P,hoistedFrom:new Map(I),hoistedTo:new Map(R)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),t.dependencies.set(N.name,N),N},Ngt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let s=Array.from(e.keys());s.sort((a,n)=>{let c=e.get(a),f=e.get(n);if(f.hoistPriority!==c.hoistPriority)return f.hoistPriority-c.hoistPriority;{let p=c.dependents.size+c.peerDependents.size;return f.dependents.size+f.peerDependents.size-p}});for(let a of s){let n=a.substring(0,a.indexOf(\"@\",1)),c=a.substring(n.length+1);if(!t.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},ZW=t=>{let e=new Set,r=(s,a=new Set)=>{if(!a.has(s)){a.add(s);for(let n of s.peerNames)if(!t.peerNames.has(n)){let c=t.dependencies.get(n);c&&!e.has(c)&&r(c,a)}e.add(s)}};for(let s of t.dependencies.values())t.peerNames.has(s.name)||r(s);return e},eY=(t,e,r,s,a,n=new Set)=>{let c=e[e.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=Hgt(c),p=Ngt(c,f),h=t==c?new Map:a.fastLookupPossible?Rgt(e):Fgt(e),E,C=!1,S=!1,P=new Map(Array.from(p.entries()).map(([R,N])=>[R,N[0]])),I=new Map;do{let R=Mgt(t,e,r,h,P,p,s,I,a);R.isGraphChanged&&(S=!0),R.anotherRoundNeeded&&(C=!0),E=!1;for(let[N,U]of p)U.length>1&&!c.dependencies.has(N)&&(P.delete(N),U.shift(),P.set(N,U[0]),E=!0)}while(E);for(let R of c.dependencies.values())if(!c.peerNames.has(R.name)&&!r.has(R.locator)){r.add(R.locator);let N=eY(t,[...e,R],r,I,a);N.isGraphChanged&&(S=!0),N.anotherRoundNeeded&&(C=!0),r.delete(R.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},Ogt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},Lgt=(t,e,r,s,a,n,c,f,{outputReason:p,fastLookupPossible:h})=>{let E,C=null,S=new Set;p&&(E=`${Array.from(e).map(N=>yo(N)).join(\"\\u2192\")}`);let P=r[r.length-1],R=!(s.ident===P.ident);if(p&&!R&&(C=\"- self-reference\"),R&&(R=s.dependencyKind!==1,p&&!R&&(C=\"- workspace\")),R&&s.dependencyKind===2&&(R=!Ogt(s),p&&!R&&(C=\"- external soft link with unhoisted dependencies\")),R&&(R=!t.peerNames.has(s.name),p&&!R&&(C=`- cannot shadow peer: ${yo(t.originalDependencies.get(s.name).locator)} at ${E}`)),R){let N=!1,U=a.get(s.name);if(N=!U||U.ident===s.ident,p&&!N&&(C=`- filled by: ${yo(U.locator)} at ${E}`),N)for(let W=r.length-1;W>=1;W--){let ie=r[W].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){N=!1;let ue=f.get(P);ue||(ue=new Set,f.set(P,ue)),ue.add(s.name),p&&(C=`- filled by ${yo(ie.locator)} at ${r.slice(0,W).map(le=>yo(le.locator)).join(\"\\u2192\")}`);break}}R=N}if(R&&(R=n.get(s.name)===s.ident,p&&!R&&(C=`- filled by: ${yo(c.get(s.name)[0])} at ${E}`)),R){let N=!0,U=new Set(s.peerNames);for(let W=r.length-1;W>=1;W--){let ee=r[W];for(let ie of U){if(ee.peerNames.has(ie)&&ee.originalDependencies.has(ie))continue;let ue=ee.dependencies.get(ie);ue&&t.dependencies.get(ie)!==ue&&(W===r.length-1?S.add(ue):(S=null,N=!1,p&&(C=`- peer dependency ${yo(ue.locator)} from parent ${yo(ee.locator)} was not hoisted to ${E}`))),U.delete(ie)}if(!N)break}R=N}if(R&&!h)for(let N of s.hoistedDependencies.values()){let U=a.get(N.name)||t.dependencies.get(N.name);if(!U||N.ident!==U.ident){R=!1,p&&(C=`- previously hoisted dependency mismatch, needed: ${yo(N.locator)}, available: ${yo(U?.locator)}`);break}}return S!==null&&S.size>0?{isHoistable:2,dependsOn:S,reason:C}:{isHoistable:R?0:1,reason:C}},rN=t=>`${t.name}@${t.locator}`,Mgt=(t,e,r,s,a,n,c,f,p)=>{let h=e[e.length-1],E=new Set,C=!1,S=!1,P=(U,W,ee,ie,ue)=>{if(E.has(ie))return;let le=[...W,rN(ie)],me=[...ee,rN(ie)],pe=new Map,Be=new Map;for(let Ae of ZW(ie)){let se=Lgt(h,r,[h,...U,ie],Ae,s,a,n,f,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(Be.set(Ae,se),se.isHoistable===2)for(let Z of se.dependsOn){let De=pe.get(Z.name)||new Set;De.add(Ae.name),pe.set(Z.name,De)}}let Ce=new Set,g=(Ae,se,Z)=>{if(!Ce.has(Ae)){Ce.add(Ae),Be.set(Ae,{isHoistable:1,reason:Z});for(let De of pe.get(Ae.name)||[])g(ie.dependencies.get(De),se,p.debugLevel>=2?`- peer dependency ${yo(Ae.locator)} from parent ${yo(ie.locator)} was not hoisted`:\"\")}};for(let[Ae,se]of Be)se.isHoistable===1&&g(Ae,se,se.reason);let we=!1;for(let Ae of Be.keys())if(!Ce.has(Ae)){S=!0;let se=c.get(ie);se&&se.has(Ae.name)&&(C=!0),we=!0,ie.dependencies.delete(Ae.name),ie.hoistedDependencies.set(Ae.name,Ae),ie.reasons.delete(Ae.name);let Z=h.dependencies.get(Ae.name);if(p.debugLevel>=2){let De=Array.from(W).concat([ie.locator]).map(mt=>yo(mt)).join(\"\\u2192\"),Re=h.hoistedFrom.get(Ae.name);Re||(Re=[],h.hoistedFrom.set(Ae.name,Re)),Re.push(De),ie.hoistedTo.set(Ae.name,Array.from(e).map(mt=>yo(mt.locator)).join(\"\\u2192\"))}if(!Z)h.ident!==Ae.ident&&(h.dependencies.set(Ae.name,Ae),ue.add(Ae));else for(let De of Ae.references)Z.references.add(De)}if(ie.dependencyKind===2&&we&&(C=!0),p.check){let Ae=q2e(t);if(Ae)throw new Error(`${Ae}, after hoisting dependencies of ${[h,...U,ie].map(se=>yo(se.locator)).join(\"\\u2192\")}:\n${PD(t)}`)}let ye=ZW(ie);for(let Ae of ye)if(Ce.has(Ae)){let se=Be.get(Ae);if((a.get(Ae.name)===Ae.ident||!ie.reasons.has(Ae.name))&&se.isHoistable!==0&&ie.reasons.set(Ae.name,se.reason),!Ae.isHoistBorder&&me.indexOf(rN(Ae))<0){E.add(ie);let De=j2e(ie,Ae);P([...U,ie],le,me,De,R),E.delete(ie)}}},I,R=new Set(ZW(h)),N=Array.from(e).map(U=>rN(U));do{I=R,R=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let W=j2e(h,U);P([],Array.from(r),N,W,R)}}while(R.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},q2e=t=>{let e=[],r=new Set,s=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),s.has(n)))return;let p=new Map(c);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),C=()=>`${Array.from(s).concat([n]).map(S=>yo(S.locator)).join(\"\\u2192\")}`;if(n.peerNames.has(h.name)){let S=c.get(h.name);(S!==E||!S||S.ident!==h.ident)&&e.push(`${C()} - broken peer promise: expected ${h.ident} but found ${S&&S.ident}`)}else{let S=f.hoistedFrom.get(n.name),P=n.hoistedTo.get(h.name),I=`${S?` hoisted from ${S.join(\", \")}`:\"\"}`,R=`${P?` hoisted to ${P}`:\"\"}`,N=`${C()}${I}`;E?E.ident!==h.ident&&e.push(`${N} - broken require promise for ${h.name}${R}: expected ${h.ident}, but found: ${E.ident}`):e.push(`${N} - broken require promise: no required dependency ${h.name}${R} found`)}}s.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);s.delete(n)};return a(t,t.dependencies,t),e.join(`\n`)},Ugt=(t,e)=>{let{identName:r,name:s,reference:a,peerNames:n}=t,c={name:s,references:new Set([a]),locator:$W(r,a),ident:H2e(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[t,c]]),p=(h,E)=>{let C=f.get(h),S=!!C;if(!C){let{name:P,identName:I,reference:R,peerNames:N,hoistPriority:U,dependencyKind:W}=h,ee=e.hoistingLimits.get(E.locator);C={name:P,references:new Set([R]),locator:$W(I,R),ident:H2e(I,R),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:ee?ee.has(P):!1,hoistPriority:U||0,dependencyKind:W||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(h,C)}if(E.dependencies.set(h.name,C),E.originalDependencies.set(h.name,C),S){let P=new Set,I=R=>{if(!P.has(R)){P.add(R),R.decoupled=!1;for(let N of R.dependencies.values())R.peerNames.has(N.name)||I(N)}};I(C)}else for(let P of h.dependencies)p(P,C)};for(let h of t.dependencies)p(h,c);return c},tY=t=>t.substring(0,t.indexOf(\"@\",1)),_gt=t=>{let e={name:t.name,identName:tY(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),s=(a,n,c)=>{let f=r.has(a),p;if(n===a)p=c;else{let{name:h,references:E,locator:C}=a;p={name:h,identName:tY(C),references:E,dependencies:new Set}}if(c.dependencies.add(p),!f){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||s(h,a,p);r.delete(a)}};for(let a of t.dependencies.values())s(a,t,e);return e},Hgt=t=>{let e=new Map,r=new Set([t]),s=c=>`${c.name}@${c.ident}`,a=c=>{let f=s(c),p=e.get(f);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(f,p)),p},n=(c,f)=>{let p=!!r.has(f);if(a(f).dependents.add(c.ident),!p){r.add(f);for(let E of f.dependencies.values()){let C=a(E);C.hoistPriority=Math.max(C.hoistPriority,E.hoistPriority),f.peerNames.has(E.name)?C.peerDependents.add(f.ident):n(f,E)}}};for(let c of t.dependencies.values())t.peerNames.has(c.name)||n(t,c);return e},yo=t=>{if(!t)return\"none\";let e=t.indexOf(\"@\",1),r=t.substring(0,e);r.endsWith(\"$wsroot$\")&&(r=`wh:${r.replace(\"$wsroot$\",\"\")}`);let s=t.substring(e+1);if(s===\"workspace:.\")return\".\";if(s){let a=(s.indexOf(\"#\")>0?s.split(\"#\")[1]:s).replace(\"npm:\",\"\");return s.startsWith(\"virtual\")&&(r=`v:${r}`),a.startsWith(\"workspace\")&&(r=`w:${r}`,a=\"\"),`${r}${a?`@${a}`:\"\"}`}else return`${r}`};var PD=t=>{let e=0,r=(a,n,c=\"\")=>{if(e>5e4||n.has(a))return\"\";e++;let f=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p=\"\";n.add(a);for(let h=0;h<f.length;h++){let E=f[h];if(!a.peerNames.has(E.name)&&E!==a){let C=a.reasons.get(E.name),S=tY(E.locator);p+=`${c}${h<f.length-1?\"\\u251C\\u2500\":\"\\u2514\\u2500\"}${(n.has(E)?\">\":\"\")+(S!==E.name?`a:${E.name}:`:\"\")+yo(E.locator)+(C?` ${C}`:\"\")}\n`,p+=r(E,n,`${c}${h<f.length-1?\"\\u2502 \":\"  \"}`)}}return n.delete(a),p};return r(t,new Set)+(e>5e4?`\nTree is too large, part of the tree has been dunped\n`:\"\")};var xD=(s=>(s.WORKSPACES=\"workspaces\",s.DEPENDENCIES=\"dependencies\",s.NONE=\"none\",s))(xD||{}),W2e=\"node_modules\",rg=\"$wsroot$\";var kD=(t,e)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=Ggt(t,e),c=null;if(a.length===0){let f=G2e(r,{hoistingLimits:s});c=Wgt(t,f,e)}return{tree:c,errors:a,preserveSymlinksRequired:n}},pA=t=>`${t.name}@${t.reference}`,nY=t=>{let e=new Map;for(let[r,s]of t.entries())if(!s.dirList){let a=e.get(s.locator);a||(a={target:s.target,linkType:s.linkType,locations:[],aliases:s.aliases},e.set(s.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((s,a)=>{let n=s.split(J.delimiter).length,c=a.split(J.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return e},Y2e=(t,e)=>{let r=G.isVirtualLocator(t)?G.devirtualizeLocator(t):t,s=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e;return G.areLocatorsEqual(r,s)},rY=(t,e,r,s)=>{if(t.linkType!==\"SOFT\")return!1;let a=fe.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith(\"virtual:\")?r.resolveVirtual(t.packageLocation):t.packageLocation);return J.contains(s,a)===null},jgt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error(\"Assertion failed: Expected the top-level package to have been registered\");if(t.findPackageLocator(e.packageLocation)===null)throw new Error(\"Assertion failed: Expected the top-level package to have a physical locator\");let s=fe.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=t.getDependencyTreeRoots(),f=new Map,p=new Set,h=(S,P)=>{let I=pA(S);if(p.has(I))return;p.add(I);let R=t.getPackageInformation(S);if(R){let N=P?pA(P):\"\";if(pA(S)!==N&&R.linkType===\"SOFT\"&&!S.reference.startsWith(\"link:\")&&!rY(R,S,t,s)){let U=V2e(R,S,t);(!f.get(U)||S.reference.startsWith(\"workspace:\"))&&f.set(U,S)}for(let[U,W]of R.packageDependencies)W!==null&&(R.packagePeers.has(U)||h(t.getLocator(U,W),S))}};for(let S of c)h(S,null);let E=s.split(J.sep);for(let S of f.values()){let P=t.getPackageInformation(S),R=fe.toPortablePath(P.packageLocation.slice(0,-1)).split(J.sep).slice(E.length),N=n;for(let U of R){let W=N.children.get(U);W||(W={children:new Map},N.children.set(U,W)),N=W}N.workspaceLocator=S}let C=(S,P)=>{if(S.workspaceLocator){let I=pA(P),R=a.get(I);R||(R=new Set,a.set(I,R)),R.add(S.workspaceLocator)}for(let I of S.children.values())C(I,S.workspaceLocator||P)};for(let S of n.children.values())C(S,n.workspaceLocator);return a},Ggt=(t,e)=>{let r=[],s=!1,a=new Map,n=jgt(t),c=t.getPackageInformation(t.topLevel);if(c===null)throw new Error(\"Assertion failed: Expected the top-level package to have been registered\");let f=t.findPackageLocator(c.packageLocation);if(f===null)throw new Error(\"Assertion failed: Expected the top-level package to have a physical locator\");let p=fe.toPortablePath(c.packageLocation.slice(0,-1)),h={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,C=(P,I)=>`${pA(I)}:${P}`,S=(P,I,R,N,U,W,ee,ie)=>{let ue=C(P,R),le=E.get(ue),me=!!le;!me&&R.name===f.name&&R.reference===f.reference&&(le=h,E.set(ue,h));let pe=rY(I,R,t,p);if(!le){let Ae=0;pe?Ae=2:I.linkType===\"SOFT\"&&R.name.endsWith(rg)&&(Ae=1),le={name:P,identName:R.name,reference:R.reference,dependencies:new Set,peerNames:Ae===1?new Set:I.packagePeers,dependencyKind:Ae},E.set(ue,le)}let Be;if(pe?Be=2:U.linkType===\"SOFT\"?Be=1:Be=0,le.hoistPriority=Math.max(le.hoistPriority||0,Be),ie&&!pe){let Ae=pA({name:N.identName,reference:N.reference}),se=a.get(Ae)||new Set;a.set(Ae,se),se.add(le.name)}let Ce=new Map(I.packageDependencies);if(e.project){let Ae=e.project.workspacesByCwd.get(fe.toPortablePath(I.packageLocation.slice(0,-1)));if(Ae){let se=new Set([...Array.from(Ae.manifest.peerDependencies.values(),Z=>G.stringifyIdent(Z)),...Array.from(Ae.manifest.peerDependenciesMeta.keys())]);for(let Z of se)Ce.has(Z)||(Ce.set(Z,W.get(Z)||null),le.peerNames.add(Z))}}let g=pA({name:R.name.replace(rg,\"\"),reference:R.reference}),we=n.get(g);if(we)for(let Ae of we)Ce.set(`${Ae.name}${rg}`,Ae.reference);(I!==U||I.linkType!==\"SOFT\"||!pe&&(!e.selfReferencesByCwd||e.selfReferencesByCwd.get(ee)))&&N.dependencies.add(le);let ye=R!==f&&I.linkType===\"SOFT\"&&!R.name.endsWith(rg)&&!pe;if(!me&&!ye){let Ae=new Map;for(let[se,Z]of Ce)if(Z!==null){let De=t.getLocator(se,Z),Re=t.getLocator(se.replace(rg,\"\"),Z),mt=t.getPackageInformation(Re);if(mt===null)throw new Error(\"Assertion failed: Expected the package to have been registered\");let j=rY(mt,De,t,p);if(e.validateExternalSoftLinks&&e.project&&j){mt.packageDependencies.size>0&&(s=!0);for(let[Ve,ke]of mt.packageDependencies)if(ke!==null){let it=G.parseLocator(Array.isArray(ke)?`${ke[0]}@${ke[1]}`:`${Ve}@${ke}`);if(pA(it)!==pA(De)){let Ue=Ce.get(Ve);if(Ue){let x=G.parseLocator(Array.isArray(Ue)?`${Ue[0]}@${Ue[1]}`:`${Ve}@${Ue}`);Y2e(x,it)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(De.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${R.name}@${R.reference}`))} dependency ${G.prettyLocator(e.project.configuration,it)} conflicts with parent dependency ${G.prettyLocator(e.project.configuration,x)}`})}else{let x=Ae.get(Ve);if(x){let w=x.target,b=G.parseLocator(Array.isArray(w)?`${w[0]}@${w[1]}`:`${Ve}@${w}`);Y2e(b,it)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(De.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${R.name}@${R.reference}`))} dependency ${G.prettyLocator(e.project.configuration,it)} conflicts with dependency ${G.prettyLocator(e.project.configuration,b)} from sibling portal ${G.prettyIdent(e.project.configuration,G.parseIdent(x.portal.name))}`})}else Ae.set(Ve,{target:it.reference,portal:De})}}}}let rt=e.hoistingLimitsByCwd?.get(ee),Fe=j?ee:J.relative(p,fe.toPortablePath(mt.packageLocation))||vt.dot,Ne=e.hoistingLimitsByCwd?.get(Fe);S(se,mt,De,le,I,Ce,Fe,rt===\"dependencies\"||Ne===\"dependencies\"||Ne===\"workspaces\")}}};return S(f.name,c,f,h,c,c.packageDependencies,vt.dot,!1),{packageTree:h,hoistingLimits:a,errors:r,preserveSymlinksRequired:s}};function V2e(t,e,r){let s=r.resolveVirtual&&e.reference&&e.reference.startsWith(\"virtual:\")?r.resolveVirtual(t.packageLocation):t.packageLocation;return fe.toPortablePath(s||t.packageLocation)}function qgt(t,e,r){let s=e.getLocator(t.name.replace(rg,\"\"),t.reference),a=e.getPackageInformation(s);if(a===null)throw new Error(\"Assertion failed: Expected the package to be registered\");return r.pnpifyFs?{linkType:\"SOFT\",target:fe.toPortablePath(a.packageLocation)}:{linkType:a.linkType,target:V2e(a,t,e)}}var Wgt=(t,e,r)=>{let s=new Map,a=(E,C,S)=>{let{linkType:P,target:I}=qgt(E,t,r);return{locator:pA(E),nodePath:C,target:I,linkType:P,aliases:S}},n=E=>{let[C,S]=E.split(\"/\");return S?{scope:C,name:S}:{scope:null,name:C}},c=new Set,f=(E,C,S)=>{if(c.has(E))return;c.add(E);let P=Array.from(E.references).sort().join(\"#\");for(let I of E.dependencies){let R=Array.from(I.references).sort().join(\"#\");if(I.identName===E.identName.replace(rg,\"\")&&R===P)continue;let N=Array.from(I.references).sort(),U={name:I.identName,reference:N[0]},{name:W,scope:ee}=n(I.name),ie=ee?[ee,W]:[W],ue=J.join(C,W2e),le=J.join(ue,...ie),me=`${S}/${U.name}`,pe=a(U,S,N.slice(1)),Be=!1;if(pe.linkType===\"SOFT\"&&r.project){let Ce=r.project.workspacesByCwd.get(pe.target.slice(0,-1));Be=!!(Ce&&!Ce.manifest.name)}if(!I.name.endsWith(rg)&&!Be){let Ce=s.get(le);if(Ce){if(Ce.dirList)throw new Error(`Assertion failed: ${le} cannot merge dir node with leaf node`);{let ye=G.parseLocator(Ce.locator),Ae=G.parseLocator(pe.locator);if(Ce.linkType!==pe.linkType)throw new Error(`Assertion failed: ${le} cannot merge nodes with different link types ${Ce.nodePath}/${G.stringifyLocator(ye)} and ${S}/${G.stringifyLocator(Ae)}`);if(ye.identHash!==Ae.identHash)throw new Error(`Assertion failed: ${le} cannot merge nodes with different idents ${Ce.nodePath}/${G.stringifyLocator(ye)} and ${S}/s${G.stringifyLocator(Ae)}`);pe.aliases=[...pe.aliases,...Ce.aliases,G.parseLocator(Ce.locator).reference]}}s.set(le,pe);let g=le.split(\"/\"),we=g.indexOf(W2e);for(let ye=g.length-1;we>=0&&ye>we;ye--){let Ae=fe.toPortablePath(g.slice(0,ye).join(J.sep)),se=g[ye],Z=s.get(Ae);if(!Z)s.set(Ae,{dirList:new Set([se])});else if(Z.dirList){if(Z.dirList.has(se))break;Z.dirList.add(se)}}}f(I,pe.linkType===\"SOFT\"?pe.target:le,me)}},p=a({name:e.name,reference:Array.from(e.references)[0]},\"\",[]),h=p.target;return s.set(h,p),f(e,h,\"\"),s};Ge();Ge();Dt();Dt();eA();wc();var wY={};Vt(wY,{PnpInstaller:()=>Gm,PnpLinker:()=>sg,UnplugCommand:()=>Sw,default:()=>Cdt,getPnpPath:()=>og,jsInstallUtils:()=>gA,pnpUtils:()=>HD,quotePathIfNeeded:()=>QBe});Dt();var kBe=Ie(\"url\");Ge();Ge();Dt();Dt();var J2e={DEFAULT:{collapsed:!1,next:{\"*\":\"DEFAULT\"}},TOP_LEVEL:{collapsed:!1,next:{fallbackExclusionList:\"FALLBACK_EXCLUSION_LIST\",packageRegistryData:\"PACKAGE_REGISTRY_DATA\",\"*\":\"DEFAULT\"}},FALLBACK_EXCLUSION_LIST:{collapsed:!1,next:{\"*\":\"FALLBACK_EXCLUSION_ENTRIES\"}},FALLBACK_EXCLUSION_ENTRIES:{collapsed:!0,next:{\"*\":\"FALLBACK_EXCLUSION_DATA\"}},FALLBACK_EXCLUSION_DATA:{collapsed:!0,next:{\"*\":\"DEFAULT\"}},PACKAGE_REGISTRY_DATA:{collapsed:!1,next:{\"*\":\"PACKAGE_REGISTRY_ENTRIES\"}},PACKAGE_REGISTRY_ENTRIES:{collapsed:!0,next:{\"*\":\"PACKAGE_STORE_DATA\"}},PACKAGE_STORE_DATA:{collapsed:!1,next:{\"*\":\"PACKAGE_STORE_ENTRIES\"}},PACKAGE_STORE_ENTRIES:{collapsed:!0,next:{\"*\":\"PACKAGE_INFORMATION_DATA\"}},PACKAGE_INFORMATION_DATA:{collapsed:!1,next:{packageDependencies:\"PACKAGE_DEPENDENCIES\",\"*\":\"DEFAULT\"}},PACKAGE_DEPENDENCIES:{collapsed:!1,next:{\"*\":\"PACKAGE_DEPENDENCY\"}},PACKAGE_DEPENDENCY:{collapsed:!0,next:{\"*\":\"DEFAULT\"}}};function Ygt(t,e,r){let s=\"\";s+=\"[\";for(let a=0,n=t.length;a<n;++a)s+=nN(String(a),t[a],e,r).replace(/^ +/g,\"\"),a+1<n&&(s+=\", \");return s+=\"]\",s}function Vgt(t,e,r){let s=`${r}  `,a=\"\";a+=r,a+=`[\n`;for(let n=0,c=t.length;n<c;++n)a+=s+nN(String(n),t[n],e,s).replace(/^ +/,\"\"),n+1<c&&(a+=\",\"),a+=`\n`;return a+=r,a+=\"]\",a}function Jgt(t,e,r){let s=Object.keys(t),a=\"\";a+=\"{\";for(let n=0,c=s.length,f=0;n<c;++n){let p=s[n],h=t[p];typeof h>\"u\"||(f!==0&&(a+=\", \"),a+=JSON.stringify(p),a+=\": \",a+=nN(p,h,e,r).replace(/^ +/g,\"\"),f+=1)}return a+=\"}\",a}function Kgt(t,e,r){let s=Object.keys(t),a=`${r}  `,n=\"\";n+=r,n+=`{\n`;let c=0;for(let f=0,p=s.length;f<p;++f){let h=s[f],E=t[h];typeof E>\"u\"||(c!==0&&(n+=\",\",n+=`\n`),n+=a,n+=JSON.stringify(h),n+=\": \",n+=nN(h,E,e,a).replace(/^ +/g,\"\"),c+=1)}return c!==0&&(n+=`\n`),n+=r,n+=\"}\",n}function nN(t,e,r,s){let{next:a}=J2e[r],n=a[t]||a[\"*\"];return K2e(e,n,s)}function K2e(t,e,r){let{collapsed:s}=J2e[e];return Array.isArray(t)?s?Ygt(t,e,r):Vgt(t,e,r):typeof t==\"object\"&&t!==null?s?Jgt(t,e,r):Kgt(t,e,r):JSON.stringify(t)}function z2e(t){return K2e(t,\"TOP_LEVEL\",\"\")}function QD(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let s=[];for(let n of e)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function zgt(t){let e=new Map,r=QD(t.fallbackExclusionList||[],[({name:s,reference:a})=>s,({name:s,reference:a})=>a]);for(let{name:s,reference:a}of r){let n=e.get(s);typeof n>\"u\"&&e.set(s,n=new Set),n.add(a)}return Array.from(e).map(([s,a])=>[s,Array.from(a)])}function Xgt(t){return QD(t.fallbackPool||[],([e])=>e)}function Zgt(t){let e=[],r=t.dependencyTreeRoots.find(s=>t.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation===\"./\");for(let[s,a]of QD(t.packageRegistry,([n])=>n===null?\"0\":`1${n}`)){if(s===null)continue;let n=[];e.push([s,n]);for(let[c,{packageLocation:f,packageDependencies:p,packagePeers:h,linkType:E,discardFromLookup:C}]of QD(a,([S])=>S===null?\"0\":`1${S}`)){if(c===null)continue;let S=[];s!==null&&c!==null&&!p.has(s)&&S.push([s,c]);for(let[U,W]of p)S.push([U,W]);let P=QD(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,N={packageLocation:f,packageDependencies:P,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,N]),r&&s===r.name&&c===r.reference&&e.unshift([null,[[null,N]]])}}return e}function TD(t){return{__info:[\"This file is automatically generated. Do not touch it, or risk\",\"your modifications being lost.\"],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,pnpZipBackend:t.pnpZipBackend,fallbackExclusionList:zgt(t),fallbackPool:Xgt(t),packageRegistryData:Zgt(t)}}var $2e=ut(Z2e());function eBe(t,e){return[t?`${t}\n`:\"\",`/* eslint-disable */\n`,`// @ts-nocheck\n`,`\"use strict\";\n`,`\n`,e,`\n`,(0,$2e.default)()].join(\"\")}function $gt(t){return JSON.stringify(t,null,2)}function edt(t){return`'${t.replace(/\\\\/g,\"\\\\\\\\\").replace(/'/g,\"\\\\'\").replace(/\\n/g,`\\\\\n`)}'`}function tdt(t){return[`const RAW_RUNTIME_STATE =\n`,`${edt(z2e(t))};\n\n`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {\n`,`  return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});\n`,`}\n`].join(\"\")}function rdt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {\n`,`  const fs = require('fs');\n`,`  const path = require('path');\n`,`  const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(Er.pnpData)});\n`,`  return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});\n`,`}\n`].join(\"\")}function tBe(t){let e=TD(t),r=tdt(e);return eBe(t.shebang,r)}function rBe(t){let e=TD(t),r=rdt(),s=eBe(t.shebang,r);return{dataFile:$gt(e),loaderFile:s}}Dt();function sY(t,{basePath:e}){let r=fe.toPortablePath(e),s=J.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,c=new Map(t.packageRegistryData.map(([C,S])=>[C,new Map(S.map(([P,I])=>{if(C===null!=(P===null))throw new Error(\"Assertion failed: The name and reference should be null, or neither should\");let R=I.discardFromLookup??!1,N={name:C,reference:P},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&R,R||(U.locator=N)):n.set(I.packageLocation,{locator:N,discardFromLookup:R});let W=null;return[P,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:R,get packageLocation(){return W||(W=J.join(s,I.packageLocation))}}]}))])),f=new Map(t.fallbackExclusionList.map(([C,S])=>[C,new Set(S)])),p=new Map(t.fallbackPool),h=t.dependencyTreeRoots,E=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:f,pnpZipBackend:t.pnpZipBackend,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}Dt();Dt();var sh=Ie(\"module\"),jm=Ie(\"url\"),gY=Ie(\"util\");var ta=Ie(\"url\");var oBe=ut(Ie(\"assert\"));var oY=Array.isArray,RD=JSON.stringify,FD=Object.getOwnPropertyNames,Hm=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),aY=(t,e)=>RegExp.prototype.exec.call(t,e),lY=(t,...e)=>RegExp.prototype[Symbol.replace].apply(t,e),ng=(t,...e)=>String.prototype.endsWith.apply(t,e),cY=(t,...e)=>String.prototype.includes.apply(t,e),uY=(t,...e)=>String.prototype.lastIndexOf.apply(t,e),ND=(t,...e)=>String.prototype.indexOf.apply(t,e),nBe=(t,...e)=>String.prototype.replace.apply(t,e),ig=(t,...e)=>String.prototype.slice.apply(t,e),hA=(t,...e)=>String.prototype.startsWith.apply(t,e),iBe=Map,sBe=JSON.parse;function OD(t,e,r){return class extends r{constructor(...s){super(e(...s)),this.code=t,this.name=`${r.name} [${t}]`}}}var aBe=OD(\"ERR_PACKAGE_IMPORT_NOT_DEFINED\",(t,e,r)=>`Package import specifier \"${t}\" is not defined${e?` in package ${e}package.json`:\"\"} imported from ${r}`,TypeError),fY=OD(\"ERR_INVALID_MODULE_SPECIFIER\",(t,e,r=void 0)=>`Invalid module \"${t}\" ${e}${r?` imported from ${r}`:\"\"}`,TypeError),lBe=OD(\"ERR_INVALID_PACKAGE_TARGET\",(t,e,r,s=!1,a=void 0)=>{let n=typeof r==\"string\"&&!s&&r.length&&!hA(r,\"./\");return e===\".\"?((0,oBe.default)(s===!1),`Invalid \"exports\" main target ${RD(r)} defined in the package config ${t}package.json${a?` imported from ${a}`:\"\"}${n?'; targets must start with \"./\"':\"\"}`):`Invalid \"${s?\"imports\":\"exports\"}\" target ${RD(r)} defined for '${e}' in the package config ${t}package.json${a?` imported from ${a}`:\"\"}${n?'; targets must start with \"./\"':\"\"}`},Error),LD=OD(\"ERR_INVALID_PACKAGE_CONFIG\",(t,e,r)=>`Invalid package config ${t}${e?` while importing ${e}`:\"\"}${r?`. ${r}`:\"\"}`,Error),cBe=OD(\"ERR_PACKAGE_PATH_NOT_EXPORTED\",(t,e,r=void 0)=>e===\".\"?`No \"exports\" main defined in ${t}package.json${r?` imported from ${r}`:\"\"}`:`Package subpath '${e}' is not defined by \"exports\" in ${t}package.json${r?` imported from ${r}`:\"\"}`,Error);var sN=Ie(\"url\");function uBe(t,e){let r=Object.create(null);for(let s=0;s<e.length;s++){let a=e[s];Hm(t,a)&&(r[a]=t[a])}return r}var iN=new iBe;function ndt(t,e,r,s){let a=iN.get(t);if(a!==void 0)return a;let n=s(t);if(n===void 0){let P={pjsonPath:t,exists:!1,main:void 0,name:void 0,type:\"none\",exports:void 0,imports:void 0};return iN.set(t,P),P}let c;try{c=sBe(n)}catch(P){throw new LD(t,(r?`\"${e}\" from `:\"\")+(0,sN.fileURLToPath)(r||e),P.message)}let{imports:f,main:p,name:h,type:E}=uBe(c,[\"imports\",\"main\",\"name\",\"type\"]),C=Hm(c,\"exports\")?c.exports:void 0;(typeof f!=\"object\"||f===null)&&(f=void 0),typeof p!=\"string\"&&(p=void 0),typeof h!=\"string\"&&(h=void 0),E!==\"module\"&&E!==\"commonjs\"&&(E=\"none\");let S={pjsonPath:t,exists:!0,main:p,name:h,type:E,exports:C,imports:f};return iN.set(t,S),S}function fBe(t,e){let r=new URL(\"./package.json\",t);for(;;){let n=r.pathname;if(ng(n,\"node_modules/package.json\"))break;let c=ndt((0,sN.fileURLToPath)(r),t,void 0,e);if(c.exists)return c;let f=r;if(r=new URL(\"../package.json\",r),r.pathname===f.pathname)break}let s=(0,sN.fileURLToPath)(r),a={pjsonPath:s,exists:!1,main:void 0,name:void 0,type:\"none\",exports:void 0,imports:void 0};return iN.set(s,a),a}function idt(t,e,r){throw new aBe(t,e&&(0,ta.fileURLToPath)(new URL(\".\",e)),(0,ta.fileURLToPath)(r))}function sdt(t,e,r,s){let a=`request is not a valid subpath for the \"${r?\"imports\":\"exports\"}\" resolution of ${(0,ta.fileURLToPath)(e)}`;throw new fY(t,a,s&&(0,ta.fileURLToPath)(s))}function MD(t,e,r,s,a){throw typeof e==\"object\"&&e!==null?e=RD(e,null,\"\"):e=`${e}`,new lBe((0,ta.fileURLToPath)(new URL(\".\",r)),t,e,s,a&&(0,ta.fileURLToPath)(a))}var ABe=/(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\\\|\\/|$)/i,pBe=/\\*/g;function odt(t,e,r,s,a,n,c,f){if(e!==\"\"&&!n&&t[t.length-1]!==\"/\"&&MD(r,t,s,c,a),!hA(t,\"./\")){if(c&&!hA(t,\"../\")&&!hA(t,\"/\")){let C=!1;try{new URL(t),C=!0}catch{}if(!C)return n?lY(pBe,t,()=>e):t+e}MD(r,t,s,c,a)}aY(ABe,ig(t,2))!==null&&MD(r,t,s,c,a);let p=new URL(t,s),h=p.pathname,E=new URL(\".\",s).pathname;if(hA(h,E)||MD(r,t,s,c,a),e===\"\")return p;if(aY(ABe,e)!==null){let C=n?nBe(r,\"*\",()=>e):r+e;sdt(C,s,c,a)}return n?new URL(lY(pBe,p.href,()=>e)):new URL(e,p)}function adt(t){let e=+t;return`${e}`!==t?!1:e>=0&&e<4294967295}function vw(t,e,r,s,a,n,c,f){if(typeof e==\"string\")return odt(e,r,s,t,a,n,c,f);if(oY(e)){if(e.length===0)return null;let p;for(let h=0;h<e.length;h++){let E=e[h],C;try{C=vw(t,E,r,s,a,n,c,f)}catch(S){if(p=S,S.code===\"ERR_INVALID_PACKAGE_TARGET\")continue;throw S}if(C!==void 0){if(C===null){p=null;continue}return C}}if(p==null)return p;throw p}else if(typeof e==\"object\"&&e!==null){let p=FD(e);for(let h=0;h<p.length;h++){let E=p[h];if(adt(E))throw new LD((0,ta.fileURLToPath)(t),a,'\"exports\" cannot contain numeric property keys.')}for(let h=0;h<p.length;h++){let E=p[h];if(E===\"default\"||f.has(E)){let C=e[E],S=vw(t,C,r,s,a,n,c,f);if(S===void 0)continue;return S}}return}else if(e===null)return null;MD(s,e,t,c,a)}function gBe(t,e){let r=ND(t,\"*\"),s=ND(e,\"*\"),a=r===-1?t.length:r+1,n=s===-1?e.length:s+1;return a>n?-1:n>a||r===-1?1:s===-1||t.length>e.length?-1:e.length>t.length?1:0}function ldt(t,e,r){if(typeof t==\"string\"||oY(t))return!0;if(typeof t!=\"object\"||t===null)return!1;let s=FD(t),a=!1,n=0;for(let c=0;c<s.length;c++){let f=s[c],p=f===\"\"||f[0]!==\".\";if(n++===0)a=p;else if(a!==p)throw new LD((0,ta.fileURLToPath)(e),r,`\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return a}function AY(t,e,r){throw new cBe((0,ta.fileURLToPath)(new URL(\".\",e)),t,r&&(0,ta.fileURLToPath)(r))}var hBe=new Set;function cdt(t,e,r){let s=(0,ta.fileURLToPath)(e);hBe.has(s+\"|\"+t)||(hBe.add(s+\"|\"+t),process.emitWarning(`Use of deprecated trailing slash pattern mapping \"${t}\" in the \"exports\" field module resolution of the package at ${s}${r?` imported from ${(0,ta.fileURLToPath)(r)}`:\"\"}. Mapping specifiers ending in \"/\" is no longer supported.`,\"DeprecationWarning\",\"DEP0155\"))}function dBe({packageJSONUrl:t,packageSubpath:e,exports:r,base:s,conditions:a}){if(ldt(r,t,s)&&(r={\".\":r}),Hm(r,e)&&!cY(e,\"*\")&&!ng(e,\"/\")){let p=r[e],h=vw(t,p,\"\",e,s,!1,!1,a);return h==null&&AY(e,t,s),h}let n=\"\",c,f=FD(r);for(let p=0;p<f.length;p++){let h=f[p],E=ND(h,\"*\");if(E!==-1&&hA(e,ig(h,0,E))){ng(e,\"/\")&&cdt(e,t,s);let C=ig(h,E+1);e.length>=h.length&&ng(e,C)&&gBe(n,h)===1&&uY(h,\"*\")===E&&(n=h,c=ig(e,E,e.length-C.length))}}if(n){let p=r[n],h=vw(t,p,c,n,s,!0,!1,a);return h==null&&AY(e,t,s),h}AY(e,t,s)}function mBe({name:t,base:e,conditions:r,readFileSyncFn:s}){if(t===\"#\"||hA(t,\"#/\")||ng(t,\"/\")){let c=\"is not a valid internal imports specifier name\";throw new fY(t,c,(0,ta.fileURLToPath)(e))}let a,n=fBe(e,s);if(n.exists){a=(0,ta.pathToFileURL)(n.pjsonPath);let c=n.imports;if(c)if(Hm(c,t)&&!cY(t,\"*\")){let f=vw(a,c[t],\"\",t,e,!1,!0,r);if(f!=null)return f}else{let f=\"\",p,h=FD(c);for(let E=0;E<h.length;E++){let C=h[E],S=ND(C,\"*\");if(S!==-1&&hA(t,ig(C,0,S))){let P=ig(C,S+1);t.length>=C.length&&ng(t,P)&&gBe(f,C)===1&&uY(C,\"*\")===S&&(f=C,p=ig(t,S,t.length-P.length))}}if(f){let E=c[f],C=vw(a,E,p,f,e,!0,!0,r);if(C!=null)return C}}}idt(t,a,e)}Dt();var udt=new Set([\"BUILTIN_NODE_RESOLUTION_FAILED\",\"MISSING_DEPENDENCY\",\"MISSING_PEER_DEPENDENCY\",\"QUALIFIED_PATH_RESOLUTION_FAILED\",\"UNDECLARED_DEPENDENCY\"]);function gs(t,e,r={},s){s??=udt.has(t)?\"MODULE_NOT_FOUND\":t;let a={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:{...a,value:s},pnpCode:{...a,value:t},data:{...a,value:r}})}function lf(t){return fe.normalize(fe.fromPortablePath(t))}var CBe=ut(EBe());function wBe(t){return fdt(),hY[t]}var hY;function fdt(){hY||(hY={\"--conditions\":[],...IBe(Adt()),...IBe(process.execArgv)})}function IBe(t){return(0,CBe.default)({\"--conditions\":[String],\"-C\":\"--conditions\"},{argv:t,permissive:!0})}function Adt(){let t=[],e=pdt(process.env.NODE_OPTIONS||\"\",t);return t.length,e}function pdt(t,e){let r=[],s=!1,a=!0;for(let n=0;n<t.length;++n){let c=t[n];if(c===\"\\\\\"&&s){if(n+1===t.length)return e.push(`invalid value for NODE_OPTIONS (invalid escape)\n`),r;c=t[++n]}else if(c===\" \"&&!s){a=!0;continue}else if(c==='\"'){s=!s;continue}a?(r.push(c),a=!1):r[r.length-1]+=c}return s&&e.push(`invalid value for NODE_OPTIONS (unterminated string)\n`),r}Dt();var[ml,ih]=process.versions.node.split(\".\").map(t=>parseInt(t,10)),BBe=ml>19||ml===19&&ih>=2||ml===18&&ih>=13,UZt=ml===20&&ih<6||ml===19&&ih>=3,_Zt=ml>19||ml===19&&ih>=6,HZt=ml>=21||ml===20&&ih>=10||ml===18&&ih>=19,jZt=ml>=21||ml===20&&ih>=10||ml===18&&ih>=20,GZt=ml>=22;function vBe(t){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(t=t.map(e=>fe.fromPortablePath(uo.resolveVirtual(fe.toPortablePath(e)))),BBe)process.send({\"watch:require\":t});else for(let e of t)process.send({\"watch:require\":e})}function dY(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,s=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\\\/]|\\\\\\\\|\\.{0,2}(?:\\/|$))((?:node:)?(?:@[^/]+\\/)?[^/]+)\\/*(.*|)$/,n=/^(\\/|\\.{1,2}(\\/|$))/,c=/\\/$/,f=/^\\.{0,2}\\//,p={name:null,reference:null},h=[],E=new Set;if(t.enableTopLevelFallback===!0&&h.push(p),e.compatibilityMode!==!1)for(let Fe of[\"react-scripts\",\"gatsby\"]){let Ne=t.packageRegistry.get(Fe);if(Ne)for(let Pe of Ne.keys()){if(Pe===null)throw new Error(\"Assertion failed: This reference shouldn't be null\");h.push({name:Fe,reference:Pe})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:P}=t;function I(Fe,Ne){return{fn:Fe,args:Ne,error:null,result:null}}function R(Fe){let Ne=process.stderr?.hasColors?.()??process.stdout.isTTY,Pe=(it,Ue)=>`\\x1B[${it}m${Ue}\\x1B[0m`,Ve=Fe.error;console.error(Ve?Pe(\"31;1\",`\\u2716 ${Fe.error?.message.replace(/\\n.*/s,\"\")}`):Pe(\"33;1\",\"\\u203C Resolution\")),Fe.args.length>0&&console.error();for(let it of Fe.args)console.error(`  ${Pe(\"37;1\",\"In \\u2190\")} ${(0,gY.inspect)(it,{colors:Ne,compact:!0})}`);Fe.result&&(console.error(),console.error(`  ${Pe(\"37;1\",\"Out \\u2192\")} ${(0,gY.inspect)(Fe.result,{colors:Ne,compact:!0})}`));let ke=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(ke.length>0){console.error();for(let it of ke)console.error(`  ${Pe(\"38;5;244\",it)}`)}console.error()}function N(Fe,Ne){if(e.allowDebug===!1)return Ne;if(Number.isFinite(s)){if(s>=2)return(...Pe)=>{let Ve=I(Fe,Pe);try{return Ve.result=Ne(...Pe)}catch(ke){throw Ve.error=ke}finally{R(Ve)}};if(s>=1)return(...Pe)=>{try{return Ne(...Pe)}catch(Ve){let ke=I(Fe,Pe);throw ke.error=Ve,R(ke),Ve}}}return Ne}function U(Fe){let Ne=g(Fe);if(!Ne)throw gs(\"INTERNAL\",\"Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)\");return Ne}function W(Fe){if(Fe.name===null)return!0;for(let Ne of t.dependencyTreeRoots)if(Ne.name===Fe.name&&Ne.reference===Fe.reference)return!0;return!1}let ee=new Set([\"node\",\"require\",...wBe(\"--conditions\")]);function ie(Fe,Ne=ee,Pe){let Ve=Ae(J.join(Fe,\"internal.js\"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(Ve===null)throw gs(\"INTERNAL\",`The locator that owns the \"${Fe}\" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:ke}=U(Ve),it=J.join(ke,Er.manifest);if(!e.fakeFs.existsSync(it))return null;let Ue=JSON.parse(e.fakeFs.readFileSync(it,\"utf8\"));if(Ue.exports==null)return null;let x=J.contains(ke,Fe);if(x===null)throw gs(\"INTERNAL\",\"unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)\");x!==\".\"&&!f.test(x)&&(x=`./${x}`);try{let w=dBe({packageJSONUrl:(0,jm.pathToFileURL)(fe.fromPortablePath(it)),packageSubpath:x,exports:Ue.exports,base:Pe?(0,jm.pathToFileURL)(fe.fromPortablePath(Pe)):null,conditions:Ne});return fe.toPortablePath((0,jm.fileURLToPath)(w))}catch(w){throw gs(\"EXPORTS_RESOLUTION_FAILED\",w.message,{unqualifiedPath:lf(Fe),locator:Ve,pkgJson:Ue,subpath:lf(x),conditions:Ne},w.code)}}function ue(Fe,Ne,{extensions:Pe}){let Ve;try{Ne.push(Fe),Ve=e.fakeFs.statSync(Fe)}catch{}if(Ve&&!Ve.isDirectory())return e.fakeFs.realpathSync(Fe);if(Ve&&Ve.isDirectory()){let ke;try{ke=JSON.parse(e.fakeFs.readFileSync(J.join(Fe,Er.manifest),\"utf8\"))}catch{}let it;if(ke&&ke.main&&(it=J.resolve(Fe,ke.main)),it&&it!==Fe){let Ue=ue(it,Ne,{extensions:Pe});if(Ue!==null)return Ue}}for(let ke=0,it=Pe.length;ke<it;ke++){let Ue=`${Fe}${Pe[ke]}`;if(Ne.push(Ue),e.fakeFs.existsSync(Ue))return Ue}if(Ve&&Ve.isDirectory())for(let ke=0,it=Pe.length;ke<it;ke++){let Ue=J.format({dir:Fe,name:\"index\",ext:Pe[ke]});if(Ne.push(Ue),e.fakeFs.existsSync(Ue))return Ue}return null}function le(Fe){let Ne=new sh.Module(Fe,null);return Ne.filename=Fe,Ne.paths=sh.Module._nodeModulePaths(Fe),Ne}function me(Fe,Ne){return Ne.endsWith(\"/\")&&(Ne=J.join(Ne,\"internal.js\")),sh.Module._resolveFilename(fe.fromPortablePath(Fe),le(fe.fromPortablePath(Ne)),!1,{plugnplay:!1})}function pe(Fe){if(C===null)return!1;let Ne=J.contains(t.basePath,Fe);return Ne===null?!1:!!C.test(Ne.replace(/\\/$/,\"\"))}let Be={std:3,resolveVirtual:1,getAllLocators:1},Ce=p;function g({name:Fe,reference:Ne}){let Pe=S.get(Fe);if(!Pe)return null;let Ve=Pe.get(Ne);return Ve||null}function we({name:Fe,reference:Ne}){let Pe=[];for(let[Ve,ke]of S)if(Ve!==null)for(let[it,Ue]of ke)it===null||Ue.packageDependencies.get(Fe)!==Ne||Ve===Fe&&it===Ne||Pe.push({name:Ve,reference:it});return Pe}function ye(Fe,Ne){let Pe=new Map,Ve=new Set,ke=Ue=>{let x=JSON.stringify(Ue.name);if(Ve.has(x))return;Ve.add(x);let w=we(Ue);for(let b of w)if(U(b).packagePeers.has(Fe))ke(b);else{let F=Pe.get(b.name);typeof F>\"u\"&&Pe.set(b.name,F=new Set),F.add(b.reference)}};ke(Ne);let it=[];for(let Ue of[...Pe.keys()].sort())for(let x of[...Pe.get(Ue)].sort())it.push({name:Ue,reference:x});return it}function Ae(Fe,{resolveIgnored:Ne=!1,includeDiscardFromLookup:Pe=!1}={}){if(pe(Fe)&&!Ne)return null;let Ve=J.relative(t.basePath,Fe);Ve.match(n)||(Ve=`./${Ve}`),Ve.endsWith(\"/\")||(Ve=`${Ve}/`);do{let ke=P.get(Ve);if(typeof ke>\"u\"||ke.discardFromLookup&&!Pe){Ve=Ve.substring(0,Ve.lastIndexOf(\"/\",Ve.length-2)+1);continue}return ke.locator}while(Ve!==\"\");return null}function se(Fe){try{return e.fakeFs.readFileSync(fe.toPortablePath(Fe),\"utf8\")}catch(Ne){if(Ne.code===\"ENOENT\")return;throw Ne}}function Z(Fe,Ne,{considerBuiltins:Pe=!0}={}){if(Fe.startsWith(\"#\"))throw new Error(\"resolveToUnqualified can not handle private import mappings\");if(Fe===\"pnpapi\")return fe.toPortablePath(e.pnpapiResolution);if(Pe&&(0,sh.isBuiltin)(Fe))return null;let Ve=lf(Fe),ke=Ne&&lf(Ne);if(Ne&&pe(Ne)&&(!J.isAbsolute(Fe)||Ae(Fe)===null)){let x=me(Fe,Ne);if(x===!1)throw gs(\"BUILTIN_NODE_RESOLUTION_FAILED\",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp)\n\nRequire request: \"${Ve}\"\nRequired by: ${ke}\n`,{request:Ve,issuer:ke});return fe.toPortablePath(x)}let it,Ue=Fe.match(a);if(Ue){if(!Ne)throw gs(\"API_ERROR\",\"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute\",{request:Ve,issuer:ke});let[,x,w]=Ue,b=Ae(Ne);if(!b){let Te=me(Fe,Ne);if(Te===!1)throw gs(\"BUILTIN_NODE_RESOLUTION_FAILED\",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).\n\nRequire path: \"${Ve}\"\nRequired by: ${ke}\n`,{request:Ve,issuer:ke});return fe.toPortablePath(Te)}let F=U(b).packageDependencies.get(x),z=null;if(F==null&&b.name!==null){let Te=t.fallbackExclusionList.get(b.name);if(!Te||!Te.has(b.reference)){for(let Ct=0,qt=h.length;Ct<qt;++Ct){let Pt=U(h[Ct]).packageDependencies.get(x);if(Pt!=null){r?z=Pt:F=Pt;break}}if(t.enableTopLevelFallback&&F==null&&z===null){let Ct=t.fallbackPool.get(x);Ct!=null&&(z=Ct)}}}let X=null;if(F===null)if(W(b))X=gs(\"MISSING_PEER_DEPENDENCY\",`Your application tried to access ${x} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x});else{let Te=ye(x,b);Te.every(lt=>W(lt))?X=gs(\"MISSING_PEER_DEPENDENCY\",`${b.name} tried to access ${x} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${b.name}@${b.reference} (via ${ke})\n${Te.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}\n`).join(\"\")}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x,brokenAncestors:Te}):X=gs(\"MISSING_PEER_DEPENDENCY\",`${b.name} tried to access ${x} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${b.name}@${b.reference} (via ${ke})\n\n${Te.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}\n`).join(\"\")}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x,brokenAncestors:Te})}else F===void 0&&(!Pe&&(0,sh.isBuiltin)(Fe)?W(b)?X=gs(\"UNDECLARED_DEPENDENCY\",`Your application tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x}):X=gs(\"UNDECLARED_DEPENDENCY\",`${b.name} tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in ${b.name}'s dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x}):W(b)?X=gs(\"UNDECLARED_DEPENDENCY\",`Your application tried to access ${x}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x}):X=gs(\"UNDECLARED_DEPENDENCY\",`${b.name} tried to access ${x}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${b.name}@${b.reference} (via ${ke})\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x}));if(F==null){if(z===null||X===null)throw X||new Error(\"Assertion failed: Expected an error to have been set\");F=z;let Te=X.message.replace(/\\n.*/g,\"\");X.message=Te,!E.has(Te)&&s!==0&&(E.add(Te),process.emitWarning(X))}let $=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:x,reference:F},oe=U($);if(!oe.packageLocation)throw gs(\"MISSING_DEPENDENCY\",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.\n\nRequired package: ${$.name}@${$.reference}${$.name!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${b.name}@${b.reference} (via ${ke})\n`,{request:Ve,issuer:ke,dependencyLocator:Object.assign({},$)});let xe=oe.packageLocation;w?it=J.join(xe,w):it=xe}else if(J.isAbsolute(Fe))it=J.normalize(Fe);else{if(!Ne)throw gs(\"API_ERROR\",\"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute\",{request:Ve,issuer:ke});let x=J.resolve(Ne);Ne.match(c)?it=J.normalize(J.join(x,Fe)):it=J.normalize(J.join(J.dirname(x),Fe))}return J.normalize(it)}function De(Fe,Ne,Pe=ee,Ve){if(n.test(Fe))return Ne;let ke=ie(Ne,Pe,Ve);return ke?J.normalize(ke):Ne}function Re(Fe,{extensions:Ne=Object.keys(sh.Module._extensions)}={}){let Pe=[],Ve=ue(Fe,Pe,{extensions:Ne});if(Ve)return J.normalize(Ve);{vBe(Pe.map(Ue=>fe.fromPortablePath(Ue)));let ke=lf(Fe),it=Ae(Fe);if(it){let{packageLocation:Ue}=U(it),x=!0;try{e.fakeFs.accessSync(Ue)}catch(w){if(w?.code===\"ENOENT\")x=!1;else{let b=(w?.message??w??\"empty exception thrown\").replace(/^[A-Z]/,y=>y.toLowerCase());throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`Required package exists but could not be accessed (${b}).\n\nMissing package: ${it.name}@${it.reference}\nExpected package location: ${lf(Ue)}\n`,{unqualifiedPath:ke,extensions:Ne})}}if(!x){let w=Ue.includes(\"/unplugged/\")?\"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).\":\"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.\";throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`${w}\n\nMissing package: ${it.name}@${it.reference}\nExpected package location: ${lf(Ue)}\n`,{unqualifiedPath:ke,extensions:Ne})}}throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.\n\nSource path: ${ke}\n${Pe.map(Ue=>`Not found: ${lf(Ue)}\n`).join(\"\")}`,{unqualifiedPath:ke,extensions:Ne})}}function mt(Fe,Ne,Pe){if(!Ne)throw new Error(\"Assertion failed: An issuer is required to resolve private import mappings\");let Ve=mBe({name:Fe,base:(0,jm.pathToFileURL)(fe.fromPortablePath(Ne)),conditions:Pe.conditions??ee,readFileSyncFn:se});if(Ve instanceof URL)return Re(fe.toPortablePath((0,jm.fileURLToPath)(Ve)),{extensions:Pe.extensions});if(Ve.startsWith(\"#\"))throw new Error(\"Mapping from one private import to another isn't allowed\");return j(Ve,Ne,Pe)}function j(Fe,Ne,Pe={}){try{if(Fe.startsWith(\"#\"))return mt(Fe,Ne,Pe);let{considerBuiltins:Ve,extensions:ke,conditions:it}=Pe,Ue=Z(Fe,Ne,{considerBuiltins:Ve});if(Fe===\"pnpapi\")return Ue;if(Ue===null)return null;let x=()=>Ne!==null?pe(Ne):!1,w=(!Ve||!(0,sh.isBuiltin)(Fe))&&!x()?De(Fe,Ue,it,Ne):Ue;return Re(w,{extensions:ke})}catch(Ve){throw Object.hasOwn(Ve,\"pnpCode\")&&Object.assign(Ve.data,{request:lf(Fe),issuer:Ne&&lf(Ne)}),Ve}}function rt(Fe){let Ne=J.normalize(Fe),Pe=uo.resolveVirtual(Ne);return Pe!==Ne?Pe:null}return{VERSIONS:Be,topLevel:Ce,getLocator:(Fe,Ne)=>Array.isArray(Ne)?{name:Ne[0],reference:Ne[1]}:{name:Fe,reference:Ne},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let Fe=[];for(let[Ne,Pe]of S)for(let Ve of Pe.keys())Ne!==null&&Ve!==null&&Fe.push({name:Ne,reference:Ve});return Fe},getPackageInformation:Fe=>{let Ne=g(Fe);if(Ne===null)return null;let Pe=fe.fromPortablePath(Ne.packageLocation);return{...Ne,packageLocation:Pe}},findPackageLocator:Fe=>Ae(fe.toPortablePath(Fe)),resolveToUnqualified:N(\"resolveToUnqualified\",(Fe,Ne,Pe)=>{let Ve=Ne!==null?fe.toPortablePath(Ne):null,ke=Z(fe.toPortablePath(Fe),Ve,Pe);return ke===null?null:fe.fromPortablePath(ke)}),resolveUnqualified:N(\"resolveUnqualified\",(Fe,Ne)=>fe.fromPortablePath(Re(fe.toPortablePath(Fe),Ne))),resolveRequest:N(\"resolveRequest\",(Fe,Ne,Pe)=>{let Ve=Ne!==null?fe.toPortablePath(Ne):null,ke=j(fe.toPortablePath(Fe),Ve,Pe);return ke===null?null:fe.fromPortablePath(ke)}),resolveVirtual:N(\"resolveVirtual\",Fe=>{let Ne=rt(fe.toPortablePath(Fe));return Ne!==null?fe.fromPortablePath(Ne):null})}}Dt();var SBe=(t,e,r)=>{let s=TD(t),a=sY(s,{basePath:e}),n=fe.join(e,Er.pnpCjs);return dY(a,{fakeFs:r,pnpapiResolution:n})};var yY=ut(bBe());Yt();var gA={};Vt(gA,{checkManifestCompatibility:()=>PBe,extractBuildRequest:()=>oN,getExtractHint:()=>EY,hasBindingGyp:()=>IY});Ge();Dt();function PBe(t){return G.isPackageCompatible(t,Ui.getArchitectureSet())}function oN(t,e,r,{configuration:s}){let a=[];for(let n of[\"preinstall\",\"install\",\"postinstall\"])e.manifest.scripts.has(n)&&a.push({type:0,script:n});return!e.manifest.scripts.has(\"install\")&&e.misc.hasBindingGyp&&a.push({type:1,script:\"node-gyp rebuild\"}),a.length===0?null:t.linkType!==\"HARD\"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${G.prettyLocator(s,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${G.prettyLocator(s,t)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!s.get(\"enableScripts\")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${G.prettyLocator(s,t)} lists build scripts, but all build scripts have been disabled.`)}:PBe(t)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${G.prettyLocator(s,t)} The ${Ui.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var gdt=new Set([\".exe\",\".bin\",\".h\",\".hh\",\".hpp\",\".c\",\".cc\",\".cpp\",\".java\",\".jar\",\".node\"]);function EY(t){return t.packageFs.getExtractHint({relevantExtensions:gdt})}function IY(t){let e=J.join(t.prefixPath,\"binding.gyp\");return t.packageFs.existsSync(e)}var HD={};Vt(HD,{getUnpluggedPath:()=>_D});Ge();Dt();function _D(t,{configuration:e}){return J.resolve(e.get(\"pnpUnpluggedFolder\"),G.slugifyLocator(t))}var ddt=new Set([G.makeIdent(null,\"open\").identHash,G.makeIdent(null,\"opn\").identHash]),sg=class{constructor(){this.mode=\"strict\";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:\"PnpLinker\",version:2})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the PnP linker to be enabled\");let s=og(r.project).cjs;if(!ce.existsSync(s))throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=je.getFactoryWithDefault(this.pnpCache,s,()=>je.dynamicRequire(s,{cachingStrategy:je.CachingStrategy.FsTime})),n={name:G.stringifyIdent(e),reference:e.reference},c=a.getPackageInformation(n);if(!c)throw new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed PnP map - running an install might help`);return fe.toPortablePath(c.packageLocation)}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=og(r.project).cjs;if(!ce.existsSync(s))return null;let n=je.getFactoryWithDefault(this.pnpCache,s,()=>je.dynamicRequire(s,{cachingStrategy:je.CachingStrategy.FsTime})).findPackageLocator(fe.fromPortablePath(e));return n?G.makeLocator(G.parseIdent(n.name),n.reference):null}makeInstaller(e){return new Gm(e)}isEnabled(e){return!(e.project.configuration.get(\"nodeLinker\")!==\"pnp\"||e.project.configuration.get(\"pnpMode\")!==this.mode)}},Gm=class{constructor(e){this.opts=e;this.mode=\"strict\";this.asyncActions=new je.AsyncActions(10);this.packageRegistry=new Map;this.virtualTemplates=new Map;this.isESMLoaderRequired=!1;this.customData={store:new Map};this.unpluggedPaths=new Set;this.opts=e}attachCustomData(e){this.customData=e}async installPackage(e,r,s){let a=G.stringifyIdent(e),n=e.reference,c=!!this.opts.project.tryWorkspaceByLocator(e),f=G.isVirtualLocator(e),p=e.peerDependencies.size>0&&!f,h=!p&&!c,E=!p&&e.linkType!==\"SOFT\",C,S;if(h||E){let ee=f?G.devirtualizeLocator(e):e;C=this.customData.store.get(ee.locatorHash),typeof C>\"u\"&&(C=await mdt(r),e.linkType===\"HARD\"&&this.customData.store.set(ee.locatorHash,C)),C.manifest.type===\"module\"&&(this.isESMLoaderRequired=!0),S=this.opts.project.getDependencyMeta(ee,e.version)}let P=h?oN(e,C,S,{configuration:this.opts.project.configuration}):null,I=E?await this.unplugPackageIfNeeded(e,C,r,S,s):r.packageFs;if(J.isAbsolute(r.prefixPath))throw new Error(`Assertion failed: Expected the prefix path (${r.prefixPath}) to be relative to the parent`);let R=J.resolve(I.getRealPath(),r.prefixPath),N=CY(this.opts.project.cwd,R),U=new Map,W=new Set;if(f){for(let ee of e.peerDependencies.values())U.set(G.stringifyIdent(ee),null),W.add(G.stringifyIdent(ee));if(!c){let ee=G.devirtualizeLocator(e);this.virtualTemplates.set(ee.locatorHash,{location:CY(this.opts.project.cwd,uo.resolveVirtual(R)),locator:ee})}}return je.getMapWithDefault(this.packageRegistry,a).set(n,{packageLocation:N,packageDependencies:U,packagePeers:W,linkType:e.linkType,discardFromLookup:r.discardFromLookup||!1}),{packageLocation:R,buildRequest:P}}async attachInternalDependencies(e,r){let s=this.getPackageInformation(e);for(let[a,n]of r){let c=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];s.packageDependencies.set(G.stringifyIdent(a),c)}}async attachExternalDependents(e,r){for(let s of r)this.getDiskInformation(s).packageDependencies.set(G.stringifyIdent(e),e.reference)}async finalizeInstall(){if(this.opts.project.configuration.get(\"pnpMode\")!==this.mode)return;let e=og(this.opts.project);if(this.isEsmEnabled()||await ce.removePromise(e.esmLoader),this.opts.project.configuration.get(\"nodeLinker\")!==\"pnp\"){await ce.removePromise(e.cjs),await ce.removePromise(e.data),await ce.removePromise(e.esmLoader),await ce.removePromise(this.opts.project.configuration.get(\"pnpUnpluggedFolder\"));return}for(let{locator:C,location:S}of this.virtualTemplates.values())je.getMapWithDefault(this.packageRegistry,G.stringifyIdent(C)).set(C.reference,{packageLocation:S,packageDependencies:new Map,packagePeers:new Set,linkType:\"SOFT\",discardFromLookup:!1});let r=this.opts.project.configuration.get(\"pnpFallbackMode\"),s=this.opts.project.workspaces.map(({anchoredLocator:C})=>({name:G.stringifyIdent(C),reference:C.reference})),a=r!==\"none\",n=[],c=new Map,f=je.buildIgnorePattern([\".yarn/sdks/**\",...this.opts.project.configuration.get(\"pnpIgnorePatterns\")]),p=this.packageRegistry,h=this.opts.project.configuration.get(\"pnpShebang\"),E=this.opts.project.configuration.get(\"pnpZipBackend\");if(r===\"dependencies-only\")for(let C of this.opts.project.storedPackages.values())this.opts.project.tryWorkspaceByLocator(C)&&n.push({name:G.stringifyIdent(C),reference:C.reference});return await this.asyncActions.wait(),await this.finalizeInstallWithPnp({dependencyTreeRoots:s,enableTopLevelFallback:a,fallbackExclusionList:n,fallbackPool:c,ignorePattern:f,pnpZipBackend:E,packageRegistry:p,shebang:h}),{customData:this.customData}}async transformPnpSettings(e){}isEsmEnabled(){if(this.opts.project.configuration.sources.has(\"pnpEnableEsmLoader\"))return this.opts.project.configuration.get(\"pnpEnableEsmLoader\");if(this.isESMLoaderRequired)return!0;for(let e of this.opts.project.workspaces)if(e.manifest.type===\"module\")return!0;return!1}async finalizeInstallWithPnp(e){let r=og(this.opts.project),s=await this.locateNodeModules(e.ignorePattern);if(s.length>0){this.opts.report.reportWarning(31,\"One or more node_modules have been detected and will be removed. This operation may take some time.\");for(let n of s)await ce.removePromise(n)}if(await this.transformPnpSettings(e),this.opts.project.configuration.get(\"pnpEnableInlining\")){let n=tBe(e);await ce.changeFilePromise(r.cjs,n,{automaticNewlines:!0,mode:493}),await ce.removePromise(r.data)}else{let{dataFile:n,loaderFile:c}=rBe(e);await ce.changeFilePromise(r.cjs,c,{automaticNewlines:!0,mode:493}),await ce.changeFilePromise(r.data,n,{automaticNewlines:!0,mode:420})}this.isEsmEnabled()&&(this.opts.report.reportWarning(0,\"ESM support for PnP uses the experimental loader API and is therefore experimental\"),await ce.changeFilePromise(r.esmLoader,(0,yY.default)(),{automaticNewlines:!0,mode:420}));let a=this.opts.project.configuration.get(\"pnpUnpluggedFolder\");if(this.unpluggedPaths.size===0)await ce.removePromise(a);else for(let n of await ce.readdirPromise(a)){let c=J.resolve(a,n);this.unpluggedPaths.has(c)||await ce.removePromise(c)}}async locateNodeModules(e){let r=[],s=e?new RegExp(e):null;for(let a of this.opts.project.workspaces){let n=J.join(a.cwd,\"node_modules\");if(s&&s.test(J.relative(this.opts.project.cwd,a.cwd))||!ce.existsSync(n))continue;let c=await ce.readdirPromise(n,{withFileTypes:!0}),f=c.filter(p=>!p.isDirectory()||p.name===\".bin\"||!p.name.startsWith(\".\"));if(f.length===c.length)r.push(n);else for(let p of f)r.push(J.join(n,p.name))}return r}async unplugPackageIfNeeded(e,r,s,a,n){return this.shouldBeUnplugged(e,r,a)?this.unplugPackage(e,s,n):s.packageFs}shouldBeUnplugged(e,r,s){return typeof s.unplugged<\"u\"?s.unplugged:ddt.has(e.identHash)||e.conditions!=null?!0:r.manifest.preferUnplugged!==null?r.manifest.preferUnplugged:!!(oN(e,r,s,{configuration:this.opts.project.configuration})?.skipped===!1||r.misc.extractHint)}async unplugPackage(e,r,s){let a=_D(e,{configuration:this.opts.project.configuration});return this.opts.project.disabledLocators.has(e.locatorHash)?new _f(a,{baseFs:r.packageFs,pathUtils:J}):(this.unpluggedPaths.add(a),s.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{let n=J.join(a,r.prefixPath,\".ready\");await ce.existsPromise(n)||(this.opts.project.storedBuildState.delete(e.locatorHash),await ce.mkdirPromise(a,{recursive:!0}),await ce.copyPromise(a,vt.dot,{baseFs:r.packageFs,overwrite:!1}),await ce.writeFilePromise(n,\"\"))})),new Sn(a))}getPackageInformation(e){let r=G.stringifyIdent(e),s=e.reference,a=this.packageRegistry.get(r);if(!a)throw new Error(`Assertion failed: The package information store should have been available (for ${G.prettyIdent(this.opts.project.configuration,e)})`);let n=a.get(s);if(!n)throw new Error(`Assertion failed: The package information should have been available (for ${G.prettyLocator(this.opts.project.configuration,e)})`);return n}getDiskInformation(e){let r=je.getMapWithDefault(this.packageRegistry,\"@@disk\"),s=CY(this.opts.project.cwd,e);return je.getFactoryWithDefault(r,s,()=>({packageLocation:s,packageDependencies:new Map,packagePeers:new Set,linkType:\"SOFT\",discardFromLookup:!1}))}};function CY(t,e){let r=J.relative(t,e);return r.match(/^\\.{0,2}\\//)||(r=`./${r}`),r.replace(/\\/?$/,\"/\")}async function mdt(t){let e=await Ut.tryFind(t.prefixPath,{baseFs:t.packageFs})??new Ut,r=new Set([\"preinstall\",\"install\",\"postinstall\"]);for(let s of e.scripts.keys())r.has(s)||e.scripts.delete(s);return{manifest:{scripts:e.scripts,preferUnplugged:e.preferUnplugged,type:e.type},misc:{extractHint:EY(t),hasBindingGyp:IY(t)}}}Ge();Ge();Yt();var xBe=ut(Go());var Sw=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Unplug direct dependencies from the entire project\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Unplug both direct and transitive dependencies\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.patterns=ge.Rest()}static{this.paths=[[\"unplug\"]]}static{this.usage=ot.Usage({description:\"force the unpacking of a list of packages\",details:\"\\n      This command will add the selectors matching the specified patterns to the list of packages that must be unplugged when installed.\\n\\n      A package being unplugged means that instead of being referenced directly through its archive, it will be unpacked at install time in the directory configured via `pnpUnpluggedFolder`. Note that unpacking packages this way is generally not recommended because it'll make it harder to store your packages within the repository. However, it's a good approach to quickly and safely debug some packages, and can even sometimes be required depending on the context (for example when the package contains shellscripts).\\n\\n      Running the command will set a persistent flag inside your top-level `package.json`, in the `dependenciesMeta` field. As such, to undo its effects, you'll need to revert the changes made to the manifest and run `yarn install` to apply the modification.\\n\\n      By default, only direct dependencies from the current workspace are affected. If `-A,--all` is set, direct dependencies from the entire project are affected. Using the `-R,--recursive` flag will affect transitive dependencies as well as direct ones.\\n\\n      This command accepts glob patterns inside the scope and name components (not the range). Make sure to escape the patterns to prevent your own shell from trying to expand them.\\n    \",examples:[[\"Unplug the lodash dependency from the active workspace\",\"yarn unplug lodash\"],[\"Unplug all instances of lodash referenced by any workspace\",\"yarn unplug lodash -A\"],[\"Unplug all instances of lodash referenced by the active workspace and its dependencies\",\"yarn unplug lodash -R\"],[\"Unplug all instances of lodash, anywhere\",\"yarn unplug lodash -AR\"],[\"Unplug one specific version of lodash\",\"yarn unplug lodash@1.2.3\"],[\"Unplug all packages with the `@babel` scope\",\"yarn unplug '@babel/*'\"],[\"Unplug all packages (only for testing, not recommended)\",\"yarn unplug -R '*'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);if(r.get(\"nodeLinker\")!==\"pnp\")throw new nt(\"This command can only be used if the `nodeLinker` option is set to `pnp`\");await s.restoreInstallState();let c=new Set(this.patterns),f=this.patterns.map(P=>{let I=G.parseDescriptor(P),R=I.range!==\"unknown\"?I:G.makeDescriptor(I,\"*\");if(!Fr.validRange(R.range))throw new nt(`The range of the descriptor patterns must be a valid semver range (${G.prettyDescriptor(r,R)})`);return N=>{let U=G.stringifyIdent(N);return!xBe.default.isMatch(U,G.stringifyIdent(R))||N.version&&!Fr.satisfiesWithPrereleases(N.version,R.range)?!1:(c.delete(P),!0)}}),p=()=>{let P=[];for(let I of s.storedPackages.values())!s.tryWorkspaceByLocator(I)&&!G.isVirtualLocator(I)&&f.some(R=>R(I))&&P.push(I);return P},h=P=>{let I=new Set,R=[],N=(U,W)=>{if(I.has(U.locatorHash))return;let ee=!!s.tryWorkspaceByLocator(U);if(!(W>0&&!this.recursive&&ee)&&(I.add(U.locatorHash),!s.tryWorkspaceByLocator(U)&&f.some(ie=>ie(U))&&R.push(U),!(W>0&&!this.recursive)))for(let ie of U.dependencies.values()){let ue=s.storedResolutions.get(ie.descriptorHash);if(!ue)throw new Error(\"Assertion failed: The resolution should have been registered\");let le=s.storedPackages.get(ue);if(!le)throw new Error(\"Assertion failed: The package should have been registered\");N(le,W+1)}};for(let U of P)N(U.anchoredPackage,0);return R},E,C;if(this.all&&this.recursive?(E=p(),C=\"the project\"):this.all?(E=h(s.workspaces),C=\"any workspace\"):(E=h([a]),C=\"this workspace\"),c.size>1)throw new nt(`Patterns ${he.prettyList(r,c,he.Type.CODE)} don't match any packages referenced by ${C}`);if(c.size>0)throw new nt(`Pattern ${he.prettyList(r,c,he.Type.CODE)} doesn't match any packages referenced by ${C}`);E=je.sortMap(E,P=>G.stringifyLocator(P));let S=await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async P=>{for(let I of E){let R=I.version??\"unknown\",N=s.topLevelWorkspace.manifest.ensureDependencyMeta(G.makeDescriptor(I,R));N.unplugged=!0,P.reportInfo(0,`Will unpack ${G.prettyLocator(r,I)} to ${he.pretty(r,_D(I,{configuration:r}),he.Type.PATH)}`),P.reportJson({locator:G.stringifyLocator(I),version:R})}await s.topLevelWorkspace.persistManifest(),this.json||P.reportSeparator()});return S.hasErrors()?S.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};var og=t=>({cjs:J.join(t.cwd,Er.pnpCjs),data:J.join(t.cwd,Er.pnpData),esmLoader:J.join(t.cwd,Er.pnpEsmLoader)}),QBe=t=>/\\s/.test(t)?JSON.stringify(t):t;async function ydt(t,e,r){let s=/\\s*--require\\s+\\S*\\.pnp\\.c?js\\s*/g,a=/\\s*--experimental-loader\\s+\\S*\\.pnp\\.loader\\.mjs\\s*/,n=(e.NODE_OPTIONS??\"\").replace(s,\" \").replace(a,\" \").trim();if(t.configuration.get(\"nodeLinker\")!==\"pnp\"){e.NODE_OPTIONS=n||void 0;return}let c=og(t),f=`--require ${QBe(fe.fromPortablePath(c.cjs))}`;ce.existsSync(c.esmLoader)&&(f=`${f} --experimental-loader ${(0,kBe.pathToFileURL)(fe.fromPortablePath(c.esmLoader)).href}`),ce.existsSync(c.cjs)&&(e.NODE_OPTIONS=n?`${f} ${n}`:f)}async function Edt(t,e){let r=og(t);e(r.cjs),e(r.data),e(r.esmLoader),e(t.configuration.get(\"pnpUnpluggedFolder\"))}var Idt={hooks:{populateYarnPaths:Edt,setupScriptEnvironment:ydt},configuration:{nodeLinker:{description:'The linker used for installing Node packages, one of: \"pnp\", \"pnpm\", or \"node-modules\"',type:\"STRING\",default:\"pnp\"},minizip:{description:\"Whether Yarn should use minizip to extract archives\",type:\"BOOLEAN\",default:!1},winLinkType:{description:\"Whether Yarn should use Windows Junctions or symlinks when creating links on Windows.\",type:\"STRING\",values:[\"junctions\",\"symlinks\"],default:\"junctions\"},pnpMode:{description:\"If 'strict', generates standard PnP maps. If 'loose', merges them with the n_m resolution.\",type:\"STRING\",default:\"strict\"},pnpShebang:{description:\"String to prepend to the generated PnP script\",type:\"STRING\",default:\"#!/usr/bin/env node\"},pnpIgnorePatterns:{description:\"Array of glob patterns; files matching them will use the classic resolution\",type:\"STRING\",default:[],isArray:!0},pnpZipBackend:{description:\"Whether to use the experimental js implementation for the ZipFS\",type:\"STRING\",values:[\"libzip\",\"js\"],default:\"libzip\"},pnpEnableEsmLoader:{description:\"If true, Yarn will generate an ESM loader (`.pnp.loader.mjs`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.\",type:\"BOOLEAN\",default:!1},pnpEnableInlining:{description:\"If true, the PnP data will be inlined along with the generated loader\",type:\"BOOLEAN\",default:!0},pnpFallbackMode:{description:\"If true, the generated PnP loader will follow the top-level fallback rule\",type:\"STRING\",default:\"dependencies-only\"},pnpUnpluggedFolder:{description:\"Folder where the unplugged packages must be stored\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/unplugged\"}},linkers:[sg],commands:[Sw]},Cdt=Idt;var UBe=ut(OBe());Yt();var xY=ut(Ie(\"crypto\")),_Be=ut(Ie(\"fs\")),HBe=1,Ti=\"node_modules\",aN=\".bin\",jBe=\".yarn-state.yml\",Mdt=1e3,kY=(s=>(s.CLASSIC=\"classic\",s.HARDLINKS_LOCAL=\"hardlinks-local\",s.HARDLINKS_GLOBAL=\"hardlinks-global\",s))(kY||{}),jD=class{constructor(){this.installStateCache=new Map}getCustomDataKey(){return JSON.stringify({name:\"NodeModulesLinker\",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the node-modules linker to be enabled\");let s=r.project.tryWorkspaceByLocator(e);if(s)return s.cwd;let a=await je.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await PY(r.project,{unrollAliases:!0}));if(a===null)throw new nt(\"Couldn't find the node_modules state file - running an install might help (findPackageLocation)\");let n=a.locatorMap.get(G.stringifyLocator(e));if(!n){let p=new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed node_modules map - running an install might help`);throw p.code=\"LOCATOR_NOT_INSTALLED\",p}let c=n.locations.sort((p,h)=>p.split(J.sep).length-h.split(J.sep).length),f=J.join(r.project.configuration.startingCwd,Ti);return c.find(p=>J.contains(f,p))||n.locations[0]}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=await je.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await PY(r.project,{unrollAliases:!0}));if(s===null)return null;let{locationRoot:a,segments:n}=lN(J.resolve(e),{skipPrefix:r.project.cwd}),c=s.locationTree.get(a);if(!c)return null;let f=c.locator;for(let p of n){if(c=c.children.get(p),!c)break;f=c.locator||f}return G.parseLocator(f)}makeInstaller(e){return new bY(e)}isEnabled(e){return e.project.configuration.get(\"nodeLinker\")===\"node-modules\"}},bY=class{constructor(e){this.opts=e;this.localStore=new Map;this.realLocatorChecksums=new Map;this.customData={store:new Map}}attachCustomData(e){this.customData=e}async installPackage(e,r){let s=J.resolve(r.packageFs.getRealPath(),r.prefixPath),a=this.customData.store.get(e.locatorHash);if(typeof a>\"u\"&&(a=await Udt(e,r),e.linkType===\"HARD\"&&this.customData.store.set(e.locatorHash,a)),!G.isPackageCompatible(e,this.opts.project.configuration.getSupportedArchitectures()))return{packageLocation:null,buildRequest:null};let n=new Map,c=new Set;n.has(G.stringifyIdent(e))||n.set(G.stringifyIdent(e),e.reference);let f=e;if(G.isVirtualLocator(e)){f=G.devirtualizeLocator(e);for(let E of e.peerDependencies.values())n.set(G.stringifyIdent(E),null),c.add(G.stringifyIdent(E))}let p={packageLocation:`${fe.fromPortablePath(s)}/`,packageDependencies:n,packagePeers:c,linkType:e.linkType,discardFromLookup:r.discardFromLookup??!1};this.localStore.set(e.locatorHash,{pkg:e,customPackageData:a,dependencyMeta:this.opts.project.getDependencyMeta(e,e.version),pnpNode:p});let h=r.checksum?r.checksum.substring(r.checksum.indexOf(\"/\")+1):null;return this.realLocatorChecksums.set(f.locatorHash,h),{packageLocation:s,buildRequest:null}}async attachInternalDependencies(e,r){let s=this.localStore.get(e.locatorHash);if(typeof s>\"u\")throw new Error(\"Assertion failed: Expected information object to have been registered\");for(let[a,n]of r){let c=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];s.pnpNode.packageDependencies.set(G.stringifyIdent(a),c)}}async attachExternalDependents(e,r){throw new Error(\"External dependencies haven't been implemented for the node-modules linker\")}async finalizeInstall(){if(this.opts.project.configuration.get(\"nodeLinker\")!==\"node-modules\")return;let e=new uo({baseFs:new $f({maxOpenFiles:80,readOnlyArchives:!0})}),r=await PY(this.opts.project),s=this.opts.project.configuration.get(\"nmMode\");(r===null||s!==r.nmMode)&&(this.opts.project.storedBuildState.clear(),r={locatorMap:new Map,binSymlinks:new Map,locationTree:new Map,nmMode:s,mtimeMs:0});let a=new Map(this.opts.project.workspaces.map(S=>{let P=this.opts.project.configuration.get(\"nmHoistingLimits\");try{P=je.validateEnum(xD,S.manifest.installConfig?.hoistingLimits??P)}catch{let I=G.prettyWorkspace(this.opts.project.configuration,S);this.opts.report.reportWarning(57,`${I}: Invalid 'installConfig.hoistingLimits' value. Expected one of ${Object.values(xD).join(\", \")}, using default: \"${P}\"`)}return[S.relativeCwd,P]})),n=new Map(this.opts.project.workspaces.map(S=>{let P=this.opts.project.configuration.get(\"nmSelfReferences\");return P=S.manifest.installConfig?.selfReferences??P,[S.relativeCwd,P]})),c={VERSIONS:{std:1},topLevel:{name:null,reference:null},getLocator:(S,P)=>Array.isArray(P)?{name:P[0],reference:P[1]}:{name:S,reference:P},getDependencyTreeRoots:()=>this.opts.project.workspaces.map(S=>{let P=S.anchoredLocator;return{name:G.stringifyIdent(P),reference:P.reference}}),getPackageInformation:S=>{let P=S.reference===null?this.opts.project.topLevelWorkspace.anchoredLocator:G.makeLocator(G.parseIdent(S.name),S.reference),I=this.localStore.get(P.locatorHash);if(typeof I>\"u\")throw new Error(\"Assertion failed: Expected the package reference to have been registered\");return I.pnpNode},findPackageLocator:S=>{let P=this.opts.project.tryWorkspaceByCwd(fe.toPortablePath(S));if(P!==null){let I=P.anchoredLocator;return{name:G.stringifyIdent(I),reference:I.reference}}throw new Error(\"Assertion failed: Unimplemented\")},resolveToUnqualified:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveUnqualified:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveRequest:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveVirtual:S=>fe.fromPortablePath(uo.resolveVirtual(fe.toPortablePath(S)))},{tree:f,errors:p,preserveSymlinksRequired:h}=kD(c,{pnpifyFs:!1,validateExternalSoftLinks:!0,hoistingLimitsByCwd:a,project:this.opts.project,selfReferencesByCwd:n});if(!f){for(let{messageName:S,text:P}of p)this.opts.report.reportError(S,P);return}let E=nY(f);await Ydt(r,E,{baseFs:e,project:this.opts.project,report:this.opts.report,realLocatorChecksums:this.realLocatorChecksums,loadManifest:async S=>{let P=G.parseLocator(S),I=this.localStore.get(P.locatorHash);if(typeof I>\"u\")throw new Error(\"Assertion failed: Expected the slot to exist\");return I.customPackageData.manifest}});let C=[];for(let[S,P]of E.entries()){if(WBe(S))continue;let I=G.parseLocator(S),R=this.localStore.get(I.locatorHash);if(typeof R>\"u\")throw new Error(\"Assertion failed: Expected the slot to exist\");if(this.opts.project.tryWorkspaceByLocator(R.pkg))continue;let N=gA.extractBuildRequest(R.pkg,R.customPackageData,R.dependencyMeta,{configuration:this.opts.project.configuration});N&&C.push({buildLocations:P.locations,locator:I,buildRequest:N})}return h&&this.opts.report.reportWarning(72,`The application uses portals and that's why ${he.pretty(this.opts.project.configuration,\"--preserve-symlinks\",he.Type.CODE)} Node option is required for launching it`),{customData:this.customData,records:C}}};async function Udt(t,e){let r=await Ut.tryFind(e.prefixPath,{baseFs:e.packageFs})??new Ut,s=new Set([\"preinstall\",\"install\",\"postinstall\"]);for(let a of r.scripts.keys())s.has(a)||r.scripts.delete(a);return{manifest:{bin:r.bin,scripts:r.scripts},misc:{hasBindingGyp:gA.hasBindingGyp(e)}}}async function _dt(t,e,r,s,{installChangedByUser:a}){let n=\"\";n+=`# Warning: This file is automatically generated. Removing it is fine, but will\n`,n+=`# cause your node_modules installation to become invalidated.\n`,n+=`\n`,n+=`__metadata:\n`,n+=`  version: ${HBe}\n`,n+=`  nmMode: ${s.value}\n`;let c=Array.from(e.keys()).sort(),f=G.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let E of c){let C=e.get(E);n+=`\n`,n+=`${JSON.stringify(E)}:\n`,n+=`  locations:\n`;for(let S of C.locations){let P=J.contains(t.cwd,S);if(P===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=`    - ${JSON.stringify(P)}\n`}if(C.aliases.length>0){n+=`  aliases:\n`;for(let S of C.aliases)n+=`    - ${JSON.stringify(S)}\n`}if(E===f&&r.size>0){n+=`  bin:\n`;for(let[S,P]of r){let I=J.contains(t.cwd,S);if(I===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=`    ${JSON.stringify(I)}:\n`;for(let[R,N]of P){let U=J.relative(J.join(S,Ti),N);n+=`      ${JSON.stringify(R)}: ${JSON.stringify(U)}\n`}}}}let p=t.cwd,h=J.join(p,Ti,jBe);a&&await ce.removePromise(h),await ce.changeFilePromise(h,n,{automaticNewlines:!0})}async function PY(t,{unrollAliases:e=!1}={}){let r=t.cwd,s=J.join(r,Ti,jBe),a;try{a=await ce.statPromise(s)}catch{}if(!a)return null;let n=ls(await ce.readFilePromise(s,\"utf8\"));if(n.__metadata.version>HBe)return null;let c=n.__metadata.nmMode||\"classic\",f=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let C=E.locations.map(P=>J.join(r,P)),S=E.bin;if(S)for(let[P,I]of Object.entries(S)){let R=J.join(r,fe.toPortablePath(P)),N=je.getMapWithDefault(p,R);for(let[U,W]of Object.entries(I))N.set(U,fe.toPortablePath([R,Ti,W].join(J.sep)))}if(f.set(h,{target:vt.dot,linkType:\"HARD\",locations:C,aliases:E.aliases||[]}),e&&E.aliases)for(let P of E.aliases){let{scope:I,name:R}=G.parseLocator(h),N=G.makeLocator(G.makeIdent(I,R),P),U=G.stringifyLocator(N);f.set(U,{target:vt.dot,linkType:\"HARD\",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:GBe(f,{skipPrefix:t.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var bw=async(t,e)=>{if(t.split(J.sep).indexOf(Ti)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{let r;if(!e.innerLoop&&(r=await ce.lstatPromise(t),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!e.isWorkspaceDir)){await ce.unlinkPromise(t);return}let s=await ce.readdirPromise(t,{withFileTypes:!0});for(let n of s){let c=J.join(t,n.name);n.isDirectory()?(n.name!==Ti||e&&e.innerLoop)&&await bw(c,{innerLoop:!0,contentsOnly:!1}):await ce.unlinkPromise(c)}let a=!e.innerLoop&&e.isWorkspaceDir&&r?.isSymbolicLink();!e.contentsOnly&&!a&&await ce.rmdirPromise(t)}catch(r){if(r.code!==\"ENOENT\"&&r.code!==\"ENOTEMPTY\")throw r}},LBe=4,lN=(t,{skipPrefix:e})=>{let r=J.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let s=r.split(J.sep).filter(p=>p!==\"\"),a=s.indexOf(Ti),n=s.slice(0,a).join(J.sep),c=J.join(e,n),f=s.slice(a);return{locationRoot:c,segments:f}},GBe=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let s=()=>({children:new Map,linkType:\"HARD\"});for(let[a,n]of t.entries()){if(n.linkType===\"SOFT\"&&J.contains(e,n.target)!==null){let f=je.getFactoryWithDefault(r,n.target,s);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:p}=lN(c,{skipPrefix:e}),h=je.getFactoryWithDefault(r,f,s);for(let E=0;E<p.length;++E){let C=p[E];if(C!==\".\"){let S=je.getFactoryWithDefault(h.children,C,s);h.children.set(C,S),h=S}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},QY=async(t,e,r)=>{if(process.platform===\"win32\"&&r===\"junctions\"){let s;try{s=await ce.lstatPromise(t)}catch{}if(!s||s.isDirectory()){await ce.symlinkPromise(t,e,\"junction\");return}}await ce.symlinkPromise(J.relative(J.dirname(e),t),e)};async function qBe(t,e,r){let s=J.join(t,`${xY.default.randomBytes(16).toString(\"hex\")}.tmp`);try{await ce.writeFilePromise(s,r);try{await ce.linkPromise(s,e)}catch{}}finally{await ce.unlinkPromise(s)}}async function Hdt({srcPath:t,dstPath:e,entry:r,globalHardlinksStore:s,baseFs:a,nmMode:n}){if(r.kind===\"file\"){if(n.value===\"hardlinks-global\"&&s&&r.digest){let f=J.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await ce.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-Mdt))if(await Nn.checksumFile(f,{baseFs:ce,algorithm:\"sha1\"})!==r.digest){let C=J.join(s,`${xY.default.randomBytes(16).toString(\"hex\")}.tmp`);await ce.renamePromise(f,C);let S=await a.readFilePromise(t);await ce.writeFilePromise(C,S);try{await ce.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await ce.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await ce.linkPromise(f,e),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(t);await qBe(s,f,h),r.mtimeMs=new Date().getTime();try{await ce.linkPromise(f,e)}catch(E){E&&E.code&&E.code==\"EXDEV\"&&(n.value=\"hardlinks-local\",await a.copyFilePromise(t,e))}}}else await a.copyFilePromise(t,e);let c=r.mode&511;c!==420&&await ce.chmodPromise(e,c)}}var jdt=async(t,e,{baseFs:r,globalHardlinksStore:s,nmMode:a,windowsLinkType:n,packageChecksum:c})=>{await ce.mkdirPromise(t,{recursive:!0});let f=async(E=vt.dot)=>{let C=J.join(e,E),S=await r.readdirPromise(C,{withFileTypes:!0}),P=new Map;for(let I of S){let R=J.join(E,I.name),N,U=J.join(C,I.name);if(I.isFile()){if(N={kind:\"file\",mode:(await r.lstatPromise(U)).mode},a.value===\"hardlinks-global\"){let W=await Nn.checksumFile(U,{baseFs:r,algorithm:\"sha1\"});N.digest=W}}else if(I.isDirectory())N={kind:\"directory\"};else if(I.isSymbolicLink())N={kind:\"symlink\",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,\"0\")})`);if(P.set(R,N),I.isDirectory()&&R!==Ti){let W=await f(R);for(let[ee,ie]of W)P.set(ee,ie)}}return P},p;if(a.value===\"hardlinks-global\"&&s&&c){let E=J.join(s,c.substring(0,2),`${c.substring(2)}.json`);try{p=new Map(Object.entries(JSON.parse(await ce.readFilePromise(E,\"utf8\"))))}catch{p=await f()}}else p=await f();let h=!1;for(let[E,C]of p){let S=J.join(e,E),P=J.join(t,E);if(C.kind===\"directory\")await ce.mkdirPromise(P,{recursive:!0});else if(C.kind===\"file\"){let I=C.mtimeMs;await Hdt({srcPath:S,dstPath:P,entry:C,nmMode:a,baseFs:r,globalHardlinksStore:s}),C.mtimeMs!==I&&(h=!0)}else C.kind===\"symlink\"&&await QY(J.resolve(J.dirname(P),C.symlinkTo),P,n)}if(a.value===\"hardlinks-global\"&&s&&h&&c){let E=J.join(s,c.substring(0,2),`${c.substring(2)}.json`);await ce.removePromise(E),await qBe(s,E,Buffer.from(JSON.stringify(Object.fromEntries(p))))}};function Gdt(t,e,r,s){let a=new Map,n=new Map,c=new Map,f=!1,p=(h,E,C,S,P)=>{let I=!0,R=J.join(h,E),N=new Set;if(E===Ti||E.startsWith(\"@\")){let W;try{W=ce.statSync(R)}catch{}I=!!W,W?W.mtimeMs>r?(f=!0,N=new Set(ce.readdirSync(R))):N=new Set(C.children.get(E).children.keys()):f=!0;let ee=e.get(h);if(ee){let ie=J.join(h,Ti,aN),ue;try{ue=ce.statSync(ie)}catch{}if(!ue)f=!0;else if(ue.mtimeMs>r){f=!0;let le=new Set(ce.readdirSync(ie)),me=new Map;n.set(h,me);for(let[pe,Be]of ee)le.has(pe)&&me.set(pe,Be)}else n.set(h,ee)}}else I=P.has(E);let U=C.children.get(E);if(I){let{linkType:W,locator:ee}=U,ie={children:new Map,linkType:W,locator:ee};if(S.children.set(E,ie),ee){let ue=je.getSetWithDefault(c,ee);ue.add(R),c.set(ee,ue)}for(let ue of U.children.keys())p(R,ue,U,ie,N)}else U.locator&&s.storedBuildState.delete(G.parseLocator(U.locator).locatorHash)};for(let[h,E]of t){let{linkType:C,locator:S}=E,P={children:new Map,linkType:C,locator:S};if(a.set(h,P),S){let I=je.getSetWithDefault(c,E.locator);I.add(h),c.set(E.locator,I)}E.children.has(Ti)&&p(h,Ti,E,P,new Set)}return{locationTree:a,binSymlinks:n,locatorLocations:c,installChangedByUser:f}}function WBe(t){let e=G.parseDescriptor(t);return G.isVirtualDescriptor(e)&&(e=G.devirtualizeDescriptor(e)),e.range.startsWith(\"link:\")}async function qdt(t,e,r,{loadManifest:s}){let a=new Map;for(let[f,{locations:p}]of t){let h=WBe(f)?null:await s(f,p[0]),E=new Map;if(h)for(let[C,S]of h.bin){let P=J.join(p[0],S);S!==\"\"&&ce.existsSync(P)&&E.set(C,S)}a.set(f,E)}let n=new Map,c=(f,p,h)=>{let E=new Map,C=J.contains(r,f);if(h.locator&&C!==null){let S=a.get(h.locator);for(let[P,I]of S){let R=J.join(f,fe.toPortablePath(I));E.set(P,R)}for(let[P,I]of h.children){let R=J.join(f,P),N=c(R,R,I);N.size>0&&n.set(f,new Map([...n.get(f)||new Map,...N]))}}else for(let[S,P]of h.children){let I=c(J.join(f,S),p,P);for(let[R,N]of I)E.set(R,N)}return E};for(let[f,p]of e){let h=c(f,f,p);h.size>0&&n.set(f,new Map([...n.get(f)||new Map,...h]))}return n}var MBe=(t,e)=>{if(!t||!e)return t===e;let r=G.parseLocator(t);G.isVirtualLocator(r)&&(r=G.devirtualizeLocator(r));let s=G.parseLocator(e);return G.isVirtualLocator(s)&&(s=G.devirtualizeLocator(s)),G.areLocatorsEqual(r,s)};function TY(t){return J.join(t.get(\"globalFolder\"),\"store\")}function Wdt(t,e){let r=s=>{let a=s.split(J.sep),n=a.lastIndexOf(Ti);if(n<0||n==a.length-1)throw new Error(`Assertion failed. Path is outside of any node_modules package ${s}`);return a.slice(0,n+(a[n+1].startsWith(\"@\")?3:2)).join(J.sep)};for(let s of t.values())for(let[a,n]of s)e.has(r(n))&&s.delete(a)}async function Ydt(t,e,{baseFs:r,project:s,report:a,loadManifest:n,realLocatorChecksums:c}){let f=J.join(s.cwd,Ti),{locationTree:p,binSymlinks:h,locatorLocations:E,installChangedByUser:C}=Gdt(t.locationTree,t.binSymlinks,t.mtimeMs,s),S=GBe(e,{skipPrefix:s.cwd}),P=[],I=async({srcDir:Be,dstDir:Ce,linkType:g,globalHardlinksStore:we,nmMode:ye,windowsLinkType:Ae,packageChecksum:se})=>{let Z=(async()=>{try{g===\"SOFT\"?(await ce.mkdirPromise(J.dirname(Ce),{recursive:!0}),await QY(J.resolve(Be),Ce,Ae)):await jdt(Ce,Be,{baseFs:r,globalHardlinksStore:we,nmMode:ye,windowsLinkType:Ae,packageChecksum:se})}catch(De){throw De.message=`While persisting ${Be} -> ${Ce} ${De.message}`,De}finally{ie.tick()}})().then(()=>P.splice(P.indexOf(Z),1));P.push(Z),P.length>LBe&&await Promise.race(P)},R=async(Be,Ce,g)=>{let we=(async()=>{let ye=async(Ae,se,Z)=>{try{Z.innerLoop||await ce.mkdirPromise(se,{recursive:!0});let De=await ce.readdirPromise(Ae,{withFileTypes:!0});for(let Re of De){if(!Z.innerLoop&&Re.name===aN)continue;let mt=J.join(Ae,Re.name),j=J.join(se,Re.name);Re.isDirectory()?(Re.name!==Ti||Z&&Z.innerLoop)&&(await ce.mkdirPromise(j,{recursive:!0}),await ye(mt,j,{...Z,innerLoop:!0})):me.value===\"hardlinks-local\"||me.value===\"hardlinks-global\"?await ce.linkPromise(mt,j):await ce.copyFilePromise(mt,j,_Be.default.constants.COPYFILE_FICLONE)}}catch(De){throw Z.innerLoop||(De.message=`While cloning ${Ae} -> ${se} ${De.message}`),De}finally{Z.innerLoop||ie.tick()}};await ye(Be,Ce,g)})().then(()=>P.splice(P.indexOf(we),1));P.push(we),P.length>LBe&&await Promise.race(P)},N=async(Be,Ce,g)=>{if(g)for(let[we,ye]of Ce.children){let Ae=g.children.get(we);await N(J.join(Be,we),ye,Ae)}else{Ce.children.has(Ti)&&await bw(J.join(Be,Ti),{contentsOnly:!1});let we=J.basename(Be)===Ti&&p.has(J.join(J.dirname(Be)));await bw(Be,{contentsOnly:Be===f,isWorkspaceDir:we})}};for(let[Be,Ce]of p){let g=S.get(Be);for(let[we,ye]of Ce.children){if(we===\".\")continue;let Ae=g&&g.children.get(we),se=J.join(Be,we);await N(se,ye,Ae)}}let U=async(Be,Ce,g)=>{if(g){MBe(Ce.locator,g.locator)||await bw(Be,{contentsOnly:Ce.linkType===\"HARD\"});for(let[we,ye]of Ce.children){let Ae=g.children.get(we);await U(J.join(Be,we),ye,Ae)}}else{Ce.children.has(Ti)&&await bw(J.join(Be,Ti),{contentsOnly:!0});let we=J.basename(Be)===Ti&&S.has(J.join(J.dirname(Be)));await bw(Be,{contentsOnly:Ce.linkType===\"HARD\",isWorkspaceDir:we})}};for(let[Be,Ce]of S){let g=p.get(Be);for(let[we,ye]of Ce.children){if(we===\".\")continue;let Ae=g&&g.children.get(we);await U(J.join(Be,we),ye,Ae)}}let W=new Map,ee=[];for(let[Be,Ce]of E)for(let g of Ce){let{locationRoot:we,segments:ye}=lN(g,{skipPrefix:s.cwd}),Ae=S.get(we),se=we;if(Ae){for(let Z of ye)if(se=J.join(se,Z),Ae=Ae.children.get(Z),!Ae)break;if(Ae){let Z=MBe(Ae.locator,Be),De=e.get(Ae.locator),Re=De.target,mt=se,j=De.linkType;if(Z)W.has(Re)||W.set(Re,mt);else if(Re!==mt){let rt=G.parseLocator(Ae.locator);G.isVirtualLocator(rt)&&(rt=G.devirtualizeLocator(rt)),ee.push({srcDir:Re,dstDir:mt,linkType:j,realLocatorHash:rt.locatorHash})}}}}for(let[Be,{locations:Ce}]of e.entries())for(let g of Ce){let{locationRoot:we,segments:ye}=lN(g,{skipPrefix:s.cwd}),Ae=p.get(we),se=S.get(we),Z=we,De=e.get(Be),Re=G.parseLocator(Be);G.isVirtualLocator(Re)&&(Re=G.devirtualizeLocator(Re));let mt=Re.locatorHash,j=De.target,rt=g;if(j===rt)continue;let Fe=De.linkType;for(let Ne of ye)se=se.children.get(Ne);if(!Ae)ee.push({srcDir:j,dstDir:rt,linkType:Fe,realLocatorHash:mt});else for(let Ne of ye)if(Z=J.join(Z,Ne),Ae=Ae.children.get(Ne),!Ae){ee.push({srcDir:j,dstDir:rt,linkType:Fe,realLocatorHash:mt});break}}let ie=Ao.progressViaCounter(ee.length),ue=a.reportProgress(ie),le=s.configuration.get(\"nmMode\"),me={value:le},pe=s.configuration.get(\"winLinkType\");try{let Be=me.value===\"hardlinks-global\"?`${TY(s.configuration)}/v1`:null;if(Be&&!await ce.existsPromise(Be)){await ce.mkdirpPromise(Be);for(let g=0;g<256;g++)await ce.mkdirPromise(J.join(Be,g.toString(16).padStart(2,\"0\")))}for(let g of ee)(g.linkType===\"SOFT\"||!W.has(g.srcDir))&&(W.set(g.srcDir,g.dstDir),await I({...g,globalHardlinksStore:Be,nmMode:me,windowsLinkType:pe,packageChecksum:c.get(g.realLocatorHash)||null}));await Promise.all(P),P.length=0;for(let g of ee){let we=W.get(g.srcDir);g.linkType!==\"SOFT\"&&g.dstDir!==we&&await R(we,g.dstDir,{nmMode:me})}await Promise.all(P),await ce.mkdirPromise(f,{recursive:!0}),Wdt(h,new Set(ee.map(g=>g.dstDir)));let Ce=await qdt(e,S,s.cwd,{loadManifest:n});await Vdt(h,Ce,s.cwd,pe),await _dt(s,e,Ce,me,{installChangedByUser:C}),le==\"hardlinks-global\"&&me.value==\"hardlinks-local\"&&a.reportWarningOnce(74,\"'nmMode' has been downgraded to 'hardlinks-local' due to global cache and install folder being on different devices\")}finally{ue.stop()}}async function Vdt(t,e,r,s){for(let a of t.keys()){if(J.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);if(!e.has(a)){let n=J.join(a,Ti,aN);await ce.removePromise(n)}}for(let[a,n]of e){if(J.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);let c=J.join(a,Ti,aN),f=t.get(a)||new Map;await ce.mkdirPromise(c,{recursive:!0});for(let p of f.keys())n.has(p)||(await ce.removePromise(J.join(c,p)),process.platform===\"win32\"&&await ce.removePromise(J.join(c,`${p}.cmd`)));for(let[p,h]of n){let E=f.get(p),C=J.join(c,p);E!==h&&(process.platform===\"win32\"?await(0,UBe.default)(fe.fromPortablePath(h),fe.fromPortablePath(C),{createPwshFile:!1}):(await ce.removePromise(C),await QY(h,C,s),J.contains(r,await ce.realpathPromise(h))!==null&&await ce.chmodPromise(h,493)))}}}Ge();Dt();eA();var GD=class extends sg{constructor(){super(...arguments);this.mode=\"loose\"}makeInstaller(r){return new RY(r)}},RY=class extends Gm{constructor(){super(...arguments);this.mode=\"loose\"}async transformPnpSettings(r){let s=new uo({baseFs:new $f({maxOpenFiles:80,readOnlyArchives:!0})}),a=SBe(r,this.opts.project.cwd,s),{tree:n,errors:c}=kD(a,{pnpifyFs:!1,project:this.opts.project});if(!n){for(let{messageName:C,text:S}of c)this.opts.report.reportError(C,S);return}let f=new Map;r.fallbackPool=f;let p=(C,S)=>{let P=G.parseLocator(S.locator),I=G.stringifyIdent(P);I===C?f.set(C,P.reference):f.set(C,[I,P.reference])},h=J.join(this.opts.project.cwd,Er.nodeModules),E=n.get(h);if(!(typeof E>\"u\")){if(\"target\"in E)throw new Error(\"Assertion failed: Expected the root junction point to be a directory\");for(let C of E.dirList){let S=J.join(h,C),P=n.get(S);if(typeof P>\"u\")throw new Error(\"Assertion failed: Expected the child to have been registered\");if(\"target\"in P)p(C,P);else for(let I of P.dirList){let R=J.join(S,I),N=n.get(R);if(typeof N>\"u\")throw new Error(\"Assertion failed: Expected the subchild to have been registered\");if(\"target\"in N)p(`${C}/${I}`,N);else throw new Error(\"Assertion failed: Expected the leaf junction to be a package\")}}}}};var Jdt={hooks:{cleanGlobalArtifacts:async t=>{let e=TY(t);await ce.removePromise(e)}},configuration:{nmHoistingLimits:{description:\"Prevents packages to be hoisted past specific levels\",type:\"STRING\",values:[\"workspaces\",\"dependencies\",\"none\"],default:\"none\"},nmMode:{description:\"Defines in which measure Yarn must use hardlinks and symlinks when generated `node_modules` directories.\",type:\"STRING\",values:[\"classic\",\"hardlinks-local\",\"hardlinks-global\"],default:\"classic\"},nmSelfReferences:{description:\"Defines whether the linker should generate self-referencing symlinks for workspaces.\",type:\"BOOLEAN\",default:!0}},linkers:[jD,GD]},Kdt=Jdt;var FK={};Vt(FK,{NpmHttpFetcher:()=>VD,NpmRemapResolver:()=>JD,NpmSemverFetcher:()=>oh,NpmSemverResolver:()=>KD,NpmTagResolver:()=>zD,default:()=>ubt,npmConfigUtils:()=>hi,npmHttpUtils:()=>en,npmPublishUtils:()=>v1});Ge();var $Be=ut(Ai());var oi=\"npm:\";var en={};Vt(en,{AuthType:()=>zBe,customPackageError:()=>qm,del:()=>Amt,get:()=>Wm,getIdentUrl:()=>WD,getPackageMetadata:()=>Qw,handleInvalidAuthenticationError:()=>ag,post:()=>umt,put:()=>fmt});Ge();Ge();Dt();var LY=ut(Vv());ql();var KBe=ut(Ai());var hi={};Vt(hi,{RegistryType:()=>VBe,getAuditRegistry:()=>zdt,getAuthConfiguration:()=>OY,getDefaultRegistry:()=>qD,getPublishRegistry:()=>Xdt,getRegistryConfiguration:()=>JBe,getScopeConfiguration:()=>NY,getScopeRegistry:()=>Pw,isPackageApproved:()=>xw,normalizeRegistry:()=>Jc});Ge();var YBe=ut(Go()),VBe=(s=>(s.AUDIT_REGISTRY=\"npmAuditRegistry\",s.FETCH_REGISTRY=\"npmRegistryServer\",s.PUBLISH_REGISTRY=\"npmPublishRegistry\",s))(VBe||{});function Jc(t){return t.replace(/\\/$/,\"\")}function zdt({configuration:t}){return qD({configuration:t,type:\"npmAuditRegistry\"})}function Xdt(t,{configuration:e}){return t.publishConfig?.registry?Jc(t.publishConfig.registry):t.name?Pw(t.name.scope,{configuration:e,type:\"npmPublishRegistry\"}):qD({configuration:e,type:\"npmPublishRegistry\"})}function Pw(t,{configuration:e,type:r=\"npmRegistryServer\"}){let s=NY(t,{configuration:e});if(s===null)return qD({configuration:e,type:r});let a=s.get(r);return a===null?qD({configuration:e,type:r}):Jc(a)}function qD({configuration:t,type:e=\"npmRegistryServer\"}){let r=t.get(e);return Jc(r!==null?r:t.get(\"npmRegistryServer\"))}function JBe(t,{configuration:e}){let r=e.get(\"npmRegistries\"),s=Jc(t),a=r.get(s);if(typeof a<\"u\")return a;let n=r.get(s.replace(/^[a-z]+:/,\"\"));return typeof n<\"u\"?n:null}var Zdt=new Map([[\"npmRegistryServer\",\"https://npm.jsr.io/\"]]);function NY(t,{configuration:e}){if(t===null)return null;let s=e.get(\"npmScopes\").get(t);return s||(t===\"jsr\"?Zdt:null)}function OY(t,{configuration:e,ident:r}){let s=r&&NY(r.scope,{configuration:e});return s?.get(\"npmAuthIdent\")||s?.get(\"npmAuthToken\")?s:JBe(t,{configuration:e})||e}function $dt({configuration:t,version:e,publishTimes:r}){let s=t.get(\"npmMinimalAgeGate\");if(s){let a=r?.[e];if(typeof a>\"u\"||(new Date().getTime()-new Date(a).getTime())/60/1e3<s)return!0}return!1}function emt(t,e,r){let s=G.tryParseDescriptor(r);if(!s||s.identHash!==t.identHash&&!YBe.default.isMatch(G.stringifyIdent(t),G.stringifyIdent(s)))return!1;if(s.range===\"unknown\")return!0;let a=Fr.validRange(s.range);return!(!a||!a.test(e))}function tmt({configuration:t,ident:e,version:r}){return t.get(\"npmPreapprovedPackages\").some(s=>emt(e,r,s))}function xw(t){return!$dt(t)||tmt(t)}var zBe=(a=>(a[a.NO_AUTH=0]=\"NO_AUTH\",a[a.BEST_EFFORT=1]=\"BEST_EFFORT\",a[a.CONFIGURATION=2]=\"CONFIGURATION\",a[a.ALWAYS_AUTH=3]=\"ALWAYS_AUTH\",a))(zBe||{});async function ag(t,{attemptedAs:e,registry:r,headers:s,configuration:a}){if(uN(t))throw new jt(41,\"Invalid OTP token\");if(t.originalError?.name===\"HTTPError\"&&t.originalError?.response.statusCode===401)throw new jt(41,`Invalid authentication (${typeof e!=\"string\"?`as ${await hmt(r,s,{configuration:a})}`:`attempted as ${e}`})`)}function qm(t,e){let r=t.response?.statusCode;return r?r===404?\"Package not found\":r>=500&&r<600?`The registry appears to be down (using a ${he.applyHyperlink(e,\"local cache\",\"https://yarnpkg.com/advanced/lexicon#local-cache\")} might have protected you against such outages)`:null:null}function WD(t){return t.scope?`/@${t.scope}%2f${t.name}`:`/${t.name}`}var XBe=new Map,rmt=new Map;async function nmt(t){return await je.getFactoryWithDefault(XBe,t,async()=>{let e=null;try{e=await ce.readJsonPromise(t)}catch{}return e})}async function imt(t,e,{configuration:r,cached:s,registry:a,headers:n,version:c,...f}){return await je.getFactoryWithDefault(rmt,t,async()=>await Wm(WD(e),{...f,customErrorMessage:qm,configuration:r,registry:a,ident:e,headers:{...n,\"If-None-Match\":s?.etag,\"If-Modified-Since\":s?.lastModified},wrapNetworkRequest:async p=>async()=>{let h=await p();if(h.statusCode===304){if(s===null)throw new Error(\"Assertion failed: cachedMetadata should not be null\");return{...h,body:s.metadata}}let E=omt(JSON.parse(h.body.toString())),C={metadata:E,etag:h.headers.etag,lastModified:h.headers[\"last-modified\"]};return XBe.set(t,Promise.resolve(C)),Promise.resolve().then(async()=>{let S=`${t}-${process.pid}.tmp`;await ce.mkdirPromise(J.dirname(S),{recursive:!0}),await ce.writeJsonPromise(S,C,{compact:!0}),await ce.renamePromise(S,t)}).catch(()=>{}),{...h,body:E}}}))}function smt(t){return t.scope!==null?`@${t.scope}-${t.name}-${t.scope.length}`:t.name}async function Qw(t,{cache:e,project:r,registry:s,headers:a,version:n,...c}){let{configuration:f}=r;s=YD(f,{ident:t,registry:s});let p=lmt(f,s),h=J.join(p,`${smt(t)}.json`),E=null;if(!r.lockfileNeedsRefresh&&(E=await nmt(h),E)){if(typeof n<\"u\"&&typeof E.metadata.versions[n]<\"u\")return E.metadata;if(f.get(\"enableOfflineMode\")){let C=structuredClone(E.metadata),S=new Set;if(e){for(let I of Object.keys(C.versions)){let R=G.makeLocator(t,`npm:${I}`),N=e.getLocatorMirrorPath(R);(!N||!ce.existsSync(N))&&(delete C.versions[I],S.add(I))}let P=C[\"dist-tags\"].latest;if(S.has(P)){let I=Object.keys(E.metadata.versions).sort(KBe.default.compare),R=I.indexOf(P);for(;S.has(I[R])&&R>=0;)R-=1;R>=0?C[\"dist-tags\"].latest=I[R]:delete C[\"dist-tags\"].latest}}return C}}return await imt(h,t,{...c,configuration:f,cached:E,registry:s,headers:a,version:n})}var ZBe=[\"name\",\"dist.tarball\",\"bin\",\"scripts\",\"os\",\"cpu\",\"libc\",\"dependencies\",\"dependenciesMeta\",\"optionalDependencies\",\"peerDependencies\",\"peerDependenciesMeta\",\"deprecated\"];function omt(t){return{\"dist-tags\":t[\"dist-tags\"],versions:Object.fromEntries(Object.entries(t.versions).map(([e,r])=>[e,Kd(r,ZBe)])),time:t.time}}var amt=Nn.makeHash(\"time\",...ZBe).slice(0,6);function lmt(t,e){let r=cmt(t),s=new URL(e);return J.join(r,amt,s.hostname)}function cmt(t){return J.join(t.get(\"globalFolder\"),\"metadata/npm\")}async function Wm(t,{configuration:e,headers:r,ident:s,authType:a,allowOidc:n,registry:c,...f}){c=YD(e,{ident:s,registry:c}),s&&s.scope&&typeof a>\"u\"&&(a=1);let p=await cN(c,{authType:a,allowOidc:n,configuration:e,ident:s});p&&(r={...r,authorization:p});try{return await nn.get(t.charAt(0)===\"/\"?`${c}${t}`:t,{configuration:e,headers:r,...f})}catch(h){throw await ag(h,{registry:c,configuration:e,headers:r}),h}}async function umt(t,e,{attemptedAs:r,configuration:s,headers:a,ident:n,authType:c=3,allowOidc:f,registry:p,otp:h,...E}){p=YD(s,{ident:n,registry:p});let C=await cN(p,{authType:c,allowOidc:f,configuration:s,ident:n});C&&(a={...a,authorization:C}),h&&(a={...a,...kw(h)});try{return await nn.post(p+t,e,{configuration:s,headers:a,...E})}catch(S){if(!uN(S)||h)throw await ag(S,{attemptedAs:r,registry:p,configuration:s,headers:a}),S;h=await MY(S,{configuration:s});let P={...a,...kw(h)};try{return await nn.post(`${p}${t}`,e,{configuration:s,headers:P,...E})}catch(I){throw await ag(I,{attemptedAs:r,registry:p,configuration:s,headers:a}),I}}}async function fmt(t,e,{attemptedAs:r,configuration:s,headers:a,ident:n,authType:c=3,allowOidc:f,registry:p,otp:h,...E}){p=YD(s,{ident:n,registry:p});let C=await cN(p,{authType:c,allowOidc:f,configuration:s,ident:n});C&&(a={...a,authorization:C}),h&&(a={...a,...kw(h)});try{return await nn.put(p+t,e,{configuration:s,headers:a,...E})}catch(S){if(!uN(S))throw await ag(S,{attemptedAs:r,registry:p,configuration:s,headers:a}),S;h=await MY(S,{configuration:s});let P={...a,...kw(h)};try{return await nn.put(`${p}${t}`,e,{configuration:s,headers:P,...E})}catch(I){throw await ag(I,{attemptedAs:r,registry:p,configuration:s,headers:a}),I}}}async function Amt(t,{attemptedAs:e,configuration:r,headers:s,ident:a,authType:n=3,allowOidc:c,registry:f,otp:p,...h}){f=YD(r,{ident:a,registry:f});let E=await cN(f,{authType:n,allowOidc:c,configuration:r,ident:a});E&&(s={...s,authorization:E}),p&&(s={...s,...kw(p)});try{return await nn.del(f+t,{configuration:r,headers:s,...h})}catch(C){if(!uN(C)||p)throw await ag(C,{attemptedAs:e,registry:f,configuration:r,headers:s}),C;p=await MY(C,{configuration:r});let S={...s,...kw(p)};try{return await nn.del(`${f}${t}`,{configuration:r,headers:S,...h})}catch(P){throw await ag(P,{attemptedAs:e,registry:f,configuration:r,headers:s}),P}}}function YD(t,{ident:e,registry:r}){if(typeof r>\"u\"&&e)return Pw(e.scope,{configuration:t});if(typeof r!=\"string\")throw new Error(\"Assertion failed: The registry should be a string\");return Jc(r)}async function cN(t,{authType:e=2,allowOidc:r=!1,configuration:s,ident:a}){let n=OY(t,{configuration:s,ident:a}),c=pmt(n,e);if(!c)return null;let f=await s.reduceHook(p=>p.getNpmAuthenticationHeader,void 0,t,{configuration:s,ident:a});if(f)return f;if(n.get(\"npmAuthToken\"))return`Bearer ${n.get(\"npmAuthToken\")}`;if(n.get(\"npmAuthIdent\")){let p=n.get(\"npmAuthIdent\");return p.includes(\":\")?`Basic ${Buffer.from(p).toString(\"base64\")}`:`Basic ${p}`}if(r&&a){let p=await gmt(t,{configuration:s,ident:a});if(p)return`Bearer ${p}`}if(c&&e!==1)throw new jt(33,\"No authentication configured for request\");return null}function pmt(t,e){switch(e){case 2:return t.get(\"npmAlwaysAuth\");case 1:case 3:return!0;case 0:return!1;default:throw new Error(\"Unreachable\")}}async function hmt(t,e,{configuration:r}){if(typeof e>\"u\"||typeof e.authorization>\"u\")return\"an anonymous user\";try{return(await nn.get(new URL(`${t}/-/whoami`).href,{configuration:r,headers:e,jsonResponse:!0})).username??\"an unknown user\"}catch{return\"an unknown user\"}}async function MY(t,{configuration:e}){let r=t.originalError?.response.headers[\"npm-notice\"];if(r&&(await Ot.start({configuration:e,stdout:process.stdout,includeFooter:!1},async a=>{if(a.reportInfo(0,r.replace(/(https?:\\/\\/\\S+)/g,he.pretty(e,\"$1\",he.Type.URL))),!process.env.YARN_IS_TEST_ENV){let n=r.match(/open (https?:\\/\\/\\S+)/i);if(n&&Ui.openUrl){let{openNow:c}=await(0,LY.prompt)({type:\"confirm\",name:\"openNow\",message:\"Do you want to try to open this url now?\",required:!0,initial:!0,onCancel:()=>process.exit(130)});c&&(await Ui.openUrl(n[1])||(a.reportSeparator(),a.reportWarning(0,\"We failed to automatically open the url; you'll have to open it yourself in your browser of choice.\")))}}}),process.stdout.write(`\n`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||\"\";let{otp:s}=await(0,LY.prompt)({type:\"password\",name:\"otp\",message:\"One-time password:\",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`\n`),s}function uN(t){if(t.originalError?.name!==\"HTTPError\")return!1;try{return(t.originalError?.response.headers[\"www-authenticate\"].split(/,\\s*/).map(r=>r.toLowerCase())).includes(\"otp\")}catch{return!1}}function kw(t){return{\"npm-otp\":t}}async function gmt(t,{configuration:e,ident:r}){let s=null;if(process.env.GITLAB_CI)s=process.env.NPM_ID_TOKEN||null;else if(process.env.GITHUB_ACTIONS){if(!(process.env.ACTIONS_ID_TOKEN_REQUEST_URL&&process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN))return null;let a=`npm:${new URL(t).host.replace(\"registry.yarnpkg.com\",\"registry.npmjs.org\").replace(\"yarn.npmjs.org\",\"registry.npmjs.org\")}`,n=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);n.searchParams.append(\"audience\",a),s=(await nn.get(n.href,{configuration:e,jsonResponse:!0,headers:{Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).value}if(!s)return null;try{return(await nn.post(`${t}/-/npm/v1/oidc/token/exchange/package${WD(r)}`,null,{configuration:e,jsonResponse:!0,headers:{Authorization:`Bearer ${s}`}})).token||null}catch{}return null}var VD=class{supports(e,r){if(!e.reference.startsWith(oi))return!1;let{selector:s,params:a}=G.parseRange(e.reference);return!(!$Be.default.valid(s)||a===null||typeof a.__archiveUrl!=\"string\")}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let{params:s}=G.parseRange(e.reference);if(s===null||typeof s.__archiveUrl!=\"string\")throw new Error(\"Assertion failed: The archiveUrl querystring parameter should have been available\");let a=await Wm(s.__archiveUrl,{customErrorMessage:qm,configuration:r.project.configuration,ident:e});return await ps.convertToZip(a,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();var JD=class{supportsDescriptor(e,r){return!(!e.range.startsWith(oi)||!G.tryParseDescriptor(e.range.slice(oi.length),!0))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Unreachable\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){let s=r.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(e,r,s){let a=s.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return await s.resolver.getCandidates(a,r,s)}async getSatisfying(e,r,s,a){let n=a.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return a.resolver.getSatisfying(n,r,s,a)}resolve(e,r){throw new Error(\"Unreachable\")}};Ge();Ge();var eve=ut(Ai());var oh=class t{supports(e,r){if(!e.reference.startsWith(oi))return!1;let s=new URL(e.reference);return!(!eve.default.valid(s.pathname)||s.searchParams.has(\"__archiveUrl\"))}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s;try{s=await Wm(t.getLocatorUrl(e),{customErrorMessage:qm,configuration:r.project.configuration,ident:e})}catch{s=await Wm(t.getLocatorUrl(e).replace(/%2f/g,\"/\"),{customErrorMessage:qm,configuration:r.project.configuration,ident:e})}return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,r,{configuration:s}){let a=Pw(e.scope,{configuration:s}),n=t.getLocatorUrl(e);return r=r.replace(/^https?:(\\/\\/(?:[^/]+\\.)?npmjs.org(?:$|\\/))/,\"https:$1\"),a=a.replace(/^https:\\/\\/registry\\.npmjs\\.org($|\\/)/,\"https://registry.yarnpkg.com$1\"),r=r.replace(/^https:\\/\\/registry\\.npmjs\\.org($|\\/)/,\"https://registry.yarnpkg.com$1\"),r===a+n||r===a+n.replace(/%2f/g,\"/\")}static getLocatorUrl(e){let r=Fr.clean(e.reference.slice(oi.length));if(r===null)throw new jt(10,\"The npm semver resolver got selected, but the version isn't semver\");return`${WD(e)}/-/${e.name}-${r}.tgz`}};Ge();Ge();Ge();var UY=ut(Ai());var fN=G.makeIdent(null,\"node-gyp\"),dmt=/\\b(node-gyp|prebuild-install)\\b/,KD=class{supportsDescriptor(e,r){return e.range.startsWith(oi)?!!Fr.validRange(e.range.slice(oi.length)):!1}supportsLocator(e,r){if(!e.reference.startsWith(oi))return!1;let{selector:s}=G.parseRange(e.reference);return!!UY.default.valid(s)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=Fr.validRange(e.range.slice(oi.length));if(a===null)throw new Error(`Expected a valid range, got ${e.range.slice(oi.length)}`);let n=await Qw(e,{cache:s.fetchOptions?.cache,project:s.project,version:UY.default.valid(a.raw)?a.raw:void 0}),c=je.mapAndFilter(Object.keys(n.versions),h=>{try{let E=new Fr.SemVer(h);if(a.test(E))return xw({configuration:s.project.configuration,ident:e,version:h,publishTimes:n.time})?E:je.mapAndFilter.skip}catch{}return je.mapAndFilter.skip}),f=c.filter(h=>!n.versions[h.raw].deprecated),p=f.length>0?f:c;return p.sort((h,E)=>-h.compare(E)),p.map(h=>{let E=G.makeLocator(e,`${oi}${h.raw}`),C=n.versions[h.raw].dist.tarball;return oh.isConventionalTarballUrl(E,C,{configuration:s.project.configuration})?E:G.bindLocator(E,{__archiveUrl:C})})}async getSatisfying(e,r,s,a){let n=Fr.validRange(e.range.slice(oi.length));if(n===null)throw new Error(`Expected a valid range, got ${e.range.slice(oi.length)}`);return{locators:je.mapAndFilter(s,p=>{if(p.identHash!==e.identHash)return je.mapAndFilter.skip;let h=G.tryParseRange(p.reference,{requireProtocol:oi});if(!h)return je.mapAndFilter.skip;let E=new Fr.SemVer(h.selector);return n.test(E)?{locator:p,version:E}:je.mapAndFilter.skip}).sort((p,h)=>-p.version.compare(h.version)).map(({locator:p})=>p),sorted:!0}}async resolve(e,r){let{selector:s}=G.parseRange(e.reference),a=Fr.clean(s);if(a===null)throw new jt(10,\"The npm semver resolver got selected, but the version isn't semver\");let n=await Qw(e,{cache:r.fetchOptions?.cache,project:r.project,version:a});if(!Object.hasOwn(n,\"versions\"))throw new jt(15,'Registry returned invalid data for - missing \"versions\" field');if(!Object.hasOwn(n.versions,a))throw new jt(16,`Registry failed to return reference \"${a}\"`);let c=new Ut;if(c.load(n.versions[a]),!c.dependencies.has(fN.identHash)&&!c.peerDependencies.has(fN.identHash)){for(let f of c.scripts.values())if(f.match(dmt)){c.dependencies.set(fN.identHash,G.makeDescriptor(fN,\"latest\"));break}}return{...e,version:a,languageName:\"node\",linkType:\"HARD\",conditions:c.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(c.dependencies),peerDependencies:c.peerDependencies,dependenciesMeta:c.dependenciesMeta,peerDependenciesMeta:c.peerDependenciesMeta,bin:c.bin}}};Ge();Ge();var AN=ut(Ai());var zD=class{supportsDescriptor(e,r){return!(!e.range.startsWith(oi)||!Mp.test(e.range.slice(oi.length)))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Unreachable\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(oi.length),n=await Qw(e,{cache:s.fetchOptions?.cache,project:s.project});if(!Object.hasOwn(n,\"dist-tags\"))throw new jt(15,'Registry returned invalid data - missing \"dist-tags\" field');let c=n[\"dist-tags\"];if(!Object.hasOwn(c,a))throw new jt(16,`Registry failed to return tag \"${a}\"`);let f=Object.keys(n.versions),p=n.time,h=c[a];if(a===\"latest\"&&!xw({configuration:s.project.configuration,ident:e,version:h,publishTimes:p})){let S=h.includes(\"-\"),P=AN.default.rsort(f).find(I=>AN.default.lt(I,h)&&(S||!I.includes(\"-\"))&&xw({configuration:s.project.configuration,ident:e,version:I,publishTimes:p}));if(!P)throw new jt(16,`The version for tag \"${a}\" is quarantined, and no lower version is available`);h=P}let E=G.makeLocator(e,`${oi}${h}`),C=n.versions[h].dist.tarball;return oh.isConventionalTarballUrl(E,C,{configuration:s.project.configuration})?[E]:[G.bindLocator(E,{__archiveUrl:C})]}async getSatisfying(e,r,s,a){let n=[];for(let c of s){if(c.identHash!==e.identHash)continue;let f=G.tryParseRange(c.reference,{requireProtocol:oi});if(!(!f||!AN.default.valid(f.selector))){if(f.params?.__archiveUrl){let p=G.makeRange({protocol:oi,selector:f.selector,source:null,params:null}),[h]=await a.resolver.getCandidates(G.makeDescriptor(e,p),r,a);if(c.reference!==h.reference)continue}n.push(c)}}return{locators:n,sorted:!1}}async resolve(e,r){throw new Error(\"Unreachable\")}};var v1={};Vt(v1,{getGitHead:()=>abt,getPublishAccess:()=>qxe,getReadmeContent:()=>Wxe,makePublishBody:()=>obt});Ge();Ge();Dt();var bV={};Vt(bV,{PackCommand:()=>jw,default:()=>KEt,packUtils:()=>yA});Ge();Ge();Ge();Dt();Yt();var yA={};Vt(yA,{genPackList:()=>NN,genPackStream:()=>DV,genPackageManifest:()=>QSe,hasPackScripts:()=>vV,prepareForPack:()=>SV});Ge();Dt();var BV=ut(Go()),xSe=ut(SSe()),kSe=Ie(\"zlib\"),MEt=[\"/package.json\",\"/readme\",\"/readme.*\",\"/license\",\"/license.*\",\"/licence\",\"/licence.*\",\"/changelog\",\"/changelog.*\"],UEt=[\"/package.tgz\",\".github\",\".git\",\".hg\",\"node_modules\",\".npmignore\",\".gitignore\",\".#*\",\".DS_Store\"];async function vV(t){return!!(In.hasWorkspaceScript(t,\"prepack\")||In.hasWorkspaceScript(t,\"postpack\"))}async function SV(t,{report:e},r){await In.maybeExecuteWorkspaceLifecycleScript(t,\"prepack\",{report:e});try{let s=J.join(t.cwd,Ut.fileName);await ce.existsPromise(s)&&await t.manifest.loadFile(s,{baseFs:ce}),await r()}finally{await In.maybeExecuteWorkspaceLifecycleScript(t,\"postpack\",{report:e})}}async function DV(t,e){typeof e>\"u\"&&(e=await NN(t));let r=new Set;for(let n of t.manifest.publishConfig?.executableFiles??new Set)r.add(J.normalize(n));for(let n of t.manifest.bin.values())r.add(J.normalize(n));let s=xSe.default.pack();process.nextTick(async()=>{for(let n of e){let c=J.normalize(n),f=J.resolve(t.cwd,c),p=J.join(\"package\",c),h=await ce.lstatPromise(f),E={name:p,mtime:new Date(fi.SAFE_TIME*1e3)},C=r.has(c)?493:420,S,P,I=new Promise((N,U)=>{S=N,P=U}),R=N=>{N?P(N):S()};if(h.isFile()){let N;c===\"package.json\"?N=Buffer.from(JSON.stringify(await QSe(t),null,2)):N=await ce.readFilePromise(f),s.entry({...E,mode:C,type:\"file\"},N,R)}else h.isSymbolicLink()?s.entry({...E,mode:C,type:\"symlink\",linkname:await ce.readlinkPromise(f)},R):R(new Error(`Unsupported file type ${h.mode} for ${fe.fromPortablePath(c)}`));await I}s.finalize()});let a=(0,kSe.createGzip)();return s.pipe(a),a}async function QSe(t){let e=JSON.parse(JSON.stringify(t.manifest.raw));return await t.project.configuration.triggerHook(r=>r.beforeWorkspacePacking,t,e),e}async function NN(t){let e=t.project,r=e.configuration,s={accept:[],reject:[]};for(let C of UEt)s.reject.push(C);for(let C of MEt)s.accept.push(C);s.reject.push(r.get(\"rcFilename\"));let a=C=>{if(C===null||!C.startsWith(`${t.cwd}/`))return;let S=J.relative(t.cwd,C),P=J.resolve(vt.root,S);s.reject.push(P)};a(J.resolve(e.cwd,Er.lockfile)),a(r.get(\"cacheFolder\")),a(r.get(\"globalFolder\")),a(r.get(\"installStatePath\")),a(r.get(\"virtualFolder\")),a(r.get(\"yarnPath\")),await r.triggerHook(C=>C.populateYarnPaths,e,C=>{a(C)});for(let C of e.workspaces){let S=J.relative(t.cwd,C.cwd);S!==\"\"&&!S.match(/^(\\.\\.)?\\//)&&s.reject.push(`/${S}`)}let n={accept:[],reject:[]},c=t.manifest.publishConfig?.main??t.manifest.main,f=t.manifest.publishConfig?.module??t.manifest.module,p=t.manifest.publishConfig?.browser??t.manifest.browser,h=t.manifest.publishConfig?.bin??t.manifest.bin;c!=null&&n.accept.push(J.resolve(vt.root,c)),f!=null&&n.accept.push(J.resolve(vt.root,f)),typeof p==\"string\"&&n.accept.push(J.resolve(vt.root,p));for(let C of h.values())n.accept.push(J.resolve(vt.root,C));if(p instanceof Map)for(let[C,S]of p.entries())n.accept.push(J.resolve(vt.root,C)),typeof S==\"string\"&&n.accept.push(J.resolve(vt.root,S));let E=t.manifest.files!==null;if(E){n.reject.push(\"/*\");for(let C of t.manifest.files)TSe(n.accept,C,{cwd:vt.root})}return await _Et(t.cwd,{hasExplicitFileList:E,globalList:s,ignoreList:n})}async function _Et(t,{hasExplicitFileList:e,globalList:r,ignoreList:s}){let a=[],n=new Hf(t),c=[[vt.root,[s]]];for(;c.length>0;){let[f,p]=c.pop(),h=await n.lstatPromise(f);if(!bSe(f,{globalList:r,ignoreLists:h.isDirectory()?null:p}))if(h.isDirectory()){let E=await n.readdirPromise(f),C=!1,S=!1;if(!e||f!==vt.root)for(let R of E)C=C||R===\".gitignore\",S=S||R===\".npmignore\";let P=S?await DSe(n,f,\".npmignore\"):C?await DSe(n,f,\".gitignore\"):null,I=P!==null?[P].concat(p):p;bSe(f,{globalList:r,ignoreLists:p})&&(I=[...p,{accept:[],reject:[\"**/*\"]}]);for(let R of E)c.push([J.resolve(f,R),I])}else(h.isFile()||h.isSymbolicLink())&&a.push(J.relative(vt.root,f))}return a.sort()}async function DSe(t,e,r){let s={accept:[],reject:[]},a=await t.readFilePromise(J.join(e,r),\"utf8\");for(let n of a.split(/\\n/g))TSe(s.reject,n,{cwd:e});return s}function HEt(t,{cwd:e}){let r=t[0]===\"!\";return r&&(t=t.slice(1)),t.match(/\\.{0,1}\\//)&&(t=J.resolve(e,t)),r&&(t=`!${t}`),t}function TSe(t,e,{cwd:r}){let s=e.trim();s===\"\"||s[0]===\"#\"||t.push(HEt(s,{cwd:r}))}function bSe(t,{globalList:e,ignoreLists:r}){let s=FN(t,e.accept);if(s!==0)return s===2;let a=FN(t,e.reject);if(a!==0)return a===1;if(r!==null)for(let n of r){let c=FN(t,n.accept);if(c!==0)return c===2;let f=FN(t,n.reject);if(f!==0)return f===1}return!1}function FN(t,e){let r=e,s=[];for(let a=0;a<e.length;++a)e[a][0]!==\"!\"?r!==e&&r.push(e[a]):(r===e&&(r=e.slice(0,a)),s.push(e[a].slice(1)));return PSe(t,s)?2:PSe(t,r)?1:0}function PSe(t,e){let r=e,s=[];for(let a=0;a<e.length;++a)e[a].includes(\"/\")?r!==e&&r.push(e[a]):(r===e&&(r=e.slice(0,a)),s.push(e[a]));return!!(BV.default.isMatch(t,r,{dot:!0,nocase:!0})||BV.default.isMatch(t,s,{dot:!0,basename:!0,nocase:!0}))}var jw=class extends ft{constructor(){super(...arguments);this.installIfNeeded=ge.Boolean(\"--install-if-needed\",!1,{description:\"Run a preliminary `yarn install` if the package contains build scripts\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Print the file paths without actually generating the package archive\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.out=ge.String(\"-o,--out\",{description:\"Create the archive at the specified path\"});this.filename=ge.String(\"--filename\",{hidden:!0})}static{this.paths=[[\"pack\"]]}static{this.usage=ot.Usage({description:\"generate a tarball from the active workspace\",details:\"\\n      This command will turn the active workspace into a compressed archive suitable for publishing. The archive will by default be stored at the root of the workspace (`package.tgz`).\\n\\n      If the `-o,--out` is set the archive will be created at the specified path. The `%s` and `%v` variables can be used within the path and will be respectively replaced by the package name and version.\\n    \",examples:[[\"Create an archive from the active workspace\",\"yarn pack\"],[\"List the files that would be made part of the workspace's archive\",\"yarn pack --dry-run\"],[\"Name and output the archive in a dedicated folder\",\"yarn pack --out /artifacts/%s-%v.tgz\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await vV(a)&&(this.installIfNeeded?await s.install({cache:await Kr.find(r),report:new ki}):await s.restoreInstallState());let n=this.out??this.filename,c=typeof n<\"u\"?J.resolve(this.context.cwd,jEt(n,{workspace:a})):J.resolve(a.cwd,\"package.tgz\");return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async p=>{await SV(a,{report:p},async()=>{p.reportJson({base:fe.fromPortablePath(a.cwd)});let h=await NN(a);for(let E of h)p.reportInfo(null,fe.fromPortablePath(E)),p.reportJson({location:fe.fromPortablePath(E)});if(!this.dryRun){let E=await DV(a,h);await ce.mkdirPromise(J.dirname(c),{recursive:!0});let C=ce.createWriteStream(c);E.pipe(C),await new Promise(S=>{C.on(\"finish\",S)})}}),this.dryRun||(p.reportInfo(0,`Package archive generated in ${he.pretty(r,c,he.Type.PATH)}`),p.reportJson({output:fe.fromPortablePath(c)}))})).exitCode()}};function jEt(t,{workspace:e}){let r=t.replace(\"%s\",GEt(e)).replace(\"%v\",qEt(e));return fe.toPortablePath(r)}function GEt(t){return t.manifest.name!==null?G.slugifyIdent(t.manifest.name):\"package\"}function qEt(t){return t.manifest.version!==null?t.manifest.version:\"unknown\"}var WEt=[\"dependencies\",\"devDependencies\",\"peerDependencies\"],YEt=\"workspace:\",VEt=(t,e)=>{e.publishConfig&&(e.publishConfig.type&&(e.type=e.publishConfig.type),e.publishConfig.main&&(e.main=e.publishConfig.main),e.publishConfig.browser&&(e.browser=e.publishConfig.browser),e.publishConfig.module&&(e.module=e.publishConfig.module),e.publishConfig.exports&&(e.exports=e.publishConfig.exports),e.publishConfig.imports&&(e.imports=e.publishConfig.imports),e.publishConfig.bin&&(e.bin=e.publishConfig.bin));let r=t.project;for(let s of WEt)for(let a of t.manifest.getForScope(s).values()){let n=r.tryWorkspaceByDescriptor(a),c=G.parseRange(a.range);if(c.protocol===YEt)if(n===null){if(r.tryWorkspaceByIdent(a)===null)throw new jt(21,`${G.prettyDescriptor(r.configuration,a)}: No local workspace found for this range`)}else{let f;G.areDescriptorsEqual(a,n.anchoredDescriptor)||c.selector===\"*\"?f=n.manifest.version??\"0.0.0\":c.selector===\"~\"||c.selector===\"^\"?f=`${c.selector}${n.manifest.version??\"0.0.0\"}`:f=c.selector;let p=s===\"dependencies\"?G.makeDescriptor(a,\"unknown\"):null,h=p!==null&&t.manifest.ensureDependencyMeta(p).optional?\"optionalDependencies\":s;e[h][G.stringifyIdent(a)]=f}}},JEt={hooks:{beforeWorkspacePacking:VEt},commands:[jw]},KEt=JEt;var Gxe=ut(HSe());Ge();var Hxe=ut(_xe()),{env:Bt}=process,XDt=\"application/vnd.in-toto+json\",ZDt=\"https://in-toto.io/Statement/v0.1\",$Dt=\"https://in-toto.io/Statement/v1\",ebt=\"https://slsa.dev/provenance/v0.2\",tbt=\"https://slsa.dev/provenance/v1\",rbt=\"https://github.com/actions/runner\",nbt=\"https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1\",ibt=\"https://github.com/npm/cli/gitlab\",sbt=\"v0alpha1\",jxe=async(t,e)=>{let r;if(Bt.GITHUB_ACTIONS){if(!Bt.ACTIONS_ID_TOKEN_REQUEST_URL)throw new jt(91,'Provenance generation in GitHub Actions requires \"write\" access to the \"id-token\" permission');let s=(Bt.GITHUB_WORKFLOW_REF||\"\").replace(`${Bt.GITHUB_REPOSITORY}/`,\"\"),a=s.indexOf(\"@\"),n=s.slice(0,a),c=s.slice(a+1);r={_type:$Dt,subject:t,predicateType:tbt,predicate:{buildDefinition:{buildType:nbt,externalParameters:{workflow:{ref:c,repository:`${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}`,path:n}},internalParameters:{github:{event_name:Bt.GITHUB_EVENT_NAME,repository_id:Bt.GITHUB_REPOSITORY_ID,repository_owner_id:Bt.GITHUB_REPOSITORY_OWNER_ID}},resolvedDependencies:[{uri:`git+${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}@${Bt.GITHUB_REF}`,digest:{gitCommit:Bt.GITHUB_SHA}}]},runDetails:{builder:{id:`${rbt}/${Bt.RUNNER_ENVIRONMENT}`},metadata:{invocationId:`${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}/actions/runs/${Bt.GITHUB_RUN_ID}/attempts/${Bt.GITHUB_RUN_ATTEMPT}`}}}}}else if(Bt.GITLAB_CI){if(!Bt.SIGSTORE_ID_TOKEN)throw new jt(91,`Provenance generation in GitLab CI requires \"SIGSTORE_ID_TOKEN\" with \"sigstore\" audience to be present in \"id_tokens\". For more info see:\nhttps://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html`);r={_type:ZDt,subject:t,predicateType:ebt,predicate:{buildType:`${ibt}/${sbt}`,builder:{id:`${Bt.CI_PROJECT_URL}/-/runners/${Bt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA},entryPoint:Bt.CI_JOB_NAME},parameters:{CI:Bt.CI,CI_API_GRAPHQL_URL:Bt.CI_API_GRAPHQL_URL,CI_API_V4_URL:Bt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:Bt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:Bt.CI_BUILD_ID,CI_BUILD_NAME:Bt.CI_BUILD_NAME,CI_BUILD_REF:Bt.CI_BUILD_REF,CI_BUILD_REF_NAME:Bt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:Bt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:Bt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:Bt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:Bt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:Bt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:Bt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:Bt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:Bt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:Bt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:Bt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:Bt.CI_COMMIT_TITLE,CI_CONFIG_PATH:Bt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:Bt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:Bt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:Bt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:Bt.CI_JOB_ID,CI_JOB_NAME:Bt.CI_JOB_NAME,CI_JOB_NAME_SLUG:Bt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:Bt.CI_JOB_STAGE,CI_JOB_STARTED_AT:Bt.CI_JOB_STARTED_AT,CI_JOB_URL:Bt.CI_JOB_URL,CI_NODE_TOTAL:Bt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:Bt.CI_PAGES_DOMAIN,CI_PAGES_URL:Bt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:Bt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:Bt.CI_PIPELINE_ID,CI_PIPELINE_IID:Bt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:Bt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:Bt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:Bt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:Bt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:Bt.CI_PROJECT_ID,CI_PROJECT_NAME:Bt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:Bt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:Bt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:Bt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:Bt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:Bt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:Bt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:Bt.CI_PROJECT_TITLE,CI_PROJECT_URL:Bt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:Bt.CI_PROJECT_VISIBILITY,CI_REGISTRY:Bt.CI_REGISTRY,CI_REGISTRY_IMAGE:Bt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:Bt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:Bt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:Bt.CI_RUNNER_ID,CI_RUNNER_TAGS:Bt.CI_RUNNER_TAGS,CI_SERVER_HOST:Bt.CI_SERVER_HOST,CI_SERVER_NAME:Bt.CI_SERVER_NAME,CI_SERVER_PORT:Bt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:Bt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:Bt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:Bt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:Bt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:Bt.CI_SERVER_URL,CI_SERVER_VERSION:Bt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:Bt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:Bt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:Bt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:Bt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:Bt.GITLAB_CI,GITLAB_FEATURES:Bt.GITLAB_FEATURES,GITLAB_USER_ID:Bt.GITLAB_USER_ID,GITLAB_USER_LOGIN:Bt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:Bt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:Bt.CI_RUNNER_DESCRIPTION,architecture:Bt.CI_RUNNER_EXECUTABLE_ARCH,server:Bt.CI_SERVER_URL,project:Bt.CI_PROJECT_PATH,job:{id:Bt.CI_JOB_ID},pipeline:{id:Bt.CI_PIPELINE_ID,ref:Bt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${Bt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA}}]}}}else throw new jt(91,\"Provenance generation is only supported in GitHub Actions and GitLab CI\");return Hxe.attest(Buffer.from(JSON.stringify(r)),XDt,e)};async function obt(t,e,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=t.manifest.name,p=t.manifest.version,h=G.stringifyIdent(f),E=Gxe.default.fromData(e,{algorithms:[\"sha1\",\"sha512\"]}),C=r??qxe(t,f),S=await Wxe(t),P=await yA.genPackageManifest(t),I=`${h}-${p}.tgz`,R=new URL(`${Jc(a)}/${h}/-/${I}`),N={[I]:{content_type:\"application/octet-stream\",data:e.toString(\"base64\"),length:e.length}};if(c){let U={name:`pkg:npm/${h.replace(/^@/,\"%40\")}@${p}`,digest:{sha512:E.sha512[0].hexDigest()}},W=await jxe([U]),ee=JSON.stringify(W);N[`${h}-${p}.sigstore`]={content_type:W.mediaType,data:ee,length:ee.length}}return{_id:h,_attachments:N,name:h,access:C,\"dist-tags\":{[s]:p},versions:{[p]:{...P,_id:`${h}@${p}`,name:h,version:p,gitHead:n,dist:{shasum:E.sha1[0].hexDigest(),integrity:E.sha512[0].toString(),tarball:R.toString()}}},readme:S}}async function abt(t){try{let{stdout:e}=await qr.execvp(\"git\",[\"rev-parse\",\"--revs-only\",\"HEAD\"],{cwd:t});return e.trim()===\"\"?void 0:e.trim()}catch{return}}function qxe(t,e){let r=t.project.configuration;return t.manifest.publishConfig&&typeof t.manifest.publishConfig.access==\"string\"?t.manifest.publishConfig.access:r.get(\"npmPublishAccess\")!==null?r.get(\"npmPublishAccess\"):e.scope?\"restricted\":\"public\"}async function Wxe(t){let e=fe.toPortablePath(`${t.cwd}/README.md`),r=t.manifest.name,a=`# ${G.stringifyIdent(r)}\n`;try{a=await ce.readFilePromise(e,\"utf8\")}catch(n){if(n.code===\"ENOENT\")return a;throw n}return a}var RK={npmAlwaysAuth:{description:\"URL of the selected npm registry (note: npm enterprise isn't supported)\",type:\"BOOLEAN\",default:!1},npmAuthIdent:{description:\"Authentication identity for the npm registry (_auth in npm and yarn v1)\",type:\"SECRET\",default:null},npmAuthToken:{description:\"Authentication token for the npm registry (_authToken in npm and yarn v1)\",type:\"SECRET\",default:null}},Yxe={npmAuditRegistry:{description:\"Registry to query for audit reports\",type:\"STRING\",default:null},npmPublishRegistry:{description:\"Registry to push packages to\",type:\"STRING\",default:null},npmRegistryServer:{description:\"URL of the selected npm registry (note: npm enterprise isn't supported)\",type:\"STRING\",default:\"https://registry.yarnpkg.com\"}},lbt={npmMinimalAgeGate:{description:\"Minimum age of a package version according to the publish date on the npm registry to be considered for installation\",type:\"DURATION\",unit:\"m\",default:\"0m\"},npmPreapprovedPackages:{description:\"Array of package descriptors or package name glob patterns to exclude from the minimum release age check\",type:\"STRING\",isArray:!0,default:[]}},cbt={configuration:{...RK,...Yxe,...lbt,npmScopes:{description:\"Settings per package scope\",type:\"MAP\",valueDefinition:{description:\"\",type:\"SHAPE\",properties:{...RK,...Yxe}}},npmRegistries:{description:\"Settings per registry\",type:\"MAP\",normalizeKeys:Jc,valueDefinition:{description:\"\",type:\"SHAPE\",properties:{...RK}}}},fetchers:[VD,oh],resolvers:[JD,KD,zD]},ubt=cbt;var qK={};Vt(qK,{NpmAuditCommand:()=>D1,NpmInfoCommand:()=>b1,NpmLoginCommand:()=>P1,NpmLogoutCommand:()=>k1,NpmPublishCommand:()=>Q1,NpmTagAddCommand:()=>R1,NpmTagListCommand:()=>T1,NpmTagRemoveCommand:()=>F1,NpmWhoamiCommand:()=>N1,default:()=>wbt,npmAuditTypes:()=>zb,npmAuditUtils:()=>kL});Ge();Ge();Yt();var UK=ut(Go());Ul();var zb={};Vt(zb,{Environment:()=>Jb,Severity:()=>Kb});var Jb=(s=>(s.All=\"all\",s.Production=\"production\",s.Development=\"development\",s))(Jb||{}),Kb=(n=>(n.Info=\"info\",n.Low=\"low\",n.Moderate=\"moderate\",n.High=\"high\",n.Critical=\"critical\",n))(Kb||{});var kL={};Vt(kL,{allSeverities:()=>S1,getPackages:()=>MK,getReportTree:()=>OK,getSeverityInclusions:()=>NK,getTopLevelDependencies:()=>LK});Ge();var Vxe=ut(Ai());var S1=[\"info\",\"low\",\"moderate\",\"high\",\"critical\"];function NK(t){if(typeof t>\"u\")return new Set(S1);let e=S1.indexOf(t),r=S1.slice(e);return new Set(r)}function OK(t){let e={},r={children:e};for(let[s,a]of je.sortMap(Object.entries(t),n=>n[0]))for(let n of je.sortMap(a,c=>`${c.id}`))e[`${s}/${n.id}`]={value:he.tuple(he.Type.IDENT,G.parseIdent(s)),children:{ID:typeof n.id<\"u\"&&{label:\"ID\",value:he.tuple(he.Type.ID,n.id)},Issue:{label:\"Issue\",value:he.tuple(he.Type.NO_HINT,n.title)},URL:typeof n.url<\"u\"&&{label:\"URL\",value:he.tuple(he.Type.URL,n.url)},Severity:{label:\"Severity\",value:he.tuple(he.Type.NO_HINT,n.severity)},\"Vulnerable Versions\":{label:\"Vulnerable Versions\",value:he.tuple(he.Type.RANGE,n.vulnerable_versions)},\"Tree Versions\":{label:\"Tree Versions\",children:[...n.versions].sort(Vxe.default.compare).map(c=>({value:he.tuple(he.Type.REFERENCE,c)}))},Dependents:{label:\"Dependents\",children:je.sortMap(n.dependents,c=>G.stringifyLocator(c)).map(c=>({value:he.tuple(he.Type.LOCATOR,c)}))}}};return r}function LK(t,e,{all:r,environment:s}){let a=[],n=r?t.workspaces:[e],c=[\"all\",\"production\"].includes(s),f=[\"all\",\"development\"].includes(s);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!f:!c)||a.push({workspace:p,dependency:h});return a}function MK(t,e,{recursive:r}){let s=new Map,a=new Set,n=[],c=(f,p)=>{let h=t.storedResolutions.get(p.descriptorHash);if(typeof h>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");if(!a.has(h))a.add(h);else return;let E=t.storedPackages.get(h);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");if(G.ensureDevirtualizedLocator(E).reference.startsWith(\"npm:\")&&E.version!==null){let S=G.stringifyIdent(E),P=je.getMapWithDefault(s,S);je.getArrayWithDefault(P,E.version).push(f)}if(r)for(let S of E.dependencies.values())n.push([E,S])};for(let{workspace:f,dependency:p}of e)n.push([f.anchoredLocator,p]);for(;n.length>0;){let[f,p]=n.shift();c(f,p)}return s}var D1=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Audit dependencies from all workspaces\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Audit transitive dependencies as well\"});this.environment=ge.String(\"--environment\",\"all\",{description:\"Which environments to cover\",validator:fo(Jb)});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.noDeprecations=ge.Boolean(\"--no-deprecations\",!1,{description:\"Don't warn about deprecated packages\"});this.severity=ge.String(\"--severity\",\"info\",{description:\"Minimal severity requested for packages to be displayed\",validator:fo(Kb)});this.excludes=ge.Array(\"--exclude\",[],{description:\"Array of glob patterns of packages to exclude from audit\"});this.ignores=ge.Array(\"--ignore\",[],{description:\"Array of glob patterns of advisory ID's to ignore in the audit report\"})}static{this.paths=[[\"npm\",\"audit\"]]}static{this.usage=ot.Usage({description:\"perform a vulnerability audit against the installed packages\",details:`\n      This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).\n\n      For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \\`-A,--all\\`. To extend this search to both direct and transitive dependencies, use \\`-R,--recursive\\`.\n\n      Applying the \\`--severity\\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${S1.map(r=>`\\`${r}\\``).join(\", \")}.\n\n      If the \\`--json\\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.\n\n      If certain packages produce false positives for a particular environment, the \\`--exclude\\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \\`npmAuditExcludePackages\\` option.\n\n      If particular advisories are needed to be ignored, the \\`--ignore\\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \\`npmAuditIgnoreAdvisories\\` option.\n\n      To understand the dependency tree requiring vulnerable packages, check the raw report with the \\`--json\\` flag or use \\`yarn why package\\` to get more information as to who depends on them.\n    `,examples:[[\"Checks for known security issues with the installed packages. The output is a list of known issues.\",\"yarn npm audit\"],[\"Audit dependencies in all workspaces\",\"yarn npm audit --all\"],[\"Limit auditing to `dependencies` (excludes `devDependencies`)\",\"yarn npm audit --environment production\"],[\"Show audit report as valid JSON\",\"yarn npm audit --json\"],[\"Audit all direct and transitive dependencies\",\"yarn npm audit --recursive\"],[\"Output moderate (or more severe) vulnerabilities\",\"yarn npm audit --severity moderate\"],[\"Exclude certain packages\",\"yarn npm audit --exclude package1 --exclude package2\"],[\"Ignore specific advisories\",\"yarn npm audit --ignore 1234567 --ignore 7654321\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=LK(s,a,{all:this.all,environment:this.environment}),c=MK(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get(\"npmAuditExcludePackages\"),...this.excludes])),p=Object.create(null);for(let[N,U]of c)f.some(W=>UK.default.isMatch(N,W))||(p[N]=[...U.keys()]);let h=hi.getAuditRegistry({configuration:r}),E,C=await lA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=en.post(\"/-/npm/v1/security/advisories/bulk\",p,{authType:en.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([ee,ie])=>{let ue=await en.getPackageMetadata(G.parseIdent(ee),{project:s});return je.mapAndFilter(ie,le=>{let{deprecated:me}=ue.versions[le];return me?[ee,le,me]:je.mapAndFilter.skip})})),W=await N;for(let[ee,ie,ue]of U.flat(1))Object.hasOwn(W,ee)&&W[ee].some(le=>Fr.satisfiesWithPrereleases(ie,le.vulnerable_versions))||(W[ee]??=[],W[ee].push({id:`${ee} (deprecation)`,title:(typeof ue==\"string\"?ue:\"\").trim()||\"This package has been deprecated.\",severity:\"moderate\",vulnerable_versions:ie}));E=W});if(C.hasErrors())return C.exitCode();let S=NK(this.severity),P=Array.from(new Set([...r.get(\"npmAuditIgnoreAdvisories\"),...this.ignores])),I=Object.create(null);for(let[N,U]of Object.entries(E)){let W=U.filter(ee=>!UK.default.isMatch(`${ee.id}`,P)&&S.has(ee.severity));W.length>0&&(I[N]=W.map(ee=>{let ie=c.get(N);if(typeof ie>\"u\")throw new Error(\"Assertion failed: Expected the registry to only return packages that were requested\");let ue=[...ie.keys()].filter(me=>Fr.satisfiesWithPrereleases(me,ee.vulnerable_versions)),le=new Map;for(let me of ue)for(let pe of ie.get(me))le.set(pe.locatorHash,pe);return{...ee,versions:ue,dependents:[...le.values()]}}))}let R=Object.keys(I).length>0;return R?(xs.emitTree(OK(I),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async N=>{N.reportInfo(1,\"No audit suggestions\")}),R?1:0)}};Ge();Ge();Dt();Yt();var _K=ut(Ai()),HK=Ie(\"util\"),b1=class extends ft{constructor(){super(...arguments);this.fields=ge.String(\"-f,--fields\",{description:\"A comma-separated list of manifest fields that should be displayed\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.packages=ge.Rest()}static{this.paths=[[\"npm\",\"info\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"show information about a package\",details:\"\\n      This command fetches information about a package from the npm registry and prints it in a tree format.\\n\\n      The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\\n\\n      Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\\n\\n      If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\\n\\n      By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\\n    \",examples:[[\"Show all available information about react (except the `dist`, `readme`, and `users` fields)\",\"yarn npm info react\"],[\"Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)\",\"yarn npm info react --json\"],[\"Show all available information about react@16.12.0\",\"yarn npm info react@16.12.0\"],[\"Show all available information about react@next\",\"yarn npm info react@next\"],[\"Show the description of react\",\"yarn npm info react --fields description\"],[\"Show all available versions of react\",\"yarn npm info react --fields versions\"],[\"Show the readme of react\",\"yarn npm info react --fields readme\"],[\"Show a few fields of react\",\"yarn npm info react --fields homepage,repository\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),a=typeof this.fields<\"u\"?new Set([\"name\",...this.fields.split(/\\s*,\\s*/)]):null,n=[],c=!1,f=await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async p=>{for(let h of this.packages){let E;if(h===\".\"){let ie=s.topLevelWorkspace;if(!ie.manifest.name)throw new nt(`Missing ${he.pretty(r,\"name\",he.Type.CODE)} field in ${fe.fromPortablePath(J.join(ie.cwd,Er.manifest))}`);E=G.makeDescriptor(ie.manifest.name,\"unknown\")}else E=G.parseDescriptor(h);let C=en.getIdentUrl(E),S=jK(await en.get(C,{configuration:r,ident:E,jsonResponse:!0,customErrorMessage:en.customPackageError})),P=Object.keys(S.versions).sort(_K.default.compareLoose),R=S[\"dist-tags\"].latest||P[P.length-1],N=Fr.validRange(E.range);if(N){let ie=_K.default.maxSatisfying(P,N);ie!==null?R=ie:(p.reportWarning(0,`Unmet range ${G.prettyRange(r,E.range)}; falling back to the latest version`),c=!0)}else Object.hasOwn(S[\"dist-tags\"],E.range)?R=S[\"dist-tags\"][E.range]:E.range!==\"unknown\"&&(p.reportWarning(0,`Unknown tag ${G.prettyRange(r,E.range)}; falling back to the latest version`),c=!0);let U=S.versions[R],W={...S,...U,version:R,versions:P},ee;if(a!==null){ee={};for(let ie of a){let ue=W[ie];if(typeof ue<\"u\")ee[ie]=ue;else{p.reportWarning(1,`The ${he.pretty(r,ie,he.Type.CODE)} field doesn't exist inside ${G.prettyIdent(r,E)}'s information`),c=!0;continue}}}else this.json||(delete W.dist,delete W.readme,delete W.users),ee=W;p.reportJson(ee),this.json||n.push(ee)}});HK.inspect.styles.name=\"cyan\";for(let p of n)(p!==n[0]||c)&&this.context.stdout.write(`\n`),this.context.stdout.write(`${(0,HK.inspect)(p,{depth:1/0,colors:!0,compact:!1})}\n`);return f.exitCode()}};function jK(t){if(Array.isArray(t)){let e=[];for(let r of t)r=jK(r),r&&e.push(r);return e}else if(typeof t==\"object\"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith(\"_\"))continue;let s=jK(t[r]);s&&(e[r]=s)}return e}else return t||null}Ge();Ge();Yt();var GK=ut(Vv()),P1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Login to the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Login to the publish registry\"});this.alwaysAuth=ge.Boolean(\"--always-auth\",{description:\"Set the npmAlwaysAuth configuration\"});this.webLogin=ge.Boolean(\"--web-login\",{description:\"Enable web login\"})}static{this.paths=[[\"npm\",\"login\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"store new login info to access the npm registry\",details:\"\\n      This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\\n\\n      Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\\n\\n      Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\\n    \",examples:[[\"Login to the default registry\",\"yarn npm login\"],[\"Login to the registry linked to the @my-scope registry\",\"yarn npm login --scope my-scope\"],[\"Login to the publish registry for the current package\",\"yarn npm login --publish\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await QL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ot.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=await gbt({registry:s,configuration:r,report:n,webLogin:this.webLogin,stdin:this.context.stdin,stdout:this.context.stdout});return await mbt(s,c,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,\"Successfully logged in\")})).exitCode()}};async function QL({scope:t,publish:e,configuration:r,cwd:s}){return t&&e?hi.getScopeRegistry(t,{configuration:r,type:hi.RegistryType.PUBLISH_REGISTRY}):t?hi.getScopeRegistry(t,{configuration:r}):e?hi.getPublishRegistry((await eC(r,s)).manifest,{configuration:r}):hi.getDefaultRegistry({configuration:r})}async function fbt(t,e){let r;try{r=await en.post(\"/-/v1/login\",null,{configuration:e,registry:t,authType:en.AuthType.NO_AUTH,jsonResponse:!0,headers:{\"npm-auth-type\":\"web\"}})}catch{return null}return r}async function Abt(t,e){let r=await nn.request(t,null,{configuration:e,jsonResponse:!0});if(r.statusCode===202){let s=r.headers[\"retry-after\"]??\"1\";return{type:\"waiting\",sleep:parseInt(s,10)}}return r.statusCode===200?{type:\"success\",token:r.body.token}:null}async function pbt({registry:t,configuration:e,report:r}){let s=await fbt(t,e);if(!s)return null;if(Ui.openUrl){r.reportInfo(0,\"Starting the web login process...\"),r.reportSeparator();let{openNow:a}=await(0,GK.prompt)({type:\"confirm\",name:\"openNow\",message:\"Do you want to try to open your browser now?\",required:!0,initial:!0,onCancel:()=>process.exit(130)});r.reportSeparator(),(!a||!await Ui.openUrl(s.loginUrl))&&(r.reportWarning(0,\"We failed to automatically open the url; you'll have to open it yourself in your browser of choice:\"),r.reportWarning(0,he.pretty(e,s.loginUrl,he.Type.URL)),r.reportSeparator())}for(;;){let a=await Abt(s.doneUrl,e);if(a===null)return null;if(a.type===\"waiting\")await new Promise(n=>setTimeout(n,a.sleep*1e3));else return a.token}}var hbt=[\"https://registry.yarnpkg.com\",\"https://registry.npmjs.org\"];async function gbt(t){if(t.webLogin??hbt.includes(t.registry)){let e=await pbt(t);if(e!==null)return e}return await dbt(t)}async function dbt({registry:t,configuration:e,report:r,stdin:s,stdout:a}){let n=await ybt({configuration:e,registry:t,report:r,stdin:s,stdout:a}),c=`/-/user/org.couchdb.user:${encodeURIComponent(n.name)}`,f={_id:`org.couchdb.user:${n.name}`,name:n.name,password:n.password,type:\"user\",roles:[],date:new Date().toISOString()},p={attemptedAs:n.name,configuration:e,registry:t,jsonResponse:!0,authType:en.AuthType.NO_AUTH};try{return(await en.put(c,f,p)).token}catch(P){if(!(P.originalError?.name===\"HTTPError\"&&P.originalError?.response.statusCode===409))throw P}let h={...p,authType:en.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${n.name}:${n.password}`).toString(\"base64\")}`}},E=await en.get(c,h);for(let[P,I]of Object.entries(E))(!f[P]||P===\"roles\")&&(f[P]=I);let C=`${c}/-rev/${f._rev}`;return(await en.put(C,f,h)).token}async function mbt(t,e,{alwaysAuth:r,scope:s}){let a=c=>f=>{let p=je.isIndexableObject(f)?f:{},h=p[c],E=je.isIndexableObject(h)?h:{};return{...p,[c]:{...E,...r!==void 0?{npmAlwaysAuth:r}:{},npmAuthToken:e}}},n=s?{npmScopes:a(s)}:{npmRegistries:a(t)};return await ze.updateHomeConfiguration(n)}async function ybt({configuration:t,registry:e,report:r,stdin:s,stdout:a}){r.reportInfo(0,`Logging in to ${he.pretty(t,e,he.Type.URL)}`);let n=!1;if(e.match(/^https:\\/\\/npm\\.pkg\\.github\\.com(\\/|$)/)&&(r.reportInfo(0,\"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions.\"),n=!0),r.reportSeparator(),t.env.YARN_IS_TEST_ENV)return{name:t.env.YARN_INJECT_NPM_USER||\"\",password:t.env.YARN_INJECT_NPM_PASSWORD||\"\"};let c=await(0,GK.prompt)([{type:\"input\",name:\"name\",message:\"Username:\",required:!0,onCancel:()=>process.exit(130),stdin:s,stdout:a},{type:\"password\",name:\"password\",message:n?\"Token:\":\"Password:\",required:!0,onCancel:()=>process.exit(130),stdin:s,stdout:a}]);return r.reportSeparator(),c}Ge();Ge();Yt();var x1=new Set([\"npmAuthIdent\",\"npmAuthToken\"]),k1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Logout of the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Logout of the publish registry\"});this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Logout of all registries\"})}static{this.paths=[[\"npm\",\"logout\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"logout of the npm registry\",details:\"\\n      This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\\n\\n      Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\\n\\n      Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\\n\\n      Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\\n    \",examples:[[\"Logout of the default registry\",\"yarn npm logout\"],[\"Logout of the @my-scope scope\",\"yarn npm logout --scope my-scope\"],[\"Logout of the publish registry for the current package\",\"yarn npm logout --publish\"],[\"Logout of all registries\",\"yarn npm logout --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=async()=>{let n=await QL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),c=await ze.find(this.context.cwd,this.context.plugins),f=G.makeIdent(this.scope??null,\"pkg\");return!hi.getAuthConfiguration(n,{configuration:c,ident:f}).get(\"npmAuthToken\")};return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{if(this.all&&(await Ibt(),n.reportInfo(0,\"Successfully logged out from everything\")),this.scope){await Jxe(\"npmScopes\",this.scope),await s()?n.reportInfo(0,`Successfully logged out from ${this.scope}`):n.reportWarning(0,\"Scope authentication settings removed, but some other ones settings still apply to it\");return}let c=await QL({configuration:r,cwd:this.context.cwd,publish:this.publish});await Jxe(\"npmRegistries\",c),await s()?n.reportInfo(0,`Successfully logged out from ${c}`):n.reportWarning(0,\"Registry authentication settings removed, but some other ones settings still apply to it\")})).exitCode()}};function Ebt(t,e){let r=t[e];if(!je.isIndexableObject(r))return!1;let s=new Set(Object.keys(r));if([...x1].every(n=>!s.has(n)))return!1;for(let n of x1)s.delete(n);if(s.size===0)return t[e]=void 0,!0;let a={...r};for(let n of x1)delete a[n];return t[e]=a,!0}async function Ibt(){let t=e=>{let r=!1,s=je.isIndexableObject(e)?{...e}:{};s.npmAuthToken&&(delete s.npmAuthToken,r=!0);for(let a of Object.keys(s))Ebt(s,a)&&(r=!0);if(Object.keys(s).length!==0)return r?s:e};return await ze.updateHomeConfiguration({npmRegistries:t,npmScopes:t})}async function Jxe(t,e){return await ze.updateHomeConfiguration({[t]:r=>{let s=je.isIndexableObject(r)?r:{};if(!Object.hasOwn(s,e))return r;let a=s[e],n=je.isIndexableObject(a)?a:{},c=new Set(Object.keys(n));if([...x1].every(p=>!c.has(p)))return r;for(let p of x1)c.delete(p);if(c.size===0)return Object.keys(s).length===1?void 0:{...s,[e]:void 0};let f={};for(let p of x1)f[p]=void 0;return{...s,[e]:{...n,...f}}}})}Ge();Dt();Yt();var Q1=class extends ft{constructor(){super(...arguments);this.access=ge.String(\"--access\",{description:\"The access for the published package (public or restricted)\"});this.tag=ge.String(\"--tag\",\"latest\",{description:\"The tag on the registry that the package should be attached to\"});this.tolerateRepublish=ge.Boolean(\"--tolerate-republish\",!1,{description:\"Warn and exit when republishing an already existing version of a package\"});this.otp=ge.String(\"--otp\",{description:\"The OTP token to use with the command\"});this.provenance=ge.Boolean(\"--provenance\",!1,{description:\"Generate provenance for the package. Only available in GitHub Actions and GitLab CI. Can be set globally through the `npmPublishProvenance` setting or the `YARN_NPM_CONFIG_PROVENANCE` environment variable, or per-package through the `publishConfig.provenance` field in package.json.\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Show what would be published without actually publishing\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Output the result in JSON format\"})}static{this.paths=[[\"npm\",\"publish\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"publish the active workspace to the npm registry\",details:'\\n      This command will pack the active workspace into a fresh archive and upload it to the npm registry.\\n\\n      The package will by default be attached to the `latest` tag on the registry, but this behavior can be overridden by using the `--tag` option.\\n\\n      Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka \"private packages\"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\\n    ',examples:[[\"Publish the active workspace\",\"yarn npm publish\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);if(a.manifest.private)throw new nt(\"Private workspaces cannot be published\");if(a.manifest.name===null||a.manifest.version===null)throw new nt(\"Workspaces must have valid names and versions to be published on an external registry\");await s.restoreInstallState();let n=a.manifest.name,c=a.manifest.version,f=hi.getPublishRegistry(a.manifest,{configuration:r});return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async h=>{if(this.tolerateRepublish)try{let E=await en.get(en.getIdentUrl(n),{configuration:r,registry:f,ident:n,jsonResponse:!0});if(!Object.hasOwn(E,\"versions\"))throw new jt(15,'Registry returned invalid data for - missing \"versions\" field');if(Object.hasOwn(E.versions,c)){let C=`Registry already knows about version ${c}; skipping.`;h.reportWarning(0,C),h.reportJson({name:G.stringifyIdent(n),version:c,registry:f,warning:C,skipped:!0});return}}catch(E){if(E.originalError?.response?.statusCode!==404)throw E}await In.maybeExecuteWorkspaceLifecycleScript(a,\"prepublish\",{report:h}),await yA.prepareForPack(a,{report:h},async()=>{let E=await yA.genPackList(a);for(let W of E)h.reportInfo(null,fe.fromPortablePath(W)),h.reportJson({file:fe.fromPortablePath(W)});let C=await yA.genPackStream(a,E),S=await je.bufferStream(C),P=await v1.getGitHead(a.cwd),I=!1,R=\"\";a.manifest.publishConfig&&\"provenance\"in a.manifest.publishConfig?(I=!!a.manifest.publishConfig.provenance,R=I?\"Generating provenance statement because `publishConfig.provenance` field is set.\":\"Skipping provenance statement because `publishConfig.provenance` field is set to false.\"):this.provenance?(I=!0,R=\"Generating provenance statement because `--provenance` flag is set.\"):r.get(\"npmPublishProvenance\")&&(I=!0,R=\"Generating provenance statement because `npmPublishProvenance` setting is set.\"),R&&(h.reportInfo(null,R),h.reportJson({type:\"provenance\",enabled:I,provenanceMessage:R}));let N=await v1.makePublishBody(a,S,{access:this.access,tag:this.tag,registry:f,gitHead:P,provenance:I});this.dryRun||await en.put(en.getIdentUrl(n),N,{configuration:r,registry:f,ident:n,otp:this.otp,jsonResponse:!0,allowOidc:!!(process.env.CI&&(process.env.GITHUB_ACTIONS||process.env.GITLAB_CI))});let U=this.dryRun?`[DRY RUN] Package would be published to ${f} with tag ${this.tag}`:\"Package archive published\";h.reportInfo(0,U),h.reportJson({name:G.stringifyIdent(n),version:c,registry:f,tag:this.tag||\"latest\",files:E.map(W=>fe.fromPortablePath(W)),access:this.access||null,dryRun:this.dryRun,published:!this.dryRun,message:U,provenance:!!I})})})).exitCode()}};Ge();Yt();var Kxe=ut(Ai());Ge();Dt();Yt();var T1=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.package=ge.String({required:!1})}static{this.paths=[[\"npm\",\"tag\",\"list\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"list all dist-tags of a package\",details:`\n      This command will list all tags of a package from the npm registry.\n\n      If the package is not specified, Yarn will default to the current workspace.\n    `,examples:[[\"List all tags of package `my-pkg`\",\"yarn npm tag list my-pkg\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n;if(typeof this.package<\"u\")n=G.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new nt(`Missing 'name' field in ${fe.fromPortablePath(J.join(a.cwd,Er.manifest))}`);n=a.manifest.name}let c=await Xb(n,r),p={children:je.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:he.tuple(he.Type.RESOLUTION,{descriptor:G.makeDescriptor(n,h),locator:G.makeLocator(n,E)})}))};return xs.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function Xb(t,e){let r=`/-/package${en.getIdentUrl(t)}/dist-tags`;return en.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:en.customPackageError})}var R1=class extends ft{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[[\"npm\",\"tag\",\"add\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"add a tag for a specific version of a package\",details:`\n      This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.\n    `,examples:[[\"Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`\",\"yarn npm tag add my-pkg@2.3.4-beta.4 beta\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=G.parseDescriptor(this.package,!0),c=n.range;if(!Kxe.default.valid(c))throw new nt(`The range ${he.pretty(r,n.range,he.Type.RANGE)} must be a valid semver version`);let f=hi.getPublishRegistry(a.manifest,{configuration:r}),p=he.pretty(r,n,he.Type.IDENT),h=he.pretty(r,c,he.Type.RANGE),E=he.pretty(r,this.tag,he.Type.CODE);return(await Ot.start({configuration:r,stdout:this.context.stdout},async S=>{let P=await Xb(n,r);Object.hasOwn(P,this.tag)&&P[this.tag]===c&&S.reportWarning(0,`Tag ${E} is already set to version ${h}`);let I=`/-/package${en.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await en.put(I,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),S.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ge();Yt();var F1=class extends ft{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[[\"npm\",\"tag\",\"remove\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"remove a tag from a package\",details:`\n      This command will remove a tag from a package from the npm registry.\n    `,examples:[[\"Remove the `beta` tag from package `my-pkg`\",\"yarn npm tag remove my-pkg beta\"]]})}async execute(){if(this.tag===\"latest\")throw new nt(\"The 'latest' tag cannot be removed.\");let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=G.parseIdent(this.package),c=hi.getPublishRegistry(a.manifest,{configuration:r}),f=he.pretty(r,this.tag,he.Type.CODE),p=he.pretty(r,n,he.Type.IDENT),h=await Xb(n,r);if(!Object.hasOwn(h,this.tag))throw new nt(`${f} is not a tag of package ${p}`);return(await Ot.start({configuration:r,stdout:this.context.stdout},async C=>{let S=`/-/package${en.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await en.del(S,{configuration:r,registry:c,ident:n,jsonResponse:!0}),C.reportInfo(0,`Tag ${f} removed from package ${p}`)})).exitCode()}};Ge();Ge();Yt();var N1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Print username for the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Print username for the publish registry\"})}static{this.paths=[[\"npm\",\"whoami\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"display the name of the authenticated user\",details:\"\\n      Print the username associated with the current authentication settings to the standard output.\\n\\n      When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\\n\\n      When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\\n    \",examples:[[\"Print username for the default registry\",\"yarn npm whoami\"],[\"Print username for the registry on a given scope\",\"yarn npm whoami --scope company\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s;return this.scope&&this.publish?s=hi.getScopeRegistry(this.scope,{configuration:r,type:hi.RegistryType.PUBLISH_REGISTRY}):this.scope?s=hi.getScopeRegistry(this.scope,{configuration:r}):this.publish?s=hi.getPublishRegistry((await eC(r,this.context.cwd)).manifest,{configuration:r}):s=hi.getDefaultRegistry({configuration:r}),(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c;try{c=await en.get(\"/-/whoami\",{configuration:r,registry:s,authType:en.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?G.makeIdent(this.scope,\"\"):void 0})}catch(f){if(f.response?.statusCode===401||f.response?.statusCode===403){n.reportError(41,\"Authentication failed - your credentials may have expired\");return}else throw f}n.reportInfo(0,c.username)})).exitCode()}};var Cbt={configuration:{npmPublishAccess:{description:\"Default access of the published packages\",type:\"STRING\",default:null},npmPublishProvenance:{description:\"Whether to generate provenance for the published packages\",type:\"BOOLEAN\",default:!1},npmAuditExcludePackages:{description:\"Array of glob patterns of packages to exclude from npm audit\",type:\"STRING\",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:\"Array of glob patterns of advisory IDs to exclude from npm audit\",type:\"STRING\",default:[],isArray:!0}},commands:[D1,b1,P1,k1,Q1,R1,T1,F1,N1]},wbt=Cbt;var XK={};Vt(XK,{PatchCommand:()=>H1,PatchCommitCommand:()=>_1,PatchFetcher:()=>rP,PatchResolver:()=>nP,default:()=>_bt,patchUtils:()=>gy});Ge();Ge();Dt();eA();var gy={};Vt(gy,{applyPatchFile:()=>RL,diffFolders:()=>KK,ensureUnpatchedDescriptor:()=>WK,ensureUnpatchedLocator:()=>NL,extractPackageToDisk:()=>JK,extractPatchFlags:()=>rke,isParentRequired:()=>VK,isPatchDescriptor:()=>FL,isPatchLocator:()=>Rg,loadPatchFiles:()=>tP,makeDescriptor:()=>OL,makeLocator:()=>YK,makePatchHash:()=>zK,parseDescriptor:()=>$b,parseLocator:()=>eP,parsePatchFile:()=>Zb,unpatchDescriptor:()=>Lbt,unpatchLocator:()=>Mbt});Ge();Dt();Ge();Dt();var Bbt=/^@@ -(\\d+)(,(\\d+))? \\+(\\d+)(,(\\d+))? @@.*/;function O1(t){return J.relative(vt.root,J.resolve(vt.root,fe.toPortablePath(t)))}function vbt(t){let e=t.trim().match(Bbt);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var Sbt=420,Dbt=493;var zxe=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),bbt=t=>({header:vbt(t),parts:[]}),Pbt={\"@\":\"header\",\"-\":\"deletion\",\"+\":\"insertion\",\" \":\"context\",\"\\\\\":\"pragma\",undefined:\"context\"};function xbt(t){let e=[],r=zxe(),s=\"parsing header\",a=null,n=null;function c(){a&&(n&&(a.parts.push(n),n=null),r.hunks.push(a),a=null)}function f(){c(),e.push(r),r=zxe()}for(let p=0;p<t.length;p++){let h=t[p];if(s===\"parsing header\")if(h.startsWith(\"@@\"))s=\"parsing hunks\",r.hunks=[],p-=1;else if(h.startsWith(\"diff --git \")){r&&r.diffLineFromPath&&f();let E=h.match(/^diff --git a\\/(.*?) b\\/(.*?)\\s*$/);if(!E)throw new Error(`Bad diff line: ${h}`);r.diffLineFromPath=E[1],r.diffLineToPath=E[2]}else if(h.startsWith(\"old mode \"))r.oldMode=h.slice(9).trim();else if(h.startsWith(\"new mode \"))r.newMode=h.slice(9).trim();else if(h.startsWith(\"deleted file mode \"))r.deletedFileMode=h.slice(18).trim();else if(h.startsWith(\"new file mode \"))r.newFileMode=h.slice(14).trim();else if(h.startsWith(\"rename from \"))r.renameFrom=h.slice(12).trim();else if(h.startsWith(\"rename to \"))r.renameTo=h.slice(10).trim();else if(h.startsWith(\"index \")){let E=h.match(/(\\w+)\\.\\.(\\w+)/);if(!E)continue;r.beforeHash=E[1],r.afterHash=E[2]}else h.startsWith(\"semver exclusivity \")?r.semverExclusivity=h.slice(19).trim():h.startsWith(\"--- \")?r.fromPath=h.slice(6).trim():h.startsWith(\"+++ \")&&(r.toPath=h.slice(6).trim());else{let E=Pbt[h[0]]||null;switch(E){case\"header\":c(),a=bbt(h);break;case null:s=\"parsing header\",f(),p-=1;break;case\"pragma\":{if(!h.startsWith(\"\\\\ No newline at end of file\"))throw new Error(`Unrecognized pragma in patch file: ${h}`);if(!n)throw new Error(\"Bad parser state: No newline at EOF pragma encountered without context\");n.noNewlineAtEndOfFile=!0}break;case\"context\":case\"deletion\":case\"insertion\":{if(!a)throw new Error(\"Bad parser state: Hunk lines encountered before hunk header\");n&&n.type!==E&&(a.parts.push(n),n=null),n||(n={type:E,lines:[],noNewlineAtEndOfFile:!1}),n.lines.push(h.slice(1))}break;default:je.assertNever(E);break}}}f();for(let{hunks:p}of e)if(p)for(let h of p)Qbt(h);return e}function kbt(t){let e=[];for(let r of t){let{semverExclusivity:s,diffLineFromPath:a,diffLineToPath:n,oldMode:c,newMode:f,deletedFileMode:p,newFileMode:h,renameFrom:E,renameTo:C,beforeHash:S,afterHash:P,fromPath:I,toPath:R,hunks:N}=r,U=E?\"rename\":p?\"file deletion\":h?\"file creation\":N&&N.length>0?\"patch\":\"mode change\",W=null;switch(U){case\"rename\":{if(!E||!C)throw new Error(\"Bad parser state: rename from & to not given\");e.push({type:\"rename\",semverExclusivity:s,fromPath:O1(E),toPath:O1(C)}),W=C}break;case\"file deletion\":{let ee=a||I;if(!ee)throw new Error(\"Bad parse state: no path given for file deletion\");e.push({type:\"file deletion\",semverExclusivity:s,hunk:N&&N[0]||null,path:O1(ee),mode:TL(p),hash:S})}break;case\"file creation\":{let ee=n||R;if(!ee)throw new Error(\"Bad parse state: no path given for file creation\");e.push({type:\"file creation\",semverExclusivity:s,hunk:N&&N[0]||null,path:O1(ee),mode:TL(h),hash:P})}break;case\"patch\":case\"mode change\":W=R||n;break;default:je.assertNever(U);break}W&&c&&f&&c!==f&&e.push({type:\"mode change\",semverExclusivity:s,path:O1(W),oldMode:TL(c),newMode:TL(f)}),W&&N&&N.length&&e.push({type:\"patch\",semverExclusivity:s,path:O1(W),hunks:N,beforeHash:S,afterHash:P})}if(e.length===0)throw new Error(\"Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string\");return e}function TL(t){let e=parseInt(t,8)&511;if(e!==Sbt&&e!==Dbt)throw new Error(`Unexpected file mode string: ${t}`);return e}function Zb(t){let e=t.split(/\\n/g);return e[e.length-1]===\"\"&&e.pop(),kbt(xbt(e))}function Qbt(t){let e=0,r=0;for(let{type:s,lines:a}of t.parts)switch(s){case\"context\":r+=a.length,e+=a.length;break;case\"deletion\":e+=a.length;break;case\"insertion\":r+=a.length;break;default:je.assertNever(s);break}if(e!==t.header.original.length||r!==t.header.patched.length){let s=a=>a<0?a:`+${a}`;throw new Error(`hunk header integrity check failed (expected @@ ${s(t.header.original.length)} ${s(t.header.patched.length)} @@, got @@ ${s(e)} ${s(r)} @@)`)}}Ge();Dt();var L1=class extends Error{constructor(r,s){super(`Cannot apply hunk #${r+1}`);this.hunk=s}};async function M1(t,e,r){let s=await t.lstatPromise(e),a=await r();typeof a<\"u\"&&(e=a),await t.lutimesPromise(e,s.atime,s.mtime)}async function RL(t,{baseFs:e=new Yn,dryRun:r=!1,version:s=null}={}){for(let a of t)if(!(a.semverExclusivity!==null&&s!==null&&!Fr.satisfiesWithPrereleases(s,a.semverExclusivity)))switch(a.type){case\"file deletion\":if(r){if(!e.existsSync(a.path))throw new Error(`Trying to delete a file that doesn't exist: ${a.path}`)}else await M1(e,J.dirname(a.path),async()=>{await e.unlinkPromise(a.path)});break;case\"rename\":if(r){if(!e.existsSync(a.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${a.fromPath}`)}else await M1(e,J.dirname(a.fromPath),async()=>{await M1(e,J.dirname(a.toPath),async()=>{await M1(e,a.fromPath,async()=>(await e.movePromise(a.fromPath,a.toPath),a.toPath))})});break;case\"file creation\":if(r){if(e.existsSync(a.path))throw new Error(`Trying to create a file that already exists: ${a.path}`)}else{let n=a.hunk?a.hunk.parts[0].lines.join(`\n`)+(a.hunk.parts[0].noNewlineAtEndOfFile?\"\":`\n`):\"\";await e.mkdirpPromise(J.dirname(a.path),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,fi.SAFE_TIME,fi.SAFE_TIME)}break;case\"patch\":await M1(e,a.path,async()=>{await Fbt(a,{baseFs:e,dryRun:r})});break;case\"mode change\":{let c=(await e.statPromise(a.path)).mode;if(Xxe(a.newMode)!==Xxe(c))continue;await M1(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:je.assertNever(a);break}}function Xxe(t){return(t&64)>0}function Zxe(t){return t.replace(/\\s+$/,\"\")}function Rbt(t,e){return Zxe(t)===Zxe(e)}async function Fbt({hunks:t,path:e},{baseFs:r,dryRun:s=!1}){let a=await r.statSync(e).mode,c=(await r.readFileSync(e,\"utf8\")).split(/\\n/),f=[],p=0,h=0;for(let C of t){let S=Math.max(h,C.header.patched.start+p),P=Math.max(0,S-h),I=Math.max(0,c.length-S-C.header.original.length),R=Math.max(P,I),N=0,U=0,W=null;for(;N<=R;){if(N<=P&&(U=S-N,W=$xe(C,c,U),W!==null)){N=-N;break}if(N<=I&&(U=S+N,W=$xe(C,c,U),W!==null))break;N+=1}if(W===null)throw new L1(t.indexOf(C),C);f.push(W),p+=N,h=U+C.header.original.length}if(s)return;let E=0;for(let C of f)for(let S of C)switch(S.type){case\"splice\":{let P=S.index+E;c.splice(P,S.numToDelete,...S.linesToInsert),E+=S.linesToInsert.length-S.numToDelete}break;case\"pop\":c.pop();break;case\"push\":c.push(S.line);break;default:je.assertNever(S);break}await r.writeFilePromise(e,c.join(`\n`),{mode:a})}function $xe(t,e,r){let s=[];for(let a of t.parts)switch(a.type){case\"context\":case\"deletion\":{for(let n of a.lines){let c=e[r];if(c==null||!Rbt(c,n))return null;r+=1}a.type===\"deletion\"&&(s.push({type:\"splice\",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&s.push({type:\"push\",line:\"\"}))}break;case\"insertion\":s.push({type:\"splice\",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&s.push({type:\"pop\"});break;default:je.assertNever(a.type);break}return s}var Obt=/^builtin<([^>]+)>$/;function U1(t,e){let{protocol:r,source:s,selector:a,params:n}=G.parseRange(t);if(r!==\"patch:\")throw new Error(\"Invalid patch range\");if(s===null)throw new Error(\"Patch locators must explicitly define their source\");let c=a?a.split(/&/).map(E=>fe.toPortablePath(E)):[],f=n&&typeof n.locator==\"string\"?G.parseLocator(n.locator):null,p=n&&typeof n.version==\"string\"?n.version:null,h=e(s);return{parentLocator:f,sourceItem:h,patchPaths:c,sourceVersion:p}}function FL(t){return t.range.startsWith(\"patch:\")}function Rg(t){return t.reference.startsWith(\"patch:\")}function $b(t){let{sourceItem:e,...r}=U1(t.range,G.parseDescriptor);return{...r,sourceDescriptor:e}}function eP(t){let{sourceItem:e,...r}=U1(t.reference,G.parseLocator);return{...r,sourceLocator:e}}function Lbt(t){let{sourceItem:e}=U1(t.range,G.parseDescriptor);return e}function Mbt(t){let{sourceItem:e}=U1(t.reference,G.parseLocator);return e}function WK(t){if(!FL(t))return t;let{sourceItem:e}=U1(t.range,G.parseDescriptor);return e}function NL(t){if(!Rg(t))return t;let{sourceItem:e}=U1(t.reference,G.parseLocator);return e}function eke({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=t!==null?{locator:G.stringifyLocator(t)}:{},f=typeof s<\"u\"?{version:s}:{},p=typeof a<\"u\"?{hash:a}:{};return G.makeRange({protocol:\"patch:\",source:n(e),selector:r.join(\"&\"),params:{...f,...p,...c}})}function OL(t,{parentLocator:e,sourceDescriptor:r,patchPaths:s}){return G.makeDescriptor(t,eke({parentLocator:e,sourceItem:r,patchPaths:s},G.stringifyDescriptor))}function YK(t,{parentLocator:e,sourcePackage:r,patchPaths:s,patchHash:a}){return G.makeLocator(t,eke({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},G.stringifyLocator))}function tke({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf(\"!\");n!==-1&&(a=a.slice(n+1));let c=a.match(Obt);return c!==null?s(c[1]):a.startsWith(\"~/\")?r(a.slice(2)):J.isAbsolute(a)?t(a):e(a)}function rke(t){let e=t.lastIndexOf(\"!\");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has(\"optional\")}}function VK(t){return tke({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function tP(t,e,r){let s=t!==null?await r.fetcher.fetch(t,r):null,a=s&&s.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,s.localPath)}:s;s&&s!==a&&s.releaseFs&&s.releaseFs();let n=await je.releaseAfterUseAsync(async()=>await Promise.all(e.map(async c=>{let f=rke(c),p=await tke({onAbsolute:async h=>await ce.readFilePromise(h,\"utf8\"),onRelative:async h=>{if(a===null)throw new Error(\"Assertion failed: The parent locator should have been fetched\");return await a.packageFs.readFilePromise(J.join(a.prefixPath,h),\"utf8\")},onProject:async h=>await ce.readFilePromise(J.join(r.project.cwd,h),\"utf8\"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},c);return{...f,source:p}})));for(let c of n)typeof c.source==\"string\"&&(c.source=c.source.replace(/\\r\\n?/g,`\n`));return n}async function JK(t,{cache:e,project:r}){let s=r.storedPackages.get(t.locatorHash);if(typeof s>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");let a=NL(t),n=r.storedChecksums,c=new ki,f=await ce.mktempPromise(),p=J.join(f,\"source\"),h=J.join(f,\"user\"),E=J.join(f,\".yarn-patch.json\"),C=r.configuration.makeFetcher(),S=[];try{let P,I;if(t.locatorHash===a.locatorHash){let R=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c});S.push(()=>R.releaseFs?.()),P=R,I=R}else P=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>P.releaseFs?.()),I=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>I.releaseFs?.());await Promise.all([ce.copyPromise(p,P.prefixPath,{baseFs:P.packageFs}),ce.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),ce.writeJsonPromise(E,{locator:G.stringifyLocator(t),version:s.version})])}finally{for(let P of S)P()}return ce.detachTemp(f),h}async function KK(t,e){let r=fe.fromPortablePath(t).replace(/\\\\/g,\"/\"),s=fe.fromPortablePath(e).replace(/\\\\/g,\"/\"),{stdout:a,stderr:n}=await qr.execvp(\"git\",[\"-c\",\"core.safecrlf=false\",\"diff\",\"--src-prefix=a/\",\"--dst-prefix=b/\",\"--ignore-cr-at-eol\",\"--full-index\",\"--no-index\",\"--no-renames\",\"--text\",r,s],{cwd:fe.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:\"1\",HOME:\"\",XDG_CONFIG_HOME:\"\",USERPROFILE:\"\"}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.\nThe following error was reported by 'git':\n${n}`);let c=r.startsWith(\"/\")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${je.escapeRegExp(`/${c(r)}/`)})`,\"g\"),\"$1/\").replace(new RegExp(`(a|b)${je.escapeRegExp(`/${c(s)}/`)}`,\"g\"),\"$1/\").replace(new RegExp(je.escapeRegExp(`${r}/`),\"g\"),\"\").replace(new RegExp(je.escapeRegExp(`${s}/`),\"g\"),\"\")}function zK(t,e){let r=[];for(let{source:s}of t){if(s===null)continue;let a=Zb(s);for(let n of a){let{semverExclusivity:c,...f}=n;c!==null&&e!==null&&!Fr.satisfiesWithPrereleases(e,c)||r.push(JSON.stringify(f))}}return Nn.makeHash(`${3}`,...r).slice(0,6)}Ge();function nke(t,{configuration:e,report:r}){for(let s of t.parts)for(let a of s.lines)switch(s.type){case\"context\":r.reportInfo(null,`  ${he.pretty(e,a,\"grey\")}`);break;case\"deletion\":r.reportError(28,`- ${he.pretty(e,a,he.Type.REMOVED)}`);break;case\"insertion\":r.reportError(28,`+ ${he.pretty(e,a,he.Type.ADDED)}`);break;default:je.assertNever(s.type)}}var rP=class{supports(e,r){return!!Rg(e)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async patchPackage(e,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=eP(e),f=await tP(s,c,r),p=await ce.mktempPromise(),h=J.join(p,\"current.zip\"),E=await r.fetcher.fetch(a,r),C=G.getIdentVendorPath(e),S=new As(h,{create:!0,level:r.project.configuration.get(\"compressionLevel\")});await je.releaseAfterUseAsync(async()=>{await S.copyPromise(C,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),S.saveAndClose();for(let{source:P,optional:I}of f){if(P===null)continue;let R=new As(h,{level:r.project.configuration.get(\"compressionLevel\")}),N=new Sn(J.resolve(vt.root,C),{baseFs:R});try{await RL(Zb(P),{baseFs:N,version:n})}catch(U){if(!(U instanceof L1))throw U;let W=r.project.configuration.get(\"enableInlineHunks\"),ee=!W&&!I?\" (set enableInlineHunks for details)\":\"\",ie=`${G.prettyLocator(r.project.configuration,e)}: ${U.message}${ee}`,ue=le=>{W&&nke(U.hunk,{configuration:r.project.configuration,report:le})};if(R.discardAndClose(),I){r.report.reportWarningOnce(66,ie,{reportExtra:ue});continue}else throw new jt(66,ie,ue)}R.saveAndClose()}return new As(h,{level:r.project.configuration.get(\"compressionLevel\")})}};Ge();var nP=class{supportsDescriptor(e,r){return!!FL(e)}supportsLocator(e,r){return!!Rg(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){let{patchPaths:a}=$b(e);return a.every(n=>!VK(n))?e:G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:s}=$b(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(s)}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{parentLocator:a,patchPaths:n}=$b(e),c=await tP(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>\"u\")throw new Error(\"Assertion failed: The dependency should have been resolved\");let p=zK(c,f.version);return[YK(e,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:p})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:s}=eP(e);return{...await r.resolver.resolve(s,r),...e}}};Ge();Dt();Yt();var _1=class extends ft{constructor(){super(...arguments);this.save=ge.Boolean(\"-s,--save\",!1,{description:\"Add the patch to your resolution entries\"});this.patchFolder=ge.String()}static{this.paths=[[\"patch-commit\"]]}static{this.usage=ot.Usage({description:\"generate a patch out of a directory\",details:\"\\n      By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\\n\\n      With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\\n\\n      Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=J.resolve(this.context.cwd,fe.toPortablePath(this.patchFolder)),c=J.join(n,\"../source\"),f=J.join(n,\"../.yarn-patch.json\");if(!ce.existsSync(c))throw new nt(\"The argument folder didn't get created by 'yarn patch'\");let p=await KK(c,n),h=await ce.readJsonPromise(f),E=G.parseLocator(h.locator,!0);if(!s.storedPackages.has(E.locatorHash))throw new nt(\"No package found in the project for the given locator\");if(!this.save){this.context.stdout.write(p);return}let C=r.get(\"patchFolder\"),S=J.join(C,`${G.slugifyLocator(E)}.patch`);await ce.mkdirPromise(C,{recursive:!0}),await ce.writeFilePromise(S,p);let P=[],I=new Map;for(let R of s.storedPackages.values()){if(G.isVirtualLocator(R))continue;let N=R.dependencies.get(E.identHash);if(!N)continue;let U=G.ensureDevirtualizedDescriptor(N),W=WK(U),ee=s.storedResolutions.get(W.descriptorHash);if(!ee)throw new Error(\"Assertion failed: Expected the resolution to have been registered\");if(!s.storedPackages.get(ee))throw new Error(\"Assertion failed: Expected the package to have been registered\");let ue=s.tryWorkspaceByLocator(R);if(ue)P.push(ue);else{let le=s.originalPackages.get(R.locatorHash);if(!le)throw new Error(\"Assertion failed: Expected the original package to have been registered\");let me=le.dependencies.get(N.identHash);if(!me)throw new Error(\"Assertion failed: Expected the original dependency to have been registered\");I.set(me.descriptorHash,me)}}for(let R of P)for(let N of Ut.hardDependencies){let U=R.manifest[N].get(E.identHash);if(!U)continue;let W=OL(U,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[J.join(Er.home,J.relative(s.cwd,S))]});R.manifest[N].set(U.identHash,W)}for(let R of I.values()){let N=OL(R,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[J.join(Er.home,J.relative(s.cwd,S))]});s.topLevelWorkspace.manifest.resolutions.push({pattern:{descriptor:{fullName:G.stringifyIdent(N),description:R.range}},reference:N.range})}await s.persist()}};Ge();Dt();Yt();var H1=class extends ft{constructor(){super(...arguments);this.update=ge.Boolean(\"-u,--update\",!1,{description:\"Reapply local patches that already apply to this packages\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.package=ge.String()}static{this.paths=[[\"patch\"]]}static{this.usage=ot.Usage({description:\"prepare a package for patching\",details:\"\\n      This command will cause a package to be extracted in a temporary directory intended to be editable at will.\\n\\n      Once you're done with your changes, run `yarn patch-commit -s path` (with `path` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\\n\\n      Calling the command when you already have a patch won't import it by default (in other words, the default behavior is to reset existing patches). However, adding the `-u,--update` flag will import any current patch.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=G.parseLocator(this.package);if(c.reference===\"unknown\"){let f=je.mapAndFilter([...s.storedPackages.values()],p=>p.identHash!==c.identHash?je.mapAndFilter.skip:G.isVirtualLocator(p)?je.mapAndFilter.skip:Rg(p)!==this.update?je.mapAndFilter.skip:p);if(f.length===0)throw new nt(\"No package found in the project for the given locator\");if(f.length>1)throw new nt(`Multiple candidate packages found; explicitly choose one of them (use \\`yarn why <package>\\` to get more information as to who depends on them):\n${f.map(p=>`\n- ${G.prettyLocator(r,p)}`).join(\"\")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new nt(\"No package found in the project for the given locator\");await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=NL(c),h=await JK(c,{cache:n,project:s});f.reportJson({locator:G.stringifyLocator(p),path:fe.fromPortablePath(h)});let E=this.update?\" along with its current modifications\":\"\";f.reportInfo(0,`Package ${G.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${he.pretty(r,fe.fromPortablePath(h),\"magenta\")}`),f.reportInfo(0,`Once you are done run ${he.pretty(r,`yarn patch-commit -s ${process.platform===\"win32\"?'\"':\"\"}${fe.fromPortablePath(h)}${process.platform===\"win32\"?'\"':\"\"}`,\"cyan\")} and Yarn will store a patchfile based on your changes.`)})}};var Ubt={configuration:{enableInlineHunks:{description:\"If true, the installs will print unmatched patch hunks\",type:\"BOOLEAN\",default:!1},patchFolder:{description:\"Folder where the patch files must be written\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/patches\"}},commands:[_1,H1],fetchers:[rP],resolvers:[nP]},_bt=Ubt;var ez={};Vt(ez,{PnpmLinker:()=>iP,default:()=>Ybt});Ge();Dt();Yt();var iP=class{getCustomDataKey(){return JSON.stringify({name:\"PnpmLinker\",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the pnpm linker to be enabled\");let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>\"u\")throw new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\\/node_modules\\/(@[^/]*\\/)?[^/]+)(\\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let c=e,f=e;do{f=c,c=J.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(e){return new ZK(e)}isEnabled(e){return e.project.configuration.get(\"nodeLinker\")===\"pnpm\"}},ZK=class{constructor(e){this.opts=e;this.asyncActions=new je.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=$P(ce,{indexPath:J.join(e.project.configuration.get(\"globalFolder\"),\"index\")})}attachCustomData(e){}async installPackage(e,r,s){switch(e.linkType){case\"SOFT\":return this.installPackageSoft(e,r,s);case\"HARD\":return this.installPackageHard(e,r,s)}throw new Error(\"Assertion failed: Unsupported package link type\")}async installPackageSoft(e,r,s){let a=J.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?J.join(a,Er.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(e,r,s){let a=jbt(e,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,G.stringifyLocator(e)),this.customData.pathsByLocator.set(e.locatorHash,a),s.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await ce.mkdirPromise(n,{recursive:!0}),await ce.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:\"HardlinkFromIndex\",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e,p={manifest:await Ut.tryFind(r.prefixPath,{baseFs:r.packageFs})??new Ut,misc:{hasBindingGyp:gA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(f,e.version),E=gA.extractBuildRequest(e,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(e,r){if(this.opts.project.configuration.get(\"nodeLinker\")!==\"pnpm\"||!ike(e,{project:this.opts.project}))return;let s=this.customData.pathsByLocator.get(e.locatorHash);if(typeof s>\"u\")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(e)})`);let{dependenciesLocation:a}=s;a&&this.asyncActions.reduce(e.locatorHash,async n=>{await ce.mkdirPromise(a,{recursive:!0});let c=await Gbt(a),f=new Map(c),p=[n],h=(C,S)=>{let P=S;ike(S,{project:this.opts.project})||(this.opts.report.reportWarningOnce(0,\"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies\"),P=G.devirtualizeLocator(S));let I=this.customData.pathsByLocator.get(P.locatorHash);if(typeof I>\"u\")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(S)})`);let R=G.stringifyIdent(C),N=J.join(a,R),U=J.relative(J.dirname(N),I.packageLocation),W=f.get(R);f.delete(R),p.push(Promise.resolve().then(async()=>{if(W){if(W.isSymbolicLink()&&await ce.readlinkPromise(N)===U)return;await ce.removePromise(N)}await ce.mkdirpPromise(J.dirname(N)),process.platform==\"win32\"&&this.opts.project.configuration.get(\"winLinkType\")===\"junctions\"?await ce.symlinkPromise(I.packageLocation,N,\"junction\"):await ce.symlinkPromise(U,N)}))},E=!1;for(let[C,S]of r)C.identHash===e.identHash&&(E=!0),h(C,S);!E&&!this.opts.project.tryWorkspaceByLocator(e)&&h(G.convertLocatorToDescriptor(e),e),p.push(qbt(a,f)),await Promise.all(p)})}async attachExternalDependents(e,r){throw new Error(\"External dependencies haven't been implemented for the pnpm linker\")}async finalizeInstall(){let e=ske(this.opts.project);if(this.opts.project.configuration.get(\"nodeLinker\")!==\"pnpm\")await ce.removePromise(e);else{let r;try{r=new Set(await ce.readdirPromise(e))}catch{r=new Set}for(let{dependenciesLocation:s}of this.customData.pathsByLocator.values()){if(!s)continue;let a=J.contains(e,s);if(a===null)continue;let[n]=a.split(J.sep);r.delete(n)}await Promise.all([...r].map(async s=>{await ce.removePromise(J.join(e,s))}))}return await this.asyncActions.wait(),await $K(e),this.opts.project.configuration.get(\"nodeLinker\")!==\"node-modules\"&&await $K(Hbt(this.opts.project)),{customData:this.customData}}};function Hbt(t){return J.join(t.cwd,Er.nodeModules)}function ske(t){return t.configuration.get(\"pnpmStoreFolder\")}function jbt(t,{project:e}){let r=G.slugifyLocator(t),s=ske(e),a=J.join(s,r,\"package\"),n=J.join(s,r,Er.nodeModules);return{packageLocation:a,dependenciesLocation:n}}function ike(t,{project:e}){return!G.isVirtualLocator(t)||!e.tryWorkspaceByLocator(t)}async function Gbt(t){let e=new Map,r=[];try{r=await ce.readdirPromise(t,{withFileTypes:!0})}catch(s){if(s.code!==\"ENOENT\")throw s}try{for(let s of r)if(!s.name.startsWith(\".\"))if(s.name.startsWith(\"@\")){let a=await ce.readdirPromise(J.join(t,s.name),{withFileTypes:!0});if(a.length===0)e.set(s.name,s);else for(let n of a)e.set(`${s.name}/${n.name}`,n)}else e.set(s.name,s)}catch(s){if(s.code!==\"ENOENT\")throw s}return e}async function qbt(t,e){let r=[],s=new Set;for(let a of e.keys()){r.push(ce.removePromise(J.join(t,a)));let n=G.tryParseIdent(a)?.scope;n&&s.add(`@${n}`)}return Promise.all(r).then(()=>Promise.all([...s].map(a=>$K(J.join(t,a)))))}async function $K(t){try{await ce.rmdirPromise(t)}catch(e){if(e.code!==\"ENOENT\"&&e.code!==\"ENOTEMPTY\"&&e.code!==\"EBUSY\")throw e}}var Wbt={configuration:{pnpmStoreFolder:{description:\"By default, the store is stored in the 'node_modules/.store' of the project. Sometimes in CI scenario's it is convenient to store this in a different location so it can be cached and reused.\",type:\"ABSOLUTE_PATH\",default:\"./node_modules/.store\"}},linkers:[iP]},Ybt=Wbt;var az={};Vt(az,{StageCommand:()=>j1,default:()=>nPt,stageUtils:()=>ML});Ge();Dt();Yt();Ge();Dt();var ML={};Vt(ML,{ActionType:()=>tz,checkConsensus:()=>LL,expandDirectory:()=>iz,findConsensus:()=>sz,findVcsRoot:()=>rz,genCommitMessage:()=>oz,getCommitPrefix:()=>oke,isYarnFile:()=>nz});Dt();var tz=(n=>(n[n.CREATE=0]=\"CREATE\",n[n.DELETE=1]=\"DELETE\",n[n.ADD=2]=\"ADD\",n[n.REMOVE=3]=\"REMOVE\",n[n.MODIFY=4]=\"MODIFY\",n))(tz||{});async function rz(t,{marker:e}){do if(!ce.existsSync(J.join(t,e)))t=J.dirname(t);else return t;while(t!==\"/\");return null}function nz(t,{roots:e,names:r}){if(r.has(J.basename(t)))return!0;do if(!e.has(t))t=J.dirname(t);else return!0;while(t!==\"/\");return!1}function iz(t){let e=[],r=[t];for(;r.length>0;){let s=r.pop(),a=ce.readdirSync(s);for(let n of a){let c=J.resolve(s,n);ce.lstatSync(c).isDirectory()?r.push(c):e.push(c)}}return e}function LL(t,e){let r=0,s=0;for(let a of t)a!==\"wip\"&&(e.test(a)?r+=1:s+=1);return r>=s}function sz(t){let e=LL(t,/^(\\w\\(\\w+\\):\\s*)?\\w+s/),r=LL(t,/^(\\w\\(\\w+\\):\\s*)?[A-Z]/),s=LL(t,/^\\w\\(\\w+\\):/);return{useThirdPerson:e,useUpperCase:r,useComponent:s}}function oke(t){return t.useComponent?\"chore(yarn): \":\"\"}var Vbt=new Map([[0,\"create\"],[1,\"delete\"],[2,\"add\"],[3,\"remove\"],[4,\"update\"]]);function oz(t,e){let r=oke(t),s=[],a=e.slice().sort((n,c)=>n[0]-c[0]);for(;a.length>0;){let[n,c]=a.shift(),f=Vbt.get(n);t.useUpperCase&&s.length===0&&(f=`${f[0].toUpperCase()}${f.slice(1)}`),t.useThirdPerson&&(f+=\"s\");let p=[c];for(;a.length>0&&a[0][0]===n;){let[,E]=a.shift();p.push(E)}p.sort();let h=p.shift();p.length===1?h+=\" (and one other)\":p.length>1&&(h+=` (and ${p.length} others)`),s.push(`${f} ${h}`)}return`${r}${s.join(\", \")}`}var Jbt=\"Commit generated via `yarn stage`\",Kbt=11;async function ake(t){let{code:e,stdout:r}=await qr.execvp(\"git\",[\"log\",\"-1\",\"--pretty=format:%H\"],{cwd:t});return e===0?r.trim():null}async function zbt(t,e){let r=[],s=e.filter(h=>J.basename(h.path)===\"package.json\");for(let{action:h,path:E}of s){let C=J.relative(t,E);if(h===4){let S=await ake(t),{stdout:P}=await qr.execvp(\"git\",[\"show\",`${S}:${C}`],{cwd:t,strict:!0}),I=await Ut.fromText(P),R=await Ut.fromFile(E),N=new Map([...R.dependencies,...R.devDependencies]),U=new Map([...I.dependencies,...I.devDependencies]);for(let[W,ee]of U){let ie=G.stringifyIdent(ee),ue=N.get(W);ue?ue.range!==ee.range&&r.push([4,`${ie} to ${ue.range}`]):r.push([3,ie])}for(let[W,ee]of N)U.has(W)||r.push([2,G.stringifyIdent(ee)])}else if(h===0){let S=await Ut.fromFile(E);S.name?r.push([0,G.stringifyIdent(S.name)]):r.push([0,\"a package\"])}else if(h===1){let S=await ake(t),{stdout:P}=await qr.execvp(\"git\",[\"show\",`${S}:${C}`],{cwd:t,strict:!0}),I=await Ut.fromText(P);I.name?r.push([1,G.stringifyIdent(I.name)]):r.push([1,\"a package\"])}else throw new Error(\"Assertion failed: Unsupported action type\")}let{code:a,stdout:n}=await qr.execvp(\"git\",[\"log\",`-${Kbt}`,\"--pretty=format:%s\"],{cwd:t}),c=a===0?n.split(/\\n/g).filter(h=>h!==\"\"):[],f=sz(c);return oz(f,r)}var Xbt={0:[\" A \",\"?? \"],4:[\" M \"],1:[\" D \"]},Zbt={0:[\"A  \"],4:[\"M  \"],1:[\"D  \"]},lke={async findRoot(t){return await rz(t,{marker:\".git\"})},async filterChanges(t,e,r,s){let{stdout:a}=await qr.execvp(\"git\",[\"status\",\"-s\"],{cwd:t,strict:!0}),n=a.toString().split(/\\n/g),c=s?.staged?Zbt:Xbt;return[].concat(...n.map(p=>{if(p===\"\")return[];let h=p.slice(0,3),E=J.resolve(t,p.slice(3));if(!s?.staged&&h===\"?? \"&&p.endsWith(\"/\"))return iz(E).map(C=>({action:0,path:C}));{let S=[0,4,1].find(P=>c[P].includes(h));return S!==void 0?[{action:S,path:E}]:[]}})).filter(p=>nz(p.path,{roots:e,names:r}))},async genCommitMessage(t,e){return await zbt(t,e)},async makeStage(t,e){let r=e.map(s=>fe.fromPortablePath(s.path));await qr.execvp(\"git\",[\"add\",\"--\",...r],{cwd:t,strict:!0})},async makeCommit(t,e,r){let s=e.map(a=>fe.fromPortablePath(a.path));await qr.execvp(\"git\",[\"add\",\"-N\",\"--\",...s],{cwd:t,strict:!0}),await qr.execvp(\"git\",[\"commit\",\"-m\",`${r}\n\n${Jbt}\n`,\"--\",...s],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(s=>fe.fromPortablePath(s.path));await qr.execvp(\"git\",[\"reset\",\"HEAD\",\"--\",...r],{cwd:t,strict:!0})}};var $bt=[lke],j1=class extends ft{constructor(){super(...arguments);this.commit=ge.Boolean(\"-c,--commit\",!1,{description:\"Commit the staged files\"});this.reset=ge.Boolean(\"-r,--reset\",!1,{description:\"Remove all files from the staging area\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Print the commit message and the list of modified files without staging / committing\"});this.update=ge.Boolean(\"-u,--update\",!1,{hidden:!0})}static{this.paths=[[\"stage\"]]}static{this.usage=ot.Usage({description:\"add all yarn files to your vcs\",details:\"\\n      This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\\n\\n      Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\\n\\n      Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\\n    \",examples:[[\"Adds all modified project files to the staging area\",\"yarn stage\"],[\"Creates a new commit containing all modified project files\",\"yarn stage --commit\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),{driver:a,root:n}=await ePt(s.cwd),c=[r.get(\"cacheFolder\"),r.get(\"globalFolder\"),r.get(\"virtualFolder\"),r.get(\"yarnPath\")];await r.triggerHook(C=>C.populateYarnPaths,s,C=>{c.push(C)});let f=new Set;for(let C of c)for(let S of tPt(n,C))f.add(S);let p=new Set([r.get(\"rcFilename\"),Er.lockfile,Er.manifest]),h=await a.filterChanges(n,f,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}\n`);else for(let C of h)this.context.stdout.write(`${fe.fromPortablePath(C.path)}\n`);else if(this.reset){let C=await a.filterChanges(n,f,p,{staged:!0});C.length===0?this.context.stdout.write(\"No staged changes found!\"):await a.makeReset(n,C)}else h.length===0?this.context.stdout.write(\"No changes found!\"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function ePt(t){let e=null,r=null;for(let s of $bt)if((r=await s.findRoot(t))!==null){e=s;break}if(e===null||r===null)throw new nt(\"No stage driver has been found for your current project\");return{driver:e,root:r}}function tPt(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let s;try{s=ce.statSync(e)}catch{break}if(s.isSymbolicLink())e=J.resolve(J.dirname(e),ce.readlinkSync(e));else break}return r}var rPt={commands:[j1]},nPt=rPt;var lz={};Vt(lz,{default:()=>fPt});Ge();Ge();Dt();var fke=ut(Ai());Ge();var cke=ut(g9()),iPt=\"e8e1bd300d860104bb8c58453ffa1eb4\",sPt=\"OFCNCOG2CU\",uke=async(t,e)=>{let r=G.stringifyIdent(t),a=oPt(e).initIndex(\"npm-search\");try{return(await a.getObject(r,{attributesToRetrieve:[\"types\"]})).types?.ts===\"definitely-typed\"}catch{return!1}},oPt=t=>(0,cke.default)(sPt,iPt,{requester:{async send(r){try{let s=await nn.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:s.body,isTimedOut:!1,status:s.statusCode}}catch(s){return{content:s.response.body,isTimedOut:!1,status:s.response.statusCode}}}}});var Ake=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,aPt=async(t,e,r,s)=>{if(r.scope===\"types\")return;let{project:a}=t,{configuration:n}=a;if(!(n.get(\"tsEnableAutoTypes\")??(ce.existsSync(J.join(t.cwd,\"tsconfig.json\"))||ce.existsSync(J.join(a.cwd,\"tsconfig.json\")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new ki};if(!await uke(r,n))return;let E=Ake(r),C=G.parseRange(r.range).selector;if(!Fr.validRange(C)){let N=n.normalizeDependency(r),U=await f.getCandidates(N,{},p);C=G.parseRange(U[0].reference).selector}let S=fke.default.coerce(C);if(S===null)return;let P=`${Xu.Modifier.CARET}${S.major}`,I=G.makeDescriptor(G.makeIdent(\"types\",E),P),R=je.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,W=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&W!==r.descriptorHash)return je.mapAndFind.skip;let ee=[];for(let ie of Ut.allDependencies){let ue=N.manifest[ie].get(I.identHash);typeof ue>\"u\"||ee.push([ie,ue])}return ee.length===0?je.mapAndFind.skip:ee});if(typeof R<\"u\")for(let[N,U]of R)t.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(I);if((await f.getCandidates(N,{},p)).length===0)return}catch{return}t.manifest[Xu.Target.DEVELOPMENT].set(I.identHash,I)}},lPt=async(t,e,r)=>{if(r.scope===\"types\")return;let{project:s}=t,{configuration:a}=s;if(!(a.get(\"tsEnableAutoTypes\")??(ce.existsSync(J.join(t.cwd,\"tsconfig.json\"))||ce.existsSync(J.join(s.cwd,\"tsconfig.json\")))))return;let c=Ake(r),f=G.makeIdent(\"types\",c);for(let p of Ut.allDependencies)typeof t.manifest[p].get(f.identHash)>\"u\"||t.manifest[p].delete(f.identHash)},cPt=(t,e)=>{e.publishConfig&&e.publishConfig.typings&&(e.typings=e.publishConfig.typings),e.publishConfig&&e.publishConfig.types&&(e.types=e.publishConfig.types)},uPt={configuration:{tsEnableAutoTypes:{description:\"Whether Yarn should auto-install @types/ dependencies on 'yarn add'\",type:\"BOOLEAN\",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:aPt,afterWorkspaceDependencyRemoval:lPt,beforeWorkspacePacking:cPt}},fPt=uPt;var pz={};Vt(pz,{VersionApplyCommand:()=>Y1,VersionCheckCommand:()=>V1,VersionCommand:()=>J1,default:()=>dPt,versionUtils:()=>W1});Ge();Ge();Yt();var W1={};Vt(W1,{Decision:()=>G1,applyPrerelease:()=>pke,applyReleases:()=>Az,applyStrategy:()=>sP,clearVersionFiles:()=>cz,getUndecidedDependentWorkspaces:()=>aP,getUndecidedWorkspaces:()=>UL,openVersionFile:()=>q1,requireMoreDecisions:()=>pPt,resolveVersionFiles:()=>oP,suggestStrategy:()=>fz,updateVersionFiles:()=>uz,validateReleaseDecision:()=>dy});Ge();Dt();wc();Yt();ql();var kA=ut(Ai()),APt=/^(>=|[~^]|)(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$/,G1=(h=>(h.UNDECIDED=\"undecided\",h.DECLINE=\"decline\",h.MAJOR=\"major\",h.MINOR=\"minor\",h.PATCH=\"patch\",h.PREMAJOR=\"premajor\",h.PREMINOR=\"preminor\",h.PREPATCH=\"prepatch\",h.PRERELEASE=\"prerelease\",h))(G1||{});function dy(t){let e=kA.default.valid(t);return e||je.validateEnum(O4(G1,\"UNDECIDED\"),t)}async function oP(t,{prerelease:e=null}={}){let r=new Map,s=t.configuration.get(\"deferredVersionFolder\");if(!ce.existsSync(s))return r;let a=await ce.readdirPromise(s);for(let n of a){if(!n.endsWith(\".yml\"))continue;let c=J.join(s,n),f=await ce.readFilePromise(c,\"utf8\"),p=ls(f);for(let[h,E]of Object.entries(p.releases||{})){if(E===\"decline\")continue;let C=G.parseIdent(h),S=t.tryWorkspaceByIdent(C);if(S===null)throw new Error(`Assertion failed: Expected a release definition file to only reference existing workspaces (${J.basename(c)} references ${h})`);if(S.manifest.version===null)throw new Error(`Assertion failed: Expected the workspace to have a version (${G.prettyLocator(t.configuration,S.anchoredLocator)})`);let P=S.manifest.raw.stableVersion??S.manifest.version,I=r.get(S),R=sP(E===\"prerelease\"?S.manifest.version:P,dy(E));if(R===null)throw new Error(`Assertion failed: Expected ${P} to support being bumped via strategy ${E}`);let N=typeof I<\"u\"?kA.default.gt(R,I)?R:I:R;r.set(S,N)}}return e&&(r=new Map([...r].map(([n,c])=>[n,pke(c,{current:n.manifest.version,prerelease:e})]))),r}async function cz(t){let e=t.configuration.get(\"deferredVersionFolder\");ce.existsSync(e)&&await ce.removePromise(e)}async function uz(t,e){let r=new Set(e),s=t.configuration.get(\"deferredVersionFolder\");if(!ce.existsSync(s))return;let a=await ce.readdirPromise(s);for(let n of a){if(!n.endsWith(\".yml\"))continue;let c=J.join(s,n),f=await ce.readFilePromise(c,\"utf8\"),p=ls(f),h=p?.releases;if(h){for(let E of Object.keys(h)){let C=G.parseIdent(E),S=t.tryWorkspaceByIdent(C);(S===null||r.has(S))&&delete p.releases[E]}Object.keys(p.releases).length>0?await ce.changeFilePromise(c,nl(new nl.PreserveOrdering(p))):await ce.unlinkPromise(c)}}}async function q1(t,{allowEmpty:e=!1}={}){let r=t.configuration;if(r.projectCwd===null)throw new nt(\"This command can only be run from within a Yarn project\");let s=await ka.fetchRoot(r.projectCwd),a=s!==null?await ka.fetchBase(s,{baseRefs:r.get(\"changesetBaseRefs\")}):null,n=s!==null?await ka.fetchChangedFiles(s,{base:a.hash,project:t}):[],c=r.get(\"deferredVersionFolder\"),f=n.filter(P=>J.contains(c,P)!==null);if(f.length>1)throw new nt(`Your current branch contains multiple versioning files; this isn't supported:\n- ${f.map(P=>fe.fromPortablePath(P)).join(`\n- `)}`);let p=new Set(je.mapAndFilter(n,P=>{let I=t.tryWorkspaceByFilePath(P);return I===null?je.mapAndFilter.skip:I}));if(f.length===0&&p.size===0&&!e)return null;let h=f.length===1?f[0]:J.join(c,`${Nn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=ce.existsSync(h)?await ce.readFilePromise(h,\"utf8\"):\"{}\",C=ls(E),S=new Map;for(let P of C.declined||[]){let I=G.parseIdent(P),R=t.getWorkspaceByIdent(I);S.set(R,\"decline\")}for(let[P,I]of Object.entries(C.releases||{})){let R=G.parseIdent(P),N=t.getWorkspaceByIdent(R);S.set(N,dy(I))}return{project:t,root:s,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(P=>P.manifest.version!==null)),releases:S,async saveAll(){let P={},I=[],R=[];for(let N of t.workspaces){if(N.manifest.version===null)continue;let U=G.stringifyIdent(N.anchoredLocator),W=S.get(N);W===\"decline\"?I.push(U):typeof W<\"u\"?P[U]=dy(W):p.has(N)&&R.push(U)}await ce.mkdirPromise(J.dirname(h),{recursive:!0}),await ce.changeFilePromise(h,nl(new nl.PreserveOrdering({releases:Object.keys(P).length>0?P:void 0,declined:I.length>0?I:void 0,undecided:R.length>0?R:void 0})))}}}function pPt(t){return UL(t).size>0||aP(t).length>0}function UL(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function aP(t,{include:e=new Set}={}){let r=[],s=new Map(je.mapAndFilter([...t.releases],([n,c])=>c===\"decline\"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(je.mapAndFilter([...t.releases],([n,c])=>c!==\"decline\"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||s.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of Ut.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let p=t.project.tryWorkspaceByDescriptor(f);p!==null&&s.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function fz(t,e){let r=kA.default.clean(e);for(let s of Object.values(G1))if(s!==\"undecided\"&&s!==\"decline\"&&kA.default.inc(t,s)===r)return s;return null}function sP(t,e){if(kA.default.valid(e))return e;if(t===null)throw new nt(`Cannot apply the release strategy \"${e}\" unless the workspace already has a valid version`);if(!kA.default.valid(t))throw new nt(`Cannot apply the release strategy \"${e}\" on a non-semver version (${t})`);let r=kA.default.inc(t,e);if(r===null)throw new nt(`Cannot apply the release strategy \"${e}\" on the specified version (${t})`);return r}function Az(t,e,{report:r,exact:s}){let a=new Map;for(let n of t.workspaces)for(let c of Ut.allDependencies)for(let f of n.manifest[c].values()){let p=t.tryWorkspaceByDescriptor(f);if(p===null||!e.has(p))continue;je.getArrayWithDefault(a,p).push([n,c,f.identHash])}for(let[n,c]of e){let f=n.manifest.version;n.manifest.version=c,kA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?G.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${G.prettyLocator(t.configuration,n.anchoredLocator)}: Bumped to ${c}`),r.reportJson({cwd:fe.fromPortablePath(n.cwd),ident:p,oldVersion:f,newVersion:c});let h=a.get(n);if(!(typeof h>\"u\"))for(let[E,C,S]of h){let P=E.manifest[C].get(S);if(typeof P>\"u\")throw new Error(\"Assertion failed: The dependency should have existed\");let I=P.range,R=!1;if(I.startsWith(Ei.protocol)&&(I=I.slice(Ei.protocol.length),R=!0,I===n.relativeCwd))continue;let N=I.match(APt);if(!N){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${G.prettyLocator(t.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${N[1]}${c}`;R&&(U=`${Ei.protocol}${U}`);let W=G.makeDescriptor(P,U);E.manifest[C].set(S,W)}}}var hPt=new Map([[\"%n\",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function pke(t,{current:e,prerelease:r}){let s=new kA.default.SemVer(e),a=s.prerelease.slice(),n=[];s.prerelease=[],s.format()!==t&&(a.length=0);let c=!0,f=r.split(/\\./g);for(let p of f){let h=hPt.get(p);if(typeof h>\"u\")n.push(p),a[0]===p?a.shift():c=!1;else{let E=c?h.extract(a):null;E!==null&&typeof E[0]==\"number\"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),c=!1)}}return s.prerelease&&(s.prerelease=[]),`${t}-${n.join(\".\")}`}var Y1=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"--all\",!1,{description:\"Apply the deferred version changes on all workspaces\"});this.dryRun=ge.Boolean(\"--dry-run\",!1,{description:\"Print the versions without actually generating the package archive\"});this.prerelease=ge.String(\"--prerelease\",{description:\"Add a prerelease identifier to new versions\",tolerateBoolean:!0});this.exact=ge.Boolean(\"--exact\",!1,{description:\"Use the exact version of each package, removes any range. Useful for nightly releases where the range might match another version.\"});this.recursive=ge.Boolean(\"-R,--recursive\",{description:\"Release the transitive workspaces as well\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"version\",\"apply\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"apply all the deferred version bumps at once\",details:`\n      This command will apply the deferred version changes and remove their definitions from the repository.\n\n      Note that if \\`--prerelease\\` is set, the given prerelease identifier (by default \\`rc.%n\\`) will be used on all new versions and the version definitions will be kept as-is.\n\n      By default only the current workspace will be bumped, but you can configure this behavior by using one of:\n\n      - \\`--recursive\\` to also apply the version bump on its dependencies\n      - \\`--all\\` to apply the version bump on all packages in the repository\n\n      Note that this command will also update the \\`workspace:\\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.\n    `,examples:[[\"Apply the version change to the local workspace\",\"yarn version apply\"],[\"Apply the version change to all the workspaces in the local workspace\",\"yarn version apply --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=this.prerelease?typeof this.prerelease!=\"boolean\"?this.prerelease:\"rc.%n\":null,h=await oP(s,{prerelease:p}),E=new Map;if(this.all)E=h;else{let C=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let S of C){let P=h.get(S);typeof P<\"u\"&&E.set(S,P)}}if(E.size===0){let C=h.size>0?\" Did you want to add --all?\":\"\";f.reportWarning(0,`The current workspace doesn't seem to require a version bump.${C}`);return}Az(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await cz(s):await uz(s,[...E.keys()])),f.reportSeparator())});return this.dryRun||c.hasErrors()?c.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ge();Dt();Yt();var _L=ut(Ai());var V1=class extends ft{constructor(){super(...arguments);this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Open an interactive interface used to set version bumps\"})}static{this.paths=[[\"version\",\"check\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"check that all the relevant packages have been bumped\",details:\"\\n      **Warning:** This command currently requires Git.\\n\\n      This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\\n\\n      In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\\n\\n      In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\\n    \",examples:[[\"Check whether the modified packages need a bump\",\"yarn version check\"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){iw(this.context);let{Gem:r}=await Promise.resolve().then(()=>(WF(),LW)),{ScrollableItems:s}=await Promise.resolve().then(()=>(KF(),JF)),{FocusRequest:a}=await Promise.resolve().then(()=>(UW(),v2e)),{useListInput:n}=await Promise.resolve().then(()=>(VF(),S2e)),{renderForm:c}=await Promise.resolve().then(()=>($F(),ZF)),{Box:f,Text:p}=await Promise.resolve().then(()=>ut(Wc())),{default:h,useCallback:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,this.context.cwd);if(!I)throw new ar(P.cwd,this.context.cwd);await P.restoreInstallState();let R=await q1(P);if(R===null||R.releaseRoots.size===0)return 0;if(R.root===null)throw new nt(\"This command can only be run on Git repositories\");let N=()=>h.createElement(f,{flexDirection:\"row\",paddingBottom:1},h.createElement(f,{flexDirection:\"column\",width:60},h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to select workspaces.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<left>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<right>\"),\" to select release strategies.\"))),h.createElement(f,{flexDirection:\"column\"},h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to save.\")),h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),U=({workspace:me,active:pe,decision:Be,setDecision:Ce})=>{let g=me.manifest.raw.stableVersion??me.manifest.version;if(g===null)throw new Error(`Assertion failed: The version should have been set (${G.prettyLocator(S,me.anchoredLocator)})`);if(_L.default.prerelease(g)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${g})`);let we=[\"undecided\",\"decline\",\"patch\",\"minor\",\"major\"];n(Be,we,{active:pe,minus:\"left\",plus:\"right\",set:Ce});let ye=Be===\"undecided\"?h.createElement(p,{color:\"yellow\"},g):Be===\"decline\"?h.createElement(p,{color:\"green\"},g):h.createElement(p,null,h.createElement(p,{color:\"magenta\"},g),\" \\u2192 \",h.createElement(p,{color:\"green\"},_L.default.valid(Be)?Be:_L.default.inc(g,Be)));return h.createElement(f,{flexDirection:\"column\"},h.createElement(f,null,h.createElement(p,null,G.prettyLocator(S,me.anchoredLocator),\" - \",ye)),h.createElement(f,null,we.map(Ae=>h.createElement(f,{key:Ae,paddingLeft:2},h.createElement(p,null,h.createElement(r,{active:Ae===Be}),\" \",Ae)))))},W=me=>{let pe=new Set(R.releaseRoots),Be=new Map([...me].filter(([Ce])=>pe.has(Ce)));for(;;){let Ce=aP({project:R.project,releases:Be}),g=!1;if(Ce.length>0){for(let[we]of Ce)if(!pe.has(we)){pe.add(we),g=!0;let ye=me.get(we);typeof ye<\"u\"&&Be.set(we,ye)}}if(!g)break}return{relevantWorkspaces:pe,relevantReleases:Be}},ee=()=>{let[me,pe]=C(()=>new Map(R.releases)),Be=E((Ce,g)=>{let we=new Map(me);g!==\"undecided\"?we.set(Ce,g):we.delete(Ce);let{relevantReleases:ye}=W(we);pe(ye)},[me,pe]);return[me,Be]},ie=({workspaces:me,releases:pe})=>{let Be=[];Be.push(`${me.size} total`);let Ce=0,g=0;for(let we of me){let ye=pe.get(we);typeof ye>\"u\"?g+=1:ye!==\"decline\"&&(Ce+=1)}return Be.push(`${Ce} release${Ce===1?\"\":\"s\"}`),Be.push(`${g} remaining`),h.createElement(p,{color:\"yellow\"},Be.join(\", \"))},le=await c(({useSubmit:me})=>{let[pe,Be]=ee();me(pe);let{relevantWorkspaces:Ce}=W(pe),g=new Set([...Ce].filter(se=>!R.releaseRoots.has(se))),[we,ye]=C(0),Ae=E(se=>{switch(se){case a.BEFORE:ye(we-1);break;case a.AFTER:ye(we+1);break}},[we,ye]);return h.createElement(f,{flexDirection:\"column\"},h.createElement(N,null),h.createElement(f,null,h.createElement(p,{wrap:\"wrap\"},\"The following files have been modified in your local checkout.\")),h.createElement(f,{flexDirection:\"column\",marginTop:1,paddingLeft:2},[...R.changedFiles].map(se=>h.createElement(f,{key:se},h.createElement(p,null,h.createElement(p,{color:\"grey\"},fe.fromPortablePath(R.root)),fe.sep,fe.relative(fe.fromPortablePath(R.root),fe.fromPortablePath(se)))))),R.releaseRoots.size>0&&h.createElement(h.Fragment,null,h.createElement(f,{marginTop:1},h.createElement(p,{wrap:\"wrap\"},\"Because of those files having been modified, the following workspaces may need to be released again (note that private workspaces are also shown here, because even though they won't be published, releasing them will allow us to flag their dependents for potential re-release):\")),g.size>3?h.createElement(f,{marginTop:1},h.createElement(ie,{workspaces:R.releaseRoots,releases:pe})):null,h.createElement(f,{marginTop:1,flexDirection:\"column\"},h.createElement(s,{active:we%2===0,radius:1,size:2,onFocusRequest:Ae},[...R.releaseRoots].map(se=>h.createElement(U,{key:se.cwd,workspace:se,decision:pe.get(se)||\"undecided\",setDecision:Z=>Be(se,Z)}))))),g.size>0?h.createElement(h.Fragment,null,h.createElement(f,{marginTop:1},h.createElement(p,{wrap:\"wrap\"},\"The following workspaces depend on other workspaces that have been marked for release, and thus may need to be released as well:\")),h.createElement(f,null,h.createElement(p,null,\"(Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<tab>\"),\" to move the focus between the workspace groups.)\")),g.size>5?h.createElement(f,{marginTop:1},h.createElement(ie,{workspaces:g,releases:pe})):null,h.createElement(f,{marginTop:1,flexDirection:\"column\"},h.createElement(s,{active:we%2===1,radius:2,size:2,onFocusRequest:Ae},[...g].map(se=>h.createElement(U,{key:se.cwd,workspace:se,decision:pe.get(se)||\"undecided\",setDecision:Z=>Be(se,Z)}))))):null)},{versionFile:R},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof le>\"u\")return 1;R.releases.clear();for(let[me,pe]of le)R.releases.set(me,pe);await R.saveAll()}async executeStandard(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return await s.restoreInstallState(),(await Ot.start({configuration:r,stdout:this.context.stdout},async c=>{let f=await q1(s);if(f===null||f.releaseRoots.size===0)return;if(f.root===null)throw new nt(\"This command can only be run on Git repositories\");if(c.reportInfo(0,`Your PR was started right after ${he.pretty(r,f.baseHash.slice(0,7),\"yellow\")} ${he.pretty(r,f.baseTitle,\"magenta\")}`),f.changedFiles.size>0){c.reportInfo(0,\"You have changed the following files since then:\"),c.reportSeparator();for(let S of f.changedFiles)c.reportInfo(null,`${he.pretty(r,fe.fromPortablePath(f.root),\"gray\")}${fe.sep}${fe.relative(fe.fromPortablePath(f.root),fe.fromPortablePath(S))}`)}let p=!1,h=!1,E=UL(f);if(E.size>0){p||c.reportSeparator();for(let S of E)c.reportError(0,`${G.prettyLocator(r,S.anchoredLocator)} has been modified but doesn't have a release strategy attached`);p=!0}let C=aP(f);for(let[S,P]of C)h||c.reportSeparator(),c.reportError(0,`${G.prettyLocator(r,S.anchoredLocator)} doesn't have a release strategy attached, but depends on ${G.prettyWorkspace(r,P)} which is planned for release.`),h=!0;(p||h)&&(c.reportSeparator(),c.reportInfo(0,\"This command detected that at least some workspaces have received modifications without explicit instructions as to how they had to be released (if needed).\"),c.reportInfo(0,\"To correct these errors, run `yarn version check --interactive` then follow the instructions.\"))})).exitCode()}};Ge();Yt();var HL=ut(Ai());var J1=class extends ft{constructor(){super(...arguments);this.deferred=ge.Boolean(\"-d,--deferred\",{description:\"Prepare the version to be bumped during the next release cycle\"});this.immediate=ge.Boolean(\"-i,--immediate\",{description:\"Bump the version immediately\"});this.strategy=ge.String()}static{this.paths=[[\"version\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"apply a new version to the current package\",details:\"\\n      This command will bump the version number for the given package, following the specified strategy:\\n\\n      - If `major`, the first number from the semver range will be increased (`X.0.0`).\\n      - If `minor`, the second number from the semver range will be increased (`0.X.0`).\\n      - If `patch`, the third number from the semver range will be increased (`0.0.X`).\\n      - If prefixed by `pre` (`premajor`, ...), a `-0` suffix will be set (`0.0.0-0`).\\n      - If `prerelease`, the suffix will be increased (`0.0.0-X`); the third number from the semver range will also be increased if there was no suffix in the previous version.\\n      - If `decline`, the nonce will be increased for `yarn version check` to pass without version bump.\\n      - If a valid semver range, it will be used as new version.\\n      - If unspecified, Yarn will ask you for guidance.\\n\\n      For more information about the `--deferred` flag, consult our documentation (https://yarnpkg.com/features/release-workflow#deferred-versioning).\\n    \",examples:[[\"Immediately bump the version to the next major\",\"yarn version major\"],[\"Prepare the version to be bumped to the next major\",\"yarn version major --deferred\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=r.get(\"preferDeferredVersions\");this.deferred&&(n=!0),this.immediate&&(n=!1);let c=HL.default.valid(this.strategy),f=this.strategy===\"decline\",p;if(c)if(a.manifest.version!==null){let E=fz(a.manifest.version,this.strategy);E!==null?p=E:p=this.strategy}else p=this.strategy;else{let E=a.manifest.version;if(!f){if(E===null)throw new nt(\"Can't bump the version if there wasn't a version to begin with - use 0.0.0 as initial version then run the command again.\");if(typeof E!=\"string\"||!HL.default.valid(E))throw new nt(`Can't bump the version (${E}) if it's not valid semver`)}p=dy(this.strategy)}if(!n){let C=(await oP(s)).get(a);if(typeof C<\"u\"&&p!==\"decline\"){let S=sP(a.manifest.version,p);if(HL.default.lt(S,C))throw new nt(`Can't bump the version to one that would be lower than the current deferred one (${C})`)}}let h=await q1(s,{allowEmpty:!0});return h.releases.set(a,p),await h.saveAll(),n?0:await this.cli.run([\"version\",\"apply\"])}};var gPt={configuration:{deferredVersionFolder:{description:\"Folder where are stored the versioning files\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/versions\"},preferDeferredVersions:{description:\"If true, running `yarn version` will assume the `--deferred` flag unless `--immediate` is set\",type:\"BOOLEAN\",default:!1}},commands:[Y1,V1,J1]},dPt=gPt;var hz={};Vt(hz,{WorkspacesFocusCommand:()=>K1,WorkspacesForeachCommand:()=>X1,default:()=>EPt});Ge();Ge();Yt();var K1=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.production=ge.Boolean(\"--production\",!1,{description:\"Only install regular dependencies by omitting dev dependencies\"});this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Install the entire project\"});this.workspaces=ge.Rest()}static{this.paths=[[\"workspaces\",\"focus\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"install a single workspace and its dependencies\",details:\"\\n      This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\\n\\n      Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\\n\\n      If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Kr.find(r);await s.restoreInstallState({restoreResolutions:!1});let c;if(this.all)c=new Set(s.workspaces);else if(this.workspaces.length===0){if(!a)throw new ar(s.cwd,this.context.cwd);c=new Set([a])}else c=new Set(this.workspaces.map(f=>s.getWorkspaceByIdent(G.parseIdent(f))));for(let f of c)for(let p of this.production?[\"dependencies\"]:Ut.hardDependencies)for(let h of f.manifest.getForScope(p).values()){let E=s.tryWorkspaceByDescriptor(h);E!==null&&c.add(E)}for(let f of s.workspaces)c.has(f)?this.production&&f.manifest.devDependencies.clear():(f.manifest.installConfig=f.manifest.installConfig||{},f.manifest.installConfig.selfReferences=!1,f.manifest.dependencies.clear(),f.manifest.devDependencies.clear(),f.manifest.peerDependencies.clear(),f.manifest.scripts.clear());return await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n,persistProject:!1})}};Ge();Ge();Ge();Yt();var z1=ut(Go()),gke=ut(Ld());Ul();var X1=class extends ft{constructor(){super(...arguments);this.from=ge.Array(\"--from\",{description:\"An array of glob pattern idents or paths from which to base any recursion\"});this.all=ge.Boolean(\"-A,--all\",{description:\"Run the command on all workspaces of a project\"});this.recursive=ge.Boolean(\"-R,--recursive\",{description:\"Run the command on the current workspace and all of its recursive dependencies\"});this.worktree=ge.Boolean(\"-W,--worktree\",{description:\"Run the command on all workspaces of the current worktree\"});this.verbose=ge.Counter(\"-v,--verbose\",{description:\"Increase level of logging verbosity up to 2 times\"});this.parallel=ge.Boolean(\"-p,--parallel\",!1,{description:\"Run the commands in parallel\"});this.interlaced=ge.Boolean(\"-i,--interlaced\",!1,{description:\"Print the output of commands in real-time instead of buffering it\"});this.jobs=ge.String(\"-j,--jobs\",{description:\"The maximum number of parallel tasks that the execution will be limited to; or `unlimited`\",validator:g_([fo([\"unlimited\"]),$2(h_(),[m_(),d_(1)])])});this.topological=ge.Boolean(\"-t,--topological\",!1,{description:\"Run the command after all workspaces it depends on (regular) have finished\"});this.topologicalDev=ge.Boolean(\"--topological-dev\",!1,{description:\"Run the command after all workspaces it depends on (regular + dev) have finished\"});this.include=ge.Array(\"--include\",[],{description:\"An array of glob pattern idents or paths; only matching workspaces will be traversed\"});this.exclude=ge.Array(\"--exclude\",[],{description:\"An array of glob pattern idents or paths; matching workspaces won't be traversed\"});this.publicOnly=ge.Boolean(\"--no-private\",{description:\"Avoid running the command on private workspaces\"});this.since=ge.String(\"--since\",{description:\"Only include workspaces that have been changed since the specified ref.\",tolerateBoolean:!0});this.dryRun=ge.Boolean(\"-n,--dry-run\",{description:\"Print the commands that would be run, without actually running them\"});this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"workspaces\",\"foreach\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"run a command on all workspaces\",details:\"\\n      This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\\n\\n      - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`, or disabled by setting `-j unlimited`.\\n\\n      - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\\n\\n      - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\\n\\n      - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project.\\n\\n      - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\\n\\n      - If `-W,--worktree` is set, Yarn will find workspaces to run the command on by looking at the current worktree.\\n\\n      - If `--from` is set, Yarn will use the packages matching the 'from' glob as the starting point for any recursive search.\\n\\n      - If `--since` is set, Yarn will only run the command on workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\\n\\n      - If `--dry-run` is set, Yarn will explain what it would do without actually doing anything.\\n\\n      - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them. You can also use the `--no-private` flag to avoid running the command in private workspaces.\\n\\n      The `-v,--verbose` flag can be passed up to twice: once to prefix output lines with the originating workspace's name, and again to include start/finish/timing log lines. Maximum verbosity is enabled by default in terminal environments.\\n\\n      If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\\n    \",examples:[[\"Publish all packages\",\"yarn workspaces foreach -A --no-private npm publish --tolerate-republish\"],[\"Run the build script on all descendant packages\",\"yarn workspaces foreach -A run build\"],[\"Run the build script on current and all descendant packages in parallel, building package dependencies first\",\"yarn workspaces foreach -Apt run build\"],[\"Run the build script on several packages and all their dependencies, building dependencies first\",\"yarn workspaces foreach -Rpt --from '{workspace-a,workspace-b}' run build\"]]})}static{this.schema=[tB(\"all\",qf.Forbids,[\"from\",\"recursive\",\"since\",\"worktree\"],{missingIf:\"undefined\"}),y_([\"all\",\"recursive\",\"since\",\"worktree\"],{missingIf:\"undefined\"})]}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!this.all&&!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=this.cli.process([this.commandName,...this.args]),c=n.path.length===1&&n.path[0]===\"run\"&&typeof n.scriptName<\"u\"?n.scriptName:null;if(n.path.length===0)throw new nt(\"Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script\");let f=Ce=>{this.dryRun&&this.context.stdout.write(`${Ce}\n`)},p=()=>{let Ce=this.from.map(g=>z1.default.matcher(g));return s.workspaces.filter(g=>{let we=G.stringifyIdent(g.anchoredLocator),ye=g.relativeCwd;return Ce.some(Ae=>Ae(we)||Ae(ye))})},h=[];if(this.since?(f(\"Option --since is set; selecting the changed workspaces as root for workspace selection\"),h=Array.from(await ka.fetchChangedWorkspaces({ref:this.since,project:s}))):this.from?(f(\"Option --from is set; selecting the specified workspaces\"),h=[...p()]):this.worktree?(f(\"Option --worktree is set; selecting the current workspace\"),h=[a]):this.recursive?(f(\"Option --recursive is set; selecting the current workspace\"),h=[a]):this.all&&(f(\"Option --all is set; selecting all workspaces\"),h=[...s.workspaces]),this.dryRun&&!this.all){for(let Ce of h)f(`\n- ${Ce.relativeCwd}\n  ${G.prettyLocator(r,Ce.anchoredLocator)}`);h.length>0&&f(\"\")}let E;if(this.recursive?this.since?(f(\"Option --recursive --since is set; recursively selecting all dependent workspaces\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependents()]).flat())):(f(\"Option --recursive is set; recursively selecting all transitive dependencies\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f(\"Option --worktree is set; recursively selecting all nested workspaces\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ce of E)f(`\n- ${Ce.relativeCwd}\n  ${G.prettyLocator(r,Ce.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(\":\")){for(let Ce of s.workspaces)if(Ce.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let Ce of h){if(c&&!Ce.manifest.scripts.has(c)&&!S&&!(await In.getWorkspaceAccessibleBinaries(Ce)).has(c)){f(`Excluding ${Ce.relativeCwd} because it doesn't have a \"${c}\" script`);continue}if(!(c===r.env.npm_lifecycle_event&&Ce.cwd===a.cwd)){if(this.include.length>0&&!z1.default.isMatch(G.stringifyIdent(Ce.anchoredLocator),this.include)&&!z1.default.isMatch(Ce.relativeCwd,this.include)){f(`Excluding ${Ce.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(z1.default.isMatch(G.stringifyIdent(Ce.anchoredLocator),this.exclude)||z1.default.isMatch(Ce.relativeCwd,this.exclude))){f(`Excluding ${Ce.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&Ce.manifest.private===!0){f(`Excluding ${Ce.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(Ce)}}if(this.dryRun)return 0;let P=this.verbose??(this.context.stdout.isTTY?1/0:0),I=P>0,R=P>1,N=this.parallel?this.jobs===\"unlimited\"?1/0:Number(this.jobs)||Math.ceil(Ui.availableParallelism()/2):1,U=N===1?!1:this.parallel,W=U?this.interlaced:!0,ee=(0,gke.default)(N),ie=new Map,ue=new Set,le=0,me=null,pe=!1,Be=await Ot.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ce=>{let g=async(we,{commandIndex:ye})=>{if(pe)return-1;!U&&R&&ye>1&&Ce.reportSeparator();let Ae=mPt(we,{configuration:r,label:I,commandIndex:ye}),[se,Z]=hke(Ce,{prefix:Ae,interlaced:W}),[De,Re]=hke(Ce,{prefix:Ae,interlaced:W});try{R&&Ce.reportInfo(null,`${Ae?`${Ae} `:\"\"}Process started`);let mt=Date.now(),j=await this.cli.run([this.commandName,...this.args],{cwd:we.cwd,stdout:se,stderr:De})||0;se.end(),De.end(),await Z,await Re;let rt=Date.now();if(R){let Fe=r.get(\"enableTimers\")?`, completed in ${he.pretty(r,rt-mt,he.Type.DURATION)}`:\"\";Ce.reportInfo(null,`${Ae?`${Ae} `:\"\"}Process exited (exit code ${j})${Fe}`)}return j===130&&(pe=!0,me=j),j}catch(mt){throw se.end(),De.end(),await Z,await Re,mt}};for(let we of C)ie.set(we.anchoredLocator.locatorHash,we);for(;ie.size>0&&!Ce.hasErrors();){let we=[];for(let[Z,De]of ie){if(ue.has(De.anchoredDescriptor.descriptorHash))continue;let Re=!0;if(this.topological||this.topologicalDev){let mt=this.topologicalDev?new Map([...De.manifest.dependencies,...De.manifest.devDependencies]):De.manifest.dependencies;for(let j of mt.values()){let rt=s.tryWorkspaceByDescriptor(j);if(Re=rt===null||!ie.has(rt.anchoredLocator.locatorHash),!Re)break}}if(Re&&(ue.add(De.anchoredDescriptor.descriptorHash),we.push(ee(async()=>{let mt=await g(De,{commandIndex:++le});return ie.delete(Z),ue.delete(De.anchoredDescriptor.descriptorHash),{workspace:De,exitCode:mt}})),!U))break}if(we.length===0){let Z=Array.from(ie.values()).map(De=>G.prettyLocator(r,De.anchoredLocator)).join(\", \");Ce.reportError(3,`Dependency cycle detected (${Z})`);return}let ye=await Promise.all(we);ye.forEach(({workspace:Z,exitCode:De})=>{De!==0&&Ce.reportError(0,`The command failed in workspace ${G.prettyLocator(r,Z.anchoredLocator)} with exit code ${De}`)});let se=ye.map(Z=>Z.exitCode).find(Z=>Z!==0);(this.topological||this.topologicalDev)&&typeof se<\"u\"&&Ce.reportError(0,\"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph\")}});return me!==null?me:Be.exitCode()}};function hke(t,{prefix:e,interlaced:r}){let s=t.createStreamReporter(e),a=new je.DefaultStream;a.pipe(s,{end:!1}),a.on(\"finish\",()=>{s.end()});let n=new Promise(f=>{s.on(\"finish\",()=>{f(a.active)})});if(r)return[a,n];let c=new je.BufferStream;return c.pipe(a,{end:!1}),c.on(\"finish\",()=>{a.end()}),[c,n]}function mPt(t,{configuration:e,commandIndex:r,label:s}){if(!s)return null;let n=`[${G.stringifyIdent(t.anchoredLocator)}]:`,c=[\"#2E86AB\",\"#A23B72\",\"#F18F01\",\"#C73E1D\",\"#CCE2A3\"],f=c[r%c.length];return he.pretty(e,n,f)}var yPt={commands:[K1,X1]},EPt=yPt;var tC=()=>({modules:new Map([[\"@yarnpkg/cli\",Gv],[\"@yarnpkg/core\",jv],[\"@yarnpkg/fslib\",_2],[\"@yarnpkg/libzip\",fv],[\"@yarnpkg/parsers\",J2],[\"@yarnpkg/shell\",mv],[\"clipanion\",oB],[\"semver\",IPt],[\"typanion\",Ea],[\"@yarnpkg/plugin-essentials\",hq],[\"@yarnpkg/plugin-catalog\",yq],[\"@yarnpkg/plugin-compat\",Bq],[\"@yarnpkg/plugin-constraints\",_q],[\"@yarnpkg/plugin-dlx\",Hq],[\"@yarnpkg/plugin-exec\",qq],[\"@yarnpkg/plugin-file\",Yq],[\"@yarnpkg/plugin-git\",pq],[\"@yarnpkg/plugin-github\",Kq],[\"@yarnpkg/plugin-http\",zq],[\"@yarnpkg/plugin-init\",Xq],[\"@yarnpkg/plugin-interactive-tools\",JW],[\"@yarnpkg/plugin-jsr\",zW],[\"@yarnpkg/plugin-link\",XW],[\"@yarnpkg/plugin-nm\",FY],[\"@yarnpkg/plugin-npm\",FK],[\"@yarnpkg/plugin-npm-cli\",qK],[\"@yarnpkg/plugin-pack\",bV],[\"@yarnpkg/plugin-patch\",XK],[\"@yarnpkg/plugin-pnp\",wY],[\"@yarnpkg/plugin-pnpm\",ez],[\"@yarnpkg/plugin-stage\",az],[\"@yarnpkg/plugin-typescript\",lz],[\"@yarnpkg/plugin-version\",pz],[\"@yarnpkg/plugin-workspace-tools\",hz]]),plugins:new Set([\"@yarnpkg/plugin-essentials\",\"@yarnpkg/plugin-catalog\",\"@yarnpkg/plugin-compat\",\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-dlx\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-file\",\"@yarnpkg/plugin-git\",\"@yarnpkg/plugin-github\",\"@yarnpkg/plugin-http\",\"@yarnpkg/plugin-init\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-jsr\",\"@yarnpkg/plugin-link\",\"@yarnpkg/plugin-nm\",\"@yarnpkg/plugin-npm\",\"@yarnpkg/plugin-npm-cli\",\"@yarnpkg/plugin-pack\",\"@yarnpkg/plugin-patch\",\"@yarnpkg/plugin-pnp\",\"@yarnpkg/plugin-pnpm\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\"])});function yke({cwd:t,pluginConfiguration:e}){let r=new Ca({binaryLabel:\"Yarn Package Manager\",binaryName:\"yarn\",binaryVersion:fn??\"<unknown>\"});return Object.assign(r,{defaultContext:{...Ca.defaultContext,cwd:t,plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr}})}function CPt(t){if(je.parseOptionalBoolean(process.env.YARN_IGNORE_NODE))return!0;let r=process.versions.node,s=\">=18.12.0\";if(Fr.satisfiesWithPrereleases(r,s))return!0;let a=new nt(`This tool requires a Node version compatible with ${s} (got ${r}). Upgrade Node, or set \\`YARN_IGNORE_NODE=1\\` in your environment.`);return Ca.defaultContext.stdout.write(t.error(a)),!1}async function Eke({selfPath:t,pluginConfiguration:e}){return await ze.find(fe.toPortablePath(process.cwd()),e,{strict:!1,usePathCheck:t})}function wPt(t,e,{yarnPath:r}){if(!ce.existsSync(r))return t.error(new Error(`The \"yarn-path\" option has been set, but the specified location doesn't exist (${r}).`)),1;process.on(\"SIGINT\",()=>{});let s={stdio:\"inherit\",env:{...process.env,YARN_IGNORE_PATH:\"1\"}};try{(0,dke.execFileSync)(process.execPath,[fe.fromPortablePath(r),...e],s)}catch(a){return a.status??1}return 0}function BPt(t,e){let r=null,s=e;return e.length>=2&&e[0]===\"--cwd\"?(r=fe.toPortablePath(e[1]),s=e.slice(2)):e.length>=1&&e[0].startsWith(\"--cwd=\")?(r=fe.toPortablePath(e[0].slice(6)),s=e.slice(1)):e[0]===\"add\"&&e[e.length-2]===\"--cwd\"&&(r=fe.toPortablePath(e[e.length-1]),s=e.slice(0,e.length-2)),t.defaultContext.cwd=r!==null?J.resolve(r):J.cwd(),s}function vPt(t,{configuration:e}){if(!e.get(\"enableTelemetry\")||mke.isCI||!process.stdout.isTTY)return;ze.telemetry=new ZI(e,\"puba9cdc10ec5790a2cf4969dd413a47270\");let s=/^@yarnpkg\\/plugin-(.*)$/;for(let a of e.plugins.keys())$I.has(a.match(s)?.[1]??\"\")&&ze.telemetry?.reportPluginName(a);t.binaryVersion&&ze.telemetry.reportVersion(t.binaryVersion)}function Ike(t,{configuration:e}){for(let r of e.plugins.values())for(let s of r.commands||[])t.register(s)}async function SPt(t,e,{selfPath:r,pluginConfiguration:s}){if(!CPt(t))return 1;let a=await Eke({selfPath:r,pluginConfiguration:s}),n=a.get(\"yarnPath\"),c=a.get(\"ignorePath\");if(n&&!c)return wPt(t,e,{yarnPath:n});delete process.env.YARN_IGNORE_PATH;let f=BPt(t,e);vPt(t,{configuration:a}),Ike(t,{configuration:a});let p=t.process(f,t.defaultContext);return p.help||ze.telemetry?.reportCommandName(p.path.join(\" \")),await t.run(p,t.defaultContext)}async function bde({cwd:t=J.cwd(),pluginConfiguration:e=tC()}={}){let r=yke({cwd:t,pluginConfiguration:e}),s=await Eke({pluginConfiguration:e,selfPath:null});return Ike(r,{configuration:s}),r}async function VR(t,{cwd:e=J.cwd(),selfPath:r,pluginConfiguration:s}){let a=yke({cwd:e,pluginConfiguration:s});function n(){Ca.defaultContext.stdout.write(`ERROR: Yarn is terminating due to an unexpected empty event loop.\nPlease report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once(\"beforeExit\",n);try{process.exitCode=42,process.exitCode=await SPt(a,t,{selfPath:r,pluginConfiguration:s})}catch(c){Ca.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off(\"beforeExit\",n),await ce.rmtempPromise()}}VR(process.argv.slice(2),{cwd:J.cwd(),selfPath:fe.toPortablePath(fe.resolve(process.argv[1])),pluginConfiguration:tC()});})();\n/**\n  @license\n  Copyright (c) 2015, Rebecca Turner\n\n  Permission to use, copy, modify, and/or distribute this software for any\n  purpose with or without fee is hereby granted, provided that the above\n  copyright notice and this permission notice appear in all copies.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n  FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n  PERFORMANCE OF THIS SOFTWARE.\n */\n/**\n  @license\n  Copyright Node.js contributors. All rights reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to\n  deal in the Software without restriction, including without limitation the\n  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n  sell copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n  IN THE SOFTWARE.\n*/\n/**\n  @license\n  The MIT License (MIT)\n\n  Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n*/\n/**\n  @license\n  Copyright Joyent, Inc. and other Node contributors.\n\n  Permission is hereby granted, free of charge, to any person obtaining a\n  copy of this software and associated documentation files (the\n  \"Software\"), to deal in the Software without restriction, including\n  without limitation the rights to use, copy, modify, merge, publish,\n  distribute, sublicense, and/or sell copies of the Software, and to permit\n  persons to whom the Software is furnished to do so, subject to the\n  following conditions:\n\n  The above copyright notice and this permission notice shall be included\n  in all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n  NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n  USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n/*! Bundled license information:\n\nis-number/index.js:\n  (*!\n   * is-number <https://github.com/jonschlinkert/is-number>\n   *\n   * Copyright (c) 2014-present, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nto-regex-range/index.js:\n  (*!\n   * to-regex-range <https://github.com/micromatch/to-regex-range>\n   *\n   * Copyright (c) 2015-present, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nfill-range/index.js:\n  (*!\n   * fill-range <https://github.com/jonschlinkert/fill-range>\n   *\n   * Copyright (c) 2014-present, Jon Schlinkert.\n   * Licensed under the MIT License.\n   *)\n\nis-extglob/index.js:\n  (*!\n   * is-extglob <https://github.com/jonschlinkert/is-extglob>\n   *\n   * Copyright (c) 2014-2016, Jon Schlinkert.\n   * Licensed under the MIT License.\n   *)\n\nis-glob/index.js:\n  (*!\n   * is-glob <https://github.com/jonschlinkert/is-glob>\n   *\n   * Copyright (c) 2014-2017, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nqueue-microtask/index.js:\n  (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nrun-parallel/index.js:\n  (*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\ngit-url-parse/lib/index.js:\n  (*!\n   * buildToken\n   * Builds OAuth token prefix (helper function)\n   *\n   * @name buildToken\n   * @function\n   * @param {GitUrl} obj The parsed Git url object.\n   * @return {String} token prefix\n   *)\n\nobject-assign/index.js:\n  (*\n  object-assign\n  (c) Sindre Sorhus\n  @license MIT\n  *)\n\nreact/cjs/react.production.min.js:\n  (** @license React v17.0.2\n   * react.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nscheduler/cjs/scheduler.production.min.js:\n  (** @license React v0.20.2\n   * scheduler.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nreact-reconciler/cjs/react-reconciler.production.min.js:\n  (** @license React v0.26.2\n   * react-reconciler.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nis-windows/index.js:\n  (*!\n   * is-windows <https://github.com/jonschlinkert/is-windows>\n   *\n   * Copyright © 2015-2018, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n*/\n"
  },
  {
    "path": ".yarnrc.yml",
    "content": "compressionLevel: mixed\n\nenableGlobalCache: false\n\nnmHoistingLimits: workspaces\n\nnmMode: hardlinks-local\n\nnodeLinker: node-modules\n\nnpmMinimalAgeGate: 14d\n"
  },
  {
    "path": "ARCHITECTURE.md",
    "content": "# Detox Architecture\n\nThis document provides an overview of Detox's internal architecture for contributors and maintainers.\n\n## Overview\n\nDetox is a **gray-box end-to-end testing framework** for React Native mobile applications. Unlike black-box testing frameworks, Detox has visibility into the app's internal state, enabling automatic synchronization between tests and the app.\n\n```text\n┌───────────────────────────────────────────────────────────┐\n│                Test Environment (Node.js)                 │\n│                                                           │\n│  ┌─────────────┐  ┌─────────────┐  ┌───────────────────┐  │\n│  │ Test Runner │  │DetoxContext │  │ ArtifactsManager  │  │\n│  │(Jest/Mocha) │  │  (Realms)   │  │                   │  │\n│  └──────┬──────┘  └──────┬──────┘  └─────────┬─────────┘  │\n│         │                │                   │            │\n│         └────────────────┼───────────────────┘            │\n│                          │                                │\n│                ┌─────────▼─────────┐                      │\n│                │   DetoxWorker     │                      │\n│                │   - device        │                      │\n│                │   - element/by    │                      │\n│                │   - expect        │                      │\n│                └─────────┬─────────┘                      │\n│                          │                                │\n│                ┌─────────▼─────────┐                      │\n│                │      Client       │                      │\n│                │    (WebSocket)    │                      │\n│                └─────────┬─────────┘                      │\n└──────────────────────────┼────────────────────────────────┘\n                           │\n                 ┌─────────▼─────────┐\n                 │   DetoxServer     │\n                 │   (WebSocket)     │\n                 │   localhost:port  │\n                 └─────────┬─────────┘\n                           │\n┌──────────────────────────┼────────────────────────────────┐\n│               Mobile Device/Simulator                     │\n│                          │                                │\n│                ┌─────────▼─────────┐                      │\n│                │   Native Client   │                      │\n│                │   (iOS/Android)   │                      │\n│                │                   │                      │\n│                │   - Synchronizer  │                      │\n│                │   - Matchers      │                      │\n│                │   - Actions       │                      │\n│                └───────────────────┘                      │\n└───────────────────────────────────────────────────────────┘\n```\n\n## Core Components\n\n### 1. Realms (`src/realms/`)\n\nDetox uses a \"realm\" pattern to manage different execution contexts:\n\n| Realm | Class | Purpose |\n|-------|-------|---------|\n| **Primary** | `DetoxPrimaryContext` | Full-featured context with device allocation, used in test runner process |\n| **Secondary** | `DetoxSecondaryContext` | Lightweight config-snapshot context for worker processes |\n\n**Key files:**\n\n- `DetoxContext.js` - Base class exposing `device`, `element`, `expect`, `by`, `waitFor`, `web`, `system`\n- `DetoxPrimaryContext.js` - Handles initialization, device allocation, server lifecycle\n- `DetoxSecondaryContext.js` - Receives config snapshots, no device management\n\nThe base `DetoxContext` uses **funpermaproxy** to lazily delegate API calls to the worker:\n\n```javascript\ndevice = funpermaproxy(() => this[symbols.worker].device);\nelement = funpermaproxy.callable(() => this[symbols.worker].element);\n```\n\n### 2. Worker (`src/DetoxWorker.js`)\n\nEach test worker creates a `DetoxWorker` instance that:\n\n- Connects to the Detox server via `Client`\n- Creates the `InvocationManager` for command serialization\n- Instantiates the `RuntimeDevice` via environment factories\n- Creates matchers (`by`, `element`, `expect`, `waitFor`)\n- Manages the `ArtifactsManager`\n\n**Lifecycle hooks:**\n\n- `onRunDescribeStart` / `onRunDescribeFinish`\n- `onTestStart` / `onTestDone`\n- `onHookFailure` / `onTestFnFailure`\n\n### 3. Client-Server Communication (`src/client/`, `src/server/`)\n\nSee [docs/architecture/client-server.md](docs/architecture/client-server.md) for details.\n\n**Key components:**\n\n- `Client` - WebSocket client connecting to server, sends actions to app\n- `AsyncWebSocket` - Promise-based WebSocket wrapper\n- `DetoxServer` - WebSocket server mediating tester ↔ app communication\n- `DetoxSession` / `DetoxSessionManager` - Per-session state management\n\n### 4. Device Management (`src/devices/`)\n\nSee [docs/architecture/devices.md](docs/architecture/devices.md) for details.\n\n**Structure:**\n\n```text\ndevices/\n├── allocation/         # Device allocation strategies\n│   ├── DeviceAllocator.js\n│   ├── DeviceRegistry.js\n│   └── drivers/\n│       ├── ios/        # SimulatorAllocDriver\n│       └── android/    # Emulator, Attached, Genycloud\n├── runtime/            # Runtime device abstractions\n│   ├── RuntimeDevice.js\n│   └── drivers/\n│       ├── ios/        # IosDriver, SimulatorDriver\n│       └── android/    # EmulatorDriver, AttachedAndroidDriver, GenyCloudDriver\n├── cookies/            # Device state serialization\n└── validation/         # Environment validators\n```\n\n### 5. Artifacts (`src/artifacts/`)\n\nSee [docs/architecture/artifacts.md](docs/architecture/artifacts.md) for details.\n\n**Plugins:**\n\n- `screenshot` - Captures screenshots on failure or on-demand\n- `video` - Records test execution video\n- `log` - Aggregates device and app logs\n- `instruments` - iOS performance profiling\n- `uiHierarchy` - Dumps view hierarchy for debugging (iOS only)\n\n### 6. Invocation System (`src/invoke.js`, `src/client/actions/`)\n\nCommands are serialized as JSON and sent to the native app:\n\n```javascript\n// Test code\nawait element(by.id('button')).tap();\n\n// Serialized to invocation\n{\n  type: 'invoke',\n  params: {\n    target: { type: 'Class', value: 'com.wix.detox.Detox' },\n    method: 'perform',\n    args: [{ /* matcher */ }, { /* action */ }]\n  }\n}\n```\n\nThe `InvocationManager` handles serialization/deserialization and batching.\n\n### 7. Matchers & Expectations (`src/ios/`, `src/android/`)\n\nPlatform-specific implementations:\n\n| Component | iOS | Android |\n|-----------|-----|---------|\n| Matchers | `src/matchers/` | `src/android/matchers/` |\n| Actions | `src/ios/` | `src/android/actions/` |\n| Expectations | `src/ios/expectTwo.js` | `src/android/AndroidExpect.js` |\n\nNote: Shared matcher factory logic is in `src/matchers/`. iOS-specific expectations and test runner code are in `src/ios/`.\n\n### 8. Test Runner Integration (`runners/`)\n\n```text\nrunners/\n├── jest/\n│   ├── testEnvironment/   # Jest environment setup\n│   ├── reporters/         # Custom reporters\n│   ├── globalSetup.js\n│   └── globalTeardown.js\n├── jest-circus/           # Circus event handling\n└── mocha/                 # Mocha adapter\n```\n\n## Data Flow\n\n### Test Execution Flow\n\n```text\n1. Jest runs test file\n         │\n         ▼\n2. DetoxEnvironment.setup()\n   └── detox.init()\n         │\n         ▼\n3. DetoxPrimaryContext initializes\n   ├── Starts DetoxServer\n   ├── Allocates device\n   └── Installs worker\n         │\n         ▼\n4. DetoxWorker.init()\n   ├── Connects Client to server\n   ├── Creates RuntimeDevice\n   ├── Creates matchers\n   └── Installs app (if configured)\n         │\n         ▼\n5. Test executes\n   ├── element(by.id('x')).tap()\n   │     └── Client.execute(invocation)\n   │           └── Server relays to app\n   │                 └── App executes action\n   │                       └── App responds\n   │                             └── Client resolves\n   └── expect(element).toBeVisible()\n         │\n         ▼\n6. DetoxEnvironment.teardown()\n   └── detox.cleanup()\n         │\n         ▼\n7. Artifacts collected, device deallocated\n```\n\n### Synchronization Flow\n\n```text\nTest sends action\n       │\n       ▼\nNative client receives\n       │\n       ▼\nSynchronizer checks app state:\n├── Pending network requests?\n├── Main thread busy?\n├── Animations running?\n├── React Native bridge busy?\n└── JavaScript thread idle?\n       │\n       ▼\nWhen idle: Execute action\n       │\n       ▼\nReturn result to test\n```\n\n## Key Design Patterns\n\n### 1. Symbol-Based Privacy\n\nInternal members use Symbols to prevent accidental access:\n\n```javascript\nconst $worker = Symbol('worker');\nclass DetoxContext {\n  [$worker] = null;\n}\n```\n\n### 2. Factory Pattern\n\nEnvironment-specific factories create platform-appropriate instances:\n\n```javascript\nconst factories = environmentFactory.createFactories(deviceConfig);\n// Returns: envValidatorFactory, artifactsManagerFactory,\n//          matchersFactory, runtimeDeviceFactory\n```\n\n### 3. Cancellable Async Flow (CAF)\n\nLong-running operations use CAF for cancellation:\n\n```javascript\nthis._reinstallAppsOnDevice = CAF(this._reinstallAppsOnDevice.bind(this));\n// Can be cancelled via: this._initToken.abort('CLEANUP')\n```\n\n### 4. Event-Driven Architecture\n\n`ArtifactsManager` and `RuntimeDevice` use event emitters for loose coupling:\n\n```javascript\ndeviceEmitter.on('bootDevice', this.onBootDevice.bind(this));\ndeviceEmitter.on('launchApp', this.onLaunchApp.bind(this));\n```\n\n## Configuration\n\nConfiguration flows through composition:\n\n```text\n.detoxrc.js / detox.config.js\n           │\n           ▼\nloadExternalConfig()\n           │\n           ▼\nCLI arguments (--configuration, --device-name, etc.)\n           │\n           ▼\ncomposeDetoxConfig()\n├── composeAppsConfig()\n├── composeDeviceConfig()\n├── composeArtifactsConfig()\n├── composeBehaviorConfig()\n└── composeSessionConfig()\n           │\n           ▼\nRuntimeConfig\n```\n\n## Directory Structure\n\n```text\ndetox/\n├── src/\n│   ├── realms/          # Context management\n│   ├── client/          # WebSocket client\n│   ├── server/          # WebSocket server\n│   ├── devices/         # Device management\n│   ├── artifacts/       # Artifact collection\n│   ├── configuration/   # Config composition\n│   ├── ios/             # iOS-specific code\n│   ├── android/         # Android-specific code\n│   ├── matchers/        # Matcher factories\n│   ├── invoke.js        # Invocation manager\n│   └── DetoxWorker.js   # Per-test worker\n├── runners/             # Test runner integrations\n├── local-cli/           # CLI commands\n├── ios/                 # Native iOS SDK\n└── android/             # Native Android SDK\n```\n\n## See Also\n\n- [docs/architecture/client-server.md](docs/architecture/client-server.md) - Client-server protocol details\n- [docs/architecture/devices.md](docs/architecture/devices.md) - Device management internals\n- [docs/architecture/artifacts.md](docs/architecture/artifacts.md) - Artifact collection system\n- [docs/articles/how-detox-works.md](docs/articles/how-detox-works.md) - User-facing explanation\n- [docs/articles/design-principles.md](docs/articles/design-principles.md) - Design philosophy\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Detox\n\n'So thrilled to know you want to contribute to Detox! 💙\n\nPlease refer to our [contribution guide!](https://wix.github.io/Detox/docs/contributing).\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) Wix.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-heading\": 0 } -->\n\n[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://stand-with-ukraine.pp.ua)\n\n<p align=\"center\">\n  <img alt=\"Detox\" width=380 src=\"https://raw.githubusercontent.com/wix/Detox/master/docs/img/DetoxLogo.png\"/>\n</p>\n<h1 align=\"center\">\n  Detox\n</h1>\n<p align=\"center\">\n<b>Gray box end-to-end testing and automation framework for mobile apps.</b>\n</p>\n<p align=\"center\">\n<img alt=\"Demo\" src=\"docs/img/Detox.gif\"/>\n</p>\n<h1></h1>\n\n<img src=\"https://user-images.githubusercontent.com/1962469/89655670-1c235c80-d8d3-11ea-9320-0f865767ef5d.png\" alt=\"\" height=24 width=1> [![NPM Version](https://img.shields.io/npm/v/detox.svg?style=flat)](https://www.npmjs.com/package/detox) [![NPM Downloads](https://img.shields.io/npm/dm/detox.svg?style=flat)](https://www.npmjs.com/package/detox) [![Build status](https://badge.buildkite.com/39afde30a964a6763de9753762bc80264ba141e1c1f41fc878.svg)](https://buildkite.com/wix-mobile-oss/detox) [![Coverage Status](https://coveralls.io/repos/github/wix/Detox/badge.svg?branch=master)](https://coveralls.io/github/wix/Detox?branch=master) [![Detox is released under the MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![PR's welcome!](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://wix.github.io/Detox/docs/contributing) [![Discord](https://img.shields.io/discord/957617863550697482?color=%235865F2\\&label=discord)](https://discord.gg/CkD5QKheF5) [![Twitter Follow](https://img.shields.io/twitter/follow/detoxe2e?label=Follow\\&style=social)](https://twitter.com/detoxe2e)\n\n## What Does a Detox Test Look Like?\n\nThis is a test for a login screen, it runs on a device/simulator like an actual user:\n\n```js\ndescribe('Login flow', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should login successfully', async () => {\n    await element(by.id('email')).typeText('john@example.com');\n    await element(by.id('password')).typeText('123456');\n\n    const loginButton = element(by.text('Login'));\n    await loginButton.tap();\n\n    await expect(loginButton).not.toExist();\n    await expect(element(by.label('Welcome'))).toBeVisible();\n  });\n});\n```\n\n[Get started with Detox now!](https://wix.github.io/Detox/docs/introduction/getting-started)\n\n## About\n\nHigh velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it’s running in a real device/simulator, interacting with it just like a real user.\n\nThe most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. That’s where Detox comes into play.\n\n- **Cross Platform:** Write end-to-end tests in JavaScript for React Native apps (Android & iOS).\n- **Debuggable:** Modern async-await API allows breakpoints in asynchronous tests to work as expected.\n- **Automatically Synchronized:** Stops flakiness at the core by monitoring asynchronous operations in your app.\n- **Made For CI:** Execute your E2E tests on CI platforms like Travis CI, Circle CI or Jenkins without grief.\n- **Runs on Devices:** Gain confidence to ship by testing your app on a device/simulator just like a real user (not yet supported on iOS).\n- **Test Runner Agnostic:** Detox provides a set of APIs to use with any test runner without it. It comes with [Jest](https://jestjs.io) integration out of the box.\n\n## Supported React Native Versions\n\nDetox was built from the ground up to support React Native projects.\n\nWhile Detox should work out of the box with any React Native version of the latest minor releases,\nthe _official_ versions compatibility is provided according to the following:\n\n- **RN `v0.77.x` - `v0.83.x`:** Fully compatible with React Native's [\"New Architecture\"](https://reactnative.dev/docs/the-new-architecture/landing-page).\n  Newer RN versions might work with Detox, but they've not been thoroughly tested by the Detox team yet.\n\nAlthough we do not officially support older React Native versions, we do our best to keep Detox compatible with them.\n\n> In case of a problem with an unsupported version of React Native, please [submit an issue](https://github.com/wix/Detox/issues/new/choose) or write us in our [Discord server](https://discord.gg/CkD5QKheF5) and we will do our best to help out.\n\n### Known Issues with React Native\n\n- Visibility edge-case on Android: see this [RN issue](https://github.com/facebook/react-native/issues/23870).\n\n## Get Started with Detox\n\nRead the [Getting Started Guide](https://wix.github.io/Detox/docs/introduction/getting-started) to get Detox running on your app in less than 10 minutes.\n\n## Documents Site\n\nExplore further about using Detox from our new **[website](https://wix.github.io/Detox/)**.\n\n## Core Principles\n\nWe believe that the only way to address the core difficulties with mobile end-to-end testing is by rethinking some of the principles of the entire approach. See what Detox [does differently](https://wix.github.io/Detox/docs/articles/design-principles).\n\n## Contributing to Detox\n\nDetox has been open-source from the first commit. If you’re interested in helping out with our roadmap, please see issues tagged with the [<img src=\"docs/img/github-label-contributors.png\">](https://github.com/wix/Detox/labels/user%3A%20looking%20for%20contributors) label. If you have encountered a bug or would like to suggest a new feature, please open an issue.\n\nDive into Detox core by reading the [Detox Contribution Guide](https://wix.github.io/Detox/docs/contributing).\n\n## License\n\n- Detox is licensed under the [MIT License](LICENSE)\n\n## Non-English Resources (Community)\n\n- [Getting Started (Brazilian Portuguese)](https://medium.com/quia-digital/iniciando-com-detox-framework-1-4-ce31ad7ae812)\n"
  },
  {
    "path": "detox/.eslintignore",
    "content": "*.d.ts\n/src/android/espressoapi/**/*.js\n/coverage\n/ios\n/android\n/test\n/allure-*\n/artifacts\n"
  },
  {
    "path": "detox/.eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  extends: [\n    'eslint:recommended',\n    'plugin:import/recommended',\n    'plugin:node/recommended',\n    'plugin:ecmascript-compat/recommended',\n  ],\n  parser: '@typescript-eslint/parser',\n  plugins: [\n    'unicorn',\n    'import',\n    'node',\n    '@typescript-eslint/eslint-plugin',\n  ],\n  env: {\n    node: true\n  },\n  rules: {\n    '@typescript-eslint/no-unused-vars': [\n      'warn',\n      { argsIgnorePattern: '^_' },\n    ],\n    'array-bracket-spacing': [\n      'error',\n      'never'\n    ],\n    'computed-property-spacing': [\n      'error',\n      'never'\n    ],\n    'import/order': [\n      'error',\n      {\n        'alphabetize': {\n          'order': 'asc'\n        },\n        'newlines-between': 'always'\n      }\n    ],\n    'no-case-declarations': 'off',\n    'no-debugger': 'error',\n    'no-empty': 'off',\n    'no-mixed-spaces-and-tabs': 'error',\n    'no-multiple-empty-lines': [\n      'error',\n      {\n        'max': 2,\n        'maxBOF': 1\n      }\n    ],\n    'no-prototype-builtins': 'off',\n    'no-unused-vars': 'off',\n    'node/no-unpublished-require': 'warn',\n    'object-curly-spacing': [\n      'error',\n      'always'\n    ],\n    'semi': [\n      'error',\n      'always'\n    ],\n    'quotes': ['error', 'single', {\n      'avoidEscape': true,\n      'allowTemplateLiterals': true\n    }],\n    'unicorn/expiring-todo-comments': ['warn',\n      {\n        allowWarningComments: false,\n      }\n    ],\n  },\n\n  overrides: [\n    {\n      files: ['*.test.{js,ts}', '**/{__mocks__,__tests__}/*.{js, ts}'],\n      plugins: [\n        'no-only-tests',\n      ],\n      env: {\n        jest: true\n      },\n      rules: {\n        'no-only-tests/no-only-tests': 'error',\n      }\n    }\n  ]\n};\n"
  },
  {
    "path": "detox/.gitignore",
    "content": "Detox.framework\nDetox.framework.tar\ndetox-*.aar\n\nlib\n\n############\n# Node\n############\n# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules\njspm_packages\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n\n################\n# JetBrains\n################\n.idea\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n\n############\n# iOS\n############\n# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build generated\nios/build/\nios/DerivedData/\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nios/xcuserdata/\n\n## Other\n*.moved-aside\n*.xcuserstate\n\n## Obj-C/Swift specific\n*.hmap\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\nios/Pods/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md\n\nfastlane/report.xml\nfastlane/screenshots\n\n\n############\n# Android\n############\n# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nandroid/bin/\nandroid/gen/\nandroid/out/\n\n# Gradle files\nandroid/.gradle/\nandroid/build/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Proguard folder generated by Eclipse\nandroid/proguard/\n\n# Log Files\n*.log\n\n# Android Studio Navigation editor temp files\nandroid/.navigation/\n\n# Android Studio captures folder\nandroid/captures/\n\n# Intellij\n*.iml\n\n\n##################\n# React-Native\n##################\n# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n\n# Android/IJ\n#\n.idea\n.gradle\nlocal.properties\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n\n# BUCK\nbuck-out/\n\\.buckd/\nandroid/app/libs\nandroid/keystores/debug.keystore\n"
  },
  {
    "path": "detox/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) Wix.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "detox/README.md",
    "content": "# Detox\n\nGraybox End-to-End Tests and Automation Library for Mobile\n\n[![NPM Version](https://img.shields.io/npm/v/detox.svg?style=flat)](https://www.npmjs.com/package/detox)\n[![Build Status](https://img.shields.io/jenkins/s/http/jenkins-oss.wixpress.com:8080/job/multi-detox-master.svg)](https://jenkins-oss.wixpress.com/job/multi-detox-master/)\n[![NPM Downloads](https://img.shields.io/npm/dm/detox.svg?style=flat)](https://www.npmjs.com/package/detox)\n\nFor more information [Read The Docs](https://wix.github.io/Detox/docs).\n"
  },
  {
    "path": "detox/__tests__/helpers.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\nconst yargs = require('yargs');\n\nconst tempfile = require('../src/utils/tempfile');\n\nfunction callCli(modulePath, cmd) {\n  return new Promise((resolve, reject) => {\n    const originalModule = require(path.join(__dirname, '../local-cli', modulePath));\n    const originalHandler = originalModule.handler;\n    const spiedModule = {\n      ...originalModule,\n      handler: async program => {\n        try {\n          return await originalHandler(program);\n        } catch (e) {\n          reject(e);\n        } finally {\n          resolve();\n        }\n      }\n    };\n\n    return yargs\n      .scriptName('detox')\n      .parserConfiguration({\n        'boolean-negation': true,\n        'camel-case-expansion': false,\n        'dot-notation': false,\n        'duplicate-arguments-array': false,\n        'populate--': true,\n      })\n      .command(spiedModule)\n      .wrap(null)\n      .exitProcess(false)\n      .fail((msg, err) => reject(err || msg))\n      .parse(cmd, (err) => err && reject(err));\n  });\n}\n\nfunction buildMockCommand(options = {}) {\n  if (!options.stdout) {\n    options.stdout = tempfile('.txt');\n  }\n\n  return {\n    get cmd() {\n      const env = [\n        options.exitCode ? `CLI_EXIT_CODE=${options.exitCode}` : undefined,\n        options.sleep ? `CLI_SLEEP=${options.sleep}` : undefined,\n        `CLI_TEST_STDOUT=${options.stdout}`,\n      ].filter(Boolean).join(' ');\n\n      return `cross-env ${env} node ${path.join(__dirname, '../local-cli/__mocks__/executable')}`;\n    },\n\n    options,\n\n    _calls: undefined,\n\n    get calls() {\n      if (this._calls === undefined) {\n        if (fs.existsSync(options.stdout)) {\n          this._calls = fs.readFileSync(options.stdout, 'utf8')\n            .trim()\n            .split('\\n')\n            .map(c => JSON.parse(c));\n        } else {\n          this._calls = [];\n        }\n      }\n\n      return this._calls;\n    },\n\n    async clean() {\n      await fs.remove(options.stdout);\n    },\n  };\n}\n\nexports.buildMockCommand = buildMockCommand;\nexports.callCli = callCli;\nexports.latestInstanceOf = (clazz) => _.last(clazz.mock.instances);\nexports.lastCallTo = (mocked) => _.last(mocked.mock.calls);\nexports.backupProcessEnv = () => {\n  /** @type {NodeJS.ProcessEnv} */\n  let environmentCopy;\n  beforeEach(() => environmentCopy = process.env);\n  afterEach(() => process.env = { ...environmentCopy });\n};\n\n"
  },
  {
    "path": "detox/__tests__/setupJest.js",
    "content": "jest.mock('proper-lockfile');\njest.mock('signal-exit', () => jest.fn(() => () => {}));\njest.mock('../src/logger/DetoxLogger');\n"
  },
  {
    "path": "detox/android/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "detox/android/build.gradle",
    "content": "buildscript {\n    apply from: './rninfo.gradle'\n\n    ext {\n        isOfficialDetoxLib = true\n        kotlinVersion = '2.0.21'\n        dokkaVersion = '1.9.10'\n        buildToolsVersion = '35.0.0'\n        compileSdkVersion = 35\n        targetSdkVersion = 35\n        minSdkVersion = 24\n    }\n    ext.detoxKotlinVersion = ext.kotlinVersion\n\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        if (!rnInfo.isRN71OrNewer) {\n            classpath \"com.facebook.react:react-native-gradle-plugin\"\n        }\n        classpath 'com.android.tools.build:gradle'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n        classpath \"org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion\"\n\n        // Needed by Spek (https://spekframework.org/setup-android)\n        classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        mavenLocal()\n\n        // In RN's below 71, the native code comes from within node_modules/ rather\n        // than from maven-central.\n        if (!rnInfo.isRN71OrNewer) {\n            maven {\n                url \"$projectDir/../../node_modules/react-native/android\"\n            }\n        }\n    }\n}\n\nsubprojects {\n    afterEvaluate { p ->\n        if (p.hasProperty('android')) {\n            android {\n                buildToolsVersion rootProject.ext.buildToolsVersion\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "detox/android/detox/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'kotlin-android'\napply from: '../rninfo.gradle'\n\ndef _kotlinMinVersion = '1.8.0'\ndef _materialMinVersion = '1.11.0'\n\ndef _ext = rootProject.ext\ndef _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 31\ndef _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 31\ndef _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '31.0.0'\ndef _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 21\ndef _kotlinVersion = _ext.has('detoxKotlinVersion') ? _ext.detoxKotlinVersion : _kotlinMinVersion\ndef _kotlinStdlib = _ext.has('detoxKotlinStdlib') ? _ext.detoxKotlinStdlib : 'kotlin-stdlib-jdk8'\n\n// RN native code comes from either maven-central (in which case, need the *exact* version),\n// or otherwise from node_modules/, where the version is already aligned, by definition.\n// noinspection GradleDynamicVersion\ndef _rnNativeArtifact = rnInfo.isRN71OrHigher\n        ? \"com.facebook.react:react-android:${rnInfo.version}\"\n            : 'com.facebook.react:react-native:+'\n\nprintln \"[$project] Resorted to RN native artifact $_rnNativeArtifact\"\n\nandroid {\n    def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()\n    if (agpVersion >= 7) {\n        namespace \"com.wix.detox\"\n    }\n    compileSdk _compileSdkVersion\n    buildToolsVersion = _buildToolsVersion\n\n    defaultConfig {\n        minSdkVersion _minSdkVersion\n        targetSdkVersion _targetSdkVersion\n        versionCode 1\n        versionName '1.0'\n\n        consumerProguardFiles 'proguard-rules.pro'\n    }\n\n    flavorDimensions = ['detox']\n    productFlavors {\n        full {\n            dimension 'detox'\n        }\n        coreNative {\n            dimension 'detox'\n        }\n    }\n\n    testOptions {\n        unitTests.includeAndroidResources = true\n        unitTests.returnDefaultValues = true\n        unitTests.all { t ->\n            reports {\n                html.required = true\n            }\n            testLogging {\n                events \"passed\", \"skipped\", \"failed\", \"standardOut\", \"standardError\"\n            }\n            afterSuite { desc, result ->\n                if (!desc.parent) { // will match the outermost suite\n                    def output = \"      ${result.resultType} (${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)     \"\n                    def repeatLength = output.length()\n                    println '\\n' + ('-' * repeatLength) + '\\n' + output + '\\n' + ('-' * repeatLength) + '\\n'\n\n                    println \"see report at file://${t.reports.html.outputLocation}/index.html\"\n                }\n            }\n        }\n    }\n\n    packagingOptions {\n        exclude 'META-INF/DEPENDENCIES'\n        exclude 'META-INF/NOTICE'\n        exclude 'META-INF/LICENSE'\n        exclude 'META-INF/LICENSE.txt'\n        exclude 'META-INF/NOTICE.txt'\n    }\n\n    lintOptions {\n        abortOnError false\n    }\n\n    if (rnInfo.isRN72OrHigher) {\n        compileOptions {\n            sourceCompatibility JavaVersion.VERSION_17\n            targetCompatibility JavaVersion.VERSION_17\n        }\n\n        kotlinOptions {\n            jvmTarget = '17'\n        }\n    } else {\n        compileOptions {\n            sourceCompatibility JavaVersion.VERSION_11\n            targetCompatibility JavaVersion.VERSION_11\n        }\n\n        kotlinOptions {\n            jvmTarget = '11'\n        }\n    }\n}\n\n// In a nutshell:\n// \"The api configuration should be used to declare dependencies which are exported by the library API, whereas the\n//  implementation configuration should be used to declare dependencies which are internal to the component.\"\n// --> https://docs.gradle.org/5.5/userguide/java_library_plugin.html\n\n// Fundamental deps.\ndependencies {\n    api \"org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion\"\n\n    compileOnly \"${_rnNativeArtifact}\"\n}\n\n// androidx.test deps.\n// All are aligned with this release: https://developer.android.com/jetpack/androidx/releases/test#1.4.0\ndependencies {\n\n    // Versions are in-sync with the 'androidx-test-1.4.0' release/tag of the android-test github repo,\n    // used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.4.0\n    // Important: Should remain so when generator tag is replaced!\n    api('androidx.test.espresso:espresso-core:3.7.0') {\n        because 'Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests.'\n    }\n    api('androidx.test.espresso:espresso-web:3.7.0') {\n        because 'Web-View testing'\n    }\n    api('androidx.test.espresso:espresso-contrib:3.7.0') {\n        because 'Android datepicker support'\n        exclude group: \"org.checkerframework\", module: \"checker\"\n    }\n    api('org.hamcrest:hamcrest:2.2') {\n        because 'See https://github.com/wix/Detox/issues/3920. Need to force hamcrest 2.2 win in battle of 2.2 vs. 1.3 (specified by Espresso).'\n    }\n    api('androidx.test:rules:1.7.0') {\n        because 'of ActivityTestRule. Needed by users *and* internally used by Detox.'\n    }\n    api('androidx.test.ext:junit:1.3.0') {\n        because 'Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.'\n    }\n    // Version is the latest; Cannot sync with the Github repo (e.g. android/android-test) because the androidx\n    // packaging version of associated classes is simply not there...\n    api('androidx.test.uiautomator:uiautomator:2.3.0') {\n        because 'Needed by Detox but also makes UIAutomator seamlessly provided to Detox users with hybrid apps/E2E-tests.'\n    }\n    api('androidx.test:core-ktx:1.7.0') {\n        because 'Needed by Detox but also makes AndroidX test core seamlessly provided to Detox users with hybrid apps/E2E-tests.'\n    }\n    implementation(\"org.jetbrains.kotlin:kotlin-reflect:$_kotlinVersion\") {\n        because('Needed by Detox for kotlin reflection')\n    }\n}\n\n// Third-party/extension deps.\ndependencies {\n    implementation('org.apache.commons:commons-lang3:3.7') {\n        because 'Needed by invoke. Warning: Upgrading to newer versions is not seamless.'\n    }\n    implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'\n\n    implementation fileTree(dir: '../libs', includes: ['*.jar']) // Includes: Genymotion SDK\n}\n\n// Unit-testing deps.\ndependencies {\n    testImplementation \"${_rnNativeArtifact}\"\n    testImplementation 'org.json:json:20230227'\n\n// https://github.com/spekframework/spek/issues/232#issuecomment-610732158\n    testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.2'\n\n    testImplementation 'org.assertj:assertj-core:3.16.1'\n    testImplementation \"org.jetbrains.kotlin:kotlin-test:$_kotlinVersion\"\n    testImplementation 'org.apache.commons:commons-io:1.3.2'\n    testImplementation 'org.mockito.kotlin:mockito-kotlin:5.2.1'\n    testImplementation 'org.robolectric:robolectric:4.11.1'\n\n    testImplementation(\"com.google.android.material:material:$_materialMinVersion\") {\n        because 'Material components are mentioned explicitly (e.g. Slider in get-attributes handler)'\n    }\n}\n\n// Spek (https://spekframework.org/setup-android)\nif (rootProject.hasProperty('isOfficialDetoxLib') ||\n    rootProject.hasProperty('isOfficialDetoxApp')) {\n\n    apply plugin: 'de.mannodermaus.android-junit5'\n\n    android {\n        testOptions {\n            junitPlatform {\n                filters {\n                    engines {\n                        include 'spek2', 'junit-vintage'\n                    }\n                }\n            }\n        }\n    }\n\n    dependencies {\n        testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.15'\n        testImplementation 'org.spekframework.spek2:spek-runner-junit5:2.0.15'\n    }\n}\n\n// Enable publishing\nif (rootProject.hasProperty('isOfficialDetoxLib')) {\n    apply from: './publishing.gradle'\n}\n\n"
  },
  {
    "path": "detox/android/detox/proguard-rules-app.pro",
    "content": "-keepattributes InnerClasses, Exceptions\n\n-keep class com.facebook.react.fabric.FabricUIManager { *; }\n-keep class com.facebook.react.fabric.mounting.MountItemDispatcher { *; }\n-keep class com.facebook.react.modules.** { *; }\n-keep class com.facebook.react.uimanager.** { *; }\n-keep class com.facebook.react.animated.** { *; }\n-keep class com.facebook.react.ReactApplication { *; }\n-keep class com.facebook.react.ReactNativeHost { *; }\n-keep class com.facebook.react.ReactHost { *; }\n-keep class com.facebook.react.runtime.ReactHostImpl { *; }\n-keep class com.facebook.react.runtime.BridgelessReactContext { *; }\n-keep class com.facebook.react.runtime.ReactInstance { *; }\n-keep class com.facebook.react.modules.core.JavaTimerManager { *; }\n-keep class com.facebook.react.defaults.DefaultNewArchitectureEntryPoint { *; }\n\n-keep class com.facebook.react.ReactInstanceManager { *; }\n-keep class com.facebook.react.ReactInstanceManager** { *; }\n-keep class com.facebook.react.ReactInstanceEventListener { *; }\n-keep class com.facebook.react.soloader.OpenSourceMergedSoMapping { *; }\n-keep class com.facebook.soloader.SoLoader { *; }\n-keep class com.facebook.soloader.ExternalSoMapping { *; }\n\n-keep class com.facebook.react.views.slider.** { *; }\n-keep class com.google.android.material.slider.** { *; }\n-keep class com.reactnativecommunity.slider.** { *; }\n-keep class com.reactnativecommunity.asyncstorage.** { *; }\n\n-keep class kotlin.reflect.** { *; }\n-keep class kotlin.KotlinVersion { *; }\n-keep class kotlin.sequences.** { *; }\n-keep class kotlin.Triple { *; }\n-keep class kotlin.properties.** { *; }\n-keep class kotlin.coroutines.CoroutineDispatcher { *; }\n-keep class kotlin.coroutines.CoroutineScope { *; }\n-keep class kotlin.coroutines.CoroutineContext { *; }\n-keep class kotlinx.coroutines.BuildersKt { *; }\n-keep class kotlin.jvm.** { *; }\n-keep class kotlin.collections.** { *; }\n-keep class kotlin.text.** { *; }\n-keep class kotlin.io.** { *; }\n-keep class okhttp3.** { *; }\n-keep class kotlin.LazyKt { *; }\n\n-keep class androidx.concurrent.futures.** { *; }\n-keep class androidx.tracing.** { *; }\n\n-dontwarn androidx.appcompat.**\n-dontwarn javax.lang.model.element.**\n\n"
  },
  {
    "path": "detox/android/detox/proguard-rules.pro",
    "content": "-dontwarn org.xmlpull.**\n-dontwarn sun.misc.**\n\n-dontnote android.**\n-dontnote androidx.**\n-dontnote java.**\n-dontnote javax.**\n-dontnote kotlin.**\n-dontnote org.apache.**\n-dontnote junit.**\n-dontnote org.junit.**\n-dontnote org.joor.**\n-dontnote org.hamcrest.**\n-dontnote com.facebook.**\n\n-keep class org.apache.commons.lang3.** { *; }\n-keep class org.apache.commons.io.** { *; }\n\n# Detox profiler (optional)\n\n-keep class com.wix.detoxprofiler.** { *; }\n-dontnote  com.wix.detox.instruments.reflected.**\n\n-dontwarn androidx.appcompat.**\n-dontwarn javax.lang.model.element.**\n"
  },
  {
    "path": "detox/android/detox/publish-pom.gradle",
    "content": "// Based on https://stackoverflow.com/a/42160584/453052\n\nproject.ext.buildPomXmlDependencies = { pom, configurations ->\n    pom.withXml {\n        final rootNode = asNode().appendNode('dependencies')\n        addConfigurationDependencies(rootNode, configurations.api, 'compile')\n        addConfigurationDependencies(rootNode, configurations.implementation, 'runtime')\n\n        // Legacy syntax\n        if (configurations.hasProperty('compile')) {\n            addConfigurationDependencies(rootNode, configurations.compile, 'compile')\n        }\n    }\n}\n\nprivate static def addConfigurationDependencies(rootNode, Configuration configuration, String scope) {\n    configuration.dependencies.each { dep -> addChildDependency(rootNode, dep, scope) }\n}\n\nprivate static def addChildDependency(rootNode, Dependency dep, String scope) {\n    if (dep.group == null || dep.version == null || dep.name == null || dep.name == \"unspecified\")\n        return\n\n    final childNode = rootNode.appendNode('dependency')\n    childNode.appendNode('groupId', dep.group)\n    childNode.appendNode('artifactId', dep.name)\n    childNode.appendNode('version', dep.version)\n    childNode.appendNode('scope', scope)\n\n    if (!dep.transitive) {\n        // If this dependency is transitive, we should force exclude all its dependencies them from the POM\n        final exclusionNode = childNode.appendNode('exclusions').appendNode('exclusion')\n        exclusionNode.appendNode('groupId', '*')\n        exclusionNode.appendNode('artifactId', '*')\n    } else if (!dep.properties.excludeRules.empty) {\n        // Otherwise add specified exclude rules\n        final exclusionNode = childNode.appendNode('exclusions').appendNode('exclusion')\n        dep.properties.excludeRules.each { ExcludeRule rule ->\n            exclusionNode.appendNode('groupId', rule.group ?: '*')\n            exclusionNode.appendNode('artifactId', rule.module ?: '*')\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/publishing.gradle",
    "content": "apply plugin: 'maven-publish'\napply plugin: 'kotlin-android'\napply plugin: 'org.jetbrains.dokka'\napply plugin: 'signing'\napply from: './publish-pom.gradle'\napply from: '../rninfo.gradle'\n\nString TARGET_LOCAL_DIR = \"$buildDir/../../../Detox-android\"\nString TARGET_MAVEN_CENTRAL_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'\n\nString PUB_FLAVOUR_FULL_DETOX = 'full'\nString PUB_FLAVOUR_DETOX_NATIVE = 'coreNative'\n\ndef DEVELOPERS = [\n    [name: 'WixMobile', email: 'mobile1@wix.com'],\n    [name: 'd4vidi', email: 'amitd@wix.com'],\n]\n\nString _versionName = System.getProperty('version')\nString _flavour = System.getProperty('buildFlavour', PUB_FLAVOUR_FULL_DETOX)\nBoolean _forceLocal = System.getProperty('forceLocal', 'false').toBoolean()\nBoolean _forceSign = System.getProperty('forceSign', 'false').toBoolean()\n\nString _mavenRepoUrl\nMap _mavenCredentials\ndef _shouldSignArtifacts = false\n\ndef _selectedVariant\n\ndef initLocalPublishing = {\n    _mavenRepoUrl = TARGET_LOCAL_DIR\n    _mavenCredentials = null\n    _shouldSignArtifacts = _forceSign\n}\n\ndef initMavenPublishing = {\n    _mavenRepoUrl = TARGET_MAVEN_CENTRAL_URL\n    _mavenCredentials = [\n            // This should come from ~/.gradle.properties\n            username: sonatypeUsername,\n            password: sonatypePassword,\n    ]\n    _shouldSignArtifacts = true\n}\n\ndef initPublishing = {\n    switch (_flavour) {\n        case PUB_FLAVOUR_FULL_DETOX:\n            initLocalPublishing()\n            break\n\n        case PUB_FLAVOUR_DETOX_NATIVE:\n            if (_forceLocal) {\n                initLocalPublishing()\n            } else {\n                initMavenPublishing()\n            }\n            break\n\n        default:\n            assertNull(_flavour, \"Don\\'t know how to publish by flavour '${_flavour}'. Try '${PUB_FLAVOUR_FULL_DETOX}' or '${PUB_FLAVOUR_DETOX_NATIVE}'.\")\n            break\n    }\n}\n\ndef onPrePublish = {\n    assertDefined(_versionName, \"Publishing: Version not specified (run 'gradle publish' with a -Dversion=1.2.3 argument)\")\n    logger.lifecycle(\"Detox publishing is now in session! 📣\\n  Version: $_versionName\\n  Target URL: ${_mavenRepoUrl}\\n  Build-variant: '${_selectedVariant.name}'\")\n}\n\ndef shouldPublishVariant = {\n    return isReleaseVariant(it) && isVariantOfProductFlavour(it, _flavour)\n}\n\ndef declareArchive = { target ->\n    project.artifacts {\n        archives target\n    }\n}\n\ninitPublishing()\n\n/*\n * Documentation JAR configuration using dokka\n * Dokka is the official javadoc equivalent that supports kotlin KDoc (see https://github.com/Kotlin/dokka)\n */\n\ntasks.named(\"dokkaJavadoc\") {\n    File dokkaDoc = new File(\"$buildDir/dokkaDoc\");\n    outputDirectory.set(dokkaDoc)\n    dokkaSourceSets {\n        named(\"main\") {\n            sourceRoots.from(android.sourceSets.main.java.srcDirs)\n            reportUndocumented.set(false)\n            skipEmptyPackages.set(true)\n            def suppressedPackages = [\"android_libs\", \"com.wix.detox.espresso.common.annot\"]\n            for (String packagePrefix : suppressedPackages) {\n                packageOptions {\n                    prefix = packagePrefix\n                    suppress = true\n                }\n            }\n        }\n    }\n}\n\n// Side note / TODO (revisit because dokka's 419 issue has been resolved, since):\n// Dokka outputs R and BuildConfig; currently, there's nothing to do about it, as issues such as\n// this on - https://github.com/Kotlin/dokka/issues/419 are still open :-/\n// We might want to revisit this in the future -- see if they've decided to export a custom classes\n// suppression config var or something.\ntask dokkaDocJar(type: Jar, dependsOn: dokkaJavadoc) {\n    from \"$buildDir/dokkaDoc\"\n    archiveClassifier.set(\"javadoc\")\n}\n\n/*\n * Sources JAR configuration\n */\n\ntask sourcesJar(type: Jar) {\n    from android.sourceSets.main.java.srcDirs\n    archiveClassifier.set(\"sources\")\n}\n\n/*\n * Signing configuration\n * https://docs.gradle.org/current/userguide/signing_plugin.html\n */\n\n// Tell signing task to sign everything current and future we set as a project archive...\nsigning {\n    required { _shouldSignArtifacts }\n    sign configurations.archives\n}\n\n/*\n * Plumbing work for actually having the publishing task work properly, if executed\n */\n\nproject.afterEvaluate {\n    project.tasks.all { Task task ->\n        android {\n            libraryVariants.all { variant ->\n                String variantName = variant.name.capitalize()\n                if (task.name == \"publishMaven${variantName}AarPublicationToMavenRepository\".toString()) {\n                    task.dependsOn \"assemble${variantName}\"\n                    task.dependsOn project.tasks.signArchives\n                    task.doFirst {\n                        onPrePublish()\n                    }\n                }\n            }\n        }\n    }\n}\n\n/*\n * Publishing configuration\n */\n\npublishing {\n    repositories {\n        maven {\n            url _mavenRepoUrl\n            if (_mavenCredentials != null) {\n                credentials {\n                    username _mavenCredentials.username\n                    password _mavenCredentials.password\n                }\n            }\n        }\n    }\n\n    publications {\n        android.libraryVariants.all { variant ->\n            if (shouldPublishVariant(variant)) {\n                _selectedVariant = variant\n\n                String variantNameCapitalized = variant.name.capitalize()\n\n                \"maven${variantNameCapitalized}Aar\"(MavenPublication) {\n                    groupId 'com.wix'\n                    if (rnInfo.isRN72OrHigher) {\n                        artifactId 'detox'\n                    } else {\n                        artifactId 'detox-legacy'\n                    }\n                    version \"$_versionName\"\n\n                    // Register built .aar as published artifact (as a file, explicitly)\n                    variant.outputs.forEach { output ->\n                        artifact output.outputFile\n\n                        // Also register as an archive-artifact, for signing (via equivalent task's output)\n                        declareArchive project.tasks[\"bundle${variantNameCapitalized}Aar\"]\n                    }\n\n                    // Register sources, javadoc as published artifacts (via equivalent tasks' output)\n                    artifact sourcesJar\n                    //artifact dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153\n\n                    // Also register source, javadoc as archive-artifacts, for signing\n                    declareArchive sourcesJar\n                    //declareArchive dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153\n\n                    // Add detox package metadata to the .pom\n                    pom {\n                        name = 'Detox'\n                        description = 'Gray box end-to-end testing and automation library for mobile apps'\n                        url = 'https://github.com/wix/Detox'\n                        packaging 'aar' // Oh so important - or apps would ignore our code!!!!!\n                        scm {\n                            connection = 'scm:git:git://github.com/wix/detox.git'\n                            developerConnection = 'scm:git:git@github.com/wix/detox.git'\n                            url = 'https://github.com/wix/detox'\n                        }\n                        licenses {\n                            license {\n                                name = 'The MIT License'\n                                url = 'https://github.com/wix/Detox/blob/master/LICENSE'\n                            }\n                        }\n                        developers {\n                            DEVELOPERS.each { d ->\n                                developer {\n                                    name = d.name\n                                    email = d.email\n                                }\n                            }\n                        }\n                    }\n\n                    // Add detox dependencies to the .pom\n                    buildPomXmlDependencies(pom, configurations)\n\n                    // Register pom.xml's signature file (pom.xml.asc) as published artifact\n                    // Note: this is done manually, instead of registering the pom as an archived artifact\n                    if (_shouldSignArtifacts) {\n                        pom.withXml {\n                            def pomFile = file(\"${project.buildDir}/generated-pom.xml\")\n                            writeTo(pomFile) // Need to force-write so as to have the signature generated over the finalized content\n\n                            def pomAscFile = signing.sign(pomFile).signatureFiles[0]\n                            artifact(pomAscFile) {\n                                classifier = null\n                                extension = 'pom.asc'\n                            }\n                        }\n                    }\n\n                    // Register all artifacts we've previously registered as signed archives (i.e. .jar.asc's, .aar.asc's) as publish-artifacts.\n                    // Note: this relies on preregistering the equivalent generator-tasks as archive artifacts inside a project.artifacts { ... } clause.\n                    if (_shouldSignArtifacts) {\n                        project.tasks.signArchives.signatureFiles.each {\n                            artifact(it) {\n                                def matcherSrcDocs = (it.file =~ /-(sources|javadoc)\\.jar\\.asc$/)\n                                def matcherAAR = (it.file =~ /\\.aar\\.asc$/)\n                                if (matcherSrcDocs.find()) {\n                                    classifier = matcherSrcDocs.group(1)\n                                    extension = 'jar.asc'\n                                } else if (matcherAAR.find()) {\n                                    classifier = null\n                                    extension = 'aar.asc'\n                                } else {\n                                    classifier = null\n                                    extension = null\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n\nprivate static def isReleaseVariant(variant) {\n    return variant.buildType.name == 'release'\n}\n\nprivate static def isVariantOfProductFlavour(variant, flavourName) {\n    return variant.productFlavors.name.find { name -> name == flavourName } != null\n}\n\nprivate static def assertDefined(target, message) {\n    if (target == null) {\n        throw new IllegalArgumentException(message)\n    }\n}\n\nprivate static def assertNull(target, message) {\n    if (target != null) {\n        throw new IllegalArgumentException(message)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/coreNative/java/com/wix/detox/actions/DetoxViewActions.kt",
    "content": "package com.wix.detox.actions\n\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.action.GeneralClickAction\nimport androidx.test.espresso.action.GeneralLocation\nimport androidx.test.espresso.action.Press\nimport androidx.test.espresso.action.ViewActions.actionWithAssertions\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport com.wix.detox.espresso.action.DetoxCustomTapper\nimport com.wix.detox.espresso.scroll.DetoxScrollAction\n\npublic object DetoxViewActions {\n    public fun tap() = multiTap(1)\n    public fun doubleTap() = multiTap(2)\n    public fun multiTap(times: Int): ViewAction =\n        actionWithAssertions(GeneralClickAction(DetoxCustomTapper(times), GeneralLocation.CENTER, Press.FINGER, 0, 0))\n\n    public fun scrollUpBy(amountInDp: Double, startOffsetPercentX: Float? = null, startOffsetPercentY: Float? = null): ViewAction =\n        actionWithAssertions(DetoxScrollAction(MOTION_DIR_UP, amountInDp, startOffsetPercentX, startOffsetPercentY))\n\n    public fun scrollDownBy(amountInDp: Double, startOffsetPercentX: Float? = null, startOffsetPercentY: Float? = null): ViewAction =\n        actionWithAssertions(DetoxScrollAction(MOTION_DIR_DOWN, amountInDp, startOffsetPercentX, startOffsetPercentY))\n\n    public fun scrollLeftBy(amountInDp: Double, startOffsetPercentX: Float? = null, startOffsetPercentY: Float? = null): ViewAction =\n        actionWithAssertions(DetoxScrollAction(MOTION_DIR_LEFT, amountInDp, startOffsetPercentX, startOffsetPercentY))\n\n    public fun scrollRightBy(amountInDp: Double, startOffsetPercentX: Float? = null, startOffsetPercentY: Float? = null): ViewAction =\n        actionWithAssertions(DetoxScrollAction(MOTION_DIR_RIGHT, amountInDp, startOffsetPercentX, startOffsetPercentY))\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/ActivityLaunchHelper.kt",
    "content": "package com.wix.detox\n\nimport android.app.Instrumentation.ActivityMonitor\nimport android.content.Context\nimport android.content.Intent\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.rule.ActivityTestRule\n\nclass ActivityLaunchHelper\n    @JvmOverloads constructor(\n        private val activityTestRule: ActivityTestRule<*>,\n        private val launchArgs: LaunchArgs = LaunchArgs(),\n        private val intentsFactory: LaunchIntentsFactory = LaunchIntentsFactory(),\n        private val notificationDataParserGen: (String) -> NotificationDataParser = { path -> NotificationDataParser(path) }\n) {\n    fun launchActivityUnderTest() {\n        val intent = extractInitialIntent()\n        activityTestRule.launchActivity(intent)\n    }\n\n    fun launchMainActivity() {\n        val activity = activityTestRule.activity\n        launchActivitySync(intentsFactory.activityLaunchIntent(activity))\n    }\n\n    fun startActivityFromUrl(url: String) {\n        launchActivitySync(intentsFactory.intentWithUrl(url, false))\n    }\n\n    fun startActivityFromNotification(dataFilePath: String) {\n        val notificationData = notificationDataParserGen(dataFilePath).toBundle()\n        val intent = intentsFactory.intentWithNotificationData(appContext, notificationData, false)\n        launchActivitySync(intent)\n    }\n\n    private fun extractInitialIntent(): Intent =\n        (if (launchArgs.hasUrlOverride()) {\n            intentsFactory.intentWithUrl(launchArgs.urlOverride, true)\n        } else if (launchArgs.hasNotificationPath()) {\n            val notificationData = notificationDataParserGen(launchArgs.notificationPath).toBundle()\n            intentsFactory.intentWithNotificationData(appContext, notificationData, true)\n        } else {\n            intentsFactory.cleanIntent()\n        }).also {\n            it.putExtra(INTENT_LAUNCH_ARGS_KEY, launchArgs.asIntentBundle())\n        }\n\n    private fun launchActivitySync(intent: Intent) {\n        // Ideally, we would just call sActivityTestRule.launchActivity(intent) and get it over with.\n        // BUT!!! as it turns out, Espresso has an issue where doing this for an activity running in the background\n        // would have Espresso set up an ActivityMonitor which will spend its time waiting for the activity to load, *without\n        // ever being released*. It will finally fail after a 45 seconds timeout.\n        // Without going into full details, it seems that activity test rules were not meant to be used this way. However,\n        // the all-new ActivityScenario implementation introduced in androidx could probably support this (e.g. by using\n        // dedicated methods such as moveToState(), which give better control over the lifecycle).\n        // In any case, this is the core reason for this issue: https://github.com/wix/Detox/issues/1125\n        // What it forces us to do, then, is this -\n        // 1. Launch the activity by \"ourselves\" from the OS (i.e. using context.startActivity()).\n        // 2. Set up an activity monitor by ourselves -- such that it would block until the activity is ready.\n        // ^ Hence the code below.\n        val activity = activityTestRule.activity\n        val activityMonitor = ActivityMonitor(activity.javaClass.name, null, true)\n        activity.startActivity(intent)\n\n        InstrumentationRegistry.getInstrumentation().run {\n            addMonitor(activityMonitor)\n            waitForMonitorWithTimeout(activityMonitor, ACTIVITY_LAUNCH_TIMEOUT)\n        }\n    }\n\n    private val appContext: Context\n        get() = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext\n\n    companion object {\n        private const val INTENT_LAUNCH_ARGS_KEY = \"launchArgs\"\n        private const val ACTIVITY_LAUNCH_TIMEOUT = 10000L\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/Delegator.java",
    "content": "package com.wix.detox;\n\nimport org.joor.Reflect;\nimport org.joor.ReflectException;\n\nimport java.lang.reflect.InvocationHandler;\nimport java.lang.reflect.Method;\n\n/**\n * Created by simonracz on 29/05/2017.\n\n * <p>\n * Helper class for InvocationHandlers, which delegates equals, hashCode and toString\n * calls to Object.\n * </p>\n *\n * <p>\n * Copied from here\n * <a href=\"https://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html\">Delegator</a>\n * </p>\n */\npublic class Delegator implements InvocationHandler {\n\n    private static Method hashCodeMethod;\n    private static Method equalsMethod;\n    private static Method toStringMethod;\n    static {\n        try {\n            hashCodeMethod = Object.class.getMethod(\"hashCode\");\n            equalsMethod =\n                    Object.class.getMethod(\"equals\", new Class[] { Object.class });\n            toStringMethod = Object.class.getMethod(\"toString\");\n        } catch (NoSuchMethodException e) {\n            throw new NoSuchMethodError(e.getMessage());\n        }\n    }\n\n    private Class[] interfaces;\n    private Object[] delegates;\n\n    public Delegator(Class[] interfaces, Object[] delegates) {\n        this.interfaces = (Class[]) interfaces.clone();\n        this.delegates = (Object[]) delegates.clone();\n    }\n\n    public Object invoke(Object proxy, Method m, Object[] args)\n            throws Throwable\n    {\n        Class declaringClass = m.getDeclaringClass();\n\n        if (declaringClass == Object.class) {\n            if (m.equals(hashCodeMethod)) {\n                return proxyHashCode(proxy);\n            } else if (m.equals(equalsMethod)) {\n                return proxyEquals(proxy, args[0]);\n            } else if (m.equals(toStringMethod)) {\n                return proxyToString(proxy);\n            } else {\n                throw new InternalError(\n                        \"unexpected Object method dispatched: \" + m);\n            }\n        } else {\n            for (int i = 0; i < interfaces.length; i++) {\n                if (declaringClass.isAssignableFrom(interfaces[i])) {\n                    try {\n                        return Reflect.on(delegates[i]).call(m.getName(), args).get();\n                    } catch (ReflectException e) {\n                        throw e.getCause();\n                    }\n                }\n            }\n\n            return invokeNotDelegated(proxy, m, args);\n        }\n    }\n\n    // Simple workaround for a deeply rooted issue regarding Proxy classes\n    public Object invokeAsString(String methodName) throws ReflectException {\n        return Reflect.on(delegates[0]).call(methodName).get();\n    }\n\n    // Simple workaround for a deeply rooted issue regarding Proxy classes\n    public Object invokeAsString(String methodName, Object[] args) throws ReflectException {\n        return Reflect.on(delegates[0]).call(methodName, args).get();\n    }\n\n    protected Object invokeNotDelegated(Object proxy, Method m,\n                                        Object[] args)\n            throws Throwable\n    {\n        throw new InternalError(\"unexpected method dispatched: \" + m);\n    }\n\n    protected Integer proxyHashCode(Object proxy) {\n        return System.identityHashCode(proxy);\n    }\n\n    protected Boolean proxyEquals(Object proxy, Object other) {\n        return (proxy == other ? Boolean.TRUE : Boolean.FALSE);\n    }\n\n    protected String proxyToString(Object proxy) {\n        return proxy.getClass().getName() + '@' +\n                Integer.toHexString(proxy.hashCode());\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/Detox.java",
    "content": "package com.wix.detox;\n\nimport android.content.Context;\n\nimport androidx.annotation.NonNull;\nimport androidx.test.platform.app.InstrumentationRegistry;\nimport androidx.test.rule.ActivityTestRule;\n\nimport com.wix.detox.config.DetoxConfig;\nimport com.wix.detox.espresso.hierarchy.ViewHierarchyGenerator;\n\n/**\n * <p>Static class.</p>\n *\n * <p>To start Detox tests, call runTests() from a JUnit test.\n * This test must use AndroidJUnitRunner or a subclass of it, as Detox uses Espresso internally.\n * All non-standard async code must be wrapped in an Espresso\n * <a href=\"https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/\">IdlingResource</a>.</p>\n *\n * Example usage\n * <pre>{@code\n *@literal @runWith(AndroidJUnit4.class)\n *@literal @LargeTest\n * public class DetoxTest {\n *  @literal @Rule\n *   //The Activity that controls React Native.\n *   public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule(MainActivity.class);\n *\n *  @literal @Before\n *   public void setUpCustomEspressoIdlingResources() {\n *     // set up your own custom Espresso resources here\n *   }\n *\n *  @literal @Test\n *   public void runDetoxTests() {\n *     Detox.runTests();\n *   }\n * }}</pre>\n *\n * <p>Two required parameters are detoxServer and detoxSessionId. These\n * must be provided either by Gradle.\n * <br>\n *\n * <pre>{@code\n * android {\n *   defaultConfig {\n *     testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n *     testInstrumentationRunnerArguments = [\n *       'detoxServer': 'ws://10.0.2.2:8001',\n *       'detoxSessionId': '1'\n *     ]\n *   }\n * }}\n * </pre>\n *\n * Or through command line, e.g <br>\n * <blockquote>{@code adb shell am instrument -w -e detoxServer ws://localhost:8001 -e detoxSessionId\n * 1 com.example/android.support.test.runner.AndroidJUnitRunner}</blockquote></p>\n *\n * <p>These are automatically set using,\n * <blockquote>{@code detox test}</blockquote></p>\n *\n * <p>If not set, then Detox tests are no ops. So it's safe to mix it with other tests.</p>\n */\npublic final class Detox {\n    private static ActivityLaunchHelper sActivityLaunchHelper;\n\n    private Detox() {\n    }\n\n    /**\n     * <p>\n     * Call this method from a JUnit test to invoke detox tests.\n     * </p>\n     *\n     * <p>\n     * In case you have a non-standard React Native application, consider using\n     * {@link #runTests(ActivityTestRule, Context)}}.\n     * </p>\n     *\n     * @param activityTestRule the activityTestRule\n     */\n    public static void runTests(ActivityTestRule activityTestRule) {\n        runTests(activityTestRule, getAppContext());\n    }\n\n    /**\n     * Same as the default {@link #runTests(ActivityTestRule)} method, but allows for the explicit specification of\n     * various configurations. Note: review {@link DetoxConfig} for defaults.\n     *\n     * @param detoxConfig The configurations to apply.\n     */\n    public static void runTests(ActivityTestRule activityTestRule, DetoxConfig detoxConfig) {\n        runTests(activityTestRule, getAppContext(), detoxConfig);\n    }\n\n    /**\n     * <p>\n     * Use this method only if you have a React Native application and it\n     * doesn't implement ReactApplication; Otherwise use {@link Detox#runTests(ActivityTestRule)}.\n     * </p>\n     *\n     * <p>\n     * The only requirement is that the passed in object must have\n     * a method with the signature\n     * <blockquote>{@code ReactNativeHost getReactNativeHost();}</blockquote>\n     * </p>\n     *\n     * @param activityTestRule the activityTestRule\n     * @param context an object that has a {@code getReactNativeHost()} method\n     */\n    public static void runTests(ActivityTestRule activityTestRule, @NonNull final Context context) {\n        runTests(activityTestRule, context, new DetoxConfig());\n    }\n\n    /**\n     * Same as {@link #runTests(ActivityTestRule, Context)}, but allows for the explicit specification of\n     * various configurations. Note: review {@link DetoxConfig} for defaults.\n     *\n     * @param detoxConfig The configurations to apply.\n     */\n    public static void runTests(ActivityTestRule activityTestRule, @NonNull final Context context, DetoxConfig detoxConfig) {\n        DetoxConfig.CONFIG = detoxConfig;\n        DetoxConfig.CONFIG.apply();\n\n        sActivityLaunchHelper = new ActivityLaunchHelper(activityTestRule);\n        DetoxMain.run(context, sActivityLaunchHelper);\n    }\n\n    public static void launchMainActivity() {\n        sActivityLaunchHelper.launchMainActivity();\n    }\n\n    public static void startActivityFromUrl(String url) {\n        sActivityLaunchHelper.startActivityFromUrl(url);\n    }\n\n    public static void startActivityFromNotification(String dataFilePath) {\n        sActivityLaunchHelper.startActivityFromNotification(dataFilePath);\n    }\n\n    private static Context getAppContext() {\n        return InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();\n    }\n\n    public static String generateViewHierarchyXml(boolean shouldInjectTestIds) {\n        return ViewHierarchyGenerator.generateXml(shouldInjectTestIds);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/DetoxANRHandler.kt",
    "content": "package com.wix.detox\n\nimport android.util.Log\nimport com.github.anrwatchdog.ANRWatchDog\nimport com.wix.detox.adapters.server.OutboundServerAdapter\n\nclass DetoxANRHandler(private val outboundServerAdapter: OutboundServerAdapter) {\n    fun attach() {\n        ANRWatchDog().setReportMainThreadOnly().setANRListener {\n            val info = mapOf(\"threadDump\" to Log.getStackTraceString(it))\n            outboundServerAdapter.sendMessage(ACTION_NAME, info, MESSAGE_ID)\n        }.start()\n\n        ANRWatchDog().setANRListener {\n            Log.e(LOG_TAG, \"App nonresnponsive detection!\", it)\n        }.start()\n    }\n\n    companion object {\n        private val LOG_TAG: String = DetoxANRHandler::class.java.simpleName\n\n        private const val ACTION_NAME = \"AppNonresponsiveDetected\"\n        private const val MESSAGE_ID = -10001L\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/DetoxCrashHandler.kt",
    "content": "package com.wix.detox\n\nimport android.util.Log\nimport com.wix.detox.adapters.server.OutboundServerAdapter\n\nclass DetoxCrashHandler(private val outboundServerAdapter: OutboundServerAdapter) {\n    fun attach() {\n        Thread.setDefaultUncaughtExceptionHandler { thread, exception ->\n            Log.e(LOG_TAG, \"Crash detected!!! thread=${thread.name} (${thread.id})\", exception)\n\n            val crashInfo = mapOf(\"errorDetails\" to \"@Thread ${thread.name}(${thread.id}):\\n${Log.getStackTraceString(exception)}\\nCheck device logs for full details!\")\n            outboundServerAdapter.sendMessage(ACTION_NAME, crashInfo, MESSAGE_ID)\n        }\n    }\n\n    companion object {\n        private val LOG_TAG: String = DetoxCrashHandler::class.java.simpleName\n\n        private const val ACTION_NAME = \"AppWillTerminateWithError\"\n        private const val MESSAGE_ID = -10000L\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/DetoxJUnitRunner.java",
    "content": "package com.wix.detox;\n\nimport android.app.Application;\nimport android.os.Bundle;\nimport android.util.Log;\n\nimport androidx.test.runner.AndroidJUnitRunner;\nimport androidx.test.runner.lifecycle.ApplicationLifecycleCallback;\nimport androidx.test.runner.lifecycle.ApplicationLifecycleMonitor;\nimport androidx.test.runner.lifecycle.ApplicationLifecycleMonitorRegistry;\nimport androidx.test.runner.lifecycle.ApplicationStage;\n\nimport com.wix.detox.instruments.DetoxInstrumentsManager;\n\n\npublic class DetoxJUnitRunner extends AndroidJUnitRunner {\n    private static final String TAG = \"DetoxJUnitRunner\";\n    private DetoxInstrumentsManager instrumentsManager;\n    private ApplicationLifecycleCallback lifecycleCallback;\n\n    @Override\n    public void onCreate(final Bundle arguments) {\n        super.onCreate(arguments);\n\n        final ApplicationLifecycleMonitor monitor = ApplicationLifecycleMonitorRegistry.getInstance();\n        lifecycleCallback = new ApplicationLifecycleCallback() {\n            @Override\n            public void onApplicationLifecycleChanged(Application app, ApplicationStage stage) {\n                if (stage == ApplicationStage.PRE_ON_CREATE) {\n                    onBeforeAppOnCreate(app, arguments);\n                } else if (stage == ApplicationStage.CREATED) {\n                    onAfterAppOnCreate();\n                }\n            }\n        };\n        monitor.addLifecycleCallback(lifecycleCallback);\n    }\n\n    @Override\n    public void onDestroy() {\n        instrumentsManager.stopRecording();\n        instrumentsManager = null;\n        lifecycleCallback = null;\n\n        super.onDestroy();\n    }\n\n    private void onBeforeAppOnCreate(Application app, Bundle arguments) {\n        final String recordingPath = arguments.getString(\"detoxInstrumRecPath\");\n        if (recordingPath != null) {\n            if (DetoxInstrumentsManager.supports()) {\n                long samplingInterval = 250;\n                try {\n                    final String interval = arguments.getString(\"detoxInstrumSamplingInterval\");\n                    if (interval != null) {\n                        samplingInterval = Long.parseLong(interval);\n                    }\n                } catch (NumberFormatException ignore) {\n                    Log.w(TAG, \"Invalid value for param \\\"detoxInstrumSamplingInterval\\\", default was used\");\n                }\n\n                instrumentsManager = new DetoxInstrumentsManager(app);\n                instrumentsManager.startRecordingAtLocalPath(recordingPath, samplingInterval);\n            }\n        }\n    }\n\n    private void onAfterAppOnCreate() {\n        if (instrumentsManager != null) {\n            instrumentsManager.tryInstallJsi();\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/DetoxMain.kt",
    "content": "package com.wix.detox\n\nimport android.content.Context\nimport android.util.Log\nimport com.wix.detox.adapters.server.*\nimport com.wix.detox.common.DetoxLog\nimport com.wix.detox.espresso.UiControllerSpy\nimport com.wix.detox.espresso.DetoxFailureHandler\nimport androidx.test.espresso.Espresso\nimport com.wix.detox.instruments.DetoxInstrumentsManager\nimport com.wix.detox.reactnative.ReactNativeExtension\nimport com.wix.invoke.MethodInvocation\nimport java.util.concurrent.CountDownLatch\n\nprivate const val TERMINATION_ACTION = \"_terminate\"\n\nobject DetoxMain {\n    private val handshakeLock = CountDownLatch(1)\n\n    @JvmStatic\n    fun run(rnHostHolder: Context, activityLaunchHelper: ActivityLaunchHelper) {\n        val detoxServerInfo = DetoxServerInfo()\n        val testEngineFacade = TestEngineFacade()\n        val actionsDispatcher = DetoxActionsDispatcher()\n        val serverAdapter = DetoxServerAdapter(actionsDispatcher, detoxServerInfo, TERMINATION_ACTION)\n\n        initCrashHandler(serverAdapter)\n        initANRListener(serverAdapter)\n        initEspresso()\n        initReactNative()\n\n        setupActionHandlers(actionsDispatcher, serverAdapter, testEngineFacade, rnHostHolder)\n        serverAdapter.connect()\n\n        launchActivityOnCue(rnHostHolder, activityLaunchHelper)\n        actionsDispatcher.join()\n    }\n\n    /**\n     * Launch the tested activity \"on cue\", namely, right after a connection is established and the handshake\n     * completes successfully.\n     *\n     * This has to be synchronized so that an `isReady` isn't handled *before* the activity is launched (albeit not fully\n     * initialized - all native modules and everything) and a react context is available.\n     *\n     * As a better alternative, it would make sense to execute this as a simple action from within the actions\n     * dispatcher (i.e. handler of `loginSuccess`), in which case, no inter-thread locking would be required\n     * thanks to the usage of Handlers. However, in this type of a solution, errors / crashes would be reported\n     * not by instrumentation itself, but based on the `AppWillTerminateWithError` message; In it's own, it is a good\n     * thing, but for a reason we're not sure of yet, it is ignored by the test runner at this point in the flow.\n     */\n    private fun launchActivityOnCue(rnHostHolder: Context, activityLaunchHelper: ActivityLaunchHelper) {\n        synchronized(this) {\n            awaitHandshake()\n            launchActivity(rnHostHolder, activityLaunchHelper)\n        }\n    }\n\n    private fun awaitHandshake() {\n        handshakeLock.await()\n    }\n\n    private fun onLoginSuccess() {\n        handshakeLock.countDown()\n    }\n\n    private fun doTeardown(serverAdapter: DetoxServerAdapter, actionsDispatcher: DetoxActionsDispatcher, testEngineFacade: TestEngineFacade) {\n        testEngineFacade.resetReactNative()\n\n        serverAdapter.teardown()\n        actionsDispatcher.teardown()\n    }\n\n    private fun setupActionHandlers(actionsDispatcher: DetoxActionsDispatcher, serverAdapter: DetoxServerAdapter, testEngineFacade: TestEngineFacade, rnHostHolder: Context) {\n        class SynchronizedActionHandler(private val actionHandler: DetoxActionHandler): DetoxActionHandler {\n            override fun handle(params: String, messageId: Long) {\n                synchronized(this@DetoxMain) {\n                    actionHandler.handle(params, messageId)\n                }\n            }\n        }\n\n        // Primary actions\n        with(actionsDispatcher) {\n            val readyHandler = SynchronizedActionHandler( ReadyActionHandler(serverAdapter, testEngineFacade) )\n            val rnReloadHandler = SynchronizedActionHandler( ReactNativeReloadActionHandler(rnHostHolder, serverAdapter, testEngineFacade) )\n\n            associateActionHandler(\"loginSuccess\", ::onLoginSuccess)\n            associateActionHandler(\"isReady\", readyHandler)\n            associateActionHandler(\"reactNativeReload\", rnReloadHandler)\n            associateActionHandler(\"invoke\", InvokeActionHandler(MethodInvocation(), serverAdapter))\n            associateActionHandler(\"cleanup\", CleanupActionHandler(serverAdapter, testEngineFacade) {\n                dispatchAction(TERMINATION_ACTION, \"\", 0)\n            })\n            associateActionHandler(TERMINATION_ACTION) { -> doTeardown(serverAdapter, actionsDispatcher, testEngineFacade) }\n\n            if (DetoxInstrumentsManager.supports()) {\n                val instrumentsManager = DetoxInstrumentsManager(rnHostHolder)\n                associateActionHandler(\"setRecordingState\", InstrumentsRecordingStateActionHandler(instrumentsManager, serverAdapter))\n                associateActionHandler(\"event\", InstrumentsEventsActionsHandler(instrumentsManager, serverAdapter))\n            }\n        }\n\n        // Secondary actions\n        with(actionsDispatcher) {\n            val queryStatusHandler = SynchronizedActionHandler( QueryStatusActionHandler(serverAdapter, testEngineFacade) )\n            associateSecondaryActionHandler(\"currentStatus\", queryStatusHandler)\n        }\n    }\n\n    private fun initCrashHandler(outboundServerAdapter: OutboundServerAdapter) {\n        DetoxCrashHandler(outboundServerAdapter).attach()\n    }\n\n    private fun initANRListener(outboundServerAdapter: OutboundServerAdapter) {\n        DetoxANRHandler(outboundServerAdapter).attach()\n    }\n\n    private fun initEspresso() {\n        UiControllerSpy.attachThroughProxy()\n\n        // Set up custom failure handler that replaces human-readable hierarchy with XML format\n        Espresso.setFailureHandler(DetoxFailureHandler())\n    }\n\n    private fun initReactNative() {\n        ReactNativeExtension.initIfNeeded()\n    }\n\n    private fun launchActivity(rnHostHolder: Context, activityLaunchHelper: ActivityLaunchHelper) {\n        Log.i(DetoxLog.LOG_TAG, \"Launching the tested activity!\")\n        activityLaunchHelper.launchActivityUnderTest()\n        ReactNativeExtension.waitForRNBootstrap(rnHostHolder)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/LaunchArgs.java",
    "content": "package com.wix.detox;\n\nimport android.os.Bundle;\nimport android.util.Base64;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport androidx.test.platform.app.InstrumentationRegistry;\n\npublic class LaunchArgs {\n    private static final String DETOX_SERVER_URL_ARG = \"detoxServer\";\n    private static final String DETOX_SESSION_ID_ARG_KEY = \"detoxSessionId\";\n    private static final String DETOX_NOTIFICATION_PATH_ARG = \"detoxUserNotificationDataURL\";\n    private static final String DETOX_BLACKLIST_URLS_ARG = \"detoxURLBlacklistRegex\";\n    private static final String DETOX_URL_OVERRIDE_ARG = \"detoxURLOverride\";\n    private static final String DETOX_ENABLE_SYNCHRONIZATION = \"detoxEnableSynchronization\";\n    private static final List<String> RESERVED_INSTRUMENTATION_ARGS = Arrays.asList(\"class\", \"package\", \"func\", \"unit\", \"size\", \"perf\", \"debug\", \"log\", \"emma\", \"coverageFile\");\n\n    public boolean hasNotificationPath() {\n        return InstrumentationRegistry.getArguments().containsKey(DETOX_NOTIFICATION_PATH_ARG);\n    }\n\n    public String getNotificationPath() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_NOTIFICATION_PATH_ARG);\n    }\n\n    public boolean hasUrlOverride() {\n        return InstrumentationRegistry.getArguments().containsKey(DETOX_URL_OVERRIDE_ARG);\n    }\n\n    public String getURLBlacklist() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_BLACKLIST_URLS_ARG);\n    }\n\n    public boolean hasURLBlacklist() {\n        return InstrumentationRegistry.getArguments().containsKey(DETOX_BLACKLIST_URLS_ARG);\n    }\n\n    public String getEnableSynchronization() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_ENABLE_SYNCHRONIZATION);\n    }\n\n    public boolean hasEnableSynchronization() {\n        return InstrumentationRegistry.getArguments().containsKey(DETOX_ENABLE_SYNCHRONIZATION);\n    }\n\n    public String getUrlOverride() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_URL_OVERRIDE_ARG);\n    }\n\n    public String getDetoxServerUrl() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_SERVER_URL_ARG);\n    }\n\n    public String getDetoxSessionId() {\n        return InstrumentationRegistry.getArguments().getString(DETOX_SESSION_ID_ARG_KEY);\n    }\n\n    public Bundle asIntentBundle() {\n        final Bundle instrumentationArgs = InstrumentationRegistry.getArguments();\n        final Bundle launchArgs = new Bundle();\n\n        for (String arg : instrumentationArgs.keySet()) {\n            if (!RESERVED_INSTRUMENTATION_ARGS.contains(arg)) {\n                launchArgs.putString(arg, decodeLaunchArgValue(arg, instrumentationArgs));\n            }\n        }\n        return launchArgs;\n    }\n\n    private String decodeLaunchArgValue(String arg, Bundle instrumArgs) {\n        final String rawValue = instrumArgs.getString(arg);\n\n        if (arg.startsWith(\"detox\")) {\n            return rawValue;\n        }\n\n        byte[] base64Value = Base64.decode(rawValue, Base64.DEFAULT);\n        return new String(base64Value);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/LaunchIntentsFactory.kt",
    "content": "package com.wix.detox\n\nimport android.app.Activity\nimport android.content.Context\nimport android.content.Intent\nimport android.net.Uri\nimport android.os.Bundle\n\nclass LaunchIntentsFactory {\n\n    /**\n     * Constructs an intent tightly associated with a specific activity.\n     *\n     * @param activity The activity to launch (typically extracted from an [androidx.test.rule.ActivityTestRule]).\n     *\n     * @return The resulting intent.\n     */\n    fun activityLaunchIntent(activity: Activity)\n        = Intent(activity.applicationContext,\n                 activity.javaClass).apply {\n            flags = coreFlags\n        }\n\n    /**\n     * Constructs a near-empty, activity-anonymous intent, assuming an ActivityTestRule instance that would handle it\n     * and fill in all the missing details. Namely, the activity class (aka component), which is taken from activityTestRule's\n     * own activityClass data member which was set in the c'tor by the user (outside of Detox).\n     *\n     * @return The resulting intent.\n     */\n    fun cleanIntent()\n        = Intent(Intent.ACTION_MAIN)\n\n    /**\n     * Constructs an activity-anonymous intent with a URL such that the resolved activity to be launched would be an activity that has\n     * been defined to match it using an intent-filter xml tag associated with an [Intent.ACTION_VIEW] action.\n     *\n     * @param url The activity-lookup URL.\n     * @param initialLaunch Whether this is done in the context of the preliminary app launch, or midway through a running test.\n     *\n     * @return The resulting intent.\n     */\n    fun intentWithUrl(url: String?, initialLaunch: Boolean)\n        = Intent(Intent.ACTION_VIEW).apply {\n            data = Uri.parse(url)\n            flags = coreFlags\n            if (initialLaunch) {\n                addFlags(initialLaunchFlags)\n            }\n        }\n\n    /**\n     * Constructs an activity-anonymous intent with extras equivalent to a given data bundle, assumed\n     * to be holding notification data.\n     *\n     * In essence, this mimics the way the FCM's default implementation handles simple *message*-ish notifications (as\n     * oppose to *data*-ish notifications) on the device, where the sender simply provides only a title, some content\n     * (body), and a flat key-value dictionary. What the FCM service does in the use case is to post a notification\n     * with a simple launcher-like intent, holding the user data in the extra's root, as originally provided.\n     * >Note: this is typically what happens only when the app is in the background/terminated; otherwise the notification\n     * is delivered to the apps' registered handlers.\n     *\n     * Obviously, to properly expose more of what Android has to offer in this context, a more customizable version of\n     * this (e.g. with more explicit intent-related configurations) should eventually be introduced as well.\n     *\n     * @param data The notification data, as a bundle.\n     * @param initialLaunch Whether this is done in the context of the preliminary app launch, or midway through a running test.\n     *\n     * @return The resulting intent.\n     */\n    fun intentWithNotificationData(appContext: Context, data: Bundle, initialLaunch: Boolean)\n        = Intent(Intent.ACTION_MAIN).apply {\n            addCategory(Intent.CATEGORY_LAUNCHER)\n            setPackage(appContext.packageName)\n            putExtras(data)\n            flags = coreFlags\n            if (initialLaunch) {\n                addFlags(initialLaunchFlags)\n            }\n        }\n\n    /**\n     * The core flags we typically set in all intents:\n     *\n     * CLEAR_TOP is important so as to avoid launching the app's main activity over an existing instance (in the same task),\n     * in case it's already running. It *would* happen without the flag, since by default ActivityTestRule instances\n     * are created so as to force the FLAG_ACTIVITY_NEW_TASK flag in the initial launch (see flags-less c'tor), which\n     * evidently causes consequent launches to create additional activity instances on top of it (although inside the same task).\n     * SINGLE_TOP here is needed as well so as to avoid the *relaunch* of the already-running activity (rather, the intent\n     * would be delivered to that activity's onNewIntent(), as explain in the docs for CLEAR_TOP).\n     */\n    private val coreFlags: Int\n        get() = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP\n\n    /**\n     * Additional flags to user to initial-launches (i.e. when launch using a test-rule):\n     *\n     * Upon initial launch (first-ever instance of the test activity), we also manually need to add the NEW_TASK flag\n     * so as to mimic the ActivityTestRule's behavior: we get NEW_TASK from it if no flags are specified; here we _do_\n     * specify flags so need to add it ourselves.\n     */\n    private val initialLaunchFlags: Int\n        get() = Intent.FLAG_ACTIVITY_NEW_TASK\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/NotificationDataParser.kt",
    "content": "package com.wix.detox\n\nimport android.os.Bundle\nimport com.wix.detox.common.JsonConverter\nimport com.wix.detox.common.TextFileReader\nimport org.json.JSONObject\n\nclass NotificationDataParser(private val notificationPath: String) {\n    fun toBundle(): Bundle {\n        val rawData = readNotificationFromFile()\n        val json = JSONObject(rawData)\n        val payload = json.getJSONObject(\"payload\")\n        return JsonConverter(payload).toBundle()\n    }\n\n    private fun readNotificationFromFile()\n            = TextFileReader(notificationPath).read()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/TestEngineFacade.kt",
    "content": "package com.wix.detox\n\nimport android.content.Context\nimport android.util.Log\nimport androidx.test.espresso.Espresso\nimport com.wix.detox.common.DetoxLog.Companion.LOG_TAG\nimport com.wix.detox.espresso.UiAutomatorHelper\nimport com.wix.detox.espresso.registry.BusyResourcesInquirer\nimport com.wix.detox.reactnative.ReactNativeExtension\n\nclass TestEngineFacade {\n    fun awaitIdle(): Unit? = Espresso.onIdle {\n        Log.i(LOG_TAG, \"Wait is over: App is now idle!\")\n        null\n    }\n    fun syncIdle() = UiAutomatorHelper.espressoSync() // TODO Check whether this can be replaced with #awaitIdle()\n    fun getAllBusyResources() = BusyResourcesInquirer.INSTANCE.getAllBusyResources()\n\n    // TODO Refactor RN related stuff away\n    fun reloadReactNative(appContext: Context) = ReactNativeExtension.reloadReactNative(appContext)\n    fun resetReactNative() = ReactNativeExtension.clearAllSynchronization()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/DetoxActionHandlers.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport android.content.Context\nimport android.util.Log\nimport com.wix.detox.TestEngineFacade\nimport com.wix.detox.common.extractRootCause\nimport com.wix.detox.espresso.errors.DetoxExceptionWithHierarchy\nimport com.wix.detox.espresso.hierarchy.ViewHierarchyGenerator\nimport com.wix.detox.instruments.DetoxInstrumentsException\nimport com.wix.detox.instruments.DetoxInstrumentsManager\nimport com.wix.invoke.MethodInvocation\nimport org.json.JSONObject\nimport java.lang.reflect.InvocationTargetException\n\nprivate const val LOG_TAG = \"DetoxActionHandlers\"\n\ninterface DetoxActionHandler {\n    fun handle(params: String, messageId: Long)\n}\n\nclass ReadyActionHandler(\n        private val outboundServerAdapter: OutboundServerAdapter,\n        private val testEngineFacade: TestEngineFacade)\n    : DetoxActionHandler {\n\n    override fun handle(params: String, messageId: Long) {\n        testEngineFacade.awaitIdle()\n        outboundServerAdapter.sendMessage(\"ready\", emptyMap(), messageId)\n    }\n}\n\nopen class ReactNativeReloadActionHandler(\n        private val appContext: Context,\n        private val outboundServerAdapter: OutboundServerAdapter,\n        private val testEngineFacade: TestEngineFacade)\n    : DetoxActionHandler {\n\n    override fun handle(params: String, messageId: Long) {\n        testEngineFacade.syncIdle()\n        testEngineFacade.reloadReactNative(appContext)\n        outboundServerAdapter.sendMessage(\"ready\", emptyMap(), messageId)\n    }\n}\n\n\nclass InvokeActionHandler @JvmOverloads constructor(\n        private val methodInvocation: MethodInvocation,\n        private val outboundServerAdapter: OutboundServerAdapter,\n        private val errorParse: (e: Throwable?) -> String = Log::getStackTraceString)\n    : DetoxActionHandler {\n\n    override fun handle(params: String, messageId: Long) {\n        try {\n            val invocationResult = methodInvocation.invoke(params)\n            outboundServerAdapter.sendMessage(\"invokeResult\", mapOf<String, Any?>(\"result\" to invocationResult), messageId)\n        } catch (e: InvocationTargetException) {\n            Log.i(LOG_TAG, \"Test exception\", e)\n            val payload = extractFailurePayload(e)\n            outboundServerAdapter.sendMessage(\"testFailed\", payload, messageId)\n        }  catch (e: Exception) {\n            Log.e(LOG_TAG, \"Exception\", e)\n            outboundServerAdapter.sendMessage(\"error\", mapOf<String, Any?>(\"error\" to \"${errorParse(e)}\\nCheck device logs for full details!\\n\"), messageId)\n        }\n    }\n\n    private fun extractFailurePayload(e: InvocationTargetException): Map<String, Any?> {\n        val error = extractRootCause(e.targetException)\n        val errorMessage = error.message ?: \"Unknown error\"\n        val viewHierarchy = if (error is DetoxExceptionWithHierarchy) {\n            error.xmlHierarchy\n        } else {\n            null\n        }\n\n        return mapOf<String, Any?>(\"details\" to \"${errorMessage}\\n\", \"viewHierarchy\" to viewHierarchy)\n    }\n}\n\nclass CleanupActionHandler(\n        private val outboundServerAdapter: OutboundServerAdapter,\n        private val testEngineFacade: TestEngineFacade,\n        private val doStopDetox: () -> Unit)\n    : DetoxActionHandler {\n    override fun handle(params: String, messageId: Long) {\n        val stopRunner = JSONObject(params).optBoolean(\"stopRunner\", false)\n        if (stopRunner) {\n            doStopDetox()\n        } else {\n            testEngineFacade.resetReactNative()\n        }\n        outboundServerAdapter.sendMessage(\"cleanupDone\", emptyMap(), messageId)\n    }\n}\n\nclass InstrumentsRecordingStateActionHandler(\n        private val instrumentsManager: DetoxInstrumentsManager,\n        private val outboundServerAdapter: OutboundServerAdapter\n) : DetoxActionHandler {\n    companion object {\n        const val DEFAULT_SAMPLING_INTERVAL = 250L\n    }\n\n    override fun handle(params: String, messageId: Long) {\n        val json = JSONObject(params)\n        val recordingPath = json.opt(\"recordingPath\")\n        if (recordingPath is String) {\n            val samplingInterval = json.optLong(\"samplingInterval\", DEFAULT_SAMPLING_INTERVAL)\n            instrumentsManager.startRecordingAtLocalPath(recordingPath, samplingInterval)\n        } else {\n            instrumentsManager.stopRecording()\n        }\n\n        outboundServerAdapter.sendMessage(\"setRecordingStateDone\", emptyMap<String, Any>(), messageId)\n    }\n}\n\nclass InstrumentsEventsActionsHandler(\n        private val instrumentsManager: DetoxInstrumentsManager,\n        private val outboundServerAdapter: OutboundServerAdapter\n) : DetoxActionHandler {\n\n    override fun handle(params: String, messageId: Long) {\n        with (JSONObject(params))  {\n            when (getString(\"action\")) {\n                \"begin\" -> {\n                    instrumentsManager.eventBeginInterval(\n                            getString(\"category\"),\n                            getString(\"name\"),\n                            getString(\"id\"),\n                            getString(\"additionalInfo\")\n                    )\n                }\n                \"end\" -> {\n                    instrumentsManager.eventEndInterval(\n                            getString(\"id\"),\n                            getString(\"status\"),\n                            getString(\"additionalInfo\")\n                    )\n                }\n                \"mark\" -> {\n                    instrumentsManager.eventMark(\n                            getString(\"category\"),\n                            getString(\"name\"),\n                            getString(\"id\"),\n                            getString(\"status\"),\n                            getString(\"additionalInfo\")\n                    )\n                }\n                else -> throw DetoxInstrumentsException(\"Invalid action\")\n            }\n        }\n        outboundServerAdapter.sendMessage(\"eventDone\", emptyMap<String, Any>(), messageId)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/DetoxActionsDispatcher.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport android.os.Handler\nimport android.os.Looper\nimport android.util.Log\nimport java.util.concurrent.CountDownLatch\n\nprivate const val LOG_TAG = \"DetoxDispatcher\"\n\nclass DetoxActionsDispatcher {\n    private val primaryExec = ActionsExecutor(\"detox.primary\")\n    private val secondaryExec = ActionsExecutor(\"detox.secondary\")\n\n    fun associateActionHandler(type: String, actionHandler: DetoxActionHandler) =\n        associateActionHandler(type, actionHandler, true)\n\n    fun associateActionHandler(type: String, handlerFunc: () -> Unit) {\n        associateActionHandler(type, object: DetoxActionHandler {\n            override fun handle(params: String, messageId: Long) = handlerFunc()\n        })\n    }\n\n    fun associateSecondaryActionHandler(type: String, actionHandler: DetoxActionHandler) =\n        associateActionHandler(type, actionHandler, false)\n\n    fun dispatchAction(type: String, params: String, messageId: Long) {\n        (primaryExec.executeAction(type, params, messageId) ||\n            secondaryExec.executeAction(type, params, messageId))\n                .let { handled ->\n                    if (!handled) Log.w(LOG_TAG, \"No handler found for action '$type'\")\n                }\n    }\n\n    fun teardown() {\n        primaryExec.teardown()\n        secondaryExec.teardown()\n    }\n\n    fun join() {\n        primaryExec.join()\n        secondaryExec.join()\n    }\n\n    private fun associateActionHandler(type: String, actionHandler: DetoxActionHandler, isPrimary: Boolean = true) {\n        val actionsExecutor = (if (isPrimary) primaryExec else secondaryExec)\n        actionsExecutor.associateHandler(type, actionHandler)\n    }\n}\n\nprivate class ActionsExecutor(name: String) {\n    private val actionHandlers = mutableMapOf<String, DetoxActionHandler>()\n    private val thread: Thread\n    private lateinit var handler: Handler\n\n    init {\n        val latch = CountDownLatch(1)\n\n        thread = Thread(Runnable {\n            Looper.prepare()\n            handler = Handler(Looper.myLooper()!!)\n            latch.countDown()\n            Looper.loop()\n        }, name)\n        thread.start()\n        latch.await()\n    }\n\n    fun associateHandler(type: String, actionHandler: DetoxActionHandler) {\n        actionHandlers[type] = actionHandler\n    }\n\n    fun executeAction(type: String, params: String, messageId: Long): Boolean {\n        actionHandlers[type]?.let {\n            handler.post {\n                Log.i(LOG_TAG, \"Handling action '$type' (ID #$messageId)...\")\n                it.handle(params, messageId)\n                Log.i(LOG_TAG, \"Done with action '$type'\")\n            }\n            return true\n        }\n        return false\n    }\n\n    fun teardown() {\n        actionHandlers.clear()\n        handler.looper.quit()\n    }\n\n    fun join() = thread.join()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/DetoxServerAdapter.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport android.util.Log\nimport com.wix.detox.common.DetoxLog\n\ninterface OutboundServerAdapter {\n    fun sendMessage(type: String, payload: Map<String, Any?>, id: Long)\n}\n\nclass DetoxServerAdapter(\n        private val actionsDispatcher: DetoxActionsDispatcher,\n        private val detoxServerInfo: DetoxServerInfo,\n        private val terminationActionType: String)\n    : WebSocketClient.WSEventsHandler, OutboundServerAdapter {\n\n    private val wsClient = WebSocketClient(this)\n\n    fun connect() {\n        Log.i(DetoxLog.LOG_TAG, \"Connecting to server...\")\n        wsClient.connectToServer(detoxServerInfo.serverUrl, detoxServerInfo.sessionId)\n    }\n\n    fun teardown() {\n        wsClient.close()\n    }\n\n    override fun onConnect() {\n        Log.i(DetoxLog.LOG_TAG, \"Connected to server!\")\n    }\n\n    override fun onClosed() {\n        Log.i(DetoxLog.LOG_TAG, \"Disconnected from server\")\n        actionsDispatcher.dispatchAction(terminationActionType, \"\", 0)\n    }\n\n    override fun onAction(type: String, params: String, messageId: Long) {\n        actionsDispatcher.dispatchAction(type, params, messageId)\n    }\n\n    override fun sendMessage(type: String, payload: Map<String, Any?>, id: Long)\n            = wsClient.sendAction(type, payload, id)\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/DetoxServerInfo.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport android.util.Log\nimport androidx.test.platform.app.InstrumentationRegistry\nimport com.wix.detox.LaunchArgs\nimport com.wix.detox.common.DetoxLog\n\nprivate const val DEFAULT_URL = \"ws://localhost:8099\"\n\nclass DetoxServerInfo internal constructor(launchArgs: LaunchArgs = LaunchArgs()) {\n    val serverUrl: String = launchArgs.detoxServerUrl ?: DEFAULT_URL\n    val sessionId: String = launchArgs.detoxSessionId ?: InstrumentationRegistry.getInstrumentation().targetContext.applicationInfo.packageName\n\n    init {\n        Log.i(DetoxLog.LOG_TAG, \"Detox server connection details: url=$serverUrl, sessionId=$sessionId\")\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/QueryStatusActionHandler.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport com.wix.detox.TestEngineFacade\nimport com.wix.detox.inquiry.DetoxBusyResource\n\nclass QueryStatusActionHandler(\n    private val outboundServerAdapter: OutboundServerAdapter,\n    private val testEngineFacade: TestEngineFacade\n) : DetoxActionHandler {\n\n    override fun handle(params: String, messageId: Long) {\n        val busyResources = testEngineFacade.getAllBusyResources()\n        val data = mapOf<String, Any?>(\n            \"status\" to formatStatus(busyResources)\n        )\n        outboundServerAdapter.sendMessage(\"currentStatusResult\", data, messageId)\n    }\n\n    private fun formatStatus(busyResources: List<DetoxBusyResource>): Map<String, Any> =\n        if (busyResources.isEmpty()) {\n            mapOf(\"app_status\" to \"idle\")\n        } else {\n            mapOf(\n                \"app_status\" to \"busy\",\n                \"busy_resources\" to busyResources.map { it.getDescription().json() }\n            )\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/adapters/server/WebSocketClient.java",
    "content": "package com.wix.detox.adapters.server;\n\nimport android.util.Log;\n\nimport com.wix.detox.common.DetoxErrors;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\n\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.WebSocket;\nimport okhttp3.WebSocketListener;\nimport okio.ByteString;\n\npublic class WebSocketClient {\n\n    private static final String LOG_TAG = \"DetoxWSClient\";\n\n    private volatile boolean closing = false;\n\n    public void close() {\n        if (closing) return;\n        closing = true;\n        websocket.close(NORMAL_CLOSURE_STATUS, null);\n    }\n\n    private String url;\n    private String sessionId;\n    private WebSocket websocket = null;\n\n    private final WSEventsHandler wsEventsHandler;\n    private final WebSocketEventsListener wsEventListener = new WebSocketEventsListener();\n\n    private static final int NORMAL_CLOSURE_STATUS = 1000;\n\n    public WebSocketClient(WSEventsHandler wsEventsHandler) {\n        this.wsEventsHandler = wsEventsHandler;\n    }\n\n    public void connectToServer(String url, String sessionId) {\n        Log.i(LOG_TAG, \"At connectToServer\");\n\n        this.url = url;\n        this.sessionId = sessionId;\n\n        final OkHttpClient client = new OkHttpClient.Builder()\n                .retryOnConnectionFailure(true)\n                .connectTimeout(1500, TimeUnit.MILLISECONDS)\n                .readTimeout(0, TimeUnit.MILLISECONDS)\n                .build();\n\n        final Request request = new Request.Builder().url(url).build();\n        this.websocket = client.newWebSocket(request, wsEventListener);\n\n        client.dispatcher().executorService().shutdown();\n    }\n\n    public void sendAction(String type, Map params, Long messageId) {\n        Log.i(LOG_TAG, \"Sending out action '\" + type + \"' (ID #\" + messageId + \")\");\n\n        final Map<String, Object> data = new HashMap<>();\n        data.put(\"type\", type);\n        data.put(\"params\", params);\n        data.put(\"messageId\", messageId);\n\n        final JSONObject json = new JSONObject(data);\n        websocket.send(json.toString());\n    }\n\n    private void receiveAction(String json) {\n        try {\n            final JSONObject object = new JSONObject(json);\n            final String type = (String) object.get(\"type\");\n            final Object params = object.get(\"params\");\n            final long messageId = object.getLong(\"messageId\");\n\n            Log.d(LOG_TAG, \"Received action '\" + type + \"' (ID #\" + messageId + \", params=\" + params + \")\");\n\n            if (wsEventsHandler != null) {\n                wsEventsHandler.onAction(type, params.toString(), messageId);\n            }\n        } catch (JSONException e) {\n            throw new DetoxErrors.DetoxIllegalArgumentException(e);\n        }\n    }\n\n    /**\n     * These methods are called on an inner worker thread.\n     * @see <a href=\"https://medium.com/@jakewharton/listener-messages-are-called-on-a-background-thread-since-okhttp-is-agnostic-with-respect-to-5fdc5182e240\">OkHTTP</a>\n     */\n    public interface WSEventsHandler {\n        void onAction(String type, String params, long messageId);\n        void onConnect();\n        void onClosed();\n    }\n\n    private class WebSocketEventsListener extends WebSocketListener {\n        @Override\n        public void onOpen(WebSocket webSocket, Response response) {\n            Log.d(LOG_TAG, \"At onOpen\");\n\n            Map<String, Object> params = new HashMap<>();\n            params.put(\"sessionId\", sessionId);\n            params.put(\"role\", \"app\");\n            sendAction(\"login\", params, 0L);\n            wsEventsHandler.onConnect();\n        }\n\n        @Override\n        public void onFailure(WebSocket webSocket, Throwable t, Response response) {\n//        Log.e(LOG_TAG, \"Detox Error: \", t);\n\n            //OKHttp won't recover from failure if it got ConnectException,\n            // this is a workaround to make the websocket client try reconnecting when failed.\n            try {\n                Thread.sleep(3000);\n            } catch (InterruptedException e2) {\n                Log.d(LOG_TAG, \"interrupted\", e2);\n            }\n\n            Log.d(LOG_TAG, \"Retrying...\");\n            connectToServer(url, sessionId);\n        }\n\n        @Override\n        public void onMessage(WebSocket webSocket, String text) {\n            receiveAction(text);\n        }\n\n        @Override\n        public void onMessage(WebSocket webSocket, ByteString bytes) {\n            Log.e(LOG_TAG, \"Unexpected binary ws message from detox server.\");\n        }\n\n        @Override\n        public void onClosed(WebSocket webSocket, int code, String reason) {\n            closing = true;\n            wsEventsHandler.onClosed();\n        }\n\n        @Override\n        public void onClosing(WebSocket webSocket, int code, String reason) {\n            closing = true;\n            websocket.close(NORMAL_CLOSURE_STATUS, null);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/common/KotlinReflectUtils.kt",
    "content": "@file:Suppress(\"UNCHECKED_CAST\")\n\npackage com.wix.detox.common\n\nimport kotlin.reflect.full.memberFunctions\nimport kotlin.reflect.full.memberProperties\nimport kotlin.reflect.jvm.isAccessible\n\nobject KotlinReflectUtils {\n\n\n    /**\n     * This function should be used only on kotlin properties that have custom getters.\n     * In Release builds, such properties are compiled away into getter methods.\n     * In Debug builds, such properties exist as fields.\n     */\n    fun <T> getPropertyValueWithCustomGetter(instance: Any, propertyName: String): T? {\n        // In Release builds, properties are compiled away into getter methods.\n        val method = instance::class.memberFunctions.find { it.name == propertyName }\n        if (method != null) {\n            method.isAccessible = true\n            return method.call(instance) as T?\n        }\n\n        // In debug builds, properties exist as fields.\n        val property = instance::class.memberProperties.first { it.name == propertyName }\n        property.isAccessible = true\n        return (property as? kotlin.reflect.KProperty1<Any, *>)?.get(instance) as T?\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/common/RNAnnotations.kt",
    "content": "package com.wix.detox.common\n\nimport kotlin.annotation.AnnotationTarget.*\n\n/**\n * Source-annotation, indicating that some changes need to be made once the associated RN version\n * (or higher) becomes the one minimally supported by Detox Android.\n */\n@Target(FUNCTION, CLASS, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, PROPERTY, FIELD, FILE)\n@Retention(AnnotationRetention.SOURCE)\nannotation class RNDropSupportTodo(val rnMajorVersion: Int, val message: String)\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/common/UIExtensions.kt",
    "content": "package com.wix.detox.common\n\nimport android.view.View\nimport android.view.ViewGroup\n\nfun View.forEachChild(callback: (child: View) -> Unit) {\n    if (this is ViewGroup) {\n        for (index in 0 until childCount) {\n            val child = getChildAt(index)\n            callback(child)\n        }\n    }\n}\n\n/**\n * In-order traverse the view-hierarchy specified by a view, considered to be the hierarchy's root.\n *\n * @param view The hierarchy's root-view.\n * @param callback A function to call per each view. Returning `false` from the callback indicates\n *  a request to refrain from traversing the sub-hierarchy associated with the current view.\n */\nfun traverseViewHierarchy(view: View, callback: (view: View) -> Boolean) {\n    if (callback(view)) {\n        view.forEachChild { child ->\n            traverseViewHierarchy(child, callback)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/config/DetoxConfig.kt",
    "content": "package com.wix.detox.config\n\nclass DetoxConfig {\n    @JvmField var idlePolicyConfig: DetoxIdlePolicyConfig = DetoxIdlePolicyConfig()\n    @JvmField var rnContextLoadTimeoutSec = 60\n\n    fun apply() {\n        idlePolicyConfig.apply()\n    }\n\n    companion object {\n        lateinit var CONFIG: DetoxConfig\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/config/DetoxIdlePolicyConfig.kt",
    "content": "package com.wix.detox.config\n\nimport androidx.test.espresso.IdlingPolicies\nimport java.util.concurrent.TimeUnit\n\n/**\n * Specification of values to use for Espresso's {@link IdlingPolicies} timeouts.\n *\n * Overrides Espresso's defaults as they tend to be too short (e.g. when running a heavy-load app\n * on suboptimal CI machines).\n */\nclass DetoxIdlePolicyConfig {\n    /** Directly binds to [IdlingPolicies.setMasterPolicyTimeout]. Applied in seconds.  */\n    @JvmField var masterTimeoutSec = 240\n\n    /** Directly binds to [IdlingPolicies.setIdlingResourceTimeout]. Applied in seconds.  */\n    @JvmField var idleResourceTimeoutSec = 180\n\n    fun apply() {\n        IdlingPolicies.setMasterPolicyTimeout(masterTimeoutSec.toLong(), TimeUnit.SECONDS)\n        IdlingPolicies.setIdlingResourceTimeout(idleResourceTimeoutSec.toLong(), TimeUnit.SECONDS)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java",
    "content": "package com.wix.detox.espresso;\n\nimport static androidx.test.espresso.action.ViewActions.actionWithAssertions;\nimport static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static org.hamcrest.Matchers.allOf;\n\nimport android.view.View;\n\nimport androidx.test.espresso.UiController;\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.espresso.ViewInteraction;\nimport androidx.test.espresso.action.CoordinatesProvider;\nimport androidx.test.espresso.action.GeneralClickAction;\nimport androidx.test.espresso.action.GeneralLocation;\nimport androidx.test.espresso.action.Press;\nimport androidx.test.espresso.contrib.PickerActions;\n\nimport com.wix.detox.action.common.MotionDir;\nimport com.wix.detox.common.DetoxErrors.DetoxRuntimeException;\nimport com.wix.detox.common.DetoxErrors.StaleActionException;\nimport com.wix.detox.espresso.action.AdjustSliderToPositionAction;\nimport com.wix.detox.espresso.action.DetoxCustomTapper;\nimport com.wix.detox.espresso.action.GetAttributesAction;\nimport com.wix.detox.espresso.action.LongPressAndDragAction;\nimport com.wix.detox.espresso.action.RNClickAction;\nimport com.wix.detox.espresso.action.RNDetoxAccessibilityAction;\nimport com.wix.detox.espresso.action.ScreenshotResult;\nimport com.wix.detox.espresso.action.ScrollToIndexAction;\nimport com.wix.detox.espresso.action.TakeViewScreenshotAction;\nimport com.wix.detox.espresso.action.common.utils.ViewInteractionExt;\nimport com.wix.detox.espresso.action.common.DetoxViewConfigurations;\nimport com.wix.detox.espresso.scroll.DetoxScrollAction;\nimport com.wix.detox.espresso.scroll.DetoxScrollActionStaleAtEdge;\nimport com.wix.detox.espresso.scroll.ScrollEdgeException;\nimport com.wix.detox.espresso.scroll.ScrollHelper;\nimport com.wix.detox.espresso.scroll.SwipeHelper;\n\nimport org.hamcrest.Matcher;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\nimport java.util.Date;\n\n/**\n * Created by simonracz on 10/07/2017.\n */\n\npublic class DetoxAction {\n    private static final String LOG_TAG = \"detox\";\n    private static final String ISO8601_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssZ\";\n    private static final String ISO8601_FORMAT_NO_TZ = \"yyyy-MM-dd'T'HH:mm:ss\";\n\n    private DetoxAction() {\n        // static class\n    }\n\n    public static ViewAction multiClick(int times) {\n        return actionWithAssertions(new GeneralClickAction(new DetoxCustomTapper(times), GeneralLocation.CENTER, Press.FINGER, 0, 0));\n    }\n\n    public static ViewAction tapAtLocation(final int x, final int y) {\n        CoordinatesProvider coordinatesProvider = createCoordinatesProvider(x, y);\n        return actionWithAssertions(new RNClickAction(coordinatesProvider));\n    }\n\n    private static CoordinatesProvider createCoordinatesProvider(final int x, final int y) {\n        final int px = DeviceDisplay.convertDpiToPx(x);\n        final int py = DeviceDisplay.convertDpiToPx(y);\n\n        return new CoordinatesProvider() {\n             @Override\n             public float[] calculateCoordinates(View view) {\n                 final int[] xy = new int[2];\n                 view.getLocationOnScreen(xy);\n                 final float fx = xy[0] + px;\n                 final float fy = xy[1] + py;\n                 return new float[]{fx, fy};\n             }\n         };\n     };\n\n    /**\n     * Scrolls to the edge of the given scrollable view.\n     *\n     * @param edge                Direction to scroll (see {@link MotionDir})\n     * @param startOffsetPercentX Percentage denoting where the scroll should start from on the X-axis, with respect to the scrollable view.\n     * @param startOffsetPercentY Percentage denoting where the scroll should start from on the Y-axis, with respect to the scrollable view.\n     * @return ViewAction\n     */\n    public static ViewAction scrollToEdge(final int edge, double startOffsetPercentX, double startOffsetPercentY) {\n        final Float _startOffsetPercentX = startOffsetPercentX < 0 ? null : (float) startOffsetPercentX;\n        final Float _startOffsetPercentY = startOffsetPercentY < 0 ? null : (float) startOffsetPercentY;\n\n        return actionWithAssertions(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return allOf(isAssignableFrom(View.class), isDisplayed());\n            }\n\n            @Override\n            public String getDescription() {\n                return \"scrollToEdge\";\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                try {\n                    for (int i = 0; i < 100; i++) {\n                        ScrollHelper.performOnce(uiController, view, edge, _startOffsetPercentX, _startOffsetPercentY);\n                    }\n                    throw new DetoxRuntimeException(\"Scrolling a lot without reaching the edge: force-breaking the loop\");\n                } catch (ScrollEdgeException e) {\n                    // Done\n                }\n            }\n        });\n    }\n\n    /**\n     * Scrolls the View in a direction by the Density Independent Pixel amount.\n     *\n     * @param direction           Direction to scroll (see {@link MotionDir})\n     * @param amountInDP          Density Independent Pixels\n     * @param startOffsetPercentX Percentage denoting where the scroll should start from on the X-axis, with respect to the scrollable view.\n     * @param startOffsetPercentY Percentage denoting where the scroll should start from on the Y-axis, with respect to the scrollable view.\n     */\n    public static ViewAction scrollInDirection(final int direction, final double amountInDP, double startOffsetPercentX, double startOffsetPercentY) {\n        final Float _startOffsetPercentX = startOffsetPercentX < 0 ? null : (float) startOffsetPercentX;\n        final Float _startOffsetPercentY = startOffsetPercentY < 0 ? null : (float) startOffsetPercentY;\n        return actionWithAssertions(new DetoxScrollAction(direction, amountInDP, _startOffsetPercentX, _startOffsetPercentY));\n    }\n\n    /**\n     * Scroll the view in a direction by a specified amount (DP units).\n     * <br/>Similar to {@link #scrollInDirection(int, double, double, double)}, but stops <b>gracefully</b> in the case\n     * where the scrolling-edge is reached, by throwing the {@link StaleActionException} exception (i.e.\n     * so as to make this use case manageable by the user).\n     *\n     * @param direction           Direction to scroll (see {@link MotionDir})\n     * @param amountInDP          Density Independent Pixels\n     * @param startOffsetPercentX Percentage denoting where the scroll should start from on the X-axis, with respect to the scrollable view.\n     * @param startOffsetPercentY Percentage denoting where the scroll should start from on the Y-axis, with respect to the scrollable view.\n     */\n    public static ViewAction scrollInDirectionStaleAtEdge(final int direction, final double amountInDP, double startOffsetPercentX, double startOffsetPercentY) {\n        final Float _startOffsetPercentX = startOffsetPercentX < 0 ? null : (float) startOffsetPercentX;\n        final Float _startOffsetPercentY = startOffsetPercentY < 0 ? null : (float) startOffsetPercentY;\n        return actionWithAssertions(new DetoxScrollActionStaleAtEdge(direction, amountInDP, _startOffsetPercentX, _startOffsetPercentY));\n    }\n\n    /**\n     * Swipes the View in a direction.\n     *\n     * @param direction                Direction to swipe (see {@link MotionDir})\n     * @param fast                     true if fast, false if slow\n     * @param normalizedOffset         or \"swipe amount\" between 0.0 and 1.0, relative to the screen width/height\n     * @param normalizedStartingPointX X coordinate of swipe starting point (between 0.0 and 1.0), relative to the view width\n     * @param normalizedStartingPointY Y coordinate of swipe starting point (between 0.0 and 1.0), relative to the view height\n     */\n    public static ViewAction swipeInDirection(final int direction, boolean fast, double normalizedOffset, double normalizedStartingPointX, double normalizedStartingPointY) {\n        SwipeHelper swipeHelper = SwipeHelper.getDefault();\n        return swipeHelper.swipeInDirection(direction, fast, normalizedOffset, normalizedStartingPointX, normalizedStartingPointY);\n    }\n\n    public static ViewAction getAttributes() {\n        return new GetAttributesAction();\n    }\n\n    public static ViewAction scrollToIndex(int index) {\n        return new ScrollToIndexAction(index);\n    }\n\n    public static ViewAction setDatePickerDate(String dateString, String formatString) throws ParseException {\n        Date date;\n        if (formatString.equals(\"ISO8601\")) {\n            date = parseDateISO8601(dateString);\n        } else {\n            date = new SimpleDateFormat(formatString).parse(dateString);\n        }\n\n        Calendar cal = Calendar.getInstance();\n        cal.setTime(date);\n        return PickerActions.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));\n    }\n\n    public static ViewAction adjustSliderToPosition(final Float newPosition) {\n        return new AdjustSliderToPositionAction(newPosition);\n    }\n\n    public static ViewAction longPressAndDrag(Integer duration,\n                                              Double normalizedPositionX,\n                                              Double normalizedPositionY,\n                                              ViewInteraction targetElement,\n                                              Double normalizedTargetPositionX,\n                                              Double normalizedTargetPositionY,\n                                              boolean isFast,\n                                              Integer holdDuration) {\n\n        // We receive a ViewInteraction which represents an interactions of the target view. We need to extract the view\n        // from it in order to get the coordinates of the target view.\n        View targetView = ViewInteractionExt.getView(targetElement);\n\n        return actionWithAssertions(new LongPressAndDragAction(\n            duration,\n            normalizedPositionX,\n            normalizedPositionY,\n            targetView,\n            normalizedTargetPositionX,\n            normalizedTargetPositionY,\n            isFast,\n            holdDuration\n        ));\n    }\n\n    public static ViewAction longPress() {\n        return longPress(null, null, null);\n    }\n\n    public static ViewAction longPress(Integer duration) {\n        return longPress(null, null, duration);\n    }\n\n    public static ViewAction longPress(Integer x, Integer y) {\n        return longPress(x, y, null);\n    }\n\n    public static ViewAction longPress(Integer x, Integer y, Integer duration) {\n        Long finalDuration = duration != null ? duration : DetoxViewConfigurations.getLongPressTimeout();\n        CoordinatesProvider coordinatesProvider = x == null || y == null ? null : createCoordinatesProvider(x, y);\n\n        return actionWithAssertions(new RNClickAction(coordinatesProvider, finalDuration));\n    }\n\n    public static ViewAction takeViewScreenshot() {\n        return new ViewActionWithResult<String>() {\n            private final TakeViewScreenshotAction action = new TakeViewScreenshotAction();\n\n            @Override\n            public Matcher<View> getConstraints() {\n                return action.getConstraints();\n            }\n\n            @Override\n            public String getDescription() {\n                return action.getDescription();\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                action.perform(uiController, view);\n            }\n\n            @Override\n            public String getResult() {\n                ScreenshotResult result = action.getResult();\n                return (result == null ? null : result.asBase64String());\n            }\n        };\n    }\n\n    public static ViewAction accessibilityAction(final String actionName) {\n        return new RNDetoxAccessibilityAction(actionName);\n    }\n\n    private static Date parseDateISO8601(String dateString) throws ParseException {\n        try {\n            return new SimpleDateFormat(ISO8601_FORMAT).parse(dateString);\n        } catch (ParseException e) {\n            return new SimpleDateFormat(ISO8601_FORMAT_NO_TZ).parse(dateString);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxAssertion.java",
    "content": "package com.wix.detox.espresso;\n\nimport android.view.View;\n\nimport com.wix.detox.common.DetoxErrors.DetoxRuntimeException;\nimport com.wix.detox.common.DetoxErrors.StaleActionException;\n\nimport junit.framework.AssertionFailedError;\n\nimport org.hamcrest.Matcher;\n\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.espresso.ViewInteraction;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static com.wix.detox.espresso.assertion.ViewAssertions.matches;\nimport static org.hamcrest.Matchers.not;\n\n/**\n * Created by simonracz on 10/07/2017.\n */\n\npublic class DetoxAssertion {\n\n    private static final double NANOSECONDS_IN_A_SECOND = 1_000_000_000.0;\n\n    private DetoxAssertion() {\n        // This is a utility class and shouldn't be instantiated.\n    }\n\n    /**\n     * Asserts the given matcher for the provided view interaction.\n     */\n    public static ViewInteraction assertMatcher(ViewInteraction viewInteraction, Matcher<View> viewMatcher) {\n        return viewInteraction.check(matches(viewMatcher));\n    }\n\n    /**\n     * Asserts that the given view interaction is not visible.\n     */\n    public static ViewInteraction assertNotVisible(ViewInteraction viewInteraction) {\n        ViewInteraction result;\n        try {\n            result = viewInteraction.check(doesNotExist());\n            return result;\n        } catch (AssertionFailedError e) {\n            result = viewInteraction.check(matches(not(isDisplayed())));\n            return result;\n        }\n    }\n\n    /**\n     * Asserts that the given view interaction does not exist.\n     */\n    public static ViewInteraction assertNotExists(ViewInteraction viewInteraction) {\n        return viewInteraction.check(doesNotExist());\n    }\n\n    /**\n     * Waits until the provided matcher matches the view interaction or a timeout occurs.\n     */\n    public static void waitForAssertMatcher(final ViewInteraction viewInteraction, final Matcher<View> viewMatcher, double timeoutSeconds) {\n        final long startTime = System.nanoTime();\n\n        while (true) {\n            long currentTime = System.nanoTime();\n            long elapsedTime = currentTime - startTime;\n            double elapsedSeconds = (double) elapsedTime / NANOSECONDS_IN_A_SECOND;\n            if (elapsedSeconds >= timeoutSeconds) {\n                throw new DetoxRuntimeException(\n                    \"\" + timeoutSeconds + \"sec timeout expired without matching of given matcher: \" + viewMatcher);\n            }\n\n            try {\n                viewInteraction.check(matches(viewMatcher));\n                break;\n            } catch (AssertionFailedError err) {\n                UiAutomatorHelper.espressoSync(20);\n            }\n        }\n    }\n\n    /**\n     * Continually asserts the provided matcher until a search action returns a matching view or a\n     * `StaleActionException` error is thrown.\n     */\n    public static void waitForAssertMatcherWithSearchAction(\n        final ViewInteraction viewInteraction,\n        final Matcher<View> viewMatcher,\n        final ViewAction searchAction,\n        final Matcher<View> searchMatcher\n    ) {\n        while (true) {\n            try {\n                assertMatcher(viewInteraction, viewMatcher);\n                break;\n            } catch (AssertionFailedError err) {\n                try {\n                    onView(searchMatcher).perform(searchAction);\n                } catch (StaleActionException exStaleAction) {\n                    assertMatcher(viewInteraction, viewMatcher);\n                    break;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxFailureHandler.kt",
    "content": "package com.wix.detox.espresso\n\nimport android.view.View\nimport android.util.Log\nimport androidx.test.espresso.FailureHandler\nimport androidx.test.espresso.NoMatchingViewException\nimport androidx.test.espresso.AmbiguousViewMatcherException\nimport com.wix.detox.espresso.errors.DetoxNoMatchingViewException\nimport com.wix.detox.espresso.errors.DetoxAmbiguousViewMatcherException\nimport com.wix.detox.espresso.hierarchy.ViewHierarchyGenerator\nimport org.hamcrest.Matcher\n\nprivate const val LOG_TAG = \"DetoxFailureHandler\"\n\n/**\n * Enhanced failure handler that wraps Espresso exceptions with cleaned error messages\n * and provides XML hierarchy for debugging while eliminating verbose view hierarchy\n * from exception messages.\n */\nclass DetoxFailureHandler : FailureHandler {\n\n    override fun handle(error: Throwable, viewMatcher: Matcher<View>) {\n        when (error) {\n            is NoMatchingViewException -> {\n                val xmlHierarchy = getSafeViewHierarchy(error.rootView)\n                throw DetoxNoMatchingViewException(error, xmlHierarchy)\n            }\n            is AmbiguousViewMatcherException -> {\n                val xmlHierarchy = getSafeViewHierarchy(error.rootView)\n                throw DetoxAmbiguousViewMatcherException(error, xmlHierarchy)\n            }\n            else -> {\n                // For other exceptions, just re-throw as-is\n                throw error\n            }\n        }\n    }\n\n    private fun getSafeViewHierarchy(rootView: View): String {\n        return try {\n            ViewHierarchyGenerator.generateXml(rootView, shouldInjectTestIds = false)\n        } catch (hierarchyException: Exception) {\n            Log.w(LOG_TAG, \"Failed to generate view hierarchy\", hierarchyException)\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<ViewHierarchy>\\n  <!-- Failed to generate hierarchy: ${hierarchyException.message} -->\\n</ViewHierarchy>\"\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxMatcher.java",
    "content": "package com.wix.detox.espresso;\n\nimport static androidx.test.espresso.matcher.ViewMatchers.hasDescendant;\nimport static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;\nimport static androidx.test.espresso.matcher.ViewMatchers.isChecked;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static androidx.test.espresso.matcher.ViewMatchers.isFocused;\nimport static androidx.test.espresso.matcher.ViewMatchers.isNotChecked;\nimport static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.matcherForDisplayingAtLeast;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.isMatchingAtIndex;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.isOfClassName;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.toHaveSliderPosition;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.withAccessibilityLabel;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.withContentDescription;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.withShallowAccessibilityLabel;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.withTagValue;\nimport static com.wix.detox.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.anyOf;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport android.view.View;\n\nimport androidx.test.espresso.matcher.ViewMatchers.Visibility;\n\nimport org.hamcrest.Matcher;\n\n/**\n * Created by simonracz on 10/07/2017.\n */\n\npublic class DetoxMatcher {\n\n    private DetoxMatcher() {\n        // static class\n    }\n\n    public static Matcher<View> matcherForText(String text, boolean isRegex) {\n        // return anyOf(withText(text), withContentDescription(text));\n        return allOf(withText(text, isRegex), withEffectiveVisibility(Visibility.VISIBLE));\n    }\n\n    public static Matcher<View> matcherForAccessibilityLabel(String label, boolean isRegex) {\n        return allOf(withAccessibilityLabel(label, isRegex), withEffectiveVisibility(Visibility.VISIBLE));\n    }\n\n    public static Matcher<View> matcherForShallowAccessibilityLabel(String label, boolean isRegex) {\n        return allOf(withShallowAccessibilityLabel(label, isRegex), withEffectiveVisibility(Visibility.VISIBLE));\n    }\n\n    public static Matcher<View> matcherForContentDescription(String contentDescription) {\n        return allOf(withContentDescription(contentDescription, false), withEffectiveVisibility(Visibility.VISIBLE));\n    }\n\n    public static Matcher<View> matcherForTestId(String testId, boolean isRegex) {\n        return allOf(withTagValue(testId, isRegex), withEffectiveVisibility(Visibility.VISIBLE));\n    }\n\n    public static Matcher<View> matcherForToggleable(boolean value) {\n        return (value ? isChecked() : isNotChecked());\n    }\n\n    public static Matcher<View> matcherForAnd(Matcher<View> m1, Matcher<View> m2) {\n        return allOf(m1, m2);\n    }\n\n    public static Matcher<View> matcherForOr(Matcher<View> m1, Matcher<View> m2) {\n        return anyOf(m1, m2);\n    }\n\n    public static Matcher<View> matcherForNot(Matcher<View> m) {\n        return not(m);\n    }\n\n    public static Matcher<View> matcherWithAncestor(Matcher<View> m, Matcher<View> ancestorMatcher) {\n        return allOf(m, isDescendantOfA(ancestorMatcher));\n    }\n\n    public static Matcher<View> matcherWithDescendant(Matcher<View> m, Matcher<View> descendantMatcher) {\n        return allOf(m, hasDescendant(descendantMatcher));\n    }\n\n    public static Matcher<View> matcherForClass(String className) {\n        return isOfClassName(className);\n    }\n\n    public static Matcher<View> matcherForSufficientlyVisible(int pct) {\n        return matcherForDisplayingAtLeast(pct);\n    }\n\n    public static Matcher<View> matcherForNotVisible() {\n        return anyOf(nullValue(), not(isDisplayed()));\n    }\n\n    public static Matcher<View> matcherForNotNull() {\n        return notNullValue(android.view.View.class);\n    }\n\n    public static Matcher<View> matcherForNull() {\n        return nullValue(android.view.View.class);\n    }\n\n    public static Matcher<View> matcherForAtIndex(final int index, final Matcher<View> innerMatcher) {\n        return isMatchingAtIndex(index, innerMatcher);\n    }\n\n    public static Matcher<View> matcherForAnything() {\n        return isAssignableFrom(View.class);\n    }\n\n    public static Matcher<View> matcherForFocus() {\n        return isFocused();\n    }\n\n    public static Matcher<View> matcherForSliderPosition(double position, double tolerance) {\n        return toHaveSliderPosition(position, tolerance);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxViewActions.java",
    "content": "package com.wix.detox.espresso;\n\nimport com.wix.detox.espresso.action.DetoxTypeTextAction;\nimport com.wix.detox.espresso.action.RNClickAction;\n\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.espresso.action.ViewActions;\n\nimport static androidx.test.espresso.action.ViewActions.actionWithAssertions;\n\n/**\n * An alternative to {@link ViewActions} - providing alternative implementations, where needed.\n */\npublic class DetoxViewActions {\n    public static ViewAction click() {\n        return actionWithAssertions(new RNClickAction());\n    }\n\n    public static ViewAction typeText(String text) {\n        return actionWithAssertions(new DetoxTypeTextAction(text));\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/EspressoDetox.java",
    "content": "package com.wix.detox.espresso;\n\nimport com.wix.detox.espresso.performer.ViewActionPerformer;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.ContextWrapper;\nimport android.content.pm.ActivityInfo;\nimport android.util.Log;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.ReactApplication;\nimport com.wix.detox.common.UIThread;\nimport com.wix.detox.reactnative.ReactNativeExtension;\nimport com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource;\n\nimport org.hamcrest.Matcher;\n\nimport java.util.ArrayList;\n\nimport androidx.test.espresso.UiController;\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.platform.app.InstrumentationRegistry;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.matcher.ViewMatchers.isRoot;\nimport static com.wix.detox.espresso.UiAutomatorHelper.getStatusBarHeightDps;\n\n/**\n * Created by rotemm on 26/12/2016.\n */\npublic class EspressoDetox {\n    private static final String LOG_TAG = \"detox\";\n\n    private static int calculateAdjustedY(View view, Integer y, boolean shouldIgnoreStatusBar) {\n        return shouldIgnoreStatusBar ? y + getStatusBarHeightDps(view) : y;\n    }\n\n    public static Object perform(Matcher<View> matcher, ViewAction action) {\n        ViewActionPerformer performer = ViewActionPerformer.forAction(action);\n        return performer.performOn(matcher);\n    }\n\n    public static Activity getActivity(Context context) {\n        if (context instanceof Activity) {\n            return (Activity) context;\n        }\n        while (context instanceof ContextWrapper) {\n            if (context instanceof Activity) {\n                return (Activity) context;\n            }\n            context = ((ContextWrapper) context).getBaseContext();\n        }\n        return null;\n    }\n\n    public static void changeOrientation(final int orientation) {\n        onView(isRoot()).perform(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return isRoot();\n            }\n\n            @Override\n            public String getDescription() {\n                return \"changing orientation to \" + orientation;\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                Activity activity = ReactNativeExtension.getRNActivity(view.getContext().getApplicationContext());\n\n                if (activity == null) {\n                    activity = getActivity(view.getContext());\n                    if (activity == null && view instanceof ViewGroup) {\n                        ViewGroup v = (ViewGroup) view;\n                        int c = v.getChildCount();\n                        for (int i = 0; i < c && activity == null; ++i) {\n                            activity = getActivity(v.getChildAt(i).getContext());\n                        }\n                    }\n                }\n\n                if (activity == null) {\n                    throw new RuntimeException(\"Couldn't get a hold of the Activity\");\n                }\n\n                switch (orientation) {\n                    case 0:\n                        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n                        break;\n                    case 1:\n                        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n                        break;\n                    case 2:\n                        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);\n                        break;\n                    case 3:\n                        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);\n                        break;\n                    default:\n                        Log.e(LOG_TAG, \"Not supported orientation: \" + orientation);\n                }\n                uiController.loopMainThreadUntilIdle();\n            }\n        });\n    }\n\n    public static void setSynchronization(boolean enabled) {\n        if (enabled) {\n            Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();\n            ReactNativeExtension.enableAllSynchronization((ReactApplication) context.getApplicationContext());\n        } else {\n            ReactNativeExtension.clearAllSynchronization();\n        }\n    }\n\n    public static void setURLBlacklist(final ArrayList<String> urls) {\n        UIThread.postSync(new Runnable() {\n            @Override\n            public void run() {\n                NetworkIdlingResource.setURLBlacklist(urls);\n            }\n        });\n    }\n\n    public static void tap(Integer x, Integer y, boolean shouldIgnoreStatusBar) {\n        onView(isRoot()).perform(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return isRoot();\n            }\n\n            @Override\n            public String getDescription() {\n                return \"tap on screen\";\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                int adjustedY = calculateAdjustedY(view, y, shouldIgnoreStatusBar);\n                ViewAction action = DetoxAction.tapAtLocation(x, adjustedY);\n                action.perform(uiController, view);\n                uiController.loopMainThreadUntilIdle();\n            }\n        });\n    }\n\n    public static void longPress(Integer x, Integer y, boolean shouldIgnoreStatusBar) {\n        longPress(x, y, null, shouldIgnoreStatusBar);\n    }\n\n    public static void longPress(Integer x, Integer y, Integer duration, boolean shouldIgnoreStatusBar) {\n        onView(isRoot()).perform(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return isRoot();\n            }\n\n            @Override\n            public String getDescription() {\n                return \"long press on screen\";\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                int adjustedY = calculateAdjustedY(view, y, shouldIgnoreStatusBar);\n                ViewAction action = DetoxAction.longPress(x, adjustedY, duration);\n                action.perform(uiController, view);\n                uiController.loopMainThreadUntilIdle();\n            }\n        });\n    }\n}\n\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/UiAutomatorHelper.java",
    "content": "package com.wix.detox.espresso;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.os.Handler;\nimport android.util.DisplayMetrics;\nimport android.util.Log;\nimport android.util.TypedValue;\nimport android.view.Choreographer;\nimport android.view.View;\n\nimport com.wix.detox.common.UIThread;\nimport com.wix.detox.espresso.action.common.utils.UiControllerUtils;\n\nimport org.joor.Reflect;\nimport org.joor.ReflectException;\n\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\n\nimport androidx.test.platform.app.InstrumentationRegistry;\n\n/**\n * Created by simonracz on 19/07/2017.\n */\n\npublic class UiAutomatorHelper {\n    private static final String LOG_TAG = \"detox\";\n\n    private static final String METHOD_LOOP_UNTIL_IDLE = \"loopMainThreadUntilIdle\";\n    private static final String METHOD_LOOP_AT_LEAST = \"loopMainThreadForAtLeast\";\n\n    /**\n     * This triggers a full Espresso sync. It's intended use is to sync UIAutomator calls.\n     */\n    public static void espressoSync() {\n        // I want to invoke Espresso's sync mechanism manually.\n        // This turned out to be amazingly difficult. This below is the\n        // nicest solution I could come up with.\n        UIThread.runSync(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    Reflect.on(UiControllerUtils.getUiController()).call(METHOD_LOOP_UNTIL_IDLE);\n                } catch (ReflectException e) {\n                    Log.e(LOG_TAG, \"Failed to sync Espresso manually.\", e.getCause());\n                }\n            }\n        });\n    }\n\n    /**\n     * This triggers a full Espresso sync. Waits at least millis amount of time.\n     *\n     * @param millis waits at least this amount of time\n     */\n    public static void espressoSync(final long millis) {\n        // I want to invoke Espresso's sync mechanism manually.\n        // This turned out to be amazingly difficult. This below is the\n        // nicest solution I could come up with.\n        UIThread.runSync(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    Reflect.on(UiControllerUtils.getUiController()).call(METHOD_LOOP_AT_LEAST, millis);\n                } catch (ReflectException e) {\n                    Log.e(LOG_TAG, \"Failed to sync Espresso manually.\", e.getCause());\n                }\n            }\n        });\n    }\n\n    /**\n     * Waits for some Choreographer calls.\n     * <p>\n     * React Native uses Choreographer callbacks. Those are invisible to Espresso.\n     * One of them is UIModule, UIViewOperationQueue.\n     * <p>\n     * After everything idled out, we should still wait for UIModule to initiate it's changes\n     * on the UI by waiting out its Choreographer frame.\n     * <p>\n     * TODO:\n     * Find a way to wrap up the UIModule in an Espresso IdlingResource, similar to JS Timers.\n     */\n    private static void waitForChoreographer() {\n        final int waitFrameCount = 2;\n        final CountDownLatch latch = new CountDownLatch(1);\n        Handler handler = new Handler(InstrumentationRegistry.getInstrumentation().getTargetContext().getMainLooper());\n        handler.post(\n                new Runnable() {\n                    @Override\n                    public void run() {\n                        Choreographer.getInstance().postFrameCallback(\n                                new Choreographer.FrameCallback() {\n\n                                    private int frameCount = 0;\n\n                                    @Override\n                                    public void doFrame(long frameTimeNanos) {\n                                        frameCount++;\n                                        if (frameCount == waitFrameCount) {\n                                            latch.countDown();\n                                        } else {\n                                            Choreographer.getInstance().postFrameCallback(this);\n                                        }\n                                    }\n                                });\n                    }\n                });\n        try {\n            if (!latch.await(500, TimeUnit.MILLISECONDS)) {\n                throw new RuntimeException(\"Timed out waiting for Choreographer\");\n            }\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    @SuppressLint({\"DiscouragedApi\", \"InternalInsetResource\"})\n    public static int getStatusBarHeightDps(View view) {\n        Context context = view.getContext();\n        int resourceId = context.getResources().getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n        return (int) (context.getResources().getDimensionPixelSize(resourceId) / ((float) context.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT));\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.View\nimport androidx.appcompat.widget.AppCompatSeekBar\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom\nimport androidx.test.espresso.matcher.ViewMatchers.isDisplayed\nimport com.wix.detox.espresso.common.ReactSliderHelper\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers\n\nclass AdjustSliderToPositionAction(private val targetPositionPct: Float) : ViewAction {\n    override fun getDescription() = \"adjustSliderToPosition\"\n    override fun getConstraints(): Matcher<View?>? =\n        Matchers.allOf( isDisplayed(), isAssignableFrom(AppCompatSeekBar::class.java) )\n\n    override fun perform(uiController: UiController?, view: View) {\n        val sliderHelper = ReactSliderHelper.create(view)\n        sliderHelper.setProgressPct(targetPositionPct)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/action/DetoxTypeTextAction.java",
    "content": "package com.wix.detox.espresso.action;\n\nimport android.view.View;\n\nimport org.hamcrest.Matcher;\n\nimport androidx.test.espresso.UiController;\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.espresso.action.TypeTextAction;\n\nimport static org.hamcrest.Matchers.allOf;\n\npublic class DetoxTypeTextAction implements ViewAction {\n    private final String text;\n    private final RNClickAction clickAction;\n    private final TypeTextAction typeTextAction;\n\n    public DetoxTypeTextAction(String text) {\n        this.text = text;\n        clickAction = new RNClickAction();\n        typeTextAction = new TypeTextAction(text, false);\n    }\n\n    @Override\n    public Matcher<View> getConstraints() {\n        return allOf(clickAction.getConstraints(), new TypeTextAction(\"\", true).getConstraints());\n    }\n\n    @Override\n    public String getDescription() {\n        return \"Click to focus & type text (\"+text+\")\";\n    }\n\n    @Override\n    public void perform(UiController uiController, View view) {\n        clickAction.perform(uiController, view);\n        typeTextAction.perform(uiController, view);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/action/GetAttributesAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.graphics.Rect\nimport android.os.Build\nimport android.view.View\nimport android.widget.CheckBox\nimport android.widget.ProgressBar\nimport android.widget.TextView\nimport androidx.test.espresso.UiController\nimport com.wix.detox.espresso.ViewActionWithResult\nimport com.wix.detox.espresso.MultipleViewsAction\nimport com.wix.detox.espresso.common.ReactSliderHelper\nimport com.wix.detox.espresso.common.MaterialSliderHelper\nimport com.wix.detox.reactnative.ui.getAccessibilityLabel\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers\nimport org.hamcrest.Matchers.allOf\nimport org.hamcrest.Matchers.notNullValue\nimport org.json.JSONObject\n\nprivate interface AttributeExtractor {\n    fun extractAttributes(json: JSONObject, view: View)\n}\n\nclass GetAttributesAction() : ViewActionWithResult<JSONObject?>, MultipleViewsAction {\n    private val attributeExtractors = listOf(\n        CommonAttributes(),\n        TextViewAttributes(),\n        CheckBoxAttributes(),\n        ProgressBarAttributes(),\n        MaterialSliderAttributes()\n    )\n    private var result: JSONObject? = null\n\n    override fun perform(uiController: UiController?, view: View?) {\n        view!!\n\n        val json = JSONObject()\n        attributeExtractors.forEach { it.extractAttributes(json, view) }\n\n        result = json\n    }\n\n    override fun getResult() = result\n    override fun getDescription() = \"Get view attributes\"\n    override fun getConstraints(): Matcher<View> = allOf(notNullValue(), Matchers.isA(View::class.java))\n}\n\nprivate class CommonAttributes : AttributeExtractor {\n    override fun extractAttributes(json: JSONObject, view: View) {\n        getId(json, view)\n        getVisibility(json, view)\n        getAccessibilityLabel(json, view)\n        getAlpha(json, view)\n        getElevation(json, view)\n        getFrame(json, view)\n        getHeight(json, view)\n        getWidth(json, view)\n        getHasFocus(json, view)\n        getIsEnabled(json, view)\n    }\n\n    private fun getId(json: JSONObject, view: View) =\n            view.tag?.let {\n                json.put(\"identifier\", it.toString())\n            }\n\n    private fun getFrame(json: JSONObject, view: View) {\n        val location = IntArray(2)\n        view.getLocationOnScreen(location)\n        json.put(\"frame\", JSONObject().apply {\n            put(\"x\", location[0])\n            put(\"y\", location[1])\n            put(\"width\", view.width)\n            put(\"height\", view.height)\n        })\n    }\n\n    private fun getVisibility(json: JSONObject, view: View) {\n        json.put(\"visibility\", visibilityMap[view.visibility])\n        json.put(\"visible\", view.getLocalVisibleRect(Rect()))\n    }\n\n    private fun getAccessibilityLabel(json: JSONObject, view: View) =\n            view.getAccessibilityLabel()?.let {\n                json.put(\"label\", it)\n            }\n\n    private fun getElevation(json: JSONObject, view: View) {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n            json.put(\"elevation\", view.elevation)\n        }\n    }\n\n    private fun getAlpha(json: JSONObject, view: View) = json.put(\"alpha\", view.alpha)\n    private fun getHeight(json: JSONObject, view: View) = json.put(\"height\", view.height)\n    private fun getWidth(json: JSONObject, view: View) = json.put(\"width\", view.width)\n    private fun getIsEnabled(json: JSONObject, view: View) = json.put(\"enabled\", view.isEnabled)\n    private fun getHasFocus(json: JSONObject, view: View) = json.put(\"focused\", view.isFocused)\n\n    companion object {\n        private val visibilityMap = mapOf(View.VISIBLE to \"visible\", View.INVISIBLE to \"invisible\", View.GONE to \"gone\")\n    }\n}\n\nprivate class TextViewAttributes : AttributeExtractor {\n    override fun extractAttributes(json: JSONObject, view: View) {\n        if (view is TextView) {\n            getText(json, view)\n            getLength(json, view)\n            getTextSize(json, view)\n            getHint(json, view)\n        }\n    }\n\n    private fun getText(rootObject: JSONObject, view: TextView) =\n            view.text?.let {\n                rootObject.put(\"text\", it.toString())\n            }\n\n    private fun getTextSize(rootObject: JSONObject, view: TextView) =\n            rootObject.put(\"textSize\", view.textSize)\n\n    private fun getLength(rootObject: JSONObject, view: TextView) =\n            view.text?.let {\n                rootObject.put(\"length\", view.length())\n            }\n\n    private fun getHint(rootObject: JSONObject, view: TextView) =\n            view.hint?.let {\n                rootObject.put(\"placeholder\", it.toString())\n            }\n}\n\nprivate class CheckBoxAttributes : AttributeExtractor {\n    override fun extractAttributes(json: JSONObject, view: View) {\n        if (view is CheckBox) {\n            getCheckboxValue(json, view)\n        }\n    }\n\n    private fun getCheckboxValue(rootObject: JSONObject, view: CheckBox) =\n            rootObject.put(\"value\", view.isChecked)\n}\n\n/**\n * Note: this applies also to [androidx.appcompat.widget.AppCompatSeekBar], which\n * is anything RN-slider-ish.\n */\nprivate class ProgressBarAttributes : AttributeExtractor {\n    override fun extractAttributes(json: JSONObject, view: View) {\n        if (view is ProgressBar) {\n            ReactSliderHelper.maybeCreate(view)?.let {\n                getReactSliderValue(json, it)\n            } ?:\n                getProgressBarValue(json, view)\n        }\n    }\n\n    private fun getReactSliderValue(rootObject: JSONObject, reactSliderHelper: ReactSliderHelper) {\n        rootObject.put(\"value\", reactSliderHelper.getCurrentProgressPct())\n    }\n\n    private fun getProgressBarValue(rootObject: JSONObject, view: ProgressBar) =\n            rootObject.put(\"value\", view.progress)\n}\n\nprivate class MaterialSliderAttributes : AttributeExtractor {\n    override fun extractAttributes(json: JSONObject, view: View) {\n        MaterialSliderHelper(view).getValueIfSlider()?.let {\n            json.put(\"value\", it)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/action/RNClickAction.java",
    "content": "package com.wix.detox.espresso.action;\n\nimport android.view.InputDevice;\nimport android.view.MotionEvent;\nimport android.view.View;\n\nimport com.wix.detox.reactnative.ReactNativeExtension;\n\nimport org.hamcrest.Matcher;\n\nimport androidx.test.espresso.UiController;\nimport androidx.test.espresso.ViewAction;\nimport androidx.test.espresso.action.CoordinatesProvider;\nimport androidx.test.espresso.action.GeneralClickAction;\nimport androidx.test.espresso.action.GeneralLocation;\nimport androidx.test.espresso.action.Press;\n\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast;\n\npublic class RNClickAction implements ViewAction {\n    private final GeneralClickAction clickAction;\n\n    public RNClickAction() {\n        this(null, null);\n    }\n\n    public RNClickAction(CoordinatesProvider coordinatesProvider) {\n        this(coordinatesProvider, null);\n    }\n\n    public RNClickAction(CoordinatesProvider coordinatesProvider, Long duration) {\n        coordinatesProvider = coordinatesProvider != null ? coordinatesProvider : GeneralLocation.VISIBLE_CENTER;\n\n        clickAction = new GeneralClickAction(\n            new DetoxSingleTap(duration),\n            coordinatesProvider,\n            Press.FINGER,\n            InputDevice.SOURCE_UNKNOWN,\n            MotionEvent.BUTTON_PRIMARY\n        );\n    }\n\n    @Override\n    public Matcher<View> getConstraints() {\n        return isDisplayingAtLeast(75);\n    }\n\n    @Override\n    public String getDescription() {\n        return clickAction.getDescription();\n    }\n\n    @Override\n    public void perform(UiController uiController, View view) {\n        ReactNativeExtension.toggleTimersSynchronization(false);\n        try {\n            clickAction.perform(uiController, view);\n        } finally {\n            ReactNativeExtension.toggleTimersSynchronization(true);\n        }\n        uiController.loopMainThreadUntilIdle();\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/action/RNDetoxAccessibilityAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.View\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.ViewAction\nimport com.facebook.react.bridge.Arguments\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.bridge.WritableMap\nimport com.facebook.react.uimanager.UIManagerHelper\nimport com.facebook.react.uimanager.events.Event\nimport com.wix.detox.espresso.DetoxMatcher\nimport org.hamcrest.Matcher\n\nclass RNDetoxAccessibilityAction(private val mActionName: String) : ViewAction {\n\n    override fun getConstraints(): Matcher<View?>? = DetoxMatcher.matcherForNotNull()\n\n    override fun getDescription(): String = \"Dispatch an Accessibility Action\"\n\n    override fun perform(uiController: UiController?, view: View?) {\n        val reactContext = view?.context as? ReactContext ?: return\n        val reactTag = view.id\n\n        UIManagerHelper.getEventDispatcherForReactTag(reactContext, reactTag)\n            ?.dispatchEvent(\n                TopAccessibilityEvent(\n                    surfaceId = UIManagerHelper.getSurfaceId(reactContext),\n                    viewId = reactTag,\n                    actionName = mActionName,\n                )\n            )\n\n        val waitTimeMS = 100\n        uiController!!.loopMainThreadForAtLeast(waitTimeMS.toLong())\n    }\n}\n\nclass TopAccessibilityEvent(surfaceId: Int, viewId: Int, private val actionName: String) :\n    Event<TopAccessibilityEvent>(surfaceId, viewId) {\n\n    override fun getEventName(): String = \"topAccessibilityAction\"\n\n    override fun getEventData(): WritableMap? {\n        return Arguments.createMap().apply { putString(\"actionName\", actionName) }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/assertion/ViewAssertions.java",
    "content": "package com.wix.detox.espresso.assertion;\n\nimport static androidx.test.espresso.matcher.ViewMatchers.assertThat;\n\nimport android.view.View;\n\nimport androidx.annotation.NonNull;\nimport androidx.test.espresso.NoMatchingViewException;\nimport androidx.test.espresso.ViewAssertion;\n\nimport org.hamcrest.Matcher;\nimport org.hamcrest.StringDescription;\n\n/**\n * A custom extension of {@link androidx.test.espresso.assertion.ViewAssertions}.\n *\n * <p/>Perhaps in the future we could extend Espresso's using Kotlin's extension functions.\n */\npublic class ViewAssertions {\n\n    /**\n     * An alternative to Espresso's {@link androidx.test.espresso.assertion.ViewAssertions#matches(Matcher)},\n     * which is more suitable for Detox' separated interaction-matcher architecture.\n     * See {@link MatchesViewAssertion} for more details.\n     */\n    public static ViewAssertion matches(final Matcher<? super View> viewMatcher) {\n        return new MatchesViewAssertion(viewMatcher);\n    }\n\n    /**\n     * Identical to Espresso's {@link androidx.test.espresso.assertion.ViewAssertions}#MatchesViewAssertion\n     * typically created by {@link androidx.test.espresso.assertion.ViewAssertions#matches(Matcher)}, except\n     * that instead of throwing the {@link NoMatchingViewException} (given to the matcher by the <b>interaction</b>\n     * when the view wasn't in the hierarchy), it invokes the matcher nonetheless (i.e. with a <i>null</i> as the item).\n     */\n    private static class MatchesViewAssertion implements ViewAssertion {\n        final Matcher<? super View> viewMatcher;\n\n        private MatchesViewAssertion(final Matcher<? super View> viewMatcher) {\n            this.viewMatcher = viewMatcher;\n        }\n\n        @Override\n        public void check(View view, NoMatchingViewException noViewException) {\n            StringDescription description = new StringDescription();\n            description.appendText(\"'\");\n            viewMatcher.describeTo(description);\n\n            description.appendText(\"' doesn't match the selected view.\");\n\n            assertThat(description.toString(), noViewException != null ? null : view, viewMatcher);\n        }\n\n        @NonNull\n        @Override\n        public String toString() {\n            return String.format(\"MatchesViewAssertion(Detox){viewMatcher=%s}\", viewMatcher);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt",
    "content": "package com.wix.detox.espresso.common\n\nimport android.view.View\nimport com.wix.detox.espresso.action.common.ReflectUtils\nimport org.joor.Reflect\n\nprivate const val CLASS_MATERIAL_SLIDER = \"com.google.android.material.slider.Slider\"\n\nopen class MaterialSliderHelper(protected val view: View) {\n    fun getValueIfSlider(): Float? {\n        if (!isSlider()) {\n            return null\n        }\n\n        return getValue()\n    }\n\n    private fun isSlider() = ReflectUtils.isAssignableFrom(view, CLASS_MATERIAL_SLIDER)\n\n    private fun getValue() = Reflect.on(view).call(\"getValue\").get() as Float\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/common/ReactSliderHelper.kt",
    "content": "package com.wix.detox.espresso.common\n\nimport android.view.View\nimport androidx.appcompat.widget.AppCompatSeekBar\nimport com.facebook.react.bridge.JavaOnlyMap\nimport com.facebook.react.uimanager.ReactStylesDiffMap\nimport com.wix.detox.common.DetoxErrors.DetoxIllegalStateException\nimport com.wix.detox.espresso.action.common.ReflectUtils\nimport org.joor.Reflect\n\nprivate const val CLASS_REACT_SLIDER_LEGACY = \"com.facebook.react.views.slider.ReactSlider\"\nprivate const val CLASS_REACT_SLIDER_LEGACY_MANAGER = \"com.facebook.react.views.slider.ReactSliderManager\"\nprivate const val CLASS_REACT_SLIDER_COMMUNITY = \"com.reactnativecommunity.slider.ReactSlider\"\nprivate const val CLASS_REACT_SLIDER_COMMUNITY_MANAGER = \"com.reactnativecommunity.slider.ReactSliderManager\"\n\nabstract class ReactSliderHelper(protected val slider: AppCompatSeekBar) {\n    fun getCurrentProgressPct(): Double {\n        val nativeProgress = slider.progress.toDouble()\n        val nativeMax = slider.max\n        return nativeProgress / nativeMax\n    }\n\n    // TODO Make this more testable (e.g. by delegating the set action away)\n    fun setProgressPct(valuePct: Float) {\n        val maxJSProgress = calcMaxJSProgress()\n        val valueJS = valuePct * maxJSProgress\n        setProgressJS(valueJS.toFloat())\n    }\n\n    protected abstract fun setProgressJS(valueJS: Float)\n\n    private fun calcMaxJSProgress(): Double {\n        val nativeProgress = slider.progress.toDouble()\n        val nativeMax = slider.max\n        val toMaxFactor = nativeMax / nativeProgress\n\n        val jsProgress = getJSProgress()\n        return jsProgress * toMaxFactor\n    }\n\n    private fun getJSProgress(): Double =\n        Reflect.on(slider).call(\"toRealProgress\", slider.progress).get() as Double\n\n    companion object {\n        fun create(view: View) =\n            maybeCreate(view)\n                ?: throw DetoxIllegalStateException(\"Cannot handle this type of a seek-bar view (Class ${view.javaClass.canonicalName}). \" +\n                        \"Only React Native sliders are currently supported.\")\n\n        fun maybeCreate(view: View): ReactSliderHelper? =\n            when {\n                ReflectUtils.isAssignableFrom(view, CLASS_REACT_SLIDER_LEGACY)\n                   -> LegacySliderHelper(view as AppCompatSeekBar)\n                ReflectUtils.isAssignableFrom(view, CLASS_REACT_SLIDER_COMMUNITY)\n                    -> CommunitySliderHelper(view as AppCompatSeekBar)\n                else\n                   -> null\n            }\n    }\n}\n\nprivate class LegacySliderHelper(slider: AppCompatSeekBar): ReactSliderHelper(slider) {\n    override fun setProgressJS(valueJS: Float) {\n        val reactSliderManager = Class.forName(CLASS_REACT_SLIDER_LEGACY_MANAGER).newInstance()\n        Reflect.on(reactSliderManager).call(\"updateProperties\", slider, buildStyles(\"value\", valueJS.toDouble()))\n    }\n\n    private fun buildStyles(vararg keysAndValues: Any) = ReactStylesDiffMap(JavaOnlyMap.of(*keysAndValues))\n}\n\nprivate class CommunitySliderHelper(slider: AppCompatSeekBar): ReactSliderHelper(slider) {\n    override fun setProgressJS(valueJS: Float) {\n        val reactSliderManager = Class.forName(CLASS_REACT_SLIDER_COMMUNITY_MANAGER).newInstance()\n        Reflect.on(reactSliderManager).call(\"setValue\", slider, valueJS)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/common/UiControllerImplReflected.kt",
    "content": "package com.wix.detox.espresso.common\n\nimport com.wix.detox.espresso.action.common.utils.getUiController\nimport org.joor.Reflect\n\nprivate const val FIELD_ASYNC_IDLE = \"asyncIdle\"\nprivate const val FIELD_COMPAT_IDLE = \"compatIdle\"\nprivate const val METHOD_IS_IDLE_NOW = \"isIdleNow\"\n\nclass UiControllerImplReflected {\n    fun isAsyncIdleNow(): Boolean =\n        Reflect.on(getUiController()).field(FIELD_ASYNC_IDLE).call(METHOD_IS_IDLE_NOW).get()\n\n    fun isCompatIdleNow(): Boolean =\n        Reflect.on(getUiController()).field(FIELD_COMPAT_IDLE).call(METHOD_IS_IDLE_NOW).get()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/errors/DetoxAmbiguousViewMatcherException.kt",
    "content": "package com.wix.detox.espresso.errors\n\nimport android.view.View\nimport androidx.test.espresso.AmbiguousViewMatcherException\nimport androidx.test.espresso.RootViewException\n\n/**\n * Detox wrapper for AmbiguousViewMatcherException that provides cleaned error messages\n * and preserves the XML hierarchy for debugging.\n */\nclass DetoxAmbiguousViewMatcherException(\n    private val originalException: AmbiguousViewMatcherException,\n    override val xmlHierarchy: String\n) : RuntimeException(DetoxExceptionUtils.cleanEspressoMessage(originalException.message)), RootViewException, DetoxExceptionWithHierarchy {\n\n    override fun getRootView(): View = originalException.rootView\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/errors/DetoxExceptionUtils.kt",
    "content": "package com.wix.detox.espresso.errors\n\n/**\n * Utility class for cleaning and processing Espresso exception messages.\n */\nobject DetoxExceptionUtils {\n    fun cleanEspressoMessage(originalMessage: String?): String {\n        val message = originalMessage ?: \"\"\n        // Remove everything after \"View Hierarchy:\\n\" (including it)\n        return message.substringBefore(\"View Hierarchy:\\n\").trim()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/errors/DetoxExceptionWithHierarchy.kt",
    "content": "package com.wix.detox.espresso.errors\n\n/**\n * Interface for exceptions that provide XML view hierarchy for debugging.\n * Exceptions implementing this interface will have their xmlHierarchy property\n * extracted and used in error reporting.\n */\ninterface DetoxExceptionWithHierarchy {\n    val xmlHierarchy: String\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/errors/DetoxNoMatchingViewException.kt",
    "content": "package com.wix.detox.espresso.errors\n\nimport android.view.View\nimport androidx.test.espresso.NoMatchingViewException\nimport androidx.test.espresso.RootViewException\n\n/**\n * Detox wrapper for NoMatchingViewException that provides cleaned error messages\n * and preserves the XML hierarchy for debugging.\n */\nclass DetoxNoMatchingViewException(\n    private val originalException: NoMatchingViewException,\n    override val xmlHierarchy: String\n) : RuntimeException(DetoxExceptionUtils.cleanEspressoMessage(originalException.message)), RootViewException, DetoxExceptionWithHierarchy {\n\n    override fun getRootView(): View = originalException.rootView\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/hierarchy/RootViewsHelper.kt",
    "content": "package com.wix.detox.espresso.hierarchy\n\nimport android.annotation.SuppressLint\nimport android.view.View\nimport java.lang.reflect.Field\nimport java.lang.reflect.Method\n\nobject RootViewsHelper {\n\n    /**\n     * Get rootviews from RootViewImpl instances that are stored in WindowManagerGlobal.\n     */\n    fun getRootViews(): List<View?>? {\n        val rootViewsReflectedObjects = getAllViewRootObjects()\n        val rootViews = rootViewsReflectedObjects?.map {\n            // Root View is stored in the ViewRootImpl instance\n            val getViewMethod = it.javaClass.getDeclaredMethod(\"getView\")\n            getViewMethod.isAccessible = true\n\n            // Invoke the method to get the root View\n            getViewMethod.invoke(it) as? View\n        }\n        return rootViews\n    }\n\n    @SuppressLint(\"PrivateApi\", \"DiscouragedPrivateApi\")\n    private fun getAllViewRootObjects(): List<Any>? {\n        return try {\n            // Get the WindowManagerGlobal class\n            val windowManagerGlobalClass = Class.forName(\"android.view.WindowManagerGlobal\")\n\n            // Get the getInstance method\n            val getInstanceMethod: Method = windowManagerGlobalClass.getDeclaredMethod(\"getInstance\")\n            getInstanceMethod.isAccessible = true\n\n            // Get the single instance of WindowManagerGlobal\n            val windowManagerGlobal = getInstanceMethod.invoke(null)\n\n            // Get the mRoots field, which is a list of ViewRootImpl instances\n            val mRootsField: Field = windowManagerGlobalClass.getDeclaredField(\"mRoots\")\n            mRootsField.isAccessible = true\n\n            // Return the list of ViewRootImpl instances\n            @Suppress(\"UNCHECKED_CAST\")\n            mRootsField.get(windowManagerGlobal) as? List<Any>\n        } catch (e: Exception) {\n            e.printStackTrace()\n            null\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/hierarchy/ViewHierarchyGenerator.kt",
    "content": "package com.wix.detox.espresso.hierarchy\n\nimport android.util.DisplayMetrics\nimport android.util.Xml\nimport android.view.View\nimport android.view.ViewGroup\nimport android.webkit.WebView\nimport android.widget.TextView\nimport com.wix.detox.espresso.DeviceDisplay\nimport com.wix.detox.reactnative.ui.getAccessibilityLabel\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.runBlocking\nimport kotlinx.coroutines.suspendCancellableCoroutine\nimport kotlinx.coroutines.withContext\nimport org.xmlpull.v1.XmlSerializer\nimport java.io.StringWriter\nimport kotlin.coroutines.resume\n\n\nprivate const val GET_HTML_SCRIPT = \"\"\"\n(function() {\n    const blacklistedTags = ['script', 'style', 'head', 'meta'];\n    const blackListedTagsSelector = blacklistedTags.join(',');\n\n    // Clone the entire document\n    var clonedDoc = document.documentElement.cloneNode(true);\n\n    // Remove all <script> and <style> tags from the cloned document\n    var scripts = clonedDoc.querySelectorAll(blackListedTagsSelector);\n    scripts.forEach(function(script) {\n        script.remove();\n    });\n\n    // Create an instance of XMLSerializer\n    var serializer = new XMLSerializer();\n\n    // Serialize the cloned DOM to a string\n    var serializedHtml = serializer.serializeToString(clonedDoc);\n\n    // Return the serialized HTML as a string\n    return serializedHtml;\n})();\n\"\"\"\n\nobject ViewHierarchyGenerator {\n    @JvmStatic\n    fun generateXml(shouldInjectTestIds: Boolean): String {\n        return runBlocking {\n            val rootViews = RootViewsHelper.getRootViews()\n            generateXmlFromViews(rootViews, shouldInjectTestIds)\n        }\n    }\n\n    @JvmStatic\n    fun generateXml(rootView: View, shouldInjectTestIds: Boolean): String {\n        return runBlocking {\n            generateXmlFromViews(listOf(rootView), shouldInjectTestIds)\n        }\n    }\n\n    private suspend fun generateXmlFromViews(rootViews: List<View?>?, shouldInjectTestIds: Boolean): String {\n        return StringWriter().use { writer ->\n            val serializer = Xml.newSerializer().apply {\n                setOutput(writer)\n                startDocument(Xml.Encoding.UTF_8.name, true)\n                setFeature(\"http://xmlpull.org/v1/doc/features.html#indent-output\", true)\n                startTag(\"\", \"ViewHierarchy\")\n                attribute(\"\", \"density\", DeviceDisplay.getDensity().toString())\n            }\n\n            rootViews?.forEach { rootView ->\n                rootView?.let {\n                    serializeViewHierarchy(it, serializer, shouldInjectTestIds, emptyList())\n                }\n            }\n\n            serializer.apply {\n                endTag(\"\", \"ViewHierarchy\")\n                endDocument()\n            }\n\n            writer.toString()\n        }\n    }\n\n    private suspend fun serializeViewHierarchy(\n        view: View,\n        serializer: XmlSerializer,\n        shouldInjectTestIds: Boolean,\n        indexPath: List<Int>\n    ) {\n        serializer.startTag(\"\", view.javaClass.simpleName)\n        serializeViewAttributes(view, serializer, shouldInjectTestIds, indexPath)\n\n        when (view) {\n            is WebView -> serializeWebView(view, serializer)\n            is ViewGroup -> serializeViewGroupChildren(view, serializer, shouldInjectTestIds, indexPath)\n        }\n\n        serializer.endTag(\"\", view.javaClass.simpleName)\n    }\n\n    private suspend fun serializeWebView(\n        webView: WebView,\n        serializer: XmlSerializer,\n    ) {\n        val html = getWebViewHtml(webView)\n        serializer.cdsect(html)\n    }\n\n    private suspend fun getWebViewHtml(webView: WebView): String = withContext(Dispatchers.Main) {\n        suspendCancellableCoroutine { cancellableContinuation ->\n            webView.evaluateJavascript(GET_HTML_SCRIPT) { html ->\n                cancellableContinuation.resume(html.unescapeUnicodeString())\n            }\n        }\n    }\n\n    private fun String.unescapeUnicodeString(): String {\n        // Replace all Unicode escape sequences (e.g., \\u003C -> <)\n        return this\n            .replace(\"\\\\u003C\", \"<\")\n            .replace(\"\\\\u003E\", \">\")\n            .replace(\"\\\\u0022\", \"\\\"\")\n            .replace(\"\\\\u0027\", \"'\")\n            .replace(\"\\\\u0026\", \"&\")\n            .replace(\"\\\\u003D\", \"=\")\n            .replace(\"\\\\u002F\", \"/\")\n            .replace(\"\\\\n\", \"\\n\")\n    }\n\n    private suspend fun serializeViewGroupChildren(\n        view: ViewGroup,\n        serializer: XmlSerializer,\n        shouldInjectTestIds: Boolean,\n        indexPath: List<Int>\n    ) {\n        for (i in 0 until view.childCount) {\n            serializeViewHierarchy(\n                view.getChildAt(i),\n                serializer,\n                shouldInjectTestIds,\n                indexPath + i\n            )\n        }\n    }\n\n    private fun serializeViewAttributes(\n        view: View,\n        serializer: XmlSerializer,\n        shouldInjectTestIds: Boolean,\n        indexPath: List<Int>\n    ) {\n        val attributes = mutableMapOf(\n            \"class\" to view.javaClass.name,\n            \"width\" to view.width.toString(),\n            \"height\" to view.height.toString(),\n            \"visibility\" to view.visibilityToString(),\n            \"alpha\" to view.alpha.toString(),\n            \"focused\" to view.isFocused.toString(),\n            \"value\" to (view.contentDescription?.toString() ?: \"\"),\n            \"label\" to (view.getAccessibilityLabel()?.toString() ?: \"\")\n        )\n\n        val location = IntArray(2).apply { view.getLocationInWindow(this) }\n        attributes[\"x\"] = location[0].toString()\n        attributes[\"y\"] = location[1].toString()\n\n        if (view is TextView) {\n            attributes[\"text\"] = view.text.toString()\n        }\n\n        val currentTestId = view.tag?.toString() ?: \"\"\n\n        val injectedPrefix = \"detox_temp_\"\n        val isTestIdEmpty = currentTestId.isEmpty()\n        val isTestIdInjected = currentTestId.startsWith(injectedPrefix)\n        val shouldInjectNewTestId = shouldInjectTestIds && (isTestIdEmpty || isTestIdInjected)\n\n        if (shouldInjectNewTestId) {\n            val newTestId = \"${injectedPrefix}${indexPath.joinToString(\"_\")}\"\n            view.tag = newTestId\n            attributes[\"id\"] = newTestId\n        } else {\n            attributes[\"id\"] = currentTestId\n        }\n\n        attributes\n            .filter { (_, value) ->\n                !value.isNullOrEmpty()\n            }\n            .forEach { (key, value) ->\n                serializer.attribute(\"\", key, value)\n            }\n    }\n\n    private fun View.visibilityToString() = when (visibility) {\n        View.VISIBLE -> \"visible\"\n        View.INVISIBLE -> \"invisible\"\n        View.GONE -> \"gone\"\n        else -> \"unknown\"\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/idlingresources/DescriptiveIdlingResource.kt",
    "content": "package com.wix.detox.espresso.idlingresources\n\nimport androidx.test.espresso.IdlingResource\n\ninterface DescriptiveIdlingResource: IdlingResource {\n    fun getDebugName(): String\n    fun getBusyHint(): Map<String, Any>?\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/matcher/IsDisplayingAtLeastDetoxMatcher.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport android.R\nimport android.annotation.SuppressLint\nimport android.content.Context\nimport android.graphics.Rect\nimport android.util.DisplayMetrics\nimport android.util.TypedValue\nimport android.view.View\nimport android.view.WindowManager\nimport androidx.test.espresso.matcher.ViewMatchers\nimport org.hamcrest.Description\nimport org.hamcrest.TypeSafeDiagnosingMatcher\nimport kotlin.math.abs\nimport kotlin.math.min\n\n/**\n * This matcher is a workaround for the issue with the `isDisplayingAtLeast` matcher.\n * Because of an issue with [View.getGlobalVisibleRect], the `isDisplayingAtLeast` matcher does not work\n * as expected with React Native views.\n * @see [React Native Issue](https://github.com/facebook/react-native/issues/23870)\n * The implementation of this matcher is based on the [isDisplayingAtLeast] matcher.\n *\n * This hack can be removed after proper fix in React Native.\n */\nclass IsDisplayingAtLeastDetoxMatcher(private val areaPercentage: Int) : TypeSafeDiagnosingMatcher<View>() {\n\n    private val visibilityMatchers = ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)\n\n    override fun describeTo(description: Description) {\n        description\n            .appendText(\"(\")\n            .appendDescriptionOf(visibilityMatchers)\n            .appendText(\" and view.getGlobalVisibleRect() covers at least \")\n            .appendValue(areaPercentage)\n            .appendText(\" percent of the view's area)\")\n    }\n\n    override fun matchesSafely(item: View, mismatchDescription: Description): Boolean {\n        // First check if the view is visible using the default matcher\n        if (!ViewMatchers.isDisplayingAtLeast(areaPercentage).matches(item)) {\n            return false\n        }\n\n        // In case it is, we need to check if the view is actually visible by running intersection of all parent views rects\n        return isDisplayingAtLeast(item, mismatchDescription)\n    }\n\n    private fun isDisplayingAtLeast(view: View, mismatchDescription: Description): Boolean {\n        val viewVisibleRect = getGlobalVisibleRectWorkaround(view)\n        val maxArea = getViewMaxArea(view)\n        val visibleArea: Double = getViewVisibleArea(viewVisibleRect)\n        val displayedPercentage = (visibleArea / maxArea * 100).toInt()\n\n        if (displayedPercentage < areaPercentage) {\n            mismatchDescription\n                .appendText(\"view was \")\n                .appendValue(displayedPercentage)\n                .appendText(\" percent visible to the user\")\n            return false\n        }\n        return true\n    }\n\n    /**\n     * Calculate the actual visible area of the view.\n     */\n    private fun getViewVisibleArea(viewVisibleRect: Rect): Double {\n        return (viewVisibleRect.height() * viewVisibleRect.width()).toDouble()\n    }\n\n    /**\n     * Calculate the maximum possible area of the view (including the not visible part).\n     */\n    private fun getViewMaxArea(view: View): Double {\n        val (viewWidth, viewHeight) = getViewSize(view)\n        return viewWidth * viewHeight\n    }\n\n    /**\n     * Calculate the actual size of the view, taking into account the scaling factor and the screen size.\n     */\n    private fun getViewSize(view: View): Pair<Double, Double> {\n        val screenSize = getScreenWithoutStatusBarActionBar(view)\n        val viewWidth = min((view.width * abs(view.scaleX.toDouble())), screenSize.width().toDouble())\n        val viewHeight = min((view.height * abs(view.scaleY.toDouble())), screenSize.height().toDouble())\n        return Pair(viewWidth, viewHeight)\n    }\n\n    /**\n     * Traverse the view hierarchy and calculate the intersection of all parent views with the given view.\n     *\n     * @return The actual visible rectangle of the view.\n     */\n    private fun getGlobalVisibleRectWorkaround(view: View): Rect {\n        var currentParent = view.parent as? View\n\n        val calculatedVisibleRect = Rect()\n        view.getGlobalVisibleRect(calculatedVisibleRect)\n\n        while (currentParent != null) {\n            val parentVisibleRectangle = Rect()\n            // Fill the visible rectangle of the parent view\n            currentParent.getGlobalVisibleRect(parentVisibleRectangle)\n\n            // The viewVisibleRect will be replaced with the intersection of the viewVisibleRect and the parentVisibleRectangle\n            if (!calculatedVisibleRect.intersect(parentVisibleRectangle)) {\n                return Rect()\n            }\n\n            currentParent = currentParent.parent as? View\n        }\n\n        return calculatedVisibleRect\n    }\n\n    private fun getScreenWithoutStatusBarActionBar(view: View): Rect {\n        val m = DisplayMetrics()\n        (view.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager)\n            .defaultDisplay\n            .getMetrics(m)\n\n        val statusBarHeight = getStatusBarHeightPixels(view)\n        val actionBarHeight = getActionBarHeight(view)\n        return Rect(0, 0, m.widthPixels, m.heightPixels - (statusBarHeight + actionBarHeight))\n    }\n\n    private fun getActionBarHeight(view: View): Int {\n        val tv = TypedValue()\n        val actionBarHeight = if (view.context.theme.resolveAttribute(R.attr.actionBarSize, tv, true)) {\n            TypedValue.complexToDimensionPixelSize(\n                tv.data, view.context.resources.displayMetrics\n            )\n        } else {\n            0\n        }\n        return actionBarHeight\n    }\n\n    @SuppressLint(\"InternalInsetResource\", \"DiscouragedApi\")\n    private fun getStatusBarHeightPixels(view: View): Int {\n        val resourceId = view.context.resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\")\n        return if (resourceId > 0) view.context.resources.getDimensionPixelSize(resourceId) else 0\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/matcher/RegexMatcher.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport org.hamcrest.Description\nimport org.hamcrest.TypeSafeMatcher\n\nclass RegexMatcher<T>(private val jsRegex: String) : TypeSafeMatcher<T>() {\n    override fun matchesSafely(item: T): Boolean {\n        val stringItem = item.toString()\n        return stringItem.matchesJSRegex(jsRegex)\n    }\n\n    override fun describeTo(description: Description) {\n        description.appendText(\"should match the pattern: $jsRegex\")\n    }\n}\n\n// Returns whether the whole string matches the given `jsRegex`.\n// JS flags has the format of `/<pattern>/<flags>`.\n// Flags can be either:\n// - i: With this flag the search is case-insensitive: no difference between A and a (see the example below).\n// - s: Enables “dotall” mode, that allows a dot . to match newline character \\n (covered in the chapter Character classes).\n// - m: Multiline mode (covered in the chapter Multiline mode of anchors ^ $, flag \"m\").\n// Other flags (e.g. g,u,s) are not supported as they do not have equivalents in Kotlin.\n//\n// - See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\nfun String.matchesJSRegex(jsRegex: String): Boolean {\n    val flagsChars = getRegexFlags(jsRegex)\n    val options = getRegexOptions(flagsChars)\n    val pattern = getRegexPattern(jsRegex)\n    return Regex(pattern, options).matches(this)\n}\n\nprivate fun getRegexFlags(jsRegex: String): CharSequence {\n    return jsRegex.substringAfterLast(\"/\")\n}\n\nprivate fun getRegexPattern(jsRegex: String): String {\n    val pattern = jsRegex.substringAfter(\"/\")\n    return pattern.substringBeforeLast(\"/\")\n}\n\nprivate fun getRegexOptions(flagsChars: CharSequence): MutableSet<RegexOption> {\n    val options = mutableSetOf<RegexOption>()\n\n    if (flagsChars.contains('i', ignoreCase = true)) {\n        options.add(RegexOption.IGNORE_CASE)\n    }\n    if (flagsChars.contains('s', ignoreCase = true)) {\n        options.add(RegexOption.DOT_MATCHES_ALL)\n    }\n    if (flagsChars.contains('m', ignoreCase = true)) {\n        options.add(RegexOption.MULTILINE)\n    }\n\n    return options\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewAtIndexMatcher.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport android.view.View\nimport org.hamcrest.BaseMatcher\nimport org.hamcrest.Description\nimport org.hamcrest.Matcher\n\nclass ViewAtIndexMatcher(private val index: Int, private val innerMatcher: Matcher<View>) : BaseMatcher<View>() {\n    private var foundMatch = false\n    private var count = 0\n\n    override fun matches(item: Any): Boolean {\n        if (!innerMatcher.matches(item) || foundMatch) return false\n\n        if (count == index) {\n            foundMatch = true\n            return true\n        }\n        ++count\n        return false\n    }\n\n    override fun describeTo(description: Description) {\n        description.appendText(\"View at index #$index, of those matching MATCHER$innerMatcher\")\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt",
    "content": "@file:JvmName(\"ViewMatchers\")\n\npackage com.wix.detox.espresso.matcher\n\nimport android.view.View\nimport androidx.appcompat.widget.AppCompatSeekBar\nimport androidx.test.espresso.matcher.BoundedMatcher\nimport androidx.test.espresso.matcher.ViewMatchers\nimport androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility\nimport com.wix.detox.espresso.common.ReactSliderHelper\nimport org.hamcrest.*\nimport org.hamcrest.Matchers.*\nimport kotlin.math.abs\nimport org.hamcrest.CoreMatchers.`is`\n\n/*\n * An extension of [androidx.test.espresso.matcher.ViewMatchers].\n */\nfun <T> getRelevantMatcher(value: T, isRegex: Boolean): Matcher<T> =\n    if (isRegex) RegexMatcher(value.toString()) else `is`(value)\n\nfun withAccessibilityLabel(text: String, isRegex: Boolean): Matcher<View> =\n    WithAccessibilityLabelMatcher(getRelevantMatcher(text, isRegex))\n\nfun withShallowAccessibilityLabel(label: String, isRegex: Boolean): Matcher<View> =\n    anyOf(withContentDescription(label, isRegex), withText(label, isRegex))\n\nfun withText(text: String, isRegex: Boolean): Matcher<View> =\n    ViewMatchers.withText(getRelevantMatcher(text, isRegex))\n\nfun withContentDescription(label: String, isRegex: Boolean): Matcher<View> =\n    ViewMatchers.withContentDescription(getRelevantMatcher(label, isRegex))\n\nfun withTagValue(testId: String, isRegex: Boolean): Matcher<View> =\n    ViewMatchers.withTagValue(getRelevantMatcher<Any>(testId, isRegex))\n\nfun isOfClassName(className: String): Matcher<View> {\n    try {\n        val cls = Class.forName(className)\n        return allOf(IsAssignableFromMatcher(cls), withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))\n    } catch (e: ClassNotFoundException) {\n        // empty\n    }\n\n    return object : BaseMatcher<View>() {\n        override fun matches(item: Any) = false\n        override fun describeTo(description: Description) {\n            description.appendText(\"Class $className not found on classpath. Are you using full class name?\")\n        }\n    }\n}\n\nfun isMatchingAtIndex(index: Int, innerMatcher: Matcher<View>): Matcher<View> =\n    ViewAtIndexMatcher(index, innerMatcher)\n\nfun toHaveSliderPosition(expectedValuePct: Double, tolerance: Double): Matcher<View?> =\n    object: BoundedMatcher<View?, AppCompatSeekBar>(AppCompatSeekBar::class.java) {\n        override fun describeTo(description: Description) {\n            description.appendText(\"sliderPositionPercent($expectedValuePct)\")\n        }\n\n        override fun matchesSafely(view: AppCompatSeekBar): Boolean {\n            val sliderHelper = ReactSliderHelper.create(view)\n            val progressPct = sliderHelper.getCurrentProgressPct()\n            return (abs(progressPct - expectedValuePct) <= tolerance)\n        }\n    }\n\nfun matcherForDisplayingAtLeast(percents: Int): Matcher<View> =\n    IsDisplayingAtLeastDetoxMatcher(percents)\n\n/**\n * Same as [androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom], but accepts any class. Needed\n * in order to avoid warning when passing 'any' class.\n * [TypeSafeMatcher] does the View-class type matching for us.\n */\nprivate class IsAssignableFromMatcher(private val clazz: Class<*>) : TypeSafeMatcher<View>() {\n    public override fun matchesSafely(view: View) = clazz.isAssignableFrom(view.javaClass)\n    override fun describeTo(description: Description) {\n        description.appendText(\"is assignable from class: $clazz\")\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/matcher/WithAccessibilityLabelMatcher.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport android.view.View\nimport com.wix.detox.reactnative.ui.getAccessibilityLabel\nimport org.hamcrest.Description\nimport org.hamcrest.Matcher\nimport org.hamcrest.TypeSafeDiagnosingMatcher\n\nclass WithAccessibilityLabelMatcher(private val textMatcher: Matcher<String>): TypeSafeDiagnosingMatcher<View>() {\n    override fun matchesSafely(view: View, mismatchDescription: Description): Boolean =\n        view.getAccessibilityLabel().let { contentDescription ->\n            return textMatcher.matches(contentDescription).also { matched ->\n                if (!matched) {\n                    mismatchDescription.appendText(\"view.getAccessibilityLabel() \")\n                    textMatcher.describeMismatch(contentDescription, mismatchDescription)\n                }\n            }\n        }\n\n    override fun describeTo(description: Description) {\n        description.appendText(\"view.getAccessibilityLabel() \").appendDescriptionOf(textMatcher)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/performer/MultipleViewsActionPerformer.kt",
    "content": "package com.wix.detox.espresso.performer\n\nimport com.wix.detox.espresso.DetoxMatcher\nimport com.wix.detox.espresso.ViewActionWithResult\nimport com.wix.detox.espresso.errors.DetoxNoMatchingViewException\n\nimport android.view.View\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.ViewAction\nimport org.hamcrest.Matcher\n\nclass MultipleViewsActionPerformer(\n    private val action: ViewAction\n) : ViewActionPerformer {\n    override fun performOn(matcher: Matcher<View>): Any? {\n        val results = mutableListOf<Any?>()\n        var index = 0\n\n        while (true) {\n            val indexedMatcher = DetoxMatcher.matcherForAtIndex(index, matcher)\n\n            try {\n                onView(indexedMatcher).perform(action)\n\n                (action as? ViewActionWithResult<*>)?.getResult()?.let { results.add(it) }\n\n                index++\n            } catch (e: DetoxNoMatchingViewException) {\n                if (index == 0) {\n                    throw e\n                }\n\n                break\n            }\n        }\n\n        return when {\n            results.isEmpty() -> null\n            results.size == 1 -> results.first()\n            else -> mapOf(\"elements\" to results)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/performer/SingleViewActionPerformer.kt",
    "content": "package com.wix.detox.espresso.performer\n\nimport com.wix.detox.espresso.ViewActionWithResult\n\nimport android.view.View\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.NoMatchingViewException\nimport androidx.test.espresso.ViewAction\nimport org.hamcrest.Matcher\n\nclass SingleViewActionPerformer(\n    private val action: ViewAction\n) : ViewActionPerformer {\n    override fun performOn(matcher: Matcher<View>): Any? {\n        onView(matcher).perform(action)\n\n        return (action as? ViewActionWithResult<*>)?.getResult()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/performer/ViewActionPerformer.kt",
    "content": "package com.wix.detox.espresso.performer\n\nimport com.wix.detox.espresso.MultipleViewsAction\n\nimport android.view.View\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.NoMatchingViewException\nimport androidx.test.espresso.ViewAction\nimport org.hamcrest.Matcher\n\ninterface ViewActionPerformer {\n    fun performOn(matcher: Matcher<View>): Any?\n\n    companion object {\n        @JvmStatic\n        fun forAction(action: ViewAction): ViewActionPerformer {\n            return if (action is MultipleViewsAction) {\n                MultipleViewsActionPerformer(action)\n            } else {\n                SingleViewActionPerformer(action)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/registry/BusyResourcesInquirer.kt",
    "content": "package com.wix.detox.espresso.registry\n\nimport androidx.test.espresso.Espresso\nimport androidx.test.espresso.base.IdlingResourceRegistry\nimport com.wix.detox.common.UIThread\nimport com.wix.detox.espresso.common.UiControllerImplReflected\nimport com.wix.detox.inquiry.DetoxBusyResource\nimport com.wix.detox.inquiry.DetoxBusyResource.BusyAsyncTasks\nimport com.wix.detox.inquiry.DetoxBusyResource.BusyIdlingResource\nimport org.joor.Reflect\nimport java.util.concurrent.Callable\n\n// TODO Better to split inquiry to two separate classes running under the single `UIThread.postFirstSync()` we have here.\nclass BusyResourcesInquirer(\n    private val registry: IdlingResourceRegistry,\n    private val uiControllerImplReflected: UiControllerImplReflected\n) {\n    fun getAllBusyResources(): List<DetoxBusyResource> {\n        return UIThread.postFirstSync(Callable<List<DetoxBusyResource>> {\n            mutableListOf<DetoxBusyResource>().apply {\n                addAll(getBusyIdlingResources())\n                addAll(getAsyncTasksResource()?.let { listOf(it) } ?: emptyList())\n            }\n        })\n    }\n\n    private fun getBusyIdlingResources(): List<BusyIdlingResource> =\n        registry.resources\n            .filter { !it.isIdleNow }\n            .map { BusyIdlingResource(it) }\n\n    private fun getAsyncTasksResource(): BusyAsyncTasks? {\n        // Mind the implicit optimization:\n        // Don't inspect both resources if not necessary (async-tasks is not idle).\n        if (uiControllerImplReflected.isAsyncIdleNow() &&\n            uiControllerImplReflected.isCompatIdleNow()) {\n            return null\n        }\n        return BusyAsyncTasks\n    }\n\n    companion object {\n        val INSTANCE = BusyResourcesInquirer(getRegistryDefault(), UiControllerImplReflected())\n    }\n}\n\nprivate fun getRegistryDefault() =\n    Reflect.on(Espresso::class.java).get<IdlingResourceRegistry>(\"baseRegistry\")\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java",
    "content": "package com.wix.detox.espresso.web;\n\n\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.findMultipleElements;\n\nimport androidx.test.espresso.web.model.Atom;\nimport androidx.test.espresso.web.model.ElementReference;\nimport androidx.test.espresso.web.webdriver.Locator;\n\nimport java.util.List;\n\npublic class DetoxWebAtomMatcher {\n\n    private DetoxWebAtomMatcher() {\n        // static class\n    }\n\n    public static Atom<List<ElementReference>> matcherForId(String id) {\n        return findMultipleElements(Locator.ID, id);\n    }\n\n    public static Atom<List<ElementReference>> matcherForClassName(String className) {\n        return findMultipleElements(Locator.CLASS_NAME, className);\n    }\n\n    public static Atom<List<ElementReference>> matcherForCssSelector(String cssSelector) {\n        return findMultipleElements(Locator.CSS_SELECTOR, cssSelector);\n    }\n\n    public static Atom<List<ElementReference>> matcherForName(String name) {\n        return findMultipleElements(Locator.NAME, name);\n    }\n\n    public static Atom<List<ElementReference>> matcherForXPath(String xpath) {\n        return findMultipleElements(Locator.XPATH, xpath);\n    }\n\n    public static Atom<List<ElementReference>> matcherForLinkText(String linkText) {\n        return findMultipleElements(Locator.LINK_TEXT, linkText);\n    }\n\n    public static Atom<List<ElementReference>> matcherForPartialLinkText(String partialLinkText) {\n        return findMultipleElements(Locator.PARTIAL_LINK_TEXT, partialLinkText);\n    }\n\n    public static Atom<List<ElementReference>> matcherForTagName(String tag) {\n        return findMultipleElements(Locator.TAG_NAME, tag);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/web/EspressoWebDetox.java",
    "content": "package com.wix.detox.espresso.web;\n\nimport android.view.View;\n\nimport org.hamcrest.Matcher;\n\nimport javax.annotation.Nullable;\n\npublic class EspressoWebDetox {\n\n    private static final String TAG = \"EspressoWebDetox\";\n\n    private EspressoWebDetox() {\n        // static class\n    }\n\n    /**\n     * Gets the one and only visible webview on the screen.\n     * If there are multiple webview, you should use {@code getWebView(@Nullable Matcher<View> matcher)}.\n     * @return {@link WebViewElement}\n     */\n    public static WebViewElement getWebView() {\n        return getWebView(null);\n    }\n\n    /**\n     * Get the webview matches the provided {@param matcher}\n     * @param matcher a webview mathcer representation\n     * @return {@link WebViewElement}\n     */\n    public static WebViewElement getWebView(@Nullable Matcher<View> matcher) {\n        return new WebViewElement(matcher);\n    }\n\n    /**\n     * @param webElement\n     * @return {@link WebExpect}\n     */\n    public static WebExpect expect(WebElement webElement) {\n        return new WebExpect(webElement);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java",
    "content": "package com.wix.detox.espresso.web;\n\nimport androidx.test.espresso.web.model.Atom;\nimport androidx.test.espresso.web.model.Atoms;\nimport androidx.test.espresso.web.model.ElementReference;\nimport androidx.test.espresso.web.model.SimpleAtom;\nimport androidx.test.espresso.web.sugar.Web;\nimport androidx.test.espresso.web.webdriver.DriverAtoms;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.TimeUnit;\n\npublic class WebElement {\n\n    final WebViewElement webViewElement;\n    final Atom<List<ElementReference>> matcherAtom;\n    final int index;\n\n    WebElement(WebViewElement webViewElement, Atom<List<ElementReference>> matcherAtom, int index) {\n        this.webViewElement = webViewElement;\n        this.matcherAtom = matcherAtom;\n        this.index = index;\n    }\n\n    Web.WebInteraction<Void> getWebViewInteraction() {\n        return webViewElement.webViewInteraction;\n    }\n\n    ElementReference get() {\n        List<ElementReference> elements = getWebViewInteraction().withTimeout(30, TimeUnit.SECONDS).perform(matcherAtom).get();\n\n        if (elements == null || elements.size() == 0 || index >= elements.size()) {\n            throw new RuntimeException(String.format(\"element was not found at index: %d\", index));\n        }\n\n        return elements.get(index);\n    }\n\n    public void tap() {\n        getWebViewInteraction().withElement(get()).perform(DriverAtoms.webClick());\n    }\n\n    public void typeText(String text) {\n        getWebViewInteraction().withElement(get()).perform(DriverAtoms.webKeys(text));\n    }\n\n    public void replaceText(String text) {\n        clearText();\n        getWebViewInteraction().withElement(get()).perform(DriverAtoms.webKeys(text));\n    }\n\n    public void clearText() {\n        getWebViewInteraction().withElement(get()).perform(DriverAtoms.clearElement());\n    }\n\n    public boolean scrollToView() {\n        return getWebViewInteraction().withElement(get()).perform(DriverAtoms.webScrollIntoView()).get();\n    }\n\n    public String getText() {\n        return getWebViewInteraction().withElement(get()).perform(DriverAtoms.getText()).get();\n    }\n\n    public Object runScript(String script) {\n        return getWebViewInteraction().withElement(get()).perform(new SimpleAtom(script)).get().getValue();\n    }\n\n    public Object runScriptWithArgs(String script, final ArrayList<Object> args) {\n        return getWebViewInteraction().withElement(get()).perform(Atoms.scriptWithArgs(script, args)).get().getValue();\n    }\n\n    public String getCurrentUrl() {\n        return getWebViewInteraction().withElement(get()).perform(Atoms.getCurrentUrl()).get();\n    }\n\n    public String getTitle() {\n        return getWebViewInteraction().withElement(get()).perform(Atoms.getTitle()).get();\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebExpect.java",
    "content": "package com.wix.detox.espresso.web;\n\nimport androidx.test.espresso.web.model.ElementReference;\nimport androidx.test.espresso.web.sugar.Web;\n\nimport java.util.Collections;\n\nimport static androidx.test.espresso.web.assertion.WebViewAssertions.webMatches;\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.getText;\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.not;\n\npublic class WebExpect {\n    final WebElement webElement;\n\n    WebExpect(WebElement webElement) {\n        this.webElement = webElement;\n    }\n\n    private Web.WebInteraction<Void> webViewInteraction() {\n        return webElement.getWebViewInteraction();\n    }\n\n    public void toNotExist() {\n        webViewInteraction().check(webMatches(webElement.matcherAtom, equalTo(Collections.<ElementReference>emptyList())));\n    }\n\n    public void toExist() {\n        webViewInteraction().check(webMatches(webElement.matcherAtom, not(equalTo(Collections.<ElementReference>emptyList()))));\n    }\n\n    public void toHaveText(String text) {\n        webViewInteraction().withElement(webElement.get()).check(webMatches(getText(), containsString(text)));\n    }\n\n    public void toNotHaveText(String text) {\n        webViewInteraction().withElement(webElement.get()).check(webMatches(getText(), not(containsString(text))));\n    }\n}"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java",
    "content": "package com.wix.detox.espresso.web;\n\nimport static androidx.test.espresso.web.sugar.Web.onWebView;\n\nimport android.view.View;\nimport android.webkit.WebView;\n\nimport androidx.test.espresso.web.model.Atom;\nimport androidx.test.espresso.web.model.ElementReference;\nimport androidx.test.espresso.web.sugar.Web;\n\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\n\nimport java.util.List;\n\nimport javax.annotation.Nullable;\n\npublic class WebViewElement {\n\n    private final static String WRAPPER_WEBVIEW_CLASS_NAME = \"RNCWebViewWrapper\";\n\n    final Web.WebInteraction<Void> webViewInteraction;\n\n    WebViewElement(@Nullable Matcher<View> userMatcher) {\n        Matcher<View> matcher = null;\n\n        if (userMatcher != null) {\n            matcher = new TypeSafeMatcher<>() {\n\n                @Override\n                protected boolean matchesSafely(View item) {\n                    // Support for react-native-webview >= 13.0.0\n                    if (item instanceof WebView && item.getParent().getClass().getSimpleName().equals(WRAPPER_WEBVIEW_CLASS_NAME)) {\n                        return userMatcher.matches(item.getParent());\n                    }\n\n                    if (item.getClass().getSimpleName().equals(\"RNCWebViewWrapper\")) {\n                        // We never want to match the wrapper of the webview\n                        return false;\n                    }\n\n                    return userMatcher.matches(item);\n                }\n\n                @Override\n                public void describeTo(Description description) {\n                    userMatcher.describeTo(description);\n                }\n            };\n        }\n        this.webViewInteraction = matcher != null ? onWebView(matcher) : onWebView();\n    }\n\n    public WebElement element(Atom<List<ElementReference>> webMatcher) {\n        return element(webMatcher, 0);\n    }\n\n    public WebElement element(Atom<List<ElementReference>> webMatcher, int index) {\n        return new WebElement(this, webMatcher, index);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/genymotion/DetoxGenymotionManager.java",
    "content": "package com.wix.detox.genymotion;\n\nimport android.content.Context;\n\nimport androidx.test.platform.app.InstrumentationRegistry;\n\nimport com.genymotion.api.GenymotionManager;\n\npublic class DetoxGenymotionManager {\n    public static void setLocation(double lat, double lon) {\n         GenymotionManager genymotion = getGenymotionManager();\n         genymotion.getGps().setLatitude(lat).setLongitude(lon);\n    }\n\n    private static GenymotionManager getGenymotionManager() {\n        Context context = InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();\n        return GenymotionManager.getGenymotionManager(context);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/inquiry/DetoxBusyResource.kt",
    "content": "package com.wix.detox.inquiry\n\nimport androidx.test.espresso.IdlingResource\nimport com.wix.detox.espresso.idlingresources.DescriptiveIdlingResource\n\nsealed class DetoxBusyResource {\n    abstract fun getDescription(): DetoxBusyResourceDescription\n\n    class BusyIdlingResource(val resource: IdlingResource): DetoxBusyResource() {\n        override fun getDescription() =\n            when {\n                (resource is DescriptiveIdlingResource) ->\n                    getIRDescription(resource)\n\n                (resource.javaClass.name.contains(\"LooperIdlingResource\")) ->\n                    getLooperResourceDescriptionByName(resource.name)\n\n                else ->\n                    getUnspecifiedResourceDescription(resource)\n            }\n\n        private fun getIRDescription(resource: DescriptiveIdlingResource) =\n            DetoxBusyResourceDescription.Builder()\n                .name(resource.getDebugName())\n                .apply {\n                    resource.getBusyHint()?.let {\n                        it.forEach { hint -> addDescription(hint.key, hint.value) }\n                    }\n                }\n                .build()\n\n        private fun getLooperResourceDescriptionByName(resourceName: String) =\n            when {\n                isJSCodeExecution(resourceName) -> {\n                    getLooperResourceDesc(\n                        thread = \"\\\"${resourceName}\\\" (JS Thread)\",\n                        executionType = \"JavaScript code\"\n                    )\n                }\n                isNativeCodeExecution(resourceName) -> {\n                    getLooperResourceDesc(\n                        thread = \"\\\"${resourceName}\\\" (Native Modules Thread)\",\n                        executionType = \"native module calls\"\n                    )\n                }\n                else -> {\n                    getLooperResourceDesc(\n                        thread = \"\\\"${resourceName}\\\"\"\n                    )\n                }\n            }\n\n        private fun getUnspecifiedResourceDescription(resource: IdlingResource) =\n            DetoxBusyResourceDescription.Builder()\n                .name(\"unknown\")\n                .addDescription(\"identifier\", resource.name)\n                .build()\n\n        /**\n         * @see URL https://reactnative.dev/docs/profiling\n         */\n        private fun isJSCodeExecution(looperName: String): Boolean {\n            return looperName.contains(\"mqt_js\")\n        }\n\n        private fun getLooperResourceDesc(thread: String, executionType: String? = null) =\n            DetoxBusyResourceDescription.Builder()\n                .name(\"looper\")\n                .addDescription(\"thread\", thread)\n                .apply {\n                    executionType?.let { addDescription(\"execution_type\", executionType) }\n                }\n                .build()\n\n        /**\n         * @see URL https://reactnative.dev/docs/profiling\n         */\n        private fun isNativeCodeExecution(looperName: String): Boolean {\n            return looperName.contains(\"mqt_native\")\n        }\n\n    }\n\n    object BusyAsyncTasks: DetoxBusyResource() {\n        override fun getDescription() =\n            DetoxBusyResourceDescription.Builder()\n                .name(\"bg\")\n                .addDescription(\"reason\", \"native async-tasks\")\n                .build()\n\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/inquiry/DetoxBusyResourceDescription.kt",
    "content": "package com.wix.detox.inquiry\n\nclass DetoxBusyResourceDescription private constructor(\n    private val name: String,\n    private val description: Map<String, Any>) {\n\n    fun json(): Map<String, Any> =\n        mutableMapOf<String, Any>(\"name\" to name)\n          .apply {\n            if (description.isNotEmpty()) put(\"description\", description)\n          }\n\n    override fun equals(other: Any?) =\n      (other is DetoxBusyResourceDescription && other.json() == this.json())\n\n    override fun hashCode(): Int =\n      (31 * name.hashCode() + description.hashCode())\n\n    data class Builder(\n        var name: String = \"unknown\",\n        var description: MutableMap<String, Any> = mutableMapOf()) {\n            fun name(value: String) = apply { name = value }\n            fun addDescription(key: String, value: Any) = apply { description[key] = value }\n            fun build() = DetoxBusyResourceDescription(name, description)\n      }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/DetoxInstrumentsException.java",
    "content": "package com.wix.detox.instruments;\n\npublic class DetoxInstrumentsException extends RuntimeException {\n    public DetoxInstrumentsException(String message) {\n        super(message);\n    }\n\n    public DetoxInstrumentsException(Throwable cause) {\n        super(cause);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/DetoxInstrumentsManager.java",
    "content": "package com.wix.detox.instruments;\n\nimport android.content.Context;\n\nimport com.wix.detox.instruments.reflected.InstrumentsReflected;\n\nimport java.io.File;\n\npublic class DetoxInstrumentsManager {\n\n    private final Context context;\n    private final Instruments instruments;\n    private InstrumentsRecording recording;\n\n    public DetoxInstrumentsManager(Context context) {\n        this(context, getDefaultInstruments());\n    }\n\n    public DetoxInstrumentsManager(Context context, Instruments instruments) {\n        this.context = context;\n        this.instruments = instruments;\n        this.recording = instruments.getActiveRecording();\n    }\n\n    public void tryInstallJsi() {\n        if (!instruments.installed()) {\n            return;\n        }\n        instruments.tryInstallJsiHook(context);\n    }\n\n    public void startRecordingAtLocalPath(String path, long samplingInterval) {\n        if (!instruments.installed()) {\n            return;\n        }\n\n        recording = instruments.startRecording(context, true, samplingInterval, new File(path), false);\n    }\n\n    public void stopRecording() {\n        if (recording != null) {\n            recording.stop();\n            recording = null;\n        }\n    }\n\n    public void eventBeginInterval(\n            String category,\n            String name,\n            String id,\n            String additionalInfo\n    ) {\n        if (recording != null) {\n            recording.eventBeginInterval(category, name, id, additionalInfo);\n        }\n    }\n\n    public void eventEndInterval(\n            String id,\n            String eventStatus,\n            String additionalInfo\n    ) {\n        if (recording != null) {\n            recording.eventEndInterval(id, eventStatus, additionalInfo);\n        }\n    }\n\n    public void eventMark(\n            String category,\n            String name,\n            String id,\n            String eventStatus,\n            String additionalInfo\n    ) {\n        if (recording != null) {\n            recording.eventMark(category, name, id, eventStatus, additionalInfo);\n        }\n    }\n\n    public static boolean supports() {\n        return getDefaultInstruments().installed();\n    }\n\n    private static Instruments getDefaultInstruments() {\n        return InstrumentsReflected.getInstance();\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/Instruments.java",
    "content": "package com.wix.detox.instruments;\n\nimport android.content.Context;\n\nimport java.io.File;\n\npublic interface Instruments {\n    boolean installed();\n\n    void tryInstallJsiHook(Context context);\n\n    InstrumentsRecording getActiveRecording();\n\n    InstrumentsRecording startRecording(\n            Context context,\n            boolean recordPerformance,\n            long samplingInterval,\n            File recordingFile,\n            boolean recordReactNativeTimersAsEvents\n    );\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/InstrumentsRecording.java",
    "content": "package com.wix.detox.instruments;\n\n\npublic interface InstrumentsRecording {\n    void stop();\n\n    void eventBeginInterval(\n            String category,\n            String name,\n            String id,\n            String additionalInfo\n    );\n\n    void eventEndInterval(\n            String id,\n            String eventStatus,\n            String additionalInfo\n    );\n\n    void eventMark(\n            String category,\n            String name,\n            String id,\n            String eventStatus,\n            String additionalInfo\n    );\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/reflected/InstrumentsRecordingReflected.java",
    "content": "package com.wix.detox.instruments.reflected;\n\nimport com.wix.detox.instruments.DetoxInstrumentsException;\nimport com.wix.detox.instruments.InstrumentsRecording;\n\nimport java.lang.reflect.Method;\n\npublic class InstrumentsRecordingReflected implements InstrumentsRecording {\n    private static Method methodStopRecording;\n    private static Method methodEventBeginInterval;\n    private static Method methodEventEndInterval;\n    private static Method methodEventMark;\n\n    static {\n        try {\n            final String basePackageName = \"com.wix.detoxprofiler\";\n            final Class<?> profilerClass = Class.forName(basePackageName + \".DTXProfiler\");\n\n            methodStopRecording = profilerClass.getDeclaredMethod(\"stopProfiling\");\n            methodEventBeginInterval = profilerClass.getDeclaredMethod(\"eventBeginInterval\",\n                    String.class,//category\n                    String.class,//name\n                    String.class,//id\n                    String.class,//additionalInfo\n                    String.class//stackTrace\n            );\n            methodEventEndInterval = profilerClass.getDeclaredMethod(\"eventEndInterval\",\n                    String.class,//id\n                    String.class,//eventStatus\n                    String.class//additionalInfo\n            );\n            methodEventMark = profilerClass.getDeclaredMethod(\"eventMark\",\n                    String.class,//category\n                    String.class,//name\n                    String.class,//id\n                    String.class,//eventStatus\n                    String.class//additionalInfo\n            );\n        } catch (Exception e) {\n            methodStopRecording = null;\n            methodEventBeginInterval = null;\n            methodEventEndInterval = null;\n            methodEventMark = null;\n        }\n    }\n\n    private final Object profilerInstance;\n    private final InstrumentsReflected instruments;\n\n    public InstrumentsRecordingReflected(Object profilerInstance, InstrumentsReflected instruments) {\n        this.profilerInstance = profilerInstance;\n        this.instruments = instruments;\n    }\n\n    @Override\n    public void stop() {\n        try {\n            methodStopRecording.invoke(profilerInstance);\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n        instruments.resetActiveRecording();\n    }\n\n    @Override\n    public void eventBeginInterval(\n            String category,\n            String name,\n            String id,\n            String additionalInfo\n    ) {\n        try {\n            methodEventBeginInterval.invoke(profilerInstance,\n                    category, name, id, additionalInfo, null\n            );\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n    }\n\n    @Override\n    public void eventEndInterval(\n            String id,\n            String eventStatus,\n            String additionalInfo\n    ) {\n        try {\n            methodEventEndInterval.invoke(profilerInstance,\n                    id, eventStatus, additionalInfo\n            );\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n    }\n\n    @Override\n    public void eventMark(\n            String category,\n            String name,\n            String id,\n            String eventStatus,\n            String additionalInfo\n    ) {\n        try {\n            methodEventMark.invoke(profilerInstance,\n                    category, name, id, eventStatus, additionalInfo\n            );\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/instruments/reflected/InstrumentsReflected.java",
    "content": "package com.wix.detox.instruments.reflected;\n\nimport android.content.Context;\n\nimport com.wix.detox.instruments.DetoxInstrumentsException;\nimport com.wix.detox.instruments.Instruments;\nimport com.wix.detox.instruments.InstrumentsRecording;\n\nimport java.io.File;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Method;\n\npublic class InstrumentsReflected implements Instruments {\n    private static final InstrumentsReflected instance = new InstrumentsReflected();\n\n    private static Constructor constructorDtxProfilingConfiguration;\n    private static Method methodGetInstanceOfProfiler;\n    private static Method methodStartRecording;\n    private static Method methodTryInstallJsiHook;\n    private static final boolean hasProfiler;\n    private InstrumentsRecording activeRecording;\n\n    static {\n        try {\n            final String basePackageName = \"com.wix.detoxprofiler\";\n            final Class<?> profilerClass = Class.forName(basePackageName + \".DTXProfiler\");\n            final Class<?> configurationClass = Class.forName(basePackageName + \".DTXProfilingConfiguration\");\n            final Class<?> jsiHookClass = Class.forName(basePackageName + \".JsiHook\");\n\n            constructorDtxProfilingConfiguration = configurationClass.getConstructor(\n                    boolean.class,//recordPerformance\n                    long.class,//samplingIntervalMillis\n                    File.class,//recordingFile\n                    boolean.class//recordReactNativeTimersAsEvents\n            );\n            methodGetInstanceOfProfiler = profilerClass.getDeclaredMethod(\"getInstance\", Context.class);\n            methodStartRecording = profilerClass.getDeclaredMethod(\"startProfiling\", Context.class, configurationClass);\n            methodTryInstallJsiHook = jsiHookClass.getDeclaredMethod(\"tryInstall\", profilerClass, Context.class);\n            methodTryInstallJsiHook.setAccessible(true);\n        } catch (ClassNotFoundException e) {\n            methodGetInstanceOfProfiler = null;\n        } catch (NoSuchMethodException e) {\n            methodGetInstanceOfProfiler = null;\n        }\n        hasProfiler = methodGetInstanceOfProfiler != null;\n    }\n\n    private InstrumentsReflected() {\n    }\n\n    @Override\n    public boolean installed() {\n        return hasProfiler;\n    }\n\n    void resetActiveRecording() {\n        activeRecording = null;\n    }\n\n    public InstrumentsRecording getActiveRecording() {\n        return activeRecording;\n    }\n\n    @Override\n    public void tryInstallJsiHook(Context context) {\n        try {\n            final Object profilerInstance = methodGetInstanceOfProfiler.invoke(null, context);\n            methodTryInstallJsiHook.invoke(null, profilerInstance, context);\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n    }\n\n    @Override\n    public InstrumentsRecording startRecording(\n            Context context,\n            boolean recordPerformance,\n            long samplingInterval,\n            File recordingFile,\n            boolean recordReactNativeTimersAsEvents\n    ) {\n        try {\n            final Object configurationInstance = constructorDtxProfilingConfiguration.newInstance(\n                    recordPerformance,\n                    samplingInterval,\n                    recordingFile,\n                    recordReactNativeTimersAsEvents\n            );\n            final Object profilerInstance = methodGetInstanceOfProfiler.invoke(null, context);\n            methodStartRecording.invoke(profilerInstance, context, configurationInstance);\n            activeRecording = new InstrumentsRecordingReflected(profilerInstance, this);\n            return activeRecording;\n        } catch (Exception e) {\n            throw new DetoxInstrumentsException(e);\n        }\n    }\n\n    public static Instruments getInstance() {\n        return instance;\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactApplicationExt.kt",
    "content": "package com.wix.detox.reactnative\n\nimport android.annotation.SuppressLint\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.ReactInstanceManager\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint\n\n\nfun ReactApplication.getInstanceManagerSafe(): ReactInstanceManager {\n    return reactNativeHost.reactInstanceManager\n        ?: throw RuntimeException(\"ReactInstanceManager is null!\")\n}\n\n@SuppressLint(\"VisibleForTests\")\nfun ReactApplication.getCurrentReactContext(): ReactContext? {\n    return if (isFabricEnabled()) {\n        reactHost?.currentReactContext\n    } else {\n        getInstanceManagerSafe().currentReactContext\n    }\n}\n\nfun ReactApplication.getCurrentReactContextSafe(): ReactContext {\n    return getCurrentReactContext()\n        ?: throw RuntimeException(\"ReactContext is null!\")\n}\n\n/**\n * A method to check if Fabric is enabled in the React Native application.\n */\nfun isFabricEnabled(): Boolean {\n    return DefaultNewArchitectureEntryPoint.fabricEnabled\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactMarkersLogger.kt",
    "content": "package com.wix.detox.reactnative\n\nimport android.util.Log\nimport com.facebook.react.bridge.ReactMarker\nimport com.facebook.react.bridge.ReactMarkerConstants\nimport com.facebook.react.bridge.ReactMarkerConstants.*\n\nobject ReactMarkersLogger : ReactMarker.MarkerListener {\n\n    fun attach() {\n        if (ReactNativeInfo.rnVersion().minor >= 71) {\n            ReactMarker.addListener(this)\n        }\n    }\n\n    override fun logMarker(marker: ReactMarkerConstants, p1: String?, p2: Int) {\n        when {\n            marker == DOWNLOAD_START ||\n            marker == DOWNLOAD_END ||\n            marker == BUILD_REACT_INSTANCE_MANAGER_START ||\n            marker == BUILD_REACT_INSTANCE_MANAGER_END ||\n            marker == REACT_BRIDGE_LOADING_START ||\n            marker == REACT_BRIDGE_LOADING_END ||\n            marker == REACT_BRIDGELESS_LOADING_START ||\n            marker == REACT_BRIDGELESS_LOADING_END ||\n            marker == CREATE_MODULE_START ||\n            marker == CREATE_MODULE_END ||\n            marker == NATIVE_MODULE_SETUP_START ||\n            marker == NATIVE_MODULE_SETUP_END ||\n            marker == PRE_RUN_JS_BUNDLE_START ||\n            marker == RUN_JS_BUNDLE_START ||\n            marker == RUN_JS_BUNDLE_END ||\n            marker == CONTENT_APPEARED ||\n            marker == CREATE_CATALYST_INSTANCE_START ||\n            marker == CREATE_CATALYST_INSTANCE_END ||\n            marker == DESTROY_CATALYST_INSTANCE_START ||\n            marker == DESTROY_CATALYST_INSTANCE_END ||\n            marker == CREATE_REACT_CONTEXT_START ||\n            marker == CREATE_REACT_CONTEXT_END ||\n            marker == PROCESS_PACKAGES_START ||\n            marker == PROCESS_PACKAGES_END ||\n                false ->\n                Log.d(\"Detox.RNMarker\", \"$marker ($p1)\")\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeExtension.kt",
    "content": "package com.wix.detox.reactnative\n\nimport android.app.Activity\nimport android.content.Context\nimport android.util.Log\nimport androidx.test.platform.app.InstrumentationRegistry\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.LaunchArgs\nimport com.wix.detox.reactnative.idlingresources.ReactNativeIdlingResources\nimport com.wix.detox.reactnative.reloader.ReactNativeReloaderFactory\n\nprivate const val LOG_TAG = \"DetoxRNExt\"\n\nobject ReactNativeExtension {\n    private var rnIdlingResources: ReactNativeIdlingResources? = null\n\n    fun initIfNeeded() {\n        if (!ReactNativeInfo.isReactNativeApp()) {\n            return\n        }\n\n        ReactMarkersLogger.attach()\n    }\n\n    /**\n     * Wait for React-Native to finish loading (i.e. make RN context available).\n     *\n     * @param applicationContext The app context, implicitly assumed to be a [ReactApplication] instance.\n     */\n    fun waitForRNBootstrap(applicationContext: Context) {\n        if (!ReactNativeInfo.isReactNativeApp()) {\n            return\n        }\n\n        (applicationContext as ReactApplication).let {\n            awaitNewReactNativeContext(it, null)\n\n            enableOrDisableSynchronization(it)\n        }\n    }\n\n    /**\n     * Reloads the React Native context and thus all javascript code.\n     *\n     * It is a lot faster to reload a React Native application this way,\n     * than to reload the whole Activity or Application.\n     *\n     * @param applicationContext The app context, implicitly assumed to be a [ReactApplication] instance.\n     */\n    @JvmStatic\n    fun reloadReactNative(applicationContext: Context) {\n        if (!ReactNativeInfo.isReactNativeApp()) {\n            return\n        }\n\n        Log.i(LOG_TAG, \"Reloading React Native\")\n\n        (applicationContext as ReactApplication).let {\n            clearIdlingResources()\n\n            val previousReactContext = it.getCurrentReactContext()\n\n            reloadReactNativeInBackground(it)\n            awaitNewReactNativeContext(it, previousReactContext)\n\n            enableOrDisableSynchronization(it)\n        }\n    }\n\n    @JvmStatic\n    fun setBlacklistUrls(blacklistUrls: String) {\n        rnIdlingResources?.setBlacklistUrls(blacklistUrls)\n    }\n\n    @JvmStatic\n    fun enableAllSynchronization(applicationContext: ReactApplication) {\n        setupIdlingResources(applicationContext)\n    }\n\n    @JvmStatic\n    fun clearAllSynchronization() = clearIdlingResources()\n\n    @JvmStatic\n    fun getRNActivity(applicationContext: Context): Activity? {\n        if (ReactNativeInfo.isReactNativeApp()) {\n            return (applicationContext as ReactApplication).getCurrentReactContext()?.currentActivity\n        }\n        return null\n    }\n\n    @JvmStatic\n    fun toggleNetworkSynchronization(enable: Boolean) {\n        rnIdlingResources?.let {\n            if (enable) it.resumeNetworkSynchronization() else it.pauseNetworkSynchronization()\n        }\n    }\n\n    @JvmStatic\n    fun toggleTimersSynchronization(enable: Boolean) {\n        rnIdlingResources?.let {\n            if (enable) it.resumeRNTimersIdlingResource() else it.pauseRNTimersIdlingResource()\n        }\n    }\n\n    @JvmStatic\n    fun toggleUISynchronization(enable: Boolean) {\n        rnIdlingResources?.let {\n            if (enable) it.resumeUIIdlingResource() else it.pauseUIIdlingResource()\n        }\n    }\n\n    private fun reloadReactNativeInBackground(reactApplication: ReactApplication) {\n        val rnReloader = ReactNativeReloaderFactory(InstrumentationRegistry.getInstrumentation(), reactApplication).create()\n        rnReloader.reloadInBackground()\n    }\n\n    private fun awaitNewReactNativeContext(\n        reactApplication: ReactApplication,\n        previousReactContext: ReactContext?\n    ): ReactContext {\n        val rnLoadingMonitor = ReactNativeLoadingMonitor(\n            InstrumentationRegistry.getInstrumentation(),\n            reactApplication,\n            previousReactContext\n        )\n        return rnLoadingMonitor.getNewContext()!!\n    }\n\n    private fun enableOrDisableSynchronization(reactApplication: ReactApplication) {\n        if (shouldDisableSynchronization()) {\n            clearAllSynchronization()\n        } else {\n            setupIdlingResources(reactApplication)\n        }\n    }\n\n    private fun shouldDisableSynchronization(): Boolean {\n        val launchArgs = LaunchArgs()\n        return launchArgs.hasEnableSynchronization() && launchArgs.enableSynchronization.equals(\"0\")\n    }\n\n    private fun setupIdlingResources(reactApplication: ReactApplication) {\n        val launchArgs = LaunchArgs()\n\n        rnIdlingResources = ReactNativeIdlingResources(reactApplication, launchArgs).apply {\n            registerAll()\n        }\n    }\n\n    private fun clearIdlingResources() {\n        rnIdlingResources?.unregisterAll()\n        rnIdlingResources = null\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeInfo.kt",
    "content": "package com.wix.detox.reactnative\n\nimport com.facebook.react.modules.systeminfo.ReactNativeVersion\n\ndata class RNVersion(val major: Int, val minor: Int, val patch: Int)\n\nobject ReactNativeInfo {\n    private var rnVersion: RNVersion = ReactNativeVersion.VERSION.run {\n        RNVersion(get(\"major\") as Int, get(\"minor\") as Int, get(\"patch\") as Int)\n    }\n\n    @JvmStatic\n    fun rnVersion() = rnVersion\n\n    fun isReactNativeApp(): Boolean = try {\n        Class.forName(\"com.facebook.react.ReactApplication\")\n        true\n    } catch (e: ClassNotFoundException) {\n        false\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeLoadingMonitor.kt",
    "content": "package com.wix.detox.reactnative\n\nimport android.app.Instrumentation\nimport android.util.Log\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.ReactInstanceEventListener\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.runtime.ReactHostImpl\nimport com.wix.detox.common.DetoxErrors\nimport com.wix.detox.config.DetoxConfig\nimport java.util.concurrent.CountDownLatch\nimport java.util.concurrent.TimeUnit\n\nprivate const val LOG_TAG = \"DetoxRNLoading\"\n\nopen class ReactNativeLoadingMonitor(\n    private val instrumentation: Instrumentation,\n    private val rnApplication: ReactApplication,\n    private val previousReactContext: ReactContext?,\n    private val config: DetoxConfig = DetoxConfig.CONFIG\n) {\n    private val countDownLatch = CountDownLatch(1)\n\n    fun getNewContext(): ReactContext? {\n        subscribeToNewRNContextUpdates()\n        return awaitNewRNContext()\n    }\n\n    private fun subscribeToNewRNContextUpdates() {\n        instrumentation.runOnMainSync(\n            Runnable {\n                val reactContext = rnApplication.getCurrentReactContext()\n                if (isReactNativeLoaded(reactContext)) {\n                    Log.d(LOG_TAG, \"Got new RN-context directly and immediately\")\n                    countDownLatch.countDown()\n                    return@Runnable\n                }\n\n                subscribeAsyncRNContextHandler() {\n                    countDownLatch.countDown()\n                }\n            })\n    }\n\n    private fun awaitNewRNContext(): ReactContext? {\n        var i = 0\n        while (true) {\n            try {\n                if (!countDownLatch.await(1, TimeUnit.SECONDS)) {\n                    i++\n                    if (i >= config.rnContextLoadTimeoutSec) {\n                        // First load can take a lot of time. (packager)\n                        // Loads afterwards should take less than a second.\n                        throw DetoxErrors.DetoxRuntimeException(\n                            \"\"\"Waited for the new RN-context for too long! (${config.rnContextLoadTimeoutSec} seconds)\n                                  |If you think that's not long enough, consider applying a custom Detox runtime-config in DetoxTest.runTests().\"\"\"\n                                .trimMargin()\n                        )\n                    }\n                } else {\n                    break\n                }\n\n                // Due to timing in RN\n                // it is possible that our listener won't be ever called\n                // That's why we have to check the reactContext regularly.\n                val reactContext = rnApplication.getCurrentReactContext()\n\n                // We also need to wait for rect native instance to be initialized\n                if (isReactNativeLoaded(reactContext)) {\n                    Log.d(LOG_TAG, \"Got new RN-context explicitly while polling (#iteration=$i)\")\n                    break\n                }\n            } catch (e: InterruptedException) {\n                throw RuntimeException(\"waiting for new RN-context got interrupted\", e)\n            }\n        }\n\n        return rnApplication.getCurrentReactContext()\n    }\n\n    private fun isReactNativeLoaded(reactContext: ReactContext?) =\n        reactContext != null && reactContext !== previousReactContext && reactContext.hasActiveReactInstance()\n\n    private fun subscribeAsyncRNContextHandler(onReactContextInitialized: () -> Any) {\n        val isFabric = isFabricEnabled()\n        if (isFabric) {\n            // We do a casting for supporting RN 0.75 and above\n            val host = rnApplication.reactHost as ReactHostImpl?\n            host?.addReactInstanceEventListener(object : ReactInstanceEventListener {\n                override fun onReactContextInitialized(context: ReactContext) {\n                    Log.i(LOG_TAG, \"Got new RN-context through listener\")\n                    onReactContextInitialized()\n                    host.removeReactInstanceEventListener(this)\n                }\n            })\n        } else {\n            val rnInstanceManager = rnApplication.getInstanceManagerSafe()\n            rnInstanceManager.addReactInstanceEventListener(object : ReactInstanceEventListener {\n                override fun onReactContextInitialized(context: ReactContext) {\n                    Log.i(LOG_TAG, \"Got new RN-context directly through listener\")\n                    onReactContextInitialized()\n                    rnInstanceManager.removeReactInstanceEventListener(this)\n                }\n            })\n        }\n    }\n}\n\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/helpers/RNHelpers.kt",
    "content": "package com.wix.detox.reactnative.helpers\n\nimport android.util.Log\nimport com.facebook.react.bridge.NativeModule\nimport com.facebook.react.bridge.ReactContext\n\nprivate const val LOG_TAG = \"DetoxRNHelpers\"\n\nclass RNHelpers {\n    fun getNativeModule(reactContext: ReactContext, className: String): NativeModule? =\n        try {\n            val moduleClass = Class.forName(className) as Class<NativeModule>\n\n            if (reactContext.hasNativeModule(moduleClass)) {\n                reactContext.getNativeModule(moduleClass)\n            } else {\n                Log.d(LOG_TAG, \"Native RN module resolution (class $className): no registered module found\")\n                null\n            }\n        } catch (ex: ClassNotFoundException) {\n            Log.d(LOG_TAG, \"Native RN module resolution (class $className): no such class\")\n            null\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DetoxIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport androidx.annotation.VisibleForTesting\nimport androidx.test.espresso.IdlingResource\nimport com.wix.detox.espresso.idlingresources.DescriptiveIdlingResource\nimport java.util.concurrent.atomic.AtomicBoolean\n\nabstract class DetoxIdlingResource : DescriptiveIdlingResource {\n    private var callback: IdlingResource.ResourceCallback? = null\n    @VisibleForTesting\n    internal var paused: AtomicBoolean = AtomicBoolean(false)\n\n    fun pause() {\n        paused.set(true)\n        notifyIdle()\n    }\n\n    fun resume() {\n        paused.set(false)\n    }\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        this.callback = callback\n    }\n\n    final override fun isIdleNow(): Boolean {\n        if (paused.get()) {\n            return true\n        }\n        return checkIdle()\n    }\n\n    open fun onUnregistered() {\n        pause()\n    }\n\n    protected abstract fun checkIdle(): Boolean\n\n    fun notifyIdle() {\n        callback?.onTransitionToIdle()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/ReactNativeIdlingResources.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport android.os.Looper\nimport android.util.Log\nimport androidx.test.espresso.Espresso\nimport androidx.test.espresso.IdlingRegistry\nimport androidx.test.espresso.base.IdlingResourceRegistry\nimport com.facebook.react.ReactApplication\nimport com.wix.detox.LaunchArgs\nimport com.wix.detox.reactnative.getCurrentReactContext\nimport com.wix.detox.reactnative.idlingresources.factory.DetoxIdlingResourceFactory\nimport com.wix.detox.reactnative.idlingresources.factory.IdlingResourcesName\nimport com.wix.detox.reactnative.idlingresources.factory.LooperName\nimport com.wix.detox.reactnative.idlingresources.looper.MQThreadsReflector\nimport com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource\nimport kotlinx.coroutines.runBlocking\nimport org.joor.Reflect\nimport java.util.concurrent.ConcurrentHashMap\n\nprivate const val LOG_TAG = \"DetoxRNIdleRes\"\n\nclass ReactNativeIdlingResources(\n    private val reactApplication: ReactApplication,\n    private var launchArgs: LaunchArgs,\n    private val idlingResourcesFactory: DetoxIdlingResourceFactory = DetoxIdlingResourceFactory(reactApplication)\n) {\n\n    private val idlingResources = mutableMapOf<IdlingResourcesName, DetoxIdlingResource>()\n    private val loopers = mutableMapOf<LooperName, Looper>()\n\n    fun registerAll() {\n        runBlocking {\n            Log.i(LOG_TAG, \"Setting up Espresso Idling Resources for React Native\")\n            unregisterAll()\n\n            setupUrlBlacklist()\n            setupMQThreadsInterrogators()\n            syncIdlingResources()\n            setupIdlingResources()\n            syncIdlingResources()\n        }\n    }\n\n    fun unregisterAll() {\n        unregisterMQThreadsInterrogators()\n        unregisterIdlingResources()\n        syncIdlingResources()\n    }\n\n    fun pauseNetworkSynchronization() = pauseIdlingResource(IdlingResourcesName.Network)\n    fun resumeNetworkSynchronization() {\n        resumeIdlingResource(IdlingResourcesName.Network)\n    }\n\n    fun pauseRNTimersIdlingResource() = pauseIdlingResource(IdlingResourcesName.Timers)\n    fun resumeRNTimersIdlingResource() = resumeIdlingResource(IdlingResourcesName.Timers)\n    fun pauseUIIdlingResource() = pauseIdlingResource(IdlingResourcesName.UI)\n    fun resumeUIIdlingResource() = resumeIdlingResource(IdlingResourcesName.UI)\n\n    fun setBlacklistUrls(urlList: String) {\n        setIdlingResourceBlacklist(urlList)\n    }\n\n    private fun setIdlingResourceBlacklist(urlList: String) {\n        val urlArray = toFormattedUrlArray(urlList)\n        NetworkIdlingResource.setURLBlacklist(urlArray)\n    }\n\n    private fun setupMQThreadsInterrogators() {\n        setupMQThreadsInterrogator(LooperName.JS)\n        setupMQThreadsInterrogator(LooperName.NativeModules)\n    }\n\n    private fun setupUrlBlacklist() {\n        if (launchArgs.hasURLBlacklist()) {\n            val blacklistUrls = launchArgs.urlBlacklist\n            setIdlingResourceBlacklist(blacklistUrls)\n        }\n    }\n\n    private fun setupMQThreadsInterrogator(looperName: LooperName) {\n        reactApplication.getCurrentReactContext()?.let { reactContext ->\n            val mqThreadsReflector = MQThreadsReflector(reactContext)\n            val looper = when (looperName) {\n                LooperName.JS -> mqThreadsReflector.getJSMQueue()?.getLooper()\n                LooperName.NativeModules -> mqThreadsReflector.getNativeModulesQueue()?.getLooper()\n            }\n\n            looper?.let {\n                IdlingRegistry.getInstance().registerLooperAsIdlingResource(it)\n                loopers[looperName] = it\n            }\n        }\n\n    }\n\n    private suspend fun setupIdlingResources() {\n        idlingResources.putAll(idlingResourcesFactory.create())\n        idlingResources.forEach { (_, idlingResource) ->\n            IdlingRegistry.getInstance().register(idlingResource)\n        }\n    }\n\n    private fun syncIdlingResources() {\n        IdlingRegistry.getInstance().apply {\n            val irr: IdlingResourceRegistry =\n                Reflect.on(Espresso::class.java).field(\"baseRegistry\").get()\n            irr.sync(this.resources, this.loopers)\n        }\n    }\n\n    private fun unregisterMQThreadsInterrogators() {\n        loopers.values.forEach { looper ->\n            IdlingRegistry.getInstance().unregisterLooperAsIdlingResource(looper)\n            clearLooperHandlerCache(looper)\n        }\n        loopers.clear()\n    }\n\n    /**\n     * Workaround for Espresso 3.7.0+ where LooperIdlingResourceInterrogationHandler\n     * caches handlers in a static map but doesn't clear them on release().\n     * This causes re-registered loopers to get stale handlers with releasing=true.\n     *\n     * For older Espresso versions without this static cache, this is a no-op.\n     */\n    private fun clearLooperHandlerCache(looper: Looper) {\n        try {\n            val insts: ConcurrentHashMap<String, Any> =\n                Reflect.on(\"androidx.test.espresso.base.LooperIdlingResourceInterrogationHandler\")\n                    .field(\"insts\")\n                    .get()\n\n            for ((key, handler) in insts) {\n                val handlerLooper: Looper? = Reflect.on(handler).field(\"looper\").get()\n                if (handlerLooper === looper) {\n                    insts.remove(key)\n                    break\n                }\n            }\n        } catch (e: Exception) {\n            // Expected for older Espresso versions or different implementations - silently ignore\n        }\n    }\n\n    @OptIn(ExperimentalStdlibApi::class)\n    private fun unregisterIdlingResources() {\n        IdlingResourcesName.entries.forEach {\n            removeIdlingResource(it)\n        }\n    }\n\n    private fun pauseIdlingResource(idlingResourcesName: IdlingResourcesName) {\n        val idlingResource = idlingResources[idlingResourcesName]\n        idlingResource?.pause()\n    }\n\n    private fun resumeIdlingResource(idlingResourcesName: IdlingResourcesName) {\n        val idlingResource = idlingResources[idlingResourcesName]\n        idlingResource?.resume()\n    }\n\n    private fun removeIdlingResource(idlingResourcesName: IdlingResourcesName) {\n        val idlingResource = idlingResources[idlingResourcesName]\n        idlingResource?.let {\n            IdlingRegistry.getInstance().unregister(it)\n            idlingResource.onUnregistered()\n            idlingResources.remove(idlingResourcesName)\n        }\n    }\n\n    private fun toFormattedUrlArray(urlList: String): List<String> {\n        var formattedUrls = urlList\n        formattedUrls = formattedUrls.replace(Regex(\"\"\"[()\"]\"\"\"), \"\")\n        formattedUrls = formattedUrls.trim()\n        return formattedUrls.split(',')\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/StabilizedIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport androidx.test.espresso.IdlingResource.ResourceCallback\n/**\n * A wrapper for idling resources that exhibit \"flapping\" behavior.\n * This wrapper artificially stabilizes them by mindfully extending their \"busy\" state periods.\n *\n * #### What does flapping mean?\n *\n * Some idling resources have extremely short busy periods. While this shouldn't theoretically be an issue,\n * in real-world scenarios (e.g., a React Native environment), the number of idling resources can accumulate.\n * Unfortunately, the process of checking if all resources are idle (idle interrogation)\n * isn't atomic. With many resources involved, this process might miss those brief busy periods\n * of resources that \"flap\" (quickly switch between busy and idle) during the interrogation.\n *\n * #### How does this wrapper fix flapping?\n *\n * This wrapper requires the wrapped resource to report itself as \"idle\" multiple times consecutively\n * before the wrapper itself is considered idle. This dramatically reduces the likelihood of it's busy phase being\n * missed by the idle interrogation process.\n */\nclass StabilizedIdlingResource(\n    private val idlingResource: DetoxIdlingResource,\n    private val size: Int): DetoxIdlingResource(), ResourceCallback {\n\n    private val name = \"${idlingResource.name} (stable@$size)\"\n    private var idleCounter = 0\n\n    init {\n        if (size <= 1) {\n            throw IllegalArgumentException(\"Size must be > 1 in order for the usage of this class to make sense\")\n        }\n        idlingResource.registerIdleTransitionCallback(this)\n    }\n\n    /**\n     * Implemented according to these 3 guiding principles:\n     * 1. As long as the actual resource is busy - we consider ourselves busy too.\n     * 2. Once actual resource is idle enough times in a row - we consider ourselves \"idle\", in a *sticky* way\n     *   (until it returns \"busy\" in an interrogation).\n     * 3. Espresso requires that just before we officially transition ourselves -- idle -> busy, we actively notify it\n     *   via the callback.\n     */\n    @Synchronized\n    override fun checkIdle(): Boolean {\n        if (!idlingResource.isIdleNow) {\n            idleCounter = 0\n            return false\n        }\n\n        if (idleCounter < size) {\n            idleCounter++\n\n            if (idleCounter == size) {\n                notifyIdle()\n            }\n        }\n        return (idleCounter == size)\n    }\n\n    /**\n     * Resets the counter to 0, assuming that Espresso will re-query this (among all other) resources\n     * immediately after this \"I'm idle\" notification.\n     */\n    @Synchronized\n    override fun onTransitionToIdle() {\n        idleCounter = 0\n        notifyIdle()\n    }\n\n    override fun getName(): String = name\n    override fun getDebugName(): String = idlingResource.getDebugName()\n    override fun getBusyHint(): Map<String, Any>? = idlingResource.getBusyHint()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.animations\n\nimport android.util.Log\nimport android.view.Choreographer\nimport androidx.annotation.UiThread\nimport androidx.test.espresso.IdlingResource.ResourceCallback\nimport com.facebook.react.animated.NativeAnimatedModule\nimport com.facebook.react.animated.NativeAnimatedNodesManager\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.common.DetoxErrors\nimport com.wix.detox.common.DetoxLog.Companion.LOG_TAG\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\n\nclass AnimatedModuleIdlingResource(private val reactContext: ReactContext) : DetoxIdlingResource(),\n    Choreographer.FrameCallback {\n\n    private var animatedModule: AnimatedModuleFacade? = null\n\n    override fun getName(): String = AnimatedModuleIdlingResource::class.java.name\n    override fun getDebugName() = \"ui\"\n    override fun getBusyHint(): Map<String, Any> = mapOf(\"reason\" to \"Animations running on screen\")\n\n    override fun checkIdle(): Boolean {\n        val animatedModule = getAnimatedModule()\n        if (animatedModule == null) {\n            Log.w(LOG_TAG, \"AnimatedModule is idle because the native-module is not available\")\n            return false\n        }\n\n        if (animatedModule.hasActiveAnimations()) {\n            Choreographer.getInstance().postFrameCallback(this)\n            return false\n        }\n\n        notifyIdle()\n        return true\n    }\n\n    override fun registerIdleTransitionCallback(callback: ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        Choreographer.getInstance().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        Choreographer.getInstance().removeFrameCallback(this)\n    }\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow\n    }\n\n    private fun getAnimatedModule(): AnimatedModuleFacade? =\n        if (animatedModule != null) {\n            animatedModule\n        } else {\n            reactContext.getNativeModule(NativeAnimatedModule::class.java)?.let {\n                AnimatedModuleFacade(it).also { nativeModule ->\n                    animatedModule = nativeModule\n                }\n            }\n        }\n}\n\nprivate class AnimatedModuleFacade(private val animatedModule: NativeAnimatedModule) {\n    private val nodesManager: NativeAnimatedNodesManager = animatedModule.nodesManager\n        ?: throw DetoxErrors.DetoxIllegalStateException(\"AnimatedModule exists but nodesManager is null\")\n\n    @UiThread\n    fun hasActiveAnimations(): Boolean {\n        return nodesManager.hasActiveAnimations()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/bridge/BridgeIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.bridge\n\nimport android.util.Log\nimport com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport java.util.concurrent.atomic.AtomicBoolean\n\n/**\n * Created by simonracz on 01/06/2017.\n */\n/**\n *\n *\n * IdlingResource for Espresso, which monitors the traffic of\n * React Native's JS bridge.\n *\n */\nclass BridgeIdlingResource(private val reactContext: ReactContext) : DetoxIdlingResource(),\n    NotThreadSafeBridgeIdleDebugListener {\n    private val idleNow = AtomicBoolean(true)\n\n    init {\n        reactContext.catalystInstance.addBridgeIdleDebugListener(this)\n    }\n\n    fun onDetach() {\n        reactContext.catalystInstance.removeBridgeIdleDebugListener(this)\n    }\n\n    override fun getName(): String {\n        return BridgeIdlingResource::class.java.name\n    }\n\n    override fun getDebugName(): String {\n        return \"bridge\"\n    }\n\n    override fun getBusyHint(): Map<String, Any>? {\n        return null\n    }\n\n    override fun checkIdle(): Boolean {\n        val ret = idleNow.get()\n        if (!ret) {\n            Log.i(LOG_TAG, \"JS Bridge is busy\")\n        }\n        return ret\n    }\n\n    override fun onTransitionToBridgeIdle() {\n        idleNow.set(true)\n        notifyIdle()\n    }\n\n    override fun onTransitionToBridgeBusy() {\n        idleNow.set(false)\n        // Log.i(LOG_TAG, \"JS Bridge transitions to busy.\");\n    }\n\n    override fun onBridgeDestroyed() {\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        onDetach()\n    }\n\n    companion object {\n        private const val LOG_TAG = \"Detox\"\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/DetoxIdlingResourceFactory.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nimport com.facebook.react.ReactApplication\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport com.wix.detox.reactnative.isFabricEnabled\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\n\n\nclass DetoxIdlingResourceFactory(private val reactApplication: ReactApplication) {\n    suspend fun create(): Map<IdlingResourcesName, DetoxIdlingResource> = withContext(Dispatchers.Main) {\n        val strategy = if (isFabricEnabled()) {\n            FabricDetoxIdlingResourceFactoryStrategy(reactApplication)\n        } else {\n            OldArchitectureDetoxIdlingResourceFactoryStrategy(reactApplication)\n        }\n\n        return@withContext strategy.create()\n    }\n}\n\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/DetoxIdlingResourceFactoryStrategy.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\n\ninterface DetoxIdlingResourceFactoryStrategy {\n    suspend fun create(): Map<IdlingResourcesName, DetoxIdlingResource>\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/FabricDetoxIdlingResourceFactoryStrategy.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nimport com.facebook.react.ReactApplication\nimport com.wix.detox.reactnative.getCurrentReactContextSafe\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport com.wix.detox.reactnative.idlingresources.StabilizedIdlingResource\nimport com.wix.detox.reactnative.idlingresources.animations.AnimatedModuleIdlingResource\nimport com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource\nimport com.wix.detox.reactnative.idlingresources.storage.AsyncStorageIdlingResource\nimport com.wix.detox.reactnative.idlingresources.timers.FabricTimersIdlingResource\nimport com.wix.detox.reactnative.idlingresources.uimodule.fabric.FabricUIManagerIdlingResources\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\n\nclass FabricDetoxIdlingResourceFactoryStrategy(private val reactApplication: ReactApplication) :\n    DetoxIdlingResourceFactoryStrategy {\n    override suspend fun create(): Map<IdlingResourcesName, DetoxIdlingResource> =\n        withContext(Dispatchers.Main) {\n            val reactContext = reactApplication.getCurrentReactContextSafe()\n\n            val result = mutableMapOf(\n                IdlingResourcesName.UI to FabricUIManagerIdlingResources(reactContext),\n                IdlingResourcesName.Animations to AnimatedModuleIdlingResource(reactContext),\n                IdlingResourcesName.Timers to FabricTimersIdlingResource(reactContext),\n                IdlingResourcesName.Network to NetworkIdlingResource(reactContext),\n                IdlingResourcesName.AsyncStorage to StabilizedIdlingResource(AsyncStorageIdlingResource(reactContext), 2)\n            )\n\n            return@withContext result\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/IdlingResourcesName.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nenum class IdlingResourcesName {\n    Timers,\n    AsyncStorage,\n    RNBridge,\n    UI,\n    Animations,\n    Network\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/LooperName.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nenum class LooperName {\n    JS,\n    NativeModules\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/OldArchitectureDetoxIdlingResourceFactoryStrategy.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.factory\n\nimport com.facebook.react.ReactApplication\nimport com.wix.detox.reactnative.getCurrentReactContext\nimport com.wix.detox.reactnative.getCurrentReactContextSafe\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport com.wix.detox.reactnative.idlingresources.animations.AnimatedModuleIdlingResource\nimport com.wix.detox.reactnative.idlingresources.bridge.BridgeIdlingResource\nimport com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource\nimport com.wix.detox.reactnative.idlingresources.storage.AsyncStorageIdlingResource\nimport com.wix.detox.reactnative.idlingresources.timers.TimersIdlingResource\nimport com.wix.detox.reactnative.idlingresources.uimodule.paper.UIModuleIdlingResource\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\n\nclass OldArchitectureDetoxIdlingResourceFactoryStrategy(private val reactApplication: ReactApplication) :\n    DetoxIdlingResourceFactoryStrategy {\n    override suspend fun create(): Map<IdlingResourcesName, DetoxIdlingResource> =\n        withContext(Dispatchers.Main) {\n            val reactContext = reactApplication.getCurrentReactContextSafe()\n\n            val result = mutableMapOf(\n                IdlingResourcesName.Timers to TimersIdlingResource(reactContext),\n                IdlingResourcesName.RNBridge to BridgeIdlingResource(reactContext),\n                IdlingResourcesName.UI to UIModuleIdlingResource(reactContext),\n                IdlingResourcesName.Animations to AnimatedModuleIdlingResource(reactContext),\n                IdlingResourcesName.Network to NetworkIdlingResource(reactContext),\n                IdlingResourcesName.AsyncStorage to AsyncStorageIdlingResource(reactContext)\n            )\n\n            return@withContext result\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/looper/MQThreadsReflector.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.looper\n\nimport android.os.Looper\nimport android.util.Log\nimport com.facebook.react.bridge.ReactContext\nimport org.joor.Reflect\nimport org.joor.ReflectException\n\n\nprivate const val LOG_TAG = \"DetoxRNIdleRes\"\nprivate const val METHOD_GET_LOOPER = \"getLooper\"\nprivate const val FIELD_NATIVE_MODULES_MSG_QUEUE = \"mNativeModulesMessageQueueThread\"\nprivate const val FIELD_JS_MSG_QUEUE = \"mJSMessageQueueThread\"\n\ninternal class MQThreadsReflector(private val reactContext: ReactContext) {\n\n    fun getJSMQueue(): MQThreadReflected? {\n        return getQueue(FIELD_JS_MSG_QUEUE)\n    }\n\n    fun getNativeModulesQueue(): MQThreadReflected? {\n        return getQueue(FIELD_NATIVE_MODULES_MSG_QUEUE)\n    }\n\n    private fun getQueue(queueName: String): MQThreadReflected? {\n        try {\n            val queue = Reflect.on(reactContext).field(queueName).get() as Any?\n            return MQThreadReflected(queue, queueName)\n        } catch (e: ReflectException) {\n            Log.e(LOG_TAG, \"Could not find queue: $queueName\", e)\n        }\n        return null\n    }\n}\n\ninternal class MQThreadReflected(private val queue: Any?, private val queueName: String) {\n    fun getLooper(): Looper? {\n        try {\n            if (queue != null) {\n                return Reflect.on(queue).call(METHOD_GET_LOOPER).get()\n            }\n        } catch (e: ReflectException) {\n            Log.e(LOG_TAG, \"Could not find looper for queue: $queueName\", e)\n        }\n        return null\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/network/NetworkIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.network\n\nimport android.util.Log\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource.ResourceCallback\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport okhttp3.Dispatcher\nimport java.util.regex.Pattern\nimport java.util.regex.PatternSyntaxException\n\n/**\n * Created by simonracz on 09/10/2017.\n *\n * Idling Resource which monitors React Native's OkHttpClient.\n *\n *\n * Must call stop() on it, before removing it from Espresso.\n */\nclass NetworkIdlingResource(private val dispatcher: Dispatcher) : DetoxIdlingResource(),\n    Choreographer.FrameCallback {\n    private val busyResources: MutableSet<String> = HashSet()\n\n    constructor(reactContext: ReactContext) : this(NetworkingModuleReflected(reactContext).getHttpClient()!!.dispatcher)\n\n    override fun getName(): String {\n        return NetworkIdlingResource::class.java.name\n    }\n\n    override fun getDebugName(): String {\n        return \"network\"\n    }\n\n    @Synchronized\n    override fun getBusyHint(): Map<String, Any> = mapOf(\"urls\" to ArrayList(busyResources))\n\n    override fun registerIdleTransitionCallback(callback: ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        Choreographer.getInstance().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        Choreographer.getInstance().removeFrameCallback(this)\n    }\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow\n    }\n\n    @Synchronized\n    override fun checkIdle(): Boolean {\n        busyResources.clear()\n\n        val calls = dispatcher.runningCalls()\n        for (call in calls) {\n            val url = call.request().url.toString()\n\n            if (!isUrlBlacklisted(url)) {\n                busyResources.add(url)\n            }\n        }\n\n        if (busyResources.isNotEmpty()) {\n            Log.i(LOG_TAG, \"Network is busy, with \" + busyResources.size + \" in-flight calls\")\n            Choreographer.getInstance().postFrameCallback(this)\n            return false\n        }\n\n        notifyIdle()\n        return true\n    }\n\n    private fun isUrlBlacklisted(url: String): Boolean {\n        for (pattern in blacklist) {\n            if (pattern.matcher(url).matches()) {\n                return true\n            }\n        }\n        return false\n    }\n\n    companion object {\n        private const val LOG_TAG = \"Detox\"\n\n        private val blacklist = ArrayList<Pattern>()\n\n        /**\n         * Must be called on the UI thread.\n         *\n         * @param urls list of regexes of blacklisted urls\n         */\n        @JvmStatic\n        fun setURLBlacklist(urls: List<String>?) {\n            blacklist.clear()\n            if (urls == null) return\n\n            for (url in urls) {\n                try {\n                    blacklist.add(Pattern.compile(url))\n                } catch (e: PatternSyntaxException) {\n                    Log.e(\n                        LOG_TAG,\n                        \"Couldn't parse regular expression for Black list url: $url\", e\n                    )\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/network/NetworkingModuleReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.network\n\nimport android.util.Log\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.modules.network.NetworkingModule\nimport com.wix.detox.reactnative.ReactNativeInfo\nimport okhttp3.OkHttpClient\nimport org.joor.Reflect\nimport org.joor.ReflectException\n\n\nprivate const val LOG_TAG = \"RNNetworkingModuleRefl\"\n\nprivate const val FIELD_OKHTTP_CLIENT_PRE80 = \"mClient\"\nprivate const val FIELD_OKHTTP_CLIENT = \"client\"\n\ninternal class NetworkingModuleReflected(private val reactContext: ReactContext) {\n    fun getHttpClient(): OkHttpClient? {\n        val networkNativeModule = reactContext.getNativeModule(NetworkingModule::class.java)\n        try {\n            val fieldName = if ( ReactNativeInfo.rnVersion().minor > 79) {\n                FIELD_OKHTTP_CLIENT\n            } else {\n                FIELD_OKHTTP_CLIENT_PRE80\n            }\n\n            return Reflect.on(networkNativeModule).field(fieldName).get()\n        } catch (e: ReflectException) {\n            Log.e(LOG_TAG, \"Can't set up Networking Module listener\", e)\n            return null\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/storage/AsyncStorageIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.storage\n\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.NativeModule\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.reactnative.helpers.RNHelpers\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport org.joor.Reflect\nimport java.util.concurrent.Executor\n\nprivate typealias SExecutorReflectedGenFnType = (executor: Executor) -> SerialExecutorReflected\n\nprivate val defaultSExecutorReflectedGenFn: SExecutorReflectedGenFnType =\n    { executor: Executor -> SerialExecutorReflected(executor) }\n\nclass AsyncStorageIdlingResource @JvmOverloads constructor(\n    private val reactContext: ReactContext,\n    private val sexecutorReflectedGenFn: SExecutorReflectedGenFnType = defaultSExecutorReflectedGenFn,\n    private val rnHelpers: RNHelpers = RNHelpers(),\n) : DetoxIdlingResource() {\n\n    private val moduleReflected: ModuleReflected? = null\n    private var idleCheckTask: Runnable? = null\n    private val idleCheckTaskImpl = Runnable {\n        val module = getModuleReflected() ?: return@Runnable\n        with(module.sexecutor) {\n            synchronized(executor()) {\n                if (hasPendingTasks()) {\n                    executeTask(idleCheckTask!!)\n                } else {\n                    clearIdleCheckTask()\n                    notifyIdle()\n                }\n            }\n        }\n\n    }\n\n    override fun getName(): String = javaClass.name\n    override fun getDebugName() = \"io\"\n    override fun getBusyHint(): Map<String, Any>? = null\n\n    private fun getModuleReflected(): ModuleReflected? {\n\n        fun className(): String {\n            val packageName = \"com.reactnativecommunity.asyncstorage\"\n            return \"$packageName.AsyncStorageModule\"\n        }\n\n        if (moduleReflected != null) {\n            return moduleReflected\n        }\n\n        val nativeModule = rnHelpers.getNativeModule(reactContext, className()) ?: return null\n        return ModuleReflected(nativeModule, sexecutorReflectedGenFn)\n    }\n\n    private fun checkIdleInternal(): Boolean {\n        val module = getModuleReflected() ?: return true\n        return with(module.sexecutor) {\n            synchronized(executor()) {\n                !hasActiveTask() && !hasPendingTasks()\n            }\n        }\n    }\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n\n        // TODO Don't do?\n        enqueueIdleCheckTask()\n    }\n\n    override fun checkIdle(): Boolean =\n        checkIdleInternal().also { idle ->\n            if (!idle) {\n                enqueueIdleCheckTask()\n            }\n        }\n\n    private fun enqueueIdleCheckTask() {\n        val module = getModuleReflected() ?: return\n        with(module.sexecutor) {\n            synchronized(executor()) {\n                if (idleCheckTask == null) {\n                    initIdleCheckTask()\n                    executeTask(idleCheckTask!!)\n                }\n            }\n        }\n    }\n\n    private fun initIdleCheckTask() {\n        idleCheckTask = idleCheckTaskImpl\n    }\n\n    private fun clearIdleCheckTask() {\n        idleCheckTask = null\n    }\n}\n\nprivate class ModuleReflected(module: NativeModule, sexecutorReflectedGen: SExecutorReflectedGenFnType) {\n    private val executorReflected: SerialExecutorReflected\n\n    init {\n        val reflected = Reflect.on(module)\n        val executor: Executor = reflected.field(\"executor\").get()\n        executorReflected = sexecutorReflectedGen(executor)\n    }\n\n    val sexecutor: SerialExecutorReflected\n        get() = executorReflected\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/storage/SerialExecutorReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.storage\n\nimport org.joor.Reflect\nimport java.util.concurrent.Executor\n\nclass SerialExecutorReflected(executor: Any) {\n    private val reflected = Reflect.on(executor)\n\n    fun hasPendingTasks(): Boolean = pendingTasks().isNotEmpty()\n    fun hasActiveTask(): Boolean = (activeTask() != null)\n    fun executeTask(runnable: Runnable) = executor().execute(runnable)\n    fun executor(): Executor = reflected.get()\n\n    private fun pendingTasks() = reflected.field(\"mTasks\").get<Collection<Any>>()\n    private fun activeTask() = reflected.field(\"mActive\").get<Runnable?>()\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/FabricTimersIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.timers\n\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\n\nclass FabricTimersIdlingResource(\n    private val reactContext: ReactContext,\n    private val getChoreographer: () -> Choreographer = { Choreographer.getInstance() }\n) : DetoxIdlingResource(), Choreographer.FrameCallback {\n\n    override fun checkIdle(): Boolean {\n        val hasActiveTimers = JavaTimersReflected.hasActiveTimers(reactContext)\n\n        if (hasActiveTimers) {\n            getChoreographer().postFrameCallback(this@FabricTimersIdlingResource)\n        } else {\n            notifyIdle()\n        }\n\n        return !hasActiveTimers\n    }\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        getChoreographer().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        getChoreographer().removeFrameCallback(this)\n    }\n\n    override fun getDebugName(): String {\n        return \"timers\"\n    }\n\n    override fun getBusyHint(): Map<String, Any>? = null\n\n    override fun getName(): String {\n        return FabricTimersIdlingResource::class.java.name\n    }\n\n\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/JavaTimersReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.timers\n\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.modules.core.JavaTimerManager\nimport com.wix.detox.reactnative.ReactNativeInfo\nimport org.joor.Reflect\nimport kotlin.reflect.full.declaredFunctions\nimport kotlin.reflect.jvm.isAccessible\n\nobject JavaTimersReflected {\n\n    fun hasActiveTimers(reactContext: ReactContext): Boolean {\n        val timersManager = getTimersManager(reactContext)\n        val hasActiveTimersInRangeInstanceClass = timersManager::class\n        val method =\n            hasActiveTimersInRangeInstanceClass.declaredFunctions.first { it.name.contains(\"hasActiveTimersInRange\") }\n        method.isAccessible = true\n        val hasActiveTimers: Boolean = method.call(timersManager, BUSY_WINDOW_THRESHOLD) as? Boolean ?: false\n        return hasActiveTimers\n    }\n\n    private fun getTimersManager(reactContext: ReactContext): JavaTimerManager {\n        val reactHostFieldName = if (ReactNativeInfo.rnVersion().minor > 79) {\n            \"reactHost\"\n        } else {\n            \"mReactHost\"\n        }\n\n        val reactInstanceFieldName = if (ReactNativeInfo.rnVersion().minor > 80) {\n            \"reactInstance\"\n        } else {\n            \"mReactInstance\"\n        }\n\n        val javaTimerManagerFieldName = if (ReactNativeInfo.rnVersion().minor > 79) {\n            \"javaTimerManager\"\n        } else {\n            \"mJavaTimerManager\"\n        }\n\n        val reactHost = Reflect.on(reactContext).field(reactHostFieldName).get<Any>()\n        val reactInstance = Reflect.on(reactHost).field(reactInstanceFieldName).get<Any>()\n        return Reflect.on(reactInstance).field(javaTimerManagerFieldName).get() as JavaTimerManager\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.timers\n\nimport android.annotation.SuppressLint\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.modules.core.TimingModule\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\n\nconst val BUSY_WINDOW_THRESHOLD: Long = 1500L\n\nclass TimersIdlingResource @JvmOverloads constructor(\n    reactContext: ReactContext,\n    private val getChoreographer: () -> Choreographer = { Choreographer.getInstance() }\n) : DetoxIdlingResource(), Choreographer.FrameCallback {\n\n    private val timingModule: TimingModule = reactContext.getNativeModule(TimingModule::class.java)!!\n\n    override fun getName(): String = this.javaClass.name\n    override fun getDebugName(): String = \"timers\"\n    override fun getBusyHint(): Map<String, Any>? = null\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        getChoreographer().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        getChoreographer().removeFrameCallback(this)\n    }\n\n    @SuppressLint(\"VisibleForTests\")\n    override fun checkIdle(): Boolean {\n        val isIdle = !timingModule.hasActiveTimersInRange(BUSY_WINDOW_THRESHOLD)\n\n        if (isIdle) {\n            notifyIdle()\n        } else {\n            getChoreographer().postFrameCallback(this)\n        }\n\n        return isIdle\n    }\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/fabric/FabricUIManagerIdlingResources.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.fabric\n\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.uimanager.UIManagerHelper\nimport com.facebook.react.uimanager.common.UIManagerType\nimport com.wix.detox.reactnative.ReactNativeInfo\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport org.joor.Reflect\nimport java.util.concurrent.ConcurrentLinkedQueue\n\n\nclass FabricUIManagerIdlingResources(\n    private val reactContext: ReactContext\n) : DetoxIdlingResource(), Choreographer.FrameCallback {\n\n    override fun checkIdle(): Boolean {\n        return if (getViewCommandMountItemsSize() == 0 && getMountItemsSize() == 0) {\n            notifyIdle()\n            true\n        } else {\n            Choreographer.getInstance().postFrameCallback(this)\n            false\n        }\n    }\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        Choreographer.getInstance().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        Choreographer.getInstance().removeFrameCallback(this)\n    }\n\n    override fun getDebugName(): String {\n        return \"ui\"\n    }\n\n    override fun getBusyHint(): Map<String, Any> {\n        return mapOf(\"mount_items\" to getMountItemsSize(), \"view_command_mount_items\" to getViewCommandMountItemsSize())\n    }\n\n    override fun getName(): String = FabricUIManagerIdlingResources::class.java.name\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow()\n    }\n\n    private fun getMountItemsSize(): Int {\n        val mountItemDispatcher = getMountItemDispatcher()\n        val filedName = if (ReactNativeInfo.rnVersion().minor >= 81) {\n            \"mountItems\"\n        } else {\n            \"mMountItems\"\n        }\n        val mountItems = Reflect.on(mountItemDispatcher).field(filedName).get<ConcurrentLinkedQueue<*>>()\n        return mountItems.size\n    }\n\n    private fun getMountItemDispatcher(): Any {\n        val fabricUIManager = UIManagerHelper.getUIManager(reactContext, UIManagerType.FABRIC)\n        val mountItemDispatcher = Reflect.on(fabricUIManager).field(\"mMountItemDispatcher\").get<Any>()\n        return mountItemDispatcher\n    }\n\n    private fun getViewCommandMountItemsSize(): Int {\n        val mountItemDispatcher = getMountItemDispatcher()\n        val filedName = if (ReactNativeInfo.rnVersion().minor >= 81) {\n            \"viewCommandMountItems\"\n        } else {\n            \"mViewCommandMountItems\"\n        }\n        val viewCommandMountItems =\n            Reflect.on(mountItemDispatcher).field(filedName).get<ConcurrentLinkedQueue<*>>()\n        return viewCommandMountItems.size\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/paper/DispatchCommandOperationReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.paper\n\nimport android.util.Log\nimport com.wix.detox.common.DetoxLog\nimport org.joor.Reflect\nimport org.joor.ReflectException\n\nprivate const val FIELD_TAG = \"mTag\"\nprivate const val FIELD_NUM_RETRIES = \"numRetries\"\nprivate const val FIELD_COMMAND = \"mCommand\"\n\nclass DispatchCommandOperationReflected(val instance: Any?) {\n    val tag: Int?\n        get() = try {\n            Reflect.on(instance).field(FIELD_TAG).get<Int>()\n        } catch (e: ReflectException) {\n            Log.e(DetoxLog.LOG_TAG, \"failed to get $FIELD_TAG \", e)\n            null\n        }\n\n    val numRetries: Int?\n        get() = try {\n            Reflect.on(instance).field(FIELD_NUM_RETRIES).get<Int>()\n        } catch (e: ReflectException) {\n            Log.e(DetoxLog.LOG_TAG, \"failed to get $FIELD_NUM_RETRIES \", e)\n            0\n        }\n\n    val viewCommand\n        get() = try {\n            Reflect.on(instance).field(FIELD_COMMAND).get<Any>()\n        } catch (e: ReflectException) {\n            Log.e(DetoxLog.LOG_TAG, \"failed to get $FIELD_COMMAND \", e)\n            null\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/paper/NativeHierarchyManagerReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.paper\n\nimport android.util.Log\nimport android.view.View\nimport com.facebook.react.uimanager.NativeViewHierarchyManager\nimport com.facebook.react.uimanager.UIViewOperationQueue\nimport com.wix.detox.common.DetoxLog\nimport org.joor.Reflect\nimport org.joor.ReflectException\n\nprivate const val FIELD_NATIVE_HIERARCHY_MANAGER = \"mNativeViewHierarchyManager\"\n\n\n\nclass NativeHierarchyManagerReflected(uIViewOperationQueueInstance: UIViewOperationQueue) {\n    private val reflected = Reflect.on(uIViewOperationQueueInstance)\n\n    fun getViewClass(tag: Int): View? {\n        return nativeViewHierarchyManager()?.resolveView(tag)\n    }\n\n    private fun nativeViewHierarchyManager(): NativeViewHierarchyManager? {\n        return try {\n            reflected.field(FIELD_NATIVE_HIERARCHY_MANAGER).get<NativeViewHierarchyManager>()\n        } catch(e: ReflectException) {\n            Log.e(DetoxLog.LOG_TAG, \"failed to get $FIELD_NATIVE_HIERARCHY_MANAGER \", e.cause)\n            null\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/paper/UIManagerModuleReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.paper\n\nimport android.util.Log\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.uimanager.UIViewOperationQueue\nimport com.wix.detox.common.DetoxLog\nimport org.joor.Reflect\n\nprivate const val CLASS_UI_MANAGER_MODULE = \"com.facebook.react.uimanager.UIManagerModule\"\nprivate const val METHOD_GET_NATIVE_MODULE = \"getNativeModule\"\nprivate const val METHOD_GET_UI_IMPLEMENTATION = \"getUIImplementation\"\nprivate const val METHOD_IS_EMPTY = \"isEmpty\"\nprivate const val FIELD_UI_OPERATION_QUEUE = \"mOperationsQueue\"\nprivate const val FIELD_DISPATCH_RUNNABLES = \"mDispatchUIRunnables\"\nprivate const val FIELD_DISPATCH_RUNNABLES_LOCK = \"mDispatchRunnablesLock\"\nprivate const val FIELD_NON_BATCHED_OPS = \"mNonBatchedOperations\"\nprivate const val FIELD_NON_BATCHED_OPS_LOCK = \"mNonBatchedOperationsLock\"\n\n\n\nclass UIManagerModuleReflected(private val reactContext: ReactContext) {\n\n    fun isRunnablesListEmpty(): Boolean =\n        getUIOperationQueue()?.let {\n            synchronized(Reflect.on(it).field(FIELD_DISPATCH_RUNNABLES_LOCK).get()) {\n                Reflect.on(it)\n                    .field(FIELD_DISPATCH_RUNNABLES)\n                    .call(METHOD_IS_EMPTY).get()\n            }\n        } ?: true\n\n    fun isNonBatchOpsEmpty(): Boolean =\n        getUIOperationQueue()?.let {\n            synchronized(Reflect.on(it).field(FIELD_NON_BATCHED_OPS_LOCK).get()) {\n                Reflect.on(it)\n                    .field(FIELD_NON_BATCHED_OPS)\n                    .call(METHOD_IS_EMPTY).get()\n            }\n        } ?: true\n\n    fun isOperationQueueEmpty(): Boolean =\n        getUIOperationQueue()?.let {\n            Reflect.on(it).call(METHOD_IS_EMPTY).get()\n        } ?: true\n\n    private fun viewCommandOperations(): ViewCommandOpsQueueReflected? =\n        getUIOperationQueue()?.let {\n            ViewCommandOpsQueueReflected(it)\n        }\n\n\n    private fun getUIOperationQueue(): UIViewOperationQueue? =\n        try {\n            val uiModuleClass = Class.forName(CLASS_UI_MANAGER_MODULE)\n            Reflect.on(reactContext)\n                .call(METHOD_GET_NATIVE_MODULE, uiModuleClass)\n                .call(METHOD_GET_UI_IMPLEMENTATION)\n                .field(FIELD_UI_OPERATION_QUEUE)\n                .get()\n        } catch (e: Exception) {\n            Log.e(DetoxLog.LOG_TAG, \"failed to get $CLASS_UI_MANAGER_MODULE instance \", e)\n            null\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/paper/UIModuleIdlingResource.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.paper\n\nimport android.util.Log\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.reactnative.helpers.RNHelpers\nimport com.wix.detox.reactnative.idlingresources.DetoxIdlingResource\nimport org.joor.ReflectException\n\n/**\n * Espresso IdlingResource for React Native's UI Module.\n * Hooks up to React Native internals to grab the pending ui operations from it.\n */\nclass UIModuleIdlingResource(private val reactContext: ReactContext)\n    : DetoxIdlingResource(), Choreographer.FrameCallback {\n\n    private val uiManagerModuleReflected = UIManagerModuleReflected(reactContext)\n\n    override fun getName(): String = UIModuleIdlingResource::class.java.name\n    override fun getDebugName(): String = \"ui\"\n    override fun getBusyHint(): Map<String, Any> {\n        return mapOf(\"reason\" to \"UI rendering activity\")\n    }\n\n    override fun checkIdle(): Boolean {\n        try {\n            if (!reactContext.hasActiveCatalystInstance()) {\n                Log.e(LOG_TAG, \"No active CatalystInstance. Should never see this.\")\n                return false\n            }\n\n            if (RNHelpers().getNativeModule(\n                    reactContext,\n                    \"com.facebook.react.uimanager.UIManagerModule\"\n                ) == null) {\n                notifyIdle()\n                return true\n            }\n\n            val runnablesAreEmpty = uiManagerModuleReflected.isRunnablesListEmpty()\n            val nonBatchesOpsEmpty = uiManagerModuleReflected.isNonBatchOpsEmpty()\n            val operationQueueEmpty = uiManagerModuleReflected.isOperationQueueEmpty()\n\n            if (runnablesAreEmpty && nonBatchesOpsEmpty && operationQueueEmpty) {\n                notifyIdle()\n                return true\n            }\n\n            Log.i(LOG_TAG, \"UIManagerModule is busy\")\n            Choreographer.getInstance().postFrameCallback(this)\n            return false\n        } catch (e: ReflectException) {\n            Log.e(LOG_TAG, \"Can't set up RN UIModule listener\", e.cause)\n        }\n        notifyIdle()\n        return true\n    }\n\n    override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {\n        super.registerIdleTransitionCallback(callback)\n        Choreographer.getInstance().postFrameCallback(this)\n    }\n\n    override fun onUnregistered() {\n        super.onUnregistered()\n        Choreographer.getInstance().removeFrameCallback(this)\n    }\n\n    override fun doFrame(frameTimeNanos: Long) {\n        isIdleNow\n    }\n\n    companion object {\n        private const val LOG_TAG = \"Detox\"\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/paper/ViewCommandOpsQueueReflected.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.uimodule.paper\n\nimport android.util.Log\nimport com.facebook.react.uimanager.UIViewOperationQueue\nimport com.wix.detox.common.DetoxLog\nimport org.joor.Reflect\nimport org.joor.ReflectException\n\nprivate const val FIELD_VIEW_COMMAND_OPERATIONS = \"mViewCommandOperations\"\n\nclass ViewCommandOpsQueueReflected(uiViewOperationQueueInstance: UIViewOperationQueue) {\n    private val instance = Reflect.on(uiViewOperationQueueInstance)\n\n    val size: Int?\n        get() = viewCommandOperations()?.size\n\n    fun firstCommandReflected() = DispatchCommandOperationReflected(firstCommand())\n\n    private fun firstCommand() = viewCommandOperations()?.elementAt(0)\n    private fun viewCommandOperations(): Collection<Any>? =\n        try {\n            instance.field(FIELD_VIEW_COMMAND_OPERATIONS).get<Collection<Any>>()\n        } catch(e: ReflectException) {\n            Log.e(DetoxLog.LOG_TAG, \"could not get reflected field mViewCommandOperations \", e)\n            null\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/reloader/ReactNativeReloader.kt",
    "content": "package com.wix.detox.reactnative.reloader\n\nimport android.app.Instrumentation\nimport com.facebook.react.ReactApplication\n\ninterface ReactNativeReLoader {\n    fun reloadInBackground()\n}\n\nclass OldArchReactNativeReLoader(\n        private val instrumentation: Instrumentation,\n        private val rnApplication: ReactApplication\n) : ReactNativeReLoader {\n\n    override fun reloadInBackground() {\n        val rnInstanceManager = rnApplication.reactNativeHost.reactInstanceManager\n        instrumentation.runOnMainSync {\n            rnInstanceManager.recreateReactContextInBackground()\n        }\n    }\n}\n\nclass NewArchitectureNativeReLoader(\n    private val instrumentation: Instrumentation,\n    private val rnApplication: ReactApplication\n) : ReactNativeReLoader {\n    override fun reloadInBackground() {\n        val reactHost = rnApplication.reactHost ?: throw IllegalStateException(\"ReactHost is null. Check implementation of you Application class\")\n\n        instrumentation.runOnMainSync {\n            reactHost.reload(\"Detox\")\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/reloader/ReactNativeReloaderFactory.kt",
    "content": "package com.wix.detox.reactnative.reloader\n\nimport android.app.Instrumentation\nimport com.facebook.react.ReactApplication\nimport com.wix.detox.reactnative.isFabricEnabled\n\nclass ReactNativeReloaderFactory(\n    private val instrumentation: Instrumentation,\n    private val rnApplication: ReactApplication\n) {\n\n    fun create(): ReactNativeReLoader {\n        return when {\n            isFabricEnabled() -> NewArchitectureNativeReLoader(instrumentation, rnApplication)\n            else -> OldArchReactNativeReLoader(instrumentation, rnApplication)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/ui/UIExtensions.kt",
    "content": "package com.wix.detox.reactnative.ui\n\nimport android.view.View\nimport android.widget.TextView\nimport com.wix.detox.common.traverseViewHierarchy\nimport com.wix.detox.reactnative.ReactNativeInfo\nimport com.wix.detox.reactnative.utils.isReactNativeObject\n\nfun View.getAccessibilityLabel(\n    isReactNativeObjectFn: (Any) -> Boolean = { isReactNativeObject(it) }\n): CharSequence? {\n    val separator = if (ReactNativeInfo.rnVersion().minor >= 81) \", \" else \" \"\n\n    return if (isReactNativeObjectFn(this)) {\n        val subLabels = collectAccessibilityLabelsFromHierarchy(this)\n        if (subLabels.isEmpty()) null else subLabels.joinToString(separator)\n    } else {\n        getRawAccessibilityLabel(this)\n    }\n}\n\nprivate fun collectAccessibilityLabelsFromHierarchy(\n    rootView: View,\n    subLabels: MutableList<CharSequence> = mutableListOf(),\n): List<CharSequence> {\n    traverseViewHierarchy(rootView) { view ->\n        getRawAccessibilityLabel(view)?.let { rawLabel ->\n            subLabels.add(rawLabel)\n            false\n        } ?: true\n\n    }\n    return subLabels\n}\n\nprivate fun getRawAccessibilityLabel(view: View): CharSequence? =\n    if (view.contentDescription != null) {\n        view.contentDescription\n    } else if (view is TextView) {\n        view.text\n    } else null\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/reactnative/utils/RNUtils.kt",
    "content": "package com.wix.detox.reactnative.utils\n\nprivate const val REACT_NATIVE_PACKAGE = \"com.facebook.react\"\n\nfun isReactNativeObject(obj: Any): Boolean =\n    obj.javaClass.canonicalName?.startsWith(REACT_NATIVE_PACKAGE) == true\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/detox/uiautomator/UiAutomator.java",
    "content": "package com.wix.detox.uiautomator;\n\nimport androidx.test.platform.app.InstrumentationRegistry;\nimport androidx.test.uiautomator.UiDevice;\n\n/**\n * Created by rotemm on 30/08/2017.\n */\n\npublic class UiAutomator {\n    private UiAutomator() {}\n\n    public static UiDevice uiDevice() {\n        return UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/MethodInvocation.java",
    "content": "package com.wix.invoke;\n\nimport com.wix.invoke.exceptions.EmptyInvocationInstructionException;\nimport com.wix.invoke.parser.JsonParser;\nimport com.wix.invoke.types.Invocation;\nimport com.wix.invoke.types.Target;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.lang.reflect.InvocationTargetException;\nimport org.json.JSONException;\n\n\n/**\n * Created by rotemm on 10/10/2016.\n */\npublic class MethodInvocation {\n\n    public Object invoke(String invocationJson) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, JSONException {\n        return invoke(invocationJson, null);\n    }\n\n    public Object invoke(String invocationJson, Class<?> extendWith) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, JSONException {\n        JsonParser parser = new JsonParser();\n        Invocation invocation = new Invocation(parser.parse(invocationJson));\n        return invoke(invocation);\n    }\n\n    public Object invoke(Invocation invocation) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n        if (StringUtils.isBlank(invocation.getMethod()))\n            throw new EmptyInvocationInstructionException();\n\n        try {\n            Target target = invocation.getTarget();\n            return target.invoke(invocation);\n        } catch (Exception e) {\n            throw e;\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/MethodUtilsExt.java",
    "content": "package com.wix.invoke;\n\nimport org.apache.commons.lang3.ArrayUtils;\nimport org.apache.commons.lang3.reflect.MethodUtils;\n\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\n\n/**\n * Created by rotemm on 26/10/2016.\n */\n\npublic class MethodUtilsExt extends MethodUtils {\n\n    public static Object invokeMethodEvenIfInaccessible(Object object, String methodName, Object... args) throws Exception {\n        Method method = object.getClass().getDeclaredMethod(methodName);\n        method.setAccessible(true);\n        return method.invoke(object, args);\n    }\n\n\n    public static Object invokeExactMethodNoAutobox(final Object object, final String methodName, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n        args = ArrayUtils.nullToEmpty(args);\n        Class<?>[] parameterTypes = toClass(args);\n        parameterTypes = ArrayUtils.nullToEmpty(parameterTypes);\n        final Method method = getAccessibleMethod(object.getClass(), methodName, parameterTypes);\n        if (method == null) {\n            throw new NoSuchMethodException(\"No such accessible method: \"\n                    + methodName + \"() on object: \"\n                    + object.getClass().getName());\n        }\n        return method.invoke(object, args);\n    }\n\n    public static Class<?>[] toClass(final Object... array) {\n        if (array == null) {\n            return null;\n        } else if (array.length == 0) {\n            return ArrayUtils.EMPTY_CLASS_ARRAY;\n        }\n        final Class<?>[] classes = new Class[array.length];\n        for (int i = 0; i < array.length; i++) {\n            Class clazz = array[i] == null ? null : array[i].getClass();\n            if (Integer.class == clazz) {\n                classes[i] = int.class;\n            } else if (Double.class == clazz) {\n                classes[i] = double.class;\n            } else if (Float.class == clazz) {\n                classes[i] = float.class;\n            } else if (Boolean.class == clazz) {\n                classes[i] = boolean.class;\n            } else {\n                classes[i] = clazz;\n            }\n\n\n        }\n        return classes;\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/exceptions/EmptyInvocationInstructionException.java",
    "content": "package com.wix.invoke.exceptions;\n\n/**\n * Created by rotemm on 10/10/2016.\n */\npublic class EmptyInvocationInstructionException extends RuntimeException {\n\n    public EmptyInvocationInstructionException() {\n        super(\"Trying to invoke an empty instruction\");\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/parser/JsonParser.java",
    "content": "package com.wix.invoke.parser;\n\nimport org.json.JSONObject;\nimport org.json.JSONException;\n\n/**\n * Created by rotemm on 13/10/2016.\n */\npublic class JsonParser {\n\n    public JsonParser() {\n    }\n\n    public JSONObject parse(String jsonData) {\n        try {\n            JSONObject obj = new JSONObject(jsonData);\n            return obj;\n        } catch (JSONException e) {\n            throw new RuntimeException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/types/ClassTarget.java",
    "content": "package com.wix.invoke.types;\n\nimport android.util.Log;\n;\n\nimport org.apache.commons.lang3.reflect.MethodUtils;\n\nimport java.lang.reflect.InvocationTargetException;\nimport java.util.Arrays;\n\n/**\n * Created by rotemm on 20/10/2016.\n */\npublic class ClassTarget extends Target {\n\n    public ClassTarget(Object value) {\n        super(value);\n    }\n\n    @Override\n    public Object execute(Invocation invocation) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n        Log.d(\"Detox\", String.format(\"%s, %s, %s\", Class.forName(getValue().toString()), invocation.getMethod(),   Arrays.toString(invocation.getArgs())));\n        return MethodUtils.invokeStaticMethod(Class.forName(getValue().toString()), invocation.getMethod(), invocation.getArgs());\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/types/Invocation.java",
    "content": "package com.wix.invoke.types;\n\nimport com.wix.invoke.parser.JsonParser;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Created by rotemm on 10/10/2016.\n */\npublic class Invocation {\n    private Target target;\n    private String method;\n    private Object[] args;\n\n    public Invocation() {\n\n    }\n\n    public Invocation(Target target, String method, Object... args) {\n        this.target = target;\n        this.method = method;\n        this.args = args;\n    }\n\n    public Invocation(JSONObject json) throws JSONException {\n        this.target = Target.getTarget(json.getJSONObject(\"target\"));\n        this.method = json.getString(\"method\");\n        JSONArray args = json.getJSONArray(\"args\");\n        try {\n            this.setArgs(args);\n        } catch (JSONException e) {\n            throw new RuntimeException(\"Unable to convert args: \" + e);\n        }\n    }\n\n    public String getMethod() {\n        return method;\n    }\n\n    public void setMethod(String method) {\n        this.method = method;\n    }\n\n    public Target getTarget() {\n        return target;\n    }\n\n    public void setTarget(Target target) {\n        this.target = target;\n    }\n\n    public Object[] getArgs() {\n        return args;\n    }\n\n    public void setArgs(JSONArray args) throws JSONException {\n        Object[] outputArgs = new Object[args.length()];\n        for (int i = 0; i < args.length(); i++) {\n            Object argument = null;\n            if (args.get(i).getClass() == String.class) {\n                argument = args.get(i);\n            } else if(args.get(i).getClass() == JSONArray.class) {\n                JSONArray jsonArray = (JSONArray) args.get(i);\n                List<Object> list = new ArrayList<>();\n                for (int j = 0; j < jsonArray.length(); j++) {\n                    list.add(jsonArray.get(j));\n                }\n                argument = list;\n            } else {\n                JSONObject jsonArgument = args.optJSONObject(i);\n                if (jsonArgument != null && jsonArgument.optString(\"type\") != null) {\n                    String type = jsonArgument.optString(\"type\");\n                    if (type.equals(\"Integer\")) {\n                        argument = jsonArgument.optInt(\"value\");\n                    } else if (type.equals(\"integer\")) {\n                        argument = jsonArgument.optInt(\"value\");\n                    } else if (type.equals(\"Float\")) {\n                        argument = Float.valueOf(jsonArgument.optString(\"value\"));\n                    } else if (type.equals(\"Double\")) {\n                        argument = jsonArgument.optDouble(\"value\");\n                    } else if (type.equals(\"String\")) {\n                        argument = jsonArgument.optString(\"value\");\n                    } else if (type.equals(\"Boolean\")) {\n                        argument = jsonArgument.optBoolean(\"value\");\n                    } else if (type.equals(\"boolean\")) {\n                        argument = jsonArgument.optBoolean(\"value\");\n                    } else if (type.equals(\"Invocation\")) {\n                        argument = new Invocation(jsonArgument.optJSONObject(\"value\"));\n                    } else {\n                        throw new RuntimeException(\"Unhandled arg type \" + type);\n                    }\n                }\n            }\n            outputArgs[i] = argument;\n        }\n\n        this.args = outputArgs;\n    }\n\n    public void setArgs(Object[] args) {\n        JsonParser parser = new JsonParser();\n\n        for (int i = 0; i < args.length; i++) {\n            Object argument = args[i];\n            if (argument instanceof HashMap && !((HashMap) argument).isEmpty()) {\n                String type = (String) ((HashMap) argument).get(\"type\");\n                Object value = ((HashMap) argument).get(\"value\");\n                if (type.equals(\"Integer\")) {\n                    argument = (int) value;\n                } else if (type.equals(\"integer\")) {\n                    argument = (int) value;\n                } else if (type.equals(\"Float\")) {\n                    argument = Float.valueOf(value.toString());\n                } else if (type.equals(\"Double\")) {\n                    argument = Double.valueOf(value.toString());\n                } else if (type.equals(\"String\")) {\n                    argument = (String) value;\n                }else if (type.equals(\"Boolean\")) {\n                    argument = ((Boolean) value);\n                } else if (type.equals(\"boolean\")) {\n                    argument = ((Boolean) value).booleanValue();\n                } else if (type.equals(\"Invocation\")) {\n                    argument = parser.parse((String)value);\n                } else {\n                    throw new RuntimeException(\"Unhandled arg type \" + type);\n                }\n\n                args[i] = argument;\n            }\n        }\n\n        this.args = args;\n    }\n\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (!(o instanceof Invocation)) return false;\n\n        Invocation that = (Invocation) o;\n\n        if (target != null ? !target.equals(that.target) : that.target != null) return false;\n        if (method != null ? !method.equals(that.method) : that.method != null) return false;\n        return Arrays.equals(args, that.args);\n\n    }\n\n    @Override\n    public int hashCode() {\n        int result = target != null ? target.hashCode() : 0;\n        result = 31 * result + (method != null ? method.hashCode() : 0);\n        result = 31 * result + Arrays.hashCode(args);\n        return result;\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/types/InvocationTarget.java",
    "content": "package com.wix.invoke.types;\n\nimport org.apache.commons.lang3.reflect.MethodUtils;\nimport java.lang.reflect.InvocationTargetException;\n/**\n * Created by rotemm on 20/10/2016.\n */\npublic class InvocationTarget extends Target {\n\n    public InvocationTarget(Invocation value) {\n        super(value);\n    }\n\n    @Override\n    public Object execute(Invocation invocation) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n        return  MethodUtils.invokeMethod(invocation.getTarget().getValue(), invocation.getMethod(), invocation.getArgs());\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/types/ObjectInstanceTarget.java",
    "content": "package com.wix.invoke.types;\n\n\nimport org.apache.commons.lang3.reflect.MethodUtils;\n\nimport java.lang.reflect.InvocationTargetException;\n\n/**\n * Created by rotemm on 20/10/2016.\n */\n\npublic class ObjectInstanceTarget extends Target {\n\n    public ObjectInstanceTarget(Object value) {\n        super(value);\n    }\n\n    @Override\n    public Object execute(Invocation invocation) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n        return  MethodUtils.invokeExactMethod(this.value, invocation.getMethod(), invocation.getArgs());\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/full/java/com/wix/invoke/types/Target.java",
    "content": "package com.wix.invoke.types;\n\nimport java.lang.reflect.InvocationTargetException;\nimport org.json.JSONObject;\nimport org.json.JSONException;\n\n/**\n * Created by rotemm on 10/10/2016.\n */\n\npublic abstract class Target {\n\n    Object value;\n\n    public static Target getTarget(JSONObject target) throws JSONException {\n        String type = target.getString(\"type\");\n\n        if (type.equals(\"Invocation\")) {\n            JSONObject objectValue = target.getJSONObject(\"value\");\n            return new InvocationTarget(new Invocation(objectValue));\n        }\n\n        if (type.equals(\"Espresso\")) {\n            String stringValue = target.getString(\"value\");\n            return new ObjectInstanceTarget(stringValue);\n        }\n\n        // Default to Class\n        String value = target.getString(\"value\");\n        return new ClassTarget(value);\n    }\n\n    public Target(Object value) {\n        this.value = value;\n    }\n\n    public Object getValue() {\n        return value;\n    }\n\n    public void setValue(Object value) {\n        this.value = value;\n    }\n\n    public Object invoke(Invocation invocation) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n        if (this.value instanceof Invocation) {\n            Invocation innerInvocation = (Invocation) this.value;\n            this.value = innerInvocation.getTarget().invoke(innerInvocation);\n        }\n\n        Object[] args = invocation.getArgs();\n        for (int i = 0; i < args.length; i++) {\n            if (args[i] instanceof Invocation) {\n                Invocation innerInvocation = (Invocation) args[i];\n                args[i] = innerInvocation.getTarget().invoke(innerInvocation);\n            }\n        }\n        invocation.setArgs(args);\n        return execute(invocation);\n    }\n\n    public abstract Object execute(Invocation invocation) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (!(o instanceof Target)) return false;\n\n        Target target = (Target) o;\n\n        return value != null ? value.equals(target.value) : target.value == null;\n    }\n\n    @Override\n    public int hashCode() {\n        int result = (value != null ? value.hashCode() : 0);\n        return result;\n    }\n}"
  },
  {
    "path": "detox/android/detox/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.wix.detox\"/>\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/action/common/MotionDefs.kt",
    "content": "@file:JvmName(\"MotionDefs\")\n\npackage com.wix.detox.action.common\n\nimport androidx.annotation.IntDef\n\n@Retention(AnnotationRetention.SOURCE)\n@IntDef(MOTION_DIR_LEFT, MOTION_DIR_RIGHT, MOTION_DIR_UP, MOTION_DIR_DOWN)\nannotation class MotionDir\n\nconst val MOTION_DIR_LEFT = 1\nconst val MOTION_DIR_RIGHT = 2\nconst val MOTION_DIR_UP = 3\nconst val MOTION_DIR_DOWN = 4\n\nfun isAscending(@MotionDir direction: Int): Boolean {\n    return direction == MOTION_DIR_RIGHT || direction == MOTION_DIR_DOWN\n}\n\nfun isDescending(@MotionDir direction: Int): Boolean {\n    return direction == MOTION_DIR_LEFT || direction == MOTION_DIR_UP\n}\n\nfun isHorizontal(@MotionDir direction: Int): Boolean {\n    return direction == MOTION_DIR_LEFT || direction == MOTION_DIR_RIGHT\n}\n\nfun isVertical(@MotionDir direction: Int): Boolean {\n    return direction == MOTION_DIR_DOWN || direction == MOTION_DIR_UP\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/DetoxErrors.java",
    "content": "package com.wix.detox.common;\n\npublic interface DetoxErrors {\n    class DetoxRuntimeException extends RuntimeException {\n        public DetoxRuntimeException(Throwable cause) {\n            super(cause);\n        }\n        public DetoxRuntimeException(String message) {\n            super(message);\n        }\n    }\n\n    /**\n     * Thrown when a Detox action has met conditions where it can no longer have an effect. For\n     * example, scrolling a view when it's already at the scrollable limit.\n     */\n    class StaleActionException extends DetoxRuntimeException {\n        public StaleActionException(Throwable cause) {\n            super(cause);\n        }\n    }\n\n    class DetoxIllegalStateException extends DetoxRuntimeException {\n        public DetoxIllegalStateException(String message) {\n            super(message);\n        }\n    }\n\n    class DetoxIllegalArgumentException extends DetoxRuntimeException {\n        public DetoxIllegalArgumentException(String message) {\n            super(message);\n        }\n\n        public DetoxIllegalArgumentException(Throwable cause) {\n            super(cause);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/DetoxLog.kt",
    "content": "@file:JvmName(\"DetoxLog\")\n\npackage com.wix.detox.common\n\nimport android.util.Log\n\nclass DetoxLog private constructor() {\n\n    fun verbose(tag: String, log: String) = Log.v(tag, log)\n    fun verbose(tag: String, log: String, error: Throwable) = Log.v(tag, log, error)\n\n    fun debug(tag: String, log: String) = Log.d(tag, log)\n    fun debug(tag: String, log: String, error: Throwable) = Log.d(tag, log, error)\n\n    fun info(tag: String, log: String) = Log.i(tag, log)\n    fun info(tag: String, log: String, error: Throwable) = Log.i(tag, log, error)\n\n    fun warn(tag: String, log: String) = Log.w(tag, log)\n    fun warn(tag: String, log: String, error: Throwable) = Log.w(tag, log, error)\n    fun warn(tag: String, error: Throwable) = Log.w(tag, error)\n\n    fun error(tag: String, log: String) = Log.e(tag, log)\n    fun error(tag: String, log: String, error: Throwable) = Log.e(tag, log, error)\n\n    internal companion object {\n        internal val instance = DetoxLog()\n        internal const val LOG_TAG = \"Detox\"\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/ErrorUtils.kt",
    "content": "package com.wix.detox.common\n\nfun extractRootCause(t: Throwable): Throwable {\n    var ex: Throwable = t\n    while (ex.cause != null) {\n        ex = ex.cause!!\n    }\n    return ex\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/JsonConverter.kt",
    "content": "package com.wix.detox.common\n\nimport android.os.Bundle\nimport org.json.JSONArray\nimport org.json.JSONObject\n\ninternal class JsonConverter(private val json: JSONObject) {\n    fun toBundle(): Bundle {\n        val bundle = Bundle()\n        json.keys().forEach { key: String ->\n            when (val value = json.get(key)) {\n                is Boolean -> bundle.putBoolean(key, value)\n                is Integer -> bundle.putInt(key, value as Int)\n                is java.lang.Long -> bundle.putLong(key, value as Long)\n                is java.lang.Double -> bundle.putDouble(key, value as Double)\n                is String -> bundle.putString(key, value)\n                is JSONObject -> {\n                    val subObject = json.getJSONObject(key)\n                    val subBundle = JsonConverter(subObject).toBundle()\n                    bundle.putBundle(key, subBundle)\n                }\n                is JSONArray -> {\n                    val stringArray = parseJsonArrayAsStringsList(value)\n                    bundle.putStringArrayList(key, stringArray)\n                }\n            }\n        }\n        return bundle\n    }\n\n    private fun parseJsonArrayAsStringsList(array: JSONArray)\n            = ArrayList<String>(array.length()).apply {\n                for (i in 0 until array.length()) {\n                    val item = array[i]\n                    if (item !is String && item !is Number && item !is Boolean) {\n                        throw IllegalArgumentException(\"Non-string arrays not currently supported inside JSON's (failed to parse value: $item)\")\n                    }\n                    add(item.toString())\n                }\n            }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/TextFileReader.kt",
    "content": "package com.wix.detox.common\n\nimport java.io.File\n\ninternal class TextFileReader(private val fileName: String) {\n    fun read() = File(fileName).readText(Charsets.UTF_8)\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/UIThread.kt",
    "content": "package com.wix.detox.common\n\nimport android.os.Handler\nimport android.os.Looper\nimport java.util.concurrent.Callable\nimport java.util.concurrent.FutureTask\n\nobject UIThread {\n    private val handler = Handler(Looper.getMainLooper())\n\n    @JvmStatic\n    fun post(runnable: Runnable) {\n        handler.post(runnable)\n    }\n\n    @JvmStatic\n    fun postSync(runnable: Runnable) =\n        postSync(Callable<Any?> {\n            runnable.run()\n            null\n        })\n\n    @JvmStatic\n    fun <T> postSync(callable: Callable<T>): T =\n        FutureTask<T>(callable)\n            .also {\n                handler.post(it)\n            }.get()\n\n    @JvmStatic\n    fun runSync(runnable: Runnable) {\n        if (isOnUIThread()) {\n            runnable.run()\n        } else {\n            postSync(runnable)\n        }\n    }\n\n    @JvmStatic\n    fun <T> runSync(callable: Callable<T>): T {\n        if (isOnUIThread()) {\n            return callable.call()\n        }\n        return postSync(callable)\n    }\n\n    @JvmStatic\n    fun postFirst(runnable: Runnable) {\n        handler.postAtFrontOfQueue(runnable)\n    }\n\n    @JvmStatic\n    fun postFirstSync(runnable: Runnable) {\n        postFirstSync(Callable<Any?> {\n            runnable.run()\n            null\n        })\n    }\n\n    @JvmStatic\n    fun <T> postFirstSync(callable: Callable<T>): T =\n        FutureTask<T>(callable)\n            .also {\n                handler.postAtFrontOfQueue(it)\n            }.get()\n\n    private fun isOnUIThread() =\n        (Looper.myLooper() == Looper.getMainLooper())\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/collect/PairsIterator.kt",
    "content": "package com.wix.detox.common.collect\n\nimport java.lang.IllegalStateException\n\ninternal class PairsIterator<T>(private val delegate: Iterator<T>): Iterator<Pair<T, T>> {\n    constructor(iterable: Iterable<T>): this(iterable.iterator())\n\n    override fun hasNext(): Boolean = delegate.hasNext()\n    override fun next(): Pair<T, T> {\n        val next = delegate.next()\n        if (!delegate.hasNext()) {\n            throw IllegalStateException(\"Uneven iterator content!\")\n        }\n\n        val nextNext = delegate.next()\n        return Pair(next, nextNext)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/proxy/MethodsSpy.kt",
    "content": "package com.wix.detox.common.proxy\n\nimport android.util.Log\nimport java.util.*\n\ndata class CallInfo(var inTime: Long? = null, var outTime: Long? = null) {\n    fun open(inTime: Long = System.currentTimeMillis()): CallInfo {\n        this.inTime = inTime\n        this.outTime = null\n        return this\n    }\n\n    fun close(outTime: Long = System.currentTimeMillis()): CallInfo {\n        this.outTime = outTime\n        return this\n    }\n\n    operator fun minus(other: CallInfo): Long? {\n        val inTime = other.inTime\n        val outTime = this.outTime\n        if (outTime != null && inTime != null) {\n            return outTime - inTime\n        }\n        return null\n    }\n\n    override fun toString() = \"$inTime -> $outTime\"\n}\n\nopen class MethodsSpy(private val entityName: String) {\n    private val methodHistories = mutableMapOf<String, LinkedList<CallInfo>>()\n    private var enabled = false\n\n    fun start() {\n        reset()\n        enabled = true\n    }\n\n    fun stop() {\n        enabled = false\n    }\n\n    fun onBeforeCall(methodName: String) {\n        if (enabled) {\n            historyOf(methodName).addFirst(CallInfo().open())\n        }\n    }\n\n    fun onAfterCall(methodName: String) {\n        if (enabled) {\n            historyOf(methodName).peekFirst()?.close()\n        }\n    }\n\n    fun getHistory(methodName: String): Queue<CallInfo>?\n        = methodHistories[methodName]\n\n    fun dumpToLog() {\n        for ((methodName, history) in methodHistories.entries) {\n            Log.d(LOG_TAG, \"[$entityName] method $methodName: $history\")\n        }\n    }\n\n    internal fun historyOf(key: String) =\n        methodHistories.getOrPut(key) {\n            LinkedList()\n        }\n\n    private fun reset() {\n        methodHistories.clear()\n    }\n\n    companion object {\n        private const val LOG_TAG = \"MethodsSpy\"\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/common/proxy/SpyingInvocationHandler.kt",
    "content": "package com.wix.detox.common.proxy\n\nimport java.lang.reflect.InvocationHandler\nimport java.lang.reflect.InvocationTargetException\nimport java.lang.reflect.Method\nimport java.lang.reflect.Proxy\n\nclass SpyingInvocationHandler(private val target: Any, private val spy: MethodsSpy) : InvocationHandler {\n    override fun invoke(proxy: Any, m: Method, args: Array<Any>): Any {\n        val result: Any\n        try {\n            spy.onBeforeCall(m.name)\n            result = m.invoke(target, *args)\n        } catch (e: InvocationTargetException) {\n            throw e.targetException\n        } finally {\n            spy.onAfterCall(m.name)\n        }\n        return result\n    }\n\n    companion object {\n        @JvmStatic\n        fun newInstance(obj: Any, journal: MethodsSpy) =\n            Proxy.newProxyInstance(\n                    obj.javaClass.classLoader,\n                    obj.javaClass.interfaces,\n                    SpyingInvocationHandler(obj, journal))\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/DeviceDisplay.kt",
    "content": "package com.wix.detox.espresso\n\nimport androidx.test.platform.app.InstrumentationRegistry\n\nobject DeviceDisplay {\n    @JvmStatic\n    fun getDensity() = getDisplayMetrics().density\n\n    @JvmStatic\n    fun convertDpiToPx(dip: Double): Int {\n        return (dip * getDensity() + 0.5f).toInt()\n    }\n\n    @JvmStatic\n    fun convertPxToDpi(pixel: Int): Int {\n        return ((pixel - 0.5f) / getDensity()).toInt()\n    }\n\n    @JvmStatic\n    fun getScreenSizeInPX(): FloatArray {\n        val metrics = getDisplayMetrics()\n        return floatArrayOf(metrics.widthPixels.toFloat(), metrics.heightPixels.toFloat())\n    }\n\n    private fun getDisplayMetrics() =\n            getAppContext().resources.displayMetrics\n\n    private fun getAppContext() =\n            InstrumentationRegistry.getInstrumentation().targetContext.applicationContext\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/MultipleViewsAction.kt",
    "content": "package com.wix.detox.espresso\n\n// Marker interface for actions that should be applied to all matching elements without ambiguity.\ninterface MultipleViewsAction\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt",
    "content": "package com.wix.detox.espresso\n\nimport androidx.test.espresso.UiController\nimport com.wix.detox.common.proxy.CallInfo\nimport com.wix.detox.common.proxy.SpyingInvocationHandler\nimport com.wix.detox.common.proxy.MethodsSpy\nimport com.wix.detox.espresso.action.common.utils.getUiController\nimport org.joor.Reflect\n\nclass UiControllerSpy: MethodsSpy(\"uiController\") {\n    fun eventInjectionsIterator(): Iterator<CallInfo?> = historyOf(\"injectMotionEvent\").iterator()\n\n    companion object {\n        val instance = UiControllerSpy()\n\n        fun attachThroughProxy(spy: UiControllerSpy = instance) {\n            val eventsInjectorReflected = EventsInjectorReflected(getUiController())\n\n            val eventsInjectionStrategy = eventsInjectorReflected.eventsInjectionStrategy!!\n            val eventsInjectionStrategyProxy = SpyingInvocationHandler.newInstance(eventsInjectionStrategy, spy)\n\n            eventsInjectorReflected.eventsInjectionStrategy = eventsInjectionStrategyProxy\n        }\n    }\n}\n\nprivate class EventsInjectorReflected constructor(uiController: UiController?) {\n    private /*EventInjector*/ val eventInjector: Any? = Reflect.on(uiController).get(\"eventInjector\")\n\n    var eventsInjectionStrategy: Any? /*EventInjectionStrategy*/\n        get() = Reflect.on(eventInjector).get<Any>(\"injectionStrategy\")\n        set(value) {\n            Reflect.on(eventInjector)[\"injectionStrategy\"] = value\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/ViewActionWithResult.kt",
    "content": "package com.wix.detox.espresso\n\nimport androidx.test.espresso.ViewAction\n\n// Interface for actions that return a result.\ninterface ViewActionWithResult<R: Any?> : ViewAction {\n    fun getResult(): R\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/DetoxCustomTapper.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.MotionEvent\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.action.Tapper\nimport com.wix.detox.common.DetoxLog\nimport com.wix.detox.common.DetoxLog.Companion.LOG_TAG\nimport com.wix.detox.common.collect.PairsIterator\nimport com.wix.detox.common.proxy.CallInfo\nimport com.wix.detox.espresso.UiControllerSpy\nimport com.wix.detox.espresso.action.common.DetoxViewConfigurations.getDoubleTapMinTime\nimport com.wix.detox.espresso.action.common.DetoxViewConfigurations.getLongTapMinTime\nimport com.wix.detox.espresso.action.common.DetoxViewConfigurations.getPostTapCoolDownTime\nimport com.wix.detox.espresso.action.common.TapEvents\n\n/**\n * An implementation that is an alternative to Espresso's implementations, namely\n * [androidx.test.espresso.action.Tap.SINGLE] and [androidx.test.espresso.action.Tap.DOUBLE].\n *\n * The main difference is: Instead of injecting distinct idle-waiting events (down, then up, etc.), here,\n * [UiController.injectMotionEventSequence] is used in order to inject all events in one go, such that no\n * idle-wait is employed in between.\n *\n * The main goal here is to fix timing problems where, for example - in a single tap, the gap between\n * the tap's 'down' and 'up' actions becomes too long to the point where the tap gets registered as a\n * long tap (true story!). As for double-taps, a different problem addressed here is where the wait in\n * between taps becomes too long, such that eventually the system registers two distinct taps instead\n * of a single double-tap gesture.\n *\n * This should be Espresso's default implementation IMO.\n */\nopen class DetoxCustomTapper\n    @JvmOverloads constructor(\n            private val times: Int,\n            private val interTapsDelayMs: Long = getDoubleTapMinTime(),\n            private val coolDownTimeMs: Long = getPostTapCoolDownTime(),\n            private val longTapMinTimeMs: Long = getLongTapMinTime(),\n            private val tapEvents: TapEvents = TapEvents(),\n            private val uiControllerCallSpy: UiControllerSpy = UiControllerSpy.instance,\n            private val log: DetoxLog = DetoxLog.instance,\n            private val duration: Long? = null\n    ) : Tapper {\n\n    override fun sendTap(uiController: UiController?, coordinates: FloatArray?, precision: FloatArray?)\n            = sendTap(uiController, coordinates, precision, 0, 0)\n\n    override fun sendTap(uiController: UiController?, coordinates: FloatArray?, precision: FloatArray?, inputDevice: Int, buttonState: Int): Tapper.Status {\n        uiController!!\n        coordinates!!\n        precision!!\n\n        var eventSequence: List<MotionEvent>? = null\n        try {\n            eventSequence = generateEventSequences(coordinates, precision)\n\n            if (!injectEvents(uiController, eventSequence)) {\n                return Tapper.Status.FAILURE\n            }\n            verifyInjectionPeriods()\n\n            uiController.loopMainThreadForAtLeast(coolDownTimeMs)\n            return Tapper.Status.SUCCESS\n        } finally {\n            eventSequence?.forEach { it.recycle() }\n        }\n    }\n\n    private fun generateEventSequences(coordinates: FloatArray, precision: FloatArray): List<MotionEvent> {\n        val eventSequence = mutableListOf<MotionEvent>()\n        var downTimestamp: Long? = null\n\n        for (i in 1..times) {\n            val tapEvents = tapEvents.createEventsSeq(coordinates, precision, downTimestamp, duration)\n            eventSequence.addAll(tapEvents)\n\n            downTimestamp = tapEvents.last().eventTime + interTapsDelayMs\n        }\n\n        return eventSequence\n    }\n\n    private fun injectEvents(uiController: UiController, eventSequence: List<MotionEvent>): Boolean {\n        try {\n            uiControllerCallSpy.start()\n            if (!uiController.injectMotionEventSequence(eventSequence)) {\n                return false\n            }\n        } finally {\n            uiControllerCallSpy.stop()\n        }\n        return true\n    }\n\n    /**\n     * Note: This renders the class non-extensible so as to not being able to handle other types of taps -- for example, a\n     * long-tap created by tapEvents.\n     * If extensibility is ever needed, this can, be solved by refactoring tapEvents onto a tap injection class\n     * that both creates tap events and validates the right constraints over them.\n     */\n    private fun verifyInjectionPeriods() {\n        val rawIterator = uiControllerCallSpy.eventInjectionsIterator()\n        PairsIterator(rawIterator).forEach {\n            verifyTapEventTimes(it.first!!, it.second!!)\n        }\n    }\n\n    private fun verifyTapEventTimes(upEvent: CallInfo, downEvent: CallInfo) {\n        val delta: Long = (upEvent - downEvent)!!\n        if (delta >= longTapMinTimeMs && duration == null) {\n            log.warn(LOG_TAG, \"Tap handled too slowly, and turned into a long-tap!\") // TODO conditionally turn into an error, based on a global strict-mode detox config\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/DetoxSingleTap.kt",
    "content": "package com.wix.detox.espresso.action\n\nclass DetoxSingleTap(duration: Long? = null) : DetoxCustomTapper(1, duration = duration)\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/DetoxSwipeWithLongPress.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport com.wix.detox.espresso.scroll.DetoxSwiper\n\n/**\n * Implementation of the Detox swipe action with long press in the beginning of the swipe and at the end\n */\nclass DetoxSwipeWithLongPress(\n    private val durationStart: Int,\n    private val durationEnd: Int,\n    private val startX: Float,\n    private val startY: Float,\n    private val endX: Float,\n    private val endY: Float,\n    private val motionCount: Int,\n    private val swiper: DetoxSwiper\n) {\n\n    fun perform() {\n        with(swiper) {\n            startAt(startX, startY)\n            wait(durationStart)\n            try {\n                val stepSizeX = (endX - startX) / (motionCount + 2f)\n                val stepSizeY = (endY - startY) / (motionCount + 2f)\n\n                var targetX = startX\n                var targetY = startY\n                for (step in 1..motionCount) {\n                    targetX += stepSizeX\n                    targetY += stepSizeY\n\n                    if (!moveTo(targetX, targetY)) {\n                        return\n                    }\n                }\n            } finally {\n                moveTo(endX, endY)\n                wait(durationEnd)\n                finishAt(endX, endY)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/LongPressAndDragAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.graphics.Point\nimport android.util.Log\nimport android.view.View\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.matcher.ViewMatchers\nimport com.wix.detox.espresso.scroll.LinearSwiper\nimport org.hamcrest.Matcher\nimport kotlin.math.ceil\n\n\nprivate const val SLOW_SCROLL_MOTIONS = 50\nprivate const val FAST_SCROLL_MOTIONS = 20\n\nclass LongPressAndDragAction(\n    private val duration: Int,\n    private val normalizedPositionX: Double,\n    private val normalizedPositionY: Double,\n    private val targetView: View,\n    private val normalizedTargetPositionX: Double,\n    private val normalizedTargetPositionY: Double,\n    isFast: Boolean,\n    private val holdDuration: Int\n) : ViewAction {\n\n    private val scrollMotions = if (isFast) FAST_SCROLL_MOTIONS else SLOW_SCROLL_MOTIONS\n\n    override fun getDescription(): String {\n        return \"longPressAndDrag\"\n    }\n\n    override fun getConstraints(): Matcher<View> {\n        return ViewMatchers.isAssignableFrom(\n            View::class.java\n        )\n    }\n\n    override fun perform(uiController: UiController, view: View) {\n        performSwipe(uiController, view, targetView)\n    }\n\n    private fun performSwipe(uiController: UiController, sourceView: View, targetView: View) {\n        val xy = IntArray(2)\n\n        // Get start coordinates\n        sourceView.getLocationOnScreen(xy)\n        val sourceViewPoint = Point(xy[0], xy[1])\n        val startPoint = Point(\n            ceil(sourceViewPoint.x + sourceView.width * normalizedPositionX).toInt(),\n            ceil(sourceViewPoint.y + sourceView.height * normalizedPositionY).toInt()\n        )\n\n        // Get end coordinates\n        targetView.getLocationOnScreen(xy)\n        val targetViewPoint = Point(xy[0], xy[1])\n        val endPoint = Point(\n            ceil(targetViewPoint.x + targetView.width * normalizedTargetPositionX).toInt(),\n            ceil(targetViewPoint.y + targetView.height * normalizedTargetPositionY).toInt()\n        )\n\n        Log.d(\n            \"LongPressAndDragAction\",\n            \"start:$startPoint, end:$endPoint duration: $duration, holdDuration: $holdDuration, scrollMotions: $scrollMotions, source:[$sourceViewPoint,${sourceView.width}x${sourceView.height}], target:[$targetViewPoint,${targetView.width}x${targetView.height}]\"\n        )\n\n        val swiper = LinearSwiper(uiController)\n        val swipe = DetoxSwipeWithLongPress(\n            duration,\n            holdDuration,\n            startPoint.x.toFloat(),\n            startPoint.y.toFloat(),\n            endPoint.x.toFloat(),\n            endPoint.y.toFloat(),\n            scrollMotions,\n            swiper\n        )\n        swipe.perform()\n\n        sourceView.getLocationOnScreen(xy)\n\n        // Please note that the actual coordinates are not the same as the end coordinates.\n        Log.d(\n            \"LongPressAndDragAction\",\n            \"Performed swipe. Actual coordinates x=${xy[0]}, y=${xy[1]}. Normalized position x=${xy[0] + sourceView.width * normalizedTargetPositionX}, y=${xy[1] + sourceView.height * normalizedTargetPositionX}\"\n        )\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/ScrollToIndexAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.View\nimport android.view.ViewGroup\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.matcher.ViewMatchers\nimport com.facebook.react.views.scroll.ReactHorizontalScrollView\nimport com.facebook.react.views.scroll.ReactScrollView\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport com.wix.detox.espresso.scroll.ScrollEdgeException\nimport com.wix.detox.espresso.scroll.ScrollHelper\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers\n\nclass ScrollToIndexAction(private val index: Int) : ViewAction {\n    override fun getConstraints(): Matcher<View> {\n        return Matchers.anyOf(\n            Matchers.allOf(\n                ViewMatchers.isAssignableFrom(\n                    View::class.java\n                ), Matchers.instanceOf(\n                    ReactScrollView::class.java\n                )\n            ),\n            Matchers.allOf(\n                ViewMatchers.isAssignableFrom(\n                    View::class.java\n                ), Matchers.instanceOf(ReactHorizontalScrollView::class.java)\n            )\n        )\n    }\n\n    override fun getDescription(): String {\n        return \"scrollToIndex\"\n    }\n\n    override fun perform(uiController: UiController?, view: View?) {\n        if (index < 0) return\n\n        val offsetPercent = 0.4f\n        val reactScrollView = view as ViewGroup\n        val internalContainer = reactScrollView.getChildAt(0) as ViewGroup\n        val childCount = internalContainer.childCount\n        if (index >= childCount) return\n\n        val isHorizontalScrollView = getIsHorizontalScrollView(reactScrollView)\n        val targetPosition = getTargetPosition(isHorizontalScrollView, internalContainer, index)\n        var currentPosition = getCurrentPosition(isHorizontalScrollView, reactScrollView)\n        val jumpSize = getTargetDimension(isHorizontalScrollView, internalContainer, index)\n        val scrollDirection =\n            getScrollDirection(isHorizontalScrollView, currentPosition, targetPosition)\n\n        // either we'll find the target view or we'll hit the edge of the scrollview\n\n        // either we'll find the target view or we'll hit the edge of the scrollview\n        while (true) {\n            if (Math.abs(currentPosition - targetPosition) < jumpSize) {\n                // we found the target view\n                return\n            }\n            currentPosition = try {\n                ScrollHelper.perform(\n                    uiController,\n                    view,\n                    scrollDirection,\n                    jumpSize.toDouble(),\n                    offsetPercent,\n                    offsetPercent\n                )\n                getCurrentPosition(isHorizontalScrollView, reactScrollView)\n            } catch (e: ScrollEdgeException) {\n                // we hit the edge\n                return\n            }\n        }\n    }\n\n}\n\nprivate fun getScrollDirection(\n    isHorizontalScrollView: Boolean,\n    currentPosition: Int,\n    targetPosition: Int\n): Int {\n    return if (isHorizontalScrollView) {\n        if (currentPosition < targetPosition) MOTION_DIR_RIGHT else MOTION_DIR_LEFT\n    } else {\n        if (currentPosition < targetPosition) MOTION_DIR_DOWN else MOTION_DIR_UP\n    }\n}\n\nprivate fun getIsHorizontalScrollView(scrollView: ViewGroup): Boolean {\n    return scrollView.canScrollHorizontally(1) || scrollView.canScrollHorizontally(-1)\n}\n\nprivate fun getCurrentPosition(isHorizontalScrollView: Boolean, scrollView: ViewGroup): Int {\n    return if (isHorizontalScrollView) scrollView.scrollX else scrollView.scrollY\n}\n\nprivate fun getTargetDimension(\n    isHorizontalScrollView: Boolean,\n    internalContainer: ViewGroup,\n    index: Int\n): Int {\n    return if (isHorizontalScrollView) internalContainer.getChildAt(index).measuredWidth else internalContainer.getChildAt(\n        index\n    ).measuredHeight\n}\n\nprivate fun getTargetPosition(\n    isHorizontalScrollView: Boolean,\n    internalContainer: ViewGroup,\n    index: Int\n): Int {\n    var necessaryTarget = 0\n    for (childIndex in 0 until index) {\n        necessaryTarget += if (isHorizontalScrollView) internalContainer.getChildAt(childIndex).measuredWidth else internalContainer.getChildAt(\n            childIndex\n        ).measuredHeight\n    }\n    return necessaryTarget\n}"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/TakeViewScreenshotAction.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.View\nimport androidx.test.espresso.UiController\nimport com.wix.detox.espresso.ViewActionWithResult\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers\n\nopen class TakeViewScreenshotAction(private val viewScreenshot: ViewScreenshot = ViewScreenshot())\n    : ViewActionWithResult<ScreenshotResult?> {\n\n    private var result: ScreenshotResult? = null\n\n    override fun perform(uiController: UiController?, view: View?) {\n        result = viewScreenshot.takeOf(view!!)\n    }\n\n    override fun getResult() = result\n    override fun getDescription() = \"View screenshot\"\n    override fun getConstraints(): Matcher<View> = Matchers.notNullValue(View::class.java)\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/ViewScreenshot.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.graphics.Bitmap\nimport android.graphics.Canvas\nimport android.util.Base64\nimport android.view.View\nimport java.io.ByteArrayOutputStream\n\nclass ScreenshotResult(private val bitmap: Bitmap) {\n    fun asBitmap() = bitmap\n    fun asRawBytes(): ByteArray {\n        val outStream = ByteArrayOutputStream(bitmap.allocationByteCount)\n        bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream)\n        return outStream.toByteArray()\n    }\n    fun asBase64String(): String =\n        Base64.encodeToString(asRawBytes(), Base64.NO_WRAP or Base64.NO_PADDING)\n}\n\nclass ViewScreenshot() {\n    fun takeOf(view: View): ScreenshotResult {\n        val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888)\n        view.draw(Canvas(bitmap))\n\n        return ScreenshotResult(bitmap)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/DetoxViewConfiguration.kt",
    "content": "package com.wix.detox.espresso.action.common\n\nimport android.os.Build\nimport android.util.Log\nimport android.view.ViewConfiguration\nimport java.lang.reflect.InvocationTargetException\n\nprivate const val LOG_TAG = \"Detox-ViewConfig\"\n\nobject DetoxViewConfigurations {\n\n    /**\n     * Duration before a press turns into a long press.\n     * Due to `Tap.LONG`, factor 1.5 is needed, otherwise a long press is not safely detected.\n     *\n     * @see androidx.test.espresso.action.Tap.LONG\n     * @see android.test.TouchUtils.longClickView\n     */\n    @JvmStatic\n    fun getLongPressTimeout(): Long = (ViewConfiguration.getLongPressTimeout() * 1.5).toLong()\n\n    fun getPostTapCoolDownTime() = ViewConfiguration.getDoubleTapTimeout().toLong()\n\n    /**\n     * Taken from [androidx.test.espresso.action.Tap]\n     */\n    fun getDoubleTapMinTime(): Long {\n        if (Build.VERSION.SDK_INT > 18) {\n            try {\n                val getDoubleTapMinTimeMethod = ViewConfiguration::class.java.getDeclaredMethod(\"getDoubleTapMinTime\")\n                return (getDoubleTapMinTimeMethod.invoke(null) as Int).toLong()\n            } catch (nsme: NoSuchMethodException) {\n                Log.w(LOG_TAG, \"Expected to find getDoubleTapMinTime\", nsme)\n            } catch (ite: InvocationTargetException) {\n                Log.w(LOG_TAG, \"Unable to query multi-tap min time!\", ite)\n            } catch (iae: IllegalAccessException) {\n                Log.w(LOG_TAG, \"Unable to query multi-tap min time!\", iae)\n            }\n        }\n        return 40 // Based on hard-coded value in raw implementation of ViewConfiguration\n    }\n\n    fun getLongTapMinTime(): Long = ViewConfiguration.getLongPressTimeout().toLong()\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/MotionEvents.kt",
    "content": "package com.wix.detox.espresso.action.common\n\nimport android.os.SystemClock\nimport android.view.InputDevice\nimport android.view.MotionEvent\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.action.MotionEvents\n\nprivate val PRECISION = floatArrayOf(16f, 16f)\n\nclass MotionEvents {\n    fun obtainMoveEvent(downEvent: MotionEvent, eventTime: Long, x: Float, y: Float): MotionEvent {\n        val pointerProperties = MotionEvent.PointerProperties().apply {\n            clear()\n            id = 0\n            toolType = MotionEvent.TOOL_TYPE_UNKNOWN\n        }\n        val pointerCoords = MotionEvent.PointerCoords().apply {\n            clear()\n            this.x = x\n            this.y = y\n            this.pressure = 0f\n            this.size = 1f\n        }\n\n        return MotionEvent.obtain(\n              downEvent.downTime,\n              eventTime,\n              MotionEvent.ACTION_MOVE,\n              1, // pointerCounts\n              arrayOf(pointerProperties),\n              arrayOf(pointerCoords),\n              0, // metaState\n              downEvent.buttonState,\n              downEvent.xPrecision,\n              downEvent.yPrecision,\n              0, // deviceId\n              0, // edgeFlags\n              downEvent.source,\n              0\n        )\n    }\n\n    fun obtainDownEvent(x: Float, y: Float, precision: FloatArray = PRECISION)\n        = obtainDownEvent(x, y, precision, null)\n\n    fun obtainDownEvent(x: Float, y: Float, precision: FloatArray = PRECISION, _downTime: Long?): MotionEvent {\n        val pointerProperties = MotionEvent.PointerProperties().apply {\n            id = 0\n            toolType = MotionEvent.TOOL_TYPE_UNKNOWN\n        }\n        val pointerCoords = MotionEvent.PointerCoords().apply {\n            clear()\n            this.x = x\n            this.y = y\n            this.pressure = 0f\n            this.size = 1f\n        }\n        val downTime = _downTime ?: SystemClock.uptimeMillis()\n\n        return MotionEvent.obtain(\n                downTime,\n                downTime,\n                MotionEvent.ACTION_DOWN,\n                1,\n                arrayOf(pointerProperties),\n                arrayOf(pointerCoords),\n                0,\n                MotionEvent.BUTTON_PRIMARY,\n                precision[0],\n                precision[1],\n                0,\n                0,\n                InputDevice.SOURCE_UNKNOWN,\n                0)\n    }\n\n    fun obtainUpEvent(downEvent: MotionEvent, eventTime: Long, x: Float, y: Float): MotionEvent {\n        val pointerProperties = MotionEvent.PointerProperties().apply {\n          id = 0\n          toolType = MotionEvent.TOOL_TYPE_UNKNOWN\n        }\n        val pointerCoords = MotionEvent.PointerCoords().apply {\n          clear()\n          this.x = x\n          this.y = y\n          this.pressure = 0f\n          this.size = 1f\n        }\n        return MotionEvent.obtain(\n              downEvent.downTime,\n              eventTime,\n              MotionEvent.ACTION_UP,\n              1, // pointerCounts\n              arrayOf(pointerProperties),\n              arrayOf(pointerCoords),\n              0, // metaState\n              downEvent.buttonState,\n              downEvent.xPrecision,\n              downEvent.yPrecision,\n              0, // deviceId\n              0, // edgeFlags\n              downEvent.source,\n              0\n        )\n    }\n\n    fun sendDownAsync(uiController: UiController, x: Float, y: Float, precision: FloatArray = PRECISION): MotionEvent {\n        val downEvent = obtainDownEvent(x, y, precision, null)\n        uiController.injectMotionEvent(downEvent)\n        return downEvent\n    }\n\n    fun sendDownSync(uiController: UiController, x: Float, y: Float, precision: FloatArray = PRECISION)\n            = MotionEvents.sendDown(uiController, floatArrayOf(x, y), precision)\n\n    fun sendMovementAsync(uiController: UiController, downEvent: MotionEvent, eventTime: Long, x: Float, y: Float): Boolean {\n        val event = obtainMoveEvent(downEvent, eventTime, x, y)\n        return uiController.injectMotionEvent(event)\n    }\n\n    fun sendMovementSync(uiController: UiController, downEvent: MotionEvent, x: Float, y: Float)\n            = MotionEvents.sendMovement(uiController, downEvent, floatArrayOf(x, y))\n\n    fun sendUp(uiController: UiController, downEvent: MotionEvent, x: Float, y: Float)\n            = MotionEvents.sendUp(uiController, downEvent, floatArrayOf(x, y))\n\n    fun sendCancel(uiController: UiController, downEvent: MotionEvent)\n            = MotionEvents.sendCancel(uiController, downEvent)\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/ReflectUtils.kt",
    "content": "package com.wix.detox.espresso.action.common\n\nobject ReflectUtils {\n    fun isAssignableFrom(source: Any, className: String) =\n        try {\n            Class.forName(className).isAssignableFrom(source.javaClass)\n        } catch (ex: ClassNotFoundException) {\n            false\n        }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/TapEvents.kt",
    "content": "package com.wix.detox.espresso.action.common\n\nimport android.view.MotionEvent\n\n/**\n * ### IMPORTANT NOTE ON THIS:\n *\n * Given the implementation of [UiControllerImpl.injectMotionEventSequence](androidx.test.espresso.base.UiControllerImpl.injectMotionEventSequence) - which\n * eventually handles the events injection, ideally we would just use 10ms. Actually, in the original implementation, that's what we did.\n *\n * However, recently, annoying RN related bugs we can't control suddenly came to be ([this one](https://github.com/software-mansion/react-native-reanimated/issues/596)\n * in particular), and so in order to comply, we need to try to meet it half-way and use a time gap that's more likely to be applied by a real user,\n * even though for all we know 10ms is enough for any Android native / pure-RN View. The trade-off here, however, being that the more we wait, the\n * higher the chance is for a simple tap to accidentally be registered as a _long_ tap (i.e. on slow devices/emulators).\n * Lastly, With the case of _that_ specific bug, we implicitly indirectly work around it with this approach, because we highly increase\n * the chance of allowing a frame to be drawn in between the _down_ and _up_ events.\n */\nprivate const val EVENTS_TIME_GAP_MS = 30L\n\nclass TapEvents(private val motionEvents: MotionEvents = MotionEvents()) {\n    fun createEventsSeq(coordinates: FloatArray, precision: FloatArray)\n            = createEventsSeq(coordinates, precision, null, null)\n\n    fun createEventsSeq(\n        coordinates: FloatArray,\n        precision: FloatArray,\n        downTimestamp: Long?,\n        duration: Long?\n    ): List<MotionEvent> {\n        val (x, y) = coordinates\n        val downEvent = motionEvents.obtainDownEvent(x, y, precision, downTimestamp)\n\n        val upEventDuration = duration ?: EVENTS_TIME_GAP_MS\n        val upEvent = motionEvents.obtainUpEvent(downEvent, downEvent.eventTime + upEventDuration, x, y)\n\n        return arrayListOf(downEvent, upEvent)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/utils/UiControllerUtils.kt",
    "content": "@file:JvmName(\"UiControllerUtils\")\n\npackage com.wix.detox.espresso.action.common.utils\n\nimport androidx.test.espresso.Espresso\nimport androidx.test.espresso.UiController\nimport org.hamcrest.core.IsAnything\nimport org.joor.Reflect\n\nfun getUiController(): UiController? {\n    val interaction = Espresso.onView(IsAnything())\n    return Reflect.on(interaction).get<UiController>(\"uiController\")\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/action/common/utils/ViewInteractionExt.kt",
    "content": "@file:JvmName(\"ViewInteractionExt\")\npackage com.wix.detox.espresso.action.common.utils\n\nimport android.view.View\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.ViewInteraction\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers\n\n\nfun ViewInteraction.getView(): View  {\n    var result: View? = null\n\n    val viewAction = object : ViewAction {\n        override fun getDescription(): String {\n            return \"Get View\"\n        }\n\n        override fun getConstraints(): Matcher<View> {\n            return Matchers.any(View::class.java)\n        }\n\n        override fun perform(uiController: androidx.test.espresso.UiController, view: View) {\n            result = view\n        }\n    }\n\n    perform(viewAction)\n\n    return result ?: throw IllegalStateException(\"Failed to get view\")\n}\n\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport android.view.View\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom\nimport androidx.test.espresso.matcher.ViewMatchers.isDisplayed\nimport com.wix.detox.action.common.MotionDir\nimport com.wix.detox.common.DetoxErrors.DetoxRuntimeException\nimport com.wix.detox.common.DetoxErrors.StaleActionException\nimport org.hamcrest.Matcher\nimport org.hamcrest.Matchers.allOf\n\nabstract class DetoxScrollActionBase internal constructor(\n        @MotionDir\n        private val direction: Int,\n        private val amountInDp: Double,\n        private val startOffsetPercentX: Float? = null,\n        private val startOffsetPercentY: Float? = null)\n    : ViewAction {\n    override fun getConstraints(): Matcher<View> = allOf(isAssignableFrom(View::class.java), isDisplayed())\n    override fun perform(uiController: UiController?, view: View?) =\n        ScrollHelper.perform(uiController, view, direction, amountInDp, startOffsetPercentX, startOffsetPercentY)\n}\n\nclass DetoxScrollAction(@MotionDir direction: Int, amountInDp: Double, startOffsetPercentX: Float?, startOffsetPercentY: Float?)\n    : DetoxScrollActionBase(direction, amountInDp, startOffsetPercentX, startOffsetPercentY) {\n\n    override fun getDescription() = \"scrollInDirection\"\n    override fun perform(uiController: UiController?, view: View?) {\n        try {\n            super.perform(uiController, view)\n        } catch (e: ScrollEdgeException) {\n            // Hit the edge\n        } catch (e: Exception) {\n            throw DetoxRuntimeException(e)\n        }\n    }\n}\n\nclass DetoxScrollActionStaleAtEdge(@MotionDir direction: Int, amountInDp: Double, startOffsetPercentX: Float?, startOffsetPercentY: Float?)\n    : DetoxScrollActionBase(direction, amountInDp, startOffsetPercentX, startOffsetPercentY) {\n\n    override fun getDescription() = \"scrollInDirectionStaleAtEdge\"\n\n    override fun perform(uiController: UiController?, view: View?) {\n        try {\n            super.perform(uiController, view)\n        } catch (exScrollAtEdge: ScrollEdgeException) {\n            throw StaleActionException(exScrollAtEdge)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt",
    "content": "package com.wix.detox.espresso.scroll\n\n/**\n * Along with [LinearSwiper], this is based on from Espresso's implementation of Swiping\n * (i.e. in [androidx.test.espresso.action.Swipe] - typically dispatched via the\n * [androidx.test.espresso.action.GeneralSwipeAction] action class).\n *\n * The main differences compared to the original impl are:\n * - Number of motion events _isn't_ hardcoded to 10 (as in Espresso's). Mainly, more motions mean that\n *   the overall scrolling will add up to something more accurate (i.e. closer to the scrolling\n *   originally requested by the user, in DP).\n * - Total swipe time globally _isn't_ hardcoded, but determined by the swiper's implementation.\n * - More comprehensible: broken down to two separate concern classes.\n */\nclass DetoxSwipe(\n        private val startX: Float,\n        private val startY: Float,\n        private val endX: Float,\n        private val endY: Float,\n        private val motionCount: Int,\n        private val swiper: DetoxSwiper) {\n\n    fun perform() {\n        with(swiper) {\n            startAt(startX, startY)\n\n            try {\n                val stepSizeX = (endX - startX) / (motionCount + 2f)\n                val stepSizeY = (endY - startY) / (motionCount + 2f)\n\n                var targetX = startX\n                var targetY = startY\n                for (step in 1..motionCount) {\n                    targetX += stepSizeX\n                    targetY += stepSizeY\n\n                    if (!moveTo(targetX, targetY)) {\n                        return\n                    }\n                }\n            } finally {\n                finishAt(endX, endY)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwiper.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport android.view.MotionEvent\nimport androidx.test.espresso.UiController\nimport com.wix.detox.espresso.action.common.MotionEvents\n\nabstract class DetoxSwiper(\n    private val uiController: UiController,\n    private val motionEvents: MotionEvents\n) {\n\n    private var downEvent: MotionEvent? = null\n\n    protected val events = mutableListOf<MotionEvent>()\n\n    fun startAt(touchX: Float, touchY: Float) {\n        assertNotStarted()\n\n        downEvent = motionEvents.obtainDownEvent(touchX, touchY)\n        events.add(downEvent!!)\n    }\n\n    fun moveTo(targetX: Float, targetY: Float): Boolean {\n        assertStarted()\n\n        val moveEvent = motionEvents.obtainMoveEvent(downEvent!!, calcEventTime(targetX, targetY), targetX, targetY)\n        events.add(moveEvent)\n        return true\n    }\n\n    fun wait(duration: Int) {\n        assertStarted()\n\n        val lastEvent = events.last()\n        // Insert a fake move event without actually moving, just to wait for the given duration.\n        val waitEvent = motionEvents.obtainMoveEvent(downEvent!!, lastEvent.eventTime + duration, lastEvent.x, lastEvent.y)\n        events.add(waitEvent)\n    }\n\n    fun finishAt(releaseX: Float, releaseY: Float) {\n        assertStarted()\n\n        try {\n            val upEvent = motionEvents.obtainUpEvent(downEvent!!, calcEventTime(releaseX, releaseY), releaseX, releaseY)\n            events.add(upEvent)\n\n            // Flush!\n            uiController.injectMotionEventSequence(events)\n        } finally {\n            events.forEach { event -> event.recycle() }\n            downEvent = null\n        }\n    }\n\n\n    private fun assertStarted() {\n        if (downEvent == null) {\n            throw IllegalStateException(\"Swiper not initialized - did you forget to call startAt()?\")\n        }\n    }\n\n    private fun assertNotStarted() {\n        if (downEvent != null) {\n            throw IllegalStateException(\"Swiper already started\")\n        }\n    }\n\n    protected abstract fun calcEventTime(targetX: Float, targetY: Float): Long\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/LinearSwiper.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport androidx.test.espresso.UiController\nimport com.wix.detox.espresso.action.common.MotionEvents\n\n/**\n * The delay between each motion event.\n * Reducing this value may fail the swipe on different devices. Please change with caution.\n */\nprivate const val EVENT_DELAY = 35L\n\n/**\n * Implementation of @see DetoxSwiper that swipes in a linear fashion uses const delay between events.\n */\nclass LinearSwiper @JvmOverloads constructor(\n    uiController: UiController,\n    motionEvents: MotionEvents = MotionEvents()\n) : DetoxSwiper(uiController, motionEvents) {\n\n    override fun calcEventTime(targetX: Float, targetY: Float): Long {\n        val lastEvent = events.last()\n\n        return lastEvent.eventTime + EVENT_DELAY\n    }\n\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollEdgeException.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nclass ScrollEdgeException(message: String) : Exception(message)\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java",
    "content": "package com.wix.detox.espresso.scroll;\n\nimport android.content.Context;\nimport android.graphics.Insets;\nimport android.graphics.Point;\nimport android.os.Build;\nimport android.util.Log;\nimport android.view.View;\nimport android.view.ViewConfiguration;\nimport android.view.WindowInsets;\n\nimport com.wix.detox.action.common.MotionDir;\nimport com.wix.detox.espresso.DeviceDisplay;\n\nimport androidx.annotation.VisibleForTesting;\nimport androidx.test.espresso.UiController;\nimport androidx.test.platform.app.InstrumentationRegistry;\n\nimport static com.wix.detox.action.common.MotionDefs.MOTION_DIR_DOWN;\nimport static com.wix.detox.action.common.MotionDefs.MOTION_DIR_LEFT;\nimport static com.wix.detox.action.common.MotionDefs.MOTION_DIR_RIGHT;\nimport static com.wix.detox.action.common.MotionDefs.MOTION_DIR_UP;\nimport static com.wix.detox.espresso.scroll.ScrollProbes.getScrollableProbe;\n\n/**\n * Created by simonracz on 09/08/2017.\n */\n\npublic class ScrollHelper {\n    private static final String LOG_TAG = \"DetoxScrollHelper\";\n\n    private static final int SCROLL_MOTIONS = 25;\n    private static final int MAX_FLING_WAITS = 3;\n\n    private static final double DEFAULT_DEADZONE_PERCENT = 0.05;\n    private static final double SCROLL_RANGE_SAFE_PERCENT = (1 - 2 * DEFAULT_DEADZONE_PERCENT);\n\n    private static ViewConfiguration viewConfiguration = null;\n\n    private ScrollHelper() {\n        // static class\n    }\n\n    /**\n     * Scrolls the View in a direction by the Density Independent Pixel amount.\n     *\n     * @param direction Direction to scroll (see {@link MotionDir})\n     * @param amountInDP Density Independent Pixels\n     * @param startOffsetPercentX Percentage denoting where the scroll should start from on the X-axis, with respect to the scrollable view. Null means select automatically.\n     * @param startOffsetPercentY Percentage denoting where the scroll should start from on the Y-axis, with respect to the scrollable view. Null means select automatically.\n     */\n    public static void perform(UiController uiController, View view, @MotionDir int direction, double amountInDP, Float startOffsetPercentX, Float startOffsetPercentY) throws ScrollEdgeException {\n        final int amountInPx = DeviceDisplay.convertDpiToPx(amountInDP);\n        final int safeScrollableRangePx = getViewSafeScrollableRangePix(view, direction);\n        final int times = amountInPx / safeScrollableRangePx;\n        final int remainder = amountInPx % safeScrollableRangePx;\n\n        Log.d(LOG_TAG, \"prescroll amountDP=\" + amountInDP + \" amountPx=\" + amountInPx + \" scrollableRangePx=\" + safeScrollableRangePx + \" times=\" + times + \" remainder=\" + remainder);\n\n        for (int i = 0; i < times; ++i) {\n            scrollOnce(uiController, view, direction, safeScrollableRangePx, startOffsetPercentX, startOffsetPercentY);\n        }\n        scrollOnce(uiController, view, direction, remainder, startOffsetPercentX, startOffsetPercentY);\n    }\n\n    /**\n     * Scrolls the View in a direction once by the maximum amount possible. (Till the edge\n     * of the screen.)\n     *\n     * @param direction Direction to scroll (see {@link @MotionDir})\n     * @param startOffsetPercentX Percentage denoting where the scroll should start from on the X-axis, with respect to the scrollable view. Null means select automatically.\n     * @param startOffsetPercentY Percentage denoting where the scroll should start from on the Y-axis, with respect to the scrollable view. Null means select automatically.\n     */\n    public static void performOnce(UiController uiController, View view, @MotionDir int direction, Float startOffsetPercentX, Float startOffsetPercentY) throws ScrollEdgeException {\n        final int scrollableRangePx = getViewSafeScrollableRangePix(view, direction);\n        scrollOnce(uiController, view, direction, scrollableRangePx, startOffsetPercentX, startOffsetPercentY);\n    }\n\n    private static void scrollOnce(UiController uiController, View view, @MotionDir int direction, int userAmountPx, Float startOffsetPercentX, Float startOffsetPercentY) throws ScrollEdgeException {\n        final ScrollableProbe scrollableProbe = getScrollableProbe(view, direction);\n        if (scrollableProbe.atScrollingEdge()) {\n            throw new ScrollEdgeException(\"View is already at the scrolling edge\");\n        }\n\n        final Point downPoint = getScrollStartPoint(view, direction, startOffsetPercentX, startOffsetPercentY);\n        final Point upPoint = getScrollEndPoint(downPoint, direction, userAmountPx, startOffsetPercentX, startOffsetPercentY);\n\n        Log.d(LOG_TAG, \"scroll \" + downPoint + \" --> \" + upPoint);\n        doScroll(view.getContext(), uiController, downPoint.x, downPoint.y, upPoint.x, upPoint.y);\n\n        // This is, at least in theory, unnecessary, as we use a swiper implementation that effectively knows how to avoid fling.\n        // Nevertheless we cannot validate all use cases in the universe, and thus in order to stay robust we assume somehow fling\n        // might get registered on rare occasions. Since the runtime price is very small, it's better to be safe than sorry...\n        waitForFlingToFinish(view, uiController);\n    }\n\n    private static void doScroll(final Context context, final UiController uiController, int downX, int downY, int upX, int upY) {\n        final DetoxSwiper swiper = new LinearSwiper(uiController);\n        final DetoxSwipe swipe = new DetoxSwipe(downX, downY, upX, upY, SCROLL_MOTIONS, swiper);\n        swipe.perform();\n    }\n\n    private static void waitForFlingToFinish(View view, UiController uiController) {\n        int waitTimeMS = 100; // Note: experimentation shows initial lookahead window should be large or we could miss out on future-pending events.\n        int iteration = 0;\n        int startX;\n        int startY;\n        do {\n            startY = view.getScrollY();\n            startX = view.getScrollX();\n            uiController.loopMainThreadForAtLeast(waitTimeMS);\n\n            waitTimeMS = 10;\n            iteration++;\n        } while ((view.getScrollY() != startY || view.getScrollX() != startX) && iteration < MAX_FLING_WAITS);\n\n        if (iteration > 1) {\n            Log.w(LOG_TAG, \"Detected a possibly overly-running fling! (#iterations=\" + iteration + \")\");\n        }\n    }\n\n    @VisibleForTesting\n    public static int getViewSafeScrollableRangePix(View view, @MotionDir int direction) {\n        final float[] screenSize = DeviceDisplay.getScreenSizeInPX();\n        final int[] pos = new int[2];\n        view.getLocationInWindow(pos);\n\n        int range;\n        switch (direction) {\n            case MOTION_DIR_LEFT:\n                range = (int) ((screenSize[0] - pos[0]) * SCROLL_RANGE_SAFE_PERCENT);\n                break;\n            case MOTION_DIR_RIGHT:\n                range = (int) ((pos[0] + view.getWidth()) * SCROLL_RANGE_SAFE_PERCENT);\n                break;\n            case MOTION_DIR_UP:\n                range = (int) ((screenSize[1] - pos[1]) * SCROLL_RANGE_SAFE_PERCENT);\n                break;\n            default:\n                range = (int) ((pos[1] + view.getHeight()) * SCROLL_RANGE_SAFE_PERCENT);\n                break;\n        }\n        return range;\n    }\n\n    private static int[] getScrollStartOffsetInView(View view, @MotionDir int direction, Float startOffsetPercentX, Float startOffsetPercentY) {\n        final int safetyOffset = DeviceDisplay.convertDpiToPx(1);\n        float offsetFactorX;\n        float offsetFactorY;\n        int safetyOffsetX;\n        int safetyOffsetY;\n\n        switch (direction) {\n            case MOTION_DIR_RIGHT:\n                offsetFactorX = (startOffsetPercentX != null ? startOffsetPercentX : 1f);\n                offsetFactorY = (startOffsetPercentY != null ? startOffsetPercentY : 0.5f);\n                safetyOffsetX = (startOffsetPercentX != null ? 0 : -safetyOffset);\n                safetyOffsetY = 0;\n                break;\n            case MOTION_DIR_LEFT:\n                offsetFactorX = (startOffsetPercentX != null ? startOffsetPercentX : 0);\n                offsetFactorY = (startOffsetPercentY != null ? startOffsetPercentY : 0.5f);\n                safetyOffsetX = (startOffsetPercentX != null ? 0 : safetyOffset);\n                safetyOffsetY = 0;\n                break;\n            case MOTION_DIR_DOWN:\n                offsetFactorX = (startOffsetPercentX != null ? startOffsetPercentX : 0.5f);\n                offsetFactorY = (startOffsetPercentY != null ? startOffsetPercentY : 1f);\n                safetyOffsetX = 0;\n                safetyOffsetY = (startOffsetPercentY != null ? 0 : -safetyOffset);\n                break;\n            case MOTION_DIR_UP:\n                offsetFactorX = (startOffsetPercentX != null ? startOffsetPercentX : 0.5f);\n                offsetFactorY = (startOffsetPercentY != null ? startOffsetPercentY : 0f);\n                safetyOffsetX = 0;\n                safetyOffsetY = (startOffsetPercentY != null ? 0 : safetyOffset);\n                break;\n            default:\n                throw new RuntimeException(\"Scroll direction can go from 1 to 4\");\n        }\n\n        int offsetX = ((int) (view.getWidth() * offsetFactorX) + safetyOffsetX);\n        int offsetY = ((int) (view.getHeight() * offsetFactorY) + safetyOffsetY);\n\n        return new int[]{offsetX, offsetY};\n    }\n\n    /**\n     * Calculates the scroll start point, with respect to the global screen coordinates and gesture insets.\n     * @param view The view to scroll.\n     * @param direction The scroll direction.\n     * @param startOffsetPercentX The scroll start offset, as a percentage of the view's width. Null means select automatically.\n     * @param startOffsetPercentY The scroll start offset, as a percentage of the view's height. Null means select automatically.\n     * @return a Point object, denoting the scroll start point.\n     */\n    private static Point getScrollStartPoint(View view, @MotionDir int direction, Float startOffsetPercentX, Float startOffsetPercentY) {\n        Point globalViewPoint = getGlobalViewLocation(view);\n\n        // 1. Calculate the scroll start point, with respect to the view's location.\n        int[] coordinates = getScrollStartOffsetInView(view, direction, startOffsetPercentX, startOffsetPercentY);\n\n        globalViewPoint.offset(coordinates[0], coordinates[1]);\n\n        // 2. Make sure that the start point is within the scrollable area, taking into account the system gesture insets.\n        coordinates = applyScreenInsets(view, direction, globalViewPoint.x, globalViewPoint.y);\n\n        return new Point(coordinates[0], coordinates[1]);\n    }\n\n    /**\n     * Calculates the scroll start point, with respect to the system gesture insets.\n     * @param view\n     * @param direction The scroll direction.\n     * @param x The scroll start point, with respect to the view's location.\n     * @param y The scroll start point, with respect to the view's location.\n     * @return an array of two integers, denoting the scroll start point, with respect to the system gesture insets.\n     */\n    private static int[] applyScreenInsets(View view, int direction, int x, int y) {\n        // System gesture insets are only available on Android Q (29) and above.\n        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {\n            return new int[]{x, y};\n        }\n\n        final float[] displaySize = DeviceDisplay.getScreenSizeInPX();\n\n        // Calculate the min/max scrollable area, taking into account the system gesture insets.\n        // By default we assume the scrollable area is the entire screen.\n        // 2dp is a safety offset to make sure we don't hit the system gesture area.\n        int gestureSafeOffset = DeviceDisplay.convertDpiToPx(2);\n        int minX = gestureSafeOffset;\n        int minY = gestureSafeOffset;\n        float maxX = displaySize[0] - gestureSafeOffset;\n        float maxY = displaySize[1] - gestureSafeOffset;\n\n        // Try to get the root window insets, and if available, use them to calculate the scrollable area.\n        WindowInsets rootWindowInsets = view.getRootWindowInsets();\n        if (rootWindowInsets == null) {\n            Log.w(LOG_TAG, \"Could not get root window insets\");\n        } else {\n            Insets gestureInsets = rootWindowInsets.getSystemGestureInsets();\n            minX += gestureInsets.left;\n            minY += gestureInsets.top;\n            maxX -= gestureInsets.right;\n            maxY -= gestureInsets.bottom;\n\n            Log.d(LOG_TAG,\n                \"System gesture insets: \" +\n                    gestureInsets + \" minX=\" + minX + \" minY=\" + minY + \" maxX=\" + maxX + \" maxY=\" + maxY + \" currentX=\" + x + \" currentY=\" + y);\n        }\n\n        switch (direction) {\n            case MOTION_DIR_UP:\n                y = (int) Math.max(y, minY);\n                break;\n            case MOTION_DIR_DOWN:\n                y = (int) Math.min(y, maxY);\n                break;\n            case MOTION_DIR_LEFT:\n                x = (int) Math.max(x, minX);\n                break;\n            case MOTION_DIR_RIGHT:\n                x = (int) Math.min(x, maxX);\n                break;\n        }\n\n        return new int[]{x, y};\n    }\n\n    private static Point getScrollEndPoint(Point startPoint, @MotionDir int direction, int userAmountPx, Float startOffsetPercentX, Float startOffsetPercentY) {\n        int safetyOffset = DeviceDisplay.convertDpiToPx(1);\n        int safetyOffsetX = (startOffsetPercentX != null ? safetyOffset : 0);\n        int safetyOffsetY = (startOffsetPercentY != null ? safetyOffset : 0);\n\n        int touchToScrollSlopPx = getViewConfiguration().getScaledTouchSlop();\n        int amountPx = userAmountPx + touchToScrollSlopPx;\n\n        Point point = new Point(startPoint);\n        int amountX;\n        int amountY;\n        switch (direction) {\n            case MOTION_DIR_RIGHT:\n                amountX = -amountPx - safetyOffsetX;\n                amountY = 0;\n                break;\n            case MOTION_DIR_LEFT:\n                amountX = amountPx + safetyOffsetX;\n                amountY = 0;\n                break;\n            case MOTION_DIR_DOWN:\n                amountX = 0;\n                amountY = -amountPx - safetyOffsetY;\n                break;\n            case MOTION_DIR_UP:\n                amountX = 0;\n                amountY = amountPx + safetyOffsetY;\n                break;\n            default:\n                throw new RuntimeException(\"Scroll direction can go from 1 to 4\");\n        }\n\n        point.offset(amountX, amountY);\n        return point;\n    }\n\n    /**\n     * Calculates the global location of the view on the screen.\n     * @param view The view to calculate.\n     * @return a Point object, denoting the global location of the view.\n     */\n    private static Point getGlobalViewLocation(View view) {\n        int[] pos = new int[2];\n        view.getLocationInWindow(pos);\n        return new Point(pos[0], pos[1]);\n    }\n\n    public static ViewConfiguration getViewConfiguration() {\n        if (viewConfiguration == null) {\n            final Context applicationContext = InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();\n            viewConfiguration = ViewConfiguration.get(applicationContext);\n        }\n        return viewConfiguration;\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollProbes.kt",
    "content": "@file:JvmName(\"ScrollProbes\")\n\npackage com.wix.detox.espresso.scroll\n\nimport android.annotation.SuppressLint\nimport android.view.View\nimport android.widget.AbsListView\nimport com.wix.detox.action.common.*\n\n// TODO ViewPager?\nfun getScrollableProbe(view: View, @MotionDir direction: Int): ScrollableProbe {\n    if (view is AbsListView) {\n        @SuppressLint(\"SwitchIntDef\")\n        when (direction) {\n            MOTION_DIR_UP -> return AbsListViewBack(view)\n            MOTION_DIR_DOWN -> return AbsListViewForward(view)\n        }\n    }\n\n    return when (direction) {\n        MOTION_DIR_LEFT -> ScrollableProbeHBack(view)\n        MOTION_DIR_RIGHT -> ScrollableProbeHForward(view)\n        MOTION_DIR_UP -> ScrollableProbeVBack(view)\n        MOTION_DIR_DOWN -> ScrollableProbeVForward(view)\n        else -> throw IllegalArgumentException(\"Invalid direction: $direction\")\n    }\n}\n\ninterface ScrollableProbe {\n    fun atScrollingEdge(): Boolean\n}\n\nprivate abstract class AbsScrollableProbe(val view: View) : ScrollableProbe\n\nprivate class ScrollableProbeHBack(view: View) : AbsScrollableProbe(view) {\n    override fun atScrollingEdge() = !view.canScrollHorizontally(-1)\n}\n\nprivate class ScrollableProbeHForward(view: View) : AbsScrollableProbe(view) {\n    override fun atScrollingEdge() = !view.canScrollHorizontally(1)\n}\n\nprivate class ScrollableProbeVBack(view: View) : AbsScrollableProbe(view) {\n    override fun atScrollingEdge() = !view.canScrollVertically(-1)\n}\n\nprivate class ScrollableProbeVForward(view: View) : AbsScrollableProbe(view) {\n    override fun atScrollingEdge() = !view.canScrollVertically(1)\n}\n\nprivate class AbsListViewBack(val view: AbsListView) : ScrollableProbe {\n    override fun atScrollingEdge(): Boolean {\n        // Ported from AbsListView#canScrollList() which isn't compatible with all API levels\n        val firstTop = view.getChildAt(0).top\n        val firstPosition = view.firstVisiblePosition\n        return firstPosition > 0 || firstTop < view.listPaddingTop\n    }\n}\n\nprivate class AbsListViewForward(val view: AbsListView) : ScrollableProbe {\n    override fun atScrollingEdge(): Boolean {\n        // Ported from AbsListView#canScrollList() which isn't compatible with all API levels\n        val itemsCount = view.count\n        val childCount = view.childCount\n        val firstPosition = view.firstVisiblePosition\n        val lastPosition = firstPosition + childCount\n        val lastBottom = view.getChildAt(childCount - 1).bottom\n        return (lastPosition < itemsCount) || (lastBottom > (view.height - view.listPaddingBottom))\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.action.*\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.espresso.utils.Vector2D\nimport kotlin.math.max\nimport kotlin.math.min\n\nprivate const val EDGE_FUZZ_FACTOR = 0.083\n\nprivate fun minMax(minValue: Double, value: Double, maxValue: Double) = max(minValue, min(value, maxValue))\n\nprivate fun ifNaN(value: Double, fallback: Double) = when {\n    value.isNaN() -> fallback\n    else -> value\n}\n\ntypealias CreateSwipeAction = (\n        swiper: Swiper,\n        startCoordinatesProvider: CoordinatesProvider,\n        endCoordinatesProvider: CoordinatesProvider,\n        precisionDescriber: PrecisionDescriber\n) -> ViewAction\n\nclass SwipeHelper(private val createAction: CreateSwipeAction) {\n\n    fun swipeInDirection(\n            direction: Int,\n            fast: Boolean,\n            normalizedSwipeAmount: Double,\n            normalizedStartingPointX: Double,\n            normalizedStartingPointY: Double\n    ): ViewAction {\n        val (edgeMin, edgeMax) = Pair(EDGE_FUZZ_FACTOR, 1.0 - EDGE_FUZZ_FACTOR)\n        val defaultNormalizedStartingPoint = Vector2D(0.5, edgeMin).rotate(direction, MOTION_DIR_DOWN).normalize()\n        val safeNormalizedStartPoint = Vector2D(\n                minMax(edgeMin, ifNaN(normalizedStartingPointX, defaultNormalizedStartingPoint.x), edgeMax),\n                minMax(edgeMin, ifNaN(normalizedStartingPointY, defaultNormalizedStartingPoint.y), edgeMax)\n        )\n\n        val safeSwipeAmount = minMax(0.0, ifNaN(normalizedSwipeAmount, 0.75), 1.0)\n        val startCoordinatesProvider = buildStartCoordinatesProvider(safeNormalizedStartPoint)\n        val endCoordinatesProvider = buildEndCoordinatesProvider(startCoordinatesProvider, direction, safeSwipeAmount)\n        val swiper = if (fast) Swipe.FAST else Swipe.SLOW\n\n        return this.createAction(swiper, startCoordinatesProvider, endCoordinatesProvider, Press.FINGER)\n    }\n\n    private fun buildStartCoordinatesProvider(normalizedStartPoint: Vector2D) = CoordinatesProvider { view ->\n        val xy = GeneralLocation.TOP_LEFT.calculateCoordinates(view)\n        xy[0] += (normalizedStartPoint.x * view.width).toFloat()\n        xy[1] += (normalizedStartPoint.y * view.height).toFloat()\n        xy\n    }\n\n    private fun buildEndCoordinatesProvider(startCoordinatesProvider: CoordinatesProvider, direction: Int, normalizedSwipeAmount: Double) =\n            CoordinatesProvider { view ->\n                val xy = startCoordinatesProvider.calculateCoordinates(view)\n\n                val screenEdge = Vector2D.from(\n                        view.context.resources.displayMetrics.widthPixels,\n                        view.context.resources.displayMetrics.heightPixels\n                )\n\n                val additionVector = Vector2D(0.0, normalizedSwipeAmount).rotate(direction, MOTION_DIR_DOWN)\n                val swipeEnd = Vector2D.from(xy)\n                        .add(screenEdge.scale(additionVector))\n                        .trimMax(0.0, 0.0)\n                        .trimMin(screenEdge.x, screenEdge.y)\n\n                xy[0] = swipeEnd.x.toFloat()\n                xy[1] = swipeEnd.y.toFloat()\n                xy\n            }\n\n    companion object {\n        @JvmStatic\n        val default = SwipeHelper { swiper: Swiper,\n                                    startCoordinatesProvider: CoordinatesProvider,\n                                    endCoordinatesProvider: CoordinatesProvider,\n                                    precisionDescriber: PrecisionDescriber ->\n            ViewActions.actionWithAssertions(\n                    GeneralSwipeAction(\n                            swiper,\n                            startCoordinatesProvider,\n                            endCoordinatesProvider,\n                            precisionDescriber\n                    )\n            );\n        }\n\n        const val edgeFuzzFactor = EDGE_FUZZ_FACTOR.toFloat()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/com/wix/detox/espresso/utils/Vector2D.kt",
    "content": "package com.wix.detox.espresso.utils\n\nimport com.wix.detox.common.DetoxErrors\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport kotlin.math.floor\nimport kotlin.math.max\nimport kotlin.math.min\n\nprivate fun frac(value: Double): Double =\n    if (value < 0) -frac(-value) else (value - floor(value))\n\nprivate fun normalize(value: Double): Double\n    = if (value < 0) (1 + frac(value)) else frac(value)\n\nprivate fun clockwise90DegRotationsToDown(direction: Int) = when (direction) {\n    MOTION_DIR_LEFT -> 3\n    MOTION_DIR_UP -> 2\n    MOTION_DIR_RIGHT -> 1\n    MOTION_DIR_DOWN -> 0\n    else -> throw DetoxErrors.DetoxIllegalArgumentException(\"Unsupported swipe direction: $direction\")\n}\n\nprivate fun angleBetween(fromDirection: Int, toDirection: Int): Int =\n    90 * ((4 + clockwise90DegRotationsToDown(fromDirection) - clockwise90DegRotationsToDown(toDirection)) % 4)\n\ndata class Vector2D(val x: Double, val y: Double) {\n    fun add(other: Vector2D) = Vector2D(x + other.x, y + other.y)\n\n    fun normalize() = Vector2D(normalize(x), normalize(y))\n\n    fun rotate(fromDirection: Int, toDirection: Int) =\n            when (angleBetween(fromDirection, toDirection)) {\n                90 -> Vector2D(y, -x)\n                180 -> Vector2D(-x, -y)\n                270 -> Vector2D(-y, x)\n                else -> Vector2D(x, y)\n            }\n\n    fun scale(amountX: Double, amountY: Double = amountX) = Vector2D(x * amountX, y * amountY)\n\n    fun scale(vector: Vector2D) = scale(vector.x, vector.y)\n\n    fun trimMax(xMax: Double, yMax: Double = xMax) = Vector2D(max(x, xMax), max(y, yMax))\n\n    fun trimMin(xMin: Double, yMin: Double = xMin) = Vector2D(min(x, xMin), min(y, yMin))\n\n    fun withX(value: Double) = Vector2D(value, y)\n\n    fun withY(value: Double) = Vector2D(x, value)\n\n    companion object {\n        fun from(arr: FloatArray) = Vector2D(arr[0].toDouble(), arr[1].toDouble())\n        fun from(x: Int, y: Int) = Vector2D(x.toDouble(), y.toDouble())\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/org/joor/Reflect.java",
    "content": "/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.joor;\n\nimport android.os.Build;\n\nimport java.lang.reflect.AccessibleObject;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Field;\nimport java.lang.reflect.InvocationHandler;\nimport java.lang.reflect.Member;\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Modifier;\nimport java.lang.reflect.Proxy;\nimport java.util.Arrays;\nimport java.util.LinkedHashMap;\nimport java.util.Locale;\nimport java.util.Map;\n\n/**\n * A wrapper for an {@link Object} or {@link Class} upon which reflective calls\n * can be made.\n * <p>\n * An example of using <code>Reflect</code> is <code><pre>\n * // Static import all reflection methods to decrease verbosity\n * import static org.joor.Reflect.*;\n *\n * // Wrap an Object / Class / class name with the on() method:\n * on(\"java.lang.String\")\n * // Invoke constructors using the create() method:\n * .create(\"Hello World\")\n * // Invoke methods using the call() method:\n * .call(\"toString\")\n * // Retrieve the wrapped object\n *\n * @author Lukas Eder\n * @author Irek Matysiewicz\n * @author Thomas Darimont\n */\npublic class Reflect {\n\n    // ---------------------------------------------------------------------\n    // Static API used as entrance points to the fluent API\n    // ---------------------------------------------------------------------\n\n    /**\n     * Wrap a class name.\n     * <p>\n     * This is the same as calling <code>on(Class.forName(name))</code>\n     *\n     * @param name A fully qualified class name\n     * @return A wrapped class object, to be used for further reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     * @see #on(Class)\n     */\n    public static Reflect on(String name) throws ReflectException {\n        return on(forName(name));\n    }\n\n    /**\n     * Wrap a class name, loading it via a given class loader.\n     * <p>\n     * This is the same as calling\n     * <code>on(Class.forName(name, classLoader))</code>\n     *\n     * @param name A fully qualified class name.\n     * @param classLoader The class loader in whose context the class should be\n     *            loaded.\n     * @return A wrapped class object, to be used for further reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     * @see #on(Class)\n     */\n    public static Reflect on(String name, ClassLoader classLoader) throws ReflectException {\n        return on(forName(name, classLoader));\n    }\n\n    /**\n     * Wrap a class.\n     * <p>\n     * Use this when you want to access static fields and methods on a\n     * {@link Class} object, or as a basis for constructing objects of that\n     * class using {@link #create(Object...)}\n     *\n     * @param clazz The class to be wrapped\n     * @return A wrapped class object, to be used for further reflection.\n     */\n    public static Reflect on(Class<?> clazz) {\n        return new Reflect(clazz);\n    }\n\n    /**\n     * Wrap an object.\n     * <p>\n     * Use this when you want to access instance fields and methods on any\n     * {@link Object}\n     *\n     * @param object The object to be wrapped\n     * @return A wrapped object, to be used for further reflection.\n     */\n    public static Reflect on(Object object) {\n        return new Reflect(object == null ? Object.class : object.getClass(), object);\n    }\n\n    private static Reflect on(Class<?> type, Object object) {\n        return new Reflect(type, object);\n    }\n\n    /**\n     * Conveniently render an {@link AccessibleObject} accessible.\n     * <p>\n     * To prevent {@link SecurityException}, this is only done if the argument\n     * object and its declaring class are non-public.\n     *\n     * @param accessible The object to render accessible\n     * @return The argument object rendered accessible\n     */\n    public static <T extends AccessibleObject> T accessible(T accessible) {\n        if (accessible == null) {\n            return null;\n        }\n\n        if (accessible instanceof Member) {\n            Member member = (Member) accessible;\n\n            if (Modifier.isPublic(member.getModifiers()) &&\n                Modifier.isPublic(member.getDeclaringClass().getModifiers())) {\n\n                return accessible;\n            }\n        }\n\n        // [jOOQ #3392] The accessible flag is set to false by default, also for public members.\n        if (!accessible.isAccessible()) {\n            accessible.setAccessible(true);\n        }\n\n        return accessible;\n    }\n\n    // ---------------------------------------------------------------------\n    // Members\n    // ---------------------------------------------------------------------\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    /**\n     * The type of the wrapped object.\n     */\n    private final Class<?> type;\n\n    /**\n     * The wrapped object.\n     */\n    private final Object   object;\n\n    // ---------------------------------------------------------------------\n    // Constructors\n    // ---------------------------------------------------------------------\n\n    private Reflect(Class<?> type) {\n        this(type, type);\n    }\n\n    private Reflect(Class<?> type, Object object) {\n        this.type = type;\n        this.object = object;\n    }\n\n    // ---------------------------------------------------------------------\n    // Fluent Reflection API\n    // ---------------------------------------------------------------------\n\n    /**\n     * Get the wrapped object\n     *\n     * @param <T> A convenience generic parameter for automatic unsafe casting\n     */\n    @SuppressWarnings(\"unchecked\")\n    public <T> T get() {\n        return (T) object;\n    }\n\n    /**\n     * Set a field value.\n     * <p>\n     * This is roughly equivalent to {@link Field#set(Object, Object)}. If the\n     * wrapped object is a {@link Class}, then this will set a value to a static\n     * member field. If the wrapped object is any other {@link Object}, then\n     * this will set a value to an instance member field.\n     * <p>\n     * This method is also capable of setting the value of (static) final\n     * fields. This may be convenient in situations where no\n     * {@link SecurityManager} is expected to prevent this, but do note that\n     * (especially static) final fields may already have been inlined by the\n     * javac and/or JIT and relevant code deleted from the runtime verison of\n     * your program, so setting these fields might not have any effect on your\n     * execution.\n     * <p>\n     * For restrictions of usage regarding setting values on final fields check:\n     * <a href=\n     * \"http://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection\">http://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection</a>\n     * ... and <a href=\n     * \"http://pveentjer.blogspot.co.at/2017/01/final-static-boolean-jit.html\">http://pveentjer.blogspot.co.at/2017/01/final-static-boolean-jit.html</a>\n     *\n     * @param name The field name\n     * @param value The new field value\n     * @return The same wrapped object, to be used for further reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     */\n    public Reflect set(String name, Object value) throws ReflectException {\n        try {\n            Field field = field0(name);\n            if ((field.getModifiers() & Modifier.FINAL) == Modifier.FINAL) {\n// Note (d4vidi): this is an important change, compared to the original implementation!!!\n// See here: https://stackoverflow.com/a/64378131/453052\n//                Field modifiersField = Field.class.getDeclaredField(\"modifiers\");\n                if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n                    Field modifiersField = Field.class.getDeclaredField(\"accessFlags\");\n                    modifiersField.setAccessible(true);\n                    modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);\n                }\n            }\n            field.set(object, unwrap(value));\n            return this;\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Get a field value.\n     * <p>\n     * This is roughly equivalent to {@link Field#get(Object)}. If the wrapped\n     * object is a {@link Class}, then this will get a value from a static\n     * member field. If the wrapped object is any other {@link Object}, then\n     * this will get a value from an instance member field.\n     * <p>\n     * If you want to \"navigate\" to a wrapped version of the field, use\n     * {@link #field(String)} instead.\n     *\n     * @param name The field name\n     * @return The field value\n     * @throws ReflectException If any reflection exception occurred.\n     * @see #field(String)\n     */\n    public <T> T get(String name) throws ReflectException {\n        return field(name).<T>get();\n    }\n\n    /**\n     * Get a wrapped field.\n     * <p>\n     * This is roughly equivalent to {@link Field#get(Object)}. If the wrapped\n     * object is a {@link Class}, then this will wrap a static member field. If\n     * the wrapped object is any other {@link Object}, then this wrap an\n     * instance member field.\n     *\n     * @param name The field name\n     * @return The wrapped field\n     * @throws ReflectException If any reflection exception occurred.\n     */\n    public Reflect field(String name) throws ReflectException {\n        try {\n            Field field = field0(name);\n            return on(field.getType(), field.get(object));\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    private Field field0(String name) throws ReflectException {\n        Class<?> t = type();\n\n        // Try getting a public field\n        try {\n            return accessible(t.getField(name));\n        }\n\n        // Try again, getting a non-public field\n        catch (NoSuchFieldException e) {\n            do {\n                try {\n                    return accessible(t.getDeclaredField(name));\n                }\n                catch (NoSuchFieldException ignore) {}\n\n                t = t.getSuperclass();\n            }\n            while (t != null);\n\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Get a Map containing field names and wrapped values for the fields'\n     * values.\n     * <p>\n     * If the wrapped object is a {@link Class}, then this will return static\n     * fields. If the wrapped object is any other {@link Object}, then this will\n     * return instance fields.\n     * <p>\n     * These two calls are equivalent <code><pre>\n     * on(object).field(\"myField\");\n     * on(object).fields().get(\"myField\");\n     * </pre></code>\n     *\n     * @return A map containing field names and wrapped values.\n     */\n    public Map<String, Reflect> fields() {\n        Map<String, Reflect> result = new LinkedHashMap<String, Reflect>();\n        Class<?> t = type();\n\n        do {\n            for (Field field : t.getDeclaredFields()) {\n                if (type != object ^ Modifier.isStatic(field.getModifiers())) {\n                    String name = field.getName();\n\n                    if (!result.containsKey(name))\n                        result.put(name, field(name));\n                }\n            }\n\n            t = t.getSuperclass();\n        }\n        while (t != null);\n\n        return result;\n    }\n\n    /**\n     * Call a method by its name.\n     * <p>\n     * This is a convenience method for calling\n     * <code>call(name, new Object[0])</code>\n     *\n     * @param name The method name\n     * @return The wrapped method result or the same wrapped object if the\n     *         method returns <code>void</code>, to be used for further\n     *         reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     * @see #call(String, Object...)\n     */\n    public Reflect call(String name) throws ReflectException {\n        return call(name, new Object[0]);\n    }\n\n    /**\n     * Call a method by its name.\n     * <p>\n     * This is roughly equivalent to {@link Method#invoke(Object, Object...)}.\n     * If the wrapped object is a {@link Class}, then this will invoke a static\n     * method. If the wrapped object is any other {@link Object}, then this will\n     * invoke an instance method.\n     * <p>\n     * Just like {@link Method#invoke(Object, Object...)}, this will try to wrap\n     * primitive types or unwrap primitive type wrappers if applicable. If\n     * several methods are applicable, by that rule, the first one encountered\n     * is called. i.e. when calling <code><pre>\n     * on(...).call(\"method\", 1, 1);\n     * </pre></code> The first of the following methods will be called:\n     * <code><pre>\n     * public void method(int param1, Integer param2);\n     * public void method(Integer param1, int param2);\n     * public void method(Number param1, Number param2);\n     * public void method(Number param1, Object param2);\n     * public void method(int param1, Object param2);\n     * </pre></code>\n     * <p>\n     * The best matching method is searched for with the following strategy:\n     * <ol>\n     * <li>public method with exact signature match in class hierarchy</li>\n     * <li>non-public method with exact signature match on declaring class</li>\n     * <li>public method with similar signature in class hierarchy</li>\n     * <li>non-public method with similar signature on declaring class</li>\n     * </ol>\n     *\n     * @param name The method name\n     * @param args The method arguments\n     * @return The wrapped method result or the same wrapped object if the\n     *         method returns <code>void</code>, to be used for further\n     *         reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     */\n    public Reflect call(String name, Object... args) throws ReflectException {\n        Class<?>[] types = types(args);\n\n        // Try invoking the \"canonical\" method, i.e. the one with exact\n        // matching argument types\n        try {\n            Method method = exactMethod(name, types);\n            return on(method, object, args);\n        }\n\n        // If there is no exact match, try to find a method that has a \"similar\"\n        // signature if primitive argument types are converted to their wrappers\n        catch (NoSuchMethodException e) {\n            try {\n                Method method = similarMethod(name, types);\n                return on(method, object, args);\n            } catch (NoSuchMethodException e1) {\n                throw new ReflectException(e1);\n            }\n        }\n    }\n\n    /**\n     * Searches a method with the exact same signature as desired.\n     * <p>\n     * If a public method is found in the class hierarchy, this method is returned.\n     * Otherwise a private method with the exact same signature is returned.\n     * If no exact match could be found, we let the {@code NoSuchMethodException} pass through.\n     */\n    private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {\n        Class<?> t = type();\n\n        // first priority: find a public method with exact signature match in class hierarchy\n        try {\n            return t.getMethod(name, types);\n        }\n\n        // second priority: find a private method with exact signature match on declaring class\n        catch (NoSuchMethodException e) {\n            do {\n                try {\n                    return t.getDeclaredMethod(name, types);\n                }\n                catch (NoSuchMethodException ignore) {}\n\n                t = t.getSuperclass();\n            }\n            while (t != null);\n\n            throw new NoSuchMethodException();\n        }\n    }\n\n    /**\n     * Searches a method with a similar signature as desired using\n     * {@link #isSimilarSignature(java.lang.reflect.Method, String, Class[])}.\n     * <p>\n     * First public methods are searched in the class hierarchy, then private\n     * methods on the declaring class. If a method could be found, it is\n     * returned, otherwise a {@code NoSuchMethodException} is thrown.\n     */\n    private Method similarMethod(String name, Class<?>[] types) throws NoSuchMethodException {\n        Class<?> t = type();\n\n        // first priority: find a public method with a \"similar\" signature in class hierarchy\n        // similar interpreted in when primitive argument types are converted to their wrappers\n        for (Method method : t.getMethods()) {\n            if (isSimilarSignature(method, name, types)) {\n                return method;\n            }\n        }\n\n        // second priority: find a non-public method with a \"similar\" signature on declaring class\n        do {\n            for (Method method : t.getDeclaredMethods()) {\n                if (isSimilarSignature(method, name, types)) {\n                    return method;\n                }\n            }\n\n            t = t.getSuperclass();\n        }\n        while (t != null);\n\n        throw new NoSuchMethodException(\"No similar method \" + name + \" with params \" + Arrays.toString(types) + \" could be found on type \" + type() + \".\");\n    }\n\n    /**\n     * Determines if a method has a \"similar\" signature, especially if wrapping\n     * primitive argument types would result in an exactly matching signature.\n     */\n    private boolean isSimilarSignature(Method possiblyMatchingMethod, String desiredMethodName, Class<?>[] desiredParamTypes) {\n        return possiblyMatchingMethod.getName().equals(desiredMethodName) && match(possiblyMatchingMethod.getParameterTypes(), desiredParamTypes);\n    }\n\n    /**\n     * Call a constructor.\n     * <p>\n     * This is a convenience method for calling\n     * <code>create(new Object[0])</code>\n     *\n     * @return The wrapped new object, to be used for further reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     * @see #create(Object...)\n     */\n    public Reflect create() throws ReflectException {\n        return create(new Object[0]);\n    }\n\n    /**\n     * Call a constructor.\n     * <p>\n     * This is roughly equivalent to {@link Constructor#newInstance(Object...)}.\n     * If the wrapped object is a {@link Class}, then this will create a new\n     * object of that class. If the wrapped object is any other {@link Object},\n     * then this will create a new object of the same type.\n     * <p>\n     * Just like {@link Constructor#newInstance(Object...)}, this will try to\n     * wrap primitive types or unwrap primitive type wrappers if applicable. If\n     * several constructors are applicable, by that rule, the first one\n     * encountered is called. i.e. when calling <code><pre>\n     * on(C.class).create(1, 1);\n     * </pre></code> The first of the following constructors will be applied:\n     * <code><pre>\n     * public C(int param1, Integer param2);\n     * public C(Integer param1, int param2);\n     * public C(Number param1, Number param2);\n     * public C(Number param1, Object param2);\n     * public C(int param1, Object param2);\n     * </pre></code>\n     *\n     * @param args The constructor arguments\n     * @return The wrapped new object, to be used for further reflection.\n     * @throws ReflectException If any reflection exception occurred.\n     */\n    public Reflect create(Object... args) throws ReflectException {\n        Class<?>[] types = types(args);\n\n        // Try invoking the \"canonical\" constructor, i.e. the one with exact\n        // matching argument types\n        try {\n            Constructor<?> constructor = type().getDeclaredConstructor(types);\n            return on(constructor, args);\n        }\n\n        // If there is no exact match, try to find one that has a \"similar\"\n        // signature if primitive argument types are converted to their wrappers\n        catch (NoSuchMethodException e) {\n            for (Constructor<?> constructor : type().getDeclaredConstructors()) {\n                if (match(constructor.getParameterTypes(), types)) {\n                    return on(constructor, args);\n                }\n            }\n\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Create a proxy for the wrapped object allowing to typesafely invoke\n     * methods on it using a custom interface\n     *\n     * @param proxyType The interface type that is implemented by the proxy\n     * @return A proxy for the wrapped object\n     */\n    @SuppressWarnings(\"unchecked\")\n    public <P> P as(final Class<P> proxyType) {\n        final boolean isMap = (object instanceof Map);\n        final InvocationHandler handler = new InvocationHandler() {\n            @SuppressWarnings(\"null\")\n            @Override\n            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n                String name = method.getName();\n\n                // Actual method name matches always come first\n                try {\n                    return on(type, object).call(name, args).get();\n                }\n\n                // [#14] Emulate POJO behaviour on wrapped map objects\n                catch (ReflectException e) {\n                    if (isMap) {\n                        Map<String, Object> map = (Map<String, Object>) object;\n                        int length = (args == null ? 0 : args.length);\n\n                        if (length == 0 && name.startsWith(\"get\")) {\n                            return map.get(property(name.substring(3)));\n                        }\n                        else if (length == 0 && name.startsWith(\"is\")) {\n                            return map.get(property(name.substring(2)));\n                        }\n                        else if (length == 1 && name.startsWith(\"set\")) {\n                            map.put(property(name.substring(3)), args[0]);\n                            return null;\n                        }\n                    }\n\n\n\n\n\n\n\n\n\n\n\n                    throw e;\n                }\n            }\n        };\n\n        return (P) Proxy.newProxyInstance(proxyType.getClassLoader(), new Class[] { proxyType }, handler);\n    }\n\n    /**\n     * Get the POJO property name of an getter/setter\n     */\n    private static String property(String string) {\n        int length = string.length();\n\n        if (length == 0) {\n            return \"\";\n        }\n        else if (length == 1) {\n            return string.toLowerCase(Locale.ROOT);\n        }\n        else {\n            return string.substring(0, 1).toLowerCase(Locale.ROOT) + string.substring(1);\n        }\n    }\n\n    // ---------------------------------------------------------------------\n    // Object API\n    // ---------------------------------------------------------------------\n\n    /**\n     * Check whether two arrays of types match, converting primitive types to\n     * their corresponding wrappers.\n     */\n    private boolean match(Class<?>[] declaredTypes, Class<?>[] actualTypes) {\n        if (declaredTypes.length == actualTypes.length) {\n            for (int i = 0; i < actualTypes.length; i++) {\n                if (actualTypes[i] == NULL.class)\n                    continue;\n\n                if (wrapper(declaredTypes[i]).isAssignableFrom(wrapper(actualTypes[i])))\n                    continue;\n\n                return false;\n            }\n\n            return true;\n        }\n        else {\n            return false;\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    public int hashCode() {\n        return object.hashCode();\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    public boolean equals(Object obj) {\n        if (obj instanceof Reflect) {\n            return object.equals(((Reflect) obj).get());\n        }\n\n        return false;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    public String toString() {\n        return object.toString();\n    }\n\n    // ---------------------------------------------------------------------\n    // Utility methods\n    // ---------------------------------------------------------------------\n\n    /**\n     * Wrap an object created from a constructor\n     */\n    private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {\n        try {\n            return on(constructor.getDeclaringClass(), accessible(constructor).newInstance(args));\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Wrap an object returned from a method\n     */\n    private static Reflect on(Method method, Object object, Object... args) throws ReflectException {\n        try {\n            accessible(method);\n\n            if (method.getReturnType() == void.class) {\n                method.invoke(object, args);\n                return on(object);\n            }\n            else {\n                return on(method.invoke(object, args));\n            }\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Unwrap an object\n     */\n    private static Object unwrap(Object object) {\n        if (object instanceof Reflect) {\n            return ((Reflect) object).get();\n        }\n\n        return object;\n    }\n\n    /**\n     * Get an array of types for an array of objects\n     *\n     * @see Object#getClass()\n     */\n    private static Class<?>[] types(Object... values) {\n        if (values == null) {\n            return new Class[0];\n        }\n\n        Class<?>[] result = new Class[values.length];\n\n        for (int i = 0; i < values.length; i++) {\n            Object value = values[i];\n            result[i] = value == null ? NULL.class : value.getClass();\n        }\n\n        return result;\n    }\n\n    /**\n     * Load a class\n     *\n     * @see Class#forName(String)\n     */\n    private static Class<?> forName(String name) throws ReflectException {\n        try {\n            return Class.forName(name);\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {\n        try {\n            return Class.forName(name, true, classLoader);\n        }\n        catch (Exception e) {\n            throw new ReflectException(e);\n        }\n    }\n\n    /**\n     * Get the type of the wrapped object.\n     *\n     * @see Object#getClass()\n     */\n    public Class<?> type() {\n        return type;\n    }\n\n    /**\n     * Get a wrapper type for a primitive type, or the argument type itself, if\n     * it is not a primitive type.\n     */\n    public static Class<?> wrapper(Class<?> type) {\n        if (type == null) {\n            return null;\n        }\n        else if (type.isPrimitive()) {\n            if (boolean.class == type) {\n                return Boolean.class;\n            }\n            else if (int.class == type) {\n                return Integer.class;\n            }\n            else if (long.class == type) {\n                return Long.class;\n            }\n            else if (short.class == type) {\n                return Short.class;\n            }\n            else if (byte.class == type) {\n                return Byte.class;\n            }\n            else if (double.class == type) {\n                return Double.class;\n            }\n            else if (float.class == type) {\n                return Float.class;\n            }\n            else if (char.class == type) {\n                return Character.class;\n            }\n            else if (void.class == type) {\n                return Void.class;\n            }\n        }\n\n        return type;\n    }\n\n    private static class NULL {}\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/java/org/joor/ReflectException.java",
    "content": "/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.joor;\n\nimport java.lang.reflect.InvocationTargetException;\n\n/**\n * A unchecked wrapper for any of Java's checked reflection exceptions:\n * <p>\n * These exceptions are\n * <ul>\n * <li> {@link ClassNotFoundException}</li>\n * <li> {@link IllegalAccessException}</li>\n * <li> {@link IllegalArgumentException}</li>\n * <li> {@link InstantiationException}</li>\n * <li> {@link InvocationTargetException}</li>\n * <li> {@link NoSuchMethodException}</li>\n * <li> {@link NoSuchFieldException}</li>\n * <li> {@link SecurityException}</li>\n * </ul>\n *\n * @author Lukas Eder\n */\npublic class ReflectException extends RuntimeException {\n\n    /**\n     * Generated UID\n     */\n    private static final long serialVersionUID = -6213149635297151442L;\n\n    public ReflectException(String message) {\n        super(message);\n    }\n\n    public ReflectException(String message, Throwable cause) {\n        super(message, cause);\n    }\n\n    public ReflectException() {\n        super();\n    }\n\n    public ReflectException(Throwable cause) {\n        super(cause);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Detox</string>\n</resources>\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/ActivityLaunchHelperTest.kt",
    "content": "package com.wix.detox\n\nimport android.app.Activity\nimport android.content.Intent\nimport android.os.Bundle\nimport org.mockito.kotlin.*\nimport androidx.test.rule.ActivityTestRule\nimport org.junit.runner.RunWith\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.Before\nimport org.junit.Test\nimport org.mockito.ArgumentMatchers.anyBoolean\nimport org.mockito.ArgumentMatchers.anyString\nimport org.robolectric.RobolectricTestRunner\n\n@RunWith(RobolectricTestRunner::class)\nclass ActivityLaunchHelperTest {\n\n    private val initialURL = \"detox://unit-test\"\n    private val bundleExtraLaunchArgs = \"launchArgs\"\n    private val notificationPath = \"path/to/notification.data\"\n\n    private lateinit var intent: Intent\n    private lateinit var launchArgsAsBundle: Bundle\n    private lateinit var notificationDataAsBundle: Bundle\n    private lateinit var testRule: ActivityTestRule<Activity>\n    private lateinit var launchArgs: LaunchArgs\n    private lateinit var intentsFactory: LaunchIntentsFactory\n    private lateinit var notificationDataParser: NotificationDataParser\n\n    private fun uut() = ActivityLaunchHelper(testRule, launchArgs, intentsFactory, { notificationDataParser })\n\n    @Before\n    fun setup() {\n        intent = Intent()\n        launchArgsAsBundle = mock()\n        notificationDataAsBundle = mock()\n\n        testRule = mock()\n        launchArgs = mock() {\n            on { asIntentBundle() }.thenReturn(launchArgsAsBundle)\n        }\n        intentsFactory = mock()\n        notificationDataParser = mock() {\n            on { toBundle() }.thenReturn(notificationDataAsBundle)\n        }\n    }\n\n    @Test\n    fun `default-activity -- should launch using test rule, with a clean intent`() {\n        givenCleanLaunch()\n        uut().launchActivityUnderTest()\n        verify(testRule).launchActivity(eq(intent))\n    }\n\n    @Test\n    fun `default-activity -- should apply launch args to intent`() {\n        givenCleanLaunch()\n        uut().launchActivityUnderTest()\n        assertIntentHasLaunchArgs()\n    }\n\n    @Test\n    fun `default activity, with a url -- should launch based on the url`() {\n        givenLaunchWithInitialURL()\n        uut().launchActivityUnderTest()\n        verify(testRule).launchActivity(eq(intent))\n        verify(intentsFactory).intentWithUrl(initialURL, true)\n    }\n\n    @Test\n    fun `default activity, with a url -- should apply launch args to intent`() {\n        givenLaunchWithInitialURL()\n        uut().launchActivityUnderTest()\n        assertIntentHasLaunchArgs()\n    }\n\n    @Test\n    fun `default activity, with notification data -- should launch with the data as bundle`() {\n        givenLaunchWithNotificationData()\n        uut().launchActivityUnderTest()\n        verify(testRule).launchActivity(eq(intent))\n        verify(intentsFactory).intentWithNotificationData(any(), eq(notificationDataAsBundle), eq(true))\n    }\n\n    @Test\n    fun `default activity, with notification data -- should apply launch args to intent`() {\n        givenLaunchWithNotificationData()\n        uut().launchActivityUnderTest()\n        assertIntentHasLaunchArgs()\n    }\n\n    private fun givenCleanLaunch() {\n        whenever(intentsFactory.cleanIntent()).thenReturn(intent)\n    }\n    private fun givenLaunchWithInitialURL() {\n        whenever(launchArgs.hasUrlOverride()).thenReturn(true)\n        whenever(launchArgs.urlOverride).thenReturn(initialURL)\n        whenever(intentsFactory.intentWithUrl(anyString(), anyBoolean())).thenReturn(intent)\n    }\n    private fun givenLaunchWithNotificationData() {\n        whenever(launchArgs.hasNotificationPath()).thenReturn(true)\n        whenever(launchArgs.notificationPath).thenReturn(notificationPath)\n        whenever(intentsFactory.intentWithNotificationData(any(), any(), anyBoolean()))\n            .thenReturn(intent)\n    }\n    private fun assertIntentHasLaunchArgs() {\n        assertThat(intent.hasExtra(bundleExtraLaunchArgs)).isTrue\n        assertThat(intent.getBundleExtra(bundleExtraLaunchArgs)).isEqualTo(launchArgsAsBundle)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/UTHelpers.kt",
    "content": "package com.wix.detox\n\nimport android.view.View\nimport android.view.ViewGroup\nimport org.mockito.ArgumentMatchers.eq\nimport org.mockito.kotlin.whenever\nimport java.util.concurrent.ExecutorService\nimport java.util.concurrent.TimeUnit\n\nobject UTHelpers {\n    fun yieldToOtherThreads(executor: ExecutorService) = executor.awaitTermination(100L, TimeUnit.MILLISECONDS)\n\n    fun mockViewHierarchy(parent: ViewGroup, vararg children: View) {\n        whenever(parent.childCount).thenReturn(children.size)\n\n        children.forEachIndexed { index, view ->\n            whenever(parent.getChildAt(eq(index))).thenReturn(view)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/adapters/server/DetoxActionHandlersSpec.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport android.content.Context\nimport androidx.test.espresso.AmbiguousViewMatcherException\nimport androidx.test.espresso.NoMatchingViewException\nimport com.wix.detox.TestEngineFacade\nimport com.wix.detox.UTHelpers.yieldToOtherThreads\nimport com.wix.detox.espresso.errors.DetoxExceptionWithHierarchy\nimport com.wix.detox.instruments.DetoxInstrumentsException\nimport com.wix.detox.instruments.DetoxInstrumentsManager\nimport com.wix.invoke.MethodInvocation\nimport org.assertj.core.api.Assertions\nimport org.json.JSONObject\nimport org.mockito.kotlin.*\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport java.lang.reflect.InvocationTargetException\nimport java.util.*\nimport java.util.concurrent.Executors\n\nval mockErrorParser = { error: Throwable? -> \"mockErrorParser($error)\" }\n\nobject DetoxActionHandlersSpec : Spek({\n    describe(\"Action handlers\") {\n        val params = \"{\\\"mock\\\": \\\"params\\\"}\"\n        val messageId = 666L\n\n        lateinit var appContext: Context\n        lateinit var outboundServerAdapter: OutboundServerAdapter\n        lateinit var testEngineFacade: TestEngineFacade\n\n        beforeEachTest {\n            appContext = mock()\n            outboundServerAdapter = mock()\n\n            testEngineFacade = mock()\n            whenever(testEngineFacade.awaitIdle()).then {\n                synchronized(testEngineFacade) {}\n            }\n            whenever(testEngineFacade.syncIdle()).then {\n                synchronized(testEngineFacade) {}\n            }\n        }\n\n        describe(\"Ready action\") {\n            fun uut() = ReadyActionHandler(outboundServerAdapter, testEngineFacade)\n\n            it(\"should reply with a 'ready' ACK if ready\") {\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"ready\"), eq(Collections.emptyMap<String, Any>()), eq(messageId))\n            }\n\n            it(\"should block waiting for idle before ACK-ing\") {\n                val executor = Executors.newSingleThreadExecutor()\n\n                synchronized(testEngineFacade) {\n                    executor.submit {\n                        uut().handle(params, messageId)\n                    }\n                    yieldToOtherThreads(executor)\n                    verify(testEngineFacade).awaitIdle()\n                    verify(outboundServerAdapter, never()).sendMessage(any(), any(), any())\n                }\n                yieldToOtherThreads(executor)\n                verify(outboundServerAdapter, times(1)).sendMessage(any(), any(), any())\n            }\n        }\n\n        describe(\"React-native reload action\") {\n            fun uut() = ReactNativeReloadActionHandler(appContext, outboundServerAdapter, testEngineFacade)\n\n            it(\"should reload the app\") {\n                uut().handle(params, messageId)\n                verify(testEngineFacade).reloadReactNative(appContext)\n            }\n\n            it(\"should reply with a 'ready' ACK when ready\") {\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"ready\"), eq(emptyMap<String, Any>()), eq(messageId))\n            }\n\n            it(\"should sync before ACK-ing\") {\n                val executor = Executors.newSingleThreadExecutor()\n\n                synchronized(testEngineFacade) {\n                    executor.submit {\n                        uut().handle(params, messageId)\n                    }\n                    yieldToOtherThreads(executor)\n                    verify(testEngineFacade).syncIdle()\n                    verify(testEngineFacade, never()).reloadReactNative(any())\n                    verify(outboundServerAdapter, never()).sendMessage(any(), any(), any())\n                }\n                yieldToOtherThreads(executor)\n                verify(testEngineFacade, times(1)).reloadReactNative(eq(appContext))\n                verify(outboundServerAdapter, times(1)).sendMessage(any(), any(), any())\n            }\n        }\n\n        describe(\"Invoke actions\") {\n            lateinit var methodInvocationMock: MethodInvocation\n\n            fun uut() = InvokeActionHandler(methodInvocationMock, outboundServerAdapter, mockErrorParser)\n\n            beforeEachTest {\n                methodInvocationMock = mock()\n            }\n\n            it(\"should invoke the right target\") {\n                uut().handle(params, messageId)\n                verify(methodInvocationMock).invoke(params)\n            }\n\n            it(\"should reply with an 'invokeResult' ACK\") {\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"invokeResult\"), any(), eq(messageId))\n            }\n\n            it(\"should reply with empty result data\") {\n                uut().handle(params, messageId)\n\n                verify(outboundServerAdapter).sendMessage(any(), argThat { size == 1 && this[\"result\"] == null }, any())\n            }\n\n            it(\"should reply with actual result data\") {\n                val someResult = \"some_result\"\n                whenever(methodInvocationMock.invoke(isA<String>())).thenReturn(someResult)\n                uut().handle(params, messageId)\n\n                verify(outboundServerAdapter).sendMessage(any(), argThat { size == 1 && this[\"result\"] == someResult }, any())\n            }\n\n            it(\"should handle runtime errors\") {\n                val exception = IllegalStateException(\"mock-error-reason\")\n                whenever(methodInvocationMock.invoke(isA<String>())).thenThrow(exception)\n\n                uut().handle(params, messageId)\n\n                verify(outboundServerAdapter).sendMessage(\n                        eq(\"error\"),\n                        argThat { size == 1 && this[\"error\"] == \"mockErrorParser(${exception})\\nCheck device logs for full details!\\n\" },\n                        eq(messageId))\n            }\n\n            it(\"should handle DetoxExceptionWithHierarchy and extract xmlHierarchy\") {\n                val detoxException = object : RuntimeException(\"Test exception\"), DetoxExceptionWithHierarchy {\n                    override val xmlHierarchy: String = \"<ViewHierarchy><TestView/></ViewHierarchy>\"\n                }\n                val exception = InvocationTargetException(detoxException)\n                whenever(methodInvocationMock.invoke(isA<String>())).thenThrow(exception)\n\n                uut().handle(params, messageId)\n\n                verify(outboundServerAdapter).sendMessage(\n                        eq(\"testFailed\"),\n                        argThat {\n                            this[\"details\"] == \"Test exception\\n\" &&\n                            this[\"viewHierarchy\"] == \"<ViewHierarchy><TestView/></ViewHierarchy>\" &&\n                            size == 2\n                        },\n                        eq(messageId))\n            }\n\n            it(\"should handle non-Detox exceptions with null viewHierarchy\") {\n                val rootException = RuntimeException(\"root-exception-mock\")\n                val targetException = Exception(\"target-exception-mock\", rootException)\n                val exception = InvocationTargetException(targetException)\n                whenever(methodInvocationMock.invoke(isA<String>())).thenThrow(exception)\n\n                uut().handle(params, messageId)\n\n                verify(outboundServerAdapter).sendMessage(\n                        eq(\"testFailed\"),\n                        argThat {\n                            this[\"details\"] == \"root-exception-mock\\n\" &&\n                            this[\"viewHierarchy\"] == null &&\n                            size == 2\n                        },\n                        eq(messageId))\n            }\n        }\n\n        describe(\"InstrumentsRecording recording state actions\") {\n            lateinit var instrumentsManager: DetoxInstrumentsManager\n\n            fun uut() = InstrumentsRecordingStateActionHandler(instrumentsManager, outboundServerAdapter)\n\n            beforeEachTest {\n                instrumentsManager = mock()\n            }\n\n            it(\"should start recording with path\") {\n                uut().handle(\"{\\\"recordingPath\\\":\\\"/MockPath\\\", \\\"samplingInterval\\\":100500}\", messageId)\n                verify(instrumentsManager).startRecordingAtLocalPath(eq(\"/MockPath\"), eq(100500L))\n            }\n\n            it(\"should start recording with path and default samplingInterval\") {\n                uut().handle(\"{\\\"recordingPath\\\":\\\"/MockPath\\\"}\", messageId)\n                verify(instrumentsManager)\n                        .startRecordingAtLocalPath(\n                                eq(\"/MockPath\"),\n                                eq(InstrumentsRecordingStateActionHandler.DEFAULT_SAMPLING_INTERVAL)\n                        )\n            }\n\n            it(\"should stop recording without path\") {\n                uut().handle(\"{\\\"recordingPath\\\":null}\", messageId)\n                verify(instrumentsManager).stopRecording()\n            }\n\n            it(\"should reply with a 'done' ACK on set state finish\") {\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"setRecordingStateDone\"), any(), eq(messageId))\n            }\n        }\n\n        describe(\"InstrumentsRecording events actions\") {\n            lateinit var instrumentsManager: DetoxInstrumentsManager\n            val mockCategory = \"MockCategory\"\n            val mockName = \"MockName\"\n            val mockId = \"MockId\"\n            val mockAdditionalInfo = \"MockAdditionalInfo\"\n            val mockStatus = \"MockStatus\"\n\n            fun uut() = InstrumentsEventsActionsHandler(instrumentsManager, outboundServerAdapter)\n\n            beforeEachTest {\n                instrumentsManager = mock()\n            }\n\n            describe(\"begin interval\") {\n                val json = with(JSONObject()) {\n                    put(\"category\", mockCategory)\n                    put(\"name\", mockName)\n                    put(\"id\", mockId)\n                    put(\"additionalInfo\", mockAdditionalInfo)\n                    put(\"action\", \"begin\")\n                }.toString()\n\n                it(\"should invoke instrumentation\") {\n                    uut().handle(json, messageId)\n                    verify(instrumentsManager).eventBeginInterval(\n                            eq(mockCategory),\n                            eq(mockName),\n                            eq(mockId),\n                            eq(mockAdditionalInfo)\n                    )\n                }\n\n                it(\"should reply with a 'done' ACK\") {\n                    uut().handle(json, messageId)\n                    verify(outboundServerAdapter).sendMessage(eq(\"eventDone\"), any(), eq(messageId))\n                }\n            }\n\n            describe(\"end interval\") {\n                val json = with(JSONObject()) {\n                    put(\"id\", mockId)\n                    put(\"status\", mockStatus)\n                    put(\"additionalInfo\", mockAdditionalInfo)\n                    put(\"action\", \"end\")\n                }.toString()\n\n                it(\"should invoke instrumentation\") {\n                    uut().handle(json, messageId)\n                    verify(instrumentsManager).eventEndInterval(\n                            eq(mockId),\n                            eq(mockStatus),\n                            eq(mockAdditionalInfo)\n                    )\n                }\n\n                it(\"should reply with a 'done' ACK\") {\n                    uut().handle(json, messageId)\n                    verify(outboundServerAdapter).sendMessage(eq(\"eventDone\"), any(), eq(messageId))\n                }\n            }\n\n            describe(\"mark\") {\n                val json = with(JSONObject()) {\n                    put(\"category\", mockCategory)\n                    put(\"name\", mockName)\n                    put(\"id\", mockId)\n                    put(\"status\", mockStatus)\n                    put(\"additionalInfo\", mockAdditionalInfo)\n                    put(\"action\", \"mark\")\n                }.toString()\n\n                it(\"should invoke instrumentation\") {\n                    uut().handle(json, messageId)\n                    verify(instrumentsManager).eventMark(\n                            eq(mockCategory),\n                            eq(mockName),\n                            eq(mockId),\n                            eq(mockStatus),\n                            eq(mockAdditionalInfo)\n                    )\n                }\n\n                it(\"should reply with a 'done' ACK\") {\n                    uut().handle(json, messageId)\n                    verify(outboundServerAdapter).sendMessage(eq(\"eventDone\"), any(), eq(messageId))\n                }\n            }\n\n            it(\"wrong event action\") {\n                val json = with(JSONObject()) {\n                    put(\"action\", \"wrong\")\n                }.toString()\n\n                var err: Exception? = null\n                try {\n                    uut().handle(json, messageId)\n                } catch (e: DetoxInstrumentsException) {\n                    err = e\n                }\n                Assertions.assertThat(err).isNotNull()\n                Assertions.assertThat(err).hasMessage(\"Invalid action\")\n            }\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/adapters/server/QueryStatusActionHandlerSpec.kt",
    "content": "package com.wix.detox.adapters.server\n\nimport com.wix.detox.TestEngineFacade\nimport com.wix.detox.inquiry.DetoxBusyResource\nimport com.wix.detox.inquiry.DetoxBusyResourceDescription\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.eq\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.verify\nimport org.mockito.kotlin.whenever\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nobject QueryStatusActionHandlerSpec : Spek({\n    describe(\"Query Status Action Handler\") {\n        val params = \"{\\\"mock\\\": \\\"params\\\"}\"\n        val messageId = 666L\n\n        lateinit var outboundServerAdapter: OutboundServerAdapter\n        lateinit var testEngineFacade: TestEngineFacade\n\n        beforeEachTest {\n            outboundServerAdapter = mock()\n\n            testEngineFacade = mock()\n            whenever(testEngineFacade.awaitIdle()).then {\n                synchronized(testEngineFacade) {}\n            }\n            whenever(testEngineFacade.syncIdle()).then {\n                synchronized(testEngineFacade) {}\n            }\n        }\n\n        fun uut() = QueryStatusActionHandler(outboundServerAdapter, testEngineFacade)\n\n        describe(\"given an idle app\") {\n            it(\"should send an idle status indication\") {\n                val expectedData =  mapOf(\"status\" to mapOf(\"app_status\" to \"idle\"))\n\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"currentStatusResult\"), eq(expectedData), eq(messageId))\n            }\n        }\n\n        describe(\"given a busy app\") {\n\n\n            fun aBusyResource(identifier: String): DetoxBusyResource {\n\n                return mock<DetoxBusyResource.BusyIdlingResource> {\n                    on { getDescription() } doReturn DetoxBusyResourceDescription.Builder()\n                        .name(\"mock\")\n                        .addDescription(\"mock\", identifier)\n                        .build()\n                }\n\n            }\n\n            it(\"should send a descriptive busy-status indication\") {\n                val busyResource = aBusyResource(\"some-resource\")\n                val busyResource2 = aBusyResource(\"yet-another-resource\")\n                val expectedData =  mapOf<String, Any>(\"status\" to mapOf(\n                    \"app_status\" to \"busy\",\n                    \"busy_resources\" to listOf(\n                        mapOf(\"name\" to \"mock\", \"description\" to mapOf(\"mock\" to \"some-resource\")),\n                        mapOf(\"name\" to \"mock\", \"description\" to mapOf(\"mock\" to \"yet-another-resource\"))\n                    )\n                ))\n                whenever(testEngineFacade.getAllBusyResources()).thenReturn(listOf(busyResource, busyResource2))\n\n                uut().handle(params, messageId)\n                verify(outboundServerAdapter).sendMessage(eq(\"currentStatusResult\"), eq(expectedData), eq(messageId))\n            }\n        }\n   }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/common/JsonConverterTest.kt",
    "content": "package com.wix.detox.common\n\nimport org.assertj.core.api.Assertions.assertThat\nimport org.json.JSONArray\nimport org.json.JSONObject\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.RobolectricTestRunner\nimport kotlin.test.assertFailsWith\n\n@RunWith(RobolectricTestRunner::class)\nclass JsonConverterTest {\n\n    @Test\n    fun `should convert an empty json to an empty bundle`() {\n        val uut = JsonConverter(JSONObject())\n        assertThat(uut.toBundle().isEmpty).isTrue()\n    }\n\n    @Test\n    fun `should convert a boolean`() {\n        val json = aJsonWithAFlag()\n\n        val uut = JsonConverter(json)\n        assertThat(uut.toBundle().getBoolean(\"flag\")).isEqualTo(true)\n    }\n\n    @Test\n    fun `should convert a string`() {\n        val json = aJsonWithAString()\n        val uut = JsonConverter(json)\n        assertThat(uut.toBundle().getString(\"test\")).isEqualTo(\"mock\")\n    }\n\n    @Test\n    fun `should convert an integer`() {\n        val json = aJsonWithAnInt()\n        val uut = JsonConverter(json)\n        assertThat(uut.toBundle().getInt(\"integer\")).isEqualTo(1234)\n    }\n\n    @Test\n    fun `should convert a long-int`() {\n        val json = aJsonWithALongInt()\n        val uut = JsonConverter(json)\n        assertThat(uut.toBundle().getLong(\"longint\")).isEqualTo(1234L)\n    }\n\n    @Test\n    fun `should convert a double`() {\n        val json = aJsonWithADouble()\n        val uut = JsonConverter(json)\n        assertThat(uut.toBundle().getDouble(\"double\")).isEqualTo(1234.56)\n    }\n\n    @Test\n    fun `should convert a complete child-object`() {\n        val json = aJsonWithAChildObject()\n        val uut = JsonConverter(json)\n\n        val subBundle = uut.toBundle().getBundle(\"obj\")\n        assertThat(subBundle).isNotNull()\n\n        subBundle!!\n        assertThat(subBundle.get(\"test\")).isEqualTo(\"777\")\n        assertThat(subBundle.get(\"double\")).isEqualTo(1234.56)\n        assertThat(subBundle.get(\"longint\")).isEqualTo(2_222_222_222L)\n    }\n\n    @Test\n    fun `should convert a strings array`() {\n        val json = aJsonWithAStringsArray()\n        val uut = JsonConverter(json)\n\n        val array = uut.toBundle().getStringArrayList(\"arr\")\n        assertThat(array).isNotNull()\n\n        array!!\n        assertThat(array).isEqualTo(arrayListOf(\"rock\", \"paper\", \"scissors\"))\n    }\n\n    @Test\n    fun `should convert a primitives array`() {\n        val json = aJsonWithPrimitiveArray()\n        val uut = JsonConverter(json)\n\n        val array = uut.toBundle().getStringArrayList(\"arr\")\n        assertThat(array).isNotNull()\n\n        array!!\n        assertThat(array).isEqualTo(arrayListOf(\"1234\", \"12.34\", \"1234\", \"true\"))\n    }\n\n    @Test\n    fun `should fail to convert a complex array`() {\n        val json = aJsonWithComplexArray()\n        val uut = JsonConverter(json)\n\n        assertFailsWith<IllegalArgumentException> {\n            uut.toBundle()\n        }\n    }\n}\n\nprivate fun aJsonWithAFlag() = JSONObject().put(\"flag\", true)\nprivate fun aJsonWithAString() = JSONObject().put(\"test\", \"mock\")\nprivate fun aJsonWithAnInt() = JSONObject().put(\"integer\", 1234)\nprivate fun aJsonWithALongInt() = JSONObject().put(\"longint\", 1234L)\nprivate fun aJsonWithADouble() = JSONObject().put(\"double\", 1234.56)\nprivate fun aJsonWithAChildObject(): JSONObject {\n    val child = JSONObject(\"\"\"{\n        \"flag\": true,\n        \"test\": \"777\",\n        \"integer\": 1234,\n        \"longint\": 2222222222,\n        \"double\": 1234.56\n    }\"\"\".trimIndent())\n    return JSONObject().put(\"obj\", child)\n}\nprivate fun aJsonWithAStringsArray() = JSONObject().apply {\n    val array = JSONArray(\"\"\"[\n        \"rock\", \"paper\", \"scissors\"\n    ]\"\"\".trimIndent())\n    put(\"arr\", array)\n}\nprivate fun aJsonWithPrimitiveArray() = JSONObject().apply {\n    val array = JSONArray(\"\"\"[\n        1234, 12.34, \"1234\", true\n    ]\"\"\".trimIndent())\n    put(\"arr\", array)\n}\nprivate fun aJsonWithComplexArray() = JSONObject().apply {\n    val array = JSONArray(\"\"\"[ \n        1234, { \"sub\": \"obj\" }\n    ]\"\"\".trimIndent())\n    put(\"arr\", array)\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/common/TapEventsSpec.kt",
    "content": "package com.wix.detox.common\n\nimport android.view.MotionEvent\nimport com.wix.detox.espresso.action.common.MotionEvents\nimport com.wix.detox.espresso.action.common.TapEvents\nimport org.assertj.core.api.Assertions.assertThat\nimport org.mockito.kotlin.*\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nprivate fun dontCareCoordinates() = FloatArray(2) { 0f }\nprivate fun dontCarePrecision() = FloatArray(2) { 0f }\nprivate fun fancyCoordinates() = FloatArray(2) { index -> ((index + 1) * 100).toFloat() }\nprivate fun fancyPrecision() = FloatArray(2) { index -> ((index + 1) * 1000).toFloat() }\n\nprivate const val DEFAULT_EVENT_TIME = 1000L\n\nobject TapEventsSpec: Spek({\n    describe(\"Tap-Events wrapper\") {\n        lateinit var downEvent: MotionEvent\n        lateinit var upEvent: MotionEvent\n        lateinit var motionEvents: MotionEvents\n\n        beforeEachTest {\n            downEvent = mock(name = \"downEventMock\") {\n                on { eventTime }.doReturn(DEFAULT_EVENT_TIME)\n            }\n            upEvent = mock(name = \"upEventMock\")\n            motionEvents = mock {\n                on { obtainDownEvent(any(), any(), any()) }.doReturn(downEvent)\n                on { obtainDownEvent(any(), any(), any(), any()) }.doReturn(downEvent)\n                on { obtainDownEvent(any(), any(), any(), isNull()) }.doReturn(downEvent)\n                on { obtainUpEvent(eq(downEvent), any(), any(), any()) }.doReturn(upEvent)\n            }\n        }\n\n        fun uut() = TapEvents(motionEvents)\n\n        fun verifyDownEventObtained(coordinates: FloatArray, precision: FloatArray)\n                = verify(motionEvents).obtainDownEvent(coordinates[0], coordinates[1], precision, null)\n\n        fun verifyDownEventObtainedWithDownTimestamp(coordinates: FloatArray, precision: FloatArray, downTimestamp: Long?)\n                = verify(motionEvents).obtainDownEvent(coordinates[0], coordinates[1], precision, downTimestamp)\n\n        fun verifyUpEventObtained(coordinates: FloatArray)\n                = verify(motionEvents).obtainUpEvent(eq(downEvent), any(), eq(coordinates[0]), eq(coordinates[1]))\n\n        fun verifyUpEventObtainedWithTimestamp(expectedUpTime: Long)\n                = verify(motionEvents).obtainUpEvent(eq(downEvent), eq(expectedUpTime), any(), any())\n\n        it(\"should obtain a down-event\") {\n            val coordinates = fancyCoordinates()\n            val precision = fancyPrecision()\n\n            uut().createEventsSeq(coordinates, precision)\n\n            verifyDownEventObtained(coordinates, precision)\n        }\n\n        it(\"should obtain an up-event\") {\n            val coordinates = fancyCoordinates()\n            val precision = fancyPrecision()\n\n            uut().createEventsSeq(coordinates, precision)\n\n            verifyUpEventObtained(coordinates)\n        }\n\n        it(\"should obtain up event with a reasonable time-gap (30ms)\") {\n            val expectedUpEventTime = DEFAULT_EVENT_TIME + 30\n            val coordinates = dontCareCoordinates()\n            val precision = dontCarePrecision()\n\n            uut().createEventsSeq(coordinates, precision)\n\n            verifyUpEventObtainedWithTimestamp(expectedUpEventTime)\n        }\n\n        it(\"should return a down-up events sequence\") {\n            val coordinates = dontCareCoordinates()\n            val precision = dontCarePrecision()\n\n            val eventSeq = uut().createEventsSeq(coordinates, precision)\n\n            assertThat(eventSeq).isEqualTo(arrayListOf(downEvent, upEvent))\n        }\n\n        it(\"should allow for an explicit down-time parameter\") {\n            val coordinates = fancyCoordinates()\n            val precision = fancyPrecision()\n            val downTimestamp = 10203040L\n\n            uut().createEventsSeq(coordinates, precision, downTimestamp, null)\n\n            verifyDownEventObtainedWithDownTimestamp(coordinates, precision, downTimestamp)\n        }\n\n        it(\"should allow for duration to be set\") {\n            val duration = 1000L\n            val expectedUpEventTime = DEFAULT_EVENT_TIME + duration\n            val coordinates = dontCareCoordinates()\n            val precision = dontCarePrecision()\n\n            uut().createEventsSeq(coordinates, precision, null, duration)\n\n            verifyDownEventObtainedWithDownTimestamp(coordinates, precision, null)\n            verifyUpEventObtainedWithTimestamp(expectedUpEventTime)\n        }\n\n        it(\"should allow for down-time and duration to be null\") {\n            val coordinates = dontCareCoordinates()\n            val precision = dontCarePrecision()\n\n            uut().createEventsSeq(coordinates, precision, null, null)\n\n            verifyDownEventObtainedWithDownTimestamp(coordinates, precision, null)\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/common/UIExtensionsTest.kt",
    "content": "package com.wix.detox.common\n\nimport android.view.View\nimport android.view.ViewGroup\nimport android.widget.TextView\nimport com.wix.detox.UTHelpers.mockViewHierarchy\nimport com.wix.detox.reactnative.ReactNativeInfo\nimport com.wix.detox.reactnative.ui.getAccessibilityLabel\nimport org.assertj.core.api.Assertions\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.whenever\nimport org.robolectric.RobolectricTestRunner\n\n@RunWith(RobolectricTestRunner::class)\nclass UIExtensionsTest {\n    private val alwaysReactNativeObjFn: (Any) -> Boolean = { true }\n    private val neverReactNativeObjFn: (Any) -> Boolean = { false }\n\n    private fun withContentDescription(value: String, v: View) { whenever(v.contentDescription).doReturn(value) }\n    private fun withText(value: String, v: TextView) { whenever(v.text).doReturn(value) }\n\n    @Test\n    fun `should return accessibility label according to content-description`() {\n        val view: View = mock()\n\n        val contentDescription = \"content-description-mock\"\n        withContentDescription(contentDescription, view)\n\n        val label = view.getAccessibilityLabel()\n        Assertions.assertThat(label).isEqualTo(contentDescription)\n    }\n\n    @Test\n    fun `should return accessibility label according to children's content-description, recursively`() {\n        val contentDescription1st = \"cd.1\"\n        val contentDescription2nd = \"cd.2\"\n        val expectedLabel =\n            if (ReactNativeInfo.rnVersion().minor >= 81) \"$contentDescription1st, $contentDescription2nd\" else \"$contentDescription1st $contentDescription2nd\"\n\n\n        val parent: ViewGroup = mock()\n        val sibling1: ViewGroup = mock()\n        val sibling2: ViewGroup = mock<ViewGroup>().also {\n            withContentDescription(contentDescription2nd, it)\n        }\n        val grandchild: View = mock<View>().also {\n            withContentDescription(contentDescription1st, it)\n        }\n\n        mockViewHierarchy(parent, sibling1, sibling2)\n        mockViewHierarchy(sibling1, grandchild)\n\n        val label = parent.getAccessibilityLabel(alwaysReactNativeObjFn)\n        Assertions.assertThat(label).isEqualTo(expectedLabel)\n    }\n\n    @Test\n    fun `should return accessibility label according to children's text, on top of label`() {\n        val text = \"some mocked text\"\n\n        val parent: ViewGroup = mock()\n        val grandchild: TextView = mock<TextView>().also {\n            withText(text, it)\n        }\n        mockViewHierarchy(parent, grandchild)\n\n        val label = parent.getAccessibilityLabel(alwaysReactNativeObjFn)\n        Assertions.assertThat(label).isEqualTo(text)\n    }\n\n    @Test\n    fun `should not return accessibility label if content description not set in view nor its descendants`() {\n        val parent: ViewGroup = mock()\n        val child: View = mock()\n\n        mockViewHierarchy(parent, child)\n\n        val label = parent.getAccessibilityLabel(alwaysReactNativeObjFn)\n        Assertions.assertThat(label).isNull()\n    }\n\n    @Test\n    fun `should not return accessibility label based on children for non-RN views`() {\n        val childContentDescription = \"content-description-mock\"\n\n        val parent: ViewGroup = mock()\n        val child: View = mock<View>().also {\n            withContentDescription(childContentDescription, it)\n        }\n        mockViewHierarchy(parent, child)\n\n        val label = parent.getAccessibilityLabel(neverReactNativeObjFn)\n        Assertions.assertThat(label).isNull()\n    }\n\n    @Test\n    fun `should return accessibility label for non-RN views`() {\n        val view: View = mock()\n\n        val contentDescription = \"content-description-mock\"\n        withContentDescription(contentDescription, view)\n\n        val label = view.getAccessibilityLabel(neverReactNativeObjFn)\n        Assertions.assertThat(label).isEqualTo(contentDescription)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/common/collect/PairsIteratorSpec.kt",
    "content": "package com.wix.detox.common.collect\n\nimport org.assertj.core.api.Assertions.assertThat\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport kotlin.test.assertFailsWith\n\nobject PairsIteratorSpec: Spek({\n    describe(\"Pairs iterator\") {\n        it(\"should be sane about empty lists\") {\n            val uut = PairsIterator(emptyList<Any>())\n            assertThat(uut.hasNext()).isFalse()\n\n            assertFailsWith(Exception::class) {\n                assertThat(uut.next())\n            }\n        }\n\n        it(\"should be sane about 2-item lists\") {\n            val uut = PairsIterator(listOf(\"first\", \"second\"))\n            assertThat(uut.hasNext()).isTrue()\n            assertThat(uut.next()).isEqualTo(Pair(\"first\", \"second\"))\n        }\n\n        it(\"should throw if iterating onto an uneven size\") {\n            val uut = PairsIterator(listOf(\"first\", \"second\", \"third\"))\n            uut.next()\n\n            assertThat(uut.hasNext()).isTrue()\n            assertFailsWith(IllegalStateException::class) {\n                uut.next()\n            }\n        }\n\n        it(\"should init using an explicit iterator\") {\n            val uut = PairsIterator(emptyList<Any>().iterator())\n            assertThat(uut.hasNext()).isFalse()\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/common/proxy/MethodsSpySpec.kt",
    "content": "package com.wix.detox.common.proxy\n\nimport org.assertj.core.api.Assertions.assertThat\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport java.util.*\n\nobject MethodsSpySpec: Spek({\n    describe(\"Method-calls spy\") {\n\n        val defaultMethodName = \"mockMethod\"\n\n        lateinit var uut: MethodsSpy\n\n        beforeEachTest {\n            uut = MethodsSpy(\"uut\")\n        }\n\n        fun assertHistory(methodName: String = defaultMethodName): Queue<CallInfo> {\n            val history = uut.getHistory(methodName)\n            assertThat(history).isNotNull\n            return history!!\n        }\n\n        fun triggerOpenMethodCall(methodName: String = defaultMethodName) {\n            uut.onBeforeCall(methodName)\n        }\n\n        fun triggerMethodCall(methodName: String = defaultMethodName) {\n            uut.onBeforeCall(methodName)\n            uut.onAfterCall(methodName)\n        }\n\n        fun assertMethodCall(callInfo: CallInfo?, expectedInTimeAbove: Long, expectedOutTimeAbove: Long) {\n            assertThat(callInfo).isNotNull\n            assertThat(callInfo!!.inTime).isGreaterThanOrEqualTo(expectedInTimeAbove)\n            assertThat(callInfo!!.outTime).isGreaterThanOrEqualTo(expectedOutTimeAbove)\n        }\n\n        fun assertMethodCallOpen(callInfo: CallInfo?, expectedInTimeAbove: Long) {\n            assertThat(callInfo).isNotNull\n            assertThat(callInfo!!.inTime).isGreaterThanOrEqualTo(expectedInTimeAbove)\n            assertThat(callInfo!!.outTime).isNull()\n        }\n\n        fun assertLastMethodCallOpen(methodName: String = defaultMethodName, expectedInTimeAbove: Long) {\n            val history = assertHistory(methodName)\n            assertMethodCallOpen(history.peek(), expectedInTimeAbove)\n        }\n\n        fun assertLastMethodCall(methodName: String = defaultMethodName, expectedInTimeAbove: Long, expectedOutTimeAbove: Long) {\n            val history = assertHistory(methodName)\n            assertMethodCall(history.peek(), expectedInTimeAbove, expectedOutTimeAbove)\n        }\n\n        fun assertCollectedCallCount(methodName: String = defaultMethodName, count: Int) {\n            val history = assertHistory(methodName)\n            assertThat(history.size).isEqualTo(count)\n        }\n\n        it(\"should handle an empty spy\") {\n            assertThat(uut.getHistory(\"nonExistMethod\")).isNull()\n        }\n\n        it(\"should spy on a method call, before calling it\") {\n            val beforeTimeRef = System.currentTimeMillis()\n\n            uut.start()\n            triggerOpenMethodCall()\n\n            assertLastMethodCallOpen(expectedInTimeAbove = beforeTimeRef)\n        }\n\n        it(\"should spy on a method call, after call completes\") {\n            val beforeTimeRef = System.currentTimeMillis()\n            val afterTimeRef = System.currentTimeMillis()\n\n            uut.start()\n            triggerMethodCall()\n\n            assertLastMethodCall(expectedInTimeAbove =  beforeTimeRef, expectedOutTimeAbove = afterTimeRef)\n        }\n\n        it(\"should spy on multiple calls, in order of: lower-index <=> newer-call\") {\n            uut.start()\n\n            val timeRef1 = System.currentTimeMillis()\n            triggerMethodCall()\n\n            Thread.sleep(100)\n\n            val timeRef2 = System.currentTimeMillis()\n            triggerMethodCall()\n\n            val history = assertHistory()\n            assertCollectedCallCount(count = 2)\n            assertMethodCall(history.elementAt(0), timeRef2, timeRef2)\n            assertMethodCall(history.elementAt(1), timeRef1, timeRef1)\n        }\n\n        it(\"should not spy if stopped\") {\n            uut.start()\n            triggerMethodCall()\n\n            uut.stop()\n            triggerMethodCall()\n\n            assertCollectedCallCount(count = 1)\n        }\n\n        it(\"should resume spying\") {\n            triggerMethodCall()\n\n            uut.start()\n            triggerMethodCall()\n            assertCollectedCallCount(count = 1)\n        }\n\n        it(\"should reset calls when started\") {\n            uut.start()\n            triggerMethodCall()\n            triggerMethodCall()\n            uut.stop()\n\n            uut.start()\n            triggerMethodCall()\n            assertCollectedCallCount(count = 1)\n        }\n\n        it(\"should spy methods distinctively\") {\n            uut.start()\n            triggerMethodCall(\"method1\")\n            triggerMethodCall(\"method2\")\n            triggerMethodCall(\"method2\")\n            uut.stop()\n\n            assertCollectedCallCount(\"method1\", 1)\n            assertCollectedCallCount(\"method2\", 2)\n        }\n\n        it(\"should allow for simple delta-time calculation\") {\n            uut.start()\n            triggerMethodCall()\n            Thread.sleep(10)\n            triggerMethodCall()\n\n            val history = assertHistory()\n            val newerCall = history.elementAt(0)\n            val olderCall = history.elementAt(1)\n            val delta = newerCall - olderCall\n            assertThat(delta).isGreaterThanOrEqualTo(10)\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/action/DetoxCustomTapperSpec.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.MotionEvent\nimport androidx.test.espresso.UiController\nimport androidx.test.espresso.action.Tapper\nimport com.wix.detox.common.DetoxLog\nimport com.wix.detox.common.proxy.CallInfo\nimport com.wix.detox.espresso.UiControllerSpy\nimport com.wix.detox.espresso.action.common.TapEvents\nimport org.assertj.core.api.Assertions.assertThat\nimport org.mockito.kotlin.*\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport java.lang.NullPointerException\nimport kotlin.test.assertFailsWith\n\nobject DetoxCustomTapperSpec: Spek({\n    describe(\"Detox custom-tapper replacement for Espresso\") {\n\n        val coolDownTimeMs = 111L\n        val interTapsDelayMs = 667L\n        val longTapMinTimeMs = 333L\n        val coordinates = FloatArray(2) { 1f }\n        val precision = FloatArray(2) { 2f }\n\n        lateinit var uiController: UiController\n        lateinit var mock1stTapEventsSeq: List<MotionEvent>\n        lateinit var mock2ndTapEventsSeq: List<MotionEvent>\n        lateinit var tapEvents: TapEvents\n        lateinit var uiControllerCallSpy: UiControllerSpy\n        lateinit var log: DetoxLog\n\n        beforeEachTest {\n            uiController = mock()\n\n            val downEvent: MotionEvent = mock(name = \"mockSeq1Event1\")\n            val upEvent: MotionEvent = mock(name = \"mockSeq1Event2\") {\n                on { eventTime }.thenReturn(6000)\n            }\n\n            mock1stTapEventsSeq = arrayListOf(downEvent, upEvent)\n            mock2ndTapEventsSeq = arrayListOf(mock(name = \"mockSeq2Event1\"), mock(name = \"mockSeq2Event2\"))\n            tapEvents = mock {\n                on { createEventsSeq(any(), any(), isNull(), isNull()) }.doReturn(mock1stTapEventsSeq)\n                on { createEventsSeq(any(), any(), isNull(), any()) }.doReturn(mock1stTapEventsSeq)\n                on { createEventsSeq(any(), any(), any(), isNull()) }.doReturn(mock2ndTapEventsSeq)\n                on { createEventsSeq(any(), any(), any(), any()) }.doReturn(mock2ndTapEventsSeq)\n            }\n\n            uiControllerCallSpy = mock() {\n                on { eventInjectionsIterator() }.doReturn(emptyList<CallInfo?>().iterator())\n            }\n\n            log = mock()\n        }\n\n        fun verify1stTapEventsSeqGenerated(duration: Long? = null) = verify(tapEvents).createEventsSeq(eq(coordinates), eq(precision), isNull(), eq(duration))\n        fun verify2ndTapEventsSeqGenerated() = verify(tapEvents).createEventsSeq(eq(coordinates), eq(precision), isNull(), isNull())\n        fun verify2ndTapEventsGenerateWithTimestamp(downTimestamp: Long) = verify(tapEvents).createEventsSeq(eq(coordinates), eq(precision), eq(downTimestamp), isNull())\n\n        fun verifyAllTapEventsInjected() = verify(uiController).injectMotionEventSequence(arrayListOf(mock1stTapEventsSeq, mock2ndTapEventsSeq).flatten())\n        fun verifyMainThreadSynced() = verify(uiController).loopMainThreadForAtLeast(eq(coolDownTimeMs))\n        fun verifyMainThreadNeverSynced() = verify(uiController, never()).loopMainThreadForAtLeast(any())\n\n        fun givenInjectionSuccess() = whenever(uiController.injectMotionEventSequence(any())).thenReturn(true)\n        fun givenInjectionFailure() = whenever(uiController.injectMotionEventSequence(any())).thenReturn(false)\n        fun givenInjectionError() = whenever(uiController.injectMotionEventSequence(any())).doThrow(RuntimeException(\"exceptionMock\"))\n\n        fun givenInjectionCallsHistory(injectionsHistory: List<CallInfo?>) =\n            whenever(uiControllerCallSpy.eventInjectionsIterator()).thenReturn(injectionsHistory.iterator())\n\n        fun uut(times: Int, duration: Long? = null) =\n            DetoxCustomTapper(times, interTapsDelayMs, coolDownTimeMs, longTapMinTimeMs, tapEvents, uiControllerCallSpy, log, duration)\n\n        fun sendOneTap(duration: Long? = null) = uut(1, duration).sendTap(uiController, coordinates, precision, -1, -1)\n        fun sendTwoTaps(uut: DetoxCustomTapper = uut(2)) = uut.sendTap(uiController, coordinates, precision, -1, -1)\n\n        it(\"should generate a single-tap events sequence using tap-events helper\") {\n            sendOneTap()\n            verify1stTapEventsSeqGenerated()\n        }\n\n        it(\"should generate a single-tap events sequence with a custom duration\") {\n            sendOneTap(1000L)\n            verify1stTapEventsSeqGenerated(1000L)\n        }\n\n        it(\"should generate multiple sets of single-tap event sequences using tap-events helper\") {\n            sendTwoTaps()\n            verify1stTapEventsSeqGenerated()\n            verify2ndTapEventsSeqGenerated()\n        }\n\n        it(\"should generate 2nd event sequence with proper down-event timestamp\") {\n            val expectedDownTimestamp = mock1stTapEventsSeq.last().eventTime + interTapsDelayMs\n            sendTwoTaps()\n            verify2ndTapEventsGenerateWithTimestamp(expectedDownTimestamp)\n        }\n\n        it(\"should inject the events sequence\") {\n            sendTwoTaps()\n            verifyAllTapEventsInjected()\n        }\n\n        it(\"should recycle tap events\") {\n            sendTwoTaps()\n            verify(mock1stTapEventsSeq.first()).recycle()\n            verify(mock2ndTapEventsSeq.last()).recycle()\n        }\n\n        it(\"should recycle events even if ui-controller throws\") {\n            givenInjectionError()\n\n            assertFailsWith<RuntimeException> {\n                sendTwoTaps()\n            }\n            verify(mock2ndTapEventsSeq.last()).recycle()\n        }\n\n        it(\"should return failure if ui-controller fails\") {\n            givenInjectionFailure()\n            val result = sendOneTap()\n            assertThat(result).isEqualTo(Tapper.Status.FAILURE)\n        }\n\n        it(\"should return success\") {\n            givenInjectionSuccess()\n            val result = sendOneTap()\n            assertThat(result).isEqualTo(Tapper.Status.SUCCESS)\n        }\n\n        it(\"should manage without inputDevice and buttonState args\") {\n            uut(2).sendTap(uiController, coordinates, precision)\n            verifyAllTapEventsInjected()\n        }\n\n        it(\"should post idle-wait the cool-down period following a successful tap injection\") {\n            givenInjectionSuccess()\n            sendOneTap()\n            verifyMainThreadSynced()\n        }\n\n        it(\"should not post idle-wait if tap injection fails\") {\n            givenInjectionFailure()\n            sendOneTap()\n            verifyMainThreadNeverSynced()\n        }\n\n        it(\"should throw if no UI-controller provided\") {\n            assertFailsWith(NullPointerException::class) {\n                uut(1).sendTap(null, coordinates, precision, -1, -1)\n            }\n        }\n\n        it(\"should throw if no coordinates / precision are provided\") {\n            assertFailsWith(NullPointerException::class) {\n                uut(1).sendTap(uiController, null, precision, -1, -1)\n            }\n\n            assertFailsWith(NullPointerException::class) {\n                uut(1).sendTap(uiController, coordinates, null, -1, -1)\n            }\n        }\n\n        it(\"should start ui-controller spy before injecting events\") {\n            sendOneTap()\n\n            inOrder(uiControllerCallSpy, uiController) {\n                verify(uiControllerCallSpy).start()\n                verify(uiController).injectMotionEventSequence(any())\n            }\n        }\n\n        it(\"should stop ui-controller spy after injecting events\") {\n            givenInjectionSuccess()\n\n            sendOneTap()\n            inOrder(uiControllerCallSpy, uiController) {\n                verify(uiController).injectMotionEventSequence(any())\n                verify(uiControllerCallSpy).stop()\n            }\n        }\n\n        it(\"should stop ui-controller spy after injecting events even if injection fails\") {\n            givenInjectionFailure()\n\n            sendOneTap()\n            verify(uiControllerCallSpy).stop()\n        }\n\n        it(\"should stop ui-controller spy after injecting events even if injection crashes\") {\n            givenInjectionError()\n\n            try {\n                sendOneTap()\n            } catch (e: Exception) {}\n            verify(uiControllerCallSpy).stop()\n        }\n\n        it(\"should warn if ui-controller spy indicates tap has turned into a long-tap\") {\n            givenInjectionSuccess()\n\n            val injectionsHistory = listOf(\n                    CallInfo(longTapMinTimeMs - 1, longTapMinTimeMs),\n                    CallInfo(0, 1)\n            )\n            givenInjectionCallsHistory(injectionsHistory)\n\n            sendOneTap()\n            verify(log).warn(\"Detox\", \"Tap handled too slowly, and turned into a long-tap!\")\n        }\n\n        it(\"should warn if ui-controller spy indicates tap 1 of 2 has turned into a long-tap\") {\n            givenInjectionSuccess()\n\n            val injectionsHistory = listOf(\n                    CallInfo(longTapMinTimeMs + 10, longTapMinTimeMs + 11), CallInfo(10, 11),\n                    CallInfo(6, 10), CallInfo(0, 5)\n            )\n            givenInjectionCallsHistory(injectionsHistory)\n\n            sendOneTap()\n            verify(log, times(1)).warn(\"Detox\", \"Tap handled too slowly, and turned into a long-tap!\")\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/action/GetAttributesActionTest.kt",
    "content": "package com.wix.detox.espresso.action\n\nimport android.view.View\nimport android.widget.CheckBox\nimport android.widget.ProgressBar\nimport android.widget.TextView\nimport com.google.android.material.slider.Slider\nimport com.wix.detox.reactnative.ui.getAccessibilityLabel\nimport org.assertj.core.api.Assertions.assertThat\nimport org.json.JSONObject\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.any\nimport org.mockito.kotlin.doAnswer\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.whenever\nimport org.robolectric.RobolectricTestRunner\n\n@RunWith(RobolectricTestRunner::class)\nclass GetAttributesActionTest {\n    lateinit var view: View\n    lateinit var uut: GetAttributesAction\n\n    @Before\n    fun setup() {\n        view = mock()\n        uut = GetAttributesAction()\n    }\n\n    private fun givenViewTag(value: Any?) { whenever(view.tag).doReturn(value) }\n    private fun givenNoViewTag() = givenViewTag(null)\n    private fun givenVisibility(value: Int) { whenever(view.visibility).doReturn(value) }\n    private fun givenVisibilityRectAvailability(value: Boolean) { whenever(view.getLocalVisibleRect(any())).doReturn(value) }\n    private fun givenAccessibilityLabel(value: String) { whenever(view.getAccessibilityLabel()).doReturn(value) }\n\n    private fun perform(v: View = view): JSONObject {\n        uut.perform(null, v)\n        return uut.getResult()!!\n    }\n\n    @Test\n    fun `should declare non-null view constraint`() {\n        assertThat(uut.constraints.matches(null)).isFalse()\n        assertThat(uut.constraints.matches(view)).isTrue()\n        assertThat(uut.constraints.matches(1)).isFalse()\n    }\n\n    @Test\n    fun `should return view-tag as ID attribute`() {\n        val testId = \"mock-test-ID\"\n        givenViewTag(testId)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"identifier\")).isEqualTo(testId)\n    }\n\n    @Test\n    fun `should not return ID if view has no tag`() {\n        givenNoViewTag()\n\n        val resultJson = perform()\n        assertThat(resultJson.has(\"identifier\")).isFalse()\n    }\n\n    @Test\n    fun `should stringify non-text tags set on view`() {\n        givenViewTag(1234)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"identifier\")).isEqualTo(\"1234\")\n    }\n\n    @Test\n    fun `should return visibility attributes for a logically visible view`() {\n        givenVisibility(View.VISIBLE)\n        givenVisibilityRectAvailability(false)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"visibility\")).isEqualTo(\"visible\")\n        assertThat(resultJson.opt(\"visible\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return visibility attributes for an effectively visible view`() {\n        givenVisibility(View.VISIBLE)\n        givenVisibilityRectAvailability(true)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"visibility\")).isEqualTo(\"visible\")\n        assertThat(resultJson.opt(\"visible\")).isEqualTo(true)\n    }\n\n    @Test\n    fun `should return visibility attributes for an invisible view`() {\n        givenVisibility(View.INVISIBLE)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"visibility\")).isEqualTo(\"invisible\")\n        assertThat(resultJson.opt(\"visible\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return visibility attributes for view that is gone`() {\n        givenVisibility(View.GONE)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"visibility\")).isEqualTo(\"gone\")\n        assertThat(resultJson.opt(\"visible\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return label according to accessibilityLabel extension`() {\n        val accessibilityLabel = \"label-mock\"\n        givenAccessibilityLabel(accessibilityLabel)\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"label\")).isEqualTo(accessibilityLabel)\n    }\n\n    @Test\n    fun `should not return label if accessibility label is not available`() {\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"label\")).isNull()\n    }\n\n    @Test\n    fun `should return common values`() {\n        view = mock {\n            on { alpha } doReturn 0.42f\n            on { width } doReturn 123\n            on { height } doReturn 456\n            on { elevation } doReturn 0.314f\n        }\n\n        doAnswer { invocation ->\n            val location = invocation.getArgument<IntArray>(0)\n            location[0] = 10\n            location[1] = 20\n        }.whenever(view).getLocationOnScreen(any())\n\n        val resultJson = perform()\n        assertThat(resultJson.opt(\"alpha\")).isEqualTo(0.42f)\n        assertThat(resultJson.opt(\"width\")).isEqualTo(123)\n        assertThat(resultJson.opt(\"height\")).isEqualTo(456)\n        assertThat(resultJson.opt(\"elevation\")).isEqualTo(0.314f)\n        assertThat(resultJson.optJSONObject(\"frame\")?.opt(\"x\")).isEqualTo(10)\n        assertThat(resultJson.optJSONObject(\"frame\")?.opt(\"y\")).isEqualTo(20)\n        assertThat(resultJson.optJSONObject(\"frame\")?.opt(\"width\")).isEqualTo(123)\n        assertThat(resultJson.optJSONObject(\"frame\")?.opt(\"height\")).isEqualTo(456)\n    }\n\n    @Test\n    fun `should return enable and disabled states`() {\n        val enabledView: View = mock {\n            on { isEnabled } doReturn true\n        }\n        val disabledView: View = mock {\n            on { isEnabled } doReturn false\n        }\n\n        assertThat(perform(enabledView).opt(\"enabled\")).isEqualTo(true)\n        assertThat(perform(disabledView).opt(\"enabled\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return whether focused or blurred`() {\n        val focusedView: View = mock {\n            on { isFocused } doReturn true\n        }\n        val blurredView: View = mock {\n            on { isFocused } doReturn false\n        }\n\n        assertThat(perform(focusedView).opt(\"focused\")).isEqualTo(true)\n        assertThat(perform(blurredView).opt(\"focused\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return check-box state via value attribute`() {\n        val checkedCheckBox: CheckBox = mock {\n            on { isChecked } doReturn true\n        }\n        val uncheckedCheckBox: CheckBox = mock {\n            on { isChecked } doReturn false\n        }\n\n        assertThat(perform(checkedCheckBox).opt(\"value\")).isEqualTo(true)\n        assertThat(perform(uncheckedCheckBox).opt(\"value\")).isEqualTo(false)\n    }\n\n    @Test\n    fun `should return raw ProgressBar or SeekBar 'progress' via value attribute`() {\n        val progressBar: ProgressBar = mock {\n            on { progress } doReturn 42\n        }\n\n        val resultJson = perform(progressBar)\n        assertThat(resultJson.opt(\"value\")).isEqualTo(42)\n    }\n\n    //FIXME: Complete the integration over RN72 or delete this test\n/*    @Test\n    fun `should return RN-Slider via value attribute`() {\n        val progressBar: ReactSlider = mock {\n            on { max } doReturn 100\n            on { progress } doReturn 50\n        }\n\n        val resultJson = perform(progressBar)\n        assertThat(resultJson.opt(\"value\")).isEqualTo(0.5)\n    }*/\n\n    @Test\n    fun `should return material-Slider state through value attribute`() {\n        val slider: Slider = mock {\n            on { value } doReturn 0.42f\n        }\n\n        val resultJson = perform(slider)\n        android.util.Log.i(\"TESTS\", \"should return material-Slider state through value attribute: \"+ resultJson)\n        assertThat(resultJson.opt(\"value\")).isEqualTo(0.42f)\n    }\n\n    @Test\n    fun `should return text attributes for a TextView`() {\n        val textView: TextView = mock {\n            on { text } doReturn \"mock-text\"\n            on { textSize } doReturn 24f\n            on { length() } doReturn 111\n        }\n\n        val resultJson = perform(textView)\n        assertThat(resultJson.opt(\"text\")).isEqualTo(\"mock-text\")\n        assertThat(resultJson.opt(\"textSize\")).isEqualTo(24f)\n        assertThat(resultJson.opt(\"length\")).isEqualTo(111)\n    }\n\n    @Test\n    fun `should not return text attributes for a text-less TextView`() {\n        val textView: TextView = mock {\n            on { text } doReturn null\n            on { length() } doReturn 0\n        }\n\n        val resultJson = perform(textView)\n        assertThat(resultJson.has(\"text\")).isFalse()\n        assertThat(resultJson.has(\"length\")).isFalse()\n    }\n\n    @Test\n    fun `should return text hint via 'placeholder' attribute, if applicable`() {\n        val textViewWithHint: TextView = mock {\n            on { hint } doReturn \"hint-text-mock\"\n        }\n        val textView: TextView = mock {\n            on { hint } doReturn null\n        }\n\n        assertThat(perform(textViewWithHint).opt(\"placeholder\")).isEqualTo(\"hint-text-mock\")\n        assertThat(perform(textView).has(\"placeholder\")).isFalse()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt",
    "content": "package com.wix.detox.espresso.common\n\nimport android.view.View\nimport com.google.android.material.slider.Slider\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.robolectric.RobolectricTestRunner\n\n@RunWith(RobolectricTestRunner::class)\nclass MaterialSliderHelperTest {\n    @Test\n    fun `should return value if view is a slider`() {\n        val slider: Slider = mock {\n            on { value } doReturn 0.2f\n        }\n\n        val uut = MaterialSliderHelper(slider)\n\n        assertThat(uut.getValueIfSlider()).isEqualTo(0.2f)\n    }\n\n    @Test\n    fun `should return null if view is not a slider`() {\n        val view: View = mock()\n\n        val uut = MaterialSliderHelper(view)\n\n        assertThat(uut.getValueIfSlider()).isNull()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/ReactSliderHelperTest.kt",
    "content": "package com.wix.detox.espresso.common\n\n//import com.facebook.react.views.slider.ReactSlider\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.whenever\nimport org.robolectric.RobolectricTestRunner\n\n/**\n * Note: This only tests against the react *legacy* (non-community) slider in order\n * to avoid having to install the community slider under node_modules just for this.\n */\n\n// FIXME: RN72 upgrade - this test is broken\n//@RunWith(RobolectricTestRunner::class)\n//class ReactSliderHelperTest {\n//    lateinit var slider: ReactSlider\n//    lateinit var uut: ReactSliderHelper\n//\n//    @Before\n//    fun setup() {\n//        slider = mock()\n//        uut = ReactSliderHelper.create(slider)\n//    }\n//\n//    private fun givenNativeProgressTraits(current: Int, max: Int) {\n//        whenever(slider.progress).doReturn(current)\n//        whenever(slider.max).doReturn(max)\n//    }\n//\n//    @Test\n//    fun `should properly calculate current progress, in percentage`() {\n//        givenNativeProgressTraits(current = 20, max = 100)\n//\n//        assertThat(uut.getCurrentProgressPct()).isEqualTo(0.2)\n//    }\n//}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/errors/DetoxExceptionUtilsTest.kt",
    "content": "package com.wix.detox.espresso.errors\n\nimport org.assertj.core.api.Assertions\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.RobolectricTestRunner\n\n@RunWith(RobolectricTestRunner::class)\nclass DetoxExceptionUtilsTest {\n\n    @Test\n    fun `should clean espresso message by removing view hierarchy`() {\n        val originalMessage = \"\"\"androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (an instance of android.widget.TextView and view.getText() with or without transformation to match: is \"supercalifragilisticexpialidocious\" and view has effective visibility <VISIBLE>)\n\nView Hierarchy:\n+>DecorView{id=-1, visibility=VISIBLE, width=1080, height=2400, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params={(0,0)(fillxfill) sim={adjust=resize} ty=BASE_APPLICATION wanim=0x1030309\n  fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDS\n  pfl=NO_MOVE_ANIMATION EDGE_TO_EDGE_ENFORCED FORCE_DRAW_STATUS_BAR_BACKGROUND FIT_INSETS_CONTROLLED\n  bhv=DEFAULT\n  fitSides=\n  frameRateBoostOnTouch=true\n  dvrrWindowFrameRateHint=true}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\"\"\"\n\n        val cleanedMessage = DetoxExceptionUtils.cleanEspressoMessage(originalMessage)\n\n        val expectedMessage = \"\"\"androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (an instance of android.widget.TextView and view.getText() with or without transformation to match: is \"supercalifragilisticexpialidocious\" and view has effective visibility <VISIBLE>)\"\"\"\n\n        Assertions.assertThat(cleanedMessage).isEqualTo(expectedMessage)\n    }\n\n    @Test\n    fun `should handle null message`() {\n        val cleanedMessage = DetoxExceptionUtils.cleanEspressoMessage(null)\n        Assertions.assertThat(cleanedMessage).isEqualTo(\"\")\n    }\n\n    @Test\n    fun `should handle empty message`() {\n        val cleanedMessage = DetoxExceptionUtils.cleanEspressoMessage(\"\")\n        Assertions.assertThat(cleanedMessage).isEqualTo(\"\")\n    }\n\n    @Test\n    fun `should handle message without view hierarchy`() {\n        val message = \"Simple error message without view hierarchy\"\n        val cleanedMessage = DetoxExceptionUtils.cleanEspressoMessage(message)\n        Assertions.assertThat(cleanedMessage).isEqualTo(message)\n    }\n\n    @Test\n    fun `should trim whitespace`() {\n        val message = \"  Error message with whitespace  \"\n        val cleanedMessage = DetoxExceptionUtils.cleanEspressoMessage(message)\n        Assertions.assertThat(cleanedMessage).isEqualTo(\"Error message with whitespace\")\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/matcher/RegexMatcherTest.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport org.junit.Test\nimport kotlin.test.assertFalse\nimport kotlin.test.assertTrue\n\nclass RegexMatcherTest {\n    @Test\n    fun `should work with string matching regex`() {\n        val input = \"Hello, world!\"\n        val regex = \"/[A-Z][a-z]+, world!/\"\n        assertTrue(input.matchesJSRegex(regex))\n    }\n\n    @Test\n    fun `should work with string not matching regex`() {\n        val input = \"Hello, world!\"\n        val regex = \"/[A-Z]+, world!/\"\n        assertFalse(input.matchesJSRegex(regex))\n    }\n\n    @Test\n    fun `should work with the 'i' flag`() {\n        val input = \"Hello, world!\"\n        val regex = \"/[A-Z]+, woRlD!/i\"\n        assertTrue(input.matchesJSRegex(regex))\n    }\n\n    @Test\n    fun `should work with the 's' flag`() {\n        val input = \"Hello,\\nworld!\"\n        val regex = \"/Hello,\\\\sworld!/s\"\n        assertTrue(input.matchesJSRegex(regex))\n    }\n\n    @Test\n    fun `should work with the 'm' flag`() {\n        val input = \"Hello,\\nworld!\"\n        val regex = \"/^Hello,\\\\s.*!$/m\"\n        assertTrue(input.matchesJSRegex(regex))\n    }\n\n    @Test\n    fun `should work with multiple flags, ignore casing`() {\n        val input = \"Hello,\\nworld!\"\n        val regex = \"/^heLLo,\\\\swOrld!/ISM\"\n        assertTrue(input.matchesJSRegex(regex))\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/matcher/ViewAtIndexMatcherSpec.kt",
    "content": "package com.wix.detox.espresso.matcher\n\nimport android.view.View\nimport org.hamcrest.Description\nimport org.hamcrest.Matcher\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.verify\nimport org.mockito.kotlin.whenever\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nobject ViewAtIndexMatcherSpec: Spek({\n    describe(\"atIndex view-matcher\") {\n\n        lateinit var innerMatcher: Matcher<View>\n        lateinit var description: Description\n        beforeEachTest {\n            innerMatcher = mock()\n            whenever(innerMatcher.toString()).thenReturn(\"(innerMatcher description)\")\n\n            description = mock()\n        }\n\n        describe(\"describeTo\") {\n            it(\"should append a valid description for index 0\") {\n                val uut = ViewAtIndexMatcher(0, innerMatcher)\n                uut.describeTo(description)\n                verify(description).appendText(\"View at index #0, of those matching MATCHER(innerMatcher description)\")\n            }\n\n            it(\"should append a valid description for index≥0\") {\n                val uut = ViewAtIndexMatcher(7, innerMatcher)\n                uut.describeTo(description)\n                verify(description).appendText(\"View at index #7, of those matching MATCHER(innerMatcher description)\")\n            }\n        }\n    }\n});\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/performer/ViewActionPerformerSpec.kt",
    "content": "package com.wix.detox.espresso.performer\n\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport androidx.test.espresso.ViewAction\nimport com.wix.detox.espresso.MultipleViewsAction\nimport org.hamcrest.Matcher\nimport org.mockito.Mockito.*\nimport org.mockito.kotlin.mock\n\nobject ViewActionPerformerSpec : Spek({\n\n    describe(\"ViewActionPerformer\") {\n        context(\"forAction\") {\n            context(\"given a regular ViewAction\") {\n                val action = mock(ViewAction::class.java)\n\n                it(\"should return a SingleViewActionPerformer\") {\n                    val performer = ViewActionPerformer.forAction(action)\n                    assert(performer is SingleViewActionPerformer)\n                }\n            }\n\n            context(\"given a MultipleViewsAction\") {\n                val multipleViewsAction: ViewAction = mock(\n                    ViewAction::class.java,\n                    withSettings().extraInterfaces(MultipleViewsAction::class.java)\n                )\n\n                it(\"should return a MultipleViewsActionPerformer\") {\n                    val performer = ViewActionPerformer.forAction(multipleViewsAction)\n                    assert(performer is MultipleViewsActionPerformer)\n                }\n            }\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/registry/BusyResourcesInquirerTest.kt",
    "content": "package com.wix.detox.espresso.registry\n\nimport android.os.Looper\nimport androidx.test.espresso.IdlingResource\nimport androidx.test.espresso.base.IdlingResourceRegistry\nimport com.wix.detox.UTHelpers\nimport com.wix.detox.espresso.common.UiControllerImplReflected\nimport com.wix.detox.inquiry.DetoxBusyResource\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.doAnswer\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.whenever\nimport org.robolectric.Robolectric\nimport org.robolectric.RobolectricTestRunner\nimport org.robolectric.annotation.LooperMode\nimport java.util.concurrent.Executors\n\n@RunWith(RobolectricTestRunner::class)\n// Fixes: Hangs in UIThread.postFirstSync inside IRStatusInquirer.getAllBusyResources when upgrading robolectric 4.3.x -> 4.4\n// See http://robolectric.org/blog/2019/06/04/paused-looper/ (coming from https://github.com/robolectric/robolectric/releases/tag/robolectric-4.4)\n@LooperMode(LooperMode.Mode.LEGACY)\nclass BusyResourcesInquirerTest {\n\n    lateinit var registry: IdlingResourceRegistry\n    lateinit var uiController: UiControllerImplReflected\n    lateinit var uut: BusyResourcesInquirer\n\n    private fun anIdleResource() = mock<IdlingResource> {\n        on { isIdleNow } doReturn true\n    }\n\n    private fun aBusyResource() = mock<IdlingResource> {\n        on { isIdleNow } doReturn false\n    }\n\n    private fun givenIdlingResources(vararg resources: IdlingResource) {\n        whenever(registry.resources).doReturn(resources.asList())\n    }\n\n    private fun givenRunningAsyncTasks() {\n        whenever(uiController.isAsyncIdleNow()).doReturn(false)\n    }\n\n    private fun givenRunningCompatAsyncTasks() {\n        whenever(uiController.isCompatIdleNow()).doReturn(false)\n    }\n\n    @Before\n    fun setup() {\n        registry = mock()\n        uiController = mock() {\n            on { isAsyncIdleNow() } doReturn true\n            on { isCompatIdleNow() } doReturn true\n        }\n        uut = BusyResourcesInquirer(registry, uiController)\n    }\n\n    @Test\n    fun `should return no busy resources if there are no registered resources`() {\n        val result = uut.getAllBusyResources()\n        assertThat(result).isEmpty()\n    }\n\n    @Test\n    fun `should return busy resources if there are some IR ones`() {\n        val resourceIdle = anIdleResource()\n        val resourceBusy = aBusyResource()\n        givenIdlingResources(resourceIdle, resourceBusy)\n\n        val result = uut.getAllBusyResources()\n        assertThat(result.size).isEqualTo(1)\n        assertThat(result[0] is DetoxBusyResource.BusyIdlingResource)\n        assertThat((result[0] as DetoxBusyResource.BusyIdlingResource).resource).isEqualTo(resourceBusy)\n    }\n\n    @Test\n    fun `should return the async-task busy resource if some async-tasks are running`() {\n        givenRunningAsyncTasks()\n\n        val result = uut.getAllBusyResources()\n        assertThat(result.size).isEqualTo(1)\n        assertThat(result[0] is DetoxBusyResource.BusyAsyncTasks)\n    }\n\n    @Test\n    fun `should return the async-task busy resource if some legacy async-tasks are running`() {\n        givenRunningCompatAsyncTasks()\n\n        val result = uut.getAllBusyResources()\n        assertThat(result.size).isEqualTo(1)\n        assertThat(result[0] is DetoxBusyResource.BusyAsyncTasks)\n    }\n\n    @Test\n    fun `should execute busy-resources inquiry on main thread`() {\n        // This is tricky because we actually need to assert two things:\n        // 1. Inquiry takes place on the main thread (i.e. the test-exec thread in robolectric UT's)\n        // 2. getAllBusyResources() actually awaits for the execution to finish.\n        // The trick, then, is to execute uut.getAllBusyResources() on a separate thread, and assert\n        // the resources are queried on the main thread nonetheless + that the *final* result is a real\n        // one (i.e. a non-empty list of IR's).\n\n        val executor = Executors.newSingleThreadExecutor()\n        val resource = mock<IdlingResource> {\n            on { isIdleNow } doAnswer {\n                assertThat(Looper.myLooper()).isEqualTo(Looper.getMainLooper()) // Assert (1)\n                Thread.sleep(10) // Make more certain to fail if inquirer doesn't *wait* for the main thread exec to complete\n                false\n            }\n        }\n        givenIdlingResources(resource)\n\n        var result: List<DetoxBusyResource>? = null\n        executor.execute {\n            result = uut.getAllBusyResources()\n        }\n        Thread.sleep(100L) // Give time for the unit to actually post on the main thread (as it's suppose to...)\n        Robolectric.flushForegroundThreadScheduler()\n        UTHelpers.yieldToOtherThreads(executor)\n\n        assertThat(result).isNotNull\n        assertThat(result!!.size).isEqualTo(1)\n        assertThat(result!![0] is DetoxBusyResource.BusyIdlingResource)\n        assertThat((result!![0] as DetoxBusyResource.BusyIdlingResource).resource).isEqualTo(resource)\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/DetoxSwipeSpec.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport org.mockito.AdditionalMatchers\nimport org.mockito.kotlin.*\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nprivate fun floatEq3(value: Float) = AdditionalMatchers.eq(value, 0.001f)\n\nobject DetoxSwipeSpec: Spek({\n    describe(\"Detox custom swipe\") {\n        val startX = 100f\n        val startY = 200f\n        val endX = 110f\n        val endY = 220f\n\n        lateinit var swiper: DetoxSwiper\n\n        fun uut(motionCount: Int = 1): DetoxSwipe = DetoxSwipe(startX, startY, endX, endY, motionCount, swiper)\n\n        beforeEachTest {\n            swiper = mock {\n                on { moveTo(any(), any()) }.doReturn(true)\n            }\n        }\n\n        it(\"should start at coordinates\") {\n            uut().perform()\n            verify(swiper).startAt(startX, startY)\n        }\n\n        it(\"should move once\") {\n            // start + (end - start) / N\n            //    where N = (motionCount + 2)\n            val expectedX = 103.333f\n            val expectedY = 206.666f\n\n            uut().perform()\n            verify(swiper).moveTo(floatEq3(expectedX), floatEq3(expectedY))\n            verify(swiper, times(1)).moveTo(any(), any())\n        }\n\n        it(\"should finish the swipe sequence\") {\n            uut().perform()\n            verify(swiper).finishAt(endX, endY)\n        }\n\n        it(\"should finish even if motion fails\") {\n            whenever(swiper.moveTo(any(), any())).doThrow(RuntimeException())\n\n            try {\n                uut().perform()\n            } catch (e: Exception) {\n            }\n\n            verify(swiper).finishAt(endX, endY)\n        }\n\n        it(\"should move in sub-steps\") {\n            val motionCount = 2\n            val expectedX1 = 102.5f\n            val expectedY1 = 205f\n            val expectedX2 = 102.5f\n            val expectedY2 = 205f\n\n            uut(motionCount).perform()\n\n            verify(swiper, times(1)).moveTo(eq(expectedX1), eq(expectedY1))\n            verify(swiper, times(1)).moveTo(eq(expectedX2), eq(expectedY2))\n            verify(swiper, times(2)).moveTo(any(), any())\n        }\n\n        it(\"should move in many sub-steps\") {\n            val motionCount = 10\n\n            uut(motionCount).perform()\n\n            verify(swiper, times(motionCount)).moveTo(any(), any())\n        }\n\n        it(\"should stop if motion fails\") {\n            val motionCount = 2\n\n            whenever(swiper.moveTo(any(), any())).doReturn(false)\n\n            uut(motionCount).perform()\n\n            verify(swiper, times(1)).moveTo(any(), any())\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/ScrollHelperTest.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport android.graphics.Insets\nimport android.view.MotionEvent\nimport android.view.View\nimport android.view.WindowInsets\nimport androidx.test.espresso.UiController\nimport androidx.test.platform.app.InstrumentationRegistry\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport com.wix.detox.espresso.DeviceDisplay\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.any\nimport org.mockito.kotlin.argumentCaptor\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.verify\nimport org.mockito.kotlin.whenever\nimport org.robolectric.RobolectricTestRunner\nimport org.robolectric.annotation.Config\nimport kotlin.test.assertEquals\n\nprivate const val INSETS_SIZE = 100\nprivate const val SCROLL_RANGE_SAFE_PERCENT = 0.9f // ScrollHelper.SCROLL_RANGE_SAFE_PERCENT\n\n@Config(\n    qualifiers = \"xxxhdpi\", // 1280x1880\n)\n@RunWith(RobolectricTestRunner::class)\nclass ScrollHelperTest {\n\n    private val display = DeviceDisplay.getScreenSizeInPX()\n    private val displayWidth = display[0].toInt()\n    private val displayHeight = display[1].toInt()\n    private val touchSlopPx = ScrollHelper.getViewConfiguration().scaledTouchSlop\n    private val safetyMarginPx = DeviceDisplay.convertDpiToPx(2.0)\n\n    private val uiControllerMock = mock<UiController>()\n    private val viewMock = mockViewWithGestureNavigation(displayWidth, displayHeight)\n\n    @Test\n    fun `should scrolling down by 200 when gesture navigation enabled`() {\n        val amountInDp = 200.0\n        val amountInPx = amountInDp * DeviceDisplay.getDensity()\n\n        ScrollHelper.perform(uiControllerMock, viewMock, MOTION_DIR_DOWN, amountInDp, null, null)\n\n        val upEvent = getUpEvent()\n        // Verify that the scroll started at the center of the view\n        assertEquals(displayWidth / 2.0, upEvent.x.toDouble(), 0.0)\n        // Verify that the scroll ended at the center of the view minus the requested amount\n        assertEquals(displayHeight - amountInPx - touchSlopPx - safetyMarginPx - INSETS_SIZE, upEvent.y.toDouble(), 0.0)\n    }\n\n    @Test\n    fun `should scrolling down by 200 when gesture navigation disabled`() {\n        val amountInDp = 200.0\n        val amountInPx = amountInDp * DeviceDisplay.getDensity()\n\n        val viewMock = mockViewWithoutGestureNavigation(displayWidth, displayHeight)\n        ScrollHelper.perform(uiControllerMock, viewMock, MOTION_DIR_DOWN, amountInDp, null, null)\n\n        val upEvent = getUpEvent()\n        // Verify that the scroll started at the center of the view\n        assertEquals(displayWidth / 2.0, upEvent.x.toDouble(), 0.0)\n        // Verify that the scroll ended at the center of the view minus the requested amount\n        assertEquals(displayHeight - amountInPx - touchSlopPx - safetyMarginPx, upEvent.y.toDouble(), 0.0)\n    }\n\n    @Test\n    fun `should scroll down to edge on full screen view when gesture navigation enabled`() {\n        ScrollHelper.performOnce(uiControllerMock, viewMock, MOTION_DIR_DOWN, null, null)\n        val upEvent = getUpEvent()\n        val amountInPx = displayHeight * SCROLL_RANGE_SAFE_PERCENT\n\n        // Calculate where the scroll should end\n        val targetY = displayHeight - amountInPx -\n            touchSlopPx -\n            safetyMarginPx -\n            INSETS_SIZE\n\n        assertEquals(displayWidth / 2.0, upEvent.x.toDouble(), 0.0)\n        assertEquals(targetY, upEvent.y, 0.0f)\n    }\n\n    @Test\n    fun `should scroll left to edge on full screen view when gesture navigation enabled`() {\n        ScrollHelper.performOnce(uiControllerMock, viewMock, MOTION_DIR_LEFT, null, null)\n        val upEvent = getUpEvent()\n        val amountInPx = displayWidth * SCROLL_RANGE_SAFE_PERCENT\n\n        // Calculate where the scroll should end\n        val targetX = amountInPx +\n            touchSlopPx +\n            safetyMarginPx +\n            INSETS_SIZE\n\n        assertEquals(targetX, upEvent.x, 0.0f)\n        assertEquals(displayHeight / 2.0, upEvent.y.toDouble(), 0.0)\n    }\n\n    @Test\n    fun `should scroll up to edge on full screen view when gesture navigation enabled`() {\n        ScrollHelper.performOnce(uiControllerMock, viewMock, MOTION_DIR_UP,null, null)\n        val upEvent = getUpEvent()\n        val amountInPx = displayHeight * SCROLL_RANGE_SAFE_PERCENT\n\n        // Calculate where the scroll should end\n        val targetY = amountInPx +\n            touchSlopPx +\n            safetyMarginPx +\n            INSETS_SIZE\n\n        assertEquals(displayWidth / 2.0, upEvent.x.toDouble(), 0.0)\n        assertEquals(targetY, upEvent.y, 0.0f)\n    }\n\n    @Test\n    fun `should scroll right to edge on full screen view when gesture navigation enabled`() {\n        ScrollHelper.performOnce(uiControllerMock, viewMock, MOTION_DIR_RIGHT,  null, null)\n        val upEvent = getUpEvent()\n        val amountInPx = displayWidth * SCROLL_RANGE_SAFE_PERCENT\n\n        // Calculate where the scroll should end\n        val targetX = displayWidth - amountInPx -\n            touchSlopPx -\n            safetyMarginPx -\n            INSETS_SIZE\n\n        assertEquals(targetX, upEvent.x, 0.0f)\n        assertEquals(displayHeight / 2.0, upEvent.y.toDouble(), 0.0)\n    }\n\n    /**\n     * Get the performed UP event from the ui controller\n     */\n    private fun getUpEvent(): MotionEvent {\n        val capture = argumentCaptor<Iterable<MotionEvent>>()\n        // Capture the events from the ui controller\n        verify(uiControllerMock).injectMotionEventSequence(capture.capture())\n\n        val listOfCapturedEvents = capture.firstValue.toList()\n        // The last event is the UP event with the target coordinates. All of the rest are not interesting\n        return listOfCapturedEvents.last()\n    }\n\n    private fun mockViewWithoutGestureNavigation(displayWidth: Int, displayHeight: Int): View {\n        // This is how we disable gesture navigation\n        val windowInsets = mock<WindowInsets>() {\n            whenever(it.systemGestureInsets).thenReturn(\n                Insets.of(0, 0, 0, 0)\n            )\n        }\n\n        return mockView(displayWidth, displayHeight, windowInsets)\n    }\n\n    /**\n     * Mock a view with gesture navigation enabled\n     */\n    private fun mockViewWithGestureNavigation(displayWidth: Int, displayHeight: Int): View {\n        // This is how we enable gesture navigation\n        val windowInsets = mock<WindowInsets>() {\n            whenever(it.systemGestureInsets).thenReturn(\n                Insets.of(INSETS_SIZE, INSETS_SIZE, INSETS_SIZE, INSETS_SIZE)\n            )\n        }\n\n        return mockView(displayWidth, displayHeight, windowInsets)\n    }\n\n    private fun mockView(\n        displayWidth: Int,\n        displayHeight: Int,\n        windowInsets: WindowInsets\n    ): View {\n        val view = mock<View>() {\n            whenever(it.width).thenReturn(displayWidth)\n            whenever(it.height).thenReturn(displayHeight)\n            whenever(it.canScrollVertically(any())).thenReturn(true) // We allow endless scroll\n            whenever(it.canScrollHorizontally(any())).thenReturn(true) // We allow endless scroll\n            whenever(it.context).thenReturn(InstrumentationRegistry.getInstrumentation().targetContext)\n            whenever(it.rootWindowInsets).thenReturn(windowInsets)\n        }\n        return view\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/SwipeHelperSpec.kt",
    "content": "package com.wix.detox.espresso.scroll\n\nimport android.content.Context\nimport android.content.res.Resources\nimport android.util.DisplayMetrics\nimport android.view.View\nimport androidx.test.espresso.ViewAction\nimport androidx.test.espresso.action.CoordinatesProvider\nimport androidx.test.espresso.action.PrecisionDescriber\nimport androidx.test.espresso.action.Press\nimport androidx.test.espresso.action.Swiper\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.junit.runners.Parameterized\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.whenever\nimport kotlin.test.assertEquals\n\ndata class SwipeArguments(\n        val direction: Int,\n        val fast: Boolean,\n        val normalizedSwipeAmount: Double,\n        val normalizedStartingPointX: Double,\n        val normalizedStartingPointY: Double\n)\n\ndata class SwipeCoordinates(\n        val startX: Float,\n        val startY: Float,\n        val endX: Float,\n        val endY: Float\n)\n\ndata class RectangleCalculator(val x: Int, val y: Int, val width: Int, val height: Int, val fuzz: Float) {\n    val left: Float get() = x + width * 0.0f\n    val center: Float get() = x + width * 0.5f\n    val right: Float get() = x + width * 1.0f\n    val top: Float get() = y + height * 0.0f\n    val middle: Float get() = y + height * 0.5f\n    val bottom: Float get() = y + height * 1.0f\n\n    val safeLeft: Float get() = x + width * (0f + fuzz)\n    val safeRight: Float get() = x + width * (1f - fuzz)\n    val safeTop: Float get() = y + height * (0f + fuzz)\n    val safeBottom: Float get() = y + height * (1f - fuzz)\n}\n\n@RunWith(Parameterized::class)\nclass SwipeHelperTest(\n        val args: SwipeArguments,\n        val expected: SwipeCoordinates\n) {\n    lateinit var action: ViewAction\n    lateinit var swiper: Swiper\n    lateinit var startCoordinatesProvider: CoordinatesProvider\n    lateinit var endCoordinatesProvider: CoordinatesProvider\n    lateinit var precisionDescriber: PrecisionDescriber\n    lateinit var swipeResult: Any\n\n    private val swipeHelper = SwipeHelper { _swiper: Swiper,\n                                            _startCoordinatesProvider: CoordinatesProvider,\n                                            _endCoordinatesProvider: CoordinatesProvider,\n                                            _precisionDescriber: PrecisionDescriber ->\n        swiper = _swiper\n        startCoordinatesProvider = _startCoordinatesProvider\n        endCoordinatesProvider = _endCoordinatesProvider\n        precisionDescriber = _precisionDescriber\n        action = mock()\n        action\n    }\n\n    @Before\n    fun setup() {\n        swipeResult = swipeHelper.swipeInDirection(\n                args.direction,\n                args.fast,\n                args.normalizedSwipeAmount,\n                args.normalizedStartingPointX,\n                args.normalizedStartingPointY\n        )\n    }\n\n    @Test\n    fun shouldReturnAction() {\n        assertEquals(action, swipeResult)\n    }\n\n    @Test\n    fun shouldUseFingerPrecision() {\n        assertEquals(Press.FINGER, precisionDescriber)\n    }\n\n    @Test\n    fun shouldCalculateCorrectStartPoint() {\n        val mockView = setupMockView()\n        val startXY = startCoordinatesProvider.calculateCoordinates(mockView)\n        val expectedStart = Pair(expected.startX, expected.startY)\n        val actualStart = Pair(startXY[0], startXY[1])\n        assertEquals(expectedStart, actualStart)\n    }\n\n    @Test\n    fun shouldCalculateCorrectEndPoint() {\n        val mockView = setupMockView()\n        val endXY = endCoordinatesProvider.calculateCoordinates(mockView)\n        val expectedEnd = Pair(expected.endX, expected.endY)\n        val actualEnd = Pair(endXY[0], endXY[1])\n        assertEquals(expectedEnd, actualEnd)\n    }\n\n    companion object {\n        @JvmStatic\n        @Parameterized.Parameters(name = \"{0}\")\n        fun data(): Collection<Array<Any>> {\n            return listOf(\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_LEFT, true, Double.NaN, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.safeRight, view.middle, view.safeRight - 0.75f * screen.width, view.middle)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_LEFT, true, 1.0, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.safeRight, view.middle, screen.left, view.middle)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_LEFT, false, Double.NaN, 1.0, 1.0),\n                            SwipeCoordinates(view.safeRight, view.safeBottom, view.safeRight - 0.75f * screen.width, view.safeBottom)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_LEFT, false, 0.0, 0.5, 0.5),\n                            SwipeCoordinates(view.center, view.middle, view.center, view.middle)\n                    ),\n\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_RIGHT, true, Double.NaN, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.safeLeft, view.middle, view.safeLeft + 0.75f * screen.width, view.middle)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_RIGHT, true, 1.0, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.safeLeft, view.middle, screen.right, view.middle)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_RIGHT, false, Double.NaN, 0.0, 0.0),\n                            SwipeCoordinates(view.safeLeft, view.safeTop, view.safeLeft + 0.75f * screen.width, view.safeTop)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_RIGHT, false, 0.0, 0.5, 0.5),\n                            SwipeCoordinates(view.center, view.middle, view.center, view.middle)\n                    ),\n\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_UP, true, Double.NaN, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.center, view.safeBottom, view.center, view.safeBottom - 0.75f * screen.height)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_UP, true, 1.0, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.center, view.safeBottom, view.center, screen.top)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_UP, false, Double.NaN, 1.0, 1.0),\n                            SwipeCoordinates(view.safeRight, view.safeBottom, view.safeRight, view.safeBottom - 0.75f * screen.height)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_UP, false, 0.0, 0.5, 0.5),\n                            SwipeCoordinates(view.center, view.middle, view.center, view.middle)\n                    ),\n\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_DOWN, true, Double.NaN, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.center, view.safeTop, view.center, view.safeTop + 0.75f * screen.height)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_DOWN, true, 1.0, Double.NaN, Double.NaN),\n                            SwipeCoordinates(view.center, view.safeTop, view.center, screen.bottom)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_DOWN, false, Double.NaN, 0.0, 0.0),\n                            SwipeCoordinates(view.safeLeft, view.safeTop, view.safeLeft, view.safeTop + 0.75f * screen.height)\n                    ),\n                    arrayOf(\n                            SwipeArguments(MOTION_DIR_DOWN, false, 0.0, 0.5, 0.5),\n                            SwipeCoordinates(view.center, view.middle, view.center, view.middle)\n                    )\n            )\n        }\n\n        val view = RectangleCalculator(200, 250, 3600, 4500, SwipeHelper.edgeFuzzFactor)\n        val screen = RectangleCalculator(0, 0, 4000, 5000, 0f)\n    }\n\n    private fun setupMockView(): View {\n        val mockView = mock<View>()\n        val mockDisplayMetrics = mock<DisplayMetrics>()\n        mockDisplayMetrics.widthPixels = screen.width\n        mockDisplayMetrics.heightPixels = screen.height\n\n        val mockResources = mock<Resources>()\n        whenever(mockResources.displayMetrics).then { mockDisplayMetrics }\n\n        val mockContext = mock<Context>()\n        whenever(mockContext.resources).then { mockResources }\n        whenever(mockView.context).then { mockContext }\n        whenever(mockView.width).then { view.width }\n        whenever(mockView.height).then { view.height }\n        whenever(mockView.getLocationOnScreen(IntArray(2))).then {\n            val arg0 = it.arguments[0]\n            val xy = arg0 as IntArray\n            xy[0] = view.x\n            xy[1] = view.y\n            xy\n        }\n\n        return mockView\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/espresso/utils/Vector2DSpec.kt",
    "content": "package com.wix.detox.espresso.utils\n\nimport com.wix.detox.action.common.MOTION_DIR_DOWN\nimport com.wix.detox.action.common.MOTION_DIR_LEFT\nimport com.wix.detox.action.common.MOTION_DIR_RIGHT\nimport com.wix.detox.action.common.MOTION_DIR_UP\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport kotlin.test.assertEquals\n\nobject Vector2DSpec: Spek({\n    describe(\"Vector2DSpec\") {\n        it(\"should have x, y coordinates\") {\n            val vector = Vector2D(3.0, 4.0)\n            assertEquals(Pair(3.0, 4.0), Pair(vector.x, vector.y))\n        }\n\n        it(\"should be comparable to each other\") {\n            val vector1 = Vector2D(3.0, 4.0)\n            val vector2 = Vector2D(3.0, 4.0)\n            assertEquals(vector1, vector2)\n        }\n\n        it(\"should be rotatable clockwise\") {\n            val vector = Vector2D(3.0, 4.0)\n\n            assertEquals(Vector2D(4.0, -3.0), vector.rotate(MOTION_DIR_UP, MOTION_DIR_RIGHT))\n            assertEquals(Vector2D(-3.0, -4.0), vector.rotate(MOTION_DIR_UP, MOTION_DIR_DOWN))\n            assertEquals(Vector2D(-4.0, 3.0), vector.rotate(MOTION_DIR_UP, MOTION_DIR_LEFT))\n            assertEquals(vector, vector.rotate(MOTION_DIR_UP, MOTION_DIR_UP))\n        }\n\n        it(\"should be have equivalent rotations clockwise\") {\n            val vector = Vector2D(3.0, 4.0)\n\n            assertEquals(vector.rotate(MOTION_DIR_UP, MOTION_DIR_RIGHT), vector.rotate(MOTION_DIR_RIGHT, MOTION_DIR_DOWN))\n            assertEquals(vector.rotate(MOTION_DIR_RIGHT, MOTION_DIR_DOWN), vector.rotate(MOTION_DIR_DOWN, MOTION_DIR_LEFT))\n            assertEquals(vector.rotate(MOTION_DIR_DOWN, MOTION_DIR_LEFT), vector.rotate(MOTION_DIR_LEFT, MOTION_DIR_UP))\n            assertEquals(vector.rotate(MOTION_DIR_LEFT, MOTION_DIR_UP), vector.rotate(MOTION_DIR_UP, MOTION_DIR_RIGHT));\n        }\n\n        it(\"should be have equivalent rotations counter-clockwise\") {\n            val vector = Vector2D(3.0, 4.0)\n\n            assertEquals(vector.rotate(MOTION_DIR_UP, MOTION_DIR_LEFT), vector.rotate(MOTION_DIR_LEFT, MOTION_DIR_DOWN))\n            assertEquals(vector.rotate(MOTION_DIR_LEFT, MOTION_DIR_DOWN), vector.rotate(MOTION_DIR_DOWN, MOTION_DIR_RIGHT))\n            assertEquals(vector.rotate(MOTION_DIR_DOWN, MOTION_DIR_RIGHT), vector.rotate(MOTION_DIR_RIGHT, MOTION_DIR_UP))\n            assertEquals(vector.rotate(MOTION_DIR_RIGHT, MOTION_DIR_UP), vector.rotate(MOTION_DIR_UP, MOTION_DIR_LEFT));\n        }\n\n        it(\"should be normalizable\") {\n            assertEquals(Vector2D(0.5, 0.25), Vector2D(0.5, 0.25).normalize())\n            assertEquals(Vector2D(0.25, 0.5), Vector2D(1.25, 0.5).normalize())\n            assertEquals(Vector2D(0.0, 0.0), Vector2D(3.0, 4.0).normalize())\n            assertEquals(Vector2D(0.75, 0.25), Vector2D(-3.25, -4.75).normalize())\n        }\n\n        it(\"should be trimmable by max value\") {\n            assertEquals(Vector2D(1.0, 1.0), Vector2D(1.0, 1.0).trimMax(0.0, 0.0))\n            assertEquals(Vector2D(100.0, 1.0), Vector2D(1.0, 1.0).trimMax(100.0, 0.0))\n            assertEquals(Vector2D(1.0, 100.0), Vector2D(1.0, 1.0).trimMax(0.0, 100.0))\n            assertEquals(Vector2D(0.0, 0.0), Vector2D(-1000.0, -3000.0).trimMax(0.0, 0.0))\n            assertEquals(Vector2D(-1000.0, -3000.0).trimMax(0.0, 0.0), Vector2D(-1000.0, -3000.0).trimMax(0.0))\n        }\n\n        it(\"should be scalable by amount\") {\n            assertEquals(Vector2D(4.0, 6.0), Vector2D(2.0, 2.0).scale(2.0, 3.0))\n            assertEquals(Vector2D(1.0, 1.0), Vector2D(2.0, 2.0).scale(0.5))\n        }\n\n        it(\"should be scalable by amount vector\") {\n            val factor = Vector2D(0.0, -1.0)\n            assertEquals(Vector2D(0.0, -2.0), Vector2D(2.0, 2.0).scale(factor))\n        }\n\n        it(\"should be X/Y settable\") {\n            assertEquals(Vector2D(4.0, 2.0), Vector2D(2.0, 2.0).withX(4.0))\n            assertEquals(Vector2D(2.0, 4.0), Vector2D(2.0, 2.0).withY(4.0))\n        }\n\n        it(\"should be addable\") {\n            val vector1 = Vector2D(1.0, 1.0)\n            val vector2 = Vector2D(2.0, -4.0)\n\n            assertEquals(Vector2D(3.0, -3.0), vector1.add(vector2))\n        }\n\n        it(\"should be creatable from FloatArray\") {\n            assertEquals(Vector2D(0.0, 1.0), Vector2D.from(FloatArray(2) { i -> i.toFloat() }))\n        }\n\n        it(\"should be creatable from x: Int, y: Int\") {\n            assertEquals(Vector2D(1.0, 1.0), Vector2D.from(1, 1))\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/inquiry/DetoxBusyResourceDescriptionSpec.kt",
    "content": "package com.wix.detox.inquiry\n\nimport org.assertj.core.api.Assertions\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nclass DetoxBusyResourceDescriptionSpec: Spek({\n    describe(\"Idling Resource Description Builder\") {\n        lateinit var description: DetoxBusyResourceDescription\n        lateinit var expectedJSON: Map<String, Any>\n\n        it(\"should build with given description\") {\n            description = DetoxBusyResourceDescription.Builder()\n                .name(\"foo\")\n                .addDescription(\"bar\", \"baz\")\n                .addDescription(\"qux\", \"quux\")\n                .build()\n\n            expectedJSON = mapOf(\n                \"name\" to \"foo\",\n                \"description\" to mapOf(\"bar\" to \"baz\", \"qux\" to \"quux\")\n            )\n            Assertions.assertThat(description.json()).isEqualTo(expectedJSON)\n        }\n\n        it(\"should build without description\") {\n            description = DetoxBusyResourceDescription.Builder().name(\"foo\").build()\n\n            expectedJSON = mapOf(\"name\" to \"foo\")\n            Assertions.assertThat(description.json()).isEqualTo(expectedJSON)\n        }\n\n        it(\"should build without name\") {\n            description = DetoxBusyResourceDescription.Builder()\n                .addDescription(\"bar\", \"baz\")\n                .addDescription(\"qux\", \"quux\")\n                .build()\n\n            expectedJSON = mapOf(\n                \"name\" to \"unknown\",\n                \"description\" to mapOf(\"bar\" to \"baz\", \"qux\" to \"quux\")\n            )\n            Assertions.assertThat(description.json()).isEqualTo(expectedJSON)\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/inquiry/DetoxBusyResourceSpec.kt",
    "content": "package com.wix.detox.inquiry\n\nimport androidx.test.espresso.IdlingResource\nimport com.wix.detox.espresso.idlingresources.DescriptiveIdlingResource\nimport org.assertj.core.api.Assertions.assertThat\nimport org.mockito.kotlin.doReturn\nimport org.mockito.kotlin.mock\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\n\nclass DetoxBusyResourceSpec: Spek({\n    describe(\"Detox busy resource\") {\n        data class TestCase<in T: IdlingResource>(\n            val caseTitle: String,\n            val idlingResource: IdlingResource,\n            val expectedDescription: DetoxBusyResourceDescription\n        )\n\n        describe(\"given a descriptive idling resource\") {\n            val mockedDebugName = \"mock:debug-name\"\n\n            fun aDescriptiveIdlingResource(busyHint: Map<String, Any>?): DescriptiveIdlingResource =\n                mock() {\n                    on { getDebugName() }.doReturn(mockedDebugName)\n                    on { getBusyHint() }.doReturn(busyHint)\n                }\n\n            listOf(\n                TestCase<IdlingResource>(\n                    caseTitle = \"should return a description based on debug-name and busy-hint\",\n                    idlingResource = aDescriptiveIdlingResource(mapOf(\"mocked\" to \"hint\", \"mocked2\" to \"hint2\")),\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(mockedDebugName)\n                        .addDescription(\"mocked\", \"hint\")\n                        .addDescription(\"mocked2\", \"hint2\")\n                        .build()\n                ),\n                TestCase(\n                    caseTitle = \"should return a description even without a busy-hint\",\n                    idlingResource = aDescriptiveIdlingResource(busyHint = null),\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(mockedDebugName)\n                        .build()\n                ),\n            ).forEach { (caseTitle, idlingResource, expectedDescription)  ->\n                it(caseTitle) {\n                    val uut = DetoxBusyResource.BusyIdlingResource(idlingResource)\n\n                    assertThat(uut.resource).isEqualTo(idlingResource)\n                    assertThat(uut.getDescription()).isEqualTo(expectedDescription)\n                }\n            }\n        }\n\n        describe(\"given a looper idling resource\") {\n\n            abstract class LooperIdlingResource: IdlingResource {}\n\n            fun aLooperIdlingResourceMock(resourceName: String): LooperIdlingResource =\n                mock() {\n                    on { name }.doReturn(resourceName)\n                }\n\n            listOf(\n                TestCase<LooperIdlingResource>(\n                    caseTitle = \"should return a tailored description for the js-thread looper\",\n                    idlingResource = aLooperIdlingResourceMock(\"mqt_js\"),\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(\"looper\")\n                        .addDescription(\"thread\", \"\\\"mqt_js\\\" (JS Thread)\")\n                        .addDescription(\"execution_type\", \"JavaScript code\")\n                        .build(),\n                ),\n                TestCase<LooperIdlingResource>(\n                    caseTitle = \"should return a tailored description for native-modules thread\",\n                    idlingResource = aLooperIdlingResourceMock(\"mqt_native\"),\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(\"looper\")\n                        .addDescription(\"thread\", \"\\\"mqt_native\\\" (Native Modules Thread)\")\n                        .addDescription(\"execution_type\", \"native module calls\")\n                        .build()\n                ),\n                TestCase<LooperIdlingResource>(\n                    caseTitle = \"should return a default description for unspecified looper-threads\",\n                    idlingResource = aLooperIdlingResourceMock(\"unmapped\"),\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(\"looper\")\n                        .addDescription(\"thread\", \"\\\"unmapped\\\"\")\n                        .build(),\n                ),\n            ).forEach { (caseTitle, idlingResource, expectedDescription) ->\n                it(caseTitle) {\n                    val uut = DetoxBusyResource.BusyIdlingResource(idlingResource)\n\n                    assertThat(uut.resource).isEqualTo(idlingResource)\n                    assertThat(uut.getDescription()).isEqualTo(expectedDescription)\n                }\n            }\n        }\n\n        describe(\"given a generic idling resource\") {\n            val mockedResourceName = \"mock:resource-name\"\n\n            listOf(\n                TestCase<IdlingResource>(\n                    caseTitle = \"should return a generic description for a generic idling resource\",\n                    idlingResource = mock { on { name}.doReturn(mockedResourceName) },\n                    expectedDescription = DetoxBusyResourceDescription.Builder()\n                        .name(\"unknown\")\n                        .addDescription(\"identifier\", mockedResourceName)\n                        .build()\n                )\n            ).forEach { (caseTitle, idlingResource, expectedDescription) ->\n                it (caseTitle) {\n                    val uut = DetoxBusyResource.BusyIdlingResource(idlingResource)\n\n                    assertThat(uut.resource).isEqualTo(idlingResource)\n                    assertThat(uut.getDescription()).isEqualTo(expectedDescription)\n                }\n            }\n        }\n\n        describe(\"busy async-task(s) description\") {\n            it(\"should return a general description\") {\n                val expectedDescription = DetoxBusyResourceDescription.Builder()\n                    .name(\"bg\")\n                    .addDescription(\"reason\", \"native async-tasks\")\n                    .build()\n\n                assertThat(DetoxBusyResource.BusyAsyncTasks.getDescription()).isEqualTo(expectedDescription)\n            }\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/instruments/DetoxInstrumentsManagerSpec.kt",
    "content": "package com.wix.detox.instruments\n\nimport android.content.Context\nimport org.mockito.kotlin.*\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport java.io.File\n\nobject DetoxInstrumentsManagerSpec : Spek({\n    describe(\"Instruments manager\") {\n        lateinit var appContext: Context\n        lateinit var instruments: Instruments\n        lateinit var instrumentsManager: DetoxInstrumentsManager\n\n        val mockCategory = \"MockCategory\"\n        val mockName = \"MockName\"\n        val mockId = \"MockId\"\n        val mockAdditionalInfo = \"MockAdditionalInfo\"\n        val mockStatus = \"MockStatus\"\n        val mockPath = \"/mock\"\n        val mockSamplingInterval = 100500L\n\n        beforeEachTest {\n            appContext = mock()\n            instruments = mock()\n            instrumentsManager = DetoxInstrumentsManager(appContext, instruments)\n        }\n\n        it(\"should start recording when instruments installed with default params\") {\n            whenever(instruments.installed()).thenReturn(true)\n            instrumentsManager.startRecordingAtLocalPath(mockPath, mockSamplingInterval)\n\n            verify(instruments).installed()\n            verify(instruments).startRecording(appContext, true, mockSamplingInterval, File(mockPath), false)\n        }\n\n        describe(\"proxy events\") {\n            lateinit var recording: InstrumentsRecording\n\n            beforeEachTest {\n                recording = mock()\n                whenever(instruments.installed()).thenReturn(true)\n                whenever(instruments.startRecording(any(), any(), any(), any(), any())).thenReturn(recording)\n            }\n\n            it(\"skipping without started recording\") {\n                instrumentsManager.eventBeginInterval(mockCategory, mockName, mockId, mockAdditionalInfo)\n                instrumentsManager.eventEndInterval(mockId, mockStatus, mockAdditionalInfo)\n                instrumentsManager.eventMark(mockCategory, mockName, mockId, mockStatus, mockAdditionalInfo)\n\n                verify(recording, never()).eventBeginInterval(any(), any(), any(), any())\n                verify(recording, never()).eventEndInterval(any(), any(), any())\n                verify(recording, never()).eventMark(any(), any(), any(), any(), any())\n            }\n\n            it(\"passing within started recording\") {\n                instrumentsManager.startRecordingAtLocalPath(mockPath, mockSamplingInterval)\n                instrumentsManager.eventBeginInterval(mockCategory, mockName, mockId, mockAdditionalInfo)\n                instrumentsManager.eventEndInterval(mockId, mockStatus, mockAdditionalInfo)\n                instrumentsManager.eventMark(mockCategory, mockName, mockId, mockStatus, mockAdditionalInfo)\n\n                verify(recording).eventBeginInterval(any(), any(), any(), any())\n                verify(recording).eventEndInterval(any(), any(), any())\n                verify(recording).eventMark(any(), any(), any(), any(), any())\n            }\n\n            it(\"skipping with started recording which was stopped\") {\n                instrumentsManager.startRecordingAtLocalPath(mockPath, mockSamplingInterval)\n                instrumentsManager.stopRecording()\n                instrumentsManager.eventBeginInterval(mockCategory, mockName, mockId, mockAdditionalInfo)\n                instrumentsManager.eventEndInterval(mockId, mockStatus, mockAdditionalInfo)\n                instrumentsManager.eventMark(mockCategory, mockName, mockId, mockStatus, mockAdditionalInfo)\n\n                verify(recording, never()).eventBeginInterval(any(), any(), any(), any())\n                verify(recording, never()).eventEndInterval(any(), any(), any())\n                verify(recording, never()).eventMark(any(), any(), any(), any(), any())\n            }\n        }\n\n        it(\"should not start recording when instruments not installed\") {\n            whenever(instruments.installed()).thenReturn(false)\n            instrumentsManager.startRecordingAtLocalPath(mockPath, mockSamplingInterval)\n\n            verify(instruments).installed()\n            verify(instruments, never()).startRecording(any(), any(), any(), any(), any())\n        }\n\n        describe(\"tryInstallJsi\") {\n            it(\"proxy when instruments installed\") {\n                whenever(instruments.installed()).thenReturn(true)\n                instrumentsManager.tryInstallJsi()\n                verify(instruments).tryInstallJsiHook(appContext)\n            }\n            it(\"skipping when instruments not installed\") {\n                whenever(instruments.installed()).thenReturn(false)\n                instrumentsManager.tryInstallJsi()\n                verify(instruments, never()).tryInstallJsiHook(any())\n            }\n        }\n\n        describe(\"recording\") {\n            lateinit var recording: InstrumentsRecording\n\n            beforeEachTest {\n                recording = mock()\n\n                whenever(instruments.installed()).thenReturn(true)\n                whenever(\n                        instruments.startRecording(any(), any(), any(), any(), any())\n                ).thenReturn(recording)\n\n                instrumentsManager.startRecordingAtLocalPath(mockPath, mockSamplingInterval)\n            }\n\n            it(\"should begin event interval\") {\n                instrumentsManager.eventBeginInterval(mockCategory, mockName, mockId, mockAdditionalInfo)\n                verify(recording).eventBeginInterval(mockCategory, mockName, mockId, mockAdditionalInfo)\n            }\n\n            it(\"should end event interval\") {\n                instrumentsManager.eventEndInterval(mockId, mockStatus, mockAdditionalInfo)\n                verify(recording).eventEndInterval(mockId, mockStatus, mockAdditionalInfo)\n            }\n\n            it(\"should mark event\") {\n                instrumentsManager.eventMark(mockCategory, mockName, mockId, mockStatus, mockAdditionalInfo)\n                verify(recording).eventMark(mockCategory, mockName, mockId, mockStatus, mockAdditionalInfo)\n            }\n\n            it(\"should stop\") {\n                instrumentsManager.stopRecording()\n                verify(recording).stop()\n            }\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResourceTest.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.NativeModule\nimport com.facebook.react.bridge.ReactContext\nimport com.wix.detox.UTHelpers.yieldToOtherThreads\nimport com.wix.detox.reactnative.helpers.RNHelpers\nimport com.wix.detox.reactnative.idlingresources.storage.AsyncStorageIdlingResource\nimport com.wix.detox.reactnative.idlingresources.storage.SerialExecutorReflected\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.any\nimport org.mockito.kotlin.argThat\nimport org.mockito.kotlin.argumentCaptor\nimport org.mockito.kotlin.eq\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.never\nimport org.mockito.kotlin.times\nimport org.mockito.kotlin.verify\nimport org.mockito.kotlin.whenever\nimport org.robolectric.RobolectricTestRunner\nimport java.util.concurrent.Executor\nimport java.util.concurrent.Executors\n\nprivate class AsyncStorageModuleStub : NativeModule {\n    val executor: Executor = mock(name = \"native-module's executor\")\n    override fun getName() = \"stub\"\n    override fun initialize() {}\n    override fun canOverrideExistingModule() = false\n    override fun onCatalystInstanceDestroy() {}\n    override fun invalidate() {}\n}\n\n@RunWith(RobolectricTestRunner::class)\nclass AsyncStorageIdlingResourceTest {\n    private lateinit var sexecutor: Executor\n    private lateinit var sexecutorReflected: SerialExecutorReflected\n    private lateinit var sexecutorReflectedGenFn: (executor: Executor) -> SerialExecutorReflected\n    private lateinit var module: AsyncStorageModuleStub\n    private lateinit var uut: AsyncStorageIdlingResource\n    private val reactContext: ReactContext = mock()\n    private lateinit var rnHelpers: RNHelpers\n\n    @Before\n    fun setup() {\n        sexecutor = mock()\n        module = AsyncStorageModuleStub()\n        sexecutorReflected = mock() {\n            on { executor() }.thenReturn(sexecutor)\n        }\n        sexecutorReflectedGenFn = mock() {\n            on { invoke(eq(module.executor)) }.thenReturn(sexecutorReflected)\n        }\n\n        rnHelpers = mock {\n            on { getNativeModule(any(), any()) }.thenReturn(module)\n        }\n        uut = AsyncStorageIdlingResource(reactContext, sexecutorReflectedGenFn, rnHelpers)\n    }\n\n    fun givenNoActiveTasks() = whenever(sexecutorReflected.hasActiveTask()).thenReturn(false)\n    fun givenAnActiveTask() = whenever(sexecutorReflected.hasActiveTask()).thenReturn(true)\n    fun givenNoPendingTasks() = whenever(sexecutorReflected.hasPendingTasks()).thenReturn(false)\n    fun givenPendingTasks() = whenever(sexecutorReflected.hasPendingTasks()).thenReturn(true)\n    fun givenIdleSExecutor() {\n        givenNoActiveTasks()\n        givenNoPendingTasks()\n    }\n\n    fun givenBusySExecutor() {\n        givenAnActiveTask()\n        givenNoPendingTasks()\n    }\n\n    fun verifyNoTasksEnqueued() = verify(sexecutorReflected, never()).executeTask(any())\n    fun verifyTaskEnqueuedOnce() = verify(sexecutorReflected, times(1)).executeTask(any())\n    fun verifyTaskEnqueuedTwice() = verify(sexecutorReflected, times(2)).executeTask(any())\n\n    @Test\n    fun `should have a name`() {\n        assertThat(uut.name).isEqualTo(\"com.wix.detox.reactnative.idlingresources.storage.AsyncStorageIdlingResource\")\n    }\n\n    @Test\n    fun `should have a debug-name`() {\n        assertThat(uut.getDebugName()).isEqualTo(\"io\")\n    }\n\n    @Test\n    fun `should be idle`() {\n        givenIdleSExecutor()\n        assertThat(uut.isIdleNow).isTrue()\n    }\n\n    @Test\n    fun `should be busy if executor is executing`() {\n        givenAnActiveTask()\n        givenNoPendingTasks()\n        assertThat(uut.isIdleNow).isFalse()\n    }\n\n    @Test\n    fun `should be busy if executor has pending tasks`() {\n        givenNoActiveTasks()\n        givenPendingTasks()\n        assertThat(uut.isIdleNow).isFalse()\n    }\n\n    @Test\n    fun `should be synchronized over actual executor`() {\n        val localExecutor = Executors.newSingleThreadExecutor()\n        var isIdle: Boolean? = null\n        synchronized(sexecutor) {\n            localExecutor.submit {\n                isIdle = uut.isIdleNow\n            }\n            yieldToOtherThreads(localExecutor)\n            assertThat(isIdle).isNull()\n        }\n        yieldToOtherThreads(localExecutor)\n    }\n\n    @Test\n    fun `should enqueue an idle-check task if resource is busy`() {\n        givenBusySExecutor()\n        uut.isIdleNow\n        verifyTaskEnqueuedOnce()\n    }\n\n    @Test\n    fun `should not enqueue an idle-check task if resource if idle`() {\n        givenIdleSExecutor()\n        uut.isIdleNow\n        verifyNoTasksEnqueued()\n    }\n\n    @Test\n    fun `should not enqueue more than one idle-check task`() {\n        givenBusySExecutor()\n\n        repeat(2) {\n            uut.isIdleNow\n        }\n        verifyTaskEnqueuedOnce()\n    }\n\n    private val callback: IdlingResource.ResourceCallback = mock()\n\n\n    fun verifyTransitionToIdleCalled() = verify(callback).onTransitionToIdle()\n    fun verifyTransitionToIdleNotCalled() = verify(callback, never()).onTransitionToIdle()\n\n    @Test\n    fun `should enqueue an idle-check task`() {\n        uut.registerIdleTransitionCallback(callback)\n        verifyTaskEnqueuedOnce()\n    }\n\n    @Test\n    fun `callback registration - should be synchronized over actual executor`() {\n        val localExecutor = Executors.newSingleThreadExecutor()\n\n        synchronized(sexecutor) {\n            localExecutor.submit {\n                uut.registerIdleTransitionCallback(callback)\n            }\n            yieldToOtherThreads(localExecutor)\n            verifyNoTasksEnqueued()\n        }\n        yieldToOtherThreads(localExecutor)\n    }\n\n\n    fun executeIdleCheckTask() {\n        argumentCaptor<Runnable>().also {\n            verify(sexecutorReflected).executeTask(it.capture())\n        }.firstValue.run()\n    }\n\n    @Test\n    fun `should transition to idle`() {\n        givenIdleSExecutor()\n\n        uut.registerIdleTransitionCallback(callback)\n        executeIdleCheckTask()\n\n        verifyTransitionToIdleCalled()\n    }\n\n    @Test\n    fun `should not transition to idle if busy`() {\n        givenAnActiveTask()\n        givenPendingTasks()\n\n        uut.registerIdleTransitionCallback(callback)\n        executeIdleCheckTask()\n\n        verifyTransitionToIdleNotCalled()\n    }\n\n    @Test\n    fun `should not inspect sexecutor for activity, because it runs on the executor itself`() {\n        givenAnActiveTask()\n        givenPendingTasks()\n\n        uut.registerIdleTransitionCallback(callback)\n        executeIdleCheckTask()\n\n        verify(sexecutorReflected, never()).hasActiveTask()\n    }\n\n    @Test\n    fun `should reenqueue if still busy`() {\n        givenAnActiveTask()\n        givenPendingTasks()\n\n        uut.registerIdleTransitionCallback(callback)\n        executeIdleCheckTask()\n\n        verifyTaskEnqueuedTwice()\n    }\n\n    @Test\n    fun `should be synchronized`() {\n        val localExecutor = Executors.newSingleThreadExecutor()\n\n        givenIdleSExecutor()\n        uut.registerIdleTransitionCallback(callback)\n\n        synchronized(sexecutor) {\n            localExecutor.submit {\n                executeIdleCheckTask()\n            }\n            yieldToOtherThreads(localExecutor)\n            verifyTransitionToIdleNotCalled()\n        }\n        yieldToOtherThreads(localExecutor)\n    }\n\n\n    @Test\n    fun `should allow for an enqueuing of more tasks after idle-transition`() {\n        uut.registerIdleTransitionCallback(callback)\n\n        givenIdleSExecutor()\n        executeIdleCheckTask()\n\n        givenBusySExecutor()\n        uut.isIdleNow\n\n        verifyTaskEnqueuedTwice()\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/NetworkIdlingResourcesTest.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport com.wix.detox.UTHelpers.yieldToOtherThreads\nimport com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource\nimport org.assertj.core.api.Assertions.assertThat\n\nimport okhttp3.Dispatcher\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.RobolectricTestRunner\nimport java.util.concurrent.Executors\n\n@RunWith(RobolectricTestRunner::class)\nclass NetworkIdlingResourcesTest {\n    lateinit var dispatcher: Dispatcher\n    lateinit var uut: NetworkIdlingResource\n\n    @Before\n    fun setup() {\n        dispatcher = Dispatcher()\n        uut =\n            NetworkIdlingResource(\n                dispatcher\n            )\n    }\n\n    // Note: Ideally, we should test that the list of busy resources is protected,\n    // rather than testing thread-safety as a whole.\n    @Test\n    fun `should return the descriptive data a thread-safe way`() {\n        val localExecutor = Executors.newSingleThreadExecutor()\n        var busyHint: Map<String, Any>? = null\n\n        synchronized(uut) {\n            localExecutor.submit {\n                busyHint = uut.getBusyHint()\n            }\n\n            yieldToOtherThreads(localExecutor)\n            assertThat(busyHint).isNull()\n        }\n        yieldToOtherThreads(localExecutor)\n        assertThat(busyHint).isNotNull\n    }\n\n    // Note: Ideally, we should test that the list of busy resources is protected,\n    // rather than testing thread-safety as a whole.\n    @Test\n    fun `should check for idle in a thread-safe way`() {\n        val localExecutor = Executors.newSingleThreadExecutor()\n        var idle = false\n\n        synchronized(uut) {\n            localExecutor.submit {\n                idle = uut.isIdleNow\n            }\n\n            yieldToOtherThreads(localExecutor)\n            assertThat(idle).isFalse\n        }\n        yieldToOtherThreads(localExecutor)\n        assertThat(idle).isTrue\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/SerialExecutorReflectedSpec.kt",
    "content": "package com.wix.detox.reactnative.idlingresources\n\nimport com.wix.detox.reactnative.idlingresources.storage.SerialExecutorReflected\nimport org.assertj.core.api.Assertions.assertThat\nimport org.mockito.kotlin.mock\nimport org.mockito.kotlin.verify\nimport org.spekframework.spek2.Spek\nimport org.spekframework.spek2.style.specification.describe\nimport java.util.concurrent.Executor\n\n\nprivate class SerialExecutorStub(private val executeFn: (r: Runnable) -> Unit): Executor {\n    val mTasks = mutableListOf<Any>()\n    var mActive: Runnable? = null\n\n    override fun execute(r: Runnable) = executeFn(r)\n}\n\nobject SerialExecutorReflectedSpec : Spek({\n    describe(\"Serial-executor\") {\n        lateinit var serialExecutor: SerialExecutorStub\n        lateinit var uut: SerialExecutorReflected\n        lateinit var executeFn: (r: Runnable) -> Unit\n\n        beforeEachTest {\n            executeFn = mock()\n            serialExecutor = SerialExecutorStub(executeFn)\n            uut = SerialExecutorReflected(serialExecutor)\n        }\n\n        it(\"should query pending tasks on empty executor\") {\n            assertThat(uut.hasPendingTasks()).isFalse()\n        }\n\n        it(\"should query pending tasks on an executor with pending jobs\") {\n            serialExecutor.mTasks.add(\"Task#1\")\n            assertThat(uut.hasPendingTasks()).isTrue()\n        }\n\n        it(\"should query active task on an empty executor\") {\n            assertThat(uut.hasActiveTask()).isFalse()\n        }\n\n        it(\"should query active task on a busy executor\") {\n            serialExecutor.mActive = Runnable {  }\n            assertThat(uut.hasActiveTask()).isTrue()\n        }\n\n        it(\"should execute tasks over the reflected executor\") {\n            val runnable = Runnable { }\n            uut.executeTask(runnable)\n            verify(executeFn).invoke(runnable)\n        }\n\n        it(\"should return the real executor\") {\n            assertThat(uut.executor()).isEqualTo(serialExecutor)\n        }\n    }\n})\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResourceTest.kt",
    "content": "package com.wix.detox.reactnative.idlingresources.timers\n\nimport android.view.Choreographer\nimport androidx.test.espresso.IdlingResource\nimport com.facebook.react.bridge.ReactContext\nimport com.facebook.react.modules.core.TimingModule\nimport org.assertj.core.api.Assertions\nimport org.junit.Assert.assertFalse\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.kotlin.*\nimport org.robolectric.RobolectricTestRunner\nimport kotlin.test.assertTrue\n\nprivate fun anIdlingResourceCallback() = mock<IdlingResource.ResourceCallback>()\n\n@RunWith(RobolectricTestRunner::class)\nclass TimersIdlingResourceTest {\n    private val choreographer: Choreographer = mock()\n    private val context: ReactContext = mock()\n    private val timersModule: TimingModule = mock()\n    private lateinit var timersIdlingResource: TimersIdlingResource\n\n    @Before\n    fun setup() {\n        whenever(context.getNativeModule(eq(TimingModule::class.java))).thenReturn(timersModule)\n        timersIdlingResource = TimersIdlingResource(context) { choreographer }\n    }\n\n    private fun givenIdleStrategy() {\n        whenever(timersModule.hasActiveTimersInRange(any())).thenReturn(false)\n    }\n\n    private fun givenBusyStrategy() {\n        whenever(timersModule.hasActiveTimersInRange(any())).thenReturn(true)\n    }\n\n    private fun getChoreographerCallback(): Choreographer.FrameCallback {\n        argumentCaptor<Choreographer.FrameCallback>().apply {\n            verify(choreographer).postFrameCallback(capture())\n            return firstValue\n        }\n    }\n\n    private fun invokeChoreographerCallback() {\n        getChoreographerCallback().doFrame(0L)\n    }\n\n    @Test\n    fun `should pause when unregistered`() {\n        assertFalse(timersIdlingResource.paused.get())\n        timersIdlingResource.onUnregistered()\n        assertTrue(timersIdlingResource.paused.get())\n    }\n\n    @Test\n    fun `should return a debug-name`() {\n        Assertions.assertThat(timersIdlingResource.getDebugName()).isEqualTo(\"timers\")\n    }\n\n    @Test\n    fun `should be idle if strategy says so`() {\n        givenIdleStrategy()\n        Assertions.assertThat(timersIdlingResource.isIdleNow).isTrue()\n    }\n\n    @Test\n    fun `should be busy if strategy says so`() {\n        givenBusyStrategy()\n        Assertions.assertThat(timersIdlingResource.isIdleNow).isFalse()\n    }\n\n    @Test\n    fun `should transition to idle if found idle by strategy`() {\n        givenIdleStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        with(timersIdlingResource) {\n            registerIdleTransitionCallback(callback)\n            isIdleNow\n        }\n\n        verify(callback).onTransitionToIdle()\n    }\n\n    @Test\n    fun `should NOT transition to idle if found busy by strategy`() {\n        givenBusyStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        with(timersIdlingResource) {\n            registerIdleTransitionCallback(callback)\n            isIdleNow\n        }\n\n        verify(callback, never()).onTransitionToIdle()\n    }\n\n    @Test\n    fun `should be idle if paused`() {\n        givenBusyStrategy()\n\n        val uut = timersIdlingResource.apply {\n            pause()\n        }\n\n        Assertions.assertThat(uut.isIdleNow).isTrue()\n    }\n\n    @Test\n    fun `should be busy if paused and resumed`() {\n        givenBusyStrategy()\n\n        val uut = timersIdlingResource.apply {\n            pause()\n            resume()\n        }\n\n        Assertions.assertThat(uut.isIdleNow).isFalse()\n    }\n\n    @Test\n    fun `should notify of transition to idle upon pausing`() {\n        givenBusyStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        with(timersIdlingResource) {\n            registerIdleTransitionCallback(callback)\n            pause()\n        }\n\n        verify(callback).onTransitionToIdle()\n    }\n\n    @Test\n    fun `should enqueue an is-idle check using choreographer when a callback gets registered`() {\n        with(timersIdlingResource) {\n            registerIdleTransitionCallback(mock())\n        }\n\n        verify(choreographer).postFrameCallback(any())\n    }\n\n    @Test\n    fun `should transition to idle when preregistered choreographer is dispatched`() {\n        givenIdleStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        timersIdlingResource.registerIdleTransitionCallback(callback)\n        invokeChoreographerCallback()\n\n        verify(callback).onTransitionToIdle()\n    }\n\n    @Test\n    fun `should NOT transition to idle if not idle when preregistered choreographer is dispatched`() {\n        givenBusyStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        timersIdlingResource.registerIdleTransitionCallback(callback)\n        invokeChoreographerCallback()\n\n        verify(callback, never()).onTransitionToIdle()\n    }\n\n    @Test\n    fun `should re-register choreographer if found idle while preregistered choreographer is dispatched`() {\n        givenBusyStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        val uut = timersIdlingResource\n        uut.registerIdleTransitionCallback(callback)\n        invokeChoreographerCallback()\n\n        verify(choreographer, times(2)).postFrameCallback(any())\n    }\n\n    @Test\n    fun `should adhere to pausing also when invoked via choreographer callback`() {\n        givenBusyStrategy()\n\n        val callback = anIdlingResourceCallback()\n\n        timersIdlingResource.apply {\n            pause()\n            registerIdleTransitionCallback(callback)\n        }\n        val runtimeChoreographerCallback = getChoreographerCallback()\n\n        reset(callback, choreographer)\n        runtimeChoreographerCallback.doFrame(0L)\n\n        verify(callback, never()).onTransitionToIdle()\n        verify(choreographer, never()).postFrameCallback(any())\n    }\n\n    @Test\n    fun `should enqueue an additional idle check (using choreographer) if found busy`() {\n        givenBusyStrategy()\n        timersIdlingResource.isIdleNow\n        verify(choreographer).postFrameCallback(any())\n    }\n\n    @Test\n    fun `should NOT enqueue an additional idle check (using choreographer) if found idle`() {\n        givenIdleStrategy()\n        timersIdlingResource.isIdleNow\n        verify(choreographer, never()).postFrameCallback(any())\n    }\n}\n\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/invoke/JsonParserTest.java",
    "content": "package com.wix.invoke;\n\nimport static org.assertj.core.api.Java6Assertions.assertThat;\n\nimport com.wix.invoke.parser.JsonParser;\nimport com.wix.invoke.types.ClassTarget;\nimport com.wix.invoke.types.Invocation;\nimport com.wix.invoke.types.InvocationTarget;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\nimport org.junit.Test;\n\nimport java.util.ArrayList;\n\n/**\n * Created by rotemm on 13/10/2016.\n */\npublic class JsonParserTest {\n\n    @Test\n    public void targetClassStaticMethodNoParams() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.System\"), \"lineSeparator\");\n        assertThat(parse(\"targetClassStaticMethodNoParams.json\")).usingRecursiveComparison().isEqualTo(invocation);\n    }\n\n    @Test\n    public void parseTargetClassStaticMethodOneParam() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 1.0f);\n        assertThat(parse(\"targetClassStaticMethodOneParam.json\")).usingRecursiveComparison().isEqualTo(invocation);\n    }\n\n    @Test\n    public void targetInvocationMethodOfClassStaticMethodOneParam() {\n        Invocation innerInvocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 1.0f);\n        Invocation outerInvocation = new Invocation(new InvocationTarget(innerInvocation), \"length\");\n        assertThat(parse(\"targetInvocationMethodOfClassStaticMethodOneParam.json\")).usingRecursiveComparison().isEqualTo(outerInvocation);\n    }\n\n    @Test\n    public void fromJsonTargetInvocationEspresso() {\n//        Espresso.onView(DetoxMatcher.matcherForContentDescription(\"Sanity\")).perform(ViewActions.click());\n        Invocation matcher = new Invocation(new ClassTarget(\"com.wix.detox.espresso.DetoxMatcher\"), \"matcherForContentDescription\", \"Sanity\");\n        Invocation onView = new Invocation(new ClassTarget(\"android.support.test.espresso.Espresso\"), \"onView\", matcher);\n        Invocation click = new Invocation(new ClassTarget(\"android.support.test.espresso.action.ViewActions\"), \"click\");\n        Invocation perform = new Invocation(new InvocationTarget(onView), \"perform\", click);\n\n\n        assertThat(parse(\"targetInvocationEspresso.json\")).usingRecursiveComparison().isEqualTo(perform);\n    }\n\n\n    @Test\n    public void fromJsonTargetInvocationEspressoDetox() {\n//        EspressoDetox.perform(Espresso.onView(DetoxMatcher.matcherForContentDescription(\"Sanity\")), ViewActions.click());\n\n        Invocation matcher = new Invocation(new ClassTarget(\"com.wix.detox.espresso.DetoxMatcher\"), \"matcherForContentDescription\", \"Sanity\");\n        Invocation onView = new Invocation(new ClassTarget(\"android.support.test.espresso.Espresso\"), \"onView\", matcher);\n        Invocation click = new Invocation(new ClassTarget(\"android.support.test.espresso.action.ViewActions\"), \"click\");\n        Invocation perform = new Invocation(new ClassTarget(\"com.wix.detox.espresso.EspressoDetox\"), \"perform\", onView, click);\n\n        assertThat(parse(\"targetInvocationEspressoDetox.json\")).usingRecursiveComparison().isEqualTo(perform);\n    }\n\n    @Test\n    public void fromJsonTargetInvocationEspressoWebDetox() {\n//        EspressoWebDetox.getWebView().element(DetoxWebAtomMatcher.matcherForId(\"textInput\")).tap();\n\n        Invocation getWebView = new Invocation(new ClassTarget(\"com.wix.detox.espresso.web.EspressoWebDetox\"), \"getWebView\");\n        Invocation matcher = new Invocation(new ClassTarget(\"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"), \"matcherForId\", \"textInput\");\n        Invocation element = new Invocation(new InvocationTarget(getWebView), \"element\", matcher, 0);\n        Invocation tap = new Invocation(new InvocationTarget(element), \"tap\");\n        assertThat(parse(\"targetInvocationEspressoWebDetox.json\")).usingRecursiveComparison().isEqualTo(tap);\n    }\n\n    @Test\n    public void fromJsonTargetInvocationEspressoWebDetoxScript() throws JSONException {\n        Invocation getWebView = new Invocation(new ClassTarget(\"com.wix.detox.espresso.web.EspressoWebDetox\"), \"getWebView\");\n        Invocation matcher = new Invocation(new ClassTarget(\"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"), \"matcherForId\", \"textInput\");\n        Invocation element = new Invocation(new InvocationTarget(getWebView), \"element\", matcher, 0);\n\n        String script = \"function(el,arg1){}\";\n        ArrayList<Object> scriptArguments = new ArrayList<>();\n        JSONArray arg1 = new JSONArray(\"[{ \\\"b\\\": true, \\\"n\\\": 1, \\\"s\\\": \\\"1\\\" }]\");\n        scriptArguments.add(arg1);\n\n        Invocation runScriptWithArgs = new Invocation(new InvocationTarget(element), \"runScriptWithArgs\", script, scriptArguments);\n        assertThat(parse(\"targetInvocationEspressoWebDetoxScript.json\")).usingRecursiveComparison().isEqualTo(runScriptWithArgs);\n    }\n\n    @Test\n    public void fromJsonTargetInvocationWithListParams() {\n        ArrayList<String> params = new ArrayList<>();\n        params.add(\".*10.0.2.2.*\");\n        Invocation test = new Invocation(new ClassTarget(\"com.wix.detox.espresso.EspressoDetox\"), \"setURLBlacklist\", params);\n        assertThat(parse(\"fromJsonTargetInvocationWithListParams.json\")).usingRecursiveComparison().isEqualTo(test);\n    }\n\n    public Invocation parseString(String jsonString) {\n        JSONObject json = new JsonParser().parse(jsonString);\n        try {\n            return new Invocation(json);\n        } catch (JSONException e) {\n            System.err.println(\"Could not parse json, got error: \" + e.getMessage());\n            return new Invocation();\n        }\n    }\n\n    public Invocation parse(String filePath) {\n        String jsonString = TestUtils.jsonFileToString(filePath);\n        return parseString(jsonString);\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/invoke/MethodInvocationTest.java",
    "content": "package com.wix.invoke;\n\nimport static org.assertj.core.api.Java6Assertions.assertThat;\n\nimport com.wix.invoke.types.ClassTarget;\nimport com.wix.invoke.types.Invocation;\nimport com.wix.invoke.types.InvocationTarget;\nimport com.wix.invoke.types.ObjectInstanceTarget;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\n\n/**\n * Created by rotemm on 10/10/2016.\n */\npublic class MethodInvocationTest {\n    MethodInvocation uut;\n\n    @Before\n    public void setUp() {\n        uut = new MethodInvocation();\n    }\n\n    @Test(expected = RuntimeException.class)\n    public void invokeEmptyInvocation() {\n        assertThat(invoke(new Invocation(null, null))).isNull();\n    }\n\n    @Test\n    public void invokeStaticStringValueOfInteger() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 0);\n        assertThat(invoke(invocation)).isEqualTo(\"0\");\n    }\n\n    @Test\n    public void invokeStaticStringValueOfFloat() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 1.0f);\n        assertThat(invoke(invocation)).isEqualTo(\"1.0\");\n    }\n\n    @Test\n    public void invokeStaticStringValeOfBoolean() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", true);\n        assertThat(invoke(invocation)).isEqualTo(\"true\");\n    }\n\n    @Test\n    public void invokeStaticStringValueOfChar() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 'c');\n        assertThat(invoke(invocation)).isEqualTo(\"c\");\n    }\n\n    @Test\n    public void invokeStaticMathMin1_2() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.Math\"), \"min\", 1, 2);\n        assertThat(invoke(invocation)).isEqualTo(1);\n    }\n\n    @Test\n    public void invokeStaticMathCbrt() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.Math\"), \"cbrt\", 64);\n        assertThat(invoke(invocation)).isEqualTo(4.0);\n    }\n\n    @Test\n    public void invokeStaticMathCbrtObject() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.Math\"), \"cbrt\", new Double(64));\n        assertThat(invoke(invocation)).isEqualTo(4.0);\n    }\n\n    @Test\n    public void invokeStaticArraysBinarySearchFindExisting() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.util.Arrays\"), \"binarySearch\", new Object[]{1, 2, 3, 4, 5}, 3);\n        assertThat(invoke(invocation)).isEqualTo(2);\n    }\n\n    @Test\n    public void invokeStaticArraysBinarySearchFindInRange() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.util.Arrays\"), \"binarySearch\", new Object[]{1, 2, 3, 4, 5}, 0, 1, 3);\n        assertThat(invoke(invocation)).isEqualTo(-2);\n    }\n\n    @Test\n    public void invokeMethodOnReturnValueOfStaticInvocation() {\n        Invocation innerInvocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 'c');\n        Invocation outerInvocation = new Invocation(new InvocationTarget(innerInvocation), \"length\");\n        assertThat(invoke(outerInvocation)).isEqualTo(1);\n    }\n\n\n    @Test\n    public void invokeMethodOnReturnValueOfStaticInvocationTwoTimes() {\n        Invocation innerInvocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 'c');\n        Invocation intermediateInvocation = new Invocation(new InvocationTarget(innerInvocation), \"concat\", \"c\");\n        Invocation outerInvocation = new Invocation(new InvocationTarget(intermediateInvocation), \"length\");\n        assertThat(invoke(outerInvocation)).isEqualTo(2);\n    }\n\n    @Test\n    public void invokeMethodOnReturnValueOfStaticInvocationThreeTimes() {\n        Invocation innerInvocation = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", 'c');\n        Invocation intermediateInvocation1 = new Invocation(new InvocationTarget(innerInvocation), \"concat\", \"c\");\n        Invocation intermediateInvocation2 = new Invocation(new InvocationTarget(intermediateInvocation1), \"concat\", \"b\");\n        Invocation outerInvocation = new Invocation(new InvocationTarget(intermediateInvocation2), \"length\");\n        assertThat(invoke(outerInvocation)).isEqualTo(3);\n    }\n\n    @Test\n    public void invokeMethodOnObjectInstance() {\n        Invocation innerInvocation = new Invocation(new ObjectInstanceTarget(new String(\"c\")), \"concat\", \"c\");\n        Invocation outerInvocation = new Invocation(new InvocationTarget(innerInvocation), \"length\");\n        assertThat(invoke(outerInvocation)).isEqualTo(2);\n    }\n\n    @Test\n    public void invokeMethodOnObjectInstanceTwice() {\n        Invocation innerInvocation = new Invocation(new ObjectInstanceTarget(new String(\"c\")), \"concat\", \"c\");\n        Invocation intermediateInvocation = new Invocation(new InvocationTarget(innerInvocation), \"concat\", \"c\");\n        Invocation outerInvocation = new Invocation(new InvocationTarget(intermediateInvocation), \"length\");\n        assertThat(invoke(outerInvocation)).isEqualTo(3);\n    }\n\n    @Test\n    public void invokeMethodsWhenInvocationIsAnArgumentOfOtherInvocation() {\n        //Espresso.onView(DetoxMatcher.matcherForContentDescription(\"Sanity\")).perform(ViewActions.click());\n        //String.valueOf(Integer.toString(1));\n        Invocation integerToString = new Invocation(new ClassTarget(\"java.lang.Integer\"), \"toString\", 1);\n        Invocation stringValueOf = new Invocation(new ClassTarget(\"java.lang.String\"), \"valueOf\", integerToString);\n        assertThat(invoke(stringValueOf)).isEqualTo(\"1\");\n    }\n\n    @Test\n    public void fromJsonTargetClassStaticMethodNoParams() {\n        assertThat(jsonToInvocation(\"targetClassStaticMethodNoParams.json\")).isEqualTo(System.lineSeparator());\n    }\n\n    @Test\n    public void fromJsonTargetClassStaticMethodOneParam() {\n        assertThat(jsonToInvocation(\"targetClassStaticMethodOneParam.json\")).isEqualTo(\"1.0\");\n    }\n\n    @Test\n    public void fromJsonTargetInvocationMethodOfClassStaticMethodOneParam() {\n        assertThat(jsonToInvocation(\"targetInvocationMethodOfClassStaticMethodOneParam.json\")).isEqualTo(3);\n    }\n\n    public Object jsonToInvocation(String filePath) {\n        String jsonData = TestUtils.jsonFileToString(filePath);\n        return invoke(jsonData);\n    }\n\n    public Object invoke(Invocation invocation) {\n        try {\n            return uut.invoke(invocation);\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public Object invoke(String string) {\n        try {\n            return uut.invoke(string);\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/invoke/TestUtils.java",
    "content": "package com.wix.invoke;\n\nimport org.apache.commons.io.IOUtils;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.io.IOException;\n\n/**\n * Created by rotemm on 13/10/2016.\n */\npublic class TestUtils {\n    public static String jsonFileToString(String path) {\n        try {\n            return StringUtils.deleteWhitespace(IOUtils.toString(\n                    MethodInvocation.class.getClassLoader().getResourceAsStream(path)));\n        } catch (IOException e) {\n\n            throw new RuntimeException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/java/com/wix/invoke/types/InvocationTest.java",
    "content": "package com.wix.invoke.types;\n\nimport static org.assertj.core.api.Java6Assertions.assertThat;\n\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.LinkedHashMap;\n/**\n * Created by rotemm on 26/10/2016.\n */\n\npublic class InvocationTest {\n\n    @Test\n    public void InvocationArgTypes() {\n        Invocation invocation = new Invocation(new ClassTarget(\"java.lang.System\"), \"lineSeparator\");\n\n        Object[] inputArgs = new Object[7];\n\n        inputArgs[0] = createArg(\"Integer\", 1);\n        inputArgs[1] = createArg(\"Float\", 1.0);\n        inputArgs[2] = createArg(\"Double\", 1.0);\n        inputArgs[3] = createArg(\"Float\", 1.0);\n        inputArgs[4] = createArg(\"String\", \"bla\");\n        inputArgs[5] = createArg(\"Boolean\", true);\n\n        invocation.setArgs(inputArgs);\n        Object[] outputArgs = invocation.getArgs();\n\n        assertThat(outputArgs[0].getClass()).isEqualTo(Integer.class);\n        assertThat(outputArgs[1].getClass()).isEqualTo(Float.class);\n        assertThat(outputArgs[2].getClass()).isEqualTo(Double.class);\n        assertThat(outputArgs[3].getClass()).isEqualTo(Float.class);\n        assertThat(outputArgs[4].getClass()).isEqualTo(String.class);\n        assertThat(outputArgs[5].getClass()).isEqualTo(Boolean.class);\n    }\n\n    public HashMap<String, Object> createArg(String type, Object value) {\n        LinkedHashMap<String, Object> arg = new LinkedHashMap<>();\n        arg.put(\"type\", type);\n        arg.put(\"value\", value);\n\n        return arg;\n    }\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/fromJsonTargetInvocationWithListParams.json",
    "content": "{\n  \"target\": {\n    \"type\": \"Class\",\n    \"value\": \"com.wix.detox.espresso.EspressoDetox\"\n  },\n  \"method\": \"setURLBlacklist\",\n  \"args\": [\n    [\n      \".*10.0.2.2.*\"\n    ]\n  ]\n}"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/mockito-extensions/org.mockito.plugins.MockMaker",
    "content": "mock-maker-inline\n"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/robolectric.properties",
    "content": "sdk=34\n"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetClassStaticMethodNoParams.json",
    "content": "{\n  \"target\": {\n    \"type\": \"Class\",\n    \"value\": \"java.lang.System\"\n  },\n  \"method\": \"lineSeparator\",\n  \"args\": []\n}"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetClassStaticMethodOneParam.json",
    "content": "{\n  \"target\": {\n    \"type\": \"Class\",\n    \"value\": \"java.lang.String\"\n  },\n  \"method\": \"valueOf\",\n  \"args\": [\n    {\n      \"type\": \"Float\",\n      \"value\": 1.0\n    }\n  ]\n}"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetInvocationEspresso.json",
    "content": "{\n  \"target\": {\n    \"type\": \"Invocation\",\n    \"value\": {\n      \"target\": {\n        \"type\": \"Class\",\n        \"value\": \"android.support.test.espresso.Espresso\"\n      },\n      \"method\": \"onView\",\n      \"args\": [{\n        \"type\": \"Invocation\",\n        \"value\": {\n          \"target\": {\n            \"type\": \"Class\",\n            \"value\": \"com.wix.detox.espresso.DetoxMatcher\"\n          },\n          \"method\": \"matcherForContentDescription\",\n          \"args\": [\"Sanity\"]\n        }\n      }]\n    }\n  },\n  \"method\": \"perform\",\n  \"args\": [{\n    \"type\": \"Invocation\",\n    \"value\": {\n      \"target\": {\n        \"type\": \"Class\",\n        \"value\": \"android.support.test.espresso.action.ViewActions\"\n      },\n      \"method \": \"click\",\n      \"args\": []\n    }\n  }]\n}"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetInvocationEspressoDetox.json",
    "content": "{\n  \"target\": {\n      \"type\": \"Class\",\n      \"value\": \"com.wix.detox.espresso.EspressoDetox\"\n    },\n    \"method\": \"perform\",\n    \"args\": [\n      {\n        \"type\": \"Invocation\",\n        \"value\": {\n          \"target\": {\n            \"type\": \"Class\",\n            \"value\": \"android.support.test.espresso.Espresso\"\n          },\n          \"method\": \"onView\",\n          \"args\": [\n            {\n              \"type\": \"Invocation\",\n              \"value\": {\n                \"target\": {\n                  \"type\": \"Class\",\n                  \"value\": \"com.wix.detox.espresso.DetoxMatcher\"\n                },\n                \"method\": \"matcherForContentDescription\",\n                \"args\": [\n                  \"Sanity\"\n                ]\n              }\n            }\n          ]\n        }\n      },\n      {\n        \"type\": \"Invocation\",\n        \"value\": {\n          \"target\": {\n            \"type\": \"Class\",\n            \"value\": \"android.support.test.espresso.action.ViewActions\"\n          },\n          \"method\": \"click\",\n          \"args\": []\n        }\n      }\n    ]\n  }"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetInvocationEspressoWebDetox.json",
    "content": "{\n  \"target\":{\n    \"type\":\"Invocation\",\n    \"value\":{\n      \"target\":{\n        \"type\":\"Invocation\",\n        \"value\":{\n          \"target\":{\n            \"type\":\"Class\",\n            \"value\":\"com.wix.detox.espresso.web.EspressoWebDetox\"\n          },\n          \"method\":\"getWebView\",\n          \"args\":[\n\n          ]\n        }\n      },\n      \"method\":\"element\",\n      \"args\":[\n        {\n          \"type\":\"Invocation\",\n          \"value\":{\n            \"target\":{\n              \"type\":\"Class\",\n              \"value\":\"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n            },\n            \"method\":\"matcherForId\",\n            \"args\":[\n              \"textInput\"\n            ]\n          }\n        },\n        {\n          \"type\":\"Integer\",\n          \"value\":0\n        }\n      ]\n    }\n  },\n  \"method\":\"tap\",\n  \"args\":[\n\n  ]\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetInvocationEspressoWebDetoxScript.json",
    "content": "{\n  \"target\":{\n    \"type\":\"Invocation\",\n    \"value\":{\n      \"target\":{\n        \"type\":\"Invocation\",\n        \"value\":{\n          \"target\":{\n            \"type\":\"Class\",\n            \"value\":\"com.wix.detox.espresso.web.EspressoWebDetox\"\n          },\n          \"method\":\"getWebView\",\n          \"args\":[\n\n          ]\n        }\n      },\n      \"method\":\"element\",\n      \"args\":[\n        {\n          \"type\":\"Invocation\",\n          \"value\":{\n            \"target\":{\n              \"type\":\"Class\",\n              \"value\":\"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n            },\n            \"method\":\"matcherForId\",\n            \"args\":[\n              \"textInput\"\n            ]\n          }\n        },\n        {\n          \"type\":\"Integer\",\n          \"value\":0\n        }\n      ]\n    }\n  },\n  \"method\": \"runScriptWithArgs\",\n  \"args\": [\n    \"function(el,arg1){}\",\n    [\n      [{ \"b\": true, \"n\": 1, \"s\": \"1\" }]\n    ]\n  ]\n}\n"
  },
  {
    "path": "detox/android/detox/src/testFull/resources/targetInvocationMethodOfClassStaticMethodOneParam.json",
    "content": "{\n  \"target\": {\n    \"type\": \"Invocation\",\n    \"value\": {\n      \"target\": {\n        \"type\": \"Class\",\n        \"value\": \"java.lang.String\"\n      },\n      \"method\": \"valueOf\",\n      \"args\": [\n        {\n          \"type\": \"Float\",\n          \"value\": 1.0\n        }\n      ]\n    }\n  },\n  \"method\": \"length\",\n  \"args\": []\n}"
  },
  {
    "path": "detox/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.14.3-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "detox/android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\nandroid.useAndroidX=true\n"
  },
  {
    "path": "detox/android/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd \"${APP_HOME:-./}\" > /dev/null && pwd -P ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    if ! command -v java >/dev/null 2>&1\n    then\n        die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "detox/android/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 0 goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "detox/android/rninfo.gradle",
    "content": "import groovy.json.JsonSlurper\n\ndef getRNPackageJsonDir() {\n    def currentDir = rootDir\n    while (currentDir != null) {\n        def nodeModulesDir = new File(currentDir, \"node_modules/react-native\")\n        def file = new File(nodeModulesDir, 'package.json')\n        if (file.exists()) {\n            return file.path\n        }\n        currentDir = currentDir.parentFile\n    }\n    throw new GradleException(\"Unable to find module: $moduleName\")\n}\n\ndef getRNVersion = { rnPackageJsonPath ->\n    println(\"RNInfo: package.json=$rnPackageJsonPath\")\n    def jsonSlurper = new JsonSlurper()\n    def packageFile =\n    println(\"RNInfo: reading $rnPackageJsonPath\")\n    Map<String, Object> packageJSON  = jsonSlurper.parse(new File(rnPackageJsonPath))\n    String rnVersion = packageJSON.get('version')\n    return rnVersion\n}\n\ndef getMajorVersionInternal = { semanticVersion ->\n    Integer rnVersionMajor = semanticVersion.split('\\\\.')[1].toInteger()\n    return rnVersionMajor\n}\n\ndef rnVersion = getRNVersion(getRNPackageJsonDir())\ndef rnMajorVer = getMajorVersionInternal(rnVersion)\nprintln \"RNInfo: detected React Native version: $rnVersion (major=$rnMajorVer)\"\n\next.rnInfo = [\n    version       : rnVersion,\n    majorVersion  : rnMajorVer,\n    isRN69OrHigher: rnMajorVer >= 69,\n    isRN70OrHigher: rnMajorVer >= 70,\n    isRN71OrHigher: rnMajorVer >= 71,\n    isRN72OrHigher: rnMajorVer >= 72,\n    isRN73OrHigher: rnMajorVer >= 73,\n    isRN74OrHigher: rnMajorVer >= 74,\n    isRN75OrHigher: rnMajorVer >= 75,\n    isRN76OrHigher: rnMajorVer >= 76,\n    isRN77OrHigher: rnMajorVer >= 77,\n    isRN78OrHigher: rnMajorVer >= 78,\n    isRN79OrHigher: rnMajorVer >= 79,\n    isRN80OrHigher: rnMajorVer >= 80,\n    isRN81OrHigher: rnMajorVer >= 81,\n]\n"
  },
  {
    "path": "detox/android/settings.gradle",
    "content": "// RN75+_BLOCK_START\npluginManagement { includeBuild(\"../node_modules/@react-native/gradle-plugin\") }\nplugins { id(\"com.facebook.react.settings\") }\nextensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }\n// RN75+_BLOCK_END\n\n\napply from: '../android/rninfo.gradle'\ninclude ':detox'\n\nprintln(\"RNInfo: rootDir=$rootDir\")\nprintln \"[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})\"\n\n\nif (ext.rnInfo.isRN72OrHigher) {\n    includeBuild('../node_modules/@react-native/gradle-plugin')\n} else {\n    includeBuild('../node_modules/react-native-gradle-plugin')\n}\n"
  },
  {
    "path": "detox/detox-native/README.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-heading\": 0 } -->\n\n<p align=\"center\">\n <img alt=\"Detox\" width=380 src=\"https://raw.githubusercontent.com/wix/Detox/master/docs/img/DetoxLogo.png\"/>\n</p>\n<h1 align=\"center\">\n  Detox (Native)\n</h1>\n<p align=\"center\">\n  <b>Gray box end-to-end testing and automation library for mobile apps.</b>\n</p>\n\n**Detox-Native** is a subsidiary of the [Detox](https://github.com/wix/Detox) project. It is a work-in-progress, experimental initiative to bring all of Detox' under-the-hood magic for mobile app developers, typically writing UI tests using Google and Apple’s native go-to frameworks (e.g. Espresso, EarlGrey, XCTest).\n\n**At the moment, the focus of the project is strictly on the Android platform.**\n\n## Android\n\nOn Android, the project mostly aims to be an improvement over what we’ve found to be shortcomings in `Espresso`’s ability to produce stable and reliable UI tests. However, it also aims at offering additional interesting features.\n\n**If you find Espresso unstable / unreliable, or are looking for some additional features, `Detox-Native` can help :muscle:**\n\nBelow is the set of actions Detox offers.\n\n- [**Tap Gestures**](#tap-gestures): `tap()`, `doubleTap()`, `multiTap()`\n- [**Gray-Box Scrolling:**](#gray-box-scrolling) `scrollDownBy()`, `scrollUpBy()`, `scrollLeftBy()`, `scrollRightBy()`\n\n### Tap Gestures\n\n#### Tap-Action Improvement\n\nDetox offers a tap-action that is a more robust version of Espresso’s `ViewActions.click()` . Unlike Espresso’s `click()`, it performs the tap in a way that does not result in undesired long-taps, on occasions.\n\nUsage example:\n\n```diff\n-onView(withId(R.id.fab)).perform(ViewActions.click())\n+onView(withId(R.id.fab)).perform(DetoxViewActions.tap())\n```\n\n#### Double-Tap Improvement\n\nDetox offers a double-tap gesture action that is a more robust version of Espresso’s `ViewActions.doubleClick()`. Detox’s implementation makes double-tapping very reliable, to the point where it would be very unlikely that the gesture would be registered as 2 separate taps (i.e. and would then not be caught by your crafted double-tap gesture handler in the app).\n\nUsage example:\n\n```diff\n-onView(withId(R.id.knockKnock)).perform(ViewActions.doubleClick())\n+onView(withId(R.id.knockKnock)).perform(DetoxViewActions.doubleTap())\n```\n\n#### Multi-Tap Gestures\n\nDetox extends Espresso’s limited tapping gestures support, by providing an API for injecting a series of as many taps as you like, in a reliable way: The `multiTap(times)` method is what does this, and in fact, under the covers, `tap()` and `doubleTap()` are mere aliases of `multiTap(1)` and `multiTap(2)`, respectively.\n\nUsage example:\n\n```kotlin\nonView(withId(R.id.easterEgg)).perform(DetoxViewActions.multiTap(5))\n```\n\n### Gray-Box Scrolling\n\nEspresso’s [list actions API](https://developer.android.com/training/testing/espresso/lists) is highly comprehensive and very impressive. However, in some cases, what you’re really looking for is a simple Gray-box API that would just scroll a list by a certain amount of pixels (e.g. equivalent to an `N * item_height` formula):\n\n```kotlin\nonView(withId(R.id.feedMe)).perform(DetoxViewActions.scrollDownBy(100.0)) // 100 is in DP!\nonView(withId(R.id.feedMe)).perform(DetoxViewActions.scrollUpBy(200.0))\n\nonView(withId(R.id.avatars)).perform(DetoxViewActions.scrollRightBy(300.0))\nonView(withId(R.id.avatars)).perform(DetoxViewActions.scrollLeftBy(400.0))\n```\n\n### Installation\n\nIn your app’s `build.gradle` - Add `Detox` as an android-test implementation dependency:\n\n```groovy\ndependencies {\n  // ...  \n  androidTestImplementation 'com.wix:detox:0.1.1'\n}\n```\n\nIn your root-project’s `build.gradle` - be sure to add `mavenCentral()` as an artifacts' repository:\n\n```groovy\nbuildscript {\n  repositories {\n    // ...\n    mavenCentral()\n  }\n}\n```\n\n> Note: Detox indirectly specifies Espresso and related dependencies - so best if you remove your own specification of them:\n>\n> ```diff\n> -  androidTestImplementation 'androidx.test.ext:junit:1.1.2'\n> -  androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0\n> ```\n"
  },
  {
    "path": "detox/detox.d.ts",
    "content": "// TypeScript definitions for Detox\n// Original authors (from DefinitelyTyped):\n// * Jane Smith <jsmith@example.com>\n// * Tareq El-Masri <https://github.com/TareqElMasri>\n// * Steve Chun <https://github.com/stevechun>\n// * Hammad Jutt <https://github.com/hammadj>\n// * pera <https://github.com/santiagofm>\n// * Max Komarychev <https://github.com/maxkomarychev>\n// * Dor Ben Baruch <https://github.com/Dor256>\n\nimport { BunyanDebugStreamOptions } from 'bunyan-debug-stream';\nimport type { Config as PilotConfig, Pilot, PromptHandler as _PromptHandler } from '@wix-pilot/core'\n\ndeclare global {\n    namespace Detox {\n        //#region DetoxConfig\n\n        interface DetoxConfig extends DetoxConfigurationCommon {\n            /**\n             * @example extends: './relative/detox.config'\n             * @example extends: '@my-org/detox-preset'\n             */\n            extends?: string;\n\n            apps?: Record<string, DetoxAppConfig>;\n            devices?: Record<string, DetoxDeviceConfig>;\n            selectedConfiguration?: string;\n            configurations: Record<string, DetoxConfiguration>;\n        }\n\n        type DetoxConfigurationCommon = {\n            artifacts?: false | DetoxArtifactsConfig;\n            behavior?: DetoxBehaviorConfig;\n            logger?: DetoxLoggerConfig;\n            session?: DetoxSessionConfig;\n            testRunner?: DetoxTestRunnerConfig;\n            /** Build command for the entire configuration, overriding individual app build commands. */\n            build?: string;\n            /** Start command for the entire configuration, overriding individual app start commands. */\n            start?: string;\n        };\n\n        interface DetoxArtifactsConfig {\n            rootDir?: string;\n            pathBuilder?: string;\n            plugins?: {\n                log?: 'none' | 'failing' | 'all' | DetoxLogArtifactsPluginConfig;\n                screenshot?: 'none' | 'manual' | 'failing' | 'all' | DetoxScreenshotArtifactsPluginConfig;\n                video?: 'none' | 'failing' | 'all' | DetoxVideoArtifactsPluginConfig;\n                instruments?: 'none' | 'all' | DetoxInstrumentsArtifactsPluginConfig;\n                uiHierarchy?: 'disabled' | 'enabled' | DetoxUIHierarchyArtifactsPluginConfig;\n\n                [pluginId: string]: unknown;\n            };\n        }\n\n        interface DetoxBehaviorConfig {\n            init?: {\n                /**\n                 * By default, Detox exports `device`, `expect`, `element`, `by` and `waitFor`\n                 * as global variables. If you want to control their initialization manually,\n                 * set this property to `false`.\n                 *\n                 * This is useful when during E2E tests you also need to run regular expectations\n                 * in Node.js. Jest's `expect` for instance, will not be overridden by Detox when\n                 * this option is used.\n                 */\n                exposeGlobals?: boolean;\n                /**\n                 * By default, Detox will uninstall and install the app upon initialization.\n                 * If you wish to reuse the existing app for a faster run, set the property to\n                 * `false`.\n                 */\n                reinstallApp?: boolean;\n                /**\n                 * When false, `detox test` command always deletes the shared lock file on start,\n                 * assuming it had been left from the previous, already finished test session.\n                 * The lock file contains information about busy and free devices and ensures\n                 * no device can be used simultaneously by multiple test workers.\n                 *\n                 * Setting it to **true** might be useful when if you need to run multiple\n                 * `detox test` commands in parallel, e.g. test a few configurations at once.\n                 *\n                 * @default false\n                 */\n                keepLockFile?: boolean;\n            };\n            launchApp?: 'auto' | 'manual';\n            cleanup?: {\n                shutdownDevice?: boolean;\n            };\n        }\n\n        type _DetoxLoggerOptions = Omit<BunyanDebugStreamOptions, 'out'>;\n\n        interface DetoxLoggerConfig {\n            /**\n             * Log level filters the messages printed to your terminal,\n             * and it does not affect the logs written to the artifacts.\n             *\n             * Use `info` by default.\n             * Use `error` or warn when you want to make the output as silent as possible.\n             * Use `debug` to control what generally is happening under the hood.\n             * Use `trace` when troubleshooting specific issues.\n             *\n             * @default 'info'\n             */\n            level?: DetoxLogLevel;\n            /**\n             * When enabled, hijacks all the console methods (console.log, console.warn, etc)\n             * so that the messages printed via them are formatted and saved as Detox logs.\n             *\n             * @default true\n             */\n            overrideConsole?: boolean;\n            /**\n             * Since Detox is using\n             * {@link https://www.npmjs.com/package/bunyan-debug-stream bunyan-debug-stream}\n             * for printing logs, all its options are exposed for sake of simplicity\n             * of customization.\n             *\n             * The only exception is {@link BunyanDebugStreamOptions#out} option,\n             * which is always set to `process.stdout`.\n             *\n             * You can also pass a callback function to override the logger config\n             * programmatically, e.g. depending on the selected log level.\n             *\n             * @see {@link BunyanDebugStreamOptions}\n             */\n            options?: _DetoxLoggerOptions | ((config: Partial<DetoxLoggerConfig>) => _DetoxLoggerOptions);\n        }\n\n        interface DetoxSessionConfig {\n            autoStart?: boolean;\n            debugSynchronization?: number;\n            ignoreUnexpectedMessages?: boolean;\n            server?: string;\n            sessionId?: string;\n        }\n\n        interface DetoxTestRunnerConfig {\n            args?: {\n                /**\n                 * The command to use for runner: 'jest', 'nyc jest',\n                 */\n                $0: string;\n                /**\n                 * The positional arguments to pass to the runner.\n                 */\n                _?: string[];\n                /**\n                 * Any other properties recognized by test runner\n                 */\n                [prop: string]: unknown;\n            };\n\n            /**\n             * This is an add-on section used by our Jest integration code (but not Detox core itself).\n             * In other words, if you’re implementing (or using) a custom integration with some other test runner, feel free to define a section for yourself (e.g. `testRunner.mocha`)\n             */\n            jest?: {\n                /**\n                 * Environment setup timeout\n                 *\n                 * As a part of the environment setup, Detox boots the device and installs the apps.\n                 * If that takes longer than the specified value, the entire test suite will be considered as failed, e.g.:\n                 * ```plain text\n                 * FAIL  e2e/starter.test.js\n                 * ● Test suite failed to run\n                 *\n                 * Exceeded timeout of 300000ms while setting up Detox environment\n                 * ```\n                 *\n                 * The default value is 5 minutes.\n                 *\n                 * @default 300000\n                 * @see {@link https://jestjs.io/docs/configuration/#testenvironment-string}\n                 */\n                setupTimeout?: number | undefined;\n                /**\n                 * Environemnt teardown timeout\n                 *\n                 * If the environment teardown takes longer than the specified value, Detox will throw a timeout error.\n                 * The default value is half a minute.\n                 *\n                 * @default 30000 (30 seconds)\n                 * @see {@link https://jestjs.io/docs/configuration/#testenvironment-string}\n                 */\n                teardownTimeout?: number | undefined;\n                /**\n                 * Jest provides an API to re-run individual failed tests: `jest.retryTimes(count)`.\n                 * When Detox detects the use of this API, it suppresses its own CLI retry mechanism controlled via `detox test … --retries <N>` or {@link DetoxTestRunnerConfig#retries}.\n                 * The motivation is simple – activating the both mechanisms is apt to increase your test duration dramatically, if your tests are flaky.\n                 * If you wish nevertheless to use both the mechanisms simultaneously, set it to `true`.\n                 *\n                 * @default false\n                 * @see {@link https://jestjs.io/docs/29.0/jest-object#jestretrytimesnumretries-options}\n                 */\n                retryAfterCircusRetries?: boolean;\n                /**\n                 * By default, Jest prints the test names and their status (_passed_ or _failed_) at the very end of the test session.\n                 * When enabled, it makes Detox to print messages like these each time the new test starts and ends:\n                 * ```plain text\n                 * 18:03:36.258 detox[40125] i Sanity: should have welcome screen\n                 * 18:03:37.495 detox[40125] i Sanity: should have welcome screen [OK]\n                 * 18:03:37.496 detox[40125] i Sanity: should show hello screen after tap\n                 * 18:03:38.928 detox[40125] i Sanity: should show hello screen after tap [OK]\n                 * 18:03:38.929 detox[40125] i Sanity: should show world screen after tap\n                 * 18:03:40.351 detox[40125] i Sanity: should show world screen after tap [OK]\n                 * ```\n                 * By default, it is enabled automatically in test sessions with a single worker.\n                 * And vice versa, if multiple tests are executed concurrently, Detox turns it off to avoid confusion in the log.\n                 * Use boolean values, `true` or `false`, to turn off the automatic choice.\n                 *\n                 * @default undefined\n                 */\n                reportSpecs?: boolean | undefined;\n                /**\n                 * In the environment setup phase, Detox boots the device and installs the apps.\n                 * This flag tells Detox to print messages like these every time the device gets assigned to a specific suite:\n                 *\n                 * ```plain text\n                 * 18:03:29.869 detox[40125] i starter.test.js is assigned to 4EC84833-C7EA-4CA3-A6E9-5C30A29EA596 (iPhone 15)\n                 * ```\n                 *\n                 * @default true\n                 */\n                reportWorkerAssign?: boolean | undefined;\n            };\n            /**\n             * Retries count. Zero means a single attempt to run tests.\n             */\n            retries?: number;\n            /**\n             * Arguments that should not be used during retries.\n             * @default ['shard']\n             */\n            noRetryArgs?: string[];\n            /**\n             * When true, tells Detox CLI to cancel next retrying if it gets\n             * at least one report about a permanent test suite failure.\n             * Has no effect, if {@link DetoxTestRunnerConfig#retries} is\n             * undefined or set to zero.\n             *\n             * @default false\n             * @see {DetoxInternals.DetoxTestFileReport#isPermanentFailure}\n             */\n            bail?: boolean;\n            /**\n             * When true, tells `detox test` to spawn the test runner in a detached mode.\n             * This is useful in CI environments, where you want to intercept SIGINT and SIGTERM signals to gracefully shut down the test runner and the device.\n             * Instead of passing the kill signal to the child process (the test runner), Detox will send an emergency shutdown request to all the workers, and then it will wait for them to finish.\n             * @default false\n             */\n            detached?: boolean;\n            /**\n             * Custom handler to process --inspect-brk CLI flag.\n             * Use it when you rely on another test runner than Jest to mutate the config.\n             */\n            inspectBrk?: (config: DetoxTestRunnerConfig) => void;\n            /**\n             * Forward environment variables to the spawned test runner\n             * accordingly to the given CLI argument overrides.\n             *\n             * If false, Detox CLI will be only printing a hint message on\n             * how to start the test runner using environment variables,\n             * in case when a user wants to avoid using Detox CLI.\n             *\n             * @default false\n             */\n            forwardEnv?: boolean;\n        }\n\n        type DetoxAppConfig = (DetoxBuiltInAppConfig | DetoxCustomAppConfig) & {\n            /**\n             * App name to use with device.selectApp(appName) calls.\n             * Can be omitted if you have a single app under the test.\n             *\n             * @see Device#selectApp\n             */\n            name?: string;\n            /**\n             * Build command to be executed when you run `detox build`\n             * @example 'cd ios && xcodebuild -workspace example.xcworkspace ...'\n             * @example 'cd android && ./gradlew assembleDebug ...'\n             */\n            build?: string;\n            /**\n             * Development server start command to be executed when you run `detox start`\n             * Usually used in debug mode, but it depends on your application setup.\n             * @example 'react-native start'\n             */\n            start?: string;\n        };\n\n        type DetoxDeviceConfig = DetoxBuiltInDeviceConfig | DetoxCustomDriverConfig;\n\n        interface DetoxLogArtifactsPluginConfig {\n            enabled?: boolean;\n            keepOnlyFailedTestsArtifacts?: boolean;\n        }\n\n        interface DetoxScreenshotArtifactsPluginConfig {\n            enabled?: boolean;\n            keepOnlyFailedTestsArtifacts?: boolean;\n            shouldTakeAutomaticSnapshots?: boolean;\n            takeWhen?: {\n                testStart?: boolean;\n                testFailure?: boolean;\n                testDone?: boolean;\n                appNotReady?: boolean;\n            };\n        }\n\n        interface DetoxVideoArtifactsPluginConfig {\n            enabled?: boolean;\n            keepOnlyFailedTestsArtifacts?: boolean;\n            android?: Partial<{\n                size: [number, number];\n                bitRate: number;\n                timeLimit: number;\n                verbose: boolean;\n            }>;\n            simulator?: Partial<{\n                codec: string;\n            }>;\n        }\n\n        interface DetoxInstrumentsArtifactsPluginConfig {\n            enabled?: boolean;\n        }\n\n        interface DetoxUIHierarchyArtifactsPluginConfig {\n            enabled?: boolean;\n        }\n\n        type DetoxBuiltInAppConfig = (DetoxIosAppConfig | DetoxAndroidAppConfig);\n\n        interface DetoxIosAppConfig {\n            type: 'ios.app';\n            binaryPath: string;\n            bundleId?: string;\n            launchArgs?: Record<string, any>;\n        }\n\n        interface DetoxAndroidAppConfig {\n            type: 'android.apk';\n            binaryPath: string;\n            bundleId?: string;\n            testBinaryPath?: string;\n            launchArgs?: Record<string, any>;\n            /**\n             * TCP ports to `adb reverse` upon the installation.\n             * E.g. 8081 - to be able to access React Native packager in Debug mode.\n             *\n             * @example [8081]\n             */\n            reversePorts?: number[];\n        }\n\n        interface DetoxCustomAppConfig {\n            type: string;\n\n            [prop: string]: unknown;\n        }\n\n        /**\n         * `minimal`: Configuration for a minimal system UI.\n         * `genymotion`: Configuration for a Genymotion-equivalent system UI.\n         *\n         * Visit https://github.com/wix/Detox/blob/master/detox/src/devices/allocation/drivers/android/utils/systemUICfgPresets.js to learn about\n         * the specifics of each preset.\n         */\n        type DetoxSystemUIPresetName = 'minimal' | 'genymotion';\n        type DetoxSystemUI = DetoxSystemUIPresetName | DetoxSystemUIConfig;\n\n        interface DetoxSystemUIConfig {\n            extends?: DetoxSystemUIPresetName;\n\n            /**\n             * Note: For 'hide' to work in Google emulators, need to set `hw.keyboard=yes` in AVD configuration (i.e.\n             * in manually `config.ini` file or via AVD Manager on Android Studio).\n             */\n            keyboard?: 'hide' | 'show' | null;\n            touches?: 'hide' | 'show' | null;\n            pointerLocationBar?: 'hide' | 'show' | null;\n            /** Note: 2-button mode is not supported in recent Android versions; Detox ignores it to avoid confusion. */\n            navigationMode?: '3-button' | 'gesture' | null;\n            statusBar?: DetoxSystemUIStatusBarConfig;\n        }\n\n        interface DetoxSystemUIStatusBarConfig {\n            notifications?: 'show' | 'hide' | null;\n            wifiSignal?: 'strong' | 'weak' | 'none' | null;\n            /** Disclaimer: Some Android versions fail to set the network type (3g, lte, etc.) */\n            cellSignal?: 'strong' | 'weak' | 'none' | null;\n            batteryLevel?: 'full' | 'half' | 'low' | null;\n            charging?: boolean | null;\n            /** In \"hhmm\" format (e.g. \"1234\" for 12:34) */\n            clock?: string | null;\n        }\n\n        type DetoxBuiltInDeviceConfig =\n            | DetoxIosSimulatorDriverConfig\n            | DetoxAttachedAndroidDriverConfig\n            | DetoxAndroidEmulatorDriverConfig\n            | DetoxGenymotionCloudDriverConfig;\n\n        interface DetoxIosSimulatorDriverConfig {\n            type: 'ios.simulator';\n            device: string | Partial<IosSimulatorQuery>;\n            bootArgs?: string;\n        }\n\n        interface DetoxSharedAndroidDriverConfig {\n            forceAdbInstall?: boolean;\n            utilBinaryPaths?: string[];\n\n            /** Disclaimer: Some features are not seamlessly supported by all Android versions and vendors. */\n            systemUI?: DetoxSystemUI;\n        }\n\n        interface DetoxAttachedAndroidDriverConfig extends DetoxSharedAndroidDriverConfig {\n            type: 'android.attached';\n            device: string | { adbName: string };\n        }\n\n        interface DetoxAndroidEmulatorDriverConfig extends DetoxSharedAndroidDriverConfig {\n            type: 'android.emulator';\n            device: string | { avdName: string };\n            bootArgs?: string;\n            gpuMode?: 'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest' | 'off';\n            headless?: boolean;\n            /**\n             * @default true\n             */\n            readonly?: boolean;\n        }\n\n        interface DetoxGenymotionCloudDriverConfig extends DetoxSharedAndroidDriverConfig {\n            type: 'android.genycloud';\n            device: string | { recipeUUID: string; } | { recipeName: string; };\n        }\n\n        interface DetoxCustomDriverConfig {\n            type: string;\n\n            [prop: string]: unknown;\n        }\n\n        interface IosSimulatorQuery {\n            id: string;\n            type: string;\n            name: string;\n            os: string;\n        }\n\n        type DetoxConfiguration = DetoxConfigurationCommon & (\n            | DetoxConfigurationSingleApp\n            | DetoxConfigurationMultiApps\n            );\n\n        interface DetoxConfigurationSingleApp {\n            device: DetoxAliasedDevice;\n            app: DetoxAliasedApp;\n        }\n\n        interface DetoxConfigurationMultiApps {\n            device: DetoxAliasedDevice;\n            apps: DetoxAliasedApp[];\n        }\n\n        type DetoxAliasedDevice = string | DetoxDeviceConfig;\n\n        type DetoxAliasedApp = string | DetoxAppConfig;\n\n        //#endregion\n\n        interface DetoxExportWrapper {\n            readonly device: Device;\n\n            readonly element: ElementFacade;\n\n            readonly waitFor: WaitForFacade;\n\n            readonly expect: ExpectFacade;\n\n            readonly by: ByFacade;\n\n            readonly web: WebFacade;\n\n            readonly system: SystemFacade;\n\n            readonly pilot: PilotFacade;\n\n          /**\n           * @deprecated This API is deprecated and will be removed in the next major version.\n           * Please use `pilot` instead of `pilot`.\n           */\n            readonly copilot: PilotFacade;\n\n            readonly DetoxConstants: {\n                userNotificationTriggers: {\n                    push: 'push';\n                    calendar: 'calendar';\n                    timeInterval: 'timeInterval';\n                    location: 'location';\n                };\n                userActivityTypes: {\n                    searchableItem: string;\n                    browsingWeb: string;\n                },\n                searchableItemActivityIdentifier: string;\n            };\n\n            /**\n             * Detox logger instance. Can be used for saving user logs to the general log file.\n             */\n            readonly log: Logger;\n\n            /**\n             * @deprecated\n             *\n             * Deprecated - use {@link Detox.Logger#trace}\n             * Detox tracer instance. Can be used for building timelines in Google Event Tracing format.\n             */\n            readonly trace: {\n                /** @deprecated */\n                readonly startSection: (name: string) => void;\n                /** @deprecated */\n                readonly endSection: (name: string) => void;\n            };\n\n            /**\n             * Trace a single call, with a given name and arguments.\n             *\n             * @deprecated\n             * @param sectionName The name of the section to trace.\n             * @param promiseOrFunction Promise or a function that provides a promise.\n             * @param args Optional arguments to pass to the trace.\n             * @returns The returned value of the traced call.\n             * @see https://wix.github.io/Detox/docs/19.x/api/detox-object-api/#detoxtracecall\n             */\n            readonly traceCall: <T>(event: string, action: () => Promise<T>, args?: Record<string, unknown>) => Promise<T>;\n\n            /**\n             * Enter the REPL mode.\n             * Works only with `--repl` CLI flag or DETOX_REPL environment variable.\n             * @param context Optional context to be passed to the REPL.\n             * @example\n             * await detox.REPL();\n             * @example\n             * await detox.REPL({ myScreenDriver, usefulConstants });\n             *\n             * @see https://wix.github.io/Detox/docs/guide/detox-repl\n             */\n            REPL(context?: object): Promise<void>;\n        }\n\n        interface Logger {\n            readonly level: DetoxLogLevel;\n\n            readonly fatal: _LogMethod;\n            readonly error: _LogMethod;\n            readonly warn: _LogMethod;\n            readonly info: _LogMethod;\n            readonly debug: _LogMethod;\n            readonly trace: _LogMethod;\n\n            child(context?: Partial<LogEvent>): Logger;\n        }\n\n        /** @internal */\n        interface _LogMethod extends _LogMethodSignature {\n            readonly begin: _LogMethodSignature;\n            readonly complete: _CompleteMethodSignature;\n            readonly end: _LogMethodSignature;\n        }\n\n        /** @internal */\n        interface _LogMethodSignature {\n            (...args: unknown[]): void\n            (event: LogEvent, ...args: unknown[]): void;\n        }\n\n        /** @internal */\n        interface _CompleteMethodSignature {\n            <T>(message: string, action: T | (() => T)): T;\n            <T>(event: LogEvent, message: string, action: T | (() => T)): T;\n        }\n\n        type LogEvent = {\n            /** Use when there's a risk of logging several parallel duration events. */\n            id?: string | number;\n            /** Optional. Event categories (tags) to facilitate filtering. */\n            cat?: string | string[];\n            /** Optional. Color name (applicable in Google Chrome Trace Format) */\n            cname?: string;\n\n            /** Reserved property. Process ID. */\n            pid?: never;\n            /** Reserved property. Thread ID. */\n            tid?: never;\n            /** Reserved property. Timestamp. */\n            ts?: never;\n            /** Reserved property. Event phase. */\n            ph?: never;\n\n            [customProperty: string]: unknown;\n        };\n\n        type DetoxLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';\n\n        type Point2D = {\n            x: number,\n            y: number,\n        }\n\n        /**\n         * A construct allowing for the querying and modification of user arguments passed to an app upon launch by Detox.\n         *\n         * @see AppLaunchArgs#modify\n         * @see AppLaunchArgs#reset\n         * @see AppLaunchArgs#get\n         */\n        interface AppLaunchArgs {\n            /**\n             * Shared (global) arguments that are not specific to a particular application.\n             * Selecting another app does not reset them, yet they still can be overridden\n             * by configuring app-specific launch args.\n             * @see Device#selectApp\n             * @see AppLaunchArgs\n             */\n            readonly shared: ScopedAppLaunchArgs;\n\n            /**\n             * Modify the launch-arguments via a modifier object, according to the following logic:\n             * - Non-nullish modifier properties would set a new value or override the previous value of\n             *   existing properties with the same name.\n             * - Modifier properties set to either `undefined` or `null` would delete the corresponding property\n             *   if it existed.\n             * These custom app launch arguments get erased whenever you select a different application.\n             * If you need to share them between all the applications, use {@link AppLaunchArgs#shared} property.\n             * Note: app-specific launch args have a priority over shared ones.\n             *\n             * @param modifier The modifier object.\n             * @example\n             * // With current launch arguments set to:\n             * // {\n             * //   mockServerPort: 1234,\n             * //   mockServerCredentials: 'user@test.com:12345678',\n             * // }\n             * device.appLaunchArgs.modify({\n             *   mockServerPort: 4321,\n             *   mockServerCredentials: null,\n             *   mockServerToken: 'abcdef',\n             * });\n             * await device.launchApp();\n             * // ==> launch-arguments become:\n             * // {\n             * //   mockServerPort: 4321,\n             * //   mockServerToken: 'abcdef',\n             * // }\n             */\n            modify(modifier: object): this;\n\n            /**\n             * Reset all app-specific launch arguments (back to an empty object).\n             * If you need to reset the shared launch args, use {@link AppLaunchArgs#shared}.\n             */\n            reset(): this;\n\n            /**\n             * Get all currently set launch arguments (including shared ones).\n             * @returns An object containing all launch-arguments.\n             * Note: mutating the values inside the result object is pointless, as it is immutable.\n             */\n            get(): object;\n        }\n\n        /**\n         * Shared (global) arguments that are not specific to a particular application.\n         */\n        interface ScopedAppLaunchArgs {\n            /** @see AppLaunchArgs#modify */\n            modify(modifier: object): this;\n\n            /** @see AppLaunchArgs#reset */\n            reset(): this;\n\n            /** @see AppLaunchArgs#get */\n            get(): object;\n        }\n\n        type DigitWithoutZero = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;\n        type Digit = 0 | DigitWithoutZero;\n        type BatteryLevel = `${Digit}` | `${DigitWithoutZero}${Digit}` | \"100\";\n\n        interface Device {\n            /**\n             * Holds the environment-unique ID of the device, namely, the adb ID on Android (e.g. emulator-5554) and the Mac-global simulator UDID on iOS -\n             * as used by simctl (e.g. AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE).\n             */\n            id: string;\n            /**\n             * Holds a descriptive name of the device. Example: emulator-5554 (Pixel_API_29)\n             */\n            name: string;\n\n            /**\n             * Select the current app (relevant only to multi-app configs) by its name.\n             * After execution, all app-specific device methods will target the selected app.\n             *\n             * @see DetoxAppConfig#name\n             * @example\n             * await device.selectApp('passenger');\n             * await device.launchApp(); // passenger\n             * // ... run tests for the passenger app\n             * await device.uninstallApp(); // passenger\n             * await device.selectApp('driver');\n             * await device.installApp(); // driver\n             * await device.launchApp(); // driver\n             * // ... run tests for the driver app\n             * await device.terminateApp(); // driver\n             */\n            selectApp(app: string): Promise<void>;\n\n            // TODO: document permissions types.\n            /**\n             * Launch the app.\n             *\n             * <p>For info regarding launch arguments, refer to the [dedicated guide](https://wix.github.io/Detox/docs/guide/launch-args).\n             *\n             * @example\n             * // Terminate the app and launch it again. If set to false, the simulator will try to bring app from background,\n             * // if the app isn't running, it will launch a new instance. default is false\n             * await device.launchApp({newInstance: true});\n             * @example\n             * // Grant or deny runtime permissions for your application.\n             * await device.launchApp({permissions: {calendar: 'YES'}});\n             * @example\n             * // Mock opening the app from URL to test your app's deep link handling mechanism.\n             * await device.launchApp({url: url});\n             * @example\n             * // Start the app with some custom arguments.\n             * await device.launchApp({\n             *   launchArgs: {arg1: 1, arg2: \"2\"},\n             * });\n             */\n            launchApp(config?: DeviceLaunchAppConfig): Promise<void>;\n\n            /**\n             * Relaunch the app. Convenience method that calls {@link Device#launchApp}\n             * with { newInstance: true } override.\n             *\n             * @deprecated\n             * @param config\n             * @see Device#launchApp\n             */\n            relaunchApp(config?: DeviceLaunchAppConfig): Promise<void>;\n\n            /**\n             * Access the user-defined launch-arguments predefined through static scopes such as the Detox configuration file and\n             * command-line arguments. This access allows - through dedicated methods, for both value-querying and\n             * modification (see {@link AppLaunchArgs}).\n             * Refer to the [dedicated guide](https://wix.github.io/Detox/docs/api/launch-args) for complete details.\n             *\n             * @example\n             * // With Detox being preconfigured statically to use these arguments in app launch:\n             * // {\n             * //   mockServerPort: 1234,\n             * // }\n             * // The following code would result in these arguments eventually passed into the launched app:\n             * // {\n             * //   mockServerPort: 4321,\n             * //   mockServerToken: 'uvwxyz',\n             * // }\n             * device.appLaunchArgs.modify({\n             *   mockServerPort: 4321,\n             *   mockServerToken: 'abcdef',\n             * });\n             * await device.launchApp({ launchArgs: { mockServerToken: 'uvwxyz' } });\n             *\n             * @see AppLaunchArgs\n             */\n            appLaunchArgs: AppLaunchArgs;\n\n            /**\n             * Terminate the app.\n             *\n             * @example\n             * // By default, terminateApp() with no params will terminate the app\n             * await device.terminateApp();\n             * @example\n             * // To terminate another app, specify its bundle id\n             * await device.terminateApp('other.bundle.id');\n             */\n            terminateApp(bundle?: string): Promise<void>;\n\n            /**\n             * Send application to background by bringing com.apple.springboard to the foreground.\n             * Combining sendToHome() with launchApp({newInstance: false}) will simulate app coming back from background.\n             * @example\n             * await device.sendToHome();\n             * await device.launchApp({newInstance: false});\n             */\n            sendToHome(): Promise<void>;\n\n            /**\n             * If this is a React Native app, reload the React Native JS bundle. This action is much faster than device.launchApp(), and can be used if you just need to reset your React Native logic.\n             *\n             * @example await device.reloadReactNative()\n             */\n            reloadReactNative(): Promise<void>;\n\n            /**\n             * Resets the app state by clearing app data and restoring it to a clean state.\n             *\n             * On Android, this command clears the app's data using the `pm clear` command,\n             * effectively resetting the app to its initial installed state without uninstalling it.\n             *\n             * On iOS, Detox uses a fallback mechanism - it backs up, deletes and installs the app from cache.\n             * This process ensures the app is returned to a clean state.\n             *\n             * @param bundleIds Optional bundle IDs to reset. If none provided, resets the currently selected app.\n             * @example\n             * // Reset current app state\n             * await device.resetAppState();\n             * @example\n             * // Reset specific app state\n             * await device.resetAppState('com.example.app');\n             * @example\n             * // Reset multiple apps\n             * await device.resetAppState('com.app1', 'com.app2');\n             */\n            resetAppState(...bundleIds: string[]): Promise<void>;\n\n            /**\n             * By default, installApp() with no params will install the app file defined in the current configuration.\n             * To install another app, specify its path\n             * @example await device.installApp();\n             * @example await device.installApp('path/to/other/app');\n             */\n            installApp(path?: any): Promise<void>;\n\n            /**\n             * By default, uninstallApp() with no params will uninstall the app defined in the current configuration.\n             * To uninstall another app, specify its bundle id\n             * @example await device.installApp('other.bundle.id');\n             */\n            uninstallApp(bundle?: string): Promise<void>;\n\n            /**\n             * Mock opening the app from URL. `sourceApp` is an optional parameter to specify source application bundle id (iOS only).\n             */\n            openURL(url: { url: string; sourceApp?: string }): Promise<void>;\n\n            /**\n             * Mock handling of received user notification when app is in foreground.\n             */\n            sendUserNotification(...params: any[]): Promise<void>;\n\n            /**\n             * Mock handling of received user activity when app is in foreground.\n             */\n            sendUserActivity(...params: any[]): Promise<void>;\n\n            /**\n             * Takes \"portrait\" or \"landscape\" and rotates the device to the given orientation. Currently only available in the iOS Simulator.\n             */\n            setOrientation(orientation: Orientation): Promise<void>;\n\n            /**\n             * Perform a tap at arbitrary coordinates on the device's screen.\n             * @param point Coordinates in the element's coordinate space. Optional. defaults: x: 100, y: 100\n             * @param shouldIgnoreStatusBar Coordinates will be measured starting from under the status bar. this param will affect only in Android tests. Optional. default: true\n             * @example await device.tap();\n             * @example await device.tap({ x: 100, y: 150 }, false);\n             * @example await device.tap({ x: 100, y: 150 });\n             * @example await device.tap(false);\n             */\n            tap(): Promise<void>;\n            tap(point: Point2D): Promise<void>;\n            tap(point: Point2D, shouldIgnoreStatusBar: boolean): Promise<void>;\n            tap(shouldIgnoreStatusBar: boolean): Promise<void>;\n\n            /**\n             * Perform a long press at arbitrary coordinates on the device's screen. Custom press duration if needed.\n             * @param point Coordinates in the device's coordinate space. Optional. defaults: x: 100, y: 100\n             * @param duration Custom press duration time, in milliseconds. Optional (defaults to the standard long-press duration for Android and 1000 milliseconds for ios).\n             *      Custom durations should be used cautiously, as they can affect test consistency and user experience expectations.\n             *      They are typically necessary when testing components that behave differently from the platform's defaults or when simulating unique user interactions.\n             * @param shouldIgnoreStatusBar Coordinates will be measured starting from under the status bar. this param will affect only in Android tests. Optional. default: true\n             * @example await device.longPress();\n             * @example await device.longPress({ x: 100, y: 150 }, 2000, false);\n             * @example await device.longPress({ x: 100, y: 150 }, 2000);\n             * @example await device.longPress(2000, false);\n             * @example await device.longPress({ x: 100, y: 150 }, false);\n             * @example await device.longPress({ x: 100, y: 150 });\n             * @example await device.longPress(2000);\n             * @example await device.longPress(false);\n             */\n            longPress(): Promise<void>;\n            longPress(point: Point2D, duration: number, shouldIgnoreStatusBar: boolean): Promise<void>;\n            longPress(point: Point2D, duration: number): Promise<void>;\n            longPress(duration: number, shouldIgnoreStatusBar: boolean): Promise<void>;\n            longPress(point: Point2D, shouldIgnoreStatusBar: boolean): Promise<void>;\n            longPress(point: Point2D): Promise<void>;\n            longPress(duration: number): Promise<void>;\n            longPress(shouldIgnoreStatusBar: boolean): Promise<void>;\n\n            /**\n             * Sets the simulator/emulator location to the given latitude and longitude.\n             *\n             * <p/>On iOS `setLocation` is dependent on [fbsimctl](https://github.com/facebook/idb/tree/4b7929480c3c0f158f33f78a5b802c1d0e7030d2/fbsimctl)\n             * which [is now deprecated](https://github.com/wix/Detox/issues/1371).\n             * If `fbsimctl` is not installed, the command will fail, asking for it to be installed.\n             *\n             * <p/>On Android `setLocation` will work with both Android Emulator (bundled with Android development tools) and Genymotion.\n             * The correct permissions must be set in your app manifest.\n             *\n             * @example await device.setLocation(32.0853, 34.7818);\n             */\n            setLocation(lat: number, lon: number): Promise<void>;\n\n            /**\n             * (iOS only) Override simulator’s status bar.\n             * @platform iOS\n             * @param {config} config status bar configuration.\n             * @example\n             * await device.setStatusBar({\n             *   time: \"12:34\",\n             *   // Set the date or time to a fixed value.\n             *   // If the string is a valid ISO date string it will also set the date on relevant devices.\n             *   dataNetwork: \"wifi\",\n             *   // If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.\n             *   wifiMode: \"failed\",\n             *   // If specified must be one of 'searching', 'failed', or 'active'.\n             *   wifiBars: \"2\",\n             *   // If specified must be 0-3.\n             *   cellularMode: \"searching\",\n             *   // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n             *   cellularBars: \"3\",\n             *   // If specified must be 0-4.\n             *   operatorName: \"A1\",\n             *   // Set the cellular operator/carrier name. Use '' for the empty string.\n             *   batteryState: \"charging\",\n             *   // If specified must be one of 'charging', 'charged', or 'discharging'.\n             *   batteryLevel: \"50\",\n             *   // If specified must be 0-100.\n             *  });\n             */\n            setStatusBar(config: {\n              time?: string,\n              dataNetwork?: \"hide\" | \"wifi\" | \"3g\" | \"4g\" | \"lte\" | \"lte-a\" | \"lte+\" | \"5g\" | \"5g+\" | \"5g-uwb\" | \"5g-uc\",\n              wifiMode?: \"searching\" |\"failed\" | \"active\",\n              wifiBars?: \"0\" | \"1\" | \"2\" | \"3\",\n              cellularMode?: \"notSupported\" | \"searching\" | \"failed\" | \"active\",\n              cellularBars?: \"0\" | \"1\" | \"2\" | \"3\" | \"4\",\n              operatorName?: string;\n              batteryState?: \"charging\" | \"charged\" | \"discharging\",\n              batteryLevel?: BatteryLevel,\n            }): Promise<void>;\n\n            /**\n             * Disable network synchronization mechanism on preferred endpoints. Useful if you want to on skip over synchronizing on certain URLs.\n             *\n             * @example await device.setURLBlacklist(['.*127.0.0.1.*']);\n             */\n            setURLBlacklist(urls: string[]): Promise<void>;\n\n            /**\n             * Temporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.\n             *\n             * <p/>This API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly *busy* (e.g. due to an\n             * endlessly repeating on-screen animation). However, using it inherently suggests that you are likely to resort to applying `sleep()`'s in your test code - testing\n             * that area, **which is not recommended and can never be 100% stable.\n             * **Therefore, as a rule of thumb, test code running \"inside\" a sync-disabled mode must be reduced to the bare minimum.\n             *\n             * <p/>Note: Synchronization is enabled by default, and it gets **reenabled on every launch of a new instance of the app.**\n             *\n             * @example await device.disableSynchronization();\n             */\n            disableSynchronization(): Promise<void>;\n\n            /**\n             * Reenable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a\n             * previous disabling of it through a call to `device.disableSynchronization()`.\n             *\n             * <p/>Warning: Making this call would resume synchronization **instantly**, having its returned promise only resolve when the app becomes idle again.\n             * In other words, this **must only be called after you navigate back to \"the safe zone\", where the app should be able to eventually become idle again**, or it would\n             * remain suspended \"forever\" (i.e. until a safeguard time-out expires).\n             *\n             * @example await device.enableSynchronization();\n             */\n            enableSynchronization(): Promise<void>;\n\n            /**\n             * Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing previously set permissions.\n             *\n             * @example await device.resetContentAndSettings();\n             */\n            resetContentAndSettings(): Promise<void>;\n\n            /**\n             * Returns the current device, ios or android.\n             *\n             * @example\n             * if (device.getPlatform() === 'ios') {\n             *     await expect(loopSwitch).toHaveValue('1');\n             * }\n             */\n            getPlatform(): 'ios' | 'android';\n\n            /**\n             * Takes a screenshot on the device and schedules putting it in the artifacts folder upon completion of the current test.\n             * @param name for the screenshot artifact\n             * @returns a temporary path to the screenshot.\n             * @example\n             * test('Menu items should have logout', async () => {\n             *   const tempPath = await device.takeScreenshot('tap on menu');\n             *   // The temporary path will remain valid until the test completion.\n             *   // Afterwards, the screenshot will be moved, e.g.:\n             *   // * on success, to: <artifacts-location>/✓ Menu items should have Logout/tap on menu.png\n             *   // * on failure, to: <artifacts-location>/✗ Menu items should have Logout/tap on menu.png\n             * });\n             */\n            takeScreenshot(name: string): Promise<string>;\n\n            /**\n             * (iOS only) Saves a view hierarchy snapshot (*.viewhierarchy) of the currently opened application\n             * to a temporary folder and schedules putting it to the artifacts folder upon the completion of\n             * the current test. The file can be opened later in Xcode 12.0 and above.\n             * @see https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:~:text=57933113\n             * @param [name=\"capture\"] optional name for the *.viewhierarchy artifact\n             * @returns a temporary path to the captured view hierarchy snapshot.\n             * @example\n             * test('Menu items should have logout', async () => {\n             *   await device.captureViewHierarchy('myElements');\n             *   // The temporary path will remain valid until the test completion.\n             *   // Afterwards, the artifact will be moved, e.g.:\n             *   // * on success, to: <artifacts-location>/✓ Menu items should have Logout/myElements.viewhierarchy\n             *   // * on failure, to: <artifacts-location>/✗ Menu items should have Logout/myElements.viewhierarchy\n             * });\n             */\n            captureViewHierarchy(name?: string): Promise<string>;\n\n            /**\n             * Dump the current view hierarchy of the app as an XML string.\n             * @param [shouldInjectTestIds=false] whether to inject testIDs into the view hierarchy when missing,\n             * to provide an identifiable reference for each element.\n             * @returns a string containing the XML representation of the view hierarchy.\n             * @example\n             * const viewHierarchy = await device.generateViewHierarchyXml();\n             * const viewHierarchyWithInjectedTestIds = await device.generateViewHierarchyXml(true);\n             * @note enabling shouldInjectTestIds changes the actual elements during the test run, use with caution.\n             */\n            generateViewHierarchyXml(shouldInjectTestIds?: boolean): Promise<string>;\n\n            /**\n             * Simulate shake (iOS Only)\n             */\n            shake(): Promise<void>;\n\n            /**\n             * Toggles device enrollment in biometric auth (TouchID or FaceID) (iOS Only)\n             * @example await device.setBiometricEnrollment(true);\n             * @example await device.setBiometricEnrollment(false);\n             */\n            setBiometricEnrollment(enabled: boolean): Promise<void>;\n\n            /**\n             * Simulates the success of a face match via FaceID (iOS Only)\n             */\n            matchFace(): Promise<void>;\n\n            /**\n             * Simulates the failure of a face match via FaceID (iOS Only)\n             */\n            unmatchFace(): Promise<void>;\n\n            /**\n             * Simulates the success of a finger match via TouchID (iOS Only)\n             */\n            matchFinger(): Promise<void>;\n\n            /**\n             * Simulates the failure of a finger match via TouchID (iOS Only)\n             */\n            unmatchFinger(): Promise<void>;\n\n            /**\n             * Clears the simulator keychain (iOS Only)\n             */\n            clearKeychain(): Promise<void>;\n\n            /**\n             * Simulate press back button (Android Only)\n             * @example await device.pressBack();\n             */\n            pressBack(): Promise<void>;\n\n            /**\n             * (Android Only)\n             * Exposes UiAutomator's UiDevice API (https://developer.android.com/reference/android/support/test/uiautomator/UiDevice).\n             * This is not a part of the official Detox API and therefore may break / change whenever an update to UiDevice or UiAutomator\n             * Gradle dependencies ('androidx.test.uiautomator:uiautomator') is done.\n             *\n             * UIDevice's autogenerated code reference: https://github.com/wix/Detox/blob/master/detox/src/android/espressoapi/UIDevice.js\n             *\n             * @example\n             * // @ts-nocheck\n             * const uiDevice = device.getUiDevice();\n             * const height = await uiDevice.getDisplayHeight();\n             * const width = await uiDevice.getDisplayWidth();\n             * await uiDevice.click(width / 2, height / 2);\n             */\n            getUiDevice(): any;\n\n            /**\n             * (Android Only)\n             * Runs `adb reverse tcp:PORT tcp:PORT` for the current device\n             * to enable network requests forwarding on localhost:PORT (computer<->device).\n             * For more information, see {@link https://www.reddit.com/r/reactnative/comments/5etpqw/what_do_you_call_what_adb_reverse_is_doing|here}.\n             * This is a no-op when running on iOS.\n             */\n            reverseTcpPort(port: number): Promise<void>;\n\n            /**\n             * (Android Only)\n             * Runs `adb reverse --remove tcp:PORT tcp:PORT` for the current device\n             * to disable network requests forwarding on localhost:PORT (computer<->device).\n             * For more information, see {@link https://www.reddit.com/r/reactnative/comments/5etpqw/what_do_you_call_what_adb_reverse_is_doing|here}.\n             * This is a no-op when running on iOS.\n             */\n            unreverseTcpPort(port: number): Promise<void>;\n        }\n\n        /**\n         * @deprecated\n         */\n        type DetoxAny = NativeElement & WaitFor;\n\n        interface ElementFacade {\n            (by: NativeMatcher): IndexableNativeElement;\n        }\n\n        interface IndexableNativeElement extends NativeElement {\n            /**\n             * Choose from multiple elements matching the same matcher using index\n             * @example await element(by.text('Product')).atIndex(2).tap();\n             */\n            atIndex(index: number): NativeElement;\n        }\n\n        interface NativeElement extends NativeElementActions {\n        }\n\n        type SemanticMatchingTypes = 'image' | 'input-field' | 'text' | 'button' | 'scrollview' | 'list' | 'switch' | 'slider' | 'picker' | 'activity-indicator' | 'progress';\n\n        interface ByFacade {\n            /**\n             * by.id will match an id that is given to the view via testID prop.\n             * @example\n             * // In a React Native component add testID like so:\n             * <TouchableOpacity testID={'tap_me'}>\n             * // Then match with by.id:\n             * await element(by.id('tap_me'));\n             * await element(by.id(/^tap_[a-z]+$/));\n             */\n            id(id: string | RegExp): NativeMatcher;\n\n            /**\n             * Find an element by text, useful for text fields, buttons.\n             * @example\n             * await element(by.text('Tap Me'));\n             * await element(by.text(/^Tap .*$/));\n             */\n            text(text: string | RegExp): NativeMatcher;\n\n            /**\n             * Find an element by accessibilityLabel on iOS, or by contentDescription on Android.\n             * @example\n             * await element(by.label('Welcome'));\n             * await element(by.label(/[a-z]+/i));\n             */\n            label(label: string | RegExp): NativeMatcher;\n\n            /**\n             * Find an element by native view type OR semantic type.\n             * Automatically detects if the input is a semantic type or regular class name.\n             * @example \n             * // Semantic types (cross-platform):\n             * await element(by.type('image'));\n             * await element(by.type('button'));\n             * await element(by.type('input-field'));\n             * \n             * // Native class names (platform-specific):\n             * await element(by.type('RCTImageView'));\n             * await element(by.type('android.widget.Button'));\n             */\n            type(typeOrSemanticType: SemanticMatchingTypes | string): NativeMatcher;\n\n            /**\n             * Find an element with an accessibility trait. (iOS only)\n             * @example await element(by.traits(['button']));\n             */\n            traits(traits: string[]): NativeMatcher;\n\n            /**\n             * Collection of web matchers\n             */\n            readonly web: ByWebFacade;\n\n            /**\n             * Collection of system-level matchers\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             */\n            readonly system: BySystemFacade;\n        }\n\n        interface ByWebFacade {\n            /**\n             * Find an element on the DOM tree by its id\n             * @param id\n             * @example\n             * web.element(by.web.id('testingh1'))\n             */\n            id(id: string): WebMatcher;\n\n            /**\n             * Find an element on the DOM tree by its CSS class\n             * @param className\n             * @example\n             * web.element(by.web.className('a'))\n             */\n            className(className: string): WebMatcher;\n\n            /**\n             * Find an element on the DOM tree matching the given CSS selector\n             * @param cssSelector\n             * @example\n             * web.element(by.web.cssSelector('#cssSelector'))\n             */\n            cssSelector(cssSelector: string): WebMatcher;\n\n            /**\n             * Find an element on the DOM tree by its \"name\" attribute\n             * @param name\n             * @example\n             * web.element(by.web.name('sec_input'))\n             */\n            name(name: string): WebMatcher;\n\n            /**\n             * Find an element on the DOM tree by its XPath\n             * @param xpath\n             * @example\n             * web.element(by.web.xpath('//*[@id=\"testingh1-1\"]'))\n             */\n            xpath(xpath: string): WebMatcher;\n\n            /**\n             * Find an <a> element on the DOM tree by its link text (href content)\n             * @param linkText\n             * @example\n             * web.element(by.web.href('disney.com'))\n             */\n            href(linkText: string): WebMatcher;\n\n            /**\n             * Find an <a> element on the DOM tree by its partial link text (href content)\n             * @param linkTextFragment\n             * @example\n             * web.element(by.web.hrefContains('disney'))\n             */\n            hrefContains(linkTextFragment: string): WebMatcher;\n\n            /**\n             * Find an element on the DOM tree by its tag name\n             * @param tag\n             * @example\n             * web.element(by.web.tag('mark'))\n             */\n            tag(tagName: string): WebMatcher;\n\n            /**\n             * (iOS Only) Find an element on the DOM tree by its value\n             * @param value\n             * @example\n             * web.element(by.web.value('hello'))\n             */\n            value(value: string): WebMatcher;\n\n            /**\n             * (iOS Only) Find an element or secured element on the web-view by its accessibility label.\n             * @param text\n             * @example\n             * web.element(by.web.label('Submit')).asSecured()\n             * web.element(by.web.label('Submit'))\n             */\n            label(text: string): MaybeSecuredWebMatcher;\n\n            /**\n             * (iOS Only) Find a secured element on the web-view by its accessibility type.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example\n             * web(by.web.type('textField')).asSecured()\n             */\n            type(type: string): SecuredWebMatcher;\n        }\n\n        interface BySystemFacade {\n            /**\n             * Find an element on the System-level by its label\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             * @example\n             * system.element(by.system.text('Allow'))\n             */\n            label(text: string): SystemMatcher;\n\n            /**\n             * Find an element on the System-level by its type\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             * @example\n             * system.element(by.system.type('button'))\n             */\n            type(type: string): SystemMatcher;\n        }\n\n        interface NativeMatcher {\n            /**\n             * Find an element satisfying all the matchers\n             * @example await element(by.text('Product').and(by.id('product_name'));\n             */\n            and(by: NativeMatcher): NativeMatcher;\n\n            /**\n             * Find an element by a matcher with a parent matcher\n             * @example await element(by.id('Grandson883').withAncestor(by.id('Son883')));\n             */\n            withAncestor(parentBy: NativeMatcher): NativeMatcher;\n\n            /**\n             * Find an element by a matcher with a child matcher\n             * @example await element(by.id('Son883').withDescendant(by.id('Grandson883')));\n             */\n            withDescendant(childBy: NativeMatcher): NativeMatcher;\n        }\n\n        interface WebMatcher {\n            __web__: any; // prevent type coercion\n        }\n\n        interface SecuredWebMatcher {\n            __web__: any; // prevent type coercion\n        }\n\n        interface MaybeSecuredWebMatcher {\n            __web__: any; // prevent type coercion\n        }\n\n        interface SystemMatcher {\n          __system__: any; // prevent type coercion\n        }\n\n        interface ExpectFacade {\n            (element: NativeElement): Expect;\n\n            (webElement: WebElement): WebExpect;\n\n            (securedWebElement: SecuredWebElement): SecuredWebExpect;\n\n            (systemElement: SystemElement): SystemExpect;\n        }\n\n        type MaybeSecuredWebElement<T> = T extends MaybeSecuredWebMatcher ?\n            IndexableMaybeSecuredWebElement & SecuredWebElementFacade :\n            T extends SecuredWebMatcher ? IndexableSecuredWebElement & SecuredWebElementFacade :\n                IndexableWebElement;\n\n        interface WebViewElement {\n            /**\n             * Find a web element by a matcher.\n             * @param webMatcher a web matcher for the web element.\n             */\n            element<T extends WebMatcher>(webMatcher: T): MaybeSecuredWebElement<T>;\n\n            /**\n             * Returns the index-th web-view in the UI hierarchy that is matched by the given matcher.\n             * @param index the index of the web-view.\n             *\n             * @note Currently, supported only for iOS.\n             *\n             * @example await web(by.id('webview')).atIndex(1);\n             */\n            atIndex(index: number): WebViewElement;\n        }\n\n        interface WebFacade extends WebViewElement {\n            /**\n             * Gets the webview element as a testing element.\n             * @param matcher a simple view matcher for the webview element in th UI hierarchy.\n             * If there is only ONE webview element in the UI hierarchy, its NOT a must to supply it.\n             * If there are MORE then one webview element in the UI hierarchy you MUST supply are view matcher.\n             */\n            (matcher?: NativeMatcher): WebViewElement;\n        }\n\n        interface SecuredWebElementFacade {\n            /**\n             * (iOS Only) Gets the secured webview element as a testing element.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             */\n            asSecured(): IndexableSecuredWebElement;\n        }\n\n        interface SystemFacade {\n            /**\n             * Find an element on the System-level using a system matcher.\n             * @param systemMatcher a system matcher for the system element.\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             * @example\n             * system.element(by.system.label('Allow'))\n             */\n            element(systemMatcher: SystemMatcher): IndexableSystemElement;\n        }\n\n        interface PilotFacade extends Pick<Pilot, \"perform\" | \"autopilot\" | \"extendAPICatalog\"> {\n            /**\n             * Initializes the Pilot with the given prompt handler.\n             * Must be called before any other Pilot methods.\n             * @note Wix-Pilot APIs are still in experimental phase and are subject to changes in the near future.\n             * @param promptHandler The prompt handler to use.\n             */\n            init: (promptHandler: PromptHandler) => void;\n            /**\n             * Sets the default values for the Pilot configuration.\n             * This method is not part of the public API and is subject to change.\n             * @internal\n             */\n            setDefaults(defaults: Partial<PilotConfig>): void;\n        }\n\n        type PromptHandler = _PromptHandler;\n\n        interface IndexableSystemElement extends SystemElement {\n            /**\n             * Choose from multiple elements matching the same matcher using index\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await system.element(by.system.type('button')).atIndex(1).tap();\n             */\n            atIndex(index: number): SystemElement;\n        }\n\n        interface SystemElement {\n            /**\n             * Simulate a tap on the element.\n             * @note System APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await system.element(by.system.label('Allow')).tap();\n             */\n            tap(): Promise<void>;\n        }\n\n        interface Expect<R = Promise<void>> {\n\n            /**\n             * Expect the view to be at least N% visible. If no number is provided then defaults to 75%. Negating this\n             * expectation with a `not` expects the view's visible area to be smaller than N%.\n             * @param pct optional integer ranging from 1 to 100, indicating how much percent of the view should be\n             *  visible to the user to be accepted.\n             * @example await expect(element(by.id('mainTitle'))).toBeVisible(35);\n             */\n            toBeVisible(pct?: number): R;\n\n            /**\n             * Negate the expectation.\n             * @example await expect(element(by.id('cancelButton'))).not.toBeVisible();\n             */\n            not: this;\n\n            /**\n             * Expect the view to not be visible.\n             * @example await expect(element(by.id('cancelButton'))).toBeNotVisible();\n             * @deprecated Use `.not.toBeVisible()` instead.\n             */\n            toBeNotVisible(): R;\n\n            /**\n             * Expect the view to exist in the UI hierarchy.\n             * @example await expect(element(by.id('okButton'))).toExist();\n             */\n            toExist(): R;\n\n            /**\n             * Expect the view to not exist in the UI hierarchy.\n             * @example await expect(element(by.id('cancelButton'))).toNotExist();\n             * @deprecated Use `.not.toExist()` instead.\n             */\n            toNotExist(): R;\n\n            /**\n             * Expect the view to be focused.\n             * @example await expect(element(by.id('emailInput'))).toBeFocused();\n             */\n            toBeFocused(): R;\n\n            /**\n             * Expect the view not to be focused.\n             * @example await expect(element(by.id('passwordInput'))).toBeNotFocused();\n             * @deprecated Use `.not.toBeFocused()` instead.\n             */\n            toBeNotFocused(): R;\n\n            /**\n             * In React Native apps, expect UI component of type <Text> to have text.\n             * In native iOS apps, expect UI elements of type UIButton, UILabel, UITextField or UITextViewIn to have inputText with text.\n             * @example await expect(element(by.id('mainTitle'))).toHaveText('Welcome back!);\n             */\n            toHaveText(text: string): R;\n\n            /**\n             * Expects a specific accessibilityLabel, as specified via the `accessibilityLabel` prop in React Native.\n             * On the native side (in both React Native and pure-native apps), that is equivalent to `accessibilityLabel`\n             * on iOS and contentDescription on Android. Refer to Detox's documentation in order to learn about caveats\n             * with accessibility-labels in React Native apps.\n             * @example await expect(element(by.id('submitButton'))).toHaveLabel('Submit');\n             */\n            toHaveLabel(label: string): R;\n\n            /**\n             * In React Native apps, expect UI component to have testID with that id.\n             * In native iOS apps, expect UI element to have accessibilityIdentifier with that id.\n             * @example await expect(element(by.text('Submit'))).toHaveId('submitButton');\n             */\n            toHaveId(id: string): R;\n\n            /**\n             * Expects a toggle-able element (e.g. a Switch or a Check-Box) to be on/checked or off/unchecked.\n             * As a reference, in react-native, this is the equivalent switch component.\n             * @example await expect(element(by.id('switch'))).toHaveToggleValue(true);\n             */\n            toHaveToggleValue(value: boolean): R;\n\n            /**\n             * Expect components like a Switch to have a value ('0' for off, '1' for on).\n             * @example await expect(element(by.id('temperatureDial'))).toHaveValue('25');\n             */\n            toHaveValue(value: any): R;\n\n            /**\n             * Expect Slider to have a position (0 - 1).\n             * Can have an optional tolerance to take into account rounding issues on ios\n             * @example await expect(element(by.id('SliderId'))).toHavePosition(0.75);\n             * @example await expect(element(by.id('SliderId'))).toHavePosition(0.74, 0.1);\n             */\n            toHaveSliderPosition(position: number, tolerance?: number): Promise<void>;\n        }\n\n        interface WaitForFacade {\n            /**\n             * This API polls using the given expectation continuously until the expectation is met. Use manual synchronization with waitFor only as a last resort.\n             * NOTE: Every waitFor call must set a timeout using withTimeout(). Calling waitFor without setting a timeout will do nothing.\n             * @example await waitFor(element(by.id('bigButton'))).toExist().withTimeout(2000);\n             */\n            (element: NativeElement): Expect<WaitFor>;\n        }\n\n        interface WaitFor {\n            /**\n             * Waits for the condition to be met until the specified time (millis) have elapsed.\n             * @example await waitFor(element(by.id('bigButton'))).toExist().withTimeout(2000);\n             */\n            withTimeout(millis: number): Promise<void>;\n\n            /**\n             * Performs the action repeatedly on the element until an expectation is met\n             * @example await waitFor(element(by.text('Item #5'))).toBeVisible().whileElement(by.id('itemsList')).scroll(50, 'down');\n             */\n            whileElement(by: NativeMatcher): NativeElementWaitableActions & WaitFor;\n\n            // TODO: not sure about & WaitFor - check if we can chain whileElement multiple times\n        }\n\n        interface NativeElementWaitableActions {\n\n          /**\n           * Scrolls a given amount of pixels in the provided direction, starting from the provided start positions.\n           * @param pixels - independent device pixels\n           * @param direction - left/right/up/down\n           * @param startPositionX - the X starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically\n           * @param startPositionY - the Y starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically\n           * @example await element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85);\n           * @example await element(by.id('scrollView')).scroll(100, 'up');\n           */\n          scroll(\n            pixels: number,\n            direction: Direction,\n            startPositionX?: number,\n            startPositionY?: number\n          ): Promise<void>;\n        }\n\n        interface NativeElementActions extends NativeElementWaitableActions{\n            /**\n             * Simulate tap on an element\n             * @param point coordinates in the element's coordinate space. Optional (default is the center of the element).\n             * @example await element(by.id('tappable')).tap();\n             * @example await element(by.id('tappable')).tap({ x:5, y:10 });\n             */\n            tap(point?: Point2D): Promise<void>;\n\n            /**\n             * Simulate long press on an element\n             * @param point coordinates in the element's coordinate space. Optional (default is the center of the element).\n             * @param duration custom press duration time, in milliseconds. Optional (defaults to the standard long-press duration for the platform).\n             *      Custom durations should be used cautiously, as they can affect test consistency and user experience expectations.\n             *      They are typically necessary when testing components that behave differently from the platform's defaults or when simulating unique user interactions.\n             * @example await element(by.id('tappable')).longPress();\n             * @example await element(by.id('tappable')).longPress(2000);\n             * @example await element(by.id('tappable')).longPress({ x:5, y:10 });\n             * @example await element(by.id('tappable')).longPress({ x:5, y:10 }, 1500);\n             */\n            longPress(): Promise<void>;\n            longPress(point: Point2D): Promise<void>;\n            longPress(duration: number): Promise<void>;\n            longPress(point: Point2D, duration: number): Promise<void>;\n\n            /**\n             * Simulate long press on an element and then drag it to the position of the target element. (iOS Only)\n             * @example await element(by.id('draggable')).longPressAndDrag(2000, NaN, NaN, element(by.id('target')), NaN, NaN, 'fast', 0);\n             */\n            longPressAndDrag(duration: number, normalizedPositionX: number, normalizedPositionY: number, targetElement: NativeElement,\n                             normalizedTargetPositionX: number, normalizedTargetPositionY: number, speed: Speed, holdDuration: number): Promise<void>;\n\n            /**\n             * Simulate multiple taps on an element.\n             * @param times number of times to tap\n             * @example await element(by.id('tappable')).multiTap(3);\n             */\n            multiTap(times: number): Promise<void>;\n\n            /**\n             * Simulate tap at a specific point on an element.\n             * Note: The point coordinates are relative to the matched element and the element size could change on different devices or even when changing the device font size.\n             * @example await element(by.id('tappable')).tapAtPoint({ x:5, y:10 });\n             * @deprecated Use `.tap()` instead.\n             */\n            tapAtPoint(point: Point2D): Promise<void>;\n\n            /**\n             * Use the builtin keyboard to type text into a text field.\n             * @example await element(by.id('textField')).typeText('passcode');\n             */\n            typeText(text: string): Promise<void>;\n\n            /**\n             * Paste text into a text field.\n             * @example await element(by.id('textField')).replaceText('passcode again');\n             */\n            replaceText(text: string): Promise<void>;\n\n            /**\n             * Clear text from a text field.\n             * @example await element(by.id('textField')).clearText();\n             */\n            clearText(): Promise<void>;\n\n            /**\n             * Taps the backspace key on the built-in keyboard.\n             * @example await element(by.id('textField')).tapBackspaceKey();\n             */\n            tapBackspaceKey(): Promise<void>;\n\n            /**\n             * Taps the return key on the built-in keyboard.\n             * @example await element(by.id('textField')).tapReturnKey();\n             */\n            tapReturnKey(): Promise<void>;\n\n            /**\n             * Scroll to index.\n             * @example await element(by.id('scrollView')).scrollToIndex(10);\n             */\n            scrollToIndex(\n                index: Number\n            ): Promise<void>;\n\n            /**\n             * Scroll to edge.\n             * @param  edge - left|right|top|bottom\n             * @param startPositionX - the X starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically\n             * @param startPositionY - the Y starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically\n             * @example await element(by.id('scrollView')).scrollTo('bottom', NaN, 0.85);\n             * @example await element(by.id('scrollView')).scrollTo('top');\n             */\n            scrollTo(edge: Direction, startPositionX?: number, startPositionY?: number): Promise<void>;\n\n            /**\n             * Adjust slider to position.\n             * @example await element(by.id('slider')).adjustSliderToPosition(0.75);\n             */\n            adjustSliderToPosition(newPosition: number): Promise<void>;\n\n            /**\n             * Swipes in the provided direction at the provided speed, started from percentage.\n             * @param speed default: `fast`\n             * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]`\n             * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]`\n             * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]`\n             * @example await element(by.id('scrollView')).swipe('down');\n             * @example await element(by.id('scrollView')).swipe('down', 'fast');\n             * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5);\n             * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2);\n             * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5);\n             */\n            swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise<void>;\n\n            /**\n             * Sets a picker view’s column to the given value. This function supports both date pickers and general picker views. (iOS Only)\n             * Note: When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles.\n             * See [here](https://wix.github.io/Detox/docs/api/device-object-api#9-launch-with-a-specific-language-ios-only) for more information.\n             *\n             * @param column number of datepicker column (starts from 0)\n             * @param value string value in set column (must be correct)\n             * @example\n             * await expect(element(by.type('UIPickerView'))).toBeVisible();\n             * await element(by.type('UIPickerView')).setColumnToValue(1,\"6\");\n             * await element(by.type('UIPickerView')).setColumnToValue(2,\"34\");\n             */\n            setColumnToValue(column: number, value: string): Promise<void>;\n\n            /**\n             * Sets the date of a date-picker according to the specified date-string and format.\n             * @param dateString Textual representation of a date (e.g. '2023/01/01'). Should be in coherence with the format specified by `dateFormat`.\n             * @param dateFormat Format of `dateString`: Generally either 'ISO8601' or an explicitly specified format (e.g. 'yyyy/MM/dd'); It should\n             *      follow the rules of NSDateFormatter for iOS and DateTimeFormatter for Android.\n             * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n             * @example\n             * await element(by.id('datePicker')).setDatePickerDate('2023-01-01T00:00:00Z', 'ISO8601');\n             * await element(by.id('datePicker')).setDatePickerDate(new Date().toISOString(), 'ISO8601');\n             * await element(by.id('datePicker')).setDatePickerDate('2023/01/01', 'yyyy/MM/dd');\n             */\n            setDatePickerDate(dateString: string, dateFormat: string): Promise<void>;\n\n            /**\n             * Triggers a given [accessibility action]{@link https://reactnative.dev/docs/accessibility#accessibility-actions}.\n             * @param actionName - name of the accessibility action\n             * @example await element(by.id('view')).performAccessibilityAction('activate');\n             */\n            performAccessibilityAction(actionName: string): Promise<void>\n\n            /**\n             * Pinches in the given direction with speed and angle. (iOS only)\n             * @param angle value in radiant, default is `0`\n             * @example\n             * await expect(element(by.id('PinchableScrollView'))).toBeVisible();\n             * await element(by.id('PinchableScrollView')).pinchWithAngle('outward', 'slow', 0);\n             * @deprecated Use `.pinch()` instead.\n             */\n            pinchWithAngle(direction: PinchDirection, speed: Speed, angle: number): Promise<void>;\n\n            /**\n             * Pinches with the given scale, speed, and angle. (iOS only)\n             * @param speed default is `fast`\n             * @param angle value in radiant, default is `0`\n             * @example\n             * await element(by.id('PinchableScrollView')).pinch(1.1);\n             * await element(by.id('PinchableScrollView')).pinch(2.0);\n             * await element(by.id('PinchableScrollView')).pinch(0.001);\n             */\n            pinch(scale: number, speed?: Speed, angle?: number): Promise<void>;\n\n            /**\n             * Takes a screenshot of the element and schedules putting it in the artifacts folder upon completion of the current test.\n             * For more information, see {@link https://wix.github.io/Detox/docs/api/screenshots#element-level-screenshots}\n             * @param {string} name for the screenshot artifact\n             * @returns {Promise<string>} a temporary path to the screenshot.\n             * @example\n             * test('Menu items should have logout', async () => {\n             *   const imagePath = await element(by.id('menuRoot')).takeScreenshot('tap on menu');\n             *   // The temporary path will remain valid until the test completion.\n             *   // Afterwards, the screenshot will be moved, e.g.:\n             *   // * on success, to: <artifacts-location>/✓ Menu items should have Logout/tap on menu.png\n             *   // * on failure, to: <artifacts-location>/✗ Menu items should have Logout/tap on menu.png\n             * });\n             */\n            takeScreenshot(name: string): Promise<string>;\n\n            /**\n             * Retrieves the OS-dependent attributes of an element.\n             * If there are multiple matches, it returns an array of attributes for all matched elements.\n             * For detailed information, refer to {@link https://wix.github.io/Detox/docs/api/actions-on-element/#getattributes}\n             *\n             * @example\n             * test('Get the attributes for my text element', async () => {\n             *    const attributes = await element(by.id('myText')).getAttributes()\n             *    const jestExpect = require('expect');\n             *    // 'visible' attribute available on both iOS and Android\n             *    jestExpect(attributes.visible).toBe(true);\n             *    // 'activationPoint' attribute available on iOS only\n             *    jestExpect(attributes.activationPoint.x).toHaveValue(50);\n             *    // 'width' attribute available on Android only\n             *    jestExpect(attributes.width).toHaveValue(100);\n             * })\n             */\n            getAttributes(): Promise<IosElementAttributes | AndroidElementAttributes | { elements: IosElementAttributes[] } | { elements: AndroidElementAttributes[] } >;\n        }\n\n        interface WebExpect<R = Promise<void>> {\n            /**\n             * Negate the expectation.\n             * @example await expect(web.element(by.web.id('sessionTimeout'))).not.toExist();\n             */\n            not: this;\n\n            /**\n             * Expect the element content to have the `text` supplied\n             * @param text expected to be on the element content\n             * @example\n             * await expect(web.element(by.web.id('checkoutButton'))).toHaveText('Proceed to check out');\n             */\n            toHaveText(text: string): R;\n\n            /**\n             * Expect the view to exist in the webview DOM tree.\n             * @example await expect(web.element(by.web.id('submitButton'))).toExist();\n             */\n            toExist(): R;\n        }\n\n        interface SecuredWebExpect<R = Promise<void>> {\n            /**\n             * (iOS Only) Negate the expectation.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await expect(web.element(by.web.id('sessionTimeout')).asSecured()).not.toExist();\n             */\n            not: this;\n\n            /**\n             * (iOS Only) Expect the view to exist in the webview DOM tree.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await expect(web.element(by.web.id('submitButton')).asSecured()).toExist();\n             */\n            toExist(): R;\n        }\n\n        interface SystemExpect<R = Promise<void>> {\n          /**\n           * Negate the expectation.\n           * @note System APIs are still in experimental phase and are subject to changes in the near future.\n           * @example await expect(system.element(by.system.text('Allow'))).not.toExist();\n           */\n          not: this;\n\n          /**\n           * Expect the view to exist in the system-level.\n           * @note System APIs are still in experimental phase and are subject to changes in the near future.\n           * @example await expect(system.element(by.system.text('Allow'))).toExist();\n           */\n          toExist(): R;\n        }\n\n        interface SecuredWebElement extends SecuredWebElementActions {\n        }\n\n        interface SecuredWebElementActions {\n            /**\n             * (iOS Only) Tap on a secured web element.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await web.element(by.web.type('textField')).asSecured().tap();\n             */\n            tap(): Promise<void>;\n\n            /**\n             * (iOS Only) Type text into a web element.\n             * @param text to type\n             * @param isContentEditable whether the element is content-editable, default is false. Ignored on iOS.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await web.element(by.web.type('textField')).asSecured().typeText('passcode');\n             */\n            typeText(text: string, isContentEditable: boolean): Promise<void>;\n\n            /**\n             * (iOS Only) Replaces the input content with the new text.\n             * @param text to replace with the old content.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await web.element(by.web.type('textField')).asSecured().replaceText('passcode');\n             */\n            replaceText(text: string): Promise<void>;\n\n            /**\n             * (iOS Only) Clears the input content.\n             * @note On Android, not working for content-editable elements.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await web.element(by.web.type('textField')).asSecured().clearText();\n             */\n            clearText(): Promise<void>;\n        }\n\n        interface IndexableWebElement extends WebElement {\n            /**\n             * Choose from multiple elements matching the same matcher using index.\n             * @example await web.element(by.web.tag('p')).asSecured().atIndex(2).tap();\n             */\n            atIndex(index: number): WebElement;\n        }\n\n        interface IndexableSecuredWebElement extends SecuredWebElement {\n            /**\n             * (iOS Only) Choose from multiple elements matching the same matcher using index.\n             * @note Secured-Web APIs are still in experimental phase and are subject to changes in the near future.\n             * @example await web.element(by.web.type('textField')).asSecured().atIndex(2).tap();\n             */\n            atIndex(index: number): SecuredWebElement & SecuredWebElementFacade;\n        }\n\n        interface IndexableMaybeSecuredWebElement extends WebElement {\n            /**\n             * Choose from multiple elements matching the same matcher using index\n             */\n            atIndex(index: number): WebElement & SecuredWebElementFacade;\n        }\n\n        interface WebElement extends WebElementActions {\n        }\n\n        interface WebElementActions {\n            tap(): Promise<void>;\n\n            /**\n             * Type text into a web element.\n             * @param text to type\n             * @param isContentEditable whether the element is content-editable, default is false. Ignored on iOS.\n             */\n            typeText(text: string, isContentEditable: boolean): Promise<void>;\n\n            /**\n             * Replaces the input content with the new text.\n             * @note On Android, not working for content-editable elements.\n             * @param text to replace with the old content.\n             */\n            replaceText(text: string): Promise<void>;\n\n            /**\n             * Clears the input content.\n             * @note On Android, not working for content-editable elements.\n             */\n            clearText(): Promise<void>;\n\n            /**\n             * Scrolling to the view, the element top position will be at the top of the screen.\n             */\n            scrollToView(): Promise<void>;\n\n            /**\n             * Gets the input content\n             */\n            getText(): Promise<string>;\n\n            /**\n             * Calls the focus function on the element\n             */\n            focus(): Promise<void>;\n\n            /**\n             * Selects all the input content.\n             * @note On Android, it works only for content-editable elements.\n             */\n            selectAllText(): Promise<void>;\n\n            /**\n             * Moves the input cursor to the end of the content.\n             * @note On Android, it works only for content-editable elements.\n             */\n            moveCursorToEnd(): Promise<void>;\n\n            /**\n             * Running a JavaScript function on the element.\n             * The first argument to the function will be the element itself.\n             * The rest of the arguments will be forwarded to the JavaScript function as is.\n             *\n             * @param script a callback function in stringified form, or a plain function reference\n             * without closures, bindings etc. that will be converted to a string.\n             * @param args optional args to pass to the script\n             *\n             * @example\n             * await webElement.runScript('(el) => el.click()');\n             * await webElement.runScript(function setText(element, text) {\n             *   element.textContent = text;\n             * }, ['Custom Title']);\n             */\n            runScript(script: string, args?: unknown[]): Promise<any>;\n            runScript<F>(script: (...args: any[]) => F, args?: unknown[]): Promise<F>;\n\n            /**\n             * Gets the current page url\n             */\n            getCurrentUrl(): Promise<string>;\n\n            /**\n             * Gets the current page title\n             */\n            getTitle(): Promise<string>;\n        }\n\n        type Direction = 'left' | 'right' | 'top' | 'bottom' | 'up' | 'down';\n\n        type PinchDirection = 'outward' | 'inward'\n\n        type Orientation = 'portrait' | 'landscape';\n\n        type Speed = 'fast' | 'slow';\n\n        interface LanguageAndLocale {\n            language?: string;\n            locale?: string;\n        }\n\n        /**\n         *  Source for string definitions is https://github.com/wix/AppleSimulatorUtils\n         */\n        interface DevicePermissions {\n            location?: LocationPermission;\n            notifications?: NotificationsPermission;\n            calendar?: CalendarPermission;\n            camera?: CameraPermission;\n            contacts?: ContactsPermission;\n            health?: HealthPermission;\n            homekit?: HomekitPermission;\n            medialibrary?: MediaLibraryPermission;\n            microphone?: MicrophonePermission;\n            motion?: MotionPermission;\n            photos?: PhotosPermission;\n            reminders?: RemindersPermission;\n            siri?: SiriPermission;\n            speech?: SpeechPermission;\n            faceid?: FaceIDPermission;\n            userTracking?: UserTrackingPermission;\n        }\n\n        type BasicPermissionState = 'YES' | 'NO' | 'unset';\n        type ExtendedPermissionState = 'YES' | 'NO' | 'unset' | 'limited';\n        type LocationPermission = 'always' | 'inuse' | 'never' | 'unset';\n\n        type CameraPermission = BasicPermissionState;\n        type ContactsPermission = ExtendedPermissionState;\n        type CalendarPermission = BasicPermissionState;\n        type HealthPermission = BasicPermissionState;\n        type HomekitPermission = BasicPermissionState;\n        type MediaLibraryPermission = BasicPermissionState;\n        type MicrophonePermission = BasicPermissionState;\n        type MotionPermission = BasicPermissionState;\n        type PhotosPermission = ExtendedPermissionState;\n        type RemindersPermission = BasicPermissionState;\n        type SiriPermission = BasicPermissionState;\n        type SpeechPermission = BasicPermissionState;\n        type NotificationsPermission = BasicPermissionState;\n        type FaceIDPermission = BasicPermissionState;\n        type UserTrackingPermission = BasicPermissionState;\n\n        interface DeviceLaunchAppConfig {\n            /**\n             * Restart the app\n             * Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, if the app isn't running, it will launch a new instance. default is false\n             */\n            newInstance?: boolean;\n            /**\n             * Set runtime permissions\n             * Grant or deny runtime permissions for your application.\n             */\n            permissions?: DevicePermissions;\n            /**\n             * Launch from URL\n             * Mock opening the app from URL to test your app's deep link handling mechanism.\n             */\n            url?: string;\n            /**\n             * Optional parameter to specify source application bundle id when opening the app from URL (iOS Only).\n             */\n            sourceApp?: string;\n            /**\n             * Launch with user notifications\n             */\n            userNotification?: any;\n            /**\n             * Launch with user activity\n             */\n            userActivity?: any;\n            /**\n             * Similar to {@link Detox.DeviceLaunchAppConfig.delete | { delete: true }}, but instead of uninstalling and installing the app,\n             * it runs {@link Detox.Device.resetAppState | device.resetAppState()} instead.\n             * @example\n             * await device.launchApp({resetAppState: true});\n             */\n            resetAppState?: boolean;\n            /**\n             * Launch into a fresh installation\n             * A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary again), default is false.\n             */\n            delete?: boolean;\n            /**\n             * Arguments to pass-through into the app.\n             * Refer to the [dedicated guide](https://wix.github.io/Detox/docs/api/launch-args) for complete details.\n             */\n            launchArgs?: Record<string, any>;\n            /**\n             * Launch config for specifying the native language and locale\n             */\n            languageAndLocale?: LanguageAndLocale;\n        }\n\n        // Element Attributes Shared Among iOS and Android\n        interface ElementAttributes {\n            /**\n             * Whether or not the element is enabled for user interaction.\n             */\n            enabled: boolean;\n            /**\n             * The identifier of the element. Matches accessibilityIdentifier on iOS, and the main view tag, on Android - both commonly holding the component's test ID in React Native apps.\n             */\n            identifier: string;\n            /**\n             * Whether the element is visible. On iOS, visibility is calculated for the activation point. On Android, the attribute directly holds the value returned by View.getLocalVisibleRect()).\n             */\n            visible: boolean;\n            /**\n             * The text value of any textual element.\n             */\n            text?: string;\n            /**\n             * The label of the element. Largely matches accessibilityLabel for ios, and contentDescription for android.\n             * Refer to Detox's documentation (`toHaveLabel()` subsection) in order to learn about caveats associated with\n             * this property in React Native apps.\n             */\n            label?: string;\n            /**\n             * The placeholder text value of the element. Matches hint on android.\n             */\n            placeholder?: string;\n            /**\n             * The value of the element, where applicable.\n             * Matches accessibilityValue, on iOS.\n             * For example: the position of a slider, or whether a checkbox has been marked (Android).\n             */\n            value?: unknown;\n        }\n\n        interface IosElementAttributeFrame extends ElementAttributeFrame { }\n\n        interface ElementAttributeFrame {\n            x: number;\n            y: number;\n            width: number;\n            height: number;\n        }\n\n        interface IosElementAttributeInsets {\n            right: number;\n            top: number;\n            left: number;\n            bottom: number;\n        }\n\n        // iOS Specific Attributes\n        interface IosElementAttributes extends ElementAttributes {\n            /**\n             * The [activation point]{@link https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint} of the element, in element coordinate space.\n             */\n            activationPoint: Point2D;\n            /**\n             * The activation point of the element, in normalized percentage ([0.0, 1.0]).\n             */\n            normalizedActivationPoint: Point2D;\n            /**\n             * Whether the element is hittable at the activation point.\n             */\n            hittable: boolean;\n            /**\n             * The frame of the element, in screen coordinate space.\n             */\n            frame: IosElementAttributeFrame;\n            /**\n             * The frame of the element, in container coordinate space.\n             */\n            elementFrame: IosElementAttributeFrame;\n            /**\n             * The bounds of the element, in element coordinate space.\n             */\n            elementBounds: IosElementAttributeFrame;\n            /**\n             * The safe area insets of the element, in element coordinate space.\n             */\n            safeAreaInsets: IosElementAttributeInsets;\n            /**\n             * The safe area bounds of the element, in element coordinate space.\n             */\n            elementSafeBounds: IosElementAttributeFrame;\n            /**\n             * The date of the element (if it is a date picker).\n             */\n            date?: string;\n            /**\n             * The normalized slider position (if it is a slider).\n             */\n            normalizedSliderPosition?: number;\n            /**\n             * The content offset (if it is a scroll view).\n             */\n            contentOffset?: Point2D;\n            /**\n             * The content inset (if it is a scroll view).\n             */\n            contentInset?: IosElementAttributeInsets;\n            /**\n             * The adjusted content inset (if it is a scroll view).\n             */\n            adjustedContentInset?: IosElementAttributeInsets;\n            /**\n             * @example \"<CALayer: 0x600003f759e0>\"\n             */\n            layer: string;\n        }\n\n        // Android Specific Attributes\n        interface AndroidElementAttributes extends ElementAttributes {\n            /**\n             * The OS visibility type associated with the element: visible, invisible or gone.\n             */\n            visibility: 'visible' | 'invisible' | 'gone';\n            /**\n             * @deprecated\n             * Width of the element, in pixels.\n             */\n            width: number;\n            /**\n             * @deprecated\n             * Height of the element, in pixels.\n             */\n            height: number;\n            /**\n             * Elevation of the element.\n             */\n            elevation: number;\n            /**\n             * Alpha value for the element.\n             */\n            alpha: number;\n            /**\n             * Whether the element is the one currently in focus.\n             */\n            focused: boolean;\n            /**\n             * The frame of the element, in screen coordinate space.\n             */\n            frame: ElementAttributeFrame;\n            /**\n             * The text size for the text element.\n             */\n            textSize?: number;\n            /**\n             * The length of the text element (character count).\n             */\n            length?: number;\n        }\n    }\n}\n\nexport = Detox;\n"
  },
  {
    "path": "detox/globals.d.ts",
    "content": "import Detox = require('./detox');\n\ndeclare global {\n  const detox: Detox.DetoxExportWrapper;\n  const device: Detox.DetoxExportWrapper['device'];\n  const element: Detox.DetoxExportWrapper['element'];\n  const waitFor: Detox.DetoxExportWrapper['waitFor'];\n  const expect: Detox.DetoxExportWrapper['expect'];\n  const by: Detox.DetoxExportWrapper['by'];\n  const web: Detox.DetoxExportWrapper['web'];\n  const system: Detox.DetoxExportWrapper['system'];\n  const copilot: Detox.DetoxExportWrapper['copilot'];\n  const pilot: Detox.DetoxExportWrapper['pilot'];\n\n  namespace NodeJS {\n    interface Global {\n      detox: Detox.DetoxExportWrapper;\n      device: Detox.DetoxExportWrapper['device'];\n      element: Detox.DetoxExportWrapper['element'];\n      waitFor: Detox.DetoxExportWrapper['waitFor'];\n      expect: Detox.DetoxExportWrapper['expect'];\n      by: Detox.DetoxExportWrapper['by'];\n      web: Detox.DetoxExportWrapper['web'];\n      system: Detox.DetoxExportWrapper['system'];\n      copilot: Detox.DetoxExportWrapper['copilot'];\n      pilot: Detox.DetoxExportWrapper['pilot'];\n    }\n  }\n}\n"
  },
  {
    "path": "detox/index.d.ts",
    "content": "/// <reference path=\"detox.d.ts\" />\n/// <reference path=\"globals.d.ts\" />\n\ndeclare const detox: Detox.DetoxExportWrapper;\nexport = detox;\n"
  },
  {
    "path": "detox/index.js",
    "content": "function create() {\n  if (process.env.DETOX_CONFIG_SNAPSHOT_PATH) {\n    return require('./src/realms/secondary');\n  } else {\n    return require('./src/realms/primary');\n  }\n}\n\n/** @type {Detox.DetoxExportWrapper} */\nmodule.exports = global['__detox__']\n  ? global['__detox__'].clientApi\n  : create();\n"
  },
  {
    "path": "detox/internals.d.ts",
    "content": "/// <reference types=\"node\" />\n/// <reference path=\"index.d.ts\"/>\n\ndeclare global {\n  namespace DetoxInternals {\n    type DetoxStatus = 'inactive' | 'init' | 'active' | 'cleanup';\n\n    type Facade = {\n      //#region Initialization\n      /**\n       * Use with a caution, when you still have no config, yet need to avoid {@link Facade#init}\n       */\n      resolveConfig(options?: Partial<DetoxInitOptions>): Promise<RuntimeConfig>;\n\n      /**\n       * Returns one of statuses depending on what’s going with the current Detox context:\n       *\n       * `inactive` – before `init()` and after `cleanup()` is called.\n       * `init` – while `init()` is executing.\n       * `active` – after `init()` and before `cleanup()` is called.\n       * `cleanup` – while `cleanup()` is executing.\n       */\n      getStatus(): DetoxStatus;\n\n      /**\n       * Starts a new Detox test session with the provided configuration.\n       * See {@link https://wix.github.io/Detox/docs/api/internals} for more details.\n       */\n      init(options?: Partial<DetoxInitOptions>): Promise<void>;\n\n      /**\n       * This is the phase where Detox loads its expectation library and boots a device.\n       * You don't need to call it separately unless you use `init({ workerId: null })` override.\n       */\n      installWorker(options?: Partial<DetoxInstallWorkerOptions>): Promise<void>;\n\n      /**\n       * Deallocates the device.\n       * Most Client API (device, by, element, expect) will stop working, except for the logger.\n       */\n      uninstallWorker(): Promise<void>;\n\n      /**\n       * This method should be called when the main or child process is about to exit.\n       * See {@link https://wix.github.io/Detox/docs/api/internals} for more details.\n       */\n      cleanup(): Promise<void>;\n      //#endregion\n\n      //#region Lifecycle\n      /**\n       * Reports that the test runner started executing a test suite, e.g. a `beforeAll` hook or a first test.\n       */\n      onRunDescribeStart(event: {\n        /** Test suite name */\n        name: string;\n      }): Promise<void>;\n      /**\n       * Reports that the test runner started executing a specific test.\n       */\n      onTestStart(event: {\n        /** Test name */\n        title: string;\n        /** Test name including the ancestor suite titles */\n        fullName: string;\n        /**\n         * N-th time this test is running, if there is a retry mechanism.\n         *\n         * @default 1\n         */\n        invocations?: number;\n        status: 'running';\n      }): Promise<void>;\n      /**\n       * Reports about an error in the midst of `beforeAll`, `beforeEach`, `afterEach`, `afterAll` or any other hook.\n       */\n      onHookFailure(event: {\n        error: Error | string;\n        /**\n         * @example 'beforeAll'\n         * @example 'afterEach'\n         */\n        hook: string;\n      }): Promise<void>;\n      /**\n       * Reports about an error in the midst of a test function, `test` or `it`.\n       */\n      onTestFnFailure(event: {\n        error: Error | string;\n      }): Promise<void>;\n      /**\n       * Reports the final status of the test, `passed` or `failed`.\n       */\n      onTestDone(event: {\n        /** Test name */\n        title: string;\n        /** Test name including the ancestor suite titles */\n        fullName: string;\n        /**\n         * N-th time this test is running, if there is a retry mechanism.\n         *\n         * @default 1\n         */\n        invocations?: number;\n        status: 'passed' | 'failed';\n        /** Whether a timeout was the reason for why the test failed. */\n        timedOut?: boolean;\n      }): Promise<void>;\n      /**\n       * Reports that the test runner has finished executing a test suite, e.g. all the `afterAll` hooks have been executed or the last test has finished running.\n       */\n      onRunDescribeFinish(event: {\n        /** Test suite name */\n        name: string;\n      }): Promise<void>;\n      /**\n       * Workaround for Jest exiting abruptly in --bail mode.\n       * Makes sure that all workers and their test environments are properly torn down.\n       * @param [permanent] - forbids further retries\n       */\n      unsafe_conductEarlyTeardown(permanent?: boolean): Promise<void>;\n      /**\n       * Reports to Detox CLI about passed and failed test files.\n       * The failed test files might be re-run again if\n       * {@link Detox.DetoxTestRunnerConfig#retries} is set to a non-zero.\n       *\n       * @param testResults - reports about test files\n       */\n      reportTestResults(testResults: DetoxTestFileReport[]): Promise<void>;\n      //#endregion\n\n      readonly config: RuntimeConfig;\n      readonly log: Detox.Logger;\n      readonly session: SessionState;\n      readonly tracing: {\n        /**\n         * Creates a readable stream of the currently recorded events in Chrome Trace Event format.\n         *\n         * @see {@link https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU}\n         * @see {import('trace-event-lib').DurationBeginEvent}\n         * @see {import('trace-event-lib').DurationEndEvent}\n         * @see {import('trace-event-lib').InstantEvent}\n         */\n        createEventStream(): NodeJS.ReadableStream;\n      };\n\n      /**\n       * Not documented on purpose.\n       * Provides direct access to the object which holds the device driver, websocket client, matchers, expectations, etc.\n       */\n      readonly worker: Worker;\n    }\n\n    interface Worker extends Detox.DetoxExportWrapper {\n      readonly id: string;\n    }\n\n    type DetoxInitOptions = {\n      cwd: string;\n      /**\n       * @internal\n       */\n      argv: Record<string, unknown>;\n      testRunnerArgv: Record<string, unknown>;\n      override: Partial<Detox.DetoxConfig>;\n      /** @inheritDoc */\n      global: NodeJS.Global | {};\n      /**\n       * Worker ID. Used to distinguish allocated workers in parallel test execution environment.\n       *\n       * If explicitly set to null, tells {@link Facade#init} to skip {@link Facade#installWorker} call.\n       * Useful for complex test runner integrations, where you have to install the worker via a separate call,\n       * when the environment is ready for that.\n       *\n       * @default 'worker'\n       */\n      workerId: string | null;\n    };\n\n    type DetoxInstallWorkerOptions = {\n      /**\n       * Used for integration with sandboxed test environments.\n       * {@link DetoxInternals.Facade#setup} might override {@link Console} methods\n       * to integrate it with Detox loggeing subsystem.\n       */\n      global: NodeJS.Global | {};\n      /**\n       * Worker ID. Used to distinguish allocated workers in parallel test execution environment.\n       *\n       * @default 'worker'\n       */\n      workerId: string;\n    };\n\n    type DetoxTestFileReport = {\n      /**\n       * Global or relative path to the failed test file.\n       */\n      testFilePath: string;\n      /**\n       * Whether the test passed or not.\n       */\n      success: boolean;\n      /**\n       * Top-level error if the entire test file failed.\n       */\n      testExecError?: { name?: string; message: string; stack?: string; };\n      /**\n       * If the test failed, it should tell whether the failure is permanent.\n       * Permanent failure means that the test file should not be re-run.\n       *\n       * @default false\n       * @see {Detox.DetoxTestRunnerConfig#retries}\n       */\n      isPermanentFailure?: boolean;\n    };\n\n    type SessionState = Readonly<{\n      /**\n       * Randomly generated ID for the entire Detox test session, including retries.\n       */\n      id: string;\n      /**\n       * Signalizes that the test session is being torn down.\n       * Experimental feature for Jest --bail mode.\n       */\n      unsafe_earlyTeardown?: boolean;\n      /**\n       * Results of test file executions. Primarily used for Detox CLI retry mechanism.\n       */\n      testResults: DetoxTestFileReport[];\n      /**\n       * Retry index of the test session: 0..retriesCount.\n       */\n      testSessionIndex: number;\n      /**\n       * Count of Detox contexts with a worker installed.\n       * Oversimplified, it reflects the count of allocated devices in the current test session.\n       *\n       * @see {Facade#init}\n       * @see {Facade#installWorker}\n       */\n      workersCount: number;\n    }>;\n\n    type RuntimeConfig = Readonly<{\n      configurationName: string;\n      commands: Readonly<RuntimeCommandsGroup>[];\n\n      /**\n       * Dictionary of app configurations,\n       * where the keys are defined by {@link Detox.DetoxAppConfig#name}\n       * or equal to \"default\" if the name is not configured.\n       */\n      apps: Record<string, Readonly<Detox.DetoxAppConfig>>;\n      artifacts: Readonly<RuntimeArtifactsConfig>;\n      behavior: Readonly<Detox.DetoxBehaviorConfig>;\n      cli: Readonly<CLIConfig>;\n      device: Readonly<Detox.DetoxDeviceConfig>;\n      logger: Readonly<Detox.DetoxLoggerConfig>;\n      testRunner: Readonly<Detox.DetoxTestRunnerConfig>;\n      session: Readonly<Detox.DetoxSessionConfig>;\n    }>;\n\n    type RuntimeArtifactsConfig = {\n      rootDir: string;\n      pathBuilder: string;\n      plugins: Readonly<{\n        log: Readonly<Detox.DetoxLogArtifactsPluginConfig>;\n        screenshot: Readonly<Detox.DetoxScreenshotArtifactsPluginConfig>;\n        video: Readonly<Detox.DetoxVideoArtifactsPluginConfig>;\n        instruments: Readonly<Detox.DetoxInstrumentsArtifactsPluginConfig>;\n        uiHierarchy: Readonly<Detox.DetoxUIHierarchyArtifactsPluginConfig>;\n        [pluginId: string]: unknown;\n      }>;\n    };\n\n    type RuntimeCommandsGroup = {\n      appName?: string;\n      build?: string;\n      start?: string;\n    };\n\n    type CLIConfig = Readonly<Partial<{\n      appLaunchArgs: string;\n      artifactsLocation: string;\n      captureViewHierarchy: string;\n      cleanup: boolean;\n      configPath: string;\n      configuration: string;\n      debugSynchronization: number;\n      deviceBootArgs: string;\n      deviceName: string;\n      forceAdbInstall: boolean;\n      gpu: string;\n      inspectBrk: boolean;\n      headless: boolean;\n      jestReportSpecs: boolean;\n      keepLockFile: boolean;\n      loglevel: string;\n      readonlyEmu: boolean;\n      recordLogs: string;\n      recordPerformance: string;\n      recordVideos: string;\n      retries: number;\n      reuse: string;\n      takeScreenshots: string;\n      useCustomLogger: string;\n      repl: boolean | 'auto';\n    }>>;\n  }\n}\n\ndeclare const detox: DetoxInternals.Facade;\nexport = detox;\n\n"
  },
  {
    "path": "detox/internals.js",
    "content": "function create() {\n  const context = require('./index');\n  const DetoxInternalsFacade = require('./src/realms/DetoxInternalsFacade');\n\n  return new DetoxInternalsFacade(context);\n}\n\n/** @type {DetoxInternals.Facade} */\nmodule.exports = global['__detox__']\n  ? global['__detox__'].internalsApi\n  : create();\n"
  },
  {
    "path": "detox/ios/.tbzignore",
    "content": "build\nDerivedData\nCOSTouchVisualizer/ExampleObjC\nCOSTouchVisualizer/ExampleSwift\nDetoxUserNotificationTests\nSocketRocket/TestChat\nSocketRocket/TestChatServer\nSocketRocket/Tests\nSocketRocket/TestSupport\n"
  },
  {
    "path": "detox/ios/Detox/Actions/NSObject+DetoxActions.h",
    "content": "//\n//  NSObject+DetoxActions.h\n//  Detox\n//\n//  Created by Leo Natan on 11/16/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface NSObject (DetoxActions)\n\n- (void)dtx_tapAtAccessibilityActivationPoint;\n- (void)dtx_tapAtAccessibilityActivationPointWithNumberOfTaps:(NSUInteger)numberOfTaps;\n- (void)dtx_tapAtPoint:(CGPoint)point numberOfTaps:(NSUInteger)numberOfTaps NS_SWIFT_NAME(dtx_tap(at:numberOfTaps:));\n- (void)dtx_longPressAtAccessibilityActivationPoint;\n- (void)dtx_longPressAtAccessibilityActivationPointForDuration:(NSTimeInterval)duration;\n- (void)dtx_longPressAtPoint:(CGPoint)point duration:(NSTimeInterval)duration NS_SWIFT_NAME(dtx_longPress(at:duration:));\n- (void)dtx_longPressAtPoint:(CGPoint)normalizedPoint duration:(NSTimeInterval)duration thenDragToElement:(NSObject*)target normalizedTargetPoint:(CGPoint)normalizedTargetPoint velocity:(CGFloat)velocity thenHoldForDuration:(NSTimeInterval)lastHoldDuration\n\tNS_SWIFT_NAME(dtx_longPress(at:duration:target:normalizedTargetPoint:velocity:lastHoldDuration:));\n- (void)dtx_swipeWithNormalizedOffset:(CGPoint)normalizedOffset velocity:(CGFloat)velocity NS_SWIFT_NAME(dtx_swipe(withNormalizedOffset:velocity:));\n- (void)dtx_swipeWithNormalizedOffset:(CGPoint)normalizedOffset velocity:(CGFloat)velocity normalizedStartingPoint:(CGPoint)normalizedStartingPoint NS_SWIFT_NAME(dtx_swipe(withNormalizedOffset:velocity:normalizedStartingPoint:));\n- (void)dtx_pinchWithScale:(CGFloat)scale velocity:(CGFloat)velocity angle:(CGFloat)angle;\n\n- (void)dtx_clearText;\n- (void)dtx_typeText:(NSString*)text;\n- (void)dtx_typeText:(NSString*)text atTextRange:(nullable UITextRange*)textRange;\n- (void)dtx_replaceText:(NSString*)text;\n- (NSURL *)dtx_takeScreenshot:(nullable NSString*)name;;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Actions/NSObject+DetoxActions.m",
    "content": "//\n//  NSObject+DetoxActions.m\n//  Detox\n//\n//  Created by Leo Natan on 11/16/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"NSObject+DetoxActions.h\"\n#import \"NSObject+DetoxUtils.h\"\n#import \"UIApplication+DTXAdditions.h\"\n\n@import Darwin;\n@import AudioToolbox;\n\n#import \"DTXAppleInternals.h\"\n#import \"DTXSyntheticEvents.h\"\n#import \"NSURL+DetoxUtils.h\"\n#import \"UIView+DetoxUtils.h\"\n#import \"UIImage+DetoxUtils.h\"\n\n#import <objc/message.h>\n\nlong long getKeyCodeForCharacter(unichar character) {\n    // special cases (non-printable chars)\n    switch (character) {\n        case '\\n': return 0x28; // Return\n        case '\\t': return 0x2B; // Tab\n        case '\\b': return 0x2A; // Backspace\n        case ' ':  return 0x2C; // Space\n    }\n\n    return character;\n}\n\nid createKeyEventWithCharacter(NSString *character) {\n    Class KeyEventClass = NSClassFromString(@\"UIPhysicalKeyboardEvent\");\n    if (!KeyEventClass) {\n        NSLog(@\"UIPhysicalKeyboardEvent class not found\");\n        return nil;\n    }\n\n    id keyEvent = [[KeyEventClass alloc] init];\n    if (!keyEvent) {\n        NSLog(@\"Failed to create UIPhysicalKeyboardEvent instance\");\n        return nil;\n    }\n\n    unichar firstChar = [character characterAtIndex:0];\n    long long keyCode = getKeyCodeForCharacter(firstChar);\n    long long modifierFlags = 0; // No modifiers\n    int inputFlags = 0;\n    long long source = 0;\n\n    // Define selectors\n    SEL setModifiedInputSel = NSSelectorFromString(@\"set_modifiedInput:\");\n    SEL setUnmodifiedInputSel = NSSelectorFromString(@\"set_unmodifiedInput:\");\n    SEL setKeyCodeSel = NSSelectorFromString(@\"set_keyCode:\");\n    SEL setModifierFlagsSel = NSSelectorFromString(@\"_setModifierFlags:\");\n    SEL setInputFlagsSel = NSSelectorFromString(@\"set_inputFlags:\");\n    SEL setSourceSel = NSSelectorFromString(@\"setSource:\");\n    SEL setExternalEventSel = NSSelectorFromString(@\"set_externalEvent:\");\n\n    // Set properties\n    if ([keyEvent respondsToSelector:setModifiedInputSel]) {\n        ((void (*)(id, SEL, NSString *))objc_msgSend)(keyEvent, setModifiedInputSel, character);\n    }\n    if ([keyEvent respondsToSelector:setUnmodifiedInputSel]) {\n        ((void (*)(id, SEL, NSString *))objc_msgSend)(keyEvent, setUnmodifiedInputSel, character);\n    }\n    if ([keyEvent respondsToSelector:setKeyCodeSel]) {\n        ((void (*)(id, SEL, long long))objc_msgSend)(keyEvent, setKeyCodeSel, keyCode);\n    }\n    if ([keyEvent respondsToSelector:setModifierFlagsSel]) {\n        ((void (*)(id, SEL, long long))objc_msgSend)(keyEvent, setModifierFlagsSel, modifierFlags);\n    }\n    if ([keyEvent respondsToSelector:setInputFlagsSel]) {\n        ((void (*)(id, SEL, int))objc_msgSend)(keyEvent, setInputFlagsSel, inputFlags);\n    }\n    if ([keyEvent respondsToSelector:setSourceSel]) {\n        ((void (*)(id, SEL, long long))objc_msgSend)(keyEvent, setSourceSel, source);\n    }\n    if ([keyEvent respondsToSelector:setExternalEventSel]) {\n        ((void (*)(id, SEL, BOOL))objc_msgSend)(keyEvent, setExternalEventSel, NO);\n    }\n\n    return keyEvent;\n}\n\n@implementation NSObject (DetoxActions)\n\n- (void)dtx_tapAtAccessibilityActivationPoint\n{\n    [self dtx_tapAtPoint:self.dtx_accessibilityActivationPointInViewCoordinateSpace numberOfTaps:1];\n}\n\n- (void)dtx_tapAtAccessibilityActivationPointWithNumberOfTaps:(NSUInteger)numberOfTaps\n{\n    [self dtx_tapAtPoint:self.dtx_accessibilityActivationPointInViewCoordinateSpace numberOfTaps:numberOfTaps];\n}\n\n- (void)dtx_tapAtPoint:(CGPoint)point numberOfTaps:(NSUInteger)numberOfTaps\n{\n    if(self.dtx_switchView != nil && numberOfTaps == 1)\n    {\n        //Attempt a long press on the switch, rather than tap.\n        [self.dtx_switchView dtx_longPressAtPoint:point duration:0.7];\n        return;\n    }\n\n    NSParameterAssert(numberOfTaps >= 1);\n\n    UIView* view = self.dtx_view;\n    UIWindow* window = view.window;\n    CGPoint viewPoint = [self dtx_convertRelativePointToViewCoordinateSpace:point];\n\n    [view dtx_assertHittableAtPoint:viewPoint];\n\n    CGPoint windowPoint = [window convertPoint:viewPoint fromView:view];\n\n    for (NSUInteger idx = 0; idx < numberOfTaps; idx++) {\n        [DTXSyntheticEvents touchAlongPath:@[@(windowPoint)] relativeToWindow:window holdDurationOnFirstTouch:0.0 holdDurationOnLastTouch:0.0];\n    }\n}\n\n\n- (void)dtx_longPressAtAccessibilityActivationPoint\n{\n    [self dtx_longPressAtAccessibilityActivationPointForDuration:1.0];\n}\n\n- (void)dtx_longPressAtAccessibilityActivationPointForDuration:(NSTimeInterval)duration\n{\n    [self dtx_longPressAtPoint:self.dtx_accessibilityActivationPointInViewCoordinateSpace duration:duration];\n}\n\n- (void)dtx_longPressAtPoint:(CGPoint)point duration:(NSTimeInterval)duration\n{\n    UIView* view = self.dtx_view;\n    UIWindow* window = view.window;\n    CGPoint viewPoint = [self dtx_convertRelativePointToViewCoordinateSpace:point];\n\n    [view dtx_assertHittableAtPoint:viewPoint];\n\n    CGPoint windowPoint = [window convertPoint:viewPoint fromView:view];\n    [DTXSyntheticEvents touchAlongPath:@[@(windowPoint)] relativeToWindow:window holdDurationOnFirstTouch:0.0 holdDurationOnLastTouch:duration];\n}\n\n#define DTX_ENFORCE_NORMALIZED_STARTING_POINT(normalizedStartingPoint) \\\nif((isnan(normalizedStartingPoint.x) == NO && (normalizedStartingPoint.x < 0 || normalizedStartingPoint.x > 1)) || isnan(normalizedStartingPoint.y) == NO && (normalizedStartingPoint.y < 0 || normalizedStartingPoint.y > 1)) \\\n{ \\\nDTXAssert(NO, @\"Bad normalized starting point provided.\"); \\\n}\n\n- (void)dtx_longPressAtPoint:(CGPoint)normalizedPoint duration:(NSTimeInterval)duration thenDragToElement:(NSObject*)target normalizedTargetPoint:(CGPoint)normalizedTargetPoint velocity:(CGFloat)velocity thenHoldForDuration:(NSTimeInterval)lastHoldDuration\n{\n    NSParameterAssert(velocity > 0.0);\n    DTX_ENFORCE_NORMALIZED_STARTING_POINT(normalizedPoint);\n    DTX_ENFORCE_NORMALIZED_STARTING_POINT(normalizedTargetPoint);\n\n    CGPoint calcNormalizedPoint = DTXCalcNormalizedPoint(normalizedPoint, self);\n    CGPoint calcNormalizedTargetPoint = DTXCalcNormalizedPoint(normalizedTargetPoint, target);\n\n    [self.dtx_view dtx_assertHittableAtPoint:[self.dtx_view.coordinateSpace convertPoint:calcNormalizedPoint fromCoordinateSpace:self.dtx_view.window.screen.coordinateSpace]];\n    [target.dtx_view dtx_assertHittableAtPoint:[target.dtx_view.coordinateSpace convertPoint:calcNormalizedTargetPoint fromCoordinateSpace:target.dtx_view.window.screen.coordinateSpace]];\n\n    // Converting end point to the window coordinate space of the view we are going to drag\n    // Setting the startPoint for better code readbility\n    CGPoint startPoint = calcNormalizedPoint;\n    CGPoint endPoint = [self.dtx_view.window.coordinateSpace convertPoint:calcNormalizedTargetPoint fromCoordinateSpace:target.dtx_view.window.coordinateSpace];\n\n    NSMutableArray<NSValue*>* points = [NSMutableArray new];\n\n    // Add start point\n    [points addObject:@(startPoint)];\n\n    velocity = (UIApplication.dtx_panVelocity * velocity);\n    // Find number of points appropriate for the speed\n    CGFloat xDiff = endPoint.x - startPoint.x;\n    CGFloat yDiff = endPoint.y - startPoint.y;\n    NSInteger numOfPoints = lround(fmax(fabs(xDiff) / velocity, fabs(yDiff) / velocity));\n\n    // Generate points in between\n    CGFloat xDiffDelta = xDiff / numOfPoints;\n    CGFloat yDiffDelta = yDiff / numOfPoints;\n    for (NSUInteger idx = 1; idx < numOfPoints; idx++) {\n        CGPoint point = CGPointMake(startPoint.x + idx * xDiffDelta, startPoint.y + idx * yDiffDelta);\n        [points addObject:@(point)];\n    }\n\n    // Add end point\n    [points addObject:@(endPoint)];\n    // This is an ugly hack needed to solve a mystery with a missing last point in the trajectory. We add one more point with the same delta after the end. The OS will happily ignore it.\n    // It is criticul to add a point with the same pace in order to insure it works for all cases. If you use point with a different direction or just (0,0) the OS will not ignore it.\n    CGPoint point = CGPointMake(startPoint.x + (numOfPoints + 1) * xDiffDelta, startPoint.y + (numOfPoints + 1) * yDiffDelta);\n    [points addObject:@(point)];\n\n    [DTXSyntheticEvents touchAlongPath:points relativeToWindow:self.dtx_view.window holdDurationOnFirstTouch:duration holdDurationOnLastTouch:lastHoldDuration];\n}\n\nstatic CGPoint DTXCalcNormalizedPoint(CGPoint normalizedPoint, NSObject* element)\n{\n    UIWindow* window = element.dtx_view.window;\n    UIView* view = element.dtx_view;\n\n    CGRect safeBounds = element.dtx_safeAreaBounds;\n    CGRect safeBoundsInScreenSpace = [window.screen.coordinateSpace convertRect:safeBounds fromCoordinateSpace:view.coordinateSpace];\n\n    CGPoint activationPoint = element.dtx_accessibilityActivationPointInViewCoordinateSpace;\n    CGPoint windowConvertedActivationPoint = [window.coordinateSpace convertPoint:activationPoint fromCoordinateSpace:view.coordinateSpace];\n\n    CGFloat calcX = !isnan(normalizedPoint.x) ? CGRectGetMinX(safeBoundsInScreenSpace) + CGRectGetWidth(safeBoundsInScreenSpace) * normalizedPoint.x : windowConvertedActivationPoint.x;\n\n    CGFloat calcY = !isnan(normalizedPoint.y) ? CGRectGetMinY(safeBoundsInScreenSpace) + CGRectGetHeight(safeBoundsInScreenSpace) * normalizedPoint.y : windowConvertedActivationPoint.y;\n\n    return CGPointMake(calcX, calcY);\n}\n\nstatic void _DTXApplySwipe(UIWindow* window, CGPoint startPoint, CGPoint endPoint, CGFloat velocity)\n{\n    NSCAssert(CGPointEqualToPoint(startPoint, endPoint) == NO, @\"Start and end points for swipe cannot be equal\");\n\n    NSMutableArray<NSValue*>* points = [NSMutableArray new];\n\n    for (CGFloat p = 0.0; p <= 1.0; p += 1.0 / (20.0 * velocity))\n    {\n        CGFloat x = LNLinearInterpolate(startPoint.x, endPoint.x, p);\n        CGFloat y = LNLinearInterpolate(startPoint.y, endPoint.y, p);\n\n        [points addObject:@(CGPointMake(x, y))];\n    }\n\n    [DTXSyntheticEvents touchAlongPath:points relativeToWindow:window holdDurationOnFirstTouch:0.0 holdDurationOnLastTouch:0.0];\n}\n\n- (void)dtx_swipeWithNormalizedOffset:(CGPoint)normalizedOffset velocity:(CGFloat)velocity\n{\n    [self dtx_swipeWithNormalizedOffset:normalizedOffset velocity:velocity normalizedStartingPoint:CGPointMake(NAN, NAN)];\n}\n\n#define DTX_CALC_SWIPE_START_END_POINTS(safeBoundsInScreenSpace, screenBounds, normalizedStartingPoint, normalizedOffset, main, other, CGRectGetMinMain, CGRectGetMinOther, CGRectGetMidMain, CGRectGetMidOther, CGRectGetMaxMain, CGRectGetMainSize, CGRectGetOtherSize) \\\nCGFloat mainStart = !isnan(normalizedStartingPoint.main) ? CGRectGetMinMain(safeBoundsInScreenSpace) + CGRectGetMainSize(safeBoundsInScreenSpace) * normalizedStartingPoint.main : MAX(MIN(CGRectGetMidMain(screenBounds) - 0.5 * normalizedOffset.main * CGRectGetMainSize(screenBounds), CGRectGetMaxMain(safeBoundsInScreenSpace) - 1), CGRectGetMinMain(safeBoundsInScreenSpace) + 1); \\\nstartPoint.main = mainStart; \\\nstartPoint.other = !isnan(normalizedStartingPoint.other) ? CGRectGetMinOther(safeBoundsInScreenSpace) + CGRectGetOtherSize(safeBoundsInScreenSpace) * normalizedStartingPoint.other : CGRectGetMidOther(safeBoundsInScreenSpace); \\\nendPoint.main = MIN(MAX(mainStart + normalizedOffset.main * CGRectGetMainSize(screenBounds), CGRectGetMinMain(screenBounds) + 1), CGRectGetMaxMain(screenBounds) - 1); \\\nendPoint.other = !isnan(normalizedStartingPoint.other) ? CGRectGetMinOther(safeBoundsInScreenSpace) + CGRectGetOtherSize(safeBoundsInScreenSpace) * normalizedStartingPoint.other : CGRectGetMidOther(safeBoundsInScreenSpace);\n\n- (void)dtx_swipeWithNormalizedOffset:(CGPoint)normalizedOffset velocity:(CGFloat)velocity normalizedStartingPoint:(CGPoint)normalizedStartingPoint\n{\n    NSParameterAssert(velocity > 0.0);\n    DTX_ENFORCE_NORMALIZED_STARTING_POINT(normalizedStartingPoint);\n\n    if(normalizedOffset.x == 0 && normalizedOffset.y == 0)\n    {\n        return;\n    }\n\n    CGPoint startPoint;\n    CGPoint endPoint;\n\n    UIWindow* window = self.dtx_view.window;\n    UIView* view = self.dtx_view;\n\n    CGRect safeBounds = self.dtx_safeAreaBounds;\n    CGRect safeBoundsInScreenSpace = [window.screen.coordinateSpace convertRect:safeBounds fromCoordinateSpace:view.coordinateSpace];\n    CGRect screenBounds = window.screen.bounds;\n\n    if(normalizedOffset.x != 0)\n    {\n        DTX_CALC_SWIPE_START_END_POINTS(safeBoundsInScreenSpace, screenBounds, normalizedStartingPoint, normalizedOffset, x, y, CGRectGetMinX, CGRectGetMinY, CGRectGetMidX, CGRectGetMidY, CGRectGetMaxX, CGRectGetWidth, CGRectGetHeight);\n    }\n    else\n    {\n        DTX_CALC_SWIPE_START_END_POINTS(safeBoundsInScreenSpace, screenBounds, normalizedStartingPoint, normalizedOffset, y, x, CGRectGetMinY, CGRectGetMinX, CGRectGetMidY, CGRectGetMidX, CGRectGetMaxY, CGRectGetHeight, CGRectGetWidth);\n    }\n\n\n    [view dtx_assertHittableAtPoint:[view.coordinateSpace convertPoint:startPoint fromCoordinateSpace:window.screen.coordinateSpace]];\n\n    startPoint = [window.coordinateSpace convertPoint:startPoint fromCoordinateSpace:window.screen.coordinateSpace];\n    endPoint = [window.coordinateSpace convertPoint:endPoint fromCoordinateSpace:window.screen.coordinateSpace];\n\n    _DTXApplySwipe(window, startPoint, endPoint, 1.0 / velocity);\n}\n\nstatic void _DTXApplyPinch(UIWindow* window, CGPoint startPoint1, CGPoint endPoint1, CGPoint startPoint2, CGPoint endPoint2, CGFloat velocity)\n{\n    NSMutableArray<NSValue*>* points1 = [NSMutableArray new];\n    NSMutableArray<NSValue*>* points2 = [NSMutableArray new];\n\n    for (CGFloat p = 0.0; p <= 1.0; p += 1.0 / (30.0 * velocity))\n    {\n        CGFloat x = LNLinearInterpolate(startPoint1.x, endPoint1.x, p);\n        CGFloat y = LNLinearInterpolate(startPoint1.y, endPoint1.y, p);\n\n        [points1 addObject:@(CGPointMake(x, y))];\n\n        x = LNLinearInterpolate(startPoint2.x, endPoint2.x, p);\n        y = LNLinearInterpolate(startPoint2.y, endPoint2.y, p);\n\n        [points2 addObject:@(CGPointMake(x, y))];\n    }\n\n    [DTXSyntheticEvents touchAlongMultiplePaths:@[points1, points2] relativeToWindow:window holdDurationOnFirstTouch:0.0 holdDurationOnLastTouch:0.0];\n}\n\nstatic void DTXCalcPinchStartEndPoints(CGRect bounds, CGFloat pixelsScale, CGFloat angle, CGPoint* startPoint1, CGPoint* endPoint1, CGPoint* startPoint2, CGPoint* endPoint2)\n{\n    *startPoint1 = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));\n    *startPoint2 = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));\n\n    CGFloat x = CGRectGetMinX(bounds);\n    CGFloat y = CGRectGetMinY(bounds);\n    CGFloat w = CGRectGetWidth(bounds);\n    CGFloat h = CGRectGetHeight(bounds);\n    CGFloat alpha = atan((0.5 * h) / (0.5 * w));\n    if(angle <= alpha)\n    {\n        *endPoint1 = CGPointMake(x + w, CGRectGetMidY(bounds) - 0.5 * w * tan(angle));\n        *endPoint2 = CGPointMake(x, CGRectGetMidY(bounds) + 0.5 * w * tan(angle));\n    }\n    else if(angle <= M_PI - alpha)\n    {\n        *endPoint1 = CGPointMake(CGRectGetMidX(bounds) + 0.5 * h * tan(M_PI_2 - angle), y);\n        *endPoint2 = CGPointMake(CGRectGetMidX(bounds) - 0.5 * h * tan(M_PI_2 - angle), y + h);\n    }\n    else\n    {\n        *endPoint1 = CGPointMake(x, CGRectGetMidY(bounds) - 0.5 * w * tan(M_PI - angle));\n        *endPoint2 = CGPointMake(x + w, CGRectGetMidY(bounds) + 0.5 * w * tan(M_PI - angle));\n    }\n\n    endPoint1->x = LNLinearInterpolate(startPoint1->x, endPoint1->x, pixelsScale);\n    endPoint1->y = LNLinearInterpolate(startPoint1->y, endPoint1->y, pixelsScale);\n    endPoint2->x = LNLinearInterpolate(startPoint2->x, endPoint2->x, pixelsScale);\n    endPoint2->y = LNLinearInterpolate(startPoint2->y, endPoint2->y, pixelsScale);\n}\n\nDTX_ALWAYS_INLINE\nstatic CGFloat clamp(CGFloat v, CGFloat min, CGFloat max)\n{\n    return MIN(MAX(v, min), max);\n}\n\n- (void)dtx_pinchWithScale:(CGFloat)scale velocity:(CGFloat)velocity angle:(CGFloat)angle\n{\n    NSParameterAssert(velocity > 0.0);\n    NSParameterAssert(scale > 0.0);\n\n    if(scale == 1.0)\n    {\n        return;\n    }\n\n    UIView* view = self.dtx_view;\n    UIWindow* window = view.window;\n    CGRect safeBounds = self.dtx_safeAreaBounds;\n\n    CGPoint startPoint1;\n    CGPoint endPoint1;\n    CGPoint startPoint2;\n    CGPoint endPoint2;\n\n    scale = clamp(scale, 0.5005, 1.9995);\n    //There is point symmetry in a rectangle and two fingers—normalize angle to [0, pi).\n    //Negative angles wrap around 180 degrees (pi).\n    angle = fmod(angle, M_PI);\n    if(angle < 0)\n    {\n        angle += M_PI;\n    }\n\n    if(scale < 1.0)\n    {\n        DTXCalcPinchStartEndPoints(safeBounds, 1.0 - scale, angle, &endPoint1, &startPoint1, &endPoint2, &startPoint2);\n    }\n    else\n    {\n        DTXCalcPinchStartEndPoints(safeBounds, scale - 1.0, angle, &startPoint1, &endPoint1, &startPoint2, &endPoint2);\n    }\n\n    [self dtx_assertHittableAtPoint:startPoint1];\n    [self dtx_assertHittableAtPoint:startPoint2];\n\n    startPoint1 = [window convertPoint:startPoint1 fromView:view];\n    endPoint1 = [window convertPoint:endPoint1 fromView:view];\n    startPoint2 = [window convertPoint:startPoint2 fromView:view];\n    endPoint2 = [window convertPoint:endPoint2 fromView:view];\n\n    _DTXApplyPinch(window, startPoint1, endPoint1, startPoint2, endPoint2, 1.0 / velocity);\n}\n\nstatic UIView* _isViewOrDescendantFirstResponder(UIView* view)\n{\n    id currentFirstResponder = view.window.firstResponder;\n\n    if([currentFirstResponder isKindOfClass:UIView.class] == NO)\n    {\n        return nil;\n    }\n\n    if(currentFirstResponder != nil && [currentFirstResponder isDescendantOfView:view])\n    {\n        return currentFirstResponder;\n    }\n\n    return nil;\n}\n\nstatic UIView* _ensureFirstResponderIfNeeded(UIView* view)\n{\n    if(view.window.isKeyWindow == NO)\n    {\n        [view.window makeKeyWindow];\n    }\n\n    UIView* firstResponder = _isViewOrDescendantFirstResponder(view);\n    if(firstResponder != nil)\n    {\n        return firstResponder;\n    }\n\n    // Tap on the element to make expectedFirstResponderView a first responder.\n    [view dtx_tapAtAccessibilityActivationPoint];\n\n    firstResponder = _isViewOrDescendantFirstResponder(view);\n    if(firstResponder == nil && [view becomeFirstResponder])\n    {\n        firstResponder = view;\n    }\n\n    if(firstResponder == nil)\n    {\n        DTXCViewAssert(firstResponder == nil, firstResponder.dtx_elementDebugAttributes, @\"Failed to make view “%@” first responder\", view.dtx_shortDescription);\n    }\n\n    return firstResponder;\n}\n\nstatic BOOL _assertFirstResponderSupportsTextInput(UIView* firstResponder)\n{\n    if([firstResponder conformsToProtocol:@protocol(UITextInput)])\n    {\n        return YES;\n    }\n\n    DTXCViewAssert(NO, firstResponder.dtx_elementDebugAttributes, @\"First responder “%@” does not conform to “UITextInput” protocol\", firstResponder);\n\n    return NO;\n}\n\nstatic void _ensureSelectionAtRange(id<UITextInput> textInput, UITextRange* textRange)\n{\n    if(textRange == nil)\n    {\n        //If none provided, move selection to end of document.\n        textRange = [textInput textRangeFromPosition:textInput.endOfDocument toPosition:textInput.endOfDocument];\n    }\n\n    textInput.selectedTextRange = textRange;\n}\n\n__attribute__((constructor))\nstatic void _DTXFixupKeyboard(void)\n{\n    static char const *const controllerPrefBundlePath = \"/System/Library/PrivateFrameworks/TextInput.framework/TextInput\";\n    __unused void *handle = dlopen(controllerPrefBundlePath, RTLD_LAZY);\n\n    TIPreferencesController* controller = TIPreferencesController.sharedPreferencesController;\n    if([controller respondsToSelector:@selector(setAutocorrectionEnabled:)] == YES)\n    {\n        controller.autocorrectionEnabled = NO;\n    }\n    else\n    {\n        [controller setValue:@NO forPreferenceKey:@\"KeyboardAutocorrection\"];\n    }\n\n    if([controller respondsToSelector:@selector(setPredictionEnabled:)])\n    {\n        controller.predictionEnabled = NO;\n    }\n    else\n    {\n        [controller setValue:@NO forPreferenceKey:@\"KeyboardPrediction\"];\n    }\n\n    [controller setValue:@YES forPreferenceKey:@\"DidShowGestureKeyboardIntroduction\"];\n    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)\n    {\n        [controller setValue:@YES forPreferenceKey:@\"DidShowContinuousPathIntroduction\"];\n    }\n\n    [controller synchronizePreferences];\n}\n\nstatic void _DTXTypeText(NSString* text)\n{\n    NSUInteger rangeIdx = 0;\n    while (rangeIdx < text.length)\n    {\n        NSRange range = [text rangeOfComposedCharacterSequenceAtIndex:rangeIdx];\n\n        NSString* grapheme = [text substringWithRange:range];\n\n        [UIKeyboardImpl.sharedInstance setShift:NO autoshift:NO];\n\n        id keyEvent = createKeyEventWithCharacter(grapheme);\n\n        [UIKeyboardImpl.sharedInstance.taskQueue performTask:^(id ctx) {\n            [UIKeyboardImpl.sharedInstance _handleKeyEvent:keyEvent executionContext:ctx];\n\n            NSArray* sounds = @[@1104, @1155, @1156];\n            AudioServicesPlaySystemSound([sounds[grapheme.hash % 3] unsignedIntValue]);\n        }];\n\n        [UIKeyboardImpl.sharedInstance.taskQueue waitUntilAllTasksAreFinished];\n\n        [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];\n\n\n        [UIKeyboardImpl.sharedInstance removeCandidateList];\n\n        rangeIdx += range.length;\n    }\n}\n\n- (void)dtx_clearText\n{\n    UIView* view = self.dtx_view;\n    UIView<UITextInput>* firstResponder = (id)_ensureFirstResponderIfNeeded(view);\n    _assertFirstResponderSupportsTextInput(firstResponder);\n\n    UITextPosition* beginningOfDocument = firstResponder.beginningOfDocument;\n    UITextPosition* endOfDocument = firstResponder.endOfDocument;\n\n    UITextRange* range = [firstResponder textRangeFromPosition:beginningOfDocument toPosition:endOfDocument];\n    if(range.isEmpty == YES)\n    {\n        return;\n    }\n\n    //Select entire text range\n    firstResponder.selectedTextRange = range;\n    [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];\n    //Delete it\n    _DTXTypeText(@\"\\b\");\n}\n\n- (void)dtx_typeText:(NSString*)text\n{\n    [self dtx_typeText:text atTextRange:nil];\n}\n\n- (void)dtx_typeText:(NSString*)text atTextRange:(UITextRange*)textRange\n{\n    UIView* view = self.dtx_view;\n    UIView<UITextInput>* firstResponder = (id)_ensureFirstResponderIfNeeded(view);\n    _assertFirstResponderSupportsTextInput(firstResponder);\n    _ensureSelectionAtRange(firstResponder, textRange);\n\n    _DTXTypeText(text);\n}\n\n- (void)dtx_replaceText:(NSString*)text\n{\n    UIView* view = self.dtx_view;\n    UIView<UITextInput>* firstResponder = (id)_ensureFirstResponderIfNeeded(view);\n    _assertFirstResponderSupportsTextInput(firstResponder);\n\n    BOOL isControl = [firstResponder isKindOfClass:UIControl.class];\n    BOOL isTextField = [firstResponder isKindOfClass:UITextField.class];\n    BOOL isTextView = [firstResponder isKindOfClass:UITextView.class];\n    UITextView* textView = (UITextView*)firstResponder;\n\n    if(isControl == YES)\n    {\n        [(UIControl*)firstResponder sendActionsForControlEvents:UIControlEventEditingDidBegin];\n    }\n\n    if(isTextField == YES)\n    {\n        [NSNotificationCenter.defaultCenter postNotificationName:UITextFieldTextDidBeginEditingNotification object:firstResponder];\n    }\n\n    if(isTextView == YES)\n    {\n        if([textView.delegate respondsToSelector:@selector(textViewDidBeginEditing:)])\n        {\n            [textView.delegate textViewDidBeginEditing:textView];\n        }\n    }\n\n    UITextPosition* beginningOfDocument = firstResponder.beginningOfDocument;\n    UITextPosition* endOfDocument = firstResponder.endOfDocument;\n\n    UITextRange* range = [firstResponder textRangeFromPosition:beginningOfDocument toPosition:endOfDocument];\n\n    [firstResponder replaceRange:range withText:text];\n\n    if(isControl == YES)\n    {\n        [(UIControl*)firstResponder sendActionsForControlEvents:UIControlEventEditingChanged];\n        [(UIControl*)firstResponder sendActionsForControlEvents:UIControlEventEditingDidEnd];\n    }\n\n    if(isTextField == YES)\n    {\n        [NSNotificationCenter.defaultCenter postNotificationName:UITextFieldTextDidChangeNotification object:firstResponder];\n        [NSNotificationCenter.defaultCenter postNotificationName:UITextFieldTextDidEndEditingNotification object:firstResponder];\n    }\n\n    if(isTextView == YES)\n    {\n        if([textView.delegate respondsToSelector:@selector(textViewDidChange:)])\n        {\n            [textView.delegate textViewDidChange:textView];\n        }\n        if([textView.delegate respondsToSelector:@selector(textViewDidEndEditing:)])\n        {\n            [textView.delegate textViewDidEndEditing:textView];\n        }\n    }\n}\n\n- (NSURL *)dtx_takeScreenshot:(nullable NSString*)name\n{\n    UIImage *image = [self.dtx_view dtx_imageFromView];\n    NSURL *path = [NSURL elementsScreenshotPath];\n    NSString *fileName;\n    if (name != nil) {\n        fileName = [NSString stringWithFormat:@\"ImageScreenshot_%@.png\", name];\n    } else {\n        fileName = [NSString stringWithFormat:@\"ImageScreenshot_%p.png\", self];\n    }\n    [image dtx_saveToPath:path fileName:fileName];\n\n    return [path URLByAppendingPathComponent:fileName isDirectory:false];;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIApplication+DetoxActions.swift",
    "content": "//\n//  UIApplication+DetoxActions.swift\n//  Detox\n//\n//  Created by brent.kelly on 13/01/2023.\n//  Copyright © 2023 Wix. All rights reserved.\n//\n\nimport UIKit\n\nextension UIApplication {\n\t@available(iOS 16.0, *)\n\tclass func dtx_setOrientation(_ mask: UIInterfaceOrientationMask) {\n\t\tlet windowScene = UIWindow.dtx_keyWindowScene() as? UIWindowScene\n\t\twindowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: mask))\n\n\t\tlet keyWindow = UIWindow.dtx_keyWindow\n\t\tkeyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIDatePicker+DetoxActions.h",
    "content": "//\n//  UIDatePicker+DetoxActions.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIDatePicker (DetoxActions)\n\n- (void)dtx_adjustToDate:(NSDate*)date;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIDatePicker+DetoxActions.m",
    "content": "//\n//  UIDatePicker+DetoxActions.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIDatePicker+DetoxActions.h\"\n#import \"UIView+DetoxUtils.h\"\n\n@implementation UIDatePicker (DetoxActions)\n\n- (void)dtx_adjustToDate:(NSDate*)date\n{\n\t[self dtx_assertHittable];\n\t\n\tNSDate* previousDate = self.date;\n\t\n\t[self setDate:date animated:YES];\n\t\n\tif([previousDate isEqualToDate:date] == NO)\n\t{\n\t\t[self sendActionsForControlEvents:UIControlEventValueChanged];\n\t}\n\t\n\t//TODO: Is Waiting needed?\n\tdispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{\n\t\t//Noop\n\t});\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIDevice+DetoxActions.h",
    "content": "//\n//  UIDevice+DetoxActions.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/30/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIDevice (DetoxActions)\n\n+ (void)dtx_setOrientation:(UIDeviceOrientation)deviceOrientation;\n+ (void)dtx_shake;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIDevice+DetoxActions.m",
    "content": "//\n//  UIDevice+DetoxActions.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/30/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIDevice+DetoxActions.h\"\n#import \"DTXAppleInternals.h\"\n#import \"UIWindow+DetoxUtils.h\"\n\n@implementation UIDevice (DetoxActions)\n\n+ (void)dtx_setOrientation:(UIDeviceOrientation)deviceOrientation\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\tDTXAssert(UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone || [[NSBundle.mainBundle objectForInfoDictionaryKey:@\"UIRequiresFullScreen\"] boolValue] == YES, @\"Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad.\");\n\t[[UIDevice currentDevice] setOrientation:deviceOrientation animated:YES];\n}\n\n+ (void)dtx_shake\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\t\n\tUIApplication *application = UIApplication.sharedApplication;\n\t\n\tUIWindow* window = UIWindow.dtx_keyWindow;\n\tUIMotionEvent *motionEvent = [application _motionEvent];\n\t\n\t[motionEvent setShakeState:1];\n\t[motionEvent _setSubtype:UIEventSubtypeMotionShake];\n\t[application sendEvent:motionEvent];\n\t[window motionBegan:UIEventSubtypeMotionShake withEvent:motionEvent];\n\t[window motionEnded:UIEventSubtypeMotionShake withEvent:motionEvent];\n}\n\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIPickerView+DetoxActions.h",
    "content": "//\n//  UIPickerView+DetoxActions.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIPickerView (DetoxActions)\n\n- (void)dtx_setComponent:(NSInteger)component toValue:(id)value;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIPickerView+DetoxActions.m",
    "content": "//\n//  UIPickerView+DetoxActions.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIPickerView+DetoxActions.h\"\n#import \"UIView+DetoxMatchers.h\"\n#import \"UIView+DetoxUtils.h\"\n\n@implementation UIPickerView (DetoxActions)\n\n- (void)dtx_setComponent:(NSInteger)component toValue:(id)value\n{\n\t[self dtx_assertHittable];\n\t\n\tDTXViewAssert(self.dataSource != nil && self.delegate != nil, self.dtx_elementDebugAttributes, @\"The picker view's data source and/or delegate are nil\");\n\t\n\tNSInteger componentCount = [self.dataSource numberOfComponentsInPickerView:self];\n\t\n\tDTXViewAssert(componentCount > component, self.dtx_elementDebugAttributes, @\"Invalid component “%@” for picker view “%@”\", @(component), self.dtx_shortDescription);\n\n\tNSInteger rowCount = [self.dataSource pickerView:self numberOfRowsInComponent:component];\n\n\tfor(NSInteger idx = 0; idx < rowCount; idx ++)\n\t{\n\t\tNSString* title;\n\t\tif([self.delegate respondsToSelector:@selector(pickerView:titleForRow:forComponent:)])\n\t\t{\n\t\t\ttitle = [self.delegate pickerView:self titleForRow:idx forComponent:component];\n\t\t}\n\t\telse if([self.delegate respondsToSelector:@selector(pickerView:attributedTitleForRow:forComponent:)])\n\t\t{\n\t\t\ttitle = [self.delegate pickerView:self attributedTitleForRow:idx forComponent:component].string;\n\t\t}\n\t\telse if ([self.delegate respondsToSelector:@selector(pickerView:viewForRow:forComponent:reusingView:)])\n\t\t{\n\t\t\tUIView* view = [self.delegate pickerView:self viewForRow:idx forComponent:component reusingView:nil];\n\t\t\tif([view isKindOfClass:UILabel.class])\n\t\t\t{\n\t\t\t\ttitle = [(UILabel*)view text];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tUILabel* label = (id)[UIView dtx_findViewsInHierarchy:view passingPredicate:[NSPredicate predicateWithBlock:^BOOL(id  _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {\n\t\t\t\t\treturn [evaluatedObject isKindOfClass:UILabel.class];\n\t\t\t\t}]].firstObject;\n\t\t\t\ttitle = label.text;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif([title isEqualToString:value])\n\t\t{\n\t\t\t[self selectRow:idx inComponent:component animated:YES];\n\t\t\tif([self.delegate respondsToSelector:@selector(pickerView:didSelectRow:inComponent:)])\n\t\t\t{\n\t\t\t\t[self.delegate pickerView:self didSelectRow:idx inComponent:component];\n\t\t\t}\n\t\t\t\n\t\t\t//TODO: Is Waiting needed?\n\t\t\tdispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{\n\t\t\t\t//Noop\n\t\t\t});\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tDTXViewAssert(NO, self.dtx_elementDebugAttributes, @\"Picker view “%@” does not contain value “%@” for component “%@”\", self.dtx_shortDescription, value, @(component));\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIScrollView+DetoxActions.h",
    "content": "//\n//  UIScrollView+DetoxActions.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIScrollView (DetoxActions)\n\n- (void)dtx_scrollToEdge:(UIRectEdge)edge NS_SWIFT_NAME(dtx_scroll(to:));\n- (void)dtx_scrollToEdge:(UIRectEdge)edge\n normalizedStartingPoint:(CGPoint)normalizedStartingPoint;\n- (void)dtx_scrollWithOffset:(CGPoint)offset;\n- (void)dtx_scrollWithOffset:(CGPoint)offset normalizedStartingPoint:(CGPoint)normalizedStartingPoint NS_SWIFT_NAME(dtx_scroll(withOffset:normalizedStartingPoint:));\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Actions/UIScrollView+DetoxActions.m",
    "content": "//\n//  UIScrollView+DetoxActions.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/20/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIScrollView+DetoxActions.h\"\n#import \"UIApplication+DTXAdditions.h\"\n#import \"DTXSyntheticEvents.h\"\n#import \"UIView+DetoxUtils.h\"\n#import \"DTXAppleInternals.h\"\n#import \"DetoxPolicy.h\"\n\n@import ObjectiveC;\n\n@interface UIScrollView ()\n\n- (void)_scrollViewWillEndDraggingWithDeceleration:(BOOL)arg1;\n\n@end\n\n@interface UIScrollView (DetoxScrolling)\n\n- (void)_dtx_scrollViewWillEndDraggingWithDeceleration:(BOOL)arg1;\n@property (nonatomic, assign, setter=dtx_setDisableDecelerationForScroll:) BOOL dtx_disableDecelerationForScroll;\n\n@end\n\nDTX_DIRECT_MEMBERS\n@implementation UIScrollView (DetoxScrolling)\n\n+ (void)load\n{\n\tNSError* error;\n\tDTXSwizzleMethod(UIScrollView.class, @selector(_scrollViewWillEndDraggingWithDeceleration:), @selector(_dtx_scrollViewWillEndDraggingWithDeceleration:), &error);\n}\n\n- (void)dtx_setDisableDecelerationForScroll:(BOOL)dtx_disableDecelerationForScroll\n{\n\tobjc_setAssociatedObject(self, \"dtx_disableDecelerationForScroll\", @(dtx_disableDecelerationForScroll), OBJC_ASSOCIATION_RETAIN);\n}\n\n- (BOOL)dtx_disableDecelerationForScroll\n{\n\treturn [objc_getAssociatedObject(self, \"dtx_disableDecelerationForScroll\") boolValue];\n}\n\n- (void)_dtx_scrollViewWillEndDraggingWithDeceleration:(BOOL)arg1\n{\n\tBOOL deceleration = arg1;\n\tif(self.dtx_disableDecelerationForScroll == YES &&\n\t   //Disallow deceleration only in cases where overscroll was not performed.\n\t   self.contentOffset.y >= (-self.adjustedContentInset.top) &&\n\t   self.contentOffset.y <= self.contentSize.height - self.bounds.size.height + self.adjustedContentInset.bottom &&\n\t   self.contentOffset.x >= (-self.adjustedContentInset.left) &&\n\t   self.contentOffset.x <= self.contentSize.width - self.bounds.size.width + self.adjustedContentInset.right\n\t   )\n\t{\n\t\tdeceleration = NO;\n\t}\n\n    [self _dtx_scrollViewWillEndDraggingWithDeceleration:deceleration];\n}\n\n@end\n\n@implementation UIScrollView (DetoxActions)\n\n#define DTXCGMakePointY(y) CGPointMake(0, y)\n#define DTXCGMakePointX(x) CGPointMake(x, 0)\n#define DTX_SCROLL_TO_EDGE(axis, inset, otherInset, _size, pointMakeMacro) \\\nCGFloat target = 0; \\\nif(edge.axis < 0) \\\n{ \\\n\ttarget = (- self.adjustedContentInset.inset); \\\n} \\\nelse \\\n{ \\\n\ttarget = self.contentSize._size + self.adjustedContentInset.otherInset - self.bounds.size._size; \\\n} \\\n[self setContentOffset:pointMakeMacro(target) animated:YES]; \\\n[NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:[[self valueForKeyPath:@\"animation.duration\"] doubleValue] + 0.05]];\n\n- (CGPoint)_edgeToNormalizedEdge:(UIRectEdge)edge\n{\n\tCGPoint normalizedEdge;\n\tswitch (edge) {\n\t\tcase UIRectEdgeTop:\n\t\t\tnormalizedEdge = CGPointMake(0, -1);\n\t\t\tbreak;\n\t\tcase UIRectEdgeBottom:\n\t\t\tnormalizedEdge = CGPointMake(0, 1);\n\t\t\tbreak;\n\t\tcase UIRectEdgeLeft:\n\t\t\tnormalizedEdge = CGPointMake(-1, 0);\n\t\t\tbreak;\n\t\tcase UIRectEdgeRight:\n\t\t\tnormalizedEdge = CGPointMake(1, 0);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnormalizedEdge= CGPointMake(0, 0);\n\t\t\tDTXAssert(NO, @\"Incorect edge provided.\");\n\t}\n\treturn normalizedEdge;\n}\n\n\n- (void)dtx_scrollToEdge:(UIRectEdge)edge\n{\n\tCGPoint normalizedEdge = [self _edgeToNormalizedEdge:edge];\n\tif(normalizedEdge.x == 0 && normalizedEdge.y == 0)\n\t\treturn;\n\n\t[self _dtx_scrollToNormalizedEdge:normalizedEdge];\n}\n\n- (void)_dtx_scrollToNormalizedEdge:(CGPoint)edge\n{\n//\tif(edge.x != 0)\n//\t{\n//\t\tDTX_SCROLL_TO_EDGE(x, left, right, width, DTXCGMakePointX);\n//\t}\n//\telse if(edge.y != 0)\n//\t{\n//\t\tDTX_SCROLL_TO_EDGE(y, top, bottom, height, DTXCGMakePointY);\n//\t}\n\t\n\t[self _dtx_scrollWithOffset:CGPointMake(- edge.x * CGFLOAT_MAX, - edge.y * CGFLOAT_MAX) normalizedStartingPoint:CGPointMake(NAN, NAN) strict:NO];\n}\n\n- (void)dtx_scrollToEdge:(UIRectEdge)edge\n\tnormalizedStartingPoint:(CGPoint)normalizedStartingPoint\n{\n\tCGPoint normalizedEdge = [self _edgeToNormalizedEdge:edge];\n\tif(normalizedEdge.x == 0 && normalizedEdge.y == 0)\n\t\treturn;\n\t\n\t[self _dtx_scrollToNormalizedEdge:normalizedEdge normalizedStartingPoint: normalizedStartingPoint ];\n}\n\n- (void)_dtx_scrollToNormalizedEdge:(CGPoint)edge\n\t\t\tnormalizedStartingPoint:(CGPoint)normalizedStartingPoint\n{\n\t[self _dtx_scrollWithOffset:CGPointMake(- edge.x * CGFLOAT_MAX, - edge.y * CGFLOAT_MAX) normalizedStartingPoint:normalizedStartingPoint strict:NO];\n}\n\n\nDTX_ALWAYS_INLINE\nstatic NSString* _DTXScrollDirectionDescriptionWithOffset(CGPoint offset)\n{\n\t\n\t//\treturn [NSString stringWithFormat:@\"%@ for %@ points\", offset.x < 0 ? @\"right\" : offset.x > 0 ? @\"left\" : offset.y < 0 ? @\"down\" : @\"up\", @(MAX(fabs(offset.x), fabs(offset.y)))];\n\t\n\treturn offset.x < 0 ? @\"right\" : offset.x > 0 ? @\"left\" : offset.y < 0 ? @\"down\" : @\"up\";\n}\n\n- (void)dtx_scrollWithOffset:(CGPoint)offset\n{\n\t[self _dtx_scrollWithOffset:offset normalizedStartingPoint:CGPointMake(NAN, NAN) strict:YES];\n}\n\n#define DTX_CREATE_SCROLL_POINTS(window, points, startPoint, offset, main, windowSafeAreaMain, windowMoundsMain) \\\noffset.main += (fabs(offset.main) / offset.main * 10); \\\nconst CGFloat d = fabs(offset.main) / offset.main * UIApplication.dtx_panVelocity; \\\nwhile (offset.main != 0 && startPoint.main > window.safeAreaInsets.windowSafeAreaMain && startPoint.main < window.bounds.size.windowMoundsMain) { \\\n\tCGFloat localD = offset.main < 0 ? MAX(d, offset.main) : MIN(d, offset.main); \\\n\tstartPoint.main += localD; \\\n\toffset.main -= localD; \\\n\t[points addObject:@(startPoint)]; \\\n}\n\nDTX_ALWAYS_INLINE\nstatic BOOL _DTXApplyScroll(UIScrollView* scrollView, CGPoint startPoint, CGPoint offset, CGPoint* remainingOffset)\n{\n\tNSMutableArray<NSValue*>* points = [NSMutableArray new];\n\t\n\t[points addObject:@(startPoint)];\n\t\n\tif(offset.x != 0)\n\t{\n\t\tDTX_CREATE_SCROLL_POINTS(scrollView.window, points, startPoint, offset, x, left, width);\n\t}\n\telse if(offset.y != 0)\n\t{\n\t\tDTX_CREATE_SCROLL_POINTS(scrollView.window, points, startPoint, offset, y, top, height);\n\t}\n\t\n\t//Add several points between first two and last two so that the touch system always handles points 🤦‍♂️\n\tif(points.count >= 2)\n\t{\n\t\tCGPoint first = [points.firstObject CGPointValue];\n\t\tCGPoint second = [points[1] CGPointValue];\n\t\tconst double interpolationCount = MAX(fabs(first.x - second.x), fabs(first.y - second.y));\n\t\t[points removeObjectAtIndex:0];\n\t\tfor(double idx = 0.0; idx < interpolationCount; idx+=1.0)\n\t\t{\n\t\t\tCGFloat x = LNLinearInterpolate(second.x, first.x, (idx + 1.0) / interpolationCount);\n\t\t\tCGFloat y = LNLinearInterpolate(second.y, first.y, (idx + 1.0) / interpolationCount);\n\t\t\t[points insertObject:@(CGPointMake(x, y)) atIndex:0];\n\t\t}\n\t}\n\t\n\tif(points.count >= 3)\n\t{\n\t\tCGPoint beforeLast = [points[points.count - 2] CGPointValue];\n\t\tCGPoint last = [points.lastObject CGPointValue];\n\t\tconst double interpolationCount = MAX(fabs(beforeLast.x - last.x), fabs(beforeLast.y - last.y));\n\t\t[points removeLastObject];\n\t\tfor(double idx = 0.0; idx < interpolationCount; idx+=1.0)\n\t\t{\n\t\t\tCGFloat x = LNLinearInterpolate(beforeLast.x, last.x, (idx + 1.0) / interpolationCount);\n\t\t\tCGFloat y = LNLinearInterpolate(beforeLast.y, last.y, (idx + 1.0) / interpolationCount);\n\t\t\t[points addObject:@(CGPointMake(x, y))];\n\t\t}\n\t}\n\t\n\tif(points.count > 1)\n\t{\n\t\t__block NSUInteger consecutiveTouchPointsWithSameContentOffset = 0;\n\t\t__block BOOL didSomeScroll = NO;\n\t\t__block CGPoint prevOffset = scrollView.contentOffset;\n\t\t\n\t\t__block BOOL didFailTouches = NO;\n\t\t[DTXSyntheticEvents touchAlongPath:points relativeToWindow:scrollView.window holdDurationOnFirstTouch:0.0 holdDurationOnLastTouch:0.0 onTouchCallback:^ BOOL (UITouchPhase phase) {\n\t\t\tif(phase != UITouchPhaseMoved)\n\t\t\t{\n\t\t\t\treturn YES;\n\t\t\t}\n\t\t\t\n\t\t\tif(CGPointEqualToPoint(scrollView.contentOffset, prevOffset))\n\t\t\t{\n\t\t\t\tconsecutiveTouchPointsWithSameContentOffset++;\n\t\t\t}\n\t\t\telse if(scrollView._isBouncing == NO)\n\t\t\t{\n\t\t\t\tdidSomeScroll |= YES;\n\t\t\t}\n\t\t\t\n\t\t\tprevOffset = scrollView.contentOffset;\n\t\t\t\n\t\t\tif(scrollView.bounces && scrollView._isBouncing)\n\t\t\t{\n\t\t\t\tif(didSomeScroll == NO)\n\t\t\t\t{\n\t\t\t\t\tdidFailTouches = YES;\n\t\t\t\t}\n\t\t\t\treturn NO;\n\t\t\t}\n\t\t\t\n\t\t\tif(consecutiveTouchPointsWithSameContentOffset >\n\t\t\t   DetoxPolicy.consecutiveTouchPointsWithSameContentOffsetThreshold)\n\t\t\t{\n\t\t\t\tif(didSomeScroll == NO)\n\t\t\t\t{\n\t\t\t\t\tdidFailTouches = YES;\n\t\t\t\t}\n\t\t\t\treturn NO;\n\t\t\t}\n\t\t\t\n\t\t\treturn YES;\n\t\t}];\n\t\t\n\t\t[NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.75]];\n\t\t\n\t\tif(didFailTouches)\n\t\t{\n\t\t\treturn NO;\n\t\t}\n\t}\n\t\n\t*remainingOffset = offset;\n\t\n\treturn YES;\n}\n\n#define DTX_RESET_START_POINT(normalizedStartingPoint, main, other, offset) \\\nif(isnan(normalizedStartingPoint.other) || normalizedStartingPoint.other < 0 || normalizedStartingPoint.other > 1) \\\n{ \\\n\tnormalizedStartingPoint.other = 0.5; \\\n} \\\nif(isnan(normalizedStartingPoint.main) || normalizedStartingPoint.main < 0 || normalizedStartingPoint.main > 1) \\\n{ \\\n\tnormalizedStartingPoint.main = offset < 0 ? 0.95 : 0.05; \\\n}\n\n- (void)dtx_scrollWithOffset:(CGPoint)offset normalizedStartingPoint:(CGPoint)normalizedStartingPoint\n{\n\t[self _dtx_scrollWithOffset:offset normalizedStartingPoint:normalizedStartingPoint strict:YES];\n}\n\n- (void)_dtx_scrollWithOffset:(CGPoint)offset normalizedStartingPoint:(CGPoint)normalizedStartingPoint strict:(BOOL)strict\n{\n\tif(offset.x == 0.0 && offset.y == 0.0)\n\t{\n\t\treturn;\n\t}\n\t\n\tNSAssert(offset.x == 0.0 || offset.y == 0.0, @\"Scrolling simultaneously in both directions is unsupported\");\n\t\n\tself.dtx_disableDecelerationForScroll = YES;\n//\tBOOL oldBounces = self.bounces;\n//\tself.bounces = NO;\n\t\n\tCGRect safeAreaToScroll = [self.window convertRect:UIEdgeInsetsInsetRect(self.bounds, self.adjustedContentInset) fromView:self];\n\t\n\tif(offset.y != 0)\n\t{\n\t\tDTX_RESET_START_POINT(normalizedStartingPoint, y, x, offset.y);\n\t}\n\telse if (offset.x != 0)\n\t{\n\t\tDTX_RESET_START_POINT(normalizedStartingPoint, x, y, offset.x);\n\t}\n\t\n\tCGPoint startPoint = CGPointMake(safeAreaToScroll.origin.x + safeAreaToScroll.size.width * normalizedStartingPoint.x, safeAreaToScroll.origin.y + safeAreaToScroll.size.height * normalizedStartingPoint.y);\n\n\tCGPoint viewPoint = [self convertPoint:startPoint fromView:self.window];\n\t[self dtx_assertScrollableAtPoint:viewPoint];\n\n\tNSUInteger successfullyAppliedScrolls = 0;\n\twhile (offset.x != 0.0 || offset.y != 0.0)\n\t{\n\t\tBOOL appliedScroll = _DTXApplyScroll(self, startPoint, offset, &offset);\n\t\tsuccessfullyAppliedScrolls += (appliedScroll ? 1 : 0);\n\t\t\n\t\tif(appliedScroll == NO)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tDTXViewAssert(strict == NO || successfullyAppliedScrolls > 0, self.dtx_elementDebugAttributes, @\"Unable to scroll %@ in “%@”\", _DTXScrollDirectionDescriptionWithOffset(offset), self.dtx_shortDescription);\n\t\n\tself.dtx_disableDecelerationForScroll = NO;\n}\n\n- (void)dtx_assertScrollableAtPoint:(CGPoint)startPoint {\n  NSError *error;\n  DTXAssert([self dtx_isHittableAtPoint:startPoint error:&error],\n\t\t\t@\"View is not scrollable at the given start point. Start point (view coordinates): %@\" \\\n\t\t\t\"\\n- Full error: %@\\n----\\nMore about scroll action API here: \" \\\n\t\t\t\"https://wix.github.io/Detox/docs/api/actions-on-element/\" \\\n\t\t\t\"#scrolloffset-direction-startpositionx-startpositiony\",\n\t\t\tNSStringFromCGPoint(startPoint), error.localizedDescription);\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleInternals/DTXAppleInternals.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n/**\n *  @file DTXAppleInternals.h\n *  @brief Exposes interfaces, structs and methods that are otherwise private.\n */\n\n#import <UIKit/UIKit.h>\n@import UserNotifications;\n\n@interface NSObject ()\n\n- (BOOL)__isKindOfUIView;\n\n@end\n\n@interface UNNotificationResponse ()\n\n+ (instancetype)responseWithNotification:(UNNotification*)arg1 actionIdentifier:(NSString*)arg2;\n\n@end\n\n@interface UNNotification ()\n\n+ (instancetype)notificationWithRequest:(UNNotificationRequest*)arg1 date:(NSDate*)arg2;\n\n@end\n\n@interface UNPushNotificationTrigger ()\n\n+ (instancetype)triggerWithContentAvailable:(BOOL)arg1 mutableContent:(BOOL)arg2;\n\n@end\n\n@interface UIWindowScene ()\n\n+ (instancetype)_keyWindowScene;\n@property(readonly, nonatomic) UIWindow *_keyWindow;\n- (id)_allWindowsIncludingInternalWindows:(_Bool)arg1 onlyVisibleWindows:(_Bool)arg2;\n+ (id)_keyboardWindowSceneForScreen:(UIScreen*)arg1 create:(_Bool)arg2;\n\n@end\n\n@interface UIWindow ()\n\n- (id)firstResponder;\n+ (instancetype)keyWindow;\n+ (NSArray<UIWindow*>*)allWindowsIncludingInternalWindows:(_Bool)arg1 onlyVisibleWindows:(_Bool)arg2;\n\n@end\n\n@interface UIView ()\n\n- (BOOL)_isInVisibleHierarchy;\n- (BOOL)isHiddenOrHasHiddenAncestor;\n- (BOOL)_la_isVisible;\n- (NSArray*)_accessibilityHitTestSubviews;\n@property (nonatomic, readonly, copy) NSString* recursiveDescription;\n\n@end\n\n@interface UIViewController ()\n- (void)viewWillMoveToWindow:(id)window;\n- (void)viewDidMoveToWindow:(id)window shouldAppearOrDisappear:(BOOL)arg;\n@end\n\n/**\n *  Structure that represents IOHIDEvents, which are sent from iOS to the application.\n */\ntypedef struct __IOHIDEvent *IOHIDEventRef;\n\n/**\n *  Private class source:\n *  http://www.opensource.apple.com/source/IOHIDFamily/IOHIDFamily-503.92.1/IOHIDFamily/IOHIDEventTypes.h\n */\n#ifdef __LP64__\ntypedef double IOHIDFloat;\n#else\ntypedef float IOHIDFloat;\n#endif\n\ntypedef UInt32 IOOptionBits;\n\n/**\n *  Event mask detailing the events being dispatched by a digitizer. It is possible for digitizer\n *  events to contain child digitizer events, effectively, behaving as collections. In the\n *  collection case, the child event mask field reference by\n *  kIOHIDEventFieldDigitizerChildEventMask will detail the cumulative event state of the child\n *  digitizer events. If you append a child digitizer event to a parent digitizer event, appropriate\n *  state will be transferred on to the parent.\n */\ntypedef enum {\n    /**\n     *  Issued when the range state has changed.\n     */\n    kIOHIDDigitizerEventRange = 0x00000001,\n    /**\n     *  Issued when the touch state has changed.\n     */\n    kIOHIDDigitizerEventTouch = 0x00000002,\n    /**\n     *  Issued when the position has changed.\n     */\n    kIOHIDDigitizerEventPosition = 0x00000004,\n} IOHIDDigitizerEventMask;\n\n/**\n *  Creates a digitizer event that sourced from a finger touching the screen.\n */\nIOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator,\n                                                   AbsoluteTime timeStamp,\n                                                   uint32_t index,\n                                                   uint32_t identity,\n                                                   IOHIDDigitizerEventMask eventMask,\n                                                   IOHIDFloat x,\n                                                   IOHIDFloat y,\n                                                   IOHIDFloat z,\n                                                   IOHIDFloat tipPressure,\n                                                   IOHIDFloat twist,\n                                                   Boolean range,\n                                                   Boolean touch,\n                                                   IOOptionBits options);\n\n/**\n *  Private class for representing internal touch events.\n *  @see\n *  https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UIInternalEvent.h\n */\n@interface UIInternalEvent : UIEvent\n/**\n *  Sets HIDEvent property for the event.\n *\n *  @param event The event for HIDEvent property.\n */\n- (void)_setHIDEvent:(IOHIDEventRef)event;\n@end\n\n/**\n *  A private class that represents touch related events. This is sent to UIApplication whenever a\n *  touch occurs.\n */\n@interface UITouchesEvent : UIInternalEvent\n/**\n *  Adds a @c touch to the event. It's unclear what @c delayedDelivery does.\n *\n *  @param touch           The touch object to be added.\n *  @param delayedDelivery Unknown private API param.\n */\n- (void)_addTouch:(UITouch *)touch forDelayedDelivery:(BOOL)delayedDelivery;\n\n/**\n *  Removes all touch objects from the event.\n */\n- (void)_clearTouches;\n@end\n\n/**\n *  A private class that represents backboard services accelerometer.\n */\n@interface BKSAccelerometer : NSObject\n/**\n *  Enable or disable accelerometer events.\n */\n@property(nonatomic) BOOL accelerometerEventsEnabled;\n@end\n\n/**\n *  A private class that represents motion related events. This is sent to UIApplication whenever a\n *  motion occurs.\n */\n@interface UIMotionEvent : UIEvent\n{\n    // The motion accelerometer of the event.\n    BKSAccelerometer *_motionAccelerometer;\n}\n\n/**\n *  Modify the _shakeState ivar inside motion event.\n *\n *  shakeState Set as true for 1 being passed. All other values set to false.\n */\n- (void)setShakeState:(int)shakeState;\n\n/**\n *  Sets the subtype for the motion event.\n *\n *  eventSubType The UIEventSubtype for the motion event.\n */\n- (void)_setSubtype:(int)eventSubType;\n@end\n\n@interface UIApplication ()\n- (BOOL)_isSpringBoardShowingAnAlert;\n- (UIWindow *)statusBarWindow;\n/**\n *  Changes the main runloop to run in the specified mode, pushing it to the top of the stack of\n *  current modes.\n */\n- (void)pushRunLoopMode:(NSString *)mode;\n/**\n *  Changes the main runloop to run in the specified mode, pushing it to the top of the stack of\n *  current modes.\n */\n- (void)pushRunLoopMode:(NSString *)mode requester:(id)requester;\n/**\n *  Pops topmost mode from the runloop mode stack.\n */\n- (void)popRunLoopMode:(NSString *)mode;\n/**\n *  Pops topmost mode from the runloop mode stack.\n */\n- (void)popRunLoopMode:(NSString *)mode requester:(id)requester;\n/**\n *  @return The shared UITouchesEvent object of the application, which is used to keep track of\n *          UITouch objects, and the relevant touch interaction state.\n */\n- (UITouchesEvent *)_touchesEvent;\n/**\n *  @return The shared UIMotionEvent object of the application, used to force enable motion\n *          accelerometer events.\n */\n- (UIMotionEvent *)_motionEvent;\n\n/**\n *  Sends a motion began event for the specified subtype.\n */\n- (void)_sendMotionBegan:(UIEventSubtype)subtype;\n\n/**\n *  Sends a motion ended event for the specified subtype.\n */\n- (void)_sendMotionEnded:(UIEventSubtype)subtype;\n@end\n\n@interface UIScrollView ()\n\n@property (nonatomic, readonly) BOOL _isBouncing;\n\n/**\n *  Called when user finishes scrolling the content. @c deceleration is @c YES if scrolling movement\n *  will continue, but decelerate, after user stopped dragging the content. If @c deceleration is\n *  @c NO, scrolling stops immediately.\n *\n *  @param deceleration Indicating if scrollview was experiencing deceleration.\n */\n- (void)_scrollViewDidEndDraggingWithDeceleration:(BOOL)deceleration;\n\n/**\n *  Called when user is about to begin scrolling the content.\n */\n- (void)_scrollViewWillBeginDragging;\n\n/**\n *  Called when scrolling of content has finished, if content continued scrolling with deceleration\n *  after user stopped dragging it. @c notify determines whether UIScrollViewDelegate will be\n *  notified that scrolling has finished.\n *\n *  @param notify An indicator specifying if scrolling has finished.\n */\n- (void)_stopScrollDecelerationNotify:(BOOL)notify;\n@end\n\n@interface UIDevice ()\n- (void)setOrientation:(UIDeviceOrientation)orientation animated:(BOOL)animated;\n@end\n\n@interface UITouch ()\n/**\n *  Sets flag marking this touch as the first touch for view.\n *\n *  @param first A boolean to indicate if this is the first touch for the view.\n */\n- (void)_setIsFirstTouchForView:(BOOL)first;\n\n/**\n *  Sets flag marking this touch as a tap.\n *\n *  @param isTap A boolean to indicate that this is a tap.\n */\n- (void)setIsTap:(BOOL)isTap;\n- (void)_setIsTapToClick:(BOOL)isTap;\n\n/**\n *  Sets location property to @c location. If @c reset is @c NO, the original value of location will\n *  be stored in the UITouch's internal property @c previousLocation. If @c reset is @c YES, @c\n *  location will be stored in @c previousLocation.\n *\n *  @param location The new location relative to the touch's window.\n *  @param reset    An indicator to specify if @c previousLocation must be reset.\n */\n- (void)_setLocationInWindow:(CGPoint)location resetPrevious:(BOOL)reset;\n\n/**\n *  Sets phase property and notifies phaseChangeDelegate.\n *\n *  @param phase The new phase property.\n */\n- (void)setPhase:(UITouchPhase)phase;\n\n/**\n *  Sets tapCount property.\n *\n *  @param tapCount The new tap count.\n */\n- (void)setTapCount:(NSUInteger)tapCount;\n\n/**\n *  Sets timestamp property.\n *\n *  @param timestamp The new timestamp.\n */\n- (void)setTimestamp:(NSTimeInterval)timestamp;\n\n/**\n *  Sets view property.\n *\n *  @param view The new view property.\n */\n- (void)setView:(UIView *)view;\n\n/**\n *  Sets window property and converts stored CGPoint structs to the the window's coordinate system.\n *\n *  @param window The new window property.\n */\n- (void)setWindow:(UIWindow *)window;\n\n/**\n *  Sets HIDEvent property for this touch.\n *\n *  @param event The new HIDEvent property.\n */\n- (void)_setHidEvent:(IOHIDEventRef)event;\n@end\n\n@interface UIKeyboardTaskQueue\n/**\n *  Completes all pending or ongoing tasks in the task queue before returning. Must be called from\n *  the main thread.\n */\n- (void)waitUntilAllTasksAreFinished;\n\n- (void)performTask:(void (^)(id ctx))arg1;\n\n@end\n\n@interface UIKeyboardImpl\n/**\n *  @return Shared instance of UIKeyboardImpl. It may be different from the active instance.\n */\n+ (instancetype)sharedInstance;\n\n/**\n *  @return The Active instance of UIKeyboardImpl, if one exists; otherwise returns @c nil. Active\n *          instance could exist even if the keyboard is not shown on the screen.\n */\n+ (instancetype)activeInstance;\n\n/**\n *  @return The current keyboard layout view, which contains accessibility elements for keyboard\n *          keys that are shown on the keyboard.\n */\n- (UIView *)_layout;\n\n/**\n *  @return The string shown on the return key on the keyboard.\n */\n- (NSString *)returnKeyDisplayName;\n\n/**\n *  @return The task queue keyboard is using to manage asynchronous tasks.\n */\n- (UIKeyboardTaskQueue *)taskQueue;\n\n/**\n *  Automatically hides the software keyboard if @c enabled is set to @c YES and hardware keyboard\n *  is available. Setting @c enabled to @c NO will always show software keyboard. This setting is\n *  global and applies to all instances of UIKeyboardImpl.\n *\n *  @param enabled A boolean that indicates automatic minimization (hiding) of the keyboard.\n */\n- (void)setAutomaticMinimizationEnabled:(BOOL)enabled;\n\n/**\n *  @return The delegate that the UIKeyboard is typing on.\n */\n- (id)delegate;\n\n/**\n *  Sets the current UIKeyboard's delegate.\n *\n *  @param delegate The element to set the UIKeyboard's delegate to.\n */\n- (void)setDelegate:(id)delegate;\n/**\n *  A method to hide the keyboard without resigning the first responder. This is used only\n *  in iOS 8.1 where we found that turning off the autocorrection type on the first responder\n *  using setAutomaticMinimizationEnabled: without toggling the keyboard caused keyboard touches\n *  to be ignored.\n */\n- (void)hideKeyboard;\n\n/**\n *  A method to show the keyboard without resigning the first responder. This is used only\n *  in iOS 8.1 where we found that turning off the autocorrection type on the first responder\n *  using setAutomaticMinimizationEnabled: without toggling the keyboard caused keyboard touches\n *  to be ignored.\n */\n- (void)showKeyboard;\n\n@property(readonly, nonatomic) UIKeyboardTaskQueue *taskQueue;\n- (void)_handleKeyEvent:(id)arg1 executionContext:(id)arg2;\n- (void)setShift:(_Bool)arg1 autoshift:(_Bool)arg2;\n- (void)removeCandidateList;\n\n@end\n\n/**\n * Text Input preferences controller to modify the keyboard preferences for iOS 8+.\n */\n@interface TIPreferencesController : NSObject\n\n/** Whether the autocorrection is enabled. */\n@property BOOL autocorrectionEnabled;\n\n/** Whether the predication is enabled. */\n@property BOOL predictionEnabled;\n\n/** The shared singleton instance. */\n+ (instancetype)sharedPreferencesController;\n\n/** Synchronize the change to save it on disk. */\n- (void)synchronizePreferences;\n\n/** Modify the preference @c value by @c key. */\n- (void)setValue:(NSValue *)value forPreferenceKey:(NSString *)key;\n@end\n\n/**\n *  Used for enabling accessibility on simulator and device.\n */\n@interface AXBackBoardServer\n\n/**\n *  Returns backboard server instance.\n */\n+ (id)server;\n\n/**\n *  Sets preference with @c key to @c value and raises @c notification.\n */\n- (void)setAccessibilityPreferenceAsMobile:(CFStringRef)key\n                                     value:(CFBooleanRef)value\n                              notification:(CFStringRef)notification;\n\n@end\n\n/**\n *  Used for enabling accessibility on device.\n */\n@interface XCAXClient_iOS\n\n/**\n *  Singleton shared instance when initialized will try to background the current process.\n */\n+ (id)sharedClient;\n\n/**\n *  Programatically enable accessibility on both simulator and device.\n *  Blocks until accessibility is fully loaded.\n *\n *  @return ignored.\n */\n- (bool)_loadAccessibility:(void **)unused;\n\n@end\n\n@interface UIAccessibilityTextFieldElement\n\n/**\n *  @return The UITextField that contains the accessibility text field element.\n */\n-(UITextField *)textField;\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXSyntheticEvents.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n *  Error codes for synthetic event injection failures.\n */\ntypedef NS_ENUM(NSInteger, GREYSyntheticEventInjectionErrorCode) {\n\tkGREYOrientationChangeFailedErrorCode = 0,  // Device orientation change has failed.\n};\n\n#pragma mark - Interface\n\n/**\n *  Utility to deliver user actions such as touches, taps, gestures and device rotation to the\n *  application under test\n */\n@interface DTXSyntheticEvents : NSObject\n\n- (instancetype)init NS_UNAVAILABLE;\n+ (instancetype)new NS_UNAVAILABLE;\n\n+ (void)touchAlongPath:(NSArray *)touchPath relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration;\n+ (void)touchAlongPath:(NSArray *)touchPath relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration onTouchCallback:(nullable BOOL (^)(UITouchPhase))callback;\n\n+ (void)touchAlongMultiplePaths:(NSArray *)touchPaths relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration;\n+ (void)touchAlongMultiplePaths:(NSArray *)touchPaths relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration onTouchCallback:(nullable BOOL (^)(UITouchPhase))callback;\n\n/**\n *  Begins interaction with a new touch starting at a specified point within a specified\n *  window's coordinates.\n *\n *  @param point     The point where the touch is to start.\n *  @param window    The window that contains the coordinates of the touch points.\n *  @param immediate If @c YES, this method blocks until touch is delivered, otherwise the touch is\n *                   enqueued for delivery the next time runloop drains.\n */\n- (void)beginTouchAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window immediateDelivery:(BOOL)immediate;\n\n/**\n *  Continues the current interaction by moving touch to a new point. Providing the same point\n *  in consecutive calls is intepreted as stationary touches. While delivering these touch points,\n *  they may be buffered and during delivery if there are multiple stale touch points that\n *  are time sensitive some of them may be dropped.\n *\n *  @param point      The point to move the touch to.\n *  @param immediate  If @c YES, this method blocks until touch is delivered, otherwise the touch is\n *                    enqueued for delivery the next time runloop drains.\n *  @param expendable @c YES indicates that this touch point is intended to be delivered in a timely\n *                    manner rather than reliably. Is ignored if @c NO.\n */\n- (void)continueTouchAtPoint:(CGPoint)point immediateDelivery:(BOOL)immediate expendable:(BOOL)expendable;\n\n/**\n *  Ends interaction started by GREYSyntheticEvents::beginTouchAtPoint:relativeToWindow.\n *  This method will block until all the touches since the beginning of the interaction have been\n *  delivered.\n */\n- (void)endTouch;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXSyntheticEvents.m",
    "content": "//\n// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \"DTXSyntheticEvents.h\"\n\n#import \"DTXAppleInternals.h\"\n#import \"DTXTouchInjector.h\"\n\n#pragma mark - Implementation\n\n@implementation DTXSyntheticEvents\n{\n\t/**\n\t *  The touch injector that completes the touch sequence for an event.\n\t */\n\tDTXTouchInjector *_touchInjector;\n\t\n\t/**\n\t *  The last injected touch point.\n\t */\n\tNSValue *_lastInjectedTouchPoint;\n\t\n\tBOOL (^_onTouchCallback)(UITouchPhase);\n}\n\n- (instancetype)initWithOnTouchCallback:(nullable BOOL (^)(UITouchPhase))onTouchCallback\n{\n\tself = [super init];\n\tif(self)\n\t{\n\t\t_onTouchCallback = onTouchCallback;\n\t}\n\t\n\treturn self;\n}\n\n+ (void)touchAlongPath:(NSArray *)touchPath relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration\n{\n\t[self touchAlongMultiplePaths:@[touchPath] relativeToWindow:window holdDurationOnFirstTouch:firstHoldDuration holdDurationOnLastTouch:lastHoldDuration onTouchCallback:nil];\n}\n\n+ (void)touchAlongPath:(NSArray *)touchPath relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration onTouchCallback:(BOOL (^)(UITouchPhase))callback\n{\n\t[self touchAlongMultiplePaths:@[touchPath] relativeToWindow:window holdDurationOnFirstTouch:firstHoldDuration holdDurationOnLastTouch:lastHoldDuration onTouchCallback:callback];\n}\n\n+ (void)touchAlongMultiplePaths:(NSArray *)touchPaths relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration\n{\n\t[self touchAlongMultiplePaths:touchPaths relativeToWindow:window holdDurationOnFirstTouch:firstHoldDuration holdDurationOnLastTouch:lastHoldDuration onTouchCallback:nil];\n}\n\n+ (void)touchAlongMultiplePaths:(NSArray *)touchPaths relativeToWindow:(UIWindow *)window holdDurationOnFirstTouch:(NSTimeInterval)firstHoldDuration holdDurationOnLastTouch:(NSTimeInterval)lastHoldDuration onTouchCallback:(BOOL (^)(UITouchPhase))callback\n{\n\tNSParameterAssert(touchPaths.count >= 1);\n\tNSParameterAssert(firstHoldDuration >= 0);\n\tNSParameterAssert(lastHoldDuration >= 0);\n\t\n\tNSUInteger firstTouchPathSize = [touchPaths[0] count];\n\tDTXSyntheticEvents *eventGenerator = [[DTXSyntheticEvents alloc] initWithOnTouchCallback:callback];\n\t\n\t// Inject \"begin\" event for the first points of each path.\n\t[eventGenerator dtx_beginTouchesAtPoints:[self dtx_objectsAtIndex:0 ofArrays:touchPaths] relativeToWindow:window immediateDelivery:NO];\n\t\n\t// If the paths have a single point, then just inject an \"end\" event with the delay being the\n\t// 'lastHoldDuration' provided\n\tif(firstTouchPathSize == 1)\n\t{\n\t\t[eventGenerator dtx_endTouchesAtPoints:[self dtx_objectsAtIndex:firstTouchPathSize - 1 ofArrays:touchPaths] timeElapsedSinceLastTouchDelivery:lastHoldDuration];\n\t}\n\telse\n\t{\n\t\t// Inject the first \"continue touch\" after holding duration at the same point the initial touch began\n\t\t// Apply 'firstHoldDuration'\n\t\t[eventGenerator dtx_continueTouchAtPoints:[self dtx_objectsAtIndex:0 ofArrays:touchPaths] afterTimeElapsedSinceLastTouchDelivery:firstHoldDuration immediateDelivery:NO expendable:NO];\n\t\t\n\t\tfor(NSUInteger i = 1; i < firstTouchPathSize; i++)\n\t\t{\n\t\t\t[eventGenerator dtx_continueTouchAtPoints:[self dtx_objectsAtIndex:i ofArrays:touchPaths] afterTimeElapsedSinceLastTouchDelivery:i == firstTouchPathSize - 1 ? lastHoldDuration : 0 immediateDelivery:NO expendable:NO];\n\t\t}\n\t\t\n\t\t[eventGenerator dtx_endTouchesAtPoints:[self dtx_objectsAtIndex:firstTouchPathSize - 1 ofArrays:touchPaths] timeElapsedSinceLastTouchDelivery:0];\n\t}\n}\n\n- (void)beginTouchAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window immediateDelivery:(BOOL)immediate\n{\n\t_lastInjectedTouchPoint = [NSValue valueWithCGPoint:point];\n\t[self dtx_beginTouchesAtPoints:@[_lastInjectedTouchPoint] relativeToWindow:window immediateDelivery:immediate];\n}\n\n- (void)continueTouchAtPoint:(CGPoint)point immediateDelivery:(BOOL)immediate expendable:(BOOL)expendable\n{\n\t_lastInjectedTouchPoint = [NSValue valueWithCGPoint:point];\n\t[self dtx_continueTouchAtPoints:@[_lastInjectedTouchPoint] afterTimeElapsedSinceLastTouchDelivery:0 immediateDelivery:immediate expendable:expendable];\n}\n\n- (void)endTouch\n{\n\t[self dtx_endTouchesAtPoints:@[_lastInjectedTouchPoint] timeElapsedSinceLastTouchDelivery:0];\n}\n\n#pragma mark - Private\n\n// Given an array containing multiple arrays, returns an array with the index'th element of each\n// array.\n+ (NSArray *)dtx_objectsAtIndex:(NSUInteger)index ofArrays:(NSArray *)arrayOfArrays\n{\n\tNSAssert(arrayOfArrays.count > 0, @\"arrayOfArrays must contain at least one element.\");\n\tNSUInteger firstArraySize = [arrayOfArrays[0] count];\n\tNSAssert(index < firstArraySize, @\"index must be smaller than the size of the arrays.\");\n\t\n\tNSMutableArray *output = [[NSMutableArray alloc] initWithCapacity:[arrayOfArrays count]];\n\tfor(NSArray *array in arrayOfArrays)\n\t{\n\t\tNSAssert(array.count == firstArraySize, @\"All arrays must be of the same size.\");\n\t\t[output addObject:array[index]];\n\t}\n\t\n\treturn output;\n}\n\n/**\n *  Begins interaction with new touches starting at multiple @c points. Touch will be delivered to\n *  the hit test view in @c window under point and will not end until @c endTouch is called.\n *\n *  @param points    Multiple points where touches should start.\n *  @param window    The window that contains the coordinates of the touch points.\n *  @param immediate If @c YES, this method blocks until touch is delivered, otherwise the touch is\n *                   enqueued for delivery the next time runloop drains.\n */\n- (void)dtx_beginTouchesAtPoints:(NSArray *)points relativeToWindow:(UIWindow *)window immediateDelivery:(BOOL)immediate\n{\n\tNSAssert(_touchInjector == nil, @\"Cannot call this method more than once until endTouch is called.\");\n\t_touchInjector = [[DTXTouchInjector alloc] initWithWindow:window onTouchInectCallback:_onTouchCallback];\n\tDTXTouchInfo *touchInfo = [[DTXTouchInfo alloc] initWithPoints:points phase:DTXTouchInfoPhaseTouchBegan deliveryTimeDeltaSinceLastTouch:0 expendable:NO];\n\t[_touchInjector enqueueTouchInfoForDelivery:touchInfo];\n\t\n\tif(immediate == YES)\n\t{\n\t\t[_touchInjector waitUntilAllTouchesAreDeliveredUsingInjector];\n\t}\n}\n\n/**\n *  Enqueues the next touch to be delivered.\n *\n *  @param points     Multiple points at which the touches are to be made.\n *  @param seconds    An interval to wait after the every last touch event.\n *  @param immediate  If @c YES, this method blocks until touches are delivered, otherwise it is\n *                    enqueued for delivery the next time runloop drains.\n *  @param expendable Indicates that this touch point is intended to be delivered in a timely\n *                    manner rather than reliably.\n */\n- (void)dtx_continueTouchAtPoints:(NSArray *)points afterTimeElapsedSinceLastTouchDelivery:(NSTimeInterval)seconds immediateDelivery:(BOOL)immediate expendable:(BOOL)expendable {\n\tDTXTouchInfo *touchInfo = [[DTXTouchInfo alloc] initWithPoints:points phase:DTXTouchInfoPhaseTouchMoved deliveryTimeDeltaSinceLastTouch:seconds expendable:expendable];\n\t[_touchInjector enqueueTouchInfoForDelivery:touchInfo];\n\t\n\tif(immediate == YES)\n\t{\n\t\t[_touchInjector waitUntilAllTouchesAreDeliveredUsingInjector];\n\t}\n}\n\n/**\n *  Enqueues the final touch in a touch sequence to be delivered.\n *\n *  @param points  Multiple points at which the touches are to be made.\n *  @param seconds An interval to wait after the every last touch event.\n */\n- (void)dtx_endTouchesAtPoints:(NSArray *)points timeElapsedSinceLastTouchDelivery:(NSTimeInterval)seconds {\n\tDTXTouchInfo *touchInfo = [[DTXTouchInfo alloc] initWithPoints:points phase:DTXTouchInfoPhaseTouchEnded deliveryTimeDeltaSinceLastTouch:seconds expendable:NO];\n\t\n\t[_touchInjector enqueueTouchInfoForDelivery:touchInfo];\n\t[_touchInjector waitUntilAllTouchesAreDeliveredUsingInjector];\n\t\n\t_touchInjector = nil;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXTouchInfo-Private.h",
    "content": "//\n//  DTXTouchInfo-Private.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/27/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"DTXTouchInfo.h\"\n\n@interface DTXTouchInfo ()\n\n@property (nonatomic) NSTimeInterval enqueuedMediaTime;\n@property (nonatomic, readonly) NSTimeInterval fireMediaTime;\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXTouchInfo.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <UIKit/UIKit.h>\n\n/**\n *  An enum for what phase of a touch action a @c DTXTouchInfo object is in.\n */\ntypedef NS_ENUM(NSUInteger, DTXTouchInfoPhase) {\n  DTXTouchInfoPhaseTouchBegan,\n  DTXTouchInfoPhaseTouchMoved,\n  DTXTouchInfoPhaseTouchEnded,\n};\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n *  An object to encapsulate essential information about a touch.\n */\n@interface DTXTouchInfo : NSObject\n\n/**\n *  Points where touch should be delivered.\n */\n@property(nonatomic, readonly) NSArray *points;\n\n/**\n *  The phase (began, moved etc) of the touch object.\n */\n@property(nonatomic, assign) DTXTouchInfoPhase phase;\n\n/**\n *  Delays this touch for specified value since the last touch delivery.\n */\n@property(nonatomic, readonly) NSTimeInterval deliveryTimeDeltaSinceLastTouch;\n/**\n *  Indicates that this touch can be dropped if system delivering the touches experiences a\n *  lag causing it to miss the expected delivery time.\n */\n@property(nonatomic, readonly, getter=isExpendable) BOOL expendable;\n\n/**\n *  Initializes this object to represent a touch at the the given @c points.\n *\n *  @param points                         The CGPoints where the touches are to be delivered.\n *  @param phase                          The current phase of each touch point.\n *  @param timeDeltaSinceLastTouchSeconds The relative injection time from the time last\n *                                        touch point was injected. It is also used as the\n *                                        expected delivery time.\n *  @param expendable                     Used for time sensitive touches, it specified if the\n *                                        touch can be dropped if system lag causes the system to\n *                                        miss the expected delivery time. If @c NO, then the touch\n *                                        will be delivered regardless.\n *\n *  @return An instance of DTXTouchInfo, initialized with all required data.\n */\n- (instancetype)initWithPoints:(NSArray *)points phase:(DTXTouchInfoPhase)phase deliveryTimeDeltaSinceLastTouch:(NSTimeInterval)timeDeltaSinceLastTouchSeconds expendable:(BOOL)expendable NS_DESIGNATED_INITIALIZER;\n\n/**\n *  @remark init is not an available initializer. Use the other initializers.\n */\n- (instancetype)init NS_UNAVAILABLE;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXTouchInfo.m",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \"DTXTouchInfo-Private.h\"\n\n@implementation DTXTouchInfo\n\n- (instancetype)initWithPoints:(NSArray *)points phase:(DTXTouchInfoPhase)phase deliveryTimeDeltaSinceLastTouch:(NSTimeInterval)timeDeltaSinceLastTouchSeconds expendable:(BOOL)expendable\n{\n\tself = [super init];\n\tif (self)\n\t{\n\t\t_points = points;\n\t\t_phase = phase;\n\t\t_deliveryTimeDeltaSinceLastTouch = timeDeltaSinceLastTouchSeconds;\n\t\t_expendable = expendable;\n\t}\n\treturn self;\n}\n\n- (NSString *)description\n{\n\tNSMutableString *desc = [[NSMutableString alloc] init];\n\t[desc appendFormat:@\"%@\", NSStringFromClass([self class])];\n\t[desc appendFormat:@\" with phase: %ld\\n\", (long)_phase];\n\t[desc appendFormat:@\" with delivery delta time: %g\\n\", _deliveryTimeDeltaSinceLastTouch];\n\t[desc appendFormat:@\" with points: %@\\n\", _points];\n\tif(_enqueuedMediaTime != 0)\n\t{\n\t\t[desc appendFormat:@\" projected fire media time: %@\\n\", @(self.fireMediaTime)];\n\t}\n\treturn desc;\n}\n\n- (NSTimeInterval)fireMediaTime\n{\n\treturn _enqueuedMediaTime + _deliveryTimeDeltaSinceLastTouch;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXTouchInjector.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <Foundation/Foundation.h>\n\n#import \"DTXTouchInfo.h\"\n\n/**\n *  State for touch injector.\n */\ntypedef NS_ENUM(NSInteger, DTXTouchInjectorState) {\n  /**\n   *  Touch injection hasn't started yet.\n   */\n  kDTXTouchInjectorPendingStart,\n  /**\n   *  Injection has started injecting touches.\n   */\n  kDTXTouchInjectorStarted,\n  /**\n   *  Touch injection has stopped. This state is reached when injector has\n   *  finished injecting all the queued touches.\n   */\n  kDTXTouchInjectorStopped,\n};\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n *  A touch injector that delivers a complete touch sequence for single finger interactions.\n *  Buffers all touch events until @c startInjecting: is called.\n *  Once injection is complete, this injector should be discarded.\n */\n@interface DTXTouchInjector : NSObject\n/**\n *  @remark init is not an available initializer. Use the other initializers.\n */\n- (instancetype)init NS_UNAVAILABLE;\n\n/**\n *  Initializes with the @c window to which touches will be delivered.\n *\n *  @param window The window that receives the touches.\n *  @param callback An optional callback to be invoked upon every touch injection.\n *\n *  @return An instance of GREYSingleSequenceTouchInjector, initialized with the window to be\n *          touched.\n */\n- (instancetype)initWithWindow:(UIWindow *)window onTouchInectCallback:(nullable BOOL(^)(UITouchPhase))callback NS_DESIGNATED_INITIALIZER;\n\n/**\n *  Enqueues @c touchInfo that will be materialized into a UITouch and delivered to application.\n *\n *  @param touchInfo The info that is used to create the UITouch. If it represents a last touch\n *                   in a sequence, the specified @c point value is ignored and injector\n *                   automatically picks the previous point where touch occurred to deliver\n *                   the last touch.\n */\n- (void)enqueueTouchInfoForDelivery:(DTXTouchInfo *)touchInfo;\n\n/**\n *  @return The state of this injector.\n */\n- (DTXTouchInjectorState)state;\n\n/**\n *  Starts delivering touches to current application.\n */\n- (void)startInjecting;\n\n/**\n *  Wait until the touch injection has stopped.\n */\n- (void)waitUntilAllTouchesAreDeliveredUsingInjector;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/DTXTouchInjector.m",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \"DTXTouchInjector.h\"\n\n#import <QuartzCore/QuartzCore.h>\n#include <mach/mach_time.h>\n\n#import \"UITouch+DTXAdditions.h\"\n#import \"DTXAppleInternals.h\"\n#import \"DTXRunLoopSpinner.h\"\n#import \"DTXTouchInfo-Private.h\"\n\n\n@implementation DTXTouchInjector\n{\n\t// Window to which touches will be delivered.\n\tUIWindow* _window;\n\t// List of objects that aid in creation of UITouches.\n\tNSMutableArray<DTXTouchInfo*>* _enqueuedTouchInfoList;\n\t// A display link used for injecting touches.\n\tCADisplayLink* _displayLink;\n\t// Touch objects created to start the touch sequence for every\n\t// touch points. It stores one UITouch object for each finger\n\t// in a touch event.\n\tNSMutableArray<UITouch*>* _ongoingUITouches;\n\t// Current state of the injector.\n\tDTXTouchInjectorState _state;\n\t// The previously injected touch event. Used to determine\n\t// whether an injected touch needs to be stationary or not.\n\t// May be nil.\n\tDTXTouchInfo* _previousTouchInfo;\n\n\tBOOL (^_callback)(UITouchPhase);\n\tBOOL _abortedByCallback;\n}\n\n- (instancetype)initWithWindow:(UIWindow *)window onTouchInectCallback:(nullable BOOL(^)(UITouchPhase))callback\n{\n\tNSParameterAssert(window != nil);\n\n\tself = [super init];\n\tif (self)\n\t{\n\t\t_window = window;\n\t\t_enqueuedTouchInfoList = [[NSMutableArray alloc] init];\n\t\t_state = kDTXTouchInjectorPendingStart;\n\t\t_ongoingUITouches = [[NSMutableArray alloc] init];\n\t\t_callback = callback;\n\t}\n\treturn self;\n}\n\n- (void)enqueueTouchInfoForDelivery:(DTXTouchInfo *)touchInfo\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\n\ttouchInfo.enqueuedMediaTime = _enqueuedTouchInfoList.count == 0 ? CACurrentMediaTime() : _enqueuedTouchInfoList.lastObject.fireMediaTime;\n\t[_enqueuedTouchInfoList addObject:touchInfo];\n\n\t[_enqueuedTouchInfoList sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@\"fireMediaTime\" ascending:YES]]];\n}\n\n- (DTXTouchInjectorState)state\n{\n\treturn _state;\n}\n\n- (void)startInjecting\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\n\tif (_state == kDTXTouchInjectorStarted)\n\t{\n\t\treturn;\n\t}\n\n\t_state = kDTXTouchInjectorStarted;\n\tif(_displayLink == nil)\n\t{\n\t\t_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkDidTick)];\n\t\t[_displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];\n\t}\n}\n\n- (void)waitUntilAllTouchesAreDeliveredUsingInjector\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\n\t// Start if necessary.\n\tif (_state == kDTXTouchInjectorPendingStart || _state == kDTXTouchInjectorStopped)\n\t{\n\t\t[self startInjecting];\n\t}\n\n\t// Now wait for it to finish.\n\tDTXRunLoopSpinner *runLoopSpinner = [DTXRunLoopSpinner new];\n\trunLoopSpinner.timeout = DBL_MAX;\n\trunLoopSpinner.minRunLoopDrains = 0;\n\trunLoopSpinner.maxSleepInterval = DBL_MAX;\n\t[runLoopSpinner spinWithStopConditionBlock:^BOOL\n\t{\n\t\treturn (_state == kDTXTouchInjectorStopped);\n\t}];\n}\n\n#pragma mark - Display Link\n\n- (void)displayLinkDidTick\n{\n\tNSParameterAssert(NSThread.isMainThread);\n\n\tDTXTouchInfo *touchInfo = [self dtx_dequeueTouchInfoForDeliveryWithCurrentTime:CACurrentMediaTime()];\n\tif (!touchInfo)\n\t{\n\t\tif (_enqueuedTouchInfoList.count == 0)\n\t\t{\n\t\t\t// Queue is empty - we are done delivering touches.\n\t\t\t[self dtx_stopTouchInjection];\n\t\t}\n\t\treturn;\n\t}\n\n\tUITouchPhase reportedPhase;\n\n\tif ([_ongoingUITouches count] == 0)\n\t{\n\t\treportedPhase = UITouchPhaseBegan;\n\t\t[self dtx_extractAndChangeTouchToStartPhase:touchInfo];\n\t}\n\telse if (touchInfo.phase == DTXTouchInfoPhaseTouchEnded)\n\t{\n\t\treportedPhase = UITouchPhaseEnded;\n\t\t[self dtx_changeTouchToEndPhase:touchInfo];\n\t}\n\telse\n\t{\n\t\treportedPhase = UITouchPhaseMoved;\n\t\tif(_abortedByCallback == NO)\n\t\t{\n\t\t\t[self dtx_changeTouchToMovePhase:touchInfo];\n\t\t}\n\t}\n\t[self dtx_injectTouches:touchInfo];\n\n\tif(_callback && _abortedByCallback == NO)\n\t{\n\t\t_abortedByCallback = _callback(reportedPhase) == NO;\n\n\t\tif(_abortedByCallback)\n\t\t{\n\t\t\t//Clean up the pending touches list from any subsequent non -Ended touches.\n\t\t\t[_enqueuedTouchInfoList filterUsingPredicate:[NSPredicate predicateWithFormat:@\"phase == %@\", @(DTXTouchInfoPhaseTouchEnded)]];\n\t\t}\n\t}\n}\n\n\n#pragma mark - Private\n\n/**\n *  Helper method to return UITouch object at @c index from the @c ongoingTouches array.\n *\n *  @param index Index of the @c ongoingTouches array.\n *\n *  @return UITouch object at that given @c index of the @c ongoingTouches array.\n */\n- (UITouch *)dtx_UITouchForFinger:(NSUInteger)index\n{\n\treturn (UITouch *)[_ongoingUITouches objectAtIndex:index];\n}\n\n/**\n *  Extracts UITouches from @c touchInfo object and inserts those in the ongoingTouches array.\n *  Phase of UITouch is set to UITouchPhaseBegan.\n *\n *  @param touchInfo The info that is used to create the UITouch.\n */\n- (void)dtx_extractAndChangeTouchToStartPhase:(DTXTouchInfo *)touchInfo\n{\n\tfor (NSValue *touchPoint in touchInfo.points)\n\t{\n\t\tCGPoint point = [touchPoint CGPointValue];\n\t\tUITouch *touch = [[UITouch alloc] initAtPoint:point relativeToWindow:_window];\n\t\t[touch setPhase:UITouchPhaseBegan];\n\t\t[_ongoingUITouches addObject:touch];\n\t}\n}\n\n/**\n *  Phase of UITouches is set to UITouchPhaseEnded for the lastTouch condition.\n *\n *  @param touchInfo The info that is used to create the UITouch.\n */\n- (void)dtx_changeTouchToEndPhase:(DTXTouchInfo *)touchInfo\n{\n\tfor (NSUInteger i = 0; i < [touchInfo.points count]; i++)\n\t{\n\t\tUITouch *touch = [self dtx_UITouchForFinger:i];\n\t\tCGPoint touchPoint = [[_previousTouchInfo.points objectAtIndex:i] CGPointValue];\n\t\t[touch _setLocationInWindow:touchPoint resetPrevious:NO];\n\t\t[touch setPhase:UITouchPhaseEnded];\n\t}\n}\n\n/**\n *  Phase of UITouches is set to UITouchPhaseMoved and currentTouchLocation is set to the\n *  current touch point.\n *\n *  @param touchInfo The info that is used to create the UITouch.\n */\n- (void)dtx_changeTouchToMovePhase:(DTXTouchInfo *)touchInfo\n{\n\tfor (NSUInteger i = 0; i < [touchInfo.points count]; i++)\n\t{\n\t\tCGPoint touchPoint = [[touchInfo.points objectAtIndex:i] CGPointValue];\n\t\tUITouch *touch = [self dtx_UITouchForFinger:i];\n\t\t[touch _setLocationInWindow:touchPoint resetPrevious:NO];\n\t\tCGPoint previousTouchPoint = [[_previousTouchInfo.points objectAtIndex:i] CGPointValue];\n\t\tif (CGPointEqualToPoint(previousTouchPoint, touchPoint))\n\t\t{\n\t\t\t[touch setPhase:UITouchPhaseStationary];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t[touch setPhase:UITouchPhaseMoved];\n\t\t}\n\t}\n}\n\n/**\n *  Inject touches to the application.\n *\n *  @param touchInfo The info that is used to create the UITouch.\n */\n- (void)dtx_injectTouches:(DTXTouchInfo *)touchInfo\n{\n\tUITouchesEvent *event = [[UIApplication sharedApplication] _touchesEvent];\n\t// Clean up before injecting touches.\n\t[event _clearTouches];\n\n\t// Array to store all hidEvent references to be released later.\n\tNSMutableArray *hidEvents = [NSMutableArray arrayWithCapacity:[_ongoingUITouches count]];\n\n\tuint64_t machAbsoluteTime = mach_absolute_time();\n\tAbsoluteTime timeStamp;\n\ttimeStamp.hi = (UInt32)(machAbsoluteTime >> 32);\n\ttimeStamp.lo = (UInt32)(machAbsoluteTime);\n\n\tUIView *currentTouchView = nil;\n\tfor (NSUInteger i = 0; i < [_ongoingUITouches count]; i++)\n\t{\n\t\tUITouch *currentTouch = [self dtx_UITouchForFinger:i];\n\t\tif (i == 0)\n\t\t{\n\t\t\tcurrentTouchView = currentTouch.view;\n\t\t}\n\t\t[currentTouch setTimestamp:[[NSProcessInfo processInfo] systemUptime]];\n\n\t\tIOHIDDigitizerEventMask eventMask = currentTouch.phase == UITouchPhaseMoved ? kIOHIDDigitizerEventPosition : (kIOHIDDigitizerEventRange | kIOHIDDigitizerEventTouch);\n\n\t\tCGPoint touchLocation = [currentTouch locationInView:currentTouch.window];\n\n\t\t// Both range and touch are set to 0 if phase is UITouchPhaseEnded, 1 otherwise.\n\t\tBoolean isRangeAndTouch = (currentTouch.phase != UITouchPhaseEnded);\n\t\tIOHIDEventRef hidEvent = IOHIDEventCreateDigitizerFingerEvent(kCFAllocatorDefault, timeStamp, 0, 2, eventMask, touchLocation.x, touchLocation.y, 0, 0, 0, isRangeAndTouch, isRangeAndTouch, 0);\n\n\t\t[hidEvents addObject:[NSValue valueWithPointer:hidEvent]];\n\n\t\tif ([currentTouch respondsToSelector:@selector(_setHidEvent:)])\n\t\t{\n\t\t\t[currentTouch _setHidEvent:hidEvent];\n\t\t}\n\n\t\t[event _addTouch:currentTouch forDelayedDelivery:NO];\n\t}\n\n\t[event _setHIDEvent:[[hidEvents objectAtIndex:0] pointerValue]];\n\t// iOS adds an autorelease pool around every event-based interaction.\n\t// We should mimic that if we want to relinquish bits in a timely manner.\n\t@autoreleasepool\n\t{\n\t\t_previousTouchInfo = touchInfo;\n\t\tBOOL touchViewContainsWKWebView = NO;\n\n\t\t@try\n\t\t{\n\t\t\t[[UIApplication sharedApplication] sendEvent:event];\n\n\t\t\tif (currentTouchView)\n\t\t\t{\n\t\t\t\t// If a WKWebView is being tapped, don't call [event _clearTouches], as this causes long\n\t\t\t\t// presses to fail. For this case, the child of |currentTouchView| is a WKCompositingView.\n\t\t\t\tUIView *firstChild = currentTouchView.subviews.firstObject;\n\t\t\t\tif ([firstChild isKindOfClass:NSClassFromString(@\"WKCompositingView\")])\n\t\t\t\t{\n\t\t\t\t\ttouchViewContainsWKWebView = YES;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@catch (NSException *e)\n\t\t{\n\t\t\t[self dtx_stopTouchInjection];\n\t\t\t@throw;\n\t\t}\n\t\t@finally\n\t\t{\n\t\t\t// Clear all touches so that it is not leaked, except for WKWebViews, where these calls\n\t\t\t// can prevent the app tracker from becoming idle.\n\t\t\tif (!touchViewContainsWKWebView)\n\t\t\t{\n\t\t\t\t[event _clearTouches];\n\t\t\t}\n\t\t\t// We need to release the event manually, otherwise it will leak.\n\t\t\tfor (NSValue *hidEventValue in hidEvents)\n\t\t\t{\n\t\t\t\tIOHIDEventRef hidEvent = [hidEventValue pointerValue];\n\t\t\t\tCFRelease(hidEvent);\n\t\t\t}\n\t\t\t[hidEvents removeAllObjects];\n\t\t\tif (touchInfo.phase == DTXTouchInfoPhaseTouchEnded)\n\t\t\t{\n\t\t\t\t[_ongoingUITouches removeAllObjects];\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n *  Stops touch injection by invalidating the current timer and clearing the touch info list.\n */\n- (void)dtx_stopTouchInjection\n{\n\t_state = kDTXTouchInjectorStopped;\n\t[_displayLink invalidate];\n\t_displayLink = nil;\n\t[_enqueuedTouchInfoList removeAllObjects];\n}\n\n/**\n *  Dequeues the next touch to be delivered based on @c currentTime.\n *\n *  @param currentTime The time for the next touch to be dequeued.\n *\n *  @return The touch info for the next touch. If a touch could not be dequeued\n *          (which can happen if queue is empty or if we attempt to dequeue too early)\n *          @c nil is returned.\n */\n- (DTXTouchInfo *)dtx_dequeueTouchInfoForDeliveryWithCurrentTime:(CFTimeInterval)currentTime\n{\n\tif(_enqueuedTouchInfoList.firstObject.fireMediaTime > currentTime)\n\t{\n\t\treturn nil;\n\t}\n\n\tDTXTouchInfo* rv = [_enqueuedTouchInfoList firstObject];\n\tif(rv != nil)\n\t{\n\t\t[_enqueuedTouchInfoList removeObjectAtIndex:0];\n\t}\n\n\treturn rv;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/UITouch+DTXAdditions.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UITouch (DTXAdditions)\n\n/**\n *  Creates a fake touch at @c point in window coordinates of the given @c window.\n *\n *  @param point  The location of this touch in window coordinates.\n *  @param window The reference window used for coordinates passed as @c point.\n *\n *  @return An initialized UITouch object\n */\n- (id)initAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/AppleTouchEvents/UITouch+DTXAdditions.m",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \"UITouch+DTXAdditions.h\"\n\n#import \"DTXAppleInternals.h\"\n\n@implementation UITouch (DTXAdditions)\n\n- (id)initAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window\n{\n\tNSParameterAssert(window != nil);\n\t\n\tself = [super init];\n\tif (self)\n\t{\n\t\t[self setTapCount:1];\n\t\t[self setPhase:UITouchPhaseBegan];\n\t\t[self setWindow:window];\n\t\t[self _setLocationInWindow:point resetPrevious:YES];\n\t\t[self setView:[window hitTest:point withEvent:nil]];\n\t\t[self setTimestamp:[[NSProcessInfo processInfo] systemUptime]];\n\t\t\n\t\tif(@available(iOS 14.0, *))\n\t\t{\n\t\t\t[self _setIsTapToClick:YES];\n\t\t\t\n\t\t\t// We modify the touchFlags ivar struct directly.\n\t\t\t// First entry is _firstTouchForView\n\t\t\tIvar flagsIvar = class_getInstanceVariable(object_getClass(self), \"_touchFlags\");\n\t\t\tptrdiff_t touchFlagsOffset = ivar_getOffset(flagsIvar);\n\t\t\tchar *flags = (__bridge void *)self + touchFlagsOffset;\n\t\t\t*flags = *flags | (char)0x01;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t[self setIsTap:YES];\n\t\t\t[self _setIsFirstTouchForView:YES];\n\t\t}\n\t}\n\treturn self;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Assertions/DTXAssertionHandler+Swift.swift",
    "content": "//\n//  DTXAssertionHandler+Swift.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/30/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nimport UIKit\n\n@inline(__always)\nfunc dtx_try_nothrow(_ block: () -> Void) -> Bool {\n\tdo {\n\t\ttry DTXAssertionHandler.__try(block)\n\t\treturn true\n\t}\n\tcatch {\n\t\treturn false\n\t}\n}\n\n@inline(__always)\nfunc dtx_try(_ block: () -> Void) throws {\n\ttry DTXAssertionHandler.__try(block)\n}\n\n@inline(__always)\nfunc dtx_fatalError(_ message: @autoclosure () -> String, viewDescription: @autoclosure () -> [String: Any]? = nil, function: String = #function, file: String = #file, line: UInt = #line) -> Never {\n\tDTXAssertionHandler.handleFailure(inFunction: function, file: file, lineNumber: Int(line), viewDescription: viewDescription(), description: message(), arguments: getVaList([]))\n\tabort()\n}\n\n@inline(__always)\nfunc dtx_assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String, viewDescription: @autoclosure () -> [String: Any]? = nil, function: String = #function, file: String = #file, line: UInt = #line) {\n\tguard condition() else {\n\t\tdtx_fatalError(message(), viewDescription: viewDescription(), function: function, file: file, line: line)\n\t}\n}\n\n@inline(__always)\nfunc dtx_errorForFatalError(_ message: @autoclosure () -> String, viewDescription: @autoclosure () -> [String: Any]? = nil, function: String = #function, file: String = #file, line: UInt = #line) -> Error {\n\treturn DTXAssertionHandler.errorForFailure(inFunction: function, file: file, lineNumber: Int(line), viewDescription: viewDescription(), description: message(), arguments: getVaList([]))\n}\n"
  },
  {
    "path": "detox/ios/Detox/Assertions/DTXAssertionHandler.h",
    "content": "//\n//  DTXAssertionHandler.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/28/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DTXTestAssertionException : NSException\n\n+ (NSException *)exceptionWithReason:(nullable NSString *)reason userInfo:(nullable NSDictionary *)userInfo viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription;\n\n+ (NSException *)exceptionWithName:(NSExceptionName)name reason:(nullable NSString *)reason userInfo:(nullable NSDictionary *)userInfo NS_UNAVAILABLE;\n\n@property (nonatomic, strong, nullable) NSDictionary<NSString*, id>* viewDescription;\n\n@end\n\n@interface DTXAssertionHandler : NSObject\n\n+ (BOOL)try:(void(NS_NOESCAPE ^)(void))block error:(NSError * __nullable * __null_unspecified)error NS_REFINED_FOR_SWIFT;\n\n+ (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format,... NS_FORMAT_FUNCTION(6,7);\n\n+ (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format,... NS_FORMAT_FUNCTION(5,6);\n\n+ (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments;\n\n+ (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments;\n\n+ (NSError*)errorForFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments;\n\n+ (NSError*)errorForFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments;\n\n+ (NSError*)errorWithReworedReason:(NSString*)reworded existingError:(NSError*)error;\n\n@end\n\nextern BOOL dtx_try(void (NS_NOESCAPE ^block)(void), NSError * __nullable * __null_unspecified error) NS_REFINED_FOR_SWIFT;\n\n#define DTXViewAssert(condition, _viewDescription, desc, ...)\t\\\ndo {\t\t\t\t\\\n\t__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \\\n\tif (__builtin_expect(!(condition), 0)) {\t\t\\\n\t\t\tNSString *__assert_file__ = [NSString stringWithUTF8String:__FILE_NAME__]; \\\n\t\t\t__assert_file__ = __assert_file__ ? __assert_file__ : @\"<Unknown File>\"; \\\n\t\t[DTXAssertionHandler handleFailureInMethod:_cmd \\\n\t\tobject:self file:__assert_file__ \\\n\t\t\tlineNumber:__LINE__ viewDescription:_viewDescription description:(desc), ##__VA_ARGS__]; \\\n\t}\t\t\t\t\\\n\t__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \\\n} while(0)\n\n#define DTXCViewAssert(condition, _viewDescription, desc, ...) \\\ndo {\t\t\t\t\\\n\t__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \\\n\tif (__builtin_expect(!(condition), 0)) {\t\t\\\n\t\tNSString *__assert_fn__ = [NSString stringWithUTF8String:__PRETTY_FUNCTION__]; \\\n\t\t__assert_fn__ = __assert_fn__ ? __assert_fn__ : @\"<Unknown Function>\"; \\\n\t\tNSString *__assert_file__ = [NSString stringWithUTF8String:__FILE_NAME__]; \\\n\t\t__assert_file__ = __assert_file__ ? __assert_file__ : @\"<Unknown File>\"; \\\n\t[DTXAssertionHandler handleFailureInFunction:__assert_fn__ \\\n\tfile:__assert_file__ \\\n\t\tlineNumber:__LINE__ viewDescription:_viewDescription description:(desc), ##__VA_ARGS__]; \\\n}\t\t\t\t\\\n\t__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \\\n} while(0)\n\n#define DTXAssert(condition, desc, ...)\tDTXViewAssert(condition, nil, desc, ##__VA_ARGS__)\n\n#define DTXCAssert(condition, desc, ...) DTXCViewAssert(condition, nil, desc, ##__VA_ARGS__)\n\n#define DTXParameterAssert(condition) DTXAssert((condition), @\"Invalid parameter not satisfying: %@\", @#condition)\n\n#define DTXCParameterAssert(condition) DTXCAssert((condition), @\"Invalid parameter not satisfying: %@\", @#condition)\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Assertions/DTXAssertionHandler.m",
    "content": "//\n//  DTXAssertionHandler.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/28/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"DTXAssertionHandler.h\"\n#import \"DTXAppleInternals.h\"\n\n@implementation DTXTestAssertionException\n\n+ (NSException *)exceptionWithReason:(nullable NSString *)reason userInfo:(nullable NSDictionary *)userInfo viewDescription:(nullable NSDictionary*)viewDescription\n{\n\tDTXTestAssertionException* rv = (id)[super exceptionWithName:@\"DetoxException\" reason:reason userInfo:userInfo];\n\trv.viewDescription = viewDescription;\n\treturn rv;\n}\n\n@end\n\nBOOL dtx_try(void (^block)(void), NSError * __nullable * __null_unspecified error)\n{\n\treturn [DTXAssertionHandler try:^ {\n\t\tblock();\n\t} error:error];\n}\n\n@implementation DTXAssertionHandler\n\n+ (NSError*)_errorForTestAssertionException:(DTXTestAssertionException*)exception\n{\n\tNSMutableDictionary* userInfo = @{NSLocalizedDescriptionKey: exception.reason, @\"DetoxFailureInformation\": exception.userInfo}.mutableCopy;\n\t\n\tif(exception.viewDescription != nil)\n\t{\n\t\t[userInfo addEntriesFromDictionary:exception.viewDescription];\n\t}\n\t\n\treturn [NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:userInfo];\n}\n\n#if DEBUG\nstatic void __detox_nested_try(void)\n{\n\t\n}\n#endif\n\n#if DEBUG\nstatic thread_local BOOL __DTXTrying = NO;\n#endif\n\n+ (BOOL)try:(void(NS_NOESCAPE ^)(void))block error:(NSError * __nullable * __null_unspecified)error\n{\n#if DEBUG\n\tif(__DTXTrying == YES)\n\t{\n\t\t__detox_nested_try();\n\t}\n\t\n\t__DTXTrying = YES;\n\tdtx_defer {\n\t\t__DTXTrying = NO;\n\t};\n#endif\n\t\n\t@try\n\t{\n\t\tblock();\n\t}\n\t@catch(DTXTestAssertionException *exception)\n\t{\n\t\tif(error)\n\t\t{\n\t\t\t*error = [self _errorForTestAssertionException:exception];\n\t\t}\n\t\t\n\t\treturn NO;\n\t}\n\t//Only catch DTXTestAssertionException here. Others should be handled by the system.\n\t@catch(NSException* exception)\n\t{\n\t\t[exception raise];\n\t}\n\t\n\treturn YES;\n}\n\n+ (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format, ...\n{\n\tva_list argumentList;\n\tva_start(argumentList, format);\n\t[self handleFailureInFunction:functionName file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:argumentList];\n\tva_end(argumentList);\n\t\n}\n\n+ (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format, ...\n{\n\tva_list argumentList;\n\tva_start(argumentList, format);\n\t[self handleFailureInMethod:selector object:object file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:argumentList];\n\tva_end(argumentList);\n}\n\n+ (DTXTestAssertionException*)_exceptionForFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\treturn (id)[DTXTestAssertionException exceptionWithReason:[[NSString alloc] initWithFormat:format arguments:arguments] userInfo:@{\n\t\t@\"functionName\": functionName,\n\t\t@\"file\": fileName,\n\t\t@\"lineNumber\": @(line)\n\t} viewDescription:viewDescription];\n}\n\n+ (DTXTestAssertionException*)_exceptionForFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\treturn (id)[DTXTestAssertionException exceptionWithReason:[[NSString alloc] initWithFormat:format arguments:arguments] userInfo:@{\n\t\t@\"selector\": NSStringFromSelector(selector),\n\t\t@\"object\": [object debugDescription],\n\t\t@\"file\": fileName,\n\t\t@\"lineNumber\": @(line)\n\t} viewDescription:viewDescription];\n}\n\n+ (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\t[[self _exceptionForFailureInFunction:functionName file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:arguments] raise];\n}\n\n+ (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\t[[self _exceptionForFailureInMethod:selector object:object file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:arguments] raise];\n}\n\n+ (NSError*)errorForFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\treturn [self _errorForTestAssertionException:[self _exceptionForFailureInFunction:functionName file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:arguments]];\n}\n\n+ (NSError*)errorForFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line viewDescription:(nullable NSDictionary<NSString*, id>*)viewDescription description:(NSString *)format arguments:(va_list)arguments\n{\n\treturn [self _errorForTestAssertionException:[self _exceptionForFailureInMethod:selector object:object file:fileName lineNumber:line viewDescription:viewDescription description:format arguments:arguments]];\n}\n\n+ (NSError*)errorWithReworedReason:(NSString*)reworded existingError:(NSError*)error\n{\n\tNSMutableDictionary* userInfo = [error.userInfo mutableCopy];\n\tuserInfo[NSLocalizedDescriptionKey] = reworded;\n\t\n\treturn [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Detox.h",
    "content": "//\n//  Detox.h\n//  Detox\n//\n//  Created by Tal Kol on 6/15/16.\n//  Copyright © 2016 Wix. All rights reserved.\n//\n\n@import Foundation;\n\n//! Project version number for Detox.\nFOUNDATION_EXPORT double DetoxVersionNumber;\n\n//! Project version string for Detox.\nFOUNDATION_EXPORT const unsigned char DetoxVersionString[];\n"
  },
  {
    "path": "detox/ios/Detox/Detox.modulemap",
    "content": "framework module Detox {\n\tumbrella header \"Detox.h\"\n\texport *\n\n\texplicit module Private {\n\t\theader \"UIView+DetoxMatchers.h\"\n\t\theader \"UIPickerView+DetoxActions.h\"\n\t\theader \"UIDatePicker+DetoxActions.h\"\n\t\theader \"UIScrollView+DetoxActions.h\"\n\t\theader \"DTXAssertionHandler.h\"\n\t\theader \"UIView+DetoxUtils.h\"\n\t\theader \"ReactNativeSupport.h\"\n\t\theader \"DetoxInstrumentsManager.h\"\n\t\theader \"DetoxAppDelegateProxy.h\"\n\t\theader \"UIDevice+DetoxActions.h\"\n\t\theader \"UISlider+DetoxUtils.h\"\n\t\theader \"DTXDurationFormatter.h\"\n\t\theader \"UIWindow+DetoxUtils.h\"\n\t\theader \"DTXAppleInternals.h\"\n\t\theader \"NSThread+DetoxUtils.h\"\n\t\theader \"NSObject+DetoxUtils.h\"\n\t\theader \"NSObject+DetoxActions.h\"\n\t\theader \"NSURL+DetoxUtils.h\"\n\t\theader \"NSURL+DetoxUtils.h\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Detox.pch",
    "content": "//\n//  Detox.pch\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 12/10/17.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\n#ifndef Detox_pch\n#define Detox_pch\n\n#define DTXAddressInfo detox_DTXAddressInfo\n\n#import \"DTXLogging.h\"\n\n#import \"Swiftier.h\"\n\n#ifdef __OBJC__\n#import \"DTXAssertionHandler.h\"\n#import \"NSThread+DetoxUtils.h\"\n#import \"NSArray+Utils.h\"\n#endif\n\n#endif /* Detox_pch */\n"
  },
  {
    "path": "detox/ios/Detox/Detox.xcconfig",
    "content": "SWIFT_INCLUDE_PATHS = $(SRCROOT)/Detox\n"
  },
  {
    "path": "detox/ios/Detox/DetoxAppDelegateProxy.h",
    "content": "//\n//  DetoxAppDelegateProxy.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 19/01/2017.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\n@import Foundation;\n@import UIKit;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DetoxAppDelegateProxy : NSObject <UIApplicationDelegate>\n\n@property (class, nonatomic, strong, readonly) DetoxAppDelegateProxy* sharedAppDelegateProxy;\n\n- (void)_dispatchUserActivityFromDataURL:(NSURL*)userActivityDataURL delayUntilActive:(BOOL)delay NS_SWIFT_NAME(dispatch(userActivityFrom:delayUntilActive:));\n- (void)_dispatchUserNotificationFromDataURL:(NSURL*)userNotificationDataURL delayUntilActive:(BOOL)delay NS_SWIFT_NAME(dispatch(userNotificationFrom:delayUntilActive:));\n- (void)_dispatchOpenURL:(NSURL*)URL options:(NSDictionary*)options delayUntilActive:(BOOL)delay NS_SWIFT_NAME(dispatch(openURL:options:delayUntilActive:));\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/DetoxAppDelegateProxy.m",
    "content": "//\n//  DetoxAppDelegateProxy.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 19/01/2017.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\n#import \"DetoxAppDelegateProxy.h\"\n@import ObjectiveC;\n@import UIKit;\n@import UserNotifications;\n@import COSTouchVisualizer;\n\n#import \"DTXAddressInfo.h\"\n\nDTX_CREATE_LOG(AppDelegateProxy)\n__unused static BOOL _enableVerboseLogging = NO;\n#define dtx_log_verbose(format, ...) __extension__({ \\\nif(_enableVerboseLogging) { __dtx_log(__prepare_and_return_file_log(), OS_LOG_TYPE_DEBUG, __current_log_prefix, format, ##__VA_ARGS__); } \\\n})\n\n#import <Detox/Detox-Swift.h>\n\n@interface COSTouchVisualizerWindow () @end\n@interface DTXTouchVisualizerWindow : COSTouchVisualizerWindow @end\n@implementation DTXTouchVisualizerWindow\n\n- (UIWindow *)overlayWindow\n{\n\treturn self;\n}\n\n- (BOOL)_canBecomeKeyWindow\n{\n\treturn NO;\n}\n\n@end\n\nstatic NSObject<UIApplicationDelegate>* _userAppDelegate;\nstatic DetoxAppDelegateProxy* _appDelegateProxy;\n\nstatic NSMutableArray<NSDictionary*>* _pendingOpenURLs;\nstatic NSMutableArray<DTXUserNotificationDispatcher*>* _pendingUserNotificationDispatchers;\nstatic DTXUserNotificationDispatcher* _pendingLaunchUserNotificationDispatcher;\nstatic NSMutableArray<DTXUserActivityDispatcher*>* _pendingUserActivityDispatchers;\nstatic DTXUserActivityDispatcher* _pendingLaunchUserActivityDispatcher;\n\nstatic DTXTouchVisualizerWindow* _touchVisualizerWindow;\n\nstatic BOOL _disableTouchIndicator;\n\nstatic NSURL* _launchUserNotificationDataURL(void)\n{\n\tNSString* userNotificationDataPath = [[NSUserDefaults standardUserDefaults] objectForKey:@\"detoxUserNotificationDataURL\"];\n\t\n\tif(userNotificationDataPath == nil)\n\t{\n\t\treturn nil;\n\t}\n\t\n\treturn [NSURL fileURLWithPath:userNotificationDataPath];\n}\n\nstatic NSURL* _launchUserActivityDataURL(void)\n{\n\tNSString* userActivityDataPath = [[NSUserDefaults standardUserDefaults] objectForKey:@\"detoxUserActivityDataURL\"];\n\t\n\tif(userActivityDataPath == nil)\n\t{\n\t\treturn nil;\n\t}\n\t\n\treturn [NSURL fileURLWithPath:userActivityDataPath];\n}\n\n@interface UIWindow (DTXEventProxy) @end\n\n@implementation UIWindow (DTXEventProxy)\n\n+ (void)load\n{\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\tDTXSwizzleMethod(self, @selector(sendEvent:), @selector(__dtx_sendEvent:), NULL);\n\t});\n}\n\n- (void)__dtx_sendEvent:(UIEvent *)event\n{\n\tif([self isKindOfClass:[COSTouchVisualizerWindow class]])\n\t{\n\t\treturn;\n\t}\n\t\n\t[_touchVisualizerWindow sendEvent:event];\n\t[self __dtx_sendEvent:event];\n}\n\n@end\n\n@interface DetoxAppDelegateProxy () <UIApplicationDelegate, COSTouchVisualizerWindowDelegate> @end\n\n@implementation DetoxAppDelegateProxy\n\n+ (void)_regenerateNewAppDelegateProxy\n{\n\tif(_appDelegateProxy != nil)\n\t{\n\t\t[NSNotificationCenter.defaultCenter removeObserver:_appDelegateProxy];\n\t}\n\t\n\t_appDelegateProxy = [DetoxAppDelegateProxy new];\n\t[NSNotificationCenter.defaultCenter addObserver:_appDelegateProxy selector:@selector(_applicationDidLaunchNotification:) name:UIApplicationDidFinishLaunchingNotification object:nil];\n}\n\n+ (instancetype)sharedAppDelegateProxy\n{\n\tif(_appDelegateProxy == nil)\n\t{\n\t\t[self _regenerateNewAppDelegateProxy];\n\t}\n\t\n\treturn _appDelegateProxy;\n}\n\n+ (void)load\n{\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\t_pendingOpenURLs = [NSMutableArray new];\n\t\t_pendingUserNotificationDispatchers = [NSMutableArray new];\n\n\t\t_disableTouchIndicator = [NSUserDefaults.standardUserDefaults boolForKey:@\"detoxDisableTouchIndicators\"];\n\t\t\n\t\t_enableVerboseLogging = [NSUserDefaults.standardUserDefaults boolForKey:@\"enableAppDelegateVerboseLogging\"];\n\t\t\n\t\tNSURL* url;\n\t\t\n\t\t_pendingUserActivityDispatchers = [NSMutableArray new];\n\t\t\n\t\turl = _launchUserActivityDataURL();\n\t\tif(url)\n\t\t{\n\t\t\t_pendingLaunchUserActivityDispatcher = [[DTXUserActivityDispatcher alloc] initWithUserActivityDataURL:url];\n\t\t}\n\t\t\n\t\turl = _launchUserNotificationDataURL();\n\t\tif(url)\n\t\t{\n\t\t\t_pendingLaunchUserNotificationDispatcher = [[DTXUserNotificationDispatcher alloc] initWithUserNotificationDataURL:url];\n\t\t}\n\t\t\n\t\tMethod m = class_getInstanceMethod([UIApplication class], @selector(delegate));\n\t\t__unused id<UIApplicationDelegate> (*origDelegate)(id, SEL) = (void*)method_getImplementation(m);\n\t\tmethod_setImplementation(m, imp_implementationWithBlock(^(id _self) {\n\t\t\tNSArray* zz = [NSThread callStackReturnAddresses];\n\t\t\tNSUInteger caller = [zz[1] unsignedIntegerValue];\n\t\t\tDTXAddressInfo* ainfo = [[DTXAddressInfo alloc] initWithAddress:caller];\n\t\t\tNSString* image = ainfo.image;\n\t\t\t\n\t\t\tNSMutableString* request = [NSMutableString stringWithFormat:@\"Delegate request from “%@`%@”; \", ainfo.image, ainfo.symbol];\n\t\t\tdtx_defer {\n\t\t\t\tdtx_log_verbose(@\"%@\", request);\n\t\t\t};\n\t\t\t\n\t\t\tif([image isEqualToString:@\"UIKit\"] || [image isEqualToString:@\"UIKitCore\"])\n\t\t\t{\n\t\t\t\t[request appendString:@\"providing proxy app delegate to caller\"];\n\t\t\t\treturn (id<UIApplicationDelegate>)DetoxAppDelegateProxy.sharedAppDelegateProxy;\n\t\t\t}\n\t\t\t\n\t\t\t[request appendString:@\"providing user app delegate to caller\"];\n\t\t\treturn (id<UIApplicationDelegate>)_userAppDelegate;\n\t\t}));\n\t\t\n\t\tm = class_getInstanceMethod([UIApplication class], @selector(setDelegate:));\n\t\tvoid (*origSetDelegate)(id, SEL, NSObject<UIApplicationDelegate, COSTouchVisualizerWindowDelegate>*) = (void*)method_getImplementation(m);\n\t\tmethod_setImplementation(m, imp_implementationWithBlock(^ (id _self, NSObject<UIApplicationDelegate, COSTouchVisualizerWindowDelegate>* origDelegate) {\n\t\t\t_userAppDelegate = origDelegate;\n\t\t\torigSetDelegate(_self, @selector(setDelegate:), DetoxAppDelegateProxy.sharedAppDelegateProxy);\n\t\t}));\n\t});\n}\n\n- (void)_applicationDidLaunchNotification:(NSNotification*)notification\n{\n\tif(!_disableTouchIndicator)\n\t{\n\t\tdispatch_async(dispatch_get_main_queue(), ^{\n\t\t\t_touchVisualizerWindow = [[DTXTouchVisualizerWindow alloc] initWithFrame:CGRectZero];\n\t\t\t_touchVisualizerWindow.windowLevel = 100000000000;\n\t\t\t_touchVisualizerWindow.backgroundColor = [UIColor.greenColor colorWithAlphaComponent:0.0];\n\t\t\t_touchVisualizerWindow.hidden = NO;\n\t\t\t_touchVisualizerWindow.touchVisualizerWindowDelegate = self;\n\t\t\t_touchVisualizerWindow.stationaryMorphEnabled = NO;\n\t\t\t_touchVisualizerWindow.userInteractionEnabled = NO;\n\t\t\t_touchVisualizerWindow.frame = UIScreen.mainScreen.bounds;\n\t\t\t\n//\t\t\tUIVisualEffectView* blurView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];\n//\t\t\tblurView.translatesAutoresizingMaskIntoConstraints = NO;\n//\t\t\t\n//\t\t\t[_touchVisualizerWindow addSubview:blurView];\n//\t\t\t\n//\t\t\t[NSLayoutConstraint activateConstraints:@[\n//\t\t\t\t[_touchVisualizerWindow.leadingAnchor constraintEqualToAnchor:blurView.leadingAnchor],\n//\t\t\t\t[_touchVisualizerWindow.rightAnchor constraintEqualToAnchor:blurView.rightAnchor],\n//\t\t\t\t[_touchVisualizerWindow.topAnchor constraintEqualToAnchor:blurView.topAnchor],\n//\t\t\t\t[_touchVisualizerWindow.bottomAnchor constraintEqualToAnchor:blurView.bottomAnchor],\n//\t\t\t]];\n\t\t});\n\t}\n}\n\n- (NSURL*)_URLOverride\n{\n\treturn [NSURL URLWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@\"detoxURLOverride\"]];\n}\n\n- (NSString*)_sourceAppOverride\n{\n\treturn [[NSUserDefaults standardUserDefaults] objectForKey:@\"detoxSourceAppOverride\"];\n}\n\n- (NSDictionary*)_prepareLaunchOptions:(NSDictionary*)launchOptions userNotificationDispatcher:(DTXUserNotificationDispatcher*)notificationDispatcher userActivityDispatcher:(DTXUserActivityDispatcher*)activityDispatcher\n{\n\tNSMutableDictionary* rv = [launchOptions mutableCopy] ?: [NSMutableDictionary new];\n\t\n\tif(notificationDispatcher && notificationDispatcher.remoteNotificationDictionary)\n\t{\n\t\trv[UIApplicationLaunchOptionsRemoteNotificationKey] = notificationDispatcher.remoteNotificationDictionary;\n\t}\n\t\n\tif(activityDispatcher)\n\t{\n\t\tNSUserActivity* userActivity = [activityDispatcher userActivity];\n\t\t\n\t\tNSDictionary* userActivityDictionary = @{\n\t\t\t\t\t\t\t\t\t\t\t\t @\"UIApplicationLaunchOptionsUserActivityKey\": userActivity,\n\t\t\t\t\t\t\t\t\t\t\t\t UIApplicationLaunchOptionsUserActivityTypeKey: userActivity.activityType,\n\t\t\t\t\t\t\t\t\t\t\t\t };\n\t\t\n\t\trv[UIApplicationLaunchOptionsUserActivityDictionaryKey] = userActivityDictionary;\n\t}\n\t\n\tNSURL* openURLOverride = [self _URLOverride];\n\tif(openURLOverride)\n\t{\n\t\trv[UIApplicationLaunchOptionsURLKey] = openURLOverride;\n\t}\n\tNSString* originalAppOverride = [self _sourceAppOverride];\n\tif(originalAppOverride)\n\t{\n\t\trv[UIApplicationLaunchOptionsSourceApplicationKey] = originalAppOverride;\n\t}\n\t\n\treturn rv;\n}\n\n- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary<UIApplicationLaunchOptionsKey, id>*)launchOptions\n{\n\tlaunchOptions = [self _prepareLaunchOptions:launchOptions userNotificationDispatcher:_pendingLaunchUserNotificationDispatcher userActivityDispatcher:_pendingLaunchUserActivityDispatcher];\n\t\n\tBOOL rv = YES;\n\tif([_userAppDelegate respondsToSelector:_cmd])\n\t{\n\t\trv = [_userAppDelegate application:application willFinishLaunchingWithOptions:launchOptions];\n\t}\n\t\n\treturn rv;\n}\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions\n{\n\tlaunchOptions = [self _prepareLaunchOptions:launchOptions userNotificationDispatcher:_pendingLaunchUserNotificationDispatcher userActivityDispatcher:_pendingLaunchUserActivityDispatcher];\n\t\n\tBOOL rv = YES;\n\tif([_userAppDelegate respondsToSelector:_cmd])\n\t{\n\t\trv = [_userAppDelegate application:application didFinishLaunchingWithOptions:launchOptions];\n\t}\n\t\n\t[_pendingLaunchUserNotificationDispatcher dispatchOnAppDelegate:self simulateDuringLaunch:YES];\n\t[_pendingLaunchUserActivityDispatcher dispatchOnAppDelegate:self];\n\t\n\t_pendingLaunchUserNotificationDispatcher = nil;\n\t_pendingLaunchUserActivityDispatcher = nil;\n\t\n\tif([self _URLOverride] && [class_getSuperclass(object_getClass(self)) instancesRespondToSelector:@selector(application:openURL:options:)])\n\t{\n\t\t[self application:application openURL:[self _URLOverride] options:launchOptions];\n\t}\n\t\n\treturn rv;\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application\n{\n\tif([_userAppDelegate respondsToSelector:_cmd])\n\t{\n\t\t[_userAppDelegate applicationDidBecomeActive:application];\n\t}\n\t\n\t[_pendingOpenURLs enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n\t\t[self _actualDispatchOpenURL:obj];\n\t}];\n\t[_pendingOpenURLs removeAllObjects];\n\t\n\t[_pendingUserNotificationDispatchers enumerateObjectsUsingBlock:^(DTXUserNotificationDispatcher * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n\t\t[self _actualDispatchUserNotificationWithDispatcher:obj];\n\t}];\n\t[_pendingUserNotificationDispatchers removeAllObjects];\n\t\n\t[_pendingUserActivityDispatchers enumerateObjectsUsingBlock:^(DTXUserActivityDispatcher * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n\t\t[self _actualDispatchUserActivityWithDispatcher:obj];\n\t}];\n\t[_pendingUserActivityDispatchers removeAllObjects];\n}\n\n- (BOOL)touchVisualizerWindowShouldAlwaysShowFingertip:(COSTouchVisualizerWindow *)window\n{\n\treturn _disableTouchIndicator == NO;\n}\n\n- (void)_actualDispatchUserActivityWithDispatcher:(DTXUserActivityDispatcher*)dispatcher\n{\n\t[dispatcher dispatchOnAppDelegate:self];\n}\n\n- (void)_dispatchUserActivityFromDataURL:(NSURL*)userActivityDataURL delayUntilActive:(BOOL)delay\n{\n\tDTXUserActivityDispatcher* dispatcher = [[DTXUserActivityDispatcher alloc] initWithUserActivityDataURL:userActivityDataURL];\n\t\n\tif(delay)\n\t{\n\t\t[_pendingUserActivityDispatchers addObject:dispatcher];\n\t}\n\telse\n\t{\n\t\t[self _actualDispatchUserActivityWithDispatcher:dispatcher];\n\t}\n}\n\n- (void)_actualDispatchUserNotificationWithDispatcher:(DTXUserNotificationDispatcher*)dispatcher\n{\n\t[dispatcher dispatchOnAppDelegate:self simulateDuringLaunch:NO];\n}\n\n- (void)_dispatchUserNotificationFromDataURL:(NSURL*)userNotificationDataURL delayUntilActive:(BOOL)delay\n{\n\tDTXUserNotificationDispatcher* dispatcher = [[DTXUserNotificationDispatcher alloc] initWithUserNotificationDataURL:userNotificationDataURL];\n\t\n\tif(delay && UIApplication.sharedApplication.applicationState != UIApplicationStateActive)\n\t{\n\t\t[_pendingUserNotificationDispatchers addObject:dispatcher];\n\t}\n\telse\n\t{\n\t\t[self _actualDispatchUserNotificationWithDispatcher:dispatcher];\n\t}\n}\n\n- (void)_actualDispatchOpenURL:(NSDictionary*)URLAndOptions\n{\n\tif([self respondsToSelector:@selector(application:openURL:options:)])\n\t{\n\t\t[self application:[UIApplication sharedApplication] openURL:URLAndOptions[@\"URL\"] options:URLAndOptions[@\"options\"]];\n\t}\n}\n\n- (void)_dispatchOpenURL:(NSURL*)URL options:(NSDictionary*)options delayUntilActive:(BOOL)delay\n{\n\tNSDictionary* payload = NSDictionaryOfVariableBindings(URL, options);\n\t\n\tif(delay)\n\t{\n\t\t[_pendingOpenURLs addObject:payload];\n\t}\n\telse\n\t{\n\t\t[self _actualDispatchOpenURL:payload];\n\t}\n}\n\n#pragma mark Proxy\n\n#define BOOLTOSTR(b) (b == YES ? @\"YES\" : @\"NO\")\n\n- (BOOL)respondsToSelector:(SEL)aSelector\n{\n\tBOOL proxy = [super respondsToSelector:aSelector];\n\tBOOL user = [_userAppDelegate respondsToSelector:aSelector];\n\tBOOL responds = proxy || user;\n\tdtx_log_verbose(@\"Selector “%@” %@\", NSStringFromSelector(aSelector), responds ? [NSString stringWithFormat:@\"known (proxy:%@, user:%@)\", BOOLTOSTR(proxy), BOOLTOSTR(user)] : @\"unknown\");\n\t\n\treturn responds;\n}\n\n- (id)forwardingTargetForSelector:(SEL)aSelector\n{\n\tif([super respondsToSelector:aSelector])\n\t{\n\t\treturn self;\n\t}\n\t\n\tdtx_log_verbose(@\"Forwarding selector “%@” to original app delegate\", NSStringFromSelector(aSelector));\n\treturn _userAppDelegate;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/DetoxInit.m",
    "content": "//\n//  DetoxInit.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/22/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Detox/Detox-Swift.h>\n#import \"DetoxCrashHandler.h\"\n\n#if DEBUG\n@import DetoxSync;\n\n@interface DetoxSyncDebugger : NSObject <DTXSyncManagerDelegate> @end\n\n@implementation DetoxSyncDebugger\n\n- (void)syncSystemDidBecomeIdle\n{\n\tNSLog(@\"🟢 System idle\");\n}\n\n- (void)syncSystemDidBecomeBusy\n{\n\tNSLog(@\"🔴 System busy\");\n}\n\n- (void)syncSystemDidStartTrackingEventWithIdentifier:(NSString*)identifier description:(NSString*)description objectDescription:(nullable NSString*)objectDescription additionalDescription:(nullable NSString*)additionalDescription\n{\n\tNSLog(@\"❗️ tracking %@ description: %@ object: %@ additional: %@\", identifier, description, objectDescription, additionalDescription);\n}\n\n- (void)syncSystemDidEndTrackingEventWithIdentifier:(NSString*)identifier\n{\n\tNSLog(@\"❗️ finished tracking %@\", identifier);\n}\n@end\n\nstatic DetoxSyncDebugger* _detoxSyncDebugger;\n\n#endif\n\n__attribute__((constructor))\nstatic void detoxConditionalInit(void)\n{\n\t__DTXInstallCrashHandlersIfNeeded();\n\t\n\t//This forces accessibility support in the application.\n\t[[[NSUserDefaults alloc] initWithSuiteName:@\"com.apple.Accessibility\"] setBool:YES forKey:@\"ApplicationAccessibilityEnabled\"];\n\t\n\tNSUserDefaults* options = [NSUserDefaults standardUserDefaults];\n\t\n#if DEBUG\n\tif([options boolForKey:@\"detoxEnableSyncDebug\"])\n\t{\n\t\t_detoxSyncDebugger = [DetoxSyncDebugger new];\n\t\tDTXSyncManager.delegate = _detoxSyncDebugger;\n\t}\n#endif\n\t\n\tNSMutableDictionary* settings = [NSMutableDictionary new];\n\t\n\tNSString* syncEnabled = [options objectForKey:@\"detoxEnableSynchronization\"];\n\tif(syncEnabled)\n\t{\n\t\tsettings[@\"enabled\"] = @([syncEnabled boolValue]);\n\t}\n\t\n\tNSString *blacklistRegex = [options stringForKey:@\"detoxURLBlacklistRegex\"];\n\tif (blacklistRegex)\n\t{\n\t    NSCharacterSet* separatorOrUselessChars = [NSCharacterSet characterSetWithCharactersInString:@\"()\\\", \"];\n        NSArray* _blacklistArray = [blacklistRegex componentsSeparatedByCharactersInSet:separatorOrUselessChars];\n\n        NSPredicate* predicate = [NSPredicate predicateWithFormat:@\"length>1\"];\n        settings[@\"blacklistURLs\"] = [_blacklistArray filteredArrayUsingPredicate:predicate];\n\t}\n\t\n\tNSString* maxTimerWait = [options objectForKey:@\"detoxMaxSynchronizedDelay\"];\n\tsettings[@\"maxTimerWait\"] = @(maxTimerWait ? maxTimerWait.integerValue : 1500);\n\t\n\tNSString* waitForDebugger = [options objectForKey:@\"detoxWaitForDebugger\"];\n\tif(waitForDebugger)\n\t{\n\t\tsettings[@\"waitForDebugger\"] = @([waitForDebugger integerValue]);\n\t}\n\t\n\t[DTXDetoxManager.sharedManager startWithSynchronizationSettings:settings];\n}\n"
  },
  {
    "path": "detox/ios/Detox/DetoxManager.swift",
    "content": "//\n//  DetoxManager.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/22/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nimport UIKit\nimport DetoxSync\nimport LNViewHierarchyDumper\n\nfileprivate let recordingManager : DetoxInstrumentsManager = {\n    return DetoxInstrumentsManager()\n}()\n\nfileprivate let log = DetoxLog(category: \"DetoxManager\")\n\n@objc(DTXDetoxManager)\npublic class DetoxManager : NSObject, WebSocketDelegate {\n    private let webSocket : WebSocket\n    private var isReady = false\n\n    @objc(sharedManager)\n    public static var shared : DetoxManager = {\n        return DetoxManager()\n    }()\n\n    override init() {\n        webSocket = WebSocket()\n\n        super.init()\n\n        webSocket.delegate = self\n\n        NotificationCenter.default.addObserver(self, selector: #selector(appDidLaunch(_:)), name: UIApplication.didFinishLaunchingNotification, object: nil)\n        NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground(_:)), name: UIApplication.didEnterBackgroundNotification, object: nil)\n\n        if let recordingPath = UserDefaults.standard.string(forKey: \"recordingPath\") {\n            var props : [String: Any] = [\"recordingPath\": recordingPath]\n            if let _ = UserDefaults.standard.string(forKey: \"samplingInterval\") {\n                let samplingIntervalDouble = UserDefaults.standard.double(forKey: \"samplingInterval\")\n                props[\"samplingInterval\"] = samplingIntervalDouble\n            }\n\n            self.handlePerformanceRecording(props: props, isFromLaunch: true, completionHandler: nil)\n        }\n    }\n\n    private func safeSend(action: String, params: [String: Any] = [:], messageId: NSNumber) {\n        DTXSyncManager.enqueueMainQueueIdleClosure {\n            self.webSocket.sendAction(action, params: params, messageId: messageId)\n        }\n    }\n\n    @objc\n    private func appDidLaunch(_ note: Notification) {\n        DTXSyncManager.enqueueMainQueueIdleClosure {\n            self.isReady = true\n            self.sendGeneralReadyMessage()\n        }\n    }\n\n    @objc\n    private func appDidEnterBackground(_ note: Notification) {\n        var bgTask : UIBackgroundTaskIdentifier = .invalid\n        bgTask = UIApplication.shared.beginBackgroundTask(withName: \"DetoxBackground\") {\n            UIApplication.shared.endBackgroundTask(bgTask)            \n            bgTask = .invalid\n\n        }\n    }\n\n    private func waitFor(applicationState: UIApplication.State, action: String, messageId: NSNumber) {\n        var observer : NSObjectProtocol?\n\n        let response : () -> Void = {\n            self.safeSend(action: \"\\(action)Done\", messageId: messageId)\n\n            guard observer == nil else {\n                NotificationCenter.default.removeObserver(observer!)\n                observer = nil\n                return\n            }\n        }\n\n        guard UIApplication.shared.applicationState != applicationState else {\n            response()\n            return\n        }\n\n        let notificationName : NSNotification.Name\n        switch  applicationState {\n            case .active:\n                notificationName = UIApplication.didBecomeActiveNotification\n                break\n            case .background:\n                notificationName = UIApplication.didEnterBackgroundNotification\n                break\n            case .inactive:\n                notificationName = UIApplication.willResignActiveNotification\n            default:\n                fatalError(\"Unknown application state \\(applicationState)\")\n        }\n\n        observer = NotificationCenter.default.addObserver(forName: notificationName, object: nil, queue: .main, using: { notification in\n            DispatchQueue.main.async(execute: response)\n        })\n    }\n\n    private func sendGeneralReadyMessage() {\n        safeSend(action: \"ready\", messageId: -1000)\n    }\n\n    private func start() {\n        start(synchronizationSettings: nil)\n    }\n\n    @objc(startWithSynchronizationSettings:)\n    public func start(synchronizationSettings settings: [String: Any]?) {\n        if let settings = settings {\n            setSynchronizationSettings(settings, messageId: nil)\n        }\n\n        let options = UserDefaults.standard\n        let detoxServer = options.string(forKey: \"detoxServer\") ?? \"ws://localhost:8099\"\n        let detoxSessionId = options.string(forKey: \"detoxSessionId\") ?? Bundle.main.bundleIdentifier!\n\n        webSocket.connect(toServer: URL(string: detoxServer)!, withSessionId: detoxSessionId)\n    }\n\n    private func handlePerformanceRecording(props: [String: Any]?, isFromLaunch launch: Bool, completionHandler: (() -> Void)?) {\n        var completionBlocked = false\n\n        if let props = props, let _ = props[\"recordingPath\"] as? String {\n            if launch {\n                recordingManager.continueRecording(withConfiguration: props)\n            } else {\n                recordingManager.startRecording(withConfiguration: props)\n            }\n        } else {\n            completionBlocked = true\n            recordingManager.stopRecording { error in\n                if let error = error {\n                    log.error(\"Error while stopping recording: \\(error)\")\n                }\n\n                if let completionHandler = completionHandler {\n                    if Thread.isMainThread {\n                        completionHandler()\n                    } else {\n                        DispatchQueue.main.async {\n                            completionHandler()\n                        }\n                    }\n                }\n            }\n        }\n\n        if completionBlocked == false {\n            completionHandler?()\n        }\n    }\n\n    private func stopAndCleanupRecording() {\n        handlePerformanceRecording(props: nil, isFromLaunch: false, completionHandler: nil)\n    }\n\n    private func waitForRNLoad(withMessageId messageId: NSNumber) {\n        ReactNativeSupport.waitForReactNativeLoad {\n            self.isReady = true\n            self.sendGeneralReadyMessage()\n        }\n    }\n\n    @objc(notifyOnCrashWithDetails:)\n    public func notifyOnCrash(details: [String: Any]) {\n        log.error(\"App crashed: \\(details[\"errorDetails\"]!)\")\n\n        let semaphore = DispatchSemaphore(value: 1)\n\n        recordingManager.stopRecording { error in\n            semaphore.signal()\n        }\n\n        semaphore.wait()\n\n        webSocket.sendAction(\"AppWillTerminateWithError\", params: details, messageId: -10000)\n    }\n\n    private func setSynchronizationSettings(_ settings: [String: Any], messageId: NSNumber?) {\n        settings.forEach { key, value in\n            switch key {\n                case \"maxTimerWait\":\n                    let maxTimerWait = (value as! NSNumber).doubleValue / 1000\n                    DTXSyncManager.maximumAllowedDelayedActionTrackingDuration = maxTimerWait\n                    DTXSyncManager.maximumTimerIntervalTrackingDuration = maxTimerWait\n                    return\n                case \"waitForDebugger\":\n                    Thread.sleep(forTimeInterval: Double(truncating: value as! NSNumber) / 1000)\n                    return\n                case \"blacklistURLs\":\n                    DTXSyncManager.urlBlacklist = value as! [String]\n                    DTXSyncManager.urlBlacklist = value as! [String]\n                    return\n                case \"enabled\":\n                    DTXSyncManager.synchronizationDisabled = !((value as! NSNumber).boolValue)\n                    return\n                default:\n                    log.error(\"Unknown synchronization setting received: \\(key)\")\n                    return\n            }\n        }\n\n        if let messageId = messageId {\n            safeSend(action: \"setSyncSettingsDone\", messageId: messageId)\n        }\n    }\n\n    // MARK: WebSocketDelegate\n\n    func webSocketDidConnect(_ webSocket: WebSocket) {\n        if ReactNativeSupport.isReactNativeApp {\n            isReady = true\n            sendGeneralReadyMessage()\n        }\n    }\n\n    func webSocket(_ webSocket: WebSocket, didFailWith error: Error) {\n        log.error(\"Web socket failed to connect with error: \\(error.localizedDescription)\")\n\n        DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: self.start)\n    }\n\n    func webSocket(_ webSocket: WebSocket, didReceiveAction type: String, params: [String : Any], messageId: NSNumber) {\n        let done = \"\\(type)Done\"\n\n        switch type {\n            case \"testerDisconnected\":\n                stopAndCleanupRecording()\n                return\n            case \"setRecordingState\":\n                handlePerformanceRecording(props: params, isFromLaunch: false) {\n                    self.safeSend(action: done, messageId: messageId)\n                }\n                return\n            case \"waitForActive\":\n                waitFor(applicationState: .active, action: type, messageId: messageId)\n                return\n            case \"waitForBackground\":\n                waitFor(applicationState: .background, action: type, messageId: messageId)\n                return\n            case \"waitForIdle\":\n                safeSend(action: done, messageId: messageId)\n                return\n            case \"setSyncSettings\":\n                setSynchronizationSettings(params, messageId: messageId)\n                return\n            case \"invoke\":\n                DTXSyncManager.enqueueMainQueueIdleClosure {\n                    InvocationManager.invoke(dictionaryRepresentation: params) { result, error in\n                        if let error = error {\n                            let params: NSMutableDictionary = [\"details\": error.localizedDescription]\n                            params.addEntries(from: (error as NSError).userInfo)\n\n                            if UserDefaults.standard.bool(forKey: \"detoxDisableHierarchyDump\") == false {\n                                let url = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(\"\\(NSUUID().uuidString).viewhierarchy\")\n                                do {\n                                    try LNViewHierarchyDumper.shared.dumpViewHierarchy(to: url)\n                                    params[\"viewHierarchyURL\"] = url.path\n                                } catch {}\n                            }\n\n                            if UserDefaults.standard.bool(forKey: \"detoxDebugVisibility\") {\n                                params[\"visibilityFailingScreenshotsURL\"] = NSURL.visibilityFailingScreenshotsPath().path\n                                params[\"visibilityFailingRectsURL\"] = NSURL.visibilityFailingRectsPath().path\n                            }\n\n                            self.safeSend(action: \"testFailed\", params: params as! [String : Any], messageId: messageId)\n                        } else {\n                            self.safeSend(action: \"invokeResult\", params: result ?? [:], messageId: messageId)\n                        }\n                    }\n                }\n                return\n            case \"isReady\":\n                if isReady {\n                    sendGeneralReadyMessage()\n                }\n                return\n            case \"cleanup\":\n                self.webSocket.sendAction(done, params: [:], messageId: messageId)\n                return\n            case \"deliverPayload\":\n                let delay = (params[\"delayPayload\"] as? Bool) ?? false\n\n                let closure : () -> Void\n                let sendDoneAction : () -> Void = {\n                    self.safeSend(action: done, messageId: messageId)\n                }\n\n                if let urlParam = params[\"url\"] as? String {\n                    guard let urlToOpen = URL(string: urlParam) else {\n                        fatalError(\"Invalid URL\")\n                    }\n\n                    var options : [UIApplication.LaunchOptionsKey: Any] = [UIApplication.LaunchOptionsKey.url: urlToOpen]\n                    if let sourceApp = params[\"sourceApp\"] as? String {\n                        options[UIApplication.LaunchOptionsKey.sourceApplication] = sourceApp\n                    }\n\n                    closure = {\n                        DetoxAppDelegateProxy.shared.dispatch(openURL: urlToOpen, options: options, delayUntilActive: delay)\n                        sendDoneAction()\n                    }\n                } else if let notificationParam = params[\"detoxUserNotificationDataURL\"] as? String {\n                    let userNotificationDataURL = URL(fileURLWithPath: notificationParam)\n\n                    closure = {\n                        DetoxAppDelegateProxy.shared.dispatch(userNotificationFrom: userNotificationDataURL, delayUntilActive: delay)\n                        sendDoneAction()\n                    }\n                } else if let activityParam = params[\"detoxUserActivityDataURL\"] as? String {\n                    let userActivityDataURL = URL(fileURLWithPath: activityParam)\n\n                    closure = {\n                        DetoxAppDelegateProxy.shared.dispatch(userActivityFrom: userActivityDataURL, delayUntilActive: delay)\n                        sendDoneAction()\n                    }\n                }\n                else\n                {\n                    fatalError(\"Unknown payload received\")\n                }\n\n                guard delay == false else {\n                    closure()\n                    return\n                }\n\n                DTXSyncManager.enqueueMainQueueIdleClosure(closure)\n                return\n            case \"setOrientation\":\n                let orientationString = params[\"orientation\"] as! String\n                let shouldSetToLandscape = orientationString == \"landscape\"\n\n                DTXSyncManager.enqueueMainQueueIdleClosure {\n                    if #available(iOS 16.0, *) {\n                        UIApplication.dtx_setOrientation(shouldSetToLandscape ? .landscapeRight : .portrait)\n\n                        DispatchQueue.global().async {\n                            // This is a workaround for a bug in iOS 16.0 and above to avoid reporting done\n                            //  before the orientation change is actually completed.\n                            Thread.sleep(forTimeInterval: 0.4)\n                            self.safeSend(action: done, messageId: messageId)\n                        }\n                    } else {\n                        UIDevice.dtx_setOrientation(shouldSetToLandscape ? .landscapeRight : .portrait)\n                        self.safeSend(action: done, messageId: messageId)\n                    }\n                }\n                return\n            case \"shakeDevice\":\n                DTXSyncManager.enqueueMainQueueIdleClosure {\n                    UIDevice.dtx_shake()\n\n                    self.safeSend(action: done, messageId: messageId)\n                }\n                return\n            case \"reactNativeReload\":\n                if ReactNativeSupport.isReactNativeApp == false {\n                    self.sendGeneralReadyMessage()\n                    return\n                }\n                isReady = false\n                DTXSyncManager.enqueueMainQueueIdleClosure {\n                    ReactNativeSupport.reloadApp()\n                }\n                waitForRNLoad(withMessageId: messageId)\n                return\n            case \"currentStatus\":\n                DTXSyncManager.status { status in\n                    self.webSocket.sendAction(\n                        \"currentStatusResult\",\n                        params: [\"messageId\": messageId, \"status\": status],\n                        messageId: messageId\n                    )\n                }\n                return\n            case \"loginSuccess\":\n                log.info(\"Successfully logged in\")\n                return\n\n            case \"generateViewHierarchyXml\":\n                Task {\n                    let recursiveDescription = await ViewHierarchyGenerator.generateXml(\n                        injectingAccessibilityIdentifiers: params[\"shouldInjectTestIds\"] as! Bool\n                    )\n                    \n                    self.webSocket.sendAction(\n                        \"generateViewHierarchyXmlResult\",\n                        params: [\"viewHierarchy\": recursiveDescription],\n                        messageId: messageId\n                    )\n                }\n            case \"captureViewHierarchy\":\n                let url = URL(fileURLWithPath: params[\"viewHierarchyURL\"] as! String)\n                precondition(url.lastPathComponent.hasSuffix(\".viewhierarchy\"), \"Provided view Hierarchy URL is not in the expected format, ending with “.viewhierarchy”\")\n                var rvParams: [String: Any] = [:]\n                if UserDefaults.standard.bool(forKey: \"detoxDisableHierarchyDump\") == false {\n                    do {\n                        try LNViewHierarchyDumper.shared.dumpViewHierarchy(to: url)\n                    } catch {\n                        rvParams[\"captureViewHierarchyError\"] = error.localizedDescription\n                    }\n                } else {\n                    rvParams[\"captureViewHierarchyError\"] = \"User ran process with -detoxDisableHierarchyDump YES\"\n                }\n                self.webSocket.sendAction(done, params: rvParams, messageId: messageId)\n            default:\n                fatalError(\"Unknown action type received: \\(type)\")\n        }\n    }\n\n    func webSocket(_ webSocket: WebSocket, didCloseWith reason: String?) {\n        if let reason = reason {\n            log.error(\"Web socket closed with reason: \\(reason)\")\n        } else {\n            log.error(\"Web socket closed\")\n        }\n\n        stopAndCleanupRecording()\n        DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: self.start)\n    }\n}\n"
  },
  {
    "path": "detox/ios/Detox/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>FMWK</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/Action.swift",
    "content": "//\n//  Action.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/21/20.\n//\n\nimport Foundation\nimport UIKit\n\n@inline(__always)\n@discardableResult\nfileprivate func async_action_dtx_try(completionHandler: @escaping ([String: Any]?, Error?) -> Void, blockToTry: () -> Void) -> Bool {\n\tdo {\n\t\ttry dtx_try(blockToTry)\n\t} catch {\n\t\tcompletionHandler(nil, error)\n\t\treturn false\n\t}\n\t\n\treturn true\n}\n\nclass Action : CustomStringConvertible {\n\tstruct Keys {\n\t\tstatic let kind = \"action\"\n\t\tstatic let params = \"params\"\n\t\tstatic let `while` = \"while\"\n\t\tstatic let targetElement = \"targetElement\"\n\t}\n\t\n\tenum Kind {\n\t\tstatic let tap = \"tap\"\n\t\tstatic let longPress = \"longPress\"\n\t\tstatic let multiTap = \"multiTap\"\n\t\tstatic let accessibilityAction = \"accessibilityAction\"\n\t\t\n\t\tstatic let tapBackspaceKey = \"tapBackspaceKey\"\n\t\tstatic let tapReturnKey = \"tapReturnKey\"\n\t\tstatic let typeText = \"typeText\"\n\t\tstatic let replaceText = \"replaceText\"\n\t\tstatic let clearText = \"clearText\"\n\t\t\n\t\tstatic let scroll = \"scroll\"\n\t\tstatic let scrollTo = \"scrollTo\"\n\t\t\n\t\tstatic let swipe = \"swipe\"\n\t\tstatic let pinch = \"pinch\"\n\t\tstatic let pinchWithAngleLegacy = \"pinchWithAngle\"\n\t\t\n\t\tstatic let adjustSliderToPosition = \"adjustSliderToPosition\"\n\t\t\n\t\tstatic let setColumnToValue = \"setColumnToValue\"\n\t\tstatic let setDatePickerDate = \"setDatePickerDate\"\n\t\tstatic let getAttributes = \"getAttributes\"\n\t\tstatic let takeScreenshot = \"takeScreenshot\"\n\t}\n\t\n\tlet element : Element\n\tlet kind : String\n\tlet params : [CustomStringConvertible & CustomDebugStringConvertible]?\n\t\n\trequired init(kind: String, params: [CustomStringConvertible & CustomDebugStringConvertible]?, element: Element) {\n\t\tself.element = element\n\t\tself.kind = kind\n\t\tself.params = params\n\t}\n\t\n\tstatic let mapping : [String: Action.Type] = [\n\t\tKind.tap: TapAction.self,\n\t\tKind.longPress: LongPressAction.self,\n\t\tKind.multiTap: MultiTapAction.self,\n\t\tKind.accessibilityAction: AccessibilityActionAction.self,\n\t\t\n\t\tKind.tapBackspaceKey: TypeTextAction.self,\n\t\tKind.tapReturnKey: TypeTextAction.self,\n\t\tKind.typeText: TypeTextAction.self,\n\t\tKind.replaceText: ReplaceTextAction.self,\n\t\tKind.clearText: ClearTextAction.self,\n\t\n\t\tKind.scrollTo: ScrollToEdgeAction.self,\n\t\t\n\t\tKind.swipe: SwipeAction.self,\n\t\tKind.pinch: PinchAction.self,\n\t\tKind.pinchWithAngleLegacy: LegacyPinchAction.self,\n\t\t\n\t\tKind.adjustSliderToPosition : AdjustSliderAction.self,\n\t\t\n\t\tKind.setColumnToValue: SetPickerAction.self,\n\t\tKind.setDatePickerDate: SetDatePickerAction.self,\n\t\tKind.getAttributes: GetAttributesAction.self,\n\t\tKind.takeScreenshot: TakeScreenshotAction.self\n\t]\n\n\tdynamic class func with(dictionaryRepresentation: [String: Any]) throws -> Action {\n\t\tlet kind = dictionaryRepresentation[Keys.kind] as! String //Crash on failure\n\t\tvar params = dictionaryRepresentation[Keys.params] as! [CustomStringConvertible & CustomDebugStringConvertible]?\n\t\t\n\t\tswitch kind {\n\t\tcase Kind.scroll:\n\t\t\treturn try ScrollAction.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\tcase Kind.longPress:\n\t\t\treturn try LongPressAction.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\tcase Kind.tapBackspaceKey:\n\t\t\tparams = [\"\\u{8}\"]\n\t\tcase Kind.tapReturnKey:\n\t\t\tparams = [\"\\n\"]\n\t\tdefault:\n\t\t\tbreak\n\t\t}\n\t\t\n\t\tlet actionClass = mapping[kind]! //Crash on failure\n\t\t\n\t\tlet element = try Element.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\treturn actionClass.init(kind: kind, params: params, element: element)\n\t}\n\t\n\tfileprivate func perform(on element: Element) -> [String: Any]? {\n\t\tfatalError(\"Unimplemented perform(on:) called for \\(type(of: self))\")\n\t}\n\t\n\tfileprivate func perform(on element: Element, completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\tcompletionHandler(perform(on: element), nil)\n\t}\n\t\n\tfunc perform(completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\tasync_action_dtx_try(completionHandler: completionHandler) {\n\t\t\tperform(on: self.element, completionHandler: completionHandler)\n\t\t}\n\t}\n\t\n\tfunc startPosition(forIndex index: Int, in params: [Any]?) -> Double {\n\t\tguard params?.count ?? 0 > index,\n\t\t\t  let param = params?[index] as? Double,\n\t\t\t  param.isNaN == false else {\n\t\t\treturn Double.nan\n\t\t}\n\t\treturn param\n\t}\n\t\n\tvar description: String {\n\t\tlet paramsDescription: String\n\t\tif let params = params {\n\t\t\tlet str = params.map({\n\t\t\t\tif let dict = $0 as? [String: Any] {\n\t\t\t\t\t//Cast to dictionary here to get the Swift debug description, rather than NSDictionary's 🤦‍♂️\n\t\t\t\t\treturn dict.debugDescription\n\t\t\t\t}\n\t\t\t\treturn $0.debugDescription\n\t\t\t}).joined(separator: \", \")\n\t\t\tparamsDescription = \"(\\(str))\"\n\t\t} else {\n\t\t\tparamsDescription = \"\"\n\t\t}\n\t\treturn String(format: \"%@%@ WITH %@\", self.kind.uppercased(), paramsDescription, element.description)\n\t}\n}\n\nclass TapAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tif let point = params?.first as? [String: Double], let x = point[\"x\"], let y = point[\"y\"] {\n\t\t\telement.tap(at: CGPoint(x: x, y: y))\n\t\t\t\n\t\t\treturn nil\n\t\t}\n\t\t\n\t\t//No params or bad params\n\t\telement.tap()\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass LongPressAction : Action {\n\tlet targetElement: Element?\n\t\n\tdynamic override class func with(dictionaryRepresentation: [String: Any]) throws -> Action {\n\t\tlet params = dictionaryRepresentation[Keys.params] as! [CustomStringConvertible & CustomDebugStringConvertible]?\n\t\tlet element = try Element.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\tlet targetElement : Element?\n\t\tif let targetElementDic = dictionaryRepresentation[Keys.targetElement] as? [String: Any]{\n\t\t\ttargetElement = try Element.with(dictionaryRepresentation: targetElementDic)\n\t\t} else {\n\t\t\ttargetElement = nil\n\t\t}\n\t\t\n\t\treturn LongPressAction(kind: Kind.longPress, params: params, element: element, targetElement: targetElement)\n\t}\n\t\n\trequired init(kind: String, params: [CustomStringConvertible & CustomDebugStringConvertible]?, element: Element, targetElement: Element?) {\n\t\tself.targetElement = targetElement\n\t\tsuper.init(kind: kind, params: params, element: element)\n\t}\n\t\n\trequired init(kind: String, params: [CustomStringConvertible & CustomDebugStringConvertible]?, element: Element) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\t\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tif targetElement != nil {\n\t\t\treturn performLongPressAndDrag(on: element)\n\t\t} else {\n\t\t\treturn performLongPress(on: element)\n\t\t}\n\t}\n\n\tprivate func performLongPress(on element: Element) -> [String: Any]? {\n\t\tvar duration: TimeInterval = 1.0\n\t\tvar point: CGPoint?\n\n\t\tif let params {\n\t\t\tfor param in params {\n\t\t\t\tif let number = param as? Double {\n\t\t\t\t\tduration = number.toSeconds()\n\t\t\t\t} else if let pointDict = param as? [String: CGFloat], let x = pointDict[\"x\"], let y = pointDict[\"y\"] {\n\t\t\t\t\tpoint = CGPoint(x: x, y: y)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telement.longPress(at: point, duration: duration)\n\t\treturn nil\n\t}\n\n\tprivate func performLongPressAndDrag(on element: Element) -> [String: Any]? {\n\t\tguard let targetElement, let params else {\n\t\t\tfatalError(\"Invalid params\")\n\t\t}\n\n\t\tguard params.count > 0, let duration = (params[0] as? Double)?.toSeconds() else {\n\t\t\tfatalError(\"Unknown duration\")\n\t\t}\n\n\t\tguard params.count > 2 else {\n\t\t\tfatalError(\"Unknown normalized starting point\")\n\t\t}\n\n\t\tlet normalizedStartingPoint = getNormalizedPoint(xPosition: params[1], yPosition: params[2])\n\n\t\tguard params.count > 4 else {\n\t\t\tfatalError(\"Unknown normalized target point\")\n\t\t}\n\n\t\tlet normalizedTargetingPoint = getNormalizedPoint(xPosition: params[3], yPosition: params[4])\n\n\t\tvar speed = CGFloat(0.5)\n\t\tif let speedString = params[5] as? String {\n\t\t\tswitch speedString {\n\t\t\t\tcase \"slow\":\n\t\t\t\t\tspeed = 0.1\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fast\":\n\t\t\t\t\tspeed = 0.5\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tfatalError(\"Unknown speed\")\n\t\t\t}\n\t\t}\n\n\t\tlet endDuration : TimeInterval\n\n\t\tif let param = params[6] as? Double {\n\t\t\tendDuration = param.toSeconds()\n\t\t} else {\n\t\t\tendDuration = 1.0\n\t\t}\n\n\t\telement.longPress(\n\t\t\tat: normalizedStartingPoint,\n\t\t\tduration: duration,\n\t\t\tdragToElement: targetElement,\n\t\t\tnormalizedTargetPoint: normalizedTargetingPoint,\n\t\t\tvelocity: speed,\n\t\t\tholdForDuration: endDuration\n\t\t)\n\n\t\treturn nil\n\t}\n\n\tfunc getNormalizedPoint(xPosition: Any, yPosition: Any) -> CGPoint {\n\t\tlet xPos, yPos: Double\n\t\t\n\t\tif let pos = xPosition as? Double, pos.isNaN == false {\n\t\t\txPos = pos\n\t\t} else {\n\t\t\txPos = Double.nan\n\t\t}\n\n\t\tif let pos = yPosition as? Double, pos.isNaN == false {\n\t\t\tyPos = pos\n\t\t} else {\n\t\t\tyPos = Double.nan\n\t\t}\n\n\t\treturn CGPoint(x: xPos, y: yPos)\n\t}\n}\n\nclass MultiTapAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet some = params!.first as Any\n\t\tlet taps = some as! Int\n\t\t\n\t\telement.tap(numberOfTaps: taps)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass AccessibilityActionAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet actionName = params!.first as! String\n\n\t\telement.performAccessibilityAction(actionName)\n\n\t\treturn nil\n\t}\n}\n\nclass TypeTextAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet text = params!.first as! String\n\t\t\n\t\telement.typeText(text)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass ReplaceTextAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet text = params!.first as! String\n\t\t\n\t\telement.replaceText(text)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass ClearTextAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\telement.clearText()\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass ScrollAction : Action {\n\tlet whileExpectation : Expectation?\n\t\n\tdynamic override class func with(dictionaryRepresentation: [String: Any]) throws -> Action {\n\t\tlet params = dictionaryRepresentation[Keys.params] as! [CustomStringConvertible & CustomDebugStringConvertible]?\n\t\tlet element = try Element.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\tlet whileExpectation : Expectation?\n\t\tif let whileExpectationObj = dictionaryRepresentation[Keys.while] as? [String: Any] {\n\t\t\twhileExpectation = try Expectation.with(dictionaryRepresentation: whileExpectationObj)\n\t\t} else {\n\t\t\twhileExpectation = nil\n\t\t}\n\t\t\n\t\treturn ScrollAction(kind: Kind.scroll, params: params, element: element, whileExpectation: whileExpectation)\n\t}\n\t\n\trequired init(kind: String, params: [CustomStringConvertible & CustomDebugStringConvertible]?, element: Element, whileExpectation: Expectation?) {\n\t\tself.whileExpectation = whileExpectation\n\t\tsuper.init(kind: kind, params: params, element: element)\n\t}\n\t\n\trequired init(kind: String, params: [CustomStringConvertible & CustomDebugStringConvertible]?, element: Element) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\t\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tfatalError(\"Unimplemented perform(on:) called for \\(type(of: self))\")\n\t}\n\t\n\tfileprivate func perform_async(on element: Element, targetOffset: CGPoint, normalizedStartingPoint: CGPoint, expectation: Expectation, completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\texpectation.evaluate { expectationError in\n\t\t\tguard expectationError != nil else {\n\t\t\t\tcompletionHandler(nil, nil)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n\t\t\tdo {\n\t\t\t\ttry dtx_try {\n\t\t\t\t\telement.scroll(withOffset: targetOffset, normalizedStartingPoint: normalizedStartingPoint)\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\tlet expectationError = expectationError!\n\t\t\t\tlet expectationDescription = expectationError.localizedDescription.prefix(1).lowercased() + expectationError.localizedDescription.dropFirst()\n\t\t\t\tlet compbinedDescription = \"\\(error.localizedDescription) and \\(expectationDescription)\"\n\t\t\t\tcompletionHandler(nil, DTXAssertionHandler.error(withReworedReason: compbinedDescription, existingError: expectationError))\n\t\t\t\t\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n\t\t\tDispatchQueue.main.async {\n\t\t\t\tself.perform_async(on: element, targetOffset: targetOffset, normalizedStartingPoint: normalizedStartingPoint, expectation: expectation, completionHandler: completionHandler)\n\t\t\t}\n\t\t}\n\t}\n\t\n\toverride func perform(on element: Element, completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\tlet points = params![0] as! Double\n\t\tlet directionString = params![1] as! String\n\t\tlet targetOffset : CGPoint\n\t\tswitch directionString {\n\t\tcase \"up\":\n\t\t\ttargetOffset = CGPoint(x: 0, y: points)\n\t\t\tbreak;\n\t\tcase \"down\":\n\t\t\ttargetOffset = CGPoint(x: 0, y: -points)\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\ttargetOffset = CGPoint(x: points, y: 0)\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\ttargetOffset = CGPoint(x: -points, y: 0)\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfatalError(\"Unknown scroll direction\")\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tlet startPositionX : Double\n\t\tif params?.count ?? 0 > 2, let param2 = params?[2] as? Double, param2.isNaN == false {\n\t\t\tstartPositionX = param2\n\t\t} else {\n\t\t\tstartPositionX = Double.nan\n\t\t}\n\t\tlet startPositionY : Double\n\t\tif params?.count ?? 0 > 3, let param3 = params?[3] as? Double, param3.isNaN == false {\n\t\t\tstartPositionY = param3\n\t\t} else {\n\t\t\tstartPositionY = Double.nan\n\t\t}\n\t\tlet normalizedStartingPoint = CGPoint(x: startPositionX, y: startPositionY)\n\t\t\n\t\tguard let whileExpectation = whileExpectation else {\n\t\t\telement.scroll(withOffset: targetOffset, normalizedStartingPoint: normalizedStartingPoint)\n\t\t\tcompletionHandler(nil, nil)\n\t\t\t\n\t\t\treturn\n\t\t}\n\t\t\n\t\tperform_async(on: element, targetOffset: targetOffset, normalizedStartingPoint: normalizedStartingPoint, expectation: whileExpectation, completionHandler: completionHandler)\n\t}\n}\n\nclass ScrollToEdgeAction : Action {\n\toverride func perform(on element: Element)  -> [String: Any]? {\n\t\tlet directionString = params![0] as! String\n\t\tlet targetEdge : UIRectEdge\n\t\tswitch directionString {\n\t\tcase \"top\":\n\t\t\ttargetEdge = .top\n\t\t\tbreak;\n\t\tcase \"bottom\":\n\t\t\ttargetEdge = .bottom\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\ttargetEdge = .left\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\ttargetEdge = .right\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfatalError(\"Unknown scroll direction\")\n\t\t\tbreak;\n\t\t}\n\n\t\tlet startPositionX = startPosition(forIndex: 1, in: params)\n\t\tlet startPositionY = startPosition(forIndex: 2, in: params)\n\t\tlet normalizedStartingPoint = CGPoint(x: startPositionX, y: startPositionY)\n\n\t\telement.scroll(to: targetEdge, normalizedStartingPoint: normalizedStartingPoint)\n\n\t\treturn nil\n\t}\n}\n\nclass SwipeAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tvar targetNormalizedOffset : CGPoint\n\t\tlet directionString = params![0] as! String\n\t\tswitch directionString {\n\t\tcase \"up\":\n\t\t\ttargetNormalizedOffset = CGPoint(x: 0, y: -1)\n\t\t\tbreak;\n\t\tcase \"down\":\n\t\t\ttargetNormalizedOffset = CGPoint(x: 0, y: 1)\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\ttargetNormalizedOffset = CGPoint(x: -1, y: 0)\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\ttargetNormalizedOffset = CGPoint(x: 1, y: 0)\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfatalError(\"Unknown swipe direction\")\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tvar velocity = CGFloat(1.0)\n\t\tif let speedString = params?[1] as? String {\n\t\t\tswitch speedString {\n\t\t\tcase \"slow\":\n\t\t\t\tvelocity = 0.5\n\t\t\t\tbreak;\n\t\t\tcase \"fast\":\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tfatalError(\"Unknown pinch speed\")\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar appliedPercentage = 0.75\n\t\tif let percentage = params?[2] as? Double {\n\t\t\tappliedPercentage = percentage\n\t\t}\n\t\t\n\t\tappliedPercentage = Double.minimum(appliedPercentage, 1.0)\n\t\tappliedPercentage = Double.maximum(0.0, appliedPercentage)\n\t\t\n\t\ttargetNormalizedOffset.x *= CGFloat(appliedPercentage)\n\t\ttargetNormalizedOffset.y *= CGFloat(appliedPercentage)\n\t\t\n\t\t\n\t\tlet startPositionX = startPosition(forIndex: 3, in: params)\n\t\tlet startPositionY = startPosition(forIndex: 4, in: params)\n\t\tlet normalizedStartingPoint = CGPoint(x: startPositionX, y: startPositionY)\n\t\t\n\t\telement.swipe(normalizedOffset: targetNormalizedOffset, velocity: velocity, normalizedStartingPoint: normalizedStartingPoint)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass LegacyPinchAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet directionString = params![0] as! String\n\t\tvar scale : CGFloat\n\t\tswitch directionString {\n\t\tcase \"inward\":\n\t\t\tscale = 0.75\n\t\t\tbreak;\n\t\tcase \"outward\":\n\t\t\tscale = 1.5\n\t\t\tbreak\n\t\tdefault:\n\t\t\tfatalError(\"Unknown pinch direction\")\n\t\t}\n\t\tvar velocity = CGFloat(1.0)\n\t\tif let speedString = params?[1] as? String {\n\t\t\tswitch speedString {\n\t\t\tcase \"slow\":\n\t\t\t\tvelocity = 1.0\n\t\t\t\tbreak;\n\t\t\tcase \"fast\":\n\t\t\t\tvelocity = 2.0\n\t\t\tdefault:\n\t\t\t\tfatalError(\"Unknown pinch speed\")\n\t\t\t}\n\t\t}\n\t\tvar angle = CGFloat(0.0)\n\t\tif let angleDouble = params?[2] as? Double {\n\t\t\tangle = CGFloat(angleDouble)\n\t\t}\n\t\t\n\t\telement.pinch(withScale: scale, velocity: velocity, angle: angle)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass PinchAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet scale = params![0] as! Double\n\t\tprecondition(scale.isNaN == false && scale > 0.0, \"Scale must be a real number above 0.0\")\n\t\tvar velocity = CGFloat(2.0)\n\t\tif let speedString = params?[1] as? String {\n\t\t\tswitch speedString {\n\t\t\tcase \"slow\":\n\t\t\t\tvelocity = 1.0\n\t\t\t\tbreak;\n\t\t\tcase \"fast\":\n\t\t\t\tvelocity = 2.0\n\t\t\tdefault:\n\t\t\t\tfatalError(\"Unknown pinch speed\")\n\t\t\t}\n\t\t}\n\t\tvar angle = CGFloat(0.0)\n\t\tif let angleDouble = params?[2] as? Double {\n\t\t\tangle = CGFloat(angleDouble)\n\t\t}\n\t\t\n\t\telement.pinch(withScale: CGFloat(scale), velocity: velocity, angle: angle)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass AdjustSliderAction : Action {\n\toverride func perform(on element: Element) -> [String : Any]? {\n\t\tlet normalizedPosition = params![0] as! Double\n\t\t\n\t\tprecondition(normalizedPosition >= 0.0 && normalizedPosition <= 1.0, \"Normalized position must be with values between 0.0 and 1.0\")\n\t\t\n\t\telement.adjust(toNormalizedSliderPosition: normalizedPosition)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass SetPickerAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet some = params![0] as Any\n\t\tlet column = some as! Int\n\t\tlet value = params![1] as! String\n\t\t\n\t\telement.setComponent(column, toValue: value)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass SetDatePickerAction : Action {\n\toverride func perform(on element: Element) -> [String: Any]? {\n\t\tlet dateString = params![0] as! String\n\t\tlet formatString = params![1] as! String\n\t\t\n\t\tlet date: Date?\n\t\tif formatString == \"ISO8601\" {\n\t\t\tlet dateFormatter = ISO8601DateFormatter()\n\t\t\tdate = dateFormatter.date(from: dateString)\n\t\t}\n\t\telse {\n\t\t\tlet dateFormatter = DateFormatter()\n\t\t\tdateFormatter.dateFormat = formatString\n\t\t\tdate = dateFormatter.date(from: dateString)\n\t\t}\n\t\t\n\t\tdtx_assert(date != nil, \"Incorrect date format “\\(formatString)” provided for date string “\\(dateString)”\")\n\t\t\n\t\telement.adjust(toDate: date!)\n\t\t\n\t\treturn nil\n\t}\n}\n\nclass GetAttributesAction : Action {\n\toverride func perform(completionHandler: @escaping ([String : Any]?, Error?) -> Void) {\n\t\tasync_action_dtx_try(completionHandler: completionHandler) {\n\t\t\tcompletionHandler(element.attributes, nil)\n\t\t}\n\t}\n}\n\nclass TakeScreenshotAction : Action {\n\toverride func perform(completionHandler: @escaping ([String : Any]?, Error?) -> Void) {\n\t\tlet fileName = params?[0] as? String ?? nil\n\t\tasync_action_dtx_try(completionHandler: completionHandler) {\n\t\t\tcompletionHandler(element.takeScreenshot(fileName: fileName), nil)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/Element.swift",
    "content": "//\n//  Element.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/27/20.\n//\n\nimport Foundation\nimport UIKit\nimport WebKit\n\nclass Element : NSObject {\n\tlet predicate : Predicate\n\tlet index : Int?\n\t\n\tstruct Keys {\n\t\tstatic let predicate = \"predicate\"\n\t\tstatic let index = \"atIndex\"\n\t}\n\t\n\trequired init(predicate: Predicate, index: Int?) {\n\t\tself.predicate = predicate\n\t\tself.index = index\n\t}\n\t\n\tclass func with(dictionaryRepresentation: [String: Any]) throws -> Element {\n\t\tlet predicateDictionaryRepresentation = dictionaryRepresentation[Keys.predicate] as! [String: Any]\n\t\tlet index = dictionaryRepresentation[Keys.index] as! Int?\n\t\t\n\t\treturn Element(predicate: try Predicate.with(dictionaryRepresentation: predicateDictionaryRepresentation), index: index)\n\t}\n\t\n\tvar exists : Bool {\n\t\tdo {\n\t\t\tvar moreThanZero : Bool = false\n\t\t\ttry dtx_try {\n\t\t\t\tmoreThanZero = self.views.count > 0\n\t\t\t}\n\t\t\treturn moreThanZero\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\t\n\tprivate var views : [NSObject] {\n\t\t//TODO: Consider searching here in all windows from all scenes.\n\t\tlet array = (UIView.dtx_findViewsInKeySceneWindows(passing: predicate.predicateForQuery()) as! [NSObject])\n\t\t\n\t\tguard array.count > 0 else {\n\t\t\tdtx_fatalError(\"No elements found for “\\(self.description)”\", viewDescription: failDebugAttributes)\n\t\t}\n\n\t\treturn array\n\t}\n\t\n\tvar view : NSObject {\n\t\tlet array = self.views\n\t\t\n\t\tlet element : NSObject\n\t\tif let index = index {\n\t\t\tguard index < array.count else {\n\t\t\t\tdtx_fatalError(\"Index \\(index) beyond bounds \\(array.count > 0 ? \"[0 .. \\(array.count - 1)] \" : \" \")for “\\(self.description)”\", viewDescription: failDebugAttributes)\n\t\t\t}\n\t\t\telement = array[index]\n\t\t} else {\n\t\t\t//Will fail test if more than one element are resolved from the query\n\t\t\tguard array.count == 1 else {\n\t\t\t\tdtx_fatalError(\"Multiple elements found for “\\(self.description)”\", viewDescription: failDebugAttributes)\n\t\t\t}\n\t\t\telement = array.first!\n\t\t}\n\t\t\n\t\treturn element\n\t}\n\t\n    private func extractScrollView() -> UIScrollView {\n        if let view = self.view as? UIScrollView {\n            return view\n        }\n\n        if let webView = self.view as? WKWebView {\n            return webView.scrollView\n        }\n\n        if ReactNativeSupport.isReactNativeApp {\n            let className = NSStringFromClass(type(of: view))\n            switch className {\n                case \"RCTScrollView\", \"RCTScrollViewComponentView\", \"RCTEnhancedScrollView\":\n                    return (view.value(forKey: \"scrollView\") as! UIScrollView)\n                default:\n                    break\n            }\n        }\n\n        dtx_fatalError(\"View “\\(self.view.dtx_shortDescription)” is not an instance of “UIScrollView”\", viewDescription: debugAttributes)\n    }\n\n\toverride var description: String {\n\t\treturn String(format: \"MATCHER(%@)%@\", predicate.description, index != nil ? \" AT INDEX(\\(index!))\" : \"\")\n\t}\n\t\n\tfileprivate var failDebugAttributes: [String: Any] {\n\t\treturn NSObject.dtx_genericElementDebugAttributes\n\t}\n\t\n\tvar debugAttributes: [String: Any] {\n\t\tdo {\n\t\t\tvar rv: [String: Any]! = nil\n\t\t\ttry dtx_try {\n\t\t\t\trv = view.dtx_elementDebugAttributes\n\t\t\t}\n\t\t\treturn rv\n\t\t} catch {\n\t\t\treturn failDebugAttributes\n\t\t}\n\t}\n\t\n\tfunc tap(at point: CGPoint? = nil, numberOfTaps: Int = 1) {\n\t\tguard let point = point else {\n\t\t\tview.dtx_tapAtAccessibilityActivationPoint(withNumberOfTaps: UInt(numberOfTaps))\n\t\t\treturn\n\t\t}\n\t\t\n\t\tview.dtx_tap(at: point, numberOfTaps: UInt(numberOfTaps))\n\t}\n\t\n\tfunc longPress(at point: CGPoint? = nil, duration: TimeInterval = 1.0) {\n\t\tguard let point = point else {\n\t\t\tview.dtx_longPressAtAccessibilityActivationPoint(forDuration: duration)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tview.dtx_longPress(at: point, duration: duration)\n\t}\n\t\n\tfunc longPress(at normalizedPoint: CGPoint, duration: TimeInterval, dragToElement targetElement: Element, normalizedTargetPoint: CGPoint, velocity: CGFloat, holdForDuration lastHoldDuration: TimeInterval) {\n\t\tview.dtx_longPress(at:normalizedPoint, duration:duration, target:targetElement.view, normalizedTargetPoint:normalizedTargetPoint, velocity:velocity, lastHoldDuration:lastHoldDuration)\n\t}\n\t\n\tfunc swipe(normalizedOffset: CGPoint, velocity: CGFloat = 1.0, normalizedStartingPoint: CGPoint? = nil) {\n\t\tif let normalizedStartingPoint = normalizedStartingPoint {\n\t\t\tview.dtx_swipe(withNormalizedOffset: normalizedOffset, velocity: velocity, normalizedStartingPoint: normalizedStartingPoint)\n\t\t} else {\n\t\t\tview.dtx_swipe(withNormalizedOffset: normalizedOffset, velocity: velocity)\n\t\t}\n\t}\n\t\n\tfunc pinch(withScale scale: CGFloat, velocity: CGFloat = 2.0, angle: CGFloat = 0.0) {\n\t\tview.dtx_pinch(withScale: scale, velocity: velocity, angle: angle)\n\t}\n\t\n\tfunc scroll(to edge: UIRectEdge, normalizedStartingPoint: CGPoint? = nil) {\n\t\tlet scrollView = extractScrollView()\n\t\tif let normalizedStartingPoint = normalizedStartingPoint {\n\t\t\tscrollView.dtx_scroll(to: edge, normalizedStarting: normalizedStartingPoint)\n\t\t} else {\n\t\t\tscrollView.dtx_scroll(to: edge)\n\t\t}\n\t}\n\n\tfunc scroll(withOffset offset: CGPoint, normalizedStartingPoint: CGPoint? = nil) {\n\t\tlet scrollView = extractScrollView()\n\t\t\n\t\tif let normalizedStartingPoint = normalizedStartingPoint {\n\t\t\tscrollView.dtx_scroll(withOffset: offset, normalizedStartingPoint: normalizedStartingPoint)\n\t\t} else {\n\t\t\tscrollView.dtx_scroll(withOffset: offset)\n\t\t}\n\t}\n\t\n\tfunc clearText() {\n\t\tview.dtx_clearText()\n\t}\n\n\tfunc typeText(_ text: String) {\n\t\tview.dtx_typeText(text)\n\t}\n\n\tfunc replaceText(_ text: String) {\n\t\tview.dtx_replaceText(text)\n\t}\n\n\tfunc performAccessibilityAction(_ actionName: String) {\n\t\tguard let action = view.accessibilityCustomActions?.first(where: { $0.name == actionName }) else {\n\t\t\tdtx_fatalError(\"Accessibility custom action with name “\\(actionName)” not found for view “\\(view.dtx_shortDescription)”\", viewDescription: debugAttributes)\n\t\t}\n\n\t\taction.target?.performSelector(onMainThread: action.selector, with: action, waitUntilDone: true)\n\t}\n\t\n\tfunc adjust(toDate date: Date) {\n        var didSetPicker = false\n\n        view.dtx_ifDatePicker { view in\n            view.dtx_adjust(to: date)\n            didSetPicker = true\n        }\n\n        guard didSetPicker else {\n            dtx_fatalError(\"View “\\(view.dtx_shortDescription)” is not an instance of “UIDatePicker”\", viewDescription: debugAttributes)\n        }\n\n\t}\n\t\n\tfunc setComponent(_ component: Int, toValue value: Any) {\n        var didSetPicker = false\n\n        view.dtx_ifPicker { view in\n            view.dtx_setComponent(component, toValue: value)\n            didSetPicker = true\n        }\n\n        guard didSetPicker else {\n            dtx_fatalError(\"View “\\(view.dtx_shortDescription)” is not an instance of “UIPickerView”\", viewDescription: debugAttributes)\n        }\n\t}\n\t\n\tfunc adjust(toNormalizedSliderPosition normalizedSliderPosition: Double) {\n        guard let slider = view.dtx_sliderView else {\n\t\t\tdtx_fatalError(\"View \\(view.dtx_shortDescription) is not instance of “UISlider”\", viewDescription: debugAttributes)\n\t\t}\n\t\t\n\t\tslider.dtx_normalizedSliderPosition = normalizedSliderPosition\n\t}\n\t\n\tfunc isVisible(with percent: UInt?)\n\tthrows -> Bool {\n\t\tvar error: NSError? = nil\n\t\tlet isVisible = view.dtx_isVisible(\n\t\t\tat: view.dtx_bounds,\n\t\t\tpercent: percent != nil ? NSNumber(value: percent!) : nil,\n\t\t\terror: &error\n\t\t)\n\n\t\tif let error = error {\n\t\t\tthrow error\n\t\t}\n\t\t\n\t\treturn isVisible\n\t}\n\t\n\tfunc isFocused() -> Bool {\n\t\treturn view.dtx_isFocused()\n\t}\n\t\n\tfunc isHittable() throws -> Bool {\n\t\treturn view.dtx_isHittable\n\t}\n\t\n\tfunc takeScreenshot(fileName: String?) -> [String : Any] {\n\t\tlet path: URL = view.dtx_takeScreenshot(fileName)\n\t\t\n\t\treturn [\"screenshotPath\": path.path]\n\t}\n\t\n\t@objc\n\tvar text: String? {\n\t\treturn view.value(forKey: \"dtx_text\") as? String\n\t}\n\t\n\t@objc\n\tvar placeholder: String? {\n\t\treturn view.value(forKey: \"dtx_placeholder\") as? String\n\t}\n\t\n\t@objc\n\tvar identifier: String? {\n\t\treturn view.accessibilityIdentifier\n\t}\n\t\n\t@objc\n\tvar label: String? {\n\t\treturn view.accessibilityLabel\n\t}\n\t\n\t@objc\n\tvar value: String? {\n\t\treturn view.accessibilityValue\n\t}\n\t\n    @objc\n    var normalizedSliderPosition: Double {\n        get {\n            if let slider = view.dtx_sliderView {\n                return slider.dtx_normalizedSliderPosition\n            }\n\n            dtx_fatalError(\n                \"View \\(view.dtx_shortDescription) is not instance or wrapper of “UISlider”\",\n                viewDescription: debugAttributes\n            )\n        }\n    }\n\n    @objc\n    var toggleValue: Double {\n        get {\n            if let toggle = view.dtx_switchView {\n                return toggle.isOn ? 1.0 : 0.0\n            }\n\n            dtx_fatalError(\n                \"View \\(view.dtx_shortDescription) is not instance or wrapper of “UISwitch”\",\n                viewDescription: debugAttributes\n            )\n        }\n    }\n\n\t@objc\n\tvar attributes: [String : Any] {\n\t\tlet views = self.views\n\t\t\n\t\tif views.count == 1 {\n\t\t\treturn views.first!.dtx_attributes\n\t\t} else {\n\t\t\tlet elements = views.map {\n\t\t\t\treturn $0.dtx_attributes\n\t\t\t}\n\t\t\t\n\t\t\treturn [\"elements\": elements]\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/Expectation.swift",
    "content": "//\n//  Assertion.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/27/20.\n//\n\nimport Foundation\nimport UIKit\n\n@inline(__always)\n@discardableResult\nfileprivate func async_expectation_dtx_try(completionHandler: @escaping (Error?) -> Void, blockToTry: () -> Void) -> Bool {\n\tdo {\n\t\ttry dtx_try(blockToTry)\n\t} catch {\n\t\tcompletionHandler(error)\n\t\treturn false\n\t}\n\t\n\treturn true\n}\n\n@inline(__always)\nfileprivate func applyModifiers(_ input: Bool, modifiers: Set<String>) -> Bool {\n\tvar rv = input\n\t\n\tmodifiers.forEach {\n\t\tswitch $0 {\n\t\tcase Modifier.not:\n\t\t\trv = !rv\n\t\tdefault:\n\t\t\tfatalError(\"Unimplemented modifier “\\($0)”\")\n\t\t\tbreak\n\t\t}\n\t}\n\t\n\treturn rv\n}\n\nclass Expectation : CustomStringConvertible {\n\tstruct Keys {\n\t\tstatic let kind = \"expectation\"\n\t\tstatic let params = \"params\"\n\t\tstatic let predicate = \"predicate\"\n\t\tstatic let modifiers = \"modifiers\"\n\t\tstatic let timeout = \"timeout\"\n\t}\n\t\n\tstruct Kind {\n\t\tstatic let toBeVisible = \"toBeVisible\"\n\t\tstatic let toBeFocused = \"toBeFocused\"\n\t\tstatic let toExist = \"toExist\"\n\t\tstatic let toHaveText = \"toHaveText\"\n\t\tstatic let toHaveLabel = \"toHaveLabel\"\n\t\tstatic let toHaveId = \"toHaveId\"\n\t\tstatic let toHaveValue = \"toHaveValue\"\n\t\tstatic let toHavePlaceholder = \"toHavePlaceholder\"\n\t\tstatic let toHaveSliderPosition = \"toHaveSliderPosition\"\n        static let toHaveToggleValue = \"toHaveToggleValue\"\n\t}\n\t\n\tlet element : Element\n\tlet kind : String\n\tlet modifiers : Set<String>\n\tlet timeout : TimeInterval\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval) {\n\t\tself.element = element\n\t\tself.kind = kind\n\t\tself.modifiers = modifiers\n\t\tself.timeout = timeout\n\t}\n\t\n\tstatic let mapping : [String: Expectation.Type] = [\n\t\tKind.toBeVisible: ToBeVisibleExpectation.self,\n\t\tKind.toBeFocused: ToBeFocusedExpectation.self,\n\t\tKind.toExist: ToExistExpectation.self,\n\t\t\n\t\tKind.toHaveText: ValueExpectation.self,\n\t\tKind.toHaveLabel: ValueExpectation.self,\n\t\tKind.toHaveId: ValueExpectation.self,\n\t\tKind.toHaveValue: ValueExpectation.self,\n\t\tKind.toHavePlaceholder: ValueExpectation.self,\n\t\tKind.toHaveSliderPosition: SliderPositionExpectation.self,\n        Kind.toHaveToggleValue: ToggleValueExpectation.self\n\t]\n\t\n\tstatic let keyMapping : [String: String] = [\n\t\tKind.toHaveText: \"text\",\n\t\tKind.toHaveLabel: \"label\",\n\t\tKind.toHaveId: \"identifier\",\n\t\tKind.toHaveValue: \"value\",\n\t\tKind.toHavePlaceholder: \"placeholder\",\n\t]\n\t\n\tclass func with(dictionaryRepresentation: [String: Any]) throws -> Expectation {\n\t\tlet kind = dictionaryRepresentation[Keys.kind] as! String //crash on failure\n\t\tlet params = dictionaryRepresentation[Keys.params] as! [CustomStringConvertible]?\n\t\tlet modifiers : Set<String>\n\t\tif let modifiersInput = dictionaryRepresentation[Keys.modifiers] as? [String] {\n\t\t\tmodifiers = Set<String>(modifiersInput)\n\t\t} else {\n\t\t\tmodifiers = []\n\t\t}\n\t\t//Convert ms to seconds\n\t\tlet timeout = ((dictionaryRepresentation[Keys.timeout] as! Double?) ?? 0.0).toSeconds()\n\t\t\n\t\tlet element = try Element.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\tlet expectationClass = mapping[kind]!\n        if expectationClass == ToggleValueExpectation.self {\n            return ToggleValueExpectation(kind: kind, modifiers: modifiers, element: element, timeout: timeout, value: params!.first! as! Double, tolerance: params!.count > 1 ? (params![1] as! Double) : nil)\n\n        } else if expectationClass == SliderPositionExpectation.self {\n\t\t\treturn SliderPositionExpectation(kind: kind, modifiers: modifiers, element: element, timeout: timeout, value: params!.first! as! Double, tolerance: params!.count > 1 ? (params![1] as! Double) : nil)\n\t\t} else if expectationClass == ValueExpectation.self {\n\t\t\treturn ValueExpectation(kind: kind, modifiers: modifiers, element: element, timeout: timeout, key: keyMapping[kind]!, value: params!.first!)\n\t\t} else if expectationClass == ToBeVisibleExpectation.self {\n\t\t\tlet percentDouble = params != nil && params!.count > 0 ? params!.first as? Double : nil\n\t\t\tlet percent = percentDouble != nil ? UInt(exactly: percentDouble!) : nil\n\n\t\t\treturn ToBeVisibleExpectation(\n\t\t\t\tkind: kind,\n\t\t\t\tmodifiers: modifiers,\n\t\t\t\telement: element,\n\t\t\t\ttimeout: timeout,\n\t\t\t\tpercent: percent\n\t\t\t)\n\t\t} else {\n\t\t\treturn expectationClass.init(kind: kind, modifiers: modifiers, element: element, timeout: timeout)\n\t\t}\n\t}\n\t\n\tfileprivate func evaluate(with element: Element) throws -> Bool {\n\t\tfatalError(\"Unimplemented perform(on:) called for \\(type(of: self))\")\n\t}\n\t\n\tfileprivate func _evaluate() {\n\t\tvar failureReason: String? = nil\n\t\tvar assertion: Bool = false\n\t\t\n\t\tdo {\n\t\t\tassertion = try evaluate(with: element)\n\t\t} catch {\n\t\t\tfailureReason = error.localizedDescription\n\t\t}\n\t\t\n\t\tdtx_assert(applyModifiers(assertion, modifiers: modifiers), \"Failed expectation: \\(self.description)\\(failureReason != nil ? \", \\(failureReason!)\" : \"\")\", viewDescription: element.debugAttributes)\n\t}\n\t\n\tfileprivate func evaluate_after(startDate: Date, completionHandler: @escaping (Error?) -> Void) {\n\t\tlet nowDate = Date()\n\t\tguard nowDate.timeIntervalSince(startDate) < timeout else {\n\t\t\tcompletionHandler(dtx_errorForFatalError(\"Timed out while waiting for expectation: \\(self.description)\", viewDescription: element.debugAttributes))\n\t\t\treturn\n\t\t}\n\t\t\n\t\tlet evaluationSuccess = dtx_try_nothrow {\n\t\t\t_evaluate()\n\t\t}\n\t\t\n\t\tguard evaluationSuccess == false else {\n\t\t\tcompletionHandler(nil)\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tDispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {\n\t\t\tself.evaluate_after(startDate: startDate, completionHandler: completionHandler)\n\t\t}\n\t}\n\t\n\tfunc evaluate(completionHandler: @escaping (Error?) -> Void) {\n\t\tasync_expectation_dtx_try (completionHandler: completionHandler) {\n\t\t\tguard timeout != 0.0 else {\n\t\t\t\t_evaluate()\n\t\t\t\tcompletionHandler(nil)\n\t\t\t\t\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n\t\t\tevaluate_after(startDate: Date(), completionHandler: completionHandler)\n\t\t}\n\t}\n\t\n\tfileprivate var additionalDescription: String {\n\t\tget {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\t\n\tstatic var durationFormatter : DTXDurationFormatter = DTXDurationFormatter()\n\t\n\tvar description: String {\n\t\tget {\n\t\t\treturn String(format: \"%@%@%@ WITH %@%@\", modifiers.contains(Modifier.not) ? \"NOT \" : \"\", self.kind.uppercased(), additionalDescription, element.description, timeout > 0.0 ? \" TIMEOUT(\\(Expectation.durationFormatter.string(fromTimeInterval: timeout)))\" : \"\")\n\t\t}\n\t}\n}\n\nclass ToBeVisibleExpectation : Expectation {\n\tlet percent: UInt?\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval,\n\t\t\t\t  percent: UInt?) {\n\t\tself.percent = percent\n\n\t\tsuper.init(kind: kind, modifiers: modifiers, element: element, timeout: timeout)\n\t}\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\n\t/// - NOTE This override is to support the special case where non-existent elements are also non-visible.\n\toverride func _evaluate() {\n\t\tif self.modifiers.contains(Modifier.not) && element.exists == false {\n\t\t\t// Don't fail if view doesn't exist.\n\t\t\treturn\n\t\t}\n\t\t\n\t\tvar failureReason: String? = nil\n\t\tvar assertion: Bool = false\n\t\t\n\t\tdo {\n\t\t\tassertion = try evaluate(with: element)\n\t\t} catch {\n\t\t\tfailureReason = error.localizedDescription\n\t\t}\n\t\t\n\t\tdtx_assert(applyModifiers(assertion, modifiers: modifiers), \"Failed expectation: \\(self.description)\\(failureReason != nil ? \", \\(failureReason!)\" : \"\")\", viewDescription: element.debugAttributes)\n\t}\n\t\n\toverride func evaluate(with element: Element) throws -> Bool {\n\t\treturn try element.isVisible(with: percent)\n\t}\n}\n\nclass ToBeFocusedExpectation : Expectation {\n\toverride func _evaluate() {\n\t\tdtx_assert(applyModifiers(self.element.isFocused(), modifiers: modifiers), \"Failed expectation: \\(self.description)\", viewDescription: self.element.debugAttributes)\n\t}\n}\n\nclass ToExistExpectation : Expectation {\n\toverride func _evaluate() {\n\t\tdtx_assert(applyModifiers(self.element.exists, modifiers: modifiers), \"Failed expectation: \\(self.description)\", viewDescription: self.element.debugAttributes)\n\t}\n}\n\nclass ValueExpectation : Expectation {\n\tlet key : String\n\tlet value : CustomStringConvertible\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval, key: String, value: CustomStringConvertible) {\n\t\tself.key = key\n\t\tself.value = value\n\t\t\n\t\tsuper.init(kind: kind, modifiers: modifiers, element: element, timeout: timeout)\n\t}\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\t\n\toverride func evaluate(with element: Element) -> Bool {\n\t\treturn NSComparisonPredicate(leftExpression: NSExpression(forKeyPath: key), rightExpression: NSExpression(forConstantValue: value), modifier: .direct, type: .equalTo, options: []).evaluate(with: element)\n\t}\n\t\n\toverride var additionalDescription: String {\n\t\tget {\n\t\t\treturn \"(\\(key) == “\\(value)”)\"\n\t\t}\n\t}\n}\n\nclass DoubleExpectation : Expectation {\n\tlet value : Double\n\tlet tolerance : Double?\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval, value: Double, tolerance: Double?) {\n\t\t//Tolerances outside of [DBL_EPSILON, 1) yield well-defined but useless results, so clamp the tolerance.\n\t\tself.value = value\n\t\tself.tolerance = tolerance != nil ? Double.minimum(Double.maximum(tolerance!, Double.ulpOfOne), 1.0 - Double.ulpOfOne) : nil\n\t\t\n\t\tsuper.init(kind: kind, modifiers: modifiers, element: element, timeout: timeout)\n\t}\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\t\n\trequired init(kind: String, modifiers: Set<String>, element: Element, timeout: TimeInterval, key: String, value: CustomStringConvertible) {\n\t\tfatalError(\"Call the other initializer\")\n\t}\n\t\n\tfileprivate func valueToTest(from element: Element) -> Double {\n\t\tfatalError(\"Abstract method valueToTest(from:) called\")\n\t}\n\t\n\toverride func evaluate(with element: Element) -> Bool {\n\t\treturn NSPredicate { evaluatedElement, _ -> Bool in\n\t\t\tguard let evaluatedElement = evaluatedElement as? Element else { return false }\n\t\t\tlet valueToTest = self.valueToTest(from: evaluatedElement)\n\t\t\treturn valueToTest.isAlmostEqual(to: self.value, tolerance: self.tolerance ?? Double.ulpOfOne.squareRoot())\n\t\t}.evaluate(with: element)\n\t}\n}\n\nclass SliderPositionExpectation : DoubleExpectation {\n\toverride func valueToTest(from element: Element) -> Double {\n\t\treturn element.normalizedSliderPosition\n\t}\n\t\n\toverride var additionalDescription: String {\n\t\tget {\n\t\t\treturn \"(sliderPosition \\(tolerance != nil ? \"(~\\(tolerance!))\" : \"\")== “\\(value)”)\"\n\t\t}\n\t}\n}\n\nclass ToggleValueExpectation : DoubleExpectation {\n    override func valueToTest(from element: Element) -> Double {\n        return element.toggleValue\n    }\n\n    override var additionalDescription: String {\n        get {\n            return \"(toggleValue \\(tolerance != nil ? \"(~\\(tolerance!))\" : \"\")== \\(value == 1.0 ? \"ON\" : \"OFF\"))\"\n        }\n    }\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/InvocationManager.swift",
    "content": "//\n//  InvocationManager.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/20/20.\n//\n\nimport UIKit\nimport os.signpost\n\nfileprivate let log = DetoxLog(category: \"InvocationManager\")\n\nfinal class InvocationManager {\n\tinternal struct Keys {\n\t\tstatic let type = \"type\"\n\t}\n\t\n\tinternal struct Types {\n\t\tstatic let action = \"action\"\n\t\tstatic let expectation = \"expectation\"\n\n\t\tstatic let webAction = \"webAction\"\n\t\tstatic let webExpectation = \"webExpectation\"\n\t}\n\t\n\tclass func invoke(dictionaryRepresentation: [String: Any], completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\tlet signpostID = OSSignpostID(log: log.osLog)\n\t\tlet signpostCompletionHandler : ([String: Any]?, Error?) -> Void = { result, error in\n\t\t\tos_signpost(.end, log: log.osLog, name: \"Invocation\", signpostID: signpostID, error != nil ? \"error: %{public}s\" : \"\", \"\\(error?.localizedDescription ?? \"\")\")\n\t\t\tcompletionHandler(result, error)\n\t\t}\n\t\t\n\t\tdo {\n\t\t\tlet kind = dictionaryRepresentation[Keys.type] as! String\n\t\t\t\n\t\t\tswitch kind {\n\t\t\tcase Types.action:\n\t\t\t\tlet action = try Action.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\t\t\tos_signpost(.begin, log: log.osLog, name: \"Action Invocation\", \n\t\t\t\t\t\t\t\t\t\tsignpostID: signpostID, \"%{public}s\", action.description)\n\t\t\t\taction.perform(completionHandler: signpostCompletionHandler)\n\n\t\t\tcase Types.expectation:\n\t\t\t\tlet expectation = try Expectation.with(dictionaryRepresentation: dictionaryRepresentation)\n\t\t\t\tos_signpost(.begin, log: log.osLog, name: \"Expectation Invocation\", \n\t\t\t\t\t\t\t\t\t\tsignpostID: signpostID, \"%{public}s\", expectation.description)\n\t\t\t\texpectation.evaluate { error in\n\t\t\t\t\tsignpostCompletionHandler(nil, error)\n\t\t\t\t}\n\n\t\t\tcase Types.webAction:\n\t\t\t\tlet action = try WebAction.init(json: dictionaryRepresentation)\n\t\t\t\tos_signpost(.begin, log: log.osLog, name: \"Web action Invocation\",\n\t\t\t\t\t\t\t\t\t\tsignpostID: signpostID, \"%{public}s\", action.description)\n\t\t\t\taction.perform(completionHandler: signpostCompletionHandler)\n\n\t\t\tcase Types.webExpectation:\n\t\t\t\tlet expectation = try WebExpectation.init(json: dictionaryRepresentation)\n\t\t\t\tos_signpost(.begin, log: log.osLog, name: \"Web expectation Invocation\", \n\t\t\t\t\t\t\t\t\t\tsignpostID: signpostID, \"%{public}s\", expectation.description)\n\t\t\t\texpectation.evaluate { error in\n\t\t\t\t\tsignpostCompletionHandler(nil, error)\n\t\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tfatalError(\"Unknown invocation type “\\(kind)”\")\n\t\t\t}\n\t\t} catch {\n\t\t\tsignpostCompletionHandler(nil, error)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/Modifier.swift",
    "content": "//\n//  Modifier.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/27/20.\n//\n\nimport Foundation\n\ninternal struct Modifier {\n\tstatic let not = \"not\"\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/Predicate.swift",
    "content": "//\n//  Predicate.swift\n//  DetoxTestRunner\n//\n//  Created by Leo Natan (Wix) on 2/20/20.\n//\n\nimport Foundation\nimport UIKit\nimport Detox.Private\n\nclass Predicate : CustomStringConvertible, CustomDebugStringConvertible {\n  struct Keys {\n    static let kind = \"type\"\n    static let value = \"value\"\n    static let predicate = \"predicate\"\n    static let modifiers = \"modifiers\"\n    static let predicates = \"predicates\"\n    static let isRegex = \"isRegex\"\n  }\n\n  struct Kind {\n    static let id = \"id\"\n    static let label = \"label\"\n    static let value = \"value\"\n    static let text = \"text\"\n    static let type = \"type\"\n    static let traits = \"traits\"\n\n    static let ancestor = \"ancestor\"\n    static let descendant = \"descendant\"\n\n    static let and = \"and\"\n    static let or = \"or\"\n  }\n\n  let kind : String\n  let modifiers : Set<String>\n  var hidden = false\n\n  fileprivate init(kind: String, modifiers: Set<String>) {\n    self.kind = kind\n    self.modifiers = modifiers\n  }\n\n  class func with(dictionaryRepresentation: [String: Any]) throws -> Predicate {\n    let kind = dictionaryRepresentation[Keys.kind] as! String //crash on failure\n    let isRegex = (dictionaryRepresentation[Keys.isRegex] as? Bool) ?? false\n    let modifiers : Set<String>\n    if let modifiersInput = dictionaryRepresentation[Keys.modifiers] as? [String] {\n      modifiers = Set<String>(modifiersInput)\n    } else {\n      modifiers = []\n    }\n\n    switch kind {\n      case Kind.traits:\n        let value = dictionaryRepresentation[Keys.value] as! [String]\n        return try TraitPredicate(kind: kind, modifiers: modifiers, stringTraits: value)\n      case Kind.type:\n        let className = dictionaryRepresentation[Keys.value] as! String\n        return try KindOfPredicate(kind: kind, modifiers: modifiers, className: className)\n      case Kind.label:\n        let label = dictionaryRepresentation[Keys.value] as! String\n        if ReactNativeSupport.isReactNativeApp == false {\n          return ValuePredicate(kind: kind, modifiers: modifiers, value: label, requiresAccessibilityElement: true, isRegex: isRegex)\n        } else {\n            let possibleRNClasses: [AnyClass] = [\n                NSClassFromString(\"RCTParagraphComponentView\"),\n                NSClassFromString(\"RCTText\"),\n                NSClassFromString(\"RCTTextView\")\n            ].compactMap { $0 }\n\n            guard !possibleRNClasses.isEmpty else {\n                fatalError(\"No React Native text component classes found\")\n            }\n\n            let typePredicates = possibleRNClasses.map { rnClass in\n                try! KindOfPredicate(kind: Kind.type, modifiers: [], className: NSStringFromClass(rnClass))\n            }\n\n            let descendantPredicate = DescendantPredicate(predicate: AndCompoundPredicate(predicates: [\n                OrCompoundPredicate(predicates: typePredicates, modifiers: []),\n                ValuePredicate(kind: kind, modifiers: modifiers, value: label, requiresAccessibilityElement: true, isRegex: isRegex)\n            ], modifiers: []), modifiers: [Modifier.not])\n            descendantPredicate.hidden = true\n\n            return AndCompoundPredicate(predicates: [\n                ValuePredicate(kind: kind, modifiers: modifiers, value: label, requiresAccessibilityElement: true, isRegex: isRegex),\n                descendantPredicate\n            ], modifiers: [])\n        }\n\n      case Kind.text:\n        let text = dictionaryRepresentation[Keys.value] as! String\n        var orPredicates = [\n          try KindOfPredicate(kind: Kind.type, modifiers: [], className: NSStringFromClass(UITextView.self)),\n          try KindOfPredicate(kind: Kind.type, modifiers: [], className: NSStringFromClass(UITextField.self)),\n          try KindOfPredicate(kind: Kind.type, modifiers: [], className: NSStringFromClass(UILabel.self)),\n        ]\n\n        if ReactNativeSupport.isReactNativeApp == true {\n            let possibleRNClasses: [AnyClass] = [\n                NSClassFromString(\"RCTParagraphComponentView\"),\n                NSClassFromString(\"RCTText\"),\n                NSClassFromString(\"RCTTextView\")\n            ].compactMap { $0 }\n\n            guard !possibleRNClasses.isEmpty else {\n                fatalError(\"No React Native text component classes found\")\n            }\n\n            possibleRNClasses.forEach { rnClass in\n                let predicate = try! KindOfPredicate(kind: Kind.type, modifiers: [], className: NSStringFromClass(rnClass))\n\n                orPredicates.append(predicate)\n            }\n        }\n\n        let orCompoundPredicate = OrCompoundPredicate(predicates: orPredicates, modifiers: [])\n        orCompoundPredicate.hidden = true\n\n        return AndCompoundPredicate(predicates: [\n          ValuePredicate(kind: kind, modifiers: modifiers, value: text, requiresAccessibilityElement: false, isRegex: isRegex),\n          orCompoundPredicate\n        ], modifiers: [])\n      case Kind.id:\n        let value = dictionaryRepresentation[Keys.value] as! CustomStringConvertible\n        return ValuePredicate(kind: kind, modifiers: modifiers, value: value, requiresAccessibilityElement: false, isRegex: isRegex)\n      case Kind.value:\n        let value = dictionaryRepresentation[Keys.value] as! CustomStringConvertible\n        return ValuePredicate(kind: kind, modifiers: modifiers, value: value, requiresAccessibilityElement: true)\n      case Kind.ancestor:\n        let predicate = try Predicate.with(dictionaryRepresentation: dictionaryRepresentation[Keys.predicate] as! [String: Any])\n        return AncestorPredicate(predicate: predicate, modifiers: modifiers)\n      case Kind.descendant:\n        let predicate = try Predicate.with(dictionaryRepresentation: dictionaryRepresentation[Keys.predicate] as! [String: Any])\n        return DescendantPredicate(predicate: predicate, modifiers: modifiers)\n      case Kind.and:\n        let predicatesDictionaryRepresentation = dictionaryRepresentation[Keys.predicates] as! [[String: Any]]\n        let innerPredicates = try predicatesDictionaryRepresentation.compactMap { try Predicate.with(dictionaryRepresentation: $0) }\n\n        let compoundPredicate : Predicate\n        if innerPredicates.count == 1 {\n          compoundPredicate = innerPredicates.first!\n        } else {\n          compoundPredicate = AndCompoundPredicate(predicates: innerPredicates, modifiers: modifiers)\n        }\n        return compoundPredicate\n      case Kind.or:\n        let predicatesDictionaryRepresentation = dictionaryRepresentation[Keys.predicates] as! [[String: Any]]\n        let innerPredicates = predicatesDictionaryRepresentation.compactMap { try? Predicate.with(dictionaryRepresentation: $0) }\n        guard !innerPredicates.isEmpty else {\n          fatalError(\"No valid predicates found in OR compound predicate\")\n        }\n        return innerPredicates.count == 1\n          ? innerPredicates.first!\n          : OrCompoundPredicate(predicates: innerPredicates, modifiers: modifiers)\n      default:\n        fatalError(\"Unknown predicate type \\(kind)\")\n    }\n  }\n\n  fileprivate func innerPredicateForQuery() -> NSPredicate {\n    fatalError(\"Unimplemented innerPredicateForQuery() called for \\(type(of: self))\")\n  }\n\n  func predicateForQuery() -> NSPredicate {\n    var rv = innerPredicateForQuery()\n\n    // Filter out `RCTAccessibilityElement` instances -\n    // React Native injects these internal accessibility bridges into the view hierarchy to handle accessibility\n    // mappings between JS and native layers\n    rv = NSCompoundPredicate(\n        andPredicateWithSubpredicates:\n            [rv, NSPredicate(format: \"NOT (class.description = %@)\", \"RCTAccessibilityElement\")])\n\n    if modifiers.contains(Modifier.not) {\n      rv = NSCompoundPredicate(notPredicateWithSubpredicate: rv)\n    }\n\n    return rv\n  }\n\n  fileprivate var operatorDescription: String {\n    get {\n      return \"\"\n    }\n  }\n\n  fileprivate var innerDescription: String {\n    get {\n      fatalError(\"Unimplemented innerDescription.get() called for \\(type(of: self))\")\n    }\n  }\n\n  var description: String {\n    get {\n      let containsNot = modifiers.contains(Modifier.not)\n      let operatorDescription = self.operatorDescription\n      return \"\\(containsNot ? \"NOT \" : \"\")\\(operatorDescription)\\(containsNot || operatorDescription.count > 0 ? \"(\" : \"\")\\(innerDescription)\\(containsNot || operatorDescription.count > 0 ? \")\" : \"\")\"\n    }\n  }\n\n  var debugDescription: String {\n    return description\n  }\n}\n\nclass KindOfPredicate : Predicate {\n  let className : String\n  let cls : AnyClass\n\n  init(kind: String, modifiers: Set<String>, className: String) throws {\n    self.className = className\n    if let cls = NSClassFromString(className) {\n      self.cls = cls\n    } else {\n      throw dtx_errorForFatalError(\"Unknown class “\\(className)”\")\n    }\n\n    super.init(kind: kind, modifiers: modifiers)\n  }\n\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSPredicate.init(format: \"SELF isKindOfClass: %@\", argumentArray: [cls])\n  }\n\n  override var innerDescription: String {\n    get {\n      return \"class ⊇ “\\(className)”\"\n    }\n  }\n}\n\nclass ValuePredicate : Predicate {\n  let value : CustomStringConvertible\n  let requiresAccessibilityElement: Bool\n  let isRegex: Bool\n\n  init(kind: String, modifiers: Set<String>, value: CustomStringConvertible, requiresAccessibilityElement: Bool, isRegex: Bool = false) {\n    self.value = value\n    self.requiresAccessibilityElement = requiresAccessibilityElement\n    self.isRegex = isRegex\n\n    super.init(kind: kind, modifiers: modifiers)\n  }\n\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSPredicate { evaluatedObject, _ in\n      guard let evaluatedObject = evaluatedObject else {\n        return false\n      }\n\n      let evaluatedValue = self.getValue(evaluatedObject, fromKind: self.kind)\n\n      guard let value = self.value as? String, let evaluatedValue = evaluatedValue as? String else {\n        return false\n      }\n\n      if self.isRegex {\n        return evaluatedValue.matchesJSRegex(to: value)\n      }\n\n      return evaluatedValue == value\n    }\n  }\n\n  private func getValue(_ evaluatedObject: Any, fromKind kind: String) -> Any? {\n    guard let object = evaluatedObject as? NSObject else {\n      return nil\n    }\n\n    switch kind {\n      case Kind.id:\n        return object.accessibilityIdentifier\n\n      case Kind.label:\n        return object.accessibilityLabel\n\n      case Kind.text:\n        return object.dtx_text\n\n      case Kind.value:\n        return object.accessibilityValue\n\n      default:\n        return nil\n    }\n  }\n\n  override var innerDescription: String {\n    return \"\\(kind) == “\\(value)”\"\n  }\n}\n\nfileprivate func traitStringsToTrait(_ traitStrings: [String]) throws -> UIAccessibilityTraits {\n  var rv : UIAccessibilityTraits = []\n\n  for traitString in traitStrings {\n    switch traitString {\n      case \"none\":\n        break\n      case \"button\":\n        rv.insert(.button)\n        break\n      case \"link\":\n        rv.insert(.link)\n        break\n      case \"searchField\":\n        rv.insert(.searchField)\n        break\n      case \"image\":\n        rv.insert(.image)\n        break\n      case \"selected\":\n        rv.insert(.selected)\n        break\n      case \"playsSound\":\n        rv.insert(.playsSound)\n        break\n      case \"keyboardKey\":\n        rv.insert(.keyboardKey)\n        break\n      case \"staticText\":\n        rv.insert(.staticText)\n        break\n      case \"summaryElement\":\n        rv.insert(.summaryElement)\n        break\n      case \"notEnabled\":\n        rv.insert(.notEnabled)\n        break\n      case \"updatesFrequently\":\n        rv.insert(.updatesFrequently)\n        break\n      case \"startsMediaSession\":\n        rv.insert(.startsMediaSession)\n        break\n      case \"adjustable\":\n        rv.insert(.adjustable)\n        break\n      case \"allowsDirectInteraction\":\n        rv.insert(.allowsDirectInteraction)\n        break\n      case \"causesPageTurn\":\n        rv.insert(.causesPageTurn)\n        break\n      case \"tabBar\":\n        rv.insert(.tabBar)\n        break\n      default:\n        throw dtx_errorForFatalError(\"Unknown or unsupported accessibility trait “\\(traitString)”\")\n    }\n  }\n\n  return rv\n}\n\nclass TraitPredicate : Predicate {\n  let stringTraits : [String]\n  let traits : UIAccessibilityTraits\n\n  init(kind: String, modifiers: Set<String>, stringTraits: [String]) throws {\n    self.stringTraits = stringTraits\n    self.traits = try traitStringsToTrait(stringTraits)\n\n    super.init(kind: kind, modifiers: modifiers)\n  }\n\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSPredicate.init { viewOrElse, _ -> Bool in\n      let view = viewOrElse as! NSObject\n      return view.isAccessibilityElement == true && (view.accessibilityTraits.rawValue & self.traits.rawValue) == self.traits.rawValue\n    }\n  }\n\n  override var innerDescription: String {\n    get {\n      return \"traits ⊇ “[\\(stringTraits.joined(separator: \", \"))]”\"\n    }\n  }\n}\n\nclass CompoundPredicate : Predicate{\n  let predicates: [Predicate]\n\n  init(predicates: [Predicate], modifiers: Set<String>) {\n    self.predicates = predicates\n\n    super.init(kind: Kind.and, modifiers: modifiers)\n  }\n\n  fileprivate func innerDescription(separator: String) -> String {\n    return predicates.filter { $0.hidden == false }.map {\n      let isMultiple = (type(of: $0) as AnyClass).isSubclass(of: CompoundPredicate.self)\n      return isMultiple ? \"(\\($0))\" : $0.description\n    }.joined(separator: separator)\n  }\n}\n\nclass AndCompoundPredicate : CompoundPredicate {\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSCompoundPredicate(andPredicateWithSubpredicates: predicates.map { $0.predicateForQuery() } )\n  }\n\n  override var innerDescription: String {\n    get {\n      return innerDescription(separator: \" && \")\n    }\n  }\n}\n\nclass OrCompoundPredicate : CompoundPredicate {\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSCompoundPredicate(orPredicateWithSubpredicates: predicates.map { $0.predicateForQuery() } )\n  }\n\n  override var innerDescription: String {\n    get {\n      return innerDescription(separator: \" || \")\n    }\n  }\n}\n\nclass DescendantPredicate : Predicate {\n  let predicate : Predicate\n\n  init(predicate: Predicate, modifiers: Set<String>) {\n    self.predicate = predicate\n\n    super.init(kind: Kind.descendant, modifiers: modifiers)\n  }\n\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSPredicate { evaluatedObject, bindings -> Bool in\n      let view = evaluatedObject as! NSObject\n\n      return UIView.dtx_findViews(inHierarchy: view, includingRoot: false, passing: self.predicate.predicateForQuery()).count > 0\n    }\n  }\n\n  override var operatorDescription: String {\n    get {\n      return \"DESCENDANT\"\n    }\n  }\n\n  override var innerDescription: String {\n    get {\n      return predicate.description\n    }\n  }\n}\n\nclass AncestorPredicate : Predicate {\n  let predicate : Predicate\n\n  init(predicate: Predicate, modifiers: Set<String>) {\n    self.predicate = predicate\n\n    super.init(kind: Kind.ancestor, modifiers: modifiers)\n  }\n\n  override func innerPredicateForQuery() -> NSPredicate {\n    return NSPredicate { evaluatedObject, bindings -> Bool in\n      let predicate = self.predicate.predicateForQuery()\n\n      var parent : NSObject? = evaluatedObject as! NSObject?\n      while parent != nil {\n        if let viewParent = parent as? UIView {\n          parent = viewParent.superview\n        } else {\n          parent = parent!.accessibilityContainer as? NSObject\n        }\n        if parent != nil && predicate.evaluate(with: parent) == true {\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n\n  override var operatorDescription: String {\n    get {\n      return \"ANCESTOR\"\n    }\n  }\n\n  override var innerDescription: String {\n    get {\n      return predicate.description\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WKWebView+evaluateJSAfterLoading.swift",
    "content": "//\n//  WKWebView+evaluateJSAfterLoading.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport WebKit\n\nfileprivate let log = DetoxLog(category: \"WebView\")\n\n/// Extends WKWebView with the ability to evaluate JavaScript after the web view has\n///  finished loading.\nextension WKWebView {\n\tfunc evaluateJSAfterLoading(\n\t\t_ javaScriptString: String,\n\t\tcompletionHandler: ((Any?, Error?) -> Void)? = nil\n\t) {\n\t\tlet cleanJavaScriptString = replaceConsecutiveSpacesAndTabs(in: javaScriptString)\n\t\tlog.debug(\"Evaluating JavaScript after loading: `\\(cleanJavaScriptString)`\")\n\n\t\tvar observation: NSKeyValueObservation?\n\t\tobservation = self.observe(\n\t\t\t\\.isLoading, options: [.new, .old, .initial]\n\t\t) { (webView, change) in\n\t\t\tguard change.newValue == false else { return }\n\n\t\t\tobservation?.invalidate()\n\n\t\t\tlog.debug(\"Evaluating JavaScript on web-view: `\\(cleanJavaScriptString)`\")\n\t\t\twebView.evaluateJavaScript(cleanJavaScriptString, completionHandler: completionHandler)\n\t\t}\n\t}\n\n\tprivate func replaceConsecutiveSpacesAndTabs(in input: String) -> String {\n\t\tlet pattern = \"[ \\\\t\\\\r\\\\n]+\"\n\t\tlet regex = try! NSRegularExpression(pattern: pattern, options: [])\n\t\tlet range = NSRange(location: 0, length: input.utf16.count)\n\t\tlet modifiedString = regex.stringByReplacingMatches(in: input, options: [], range: range, withTemplate: \" \")\n\t\treturn modifiedString\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WKWebView+findView.swift",
    "content": "//\n//  WKWebView+findView.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport WebKit\n\n/// Extends WKWebView with the ability to find a web view element.\nextension WKWebView {\n\t/// Finds a web view element by the given `predicate` at the given `index`.\n\tclass func findView(\n\t\tby predicate: Predicate?,\n\t\tatIndex index: Int?\n\t) throws -> WKWebView {\n\t\tlet webView: WKWebView?\n\n\t\tif let predicate = predicate {\n\t\t\tguard let ancestor = Element(predicate: predicate, index: index).view as? UIView else {\n\t\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\t\"Failed to find web view with predicate: \\(predicate.description)\")\n\t\t\t}\n\n\t\t\twebView = try findWebViewDescendant(in: ancestor)\n\t\t} else {\n\t\t\twebView = try findWebViewDescendant()\n\t\t}\n\n\t\tguard let webView = webView else {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Failed to find web view with predicate: `\\(predicate?.description ?? \"\")` \" +\n\t\t\t\t\"at index: `\\(index ?? 0)`\")\n\t\t}\n\n\t\treturn webView\n\t}\n\n\tfileprivate class func findWebViewDescendant(\n\t\tin ancestor: UIView? = nil\n\t) throws -> WKWebView? {\n\t\tlet predicate = NSPredicate.init { (view, _) -> Bool in\n\t\t\treturn view is WKWebView\n\t\t}\n\n\t\tvar webViews: [WKWebView]\n\t\tif let ancestor = ancestor {\n\t\t\twebViews = UIView.dtx_findViews(inHierarchy: ancestor, passing: predicate).compactMap {\n\t\t\t\t$0 as? WKWebView\n\t\t\t}\n\t\t} else {\n\t\t\twebViews = UIView.dtx_findViewsInAllWindows(passing: predicate).compactMap {\n\t\t\t\t$0 as? WKWebView\n\t\t\t}\n\t\t}\n\n\t\tif webViews.count == 0 {\n\t\t\treturn nil\n\t\t} else if webViews.count > 1 {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Found more than one matching web view in the hierarchy. \" +\n\t\t\t\t\"Please specify a predicate to find the correct web view.\")\n\t\t} else {\n\t\t\treturn webViews.first\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WKWebViewConfiguration+Detox.h",
    "content": "//\n//  WKWebViewConfiguration+Detox.h (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n@import WebKit;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface WKWebViewConfiguration (Detox)\n\n- (BOOL)shouldDisableWebKitSecurity;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WKWebViewConfiguration+Detox.m",
    "content": "//\n//  WKWebViewConfiguration+Detox.m (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n#import \"WKWebViewConfiguration+Detox.h\"\n\n@import ObjectiveC;\n\n\n//void WKPreferencesSetWebSecurityEnabled(id, bool);\n\n\n// Private WebKit API declarations\ntypedef struct OpaqueWKPreferences* WKPreferencesRef;\nextern void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef, bool);\n\n\n@interface WKWebView (DetoxSecurity)\n- (instancetype)dtx_initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration;\n@end\n\n\n@interface DTXFakeWKPreferencesRef: NSObject\n@property (nonatomic) void* _apiObject;\n@end\n\n@implementation DTXFakeWKPreferencesRef\n@end\n\n\n/// Set web-security policy for WebKit (e.g. CORS restriction).\n///\n/// @note Since we can't access the `WKPreferencesSetWebSecurityEnabled` directly with\n///  a `WKPreferences*`, we wrap it in a `WKPreferencesRef` in the getWKPrefsRef function, which can be passed to this function.\n/// This private API is not officially supported on iOS, and generally used for debugging / testing\n///  purposes on MacOS only. So there's no guarantee that it will work in the future.\nvoid DTXPreferencesSetWebSecurityEnabled(WKPreferences* prefs, bool enabled) {\n    Ivar ivar = NULL;\n    \n    if (@available(iOS 18.0, *)) {\n        unsigned int ivarCount;\n        Ivar *ivarList = class_copyIvarList([WKPreferences class], &ivarCount);\n        if (ivarList) {\n            for (unsigned int i = 0; i < ivarCount; i++) {\n                const char *ivarName = ivar_getName(ivarList[i]);\n                if (ivarName && strcmp(ivarName, \"_preferences\") == 0) {\n                    ivar = ivarList[i];\n                    break;\n                }\n            }\n            free(ivarList);\n        }\n    } else {\n        ivar = class_getInstanceVariable([WKPreferences class], \"_preferences\");\n    }\n    \n    DTXFakeWKPreferencesRef* fakeRef = [DTXFakeWKPreferencesRef new];\n    void* realPreferences = (void*)(((uintptr_t)prefs) + ivar_getOffset(ivar));\n    fakeRef._apiObject = realPreferences;\n    WKPreferencesSetWebSecurityEnabled((__bridge WKPreferencesRef)fakeRef, enabled);\n}\n\n@implementation WKWebViewConfiguration (Detox)\n\n+ (void)load {\n    [self swizzleWKWebViewConfigurationSetPreferences];\n    \n    if (@available(iOS 18.0, *)) {\n        [self swizzleWKWebViewInitWithFrameConfiguration];\n    }\n}\n\n+ (void)swizzleWKWebViewConfigurationSetPreferences {\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\tClass class = [self class];\n\t\t\n\t\tSEL originalSelector = @selector(setPreferences:);\n\t\tSEL swizzledSelector = @selector(dtx_setPreferences:);\n\n\t\tMethod originalMethod = class_getInstanceMethod(class, originalSelector);\n\t\tMethod swizzledMethod = class_getInstanceMethod(class, swizzledSelector);\n\n\t\tBOOL didAddMethod = class_addMethod(class,\n\t\t\t\t\t\t\t\t\t\t\toriginalSelector,\n\t\t\t\t\t\t\t\t\t\t\tmethod_getImplementation(swizzledMethod),\n\t\t\t\t\t\t\t\t\t\t\tmethod_getTypeEncoding(swizzledMethod));\n\n\t\tif (didAddMethod) {\n\t\t\tclass_replaceMethod(class,\n\t\t\t\t\t\t\tswizzledSelector,\n\t\t\t\t\t\t\tmethod_getImplementation(originalMethod),\n\t\t\t\t\t\t\tmethod_getTypeEncoding(originalMethod));\n\t\t} else {\n\t\t\tmethod_exchangeImplementations(originalMethod, swizzledMethod);\n\t\t}\n\t});\n}\n\n+ (void)swizzleWKWebViewInitWithFrameConfiguration {\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\tClass wkWebViewClass = [WKWebView class];\n\t\t\n\t\tSEL originalSelector = @selector(initWithFrame:configuration:);\n\t\tSEL swizzledSelector = @selector(dtx_initWithFrame:configuration:);\n\n\t\tMethod originalMethod = class_getInstanceMethod(wkWebViewClass, originalSelector);\n\t\tMethod swizzledMethod = class_getInstanceMethod(wkWebViewClass, swizzledSelector);\n\n\t\tBOOL didAddMethod = class_addMethod(wkWebViewClass,\n\t\t\t\t\t\t\t\t\t\t\toriginalSelector,\n\t\t\t\t\t\t\t\t\t\t\tmethod_getImplementation(swizzledMethod),\n\t\t\t\t\t\t\t\t\t\t\tmethod_getTypeEncoding(swizzledMethod));\n\n\t\tif (didAddMethod) {\n\t\t\tclass_replaceMethod(wkWebViewClass,\n\t\t\t\t\t\t\tswizzledSelector,\n\t\t\t\t\t\t\tmethod_getImplementation(originalMethod),\n\t\t\t\t\t\t\tmethod_getTypeEncoding(originalMethod));\n\t\t} else {\n\t\t\tmethod_exchangeImplementations(originalMethod, swizzledMethod);\n\t\t}\n\t});\n}\n\n- (void)dtx_setPreferences:(WKPreferences *)preferences {\n    if ([self shouldDisableWebKitSecurity]) {\n        DTXPreferencesSetWebSecurityEnabled(preferences, NO);\n    }\n    [self dtx_setPreferences:preferences];\n}\n\n- (BOOL)shouldDisableWebKitSecurity {\n    return [NSUserDefaults.standardUserDefaults boolForKey:@\"detoxDisableWebKitSecurity\"];\n}\n\n@end\n\n\n@implementation WKWebView (DetoxSecurity)\n\n- (instancetype)dtx_initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration {\n    BOOL shouldDisable = [configuration shouldDisableWebKitSecurity];\n\tif (shouldDisable) {\n\t\tif (!configuration.preferences) {\n\t\t\tconfiguration.preferences = [[WKPreferences alloc] init];\n\t\t}\n\t\t\n\t\tDTXPreferencesSetWebSecurityEnabled(configuration.preferences, !shouldDisable);\n\t}\n\t\n\treturn [self dtx_initWithFrame:frame configuration:configuration];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebAction.swift",
    "content": "//\n//  WebAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport WebKit\n\n/// Represents a web action to be performed on a web view.\nclass WebAction: WebInteraction {\n\tvar webAction: WebActionType\n\tvar params: [Any]?\n\n\toverride init(json: [String: Any]) throws {\n\t\tself.webAction = WebActionType(rawValue: json[\"webAction\"] as! String)!\n\t\tself.params = json[\"params\"] as? [Any]\n\t\ttry super.init(json: json)\n\t}\n\n\toverride var description: String {\n\t\treturn \"WebAction: \\(webAction.rawValue)\"\n\t}\n\n\tfunc perform(completionHandler: @escaping ([String: Any]?, Error?) -> Void) {\n\t\tvar jsString: String\n\t\tvar webView: WKWebView\n\n\t\tdo {\n\t\t\tjsString = try WebCodeBuilder()\n\t\t\t\t.with(predicate: webPredicate, atIndex: webAtIndex)\n\t\t\t\t.with(action: webAction, params: params)\n\t\t\t\t.build()\n\n\t\t\twebView = try WKWebView.findView(by: predicate, atIndex: atIndex)\n\t\t} catch {\n\t\t\tcompletionHandler(nil, error)\n\t\t\treturn\n\t\t}\n\n\t\twebView.evaluateJSAfterLoading(jsString) { (result, error) in\n\t\t\tif let error = error {\n\t\t\t\tcompletionHandler(\n\t\t\t\t\t[\"result\": false, \"error\": error.localizedDescription],\n\t\t\t\t\tdtx_errorForFatalError(\n\t\t\t\t\t\t\"Failed to evaluate JavaScript on web view: \\(webView.debugDescription). \" +\n\t\t\t\t\t\t\"Error: \\(error.localizedDescription)\")\n\t\t\t\t)\n\t\t\t} else if let jsError = (result as? [String: Any])?[\"error\"] as? String {\n\t\t\t\tcompletionHandler(\n\t\t\t\t\t[\"result\": false, \"error\": jsError],\n\t\t\t\t\tdtx_errorForFatalError(\n\t\t\t\t\t\t\"Failed to evaluate JavaScript on web view: \\(webView.debugDescription). \" +\n\t\t\t\t\t\t\"JS exception: \\(jsError)\")\n\t\t\t\t)\n\t\t\t} else if let result = (result as? [String: Any])?[\"result\"] as? String {\n\t\t\t\tcompletionHandler([\"result\": result], nil)\n\t\t\t} else {\n\t\t\t\tcompletionHandler(nil, nil)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebActionType.swift",
    "content": "//\n//  WebActionType.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nenum WebActionType: String, Codable {\n\tcase tap = \"tap\"\n\tcase typeText = \"typeText\"\n\tcase replaceText = \"replaceText\"\n\tcase clearText = \"clearText\"\n\tcase selectAllText = \"selectAllText\"\n\tcase getText = \"getText\"\n\tcase scrollToView = \"scrollToView\"\n\tcase focus = \"focus\"\n\tcase moveCursorToEnd = \"moveCursorToEnd\"\n\tcase runScript = \"runScript\"\n\tcase runScriptWithArgs = \"runScriptWithArgs\"\n\tcase getCurrentUrl = \"getCurrentUrl\"\n\tcase getTitle = \"getTitle\"\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createAction.swift",
    "content": "//\n//  WebCodeBuilder+createAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web action JS code.\nextension WebCodeBuilder {\n\tfunc createAction(\n\t\tforAction action: WebActionType,\n\t\tparams: [Any]?,\n\t\tonSelector selector: String\n\t) throws -> String {\n\t\tswitch action {\n\t\t\tcase .tap:\n\t\t\t\treturn createTapAction(selector: selector)\n\n\t\t\tcase .clearText:\n\t\t\t\treturn createTypeAction(selector: selector, text: \"\", replace: true)\n\n\t\t\tcase .typeText:\n\t\t\t\tlet text = try extractValueParam(action, params)\n\t\t\t\treturn createTypeAction(selector: selector, text: text, replace: false)\n\n\t\t\tcase .replaceText:\n\t\t\t\tlet text = try extractValueParam(action, params)\n\t\t\t\treturn createTypeAction(selector: selector, text: text, replace: true)\n\n\t\t\tcase .focus:\n\t\t\t\treturn createFocusAction(selector: selector)\n\n\t\t\tcase .getCurrentUrl:\n\t\t\t\treturn createGetURLAction()\n\n\t\t\tcase .getText:\n\t\t\t\treturn createGetTextAction(selector: selector)\n\n\t\t\tcase .getTitle:\n\t\t\t\treturn createGetTitleAction()\n\n\t\t\tcase .moveCursorToEnd:\n\t\t\t\treturn createMoveCursorToEndAction(selector: selector)\n\n\t\t\tcase .runScript, .runScriptWithArgs:\n\t\t\t\treturn try createRunScriptAction(assertedParams(action, params, 1), selector: selector)\n\n\t\t\tcase .selectAllText:\n\t\t\t\treturn createSelectAllTextAction(selector: selector)\n\n\t\t\tcase .scrollToView:\n\t\t\t\treturn createScrollIntoViewAction(selector: selector)\n\t\t}\n\t}\n\n\tprivate func extractValueParam( _ action: WebActionType, _ params: [Any]?) throws -> String {\n\t\tlet params = try assertedParams(action, params, 1)\n\n\t\tguard let value = params.first as? String else {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Value param for action \\(action.rawValue.uppercased()) is not a string (got: \\(params))\"\n\t\t\t)\n\t\t}\n\n\t\treturn value\n\t}\n\n\tprivate func assertedParams(\n\t\t_ action: WebActionType, _ params: [Any]?, _ expectedMinCount: Int\n\t) throws -> [Any] {\n\t\tguard let params = params, params.count >= expectedMinCount else {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Expected at-least \\(expectedMinCount) params for action \" +\n\t\t\t\t\"\\(action.rawValue.uppercased()) (got: \\(params?.description ?? \"none\"))\"\n\t\t\t)\n\t\t}\n\n\t\treturn params\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createExpectation.swift",
    "content": "//\n//  WebCodeBuilder+createExpectation.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web expectation JS code.\nextension WebCodeBuilder {\n\tfunc createExpectation(expectation: WebExpectationType, params: [String]?, modifiers: [WebModifier]?) -> String {\n\t\tlet expectationScript: String\n\n\t\tswitch expectation {\n\t\t\tcase .toExist:\n\t\t\t\texpectationScript = \"element != null\"\n\n\t\t\tcase .toHaveText:\n\t\t\t\tlet expectedText = params?.first ?? \"\"\n\n\t\t\t\tlet escapedExpectedText = expectedText\n\t\t\t\t\t.replacingOccurrences(of: \"`\", with: \"\\\\`\")\n\t\t\t\t\t.replacingOccurrences(of: \"'\", with: \"\\'\")\n\t\t\t\t\t.trimmingCharacters(in: .whitespacesAndNewlines)\n\n\t\t\t\texpectationScript = \"(element.textContent && element.textContent.trim() == `\\(escapedExpectedText)`) || \" +\n\t\t\t\t\t\"(element.innerText && element.innerText.trim() == `\\(escapedExpectedText)`) || \" +\n\t\t\t\t\t\"(element.value && element.value.trim() == `\\(escapedExpectedText)`) || \" +\n\t\t\t\t\t\"`\\(escapedExpectedText)` == ''\"\n\t\t}\n\n\t\treturn modifyExpectation(script: expectationScript, modifiers: modifiers)\n\t}\n\n\tprivate func modifyExpectation(\n\t\tscript expectationScript: String, modifiers: [WebModifier]?\n\t) -> String {\n\t\tguard let modifiers = modifiers else {\n\t\t\treturn expectationScript\n\t\t}\n\n\t\treturn modifiers.reduce(expectationScript) { (expectationScript, modifier) in\n\t\t\tswitch modifier {\n\t\t\t\tcase .not:\n\t\t\t\t\treturn \"!(\" + expectationScript + \")\"\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createFocusAction.swift",
    "content": "//\n//  WebCodeBuilder+createFocusAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web focus action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that focuses on the given element.\n\tfunc createFocusAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n\tif (!element) {\n\t\tthrow new Error('Element not found');\n\t}\n\n\tif (typeof element.focus !== 'function') {\n\t\tthrow new Error('Element is not focusable');\n\t}\n\n  \\(createScrollIntoViewAction(selector: selector))\n\n  element.focus();\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createGetTextAction.swift",
    "content": "//\n//  WebCodeBuilder+createGetTextAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web get text action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that gets the text of an given element.\n\tfunc createGetTextAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n\tif (!element) {\n\t  throw new Error('Element not found');\n  }\n\n  return element.textContent.length > 0 ? element.textContent : element.value;\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createGetTitleAction.swift",
    "content": "//\n//  WebCodeBuilder+createGetTitleAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web get title action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that gets the title of the current page.\n\tfunc createGetTitleAction() -> String {\n\t\treturn \"\"\"\n(() => {\n  return document.title;\n})();\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createGetURLAction.swift",
    "content": "//\n//  WebCodeBuilder+createGetURLAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web get URL action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that gets the URL of the current page.\n\tfunc createGetURLAction() -> String {\n\t\treturn \"\"\"\n(() => {\n  return window.location.href;\n})();\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createMoveCursorToEndAction.swift",
    "content": "//\n//  WebCodeBuilder+createMoveCursorToEndAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web move cursor to end action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that moves the cursor to the end of the given element.\n\tfunc createMoveCursorToEndAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n  if (!element) {\n    throw new Error('Element not found');\n  }\n\n\t\\(createFocusAction(selector: selector))\n\n\tconst getLength = (element) => {\n\t\tif (element.value) {\n\t\t\treturn element.value.length;\n\t\t} else if (element.innerText) {\n\t\t\treturn element.innerText.length;\n\t\t} else if (element.textContent) {\n\t\t\treturn element.textContent.length;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t};\n\n\tif (document.activeElement !== element) {\n\t\telement.focus();\n\t}\n\n\tif (typeof element.setSelectionRange === 'function') {\n\t\tif (element.nodeName.toLowerCase() === 'input' &&\n\t\t\t['text', 'search', 'tel', 'url', 'password'].includes(element.type.toLowerCase()) === false) {\n\t\t  /* Some input types do not support `setSelectionRange`. See:\n\t\t  * https://html.spec.whatwg.org/multipage/input.html#:~:text=%C2%B7-,setSelectionRange(),-%C2%B7\n\t\t  */\n\t\t  return;\n\t\t}\n\n\t\tconst length = getLength(element);\n\t\telement.setSelectionRange(length, length);\n\t} else {\n\t\tvar range = element.ownerDocument.createRange();\n\n\t\trange.selectNodeContents(element);\n\t\trange.collapse(false);\n\n\t\tvar selection = window.getSelection();\n\n\t\tselection.removeAllRanges();\n\t\tselection.addRange(range);\n\t}\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createRunScriptAction.swift",
    "content": "//\n//  WebCodeBuilder+createRunScriptAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web run script action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that runs a script on the given element.\n\tfunc createRunScriptAction(_ params: [Any], selector: String) throws -> String {\n\t\tguard let script = params.first else {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Missing script parameter for runScript action, got: \\(String(describing: params))\")\n\t\t}\n\n\t\tlet extraParamsOrNil = params.dropFirst().compactMap({ param -> String? in\n\t\t\tguard let data = try? JSONSerialization.data(withJSONObject: param, options: []),\n\t\t\t\t\t\tlet param = String(data: data, encoding: .utf8) else {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn param\n\t\t}).joined(separator: \",\")\n\n\t\tlet extraParams = extraParamsOrNil.isEmpty ? \"\" : \",...\\(extraParamsOrNil)\"\n\n\t\treturn \"(\\(script))(\\(selector)\\(extraParams));\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createScrollIntoViewAction.swift",
    "content": "//\n//  WebCodeBuilder+createScrollIntoViewAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web scroll into view action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that scrolls into view the given element.\n\tfunc createScrollIntoViewAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n\tif (!element) {\n\t throw new Error('Element not found');\n\t}\n\n\tif (typeof element.scrollIntoViewIfNeeded === 'function') {\n\t  element.scrollIntoViewIfNeeded(true);\n\t} else if (typeof element.scrollIntoView === 'function') {\n\t  element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });\n  }\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createSelectAllTextAction.swift",
    "content": "//\n//  WebCodeBuilder+createSelectAllTextAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web select all text action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that selects all text of an given element.\n\tfunc createSelectAllTextAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n  if (!element) {\n\t  throw new Error('Element not found');\n  }\n\n  \\(createFocusAction(selector: selector))\n\n  const isContentEditable = element.contentEditable === 'true';\n  const isInputField = (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA');\n\n  if (!isContentEditable && !isInputField) {\n\t  throw new Error('Element is not editable');\n\t}\n\n  if (element.readOnly) {\n\t  throw new Error('Element is read-only');\n\t}\n\n\tif (element.disabled) {\n\t  throw new Error('Element is disabled');\n  }\n\n  if (isContentEditable) {\n\t\tvar range = element.ownerDocument.createRange();\n\t\trange.selectNodeContents(element);\n\t\tvar selection = window.getSelection();\n\t\tselection.removeAllRanges();\n\t\tselection.addRange(range);\n  } else if (isInputField) {\n\t\telement.focus();\n\t\telement.select();\n  } else {\n    throw new Error('Element text is not selectable');\n  }\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createSelector.swift",
    "content": "//\n//  WebCodeBuilder+createSelector.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// This extension is responsible for creating the JavaScript selector for the given predicate type\n///  and value.\nextension WebCodeBuilder {\n\tfunc createSelector(forType type: WebPredicateType, value: String, index: Int?) -> String {\n\t\tlet index = index ?? 0\n\t\tlet sanitizedValue = value.replacingOccurrences(of: \"'\", with: \"\\\\'\")\n\n\t\t// Handling XPath separately, for other selectors, we use `getBaseSelector`.\n\t\tif type == .xpath {\n\t\t\treturn \"\"\"\n(function() {\n\t\tvar xpathResult = document.evaluate('\\(sanitizedValue)', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\t\tif (xpathResult.snapshotLength > \\(index)) {\n\t\t\t\treturn xpathResult.snapshotItem(\\(index));\n\t\t} else {\n\t\t\t\treturn null;\n\t\t}\n})()\n\"\"\"\n\t\t}\n\n\t\tlet baseSelector = self.getBaseSelector(forType: type, value: sanitizedValue)\n\t\treturn \"\"\"\n(function() {\n\tvar getAllElements = function(doc, selector) {\n\t\tvar elements = Array.from(doc.querySelectorAll(selector));\n\t\tvar frames = doc.querySelectorAll('iframe');\n\t\tfor (var i = 0; i < frames.length; i++) {\n\t\t\ttry {\n\t\t\t\tvar frameDoc = frames[i].contentDocument || frames[i].contentWindow.document;\n\t\t\t\tvar frameElements = getAllElements(frameDoc, selector);\n\t\t\t\telements = elements.concat(frameElements);\n\t\t\t} catch(e) {\n\t\t\t\t/* Probably issues accessing iframe documents (CORS restrictions) */\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t};\n\tvar allElements = getAllElements(document, '\\(baseSelector)');\n\treturn allElements.length > \\(index) ? allElements[\\(index)] : null;\n})()\n\"\"\"\n\t}\n\n\tprivate func getBaseSelector(forType type: WebPredicateType, value: String) -> String {\n\t\tswitch type {\n\t\t\tcase .id:\n\t\t\t\treturn \"#\\(value)\"\n\n\t\t\tcase .className:\n\t\t\t\treturn \".\\(value)\"\n\n\t\t\tcase .href:\n\t\t\t\treturn \"a[href=\\\"\\(value)\\\"]\"\n\n\t\t\tcase .hrefContains:\n\t\t\t\treturn \"a[href*=\\\"\\(value)\\\"]\"\n\n\t\t\tcase .cssSelector:\n\t\t\t\treturn value\n\n\t\t\tcase .name:\n\t\t\t\treturn \"[name=\\\"\\(value)\\\"]\"\n\n\t\t\tcase .tag, .value:\n\t\t\t\treturn value\n\n\t\t\tcase .label:\n\t\t\t\treturn \"[aria-label=\\\"\\(value)\\\"]\"\n\n\t\t\tcase .xpath:\n\t\t\t\t// Handled separately\n\t\t\t\tdtx_fatalError(\"XPath should be handled separately\")\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createTapAction.swift",
    "content": "//\n//  WebCodeBuilder+createTapAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web tap action JS code.\nextension WebCodeBuilder {\n\t/// Creates a JS code that taps on the given element.\n\tfunc createTapAction(selector: String) -> String {\n\t\treturn \"\"\"\n((element) => {\n\tif (!element) {\n\t\tthrow new Error('Element not found');\n\t}\n\n  \\(createScrollIntoViewAction(selector: selector))\n\n\tvar mouseDownEvent = new MouseEvent('mousedown', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t\tview: window\n\t});\n\n\tvar mouseUpEvent = new MouseEvent('mouseup', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t\tview: window\n\t});\n\n\tvar clickEvent = new MouseEvent('click', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t\tview: window\n\t});\n\n\telement.dispatchEvent(mouseDownEvent);\n\telement.dispatchEvent(mouseUpEvent);\n\telement.dispatchEvent(clickEvent);\n})(\\(selector));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder+createTypeAction.swift",
    "content": "//\n//  WebCodeBuilder+createTypeAction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Extends `WebCodeBuilder` with the ability to create a web type action JS code.\nextension WebCodeBuilder {\n\t/// The delay between typing each character.\n\tprivate var typeCharacterDelay: Int { 200 }\n\n\t/// Creates a web type action JS code.\n\tfunc createTypeAction(\n\t\tselector: String, text textToType: String, replace shouldReplaceCurrentText: Bool\n\t) -> String {\n\t\treturn \"\"\"\n((element, textToType, shouldReplaceCurrentText) => {\n\tif (!element) {\n\t\tthrow new Error('Element not found');\n\t}\n\n\tconst isContentEditable = element.contentEditable === 'true';\n\tconst isInputField = (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA');\n\n\tif (!isContentEditable && !isInputField) {\n\t\tthrow new Error('Element is not editable');\n\t}\n\n\tif (element.readOnly) {\n\t  throw new Error('Element is read-only');\n  }\n\n  if (element.disabled) {\n\t  throw new Error('Element is disabled');\n\t}\n\n\t\\(createMoveCursorToEndAction(selector: selector))\n\n\tif (shouldReplaceCurrentText) {\n\t\tconst range = element.ownerDocument.createRange();\n\t\tconst sel = window.getSelection();\n\n\t\tif (isContentEditable) {\n\t\t  range.selectNodeContents(element);\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\n\t\t\telement.ownerDocument.execCommand('delete', false, null);\n\t\t} else if (isInputField) {\n\t\t\telement.select();\n\n\t\t\telement.ownerDocument.execCommand('cut');\n\t\t}\n\t}\n\n\tif (textToType.length === 0) {\n\t\treturn;\n\t}\n\n\tlet currentIndex = 0;\n\tconst delay = \\(typeCharacterDelay);\n\tconst typeCharacters = () => {\n\t\tif (isInputField && (element.value.length >= element.getAttribute('maxlength'))) {\n\t\t  return;\n\t\t}\n\n\t\tif (currentIndex < textToType.length) {\n\t\t\tif (isContentEditable) {\n\t\t\t\telement.textContent += textToType.charAt(currentIndex);\n\t\t\t} else if (isInputField) {\n\t\t\t\telement.value += textToType.charAt(currentIndex);\n\t\t\t}\n\n\t\t\tconst inputEvent = new Event('input', { bubbles: true, cancelable: true });\n\t\t\telement.dispatchEvent(inputEvent);\n\n\t\t\t\\(createMoveCursorToEndAction(selector: selector))\n\n\t\t\tcurrentIndex++;\n\n\t\t\ttypeCharacters();\n\n\t\t\tconst startTime = new Date().getTime();\n\t\t\tconst finishTime = startTime + delay;\n\t\t\twhile (new Date().getTime() < finishTime) {\n\t\t\t\t/* Synchronically wait for type delay to pass */\n\t\t\t}\n\t\t}\n\t};\n\n\ttypeCharacters();\n})(\\(selector), '\\(textToType)', \\(shouldReplaceCurrentText ? \"true\" : \"false\"));\n\"\"\"\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebCodeBuilder.swift",
    "content": "//\n//  WebCodeBuilder.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n/// Responsible for building the JavaScript code that will be evaluated on a web view.\nclass WebCodeBuilder {\n\tprivate var predicate: WebPredicate?\n\tprivate var expectation: WebExpectationType?\n\tprivate var expectationParams: [String]?\n\tprivate var expectationModifiers: [WebModifier]?\n\tprivate var index: Int?\n\tprivate var action: WebActionType?\n\tprivate var actionParams: [Any]?\n\n\tfunc with(predicate: WebPredicate, atIndex: Int?) -> WebCodeBuilder {\n\t\tself.predicate = predicate\n\t\tself.index = atIndex\n\n\t\treturn self\n\t}\n\n\tfunc with(\n\t\texpectation: WebExpectationType,\n\t\tparams: [String]?,\n\t\tmodifiers: [WebModifier]?\n\t) -> WebCodeBuilder {\n\t\tself.expectation = expectation\n\t\tself.expectationParams = params\n\t\tself.expectationModifiers = modifiers\n\n\t\treturn self\n\t}\n\n\tfunc with(action: WebActionType, params: [Any]?) -> WebCodeBuilder {\n\t\tself.action = action\n\t\tself.actionParams = params\n\n\t\treturn self\n\t}\n\n\tfunc build() throws -> String {\n\t\tguard let predicate = predicate else {\n\t\t\treturn \"return false;\"\n\t\t}\n\n\t\tlet selector = createSelector(forType: predicate.type, value: predicate.value, index: index)\n\n\t\tif let expectation = expectation {\n\t\t\tlet expectationScript = createExpectation(expectation: expectation, params: expectationParams, modifiers: expectationModifiers);\n\n\t\t\treturn \"(() => {\" +\n\t\t\t\"try {\" +\n\t\t\t\"const truncateString = (string = '', maxLength = 124) =>\" +\n\t\t\t\"string.length > maxLength ? `${string.substring(0, maxLength)}…`: string;\" +\n\t\t\t\"let element = \\(selector);\" +\n\t\t\t\"let result = \\(expectationScript);\" +\n\t\t\t\"let elementInfo = element ? {\" +\n\t\t\t\"'html': truncateString(element.outerHTML),\" +\n\t\t\t\"'value': element.value, \" +\n\t\t\t\"'textContent': element.textContent,\" +\n\t\t\t\"'innerText': element.innerText\" +\n\t\t\t\"} : null;\" +\n\t\t\t\"return {'result': result, 'element': elementInfo};\" +\n\t\t\t\"} catch (error) {\" +\n\t\t\t\"return {'error': error.message};\" +\n\t\t\t\"}\" +\n\t\t\t\"})();\"\n\t\t} else if let action = action {\n\t\t\tlet actionScript = try createAction(\n\t\t\t\tforAction: action, params: actionParams, onSelector: selector)\n\n\t\t\treturn \"(() => {\" +\n\t\t\t\"try {\" +\n\t\t\t\"const result = \\(actionScript)\" +\n\t\t\t\"return {'result': result};\" +\n\t\t\t\"} catch (error) {\" +\n\t\t\t\"return {'error': error.message};\" +\n\t\t\t\"}\" +\n\t\t\t\"})();\"\n\t\t} else {\n\t\t\tdtx_fatalError(\"No expectation or action was set\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebExpectation.swift",
    "content": "//\n//  WebExpectation.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport WebKit\n\n/// The expectation type to evaluate on a web view.\nclass WebExpectation: WebInteraction {\n\tvar webModifiers: [WebModifier]?\n\tvar webExpectation: WebExpectationType\n\tvar params: [String]?\n\n\toverride init(json: [String: Any]) throws {\n\t\tself.webExpectation = WebExpectationType(rawValue: json[\"webExpectation\"] as! String)!\n\t\tself.params = json[\"params\"] as? [String]\n\t\tself.webModifiers = (json[\"webModifiers\"] as? [String])?.compactMap { WebModifier(rawValue: $0) }\n\t\ttry super.init(json: json)\n\t}\n\n\toverride var description: String {\n\t\treturn \"WebExpectation: \\(webExpectation.rawValue)\"\n\t}\n\n\tfunc evaluate(completionHandler: @escaping (Error?) -> Void) {\n\t\tvar jsString: String\n\t\tvar webView: WKWebView\n\n\t\tdo {\n\t\t\tjsString = try WebCodeBuilder()\n\t\t\t\t.with(predicate: webPredicate, atIndex: webAtIndex)\n\t\t\t\t.with(\n\t\t\t\t\texpectation: webExpectation, params: params, modifiers: webModifiers)\n\t\t\t\t.build()\n\n\t\t\twebView = try WKWebView.findView(by: predicate, atIndex: atIndex)\n\t\t} catch {\n\t\t\tcompletionHandler(error)\n\t\t\treturn\n\t\t}\n\n\t\twebView.evaluateJSAfterLoading(jsString) { [self] (result, error) in\n\t\t\tlet dict = result as? [String: Any]\n\n\t\t\tlet valueResult = dict?[\"result\"]\n\n\t\t\tlet elementResult = dict?[\"element\"]\n\t\t\tlet elementInfo: String =\n\t\t\t\telementResult != nil ?\n\t\t\t\t\t\"info: `\\(String(describing: elementResult!))`\" :\n\t\t\t\t\t\"not found\"\n\n\t\t\tlet jsError = dict?[\"error\"]\n\t\t\tlet jsErrorDescription = jsError != nil ?\n\t\t\t\t\t\", with JS error: \\(String(describing: jsError!))\" : \"\"\n\n\t\t\tif let error = error {\n\t\t\t\tcompletionHandler(dtx_errorForFatalError(\n\t\t\t\t\t\"Failed to evaluate JavaScript on web view: \\(webView.debugDescription). \" +\n\t\t\t\t\t\"Error: \\(error.localizedDescription)\"))\n\t\t\t} else if valueResult as? Bool != true {\n\t\t\t\tcompletionHandler(dtx_errorForFatalError(\n\t\t\t\t\t\"Failed on web expectation: \\(webModifiers?.description.uppercased() ?? \"\") \" +\n\t\t\t\t\t\"\\(webExpectation.rawValue.uppercased()) \" +\n\t\t\t\t\t\"with params \\(params?.description ?? \"\") \" +\n\t\t\t\t\t\"on element with \\(webPredicate.type.rawValue.uppercased()) == \" +\n\t\t\t\t\t\"'\\(webPredicate.value)', web-view: \\(webView.debugDescription). \" +\n\t\t\t\t\t\"Got evaluation result: \" +\n\t\t\t\t\t\"\\(valueResult as? Bool == false ? \"false\" : String(describing: valueResult)). \" +\n\t\t\t\t\t\"Element \\(elementInfo)\" +\n\t\t\t\t\tjsErrorDescription\n\t\t\t\t))\n\t\t\t} else {\n\t\t\t\tcompletionHandler(nil)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebExpectationModifier.swift",
    "content": "//\n//  WebExpectationModifier.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nenum WebModifier: String, Codable {\n\tcase not = \"not\"\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebExpectationType.swift",
    "content": "//\n//  WebExpectationType.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nenum WebExpectationType: String, Codable {\n\tcase toExist = \"toExist\"\n\tcase toHaveText = \"toHaveText\"\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebInteraction.swift",
    "content": "//\n//  WebInteraction.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport WebKit\n\n/// Represents a web interaction base class.\nclass WebInteraction: CustomStringConvertible {\n\tvar predicate: Predicate?\n\tvar atIndex: Int?\n\tvar webPredicate: WebPredicate\n\tvar webAtIndex: Int?\n\n\tinit(json: [String: Any]) throws {\n\t\tlet webPredicateJSON = json[\"webPredicate\"] as? [String: Any]\n\n\t\tguard\n\t\t\tlet webPredicateJSON = webPredicateJSON,\n\t\t\tlet webPredicateData =\n\t\t\t\ttry? JSONSerialization.data(withJSONObject: webPredicateJSON),\n\t\t\tlet decodedWebPredicate =\n\t\t\t\ttry? JSONDecoder().decode(WebPredicate.self, from: webPredicateData)\n\t\telse {\n\t\t\tthrow dtx_errorForFatalError(\n\t\t\t\t\"Failed to decode WebPredicate \\(String(describing: webPredicateJSON))\")\n\t\t}\n\n\t\tself.webPredicate = decodedWebPredicate\n\t\tif let predicateJSON = json[\"predicate\"] as? [String: Any] {\n\t\t\tself.predicate = try Predicate.with(dictionaryRepresentation: predicateJSON)\n\t\t}\n\n\t\tself.atIndex = json[\"atIndex\"] as? Int\n\t\tself.webAtIndex = json[\"webAtIndex\"] as? Int\n\t}\n\n\tvar description: String {\n\t\treturn \"WebInteraction\"\n\t}\n}\n\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebPredicate.swift",
    "content": "//\n//  WebPredicate.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nclass WebPredicate: Codable {\n\tlet type: WebPredicateType\n\tlet value: String\n}\n"
  },
  {
    "path": "detox/ios/Detox/Invocation/WebPredicateType.swift",
    "content": "//\n//  WebPredicateType.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nenum WebPredicateType: String, Codable {\n\tcase id = \"id\"\n\tcase className = \"class\"\n\tcase cssSelector = \"css\"\n\tcase name = \"name\"\n\tcase xpath = \"xpath\"\n\tcase href = \"href\"\n\tcase hrefContains = \"hrefContains\"\n\tcase tag = \"tag\"\n\tcase label = \"label\"\n\tcase value = \"value\"\n}\n"
  },
  {
    "path": "detox/ios/Detox/Matchers/UIView+DetoxMatchers.h",
    "content": "//\n//  UIView+DetoxMatchers.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/19/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIView (DetoxMatchers)\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInAllWindowsPassingPredicate:(NSPredicate*)predicate;\n+ (NSMutableArray<UIView*>*)dtx_findViewsInKeySceneWindowsPassingPredicate:(NSPredicate*)predicate;\n+ (NSMutableArray<UIView*>*)dtx_findViewsInWindows:(NSArray<UIWindow*>*)windows passingPredicate:(NSPredicate*)predicate;\n+ (NSMutableArray<UIView*>*)dtx_findViewsInHierarchy:(id)hierarchy passingPredicate:(NSPredicate*)predicate;\n+ (NSMutableArray<UIView*>*)dtx_findViewsInHierarchy:(id)hierarchy includingRoot:(BOOL)includingRoot passingPredicate:(NSPredicate*)predicate;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Matchers/UIView+DetoxMatchers.m",
    "content": "//\n//  UIView+DetoxMatchers.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/19/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIView+DetoxMatchers.h\"\n#import \"UIView+DetoxUtils.h\"\n#import \"DTXAppleInternals.h\"\n#import \"UIWindow+DetoxUtils.h\"\n\n@implementation UIView (DetoxMatchers)\n\nNSArray* DTXChildElements(id element)\n{\n\tNSCParameterAssert(element != nil);\n\t\n\tNSMutableOrderedSet<id> *immediateChildren = [[NSMutableOrderedSet alloc] init];\n\t\n\tif ([element isKindOfClass:[UIView class]])\n\t{\n\t\t// Grab all subviews so that we continue traversing the entire hierarchy.\n\t\t// Add the objects in reverse order to make sure that objects on top get matched first.\n\t\tNSArray<id> *subviews = [element subviews];\n\t\tif ([subviews count] > 0)\n\t\t{\n\t\t\tfor (UIView *subview in [subviews reverseObjectEnumerator])\n\t\t\t{\n\t\t\t\t[immediateChildren addObject:subview];\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// If we encounter an accessibility container, grab all the contained accessibility elements.\n\t// However, we need to skip a few types of containers:\n\t// 1) UITableViewCells as they do a lot of custom accessibility work underneath\n\t//    and the accessibility elements they return are 'mocks' that cause access errors.\n\t// 2) UITableViews as because they report all their cells, even the ones off-screen as\n\t//    accessibility elements. We should not consider off-screen cells as there could be\n\t//    hundreds, even thousands of them and we would be iterating over them unnecessarily.\n\t//    Worse yet, if the cell isn't visible, calling accessibilityElementAtIndex will create\n\t//    and initialize them each time.\n\tif ([element respondsToSelector:@selector(accessibilityElementCount)] &&\n\t\t[element isKindOfClass:UITableView.class] == NO &&\n\t\t[element isKindOfClass:NSClassFromString(@\"UIPickerTableView\")] == NO &&\n\t\t[element isKindOfClass:UITableViewCell.class] == NO)\n\t{\n\t\tNSInteger elementCount = [element accessibilityElementCount];\n\t\tif (elementCount != NSNotFound && elementCount > 0)\n\t\t{\n\t\t\t// Temp holder created by UIKit. What we really want is the underlying element.\n\t\t\tClass accessibilityMockClass = NSClassFromString(@\"UIAccessibilityElementMockView\");\n\t\t\tClass textFieldElementClass= NSClassFromString(@\"UIAccessibilityTextFieldElement\");\n\t\t\tfor (NSInteger i = elementCount - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tid item = [element accessibilityElementAtIndex:i];\n\t\t\t\tif([item isKindOfClass:accessibilityMockClass])\n\t\t\t\t{\n\t\t\t\t\t// Replace mock views with the views they encapsulate.\n\t\t\t\t\titem = [item view];\n\t\t\t\t}\n\t\t\t\telse if([item isKindOfClass:textFieldElementClass])\n\t\t\t\t{\n\t\t\t\t\titem = [item textField];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (item == nil)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If item is a UIView subclass, it could be both a subview of another view and an\n\t\t\t\t// accssibility element of a different accessibility container (which is not necessarily its\n\t\t\t\t// superview). This could introduce elements being duplicated in the view hierarchy.\n\t\t\t\tif ([item isKindOfClass:[UIView class]])\n\t\t\t\t{\n\t\t\t\t\t// Only add the item as the element's immediate children if it meets these conditions:\n\t\t\t\t\t// (1) Item's superview is the element. This ensures that other accessibility containers\n\t\t\t\t\t//     don't add it as their immeditate children.\n\t\t\t\t\t// (2) Item does not have a superview. If item does not have a superview, you can ensure\n\t\t\t\t\t//     it's being added only once as an accessibility element of a container.\n\t\t\t\t\tid superview = [item superview];\n\t\t\t\t\tif (superview == element || superview == nil)\n\t\t\t\t\t{\n\t\t\t\t\t\t[immediateChildren addObject:item];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// If the item not a UIView subclass, it's mostly safe to add it as immediate child\n\t\t\t\t\t// since no two accessibility containers should add the same accessible element.\n\t\t\t\t\t[immediateChildren addObject:item];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn [immediateChildren array];\n}\n\n+ (void)_dtx_appendViewsRecursivelyFromArray:(NSArray<UIView*>*)views passingPredicate:(NSPredicate*)predicate storage:(NSMutableArray<UIView*>*)storage\n{\n\tif(views.count == 0)\n\t{\n\t\treturn;\n\t}\n\t\n\t[views enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n\t\tif(predicate == nil || [predicate evaluateWithObject:obj] == YES)\n\t\t{\n\t\t\t[storage addObject:obj];\n\t\t}\n\t\t\n\t\t[self _dtx_appendViewsRecursivelyFromArray:DTXChildElements(obj) passingPredicate:predicate storage:storage];\n\t}];\n}\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInWindows:(NSArray<UIWindow*>*)windows passingPredicate:(NSPredicate*)predicate\n{\n\tNSMutableArray<UIView*>* rv = [NSMutableArray new];\n\t\n\t[self _dtx_appendViewsRecursivelyFromArray:windows passingPredicate:predicate storage:rv];\n\t[self _dtx_sortViewsByCoords:rv];\n\t\n\treturn rv;\n}\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInAllWindowsPassingPredicate:(NSPredicate*)predicate\n{\n\treturn [self dtx_findViewsInWindows:UIWindow.dtx_allWindows.reverseObjectEnumerator.allObjects passingPredicate:predicate];\n}\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInKeySceneWindowsPassingPredicate:(NSPredicate*)predicate\n{\n\treturn [self dtx_findViewsInWindows:UIWindow.dtx_allKeyWindowSceneWindows.reverseObjectEnumerator.allObjects passingPredicate:predicate];\n}\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInHierarchy:(UIView*)hierarchy passingPredicate:(NSPredicate*)predicate\n{\n\treturn [self dtx_findViewsInHierarchy:hierarchy includingRoot:YES passingPredicate:predicate];\n}\n\n+ (NSMutableArray<UIView*>*)dtx_findViewsInHierarchy:(UIView*)hierarchy includingRoot:(BOOL)includingRoot passingPredicate:(NSPredicate*)predicate\n{\n\tNSMutableArray<UIView*>* rv = [NSMutableArray new];\n\t\n\t[self _dtx_appendViewsRecursivelyFromArray:includingRoot ? @[hierarchy] : DTXChildElements(hierarchy) passingPredicate:predicate storage:rv];\n\t[self _dtx_sortViewsByCoords:rv];\n\t\n\treturn rv;\n}\n\n+ (void)_dtx_sortViewsByCoords:(NSMutableArray<UIView*>*)views\n{\n\t[views sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:nil ascending:YES comparator:^NSComparisonResult(UIView* _Nonnull obj1, UIView* _Nonnull obj2) {\n\t\tCGRect frame1 = obj1.dtx_accessibilityFrame;\n\t\tCGRect frame2 = obj2.dtx_accessibilityFrame;\n\t\t\n\t\treturn frame1.origin.y < frame2.origin.y ? NSOrderedAscending : frame1.origin.y > frame2.origin.y ? NSOrderedDescending : NSOrderedSame;\n\t}], [NSSortDescriptor sortDescriptorWithKey:nil ascending:YES comparator:^NSComparisonResult(UIView* _Nonnull obj1, UIView* _Nonnull obj2) {\n\t\tCGRect frame1 = obj1.dtx_accessibilityFrame;\n\t\tCGRect frame2 = obj2.dtx_accessibilityFrame;\n\t\t\n\t\treturn frame1.origin.x < frame2.origin.x ? NSOrderedAscending : frame1.origin.x > frame2.origin.x ? NSOrderedDescending : NSOrderedSame;\n\t}]]];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Policy/DetoxPolicy.h",
    "content": "//\n//  DetoxPolicy.h\n//  Detox\n//\n//  Created by Leo Natan on 9/15/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DetoxPolicy : NSObject\n\n@property (class, nonatomic, readonly) CGFloat visibilityPixelAlphaThreshold;\n@property (class, nonatomic, readonly) NSUInteger defaultPercentThresholdForVisibility;\n@property (class, nonatomic, readonly) NSUInteger consecutiveTouchPointsWithSameContentOffsetThreshold;\n\n+ (NSString*)percentDescriptionForPercent:(CGFloat)percent;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Policy/DetoxPolicy.m",
    "content": "//\n//  DetoxPolicy.m\n//  Detox\n//\n//  Created by Leo Natan on 9/15/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"DetoxPolicy.h\"\n\n@implementation DetoxPolicy\n\n+ (CGFloat)visibilityPixelAlphaThreshold {\n\treturn 0.5;\n}\n\n+ (NSUInteger)defaultPercentThresholdForVisibility {\n\treturn 75;\n}\n\n+ (NSUInteger)consecutiveTouchPointsWithSameContentOffsetThreshold {\n\treturn 12;\n}\n\n+ (NSString*)percentDescriptionForPercent:(CGFloat)percent {\n\treturn [NSString stringWithFormat:@\"%g%%\", percent];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ApproximateEquality.swift",
    "content": "//===--- ApproximateEquality.swift ----------------------------*- swift -*-===//\n//\n// This source file is part of the Swift Numerics open source project\n//\n// Copyright (c) 2019 - 2020 Apple Inc. and the Swift Numerics project authors\n// Licensed under Apache License v2.0 with Runtime Library Exception\n//\n// See https://swift.org/LICENSE.txt for license information\n//\n//===----------------------------------------------------------------------===//\n\nextension FloatingPoint {\n  /// Test approximate equality with relative tolerance.\n  ///\n  /// Do not use this function to check if a number is approximately\n  /// zero; no reasoned relative tolerance can do what you want for\n  /// that case. Use `isAlmostZero` instead for that case.\n  ///\n  /// The relation defined by this predicate is symmetric and reflexive\n  /// (except for NaN), but *is not* transitive. Because of this, it is\n  /// often unsuitable for use for key comparisons, but it can be used\n  /// successfully in many other contexts.\n  ///\n  /// The internet is full advice about what not to do when comparing\n  /// floating-point values:\n  ///\n  /// - \"Never compare floats for equality.\"\n  /// - \"Always use an epsilon.\"\n  /// - \"Floating-point values are always inexact.\"\n  ///\n  /// Much of this advice is false, and most of the rest is technically\n  /// correct but misleading. Almost none of it provides specific and\n  /// correct recommendations for what you *should* do if you need to\n  /// compare floating-point numbers.\n  ///\n  /// There is no uniformly correct notion of \"approximate equality\", and\n  /// there is no uniformly correct tolerance that can be applied without\n  /// careful analysis. This function considers two values to be almost\n  /// equal if the relative difference between them is smaller than the\n  /// specified `tolerance`.\n  ///\n  /// The default value of `tolerance` is `sqrt(.ulpOfOne)`; this value\n  /// comes from the common numerical analysis wisdom that if you don't\n  /// know anything about a computation, you should assume that roughly\n  /// half the bits may have been lost to rounding. This is generally a\n  /// pretty safe choice of tolerance--if two values that agree to half\n  /// their bits but are not meaningfully almost equal, the computation\n  /// is likely ill-conditioned and should be reformulated.\n  ///\n  /// For more complete guidance on an appropriate choice of tolerance,\n  /// consult with a friendly numerical analyst.\n  ///\n  /// - Parameters:\n  ///   - other: the value to compare with `self`\n  ///   - tolerance: the relative tolerance to use for the comparison.\n  ///     Should be in the range [.ulpOfOne, 1).\n  ///\n  /// - Returns: `true` if `self` is almost equal to `other`; otherwise\n  ///   `false`.\n  @inlinable\n  public func isAlmostEqual(\n    to other: Self,\n    tolerance: Self = Self.ulpOfOne.squareRoot()\n  ) -> Bool {\n    // Tolerances outside of [.ulpOfOne, 1) yield well-defined but useless\n    // results, so this is enforced by an assert rathern than a precondition.\n    assert(tolerance >= .ulpOfOne && tolerance < 1, \"tolerance should be in [.ulpOfOne, 1).\")\n    // The simple computation below does not necessarily give sensible\n    // results if one of self or other is infinite; we need to rescale\n    // the computation in that case.\n    guard self.isFinite && other.isFinite else {\n      return rescaledAlmostEqual(to: other, tolerance: tolerance)\n    }\n    // This should eventually be rewritten to use a scaling facility to be\n    // defined on FloatingPoint suitable for hypot and scaled sums, but the\n    // following is good enough to be useful for now.\n    let scale = max(abs(self), abs(other), .leastNormalMagnitude)\n    return abs(self - other) < scale*tolerance\n  }\n\n  /// Test if this value is nearly zero with a specified `absoluteTolerance`.\n  ///\n  /// This test uses an *absolute*, rather than *relative*, tolerance,\n  /// because no number should be equal to zero when a relative tolerance\n  /// is used.\n  ///\n  /// Some very rough guidelines for selecting a non-default tolerance for\n  /// your computation can be provided:\n  ///\n  /// - If this value is the result of floating-point additions or\n  ///   subtractions, use a tolerance of `.ulpOfOne * n * scale`, where\n  ///   `n` is the number of terms that were summed and `scale` is the\n  ///   magnitude of the largest term in the sum.\n  ///\n  /// - If this value is the result of floating-point multiplications,\n  ///   consider each term of the product: what is the smallest value that\n  ///   should be meaningfully distinguished from zero? Multiply those terms\n  ///   together to get a tolerance.\n  ///\n  /// - More generally, use half of the smallest value that should be\n  ///   meaningfully distinct from zero for the purposes of your computation.\n  ///\n  /// For more complete guidance on an appropriate choice of tolerance,\n  /// consult with a friendly numerical analyst.\n  ///\n  /// - Parameter absoluteTolerance: values with magnitude smaller than\n  ///   this value will be considered to be zero. Must be greater than\n  ///   zero.\n  ///\n  /// - Returns: `true` if `abs(self)` is less than `absoluteTolerance`.\n  ///            `false` otherwise.\n  @inlinable\n  public func isAlmostZero(\n    absoluteTolerance tolerance: Self = Self.ulpOfOne.squareRoot()\n  ) -> Bool {\n    assert(tolerance > 0)\n    return abs(self) < tolerance\n  }\n\n  /// Rescales self and other to give meaningful results when one of them\n  /// is infinite. We also handle NaN here so that the fast path doesn't\n  /// need to worry about it.\n  @usableFromInline\n  internal func rescaledAlmostEqual(to other: Self, tolerance: Self) -> Bool {\n    // NaN is considered to be not approximately equal to anything, not even\n    // itself.\n    if self.isNaN || other.isNaN { return false }\n    if self.isInfinite {\n      if other.isInfinite { return self == other }\n      // Self is infinite and other is finite. Replace self with the binade\n      // of the greatestFiniteMagnitude, and reduce the exponent of other by\n      // one to compensate.\n      let scaledSelf = Self(sign: self.sign,\n                            exponent: Self.greatestFiniteMagnitude.exponent,\n                            significand: 1)\n      let scaledOther = Self(sign: .plus,\n                             exponent: -1,\n                             significand: other)\n      // Now both values are finite, so re-run the naive comparison.\n      return scaledSelf.isAlmostEqual(to: scaledOther, tolerance: tolerance)\n    }\n    // If self is finite and other is infinite, flip order and use scaling\n    // defined above, since this relation is symmetric.\n    return other.rescaledAlmostEqual(to: self, tolerance: tolerance)\n  }\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DTXDurationFormatter.h",
    "content": "//\n//  DTXDurationFormatter.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 6/1/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DTXDurationFormatter : NSFormatter\n\n- (NSString*)stringFromTimeInterval:(NSTimeInterval)ti;\n- (NSString*)stringFromDate:(NSDate *)startDate toDate:(NSDate *)endDate;\n- (NSString *)stringForObjectValue:(nullable id)obj;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DTXDurationFormatter.m",
    "content": "//\n//  DTXDurationFormatter.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 6/1/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"DTXDurationFormatter.h\"\n\n@implementation DTXDurationFormatter\n{\n\tNSNumberFormatter* _numberFormatter;\n}\n\n- (instancetype)init\n{\n\tself = [super init];\n\tif(self)\n\t{\n\t\t_numberFormatter = [NSNumberFormatter new];\n\t\t_numberFormatter.maximumFractionDigits = 2;\n\t}\n\t\n\treturn self;\n}\n\n- (NSString*)_usStringFromTimeInterval:(NSTimeInterval)ti\n{\n\treturn [NSString stringWithFormat:@\"%@μs\", [_numberFormatter stringFromNumber:@(ti * 1000000)]];\n}\n\n- (NSString*)_msStringFromTimeInterval:(NSTimeInterval)ti round:(BOOL)roundMs\n{\n\tti *= 1000;\n\tif(roundMs)\n\t{\n\t\tti = round(ti);\n\t}\n\t\n\treturn [NSString stringWithFormat:@\"%@ms\", [_numberFormatter stringFromNumber:@(ti)]];\n}\n\n- (NSString*)_hmsmsStringFromTimeInterval:(NSTimeInterval)ti\n{\n\tNSMutableString* rv = [NSMutableString new];\n\t\n\tdouble hours = floor(ti / 3600);\n\tdouble minutes = floor(fmod(ti / 60, 60));\n\tdouble seconds = fmod(ti, 60);\n\tdouble secondsRound = floor(fmod(ti, 60));\n\tdouble ms = ti - floor(ti);\n\t\n\tif(hours > 0)\n\t{\n\t\t[rv appendFormat:@\"%@h\", [_numberFormatter stringFromNumber:@(hours)]];\n\t}\n\t\n\tif(minutes > 0)\n\t{\n\t\tif(rv.length != 0)\n\t\t{\n\t\t\t[rv appendString:@\" \"];\n\t\t}\n\t\t\n\t\t[rv appendFormat:@\"%@m\", [_numberFormatter stringFromNumber:@(minutes)]];\n\t}\n\t\n\tif(rv.length == 0)\n\t{\n\t\tif(seconds > 0)\n\t\t{\n\t\t\tif(rv.length != 0)\n\t\t\t{\n\t\t\t\t[rv appendString:@\" \"];\n\t\t\t}\n\t\t\t\n\t\t\t[rv appendFormat:@\"%@s\", [_numberFormatter stringFromNumber:@(seconds)]];\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(secondsRound > 0)\n\t\t{\n\t\t\t[rv appendString:@\" \"];\n\t\t\t\n\t\t\t[rv appendFormat:@\"%@s\", [_numberFormatter stringFromNumber:@(secondsRound)]];\n\t\t}\n\t\t\n\t\tif(ms > 0)\n\t\t{\n\t\t\t[rv appendString:@\" \"];\n\t\t\t\n\t\t\t[rv appendString:[self _msStringFromTimeInterval:ms round:YES]];\n\t\t}\n\t}\n\t\n\treturn rv;\n}\n\n- (NSString*)stringFromTimeInterval:(NSTimeInterval)ti\n{\n\tif(ti < 0.001)\n\t{\n\t\treturn [self _usStringFromTimeInterval:ti];\n\t}\n\t\t\n\tif(ti < 1.0)\n\t{\n\t\treturn [self _msStringFromTimeInterval:ti round:NO];\n\t}\n\t\n\treturn [self _hmsmsStringFromTimeInterval:ti];\n}\n\n- (NSString*)stringFromDate:(NSDate *)startDate toDate:(NSDate *)endDate\n{\n\treturn [self stringFromTimeInterval:endDate.timeIntervalSinceReferenceDate - startDate.timeIntervalSinceReferenceDate];\n}\n\n- (NSString *)stringForObjectValue:(id)obj\n{\n\tif(obj == nil)\n\t{\n\t\treturn nil;\n\t}\n\t\n\treturn [self stringFromTimeInterval:[obj doubleValue]];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DTXLoggingSubsystem.h",
    "content": "//\n//  DTXLoggingSubsystem.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 12/10/17.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\n#ifndef DTX_LOG_SUBSYSTEM\n#define DTX_LOG_SUBSYSTEM \"com.wix.Detox\"\n#endif /* DTX_LOG_SUBSYSTEM */\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DTXRunLoopSpinner.h",
    "content": "//\n// Copyright 2017 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <Foundation/Foundation.h>\n\n/**\n *  @brief Handles spinning the current runloop in the active mode with various configurations.\n *  Similar to dispatch_sync calls on a thread, you cannot make nested spin calls to the same\n *  spinner object, but it is OK to create and spin a separate spinner object within a\n *  source/timer/block invoked by another spinner.\n *\n *  The current runloop mode is the mode that a runloop is currently executing in. The active run\n *  loop mode is (more or less) the mode that the runloop would be executing if we weren't\n *  controlling the runloop's execution. Some events, like scrolling, will switch the current mode\n *  under normal conditions but not while we are spinning the runloop. To make the app behave\n *  closer to normal app conditions, the runloop spinner spins the runloop in the active mode not\n *  the current mode.\n *\n *  Draining (or doing a pass over) the runloop in a particular mode is running the runloop so\n *  that it services all pending blocks, sources, or timers. Spinning the runloop means repeatedly\n *  draining the runloop, possibly allowing the runloop to sleep between drains.\n *\n *  While the runloop spinner is running the runloop in a particular mode, any source/timer/block\n *  serviced by the runloop may itself start running the runloop in any mode of its choosing.\n *  In that case, we consider runloop as not running in the mode that we started spinning, even\n *  if the source/timer/block started running the runloop in the same mode (nesting the runloop\n *  mode).\n */\n@interface DTXRunLoopSpinner : NSObject\n\n/**\n *  The maximum time in seconds that the spinner will spin the runloop. Default is 0.\n *\n *  The spinner will not initiate any runloop drains after @c timeout seconds, but it is possible\n *  that an ongoing runloop drain will be executing after @c timeout. If @c timeout is 0, then the\n *  spinner will only drain the runloop for its configured minimum number of runloop drains.\n */\n@property(nonatomic) CFTimeInterval timeout;\n\n/**\n *  The maximum time in seconds that the current thread will be allowed to sleep while running in\n *  the active mode that we started spinning. Default is 0.\n *\n *  If set to 0, then the runloop will not be allowed to sleep in the active mode that it started\n *  spinning.\n *\n *  @remark Not allowing the runloop to sleep can be useful for some test scenarios but causes the\n *          thread to use significantly more CPU.\n */\n@property(nonatomic) CFTimeInterval maxSleepInterval;\n\n/**\n *  The minimum number of times that the runloop should be drained in the active mode before\n *  checking the stop condition. Default is 2.\n *\n *  @remark The default value is 2 because, as per the CFRunLoop implementation, some ports\n *          (specifically the dispatch port) will only be serviced every other runloop drain.\n */\n@property(nonatomic) NSUInteger minRunLoopDrains;\n\n/**\n *  This block is invoked in the active runloop mode if the stop condition evaluates to @c YES.\n *  Default is a noop.\n */\n@property(copy, nonatomic) void (^conditionMetHandler)(void);\n\n/**\n *  Spins the current thread's runloop in the active mode using the given stop condition.\n *\n *  Will always spin the runloop for at least the minimum number of runloop drains. Will always\n *  evaluate @c stopConditionBlock at least once after draining for minimum number of drains. After\n *  draining for the minimum number of drains, the spinner will evaluate @c stopConditionBlock at\n *  least once per runloop drain. The spinner will stop initiating drains and return if\n *  @c stopConditionBlock evaluates to @c YES or if the timeout has elapsed.\n *\n *  @remark This method should not be invoked on the same spinner object in nested calls (e.g.\n *          sources that are serviced while it's spinning) or concurrently.\n *\n *  @param stopConditionBlock The condition block used by the spinner to determine if it should\n *                            keep spinning the active runloop.\n *\n *  @return @c YES if the spinner evaluated the @c stopConditionBlock to @c YES; @c NO otherwise.\n */\n- (BOOL)spinWithStopConditionBlock:(BOOL (NS_NOESCAPE ^)(void))stopConditionBlock;\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DTXRunLoopSpinner.m",
    "content": "//\n// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n#import \"DTXRunLoopSpinner.h\"\n\n#import \"UIApplication+DTXAdditions.h\"\n\n/**\n *  The default minimum number of runloop drains. The default is 2 because, as per the CFRunLoop\n *  implementation, some ports (specifically the dispatch port) will only be serviced every other\n *  runloop drain.\n */\nstatic const NSUInteger kDefaultMinRunLoopDrains = 2;\n\n/**\n *  No-op timer handler block.\n */\nstatic void (^noopTimerHandler)(CFRunLoopTimerRef timer) = ^(CFRunLoopTimerRef timer) {\n};\n\n@implementation DTXRunLoopSpinner\n{\n\tBOOL _spinning;\n}\n\n- (instancetype)init {\n\tself = [super init];\n\tif (self) {\n\t\t_minRunLoopDrains = kDefaultMinRunLoopDrains;\n\t}\n\treturn self;\n}\n\n- (BOOL)spinWithStopConditionBlock:(BOOL (NS_NOESCAPE ^)(void))stopConditionBlock {\n\tNSAssert(!_spinning, @\"Should not spin the same run loop spinner instance concurrently.\");\n\t\n\t_spinning = YES;\n\tCFTimeInterval timeoutTime = CACurrentMediaTime() + _timeout;\n\t[self dtx_drainRunLoopInActiveModeForDrains:_minRunLoopDrains];\n\tBOOL stopConditionMet = [self dtx_checkConditionInActiveMode:stopConditionBlock];\n\tCFTimeInterval remainingTime = [self dtx_secondsUntilTime:timeoutTime];\n\t\n\twhile (!stopConditionMet && remainingTime > 0) {\n\t\t@autoreleasepool {\n\t\t\tstopConditionMet = [self dtx_drainRunLoopInActiveModeAndCheckCondition:stopConditionBlock\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforTime:remainingTime];\n\t\t\tremainingTime = [self dtx_secondsUntilTime:timeoutTime];\n\t\t}\n\t}\n\t\n\t_spinning = NO;\n\treturn stopConditionMet;\n}\n\n#pragma mark - Private\n\n/**\n *  Spins the run loop in the active mode for @c exitDrainCount drains.\n *\n *  @param exitDrainCount The number of times to drain the active run loop.\n */\n- (void)dtx_drainRunLoopInActiveModeForDrains:(NSUInteger)exitDrainCount {\n\tif (exitDrainCount == 0) {\n\t\treturn;\n\t}\n\t\n\t__block NSUInteger drainCount = 0;\n\tvoid (^drainCountingBlock)(void) = ^{\n\t\tdrainCount++;\n\t\tif (drainCount >= exitDrainCount) {\n\t\t\tCFRunLoopStop(CFRunLoopGetCurrent());\n\t\t}\n\t};\n\t\n\tvoid (^wakeUpBlock)(void) = ^{\n\t\t// Never let the run loop sleep while we are draining it for the minimum drains.\n\t\tCFRunLoopWakeUp(CFRunLoopGetCurrent());\n\t};\n\t\n\t// Drain the currently active mode in a while loop so that we handle cases where the active mode\n\t// finishes or is stopped. In these cases, we want to keep draining the (possibly new) active mode\n\t// for the remaining drains.\n\twhile (drainCount < exitDrainCount) {\n\t\t@autoreleasepool {\n\t\t\tNSString *activeMode = [self dtx_activeRunLoopMode];\n\t\t\tCFRunLoopObserverRef drainCountingObserver = [self dtx_setupObserverInMode:activeMode\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t withBeforeSourcesBlock:drainCountingBlock\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t beforeWaitingBlock:wakeUpBlock];\n\t\t\t\n\t\t\tCFRunLoopRunResult result = CFRunLoopRunInMode((CFStringRef)activeMode, DBL_MAX, false);\n\t\t\tif (result == kCFRunLoopRunFinished) {\n\t\t\t\t// Running a run loop mode will finish if that mode has no sources or timers. In that case,\n\t\t\t\t// the observer callbacks will not get called, so we need to increment the drain count here.\n\t\t\t\tdrainCount++;\n\t\t\t}\n\t\t\t[self dtx_teardownObserver:drainCountingObserver inMode:activeMode];\n\t\t}\n\t}\n}\n\n/**\n *  Spins the run loop in the active mode until the stop condition has been met, we have timed\n *  out, the run loop finishes, or the run loop is stopped by someone else. Checks the stop\n *  condition at least once per run loop drain.\n *\n *  @param stopConditionBlock The condition block that should be checked to determine if we should\n *                            stop initiating drains in the active mode.\n *  @param time               The timeout time after which we should stop initiating drains.\n *\n *  @return @c YES if the condition block was evaluated to YES while draining or after the active\n *          run loop finished; @c NO otherwise.\n */\n- (BOOL)dtx_drainRunLoopInActiveModeAndCheckCondition:(BOOL (^)(void))stopConditionBlock\n\t\t\t\t\t\t\t\t\t\t\t   forTime:(CFTimeInterval)time {\n\tNSString *activeMode = [self dtx_activeRunLoopMode];\n\tCFRunLoopTimerRef wakeUpTimer = [self dtx_setupWakeUpTimerInMode:activeMode];\n\t__block BOOL conditionMet = NO;\n\t__weak __typeof__(self) weakSelf = self;\n\t\n\tvoid (^beforeSourcesConditionCheckBlock)(void) = ^{\n\t\t__typeof__(self) strongSelf = weakSelf;\n\t\tNSAssert(strongSelf != nil,  @\"The spinner should not have been deallocated.\");\n\t\t\n\t\tif (stopConditionBlock()) {\n\t\t\tif ([strongSelf conditionMetHandler]) {\n\t\t\t\t[strongSelf conditionMetHandler]();\n\t\t\t}\n\t\t\tconditionMet = YES;\n\t\t\tCFRunLoopStop(CFRunLoopGetCurrent());\n\t\t}\n\t};\n\t\n\tvoid (^beforeWaitingConditionCheckBlock)(void) = ^{\n\t\t__typeof__(self) strongSelf = weakSelf;\n\t\tNSAssert(strongSelf != nil,  @\"The spinner should not have been deallocated.\");\n\t\t\n\t\tif (strongSelf.maxSleepInterval == 0) {\n\t\t\tCFRunLoopWakeUp(CFRunLoopGetCurrent());\n\t\t}\n\t\t\n\t\t// This observer callback is not guaranteed to be called, but we must also check if we should\n\t\t// stop the run loop here because we do not want the run loop to go to sleep if we should stop\n\t\t// the run loop. A source handled in the last drain may have satisfied the stop condition.\n\t\t//\n\t\t// Do not check _stopConditionBlock if _stopConditionMet is already true. This will occur if we\n\t\t// stopped the run loop in the BeforeSources handler. In this case, we do not want to check the\n\t\t// stop condition again.\n\t\tif (!conditionMet && stopConditionBlock()) {\n\t\t\tif ([strongSelf conditionMetHandler]) {\n\t\t\t\t[strongSelf conditionMetHandler]();\n\t\t\t}\n\t\t\tconditionMet = YES;\n\t\t\tCFRunLoopStop(CFRunLoopGetCurrent());\n\t\t}\n\t};\n\t\n\tCFRunLoopObserverRef conditionCheckingObserver =\n\t[self dtx_setupObserverInMode:activeMode\n\t\t\twithBeforeSourcesBlock:beforeSourcesConditionCheckBlock\n\t\t\t\tbeforeWaitingBlock:beforeWaitingConditionCheckBlock];\n\t\n\tCFRunLoopRunResult result = CFRunLoopRunInMode((CFStringRef)activeMode, time, false);\n\t\n\t// Running a run loop mode will finish if that mode has no sources or timers. In that case,\n\t// the observer callbacks will not get called, so we need to check the condition here.\n\tif (result == kCFRunLoopRunFinished) {\n\t\tNSAssert(conditionMet == NO, @\"If the running the active mode returned finished, the condition should not have been met.\");\n\t\tconditionMet = [self dtx_checkConditionInActiveMode:stopConditionBlock];\n\t}\n\t\n\t[self dtx_teardownObserver:conditionCheckingObserver inMode:activeMode];\n\t[self dtx_teardownTimer:wakeUpTimer inMode:activeMode];\n\t\n\treturn conditionMet;\n}\n\n/**\n *  Checks the stop condition block in the active mode and invokes the condition met handler in the\n *  active mode if it was evaluated to @c YES.\n *\n *  @param stopConditionBlock The condition block that should be evaluated in the active mode.\n *\n *  @return @c YES if the stop condition block evaluated to @YES; @c NO otherwise.\n */\n- (BOOL)dtx_checkConditionInActiveMode:(BOOL (^)(void))stopConditionBlock  {\n\t__block BOOL conditionMet = NO;\n\t__weak __typeof__(self) weakSelf = self;\n\t\n\tNSString *activeMode = [self dtx_activeRunLoopMode];\n\tCFRunLoopPerformBlock(CFRunLoopGetCurrent(), (CFStringRef)activeMode, ^{\n\t\t__typeof__(self) strongSelf = weakSelf;\n\t\tNSAssert(strongSelf != nil,  @\"The spinner should not have been deallocated.\");\n\t\t\n\t\tif (stopConditionBlock()) {\n\t\t\tvoid (^conditionMetHandler)(void) = [strongSelf conditionMetHandler];\n\t\t\tif (conditionMetHandler) {\n\t\t\t\tconditionMetHandler();\n\t\t\t}\n\t\t\tconditionMet = YES;\n\t\t}\n\t});\n\t// Handles at most one souce in the active mode. All enqueued blocks are serviced before any\n\t// sources are serviced.\n\tCFRunLoopRunInMode((CFStringRef)activeMode, 0, true);\n\t\n\treturn conditionMet;\n}\n\n/**\n *  Setup an observer in @c mode that will invoke the provided blocks when the on the appropriate\n *  observer events if and only if the run loop is running in @c mode and the mode has not been\n *  nested.\n *\n *  @remark We consider a mode \"nested\" if a source handled while we are spinning the run loop\n *          starts spinning the run loop in the same mode.\n *\n *  @param mode               The mode that the observer should be added to.\n *  @param beforeSourcesBlock Block that will be invoked when the added observer receives before-\n *                            sources callbacks and is not nested.\n *  @param beforeWaitingBlock Block that will be invoked when the added observer receives before-\n *                            waiting callbacks and is not nested.\n *\n *  @return The registered observer.\n */\n- (CFRunLoopObserverRef)dtx_setupObserverInMode:(NSString *)mode\n\t\t\t\t\t\t  withBeforeSourcesBlock:(void (^)(void))beforeSourcesBlock\n\t\t\t\t\t\t\t  beforeWaitingBlock:(void (^)(void))beforeWaitingBlock {\n\t__block int numNestedRunLoopModes = 0;\n\t\n\tvoid (^observerBlock)(CFRunLoopObserverRef observer, CFRunLoopActivity activity) =\n\t^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) {\n\t\tif (activity & kCFRunLoopEntry) {\n\t\t\t// When entering a run loop in @c mode, increment the nesting count.\n\t\t\tnumNestedRunLoopModes++;\n\t\t} else if (activity & kCFRunLoopExit) {\n\t\t\t// When exiting a run loop in @c mode, decrement the nesting count.\n\t\t\tnumNestedRunLoopModes--;\n\t\t} else if (activity & kCFRunLoopBeforeSources) {\n\t\t\t// When this observer was created, the nesting count was 0. When we started running the\n\t\t\t// run loop in @c mode, the run loop entered @c mode and incremented the nesting count. So\n\t\t\t// now, the \"unnested\" nesting count is 1.\n\t\t\tif (numNestedRunLoopModes == 1) {\n\t\t\t\tbeforeSourcesBlock();\n\t\t\t}\n\t\t} else if (activity & kCFRunLoopBeforeWaiting) {\n\t\t\tif (numNestedRunLoopModes == 1) {\n\t\t\t\tbeforeWaitingBlock();\n\t\t\t}\n\t\t} else {\n\t\t\tNSAssert(NO, @\"Should not get here. Observer is not registered for any other options.\");\n\t\t}\n\t\tNSAssert(numNestedRunLoopModes >= 0, @\"The nesting count for |mode| should never be less than zero.\");\n\t};\n\t\n\tCFOptionFlags observerFlags = kCFRunLoopEntry | kCFRunLoopExit;\n\tif (beforeSourcesBlock) {\n\t\tobserverFlags = observerFlags | kCFRunLoopBeforeSources;\n\t}\n\tif (beforeWaitingBlock) {\n\t\tobserverFlags = observerFlags | kCFRunLoopBeforeWaiting;\n\t}\n\t\n\t// Order = LONG_MAX so it is serviced last after all other higher priority observers.\n\t// Let the other observers do their job before querying for idleness.\n\tCFRunLoopObserverRef observer =\n\tCFRunLoopObserverCreateWithHandler(NULL, observerFlags, true, LONG_MAX, observerBlock);\n\tCFRunLoopAddObserver(CFRunLoopGetCurrent(), observer, (CFStringRef)mode);\n\treturn observer;\n}\n\n/**\n *  Create and return a wake up timer in @c mode. Will not add a timer if @c maxSleepInterval\n *  is 0. The wake up timer will fire every @c maxSleepInterval to keep the run loop from sleeping\n *  more than @c maxSleepInterval while running in @c mode.\n *\n *  @param mode The mode that the timer should be added to.\n *\n *  @return The registered timer or @c nil if no timer was added to @c mode.\n */\n- (CFRunLoopTimerRef)dtx_setupWakeUpTimerInMode:(NSString *)mode {\n\tif (_maxSleepInterval > 0) {\n\t\tCFRunLoopTimerRef timer =\n\t\tCFRunLoopTimerCreateWithHandler(kCFAllocatorDefault,\n\t\t\t\t\t\t\t\t\t\tCFAbsoluteTimeGetCurrent() + _maxSleepInterval,\n\t\t\t\t\t\t\t\t\t\t_maxSleepInterval,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\tnoopTimerHandler);\n\t\tCFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, (CFStringRef)mode);\n\t\treturn timer;\n\t} else {\n\t\treturn NULL;\n\t}\n}\n\n/**\n *  Remove @c observer from @c mode and then release it.\n *\n *  @param observer The observer to be removed and released.\n *  @param mode     The mode from which the observer should be removed.\n */\n- (void)dtx_teardownObserver:(CFRunLoopObserverRef)observer inMode:(NSString *)mode {\n\tif (observer) {\n\t\tCFRunLoopRemoveObserver(CFRunLoopGetCurrent(), observer, (CFStringRef)mode);\n\t\tCFRelease(observer);\n\t}\n}\n\n/**\n *  Remove @c timer from @c mode and then release it.\n *\n *  @param timer The time to be removed and released.\n *  @param mode  The mode from which the timer should be removed.\n */\n- (void)dtx_teardownTimer:(CFRunLoopTimerRef)timer inMode:(NSString *)mode {\n\tif (timer) {\n\t\tCFRunLoopRemoveTimer(CFRunLoopGetCurrent(), timer, (CFStringRef)mode);\n\t\tCFRelease(timer);\n\t}\n}\n\n/**\n *  @param time The point in time to measure against.\n *\n *  @return The time in seconds from now until @c time.\n */\n- (CFTimeInterval)dtx_secondsUntilTime:(CFTimeInterval)time {\n\treturn time - CACurrentMediaTime();\n}\n\n/**\n *  @return The active mode for the current runloop.\n */\n- (NSString *)dtx_activeRunLoopMode {\n\tNSString *activeRunLoopMode = [[UIApplication sharedApplication] dtx_activeRunLoopMode];\n\tif (!activeRunLoopMode) {\n\t\t// If UIKit does not have any modes on its run loop stack, then consider the default\n\t\t// run loop mode as the active mode. We do not use the current run loop mode because if this\n\t\t// spinner is nested within another spinner, we could get stuck spinning the run loop in a\n\t\t// mode that was active but shouldn't be anymore.\n\t\t// TODO: Do better than just always using the default run loop mode.\n\t\tactiveRunLoopMode = NSDefaultRunLoopMode;\n\t}\n\treturn activeRunLoopMode;\n}\n\n#pragma mark - Getters and Setters\n\n- (void)setMaxSleepInterval:(CFTimeInterval)maxSleepInterval {\n\tNSAssert(maxSleepInterval >= 0, @\"Maximum sleep interval must be non-negative.\");\n\t_maxSleepInterval = maxSleepInterval;\n}\n\n- (void)setTimeout:(CFTimeInterval)timeout {\n\tNSAssert(timeout >= 0, @\"Timeout must be non-negative.\");\n\t_timeout = timeout;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxCrashHandler.h",
    "content": "//\n//  DetoxCrashHandler.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/26/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nextern void __DTXInstallCrashHandlersIfNeeded(void);\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxCrashHandler.mm",
    "content": "//\n//  DetoxCrashHandler.mm\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 12/5/17.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\n#import <Detox/Detox-Swift.h>\n#import \"DTXAssertionHandler.h\"\n#import \"fishhook.h\"\n\n#import <dlfcn.h>\n#import <Foundation/Foundation.h>\n#include <cstdlib>\n#include <exception>\n#include <typeinfo>\n#include <cxxabi.h>\n#import <asl.h>\n\n__attribute__ ((visibility (\"hidden\")))\nOBJC_EXTERN void __DTXHandleCrash(NSException* exception, NSNumber* signal, NSString* other)\n{\n    @autoreleasepool {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n        const char * queue_label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);\n#pragma clang diagnostic pop\n\n        NSMutableDictionary* report = [@{\n            @\"threadNumber\": [[NSThread currentThread] valueForKeyPath:@\"private.seqNum\"] ?: @(-1),\n            @\"queueName\": [NSString stringWithCString:dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)encoding:NSASCIIStringEncoding]\n        } mutableCopy];\n\n        NSString* errorDetails;\n        if (exception) {\n            errorDetails = [NSString stringWithFormat:@\"%@\\n%@\\n%@\", exception.name, exception.reason, exception.dtx_demangledCallStackSymbols];\n        } else if (signal) {\n            errorDetails = [NSString stringWithFormat:@\"Signal %@ raised\\n%@\", signal, [NSThread dtx_demangledCallStackSymbols]];\n        } else {\n            errorDetails = [NSString stringWithFormat:@\"%@\\n%@\", other ?: @\"\", [NSThread dtx_demangledCallStackSymbols]];\n        }\n\n        report[@\"errorDetails\"] = errorDetails;\n\n        if (NSThread.isMainThread) {\n            [DTXDetoxManager.sharedManager notifyOnCrashWithDetails:report];\n        } else {\n        dispatch_sync(dispatch_get_main_queue(), ^{\n            [DTXDetoxManager.sharedManager notifyOnCrashWithDetails:report];\n        });\n        }\n\n        [NSRunLoop.mainRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2]];\n    }\n}\n\nstatic NSSet<NSNumber*>* __supportedSignals;\n\nstatic int (*__orig_sigaction)(int, const struct sigaction * __restrict, struct sigaction * __restrict);\nstatic int __dtx_sigaction(int signal, const struct sigaction * __restrict newaction, struct sigaction * __restrict oldaction)\n{\n\tif([__supportedSignals containsObject:@(signal)] == NO)\n\t{\n\t\treturn __orig_sigaction(signal, newaction, oldaction);\n\t}\n\t\n\treturn 0;\n}\n\n__attribute__ ((visibility (\"hidden\")))\nOBJC_EXTERN int __dtx_asl_log(asl_object_t client, asl_object_t msg, int level, const char *format, ...)\n{\n\tva_list args;\n\tva_start(args, format);\n\n\tif(level == ASL_LEVEL_ERR)\n\t{\n\t\t//No other way to catch Swift fatal errors. We swizzle asl_log, which is called by the Swift runtime\n\t\t// in https://github.com/apple/swift/blob/889e84a2029a28f25dd62c3bfc1a9a0241b0413f/stdlib/public/runtime/Errors.cpp#L310\n\t\t//We then check for a known Swift function in the first few frames of the call stack.\n\t\tNSArray<NSString*>* callStackSymbols = NSThread.callStackSymbols;\n\t\tfor (NSUInteger idx = 1; idx < MIN(callStackSymbols.count, 4); idx++) {\n\t\t\tif([callStackSymbols[idx] containsString:@\"swift_reportError\"])\n\t\t\t{\n\t\t\t\tNSString* message = [[NSString alloc] initWithFormat:[NSString stringWithUTF8String:format] arguments:args];\n\t\t\t\tva_end(args);\n\t\t\t\t__DTXHandleCrash(nil, nil, [message stringByTrimmingCharactersInSet:NSCharacterSet.newlineCharacterSet]);\n\t\t\t\t\n\t\t\t\tva_start(args, format);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tint rv = asl_vlog(client, msg, level, format, args);\n\tva_end(args);\n\n\treturn rv;\n}\n\n__attribute__ ((visibility (\"hidden\")))\nOBJC_EXTERN void __DTXHandleSignal(int signal)\n{\n\t__DTXHandleCrash(nil, @(signal), nil);\n\t\n\texit(1);\n}\n\nOBJC_EXTERN std::type_info *__cxa_current_exception_type(void);\nOBJC_EXTERN void __cxa_rethrow(void);\n\nstatic thread_local BOOL __alreadyTerminating = NO;\n\nstatic void (*__old_terminate)(void) = nullptr;\n__attribute__ ((visibility (\"hidden\")))\nstatic void __dtx_terminate()\n{\n    static thread_local BOOL terminating = NO;\n    if (terminating) return;\n    terminating = YES;\n\n    @autoreleasepool {\n        try {\n            if (auto eptr = std::current_exception()) {\n                std::rethrow_exception(eptr);\n            }\n        } catch (const std::exception& e) {\n            __DTXHandleCrash(nil, nil, [NSString stringWithUTF8String:e.what()]);\n        } catch (NSException* e)\n        {\n            __DTXHandleCrash(e, nil, nil);\n        } catch (id obj) {\n            __DTXHandleCrash(nil, nil, [NSString stringWithFormat:@\"ObjC exception of type “%@” was thrown\", [obj class]]);\n        } catch (...) {\n            std::type_info* exceptionType = __cxa_current_exception_type();\n\n            if (exceptionType == nullptr)\n            {\n                __DTXHandleCrash(nil, nil, @\"Exception of unknown type was thrown\");\n            } else {\n                const char* exceptionTypeMangledName = exceptionType->name();\n\n                int status = -1;\n                const char* demangled = abi::__cxa_demangle(exceptionTypeMangledName, NULL, NULL, &status);\n                NSString* exceptionTypeName = nil;\n                if(demangled)\n                {\n                    exceptionTypeName = [NSString stringWithUTF8String:demangled];\n                    free((void*)demangled);\n                }\n                else\n                {\n                    exceptionTypeName = [NSString stringWithUTF8String:exceptionTypeMangledName];\n                }\n\n\n                __DTXHandleCrash(nil, nil, [NSString stringWithFormat:@\"C++ exception of type “%@” was thrown\", exceptionTypeName]);\n            }\n        }\n\n        if (__old_terminate) __old_terminate();\n    }\n}\n\nstatic std::terminate_handler (*__old_std_set_terminate)(std::terminate_handler) = nil;\nstatic std::terminate_handler __dtx_std_set_terminate(std::terminate_handler new_handler)\n{\n\tstd::terminate_handler rv = __old_terminate;\n\t__old_terminate = new_handler;\n\treturn rv;\n}\n\n__attribute__((constructor))\nOBJC_EXTERN void __DTXInstallCrashHandlersIfNeeded(void)\n{\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\t__old_std_set_terminate = (std::terminate_handler (*)(std::terminate_handler))dlsym(RTLD_DEFAULT, \"_ZSt13set_terminatePFvvE\");\n\t\t{\n\t\t\t//Mnagled name of \"std::set_terminate()\"\n\t\t\tstruct rebinding rebindings[] = {\n\t\t\t\t{\"_ZSt13set_terminatePFvvE\", (void*)__dtx_std_set_terminate, nullptr }\n\t\t\t};\n\t\t\trebind_symbols(rebindings, 1);\n\t\t}\n\t\t\n\t\t__old_terminate = __old_std_set_terminate(__dtx_terminate);\n\t\t__supportedSignals = [NSSet setWithArray:@[@(SIGQUIT), @(SIGILL), @(SIGTRAP), @(SIGABRT), @(SIGFPE), @(SIGBUS), @(SIGSEGV), @(SIGSYS)]];\n\t\t__orig_sigaction = (int (*)(int, const struct sigaction * __restrict, struct sigaction * __restrict))dlsym(RTLD_DEFAULT, \"sigaction\");\n\t\t\n\t\t{\n\t\t\tstruct rebinding rebindings[] = {\n\t\t\t\t{\"sigaction\", (void*)__dtx_sigaction, nullptr},\n\t\t\t\t{\"asl_log\", (void*)__dtx_asl_log, nullptr},\n\t\t\t};\n\t\t\t\n\t\t\trebind_symbols(rebindings, sizeof(rebindings) / sizeof(rebindings[0]));\n\t\t}\n\t\t\n\t\tstruct sigaction signalAction;\n\t\tmemset(&signalAction, 0, sizeof(signalAction));\n\t\tsigemptyset(&signalAction.sa_mask);\n\t\tsignalAction.sa_handler = &__DTXHandleSignal;\n\t\t\n\t\t[__supportedSignals enumerateObjectsUsingBlock:^(NSNumber * _Nonnull obj, BOOL * _Nonnull stop) {\n\t\t\tint signum = obj.intValue;\n\t\t\t\n\t\t\t__orig_sigaction(signum, &signalAction, nullptr);\n\t\t}];\n\t});\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxInstrumentsManager.h",
    "content": "//\n//  DetoxInstrumentsManager.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 2/17/19.\n//  Copyright © 2019 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DetoxInstrumentsManager : NSObject\n\n+ (NSURL*)defaultURLForTestName:(NSString*)testName;\n\n- (void)startRecordingWithConfiguration:(NSDictionary<NSString*, id>*)config;\n- (void)continueRecordingWithConfiguration:(NSDictionary<NSString*, id>*)config;\n- (void)stopRecordingWithCompletionHandler:(void(^)(NSError* _Nullable  error))completionHandler;\n\n\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxInstrumentsManager.m",
    "content": "//\n//  DetoxInstrumentsManager.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 2/17/19.\n//  Copyright © 2019 Wix. All rights reserved.\n//\n\n#import \"DetoxInstrumentsManager.h\"\n#import \"DTXLogging.h\"\n#include <dlfcn.h>\n@import CommonCrypto;\n\n#define LOAD_PROFILER_IF_NEEDED [DetoxInstrumentsManager _loadProfilerFrameworkIfNeeded];\n\nDTX_CREATE_LOG(DetoxInstrumentsManager)\n\n@interface NSObject ()\n\n//DTXProfilingConfiguration\n@property (class, nonatomic, strong, readonly) id defaultProfilingConfiguration;\n@property (nonatomic, readwrite) NSTimeInterval samplingInterval;\n@property (nonatomic, readwrite) BOOL recordEvents;\n@property (nonatomic, readwrite) BOOL recordNetwork;\n@property (nonatomic, readwrite) BOOL recordLocalhostNetwork;\n@property (nonatomic, readwrite) BOOL profileReactNative;\n@property (nonatomic, readwrite) BOOL recordInternalReactNativeEvents;\n@property (nonatomic, readwrite) BOOL recordThreadInformation;\n@property (nonatomic, readwrite) BOOL collectStackTraces;\n@property (nonatomic, readwrite) BOOL symbolicateStackTraces;\n@property (atomic, assign, readonly, getter=isRecording) BOOL recording;\n@property (nonatomic, copy, null_resettable, readwrite) NSURL* recordingFileURL;\n\n//DTXProfiler\n- (void)startProfilingWithConfiguration:(id)configuration;\n- (void)continueProfilingWithConfiguration:(id)configuration;\n- (void)stopProfilingWithCompletionHandler:(void(^ __nullable)(NSError* __nullable error))completionHandler;\n@property (atomic, copy, readonly, nullable) id profilingConfiguration;\n\n@end\n\ntypedef NS_ENUM(NSUInteger, __DTXEventStatus) {\n\t__DTXEventStatusCompleted,\n\t__DTXEventStatusError,\n\t__DTXEventStatusCancelled\n};\n\nstatic Class __DTXProfiler;\nstatic Class __DTXMutableProfilingConfiguration;\n\nstatic void (*__DTXProfilerAddTag)(NSString* tag);\nstatic NSString* (*__DTXProfilerMarkEventIntervalBegin)(NSString* category, NSString* name, NSString* __nullable message);\nstatic void (*__DTXProfilerMarkEventIntervalEnd)(NSString* identifier, __DTXEventStatus eventStatus, NSString* __nullable endMessage);\nstatic void (*__DTXProfilerMarkEvent)(NSString* category, NSString* name, __DTXEventStatus eventStatus, NSString* __nullable startMessage);\n\n@implementation DetoxInstrumentsManager\n{\n\tid _recorderInstance;\n}\n\nstatic BOOL __DTXDecryptFramework(NSURL* encryptedBinaryURL, NSURL* targetBinaryURL)\n{\n\t@autoreleasepool {\n\t\tNSError* error;\n\t\tNSData* encryptedBinaryData = [[NSData alloc] initWithContentsOfURL:encryptedBinaryURL options:NSDataReadingMappedAlways error:&error];\n\t\t\n\t\tif(encryptedBinaryData.length == 0)\n\t\t{\n\t\t\tdtx_log_error(@\"Unable to read data from %@; error: %@\", encryptedBinaryURL.path, error);\n\t\t\t\n\t\t\treturn NO;\n\t\t}\n\t\t\n\t\tNSMutableData* targetBinaryData = [NSMutableData dataWithLength:encryptedBinaryData.length];\n\t\tsize_t targetBinaryLength;\n\t\t\n\t\tuint8_t key[kCCKeySizeAES256] = {0};\n\t\tuint8_t iv[kCCBlockSizeAES128] = {0};\n\t\tCCCryptorStatus status = CCCrypt(kCCDecrypt, kCCAlgorithmAES, 0, key, kCCKeySizeAES256, iv, encryptedBinaryData.bytes, encryptedBinaryData.length, targetBinaryData.mutableBytes, targetBinaryData.length, &targetBinaryLength);\n\t\t\n\t\tif(status != kCCSuccess)\n\t\t{\n\t\t\tdtx_log_error(@\"Unable to decrypt %@\", encryptedBinaryURL.path);\n\t\t\t\n\t\t\treturn NO;\n\t\t}\n\t\t\n\t\ttargetBinaryData.length = targetBinaryLength;\n\t\t\n\t\tif([targetBinaryData writeToURL:targetBinaryURL atomically:YES] == NO)\n\t\t{\n\t\t\tdtx_log_error(@\"Unable to write decrypted data to %@\", targetBinaryURL.path);\n\t\t\t\n\t\t\treturn NO;\n\t\t}\n\t\t\n\t\treturn YES;\n\t}\n}\n\n+ (void)_loadProfilerFrameworkIfNeeded\n{\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\t__DTXProfiler = NSClassFromString(@\"DTXProfiler\");\n\t\t\n\t\tif(__DTXProfiler == NULL)\n\t\t{\n\t\t\tdtx_log_info(@\"DTXProfiler class was not found in hosting process, loading Profiler framework manually\");\n\t\t\t\n\t\t\t//The user has not linked the Profiler framework. Load it manually.\n\t\t\t\n\t\t\tNSString* instrumentsPath = [NSUserDefaults.standardUserDefaults stringForKey:@\"instrumentsPath\"];\n\t\t\tif(instrumentsPath == nil)\n\t\t\t{\n\t\t\t\tinstrumentsPath = @\"/Applications/Detox Instruments.app\";\n\t\t\t}\n\t\t\t\n\t\t\tNSURL* bundleURL = [[NSURL fileURLWithPath:instrumentsPath isDirectory:YES] URLByAppendingPathComponent:@\"Contents/SharedSupport/ProfilerFramework/DTXProfiler.framework\"];\n\t\t\tNSBundle* profilerBundle = [NSBundle bundleWithURL:bundleURL];\n\t\t\t\n\t\t\tif(profilerBundle == nil)\n\t\t\t{\n\t\t\t\tdtx_log_info(@\"Error loading Profiler framework bundle. Bundle not found at %@\", bundleURL.path);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tNSError* error = nil;\n\t\t\t\n\t\t\tNSFileHandle* executableFileHandle = [NSFileHandle fileHandleForReadingFromURL:profilerBundle.executableURL error:&error];\n\t\t\tNSData* header = [executableFileHandle readDataOfLength:4];\n\t\t\tNSData* expectedBinaryHeader = [[NSData alloc] initWithBase64EncodedString:@\"yv66vg==\" options:0];\n\t\t\t\n\t\t\tif([header isEqualToData:expectedBinaryHeader] == NO)\n\t\t\t{\n\t\t\t\tdtx_log_info(@\"Encrypted framework binary found at %@\", profilerBundle.executableURL.path);\n\t\t\t\t\n\t\t\t\tNSURL* tempURL = [[NSURL fileURLWithPath:NSTemporaryDirectory() isDirectory:YES] URLByAppendingPathComponent:@\"__detox_instruments_support__\" isDirectory:YES];\n\t\t\t\t[NSFileManager.defaultManager removeItemAtURL:tempURL error:NULL];\n\t\t\t\t[NSFileManager.defaultManager createDirectoryAtURL:tempURL withIntermediateDirectories:YES attributes:nil error:&error];\n\t\t\t\tNSURL* targetBundleURL = [tempURL URLByAppendingPathComponent:bundleURL.lastPathComponent];\n\t\t\t\t[NSFileManager.defaultManager copyItemAtURL:bundleURL toURL:targetBundleURL error:&error];\n\t\t\t\n\t\t\t\tif(__DTXDecryptFramework(profilerBundle.executableURL, [targetBundleURL URLByAppendingPathComponent:profilerBundle.executableURL.lastPathComponent]) == NO)\n\t\t\t\t{\n\t\t\t\t\tdtx_log_error(@\"Decryption failed, stopping\");\n\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(__DTXDecryptFramework([profilerBundle.bundleURL URLByAppendingPathComponent:@\"Frameworks/DetoxSync.framework/DetoxSync\"], [targetBundleURL URLByAppendingPathComponent:@\"Frameworks/DetoxSync.framework/DetoxSync\"]) == NO)\n\t\t\t\t{\n\t\t\t\t\tdtx_log_info(@\"Decryption of DetoxSync failed, continuing\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tprofilerBundle = [NSBundle bundleWithURL:targetBundleURL];\n\t\t\t}\n\t\t\t\n\t\t\t[profilerBundle loadAndReturnError:&error];\n\t\t\t\n\t\t\tif(error != nil)\n\t\t\t{\n\t\t\t\tdtx_log_error(@\"Error loading Profiler framework bundle: %@\", error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdtx_log_info(@\"Using DTXProfiler class from hosting process\");\n\t\t}\n\t\t\n\t\tstatic void (^cleanupOnError)(void) = ^ {\n\t\t\t__DTXProfiler = NULL;\n\t\t\t__DTXMutableProfilingConfiguration = NULL;\n\t\t};\n\t\t\n\t\t__DTXProfiler = NSClassFromString(@\"DTXProfiler\");\n\t\tif(__DTXProfiler == NULL)\n\t\t{\n\t\t\tcleanupOnError();\n\t\t\tdtx_log_error(@\"DTXProfiler class not found—this should not have happened!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t__DTXMutableProfilingConfiguration = NSClassFromString(@\"DTXMutableProfilingConfiguration\");\n\t\tif(__DTXMutableProfilingConfiguration == NULL)\n\t\t{\n\t\t\tcleanupOnError();\n\t\t\tdtx_log_error(@\"DTXMutableProfilingConfiguration class not found—this should not have happened!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t__DTXProfilerAddTag = dlsym(RTLD_DEFAULT, \"DTXProfilerAddTag\");\n\t\t__DTXProfilerMarkEventIntervalBegin = dlsym(RTLD_DEFAULT, \"DTXProfilerMarkEventIntervalBegin\");\n\t\t__DTXProfilerMarkEventIntervalEnd = dlsym(RTLD_DEFAULT, \"DTXProfilerMarkEventIntervalEnd\");\n\t\t__DTXProfilerMarkEvent = dlsym(RTLD_DEFAULT, \"DTXProfilerMarkEvent\");\n\t\t\n\t\tif(__DTXProfilerAddTag == NULL || __DTXProfilerMarkEventIntervalBegin == NULL || __DTXProfilerMarkEventIntervalEnd == NULL || __DTXProfilerMarkEvent == NULL)\n\t\t{\n\t\t\tcleanupOnError();\n\t\t\tdtx_log_error(@\"One or more DTXProfilerAPI functions are NULL—this should not have happened!\");\n\t\t\treturn;\n\t\t}\n\t});\n}\n\n+ (NSString *)_sanitizeFileNameString:(NSString *)fileName\n{\n\tNSCharacterSet* illegalFileNameCharacters = [NSCharacterSet characterSetWithCharactersInString:@\":/\\\\?%*|\\\"<>\"];\n\treturn [[fileName componentsSeparatedByCharactersInSet:illegalFileNameCharacters] componentsJoinedByString:@\"_\"];\n}\n\n+ (NSURL*)defaultURLForTestName:(NSString*)testName\n{\n\tNSURL* documents = [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask].firstObject;\n\tNSURL* rv = [documents URLByAppendingPathComponent:[self _sanitizeFileNameString:testName]];\n\t\n\tdtx_log_debug(@\"Returning %@ as URL\", rv.path);\n\t\n\treturn rv;\n}\n\n- (instancetype)init\n{\n\tself = [super init];\n\t\n\tif(self)\n\t{\n\t\t\n\t}\n\t\n\treturn self;\n}\n\n- (id)_configurationWithDictionaryConfiguration:(NSDictionary *)configDict\n{\n\tLOAD_PROFILER_IF_NEEDED\n\t\n\tif(__DTXMutableProfilingConfiguration == nil)\n\t{\n\t\tdtx_log_error(@\"Profiler framework is not loaded. Did you forget to install Detox Instruments?\");\n\t\t\n\t\treturn nil;\n\t}\n\t\n\tid config = [__DTXMutableProfilingConfiguration defaultProfilingConfiguration];\n\t[config setRecordingFileURL:[NSURL fileURLWithPath:configDict[@\"recordingPath\"]]];\n\t\n\t//TODO: Finalize the actual config for Detox perf recording.\n\t[config setRecordEvents:YES];\n\t[config setProfileReactNative:YES];\n\tif ([config respondsToSelector:@selector(setRecordInternalReactNativeEvents:)])\n\t{\n\t\t[config setRecordInternalReactNativeEvents:YES];\n\t}\n\n\t[config setRecordNetwork:YES];\n\t[config setRecordLocalhostNetwork:YES];\n\t[config setRecordThreadInformation:YES];\n\t[config setCollectStackTraces:YES];\n\t[config setSymbolicateStackTraces:YES];\n\tNSTimeInterval samplingInterval = [configDict[@\"samplingInterval\"] ?: @0.25 doubleValue];\n\t[config setSamplingInterval:samplingInterval];\n\t\n\treturn config;\n}\n\n- (void)startRecordingWithConfiguration:(NSDictionary<NSString*, id>*)configDict\n{\n\tLOAD_PROFILER_IF_NEEDED\n\t\n\tif(__DTXProfiler == nil)\n\t{\n\t\tdtx_log_error(@\"Profiler framework is not loaded. Did you forget to install Detox Instruments?\");\n\t\t\n\t\treturn;\n\t}\n\t\n\tif(_recorderInstance != nil)\n\t{\n\t\tdtx_log_error(@\"Another recording is already in progress: %@\", [[_recorderInstance profilingConfiguration] recordingFileURL]);\n\t\t\n\t\treturn;\n\t}\n\t\n\t_recorderInstance = [__DTXProfiler new];\n\t\n\tid config = [self _configurationWithDictionaryConfiguration:configDict];\n\tdtx_log_info(@\"Starting recording at %@\", [config recordingFileURL]);\n\t[_recorderInstance startProfilingWithConfiguration:config];\n}\n\n- (void)continueRecordingWithConfiguration:(NSDictionary<NSString*, id>*)configDict\n{\n\tLOAD_PROFILER_IF_NEEDED\n\t\n\tif(__DTXProfiler == nil)\n\t{\n\t\tdtx_log_error(@\"Profiler framework is not loaded. Did you forget to install Detox Instruments?\");\n\t\t\n\t\treturn;\n\t}\n\t\n\tif(_recorderInstance != nil)\n\t{\n\t\tdtx_log_error(@\"Another recording is already in progress: %@\", [[_recorderInstance profilingConfiguration] recordingFileURL]);\n\t\t\n\t\treturn;\n\t}\n\t\n\t_recorderInstance = [__DTXProfiler new];\n\t\n\tid config = [self _configurationWithDictionaryConfiguration:configDict];\n\tdtx_log_info(@\"Continuing recording at %@\", [config recordingFileURL]);\n\t[_recorderInstance continueProfilingWithConfiguration:config];\n}\n\n- (void)stopRecordingWithCompletionHandler:(void(^)(NSError* error))completionHandler\n{\n\tdtx_defer {\n\t\t_recorderInstance = nil;\n\t};\n\t\n\tif(_recorderInstance == nil || [_recorderInstance isRecording] == NO)\n\t{\n\t\tdtx_log_info(@\"Called stop but no recording in progress\");\n\t\t\n\t\tif(completionHandler != nil)\n\t\t{\n\t\t\tcompletionHandler(nil);\n\t\t}\n\t\t\n\t\treturn;\n\t}\n\t\n\t[_recorderInstance stopProfilingWithCompletionHandler:^(NSError * _Nullable error) {\n\t\tif(error)\n\t\t{\n\t\t\tdtx_log_error(@\"Stopped recording with error: %@\", error);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdtx_log_info(@\"Stopped recording at %@\", [[_recorderInstance profilingConfiguration] recordingFileURL]);\n\t\t}\n\t\t\n\t\tif(completionHandler != nil)\n\t\t{\n\t\t\tcompletionHandler(error);\n\t\t}\n\t}];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxUserActivityDispatcher.swift",
    "content": "//\n//  DetoxUserActivityDispatcher.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 3/15/18.\n//  Copyright © 2018 Wix. All rights reserved.\n//\n\nimport UIKit\n\nprivate struct DetoxUserActivityKeys {\n\tstatic let activityType = \"activityType\"\n\tstatic let userInfo = \"userInfo\"\n\tstatic let webpageURL = \"webpageURL\"\n\tstatic let referrerURL = \"referrerURL\"\n}\n\n@objc(DTXUserActivityDispatcher)\npublic class DetoxUserActivityDispatcher: NSObject {\n\t@objc let userActivityData : [String: Any]\n\t\n\t@objc(initWithUserActivityDataURL:)\n\tpublic init(userActivityDataUrl: URL) {\n\t\tuserActivityData = DetoxUserActivityDispatcher.parseUserActivityData(url: userActivityDataUrl)\n\t\t\n\t\tsuper.init()\n\t}\n\t\n\tprivate class func parseUserActivityData(url: URL) -> [String: Any] {\n\t\tguard let data = try? Data.init(contentsOf: url) else {\n\t\t\tSwift.fatalError(\"Unable to read user activity data file.\")\n\t\t}\n\t\t\n\t\tguard let jsonObject = try? (JSONSerialization.jsonObject(with: data, options: .init(rawValue: 0)) as! [String: Any]) else {\n\t\t\tSwift.fatalError(\"Unable to parse user activity data file.\")\n\t\t}\n\t\t\n\t\treturn jsonObject\n\t}\n\t\n\t@objc public private(set) lazy var userActivity: NSUserActivity = {\n\t\tguard let activityType = self.userActivityData[DetoxUserActivityKeys.activityType] as? String, activityType.count > 0 else {\n\t\t\tSwift.fatalError(\"Missing or invalid activity type\")\n\t\t}\n\t\t\n\t\tlet rv = NSUserActivity(activityType: activityType)\n\t\t\n\t\tself.userActivityData.forEach {\n\t\t\tguard $0 != \"activityType\" else {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n\t\t\tvar value : Any = $1\n\t\t\tif $0 == \"referrerURL\" || $0 == \"webpageURL\" {\n\t\t\t\tvalue = URL(string: $1 as! String)!\n\t\t\t}\n\t\t\t\n\t\t\trv.setValue(value, forKey: $0)\n\t\t}\n\t\t\n\t\treturn rv\n\t}()\n\t\n\t@objc(dispatchOnAppDelegate:)\n\tpublic func dispatch(on appDelegate: UIApplicationDelegate) {\n\t\tlet userActivity = self.userActivity\n\t\t\n\t\t_ = appDelegate.application?(UIApplication.shared, willContinueUserActivityWithType: userActivity.activityType)\n\t\t_ = appDelegate.application?(UIApplication.shared, continue: userActivity) { objects in }\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/DetoxUserNotificationDispatcher.swift",
    "content": "//\n//  DetoxUserNotificationDispatcher.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 22/01/2017.\n//  Copyright © 2017 Wix. All rights reserved.\n//\n\nimport UIKit\nimport UserNotifications\nimport Detox.Private\nimport CoreLocation\n\nprivate struct DetoxUserNotificationKeys {\n\tstruct TriggerTypes {\n\t\tstatic let push = \"push\"\n\t\tstatic let calendar = \"calendar\"\n\t\tstatic let location = \"location\"\n\t\tstatic let timeInterval = \"timeInterval\"\n\t}\n\t\n\tstatic let trigger = \"trigger\"\n\tstatic let type = \"type\"\n\tstatic let absoluteTriggerType = \"__triggerType\"\n\tstatic let payload = \"payload\"\n\tstatic let aps = \"aps\"\n\tstatic let alert = \"alert\"\n\tstatic let title = \"title\"\n\tstatic let subtitle = \"subtitle\"\n\tstatic let body = \"body\"\n\tstatic let badge = \"badge\"\n\tstatic let category = \"category\"\n\tstatic let userText = \"user-text\"\n\tstatic let contentAvailable = \"content-available\"\n\tstatic let actionIdentifier = \"action-identifier\"\n\tstatic let dateComponents = \"date-components\"\n\tstatic let repeats = \"repeats\"\n\tstatic let region = \"region\"\n\tstatic let identifier = \"identifier\"\n\tstatic let center = \"center\"\n\tstatic let latitude = \"latitude\"\n\tstatic let longitude = \"longitude\"\n\tstatic let radius = \"radius\"\n\tstatic let notifyOnEntry = \"notifyOnEntry\"\n\tstatic let notifyOnExit = \"notifyOnExit\"\n\tstatic let timeInterval = \"timeInterval\"\n}\n\n@objc(DTXUserNotificationDispatcher)\npublic class DetoxUserNotificationDispatcher: NSObject {\n\t@objc let userNotificationData : [String: Any]\n\tprivate let appStateAtCreation : UIApplication.State\n\t\n\t@objc(initWithUserNotificationDataURL:)\n\tpublic init(userNotificationDataUrl: URL) {\n\t\tuserNotificationData = DetoxUserNotificationDispatcher.parseUserNotificationData(url: userNotificationDataUrl)\n\t\tappStateAtCreation = UIApplication.shared.applicationState\n\t\t\n\t\tsuper.init()\n\t}\n\t\n\t@objc(dispatchOnAppDelegate:simulateDuringLaunch:)\n\tpublic func dispatch(on appDelegate: UIApplicationDelegate, simulateDuringLaunch: Bool) {\n\t\tguard let userNotificationsDelegate = UNUserNotificationCenter.current().delegate, let actualDelegateMethod = userNotificationsDelegate.userNotificationCenter(_:didReceive:withCompletionHandler:) else {\n\t\t\treturn\n\t\t}\n\t\tlet notification = userNotification()\n\t\t\n\t\tlet handler : (UNNotificationPresentationOptions) -> Void = { (options) in\n\t\t\tguard options.contains(.alert) else {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n\t\t\tactualDelegateMethod(UNUserNotificationCenter.current(), self.userNotificationResponse(notification: notification), {})\n\t\t}\n\t\t\n\t\tlet isAppActive = simulateDuringLaunch == false && appStateAtCreation == .active\n\t\t\n\t\tif isAppActive == true, let actualWillPresentDelegateMethod = userNotificationsDelegate.userNotificationCenter(_:willPresent:withCompletionHandler:) {\n\t\t\tactualWillPresentDelegateMethod(UNUserNotificationCenter.current(), notification, handler)\n\t\t} else {\n\t\t\thandler(isAppActive == false ? [ .alert ] : [])\n\t\t}\n\t}\n\t\n\tprivate static let supportedTriggerTypes = [DetoxUserNotificationKeys.TriggerTypes.push, DetoxUserNotificationKeys.TriggerTypes.calendar, DetoxUserNotificationKeys.TriggerTypes.location, DetoxUserNotificationKeys.TriggerTypes.timeInterval]\n\n\tprivate class func parseUserNotificationData(url: URL) -> [String: Any] {\n\t\t\n\t\tguard let data = try? Data.init(contentsOf: url) else {\n\t\t\tSwift.fatalError(\"Unable to read user notification data file.\")\n\t\t}\n\t\t\n\t\tguard var jsonObject = try? (JSONSerialization.jsonObject(with: data, options: .init(rawValue: 0)) as! [String: Any]) else {\n\t\t\tSwift.fatalError(\"Unable to parse user notification data file.\")\n\t\t}\n\t\t\n\t\tguard let trigger = jsonObject[DetoxUserNotificationKeys.trigger] as? [String: AnyObject], let triggerType = trigger[DetoxUserNotificationKeys.type] as? String, supportedTriggerTypes.contains(triggerType) else {\n\t\t\tSwift.fatalError(\"Missing trigger or invalid trigger type. A 'trigger' key must exist, with one of the following types: '\\(supportedTriggerTypes.joined(separator: \"', '\"))'\")\n\t\t}\n\t\t\n\t\tjsonObject[DetoxUserNotificationKeys.absoluteTriggerType] = triggerType\n\t\t\n\t\treturn jsonObject\n\t}\n\t\n\t@objc public private(set) lazy var remoteNotificationDictionary : [String: Any]? = {\n\t\t[unowned self] in\n\t\tguard self.userNotificationData[DetoxUserNotificationKeys.absoluteTriggerType] as! String == DetoxUserNotificationKeys.TriggerTypes.push else {\n\t\t\treturn nil;\n\t\t}\n\t\t\n\t\treturn self.payload\n\t}()\n\t\n\tprivate lazy var userPayload : [String: Any] = {\n\t\treturn self.userNotificationData[DetoxUserNotificationKeys.payload] as? [String: Any] ?? [:]\n\t}()\n\t\n\tprivate lazy var payload : [String: Any] = {\n\t\t[unowned self] in\n\t\tvar rv : [String: Any] = self.userPayload\n\t\tvar aps = rv[DetoxUserNotificationKeys.aps] as? [String: Any] ?? [:]\n\t\tvar alert = aps[DetoxUserNotificationKeys.alert] as? [String: Any] ?? [:]\n\t\t\n\t\talert[DetoxUserNotificationKeys.title] = self.userNotificationData[DetoxUserNotificationKeys.title]\n\t\talert[DetoxUserNotificationKeys.subtitle] = self.userNotificationData[DetoxUserNotificationKeys.subtitle]\n\t\talert[DetoxUserNotificationKeys.body] = self.userNotificationData[DetoxUserNotificationKeys.body]\n\t\t\n\t\taps[DetoxUserNotificationKeys.alert] = alert\n\t\t\n\t\taps[DetoxUserNotificationKeys.badge] = self.userNotificationData[DetoxUserNotificationKeys.badge]\n\t\taps[DetoxUserNotificationKeys.category] = self.userNotificationData[DetoxUserNotificationKeys.category]\n\t\taps[DetoxUserNotificationKeys.contentAvailable] = self.userNotificationData[DetoxUserNotificationKeys.contentAvailable]\n\t\t\n\t\trv[DetoxUserNotificationKeys.aps] = aps\n\t\treturn rv\n\t\t\n\t}()\n\t\n\tprivate class func fatalError(forMissingKey key: @autoclosure () -> String, in context: @autoclosure () -> String) -> Never {\n\t\tSwift.fatalError(\"\\(context().uppercased()) requested but no \\(key()) found or in incorrect format.\")\n\t}\n\t\n\tprivate class func value<T>(for key: String, `in` data: [String: Any], ofType type: T.Type, context: String) -> T {\n\t\tguard let rv = data[key] as? T else {\n\t\t\tfatalError(forMissingKey: key, in: context)\n\t\t}\n\t\treturn rv\n\t}\n\t\n\tprivate class func dateComponents(from data: [String: Any]) -> DateComponents {\n\t\tlet rv = NSDateComponents()\n\t\t\n\t\tdata.forEach {\n\t\t\trv.setValue($1, forKey: $0)\n\t\t}\n\t\t\n\t\treturn rv as DateComponents\n\t}\n\t\n\tprivate class func coord(from data: [String: Any]) -> CLLocationCoordinate2D {\n\t\tvar coord = CLLocationCoordinate2D()\n\t\n\t\tcoord.latitude = value(for: DetoxUserNotificationKeys.latitude, in: data, ofType: CLLocationDegrees.self, context: \"coordinate\")\n\t\tcoord.longitude = value(for: DetoxUserNotificationKeys.longitude, in: data, ofType: CLLocationDegrees.self, context: \"coordinate\")\n\t\t\n\t\treturn coord\n\t}\n\t\n\tprivate class func region(from data: [String: Any]) -> CLRegion {\n\t\tlet centerData = value(for: DetoxUserNotificationKeys.center, in: data, ofType: [String: Any].self, context: \"region\")\n\t\tlet center = coord(from: centerData)\n\t\tlet radius = value(for: DetoxUserNotificationKeys.radius, in: data, ofType: CLLocationDistance.self, context: \"region\")\n\t\tlet identifier = value(for: DetoxUserNotificationKeys.identifier, in: data, ofType: String.self, context: \"region\")\n\t\t\n\t\tlet region = CLCircularRegion(center: center, radius: radius, identifier: identifier)\n\t\tregion.notifyOnEntry = data[DetoxUserNotificationKeys.notifyOnEntry] as? Bool ?? true\n\t\tregion.notifyOnExit = data[DetoxUserNotificationKeys.notifyOnExit] as? Bool ?? true\n\t\treturn region\n\t}\n\t\n\tpublic func userNotification() -> UNNotification {\n\t\tlet notificationContent = UNMutableNotificationContent()\n\t\tnotificationContent.badge = userNotificationData[DetoxUserNotificationKeys.badge] as? NSNumber\n\t\tnotificationContent.body = userNotificationData[DetoxUserNotificationKeys.body] as? String ?? \"\"\n\t\tnotificationContent.categoryIdentifier = userNotificationData[DetoxUserNotificationKeys.category] as? String ?? \"\"\n\t\tnotificationContent.subtitle = userNotificationData[DetoxUserNotificationKeys.subtitle] as? String ?? \"\"\n\t\tnotificationContent.title = userNotificationData[DetoxUserNotificationKeys.title] as? String ?? \"\"\n\t\t\n\t\tnotificationContent.userInfo = payload\n\t\t\n\t\tlet repeats = userNotificationData[DetoxUserNotificationKeys.repeats] as? Bool ?? false\n\t\t\n\t\tlet triggerData = userNotificationData[DetoxUserNotificationKeys.trigger] as! [String: Any]\n\t\t\n\t\tvar trigger : UNNotificationTrigger? = nil\n\t\tswitch userNotificationData[DetoxUserNotificationKeys.absoluteTriggerType] as! String {\n\t\tcase DetoxUserNotificationKeys.TriggerTypes.push:\n\t\t\tlet contentAvailable = userNotificationData[DetoxUserNotificationKeys.contentAvailable] as? Bool ?? false\n\t\t\ttrigger = UNPushNotificationTrigger(contentAvailable: contentAvailable, mutableContent: false)\n\t\t\tbreak\n\t\tcase DetoxUserNotificationKeys.TriggerTypes.calendar:\n\t\t\tlet dateComponentsData = DetoxUserNotificationDispatcher.value(for: DetoxUserNotificationKeys.dateComponents, in: triggerData, ofType: [String: Any].self, context: \"calendar trigger\")\n\t\t\tlet dc = DetoxUserNotificationDispatcher.dateComponents(from: dateComponentsData)\n\t\t\ttrigger = UNCalendarNotificationTrigger(dateMatching: dc, repeats: repeats)\n\t\t\tbreak\n\t\tcase DetoxUserNotificationKeys.TriggerTypes.location:\n\t\t\tlet regionData = DetoxUserNotificationDispatcher.value(for: DetoxUserNotificationKeys.region, in: triggerData, ofType: [String: Any].self, context: \"location trigger\")\n\t\t\tlet rgn = DetoxUserNotificationDispatcher.region(from: regionData)\n\t\t\ttrigger = UNLocationNotificationTrigger(region: rgn, repeats: repeats)\n\t\t\tbreak\n\t\tcase DetoxUserNotificationKeys.TriggerTypes.timeInterval:\n\t\t\tlet timeInterval = DetoxUserNotificationDispatcher.value(for: DetoxUserNotificationKeys.timeInterval, in: triggerData, ofType: Double.self, context: \"time interval trigger\")\n\t\t\ttrigger = UNTimeIntervalNotificationTrigger(timeInterval: timeInterval, repeats: repeats)\n\t\t\tbreak\n\t\tdefault: break\n\t\t}\n\t\t\n\t\tlet notificationRequest = UNNotificationRequest(identifier: NSUUID().uuidString, content: notificationContent, trigger: trigger)\n\t\t\n\t\treturn UNNotification(request: notificationRequest, date: Date())\n\t}\n\t\n\tpublic func userNotificationResponse(notification: UNNotification) -> UNNotificationResponse {\n\t\t\n\t\t\n\t\tlet notificationResponseType : UNNotificationResponse.Type\n\t\tlet userText = userNotificationData[DetoxUserNotificationKeys.userText] as? String\n\t\t\n\t\t\n\t\tif userText != nil {\n\t\t\tnotificationResponseType = UNTextInputNotificationResponse.self\n\t\t}\n\t\telse {\n\t\t\tnotificationResponseType = UNNotificationResponse.self\n\t\t}\n\t\t\n\t\tlet rv = notificationResponseType.init(notification: notification, actionIdentifier: self.userNotificationData[DetoxUserNotificationKeys.actionIdentifier] as? String ?? UNNotificationDefaultActionIdentifier)!\n\n\t\tif userText != nil {\n\t\t\trv.setValue(userText, forKey: \"userText\")\n\t\t}\n\t\t\n\t\treturn rv\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ExternalLogging.h",
    "content": "//\n//  ExternalLogging.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 11/7/18.\n//  Copyright © 2018 Wix. All rights reserved.\n//\n\n#ifndef ExternalLogging_h\n#define ExternalLogging_h\n\n#include <stdio.h>\n\n#endif /* ExternalLogging_h */\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ExternalLogging.m",
    "content": "//\n//  ExternalLogging.c\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 11/7/18.\n//  Copyright © 2018 Wix. All rights reserved.\n//\n\n#include \"ExternalLogging.h\"\n#include \"DTXLogging.h\"\n\nDTX_CREATE_LOG(External)\n\nvoid __dtx_send_external_log(const char* log)\n{\n\tdtx_log_info(@\"%s\", log);\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSException+DetoxUtils.swift",
    "content": "//\n//  NSException+DetoxUtils.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/31/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nimport Foundation\n\n@objc\nextension NSException {\n\t@objc(dtx_demangledCallStackSymbols)\n\topen var demangledCallStackSymbols : String {\n\t\treturn Thread.demangledCallStackSymbols(forReturnAddresses: callStackReturnAddresses, startIndex: 0)\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSObject+DetoxUtils.h",
    "content": "//\n//  NSObject+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan on 11/12/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\nBOOL __DTXDoulbeEqualToDouble(double a, double b);\nBOOL __DTXPointEqualToPoint(CGPoint a, CGPoint b);\n\ninline __attribute__((__always_inline__))\nstatic double LNLinearInterpolate(CGFloat from, CGFloat to, CGFloat p)\n{\n\treturn from + p * (to - from);\n}\n\n@interface NSObject (DetoxUtils)\n\n@property (nonatomic, readonly, strong) NSString* accessibilityIdentifier;\n@property (nonatomic, readonly, nullable) id accessibilityContainer;\n\n@property (nonatomic, readonly) UIView* dtx_view;\n@property (nonatomic, readonly, nullable) UISlider* dtx_sliderView;\n@property (nonatomic, readonly, nullable) UISwitch* dtx_switchView;\n\n- (CGPoint)dtx_convertRelativePointToViewCoordinateSpace:(CGPoint)relativePoint;\n\n@property (nonatomic, readonly) CGRect dtx_bounds;\n@property (nonatomic, readonly) CGRect dtx_contentBounds;\n@property (nonatomic, readonly) CGRect dtx_visibleBounds;\n\n- (void)dtx_ifHasSlider:(void(^)(UISlider *slider))block;\n- (void)dtx_ifHasScrollView:(void(^)(UIScrollView *scrollView))block;\n- (void)dtx_ifDatePicker:(void(^)(UIDatePicker *picker))block;\n- (void)dtx_ifPicker:(void(^)(UIPickerView *picker))block;\n\n- (BOOL)dtx_isVisible;\n- (void)dtx_assertVisibleWithPercent:(nullable NSNumber *)percent;\n- (BOOL)dtx_isVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent\n\t\t\t\t\t  error:(NSError* __strong __nullable * __nullable)error;\n- (void)dtx_assertVisible;\n- (void)dtx_assertVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent;\n\n- (BOOL)dtx_isFocused;\n\n@property (nonatomic, readonly) BOOL dtx_isHittable;\n- (BOOL)dtx_isHittableAtPoint:(CGPoint)viewPoint\n\t\t\t\t\t\terror:(NSError* __strong __nullable * __nullable)error;\n- (void)dtx_assertHittable;\n- (void)dtx_assertHittableAtPoint:(CGPoint)point;\n\n@property (nonatomic, copy, readonly) NSString* dtx_text;\n@property (nonatomic, copy, readonly) NSString* dtx_placeholder;\n\n@property (nonatomic, readonly) BOOL dtx_isEnabled;\n- (void)dtx_assertEnabled;\n\n@property (nonatomic, readonly, copy) NSString* dtx_shortDescription;\n@property (nonatomic, readonly) CGRect dtx_accessibilityFrame;\n@property (nonatomic, readonly) CGRect dtx_safeAreaBounds;\n@property (nonatomic, readonly) CGPoint dtx_accessibilityActivationPoint;\n@property (nonatomic, readonly) CGPoint dtx_accessibilityActivationPointInViewCoordinateSpace;\n\n@property (nonatomic, readonly, class, copy) NSDictionary<NSString*, id>* dtx_genericElementDebugAttributes;\n@property (nonatomic, readonly, copy) NSDictionary<NSString*, id>* dtx_attributes;\n@property (nonatomic, readonly, copy) NSDictionary<NSString*, id>* dtx_elementDebugAttributes;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSObject+DetoxUtils.m",
    "content": "//\n//  NSObject+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan on 11/12/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n@import UIKit;\n#import \"DetoxPolicy.h\"\n#import \"DTXAppleInternals.h\"\n#import \"NSObject+DetoxUtils.h\"\n#import \"NSObject+DontCrash.h\"\n#import \"UISlider+DetoxUtils.h\"\n#import \"UIWindow+DetoxUtils.h\"\n\nDTX_ALWAYS_INLINE\nstatic id DTXJSONSafeNSNumberOrString(double d)\n{\n    return isnan(d) ? @\"NaN\" : @(d);\n}\n\nDTX_ALWAYS_INLINE\nstatic NSDictionary* DTXInsetsToDictionary(UIEdgeInsets insets)\n{\n    return @{@\"top\": DTXJSONSafeNSNumberOrString(insets.top), @\"bottom\": DTXJSONSafeNSNumberOrString(insets.bottom), @\"left\": DTXJSONSafeNSNumberOrString(insets.left), @\"right\": DTXJSONSafeNSNumberOrString(insets.right)};\n}\n\nDTX_ALWAYS_INLINE\nstatic NSDictionary* DTXRectToDictionary(CGRect rect)\n{\n    return @{@\"x\": DTXJSONSafeNSNumberOrString(rect.origin.x), @\"y\": DTXJSONSafeNSNumberOrString(rect.origin.y), @\"width\": DTXJSONSafeNSNumberOrString(rect.size.width), @\"height\": DTXJSONSafeNSNumberOrString(rect.size.height)};\n}\n\nDTX_ALWAYS_INLINE\nstatic NSDictionary* DTXPointToDictionary(CGPoint point)\n{\n    return @{@\"x\": DTXJSONSafeNSNumberOrString(point.x), @\"y\": DTXJSONSafeNSNumberOrString(point.y)};\n}\n\nDTX_ALWAYS_INLINE\nstatic NSString* DTXPointToString(CGPoint point)\n{\n    return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:DTXPointToDictionary(point) options:0 error:nil] encoding:NSUTF8StringEncoding];\n}\n\n@interface NSObject ()\n\n@property (readonly) id<UICoordinateSpace> coordinateSpace;\n\n@end\n\nBOOL __DTXDoulbeEqualToDouble(double a, double b)\n{\n    double difference = fabs(a * .00001);\n    return fabs(a - b) <= difference;\n}\n\nBOOL __DTXPointEqualToPoint(CGPoint a, CGPoint b)\n{\n    return __DTXDoulbeEqualToDouble(floor(a.x), floor(b.x)) && __DTXDoulbeEqualToDouble(floor(a.y), floor(b.y));\n}\n\n@implementation NSObject (DetoxUtils)\n\n@dynamic accessibilityIdentifier;\n@dynamic accessibilityContainer;\n\n- (CGPoint)dtx_convertRelativePointToViewCoordinateSpace:(CGPoint)relativePoint\n{\n    if([self isKindOfClass:UIView.class])\n    {\n        return relativePoint;\n    }\n\n    CGPoint screenPoint = CGPointMake(self.accessibilityFrame.origin.x + relativePoint.x, self.accessibilityFrame.origin.y + relativePoint.y);\n    return [self.dtx_view.window.screen.coordinateSpace convertPoint:screenPoint toCoordinateSpace:self.dtx_view.coordinateSpace];\n}\n\n- (UIView*)dtx_view\n{\n    if([self isKindOfClass:UIView.class])\n    {\n        return (id)self;\n    }\n\n    return self.dtx_viewContainer;\n}\n\n- (UISlider *)dtx_sliderView {\n    if([self isKindOfClass:UISlider.class])\n    {\n        return (id)self;\n    }\n\n    Ivar ivar = class_getInstanceVariable([self class], \"slider\");\n\n    if (ivar == NULL) {\n        return nil;\n    }\n\n    return object_getIvar(self, ivar);\n}\n\n- (UISlider *)dtx_scrollView {\n    if([self isKindOfClass:UIScrollView.class])\n    {\n        return (UISlider *)self;\n    }\n\n    Ivar ivar = class_getInstanceVariable([self class], \"_scrollView\");\n\n    if (ivar == NULL) {\n        return nil;\n    }\n\n    return (UISlider *)object_getIvar(self, ivar);\n}\n\n- (UIDatePicker *)dtx_datePicker {\n    if([self isKindOfClass:UIDatePicker.class])\n    {\n        return (UIDatePicker *)self;\n    }\n\n    Ivar ivar = class_getInstanceVariable([self class], \"_picker\");\n    if (ivar) {\n        return (UIDatePicker *)object_getIvar(self, ivar);\n    }\n\n    return nil;\n}\n\n- (UIDatePicker *)dtx_picker {\n    if([self isKindOfClass:UIPickerView.class])\n    {\n        return (UIDatePicker *)self;\n    }\n\n    Ivar ivar = class_getInstanceVariable([self class], \"picker\");\n    if (ivar) {\n        return (UIDatePicker *)object_getIvar(self, ivar);\n    }\n\n    return nil;\n}\n\n- (UISwitch *)dtx_switchView {\n    if([self isKindOfClass:UISwitch.class])\n    {\n        return (UISwitch *)self;\n    }\n\n    Ivar ivar = class_getInstanceVariable([self class], \"_switchView\");\n\n    if (ivar == NULL) {\n        return nil;\n    }\n\n    return (UISwitch *)object_getIvar(self, ivar);\n}\n\n- (UIView*)dtx_viewContainer\n{\n    if([self isKindOfClass:UIView.class])\n    {\n        return self.dtx_container;\n    }\n    else if([self respondsToSelector:@selector(accessibilityContainer)])\n    {\n        return [self.dtx_container dtx_view];\n    }\n\n    return nil;\n}\n\n- (id)dtx_container\n{\n    if ([self isKindOfClass:UIView.class])\n    {\n        return [(UIView *)self superview];\n    }\n    else if ([self respondsToSelector:@selector(accessibilityContainer)])\n    {\n        return [(UIAccessibilityElement*)self accessibilityContainer];\n    }\n\n    return nil;\n}\n\n- (CGRect)dtx_bounds\n{\n    if([self isKindOfClass:UIView.class])\n    {\n        return [(UIView*)self bounds];\n    }\n\n    UIView* view = self.dtx_view;\n    return [view.window.screen.coordinateSpace convertRect:self.accessibilityFrame toCoordinateSpace:view.coordinateSpace];\n}\n\n- (CGRect)dtx_contentBounds\n{\n    return self.dtx_bounds;\n}\n\n- (CGRect)dtx_visibleBounds\n{\n    return self.dtx_bounds;\n}\n\n- (BOOL)dtx_isVisible {\n    return [self dtx_isVisibleAtRect:self.dtx_bounds percent:nil error:nil];\n}\n\n- (BOOL)dtx_isVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent\n                      error:(NSError* __strong __nullable * __nullable)error {\n    return [self.dtx_view dtx_isVisibleAtRect:rect percent:percent error:error];\n}\n\n- (void)dtx_assertVisible {\n    [self dtx_assertVisibleWithPercent:nil];\n}\n\n- (void)dtx_assertVisibleWithPercent:(nullable NSNumber *)percent {\n    [self dtx_assertVisibleAtRect:self.dtx_bounds percent:percent];\n}\n\n- (void)dtx_assertVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent {\n    [self.dtx_view dtx_assertVisibleAtRect:rect percent:percent];\n}\n\n- (BOOL)dtx_isFocused\n{\n    BOOL isFocused = [self.dtx_view isFocused];\n    BOOL isFirstResponder = [self.dtx_view isFirstResponder];\n    return isFocused || isFirstResponder;\n}\n\n- (BOOL)dtx_isHittable\n{\n    return YES;\n}\n\n- (BOOL)dtx_isHittableAtPoint:(CGPoint)viewPoint\n                        error:(NSError* __strong __nullable * __nullable)error {\n    return YES;\n}\n\n- (void)dtx_assertHittable {}\n\n- (void)dtx_assertHittableAtPoint:(CGPoint)point {}\n\n- (NSString *)dtx_text\n{\n    id rv = [self _dtx_text];\n    if(rv == nil || [rv isKindOfClass:NSString.class])\n    {\n        return rv;\n    }\n\n    if([rv isKindOfClass:NSAttributedString.class])\n    {\n        return [(NSAttributedString*)rv string];\n    }\n\n    //Unsupported\n    return nil;\n}\n\n- (NSString *)dtx_placeholder\n{\n    id rv = [self _dtx_placeholder];\n    if(rv == nil || [rv isKindOfClass:NSString.class])\n    {\n        return rv;\n    }\n\n    if([rv isKindOfClass:NSAttributedString.class])\n    {\n        return [(NSAttributedString*)rv string];\n    }\n\n    //Unsupported\n    return nil;\n}\n\n- (BOOL)dtx_isEnabled\n{\n    return self.dtx_view.dtx_isEnabled;\n}\n\n- (void)dtx_assertEnabled\n{\n    return [self.dtx_view dtx_assertEnabled];\n}\n\n- (NSString *)dtx_shortDescription\n{\n    return self.description;\n}\n\n- (CGRect)dtx_accessibilityFrame\n{\n    return self.accessibilityFrame;\n}\n\n- (CGRect)dtx_safeAreaBounds\n{\n    return self.dtx_bounds;\n}\n\n- (CGPoint)dtx_accessibilityActivationPoint\n{\n    return self.accessibilityActivationPoint;\n}\n\n- (CGPoint)dtx_accessibilityActivationPointInViewCoordinateSpace\n{\n    UIView* view = self.dtx_view;\n    return [view.window.screen.coordinateSpace convertPoint:self.accessibilityActivationPoint toCoordinateSpace:view.coordinateSpace];\n}\n\n- (NSDictionary<NSString *,id> *)dtx_attributes\n{\n    NSMutableDictionary* rv = [NSMutableDictionary new];\n\n    rv[@\"className\"] = NSStringFromClass(self.class);\n\n    NSDictionary* results = [self dictionaryWithValuesForKeys:@[@\"dtx_text\", @\"accessibilityLabel\", @\"accessibilityIdentifier\", @\"accessibilityValue\", @\"dtx_placeholder\"]];\n    [results enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {\n        if([obj isKindOfClass:NSNull.class])\n        {\n            return;\n        }\n\n        if([key isEqualToString:@\"dtx_text\"])\n        {\n            rv[@\"text\"] = obj;\n        }\n        else if([key isEqualToString:@\"dtx_placeholder\"])\n        {\n            rv[@\"placeholder\"] = obj;\n        }\n        else if([key isEqualToString:@\"accessibilityLabel\"])\n        {\n            rv[@\"label\"] = obj;\n        }\n        else if([key isEqualToString:@\"accessibilityValue\"])\n        {\n            rv[@\"value\"] = obj;\n        }\n        else if([key isEqualToString:@\"accessibilityIdentifier\"])\n        {\n            rv[@\"identifier\"] = obj;\n        }\n        else\n        {\n            rv[key] = obj;\n        }\n    }];\n\n    rv[@\"enabled\"] = @(self.dtx_isEnabled);\n\n    rv[@\"frame\"] = DTXRectToDictionary(self.dtx_accessibilityFrame);\n    rv[@\"elementSafeBounds\"] = DTXRectToDictionary(self.dtx_safeAreaBounds);\n\n    if([self isKindOfClass:UIView.class])\n    {\n        UIView* view = (id)self;\n        rv[@\"elementFrame\"] = DTXRectToDictionary(view.frame);\n        rv[@\"elementBounds\"] = DTXRectToDictionary(view.bounds);\n        rv[@\"safeAreaInsets\"] = DTXInsetsToDictionary(view.safeAreaInsets);\n        rv[@\"layer\"] = view.layer.description;\n    }\n    else\n    {\n        rv[@\"isAccessibilityElement\"] = @(self.isAccessibilityElement);\n    }\n\n    CGPoint accessibilityActivationPoint = self.dtx_accessibilityActivationPoint;\n    CGPoint accessibilityActivationPointInViewCoordinateSpace = self.dtx_accessibilityActivationPointInViewCoordinateSpace;\n    rv[@\"activationPoint\"] = DTXPointToDictionary(accessibilityActivationPointInViewCoordinateSpace);\n    CGRect accessibilityFrame = self.dtx_accessibilityFrame;\n    rv[@\"normalizedActivationPoint\"] = DTXPointToDictionary(CGPointMake(CGRectGetWidth(accessibilityFrame) == 0 ? 0 : (accessibilityActivationPoint.x - CGRectGetMinX(accessibilityFrame)) / CGRectGetWidth(accessibilityFrame), CGRectGetHeight(accessibilityFrame) == 0 ? 0 : (accessibilityActivationPoint.y - CGRectGetMinY(accessibilityFrame)) / CGRectGetHeight(accessibilityFrame)));\n\n    rv[@\"hittable\"] = @(self.dtx_isHittable);\n    rv[@\"visible\"] = @(self.dtx_isVisible);\n\n    [self dtx_ifHasScrollView:^(UIScrollView *scrollView) {\n        rv[@\"contentInset\"] = DTXInsetsToDictionary([scrollView contentInset]);\n        rv[@\"adjustedContentInset\"] = DTXInsetsToDictionary([scrollView adjustedContentInset]);\n        rv[@\"contentOffset\"] = DTXPointToDictionary([scrollView contentOffset]);\n    }];\n\n    [self dtx_ifHasSlider:^(UISlider *slider) {\n        rv[@\"normalizedSliderPosition\"] = @([slider dtx_normalizedSliderPosition]);\n        rv[@\"value\"] = [slider accessibilityValue];\n    }];\n\n    [self dtx_ifDatePicker:^(UIDatePicker *dp) {\n        rv[@\"date\"] = [NSISO8601DateFormatter stringFromDate:dp.date timeZone:dp.timeZone ?: NSTimeZone.systemTimeZone formatOptions:NSISO8601DateFormatWithInternetDateTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone];\n        NSDateComponents* dc = [dp.calendar componentsInTimeZone:dp.timeZone ?: NSTimeZone.systemTimeZone fromDate:dp.date];\n\n        NSMutableDictionary* dateComponents = [NSMutableDictionary new];\n        dateComponents[@\"era\"] = @(dc.era);\n        dateComponents[@\"year\"] = @(dc.year);\n        dateComponents[@\"month\"] = @(dc.month);\n        dateComponents[@\"day\"] = @(dc.day);\n        dateComponents[@\"hour\"] = @(dc.hour);\n        dateComponents[@\"minute\"] = @(dc.minute);\n        dateComponents[@\"second\"] = @(dc.second);\n        dateComponents[@\"weekday\"] = @(dc.weekday);\n        dateComponents[@\"weekdayOrdinal\"] = @(dc.weekdayOrdinal);\n        dateComponents[@\"quarter\"] = @(dc.quarter);\n        dateComponents[@\"weekOfMonth\"] = @(dc.weekOfMonth);\n        dateComponents[@\"weekOfYear\"] = @(dc.weekOfYear);\n        dateComponents[@\"leapMonth\"] = @(dc.leapMonth);\n\n        rv[@\"dateComponents\"] = dateComponents;\n    }];\n\n    return rv;\n}\n\n- (void)dtx_ifHasSlider:(void(^)(UISlider *slider))block {\n    if (!self.dtx_sliderView) { return; }\n\n    if (block) {\n        block((UISlider *)self.dtx_sliderView);\n    }\n}\n\n- (void)dtx_ifHasScrollView:(void(^)(UIScrollView *scrollView))block {\n    if (!self.dtx_scrollView) { return; }\n\n    if (block) {\n        block((UIScrollView *)self.dtx_scrollView);\n    }\n}\n\n- (void)dtx_ifDatePicker:(void(^)(UIDatePicker *picker))block {\n    if (!self.dtx_datePicker) { return; }\n\n    if (block) {\n        block((UIDatePicker *)self.dtx_datePicker);\n    }\n}\n\n- (void)dtx_ifPicker:(void(^)(UIPickerView *picker))block {\n    if (!self.dtx_picker) { return; }\n\n    if (block) {\n        block((UIPickerView *)self.dtx_picker);\n    }\n}\n\n+ (NSDictionary<NSString*, id> *)dtx_genericElementDebugAttributes\n{\n    NSMutableDictionary* rv = [NSMutableDictionary new];\n\n    rv[@\"viewHierarchy\"] = [[UIWindow dtx_keyWindowScene] dtx_recursiveDescription];\n\n    NSMutableArray* windowDescriptions = [NSMutableArray new];\n\n    UIWindowScene* scene = UIWindow.dtx_keyWindow.windowScene;\n    auto windows = [UIWindow dtx_allWindowsForScene:scene];\n    [windows enumerateObjectsUsingBlock:^(UIWindow * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n        [windowDescriptions addObject:[obj dtx_shortDescription]];\n    }];\n\n    rv[@\"windows\"] = windowDescriptions;\n\n    return rv;\n}\n\n- (NSDictionary<NSString *, id> *)dtx_elementDebugAttributes\n{\n    NSMutableDictionary<NSString *, id> *rv = [NSMutableDictionary new];\n    [rv addEntriesFromDictionary:NSObject.dtx_genericElementDebugAttributes];\n\n    rv[@\"elementAttributes\"] = [self dtx_attributes];\n    rv[@\"viewDescription\"] = self.description;\n\n    return rv;\n}\n\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSObject+DontCrash.h",
    "content": "//\n//  NSObject+DontCrash.h\n//  ExampleApp\n//\n//  Created by Leo Natan (Wix) on 4/16/20.\n//\n\n@import UIKit;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface NSObject (DontCrash)\n\n- (id)_dtx_text;\n- (id)_dtx_placeholder;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSObject+DontCrash.m",
    "content": "//\n//  NSObject+DontCrash.m\n//  ExampleApp\n//\n//  Created by Leo Natan (Wix) on 4/16/20.\n//\n\n#import \"NSObject+DontCrash.h\"\n\n@implementation NSObject (DontCrash)\n\n- (id)_dtx_text\n{\n    if([self respondsToSelector:@selector(text)])\n    {\n        return [(UITextView*)self text];\n    }\n\n    static Class RCTParagraphComponentViewClass;\n    static Class RCTTextClass;\n    static Class RCTTextViewClass;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        RCTParagraphComponentViewClass = NSClassFromString(@\"RCTParagraphComponentView\");\n        RCTTextClass = NSClassFromString(@\"RCTText\");\n        RCTTextViewClass = NSClassFromString(@\"RCTTextView\");\n    });\n\n    if(RCTParagraphComponentViewClass != nil && [self isKindOfClass:RCTParagraphComponentViewClass])\n    {\n        NSAttributedString *attributedText = [self valueForKey:@\"attributedText\"];\n        return [attributedText string];\n    }\n\n    if(RCTTextClass != nil && [self isKindOfClass:RCTTextClass])\n    {\n        return [(NSTextStorage*)[self valueForKey:@\"textStorage\"] string];\n    }\n\n    if(RCTTextViewClass != nil && [self isKindOfClass:RCTTextViewClass])\n    {\n        return [(NSTextStorage*)[self valueForKey:@\"textStorage\"] string];\n    }\n\n    return nil;\n}\n\n- (id)_dtx_placeholder\n{\n    if([self respondsToSelector:@selector(placeholder)])\n    {\n        return [(UITextField*)self placeholder];\n    }\n\n    return nil;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSThread+DetoxUtils.h",
    "content": "//\n//  NSThread+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 7/16/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface NSThread (DetoxUtils)\n\n@property (nonatomic, class, readonly, copy) NSString* dtx_demangledCallStackSymbols NS_SWIFT_NAME(demangledCallStackSymbols);\n\n+ (NSString*)dtx_demangledCallStackSymbolsForReturnAddresses:(NSArray<NSNumber*>*)returnAddresses startIndex:(NSInteger)startIndex NS_SWIFT_NAME(demangledCallStackSymbols(forReturnAddresses:startIndex:));\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSThread+DetoxUtils.m",
    "content": "//\n//  NSThread+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 7/16/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"NSThread+DetoxUtils.h\"\n#import \"DTXAddressInfo.h\"\n\n@implementation NSThread (DetoxUtils)\n\n+ (NSString*)dtx_demangledCallStackSymbols\n{\n\treturn [self dtx_demangledCallStackSymbolsForReturnAddresses:self.callStackReturnAddresses startIndex:1];\n}\n\n+ (NSString*)dtx_demangledCallStackSymbolsForReturnAddresses:(NSArray<NSNumber*>*)returnAddresses startIndex:(NSInteger)startIndex\n{\n\tNSArray* symbols = [returnAddresses dtx_mapObjectsUsingBlock:^id _Nonnull(NSNumber * _Nonnull obj, NSUInteger idx) {\n\t\treturn [[[DTXAddressInfo alloc] initWithAddress:obj.unsignedIntegerValue] formattedDescriptionForIndex:idx];\n\t}];\n\treturn [NSString stringWithFormat:@\"(\\n\\t%@\\n)\", [symbols componentsJoinedByString:@\"\\n\\t\"]];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSURL+DetoxUtils.h",
    "content": "//\n//  NSURL+DetoxUtils.h\n//  Detox\n//\n//  Created by Alon Haiut on 26/04/2021.\n//  Copyright © 2021 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface NSURL (DetoxUtils)\n\n+ (NSURL*)temporaryPath:(NSString *)subFolder;\n+ (NSURL*)visibilityFailingScreenshotsPath;\n+ (NSURL*)visibilityFailingRectsPath;\n+ (NSURL*)elementsScreenshotPath;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/NSURL+DetoxUtils.m",
    "content": "//\n//  NSURL+DetoxUtils.m\n//  Detox\n//\n//  Created by Alon Haiut on 26/04/2021.\n//  Copyright © 2021 Wix. All rights reserved.\n//\n\n#import \"NSURL+DetoxUtils.h\"\n\n@implementation NSURL (DetoxUtils)\n\n+ (NSURL *)temporaryPath:(NSString *)subFolder\n{\n\tstatic NSURL* temporaryURL;\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\ttemporaryURL = [NSURL URLWithString:NSTemporaryDirectory()];\n\t});\n\t\n\tNSURL* directoryPath = [temporaryURL URLByAppendingPathComponent:subFolder isDirectory:true];\n\tNSError * error = nil;\n\t[[NSFileManager defaultManager] createDirectoryAtPath:directoryPath.path\n\t\t\t\t\t\t\t  withIntermediateDirectories:YES\n\t\t\t\t\t\t\t\t\t\t\t   attributes:nil\n\t\t\t\t\t\t\t\t\t\t\t\t\terror:&error];\n\tif (error != nil) {\n\t\tNSLog(@\"Error creating %@ directory under tmp directory: %@\", subFolder, error);\n\t}\n\t\n\treturn directoryPath;\n}\n\n+ (NSURL *)visibilityFailingScreenshotsPath\n{\n\treturn [self temporaryPath:@\"visibilityFailingScreenshots\"];\n}\n\n+ (NSURL *)visibilityFailingRectsPath\n{\n\treturn [self temporaryPath:@\"visibilityFailingRects\"];\n}\n\n+ (NSURL *)elementsScreenshotPath\n{\n\treturn [self temporaryPath:@\"elementsScreenshot\"];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ReactNativeSupport/ReactNativeHeaders.h",
    "content": "//\n//  ReactNativeHeaders.h\n//  Detox\n//\n//  Created by Tal Kol on 8/15/16.\n//  Copyright © 2016 Wix. All rights reserved.\n//\n\n#ifndef ReactNativeHeaders_h\n#define ReactNativeHeaders_h\n\n#import <Foundation/Foundation.h>\n\n// we don't want detox to have a direct dependency on ReactNative\n\ntypedef void (^RN_RCTJavaScriptCallback)(id json, NSError *error);\n\n@protocol RN_RCTUIManager <NSObject>\n- (dispatch_queue_t)methodQueue;\n@end\n\n@protocol RN_RCTBridge <NSObject>\n+ (id<RN_RCTBridge>)currentBridge;\n- (void)requestReload;\n- (id<RN_RCTUIManager>) uiManager;\n- (id)moduleForName:(NSString *)moduleName;\n- (id)moduleForClass:(Class)moduleClass;\n@property (nonatomic, readonly, getter=isLoading) BOOL loading;\n@property (nonatomic, readonly, getter=isValid) BOOL valid;\n\n@end\n\n@protocol RN_RCTJavaScriptExecutor <NSObject>\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block;\n- (void)flushedQueue:(RN_RCTJavaScriptCallback)onComplete;\n@end\n\n#endif /* ReactNativeHeaders_h */\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ReactNativeSupport/ReactNativeSupport.h",
    "content": "//\n//  ReactNativeSupport.h\n//  Detox\n//\n//  Created by Tal Kol on 6/28/16.\n//  Copyright © 2016 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@interface ReactNativeSupport : NSObject\n\n@property (nonatomic, class, readonly) BOOL isReactNativeApp;\n\n+ (void)reloadApp;\n+ (void)waitForReactNativeLoadWithCompletionHandler:(void(^)(void))handler;\n\n@end\n\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ReactNativeSupport/ReactNativeSupport.m",
    "content": "//\n//  ReactNativeSupport.m\n//  Detox\n//\n//  Created by Tal Kol on 6/28/16.\n//  Copyright © 2016 Wix. All rights reserved.\n//\n\n#import \"ReactNativeSupport.h\"\n#import \"ReactNativeHeaders.h\"\n#import \"DetoxSwiftBridge.h\"\n\n#include <dlfcn.h>\n#include <stdatomic.h>\n@import ObjectiveC;\n@import Darwin;\n#import <DetoxSync/DTXReactNativeSupport.h>\n\nDTX_CREATE_LOG(ReactNativeSupport);\n\nstatic NSString *const RCTReloadNotification = @\"RCTReloadNotification\";\n\n@implementation ReactNativeSupport\n\n+ (BOOL)isReactNativeApp\n{\n\treturn [DTXReactNativeSupport hasReactNative];\n}\n\n\n+ (void)reloadApp\n{\n    // Early return if React Native is not present\n    if (![DTXReactNativeSupport hasReactNative]) {\n        return;\n    }\n\n    // Try legacy reload approach (without new arch)\n    id<RN_RCTBridge> bridge = [NSClassFromString(@\"RCTBridge\") valueForKey:@\"currentBridge\"];\n    if ([bridge respondsToSelector:@selector(requestReload)]) {\n        [bridge requestReload];\n        return;\n    }\n\n    // Try New Architecture reload approach\n    NSObject *reactHost = [self getReactHost];\n\n    SEL reloadCommand = NSSelectorFromString(@\"didReceiveReloadCommand\");\n    if (reactHost && [reactHost respondsToSelector:reloadCommand]) {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Warc-performSelector-leaks\"\n        [reactHost performSelector:reloadCommand];\n#pragma clang diagnostic pop\n        return;\n    }\n\n    // Fallback to legacy^2 reload approach\n    [[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification\n                                                        object:nil\n                                                      userInfo:nil];\n}\n\n+ (void)waitForReactNativeLoadWithCompletionHandler:(void (^)(void))handler\n{\n\t[DTXReactNativeSupport waitForReactNativeLoadWithCompletionHandler:handler];\n}\n\n+ (NSObject *) getReactHost {\n    NSObject<UIApplicationDelegate> *appDelegate = UIApplication.sharedApplication.delegate;\n    \n    NSObject *rootViewFactory = nil;\n    \n    @try {\n        rootViewFactory = [appDelegate valueForKey:@\"rootViewFactory\"];\n    } @catch (NSException *exception) {\n        @try {\n            NSObject *reactNativeFactory = [appDelegate valueForKey:@\"reactNativeFactory\"];\n            rootViewFactory = [reactNativeFactory valueForKey:@\"rootViewFactory\"];\n        } @catch (NSException *exception) {\n            rootViewFactory = [DetoxSwiftBridge getRootViewFactory];\n            if (rootViewFactory == nil) {\n                [NSException raise:@\"Invalid AppDelegate\" format:@\"Could not access rootViewFactory. Make sure your AppDelegate either: Inherits from RCTAppDelegate or defines 'reactNativeFactory'\" ];\n            }\n        }\n    }\n    \n    return [rootViewFactory valueForKey:@\"reactHost\"];\n}\n\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ReactNativeSupport.m",
    "content": "//\n//  ReactNativeSupport.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 7/15/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n@import ObjectiveC;\n\n@interface NSObject (DTXRNFix) @end\n@implementation NSObject (DTXRNFix)\n\n//Disable live reload for Detox\n- (void)__detox_sync__reloadWithDefaults:(NSDictionary *)defaultValues\n{\n\tNSMutableDictionary* dv = [defaultValues mutableCopy];\n\tdv[@\"hotLoadingEnabled\"] = @NO;\n\t\n\t[self __detox_sync__reloadWithDefaults:defaultValues];\n\t\n\tNSMutableDictionary* _settings = [self valueForKey:@\"_settings\"];\n\t_settings[@\"hotLoadingEnabled\"] = @NO;\n\t[NSUserDefaults.standardUserDefaults setObject:_settings forKey:@\"RCTDevMenu\"];\n}\n\n@end\n\n__attribute__((constructor))\nstatic void __setupRNSupport(void)\n{\n\tClass cls = NSClassFromString(@\"RCTDevSettingsUserDefaultsDataSource\");\n\tif(cls != nil)\n\t{\n\t\tDTXSwizzleMethod(cls, NSSelectorFromString(@\"_reloadWithDefaults:\"), @selector(__detox_sync__reloadWithDefaults:), NULL);\n\t}\n\t\n\tcls = NSClassFromString(@\"RCTPicker\");\n\tif(cls != nil)\n\t{\n\t\tSEL sel = @selector(initWithFrame:);\n\t\tMethod m = class_getInstanceMethod(cls, sel);\n\t\t\n\t\tif(m != NULL)\n\t\t{\n\t\t\tid (*orig)(id, SEL, CGRect) = (void*)method_getImplementation(m);\n\t\t\tmethod_setImplementation(m, imp_implementationWithBlock(^ (UIPickerView<UIPickerViewDataSource>* _self, CGRect frame) {\n\t\t\t\t_self = orig(_self, sel, frame);\n\t\t\t\t_self.dataSource = _self;\n\t\t\t\t\n\t\t\t\treturn _self;\n\t\t\t}));\n\t\t}\n\t}\n\n//\t//Disable broken RN Flopper until it is fixed:\n//\t//\thttps://github.com/facebook/flipper/issues/1674\n//\tcls = NSClassFromString(@\"FlipperClient\");\n//\tif(cls != nil)\n//\t{\n//\t\tSEL sel = NSSelectorFromString(@\"sharedClient\");\n//\t\tMethod m = class_getClassMethod(cls, sel);\n//\t\t\n//\t\tif(m != NULL)\n//\t\t{\n//\t\t\tmethod_setImplementation(m, imp_implementationWithBlock(^id(id _self) {\n//\t\t\t\treturn nil;\n//\t\t\t}));\n//\t\t}\n//\t}\n//\t\n//\tNSArray* flapperPlugins = @[@\"FlipperKitLayoutPlugin\", @\"FKUserDefaultsPlugin\", @\"FlipperKitReactPlugin\", @\"FlipperKitNetworkPlugin\", ];\n//\t[flapperPlugins enumerateObjectsUsingBlock:^(NSString*  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n//\t\tClass cls = objc_getMetaClass(obj.UTF8String);\n//\t\tif(cls != nil)\n//\t\t{\n//\t\t\tSEL sel = NSSelectorFromString(@\"alloc\");\n//\t\t\tclass_addMethod(cls, @selector(alloc), imp_implementationWithBlock(^id(id _self) {\n//\t\t\t\treturn nil;\n//\t\t\t}), \"@@:\");\n//\t\t}\n//\t}];\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/String+LocalizedError.swift",
    "content": "//\n//  String+LocalizedError.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 6/7/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#if hasFeature(RetroactiveAttribute)\nextension String: @retroactive Error {}\nextension String: @retroactive LocalizedError {\n    public var errorDescription: String? { return self }\n}\n#else\nextension String: LocalizedError {\n    public var errorDescription: String? { return self }\n}\n#endif\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/String+matchesJSRegex.swift",
    "content": "//\n//  String+matchesJSRegex.swift (Detox)\n//  Created by Asaf Korem (Wix.com) on 2022.\n//\nimport Foundation\n\nextension String {\n\t/// Returns whether the whole string matches the given `jsRegex`.\n\t/// JS flags has the format of `/<pattern>/<flags>`.\n\t/// Flags can be either:\n\t/// - i: With this flag the search is case-insensitive: no difference between A and a (see the example below).\n\t/// - s: Enables “dotall” mode, that allows a dot . to match newline character \\n (covered in the chapter Character classes).\n\t/// - m: Multiline mode (covered in the chapter Multiline mode of anchors ^ $, flag \"m\").\n\t/// Other flags (e.g. g,u,s) are not supported as they do not have equivalents in Swift.\n\t///\n\t/// - See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n\tpublic func matchesJSRegex(to jsRegex: String) -> Bool {\n\t\tlet flagsChars = flagsChars(from: jsRegex)\n\t\tlet pattern = pattern(from: jsRegex, flagsChars: flagsChars)\n\t\tlet options = regexOptions(from: flagsChars)\n\n\t\tlet regex = try! NSRegularExpression(pattern: pattern, options: options)\n\t\tlet searchRange = NSRange(location: 0, length: self.utf16.count)\n\t\tlet match = regex.firstMatch(\n\t\t\tin: self,\n\t\t\toptions: [],\n\t\t\trange: searchRange\n\t\t)\n\n\t\tguard let match = match else {\n\t\t\treturn false\n\t\t}\n\n\t\treturn searchRange == match.range\n\t}\n\n\tprivate func flagsChars(from jsRegex: String) -> [Character] {\n\t\tlet separated = jsRegex.components(separatedBy: \"/\")\n\n\t\tguard jsRegex.last != \"/\", let lastChars = separated.last else {\n\t\t\treturn []\n\t\t}\n\n\t\treturn Array(lastChars)\n\t}\n\n\tprivate func regexOptions(from flagsChars: [Character]) -> NSRegularExpression.Options {\n\t\treturn .init(rawValue: flagsChars.reduce(\n\t\t\t.zero,\n\t\t\t{ partialValue, flagChar in\n\t\t\t\tguard let option = regexOption(from: flagChar) else {\n\t\t\t\t\treturn partialValue\n\t\t\t\t}\n\n\t\t\t\treturn partialValue | option.rawValue\n\t\t\t}))\n\t}\n\n\tprivate func pattern(from jsRegex: String, flagsChars: [Character]) -> String {\n\t\treturn String(jsRegex.dropLast(flagsChars.count + 1).dropFirst(1))\n\t}\n\n\tprivate func regexOption(from flagChar: Character) -> NSRegularExpression.Options? {\n\t\tswitch(flagChar) {\n\t\t\tcase \"i\": return .caseInsensitive\n\t\t\tcase \"s\": return .dotMatchesLineSeparators\n            case \"m\": return .anchorsMatchLines\n\t\t\tdefault: return nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/SwiftSupport/DetoxSwiftBridge.h",
    "content": "//\n//  DetoxSwiftBridge.h\n//  Detox\n//\n//  Created by Mark de Vocht on 28/09/2025.\n//  Copyright © 2025 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface DetoxSwiftBridge : NSObject\n+ (nullable NSObject *)getRootViewFactory;\n+ (nullable NSObject *)getReactNativeFactory;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/SwiftSupport/DetoxSwiftBridge.m",
    "content": "//\n//  DetoxSwiftBridge.m\n//  Detox\n//\n//  Created by Mark de Vocht on 28/09/2025.\n//  Copyright © 2025 Wix. All rights reserved.\n//\n\n#import \"DetoxSwiftBridge.h\"\n@import UIKit;\n@import ObjectiveC;\n\nDTX_CREATE_LOG(SwiftBridge);\n\n@implementation DetoxSwiftBridge\n\n+ (nullable NSObject *)getRootViewFactory\n{\n    NSObject<UIApplicationDelegate> *appDelegate = UIApplication.sharedApplication.delegate;\n    if (!appDelegate) {\n        return nil;\n    }\n    \n    NSObject *rootViewFactory = [self getPropertyFromObject:appDelegate named:@\"rootViewFactory\"];\n    if (rootViewFactory) {\n        return rootViewFactory;\n    }\n    \n    NSObject *reactNativeFactory = [self getPropertyFromObject:appDelegate named:@\"reactNativeFactory\"];\n    if (reactNativeFactory) {\n        return [self getPropertyFromObject:reactNativeFactory named:@\"rootViewFactory\"];\n    }\n    \n    return nil;\n}\n\n+ (nullable NSObject *)getReactNativeFactory\n{\n    NSObject<UIApplicationDelegate> *appDelegate = UIApplication.sharedApplication.delegate;\n    if (!appDelegate) {\n        return nil;\n    }\n    \n    return [self getPropertyFromObject:appDelegate named:@\"reactNativeFactory\"];\n}\n\n+ (nullable NSObject *)getPropertyFromObject:(NSObject *)object named:(NSString *)propertyName\n{\n    if (!object || !propertyName) {\n        return nil;\n    }\n    \n    Class objectClass = [object class];\n    while (objectClass) {\n        unsigned int ivarCount;\n        Ivar *ivars = class_copyIvarList(objectClass, &ivarCount);\n        \n        for (unsigned int i = 0; i < ivarCount; i++) {\n            const char *ivarName = ivar_getName(ivars[i]);\n            if (ivarName) {\n                NSString *ivarNameString = [NSString stringWithUTF8String:ivarName];\n                if ([ivarNameString isEqualToString:propertyName] ||\n                    [ivarNameString isEqualToString:[@\"_\" stringByAppendingString:propertyName]]) {\n                    NSObject *value = object_getIvar(object, ivars[i]);\n                    if (value) {\n                        free(ivars);\n                        return value;\n                    }\n                }\n            }\n        }\n        \n        free(ivars);\n        objectClass = class_getSuperclass(objectClass);\n    }\n    \n    return nil;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/TimeInterval+DetoxUtils.swift",
    "content": "//\n//  TimeInterval+DetoxUtils.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/12/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nimport Foundation\n\nextension Double {\n\tfunc toSeconds() -> TimeInterval {\n\t\treturn self / 1000.0\n\t}\n}\n\nextension TimeInterval {\n\tfunc toMilliseconds() -> Double {\n\t\treturn self * 1000.0\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIApplication+DTXAdditions.h",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n *  EarlGrey specific additions for tracking runloop mode changes and user interaction events.\n */\n@interface UIApplication (DTXAdditions)\n\n/**\n * @return Active mode for the main runloop that was pushed by one of the push runloop methods.\n *         May return @c nil when no mode was pushed.\n */\n- (NSString *_Nullable)dtx_activeRunLoopMode;\n\n+ (CGFloat)dtx_panVelocity;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIApplication+DTXAdditions.m",
    "content": "//\n// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \"UIApplication+DTXAdditions.h\"\n\n@import ObjectiveC;\n@import Darwin;\n\n#import \"DTXAppleInternals.h\"\n\n/**\n *  List for all the runloop modes that have been pushed and unpopped using UIApplication's push/pop\n *  runloop mode methods. The most recently pushed runloop mode is at the end of the list.\n */\nstatic NSMutableArray *__runLoopModes;\nstatic pthread_mutex_t __runLoopModesMutex;\n\n@implementation UIApplication (DTXAdditions)\n\n+ (void)load {\n\t@autoreleasepool {\n\t\t__runLoopModes = [[NSMutableArray alloc] init];\n\t\t\n\t\tpthread_mutexattr_t attr;\n\t\tpthread_mutexattr_init(&attr);\n\t\tpthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);\n\t\t\n\t\tpthread_mutex_init(&__runLoopModesMutex, &attr);\n\t\t\n\t\t[NSNotificationCenter.defaultCenter addObserverForName:@\"_UIApplicationRunLoopModePushNotification\" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {\n\t\t\tpthread_mutex_lock(&__runLoopModesMutex);\n\t\t\t[__runLoopModes addObject:note.userInfo[@\"_UIApplicationRunLoopMode\"]];\n\t\t\tpthread_mutex_unlock(&__runLoopModesMutex);\n\t\t}];\n\t\t\n\t\t[NSNotificationCenter.defaultCenter addObserverForName:@\"_UIApplicationRunLoopModePopNotification\" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {\n\t\t\tpthread_mutex_lock(&__runLoopModesMutex);\n\t\t\tNSCParameterAssert([__runLoopModes.lastObject isEqualToString:note.userInfo[@\"_UIApplicationRunLoopMode\"]]);\n\t\t\t[__runLoopModes removeLastObject];\n\t\t\tpthread_mutex_unlock(&__runLoopModesMutex);\n\t\t}];\n\t\t\n\t\t[self dtx_enableAccessibilityForSimulator];\n\t}\n}\n\n- (NSString *)dtx_activeRunLoopMode\n{\n\tNSString* rv;\n\tpthread_mutex_lock(&__runLoopModesMutex);\n\trv = [__runLoopModes lastObject];\n\tpthread_mutex_unlock(&__runLoopModesMutex);\n\t\n\treturn rv;\n}\n\n+ (void)dtx_enableAccessibilityForSimulator\n{\n\tNSLog(@\"Enabling accessibility for automation on Simulator.\");\n\tstatic NSString *path =\n\t@\"/System/Library/PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities\";\n\tchar const *const localPath = [path fileSystemRepresentation];\n\t\n\tdlopen(localPath, RTLD_LOCAL);\n\t\n\tClass AXBackBoardServerClass = NSClassFromString(@\"AXBackBoardServer\");\n\tid server = [AXBackBoardServerClass server];\n\t\n\t[server setAccessibilityPreferenceAsMobile:(CFStringRef)@\"ApplicationAccessibilityEnabled\"\n\t\t\t\t\t\t\t\t\t\t value:kCFBooleanTrue\n\t\t\t\t\t\t\t\t  notification:(CFStringRef)@\"com.apple.accessibility.cache.app.ax\"];\n\t[server setAccessibilityPreferenceAsMobile:(CFStringRef)@\"AccessibilityEnabled\"\n\t\t\t\t\t\t\t\t\t\t value:kCFBooleanTrue\n\t\t\t\t\t\t\t\t  notification:(CFStringRef)@\"com.apple.accessibility.cache.ax\"];\n}\n\n+ (CGFloat)dtx_panVelocity\n{\n\tstatic CGFloat rv;\n\t\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\trv = 25;\n\t});\n\t\n\treturn rv;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIImage+DetoxUtils.h",
    "content": "//\n//  UIImage+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan on 9/13/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIImage (DetoxUtils)\n\n- (UIImage*)dtx_imageByCroppingInRect:(CGRect)rect;\n- (NSUInteger)dtx_numberOfVisiblePixelsWithAlphaThreshold:(CGFloat)threshold totalPixels:(NSUInteger*)totalPixels;\n\n- (void)dtx_saveToPath:(NSURL*)path fileName:(NSString*)name;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIImage+DetoxUtils.m",
    "content": "//\n//  UIImage+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan on 9/13/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIImage+DetoxUtils.h\"\n\n@implementation UIImage (DetoxUtils)\n\n- (UIImage *)dtx_imageByCroppingInRect:(CGRect)rect\n{\n\trect = CGRectMake(rect.origin.x * self.scale, rect.origin.y * self.scale, rect.size.width * self.scale, rect.size.height * self.scale);\n\t\n\treturn [UIImage imageWithCGImage:CGImageCreateWithImageInRect(self.CGImage, rect) scale:1 orientation:self.imageOrientation];\n}\n\n- (NSUInteger)dtx_numberOfVisiblePixelsWithAlphaThreshold:(CGFloat)threshold totalPixels:(NSUInteger*)totalPixels\n{\n\tCGImageRef cgImage = self.CGImage;\n\t\n\tCFDataRef pixelData = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));\n\tdtx_defer {\n\t\tCFRelease(pixelData);\n\t};\n\tconst uint8_t* bytes = CFDataGetBytePtr(pixelData);\n\t\n\tsize_t width  = CGImageGetWidth(cgImage);\n\tsize_t height = CGImageGetHeight(cgImage);\n\t\n\tsize_t bpr = CGImageGetBytesPerRow(cgImage);\n\tsize_t bpp = CGImageGetBitsPerPixel(cgImage);\n\tsize_t bpc = CGImageGetBitsPerComponent(cgImage);\n\tsize_t bytes_per_pixel = bpp / bpc;\n\t\n\tCGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(cgImage);\n\tCGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(cgImage);\n\t\n\tuint8_t alphaOffset;\n\tif(alphaInfo == kCGImageAlphaPremultipliedFirst)\n\t{\n\t\tif((bitmapInfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Little)\n\t\t{\n\t\t\talphaOffset = 3;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talphaOffset = 0;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif((bitmapInfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Little)\n\t\t{\n\t\t\talphaOffset = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talphaOffset = 3;\n\t\t}\n\t}\n\t\n\tNSUInteger visible = 0;\n\tNSUInteger total = 0;\n\t\n\tfor(size_t row = 0; row < height; row++)\n\t{\n\t\tfor(size_t col = 0; col < width; col++)\n\t\t{\n\t\t\ttotal++;\n\t\t\t\n\t\t\tconst uint8_t* pixel =\n\t\t\t&bytes[row * bpr + col * bytes_per_pixel];\n\t\t\t\n\t\t\tuint8_t alpha255 = pixel[alphaOffset];\n\t\t\tCGFloat alpha = alpha255 / 255.0;\n\t\t\t\n\t\t\tif(alpha < threshold)\n\t\t\t{\n\t\t\t\tvisible++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif(totalPixels != NULL)\n\t{\n\t\t*totalPixels = total;\n\t}\n\t\n\treturn visible;\n}\n\n- (void)dtx_saveToPath:(NSURL*)path fileName:(NSString*)name\n{\n\tNSURL *combinedPath = [path URLByAppendingPathComponent:name];\n\t[UIImagePNGRepresentation(self) writeToURL:[NSURL fileURLWithPath:combinedPath.path] atomically:YES];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIResponder+First.h",
    "content": "//\n//  UIResponder+First.h\n//  Detox\n//\n//  Created by Asaf Korem on 02/12/2021.\n//  Copyright © 2021 Wix. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIResponder (First)\n\n/// Finds the first reponder.\n/// @see https://stackoverflow.com/a/21330810/11686340\n+ (instancetype)dtx_first;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIResponder+First.m",
    "content": "//\n//  UIResponder+First.m\n//  Detox\n//\n//  Created by Asaf Korem on 02/12/2021.\n//  Copyright © 2021 Wix. All rights reserved.\n//\n\n#import \"UIResponder+First.h\"\n\nstatic __weak UIResponder *_dtx_first;\n\n@implementation UIResponder (First)\n\n+ (instancetype)dtx_first {\n  _dtx_first = nil;\n  [[UIApplication sharedApplication] sendAction:@selector(responderAction:) to:nil from:nil\n\t\t\t\t\t\t\t\t\t   forEvent:nil];\n  return _dtx_first;\n}\n\n- (void)responderAction:(id)sender {\n  _dtx_first = self;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UISlider+DetoxUtils.h",
    "content": "//\n//  UISlider+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/28/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UISlider (DetoxUtils)\n\n@property (nonatomic, getter=dtx_normalizedSliderPosition, setter=dtx_setNormalizedSliderPosition:) double dtx_normalizedSliderPosition;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UISlider+DetoxUtils.m",
    "content": "//\n//  UISlider+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/28/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UISlider+DetoxUtils.h\"\n\n@implementation UISlider (DetoxUtils)\n\n- (double)dtx_normalizedSliderPosition\n{\n\tif(self.maximumValue == 0.0)\n\t{\n\t\t//No nans allowed.\n\t\treturn 0.0;\n\t}\n\t\n\treturn (self.value - self.minimumValue) / self.maximumValue;\n}\n\n- (void)dtx_setNormalizedSliderPosition:(double)dtx_normalizedSliderPosition\n{\n\tself.value = dtx_normalizedSliderPosition * (self.maximumValue - self.minimumValue) + self.minimumValue;\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+DetoxSpeedup.h",
    "content": "//\n//  UIView+DetoxSpeedup.h\n//  Detox\n//\n//  Created by Leo Natan on 11/24/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIView (DetoxSpeedup)\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+DetoxSpeedup.m",
    "content": "//\n//  UIView+DetoxSpeedup.m\n//  Detox\n//\n//  Created by Leo Natan on 11/24/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIView+DetoxSpeedup.h\"\n\n@interface NSObject ()\n\n- (void)_setCaretBlinkAnimationEnabled:(BOOL)arg1;\n- (void)setCaretBlinks:(BOOL)arg1;\n\n@end\n\n@interface UIScrollView ()\n\n- (void)_hideScrollIndicators;\n- (void)_hideScrollIndicator:(id)arg1 afterDelay:(NSTimeInterval)arg2 animated:(BOOL)arg3;\n\n@end\n\n@implementation UIView (DetoxSpeedup)\n\n+ (void)load\n{\n\t@autoreleasepool {\n\t\tNSError* error;\n\t\tif(@available(iOS 14.0, *))\n\t\t{\n\t\t\t//Under iOS 14, this is necessary.\n\t\t\tDTXSwizzleMethod(NSClassFromString(@\"UITextSelectionView\"), @selector(_setCaretBlinkAnimationEnabled:), @selector(_dtx_setCaretBlinkAnimationEnabled:), &error);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif([NSUserDefaults.standardUserDefaults boolForKey:@\"detoxDisableAnimationSpeedup\"] == NO)\n\t\t\t{\n\t\t\t\tDTXSwizzleMethod(NSClassFromString(@\"UITextSelectionView\"), @selector(setCaretBlinks:), @selector(_dtx_setCaretBlinks:), &error);\n\t\t\t}\n\t\t}\n\t}\n}\n\n- (void)_dtx_setCaretBlinkAnimationEnabled:(BOOL)arg1\n{\n\t[self _dtx_setCaretBlinkAnimationEnabled:NO];\n}\n\n- (void)_dtx_setCaretBlinks:(BOOL)arg1\n{\n\t[self _dtx_setCaretBlinks:NO];\n}\n\n@end\n\n@interface UIScrollView (DetoxSpeedup) @end\n@implementation UIScrollView (DetoxSpeedup)\n\n+ (void)load\n{\n\t@autoreleasepool {\n\t\tif([NSUserDefaults.standardUserDefaults boolForKey:@\"detoxDisableAnimationSpeedup\"] == NO)\n\t\t{\n\t\t\tNSError* error;\n\t\t\tDTXSwizzleMethod(self, @selector(_hideScrollIndicators), @selector(_dtx_hideScrollIndicators), &error);\n\t\t\tDTXSwizzleMethod(self, @selector(_hideScrollIndicator:afterDelay:animated:), @selector(_dtx_hideScrollIndicator:afterDelay:animated:), &error);\n\t\t}\n\t}\n}\n\n- (void)_dtx_hideScrollIndicators\n{\n\t[[self valueForKey:@\"horizontalScrollIndicator\"] setAlpha:0.0];\n\t[[self valueForKey:@\"verticalScrollIndicator\"] setAlpha:0.0];\n}\n\n- (void)_dtx_hideScrollIndicator:(UIView*)arg1 afterDelay:(NSTimeInterval)arg2 animated:(BOOL)arg3\n{\n\t[arg1 setAlpha:0.0];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+DetoxUtils.h",
    "content": "//\n//  UIView+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/27/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n#import <NSObject+DetoxUtils.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIView (DetoxUtils)\n\n@property (nonatomic, readonly, weak) UIViewController* dtx_containingViewController;\n- (UIImage*)dtx_imageFromView;\n- (BOOL)isVisibleAroundPoint:(CGPoint)point;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+DetoxUtils.m",
    "content": "//\n//  UIView+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 4/27/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIView+DetoxUtils.h\"\n#import \"DTXAppleInternals.h\"\n#import \"UIWindow+DetoxUtils.h\"\n#import \"UIImage+DetoxUtils.h\"\n#import \"UIView+Drawing.h\"\n#import \"DetoxPolicy.h\"\n#import \"NSURL+DetoxUtils.h\"\n#import \"UIResponder+First.h\"\n\n@interface DTXTouchVisualizerWindow : UIWindow @end\n\n//#ifdef DEBUG\n//#define _DTXPopulateError(errOut) { NSLog(@\"🤦‍♂️ %@\", errOut); if(error) { *error = (errOut); } }\n//#else\n#define _DTXPopulateError(errOut) if(error) { *error = (errOut); }\n//#endif\n#define APPLY_PREFIX(...) [NSString stringWithFormat:@\"%@ %@\", prefix, __VA_ARGS__]\n\n@import ObjectiveC;\n\nDTX_DIRECT_MEMBERS\n@implementation UIView (DetoxUtils)\n\n- (void)dtx_assertVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent {\n\tNSError* error;\n\tBOOL assert = [self dtx_isVisibleAtRect:rect percent:percent error:&error];\n\n\tDTXViewAssert(assert, self.dtx_elementDebugAttributes, @\"%@\", error.localizedDescription);\n}\n\n- (NSString *)dtx_shortDescription\n{\n\treturn [NSString stringWithFormat:@\"<%@: %p>\", self.class, self];\n}\n\n- (CGRect)dtx_accessibilityFrame\n{\n\tCGRect accessibilityFrame = self.accessibilityFrame;\n\tif(CGRectEqualToRect(accessibilityFrame, CGRectZero))\n\t{\n\t\taccessibilityFrame = [self.window.screen.coordinateSpace convertRect:self.bounds fromCoordinateSpace:self.coordinateSpace];\n\t}\n\treturn accessibilityFrame;\n}\n\n- (CGRect)dtx_safeAreaBounds\n{\n\treturn UIEdgeInsetsInsetRect(self.bounds, self.safeAreaInsets);\n}\n\n- (CGPoint)dtx_accessibilityActivationPoint\n{\n\tCGPoint activationPoint = self.accessibilityActivationPoint;\n\tif(CGPointEqualToPoint(activationPoint, CGPointZero))\n\t{\n\t\tactivationPoint = [self.coordinateSpace convertPoint:CGPointMake(CGRectGetMidX(self.dtx_safeAreaBounds), CGRectGetMidY(self.dtx_safeAreaBounds)) toCoordinateSpace:self.window.screen.coordinateSpace];\n\t}\n\treturn activationPoint;\n}\n\n- (CGPoint)dtx_accessibilityActivationPointInViewCoordinateSpace\n{\n\tUIWindow* windowToUse = [self isKindOfClass:UIWindow.class] ? (id)self : self.window;\n\n\treturn [windowToUse.screen.coordinateSpace convertPoint:self.dtx_accessibilityActivationPoint toCoordinateSpace:self.coordinateSpace];\n}\n\n- (CGRect)dtx_contentBounds\n{\n\tCGRect contentBounds = self.bounds;\n\n\tif(self.clipsToBounds == YES)\n\t{\n\t\treturn contentBounds;\n\t}\n\n\tfor (UIView* subview in self.subviews) {\n\t\tcontentBounds = CGRectUnion(contentBounds, subview.dtx_contentBounds);\n\t}\n\n\treturn contentBounds;\n}\n\n- (CGRect)dtx_visibleBounds\n{\n\tCGRect visibleBounds = self.bounds;\n\n\tUIView* superview = self.superview;\n\twhile(superview != nil)\n\t{\n\t\tif([superview clipsToBounds] == YES)\n\t\t{\n\t\t\tCGRect boundsInSelfCoords = [self convertRect:superview.bounds fromView:superview];\n\t\t\tvisibleBounds = CGRectIntersection(boundsInSelfCoords, visibleBounds);\n\t\t}\n\n\t\tif(CGRectIsEmpty(visibleBounds))\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\tsuperview = superview.superview;\n\t}\n\n\treturn visibleBounds;\n}\n\n- (BOOL)dtx_isVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent {\n\treturn [self dtx_isVisibleAtRect:rect percent:percent error:nil];\n}\n\n- (UIImage*)dtx_imageFromView\n{\n\tUIWindow* window = [self isKindOfClass:UIWindow.class] ? (id)self : self.window;\n\tCGFloat scale = window != nil ? window.screen.scale : 0.0;\n\tUIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, scale);\n\n\t[self.layer renderInContext:UIGraphicsGetCurrentContext()];\n\n\tUIImage *image= UIGraphicsGetImageFromCurrentImageContext();\n\tUIGraphicsEndImageContext();\n\n\treturn image;\n}\n\n- (UIImage*)_dtx_imageForVisibilityTestingInWindow:(UIWindow*)windowToUse testedView:(UIView*)testedView inRect:(CGRect)testedRect drawTestedRect:(BOOL)drawTestedRect\n{\n\tUIGraphicsBeginImageContextWithOptions(windowToUse.bounds.size, NO, windowToUse.screen.scale);\n\n\tUIWindowScene* scene = windowToUse.windowScene;\n\tNSArray<UIWindow*>* windows = [UIWindow dtx_allWindowsForScene:scene];\n\tNSUInteger indexOfTestedWindow = [windows indexOfObject:windowToUse];\n\n\tDTXAssert(indexOfTestedWindow != NSNotFound, @\"Window hierarchy mutated while iterated; should not happen\");\n\n\tif(testedView == nil)\n\t{\n\t\t[UIColor.blackColor setFill];\n\t\t[[UIBezierPath bezierPathWithRect:windowToUse.bounds] fill];\n\t}\n\n\t[windowToUse dtx_drawViewHierarchyUpToSubview:testedView inRect:windowToUse.bounds afterScreenUpdates:NO];\n\n\tfor (NSUInteger idx = indexOfTestedWindow + 1; idx < windows.count; idx++) {\n\t\tUIWindow* currentWindow = windows[idx];\n\n\t\t[currentWindow dtx_drawViewHierarchyUpToSubview:nil inRect:currentWindow.bounds afterScreenUpdates:NO];\n\t}\n\n\t//Overlay the keyboard scene windows on top\n\tscene = [UIWindowScene _keyboardWindowSceneForScreen:windowToUse.screen create:NO];\n\tif(scene != nil)\n\t{\n\t\twindows = [UIWindow dtx_allWindowsForScene:scene];\n\n\t\tfor (UIWindow* keyboardSceneWindow in windows) {\n\t\t\tif (![keyboardSceneWindow isEqual: windowToUse]) {\n\t\t\t\t[keyboardSceneWindow dtx_drawViewHierarchyUpToSubview:nil inRect:keyboardSceneWindow.bounds afterScreenUpdates:NO];\n\t\t\t}\n\t\t}\n\t}\n\n\tif(drawTestedRect && testedView != nil)\n\t{\n\t\tCGContextRef ctx = UIGraphicsGetCurrentContext();\n\t\tCGContextSetLineWidth(ctx, 1);\n\t\tCGContextSetAllowsAntialiasing(ctx, NO);\n\n\t\tCGFloat* lengths = (CGFloat[]){2.0, 2.0};\n\t\t[@[UIColor.systemRedColor, UIColor.whiteColor] enumerateObjectsUsingBlock:^(UIColor * _Nonnull color, NSUInteger idx, BOOL * _Nonnull stop) {\n\t\t\tCGContextSetLineDash(ctx, idx * 2.0, lengths, 2);\n\t\t\t[color setStroke];\n\t\t\tCGContextStrokeRect(ctx, testedRect);\n\n\t\t\t//\t\t\t*stop = YES;\n\t\t}];\n\t}\n\n\tUIImage* rv = UIGraphicsGetImageFromCurrentImageContext();\n\tUIGraphicsEndImageContext();\n\n\treturn rv;\n}\n\n- (BOOL)_dtx_isTestedRegionObscuredWithVisiblePixels:(NSUInteger)visible\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t totalPixels:(NSUInteger)total percent:(NSUInteger)percent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tofView:(UIView*)lookingFor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t explanation:(NSString**)explanation {\n\tBOOL isRegionObscured = [self isRegionObscuredWithVisiblePixels:visible\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotalPixels:total percent:percent];\n\n\tif (isRegionObscured) {\n\t\t*explanation = [NSString stringWithFormat:@\"View does not pass visibility percent \"\n\t\t\t\t\t\t\t\t\t\t\"threshold (%lu)\", (unsigned long)percent];\n\t}\n\n\treturn isRegionObscured;\n}\n\n- (BOOL)isRegionObscuredWithVisiblePixels:(NSUInteger)visible\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotalPixels:(NSUInteger)total percent:(NSUInteger)percent {\n\tCGFloat visiblePercent = visible / (CGFloat)total * 100.;\n\treturn visiblePercent < (CGFloat)percent;\n}\n\n- (BOOL)_dtx_isRegionObscured:(CGRect)intersection fromTestedRegion:(CGRect)testedRegion\n\t\t\t\t\t\t\t\t\t\t\tpercent:(NSUInteger)percent {\n\tCGFloat visible = intersection.size.width * intersection.size.height;\n\tCGFloat total = testedRegion.size.width * testedRegion.size.height;\n\treturn [self isRegionObscuredWithVisiblePixels:visible totalPixels:total percent:percent];\n}\n\n- (BOOL)_dtx_isTestedRegionObscured:(CGRect)testedRegion inWindowBounds:(CGRect)windowBounds\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpercent:(NSUInteger)percent {\n\tCGRect intersection = CGRectIntersection(windowBounds, testedRegion);\n\treturn [self _dtx_isRegionObscured:intersection fromTestedRegion:testedRegion percent:percent];\n}\n\n- (BOOL)_dtx_hasScrollViewAncestor {\n\tUIView* superview = self.superview;\n\twhile (superview != nil) {\n\t\tif ([superview isKindOfClass:UIScrollView.class]) {\n\t\t\treturn YES;\n\t\t}\n\t\tsuperview = superview.superview;\n\t}\n\treturn NO;\n}\n\n- (BOOL)_dtx_testVisibilityInRect:(CGRect)rect percent:(NSUInteger)percent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terror:(NSError* __strong __nullable * __nullable)error {\n\tNSString* prefix = [NSString stringWithFormat:@\"View “%@” is not visible:\", self.dtx_shortDescription];\n\n\tif(UIApplication.sharedApplication._isSpringBoardShowingAnAlert)\n\t{\n\t\t_DTXPopulateError([NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:@{NSLocalizedDescriptionKey: APPLY_PREFIX(@\"System alert is shown on screen\")}]);\n\n\t\treturn NO;\n\t}\n\n\tUIWindow* windowToUse = [self isKindOfClass:UIWindow.class] ? (id)self : self.window;\n\n\tif(windowToUse == nil || windowToUse.screen == nil)\n\t{\n\t\t_DTXPopulateError([NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:@{NSLocalizedDescriptionKey: APPLY_PREFIX(@\"Either window or screen are nil\")}]);\n\n\t\treturn NO;\n\t}\n\n\tif(windowToUse.windowScene == nil)\n\t{\n\t\t_DTXPopulateError([NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:@{NSLocalizedDescriptionKey: APPLY_PREFIX(@\"Window scene is nil\")}]);\n\t\treturn NO;\n\t}\n\n\tif([self isHiddenOrHasHiddenAncestor] == YES)\n\t{\n\t\t_DTXPopulateError([NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:@{NSLocalizedDescriptionKey: APPLY_PREFIX(@\"View is hidden or has hidden ancestor\")}]);\n\n\t\treturn NO;\n\t}\n\n\tCGRect testedRegionInWindowCoords = [windowToUse convertRect:rect fromView:self];\n\n\tCGRect visibleBounds = self.dtx_visibleBounds;\n\tBOOL failsClippingCheck;\n\tif ([self _dtx_hasScrollViewAncestor]) {\n\t\tCGRect rectVisiblePortion = CGRectIntersection(visibleBounds, rect);\n\t\tfailsClippingCheck = CGRectIsEmpty(rectVisiblePortion) ||\n\t\t\t[self _dtx_isRegionObscured:rectVisiblePortion fromTestedRegion:rect percent:percent];\n\t} else {\n\t\tfailsClippingCheck = CGRectIsEmpty(visibleBounds) ||\n\t\t\t[self _dtx_isRegionObscured:visibleBounds fromTestedRegion:visibleBounds percent:percent];\n\t}\n\tif (failsClippingCheck) {\n\t\tauto errorDescription = [NSString stringWithFormat:@\"View is clipped by one or more of its \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"superviews' bounds and does not pass visibility percent \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"threshold (%lu)\", (unsigned long)percent];\n\n\t\tauto userInfo = @{ NSLocalizedDescriptionKey: APPLY_PREFIX(errorDescription) };\n\n\t\tNSError* err = [NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:userInfo];\n\t\t_DTXPopulateError(err);\n\n\t\treturn NO;\n\t}\n\n\tif ([self _dtx_isTestedRegionObscured:testedRegionInWindowCoords\n\t\t\t\t\t\t\t\t\t\t\t\t inWindowBounds:windowToUse.bounds percent:percent]) {\n\t\tauto errorDescription = [NSString stringWithFormat:@\"View is obscured by its window bounds \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"and does not pass visibility percent threshold (%lu)\", (unsigned long)percent];\n\n\t\tauto userInfo = @{ NSLocalizedDescriptionKey: APPLY_PREFIX(errorDescription) };\n\n\t\tNSError* err = [NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:userInfo];\n\t\t_DTXPopulateError(err);\n\n\t\treturn NO;\n\t}\n\n\tUIImage* image = [self _dtx_imageForVisibilityTestingInWindow:windowToUse testedView:self inRect:testedRegionInWindowCoords drawTestedRect:NO];\n\timage = [image dtx_imageByCroppingInRect:testedRegionInWindowCoords];\n\n\tNSUInteger total;\n\tNSUInteger visible = [image\n\t\t\t\t\t\t\t\t\t\t\t\tdtx_numberOfVisiblePixelsWithAlphaThreshold:DetoxPolicy.visibilityPixelAlphaThreshold\n\t\t\t\t\t\t\t\t\t\t\t\ttotalPixels:&total];\n\n\tNSString* explanation;\n\tif ([self _dtx_isTestedRegionObscuredWithVisiblePixels:visible totalPixels:total percent:percent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tofView:self explanation:&explanation]) {\n\t\tNSError* err = [NSError errorWithDomain:@\"DetoxErrorDomain\" code:0 userInfo:@{NSLocalizedDescriptionKey: APPLY_PREFIX(explanation)}];\n\t\t_DTXPopulateError(err);\n\n\t\tif([NSUserDefaults.standardUserDefaults boolForKey:@\"detoxDebugVisibility\"])\n\t\t{\n\t\t\t[[self _dtx_imageForVisibilityTestingInWindow:windowToUse testedView:nil inRect:testedRegionInWindowCoords drawTestedRect:NO] dtx_saveToPath:NSURL.visibilityFailingScreenshotsPath fileName:[NSString stringWithFormat:@\"DETOX_VISIBILITY_%@ <%p>_SCREEN.png\", NSStringFromClass(self.class), self]];\n\t\t\t[[self _dtx_imageForVisibilityTestingInWindow:windowToUse testedView:self inRect:testedRegionInWindowCoords drawTestedRect:YES] dtx_saveToPath:NSURL.visibilityFailingRectsPath fileName:[NSString stringWithFormat:@\"DETOX_VISIBILITY_%@ <%p>_TEST.png\", NSStringFromClass(self.class), self]];\n\t\t}\n\n\t\treturn NO;\n\t}\n\n\treturn YES;\n}\n\n- (BOOL)dtx_isVisibleAtRect:(CGRect)rect percent:(nullable NSNumber *)percent\n\t\t\t\t\t\t\t\t\t\t\terror:(NSError* __strong __nullable * __nullable)error {\n\tNSUInteger percentValue = percent ? percent.unsignedIntegerValue :\n\tDetoxPolicy.defaultPercentThresholdForVisibility;\n\treturn [self _dtx_testVisibilityInRect:rect percent:percentValue error:error];\n}\n\n- (BOOL)dtx_isEnabled\n{\n\tBOOL enabled = self.userInteractionEnabled;\n\tif([self isKindOfClass:UIControl.class])\n\t{\n\t\tenabled = enabled && [[self valueForKey:@\"enabled\"] boolValue];\n\t}\n\treturn enabled;\n}\n\n- (void)dtx_assertEnabled\n{\n\tDTXViewAssert(self.dtx_isEnabled == YES, self.dtx_elementDebugAttributes, @\"View is not enabled.\");\n}\n\n- (UIViewController *)dtx_containingViewController\n{\n\tUIViewController* rv = (id)self.nextResponder;\n\twhile(rv != nil && [rv isKindOfClass:UIViewController.class] == NO)\n\t{\n\t\trv = (id)rv.nextResponder;\n\t}\n\n\treturn rv;\n}\n\n#pragma mark - Check Hitability\n\n- (BOOL)dtx_isHittable {\n\tCGPoint point = [self findVisiblePoint];\n\treturn [self dtx_isHittableAtPoint:point error:nil];\n}\n\n- (CGPoint)findVisiblePoint {\n\tCGRect visibleBounds = self.dtx_visibleBounds;\n\tif (CGRectIsEmpty(visibleBounds)) {\n\t\treturn CGPointMake(NAN, NAN);\n\t}\n\n\treturn CGPointMake(visibleBounds.origin.x + visibleBounds.size.width / 2,\n\t\t\t\t\t\t\t\t\t\t visibleBounds.origin.y + visibleBounds.size.height / 2);\n}\n\n- (BOOL)dtx_isHittableAtPoint:(CGPoint)viewPoint\n\t\t\t\t\t\t\t\t\t\t\t\terror:(NSError* __strong __nullable * __nullable)error {\n\tif (viewPoint.x == NAN || viewPoint.y == NAN) {\n\t\tif (error) {\n\t\t\t*error = [NSError\n\t\t\t\t\t\t\t\terrorWithDomain:@\"Detox\" code:0\n\t\t\t\t\t\t\t\tuserInfo:@{NSLocalizedDescriptionKey:@\"Given point coordinates are NaN\"}];\n\t\t}\n\n\t\treturn NO;\n\t}\n\n\tif (![self _isVisibleAroundPoint:viewPoint error:error]) {\n\t\tif (error) {\n\t\t\tNSString *description = [NSString stringWithFormat:@\"View is not visible around\" \\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \" point.\\n- view point: %@\\n- visible bounds: %@\" \\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"\\n- view bounds: %@\\n---\\nError: %@\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t NSStringFromCGPoint(viewPoint),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t NSStringFromCGRect(self.dtx_visibleBounds),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t NSStringFromCGRect(self.frame), *error];\n\n\t\t\t*error = [NSError errorWithDomain:@\"Detox\" code:0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t userInfo:@{NSLocalizedDescriptionKey:description}];\n\n\t\t}\n\n\t\treturn NO;\n\t}\n\n\tCGPoint absPoint = [self calcAbsPointFromLocalPoint:viewPoint];\n\n\tUIView * _Nullable visibleContainer = [self _topMostViewOverlayAtPoint:absPoint];\n\n\tif (!visibleContainer) {\n\t\tUIViewController * _Nullable topMostViewController = [self _topMostViewControllerAtPoint:absPoint];\n\t\tif (!topMostViewController) {\n\t\t\tif (error) {\n\t\t\t\tNSString *description = [NSString stringWithFormat:@\"Failed to interact with the screen \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"at point: %@.\", NSStringFromCGPoint(viewPoint)];\n\t\t\t\t*error = [NSError\n\t\t\t\t\t\t\t\t\terrorWithDomain:@\"Detox\" code:0\n\t\t\t\t\t\t\t\t\tuserInfo:@{NSLocalizedDescriptionKey:description}];\n\t\t\t}\n\n\t\t\treturn NO;\n\t\t}\n\n\t\tvisibleContainer = topMostViewController.view;\n\t}\n\n\tif ([self isDescendantOfView:visibleContainer]) {\n\t\treturn [self _canHitFromView:self atAbsPoint:absPoint error:error];\n\t}\n\n\tUIView *firstResponderInputView = UIResponder.dtx_first.inputView;\n\tif ([self isDescendantOfView:firstResponderInputView]) {\n\t\treturn [self _canHitFromView:firstResponderInputView atAbsPoint:absPoint error:error];\n\t}\n\n\treturn [self _canHitFromView:visibleContainer atAbsPoint:absPoint error:error];\n}\n\n- (nullable UIView *)_topMostViewOverlayAtPoint:(CGPoint)point {\n\tUIWindow * _Nullable topMostWindow = [UIWindow dtx_topMostWindowAtPoint:point];\n\tif (!topMostWindow) {\n\t\treturn nil;\n\t}\n\n\tNSArray<UIView *> *viewsAtPoint =\n\t\t\t[topMostWindow.subviews filteredArrayUsingPredicate:[NSPredicate\n\t\t\t\t\tpredicateWithBlock:^BOOL(UIView *view,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t NSDictionary<NSString *, id> * _Nullable __unused bindings) {\n\t\tif (!CGRectContainsPoint(view.frame, point)) {\n\t\t\treturn NO;\n\t\t}\n\n\t\tif (![view isVisibleAroundPoint:point]) {\n\t\t\treturn NO;\n\t\t}\n\n\t\tUIView * _Nullable hit = [view hitTest:point withEvent:nil];\n\t\tif (!hit) {\n\t\t\t// The point lies completely outside the view's hierarchy.\n\t\t\treturn NO;\n\t\t}\n\n\t\treturn YES;\n\t}]];\n\n\tif (!viewsAtPoint.count) {\n\t\treturn nil;\n\t}\n\n\treturn viewsAtPoint.lastObject;\n}\n\n- (BOOL)isVisibleAroundPoint:(CGPoint)point {\n\treturn [self _isVisibleAroundPoint:point error:nil];\n}\n\n- (BOOL)_isVisibleAroundPoint:(CGPoint)point error:(NSError* __strong __nullable * __nullable)error {\n\tCGRect intersection = CGRectIntersection(\n\t    self.dtx_visibleBounds, CGRectMake(point.x - 0.5, point.y - 0.5, 1, 1));\n\treturn [self _dtx_testVisibilityInRect:intersection percent:100 error:error];\n}\n\n- (BOOL)_canHitFromView:(UIView *)originView atAbsPoint:(CGPoint)point\n\t\t\t\t\t\t\t\t\terror:(NSError* __strong __nullable * __nullable)error {\n\tCGPoint absOrigin = [originView calcAbsOrigin];\n\tCGPoint relativePoint = CGPointMake(point.x - absOrigin.x, point.y - absOrigin.y);\n\n\tUIView *hit = [originView hitTest:relativePoint withEvent:nil];\n\n\tBOOL hitRemainedOnOrigin = !hit;\n\tif (hitRemainedOnOrigin && originView == self) {\n\t\treturn YES;\n\t}\n\n\tif ([hit isDescendantOfView:self]) {\n\t\treturn YES;\n\t}\n\n\tif (error) {\n\t\tNSString *hint = [self isDescendantOfView:hit] ?\n\t\t\t\t@\"\\n- Hint: The Target view is a descendant of the hit view\" : @\"\";\n\n\t\tNSString *errorMessage =\n\t\t[NSString stringWithFormat:@\"Failed to hit view %@at point %@ with hit-test\\n\" \\\n\t\t \"- Origin view: %@\\n\" \\\n\t\t \"- Absolute origin: %@\\n\" \\\n\t\t \"- Hit: %@%@\\n\" \\\n\t\t \"- Target view: %@\\n\" \\\n\t\t \"- Relative point: %@%@\",\n\t\t self.accessibilityIdentifier ?\n\t\t\t\t[NSString stringWithFormat:@\"with identifier `%@` \", self.accessibilityIdentifier] :\n\t\t\t\t@\"\",\n\t\t NSStringFromCGPoint(point),\n\t\t originView,\n\t\t NSStringFromCGPoint(absOrigin),\n\t\t hit,\n\t\t hit.accessibilityIdentifier ?\n\t\t\t\t[NSString stringWithFormat:@\" (identifier: `%@`)\", hit.accessibilityIdentifier] :\n\t\t\t\t@\"\",\n\t\t self,\n\t\t NSStringFromCGPoint(relativePoint),\n\t\t hint\n\t\t];\n\n\t\t*error = [NSError errorWithDomain:@\"Detox\" code:0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t userInfo:@{NSLocalizedDescriptionKey:errorMessage}];\n\t}\n\n\treturn NO;\n}\n\n- (nullable UIViewController *)_topMostViewControllerAtPoint:(CGPoint)point {\n\tUIWindow * _Nullable topMostWindow = [UIWindow dtx_topMostWindowAtPoint:point];\n\tif (!topMostWindow) {\n\t\treturn nil;\n\t}\n\n\treturn [self _topMostViewControllerForViewController:topMostWindow.rootViewController];\n}\n\n- (UIViewController *)_topMostViewControllerForViewController:(UIViewController *)viewController {\n\tif (viewController.presentedViewController) {\n\t\treturn [self _topMostViewControllerForViewController:viewController.presentedViewController];\n\t}\n\n\treturn viewController;\n}\n\n- (void)dtx_assertHittable {\n\tCGPoint point = [self findVisiblePoint];\n\t[self dtx_assertHittableAtPoint:point];\n}\n\n- (void)dtx_assertHittableAtPoint:(CGPoint)point {\n\tNSError *error;\n\tDTXAssert([self dtx_isHittableAtPoint:point error:&error],\n\t\t\t\t\t\t@\"View is not hittable at its visible point. Error: %@\", error.localizedDescription);\n}\n\n- (CGPoint)calcAbsOrigin {\n\treturn [self.superview calcAbsPointFromLocalPoint:self.frame.origin];\n}\n\n- (CGPoint)calcAbsPointFromLocalPoint:(CGPoint)localPoint {\n\treturn [self convertPoint:localPoint toView:nil];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+Drawing.h",
    "content": "//\n//  UIView+Drawing.h\n//  Detox\n//\n//  Created by Leo Natan on 9/17/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIView (Drawing)\n\n- (void)dtx_drawViewHierarchyUpToSubview:(nullable UIView*)subview inRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIView+Drawing.m",
    "content": "//\n//  UIView+Drawing.m\n//  Detox\n//\n//  Created by Leo Natan on 9/17/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIView+Drawing.h\"\n@import ObjectiveC;\n\n@interface CALayer ()\n\n- (void)_renderSublayersInContext:(struct CGContext *)arg1;\n- (void)_renderForegroundInContext:(struct CGContext *)arg1;\n- (void)_renderBackgroundInContext:(struct CGContext *)arg1;\n- (void)_renderBorderInContext:(struct CGContext *)arg1;\n\n@end\n\n@interface CALayer (BackdropDrawingUtils) @end\n@implementation CALayer (BackdropDrawingUtils)\n\nstatic BOOL __currentlyDrawing = NO;\nstatic BOOL __subviewFound = NO;\nstatic UIView* __subview = nil;\n\nstatic void (*__orig_VKMapView_renderInContext)(id self, SEL _cmd, CGContextRef ctx);\n+ (void)_dtx_applyDrawingFixes\n{\n\t[CALayer _fixupRenderingOnce];\n\t\n\t__currentlyDrawing = YES;\n\t__subviewFound = NO;\n\t\n\tClass cls = NSClassFromString(@\"VKMapView\");\n\tif(cls != nil)\n\t{\n\t\tMethod m = class_getInstanceMethod(cls, @selector(renderInContext:));\n\t\t__orig_VKMapView_renderInContext = (void*)method_getImplementation(m);\n\t\tmethod_setImplementation(m, (void*)_dtx_map_renderInContext);\n\t}\n}\n\n+ (void)_dtx_restoreDrawingDefaults\n{\n\tClass cls = NSClassFromString(@\"VKMapView\");\n\tif(cls != nil)\n\t{\n\t\tMethod m = class_getInstanceMethod(cls, @selector(renderInContext:));\n\t\t__orig_VKMapView_renderInContext = (void*)method_getImplementation(m);\n\t\tmethod_setImplementation(m, (void*)__orig_VKMapView_renderInContext);\n\t}\n\t\n\t__currentlyDrawing = NO;\n}\n\n+ (void)load\n{\n\t@autoreleasepool\n\t{\n\t\tMethod m = class_getInstanceMethod(CALayer.class, @selector(renderInContext:));\n\t\tclass_addMethod(NSClassFromString(@\"CABackdropLayer\"), method_getName(m), (IMP)_dtx_backdrop_renderInContext, method_getTypeEncoding(m));\n\t}\n}\n\n+ (void)_fixupRenderingOnce\n{\n\tstatic dispatch_once_t onceToken;\n\tdispatch_once(&onceToken, ^{\n\t\t//Do all this to support custom layer classes thay may implement their own renderInContext: and co.\n\t\t\n\t\tClass* classes = NULL;\n\t\tint numClasses = objc_getClassList(NULL, 0);\n\t\tif (numClasses > 0)\n\t\t{\n\t\t\tclasses = (Class*)malloc(sizeof(Class) * numClasses);\n\t\t\tnumClasses = objc_getClassList(classes, numClasses);\n\n\t\t\tfor (int i = 0; i < numClasses; i++)\n\t\t\t{\n\t\t\t\tClass superClass = classes[i];\n\t\t\t\twhile(superClass && superClass != CALayer.class)\n\t\t\t\t{\n\t\t\t\t\tsuperClass = class_getSuperclass(superClass);\n\t\t\t\t}\n\n\t\t\t\tif (superClass == nil)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tunsigned int numMethods = 0;\n\t\t\t\tMethod* methods = class_copyMethodList(classes[i], &numMethods);\n\t\t\t\t\n\t\t\t\tfor(unsigned int j = 0; j < numMethods; j++)\n\t\t\t\t{\n\t\t\t\t\tMethod m = methods[j];\n\t\t\t\t\tif(sel_isEqual(method_getName(m), @selector(renderInContext:)))\n\t\t\t\t\t{\n\t\t\t\t\t\tvoid (*__orig_CALayer_renderInContext)(id self, SEL _cmd, CGContextRef ctx) = (void*)method_getImplementation(m);\n\t\t\t\t\t\tmethod_setImplementation(m, imp_implementationWithBlock(^(CALayer* self, CGContextRef ctx) {\n\t\t\t\t\t\t\tSEL _cmd = @selector(renderInContext:);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(__currentlyDrawing == NO)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t__orig_CALayer_renderInContext(self, _cmd, ctx);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tUIView* delegate = (self.delegate != nil && [self.delegate isKindOfClass:UIView.class]) ? (id)self.delegate : nil;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(__subviewFound == NO && (delegate == nil || [__subview isDescendantOfView:delegate] == NO))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//This layer tree is under the subview we are looking for.\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(delegate == __subview)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//This layer tree is the one we are looking for, mark as found and return.\n\t\t\t\t\t\t\t\t__subviewFound = YES;\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(__subviewFound == YES)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t__orig_CALayer_renderInContext(self, _cmd, ctx);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\t[self _renderSublayersInContext:ctx];\n\t\t\t\t\t\t\t__orig_CALayer_renderInContext(self, _cmd, ctx);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t\telse if(sel_isEqual(method_getName(m), @selector(_renderForegroundInContext:)) || sel_isEqual(method_getName(m), @selector(_renderBackgroundInContext:)) || sel_isEqual(method_getName(m), @selector(_renderBorderInContext:)))\n\t\t\t\t\t{\n\t\t\t\t\t\tSEL _cmd = method_getName(m);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvoid (*__orig_CALayer_something)(id self, SEL _cmd, CGContextRef ctx) = (void*)method_getImplementation(m);\n\t\t\t\t\t\tmethod_setImplementation(m, imp_implementationWithBlock(^(CALayer* self, CGContextRef ctx) {\n\t\t\t\t\t\t\tif(__currentlyDrawing == NO)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t__orig_CALayer_something(self, _cmd, ctx);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tUIView* delegate = (self.delegate != nil && [self.delegate isKindOfClass:UIView.class]) ? (id)self.delegate : nil;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(__subviewFound == NO && (delegate == nil || [__subview isDescendantOfView:delegate] == NO))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//This layer tree is under the subview we are looking for.\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif([__subview isDescendantOfView:delegate] == YES)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t__orig_CALayer_something(self, _cmd, ctx);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t\telse if(sel_isEqual(method_getName(m), @selector(sublayers)))\n\t\t\t\t\t{\n\t\t\t\t\t\tNSArray* (*__orig_CALayer_sublayers)(id self, SEL _cmd) = (void*)method_getImplementation(m);\n\t\t\t\t\t\tmethod_setImplementation(m, imp_implementationWithBlock(^(CALayer* self, CGContextRef ctx) {\n\t\t\t\t\t\t\tSEL _cmd = @selector(sublayers);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(__currentlyDrawing == NO)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn __orig_CALayer_sublayers(self, _cmd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tNSArray* zSorted = [__orig_CALayer_sublayers(self, _cmd) sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(CALayer* _Nonnull obj1, CALayer* _Nonnull obj2) {\n\t\t\t\t\t\t\t\treturn [@(obj1.zPosition) compare:@(obj2.zPosition)];\n\t\t\t\t\t\t\t}];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn zSorted;\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfree(methods);\n\t\t\t}\n\n\t\t\tfree(classes);\n\t\t}\n\t});\n}\n\nstatic void _dtx_map_renderInContext(CALayer* self, SEL _cmd, CGContextRef ctx)\n{\n\tCGContextSaveGState(ctx);\n\tCGContextBeginTransparencyLayer(ctx, nil);\n\tCGContextSetAlpha(ctx, self.opacity);\n\t[[UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {\n\t\tif(traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)\n\t\t{\n\t\t\treturn [UIColor colorWithRed:44.0 / 255.0 green:45.0 / 255.0 blue:47.0 / 255.0 alpha:1.0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn [UIColor colorWithRed:250.0 / 255.0 green:245.0 / 255.0 blue:237.0 / 255.0 alpha:1.0];\n\t\t}\n\t}] setFill];\n\tCGContextFillRect(ctx, self.bounds);\n\tCGContextEndTransparencyLayer(ctx);\n\tCGContextRestoreGState(ctx);\n}\n\nstatic void _dtx_backdrop_renderInContext(CALayer* self, SEL _cmd, CGContextRef ctx)\n{\n\tCGContextSaveGState(ctx);\n\tCGContextBeginTransparencyLayer(ctx, nil);\n\tCGContextSetAlpha(ctx, self.opacity);\n\t[UIColor.systemBackgroundColor setFill];\n\tCGContextFillRect(ctx, self.bounds);\n\tCGContextEndTransparencyLayer(ctx);\n\tCGContextRestoreGState(ctx);\n}\n\n@end\n\nDTX_DIRECT_MEMBERS\n@implementation UIView (Drawing)\n\nCALayer* _DTXLayerForView(UIView* view, BOOL afterUpdates)\n{\n\treturn afterUpdates ? view.layer : view.layer.presentationLayer;\n}\n\n- (void)dtx_drawViewHierarchyUpToSubview:(UIView*)subview inRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates\n{\n\t[CALayer _dtx_applyDrawingFixes];\n\t__subview = subview;\n\t\n\tCGContextRef ctx = UIGraphicsGetCurrentContext();\n\tCGContextSaveGState(ctx);\n\t\n\t// Center the context around the view's anchor point\n\tCGContextTranslateCTM(ctx, self.center.x, self.center.y);\n\t// Apply the view's transform about the anchor point\n\tCGContextConcatCTM(ctx, self.transform);\n\t// Offset by the portion of the bounds left of and above the anchor point\n\tCGContextTranslateCTM(ctx, -self.bounds.size.width * self.layer.anchorPoint.x, -self.bounds.size.height * self.layer.anchorPoint.y);\n\t\n\tif(subview == nil)\n\t{\n\t\t[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates];\n\t}\n\telse\n\t{\n\t\t[_DTXLayerForView(self, afterUpdates) renderInContext:ctx];\n\t}\n\t\n\tCGContextRestoreGState(ctx);\n\t[CALayer _dtx_restoreDrawingDefaults];\n}\n\n@end\n\n\t\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIWindow+DetoxUtils.h",
    "content": "//\n//  UIWindow+DetoxUtils.h\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 6/4/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface UIWindowScene (DetoxUtils)\n\n- (NSString*)dtx_recursiveDescription;\n\n@end\n\n@interface UIWindow (DetoxUtils)\n\n@property (nonatomic, strong, class, readonly, nullable) UIWindow* dtx_keyWindow NS_SWIFT_NAME(dtx_keyWindow);\n@property (nonatomic, strong, class, readonly) NSArray<UIWindow*>* dtx_allKeyWindowSceneWindows NS_SWIFT_NAME(allKeyWindowSceneWindows);\n\n+ (id _Nullable)dtx_keyWindowScene;\n+ (NSArray<UIWindow*>*)dtx_allWindows;\n+ (NSArray<UIWindow*>*)dtx_allWindowsForScene:(nullable UIWindowScene*)scene;\n+ (void)dtx_enumerateAllWindowsUsingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block;\n+ (void)dtx_enumerateKeyWindowSceneWindowsUsingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block;\n+ (void)dtx_enumerateWindowsInScene:(nullable UIWindowScene*)scene usingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block;\n+ (nullable UIWindow *)dtx_topMostWindowAtPoint:(CGPoint)point;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/UIWindow+DetoxUtils.m",
    "content": "//\n//  UIWindow+DetoxUtils.m\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 6/4/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\n#import \"UIWindow+DetoxUtils.h\"\n\n#import \"DTXAppleInternals.h\"\n#import \"NSObject+DetoxUtils.h\"\n#import \"UIView+DetoxUtils.h\"\n#import <WebKit/WebKit.h>\n\nextern NSArray* DTXChildElements(id element);\n\nstatic NSInteger _DTXClampedInt(double value)\n{\n\treturn (NSInteger)MIN(MAX(value, (double)NSIntegerMin), (double)NSIntegerMax);\n}\n\nstatic void _DTXReplaceOccurrences(NSMutableString* string, NSString* target, NSString* replacement)\n{\n\t[string replaceOccurrencesOfString:target withString:replacement options:0 range:NSMakeRange(0, string.length)];\n}\n\nstatic NSString* _DTXEscapeXML(NSString* string)\n{\n\tif(string == nil)\n\t{\n\t\treturn @\"\";\n\t}\n\n\tNSMutableString* rv = [string mutableCopy];\n\t_DTXReplaceOccurrences(rv, @\"&\", @\"&amp;\");\n\t_DTXReplaceOccurrences(rv, @\"<\", @\"&lt;\");\n\t_DTXReplaceOccurrences(rv, @\">\", @\"&gt;\");\n\t_DTXReplaceOccurrences(rv, @\"\\\"\", @\"&quot;\");\n\treturn rv;\n}\n\nstatic NSDictionary* _DTXGetElementAttributes(UIView* view)\n{\n\tNSMutableDictionary* attributes = [NSMutableDictionary new];\n\tattributes[@\"class\"] = NSStringFromClass(view.class);\n\tattributes[@\"width\"] = @(_DTXClampedInt(CGRectGetWidth(view.frame))).stringValue;\n\tattributes[@\"height\"] = @(_DTXClampedInt(CGRectGetHeight(view.frame))).stringValue;\n\tattributes[@\"visibility\"] = view.hidden ? @\"invisible\" : @\"visible\";\n\tattributes[@\"alpha\"] = [NSString stringWithFormat:@\"%.1f\", view.alpha];\n\tattributes[@\"focused\"] = view.isFocused ? @\"true\" : @\"false\";\n\n\tif (view.accessibilityValue.length > 0) {\n\t\tattributes[@\"value\"] = view.accessibilityValue;\n\t}\n\tif (view.accessibilityLabel.length > 0) {\n\t\tattributes[@\"label\"] = view.accessibilityLabel;\n\t}\n\tif (view.tag != 0) {\n\t\tattributes[@\"tag\"] = @(view.tag).stringValue;\n\t}\n\tif (view.superview != nil) {\n\t\tCGPoint originInSuperview = [view convertPoint:CGPointZero toView:view.superview];\n\t\tattributes[@\"x\"] = @(_DTXClampedInt(originInSuperview.x)).stringValue;\n\t\tattributes[@\"y\"] = @(_DTXClampedInt(originInSuperview.y)).stringValue;\n\t}\n\tif (view.accessibilityIdentifier.length > 0) {\n\t\tattributes[@\"id\"] = view.accessibilityIdentifier;\n\t}\n\n\tNSString* text = [view dtx_text];\n\tif (text.length > 0) {\n\t\tattributes[@\"text\"] = text;\n\t}\n\n\t// Add memory address for unique identification and debugging\n\tattributes[@\"ptr\"] = [NSString stringWithFormat:@\"%p\", view];\n\n\treturn attributes;\n}\n\nstatic void _DTXAppendRecursiveXMLDescription(id element, NSMutableString* storage, NSUInteger depth)\n{\n\tif([element isKindOfClass:UIView.class] == NO)\n\t{\n\t\treturn;\n\t}\n\n\tUIView* view = element;\n\n\tNSString* indent = [@\"\" stringByPaddingToLength:depth * 4 withString:@\" \" startingAtIndex:0];\n\t[storage appendFormat:@\"\\n%@\", indent];\n\n\tNSString* elementName = NSStringFromClass(view.class);\n\t[storage appendFormat:@\"<%@\", elementName];\n\n\tNSDictionary* attributes = _DTXGetElementAttributes(view);\n\tNSArray* sortedKeys = [attributes.allKeys sortedArrayUsingSelector:@selector(compare:)];\n\tfor(NSString* key in sortedKeys)\n\t{\n\t\tNSString* value = attributes[key];\n\t\tif(value.length > 0)\n\t\t{\n\t\t\t[storage appendFormat:@\" %@=\\\"%@\\\"\", key, _DTXEscapeXML(value)];\n\t\t}\n\t}\n\n\tNSArray* children = DTXChildElements(element);\n\tif([element isKindOfClass:WKWebView.class])\n\t{\n\t\t[storage appendString:@\">\"];\n\t\t[storage appendFormat:@\"\\n%@    <![CDATA[WebView content cannot be extracted synchronously.]]>\", indent];\n\t\t[storage appendFormat:@\"\\n%@</%@>\", indent, elementName];\n\t\treturn;\n\t}\n\n\tif (children.count == 0)\n\t{\n\t\t[storage appendString:@\" />\"];\n\t}\n\telse\n\t{\n\t\t[storage appendString:@\">\"];\n\t\tfor(id child in [children reverseObjectEnumerator])\n\t\t{\n\t\t\t_DTXAppendRecursiveXMLDescription(child, storage, depth + 1);\n\t\t}\n\t\t[storage appendFormat:@\"\\n%@</%@>\", indent, elementName];\n\t}\n}\n\nstatic NSString* _DTXNSStringFromUISceneActivationState(UISceneActivationState state)\n{\n\tswitch(state)\n\t{\n\t\tcase UISceneActivationStateBackground:\n\t\t\treturn @\"UISceneActivationStateBackground\";\n\t\tcase UISceneActivationStateForegroundActive:\n\t\t\treturn @\"UISceneActivationStateForegroundActive\";\n\t\tcase UISceneActivationStateForegroundInactive:\n\t\t\treturn @\"UISceneActivationStateForegroundInactive\";\n\t\tcase UISceneActivationStateUnattached:\n\t\t\treturn @\"UISceneActivationStateUnattached\";\n\t}\n}\n\n@implementation UIWindowScene (DetoxUtils)\n\n- (NSString*)dtx_recursiveDescription\n{\n\tNSMutableString* rv;\n\t@autoreleasepool {\n\t\trv = [NSMutableString stringWithString:@\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<ViewHierarchy>\"];\n\n\t\tNSArray<UIWindow*>* windows = [UIWindow dtx_allWindowsForScene:self];\n\t\tfor (UIWindow* window in windows)\n\t\t{\n\t\t\t//Ignore the touch visualizer window\n\t\t\tif([NSStringFromClass(window.class) isEqualToString:@\"DTXTouchVisualizerWindow\"])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t_DTXAppendRecursiveXMLDescription(window, rv, 1);\n\t\t}\n\n\t\t[rv appendString:@\"\\n</ViewHierarchy>\"];\n\t}\n\n\treturn rv;\n}\n\n@end\n\n@implementation UIWindow (DetoxUtils)\n\n+ (UIWindow*)dtx_keyWindow {\n  NSArray *windows = [[UIApplication sharedApplication]windows];\n  for (UIWindow *window in windows) {\n\t  if (window.isKeyWindow) {\n\t\t  return window;\n\t  }\n  }\n  return nil;\n}\n\n+ (id)dtx_keyWindowScene\n{\n\tUIWindow* keyWindow = [self dtx_keyWindow];\n\tUIWindowScene* scene = keyWindow ? keyWindow.windowScene :  nil;\n\treturn scene;\n}\n\n+ (NSArray<UIWindow *> *)dtx_allKeyWindowSceneWindows\n{\n\tUIWindowScene* scene = [self dtx_keyWindowScene];\n\treturn [self dtx_allWindowsForScene:scene];\n}\n\n+ (NSArray<UIWindow*>*)dtx_allWindowsForScene:(UIWindowScene*)scene\n{\n\tNSMutableArray<UIWindow*>* windows = [[self dtx_allWindows] mutableCopy];\n\tscene = scene ?: [self dtx_keyWindowScene];\n\tif(scene != nil)\n\t{\n\t\tNSPredicate* predicate = [NSPredicate predicateWithFormat:@\"windowScene == %@\", scene];\n\n\t\tUIScene* keyboardScene = [UIWindowScene _keyboardWindowSceneForScreen:[scene screen] create:NO];\n\t\tif(keyboardScene != nil)\n\t\t{\n\t\t\tpredicate = [NSCompoundPredicate orPredicateWithSubpredicates:@[predicate, [NSPredicate predicateWithFormat:@\"windowScene == %@\", keyboardScene]]];\n\t\t}\n\n\t\t[windows filterUsingPredicate:predicate];\n\t}\n\n\treturn windows;\n}\n\n+ (NSArray<UIWindow*>*)dtx_allWindows\n{\n\treturn [[UIWindow allWindowsIncludingInternalWindows:YES onlyVisibleWindows:NO] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@\"hidden == NO\"]];\n}\n\n+ (void)_dtx_enumerateWindows:(NSArray<UIWindow*>*)windows usingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block\n{\n\tNSUInteger idx = 0;\n\tfor (UIWindow * _Nonnull obj in windows.reverseObjectEnumerator)\n\t{\n\t\tBOOL stop = NO;\n\t\tblock(obj, idx, &stop);\n\t\tif(stop == YES)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n+ (void)dtx_enumerateAllWindowsUsingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block\n{\n\t[self _dtx_enumerateWindows:self.dtx_allWindows usingBlock:block];\n}\n\n+ (void)dtx_enumerateKeyWindowSceneWindowsUsingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block\n{\n\tUIWindowScene* scene = [self dtx_keyWindowScene];\n\t[self dtx_enumerateWindowsInScene:scene usingBlock:block];\n}\n\n+ (void)dtx_enumerateWindowsInScene:(UIWindowScene*)scene usingBlock:(void (NS_NOESCAPE ^)(UIWindow* obj, NSUInteger idx, BOOL *stop))block\n{\n\t[self _dtx_enumerateWindows:[self dtx_allWindowsForScene:scene] usingBlock:block];\n}\n\n- (NSString *)dtx_shortDescription\n{\n\tCGRect frame = self.frame;\n\n\treturn [NSString stringWithFormat:@\"<%@: %p; frame = (%@ %@; %@ %@);>\", self.class, self, @(frame.origin.x), @(frame.origin.y), @(frame.size.width), @(frame.size.height)];\n}\n\n+ (nullable UIWindow *)dtx_topMostWindowAtPoint:(CGPoint)point {\n  NSArray<UIWindow *> *windows = [self dtx_allWindows];\n\n  NSArray<UIWindow *> *visibleWindowsAtPoint = [windows filteredArrayUsingPredicate:\n\t\t[NSPredicate predicateWithBlock:^BOOL(\n\t\t\tUIWindow *window,\n\t\t\tNSDictionary<NSString *, id> * _Nullable __unused bindings\n\t\t) {\n\t\t\tif (!CGRectContainsPoint(window.frame, point)) {\n\t\t\t\treturn NO;\n\t\t\t}\n\n\t\t\tif (![window isVisibleAroundPoint:point]) {\n\t\t\t\treturn NO;\n\t\t\t}\n\n\t\t\tif (![window hitTest:point withEvent:nil]) {\n\t\t\t\t// The point lies completely outside the window's hierarchy.\n\t\t\t\treturn NO;\n\t\t\t}\n\n\t\t\treturn YES;\n\t\t}]];\n\n\tif (!visibleWindowsAtPoint) {\n\t\treturn nil;\n  }\n\n  return [[visibleWindowsAtPoint\n\t  sortedArrayUsingComparator:^NSComparisonResult(UIWindow *window1, UIWindow *window2) {\n\t\treturn window1.windowLevel - window2.windowLevel;\n\t}] lastObject];\n}\n\n@end\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/ViewHierarchyGenerator.swift",
    "content": "//\n//  ViewHierarchyGenerator.swift\n//  Detox\n//\n//  Created by Georgy Steshin on 18/08/2024.\n//  Copyright © 2024 Wix. All rights reserved.\n//\n\nimport Foundation\nimport UIKit\nimport WebKit\n\nprivate let GET_HTML_SCRIPT = \"\"\"\n    (function() {\n    const blacklistedTags = ['script', 'style', 'head', 'meta'];\n    const blackListedTagsSelector = blacklistedTags.join(',');\n\n    // Clone the entire document\n    var clonedDoc = document.documentElement.cloneNode(true);\n\n    // Remove all <script> and <style> tags from the cloned document\n    var scripts = clonedDoc.querySelectorAll(blackListedTagsSelector);\n    scripts.forEach(function(script) {\n        script.remove();\n    });\n\n    // Create an instance of XMLSerializer\n    var serializer = new XMLSerializer();\n\n    // Serialize the cloned DOM to a string\n    var serializedHtml = serializer.serializeToString(clonedDoc);\n\n    // Return the serialized HTML as a string\n    return serializedHtml;\n})();\n\"\"\"\n\nstruct ViewHierarchyGenerator {\n    private static let maxDepth = 200\n\n    @MainActor\n    static func generateXml(injectingAccessibilityIdentifiers shouldInject: Bool) async -> String {\n        let xmlHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\"\n        let windows = UIWindow.allKeyWindowSceneWindows\n            .filter { !isVisualizerWindow($0) }\n\n        var viewHierarchy = \"\"\n        for window in windows {\n            viewHierarchy += await generateXmlForViewHierarchy(window, depth: 1, indexPath: [], shouldInjectIdentifiers: shouldInject)\n        }\n\n        return \"\"\"\n        \\(xmlHeader)\n        <ViewHierarchy>\\(viewHierarchy)\n        </ViewHierarchy>\n        \"\"\"\n    }\n\n    private static func isVisualizerWindow(_ window: UIWindow) -> Bool {\n        return NSStringFromClass(type(of: window)) == \"DTXTouchVisualizerWindow\"\n    }\n\n    @MainActor\n    private static func generateXmlForViewHierarchy(\n        _ view: UIView,\n        depth: Int,\n        indexPath: [Int],\n        shouldInjectIdentifiers: Bool\n    ) async -> String {\n        guard depth <= maxDepth else { return \"\" }\n\n        let indent = String(repeating: \" \", count: depth)\n        let elementName = String(describing: type(of: view))\n        let attributes = generateAttributes(for: view, indexPath: indexPath, shouldInjectIdentifiers: shouldInjectIdentifiers)\n\n        var xml = \"\\n\\(indent)<\\(elementName)\\(attributes)\"\n\n        if let webView = view as? WKWebView {\n            let htmlContent = await getHtmlFromWebView(webView)\n            xml += \">\\n\\(indent)\\t<![CDATA[\\(htmlContent)]]>\"\n            xml += \"\\n\\(indent)</\\(elementName)>\"\n        } else if view.subviews.isEmpty {\n            xml += \" />\"\n        } else {\n            xml += \">\"\n            for (index, subview) in view.subviews.enumerated() {\n                let subviewIndexPath = indexPath + [index]\n                xml += await generateXmlForViewHierarchy(\n                    subview,\n                    depth: depth + 1,\n                    indexPath: subviewIndexPath,\n                    shouldInjectIdentifiers: shouldInjectIdentifiers\n                )\n            }\n            xml += \"\\n\\(indent)</\\(elementName)>\"\n        }\n\n        return xml\n    }\n\n    @MainActor\n    private static func getHtmlFromWebView(_ webView: WKWebView) async -> String {\n        let handler = WebViewHandler()\n\n        do {\n            try await handler.waitForPageLoad(webView)\n        } catch {\n            print(\"Error waiting for page to load: \\(error)\")\n            return \"<!-- Error loading page -->\"\n        }\n\n        return await withCheckedContinuation { continuation in\n            webView.evaluateJavaScript(GET_HTML_SCRIPT) { result, error in\n                if let html = result as? String {\n                    continuation.resume(returning: html)\n                } else if let error = error {\n                    continuation.resume(returning: \"<!-- Error loading HTML: \\(error) -->\")\n                } else {\n                    continuation.resume(returning: \"<!--- HTML is empty -->\")\n                }\n            }\n        }\n    }\n\n    private static func generateAttributes(\n        for view: UIView,\n        indexPath: [Int],\n        shouldInjectIdentifiers: Bool\n    ) -> String {\n        var attributes: [String: String] = [\n            \"class\": \"\\(type(of: view))\",\n            \"width\": \"\\(toClampedInt(view.frame.size.width))\",\n            \"height\": \"\\(toClampedInt(view.frame.size.height))\",\n            \"visibility\": view.isHidden ? \"invisible\" : \"visible\",\n            \"alpha\": \"\\(view.alpha)\",\n            \"focused\": \"\\(view.isFocused)\",\n            \"value\": view.accessibilityValue ?? \"\",\n            \"label\": view.accessibilityLabel ?? \"\"\n        ]\n\n        if view.tag != 0 {\n            attributes[\"tag\"] = \"\\(view.tag)\"\n        }\n\n        if let superview = view.superview {\n            let location = view.convert(view.bounds.origin, to: superview)\n            attributes[\"x\"] = \"\\(toClampedInt(location.x))\"\n            attributes[\"y\"] = \"\\(toClampedInt(location.y))\"\n        }\n\n        if shouldInjectIdentifiers {\n            let injectedPrefix = \"detox_temp_\"\n            let injectedIdentifier = \"\\(injectedPrefix)\\(indexPath.map { String($0) }.joined(separator: \"_\"))\"\n\n            if let existingTestID = view.accessibilityIdentifier {\n                // Override previously injected identifiers\n                if existingTestID.hasPrefix(injectedPrefix) {\n                    view.accessibilityIdentifier = injectedIdentifier\n                }\n            } else {\n                view.accessibilityIdentifier = injectedIdentifier\n            }\n        }\n\n        if let testID = view.accessibilityIdentifier {\n            attributes[\"id\"] = testID\n        }\n\n        if let textView = view as? UITextView {\n            attributes[\"text\"] = textView.text ?? \"\"\n        } else if let label = view as? UILabel {\n            attributes[\"text\"] = label.text ?? \"\"\n        }\n\n        return attributes\n            .filter { !$0.value.isEmpty }\n            .map { \" \\($0.key)=\\\"\\($0.value)\\\"\" }\n            .sorted()\n            .joined()\n    }\n}\n\n@MainActor\nclass WebViewHandler: NSObject, WKNavigationDelegate {\n    private var loadCompletion: ((Result<Void, Error>) -> Void)?\n\n    enum WebViewError: Error {\n        case timeout\n    }\n\n    func waitForPageLoad(_ webView: WKWebView, timeoutAfter seconds: TimeInterval = 10) async throws {\n        webView.navigationDelegate = self\n\n        if !webView.isLoading {\n            return\n        }\n\n        return try await withCheckedThrowingContinuation { continuation in\n            let task = Task {\n                try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))\n                loadCompletion?(.failure(WebViewError.timeout))\n            }\n\n            self.loadCompletion = { result in\n                task.cancel()\n                self.loadCompletion = nil\n                continuation.resume(with: result)\n            }\n        }\n    }\n\n    nonisolated func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {\n        Task { @MainActor in\n            loadCompletion?(.success(()))\n        }\n    }\n\n    nonisolated func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {\n        Task { @MainActor in\n            loadCompletion?(.failure(error))\n        }\n    }\n}\n\nfunc toClampedInt(_ value: Double) -> Int {\n    return Int(min(max(value, Double(Int.min)), Double(Int.max)))\n}\n"
  },
  {
    "path": "detox/ios/Detox/Utilities/WebSocket.swift",
    "content": "//\n//  WebSocket.swift\n//  Detox\n//\n//  Created by Leo Natan (Wix) on 5/22/20.\n//  Copyright © 2020 Wix. All rights reserved.\n//\n\nimport Foundation\n\nfileprivate let log = DetoxLog(category: \"WebSocket\")\n\nprotocol WebSocketDelegate: AnyObject {\n\tfunc webSocketDidConnect(_ webSocket: WebSocket)\n\tfunc webSocket(_ webSocket: WebSocket, didFailWith error: Error)\n\tfunc webSocket(_ webSocket: WebSocket, didReceiveAction type : String, params: [String: Any], messageId: NSNumber)\n\tfunc webSocket(_ webSocket: WebSocket, didCloseWith reason: String?)\n}\n\nclass WebSocket : NSObject, URLSessionWebSocketDelegate {\n\tvar sessionId: String?\n\tprivate var urlSession: URLSession!\n\tprivate var webSocketSessionTask: URLSessionWebSocketTask?\n\tweak var delegate: WebSocketDelegate?\n\t\n\toverride init() {\n\t\tsuper.init()\n\t\turlSession = URLSession(configuration: .default, delegate: self, delegateQueue: OperationQueue.main)\n\t}\n\t\n\tfunc connect(toServer server: URL, withSessionId sessionId: String) {\n\t\tself.sessionId = sessionId\n\t\t\n\t\twebSocketSessionTask = urlSession.webSocketTask(with: server)\n\t\twebSocketSessionTask?.resume()\n\t}\n\t\n\tfunc close() {\n\t\twebSocketSessionTask?.cancel(with: .normalClosure, reason: nil)\n\t\twebSocketSessionTask = nil\n\t}\n\t\n\tfunc sendAction(_ type: String, params: [String : Any], messageId: NSNumber) {\n\t\tlet data : [String: Any] = [\"type\": type, \"params\": params, \"messageId\": messageId]\n\t\tdo {\n\t\t\tlet data = try JSONSerialization.data(withJSONObject: data, options: [])\n\t\t\tlet message = URLSessionWebSocketTask.Message.data(data)\n\t\t\twebSocketSessionTask?.send(message) { error in\n\t\t\t\tif let error = error {\n\t\t\t\t\tlog.error(\"Error sending message: \\(error.localizedDescription)\")\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\tlog.error(\"Error encoding message: \\(error.localizedDescription)\")\n\t\t}\n\t}\n\t\n\tprivate func receive() {\n\t\twebSocketSessionTask?.receive { [weak self] result in\n\t\t\tswitch result {\n\t\t\tcase .failure(let error as NSError):\n\t\t\t\tlog.error(\"Error receiving message: \\(error.localizedDescription)\")\n\t\t\tcase .success(let message):\n\t\t\t\tswitch message {\n\t\t\t\tcase .string(let string):\n\t\t\t\t\tself?.receiveAction(json: string)\n\t\t\t\tcase .data(let data):\n\t\t\t\t\tself?.receiveAction(json: String(data: data, encoding: .utf8)!)\n\t\t\t\t@unknown default:\n\t\t\t\t\tfatalError(\"Unknown websocket message type\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tself?.receive()\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunc urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol pr: String?) {\n\t\tonDidOpen()\n\t\treceive()\n\t\t\n\t\tdelegate?.webSocketDidConnect(self)\n\t}\n\t\n\t\n\tfunc urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) {\n\t\tlet string: String?\n\t\tif let reason = reason, let str = String(data: reason, encoding: .utf8) {\n\t\t\tstring = str\n\t\t} else {\n\t\t\tstring = nil\n\t\t}\n\t\t\n\t\tdelegate?.webSocket(self, didCloseWith: string)\n\t}\n\t\n\tfunc urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {\n\t\tif let error = error {\n\t\t\tdelegate?.webSocket(self, didFailWith: error)\n\t\t} else {\n\t\t\tdelegate?.webSocket(self, didCloseWith: nil)\n\t\t}\n\t}\n\t\n\tfunc receiveAction(json: String) {\n\t\tdo {\n\t\t\tlet jsonData = json.data(using: .utf8)!\n\t\t\tlet obj = try JSONSerialization.jsonObject(with: jsonData, options: []) as! [String: Any]\n\t\t\t\n\t\t\tlet type = obj[\"type\"] as! String\n\t\t\tlet params = obj[\"params\"] as? [String: Any]\n\t\t\tlet messageId = obj[\"messageId\"] as! NSNumber\n\t\t\t\n\t\t\tlog.info(\"Action received: \\(type)\")\n\t\t\t\n\t\t\tdelegate?.webSocket(self, didReceiveAction: type, params: params ?? [:], messageId: messageId)\n\t\t} catch {\n\t\t\tlog.error(\"Error decoding receiveAction decode: \\(error.localizedDescription)\")\n\t\t}\n\t}\n\t\n\tfunc onDidOpen() {\n\t\tsendAction(\"login\", params: [\"sessionId\": sessionId!, \"role\": \"app\"], messageId: 0)\n\t}\n}\n"
  },
  {
    "path": "detox/ios/Detox.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 51;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t12BDDA602971652D00FDBBA8 /* UIApplication+DetoxActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12BDDA5F2971652D00FDBBA8 /* UIApplication+DetoxActions.swift */; };\n\t\t390DED83248906FC00E27BE8 /* UIWindow+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 390DED81248906FC00E27BE8 /* UIWindow+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t390DED84248906FC00E27BE8 /* UIWindow+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 390DED82248906FC00E27BE8 /* UIWindow+DetoxUtils.m */; };\n\t\t390DEDDC248D56F600E27BE8 /* String+LocalizedError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 390DEDDB248D56F600E27BE8 /* String+LocalizedError.swift */; };\n\t\t392324D72477D87D00A3D119 /* DetoxManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392324D62477D87D00A3D119 /* DetoxManager.swift */; };\n\t\t392324DF24781CBD00A3D119 /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392324DE24781CBD00A3D119 /* WebSocket.swift */; };\n\t\t392324E324782AE500A3D119 /* DetoxInit.m in Sources */ = {isa = PBXBuildFile; fileRef = 392324E124782AE500A3D119 /* DetoxInit.m */; };\n\t\t3928EFAA1E47404900C19B6E /* Detox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 394767971DBF985400D72256 /* Detox.framework */; };\n\t\t39319D7A1FCA0DA70045BC17 /* COSTouchVisualizer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };\n\t\t393E66ED1FC5F3F40092EE89 /* COSTouchVisualizer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */; };\n\t\t3946CD3E2566EB9E000A3606 /* NSObject+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3946CD3C2566EB9E000A3606 /* NSObject+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3946CD3F2566EB9E000A3606 /* NSObject+DetoxActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3946CD3D2566EB9E000A3606 /* NSObject+DetoxActions.m */; };\n\t\t3946CD442566EBC2000A3606 /* NSObject+DontCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 3946CD422566EBC2000A3606 /* NSObject+DontCrash.h */; };\n\t\t3946CD452566EBC2000A3606 /* NSObject+DontCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 3946CD432566EBC2000A3606 /* NSObject+DontCrash.m */; };\n\t\t3946CD492566EBCB000A3606 /* NSObject+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3946CD472566EBCB000A3606 /* NSObject+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3946CD4A2566EBCB000A3606 /* NSObject+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3946CD482566EBCB000A3606 /* NSObject+DetoxUtils.m */; };\n\t\t3947679C1DBF985400D72256 /* Detox.h in Headers */ = {isa = PBXBuildFile; fileRef = 3947679A1DBF985400D72256 /* Detox.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\t395B06E4256D5A5600941716 /* UIView+DetoxSpeedup.h in Headers */ = {isa = PBXBuildFile; fileRef = 395B06E2256D5A5600941716 /* UIView+DetoxSpeedup.h */; };\n\t\t395B06E5256D5A5600941716 /* UIView+DetoxSpeedup.m in Sources */ = {isa = PBXBuildFile; fileRef = 395B06E3256D5A5600941716 /* UIView+DetoxSpeedup.m */; };\n\t\t396D454425238B780096E7FA /* DetoxPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 396D454225238B780096E7FA /* DetoxPolicy.m */; };\n\t\t396D454525238B780096E7FA /* DetoxPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 396D454325238B780096E7FA /* DetoxPolicy.h */; };\n\t\t396D455225238BB90096E7FA /* UIView+Drawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 396D455025238BB90096E7FA /* UIView+Drawing.m */; };\n\t\t396D455325238BB90096E7FA /* UIView+Drawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 396D455125238BB90096E7FA /* UIView+Drawing.h */; };\n\t\t396D455725238BCE0096E7FA /* UIImage+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 396D455525238BCE0096E7FA /* UIImage+DetoxUtils.m */; };\n\t\t396D455825238BCE0096E7FA /* UIImage+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 396D455625238BCE0096E7FA /* UIImage+DetoxUtils.h */; };\n\t\t3976BF02246AC7DE00AA20C7 /* TimeInterval+DetoxUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3976BF01246AC7DE00AA20C7 /* TimeInterval+DetoxUtils.swift */; };\n\t\t397CA78C248010B5005E8A71 /* UISlider+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 397CA78A248010B5005E8A71 /* UISlider+DetoxUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\t397CA78D248010B5005E8A71 /* UISlider+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 397CA78B248010B5005E8A71 /* UISlider+DetoxUtils.m */; };\n\t\t397CA79F2483F07D005E8A71 /* ApproximateEquality.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397CA7982483F07D005E8A71 /* ApproximateEquality.swift */; };\n\t\t397CA7A324840449005E8A71 /* NSException+DetoxUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397CA7A224840449005E8A71 /* NSException+DetoxUtils.swift */; };\n\t\t3980D10F2448B52C004812DD /* UIApplication+DTXAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D0FE2448B52A004812DD /* UIApplication+DTXAdditions.h */; };\n\t\t3980D1102448B52C004812DD /* DTXSyntheticEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D0FF2448B52A004812DD /* DTXSyntheticEvents.m */; };\n\t\t3980D1122448B52C004812DD /* UIApplication+DTXAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D1012448B52B004812DD /* UIApplication+DTXAdditions.m */; };\n\t\t3980D1142448B52C004812DD /* DTXTouchInjector.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D1032448B52B004812DD /* DTXTouchInjector.h */; };\n\t\t3980D1162448B52C004812DD /* DTXTouchInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D1052448B52B004812DD /* DTXTouchInfo.m */; };\n\t\t3980D1172448B52C004812DD /* DTXRunLoopSpinner.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D1062448B52B004812DD /* DTXRunLoopSpinner.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D1182448B52C004812DD /* UITouch+DTXAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D1072448B52B004812DD /* UITouch+DTXAdditions.h */; };\n\t\t3980D1192448B52C004812DD /* UITouch+DTXAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D1082448B52B004812DD /* UITouch+DTXAdditions.m */; };\n\t\t3980D11A2448B52C004812DD /* DTXTouchInjector.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D1092448B52B004812DD /* DTXTouchInjector.m */; };\n\t\t3980D11B2448B52C004812DD /* DTXRunLoopSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D10A2448B52B004812DD /* DTXRunLoopSpinner.m */; };\n\t\t3980D11C2448B52C004812DD /* DTXSyntheticEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D10B2448B52B004812DD /* DTXSyntheticEvents.h */; };\n\t\t3980D11D2448B52C004812DD /* DTXAppleInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D10C2448B52C004812DD /* DTXAppleInternals.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D11E2448B52C004812DD /* DTXTouchInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D10D2448B52C004812DD /* DTXTouchInfo.h */; };\n\t\t3980D12E244C41E1004812DD /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3980D12D244C41E1004812DD /* IOKit.framework */; };\n\t\t3980D135244C4373004812DD /* UIView+DetoxMatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D133244C4373004812DD /* UIView+DetoxMatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D136244C4373004812DD /* UIView+DetoxMatchers.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D134244C4373004812DD /* UIView+DetoxMatchers.m */; };\n\t\t3980D158244C45EA004812DD /* Modifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D14B244C45E9004812DD /* Modifier.swift */; };\n\t\t3980D15A244C45EA004812DD /* Element.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D153244C45E9004812DD /* Element.swift */; };\n\t\t3980D15B244C45EA004812DD /* InvocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D154244C45E9004812DD /* InvocationManager.swift */; };\n\t\t3980D15C244C45EA004812DD /* Action.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D155244C45E9004812DD /* Action.swift */; };\n\t\t3980D15D244C45EA004812DD /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D156244C45E9004812DD /* Expectation.swift */; };\n\t\t3980D15E244C45EA004812DD /* Predicate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3980D157244C45E9004812DD /* Predicate.swift */; };\n\t\t3980D165244DC8F0004812DD /* UIPickerView+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D163244DC8F0004812DD /* UIPickerView+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D166244DC8F0004812DD /* UIPickerView+DetoxActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D164244DC8F0004812DD /* UIPickerView+DetoxActions.m */; };\n\t\t3980D169244DD837004812DD /* UIDatePicker+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D167244DD837004812DD /* UIDatePicker+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D16A244DD837004812DD /* UIDatePicker+DetoxActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D168244DD837004812DD /* UIDatePicker+DetoxActions.m */; };\n\t\t3980D16D244DDCD7004812DD /* UIScrollView+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3980D16B244DDCD7004812DD /* UIScrollView+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3980D16E244DDCD7004812DD /* UIScrollView+DetoxActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980D16C244DDCD7004812DD /* UIScrollView+DetoxActions.m */; };\n\t\t3990BA152457248600B608C8 /* UIView+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3990BA132457248600B608C8 /* UIView+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3990BA162457248600B608C8 /* UIView+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3990BA142457248600B608C8 /* UIView+DetoxUtils.m */; };\n\t\t3990BA28245882EF00B608C8 /* DTXAssertionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3990BA26245882EF00B608C8 /* DTXAssertionHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3990BA29245882EF00B608C8 /* DTXAssertionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3990BA27245882EF00B608C8 /* DTXAssertionHandler.m */; };\n\t\t3990BA36245AC98C00B608C8 /* DTXAssertionHandler+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3990BA35245AC98C00B608C8 /* DTXAssertionHandler+Swift.swift */; };\n\t\t39996B4C248555AB009B8E45 /* DTXDurationFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 39996B4A248555AB009B8E45 /* DTXDurationFormatter.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39996B4D248555AB009B8E45 /* DTXDurationFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 39996B4B248555AB009B8E45 /* DTXDurationFormatter.m */; };\n\t\t399BF36821933F0C00F96D50 /* ExternalLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 399BF36621933F0C00F96D50 /* ExternalLogging.h */; };\n\t\t399BF36921933F0C00F96D50 /* ExternalLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 399BF36721933F0C00F96D50 /* ExternalLogging.m */; };\n\t\t39A34C711E30F10D00BEBB59 /* DetoxAppDelegateProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 39A34C6F1E30F10D00BEBB59 /* DetoxAppDelegateProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39A34C721E30F10D00BEBB59 /* DetoxAppDelegateProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A34C701E30F10D00BEBB59 /* DetoxAppDelegateProxy.m */; };\n\t\t39AB2D31205ABBD90029CD1F /* DetoxUserActivityDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39AB2D30205ABBD90029CD1F /* DetoxUserActivityDispatcher.swift */; };\n\t\t39CA978C245B13CB00A7FC43 /* UIDevice+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 39CA978A245B13CB00A7FC43 /* UIDevice+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39CA978D245B13CB00A7FC43 /* UIDevice+DetoxActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 39CA978B245B13CB00A7FC43 /* UIDevice+DetoxActions.m */; };\n\t\t39CE25AB22197F0900D78AA1 /* DetoxInstrumentsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 39CE25A922197F0900D78AA1 /* DetoxInstrumentsManager.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39CE25AC22197F0900D78AA1 /* DetoxInstrumentsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 39CE25AA22197F0900D78AA1 /* DetoxInstrumentsManager.m */; };\n\t\t39CEFCDB1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CEFCDA1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift */; };\n\t\t39CF46212A2E1F50004A0CA3 /* String+matchesJSRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF46202A2E1F50004A0CA3 /* String+matchesJSRegex.swift */; };\n\t\t39D7BF9D24EAE520003E0694 /* LNViewHierarchyDumper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */; };\n\t\t39D7BF9E24EAE520003E0694 /* LNViewHierarchyDumper.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };\n\t\t39DC984724BB8E8900FFB224 /* DTXLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DC984424BB8E8900FFB224 /* DTXLogging.h */; };\n\t\t39DC984824BB8E8900FFB224 /* DTXLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 39DC984524BB8E8900FFB224 /* DTXLogging.m */; };\n\t\t39DC984924BB8E8900FFB224 /* DTXLogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39DC984624BB8E8900FFB224 /* DTXLogging.swift */; };\n\t\t39DC985624BB904D00FFB224 /* ReactNativeHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DC985124BB904D00FFB224 /* ReactNativeHeaders.h */; };\n\t\t39DC985724BB904D00FFB224 /* ReactNativeSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 39DC985224BB904D00FFB224 /* ReactNativeSupport.m */; };\n\t\t39DC985924BB904D00FFB224 /* ReactNativeSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DC985424BB904D00FFB224 /* ReactNativeSupport.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39DC985B24BB906A00FFB224 /* DetoxSync.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39DC984F24BB8FCD00FFB224 /* DetoxSync.framework */; };\n\t\t39DC985C24BB906A00FFB224 /* DetoxSync.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39DC984F24BB8FCD00FFB224 /* DetoxSync.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };\n\t\t39EECB4324BF4FDA009C3364 /* ReactNativeSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 39EECB4224BF4FDA009C3364 /* ReactNativeSupport.m */; };\n\t\t39EECB7C24C0A5AF009C3364 /* NSThread+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 39EECB7A24C0A5AE009C3364 /* NSThread+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t39EECB7D24C0A5AF009C3364 /* NSThread+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 39EECB7B24C0A5AF009C3364 /* NSThread+DetoxUtils.m */; };\n\t\t39FFD9471FD730A600C97030 /* DetoxCrashHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39FFD9451FD730A600C97030 /* DetoxCrashHandler.mm */; };\n\t\t600A0A762B923B1F00937051 /* WebExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A752B923B1F00937051 /* WebExpectation.swift */; };\n\t\t600A0A792B93097200937051 /* WKWebView+findView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A782B93097200937051 /* WKWebView+findView.swift */; };\n\t\t600A0A7B2B9376D600937051 /* WebCodeBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A7A2B9376D600937051 /* WebCodeBuilder.swift */; };\n\t\t600A0A852B966F9000937051 /* WebAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A842B966F9000937051 /* WebAction.swift */; };\n\t\t600A0A872B966FBE00937051 /* WebPredicate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A862B966FBE00937051 /* WebPredicate.swift */; };\n\t\t600A0A892B966FE200937051 /* WebPredicateType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0A882B966FE200937051 /* WebPredicateType.swift */; };\n\t\t600A0AA62B998B2700937051 /* WebActionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AA52B998B2700937051 /* WebActionType.swift */; };\n\t\t600A0AA82B998B4200937051 /* WebExpectationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AA72B998B4200937051 /* WebExpectationType.swift */; };\n\t\t600A0AAA2B998B5500937051 /* WebExpectationModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AA92B998B5500937051 /* WebExpectationModifier.swift */; };\n\t\t600A0AAC2B998C1800937051 /* WebInteraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AAB2B998C1800937051 /* WebInteraction.swift */; };\n\t\t600A0AAE2B999D2300937051 /* WKWebView+evaluateJSAfterLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AAD2B999D2300937051 /* WKWebView+evaluateJSAfterLoading.swift */; };\n\t\t600A0AB22B99B1D100937051 /* WebCodeBuilder+createAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AB12B99B1D100937051 /* WebCodeBuilder+createAction.swift */; };\n\t\t600A0AB42B99B1DF00937051 /* WebCodeBuilder+createExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AB32B99B1DF00937051 /* WebCodeBuilder+createExpectation.swift */; };\n\t\t600A0AB62B99B23800937051 /* WebCodeBuilder+createSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AB52B99B23800937051 /* WebCodeBuilder+createSelector.swift */; };\n\t\t600A0ACE2B9B60F800937051 /* WebCodeBuilder+createTapAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0ACD2B9B60F800937051 /* WebCodeBuilder+createTapAction.swift */; };\n\t\t600A0AD02B9B625600937051 /* WebCodeBuilder+createFocusAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0ACF2B9B625600937051 /* WebCodeBuilder+createFocusAction.swift */; };\n\t\t600A0AD22B9C39EE00937051 /* WebCodeBuilder+createTypeAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AD12B9C39EE00937051 /* WebCodeBuilder+createTypeAction.swift */; };\n\t\t600A0AD42B9C407900937051 /* WebCodeBuilder+createGetURLAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AD32B9C407900937051 /* WebCodeBuilder+createGetURLAction.swift */; };\n\t\t600A0AD62B9C410900937051 /* WebCodeBuilder+createGetTextAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AD52B9C410900937051 /* WebCodeBuilder+createGetTextAction.swift */; };\n\t\t600A0AD82B9C41C400937051 /* WebCodeBuilder+createGetTitleAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AD72B9C41C400937051 /* WebCodeBuilder+createGetTitleAction.swift */; };\n\t\t600A0ADA2B9C7E5900937051 /* WebCodeBuilder+createMoveCursorToEndAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0AD92B9C7E5900937051 /* WebCodeBuilder+createMoveCursorToEndAction.swift */; };\n\t\t600A0ADC2B9C7F9D00937051 /* WebCodeBuilder+createRunScriptAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0ADB2B9C7F9D00937051 /* WebCodeBuilder+createRunScriptAction.swift */; };\n\t\t600A0ADE2B9C817500937051 /* WebCodeBuilder+createSelectAllTextAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0ADD2B9C817500937051 /* WebCodeBuilder+createSelectAllTextAction.swift */; };\n\t\t600A0AE02B9C835800937051 /* WebCodeBuilder+createScrollIntoViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 600A0ADF2B9C835800937051 /* WebCodeBuilder+createScrollIntoViewAction.swift */; };\n\t\t601A40DC2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.h in Headers */ = {isa = PBXBuildFile; fileRef = 601A40DA2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.h */; };\n\t\t601A40DD2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.m in Sources */ = {isa = PBXBuildFile; fileRef = 601A40DB2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.m */; };\n\t\t604932B52C8070D5002EFCC9 /* ViewHierarchyGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 604932B42C8070D5002EFCC9 /* ViewHierarchyGenerator.swift */; };\n\t\t6062B5E12720323700CBDBF0 /* DTXAddressInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6062B5DB2720323600CBDBF0 /* DTXAddressInfo.h */; };\n\t\t6062B5E22720323700CBDBF0 /* DTXSwizzlingHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6062B5DC2720323600CBDBF0 /* DTXSwizzlingHelper.h */; };\n\t\t6062B5E32720323700CBDBF0 /* NSArray+Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 6062B5DD2720323700CBDBF0 /* NSArray+Utils.h */; };\n\t\t6062B5E42720323700CBDBF0 /* NSArray+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 6062B5DE2720323700CBDBF0 /* NSArray+Utils.m */; };\n\t\t6062B5E52720323700CBDBF0 /* Swiftier.h in Headers */ = {isa = PBXBuildFile; fileRef = 6062B5DF2720323700CBDBF0 /* Swiftier.h */; };\n\t\t6062B5E62720323700CBDBF0 /* DTXAddressInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6062B5E02720323700CBDBF0 /* DTXAddressInfo.mm */; };\n\t\t60C1961A271F11C4000172DD /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = 60C19618271F11C4000172DD /* fishhook.h */; };\n\t\t60C1961B271F11C4000172DD /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 60C19619271F11C4000172DD /* fishhook.c */; };\n\t\t60E149C72759038F00519EE4 /* UIResponder+First.h in Headers */ = {isa = PBXBuildFile; fileRef = 60E149C52759038F00519EE4 /* UIResponder+First.h */; };\n\t\t60E149C82759038F00519EE4 /* UIResponder+First.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E149C62759038F00519EE4 /* UIResponder+First.m */; };\n\t\t7D3919BE2E890DBB00D16E3A /* DetoxSwiftBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D3919BA2E890DBB00D16E3A /* DetoxSwiftBridge.h */; };\n\t\t7D3919C02E890F0E00D16E3A /* DetoxSwiftBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3919BF2E890F0E00D16E3A /* DetoxSwiftBridge.m */; };\n\t\tAD4781082636F7CF006774CD /* NSURL+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4781062636F7CE006774CD /* NSURL+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\tAD4781092636F7CF006774CD /* NSURL+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = AD4781072636F7CF006774CD /* NSURL+DetoxUtils.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t3928EFAB1E47404900C19B6E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 3947678E1DBF985400D72256 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 394767961DBF985400D72256;\n\t\t\tremoteInfo = Detox;\n\t\t};\n\t\t393E66E51FC5F3E90092EE89 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A71946A71C7EF890003B7C4A;\n\t\t\tremoteInfo = COSTouchVisualizer;\n\t\t};\n\t\t393E67011FC728360092EE89 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A71946A61C7EF890003B7C4A;\n\t\t\tremoteInfo = COSTouchVisualizer;\n\t\t};\n\t\t39CF46232A2E1F50004A0CA3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 602F956A274528ED00BAFA74;\n\t\t\tremoteInfo = DetoxSyncTests;\n\t\t};\n\t\t39D7BF9424EAE510003E0694 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 39CA7FF524AEA316009883BC;\n\t\t\tremoteInfo = LNViewHierarchyDumper;\n\t\t};\n\t\t39D7BF9B24EAE51B003E0694 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 39CA7FF424AEA316009883BC;\n\t\t\tremoteInfo = LNViewHierarchyDumper;\n\t\t};\n\t\t39DC984E24BB8FCD00FFB224 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 39DE8F5222F707DD00780546;\n\t\t\tremoteInfo = DetoxSync;\n\t\t};\n\t\t39DC985D24BB907200FFB224 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 39DE8F5122F707DD00780546;\n\t\t\tremoteInfo = DetoxSync;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t39C3C34B1DBF9A05008177E1 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t\t39D7BF9E24EAE520003E0694 /* LNViewHierarchyDumper.framework in CopyFiles */,\n\t\t\t\t39319D7A1FCA0DA70045BC17 /* COSTouchVisualizer.framework in CopyFiles */,\n\t\t\t\t39DC985C24BB906A00FFB224 /* DetoxSync.framework in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t12BDDA5F2971652D00FDBBA8 /* UIApplication+DetoxActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"UIApplication+DetoxActions.swift\"; sourceTree = \"<group>\"; };\n\t\t390D1C981E3A2893007F5F46 /* Detox.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Detox.xcconfig; sourceTree = \"<group>\"; };\n\t\t390DED81248906FC00E27BE8 /* UIWindow+DetoxUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIWindow+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t390DED82248906FC00E27BE8 /* UIWindow+DetoxUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIWindow+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t390DEDDB248D56F600E27BE8 /* String+LocalizedError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"String+LocalizedError.swift\"; sourceTree = \"<group>\"; };\n\t\t392324D62477D87D00A3D119 /* DetoxManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetoxManager.swift; sourceTree = \"<group>\"; };\n\t\t392324DE24781CBD00A3D119 /* WebSocket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSocket.swift; sourceTree = \"<group>\"; };\n\t\t392324E124782AE500A3D119 /* DetoxInit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetoxInit.m; sourceTree = \"<group>\"; };\n\t\t3928EFA51E47404900C19B6E /* DetoxUserNotificationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DetoxUserNotificationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = COSTouchVisualizer.xcodeproj; path = COSTouchVisualizer/Classes/COSTouchVisualizer.xcodeproj; sourceTree = \"<group>\"; };\n\t\t3946CD3C2566EB9E000A3606 /* NSObject+DetoxActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSObject+DetoxActions.h\"; sourceTree = \"<group>\"; };\n\t\t3946CD3D2566EB9E000A3606 /* NSObject+DetoxActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSObject+DetoxActions.m\"; sourceTree = \"<group>\"; };\n\t\t3946CD422566EBC2000A3606 /* NSObject+DontCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSObject+DontCrash.h\"; sourceTree = \"<group>\"; };\n\t\t3946CD432566EBC2000A3606 /* NSObject+DontCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSObject+DontCrash.m\"; sourceTree = \"<group>\"; };\n\t\t3946CD472566EBCB000A3606 /* NSObject+DetoxUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSObject+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t3946CD482566EBCB000A3606 /* NSObject+DetoxUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSObject+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t394767971DBF985400D72256 /* Detox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Detox.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3947679A1DBF985400D72256 /* Detox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Detox.h; sourceTree = \"<group>\"; };\n\t\t3947679B1DBF985400D72256 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t395B06E2256D5A5600941716 /* UIView+DetoxSpeedup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIView+DetoxSpeedup.h\"; sourceTree = \"<group>\"; };\n\t\t395B06E3256D5A5600941716 /* UIView+DetoxSpeedup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIView+DetoxSpeedup.m\"; sourceTree = \"<group>\"; };\n\t\t396D454225238B780096E7FA /* DetoxPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetoxPolicy.m; sourceTree = \"<group>\"; };\n\t\t396D454325238B780096E7FA /* DetoxPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetoxPolicy.h; sourceTree = \"<group>\"; };\n\t\t396D455025238BB90096E7FA /* UIView+Drawing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIView+Drawing.m\"; sourceTree = \"<group>\"; };\n\t\t396D455125238BB90096E7FA /* UIView+Drawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIView+Drawing.h\"; sourceTree = \"<group>\"; };\n\t\t396D455525238BCE0096E7FA /* UIImage+DetoxUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIImage+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t396D455625238BCE0096E7FA /* UIImage+DetoxUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIImage+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t3975C78220272ED500C59ED8 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../src; sourceTree = \"<group>\"; };\n\t\t3976BF01246AC7DE00AA20C7 /* TimeInterval+DetoxUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"TimeInterval+DetoxUtils.swift\"; sourceTree = \"<group>\"; };\n\t\t397CA78A248010B5005E8A71 /* UISlider+DetoxUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UISlider+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t397CA78B248010B5005E8A71 /* UISlider+DetoxUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UISlider+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t397CA7982483F07D005E8A71 /* ApproximateEquality.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApproximateEquality.swift; sourceTree = \"<group>\"; };\n\t\t397CA7A224840449005E8A71 /* NSException+DetoxUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"NSException+DetoxUtils.swift\"; sourceTree = \"<group>\"; };\n\t\t3980D0FE2448B52A004812DD /* UIApplication+DTXAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIApplication+DTXAdditions.h\"; sourceTree = \"<group>\"; };\n\t\t3980D0FF2448B52A004812DD /* DTXSyntheticEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTXSyntheticEvents.m; sourceTree = \"<group>\"; };\n\t\t3980D1012448B52B004812DD /* UIApplication+DTXAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIApplication+DTXAdditions.m\"; sourceTree = \"<group>\"; };\n\t\t3980D1032448B52B004812DD /* DTXTouchInjector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTXTouchInjector.h; sourceTree = \"<group>\"; };\n\t\t3980D1052448B52B004812DD /* DTXTouchInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTXTouchInfo.m; sourceTree = \"<group>\"; };\n\t\t3980D1062448B52B004812DD /* DTXRunLoopSpinner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTXRunLoopSpinner.h; sourceTree = \"<group>\"; };\n\t\t3980D1072448B52B004812DD /* UITouch+DTXAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UITouch+DTXAdditions.h\"; sourceTree = \"<group>\"; };\n\t\t3980D1082448B52B004812DD /* UITouch+DTXAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UITouch+DTXAdditions.m\"; sourceTree = \"<group>\"; };\n\t\t3980D1092448B52B004812DD /* DTXTouchInjector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTXTouchInjector.m; sourceTree = \"<group>\"; };\n\t\t3980D10A2448B52B004812DD /* DTXRunLoopSpinner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTXRunLoopSpinner.m; sourceTree = \"<group>\"; };\n\t\t3980D10B2448B52B004812DD /* DTXSyntheticEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTXSyntheticEvents.h; sourceTree = \"<group>\"; };\n\t\t3980D10C2448B52C004812DD /* DTXAppleInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTXAppleInternals.h; sourceTree = \"<group>\"; };\n\t\t3980D10D2448B52C004812DD /* DTXTouchInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTXTouchInfo.h; sourceTree = \"<group>\"; };\n\t\t3980D12D244C41E1004812DD /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/IOKit.framework; sourceTree = DEVELOPER_DIR; };\n\t\t3980D133244C4373004812DD /* UIView+DetoxMatchers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIView+DetoxMatchers.h\"; sourceTree = \"<group>\"; };\n\t\t3980D134244C4373004812DD /* UIView+DetoxMatchers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIView+DetoxMatchers.m\"; sourceTree = \"<group>\"; };\n\t\t3980D14B244C45E9004812DD /* Modifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Modifier.swift; sourceTree = \"<group>\"; };\n\t\t3980D153244C45E9004812DD /* Element.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Element.swift; sourceTree = \"<group>\"; };\n\t\t3980D154244C45E9004812DD /* InvocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InvocationManager.swift; sourceTree = \"<group>\"; };\n\t\t3980D155244C45E9004812DD /* Action.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Action.swift; sourceTree = \"<group>\"; };\n\t\t3980D156244C45E9004812DD /* Expectation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Expectation.swift; sourceTree = \"<group>\"; };\n\t\t3980D157244C45E9004812DD /* Predicate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Predicate.swift; sourceTree = \"<group>\"; wrapsLines = 0; };\n\t\t3980D162244C689A004812DD /* Detox.modulemap */ = {isa = PBXFileReference; lastKnownFileType = \"sourcecode.module-map\"; path = Detox.modulemap; sourceTree = \"<group>\"; };\n\t\t3980D163244DC8F0004812DD /* UIPickerView+DetoxActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIPickerView+DetoxActions.h\"; sourceTree = \"<group>\"; };\n\t\t3980D164244DC8F0004812DD /* UIPickerView+DetoxActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIPickerView+DetoxActions.m\"; sourceTree = \"<group>\"; };\n\t\t3980D167244DD837004812DD /* UIDatePicker+DetoxActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIDatePicker+DetoxActions.h\"; sourceTree = \"<group>\"; };\n\t\t3980D168244DD837004812DD /* UIDatePicker+DetoxActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIDatePicker+DetoxActions.m\"; sourceTree = \"<group>\"; };\n\t\t3980D16B244DDCD7004812DD /* UIScrollView+DetoxActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIScrollView+DetoxActions.h\"; sourceTree = \"<group>\"; };\n\t\t3980D16C244DDCD7004812DD /* UIScrollView+DetoxActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIScrollView+DetoxActions.m\"; sourceTree = \"<group>\"; };\n\t\t3990BA052457093800B608C8 /* DTXTouchInfo-Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"DTXTouchInfo-Private.h\"; sourceTree = \"<group>\"; };\n\t\t3990BA132457248600B608C8 /* UIView+DetoxUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIView+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t3990BA142457248600B608C8 /* UIView+DetoxUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIView+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t3990BA26245882EF00B608C8 /* DTXAssertionHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTXAssertionHandler.h; sourceTree = \"<group>\"; };\n\t\t3990BA27245882EF00B608C8 /* DTXAssertionHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTXAssertionHandler.m; sourceTree = \"<group>\"; };\n\t\t3990BA35245AC98C00B608C8 /* DTXAssertionHandler+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"DTXAssertionHandler+Swift.swift\"; sourceTree = \"<group>\"; };\n\t\t39996B4A248555AB009B8E45 /* DTXDurationFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTXDurationFormatter.h; sourceTree = \"<group>\"; };\n\t\t39996B4B248555AB009B8E45 /* DTXDurationFormatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTXDurationFormatter.m; sourceTree = \"<group>\"; };\n\t\t399BF36621933F0C00F96D50 /* ExternalLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExternalLogging.h; sourceTree = \"<group>\"; };\n\t\t399BF36721933F0C00F96D50 /* ExternalLogging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExternalLogging.m; sourceTree = \"<group>\"; };\n\t\t39A34C6F1E30F10D00BEBB59 /* DetoxAppDelegateProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetoxAppDelegateProxy.h; sourceTree = \"<group>\"; };\n\t\t39A34C701E30F10D00BEBB59 /* DetoxAppDelegateProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetoxAppDelegateProxy.m; sourceTree = \"<group>\"; };\n\t\t39AB2D30205ABBD90029CD1F /* DetoxUserActivityDispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetoxUserActivityDispatcher.swift; sourceTree = \"<group>\"; };\n\t\t39CA978A245B13CB00A7FC43 /* UIDevice+DetoxActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIDevice+DetoxActions.h\"; sourceTree = \"<group>\"; };\n\t\t39CA978B245B13CB00A7FC43 /* UIDevice+DetoxActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIDevice+DetoxActions.m\"; sourceTree = \"<group>\"; };\n\t\t39CE25A922197F0900D78AA1 /* DetoxInstrumentsManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetoxInstrumentsManager.h; sourceTree = \"<group>\"; };\n\t\t39CE25AA22197F0900D78AA1 /* DetoxInstrumentsManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetoxInstrumentsManager.m; sourceTree = \"<group>\"; };\n\t\t39CEFCDA1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetoxUserNotificationDispatcher.swift; sourceTree = \"<group>\"; };\n\t\t39CF46202A2E1F50004A0CA3 /* String+matchesJSRegex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"String+matchesJSRegex.swift\"; sourceTree = \"<group>\"; };\n\t\t39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = LNViewHierarchyDumper.xcodeproj; path = LNViewHierarchyDumper/LNViewHierarchyDumper/LNViewHierarchyDumper.xcodeproj; sourceTree = SOURCE_ROOT; };\n\t\t39DC984424BB8E8900FFB224 /* DTXLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DTXLogging.h; path = DTXLoggingInfra/DTXLogging.h; sourceTree = SOURCE_ROOT; };\n\t\t39DC984524BB8E8900FFB224 /* DTXLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DTXLogging.m; path = DTXLoggingInfra/DTXLogging.m; sourceTree = SOURCE_ROOT; };\n\t\t39DC984624BB8E8900FFB224 /* DTXLogging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DTXLogging.swift; path = DTXLoggingInfra/DTXLogging.swift; sourceTree = SOURCE_ROOT; };\n\t\t39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = DetoxSync.xcodeproj; path = DetoxSync/DetoxSync/DetoxSync.xcodeproj; sourceTree = SOURCE_ROOT; };\n\t\t39DC985124BB904D00FFB224 /* ReactNativeHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReactNativeHeaders.h; sourceTree = \"<group>\"; };\n\t\t39DC985224BB904D00FFB224 /* ReactNativeSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeSupport.m; sourceTree = \"<group>\"; };\n\t\t39DC985424BB904D00FFB224 /* ReactNativeSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReactNativeSupport.h; sourceTree = \"<group>\"; };\n\t\t39E91C06247D6BB00099F8F3 /* DetoxCrashHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetoxCrashHandler.h; sourceTree = \"<group>\"; };\n\t\t39EECB4224BF4FDA009C3364 /* ReactNativeSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeSupport.m; sourceTree = \"<group>\"; };\n\t\t39EECB7A24C0A5AE009C3364 /* NSThread+DetoxUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"NSThread+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\t39EECB7B24C0A5AF009C3364 /* NSThread+DetoxUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"NSThread+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n\t\t39F6422A1FDD5EEC00468FED /* Detox.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Detox.pch; sourceTree = \"<group>\"; };\n\t\t39F6422B1FDD5F3300468FED /* DTXLoggingSubsystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTXLoggingSubsystem.h; sourceTree = \"<group>\"; };\n\t\t39FFD9451FD730A600C97030 /* DetoxCrashHandler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DetoxCrashHandler.mm; sourceTree = \"<group>\"; };\n\t\t600A0A752B923B1F00937051 /* WebExpectation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebExpectation.swift; sourceTree = \"<group>\"; };\n\t\t600A0A782B93097200937051 /* WKWebView+findView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WKWebView+findView.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0A7A2B9376D600937051 /* WebCodeBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebCodeBuilder.swift; sourceTree = \"<group>\"; };\n\t\t600A0A842B966F9000937051 /* WebAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebAction.swift; sourceTree = \"<group>\"; };\n\t\t600A0A862B966FBE00937051 /* WebPredicate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPredicate.swift; sourceTree = \"<group>\"; };\n\t\t600A0A882B966FE200937051 /* WebPredicateType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPredicateType.swift; sourceTree = \"<group>\"; };\n\t\t600A0AA52B998B2700937051 /* WebActionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebActionType.swift; sourceTree = \"<group>\"; };\n\t\t600A0AA72B998B4200937051 /* WebExpectationType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebExpectationType.swift; sourceTree = \"<group>\"; };\n\t\t600A0AA92B998B5500937051 /* WebExpectationModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebExpectationModifier.swift; sourceTree = \"<group>\"; };\n\t\t600A0AAB2B998C1800937051 /* WebInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebInteraction.swift; sourceTree = \"<group>\"; };\n\t\t600A0AAD2B999D2300937051 /* WKWebView+evaluateJSAfterLoading.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WKWebView+evaluateJSAfterLoading.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AB12B99B1D100937051 /* WebCodeBuilder+createAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AB32B99B1DF00937051 /* WebCodeBuilder+createExpectation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createExpectation.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AB52B99B23800937051 /* WebCodeBuilder+createSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createSelector.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0ACD2B9B60F800937051 /* WebCodeBuilder+createTapAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createTapAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0ACF2B9B625600937051 /* WebCodeBuilder+createFocusAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createFocusAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AD12B9C39EE00937051 /* WebCodeBuilder+createTypeAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createTypeAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AD32B9C407900937051 /* WebCodeBuilder+createGetURLAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createGetURLAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AD52B9C410900937051 /* WebCodeBuilder+createGetTextAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createGetTextAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AD72B9C41C400937051 /* WebCodeBuilder+createGetTitleAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createGetTitleAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0AD92B9C7E5900937051 /* WebCodeBuilder+createMoveCursorToEndAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createMoveCursorToEndAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0ADB2B9C7F9D00937051 /* WebCodeBuilder+createRunScriptAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createRunScriptAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0ADD2B9C817500937051 /* WebCodeBuilder+createSelectAllTextAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createSelectAllTextAction.swift\"; sourceTree = \"<group>\"; };\n\t\t600A0ADF2B9C835800937051 /* WebCodeBuilder+createScrollIntoViewAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"WebCodeBuilder+createScrollIntoViewAction.swift\"; sourceTree = \"<group>\"; };\n\t\t601A40DA2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"WKWebViewConfiguration+Detox.h\"; sourceTree = \"<group>\"; };\n\t\t601A40DB2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"WKWebViewConfiguration+Detox.m\"; sourceTree = \"<group>\"; };\n\t\t604932B42C8070D5002EFCC9 /* ViewHierarchyGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewHierarchyGenerator.swift; sourceTree = \"<group>\"; };\n\t\t6062B5DB2720323600CBDBF0 /* DTXAddressInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DTXAddressInfo.h; path = DetoxSync/DetoxSync/DTXObjectiveCHelpers/DTXAddressInfo.h; sourceTree = SOURCE_ROOT; };\n\t\t6062B5DC2720323600CBDBF0 /* DTXSwizzlingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DTXSwizzlingHelper.h; path = DetoxSync/DetoxSync/DTXObjectiveCHelpers/DTXSwizzlingHelper.h; sourceTree = SOURCE_ROOT; };\n\t\t6062B5DD2720323700CBDBF0 /* NSArray+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"NSArray+Utils.h\"; path = \"DetoxSync/DetoxSync/DTXObjectiveCHelpers/NSArray+Utils.h\"; sourceTree = SOURCE_ROOT; };\n\t\t6062B5DE2720323700CBDBF0 /* NSArray+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = \"NSArray+Utils.m\"; path = \"DetoxSync/DetoxSync/DTXObjectiveCHelpers/NSArray+Utils.m\"; sourceTree = SOURCE_ROOT; };\n\t\t6062B5DF2720323700CBDBF0 /* Swiftier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Swiftier.h; path = DetoxSync/DetoxSync/DTXObjectiveCHelpers/Swiftier.h; sourceTree = SOURCE_ROOT; };\n\t\t6062B5E02720323700CBDBF0 /* DTXAddressInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DTXAddressInfo.mm; path = DetoxSync/DetoxSync/DTXObjectiveCHelpers/DTXAddressInfo.mm; sourceTree = SOURCE_ROOT; };\n\t\t60C19618271F11C4000172DD /* fishhook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fishhook.h; path = DetoxSync/DetoxSync/fishhook/fishhook.h; sourceTree = SOURCE_ROOT; };\n\t\t60C19619271F11C4000172DD /* fishhook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fishhook.c; path = DetoxSync/DetoxSync/fishhook/fishhook.c; sourceTree = SOURCE_ROOT; };\n\t\t60E149C52759038F00519EE4 /* UIResponder+First.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIResponder+First.h\"; sourceTree = \"<group>\"; };\n\t\t60E149C62759038F00519EE4 /* UIResponder+First.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"UIResponder+First.m\"; sourceTree = \"<group>\"; };\n\t\t7D3919BA2E890DBB00D16E3A /* DetoxSwiftBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetoxSwiftBridge.h; sourceTree = \"<group>\"; };\n\t\t7D3919BF2E890F0E00D16E3A /* DetoxSwiftBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetoxSwiftBridge.m; sourceTree = \"<group>\"; };\n\t\tAD4781062636F7CE006774CD /* NSURL+DetoxUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"NSURL+DetoxUtils.h\"; sourceTree = \"<group>\"; };\n\t\tAD4781072636F7CF006774CD /* NSURL+DetoxUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"NSURL+DetoxUtils.m\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t3928EFA21E47404900C19B6E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3928EFAA1E47404900C19B6E /* Detox.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t394767931DBF985400D72256 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t39DC985B24BB906A00FFB224 /* DetoxSync.framework in Frameworks */,\n\t\t\t\t393E66ED1FC5F3F40092EE89 /* COSTouchVisualizer.framework in Frameworks */,\n\t\t\t\t39D7BF9D24EAE520003E0694 /* LNViewHierarchyDumper.framework in Frameworks */,\n\t\t\t\t3980D12E244C41E1004812DD /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t39232594247AAAAC00A3D119 /* Assertions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3990BA26245882EF00B608C8 /* DTXAssertionHandler.h */,\n\t\t\t\t3990BA27245882EF00B608C8 /* DTXAssertionHandler.m */,\n\t\t\t\t3990BA35245AC98C00B608C8 /* DTXAssertionHandler+Swift.swift */,\n\t\t\t);\n\t\t\tpath = Assertions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t393E66E21FC5F3E90092EE89 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t39408DEE1FE6368100C20BD5 /* JS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3975C78220272ED500C59ED8 /* src */,\n\t\t\t);\n\t\t\tname = JS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3947678D1DBF985400D72256 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t394767991DBF985400D72256 /* Detox */,\n\t\t\t\t39408DEE1FE6368100C20BD5 /* JS */,\n\t\t\t\t394767D61DBF990F00D72256 /* Frameworks */,\n\t\t\t\t394767981DBF985400D72256 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t\tusesTabs = 1;\n\t\t};\n\t\t394767981DBF985400D72256 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t394767971DBF985400D72256 /* Detox.framework */,\n\t\t\t\t3928EFA51E47404900C19B6E /* DetoxUserNotificationTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t394767991DBF985400D72256 /* Detox */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3980D131244C4336004812DD /* Actions */,\n\t\t\t\t3980D12B244C40D2004812DD /* AppleInternals */,\n\t\t\t\t3980D12C244C40E2004812DD /* AppleTouchEvents */,\n\t\t\t\t39232594247AAAAC00A3D119 /* Assertions */,\n\t\t\t\t3980D13C244C44C3004812DD /* Invocation */,\n\t\t\t\t396D453C25238B430096E7FA /* Policy */,\n\t\t\t\t3980D132244C435B004812DD /* Matchers */,\n\t\t\t\t3980D130244C42E7004812DD /* Utilities */,\n\t\t\t\t392324E124782AE500A3D119 /* DetoxInit.m */,\n\t\t\t\t39A34C6F1E30F10D00BEBB59 /* DetoxAppDelegateProxy.h */,\n\t\t\t\t39A34C701E30F10D00BEBB59 /* DetoxAppDelegateProxy.m */,\n\t\t\t\t392324D62477D87D00A3D119 /* DetoxManager.swift */,\n\t\t\t\t3947679A1DBF985400D72256 /* Detox.h */,\n\t\t\t\t39F6422A1FDD5EEC00468FED /* Detox.pch */,\n\t\t\t\t3947679B1DBF985400D72256 /* Info.plist */,\n\t\t\t\t390D1C981E3A2893007F5F46 /* Detox.xcconfig */,\n\t\t\t\t3980D162244C689A004812DD /* Detox.modulemap */,\n\t\t\t);\n\t\t\tpath = Detox;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t394767D61DBF990F00D72256 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3980D12D244C41E1004812DD /* IOKit.framework */,\n\t\t\t\t393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t396D453C25238B430096E7FA /* Policy */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t396D454325238B780096E7FA /* DetoxPolicy.h */,\n\t\t\t\t396D454225238B780096E7FA /* DetoxPolicy.m */,\n\t\t\t);\n\t\t\tpath = Policy;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D12B244C40D2004812DD /* AppleInternals */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3980D10C2448B52C004812DD /* DTXAppleInternals.h */,\n\t\t\t);\n\t\t\tpath = AppleInternals;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D12C244C40E2004812DD /* AppleTouchEvents */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3980D10B2448B52B004812DD /* DTXSyntheticEvents.h */,\n\t\t\t\t3980D0FF2448B52A004812DD /* DTXSyntheticEvents.m */,\n\t\t\t\t3990BA052457093800B608C8 /* DTXTouchInfo-Private.h */,\n\t\t\t\t3980D10D2448B52C004812DD /* DTXTouchInfo.h */,\n\t\t\t\t3980D1052448B52B004812DD /* DTXTouchInfo.m */,\n\t\t\t\t3980D1032448B52B004812DD /* DTXTouchInjector.h */,\n\t\t\t\t3980D1092448B52B004812DD /* DTXTouchInjector.m */,\n\t\t\t\t3980D1072448B52B004812DD /* UITouch+DTXAdditions.h */,\n\t\t\t\t3980D1082448B52B004812DD /* UITouch+DTXAdditions.m */,\n\t\t\t);\n\t\t\tpath = AppleTouchEvents;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D130244C42E7004812DD /* Utilities */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t7D3919BC2E890DBB00D16E3A /* SwiftSupport */,\n\t\t\t\t397CA7982483F07D005E8A71 /* ApproximateEquality.swift */,\n\t\t\t\t39E91C06247D6BB00099F8F3 /* DetoxCrashHandler.h */,\n\t\t\t\t39FFD9451FD730A600C97030 /* DetoxCrashHandler.mm */,\n\t\t\t\t39CE25A922197F0900D78AA1 /* DetoxInstrumentsManager.h */,\n\t\t\t\t39CE25AA22197F0900D78AA1 /* DetoxInstrumentsManager.m */,\n\t\t\t\t39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */,\n\t\t\t\t39AB2D30205ABBD90029CD1F /* DetoxUserActivityDispatcher.swift */,\n\t\t\t\t39CEFCDA1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift */,\n\t\t\t\t6062B5DB2720323600CBDBF0 /* DTXAddressInfo.h */,\n\t\t\t\t6062B5E02720323700CBDBF0 /* DTXAddressInfo.mm */,\n\t\t\t\t39996B4A248555AB009B8E45 /* DTXDurationFormatter.h */,\n\t\t\t\t39996B4B248555AB009B8E45 /* DTXDurationFormatter.m */,\n\t\t\t\t39DC984424BB8E8900FFB224 /* DTXLogging.h */,\n\t\t\t\t39DC984524BB8E8900FFB224 /* DTXLogging.m */,\n\t\t\t\t39DC984624BB8E8900FFB224 /* DTXLogging.swift */,\n\t\t\t\t39F6422B1FDD5F3300468FED /* DTXLoggingSubsystem.h */,\n\t\t\t\t3980D1062448B52B004812DD /* DTXRunLoopSpinner.h */,\n\t\t\t\t3980D10A2448B52B004812DD /* DTXRunLoopSpinner.m */,\n\t\t\t\t6062B5DC2720323600CBDBF0 /* DTXSwizzlingHelper.h */,\n\t\t\t\t399BF36621933F0C00F96D50 /* ExternalLogging.h */,\n\t\t\t\t399BF36721933F0C00F96D50 /* ExternalLogging.m */,\n\t\t\t\t60C19618271F11C4000172DD /* fishhook.h */,\n\t\t\t\t60C19619271F11C4000172DD /* fishhook.c */,\n\t\t\t\t39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */,\n\t\t\t\t6062B5DD2720323700CBDBF0 /* NSArray+Utils.h */,\n\t\t\t\t6062B5DE2720323700CBDBF0 /* NSArray+Utils.m */,\n\t\t\t\t397CA7A224840449005E8A71 /* NSException+DetoxUtils.swift */,\n\t\t\t\t3946CD472566EBCB000A3606 /* NSObject+DetoxUtils.h */,\n\t\t\t\t3946CD482566EBCB000A3606 /* NSObject+DetoxUtils.m */,\n\t\t\t\t3946CD422566EBC2000A3606 /* NSObject+DontCrash.h */,\n\t\t\t\t3946CD432566EBC2000A3606 /* NSObject+DontCrash.m */,\n\t\t\t\t39EECB7A24C0A5AE009C3364 /* NSThread+DetoxUtils.h */,\n\t\t\t\t39EECB7B24C0A5AF009C3364 /* NSThread+DetoxUtils.m */,\n\t\t\t\tAD4781062636F7CE006774CD /* NSURL+DetoxUtils.h */,\n\t\t\t\tAD4781072636F7CF006774CD /* NSURL+DetoxUtils.m */,\n\t\t\t\t39DC985024BB903800FFB224 /* ReactNativeSupport */,\n\t\t\t\t39EECB4224BF4FDA009C3364 /* ReactNativeSupport.m */,\n\t\t\t\t390DEDDB248D56F600E27BE8 /* String+LocalizedError.swift */,\n\t\t\t\t39CF46202A2E1F50004A0CA3 /* String+matchesJSRegex.swift */,\n\t\t\t\t6062B5DF2720323700CBDBF0 /* Swiftier.h */,\n\t\t\t\t3976BF01246AC7DE00AA20C7 /* TimeInterval+DetoxUtils.swift */,\n\t\t\t\t3980D0FE2448B52A004812DD /* UIApplication+DTXAdditions.h */,\n\t\t\t\t3980D1012448B52B004812DD /* UIApplication+DTXAdditions.m */,\n\t\t\t\t396D455625238BCE0096E7FA /* UIImage+DetoxUtils.h */,\n\t\t\t\t396D455525238BCE0096E7FA /* UIImage+DetoxUtils.m */,\n\t\t\t\t60E149C52759038F00519EE4 /* UIResponder+First.h */,\n\t\t\t\t60E149C62759038F00519EE4 /* UIResponder+First.m */,\n\t\t\t\t397CA78A248010B5005E8A71 /* UISlider+DetoxUtils.h */,\n\t\t\t\t397CA78B248010B5005E8A71 /* UISlider+DetoxUtils.m */,\n\t\t\t\t395B06E2256D5A5600941716 /* UIView+DetoxSpeedup.h */,\n\t\t\t\t395B06E3256D5A5600941716 /* UIView+DetoxSpeedup.m */,\n\t\t\t\t3990BA132457248600B608C8 /* UIView+DetoxUtils.h */,\n\t\t\t\t3990BA142457248600B608C8 /* UIView+DetoxUtils.m */,\n\t\t\t\t396D455125238BB90096E7FA /* UIView+Drawing.h */,\n\t\t\t\t396D455025238BB90096E7FA /* UIView+Drawing.m */,\n\t\t\t\t390DED81248906FC00E27BE8 /* UIWindow+DetoxUtils.h */,\n\t\t\t\t390DED82248906FC00E27BE8 /* UIWindow+DetoxUtils.m */,\n\t\t\t\t604932B42C8070D5002EFCC9 /* ViewHierarchyGenerator.swift */,\n\t\t\t\t392324DE24781CBD00A3D119 /* WebSocket.swift */,\n\t\t\t);\n\t\t\tpath = Utilities;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D131244C4336004812DD /* Actions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3946CD3C2566EB9E000A3606 /* NSObject+DetoxActions.h */,\n\t\t\t\t3946CD3D2566EB9E000A3606 /* NSObject+DetoxActions.m */,\n\t\t\t\t3980D167244DD837004812DD /* UIDatePicker+DetoxActions.h */,\n\t\t\t\t3980D168244DD837004812DD /* UIDatePicker+DetoxActions.m */,\n\t\t\t\t39CA978A245B13CB00A7FC43 /* UIDevice+DetoxActions.h */,\n\t\t\t\t39CA978B245B13CB00A7FC43 /* UIDevice+DetoxActions.m */,\n\t\t\t\t3980D163244DC8F0004812DD /* UIPickerView+DetoxActions.h */,\n\t\t\t\t3980D164244DC8F0004812DD /* UIPickerView+DetoxActions.m */,\n\t\t\t\t3980D16B244DDCD7004812DD /* UIScrollView+DetoxActions.h */,\n\t\t\t\t3980D16C244DDCD7004812DD /* UIScrollView+DetoxActions.m */,\n\t\t\t\t12BDDA5F2971652D00FDBBA8 /* UIApplication+DetoxActions.swift */,\n\t\t\t);\n\t\t\tpath = Actions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D132244C435B004812DD /* Matchers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3980D133244C4373004812DD /* UIView+DetoxMatchers.h */,\n\t\t\t\t3980D134244C4373004812DD /* UIView+DetoxMatchers.m */,\n\t\t\t);\n\t\t\tpath = Matchers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3980D13C244C44C3004812DD /* Invocation */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0A772B92FD5800937051 /* WebViews */,\n\t\t\t\t3980D155244C45E9004812DD /* Action.swift */,\n\t\t\t\t3980D153244C45E9004812DD /* Element.swift */,\n\t\t\t\t3980D156244C45E9004812DD /* Expectation.swift */,\n\t\t\t\t3980D154244C45E9004812DD /* InvocationManager.swift */,\n\t\t\t\t3980D14B244C45E9004812DD /* Modifier.swift */,\n\t\t\t\t3980D157244C45E9004812DD /* Predicate.swift */,\n\t\t\t);\n\t\t\tpath = Invocation;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t39D7BF9124EAE510003E0694 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t39DC984B24BB8FCD00FFB224 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t39DC984F24BB8FCD00FFB224 /* DetoxSync.framework */,\n\t\t\t\t39CF46242A2E1F50004A0CA3 /* DetoxSyncTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t39DC985024BB903800FFB224 /* ReactNativeSupport */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t39DC985124BB904D00FFB224 /* ReactNativeHeaders.h */,\n\t\t\t\t39DC985424BB904D00FFB224 /* ReactNativeSupport.h */,\n\t\t\t\t39DC985224BB904D00FFB224 /* ReactNativeSupport.m */,\n\t\t\t);\n\t\t\tpath = ReactNativeSupport;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0A772B92FD5800937051 /* WebViews */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AA02B998A2200937051 /* Action */,\n\t\t\t\t600A0AA22B998A2E00937051 /* Expectation */,\n\t\t\t\t600A0AA42B998A9100937051 /* Shared */,\n\t\t\t);\n\t\t\tname = WebViews;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AA02B998A2200937051 /* Action */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AC82B9B5E4F00937051 /* CodeBuilder */,\n\t\t\t\t600A0A842B966F9000937051 /* WebAction.swift */,\n\t\t\t\t600A0AA52B998B2700937051 /* WebActionType.swift */,\n\t\t\t);\n\t\t\tname = Action;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AA22B998A2E00937051 /* Expectation */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AC72B9B5E4200937051 /* CodeBuilder */,\n\t\t\t\t600A0A752B923B1F00937051 /* WebExpectation.swift */,\n\t\t\t\t600A0AA72B998B4200937051 /* WebExpectationType.swift */,\n\t\t\t\t600A0AA92B998B5500937051 /* WebExpectationModifier.swift */,\n\t\t\t);\n\t\t\tname = Expectation;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AA32B998A5E00937051 /* CodeBuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0A7A2B9376D600937051 /* WebCodeBuilder.swift */,\n\t\t\t\t600A0AB52B99B23800937051 /* WebCodeBuilder+createSelector.swift */,\n\t\t\t);\n\t\t\tname = CodeBuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AA42B998A9100937051 /* Shared */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t601A40D62BA63405007BC8C4 /* Runtime */,\n\t\t\t\t600A0AA32B998A5E00937051 /* CodeBuilder */,\n\t\t\t\t600A0AB02B999E5E00937051 /* Interaction */,\n\t\t\t\t600A0AAF2B999E3900937051 /* WKWebView */,\n\t\t\t);\n\t\t\tname = Shared;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AAF2B999E3900937051 /* WKWebView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0A782B93097200937051 /* WKWebView+findView.swift */,\n\t\t\t\t600A0AAD2B999D2300937051 /* WKWebView+evaluateJSAfterLoading.swift */,\n\t\t\t);\n\t\t\tname = WKWebView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AB02B999E5E00937051 /* Interaction */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AAB2B998C1800937051 /* WebInteraction.swift */,\n\t\t\t\t600A0A862B966FBE00937051 /* WebPredicate.swift */,\n\t\t\t\t600A0A882B966FE200937051 /* WebPredicateType.swift */,\n\t\t\t);\n\t\t\tname = Interaction;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AC72B9B5E4200937051 /* CodeBuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AB32B99B1DF00937051 /* WebCodeBuilder+createExpectation.swift */,\n\t\t\t);\n\t\t\tname = CodeBuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t600A0AC82B9B5E4F00937051 /* CodeBuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t600A0AB12B99B1D100937051 /* WebCodeBuilder+createAction.swift */,\n\t\t\t\t600A0ACF2B9B625600937051 /* WebCodeBuilder+createFocusAction.swift */,\n\t\t\t\t600A0AD52B9C410900937051 /* WebCodeBuilder+createGetTextAction.swift */,\n\t\t\t\t600A0AD72B9C41C400937051 /* WebCodeBuilder+createGetTitleAction.swift */,\n\t\t\t\t600A0AD32B9C407900937051 /* WebCodeBuilder+createGetURLAction.swift */,\n\t\t\t\t600A0AD92B9C7E5900937051 /* WebCodeBuilder+createMoveCursorToEndAction.swift */,\n\t\t\t\t600A0ADB2B9C7F9D00937051 /* WebCodeBuilder+createRunScriptAction.swift */,\n\t\t\t\t600A0ADF2B9C835800937051 /* WebCodeBuilder+createScrollIntoViewAction.swift */,\n\t\t\t\t600A0ADD2B9C817500937051 /* WebCodeBuilder+createSelectAllTextAction.swift */,\n\t\t\t\t600A0ACD2B9B60F800937051 /* WebCodeBuilder+createTapAction.swift */,\n\t\t\t\t600A0AD12B9C39EE00937051 /* WebCodeBuilder+createTypeAction.swift */,\n\t\t\t);\n\t\t\tname = CodeBuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t601A40D62BA63405007BC8C4 /* Runtime */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t601A40DA2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.h */,\n\t\t\t\t601A40DB2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.m */,\n\t\t\t);\n\t\t\tname = Runtime;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t7D3919BC2E890DBB00D16E3A /* SwiftSupport */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t7D3919BA2E890DBB00D16E3A /* DetoxSwiftBridge.h */,\n\t\t\t\t7D3919BF2E890F0E00D16E3A /* DetoxSwiftBridge.m */,\n\t\t\t);\n\t\t\tpath = SwiftSupport;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t394767941DBF985400D72256 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t60E149C72759038F00519EE4 /* UIResponder+First.h in Headers */,\n\t\t\t\t3947679C1DBF985400D72256 /* Detox.h in Headers */,\n\t\t\t\t39CA978C245B13CB00A7FC43 /* UIDevice+DetoxActions.h in Headers */,\n\t\t\t\t3980D11C2448B52C004812DD /* DTXSyntheticEvents.h in Headers */,\n\t\t\t\t3980D169244DD837004812DD /* UIDatePicker+DetoxActions.h in Headers */,\n\t\t\t\t39EECB7C24C0A5AF009C3364 /* NSThread+DetoxUtils.h in Headers */,\n\t\t\t\t39A34C711E30F10D00BEBB59 /* DetoxAppDelegateProxy.h in Headers */,\n\t\t\t\t39996B4C248555AB009B8E45 /* DTXDurationFormatter.h in Headers */,\n\t\t\t\t397CA78C248010B5005E8A71 /* UISlider+DetoxUtils.h in Headers */,\n\t\t\t\t601A40DC2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.h in Headers */,\n\t\t\t\t3980D1142448B52C004812DD /* DTXTouchInjector.h in Headers */,\n\t\t\t\t3990BA28245882EF00B608C8 /* DTXAssertionHandler.h in Headers */,\n\t\t\t\t6062B5E22720323700CBDBF0 /* DTXSwizzlingHelper.h in Headers */,\n\t\t\t\t399BF36821933F0C00F96D50 /* ExternalLogging.h in Headers */,\n\t\t\t\t3946CD492566EBCB000A3606 /* NSObject+DetoxUtils.h in Headers */,\n\t\t\t\t6062B5E12720323700CBDBF0 /* DTXAddressInfo.h in Headers */,\n\t\t\t\t3980D1182448B52C004812DD /* UITouch+DTXAdditions.h in Headers */,\n\t\t\t\t3990BA152457248600B608C8 /* UIView+DetoxUtils.h in Headers */,\n\t\t\t\t60C1961A271F11C4000172DD /* fishhook.h in Headers */,\n\t\t\t\t39DC985924BB904D00FFB224 /* ReactNativeSupport.h in Headers */,\n\t\t\t\t396D455825238BCE0096E7FA /* UIImage+DetoxUtils.h in Headers */,\n\t\t\t\t3980D10F2448B52C004812DD /* UIApplication+DTXAdditions.h in Headers */,\n\t\t\t\t3980D1172448B52C004812DD /* DTXRunLoopSpinner.h in Headers */,\n\t\t\t\tAD4781082636F7CF006774CD /* NSURL+DetoxUtils.h in Headers */,\n\t\t\t\t7D3919BE2E890DBB00D16E3A /* DetoxSwiftBridge.h in Headers */,\n\t\t\t\t6062B5E32720323700CBDBF0 /* NSArray+Utils.h in Headers */,\n\t\t\t\t3980D135244C4373004812DD /* UIView+DetoxMatchers.h in Headers */,\n\t\t\t\t3980D16D244DDCD7004812DD /* UIScrollView+DetoxActions.h in Headers */,\n\t\t\t\t3946CD3E2566EB9E000A3606 /* NSObject+DetoxActions.h in Headers */,\n\t\t\t\t39DC984724BB8E8900FFB224 /* DTXLogging.h in Headers */,\n\t\t\t\t396D454525238B780096E7FA /* DetoxPolicy.h in Headers */,\n\t\t\t\t3980D165244DC8F0004812DD /* UIPickerView+DetoxActions.h in Headers */,\n\t\t\t\t39CE25AB22197F0900D78AA1 /* DetoxInstrumentsManager.h in Headers */,\n\t\t\t\t6062B5E52720323700CBDBF0 /* Swiftier.h in Headers */,\n\t\t\t\t396D455325238BB90096E7FA /* UIView+Drawing.h in Headers */,\n\t\t\t\t390DED83248906FC00E27BE8 /* UIWindow+DetoxUtils.h in Headers */,\n\t\t\t\t3980D11D2448B52C004812DD /* DTXAppleInternals.h in Headers */,\n\t\t\t\t3946CD442566EBC2000A3606 /* NSObject+DontCrash.h in Headers */,\n\t\t\t\t39DC985624BB904D00FFB224 /* ReactNativeHeaders.h in Headers */,\n\t\t\t\t3980D11E2448B52C004812DD /* DTXTouchInfo.h in Headers */,\n\t\t\t\t395B06E4256D5A5600941716 /* UIView+DetoxSpeedup.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t3928EFA41E47404900C19B6E /* DetoxUserNotificationTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3928EFAD1E47404900C19B6E /* Build configuration list for PBXNativeTarget \"DetoxUserNotificationTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3928EFA11E47404900C19B6E /* Sources */,\n\t\t\t\t3928EFA21E47404900C19B6E /* Frameworks */,\n\t\t\t\t3928EFA31E47404900C19B6E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3928EFAC1E47404900C19B6E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = DetoxUserNotificationTests;\n\t\t\tproductName = DetoxUserNotificationTests;\n\t\t\tproductReference = 3928EFA51E47404900C19B6E /* DetoxUserNotificationTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t394767961DBF985400D72256 /* Detox */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3947679F1DBF985400D72256 /* Build configuration list for PBXNativeTarget \"Detox\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t394767941DBF985400D72256 /* Headers */,\n\t\t\t\t394767921DBF985400D72256 /* Sources */,\n\t\t\t\t394767931DBF985400D72256 /* Frameworks */,\n\t\t\t\t394767951DBF985400D72256 /* Resources */,\n\t\t\t\t39C3C34B1DBF9A05008177E1 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t39D7BF9C24EAE51B003E0694 /* PBXTargetDependency */,\n\t\t\t\t39DC985E24BB907200FFB224 /* PBXTargetDependency */,\n\t\t\t\t393E67021FC728360092EE89 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = Detox;\n\t\t\tproductName = Detox;\n\t\t\tproductReference = 394767971DBF985400D72256 /* Detox.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t3947678E1DBF985400D72256 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 0830;\n\t\t\t\tLastUpgradeCheck = 1220;\n\t\t\t\tORGANIZATIONNAME = Wix;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t3928EFA41E47404900C19B6E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.3;\n\t\t\t\t\t\tLastSwiftMigration = 0900;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t394767961DBF985400D72256 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.1;\n\t\t\t\t\t\tLastSwiftMigration = 0900;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 394767911DBF985400D72256 /* Build configuration list for PBXProject \"Detox\" */;\n\t\t\tcompatibilityVersion = \"Xcode 10.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 3947678D1DBF985400D72256;\n\t\t\tproductRefGroup = 394767981DBF985400D72256 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 393E66E21FC5F3E90092EE89 /* Products */;\n\t\t\t\t\tProjectRef = 393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 39DC984B24BB8FCD00FFB224 /* Products */;\n\t\t\t\t\tProjectRef = 39DC984A24BB8FCD00FFB224 /* DetoxSync.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 39D7BF9124EAE510003E0694 /* Products */;\n\t\t\t\t\tProjectRef = 39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t394767961DBF985400D72256 /* Detox */,\n\t\t\t\t3928EFA41E47404900C19B6E /* DetoxUserNotificationTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = COSTouchVisualizer.framework;\n\t\t\tremoteRef = 393E66E51FC5F3E90092EE89 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t39CF46242A2E1F50004A0CA3 /* DetoxSyncTests.xctest */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.cfbundle;\n\t\t\tpath = DetoxSyncTests.xctest;\n\t\t\tremoteRef = 39CF46232A2E1F50004A0CA3 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = LNViewHierarchyDumper.framework;\n\t\t\tremoteRef = 39D7BF9424EAE510003E0694 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t39DC984F24BB8FCD00FFB224 /* DetoxSync.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = DetoxSync.framework;\n\t\t\tremoteRef = 39DC984E24BB8FCD00FFB224 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t3928EFA31E47404900C19B6E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t394767951DBF985400D72256 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t3928EFA11E47404900C19B6E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t394767921DBF985400D72256 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t392324E324782AE500A3D119 /* DetoxInit.m in Sources */,\n\t\t\t\t39DC985724BB904D00FFB224 /* ReactNativeSupport.m in Sources */,\n\t\t\t\t6062B5E42720323700CBDBF0 /* NSArray+Utils.m in Sources */,\n\t\t\t\t3980D15C244C45EA004812DD /* Action.swift in Sources */,\n\t\t\t\t600A0AE02B9C835800937051 /* WebCodeBuilder+createScrollIntoViewAction.swift in Sources */,\n\t\t\t\tAD4781092636F7CF006774CD /* NSURL+DetoxUtils.m in Sources */,\n\t\t\t\t600A0AA82B998B4200937051 /* WebExpectationType.swift in Sources */,\n\t\t\t\t600A0ADE2B9C817500937051 /* WebCodeBuilder+createSelectAllTextAction.swift in Sources */,\n\t\t\t\t3976BF02246AC7DE00AA20C7 /* TimeInterval+DetoxUtils.swift in Sources */,\n\t\t\t\t600A0A892B966FE200937051 /* WebPredicateType.swift in Sources */,\n\t\t\t\t600A0AAA2B998B5500937051 /* WebExpectationModifier.swift in Sources */,\n\t\t\t\t604932B52C8070D5002EFCC9 /* ViewHierarchyGenerator.swift in Sources */,\n\t\t\t\t39996B4D248555AB009B8E45 /* DTXDurationFormatter.m in Sources */,\n\t\t\t\t399BF36921933F0C00F96D50 /* ExternalLogging.m in Sources */,\n\t\t\t\t600A0A872B966FBE00937051 /* WebPredicate.swift in Sources */,\n\t\t\t\t3980D16A244DD837004812DD /* UIDatePicker+DetoxActions.m in Sources */,\n\t\t\t\t3980D11B2448B52C004812DD /* DTXRunLoopSpinner.m in Sources */,\n\t\t\t\t3980D166244DC8F0004812DD /* UIPickerView+DetoxActions.m in Sources */,\n\t\t\t\t600A0AD22B9C39EE00937051 /* WebCodeBuilder+createTypeAction.swift in Sources */,\n\t\t\t\t600A0AAE2B999D2300937051 /* WKWebView+evaluateJSAfterLoading.swift in Sources */,\n\t\t\t\t3990BA162457248600B608C8 /* UIView+DetoxUtils.m in Sources */,\n\t\t\t\t397CA7A324840449005E8A71 /* NSException+DetoxUtils.swift in Sources */,\n\t\t\t\t600A0AD62B9C410900937051 /* WebCodeBuilder+createGetTextAction.swift in Sources */,\n\t\t\t\t39DC984824BB8E8900FFB224 /* DTXLogging.m in Sources */,\n\t\t\t\t39AB2D31205ABBD90029CD1F /* DetoxUserActivityDispatcher.swift in Sources */,\n\t\t\t\t397CA78D248010B5005E8A71 /* UISlider+DetoxUtils.m in Sources */,\n\t\t\t\t600A0AD42B9C407900937051 /* WebCodeBuilder+createGetURLAction.swift in Sources */,\n\t\t\t\t3980D15D244C45EA004812DD /* Expectation.swift in Sources */,\n\t\t\t\t3980D11A2448B52C004812DD /* DTXTouchInjector.m in Sources */,\n\t\t\t\t3946CD3F2566EB9E000A3606 /* NSObject+DetoxActions.m in Sources */,\n\t\t\t\t395B06E5256D5A5600941716 /* UIView+DetoxSpeedup.m in Sources */,\n\t\t\t\t600A0AA62B998B2700937051 /* WebActionType.swift in Sources */,\n\t\t\t\t3980D15B244C45EA004812DD /* InvocationManager.swift in Sources */,\n\t\t\t\t39DC984924BB8E8900FFB224 /* DTXLogging.swift in Sources */,\n\t\t\t\t3946CD452566EBC2000A3606 /* NSObject+DontCrash.m in Sources */,\n\t\t\t\t396D455725238BCE0096E7FA /* UIImage+DetoxUtils.m in Sources */,\n\t\t\t\t39A34C721E30F10D00BEBB59 /* DetoxAppDelegateProxy.m in Sources */,\n\t\t\t\t39EECB7D24C0A5AF009C3364 /* NSThread+DetoxUtils.m in Sources */,\n\t\t\t\t60E149C82759038F00519EE4 /* UIResponder+First.m in Sources */,\n\t\t\t\t390DED84248906FC00E27BE8 /* UIWindow+DetoxUtils.m in Sources */,\n\t\t\t\t3980D158244C45EA004812DD /* Modifier.swift in Sources */,\n\t\t\t\t601A40DD2BA63556007BC8C4 /* WKWebViewConfiguration+Detox.m in Sources */,\n\t\t\t\t39EECB4324BF4FDA009C3364 /* ReactNativeSupport.m in Sources */,\n\t\t\t\t600A0ADC2B9C7F9D00937051 /* WebCodeBuilder+createRunScriptAction.swift in Sources */,\n\t\t\t\t3980D15A244C45EA004812DD /* Element.swift in Sources */,\n\t\t\t\t600A0AD82B9C41C400937051 /* WebCodeBuilder+createGetTitleAction.swift in Sources */,\n\t\t\t\t3980D1122448B52C004812DD /* UIApplication+DTXAdditions.m in Sources */,\n\t\t\t\t600A0AD02B9B625600937051 /* WebCodeBuilder+createFocusAction.swift in Sources */,\n\t\t\t\t600A0ADA2B9C7E5900937051 /* WebCodeBuilder+createMoveCursorToEndAction.swift in Sources */,\n\t\t\t\t600A0A792B93097200937051 /* WKWebView+findView.swift in Sources */,\n\t\t\t\t39CF46212A2E1F50004A0CA3 /* String+matchesJSRegex.swift in Sources */,\n\t\t\t\t600A0A762B923B1F00937051 /* WebExpectation.swift in Sources */,\n\t\t\t\t396D454425238B780096E7FA /* DetoxPolicy.m in Sources */,\n\t\t\t\t3980D15E244C45EA004812DD /* Predicate.swift in Sources */,\n\t\t\t\t397CA79F2483F07D005E8A71 /* ApproximateEquality.swift in Sources */,\n\t\t\t\t6062B5E62720323700CBDBF0 /* DTXAddressInfo.mm in Sources */,\n\t\t\t\t39CEFCDB1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift in Sources */,\n\t\t\t\t600A0AB22B99B1D100937051 /* WebCodeBuilder+createAction.swift in Sources */,\n\t\t\t\t39FFD9471FD730A600C97030 /* DetoxCrashHandler.mm in Sources */,\n\t\t\t\t3980D136244C4373004812DD /* UIView+DetoxMatchers.m in Sources */,\n\t\t\t\t392324DF24781CBD00A3D119 /* WebSocket.swift in Sources */,\n\t\t\t\t600A0AB42B99B1DF00937051 /* WebCodeBuilder+createExpectation.swift in Sources */,\n\t\t\t\t60C1961B271F11C4000172DD /* fishhook.c in Sources */,\n\t\t\t\t600A0A7B2B9376D600937051 /* WebCodeBuilder.swift in Sources */,\n\t\t\t\t600A0ACE2B9B60F800937051 /* WebCodeBuilder+createTapAction.swift in Sources */,\n\t\t\t\t390DEDDC248D56F600E27BE8 /* String+LocalizedError.swift in Sources */,\n\t\t\t\t3946CD4A2566EBCB000A3606 /* NSObject+DetoxUtils.m in Sources */,\n\t\t\t\t600A0AAC2B998C1800937051 /* WebInteraction.swift in Sources */,\n\t\t\t\t3990BA36245AC98C00B608C8 /* DTXAssertionHandler+Swift.swift in Sources */,\n\t\t\t\t12BDDA602971652D00FDBBA8 /* UIApplication+DetoxActions.swift in Sources */,\n\t\t\t\t39CA978D245B13CB00A7FC43 /* UIDevice+DetoxActions.m in Sources */,\n\t\t\t\t7D3919C02E890F0E00D16E3A /* DetoxSwiftBridge.m in Sources */,\n\t\t\t\t396D455225238BB90096E7FA /* UIView+Drawing.m in Sources */,\n\t\t\t\t39CE25AC22197F0900D78AA1 /* DetoxInstrumentsManager.m in Sources */,\n\t\t\t\t3980D1162448B52C004812DD /* DTXTouchInfo.m in Sources */,\n\t\t\t\t3990BA29245882EF00B608C8 /* DTXAssertionHandler.m in Sources */,\n\t\t\t\t3980D1102448B52C004812DD /* DTXSyntheticEvents.m in Sources */,\n\t\t\t\t3980D16E244DDCD7004812DD /* UIScrollView+DetoxActions.m in Sources */,\n\t\t\t\t392324D72477D87D00A3D119 /* DetoxManager.swift in Sources */,\n\t\t\t\t600A0A852B966F9000937051 /* WebAction.swift in Sources */,\n\t\t\t\t600A0AB62B99B23800937051 /* WebCodeBuilder+createSelector.swift in Sources */,\n\t\t\t\t3980D1192448B52C004812DD /* UITouch+DTXAdditions.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t3928EFAC1E47404900C19B6E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 394767961DBF985400D72256 /* Detox */;\n\t\t\ttargetProxy = 3928EFAB1E47404900C19B6E /* PBXContainerItemProxy */;\n\t\t};\n\t\t393E67021FC728360092EE89 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = COSTouchVisualizer;\n\t\t\ttargetProxy = 393E67011FC728360092EE89 /* PBXContainerItemProxy */;\n\t\t};\n\t\t39D7BF9C24EAE51B003E0694 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = LNViewHierarchyDumper;\n\t\t\ttargetProxy = 39D7BF9B24EAE51B003E0694 /* PBXContainerItemProxy */;\n\t\t};\n\t\t39DC985E24BB907200FFB224 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = DetoxSync;\n\t\t\ttargetProxy = 39DC985D24BB907200FFB224 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t3928EFAE1E47404900C19B6E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tINFOPLIST_FILE = DetoxUserNotificationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxUserNotificationTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"DetoxUserNotificationTests/Bridging-Header.h\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3928EFAF1E47404900C19B6E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tINFOPLIST_FILE = DetoxUserNotificationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxUserNotificationTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"DetoxUserNotificationTests/Bridging-Header.h\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3947679D1DBF985400D72256 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 390D1C981E3A2893007F5F46 /* Detox.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_CFLAGS = (\n\t\t\t\t\t\"-Wno-error=unused-command-line-argument\",\n\t\t\t\t\t\"-fobjc-arc-exceptions\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t\tSTRIP_SWIFT_SYMBOLS = NO;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_TREAT_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3947679E1DBF985400D72256 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 390D1C981E3A2893007F5F46 /* Detox.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_CFLAGS = (\n\t\t\t\t\t\"-Wno-error=unused-command-line-argument\",\n\t\t\t\t\t\"-fobjc-arc-exceptions\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t\tSTRIP_SWIFT_SYMBOLS = NO;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tSWIFT_TREAT_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t394767A01DBF985400D72256 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 390D1C981E3A2893007F5F46 /* Detox.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = NO;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tGCC_PREFIX_HEADER = Detox/Detox.pch;\n\t\t\t\tGCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = EarlGrey/fishhook;\n\t\t\t\tINFOPLIST_FILE = Detox/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t\t\"$(PLATFORM_DIR)/Developer/Library/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMODULEMAP_FILE = Detox/Detox.modulemap;\n\t\t\t\tOTHER_CFLAGS = (\n\t\t\t\t\t\"-Wno-unused-command-line-argument\",\n\t\t\t\t\t\"-fobjc-arc-exceptions\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-all_load\",\n\t\t\t\t\t\"-lstdc++\",\n\t\t\t\t\t\"-Wl,-U,_OBJC_CLASS_$_TIPreferencesController\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.Detox;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t394767A11DBF985400D72256 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 390D1C981E3A2893007F5F46 /* Detox.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tGCC_PREFIX_HEADER = Detox/Detox.pch;\n\t\t\t\tGCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = EarlGrey/fishhook;\n\t\t\t\tINFOPLIST_FILE = Detox/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t\t\"$(PLATFORM_DIR)/Developer/Library/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMODULEMAP_FILE = Detox/Detox.modulemap;\n\t\t\t\tOTHER_CFLAGS = (\n\t\t\t\t\t\"-Wno-unused-command-line-argument\",\n\t\t\t\t\t\"-fobjc-arc-exceptions\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-all_load\",\n\t\t\t\t\t\"-lstdc++\",\n\t\t\t\t\t\"-Wl,-U,_OBJC_CLASS_$_TIPreferencesController\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.Detox;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t3928EFAD1E47404900C19B6E /* Build configuration list for PBXNativeTarget \"DetoxUserNotificationTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3928EFAE1E47404900C19B6E /* Debug */,\n\t\t\t\t3928EFAF1E47404900C19B6E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t394767911DBF985400D72256 /* Build configuration list for PBXProject \"Detox\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3947679D1DBF985400D72256 /* Debug */,\n\t\t\t\t3947679E1DBF985400D72256 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3947679F1DBF985400D72256 /* Build configuration list for PBXNativeTarget \"Detox\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t394767A01DBF985400D72256 /* Debug */,\n\t\t\t\t394767A11DBF985400D72256 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 3947678E1DBF985400D72256 /* Project object */;\n}\n"
  },
  {
    "path": "detox/ios/Detox.xcodeproj/xcshareddata/xcschemes/Detox.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1220\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"394767961DBF985400D72256\"\n               BuildableName = \"Detox.framework\"\n               BlueprintName = \"Detox\"\n               ReferencedContainer = \"container:Detox.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"NO\"\n      codeCoverageEnabled = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"394767961DBF985400D72256\"\n            BuildableName = \"Detox.framework\"\n            BlueprintName = \"Detox\"\n            ReferencedContainer = \"container:Detox.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <CommandLineArguments>\n         <CommandLineArgument\n            argument = \"-DetoxUnitTest YES\"\n            isEnabled = \"YES\">\n         </CommandLineArgument>\n      </CommandLineArguments>\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"3928EFA41E47404900C19B6E\"\n               BuildableName = \"DetoxUserNotificationTests.xctest\"\n               BlueprintName = \"DetoxUserNotificationTests\"\n               ReferencedContainer = \"container:Detox.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Release\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"394767961DBF985400D72256\"\n            BuildableName = \"Detox.framework\"\n            BlueprintName = \"Detox\"\n            ReferencedContainer = \"container:Detox.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"394767961DBF985400D72256\"\n            BuildableName = \"Detox.framework\"\n            BlueprintName = \"Detox\"\n            ReferencedContainer = \"container:Detox.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/ContentView.swift",
    "content": "//\n//  ContentView.swift (DetoxXCUITestRunnerApp)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport SwiftUI\n\nstruct ContentView: View {\n  var body: some View {\n    VStack {\n      Image(systemName: \"xmark\")\n        .imageScale(.large)\n        .foregroundColor(.red)\n      Text(\"Not a real app\")\n        .font(.title)\n      Text(\"Detox XCUITest Runner\")\n        .font(.subheadline)\n    }\n    .padding()\n    .border(.gray)\n    .shadow(radius: 3, x: 2, y: 2)\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/DetoxXCUITestRunner.swift",
    "content": "//\n//  DetoxXCUITestRunner.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport XCTest\n\nfinal class DetoxXCUITestRunner: XCTestCase {\n  var actionHandler: ActionHandler!\n  var expectationHandler: ExpectationHandler!\n\n  override func setUpWithError() throws {\n    continueAfterFailure = false\n    actionHandler = ActionHandler()\n    expectationHandler = ExpectationHandler()\n  }\n\n  func testRunner() throws {\n    let appUnderTest = try XCUIApplication.appUnderTest()\n    appUnderTest.activate()\n\n    let params = try InvocationParamsReader.readParams()\n\n    let predicateHandler = PredicateHandler(\n      springboardApp: XCUIApplication.springboard,\n      appUnderTest: appUnderTest\n    )\n\n    switch params.type {\n      case .systemAction, .webAction:\n        try actionHandler.handle(from: params, predicateHandler: predicateHandler)\n\n      case .systemExpectation, .webExpectation:\n        try expectationHandler.handle(from: params, predicateHandler: predicateHandler)\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/DetoxXCUITestRunnerApp.swift",
    "content": "//\n//  DetoxXCUITestRunnerApp.swift (DetoxXCUITestRunnerApp)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport SwiftUI\n\n@main\nstruct DetoxXCUITestRunnerApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n    }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Extensions/ElementType+Extensions.swift",
    "content": "//\n//  ElementType+Extensions.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nextension XCUIElement.ElementType {\n  /// Returns the `XCUIElement.ElementType` as a `String`.\n  private func asString() -> String {\n    switch self {\n      case .switch:\n        return \"switch\"\n\n      case .tabBar:\n        return \"tabBar\"\n\n      case .staticText:\n        return \"staticText\"\n\n      case .searchField:\n        return \"searchField\"\n\n      case .link:\n        return \"link\"\n\n      case .key:\n        return \"key\"\n\n      case .image:\n        return \"image\"\n\n      case .button:\n        return \"button\"\n\n      case .application:\n        return \"application\"\n\n      case .group:\n        return \"group\"\n\n      case .slider:\n        return \"slider\"\n\n      case .map:\n        return \"map\"\n\n      case .window:\n        return \"window\"\n\n      case .sheet:\n        return \"sheet\"\n\n      case .drawer:\n        return \"drawer\"\n\n      case .alert:\n        return \"alert\"\n\n      case .dialog:\n        return \"dialog\"\n\n      case .radioButton:\n        return \"radioButton\"\n\n      case .radioGroup:\n        return \"radioGroup\"\n\n      case .checkBox:\n        return \"checkBox\"\n\n      case .disclosureTriangle:\n        return \"disclosureTriangle\"\n\n      case .popUpButton:\n        return \"popUpButton\"\n\n      case .comboBox:\n        return \"comboBox\"\n\n      case .menuButton:\n        return \"menuButton\"\n\n      case .toolbarButton:\n        return \"toolbarButton\"\n\n      case .popover:\n        return \"popover\"\n\n      case .keyboard:\n        return \"keyboard\"\n\n      case .navigationBar:\n        return \"navigationBar\"\n\n      case .tabGroup:\n        return \"tabGroup\"\n\n      case .toolbar:\n        return \"toolbar\"\n\n      case .statusBar:\n        return \"statusBar\"\n\n      case .table:\n        return \"table\"\n\n      case .tableRow:\n        return \"tableRow\"\n\n      case .tableColumn:\n        return \"tableColumn\"\n\n      case .outline:\n        return \"outline\"\n\n      case .outlineRow:\n        return \"outlineRow\"\n\n      case .browser:\n        return \"browser\"\n\n      case .collectionView:\n        return \"collectionView\"\n\n      case .pageIndicator:\n        return \"pageIndicator\"\n\n      case .progressIndicator:\n        return \"progressIndicator\"\n\n      case .activityIndicator:\n        return \"activityIndicator\"\n\n      case .segmentedControl:\n        return \"segmentedControl\"\n\n      case .picker:\n        return \"picker\"\n\n      case .pickerWheel:\n        return \"pickerWheel\"\n\n      case .toggle:\n        return \"toggle\"\n\n      case .icon:\n        return \"icon\"\n\n      case .scrollView:\n        return \"scrollView\"\n\n      case .scrollBar:\n        return \"scrollBar\"\n\n      case .textField:\n        return \"textField\"\n\n      case .secureTextField:\n        return \"secureTextField\"\n\n      case .datePicker:\n        return \"datePicker\"\n\n      case .textView:\n        return \"textView\"\n\n      case .menu:\n        return \"menu\"\n\n      case .menuItem:\n        return \"menuItem\"\n\n      case .menuBar:\n        return \"menuBar\"\n\n      case .menuBarItem:\n        return \"menuBarItem\"\n\n      case .webView:\n        return \"webView\"\n\n      case .incrementArrow:\n        return \"incrementArrow\"\n\n      case .decrementArrow:\n        return \"decrementArrow\"\n\n      case .timeline:\n        return \"timeline\"\n\n      case .ratingIndicator:\n        return \"ratingIndicator\"\n\n      case .valueIndicator:\n        return \"valueIndicator\"\n\n      case .splitGroup:\n        return \"splitGroup\"\n\n      case .splitter:\n        return \"splitter\"\n\n      case .relevanceIndicator:\n        return \"relevanceIndicator\"\n\n      case .colorWell:\n        return \"colorWell\"\n\n      case .helpTag:\n        return \"helpTag\"\n\n      case .matte:\n        return \"matte\"\n\n      case .dockItem:\n        return \"dockItem\"\n\n      case .ruler:\n        return \"ruler\"\n\n      case .rulerMarker:\n        return \"rulerMarker\"\n\n      case .grid:\n        return \"grid\"\n\n      case .levelIndicator:\n        return \"levelIndicator\"\n\n      case .cell:\n        return \"cell\"\n\n      case .layoutArea:\n        return \"layoutArea\"\n\n      case .layoutItem:\n        return \"layoutItem\"\n\n      case .handle:\n        return \"handle\"\n\n      case .stepper:\n        return \"stepper\"\n\n      case .tab:\n        return \"tab\"\n\n      case .touchBar:\n        return \"touchBar\"\n\n      case .statusItem:\n        return \"statusItem\"\n\n      case .any:\n        return \"any\"\n\n      case .other:\n        return \"other\"\n\n      @unknown default:\n        return \"unknown\"\n    }\n  }\n\n  static func from(string typeString: String) throws -> XCUIElement.ElementType {\n    var type: XCUIElement.ElementType?\n\n    var index: UInt = 0\n    while let ithType = XCUIElement.ElementType(rawValue: index) {\n      let ithTypeString = ithType.asString()\n\n      guard ithTypeString != \"unknown\" else {\n        break\n      }\n\n      if ithTypeString == typeString {\n        type = ithType\n        break\n      }\n\n      index += 1\n    }\n\n    guard let type else {\n      throw Error.unknownElementTypeString(typeString)\n    }\n\n    return type\n  }\n\n  enum Error: Swift.Error, LocalizedError {\n    case unknownElementTypeString(_ typeString: String)\n\n    var errorDescription: String? {\n      switch self {\n        case .unknownElementTypeString(let typeString):\n          return \"Unknown element type: \\(typeString)\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Extensions/InvocationParams+matcherDescription.swift",
    "content": "//\n//  InvocationParams+matcherDescription.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\n\nextension InvocationParams {\n  var matcherDescription: String {\n      return predicate?.description ?? \"none\"\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Extensions/TimeInterval+defaultTimeout.swift",
    "content": "//\n//  TimeInterval+defaultTimeout.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nextension TimeInterval {\n  /// Default timeout for assertions.\n  static var defaultTimeout: TimeInterval {\n    return 1\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Extensions/XCUIApplication+Extensions.swift",
    "content": "//\n//  XCUIApplication+Extensions.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nextension XCUIApplication {\n  static var springboard: XCUIApplication {\n    return XCUIApplication(bundleIdentifier: \"com.apple.springboard\")\n  }\n\n  static func appUnderTest() throws -> XCUIApplication {\n    guard let bundleId = Environment.bundleID else {\n      throw Error.missingBundleId\n    }\n\n    return XCUIApplication(bundleIdentifier: bundleId)\n  }\n}\n\nextension XCUIApplication {\n  enum Error: Swift.Error, LocalizedError {\n    case missingBundleId\n\n    var errorDescription: String? {\n      switch self {\n        case .missingBundleId:\n          return \"Missing bundle-id param in environment variables\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Handlers/ActionHandler.swift",
    "content": "//\n//  ActionHandler.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nclass ActionHandler {\n\n  func findElement(from params: InvocationParams, predicateHandler: PredicateHandler) -> XCUIElement {\n    let element = predicateHandler.findElement(using: params)\n    let exists = element.waitForExistence(timeout: .defaultTimeout)\n    DTXAssert(\n      exists,\n      \"Action failed, element with matcher `\\(params.matcherDescription)` does not exist\"\n    )\n    return element\n  }\n\n  func getNormalizedCoordinate(from params: InvocationParams) throws -> XCUICoordinate {\n    let x = Int(params.params?.first ?? \"100\") ?? 100\n    let y = Int(params.params?[1] ?? \"100\") ?? 100\n    \n    let appUnderTest = try XCUIApplication.appUnderTest()\n    let screenFrame = appUnderTest.frame\n    let normalizedX = CGFloat(x) / screenFrame.width\n    let normalizedY = CGFloat(y) / screenFrame.height\n    let normalizedPoint = CGVector(dx: normalizedX, dy: normalizedY)\n    let coordinate = appUnderTest.coordinate(\n      withNormalizedOffset: normalizedPoint)\n\n    return coordinate\n  }\n    \n  func handle(from params: InvocationParams, predicateHandler: PredicateHandler) throws {\n      \n    guard let action = params.action else { return }\n    switch action {\n      case .tap:\n        let element = findElement(from: params, predicateHandler: predicateHandler);\n        element.tap()\n\n      case .typeText:\n        guard let text = params.params?.first else {\n          throw Error.missingTypeTextParam\n        }\n\n        let element = findElement(from: params, predicateHandler: predicateHandler);\n        element.typeTextOnEnd(text)\n\n      case .replaceText:\n        guard let text = params.params?.first else {\n          throw Error.missingTypeTextParam\n        }\n\n        let element = findElement(from: params, predicateHandler: predicateHandler);\n        element.replaceText(text)\n\n      case .clearText:\n        let element = findElement(from: params, predicateHandler: predicateHandler);\n        element.clearText()\n        \n      case .coordinateTap:\n        do {\n            try getNormalizedCoordinate(from: params).tap();\n        } catch  {\n            throw Error.failedToTapDeviceByCoordinates\n        }\n      case .coordinateLongPress:\n        guard let pressDuration = Double(params.params?[2] ?? \"1\") else { throw Error.missingTypeTextParam\n        }\n        \n        do {\n            try getNormalizedCoordinate(from: params).press(forDuration: pressDuration);\n        } catch  {\n            throw Error.failedToTapDeviceByCoordinates\n        }\n    }\n  }\n}\n\nextension ActionHandler {\n  enum Error: Swift.Error, LocalizedError {\n    case missingTypeTextParam\n    case failedToTapDeviceByCoordinates\n\n    var errorDescription: String? {\n      switch self {\n        case .missingTypeTextParam:\n          return \"Missing text param for type action\"\n        case .failedToTapDeviceByCoordinates:\n          return \"Failed to perform tap action by coordinates\"\n        }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Handlers/ExpectationHandler.swift",
    "content": "//\n//  ExpectationHandler.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nclass ExpectationHandler {\n  func handle(from params: InvocationParams, predicateHandler: PredicateHandler) throws {\n    guard let expectation = params.expectation else {\n      throw Error.invalidInvocationParams(\"Expectation type is missing\")\n    }\n\n    let element = predicateHandler.findElement(using: params)\n    let expectedEvaluation = expectedEvaluation(params)\n\n    switch expectation {\n      case .exists:\n        assert(\n          expected: expectedEvaluation,\n          actual: element.waitForExistence(timeout: .defaultTimeout),\n          matcherDescription: params.matcherDescription,\n          evaluationDescription: \"exist\"\n        )\n    }\n  }\n\n  private func expectedEvaluation(_ params: InvocationParams) -> Bool {\n    let modifiers = params.expectationModifiers ?? []\n    let shouldNegate = modifiers.contains(.not)\n    return !shouldNegate\n  }\n\n  private func assert(\n    expected: Bool,\n    actual: Bool,\n    matcherDescription: String,\n    evaluationDescription: String\n  ) {\n    DTXAssert(\n      expected == actual,\n      \"Expectation failed, element with matcher `\\(matcherDescription)` \" +\n        \"does \\(actual ? \"\" : \"not \")\\(evaluationDescription)\"\n    )\n  }\n}\n\nextension ExpectationHandler {\n  enum Error: Swift.Error, LocalizedError {\n    case invalidInvocationParams(String)\n\n    var errorDescription: String? {\n      switch self {\n        case .invalidInvocationParams(let message):\n          return \"Invalid invocation parameters: \\(message)\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Handlers/PredicateHandler.swift",
    "content": "//\n//  PredicateHandler.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nclass PredicateHandler {\n  let springboardApp: XCUIApplication\n  let appUnderTest: XCUIApplication\n\n  init(springboardApp: XCUIApplication, appUnderTest: XCUIApplication) {\n    self.springboardApp = springboardApp\n    self.appUnderTest = appUnderTest\n  }\n\n  func findElement(using params: InvocationParams) -> XCUIElement {\n      guard let predicate = params.predicate else {\n          fatalError(\"expected predicate param\")\n      }\n    let query: XCUIElementQuery\n\n    switch params.type {\n      case .systemAction, .systemExpectation:\n        query = createSystemQuery(type: predicate.type, value: predicate.value)\n\n      case .webAction, .webExpectation:\n        query = createWebViewQuery(type: predicate.type, value: predicate.value)\n    }\n\n    let atIndex = params.atIndex ?? 0\n    return query.element(boundBy: atIndex)\n  }\n\n  func createSystemQuery(\n    type: InvocationParams.Predicate.PredicateType,\n    value: String\n  ) -> XCUIElementQuery {\n    switch type {\n      case .label:\n        return springboardApp.descendants(matching: .any).matching(identifier: value)\n\n      case .type:\n        let elementType = try! XCUIElement.ElementType.from(string: value)\n        return springboardApp.descendants(matching: elementType)\n    }\n  }\n\n  func createWebViewQuery(\n    type: InvocationParams.Predicate.PredicateType,\n    value: String\n  ) -> XCUIElementQuery {\n    switch type {\n      case .label:\n        return appUnderTest.webViews.descendants(matching: .any).matching(identifier: value)\n\n      case .type:\n        let elementType = try! XCUIElement.ElementType.from(string: value)\n        return appUnderTest.webViews.descendants(matching: elementType)\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Params Reader/InvocationParams.swift",
    "content": "import Foundation\n\nstruct InvocationParams: Codable {\n  let type: InvocationType\n  let predicate: Predicate?\n  let atIndex: Int?\n  let action: Action?\n  let expectation: Expectation?\n  let expectationModifiers: [Expectation.Modifiers]?\n  let params: [String]?\n\n  enum CodingKeys: String, CodingKey {\n    case type = \"type\"\n    case systemPredicate = \"systemPredicate\"\n    case webPredicate = \"webPredicate\"\n    case systemAtIndex = \"systemAtIndex\"\n    case webAtIndex = \"webAtIndex\"\n    case systemAction = \"systemAction\"\n    case webAction = \"webAction\"\n    case systemExpectation = \"systemExpectation\"\n    case webExpectation = \"webExpectation\"\n    case systemModifiers = \"systemModifiers\"\n    case webModifiers = \"webModifiers\"\n    case params = \"params\"\n  }\n\n  init(from decoder: Decoder) throws {\n    let container = try decoder.container(keyedBy: CodingKeys.self)\n    type = try container.decode(InvocationType.self, forKey: .type)\n\n    // Handle both systemPredicate and webPredicate for the predicate property\n    if let systemPredicate = try? container.decode(Predicate.self, forKey: .systemPredicate) {\n      predicate = systemPredicate\n    } else if let webPredicate = try? container.decode(Predicate.self, forKey: .webPredicate) {\n      predicate = webPredicate\n    } else {\n      predicate = nil\n    }\n\n    // Handle both systemAtIndex and webAtIndex for the atIndex property\n    if let systemAtIndex = try? container.decode(Int.self, forKey: .systemAtIndex) {\n      atIndex = systemAtIndex\n    } else if let webAtIndex = try? container.decode(Int.self, forKey: .webAtIndex) {\n      atIndex = webAtIndex\n    } else {\n      atIndex = nil\n    }\n\n    // Handle both systemAction and webAction for the action property\n    if let systemAction = try? container.decode(Action.self, forKey: .systemAction) {\n      action = systemAction\n    } else if let webAction = try? container.decode(Action.self, forKey: .webAction) {\n      action = webAction\n    } else {\n      action = nil\n    }\n\n    // Handle both systemExpectation and webExpectation for the expectation property\n    if let systemExpectation = try? container.decode(Expectation.self, forKey: .systemExpectation) {\n      expectation = systemExpectation\n    } else if let webExpectation = try? container.decode(Expectation.self, forKey: .webExpectation) {\n      expectation = webExpectation\n    } else {\n      expectation = nil\n    }\n\n    // Handle both systemModifiers and webModifiers for the expectationModifiers property\n    if let systemModifiers = try? container.decode([Expectation.Modifiers].self, forKey: .systemModifiers) {\n      expectationModifiers = systemModifiers\n    } else if let webModifiers = try? container.decode([Expectation.Modifiers].self, forKey: .webModifiers) {\n      expectationModifiers = webModifiers\n    } else {\n      expectationModifiers = nil\n    }\n\n    params = try container.decodeIfPresent([String].self, forKey: .params)\n  }\n\n  func encode(to encoder: Encoder) throws {\n    var container = encoder.container(keyedBy: CodingKeys.self)\n    try container.encode(type, forKey: .type)\n\n    // Encode predicate to the appropriate key based on the type\n    if type == .systemAction || type == .systemExpectation {\n      try container.encode(predicate, forKey: .systemPredicate)\n    } else if type == .webAction || type == .webExpectation {\n      try container.encode(predicate, forKey: .webPredicate)\n    }\n\n    // Encode atIndex to the appropriate key based on the type\n    if let atIndex = atIndex {\n      if type == .systemAction || type == .systemExpectation {\n        try container.encode(atIndex, forKey: .systemAtIndex)\n      } else if type == .webAction || type == .webExpectation {\n        try container.encode(atIndex, forKey: .webAtIndex)\n      }\n    }\n\n    // Encode action to the appropriate key based on the type\n    if let action = action {\n      if type == .systemAction {\n        try container.encode(action, forKey: .systemAction)\n      } else if type == .webAction {\n        try container.encode(action, forKey: .webAction)\n      }\n    }\n\n    // Encode expectation to the appropriate key based on the type\n    if let expectation = expectation {\n      if type == .systemExpectation {\n        try container.encode(expectation, forKey: .systemExpectation)\n      } else if type == .webExpectation {\n        try container.encode(expectation, forKey: .webExpectation)\n      }\n    }\n\n    // Encode expectationModifiers to the appropriate key based on the type\n    if let expectationModifiers = expectationModifiers {\n      if type == .systemExpectation {\n        try container.encode(expectationModifiers, forKey: .systemModifiers)\n      } else if type == .webExpectation {\n        try container.encode(expectationModifiers, forKey: .webModifiers)\n      }\n    }\n\n    try container.encodeIfPresent(params, forKey: .params)\n  }\n}\n\nextension InvocationParams {\n  enum InvocationType: String, Codable {\n    case systemAction = \"systemAction\"\n    case systemExpectation = \"systemExpectation\"\n    case webAction = \"webAction\"\n    case webExpectation = \"webExpectation\"\n  }\n}\n\nextension InvocationParams {\n  struct Predicate: Codable, CustomStringConvertible {\n    let type: PredicateType\n    let value: String\n\n    var description: String {\n      return \"\\(type.rawValue) == \\\"\\(value)\\\"\"\n    }\n  }\n}\n\nextension InvocationParams.Predicate {\n  enum PredicateType: String, Codable {\n    case label\n    case type\n  }\n}\n\nextension InvocationParams {\n  enum Action: String, Codable {\n    case tap\n    case coordinateTap\n    case coordinateLongPress\n    case typeText\n    case replaceText\n    case clearText\n  }\n}\n\nextension InvocationParams {\n  enum Expectation: String, Codable {\n    case exists = \"toExist\"\n  }\n}\n\nextension InvocationParams.Expectation {\n  enum Modifiers: String, Codable {\n    case not\n  }\n}\n\nextension InvocationParams {\n  enum Error: Swift.Error, LocalizedError {\n    case dataCorruptedError(String)\n\n    var errorDescription: String? {\n      switch self {\n        case .dataCorruptedError(let kind):\n          return \"Invocation params missing \\(kind) param\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Params Reader/InvocationParamsReader.swift",
    "content": "//\n//  InvocationParamsReader.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\n\nclass InvocationParamsReader {\n  static func readParams() throws -> InvocationParams {\n    do {\n      guard let base64Params = Environment.params else {\n        throw Error.missingRunnerParams\n      }\n\n      guard let data = Data(base64Encoded: base64Params) else {\n        throw Error.failedToDecodeParams(base64Params)\n      }\n\n      return try JSONDecoder().decode(InvocationParams.self, from: data)\n    }\n  }\n}\n\nextension InvocationParamsReader {\n  enum Error: Swift.Error, LocalizedError {\n    case missingRunnerParams\n    case failedToDecodeParams(_ base64Params: String)\n\n    var errorDescription: String? {\n      switch self {\n        case .missingRunnerParams:\n          return \"Missing runner params (`TEST_RUNNER_PARAMS`) in environment variables\"\n\n        case .failedToDecodeParams(let base64Params):\n          return \"Failed to decode runner params from base64 string: \\(base64Params)\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Utils/DTXAssert.swift",
    "content": "//\n//  DTXAssert.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\npublic func DTXAssert(_ assertion: Bool, _ message: String) {\n  XCTAssert(\n    assertion,\n    \"DTXError: \\(message)\"\n  )\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Utils/Environment.swift",
    "content": "//\n//  Environment.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\n\nstruct Environment {\n  private static let environment = ProcessInfo.processInfo.environment\n  static let params: String? = environment[\"PARAMS\"]\n  static let bundleID: String? = environment[\"BUNDLE_ID\"]\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Utils/LogUtils.swift",
    "content": "//\n//  LogUtils.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport OSLog\n\n// MARK: - Logging methods\n\n/// Logs the given `message` with its `type`, under the main logs container.\nfunc log(_ message: String, _ type: OSLogType = .info) {\n  detoxLog(message: message, container: .main, type: type)\n}\n\n/// Logs the `message` under a DetoxTester `container` along with its `type`.\nfileprivate func detoxLog(message: String, container: OSLog, type: OSLogType) {\n  // TODO: reduce logs amount.\n  os_log(\"%{public}@\", log: container, type: type, message)\n}\n\n// MARK: - Containers\n\n/// Extends `OSLog` with different containers of DetoxTester.\nfileprivate extension OSLog {\n  private static var subsystem = Bundle.main.bundleIdentifier!\n\n  // General logs container.\n  static let main = OSLog(subsystem: subsystem, category: \"MAIN\")\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner/Utils/XCUIElement+Extensions.swift",
    "content": "//\n//  XCUIElement+Keyboard.swift (DetoxXCUITestRunner)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport Foundation\nimport XCTest\n\nextension XCUIElement {\n  public func replaceText(_ text: String) {\n    clearText()\n    typeTextOnEnd(text)\n  }\n\n  public func typeTextOnEnd(_ text: String) {\n    let content = value as? String ?? \"\"\n    let shouldSkipFocus = hasKeyboardFocus && content.count == 0\n\n    if (!shouldSkipFocus) {\n      let end = coordinate(withNormalizedOffset: CGVector(dx: 0.7, dy: 0.5))\n      end.tap()\n    }\n\n    typeText(text)\n  }\n\n  public func clearText() {\n    guard var content = value as? String else {\n      XCTFail(\"The text field does not contain a string value.\")\n      return\n    }\n\n    while content.count > 0 {\n      let deleteString = String(repeating: \"\\u{8}\", count: content.count)\n      typeText(deleteString)\n\n      let newContent = value as? String ?? \"\"\n\n      if (newContent == content) {\n        break\n      } else {\n        content = newContent\n      }\n    }\n  }\n}\n\nextension XCUIElement {\n  var hasKeyboardFocus: Bool {\n    return (self.value(forKey: \"hasKeyboardFocus\") as? Bool) ?? false\n  }\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t602735AA2BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735A92BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.swift */; };\n\t\t602735AC2BCC0ACF00A9EE22 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735AB2BCC0ACF00A9EE22 /* ContentView.swift */; };\n\t\t602735AE2BCC0AD000A9EE22 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 602735AD2BCC0AD000A9EE22 /* Assets.xcassets */; };\n\t\t602735B12BCC0AD000A9EE22 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 602735B02BCC0AD000A9EE22 /* Preview Assets.xcassets */; };\n\t\t602735BE2BCC0C1500A9EE22 /* DetoxXCUITestRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735BD2BCC0C1500A9EE22 /* DetoxXCUITestRunner.swift */; };\n\t\t602735CA2BCC1C4500A9EE22 /* InvocationParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735C92BCC1C4500A9EE22 /* InvocationParams.swift */; };\n\t\t602735CD2BCC1F9C00A9EE22 /* InvocationParamsReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735CC2BCC1F9C00A9EE22 /* InvocationParamsReader.swift */; };\n\t\t602735D22BCC22E400A9EE22 /* XCUIApplication+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735D12BCC22E400A9EE22 /* XCUIApplication+Extensions.swift */; };\n\t\t602735D52BCC24EE00A9EE22 /* ElementType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735D42BCC24EE00A9EE22 /* ElementType+Extensions.swift */; };\n\t\t602735E12BD049C700A9EE22 /* PredicateHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735E02BD049C700A9EE22 /* PredicateHandler.swift */; };\n\t\t602735E32BD049FB00A9EE22 /* ActionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735E22BD049FB00A9EE22 /* ActionHandler.swift */; };\n\t\t602735E52BD04A1A00A9EE22 /* ExpectationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735E42BD04A1A00A9EE22 /* ExpectationHandler.swift */; };\n\t\t602735E92BD4F24600A9EE22 /* TimeInterval+defaultTimeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735E82BD4F24600A9EE22 /* TimeInterval+defaultTimeout.swift */; };\n\t\t602735EB2BD5052600A9EE22 /* InvocationParams+matcherDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735EA2BD5052600A9EE22 /* InvocationParams+matcherDescription.swift */; };\n\t\t602735EE2BD5357D00A9EE22 /* DTXAssert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 602735ED2BD5357D00A9EE22 /* DTXAssert.swift */; };\n\t\t609454422C07253100E858CA /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 609454412C07253100E858CA /* Environment.swift */; };\n\t\t609454452C07869900E858CA /* XCUIElement+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 609454442C07869900E858CA /* XCUIElement+Extensions.swift */; };\n\t\t60AEC8592C15F24D00570BCD /* LogUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60AEC8582C15F24D00570BCD /* LogUtils.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t602735C12BCC0C1500A9EE22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 6027359E2BCC0ACF00A9EE22 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 602735A52BCC0ACF00A9EE22;\n\t\t\tremoteInfo = DetoxXCUITestRunnerApp;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t602735A62BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DetoxXCUITestRunnerApp.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t602735A92BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetoxXCUITestRunnerApp.swift; sourceTree = \"<group>\"; };\n\t\t602735AB2BCC0ACF00A9EE22 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t602735AD2BCC0AD000A9EE22 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t602735B02BCC0AD000A9EE22 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t602735BB2BCC0C1500A9EE22 /* DetoxXCUITestRunner.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DetoxXCUITestRunner.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t602735BD2BCC0C1500A9EE22 /* DetoxXCUITestRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetoxXCUITestRunner.swift; sourceTree = \"<group>\"; };\n\t\t602735C92BCC1C4500A9EE22 /* InvocationParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvocationParams.swift; sourceTree = \"<group>\"; };\n\t\t602735CC2BCC1F9C00A9EE22 /* InvocationParamsReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvocationParamsReader.swift; sourceTree = \"<group>\"; };\n\t\t602735D12BCC22E400A9EE22 /* XCUIApplication+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"XCUIApplication+Extensions.swift\"; sourceTree = \"<group>\"; };\n\t\t602735D42BCC24EE00A9EE22 /* ElementType+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = \"ElementType+Extensions.swift\"; sourceTree = \"<group>\"; };\n\t\t602735DE2BD0114000A9EE22 /* DetoxXCUITestRunner.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = DetoxXCUITestRunner.xctestplan; sourceTree = \"<group>\"; };\n\t\t602735E02BD049C700A9EE22 /* PredicateHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PredicateHandler.swift; sourceTree = \"<group>\"; };\n\t\t602735E22BD049FB00A9EE22 /* ActionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionHandler.swift; sourceTree = \"<group>\"; };\n\t\t602735E42BD04A1A00A9EE22 /* ExpectationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpectationHandler.swift; sourceTree = \"<group>\"; };\n\t\t602735E82BD4F24600A9EE22 /* TimeInterval+defaultTimeout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"TimeInterval+defaultTimeout.swift\"; sourceTree = \"<group>\"; };\n\t\t602735EA2BD5052600A9EE22 /* InvocationParams+matcherDescription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"InvocationParams+matcherDescription.swift\"; sourceTree = \"<group>\"; };\n\t\t602735ED2BD5357D00A9EE22 /* DTXAssert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DTXAssert.swift; sourceTree = \"<group>\"; };\n\t\t609454412C07253100E858CA /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = \"<group>\"; };\n\t\t609454442C07869900E858CA /* XCUIElement+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"XCUIElement+Extensions.swift\"; sourceTree = \"<group>\"; };\n\t\t60AEC8582C15F24D00570BCD /* LogUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogUtils.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t602735A32BCC0ACF00A9EE22 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t602735B82BCC0C1500A9EE22 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t6027359D2BCC0ACF00A9EE22 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735DE2BD0114000A9EE22 /* DetoxXCUITestRunner.xctestplan */,\n\t\t\t\t602735A82BCC0ACF00A9EE22 /* DetoxXCUITestRunner */,\n\t\t\t\t602735BC2BCC0C1500A9EE22 /* DetoxXCUITestRunner */,\n\t\t\t\t602735A72BCC0ACF00A9EE22 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735A72BCC0ACF00A9EE22 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735A62BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.app */,\n\t\t\t\t602735BB2BCC0C1500A9EE22 /* DetoxXCUITestRunner.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735A82BCC0ACF00A9EE22 /* DetoxXCUITestRunner */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735A92BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.swift */,\n\t\t\t\t602735AB2BCC0ACF00A9EE22 /* ContentView.swift */,\n\t\t\t\t602735AD2BCC0AD000A9EE22 /* Assets.xcassets */,\n\t\t\t\t602735AF2BCC0AD000A9EE22 /* Preview Content */,\n\t\t\t);\n\t\t\tpath = DetoxXCUITestRunner;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735AF2BCC0AD000A9EE22 /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735B02BCC0AD000A9EE22 /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735BC2BCC0C1500A9EE22 /* DetoxXCUITestRunner */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735EC2BD534DD00A9EE22 /* Utils */,\n\t\t\t\t602735DF2BD049BC00A9EE22 /* Handlers */,\n\t\t\t\t602735D02BCC22C300A9EE22 /* Extensions */,\n\t\t\t\t602735CB2BCC1F7300A9EE22 /* Params Reader */,\n\t\t\t\t602735BD2BCC0C1500A9EE22 /* DetoxXCUITestRunner.swift */,\n\t\t\t);\n\t\t\tpath = DetoxXCUITestRunner;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735CB2BCC1F7300A9EE22 /* Params Reader */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735C92BCC1C4500A9EE22 /* InvocationParams.swift */,\n\t\t\t\t602735CC2BCC1F9C00A9EE22 /* InvocationParamsReader.swift */,\n\t\t\t);\n\t\t\tpath = \"Params Reader\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735D02BCC22C300A9EE22 /* Extensions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735D42BCC24EE00A9EE22 /* ElementType+Extensions.swift */,\n\t\t\t\t602735EA2BD5052600A9EE22 /* InvocationParams+matcherDescription.swift */,\n\t\t\t\t602735E82BD4F24600A9EE22 /* TimeInterval+defaultTimeout.swift */,\n\t\t\t\t602735D12BCC22E400A9EE22 /* XCUIApplication+Extensions.swift */,\n\t\t\t);\n\t\t\tpath = Extensions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735DF2BD049BC00A9EE22 /* Handlers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t602735E02BD049C700A9EE22 /* PredicateHandler.swift */,\n\t\t\t\t602735E22BD049FB00A9EE22 /* ActionHandler.swift */,\n\t\t\t\t602735E42BD04A1A00A9EE22 /* ExpectationHandler.swift */,\n\t\t\t);\n\t\t\tpath = Handlers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t602735EC2BD534DD00A9EE22 /* Utils */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t60AEC8582C15F24D00570BCD /* LogUtils.swift */,\n\t\t\t\t602735ED2BD5357D00A9EE22 /* DTXAssert.swift */,\n\t\t\t\t609454412C07253100E858CA /* Environment.swift */,\n\t\t\t\t609454442C07869900E858CA /* XCUIElement+Extensions.swift */,\n\t\t\t);\n\t\t\tpath = Utils;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t602735A52BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 602735B42BCC0AD000A9EE22 /* Build configuration list for PBXNativeTarget \"DetoxXCUITestRunnerApp\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t602735A22BCC0ACF00A9EE22 /* Sources */,\n\t\t\t\t602735A32BCC0ACF00A9EE22 /* Frameworks */,\n\t\t\t\t602735A42BCC0ACF00A9EE22 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = DetoxXCUITestRunnerApp;\n\t\t\tproductName = DetoxXCUITestRunner;\n\t\t\tproductReference = 602735A62BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t602735BA2BCC0C1500A9EE22 /* DetoxXCUITestRunner */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 602735C32BCC0C1500A9EE22 /* Build configuration list for PBXNativeTarget \"DetoxXCUITestRunner\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t602735B72BCC0C1500A9EE22 /* Sources */,\n\t\t\t\t602735B82BCC0C1500A9EE22 /* Frameworks */,\n\t\t\t\t602735B92BCC0C1500A9EE22 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t602735C22BCC0C1500A9EE22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = DetoxXCUITestRunner;\n\t\t\tproductName = DetoxXCUITestRunner;\n\t\t\tproductReference = 602735BB2BCC0C1500A9EE22 /* DetoxXCUITestRunner.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.ui-testing\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t6027359E2BCC0ACF00A9EE22 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tBuildIndependentTargetsInParallel = 1;\n\t\t\t\tLastSwiftUpdateCheck = 1530;\n\t\t\t\tLastUpgradeCheck = 1530;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t602735A52BCC0ACF00A9EE22 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 15.3;\n\t\t\t\t\t};\n\t\t\t\t\t602735BA2BCC0C1500A9EE22 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 15.3;\n\t\t\t\t\t\tTestTargetID = 602735A52BCC0ACF00A9EE22;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 602735A12BCC0ACF00A9EE22 /* Build configuration list for PBXProject \"DetoxXCUITestRunner\" */;\n\t\t\tcompatibilityVersion = \"Xcode 14.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 6027359D2BCC0ACF00A9EE22;\n\t\t\tproductRefGroup = 602735A72BCC0ACF00A9EE22 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t602735A52BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp */,\n\t\t\t\t602735BA2BCC0C1500A9EE22 /* DetoxXCUITestRunner */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t602735A42BCC0ACF00A9EE22 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t602735B12BCC0AD000A9EE22 /* Preview Assets.xcassets in Resources */,\n\t\t\t\t602735AE2BCC0AD000A9EE22 /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t602735B92BCC0C1500A9EE22 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t602735A22BCC0ACF00A9EE22 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t602735AC2BCC0ACF00A9EE22 /* ContentView.swift in Sources */,\n\t\t\t\t602735AA2BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t602735B72BCC0C1500A9EE22 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t602735D22BCC22E400A9EE22 /* XCUIApplication+Extensions.swift in Sources */,\n\t\t\t\t609454422C07253100E858CA /* Environment.swift in Sources */,\n\t\t\t\t602735EB2BD5052600A9EE22 /* InvocationParams+matcherDescription.swift in Sources */,\n\t\t\t\t602735E32BD049FB00A9EE22 /* ActionHandler.swift in Sources */,\n\t\t\t\t602735D52BCC24EE00A9EE22 /* ElementType+Extensions.swift in Sources */,\n\t\t\t\t602735E12BD049C700A9EE22 /* PredicateHandler.swift in Sources */,\n\t\t\t\t602735BE2BCC0C1500A9EE22 /* DetoxXCUITestRunner.swift in Sources */,\n\t\t\t\t602735E92BD4F24600A9EE22 /* TimeInterval+defaultTimeout.swift in Sources */,\n\t\t\t\t602735E52BD04A1A00A9EE22 /* ExpectationHandler.swift in Sources */,\n\t\t\t\t602735CD2BCC1F9C00A9EE22 /* InvocationParamsReader.swift in Sources */,\n\t\t\t\t602735CA2BCC1C4500A9EE22 /* InvocationParams.swift in Sources */,\n\t\t\t\t602735EE2BD5357D00A9EE22 /* DTXAssert.swift in Sources */,\n\t\t\t\t60AEC8592C15F24D00570BCD /* LogUtils.swift in Sources */,\n\t\t\t\t609454452C07869900E858CA /* XCUIElement+Extensions.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t602735C22BCC0C1500A9EE22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 602735A52BCC0ACF00A9EE22 /* DetoxXCUITestRunnerApp */;\n\t\t\ttargetProxy = 602735C12BCC0C1500A9EE22 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t602735B22BCC0AD000A9EE22 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++20\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu17;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLOCALIZATION_PREFERS_STRING_CATALOGS = YES;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = \"DEBUG $(inherited)\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t602735B32BCC0AD000A9EE22 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++20\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu17;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLOCALIZATION_PREFERS_STRING_CATALOGS = YES;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t602735B52BCC0AD000A9EE22 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"DetoxXCUITestRunner/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tINFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;\n\t\t\t\tINFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;\n\t\t\t\tINFOPLIST_KEY_UILaunchScreen_Generation = YES;\n\t\t\t\tINFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = \"UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight\";\n\t\t\t\tINFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = \"UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxXCUITestRunnerApp;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos iphonesimulator\";\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tSUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t602735B62BCC0AD000A9EE22 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"DetoxXCUITestRunner/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tINFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;\n\t\t\t\tINFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;\n\t\t\t\tINFOPLIST_KEY_UILaunchScreen_Generation = YES;\n\t\t\t\tINFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = \"UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight\";\n\t\t\t\tINFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = \"UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxXCUITestRunnerApp;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos iphonesimulator\";\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tSUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t602735C42BCC0C1500A9EE22 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxXCUITestRunner;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos iphonesimulator\";\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tSUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = NO;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tTEST_TARGET_NAME = DetoxXCUITestRunnerApp;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t602735C52BCC0C1500A9EE22 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxXCUITestRunner;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos iphonesimulator\";\n\t\t\t\tSUPPORTS_MACCATALYST = NO;\n\t\t\t\tSUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = NO;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tTEST_TARGET_NAME = DetoxXCUITestRunnerApp;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t602735A12BCC0ACF00A9EE22 /* Build configuration list for PBXProject \"DetoxXCUITestRunner\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t602735B22BCC0AD000A9EE22 /* Debug */,\n\t\t\t\t602735B32BCC0AD000A9EE22 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t602735B42BCC0AD000A9EE22 /* Build configuration list for PBXNativeTarget \"DetoxXCUITestRunnerApp\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t602735B52BCC0AD000A9EE22 /* Debug */,\n\t\t\t\t602735B62BCC0AD000A9EE22 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t602735C32BCC0C1500A9EE22 /* Build configuration list for PBXNativeTarget \"DetoxXCUITestRunner\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t602735C42BCC0C1500A9EE22 /* Debug */,\n\t\t\t\t602735C52BCC0C1500A9EE22 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 6027359E2BCC0ACF00A9EE22 /* Project object */;\n}\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner.xcodeproj/xcshareddata/xcschemes/DetoxXCUITestRunner.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1530\"\n   version = \"1.7\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\"\n      buildArchitectures = \"Automatic\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"602735A52BCC0ACF00A9EE22\"\n               BuildableName = \"DetoxXCUITestRunnerApp.app\"\n               BlueprintName = \"DetoxXCUITestRunnerApp\"\n               ReferencedContainer = \"container:DetoxXCUITestRunner.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <TestPlans>\n         <TestPlanReference\n            reference = \"container:DetoxXCUITestRunner.xctestplan\"\n            default = \"YES\">\n         </TestPlanReference>\n      </TestPlans>\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"602735BA2BCC0C1500A9EE22\"\n               BuildableName = \"DetoxXCUITestRunner.xctest\"\n               BlueprintName = \"DetoxXCUITestRunner\"\n               ReferencedContainer = \"container:DetoxXCUITestRunner.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"602735A52BCC0ACF00A9EE22\"\n            BuildableName = \"DetoxXCUITestRunnerApp.app\"\n            BlueprintName = \"DetoxXCUITestRunnerApp\"\n            ReferencedContainer = \"container:DetoxXCUITestRunner.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"602735A52BCC0ACF00A9EE22\"\n            BuildableName = \"DetoxXCUITestRunnerApp.app\"\n            BlueprintName = \"DetoxXCUITestRunnerApp\"\n            ReferencedContainer = \"container:DetoxXCUITestRunner.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "detox/ios/DetoxXCUITestRunner/DetoxXCUITestRunner.xctestplan",
    "content": "{\n  \"configurations\" : [\n    {\n      \"id\" : \"C80674F4-8FF4-44FC-9217-568D50BF2A27\",\n      \"name\" : \"Test Scheme Action\",\n      \"options\" : {\n\n      }\n    }\n  ],\n  \"defaultOptions\" : {\n    \"targetForVariableExpansion\" : {\n      \"containerPath\" : \"container:DetoxXCUITestRunner.xcodeproj\",\n      \"identifier\" : \"602735A52BCC0ACF00A9EE22\",\n      \"name\" : \"DetoxXCUITestRunnerApp\"\n    }\n  },\n  \"testTargets\" : [\n    {\n      \"target\" : {\n        \"containerPath\" : \"container:DetoxXCUITestRunner.xcodeproj\",\n        \"identifier\" : \"602735BA2BCC0C1500A9EE22\",\n        \"name\" : \"DetoxXCUITestRunner\"\n      }\n    }\n  ],\n  \"version\" : 1\n}\n"
  },
  {
    "path": "detox/jest.config.js",
    "content": "const DEBUG = process.argv.includes('--reporters');\n\n/** @type{import('jest-allure2-reporter').ReporterOptions} */\nconst jestAllure2ReporterOptions = {\n  testCase: {\n    labels: {\n      package: ({ filePath }) => `unit.${filePath.slice(1, -1).join('.')}`,\n      testMethod: ({ testCase }) => testCase.fullName,\n      tag: ['unit'],\n    },\n  },\n};\n\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n  setupFiles: [\n    '<rootDir>/__tests__/setupJest.js'\n  ],\n  testEnvironment: DEBUG ? 'node' : 'jest-allure2-reporter/environment-node',\n  testRunner: 'jest-circus/runner',\n  roots: [\n    'node_modules',\n    'local-cli',\n    'src',\n    'runners'\n  ],\n  testPathIgnorePatterns: [\n    '/node_modules/',\n    'local-cli/test.js'\n  ],\n  coveragePathIgnorePatterns: [\n    '/node_modules/',\n    '__tests__',\n    '.test.js$',\n    '.mock.js$',\n    'index.js',\n    'internals.js',\n    'local-cli/utils',\n    'src/environmentFactory',\n    'src/android/espressoapi',\n    'src/artifacts/factories/index.js',\n    'src/artifacts/providers/index.js',\n    'src/artifacts/log',\n    'src/artifacts/screenshot',\n    'src/artifacts/video',\n    'src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js',\n    'src/devices/allocation/drivers/android/emulator/patchAvdSkinConfig.js',\n    'src/devices/allocation/.*AllocDriver.js',\n    'src/devices/allocation/drivers/ios',\n    'src/devices/allocation/factories',\n    'src/devices/allocation/factories/drivers',\n    'src/devices/cookies',\n    'src/devices/common/drivers/android/exec/ADB.js',\n    'src/devices/common/drivers/android/emulator/exec/EmulatorExec.js',\n    'src/devices/common/drivers/android/tools/EmulatorTelnet.js',\n    'src/devices/common/drivers/ios/tools',\n    'src/devices/runtime/drivers/android/AndroidDriver.js',\n    'src/devices/runtime/drivers/android/emulator/EmulatorDriver.js',\n    'src/devices/runtime/drivers/DeviceDriverBase.js',\n    'src/devices/runtime/drivers/ios',\n    'src/devices/runtime/factories',\n    'src/devices/runtime/factories/drivers',\n    'src/devices/validation/EnvironmentValidatorBase.js',\n    'src/devices/validation/factories',\n    'src/matchers/factories',\n    'src/utils/appdatapath.js',\n    'src/utils/debug.js',\n    'src/utils/environment.js',\n    'src/utils/logger.js',\n    'src/utils/pipeCommands.js',\n    'src/utils/pressAnyKey.js',\n    'src/utils/repl.js',\n    'src/utils/shellUtils.js',\n    'runners/jest/reporters',\n    'runners/jest/testEnvironment',\n    'src/DetoxWorker.js',\n    'src/logger/utils/streamUtils.js',\n    'src/realms',\n    'src/pilot',\n  ],\n  resetMocks: true,\n  resetModules: true,\n  reporters: [\n    'default',\n    [\n      'jest-allure2-reporter',\n      jestAllure2ReporterOptions,\n    ]\n  ],\n  coverageReporters: [\n    'html',\n    'json',\n    'text',\n    'clover',\n    [\n      'lcov',\n      {\n        projectRoot: '..'\n      }\n    ]\n  ],\n  coverageThreshold: {\n    global: {\n      statements: 100,\n      branches: 100,\n      functions: 100,\n      lines: 100\n    }\n  }\n};\n"
  },
  {
    "path": "detox/jsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowSyntheticDefaultImports\": true,\n    \"checkJs\": true,\n    \"target\": \"es2017\"\n  },\n  \"exclude\": [\n    \"node_modules\"\n  ],\n  \"include\": [\n    \"src/**/*\"\n  ]\n}"
  },
  {
    "path": "detox/local-cli/__mocks__/detox.config.js",
    "content": "module.exports = {\n  configurations: {\n    only: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 11'\n      }\n    },\n  },\n};\n"
  },
  {
    "path": "detox/local-cli/__mocks__/executable",
    "content": "#!/usr/bin/env node\n\nconst fs = require('fs');\n\nconst DETOX_REGEXP = /^DETOX_(?!DISABLE_POD_INSTALL|DISABLE_POSTINSTALL)/;\n\nfunction main() {\n    const [, ...argv] = process.argv;\n    const env = Object.keys(process.env)\n        .filter(k => DETOX_REGEXP.test(k.toUpperCase()))\n        .reduce((acc, key) => {\n            acc[key] = process.env[key];\n            return acc;\n        }, {});\n\n    const output = JSON.stringify({ env, argv }) + '\\n';\n\n    if (process.env.CLI_TEST_STDOUT) {\n        fs.appendFileSync(process.env.CLI_TEST_STDOUT, output);\n    } else {\n        process.stdout.write(output);\n    }\n\n    if (process.env.CLI_EXIT_CODE) {\n        process.exit(+process.env.CLI_EXIT_CODE);\n    } else {\n        process.exit(0);\n    }\n}\n\nif (process.env.CLI_SLEEP > 0) {\n    setTimeout(main, +process.env.CLI_SLEEP);\n} else {\n    main();\n}\n"
  },
  {
    "path": "detox/local-cli/__snapshots__/run-server.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`run-server throws if the port number is out of range 1`] = `\"The port should be between 1 and 65535, got NaN\"`;\n\nexports[`run-server throws if the port number is out of range 2`] = `\"The port should be between 1 and 65535, got 0\"`;\n\nexports[`run-server throws if the port number is out of range 3`] = `\"The port should be between 1 and 65535, got 100000\"`;\n"
  },
  {
    "path": "detox/local-cli/build-framework-cache.js",
    "content": "const { build } = require('./utils/frameworkUtils');\n\nmodule.exports = {\n  command: 'build-framework-cache',\n  desc: 'Builds cached versions of the Detox framework and XCUITest-runner in ~/Library/Detox. ' +\n    'Use the `--detox` and `--xcuitest` flags to selectively build the framework components. ' +\n    'By default, both the injected Detox library and the XCUITest test runner are built. (MacOS only)',\n\n  builder: yargs => yargs\n  .option('detox', {\n    describe: 'Build only the injected Detox library',\n    type: 'boolean',\n    default: false\n  })\n  .option('xcuitest', {\n    describe: 'Build only the XCUITest test runner',\n    type: 'boolean',\n    default: false\n  }),\n\n  handler: async function(argv) {\n    await build(argv.detox, argv.xcuitest);\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/build.js",
    "content": "// @ts-nocheck\nconst cp = require('child_process');\nconst fs = require('fs');\n\nconst detox = require('../internals');\n\nmodule.exports.command = 'build';\nmodule.exports.desc = \"Runs the user-provided build command, as defined in the 'build' property of the specified configuration.\";\nmodule.exports.builder = {\n  C: {\n    alias: 'config-path',\n    group: 'Configuration:',\n    describe: 'Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or \"detox\" section in package.json',\n  },\n  c: {\n    alias: 'configuration',\n    group: 'Configuration:',\n    describe:\n      \"Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it\",\n  },\n  i: {\n    alias: 'if-missing',\n    group: 'Configuration:',\n    boolean: true,\n    describe:\n      'Execute the build command only if the app binary is missing.',\n  },\n  s: {\n    alias: 'silent',\n    group: 'Configuration:',\n    boolean: true,\n    describe:\n      'Do not fail with error if an app config has no build command.',\n  },\n};\n\nfunction checkWhichAppsExist(appsConfig) {\n  const result = { '*': true };\n\n  for (const appName of Object.keys(appsConfig)) {\n    result[appName] = true;\n\n    /* istanbul ignore next */\n    const app = appsConfig[appName] || {};\n    if (app.binaryPath && !fs.existsSync(app.binaryPath)) {\n      result[appName] = result['*'] = false;\n    }\n\n    if (app.testBinaryPath && !fs.existsSync(app.testBinaryPath)) {\n      result[appName] = result['*'] = false;\n    }\n  }\n\n  return result;\n}\n\nmodule.exports.handler = async function build(argv) {\n  const { apps, commands, errorComposer } = await detox.resolveConfig({ argv });\n  const appsExist = checkWhichAppsExist(apps);\n\n  let seenBuildCommands = false;\n\n  for (const { appName, build } of commands) {\n    const app = apps[appName] || {};\n\n    if (build) {\n      seenBuildCommands = true;\n\n      if (argv['if-missing'] && appsExist[appName || '*']) {\n        detox.log.info(appName ? `Skipping build for \"${appName}\" app...` : 'Skipping build...');\n        continue;\n      }\n\n      try {\n        if (appName && commands.length > 1) {\n          detox.log.info(`Building \"${appName}\" app...`);\n        }\n\n        detox.log.info(build);\n        cp.execSync(build, { stdio: 'inherit' });\n      } catch (e) {\n        detox.log.warn(\"\\n\\nImportant: 'detox build' is a convenience shortcut for calling your own build command, as provided in the config file.\\nFailures in this build command are not the responsibility of Detox. You are responsible for maintaining this command.\\n\");\n        throw e;\n      }\n    }\n\n    if (app.binaryPath && !fs.existsSync(app.binaryPath)) {\n      detox.log.warn('After running the build command, Detox could not find your app at the given binary path:\\n\\t' + app.binaryPath + \"\\nMake sure it is correct, otherwise you'll get an error on an attempt to install your app.\\n\");\n    }\n  }\n\n  if (!seenBuildCommands && !argv.silent) {\n    throw errorComposer.missingBuildScript(Object.values(apps)[0]);\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/build.test.js",
    "content": "const { callCli } = require('../__tests__/helpers');\nconst tempfile = require('../src/utils/tempfile');\n\n\ndescribe('build', () => {\n  let execSync, detox;\n\n  beforeEach(() => {\n    jest.mock('child_process');\n    execSync = require('child_process').execSync;\n\n    jest.mock('../src/utils/logger');\n    jest.mock('../internals', () => {\n      const DetoxConfigErrorComposer = require('../src/errors/DetoxConfigErrorComposer');\n\n      const config = {\n        apps: {},\n        artifacts: {},\n        behavior: {},\n        commands: [],\n        errorComposer: new DetoxConfigErrorComposer(),\n        device: {},\n        session: {}\n      };\n\n      return ({\n        config,\n        resolveConfig: jest.fn().mockResolvedValue(config),\n        log: require('../src/utils/logger')\n      });\n    });\n\n    detox = require('../internals');\n  });\n\n  it('passes argv to resolveConfig', async () => {\n    await callCli('./build', 'build -C /etc/.detoxrc.js -c myconf').catch(() => {});\n\n    expect(detox.resolveConfig).toHaveBeenCalledWith({\n      argv: expect.objectContaining({\n        'C': '/etc/.detoxrc.js',\n        'c': 'myconf',\n      }),\n    });\n  });\n\n  it('runs the build script from the composed device config', async () => {\n    detox.config.commands = [{ appName: 'default', build: 'yet another command' }];\n\n    await callCli('./build', 'build');\n    expect(execSync).toHaveBeenCalledWith('yet another command', expect.anything());\n  });\n\n  it('skips building the app if the binary exists and --if-missing flag is set', async () => {\n    detox.config.apps.default = { binaryPath: __filename };\n    detox.config.commands = [{ appName: 'default', build: 'yet another command' }];\n\n    await callCli('./build', 'build -i');\n    expect(execSync).not.toHaveBeenCalled();\n\n    await callCli('./build', 'build --if-missing');\n    expect(execSync).not.toHaveBeenCalled();\n\n    expect(detox.log.info).toHaveBeenCalledWith('Skipping build for \"default\" app...');\n  });\n\n  it('should not skip building the app if the test binary does not exist', async () => {\n    detox.config.apps.default = { binaryPath: __filename, testBinaryPath: __filename + '.doesnotexist' };\n    detox.config.commands = [{ appName: 'default', build: 'yet another command' }];\n\n    await callCli('./build', 'build --if-missing');\n    expect(execSync).toHaveBeenCalled();\n  });\n\n  it('skips building the multi-app build command if all apps exist and --if-missing flag is set', async () => {\n    detox.config.apps.app1 = { binaryPath: __filename };\n    detox.config.apps.app2 = { binaryPath: __filename };\n    detox.config.commands = [\n      { build: 'yet another command' },\n    ];\n\n    await callCli('./build', 'build -i');\n    expect(execSync).not.toHaveBeenCalled();\n\n    await callCli('./build', 'build --if-missing');\n    expect(execSync).not.toHaveBeenCalled();\n\n    expect(detox.log.info).toHaveBeenCalledWith('Skipping build...');\n  });\n\n  it('should not skip building the multi-app build command if one app does not exist', async () => {\n    detox.config.apps.app1 = { binaryPath: __filename };\n    detox.config.apps.app2 = { binaryPath: __filename + '.doesnotexist' };\n    detox.config.commands = [\n      { build: 'yet another command' },\n    ];\n\n    await callCli('./build', 'build --if-missing');\n    expect(execSync).toHaveBeenCalled();\n    expect(detox.log.info).not.toHaveBeenCalledWith('Skipping build...');\n  });\n\n  it('fails with an error if a build script has not been found', async () => {\n    detox.config.apps.default = {};\n    detox.config.commands = [{ appName: 'default', start: 'a command' }];\n    await expect(callCli('./build', 'build')).rejects.toThrow(/Failed to build/);\n  });\n\n  it('should ignore missing build command with -s, --silent flag', async () => {\n    detox.config.apps.default = {};\n    await expect(callCli('./build', 'build -s')).resolves.not.toThrow();\n    expect(detox.log.warn).not.toHaveBeenCalled();\n  });\n\n  it('should print a warning upon user build script failure', async () => {\n    detox.config.commands = [{ appName: 'default', build: 'a command' }];\n    execSync.mockImplementation(() => { throw new Error('Build failure'); });\n    await expect(callCli('./build', 'build')).rejects.toThrow(/Build failure/);\n    expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('You are responsible'));\n  });\n\n  it('should print a warning if app is not found at binary path', async () => {\n    detox.config.apps.default = { binaryPath: tempfile() };\n    detox.config.commands = [{ appName: 'default', build: ':' }];\n\n    await expect(callCli('./build', 'build -s')).resolves.not.toThrow();\n    expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('could not find your app at the given binary path'));\n  });\n\n  it('should print extra message with the app name before building (in a multi-app configuration)', async () => {\n    detox.config.apps.app1 = { binaryPath: tempfile() };\n    detox.config.apps.app2 = { binaryPath: tempfile() };\n    detox.config.commands = [{ appName: 'app1', build: 'app1 build' }, { appName: 'app2', build: 'app2 build' }];\n\n    await expect(callCli('./build', 'build -s')).resolves.not.toThrow();\n    expect(detox.log.info).toHaveBeenCalledWith(expect.stringContaining('app1'));\n    expect(detox.log.info).toHaveBeenCalledWith(expect.stringContaining('app2'));\n  });\n\n  it('should not print that extra message when the app is single', async () => {\n    detox.config.apps.default = { binaryPath: tempfile() };\n    detox.config.commands = [{ appName: 'default', build: ':' }];\n\n    await expect(callCli('./build', 'build -s')).resolves.not.toThrow();\n    expect(detox.log.info).not.toHaveBeenCalledWith(expect.stringContaining('default'));\n  });\n});\n"
  },
  {
    "path": "detox/local-cli/clean-framework-cache.js",
    "content": "const { clean } = require('./utils/frameworkUtils');\n\nmodule.exports = {\n  command: 'clean-framework-cache',\n  desc: 'Cleans cached versions of the Detox framework and XCUITest-runner in ~/Library/Detox. ' +\n    'Use the `--detox` and `--xcuitest` flags to selectively clean the framework components. ' +\n    'By default, both the injected Detox library and the XCUITest test runner are cleaned. (MacOS only)',\n\n  builder: yargs => yargs\n  .option('detox', {\n    describe: 'Clean only the injected Detox library',\n    type: 'boolean',\n    default: false\n  })\n  .option('xcuitest', {\n    describe: 'Clean only the XCUITest test runner',\n    type: 'boolean',\n    default: false\n  }),\n\n  handler: async function(argv) {\n    await clean(argv.detox, argv.xcuitest);\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/cli.js",
    "content": "#!/usr/bin/env node\nconst fs = require('fs');\n\nconst _ = require('lodash');\nconst yargs = require('yargs');\n\nconst logger = require('../internals').log.child({ cat: 'cli' });\nconst DetoxError = require('../src/errors/DetoxError');\n\nconst { isErrorAlreadyLogged } = require('./utils/cliErrorHandling');\n\nyargs\n  .scriptName('detox')\n  .parserConfiguration({\n    'boolean-negation': true,\n    'camel-case-expansion': false,\n    'dot-notation': false,\n    'duplicate-arguments-array': false,\n    'populate--': true,\n  })\n  .commandDir('./', {\n    exclude: function(path) {\n      // This is a test file\n      return /\\.test\\.js$/.test(path);\n    }\n  })\n  .demandCommand()\n  .recommendCommands()\n  .help()\n  .wrap(yargs.terminalWidth() * 0.9)\n  .fail(function(msg, err, program) {\n    if (err) {\n      if (!isErrorAlreadyLogged(err)) {\n        logger.error(DetoxError.format(err));\n        process.stderr.write('\\n');\n      }\n\n      // @ts-ignore\n      _.attempt(() => fs.unlinkSync(logger.file));\n      // eslint-disable-next-line no-process-exit\n      process.exit(1);\n    }\n\n    if (msg) {\n      logger.error(msg + '\\n');\n      program.showHelp();\n    }\n  })\n  .parse();\n"
  },
  {
    "path": "detox/local-cli/init.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst util = require('util');\n\nconst detox = require('../internals');\n\nconst jestTemplates = require('./templates/jest');\n\nlet exitCode = 0;\n\nmodule.exports.command = 'init';\nmodule.exports.desc = 'Creates template files to get you started with Detox';\nmodule.exports.builder = {};\n\nmodule.exports.handler = async function init() {\n  createDetoxConfig();\n  createJestFolderE2E();\n  process.exit(exitCode); // eslint-disable-line\n};\n\nfunction createFolder(dir, files) {\n  if (fs.existsSync(dir)) {\n    return reportError(`Failed to create ${dir} folder, because it already exists at path: ${path.resolve(dir)}`);\n  }\n\n  try {\n    fs.mkdirSync(dir);\n  } catch (err) {\n    return reportError({ err }, `Failed to create ${dir} folder due to an error:`);\n  }\n\n  for (const entry of Object.entries(files)) {\n    const [filename, content] = entry;\n    createFile(path.join(dir, filename), content);\n  }\n}\n\nfunction createFile(filename, content) {\n  if (fs.existsSync(filename)) {\n    return reportError(\n      `Failed to create ${filename} file, ` +\n      `because it already exists at path: ${path.resolve(filename)}`\n    );\n  }\n\n  try {\n    fs.writeFileSync(filename, content);\n    detox.log.info(`Created a file at path: ${filename}`);\n  } catch (err) {\n    reportError({ err }, `Failed to create a file at path: ${filename}`);\n  }\n}\n\nfunction createJestFolderE2E() {\n  createFolder('e2e', {\n    'jest.config.js': jestTemplates.runnerConfig,\n    'starter.test.js': jestTemplates.starter,\n  });\n}\n\nfunction createDetoxConfig() {\n  createFile('.detoxrc.js',\n    '/** @type {Detox.DetoxConfig} */\\n' +\n    'module.exports = ' +\n    util.inspect(createDefaultConfigurations(), { compact: false, depth: Infinity }) +\n    ';\\n'\n  );\n}\n\n/** @returns {Detox.DetoxConfig} */\nfunction createDefaultConfigurations() {\n  return {\n    testRunner: {\n      args: {\n        $0: 'jest',\n        config: 'e2e/jest.config.js',\n      },\n      jest: {\n        setupTimeout: 120000,\n      },\n    },\n    apps: {\n      'ios.debug': {\n        type: 'ios.app',\n        binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/YOUR_APP.app',\n        build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',\n      },\n      'ios.release': {\n        type: 'ios.app',\n        binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/YOUR_APP.app',\n        build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',\n      },\n      'android.debug': {\n        type: 'android.apk',\n        binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',\n        build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n        reversePorts: [8081],\n      },\n      'android.release': {\n        type: 'android.apk',\n        binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n        build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',\n      },\n    },\n    devices: {\n      simulator: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 15',\n        },\n      },\n      attached: {\n        type: 'android.attached',\n        device: {\n          adbName: '.*',\n        },\n      },\n      emulator: {\n        type: 'android.emulator',\n        device: {\n          avdName: 'Pixel_3a_API_30_x86',\n        },\n      },\n    },\n    configurations: {\n      'ios.sim.debug': {\n        device: 'simulator',\n        app: 'ios.debug',\n      },\n      'ios.sim.release': {\n        device: 'simulator',\n        app: 'ios.release',\n      },\n      'android.att.debug': {\n        device: 'attached',\n        app: 'android.debug',\n      },\n      'android.att.release': {\n        device: 'attached',\n        app: 'android.release',\n      },\n      'android.emu.debug': {\n        device: 'emulator',\n        app: 'android.debug',\n      },\n      'android.emu.release': {\n        device: 'emulator',\n        app: 'android.release',\n      },\n    },\n  };\n}\n\nfunction reportError(...args) {\n  detox.log.error(...args);\n  exitCode = 1;\n}\n"
  },
  {
    "path": "detox/local-cli/rebuild-framework-cache.js",
    "content": "const { build, clean } = require('./utils/frameworkUtils');\n\nmodule.exports = {\n  command: 'rebuild-framework-cache',\n  desc: 'Rebuilds cached versions of the Detox framework and XCUITest-runner in ~/Library/Detox. ' +\n    'Use the `--detox` and `--xcuitest` flags to selectively rebuild the framework components. ' +\n    'By default, both the injected Detox library and the XCUITest test runner are rebuilt. (MacOS only)',\n\n  builder: yargs => yargs\n  .option('detox', {\n    describe: 'Rebuild only the injected Detox library',\n    type: 'boolean',\n    default: false\n  })\n  .option('xcuitest', {\n    describe: 'Rebuild only the XCUITest test runner',\n    type: 'boolean',\n    default: false\n  }),\n\n  handler: async function(argv) {\n    await clean(argv.detox, argv.xcuitest);\n    await build(argv.detox, argv.xcuitest);\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/reset-lock-file.js",
    "content": "const { log } = require('../internals');\nconst DeviceRegistry = require('../src/devices/allocation/DeviceRegistry');\n\nmodule.exports.command = 'reset-lock-file';\nmodule.exports.desc = 'Resets Detox lock file completely - all devices are marked as available after that.';\n\nmodule.exports.handler = async function resetLockFile() {\n  const registry = new DeviceRegistry();\n  await registry.reset();\n\n  log.info(`Cleaned lock file at: ${registry.lockFilePath}`);\n};\n"
  },
  {
    "path": "detox/local-cli/run-server.js",
    "content": "const collectCliConfig = require('../src/configuration/collectCliConfig');\nconst composeLoggerConfig = require('../src/configuration/composeLoggerConfig');\nconst { DetoxConfigErrorComposer, DetoxRuntimeError } = require('../src/errors');\nconst DetoxServer = require('../src/server/DetoxServer');\nconst logger = require('../src/utils/logger');\n\nmodule.exports.command = 'run-server';\nmodule.exports.desc = 'Start a standalone Detox server';\nmodule.exports.builder = {\n  l: {\n    alias: 'loglevel',\n    describe: 'Log level',\n    group: 'Configuration:',\n    choices: ['fatal', 'error', 'warn', 'info', 'verbose', 'trace'],\n  },\n  p: {\n    alias: 'port',\n    describe: 'Port number',\n    group: 'Configuration:',\n    number: true,\n    default: 8099\n  },\n  'no-color': {\n    describe: 'Disable colorful logs',\n    boolean: true\n  }\n};\n\nmodule.exports.handler = async function runServer(argv) {\n  if (isNaN(argv.port) || argv.port < 1 || argv.port > 65535) {\n    throw new DetoxRuntimeError(`The port should be between 1 and 65535, got ${argv.port}`);\n  }\n\n  const errorComposer = new DetoxConfigErrorComposer();\n\n  await logger.setConfig(composeLoggerConfig({\n    // @ts-ignore\n    globalConfig: {},\n    // @ts-ignore\n    localConfig: {},\n    cliConfig: collectCliConfig({ argv, errorComposer }),\n  }));\n\n  await new DetoxServer({\n    port: +argv.port,\n    standalone: true,\n  }).open();\n};\n"
  },
  {
    "path": "detox/local-cli/run-server.test.js",
    "content": "jest.mock('../src/utils/logger');\n\nconst { callCli } = require('../__tests__/helpers');\n\ndescribe('run-server', () => {\n  it('starts the server', async () => {\n    jest.mock('../src/server/DetoxServer');\n    const DetoxServer = require('../src/server/DetoxServer');\n    await callCli('./run-server', 'run-server');\n\n    expect(DetoxServer).toHaveBeenCalledWith(expect.objectContaining({ port: 8099 }));\n  });\n\n  it('throws if the port number is out of range', async () => {\n    jest.spyOn(process, 'exit'); // otherwise tests are aborted\n    jest.mock('../src/server/DetoxServer');\n    const DetoxServer = require('../src/server/DetoxServer');\n\n    await expect(callCli('./run-server', 'run-server -p PORT')).rejects.toThrowErrorMatchingSnapshot();\n    await expect(callCli('./run-server', 'run-server -p 0')).rejects.toThrowErrorMatchingSnapshot();\n    await expect(callCli('./run-server', 'run-server -p 100000')).rejects.toThrowErrorMatchingSnapshot();\n    expect(DetoxServer).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "detox/local-cli/start.js",
    "content": "const detox = require('../internals');\n\nconst AppStartCommand = require('./startCommand/AppStartCommand');\n\nmodule.exports.command = 'start';\nmodule.exports.desc = 'Run app \"start\" scripts inside the selected configuration';\nmodule.exports.builder = {\n  C: {\n    alias: 'config-path',\n    describe: 'Specify Detox config file path. If not supplied, Detox searches for .detoxrc[.js] or \"detox\" section in package.json',\n  },\n  c: {\n    alias: ['configuration'],\n    describe:\n      'Select a local configuration from your defined configurations to extract the app \"start\" scripts from. If not supplied, and there\\'s only one configuration, Detox will default to it',\n  },\n  f: {\n    alias: 'force',\n    describe: 'Ignore errors from the \"start\" scripts and proceed',\n    boolean: true,\n  }\n};\n\nmodule.exports.handler = async function start(argv) {\n  const { commands } = await detox.resolveConfig({ argv });\n  const startCommands = commands.map(s => s.start).filter(Boolean)\n    .map(cmd => new AppStartCommand({\n      cmd,\n      passthrough: argv['--'],\n      forceSpawn: argv.force,\n    }));\n\n  if (startCommands.length) {\n    try {\n      await Promise.all(startCommands.map(c => c.execute()));\n    } catch (e) {\n      await Promise.allSettled(startCommands.map(c => c.stop()));\n      throw e;\n    }\n  } else {\n    detox.log.warn('No \"start\" commands were found in the app configs.');\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/start.test.js",
    "content": "const { callCli, buildMockCommand } = require('../__tests__/helpers');\n\ndescribe('start', () => {\n  let cmd;\n  let detox;\n\n  beforeEach(() => {\n    cmd = null;\n\n    jest.mock('../src/utils/logger');\n    jest.mock('../internals', () => {\n      const DetoxConfigErrorComposer = require('../src/errors/DetoxConfigErrorComposer');\n\n      const config = {\n        apps: {},\n        artifacts: {},\n        behavior: {},\n        commands: [],\n        errorComposer: new DetoxConfigErrorComposer(),\n        device: {},\n        session: {}\n      };\n\n      return ({\n        config,\n        resolveConfig: jest.fn().mockResolvedValue(config),\n        log: require('../src/utils/logger')\n      });\n    });\n\n    detox = require('../internals');\n  });\n\n  afterEach(async () => {\n    if (cmd) {\n      await cmd.clean();\n    }\n  });\n\n  it('passes argv to resolveConfig', async () => {\n    await callCli('./start', 'start -C /etc/.detoxrc.js -c myconf');\n\n    expect(detox.resolveConfig).toHaveBeenCalledWith({\n      argv: expect.objectContaining({\n        'C': '/etc/.detoxrc.js',\n        'c': 'myconf',\n      }),\n    });\n  });\n\n  it('warns if no start commands were found', async () => {\n    await callCli('./start', 'start');\n    expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('No \"start\" commands were found'));\n  });\n\n  it('spawns the start script from the composed apps config', async () => {\n    cmd = buildMockCommand();\n    detox.config.commands = [{ appName: 'default', start: `${cmd.cmd} --arg1=value1 --arg2 value2` }];\n    await callCli('./start', 'start').catch(() => {});\n\n    expect(cmd.calls).toEqual([\n      expect.objectContaining({ argv: [\n        expect.stringContaining('executable'),\n        '--arg1=value1',\n        '--arg2',\n        'value2',\n      ] }),\n    ]);\n  });\n\n  it('forwards passthrough arguments to the start script', async () => {\n    cmd = buildMockCommand();\n    detox.config.commands = [{ appName: 'default', start: `${cmd.cmd} --arg1` }];\n    await callCli('./start', 'start -- --arg2').catch(() => {});\n\n    expect(cmd.calls).toEqual([\n      expect.objectContaining({ argv: [\n          expect.stringContaining('executable'),\n          '--arg1',\n          '--arg2',\n        ] }),\n    ]);\n  });\n\n  it('stops if one of the scripts is failing', async () => {\n    cmd = buildMockCommand({ exitCode: 0, sleep: 100 });\n    detox.config.commands.push({ appName: 'app1', start: 'node --eval=\"process.exit(3)\"' });\n    detox.config.commands.push({ appName: 'app2', start: cmd.cmd });\n    await expect(callCli('./start', 'start')).rejects.toThrow(/Command exited with code 3/);\n\n    expect(cmd.calls).toHaveLength(0);\n  });\n\n  it.each([\n    ['-f'],\n    ['--force'],\n  ])('does not stop in %s mode if one of the scripts is failing', async (__force) => {\n    cmd = buildMockCommand({ sleep: 100 });\n    detox.config.commands.push({ appName: 'app1', start: 'node --eval=\"process.exit(3)\"' });\n    detox.config.commands.push({ appName: 'app2', start: cmd.cmd });\n\n    await callCli('./start', `start ${__force}`);\n    expect(cmd.calls).toHaveLength(1);\n  });\n});\n"
  },
  {
    "path": "detox/local-cli/startCommand/AppStartCommand.js",
    "content": "const execa = require('execa');\n\nconst detox = require('../../internals');\nconst { DetoxRuntimeError } = require('../../src/errors');\nconst Deferred = require('../../src/utils/Deferred');\nconst log = detox.log.child({ cat: ['lifecycle', 'cli'] });\n\nclass AppStartCommand {\n  constructor({ cmd, passthrough = [], forceSpawn = false }) {\n    this._id = Math.random();\n    this._cmd = cmd;\n    this._passthrough = passthrough;\n    this._forceSpawn = forceSpawn;\n\n    this._cpHandle = null;\n    this._cpDeferred = new Deferred();\n  }\n\n  execute() {\n    const cmd = [this._cmd, ...this._passthrough].join(' ');\n\n    log.info.begin({ id: this._id }, cmd);\n\n    const onEnd = (msg, code, signal) => {\n      log.trace.end({ id: this._id, code, signal }, msg);\n      this._cpDeferred.resolve();\n    };\n\n    const onError = (msg, code, signal) => {\n      const logLevel = this._forceSpawn ? 'warn' : 'error';\n      log[logLevel].end({ id: this._id, code, signal }, msg);\n      if (this._forceSpawn) {\n        this._cpDeferred.resolve();\n      } else {\n        this._cpDeferred.reject(new DetoxRuntimeError(msg));\n      }\n    };\n\n    this._cpHandle = execa.command(cmd, {\n      stdio: ['ignore', 'inherit', 'inherit'],\n      shell: true\n    });\n    this._cpHandle.on('error', onError);\n    this._cpHandle.on('exit', (code, signal) => {\n      const reason = code == null ? `signal ${signal}` : `code ${code}`;\n      const msg = `Command exited with ${reason}: ${cmd}`;\n      if (signal || code === 0) {\n        onEnd(msg, code, signal);\n      } else {\n        onError(msg, code, signal);\n      }\n\n      this._cpHandle = null;\n    });\n\n    return this._cpDeferred.promise;\n  }\n\n  async stop() {\n    if (this._cpHandle) {\n      this._cpHandle.kill();\n    }\n\n    return this._cpDeferred.promise;\n  }\n}\n\nmodule.exports = AppStartCommand;\n"
  },
  {
    "path": "detox/local-cli/templates/firstTestContent.js",
    "content": "const firstTestContent = `describe('Example', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should have welcome screen', async () => {\n    await expect(element(by.id('welcome'))).toBeVisible();\n  });\n\n  it('should show hello screen after tap', async () => {\n    await element(by.id('hello_button')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('should show world screen after tap', async () => {\n    await element(by.id('world_button')).tap();\n    await expect(element(by.text('World!!!'))).toBeVisible();\n  });\n});\n`;\n\nmodule.exports = firstTestContent;\n"
  },
  {
    "path": "detox/local-cli/templates/jest.js",
    "content": "const firstTestContent = require('./firstTestContent');\n\nconst runnerConfig = `\\\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n  rootDir: '..',\n  testMatch: ['<rootDir>/e2e/**/*.test.js'],\n  testTimeout: 120000,\n  maxWorkers: 1,\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  reporters: ['detox/runners/jest/reporter'],\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  verbose: true,\n};\n`;\n\nexports.starter = firstTestContent;\nexports.runnerConfig = runnerConfig;\n"
  },
  {
    "path": "detox/local-cli/test.js",
    "content": "const detox = require('../internals');\n\nconst TestRunnerCommand = require('./testCommand/TestRunnerCommand');\nconst patchJestUtil = require('./utils/patchJestUtil');\n\nmodule.exports.command = 'test';\nmodule.exports.desc = 'Run your test suites with the test runner specified in the project\\'s Detox config';\nmodule.exports.builder = require('./testCommand/builder');\nmodule.exports.middlewares = require('./testCommand/middlewares').default;\n\nmodule.exports.handler = async function test({ detoxArgs, runnerArgs }) {\n  try {\n    const opts = {\n      argv: detoxArgs,\n      testRunnerArgv: runnerArgs,\n      workerId: null,\n    };\n\n    const config = await detox.resolveConfig(opts);\n    if (!config.cli.inspectBrk) {\n      await detox.init(opts);\n    }\n\n    if (config.cli.repl) {\n      patchJestUtil();\n    }\n\n    const runnerCommand = new TestRunnerCommand({\n      config,\n      env: process.env,\n    });\n\n    await runnerCommand.execute();\n  } finally {\n    await detox.cleanup();\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/test.test.js",
    "content": "// @ts-nocheck\nif (process.platform === 'win32') {\n  jest.retryTimes(1); // TODO [2024-12-01]: investigate why it gets stuck for the 1st time on Windows\n}\n\njest.mock('../src/logger/DetoxLogger');\njest.mock('./utils/jestInternals');\njest.mock('./utils/interruptListeners');\njest.mock('./utils/patchJestUtil');\n\nconst cp = require('child_process');\nconst cpSpawn = cp.spawn;\nconst os = require('os');\nconst util = require('util');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst { buildMockCommand, callCli } = require('../__tests__/helpers');\n\nconst { DEVICE_LAUNCH_ARGS_DEPRECATION } = require('./testCommand/warnings');\n\nconst sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n\ndescribe('CLI', () => {\n  let _env;\n  let logger;\n  let _temporaryFiles;\n  let detoxConfig;\n  let detoxConfigPath;\n  let jestInternals;\n\n  let mockExecutable;\n\n  afterEach(() => {\n    cp.spawn = cpSpawn;\n  });\n\n  beforeEach(() => {\n    _env = process.env;\n    _temporaryFiles = [];\n\n    process.env = { ..._env };\n\n    mockExecutable = buildMockCommand();\n    _temporaryFiles.push(mockExecutable.options.stdout);\n\n    detoxConfig = {\n      testRunner: {\n        args: {\n          $0: mockExecutable.cmd,\n          config: 'e2e/config.json'\n        },\n        forwardEnv: true,\n      },\n      configurations: {\n        single: {\n          device: {\n            type: 'ios.simulator',\n            device: 'iPhone X'\n          },\n          apps: [],\n        },\n      },\n    };\n\n    const realJestInternals = jest.requireActual('./utils/jestInternals');\n    jestInternals = require('./utils/jestInternals');\n    Object.assign(jestInternals, realJestInternals);\n    jestInternals.readJestConfig = jest.fn(async (argv) => {\n      const runnerConfigTemplate = _.omit(\n        JSON.parse(require('./templates/jest').runnerConfig),\n        ['reporters', 'testEnvironment']\n      );\n\n      return realJestInternals.readJestConfig({\n        ...argv,\n        config: tempfile('.json', JSON.stringify(runnerConfigTemplate)),\n      });\n    });\n\n    logger = () => require('../src/logger/DetoxLogger').instances[0];\n  });\n\n  afterEach(async () => {\n    process.env = _env;\n\n    await Promise.all(_temporaryFiles.map(name => fs.remove(name)));\n  });\n\n  describe('by default', () => {\n    test('by default, should attempt to load config from package.json or .detoxrc', async () => {\n      const expectedError = /^Cannot run Detox without a configuration/;\n      await expect(callCli('./test', 'test')).rejects.toThrow(expectedError);\n    });\n  });\n\n  describe.each([\n    ['iOS', 'ios.simulator'],\n    ['Android', 'android.emulator'],\n  ])('given no extra args (%s)', (_platform, deviceType) => {\n    beforeEach(async () => {\n      singleConfig().device.type = deviceType;\n    });\n\n    describe('when testRunner.forwardEnv is true', () => {\n      beforeEach(async () => {\n        singleConfig().testRunner = { forwardEnv: true };\n        await run();\n      });\n\n      test('should produce a default command', () => {\n        expect(cliCall().argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n      });\n\n      test('should override environment variables', () => {\n        expect(cliCall().env).toEqual({\n          DETOX_CONFIG_PATH: expect.any(String),\n          DETOX_CONFIG_SNAPSHOT_PATH: expect.any(String)\n        });\n      });\n\n      test('should hint essential environment variables', () => {\n        expect(cliCall().fullCommand).toMatch(/\\bDETOX_CONFIG_PATH=.*\\bexecutable\\b/);\n      });\n    });\n\n    describe('when testRunner.forwardEnv is false', () => {\n      beforeEach(async () => {\n        singleConfig().testRunner = { forwardEnv: false };\n        await run();\n      });\n\n      test('should produce a default command', () => {\n        expect(cliCall().argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n      });\n\n      test('should not override environment variables', () => {\n        expect(cliCall().env).toEqual({\n          DETOX_CONFIG_SNAPSHOT_PATH: expect.any(String)\n        });\n      });\n\n      test('should not hint essential environment variables', () => {\n        expect(cliCall().fullCommand).not.toMatch(/\\bDETOX_CONFIG_PATH=.*\\bexecutable\\b/);\n      });\n    });\n  });\n\n  describe('detached runner', () => {\n    beforeEach(() => {\n      detoxConfig.testRunner.detached = true;\n    });\n\n    test('should be able to run as you would normally expect', async () => {\n      await run();\n      expect(_.last(cliCall().argv)).toEqual('e2e/config.json');\n    });\n\n    test('should intercept SIGINT and SIGTERM', async () => {\n      const { subscribe, unsubscribe } = jest.requireMock('./utils/interruptListeners');\n      const simulateSIGINT = () => subscribe.mock.calls[0][0]();\n\n      mockExitCode(1);\n      mockLongRun(2000);\n\n      await Promise.all([\n        run('--retries 2').catch(_.noop),\n        sleep(1000).then(() => {\n          simulateSIGINT();\n          simulateSIGINT();\n          expect(unsubscribe).not.toHaveBeenCalled();\n        }),\n      ]);\n\n      expect(unsubscribe).toHaveBeenCalled();\n      expect(cliCall(0)).not.toBe(null);\n      expect(cliCall(1)).toBe(null);\n    });\n  });\n\n  test('should use testRunner.args._ as default specs', async () => {\n    detoxConfig.testRunner.args._ = ['e2e/sanity'];\n    await run();\n    expect(_.last(cliCall().argv)).toEqual('e2e/sanity');\n  });\n\n  test.each([['--config']])('%s <path> should point to the specified Jest config', async (__runnerConfig) => {\n    await run(__runnerConfig, 'e2e/custom.config.js');\n    expect(cliCall().argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/custom.config.js']);\n  });\n\n  test.each([['-l'], ['--loglevel']])('%s <value> should be passed as environment variable', async (__loglevel) => {\n    await run(__loglevel, 'trace');\n    expect(cliCall().env).toHaveProperty('DETOX_LOGLEVEL');\n    expect(cliCall().fullCommand).toMatch(/ DETOX_LOGLEVEL=\"trace\" /);\n  });\n\n  test('should run the start commands before the tests', async () => {\n    const startCmd = buildMockCommand({ ...mockExecutable.options });\n    singleConfig().apps.push({\n      name: 'app1',\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --app=1`,\n    }, {\n      name: 'app2',\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --app=2`,\n    });\n\n    await run();\n\n    expect([\n      cliCall(0).argv[1],\n      cliCall(1).argv[1],\n    ].sort()).toEqual(['--app=1', '--app=2']);\n    expect(cliCall(2).argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n  });\n\n  test('should kill the start command after the tests', async () => {\n    const startCmd = buildMockCommand({ ...mockExecutable.options, sleep: 10000 });\n    singleConfig().apps.push({\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --some-start=command`,\n    });\n\n    await run();\n    expect(cliCall(0).argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n    expect(cliCall(1)).toBe(null); // because the start command had been killed earlier than wrote the call details (10000ms)\n  }, 2000);\n\n  test('should not run tests if the start command fails', async () => {\n    const startCmd = buildMockCommand({ ...mockExecutable.options, exitCode: 1 });\n    singleConfig().apps.push({\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --some-start=command`,\n    });\n\n    await expect(run).rejects.toThrow(/Command exited with code 1:.*--some-start=command/);\n    expect(cliCall(0).argv[1]).toBe('--some-start=command');\n    expect(cliCall(1)).toBe(null);\n  });\n\n  test('--start=force should run tests even though the start command fails', async () => {\n    const startCmd = buildMockCommand({ ...mockExecutable.options, exitCode: 1 });\n    singleConfig().apps.push({\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --some-start=command`,\n    });\n\n    await run('--start=force');\n    expect(cliCall(0).argv[1]).toBe('--some-start=command');\n    expect(cliCall(1).argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n  });\n\n  test.each([\n    ['--no-start'],\n    ['--start=false'],\n  ])('%s should run tests without the start command', async (__start) => {\n    const startCmd = buildMockCommand({ ...mockExecutable.options, exitCode: 1 });\n    singleConfig().apps.push({\n      type: 'ios.app',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      start: `${startCmd.cmd} --some-start=command`,\n    });\n\n    await run(__start);\n    expect(cliCall(0).argv).toEqual([expect.stringContaining('executable'), '--config', 'e2e/config.json']);\n  });\n\n  test.each([['-R'], ['--retries']])('%s <value> should execute successful run once', async (__retries) => {\n    await run(__retries, 1);\n    expect(cliCall(1)).toBe(null);\n  });\n\n  test.each([['-R'], ['--retries']])('%s <value> should execute unsuccessful run N extra times', async (__retries) => {\n    function toTestResult(testFilePath) {\n      return {\n        testFilePath,\n        success: false,\n        isPermanentFailure: false,\n      };\n    }\n\n    const context = require('../internals');\n\n    jest.spyOn(cp, 'spawn')\n      .mockImplementationOnce((...args) => {\n        context.session.testResults = ['e2e/failing1.test.js', 'e2e/failing2.test.js'].map(toTestResult);\n        return cpSpawn(...args);\n      })\n      .mockImplementationOnce((...args) => {\n        context.session.testResults = ['e2e/failing2.test.js'].map(toTestResult);\n        return cpSpawn(...args);\n      })\n      .mockImplementationOnce((...args) => {\n        return cpSpawn(...args);\n      });\n\n    mockExitCode(1);\n\n    await run(__retries, 2).catch(_.noop);\n\n    expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);\n    expect(cliCall(1).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing1.test.js', 'e2e/failing2.test.js']);\n    expect(cliCall(2).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing2.test.js']);\n  });\n\n  describe('when there are permanently failed tests', () => {\n    beforeEach(() => {\n      const context = require('../internals');\n      context.session.testResults = ['e2e/failing1.test.js', 'e2e/failing2.test.js'].map((testFilePath, index) => ({\n        testFilePath,\n        success: false,\n        isPermanentFailure: index > 0,\n      }));\n\n      mockExitCode(1);\n    });\n\n    test.each([['-R'], ['--retries']])('%s <value> should not bail by default', async (__retries) => {\n      await run(__retries, 2).catch(_.noop);\n\n      expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);\n      expect(cliCall(1).env).not.toHaveProperty('DETOX_RERUN_INDEX');\n      expect(cliCall(1).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing1.test.js']);\n      // note that it does not take the permanently failed test\n    });\n\n    test.each([['-R'], ['--retries']])('%s <value> should bail if configured', async (__retries) => {\n      detoxConfig.testRunner.bail = true;\n      await run(__retries, 2).catch(_.noop);\n\n      expect(cliCall(0).env).not.toHaveProperty('DETOX_RERUN_INDEX');\n      expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);\n      expect(cliCall(1)).toBe(null);\n    });\n  });\n\n  test.each([['-R'], ['--retries']])('%s <value> should not restart test runner if there are no failing tests paths', async (__retries) => {\n    mockExitCode(1);\n\n    await run(__retries, 1).catch(_.noop);\n    expect(cliCall(0)).not.toBe(null);\n    expect(cliCall(1)).toBe(null);\n  });\n\n  test.each([['-R'], ['--retries']])('%s <value> should retain -- <...explicitPassthroughArgs>', async (__retries) => {\n    const context = require('../internals');\n    context.session.testResults = [{\n      testFilePath: 'tests/failing.test.js',\n      success: false,\n      isPermanentFailure: false,\n    }];\n\n    mockExitCode(1);\n\n    await run(__retries, 1, 'tests', '--', '--debug').catch(_.noop);\n\n    expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', '--debug', 'tests']);\n    expect(cliCall(1).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', '--debug', 'tests/failing.test.js']);\n  });\n\n  test.each([['-r'], ['--reuse']])('%s <value> should be passed as environment variable', async (__reuse) => {\n    await run(__reuse);\n    expect(cliCall().env).toHaveProperty('DETOX_REUSE');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_REUSE=true /);\n  });\n\n  test.each([['-u'], ['--cleanup']])('%s <value> should be passed as environment variable', async (__cleanup) => {\n    await run(__cleanup);\n    expect(cliCall().env).toHaveProperty('DETOX_CLEANUP');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_CLEANUP=true /);\n  });\n\n  test.each([['-d'], ['--debug-synchronization']])('%s <value> should be passed as environment variable', async (__debug_synchronization) => {\n    await run(__debug_synchronization, 5000);\n    expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEBUG_SYNCHRONIZATION=5000 /);\n  });\n\n  test.each([['-d'], ['--debug-synchronization']])('%s <value> should be passed as 0 when given false', async (__debug_synchronization) => {\n    await run(__debug_synchronization, false);\n    expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEBUG_SYNCHRONIZATION=0 /);\n  });\n\n  test.each([['-d'], ['--debug-synchronization']])('%s <value> should have default value = 3000', async (__debug_synchronization) => {\n    await run(`${__debug_synchronization}`);\n    expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEBUG_SYNCHRONIZATION=3000 /);\n  });\n\n  test.each([['-a'], ['--artifacts-location']])('%s <value> should be passed as environment variable', async (__artifacts_location) => {\n    await run(__artifacts_location, '/tmp');\n    expect(cliCall().env).toHaveProperty('DETOX_ARTIFACTS_LOCATION');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_ARTIFACTS_LOCATION=\"\\/tmp\" /);\n  });\n\n  test('--record-logs <value> should be passed as environment variable', async () => {\n    await run('--record-logs', 'all');\n    expect(cliCall().env).toHaveProperty('DETOX_RECORD_LOGS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_RECORD_LOGS=\"all\" /);\n  });\n\n  test('--take-screenshots <value> should be passed as environment variable', async () => {\n    await run('--take-screenshots', 'failing');\n    expect(cliCall().env).toHaveProperty('DETOX_TAKE_SCREENSHOTS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_TAKE_SCREENSHOTS=\"failing\" /);\n  });\n\n  test('--record-videos <value> should be passed as environment variable', async () => {\n    await run('--record-videos', 'failing');\n    expect(cliCall().env).toHaveProperty('DETOX_RECORD_VIDEOS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_RECORD_VIDEOS=\"failing\" /);\n  });\n\n  test('--record-performance <value> should be passed as environment variable', async () => {\n    await run('--record-performance', 'all');\n    expect(cliCall().env).toHaveProperty('DETOX_RECORD_PERFORMANCE');\n    expect(cliCall().fullCommand).toMatch(/\\DETOX_RECORD_PERFORMANCE=\"all\" /);\n  });\n\n  test('--capture-view-hierarchy <value> should be passed as environment variable', async () => {\n    await run('--capture-view-hierarchy', 'enabled');\n    expect(cliCall().env).toHaveProperty('DETOX_CAPTURE_VIEW_HIERARCHY');\n    expect(cliCall().fullCommand).toMatch(/\\DETOX_CAPTURE_VIEW_HIERARCHY=\"enabled\" /);\n  });\n\n  test('--jest-report-specs, set explicitly, should be passed as an environment variable', async () => {\n    await run('--jest-report-specs');\n    expect(cliCall().env).toHaveProperty('DETOX_REPORT_SPECS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_REPORT_SPECS=true /);\n  });\n\n  test.each([['-H'], ['--headless']])('%s <value> should be passed as environment variable', async (__headless) => {\n    await run(__headless);\n    expect(cliCall().env).toHaveProperty('DETOX_HEADLESS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_HEADLESS=true /);\n  });\n\n  test('--gpu <value> should be passed as environment variable', async () => {\n    await run('--gpu', 'angle_indirect');\n    expect(cliCall().env).toHaveProperty('DETOX_GPU');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_GPU=\"angle_indirect\" /);\n  });\n\n  test.each([['--repl', 'true'], ['--repl']])('%s should be passed as environment variable with \"true\" value', async (...args) => {\n    await run(...args);\n    expect(cliCall().env).toHaveProperty('DETOX_REPL');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_REPL=true /);\n\n    const patchJestUtil = jest.requireMock('./utils/patchJestUtil');\n    expect(patchJestUtil).toHaveBeenCalled();\n  });\n\n  test.each([['--no-repl'], ['--repl', 'false']])('%s should be passed as environment variable with \"false\" value', async (...args) => {\n    await run(...args);\n    expect(cliCall().env).not.toHaveProperty('DETOX_REPL');\n    expect(cliCall().fullCommand).not.toMatch(/\\bDETOX_REPL/);\n  });\n\n  test('--repl auto should be passed as environment variable with \"auto\" value', async () => {\n    await run('--repl', 'auto');\n    expect(cliCall().env).toHaveProperty('DETOX_REPL');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_REPL=\"auto\" /);\n  });\n\n  test('--repl followed by non-boolean argument should be correctly disengaged', async () => {\n    await run('--repl', 'some/test/file.js');\n    expect(cliCall().env).toHaveProperty('DETOX_REPL');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_REPL=true /);\n    expect(cliCall().argv).toContain('some/test/file.js');\n  });\n\n  test('--device-boot-args should be passed as an environment variable (without deprecation warnings)', async () => {\n    await run('--device-boot-args=\"--verbose\"');\n    expect(cliCall().env).toHaveProperty('DETOX_DEVICE_BOOT_ARGS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEVICE_BOOT_ARGS=\"--verbose\" /);\n    expect(logger().warn).not.toHaveBeenCalledWith(DEVICE_LAUNCH_ARGS_DEPRECATION);\n  });\n\n  test('--app-launch-args should be passed as an environment variable', async () => {\n    await run(`--app-launch-args=\"--debug yes\"`);\n    expect(cliCall().env).toHaveProperty('DETOX_APP_LAUNCH_ARGS');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_APP_LAUNCH_ARGS=\"--debug yes\" /);\n  });\n\n  test('--use-custom-logger false should be prevent passing environment variable', async () => {\n    await run(`--use-custom-logger=false`);\n    expect(cliCall().env).toHaveProperty('DETOX_USE_CUSTOM_LOGGER');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_USE_CUSTOM_LOGGER=false /);\n  });\n\n  test('--force-adb-install should be ignored for iOS', async () => {\n    singleConfig().device.type = 'ios.simulator';\n    await run(`--force-adb-install`);\n    expect(cliCall().env).not.toHaveProperty('DETOX_FORCE_ADB_INSTALL');\n    expect(cliCall().fullCommand).not.toMatch(/DETOX_FORCE_ADB_INSTALL/);\n  });\n\n  test('--force-adb-install should be passed as environment variable', async () => {\n    singleConfig().device.type = 'android.emulator';\n    await run(`--force-adb-install`);\n    expect(cliCall().env).toHaveProperty('DETOX_FORCE_ADB_INSTALL');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_FORCE_ADB_INSTALL=true /);\n  });\n\n  test.each([['-n'], ['--device-name']])('%s <value> should be passed as environment variable', async (__device_name) => {\n    await run(__device_name, 'TheDevice');\n    expect(cliCall().env).toHaveProperty('DETOX_DEVICE_NAME');\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEVICE_NAME=\"TheDevice\" /);\n  });\n\n  test('specifying direct test paths instead of default args._', async () => {\n    detoxConfig.testRunner.args._ = ['e2e/'];\n    await run('e2e/01.sanity.test.js', 'e2e/02.sanity.test.js');\n\n    expect(cliCall().argv).not.toContain('e2e');\n    expect(cliCall().argv.slice(-2)).toEqual(['e2e/01.sanity.test.js', 'e2e/02.sanity.test.js']);\n  });\n\n  test.each([\n    ['-d e2eFolder', / e2eFolder$/, /\\bDETOX_DEBUG_SYNCHRONIZATION=3000/],\n    ['--debug-synchronization e2eFolder', / e2eFolder$/, /\\bDETOX_DEBUG_SYNCHRONIZATION=3000/],\n    ['-r e2eFolder', / e2eFolder$/, /\\bDETOX_REUSE=true/],\n    ['--reuse e2eFolder', / e2eFolder$/, /\\bDETOX_REUSE=true/],\n    ['-u e2eFolder', / e2eFolder$/, /\\bDETOX_CLEANUP=true/],\n    ['--cleanup e2eFolder', / e2eFolder$/, /\\bDETOX_CLEANUP=true/],\n    ['--jest-report-specs e2eFolder', / e2eFolder$/, /\\bDETOX_REPORT_SPECS=true/],\n    ['-H e2eFolder', / e2eFolder$/, /\\bDETOX_HEADLESS=true/],\n    ['--headless e2eFolder', / e2eFolder$/, /\\bDETOX_HEADLESS=true/],\n    ['--keepLockFile e2eFolder', / e2eFolder$/, /\\bDETOX_KEEP_LOCKFILE=true/],\n    ['--use-custom-logger e2eFolder', / e2eFolder$/, /\\bDETOX_USE_CUSTOM_LOGGER=true/],\n    ['--force-adb-install e2eFolder', / e2eFolder$/, /\\bDETOX_FORCE_ADB_INSTALL=true/],\n  ])('\"%s\" should be disambigued correctly', async (command, commandMatcher, envMatcher) => {\n    singleConfig().device.type = 'android.emulator';\n    await run(...command.split(' '));\n\n    expect(cliCall().argv.join(' ')).toMatch(commandMatcher);\n    expect(cliCall().fullCommand).toMatch(envMatcher);\n  });\n\n  test('e.g., --debug should be passed through', async () => {\n    await run(`--debug`);\n    expect(cliCall().argv).toContain('--debug');\n  });\n\n  test('e.g., --coverageProvider v8 should be passed through', async () => {\n    await run('--coverageProvider', 'v8');\n    expect(cliCall().argv.slice(-2)).toEqual(['--coverageProvider', 'v8']);\n  });\n\n  test('e.g., --debug e2e/Login.test.js should be split to --debug and e2e/Login.test.js', async () => {\n    await run('--debug', 'e2e/Login.test.js', '--coverageProvider', 'v8');\n\n    expect(cliCall().argv).toEqual([\n      expect.stringMatching(/executable$/),\n      '--config', 'e2e/config.json',\n      '--debug',\n      '--coverageProvider', 'v8',\n      'e2e/Login.test.js'\n    ]);\n  });\n\n  test('should escape whitespaces when forwarding a CLI argument', async () => {\n    await run(`e2e tests/first test.spec.js`);\n    expect(_.last(cliCall().argv)).toEqual(`e2e tests/first test.spec.js`);\n  });\n\n  test(`should be able to use custom test runner commands`, async () => {\n    detoxConfig.testRunner.args.$0 += ' --hello';\n    await run();\n    expect(cliCall().argv).toContain('--hello');\n  });\n\n  test('-- <...explicitPassthroughArgs> should be forwarded to the test runner CLI as-is', async () => {\n    await run('--device-boot-args', 'detoxArgs', 'e2eFolder', '--', 'a', '-a', '--a', '--device-boot-args', 'runnerArgs');\n    expect(cliCall().argv).toEqual([\n      expect.stringMatching(/executable$/),\n      '--config', 'e2e/config.json',\n      'a',\n      '-a',\n      '--a',\n      '--device-boot-args',\n      'runnerArgs',\n      'e2eFolder',\n    ]);\n\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_DEVICE_BOOT_ARGS=\"detoxArgs\" /);\n  });\n\n  test('-- <...explicitPassthroughArgs> should omit double-dash \"--\" only once when forwarding args', async () => {\n    await run('--', '--', '--deepParameter');\n\n    expect(cliCall().argv).toContain('--');\n    expect(cliCall().argv).toContain('--deepParameter');\n  });\n\n  test('--inspect-brk should activate inspectBrk hook', async () => {\n    detoxConfig.testRunner.inspectBrk = (config) => {\n      config.args.customFlag = true;\n      return config;\n    };\n\n    await run('--inspect-brk');\n    expect(cliCall().argv).toContain('--customFlag');\n  });\n\n  test('should append $DETOX_ARGV_OVERRIDE to detox test ... command and print a warning', async () => {\n    process.env.PLATFORM = 'ios';\n    process.env.DETOX_ARGV_OVERRIDE = os.platform() === 'win32'\n      ? '--testNamePattern=\"[%PLATFORM%] tap\" -l trace e2e/sanity/*.test.js'\n      : '--testNamePattern=\"[$PLATFORM] tap\" -l trace e2e/sanity/*.test.js';\n\n    await run();\n\n    expect(cliCall().fullCommand).toMatch(/\\bDETOX_LOGLEVEL=\"trace\" /);\n    expect(cliCall().argv.slice(-3)).toEqual(['--testNamePattern', '[ios] tap', 'e2e/sanity/*.test.js']);\n    expect(logger().warn).toHaveBeenCalledWith(expect.stringContaining('$DETOX_ARGV_OVERRIDE is detected'));\n  });\n\n  test('should append $DETOX_ARGV_OVERRIDE \"--\" part to test runner command', async () => {\n    process.env.PLATFORM = 'ios';\n    process.env.DETOX_ARGV_OVERRIDE = '-- --help';\n\n    await run();\n\n    expect(cliCall().argv.slice(-1)).toEqual(['--help']);\n    expect(logger().warn).toHaveBeenCalledWith(expect.stringContaining('$DETOX_ARGV_OVERRIDE is detected'));\n  });\n\n  test('should remove Jest sharding flags during retries', async () => {\n    mockExitCode(1);\n\n    const context = require('../internals');\n    context.session.testResults = [{\n      testFilePath: 'e2e/failing.test.js',\n      success: false,\n      isPermanentFailure: false,\n    }];\n\n    await run('--retries', 1, '--shard', '1/3').catch(_.noop);\n\n    // First call should include the shard flag\n    expect(cliCall(0).argv).toContain('--shard');\n    expect(cliCall(0).argv).toContain('1/3');\n\n    // Second call (retry) should NOT include the shard flag\n    expect(cliCall(1).argv).not.toContain('--shard');\n    expect(cliCall(1).argv).not.toContain('1/3');\n  });\n\n  // Helpers\n\n  function tempfile(extension, content) {\n    const _tempfile = require('../src/utils/tempfile');\n    const tempFilePath = _tempfile(extension);\n\n    fs.ensureFileSync(tempFilePath);\n    if (content) {\n      fs.writeFileSync(tempFilePath, content);\n    }\n\n    _temporaryFiles.push(tempFilePath);\n    return tempFilePath;\n  }\n\n  async function run(...args) {\n    let contents = `module.exports = ${util.inspect(detoxConfig, { depth: Infinity })};`;\n    if (detoxConfig.testRunner && detoxConfig.testRunner.inspectBrk) {\n      contents = contents.replace(/\\[Function.*\\]/m, detoxConfig.testRunner.inspectBrk.toString());\n    }\n\n    detoxConfigPath = tempfile('.js', contents);\n    const __configPath = Math.random() > 0.5 ? '-C' : '--config-path';\n    await callCli('./test', ['test', __configPath, detoxConfigPath, ...args]);\n  }\n\n  function cliCall(index = 0) {\n    const mockCall = mockExecutable.calls[index];\n    if (!mockCall) {\n      return null;\n    }\n\n    return {\n      ...mockCall,\n      fullCommand: _.chain(logger().log.mock.calls)\n        .filter(([_level, _childMeta, meta]) => meta && meta.env)\n        .get(index)\n        .get(3)\n        .value(),\n    };\n  }\n\n  function singleConfig() {\n    return Object.values(detoxConfig.configurations)[0];\n  }\n\n  function mockExitCode(code) {\n    mockExecutable.options.exitCode = code;\n    detoxConfig.testRunner.args.$0 = mockExecutable.cmd;\n  }\n\n  function mockLongRun(ms) {\n    mockExecutable.options.sleep = ms;\n    detoxConfig.testRunner.args.$0 = mockExecutable.cmd;\n  }\n});\n"
  },
  {
    "path": "detox/local-cli/testCommand/TestRunnerCommand.js",
    "content": "const cp = require('child_process');\n\nconst _ = require('lodash');\nconst parser = require('yargs-parser');\nconst unparse = require('yargs-unparser');\n\nconst detox = require('../../internals');\nconst log = detox.log.child({ cat: ['lifecycle', 'cli'] });\nconst { printEnvironmentVariables, prependNodeModulesBinToPATH } = require('../../src/utils/envUtils');\nconst { toSimplePath } = require('../../src/utils/pathUtils');\nconst { escapeSpaces, useForwardSlashes } = require('../../src/utils/shellUtils');\nconst sleep = require('../../src/utils/sleep');\nconst AppStartCommand = require('../startCommand/AppStartCommand');\nconst { markErrorAsLogged } = require('../utils/cliErrorHandling');\nconst interruptListeners = require('../utils/interruptListeners');\n\nconst TestRunnerError = require('./TestRunnerError');\n\nclass TestRunnerCommand {\n  /*\n    @param {object} opts\n    @param {DetoxInternals.RuntimeConfig} opts.config\n    @param {ProcessEnv} opts.env\n  */\n  constructor(opts) {\n    const cliConfig = opts.config.cli;\n    const deviceConfig = opts.config.device;\n    const runnerConfig = opts.config.testRunner;\n    const commands = opts.config.commands;\n\n    this._argv = runnerConfig.args;\n    this._detached = runnerConfig.detached;\n    this._retries = runnerConfig.retries;\n    this._noRetryArgs = runnerConfig.noRetryArgs;\n    this._envHint = this._buildEnvHint(opts.env);\n    this._startCommands = this._prepareStartCommands(commands, cliConfig);\n    this._envFwd = {};\n    this._terminating = false;\n\n    if (runnerConfig.forwardEnv) {\n      this._envFwd = this._buildEnvOverride(cliConfig, deviceConfig);\n      Object.assign(this._envHint, this._envFwd);\n    }\n\n    if (cliConfig.repl) {\n      this._envFwd.DETOX_REPL = cliConfig.repl;\n      this._envHint.DETOX_REPL = cliConfig.repl;\n    }\n  }\n\n  async execute() {\n    let runsLeft = 1 + this._retries;\n    let launchError = null;\n\n    if (this._startCommands.length > 0) {\n      try {\n        await Promise.race([sleep(1000), ...this._startCommands.map(cmd => cmd.execute())]);\n      } catch (e) {\n        await Promise.allSettled(this._startCommands.map(cmd => cmd.stop()));\n        throw e;\n      }\n    }\n\n    do {\n      try {\n        await this._spawnTestRunner();\n        launchError = null;\n      } catch (e) {\n        launchError = e;\n\n        if (this._terminating) {\n          runsLeft = 0;\n        }\n\n        const failedTestFiles = detox.session.testResults.filter(r => !r.success);\n\n        const { bail } = detox.config.testRunner;\n        if (bail && failedTestFiles.some(r => r.isPermanentFailure)) {\n          runsLeft = 0;\n        }\n\n        const testFilesToRetry = failedTestFiles.filter(r => !r.isPermanentFailure).map(r => r.testFilePath);\n        if (testFilesToRetry.length === 0) {\n          runsLeft = 0;\n        }\n\n        if (--runsLeft > 0) {\n          // @ts-ignore\n          detox.session.testSessionIndex++; // it is always the primary context, so we can update it\n          this._noRetryArgs.forEach(arg => delete this._argv[arg]);\n          this._argv._ = testFilesToRetry.map(useForwardSlashes);\n          this._logRelaunchError(testFilesToRetry);\n        }\n      }\n    } while (launchError && runsLeft > 0);\n\n    await Promise.allSettled(this._startCommands.map(cmd => cmd.stop()));\n\n    if (launchError) {\n      throw launchError;\n    }\n  }\n\n  _buildEnvHint(env) {\n    return _(env)\n      .mapKeys((_value, key) => key.toUpperCase())\n      .pickBy((_value, key) => key.startsWith('DETOX_'))\n      .omit(['DETOX_CONFIG_SNAPSHOT_PATH'])\n      .value();\n  }\n\n  _prepareStartCommands(commands, cliConfig) {\n    if (`${cliConfig.start}` === 'false') {\n      return [];\n    }\n\n    return _.filter(commands, 'start')\n      .map(commands => new AppStartCommand({\n        cmd: commands.start,\n        forceSpawn: cliConfig.start === 'force',\n      }));\n  }\n\n  /**\n   * @param {DetoxInternals.CLIConfig} cliConfig\n   * @param {Detox.DetoxDeviceConfig} deviceConfig\n   */\n  _buildEnvOverride(cliConfig, deviceConfig) {\n    return _.omitBy({\n      DETOX_APP_LAUNCH_ARGS: cliConfig.appLaunchArgs,\n      DETOX_ARTIFACTS_LOCATION: cliConfig.artifactsLocation,\n      DETOX_CAPTURE_VIEW_HIERARCHY: cliConfig.captureViewHierarchy,\n      DETOX_CLEANUP: cliConfig.cleanup,\n      DETOX_CONFIGURATION: cliConfig.configuration,\n      DETOX_CONFIG_PATH: cliConfig.configPath,\n      DETOX_DEBUG_SYNCHRONIZATION: cliConfig.debugSynchronization,\n      DETOX_DEVICE_BOOT_ARGS: cliConfig.deviceBootArgs,\n      DETOX_DEVICE_NAME: cliConfig.deviceName,\n      DETOX_FORCE_ADB_INSTALL: deviceConfig.type.startsWith('android.')\n        ? cliConfig.forceAdbInstall\n        : undefined,\n      DETOX_GPU: cliConfig.gpu,\n      DETOX_HEADLESS: cliConfig.headless,\n      DETOX_KEEP_LOCKFILE: cliConfig.keepLockFile,\n      DETOX_LOGLEVEL: cliConfig.loglevel,\n      DETOX_READ_ONLY_EMU: cliConfig.readonlyEmu,\n      DETOX_RECORD_LOGS: cliConfig.recordLogs,\n      DETOX_RECORD_PERFORMANCE: cliConfig.recordPerformance,\n      DETOX_RECORD_VIDEOS: cliConfig.recordVideos,\n      DETOX_REPORT_SPECS: cliConfig.jestReportSpecs,\n      DETOX_RETRIES: cliConfig.retries,\n      DETOX_REUSE: cliConfig.reuse,\n      DETOX_TAKE_SCREENSHOTS: cliConfig.takeScreenshots,\n      DETOX_USE_CUSTOM_LOGGER: cliConfig.useCustomLogger,\n    }, _.isUndefined);\n  }\n\n  _onTerminate = () => {\n    if (this._terminating) {\n      return;\n    }\n\n    this._terminating = true;\n    return detox.unsafe_conductEarlyTeardown(true);\n  };\n\n  async _spawnTestRunner() {\n    const fullCommand = this._buildSpawnArguments().map(escapeSpaces);\n    const fullCommandWithHint = printEnvironmentVariables(this._envHint) + fullCommand.join(' ');\n\n    log.info.begin({ env: this._envHint }, fullCommandWithHint);\n\n    return new Promise((resolve, reject) => {\n      cp.spawn(fullCommand[0], fullCommand.slice(1), {\n        shell: true,\n        stdio: 'inherit',\n        detached: this._detached,\n        env: _({})\n          .assign(process.env)\n          .assign(this._envFwd)\n          .omitBy(_.isUndefined)\n          .tap(prependNodeModulesBinToPATH)\n          .value()\n      })\n        .on('error', /* istanbul ignore next */ (err) => reject(err))\n        .on('exit', (code, signal) => {\n          interruptListeners.unsubscribe(this._onTerminate);\n\n          if (code === 0) {\n            log.trace.end({ success: true });\n            resolve();\n          } else {\n            const error = new TestRunnerError({\n              command: fullCommandWithHint,\n              code,\n              signal,\n            });\n            log.error.end({ success: false, code, signal }, error.message);\n            reject(markErrorAsLogged(error));\n          }\n        });\n\n      if (this._detached) {\n        interruptListeners.subscribe(this._onTerminate);\n      }\n    });\n  }\n\n  _buildSpawnArguments() {\n    /* istanbul ignore next */\n    const { _: specs = [], '--': passthrough = [], $0, ...argv } = this._argv;\n    const { _: $0_, ...$0argv } = parser($0);\n\n    return [\n      ...$0_,\n      ...unparse($0argv),\n      ...unparse(argv),\n      ...unparse({ _: [...passthrough, ...specs] }),\n    ].map(String);\n  }\n\n  _logRelaunchError(filePaths) {\n    const list = filePaths.map((file, index) => {\n      return `  ${index + 1}. ${toSimplePath(file)}`;\n    }).join('\\n');\n\n    log.error(\n      `There were failing tests in the following files:\\n${list}\\n\\n` +\n      'Detox CLI is going to restart the test runner with those files...\\n'\n    );\n  }\n}\n\nmodule.exports = TestRunnerCommand;\n"
  },
  {
    "path": "detox/local-cli/testCommand/TestRunnerError.js",
    "content": "const { DetoxError } = require('../../src/errors');\n\nclass TestRunnerError extends DetoxError {\n  constructor({ command, code, signal }) {\n    super(`Command failed with exit code = ${code}:\\n${command}`);\n\n    this.code = code;\n    this.signal = signal;\n    this.name = 'TestRunnerError';\n  }\n}\n\nmodule.exports = TestRunnerError;\n"
  },
  {
    "path": "detox/local-cli/testCommand/TestRunnerError.test.js",
    "content": "const TestRunnerError = require('./TestRunnerError');\n\ndescribe('TestRunnerError', () => {\n  let error;\n\n  beforeAll(() => {\n    error = new TestRunnerError({ command: 'foo', code: 1, signal: 'SIGINT' });\n  });\n\n  it('should format an error message', () => {\n    expect(`${error}`).toMatch(/Command failed with exit code = 1:\\nfoo/);\n    expect(`${error.format()}`).toMatch(/Command failed with exit code = 1:\\nfoo/);\n  });\n\n  it('should assign properties (code, signal)', () => {\n    expect(error.code).toBe(1);\n    expect(error.signal).toBe('SIGINT');\n  });\n});\n"
  },
  {
    "path": "detox/local-cli/testCommand/builder.js",
    "content": "module.exports = {\n  C: {\n    alias: 'config-path',\n    group: 'Configuration:',\n    describe: 'Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or \"detox\" section in package.json',\n  },\n  c: {\n    alias: ['configuration'],\n    group: 'Configuration:',\n    describe:\n      'Select a device configuration from your defined configurations, if not supplied, and there\\'s only one configuration, detox will default to it',\n  },\n  l: {\n    alias: 'loglevel',\n    group: 'Debugging:',\n    choices: ['fatal', 'error', 'warn', 'info', 'verbose', 'debug', 'trace'],\n    describe: 'Log level',\n  },\n  R: {\n    alias: 'retries',\n    group: 'Execution:',\n    describe: 'Re-spawn the test runner for individual failing suite files until they pass, or <N> times at least.',\n    number: true,\n  },\n  r: {\n    alias: 'reuse',\n    group: 'Execution:',\n    describe: 'Reuse existing installed app (do not delete + reinstall) for a faster run.',\n    boolean: true,\n  },\n  start: {\n    group: 'Execution:',\n    describe: 'Run app \"start\" scripts before running the tests. Use --no-start to disable that, and --start=force to ignore errors.',\n    default: true,\n  },\n  u: {\n    alias: 'cleanup',\n    group: 'Execution:',\n    describe: 'Shutdown simulator when test is over, useful for CI scripts, to make sure detox exits cleanly with no residue',\n    boolean: true,\n  },\n  d: {\n    alias: 'debug-synchronization',\n    group: 'Debugging:',\n    coerce(value) {\n      if (value === false || value === 'false') {\n        return 0;\n      }\n\n      if (value === true || value === 'true') {\n        return 3000;\n      }\n\n      return Number.isNaN(+value) ? value : +value;\n    },\n    describe:\n      'Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. ' +\n      'By default, the app status will be printed if the action takes more than 10s to complete.'\n  },\n  a: {\n    alias: 'artifacts-location',\n    group: 'Debugging:',\n    describe: 'Artifacts (logs, screenshots, etc) root directory.',\n  },\n  'record-logs': {\n    group: 'Debugging:',\n    choices: ['failing', 'all', 'none'],\n    describe: 'Save logs during each test to artifacts directory. Pass \"failing\" to save logs of failing tests only.',\n  },\n  'take-screenshots': {\n    group: 'Debugging:',\n    choices: ['manual', 'failing', 'all', 'none'],\n    describe: 'Save screenshots before and after each test to artifacts directory. Pass \"failing\" to save screenshots of failing tests only.',\n  },\n  'record-videos': {\n    group: 'Debugging:',\n    choices: ['failing', 'all', 'none'],\n    describe: 'Save screen recordings of each test to artifacts directory. Pass \"failing\" to save recordings of failing tests only.',\n  },\n  'record-performance': {\n    group: 'Debugging:',\n    choices: ['all', 'none'],\n    describe: '[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory.',\n  },\n  'capture-view-hierarchy': {\n    group: 'Debugging:',\n    choices: ['enabled', 'disabled'],\n    describe: '[iOS Only] Capture *.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls.',\n  },\n  'jest-report-specs': {\n    group: 'Execution:',\n    describe: 'Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.',\n    boolean: true,\n  },\n  H: {\n    alias: 'headless',\n    group: 'Execution:',\n    describe: 'Launch device in headless mode. Useful when running on CI.',\n    boolean: true,\n  },\n  gpu: {\n    group: 'Execution:',\n    choices: ['auto', 'host', 'swiftshader_indirect', 'angle_indirect', 'guest', 'off'],\n    describe: '[Android Only] Launch emulator with the specific -gpu [gpu mode] parameter.',\n  },\n  keepLockFile: {\n    group: 'Configuration:',\n    describe:'Keep the device lock file when running Detox tests',\n    boolean: true,\n  },\n  n: {\n    alias: 'device-name',\n    group: 'Configuration:',\n    describe: 'Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.',\n  },\n  'device-boot-args': {\n    group: 'Execution:',\n    describe: 'Custom arguments to pass (through) onto the device (emulator/simulator) binary when booted.',\n  },\n  'app-launch-args': {\n    group: 'Execution:',\n    describe: 'Custom arguments to pass (through) onto the app every time it is launched.',\n  },\n  'use-custom-logger': {\n    boolean: true,\n    group: 'Execution:',\n    describe: `Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test runner's implementation (e.g. Jest).`,\n  },\n  'force-adb-install': {\n    boolean: true,\n    group: 'Execution:',\n    describe: `[Android Only] Due to problems with the \"adb install\" command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of \"adb install\", instead.`,\n  },\n  'inspect-brk': {\n    group: 'Debugging:',\n    describe: '[Jest Only] Allows debugging of the underlying test runner',\n    boolean: true,\n  },\n  'repl': {\n    group: 'Debugging:',\n    describe: 'Launch REPL mode. Use --repl=auto to enter REPL on test failures.',\n    coerce(value) {\n      if (value === false || value === 'false') return false;\n      if (value === true || value === 'true') return true;\n      return value;\n    },\n  }\n};\n"
  },
  {
    "path": "detox/local-cli/testCommand/middlewares.js",
    "content": "const _ = require('lodash');\n\nconst { log } = require('../../internals');\nconst { getJestBooleanArgs } = require('../utils/jestInternals');\nconst { simpleUnquote, extractKnownKeys, disengageBooleanArgs } = require('../utils/yargsUtils');\n\nconst testCommandArgs = require('./builder');\nconst { DETOX_ARGV_OVERRIDE_NOTICE } = require('./warnings');\n\nfunction applyEnvironmentVariableAddendum(argv, yargs) {\n  if (process.env.DETOX_ARGV_OVERRIDE) {\n    log.warn(DETOX_ARGV_OVERRIDE_NOTICE);\n\n    const { _: positional, '--': passthrough, ...named } = yargs.parse(process.env.DETOX_ARGV_OVERRIDE);\n\n    if (!_.isEmpty(positional)) {\n      /* istanbul ignore next */\n      argv._ = argv._ || [];\n      argv._.push(...positional.map(simpleUnquote));\n    }\n\n    if (!_.isEmpty(passthrough)) {\n      argv['--'] = argv['--'] || [];\n      argv['--'].push(...passthrough.map(simpleUnquote));\n    }\n\n    Object.assign(argv, named);\n  }\n\n  return argv;\n}\n\n/**\n * @param {Record<string, *>} argv\n * @returns {{\n *   detoxArgs: Record<string, *>,\n *   runnerArgs: Record<string, *>\n * }}\n */\nfunction splitArgv(argv) {\n  const aliases = extractKnownKeys(testCommandArgs);\n  const isDetoxArg = (_value, key) => key === '$0' || aliases.has(key);\n\n  const detoxArgs = _.pickBy(argv, isDetoxArg);\n  const runnerArgv = _.omitBy(argv, isDetoxArg);\n  runnerArgv._ = runnerArgv._.slice(1); // omit 'test' string, as in 'detox test'\n  if (typeof detoxArgs['debug-synchronization'] === 'string') {\n    const erroneousPassthrough = detoxArgs['debug-synchronization'];\n    detoxArgs['debug-synchronization'] = 3000;\n    runnerArgv._.unshift(erroneousPassthrough);\n  }\n  if (typeof detoxArgs.repl === 'string' && detoxArgs.repl !== 'auto') {\n    runnerArgv._.unshift(detoxArgs.repl);\n    detoxArgs.repl = true;\n  }\n\n  const runnerArgs = disengageBooleanArgs(runnerArgv, getJestBooleanArgs());\n  return { detoxArgs, runnerArgs };\n}\n\n// noinspection JSUnusedGlobalSymbols\nmodule.exports = {\n  applyEnvironmentVariableAddendum,\n  splitArgv,\n};\n\nmodule.exports.default = [\n  applyEnvironmentVariableAddendum,\n  splitArgv,\n];\n"
  },
  {
    "path": "detox/local-cli/testCommand/warnings.js",
    "content": "const DETOX_ARGV_OVERRIDE_NOTICE = `\n   _____ _____ ___________\n  /  ___|_   _|  _  | ___ \\\\  $DETOX_ARGV_OVERRIDE is detected\n  \\\\ '--.  | | | | | | |_/ /\n   '--. \\\\ | | | | | |  __/   This feature is designed solely\n  /\\\\__/ / | | \\\\ \\\\_/ / |      for ad-hoc troubleshooting of\n  \\\\____/  \\\\_/  \\\\___/\\\\_|      failing builds.\n\n  Do not use this feature in scripts and do not rely on it\n  for anything that is not a quick-and-dirty rerun of your\n  failing E2E script.\n\n  Use it sparingly for emergency Detox launches with extra\n  debugging flags and features, to speed up your investigation\n  and collect additional test artifacts. For more details, see:\n\n  https://wix.github.io/Detox/docs/api/matchers/detox-cli#detox_argv_override\n\n`;\n\nmodule.exports = {\n  DETOX_ARGV_OVERRIDE_NOTICE,\n};\n"
  },
  {
    "path": "detox/local-cli/utils/cliErrorHandling.js",
    "content": "const loggedErrors = new WeakSet();\n\nfunction markErrorAsLogged(error) {\n  loggedErrors.add(error);\n  return error;\n}\n\nfunction isErrorAlreadyLogged(error) {\n  return loggedErrors.has(error);\n}\n\nmodule.exports = {\n  markErrorAsLogged,\n  isErrorAlreadyLogged,\n};\n"
  },
  {
    "path": "detox/local-cli/utils/frameworkUtils.js",
    "content": "const os = require('os');\nconst path = require('path');\n\nconst fs = require('fs-extra');\n\nconst detox = require('../../internals');\nconst { spawnAndLog } = require('../../src/utils/childProcess');\nconst { getFrameworkDirPath, getXCUITestRunnerDirPath } = require('../../src/utils/environment');\n\nconst frameworkBuildScript = '../../scripts/build_local_framework.ios.sh';\nconst xcuitestBuildScript = '../../scripts/build_local_xcuitest.ios.sh';\n\nfunction shouldSkipExecution() {\n  if (os.platform() !== 'darwin') {\n    detox.log.info('The command is supported only on macOS, skipping the execution.');\n    return true;\n  }\n\n  return false;\n}\n\nasync function execBuildScript(targetPath, scriptPath, descriptor) {\n  detox.log.info(`Building ${descriptor} cache at ${targetPath}..`);\n\n  const scriptFullPath = path.join(__dirname, scriptPath);\n\n  try {\n    await spawnAndLog(scriptFullPath, [], { stdio: 'inherit' });\n  } catch (error) {\n    detox.log.error(`Error while building ${descriptor}:\\n${error}`);\n    throw error;\n  }\n}\n\nasync function removeTarget(targetPath, descriptor) {\n  detox.log.info(`Cleaning ${descriptor} cache at ${targetPath}..`);\n  await fs.remove(targetPath);\n  detox.log.info(`Done\\n`);\n}\n\nasync function build(framework, xcuitest) {\n  if (shouldSkipExecution()) {\n    return;\n  }\n\n  const shouldBuildBoth = !framework && !xcuitest;\n\n  if (framework || shouldBuildBoth) {\n    await execBuildScript(getFrameworkDirPath, frameworkBuildScript, 'Detox framework');\n  }\n\n  if (xcuitest || shouldBuildBoth) {\n    await execBuildScript(getXCUITestRunnerDirPath, xcuitestBuildScript, 'XCUITest runner');\n  }\n}\n\nasync function clean(framework, xcuitest) {\n  if (shouldSkipExecution()) {\n    return;\n  }\n\n  const shouldCleanBoth = !framework && !xcuitest;\n\n  if (framework || shouldCleanBoth) {\n    await removeTarget(getFrameworkDirPath, 'Detox framework');\n  }\n\n  if (xcuitest || shouldCleanBoth) {\n    await removeTarget(getXCUITestRunnerDirPath, 'XCUITest runner');\n  }\n}\n\nmodule.exports = {\n  build,\n  clean\n};\n"
  },
  {
    "path": "detox/local-cli/utils/interruptListeners.js",
    "content": "function subscribe(listener) {\n  process.on('SIGINT', listener);\n  process.on('SIGTERM', listener);\n}\n\nfunction unsubscribe(listener) {\n  process.removeListener('SIGINT', listener);\n  process.removeListener('SIGTERM', listener);\n}\n\nmodule.exports = {\n  subscribe,\n  unsubscribe,\n};\n\n"
  },
  {
    "path": "detox/local-cli/utils/jestInternals.js",
    "content": "// @ts-nocheck\nconst Module = require('module');\nconst path = require('path');\n\nconst _ = require('lodash');\nconst resolveFrom = require('resolve-from');\nconst semver = require('semver');\n\nconst { DetoxRuntimeError } = require('../../src/errors');\n\nconst { extractKnownKeys } = require('./yargsUtils');\n\nconst getNodeModulePaths = (dir) => Module._nodeModulePaths(dir);\n\nfunction getJestLocation() {\n  const cwd = process.cwd();\n\n  if (!resolveFrom.silent(cwd, 'jest')) {\n    throw new DetoxRuntimeError({\n      message: 'Could not resolve \"jest\" package from the current working directory.\\n\\n' +\n        'This means that Detox could not find it in any of the following locations:\\n' +\n        getNodeModulePaths(cwd).map(p => `* ${p}`).join('\\n'),\n      hint: `Try installing \"jest\": npm install jest --save-dev`,\n    });\n  }\n\n  return path.dirname(resolveFrom(cwd, 'jest/package.json'));\n}\n\nfunction getJestCliArgsJsFilePath(jestCliVersion) {\n  if (semver.gte(jestCliVersion, '30.0.0')) {\n    return 'build/index.js';\n  }\n\n  return semver.gt(jestCliVersion, '29.1.2') ? 'build/args.js' : 'build/cli/args.js';\n}\n\nfunction resolveJestDependency(jestLocation, dependencyName) {\n  const result = resolveFrom.silent(jestLocation, dependencyName);\n  if (!result) {\n    throw new DetoxRuntimeError({\n      message: `Could not resolve \"${dependencyName}\" package from the \"jest\" npm package directory.\\n\\n` +\n        'This means that Detox could not find it in any of the following locations:\\n' +\n        getNodeModulePaths(jestLocation).map(p => `* ${p}`).join('\\n'),\n      hint: 'Consider reporting this as an issue at: https://github.com/wix/Detox/issues'\n    });\n  }\n\n  return result;\n}\n\nfunction requireJestDependency(jestLocation, dependencyName) {\n  return require(resolveJestDependency(jestLocation, dependencyName));\n}\n\nfunction resolveJestCliArgs() {\n  const jestLocation = getJestLocation();\n  resolveJestDependency(jestLocation, 'jest-cli');\n\n  try {\n    const jestCliManifest = resolveJestDependency(jestLocation, 'jest-cli/package.json');\n    const jestCliVersion = require(jestCliManifest).version;\n    const argsJsFilePath = getJestCliArgsJsFilePath(jestCliVersion);\n    const argsJsFile = path.join(path.dirname(jestCliManifest), argsJsFilePath);\n\n    return require(argsJsFile);\n  } catch (e) {\n    throw new DetoxRuntimeError({\n      message: 'Could not parse CLI arguments supported by \"jest-cli\" package, see the error below.',\n      hint: 'Consider reporting this as an issue at: https://github.com/wix/Detox/issues',\n      debugInfo: e,\n    });\n  }\n}\n\nasync function readJestConfig(argv) {\n  const jestLocation = getJestLocation();\n  const { readConfig } = requireJestDependency(jestLocation, 'jest-config');\n  return readConfig(argv, process.cwd(), false);\n}\n\nfunction getJestBooleanArgs() {\n  return _(resolveJestCliArgs())\n    .thru(args => args.yargsOptions || args.options)\n    .pickBy(({ type }) => type === 'boolean')\n    .thru(extractKnownKeys)\n    .value();\n}\n\nmodule.exports = {\n  getJestBooleanArgs,\n  readJestConfig,\n};\n"
  },
  {
    "path": "detox/local-cli/utils/patchJestUtil.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst resolveFrom = require('resolve-from');\n\nconst log = require('../../src/utils/logger').child({ cat: 'jest-patch' });\n\nfunction patchJestUtil() {\n  try {\n    const jestUtilPath = resolveFrom(process.cwd(), 'jest-util/package.json');\n    const isInteractivePath = path.join(path.dirname(jestUtilPath), 'build/isInteractive.js');\n\n    if (!fs.existsSync(isInteractivePath)) {\n      log.warn('Could not find node_modules/jest-util/build/isInteractive.js to patch!');\n      return;\n    }\n\n    const content = fs.readFileSync(isInteractivePath, 'utf8');\n    if (!content.includes('DETOX_REPL')) {\n      const patchedContent = content.replace(\n        \"process.env.TERM !== 'dumb'\",\n        \"process.env.TERM !== 'dumb' && /* patched by Detox */ !process.env.DETOX_REPL\"\n      );\n      fs.writeFileSync(`${isInteractivePath}.bak`, content);\n      fs.writeFileSync(isInteractivePath, patchedContent);\n      log.info('Successfully patched jest-util for REPL support');\n    }\n  } catch (error) {\n    log.warn({ err: error }, 'Failed to patch jest-util for REPL support');\n  }\n}\n\nmodule.exports = patchJestUtil;\n"
  },
  {
    "path": "detox/local-cli/utils/yargsUtils.js",
    "content": "/**\n * @param {Record<string, Record<string, *>>} yargsBuilder\n * @returns {Set<string>}\n */\nfunction extractKnownKeys(yargsBuilder) {\n  return Object.entries(yargsBuilder).reduce(\n    (set, [key, option]) => {\n      if (option.alias) {\n        if (Array.isArray(option.alias)) {\n          for (const value of option.alias) {\n            set.add(value);\n          }\n        } else {\n          set.add(option.alias);\n        }\n      }\n\n      return set.add(key);\n    },\n    new Set()\n  );\n}\n\n/**\n * @param {Record<string, *>} argv\n * @param {Set<string>} booleanKeys\n * @returns {Record<string, *>}\n */\nfunction disengageBooleanArgs(argv, booleanKeys) {\n  const result = {};\n  const passthrough = [];\n\n  for (const entry of Object.entries(argv)) {\n    const [key, value] = entry;\n    if (key === '_' || key === '--') {\n      continue;\n    }\n\n    const positiveKey = key.startsWith('no-') ? key.slice(3) : key;\n    if (booleanKeys.has(positiveKey) && typeof value !== 'boolean') {\n      result[positiveKey] = key === positiveKey;\n      passthrough.push(value);\n    } else {\n      result[key] = value;\n    }\n  }\n\n  return {\n    ...result,\n    '_': passthrough.concat(argv._),\n    '--': argv['--'] || [],\n  };\n}\n\nfunction simpleUnquote(arg) {\n  if ((arg[0] === '\"' || arg[0] === \"'\") && arg[0] === arg[arg.length - 1]) {\n    return arg.slice(1, -1);\n  }\n\n  return arg;\n}\n\nmodule.exports = {\n  disengageBooleanArgs,\n  extractKnownKeys,\n  simpleUnquote,\n};\n"
  },
  {
    "path": "detox/package.json",
    "content": "{\n  \"name\": \"detox\",\n  \"description\": \"E2E tests and automation for mobile\",\n  \"version\": \"20.47.0\",\n  \"bin\": \"local-cli/cli.js\",\n  \"files\": [\n    \"android\",\n    \"detox-native\",\n    \"Detox-android\",\n    \"Detox-ios-*.tbz\",\n    \"local-cli\",\n    \"runners\",\n    \"scripts\",\n    \"src\",\n    \"*.js\",\n    \"*.json\",\n    \"*.d.ts\",\n    \"!**/__*__/**\",\n    \"!**/*.mock.json\",\n    \"!**/*.test.js\",\n    \"!**/*.snap\",\n    \"!jest.config.js\",\n    \"!wallaby.js\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/wix/Detox.git\"\n  },\n  \"nativePackage\": true,\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/wix/Detox/issues\"\n  },\n  \"homepage\": \"https://github.com/wix/Detox#readme\",\n  \"main\": \"./index.js\",\n  \"types\": \"./index.d.ts\",\n  \"author\": \"Tal Kol <talkol@gmail.com>\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"build\": \":\",\n    \"build:android\": \"cd android && ./gradlew publish -Dversion=999.999.999 && cd ..\",\n    \"build:android-native\": \"cd android && ./gradlew publish -Dversion=999.999.999 -DbuildFlavour=coreNative -DforceLocal=true && cd ..\",\n    \"lint\": \"eslint .\",\n    \"unit\": \"jest --coverage --verbose\",\n    \"unit:android-debug\": \"cd android && ./gradlew testFullDebug\",\n    \"unit:android-release\": \"cd android && ./gradlew testFullRelease\",\n    \"pretest\": \"npm run lint\",\n    \"test\": \"npm run unit\",\n    \"posttest\": \"cp coverage/lcov.info coverage/unit.lcov\",\n    \"unit:watch\": \"jest --watch\",\n    \"prepublish\": \"npm run build\",\n    \"postinstall\": \"node scripts/postinstall.js\"\n  },\n  \"devDependencies\": {\n    \"@react-native-community/cli\": \"20.0.2\",\n    \"@react-native-community/cli-platform-android\": \"20.0.2\",\n    \"@react-native-community/cli-platform-ios\": \"20.0.2\",\n    \"@react-native/babel-preset\": \"0.83.0\",\n    \"@react-native/eslint-config\": \"0.83.0\",\n    \"@react-native/metro-config\": \"0.83.0\",\n    \"@react-native/typescript-config\": \"0.83.0\",\n    \"@tsconfig/react-native\": \"^3.0.0\",\n    \"@types/bunyan\": \"^1.8.8\",\n    \"@types/child-process-promise\": \"^2.2.1\",\n    \"@types/fs-extra\": \"^11.0.4\",\n    \"@types/jest\": \"^29.5.13\",\n    \"@types/node\": \"^14.18.33\",\n    \"@types/node-ipc\": \"^9.2.0\",\n    \"@types/ws\": \"^7.4.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^6.16.0\",\n    \"@typescript-eslint/parser\": \"^6.16.0\",\n    \"cross-env\": \"^7.0.3\",\n    \"eslint\": \"^8.56.0\",\n    \"eslint-plugin-ecmascript-compat\": \"^3.1.0\",\n    \"eslint-plugin-import\": \"^2.29.1\",\n    \"eslint-plugin-no-only-tests\": \"^3.1.0\",\n    \"eslint-plugin-node\": \"^11.1.0\",\n    \"eslint-plugin-unicorn\": \"^50.0.1\",\n    \"jest\": \"^30.0.3\",\n    \"jest-allure2-reporter\": \"^2.2.6\",\n    \"metro-react-native-babel-preset\": \"0.76.8\",\n    \"prettier\": \"^3.1.1\",\n    \"react-native\": \"0.83.0\",\n    \"react-native-codegen\": \"^0.0.8\",\n    \"typescript\": \"^5.8.3\",\n    \"wtfnode\": \"^0.9.1\"\n  },\n  \"dependencies\": {\n    \"@wix-pilot/core\": \"^3.4.2\",\n    \"@wix-pilot/detox\": \"^1.0.13\",\n    \"ajv\": \"^8.6.3\",\n    \"bunyan\": \"^1.8.12\",\n    \"bunyan-debug-stream\": \"^3.1.0\",\n    \"caf\": \"^15.0.1\",\n    \"chalk\": \"^4.0.0\",\n    \"execa\": \"^5.1.1\",\n    \"find-up\": \"^5.0.0\",\n    \"fs-extra\": \"^11.0.0\",\n    \"funpermaproxy\": \"^1.1.0\",\n    \"glob\": \"^8.0.3\",\n    \"ini\": \"^1.3.4\",\n    \"jest-environment-emit\": \"^1.2.0\",\n    \"json-cycle\": \"^1.3.0\",\n    \"lodash\": \"^4.17.11\",\n    \"multi-sort-stream\": \"^1.0.3\",\n    \"multipipe\": \"^4.0.0\",\n    \"node-ipc\": \"9.2.1\",\n    \"promisify-child-process\": \"^4.1.2\",\n    \"proper-lockfile\": \"^3.0.2\",\n    \"resolve-from\": \"^5.0.0\",\n    \"sanitize-filename\": \"^1.6.1\",\n    \"semver\": \"^7.0.0\",\n    \"serialize-error\": \"^8.0.1\",\n    \"shell-quote\": \"^1.7.2\",\n    \"signal-exit\": \"^3.0.3\",\n    \"stream-json\": \"^1.7.4\",\n    \"strip-ansi\": \"^6.0.1\",\n    \"telnet-client\": \"1.2.8\",\n    \"tmp\": \"^0.2.1\",\n    \"trace-event-lib\": \"^1.3.1\",\n    \"which\": \"^1.3.1\",\n    \"ws\": \"^7.0.0\",\n    \"yargs\": \"^17.0.0\",\n    \"yargs-parser\": \"^21.0.0\",\n    \"yargs-unparser\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"jest\": \"30.x.x || 29.x.x || 28.x.x || ^27.2.5\"\n  },\n  \"peerDependenciesMeta\": {\n    \"jest\": {\n      \"optional\": true\n    }\n  },\n  \"engines\": {\n    \"node\": \">=14\"\n  },\n  \"browserslist\": [\n    \"node 14\"\n  ]\n}\n"
  },
  {
    "path": "detox/runners/__tests__/__snapshots__/migration.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`file migration should work for: jest-circus/environment 1`] = `\n\"[DEPRECATION] Detox detected an attempt to require a module from an outdated location, please change in your project:\n- detox/runners/jest-circus/environment\n+ detox/runners/jest/testEnvironment\n\"\n`;\n\nexports[`file migration should work for: jest-circus/index 1`] = `\n\"[DEPRECATION] Detox detected an attempt to require a module from an outdated location, please change in your project:\n- detox/runners/jest-circus\n+ detox/runners/jest\n\"\n`;\n\nexports[`file migration should work for: jest-circus/reporter 1`] = `\n\"[DEPRECATION] Detox detected an attempt to require a module from an outdated location, please change in your project:\n- detox/runners/jest-circus/reporter\n+ detox/runners/jest/reporter\n\"\n`;\n"
  },
  {
    "path": "detox/runners/__tests__/migration.test.js",
    "content": "describe('file migration', () => {\n  let logger;\n\n  beforeEach(() => {\n    logger = jest.fn();\n    require('../migration')._log = logger;\n  });\n\n  test.each([\n    ['environment', 'testEnvironment'],\n    ['index'],\n    ['reporter'],\n  ])('should work for: jest-circus/%s', (oldModuleName, newModuleName = oldModuleName) => {\n    const newImpl = require(`../jest/${newModuleName}`);\n    expect(logger).not.toHaveBeenCalled();\n    expect(require(`../jest-circus/${oldModuleName}`)).toBe(newImpl);\n    expect(logger.mock.calls[0][0]).toMatchSnapshot();\n    expect(require(`../jest-circus/${oldModuleName}`)).toBe(newImpl);\n    expect(logger).not.toHaveBeenCalledTimes(2);\n  });\n});\n"
  },
  {
    "path": "detox/runners/__tests__/reporter.test.js",
    "content": "const DetoxReporter = require('../jest/reporter');\n\ntest('DetoxReporter', () => {\n  const reporter = new DetoxReporter({\n    bail: 0,\n    reporters: [['default', {}]],\n  });\n\n  expect(reporter.getLastError).toBeInstanceOf(Function);\n  expect(reporter.onRunStart).toBeInstanceOf(Function);\n  expect(reporter.onTestFileStart).toBeInstanceOf(Function);\n  expect(reporter.onTestStart).toBeInstanceOf(Function);\n  expect(reporter.onTestCaseStart).toBeInstanceOf(Function);\n  expect(reporter.onTestCaseResult).toBeInstanceOf(Function);\n  expect(reporter.onTestFileResult).toBeInstanceOf(Function);\n  expect(reporter.onTestResult).toBeInstanceOf(Function);\n  expect(reporter.onRunComplete).toBeInstanceOf(Function);\n});\n"
  },
  {
    "path": "detox/runners/deprecation.js",
    "content": "const chalk = require('chalk');\n\n// @ts-ignore\nconst bold = chalk.bold;\n\nfunction getMaxWidth(text) {\n  const lines = text.split('\\n');\n  return lines.reduce((acc, line) => Math.max(acc, line.length), 0);\n}\n\nfunction centerText(text, maxWidth = getMaxWidth(text)) {\n  return text\n    .split('\\n')\n    .map(line => {\n      const padStart = Math.max(0, Math.floor((maxWidth - line.length) / 2));\n      const padEnd = Math.max(0, maxWidth - line.length - padStart);\n      return ' '.repeat(padStart) + line + ' '.repeat(padEnd);\n    })\n    .join('\\n');\n}\n\nconst header = `\\\n=========================  THE NEW JOURNEY BEGINS  =============================`;\n\nconsole.error(centerText(`\\\n\n${bold(header)}\n\nhttps://wix.github.io/Detox/docs/guide/migration\n\nSorry to say that Detox 20 comes without old adapters for Jest.\nYou have to rearrange your init code before you can continue your journey.\n\nNavigate to the link and follow the migration guide steps.\n\nSincerely yours,\nDetox team.\n\n${bold(header)}\n\n`, header.length));\n\nconst error = new Error('\\nPlease follow the migration guide:\\nhttps://wix.github.io/Detox/docs/guide/migration\\n\\n');\nerror.stack = '';\nthrow error;\n"
  },
  {
    "path": "detox/runners/jest/JestCircusEnvironment.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/jest/adapter.d.ts",
    "content": "/***\n * @deprecated Detox does not support old Jest integrations since v20.0.0\n */\ndeclare const adapter: never;\n\nexport = adapter;\n"
  },
  {
    "path": "detox/runners/jest/adapter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/jest/assignReporter.d.ts",
    "content": "/***\n * @deprecated Detox does not support old Jest integrations since v20.0.0\n */\ndeclare const assignReporter: never;\n\nexport = assignReporter;\n"
  },
  {
    "path": "detox/runners/jest/assignReporter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/jest/globalSetup.js",
    "content": "module.exports = async () => require('../../internals').init({ workerId: null });\n"
  },
  {
    "path": "detox/runners/jest/globalTeardown.js",
    "content": "module.exports = async () => require('../../internals').cleanup();\n"
  },
  {
    "path": "detox/runners/jest/index.d.ts",
    "content": "declare module 'detox/runners/jest' {\n  import type NodeEnvironment from 'jest-environment-node';\n\n  export function globalSetup(): Promise<void>;\n  export function globalTeardown(): Promise<void>;\n\n  export type DetoxCircusListenerConstructorOpts = {\n    readonly env: DetoxCircusEnvironment;\n  }\n\n  /**\n   * @example\n   * class CustomListener implements DetoxCircusListener {\n   *   constructor(opts: DetoxCircusListenerConstructorOpts) {\n   *     console.log('Current test path is:', opts.env.testPath);\n   *   }\n   * }\n   */\n  export interface DetoxCircusListener {\n    start_describe_definition?(event: unknown, state: unknown): void;\n    finish_describe_definition?(event: unknown, state: unknown): void;\n    add_hook?(event: unknown, state: unknown): void;\n    add_test?(event: unknown, state: unknown): void;\n    error?(event: unknown, state: unknown): void;\n\n    setup?(event: unknown, state: unknown): void | Promise<void>;\n    include_test_location_in_result?(event: unknown, state: unknown): void | Promise<void>;\n    hook_start?(event: unknown, state: unknown): void | Promise<void>;\n    hook_success?(event: unknown, state: unknown): void | Promise<void>;\n    hook_failure?(event: unknown, state: unknown): void | Promise<void>;\n    test_fn_start?(event: unknown, state: unknown): void | Promise<void>;\n    test_fn_success?(event: unknown, state: unknown): void | Promise<void>;\n    test_fn_failure?(event: unknown, state: unknown): void | Promise<void>;\n    test_retry?(event: unknown, state: unknown): void | Promise<void>;\n    test_start?(event: unknown, state: unknown): void | Promise<void>;\n    test_skip?(event: unknown, state: unknown): void | Promise<void>;\n    test_todo?(event: unknown, state: unknown): void | Promise<void>;\n    test_done?(event: unknown, state: unknown): void | Promise<void>;\n    run_describe_start?(event: unknown, state: unknown): void | Promise<void>;\n    run_describe_finish?(event: unknown, state: unknown): void | Promise<void>;\n    run_start?(event: unknown, state: unknown): void | Promise<void>;\n    run_finish?(event: unknown, state: unknown): void | Promise<void>;\n    teardown?(event: unknown, state: unknown): void | Promise<void>;\n  }\n\n  export interface DetoxListenerFactory {\n    new (opts: DetoxCircusListenerConstructorOpts): DetoxCircusListener;\n  }\n\n  export class DetoxCircusEnvironment extends NodeEnvironment {\n    public readonly testPath: string;\n\n    public handleTestEvent(event: unknown, state: unknown): void | Promise<void>;\n\n    protected registerListeners(map: Record<string, DetoxListenerFactory>): void;\n    protected setupTimeout: number;\n    protected teardownTimeout: number;\n    protected initDetox(): Promise<DetoxInternals.Worker>;\n    protected cleanupDetox(): Promise<void>;\n  }\n}\n"
  },
  {
    "path": "detox/runners/jest/index.js",
    "content": "// Lazy require() is used to avoid initializing a bare Detox context when it is not needed.\n// At the moment, this safety measure is not really needed, but it's better to be on the safe side.\n\nmodule.exports = {\n  get DetoxCircusEnvironment() {\n    return require('./testEnvironment');\n  },\n\n  get globalSetup() {\n    return require('./globalSetup');\n  },\n\n  get globalTeardown() {\n    return require('./globalTeardown');\n  },\n};\n"
  },
  {
    "path": "detox/runners/jest/index.test.js",
    "content": "describe('detox/runners/jest', () => {\n  it('should lazily require the exported modules', () => {\n    const index = jest.requireActual('./index');\n\n    jest.mock('./testEnvironment', () => 0);\n    jest.mock('./globalSetup', () => 1);\n    jest.mock('./globalTeardown', () => 2);\n\n    expect(index.DetoxCircusEnvironment).toBe(0);\n    expect(index.globalSetup).toBe(1);\n    expect(index.globalTeardown).toBe(2);\n  });\n});\n"
  },
  {
    "path": "detox/runners/jest/reporter.js",
    "content": "/** @typedef {import('@jest/reporters').Reporter} Reporter */\n\nconst {\n  DetoxIPCReporter,\n  DetoxReporterDispatcher,\n  DetoxSummaryReporter,\n  DetoxVerboseReporter,\n} = require('./reporters');\n\n/** @implements {Reporter} */\nclass DetoxReporter extends DetoxReporterDispatcher {\n  constructor(globalConfig) {\n    super(globalConfig, {\n      DetoxVerboseReporter,\n      DetoxSummaryReporter,\n      DetoxIPCReporter,\n    });\n  }\n}\n\nmodule.exports = DetoxReporter;\n"
  },
  {
    "path": "detox/runners/jest/reporters/DetoxIPCReporter.js",
    "content": "const { config, reportTestResults } = require('../../../internals');\n\n/** @typedef {import('@jest/reporters').Reporter} Reporter */\n\n/** @implements {Partial<Reporter>} */\nclass DetoxIPCReporter {\n  /**\n   * @param {Set<import('@jest/reporters').TestContext>} testContexts\n   * @param {import('@jest/reporters').AggregatedResult} aggregatedResult\n   */\n  async onRunComplete(testContexts, aggregatedResult) {\n    const lostTests = aggregatedResult.numTotalTestSuites - aggregatedResult.testResults.length;\n\n    await reportTestResults(aggregatedResult.testResults.map(r => ({\n      success: !r.failureMessage,\n      testFilePath: r.testFilePath,\n      testExecError: r.testExecError,\n      isPermanentFailure: lostTests > 0 || this._isPermanentFailure(r),\n    })));\n  }\n\n  /**\n   * @param {import('@jest/test-result').TestResult} testResult\n   */\n  _isPermanentFailure(testResult) {\n    if (config.testRunner.jest.retryAfterCircusRetries) {\n      return false;\n    }\n\n    return testResult.testResults.some(r => r.status === 'failed' && r.invocations > 1);\n  }\n}\n\nmodule.exports = DetoxIPCReporter;\n"
  },
  {
    "path": "detox/runners/jest/reporters/DetoxReporterDispatcher.js",
    "content": "/** @typedef {import('@jest/reporters').Reporter} Reporter */\n\nconst { config, unsafe_conductEarlyTeardown } = require('../../../internals');\nconst Deferred = require('../../../src/utils/Deferred');\n\n/** @implements {Reporter} */\nclass DetoxReporterDispatcher {\n  /**\n   * @param {import('@jest/types').Config.GlobalConfig} globalConfig\n   * @param {Record<string, new (globalConfig: import('@jest/types').Config.GlobalConfig) => Partial<Reporter>>} reporters\n   */\n  constructor(globalConfig, reporters) {\n    this._bail = globalConfig.bail;\n    /** @type {Deferred | null} */\n    this._lastRunComplete = null;\n    /** @type {Set<string>} */\n    this._pendingTestFiles = new Set();\n    /** @type {Promise<any> | null} */\n    this._onRunCompletePromise = null;\n    /** @type {Partial<Reporter>[]} */\n    this._reporters = Object.values(reporters).map((Reporter) => new Reporter(globalConfig));\n  }\n\n  getLastError() {\n    for (const reporter of this._reporters) {\n      let error = typeof reporter.getLastError === 'function'\n        ? reporter.getLastError()\n        : undefined;\n\n      if (error) {\n        return error;\n      }\n    }\n\n    return;\n  }\n\n  onRunStart(aggregatedResult, options) {\n    return this._dispatch('onRunStart', aggregatedResult, options);\n  }\n\n  onTestFileStart(test) {\n    this._pendingTestFiles.add(test.path);\n    return this._dispatch(['onTestFileStart', 'onTestStart'], test);\n  }\n\n  onTestStart(test) {\n    // Legacy method\n    return this.onTestFileStart(test);\n  }\n\n  // NEW! Supported only since Jest 29.6.0\n  onTestCaseStart(test, testCaseStartInfo) {\n    return this._dispatch('onTestCaseStart', test, testCaseStartInfo);\n  }\n\n  onTestCaseResult(test, testCaseResult) {\n    return this._dispatch('onTestCaseResult', test, testCaseResult);\n  }\n\n  async onTestFileResult(test, testResult, aggregatedResult) {\n    this._pendingTestFiles.delete(test.path);\n\n    await this._dispatch(['onTestFileResult', 'onTestResult'], test, testResult, aggregatedResult);\n\n    if (this._lastRunComplete && this._pendingTestFiles.size === 0) {\n      this._lastRunComplete.resolve(aggregatedResult);\n    }\n  }\n\n  onTestResult(test, testResult, aggregatedResult) {\n    // Legacy method\n    return this.onTestFileResult(test, testResult, aggregatedResult);\n  }\n\n  onRunComplete(testContexts, aggregatedResult) {\n    if (!this._lastRunComplete) {\n      // Both `_lastRunComplete` and `_onRunCompletePromise` are used to prevent\n      // a bug in Jest, where `onRunComplete` is called multiple times when\n      // Jest runs with `--bail` and multiple workers, and `onRunComplete`\n      // is implemented as an asynchronous long-running operation.\n      this._lastRunComplete = this._pendingTestFiles.size === 0\n        ? Deferred.resolved(aggregatedResult)\n        : new Deferred();\n    }\n\n    if (!this._onRunCompletePromise) {\n      this._onRunCompletePromise = this._doRunComplete(testContexts, aggregatedResult);\n    }\n\n    return this._onRunCompletePromise;\n  }\n\n  /**\n   * @private\n   * @param {Set<import('@jest/reporters').TestContext>} testContexts\n   * @param {import('@jest/test-result').AggregatedResult} aggregatedResult\n   * @returns {Promise<void>}\n   */\n  async _doRunComplete(testContexts, aggregatedResult) {\n    const earlyTeardown = this._bail > 0 && aggregatedResult.numFailedTests >= this._bail;\n    if (earlyTeardown) {\n      const lostTests = aggregatedResult.numTotalTestSuites - aggregatedResult.testResults.length;\n      if (lostTests > 0 && config.testRunner.retries > 0) {\n        console.warn(\n          'Jest aborted the test execution before all scheduled test files have been reported.\\n' +\n          'If you want to retry the whole test run, please disable Jest\\'s --bail option.'\n        );\n      }\n\n      await unsafe_conductEarlyTeardown();\n    }\n\n    await this._lastRunComplete.promise;\n    await this._dispatch('onRunComplete', testContexts, aggregatedResult);\n  }\n\n  /**\n   * @private\n   * @param {string | string[]} rawMethodNames\n   * @param {...any} args\n   * @returns {Promise<void>}\n   */\n  _dispatch(rawMethodNames, ...args) {\n    const methodNames = Array.isArray(rawMethodNames)\n      ? rawMethodNames\n      : [rawMethodNames];\n\n    const maybePromises = [];\n\n    for (const reporter of this._reporters) {\n      for (const methodName of methodNames) {\n        if (typeof reporter[methodName] === 'function') {\n          maybePromises.push(reporter[methodName](...args));\n          break;\n        }\n      }\n    }\n\n    return Promise.all(maybePromises).then(() => void 0);\n  }\n}\n\nmodule.exports = DetoxReporterDispatcher;\n"
  },
  {
    "path": "detox/runners/jest/reporters/DetoxReporterDispatcher.test.js",
    "content": "jest.mock('../../../internals', () => ({\n  config: { testRunner: {} },\n  unsafe_conductEarlyTeardown: jest.fn(),\n}));\n\ndescribe('DetoxReporterDispatcher', () => {\n  /** @type {import('./DetoxReporterDispatcher')} */\n  let dispatcher;\n  /** @type {any} */\n  let mockGlobalConfig;\n  /** @type {LegacyReporter} */\n  let legacyReporter;\n  /** @type {ModernReporter} */\n  let modernReporter;\n\n  class LegacyReporter {\n    constructor(globalConfig) {\n      if (globalConfig) {\n        legacyReporter = this;\n      }\n    }\n\n    getLastError = jest.fn();\n    onRunStart = jest.fn();\n    onTestStart = jest.fn();\n    onTestCaseStart = jest.fn();\n    onTestCaseResult = jest.fn();\n    onTestResult = jest.fn();\n    onRunComplete = jest.fn();\n  }\n\n  class ModernReporter extends LegacyReporter {\n    constructor() {\n      super(null);\n      modernReporter = this;\n    }\n\n    onTestFileStart = jest.fn();\n    onTestFileResult = jest.fn();\n  }\n\n  beforeEach(() => {\n    mockGlobalConfig = { bail: 2 };\n\n    const DetoxReporterDispatcher = require('./DetoxReporterDispatcher');\n    dispatcher = new DetoxReporterDispatcher(mockGlobalConfig, {\n      LegacyReporter,\n      ModernReporter,\n    });\n  });\n\n  it('should instantiate reporters', () => {\n    expect(legacyReporter).toBeInstanceOf(LegacyReporter);\n    expect(modernReporter).toBeInstanceOf(ModernReporter);\n  });\n\n  it('should return first error from getLastError method', () => {\n    const [error1, error2] = [new Error('1'), new Error('2')];\n    legacyReporter.getLastError.mockReturnValue(error1);\n    modernReporter.getLastError.mockReturnValue(error2);\n    expect(dispatcher.getLastError()).toBe(error1);\n  });\n\n  it.each([\n    ['onRunStart'],\n    ['onTestCaseStart'],\n    ['onTestCaseResult'],\n    ['onRunComplete'],\n  ])('should dispatch %s calls to all reporters', async (methodName) => {\n    const args = [{ path: 'test' }, { arg: 2 }, { arg: 3 }].slice(0, dispatcher[methodName].length);\n    await dispatcher[methodName](...args);\n    expect(legacyReporter[methodName]).toHaveBeenCalledWith(...args);\n    expect(modernReporter[methodName]).toHaveBeenCalledWith(...args);\n  });\n\n  it.each([\n    ['onTestFileStart', 'onTestStart'],\n    ['onTestFileResult', 'onTestResult'],\n  ])('should dispatch %s/%s calls to all reporters', async (modernMethod, legacyMethod) => {\n    const args = [{ path: 'test' }, { arg: 2 }, { arg: 3 }].slice(0, dispatcher[modernMethod].length);\n\n    for (const methodName of [modernMethod, legacyMethod]) {\n      await dispatcher[methodName](...args);\n\n      expect(legacyReporter[legacyMethod]).toHaveBeenCalledWith(...args);\n      expect(modernReporter[modernMethod]).toHaveBeenCalledWith(...args);\n      expect(modernReporter[legacyMethod]).not.toHaveBeenCalled();\n\n      legacyReporter[legacyMethod].mockClear();\n      modernReporter[modernMethod].mockClear();\n    }\n  });\n\n  describe('onRunComplete', () => {\n    let unsafe_conductEarlyTeardown;\n\n    beforeEach(() => {\n      jest.spyOn(console, 'warn');\n      unsafe_conductEarlyTeardown = require('../../../internals').unsafe_conductEarlyTeardown;\n    });\n\n    describe('upon a regular exit', () => {\n      const testContexts = new Set();\n      const aggregatedResult = { numFailedTests: 1, numTotalSuites: 0, testResults: [] };\n\n      it('should not call unsafe cleanup on regular exit', async () => {\n        await dispatcher.onRunComplete(testContexts, aggregatedResult);\n        expect(unsafe_conductEarlyTeardown).not.toHaveBeenCalled();\n        expect(console.warn).not.toHaveBeenCalled();\n      });\n\n      it('can be called only once per reporter lifecycle', async () => {\n        const promise1 = dispatcher.onRunComplete(testContexts, aggregatedResult);\n        const promise2 = dispatcher.onRunComplete(testContexts, aggregatedResult);\n\n        expect(promise1).toBe(promise2);\n      });\n    });\n\n    describe('upon an early exit', () => {\n      const testContexts = new Set();\n      let aggregatedResult;\n      let config;\n\n      beforeEach(() => {\n        // 2 > 1 (numFailedTests > bail)\n        aggregatedResult = { numFailedTests: 2, numTotalTestSuites: 1, testResults: [] };\n        config = require('../../../internals').config;\n      });\n\n      it('should call unsafe cleanup on early exit', async () => {\n        await dispatcher.onRunComplete(testContexts, aggregatedResult);\n\n        expect(unsafe_conductEarlyTeardown).toHaveBeenCalled();\n        expect(console.warn).not.toHaveBeenCalled();\n      });\n\n      it('should wait for all test files to finish', async () => {\n        await dispatcher.onTestFileStart({ path: 'a' });\n        const runCompletePromise = dispatcher.onRunComplete(testContexts, aggregatedResult);\n        const timeoutPromise = new Promise((resolve) => setTimeout(resolve, 100, 'timeout'));\n\n        await expect(Promise.race([runCompletePromise, timeoutPromise])).resolves.toBe('timeout');\n        await dispatcher.onTestFileResult({ path: 'a' }, {});\n        await expect(runCompletePromise).resolves.toBe(undefined);\n      });\n\n      it('should warn about mismatching number of failed test suites if -R, --retries > 0', async () => {\n        config.testRunner.retries = 1;\n\n        await dispatcher.onRunComplete(testContexts, aggregatedResult);\n        expect(unsafe_conductEarlyTeardown).toHaveBeenCalled();\n        expect(console.warn).toHaveBeenCalledWith(expect.stringContaining('aborted'));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/runners/jest/reporters/DetoxSummaryReporter.js",
    "content": "/** @typedef {import('@jest/reporters').Reporter} Reporter */\n\nconst resolveFrom = require('resolve-from');\n/** @type {new (globalConfig: any) => import('@jest/reporters').SummaryReporter} */\nconst SummaryReporter = require(resolveFrom(process.cwd(), '@jest/reporters')).SummaryReporter;\n\n/** @implements {Partial<Reporter>} */\nclass DetoxSummaryReporter {\n  constructor(globalConfig) {\n    if (globalConfig.reporters.every(([name]) => name !== 'default' && name !== 'summary')) {\n      return new SummaryReporter(globalConfig);\n    }\n  }\n}\n\nmodule.exports = DetoxSummaryReporter;\n"
  },
  {
    "path": "detox/runners/jest/reporters/DetoxVerboseReporter.js",
    "content": "/** @typedef {import('@jest/reporters').Reporter} Reporter */\n\nconst resolveFrom = require('resolve-from');\n/** @type {new (globalConfig: any) => import('@jest/reporters').VerboseReporter} */\nconst VerboseReporter = require(resolveFrom(process.cwd(), '@jest/reporters')).VerboseReporter;\n\n/** @implements {Partial<Reporter>} */\nclass DetoxVerboseReporter {\n  constructor(globalConfig) {\n    if (globalConfig.reporters.every(([name]) => name !== 'default')) {\n      return new VerboseReporter(globalConfig);\n    }\n  }\n}\n\nmodule.exports = DetoxVerboseReporter;\n"
  },
  {
    "path": "detox/runners/jest/reporters/index.js",
    "content": "module.exports = {\n  DetoxIPCReporter: require('./DetoxIPCReporter'),\n  DetoxReporterDispatcher: require('./DetoxReporterDispatcher'),\n  DetoxSummaryReporter: require('./DetoxSummaryReporter'),\n  DetoxVerboseReporter: require('./DetoxVerboseReporter'),\n};\n"
  },
  {
    "path": "detox/runners/jest/specReporter.d.ts",
    "content": "/***\n * @deprecated Detox does not support old Jest integrations since v20.0.0\n */\ndeclare const specReporter: never;\n\nexport = specReporter;\n"
  },
  {
    "path": "detox/runners/jest/specReporter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/jest/streamlineReporter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/index.js",
    "content": "const path = require('path');\n\nconst WithEmitter = require('jest-environment-emit').default;\nconst resolveFrom = require('resolve-from');\nconst maybeNodeEnvironment = require(resolveFrom(process.cwd(), 'jest-environment-node'));\n/** @type {typeof import('@jest/environment').JestEnvironment} */\nconst NodeEnvironment = maybeNodeEnvironment.default || maybeNodeEnvironment;\n\nconst detox = require('../../../internals');\nconst Timer = require('../../../src/utils/Timer');\n\nconst {\n  DetoxCoreListener,\n  DetoxInitErrorListener,\n  DetoxPlatformFilterListener,\n  REPLListener,\n  SpecReporter,\n  WorkerAssignReporter\n} = require('./listeners');\nconst assertExistingContext = require('./utils/assertExistingContext');\nconst { validateAndPatchProjectConfig } = require('./utils/validateAndPatchProjectConfig');\n\nconst SYNC_CIRCUS_EVENTS = new Set([\n  'start_describe_definition',\n  'finish_describe_definition',\n  'add_hook',\n  'add_test',\n  'error',\n]);\n\nconst log = detox.log.child({ cat: 'lifecycle,jest-environment' });\n\n/**\n * @see https://www.npmjs.com/package/jest-circus#overview\n */\nclass DetoxCircusEnvironment extends WithEmitter(NodeEnvironment) {\n  constructor(config, context) {\n    super(validateAndPatchProjectConfig(config), assertExistingContext(context));\n\n    /** @private */\n    this._shouldManageDetox = detox.getStatus() === 'inactive';\n    /** @private */\n    this._timer = new Timer();\n\n    /** @internal */\n    this.testPath = path.relative(process.cwd(), context.testPath);\n    /** @protected */\n    this.testEventListeners = [];\n    /** @protected */\n    this.setupTimeout = detox.config.testRunner.jest.setupTimeout;\n    /** @protected */\n    this.teardownTimeout = detox.config.testRunner.jest.teardownTimeout;\n\n    log.trace.begin(this.testPath);\n\n    this.handleTestEvent = this.handleTestEvent.bind(this);\n    this.setup = this._wrapSetup(this.setup);\n    this.teardown = this._wrapTeardown(this.teardown);\n\n    this.registerListeners({\n      DetoxInitErrorListener,\n      DetoxPlatformFilterListener,\n      DetoxCoreListener,\n      SpecReporter,\n      WorkerAssignReporter,\n      REPLListener,\n    });\n\n    // Artifacts flushing should be delayed to avoid conflicts with third-party reporters\n    this.testEvents.on('*', this._onTestEvent.bind(this), 1e6);\n  }\n\n  /** @override */\n  async setup() {\n    await super.setup();\n    await this.initDetox();\n  }\n\n  // @ts-expect-error TS2425\n  async handleTestEvent(event, state) {\n    // @ts-expect-error TS2855\n    await super.handleTestEvent(event, state);\n\n    if (detox.session.unsafe_earlyTeardown) {\n      if (event.name === 'test_fn_start' || event.name === 'hook_start') {\n        throw new Error('Detox halted test execution due to an early teardown request');\n      }\n    }\n  }\n\n  /** @override */\n  async teardown() {\n    try {\n      await this.cleanupDetox();\n    } finally {\n      await super.teardown();\n    }\n  }\n\n  /** @protected */\n  registerListeners(map) {\n    for (const Listener of Object.values(map)) {\n      this.testEventListeners.push(new Listener({\n        env: this,\n      }));\n    }\n  }\n\n  /**\n   * @protected\n   */\n  async initDetox() {\n    if (detox.session.unsafe_earlyTeardown) {\n      throw new Error('Detox halted test execution due to an early teardown request');\n    }\n\n    const opts = {\n      global: this.global,\n      workerId: `w${process.env.JEST_WORKER_ID}`,\n    };\n\n    if (this._shouldManageDetox) {\n      await detox.init(opts);\n    } else {\n      await detox.installWorker(opts);\n    }\n\n    detox.worker.pilot.setDefaults({\n      testContext: {\n        getCurrentTestFilePath: () => path.resolve(this.testPath),\n      },\n    });\n\n    return detox.worker;\n  }\n\n  /** @protected */\n  async cleanupDetox() {\n    if (this._shouldManageDetox) {\n      await detox.cleanup();\n    } else {\n      await detox.uninstallWorker();\n    }\n  }\n\n  /** @private */\n  _handleTestEventSync(event, state) {\n    const { name } = event;\n\n    for (const listener of this.testEventListeners) {\n      if (typeof listener[name] === 'function') {\n        listener[name](event, state);\n      }\n    }\n  }\n\n  /** @private */\n  _onTestEvent({ type, event, state }) {\n    const timeout = state && state.testTimeout != null ? state.testTimeout : this.setupTimeout;\n\n    this._timer.schedule(timeout);\n\n    if (event) {\n      if (SYNC_CIRCUS_EVENTS.has(event.name)) {\n        this._handleTestEventSync(event, state);\n      } else {\n        return this._handleTestEventAsync(event, state);\n      }\n    } else {\n      return this._handleTestEventAsync({ name: type }, null);\n    }\n  }\n\n  /** @private */\n  async _handleTestEventAsync(event, state = null) {\n    const description = `handling ${state ? 'jest-circus' : 'jest-environment'} \"${event.name}\" event`;\n\n    for (const listener of this.testEventListeners) {\n      if (typeof listener[event.name] !== 'function') {\n        continue;\n      }\n\n      try {\n        await this._timer.run(description, () => listener[event.name](event, state));\n      } catch (listenerError) {\n        log.error(listenerError);\n        if (this._timer.expired) {\n          break;\n        }\n      }\n    }\n  }\n\n  _wrapSetup(fn) {\n    const _setup = fn.bind(this);\n\n    return async () => {\n      await log.trace.complete('set up environment', async () => {\n        try {\n          this._timer.schedule(this.setupTimeout);\n          await this._handleTestEventAsync({ name: 'environment_setup_start' });\n          await this._timer.run(`setting up Detox environment`, _setup);\n          await this._handleTestEventAsync({ name: 'environment_setup_success' });\n        } catch (error) {\n          this._timer.schedule(this.teardownTimeout);\n          await this._handleTestEventAsync({ name: 'environment_setup_failure', error });\n          throw error;\n        } finally {\n          this._timer.clear();\n        }\n      });\n    };\n  }\n\n  _wrapTeardown(fn) {\n    const _teardown = fn.bind(this);\n\n    return async () => {\n      await log.trace.complete('tear down environment', async () => {\n        try {\n          this._timer.schedule(this.teardownTimeout);\n          await this._handleTestEventAsync({ name: 'environment_teardown_start' });\n          await this._timer.run(`tearing down Detox environment`, _teardown);\n          await this._handleTestEventAsync({ name: 'environment_teardown_success' });\n        } catch (error) {\n          if (this._timer.expired) {\n            this._timer.schedule(this.teardownTimeout);\n          }\n\n          await this._handleTestEventAsync({ name: 'environment_teardown_failure', error });\n          throw error;\n        } finally {\n          this._timer.clear();\n          log.trace.end();\n        }\n      });\n    };\n  }\n}\n\nmodule.exports = DetoxCircusEnvironment;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/DetoxCoreListener.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst detox = require('../../../..');\nconst detoxInternals = require('../../../../internals');\nconst { getFullTestName, hasTimedOut } = require('../utils');\n\nconst RETRY_TIMES = Symbol.for('RETRY_TIMES');\n\nconst log = detoxInternals.log.child({ cat: 'lifecycle,jest-environment' });\n\nclass DetoxCoreListener {\n  constructor({ env }) {\n    this._startedTests = new Set();\n    this._skippedTests = new Set();\n    this._testsFailedBeforeStart = new Set();\n    this._env = env;\n    this._circusRetryTimes = 1;\n  }\n\n  async setup() {\n    // Workaround to override Jest's expect\n    if (detoxInternals.config.behavior.init.exposeGlobals) {\n      this._env.global.expect = detox.expect;\n    }\n  }\n\n  async run_describe_start({ describeBlock }) {\n    if (describeBlock.children.length) {\n      log.trace.begin(describeBlock.parent ? describeBlock.name : 'run the tests');\n      await detoxInternals.onRunDescribeStart({\n        name: describeBlock.name,\n      });\n    }\n  }\n\n  async run_describe_finish({ describeBlock }) {\n    if (describeBlock.children.length) {\n      await detoxInternals.onRunDescribeFinish({ name: describeBlock.name });\n      log.trace.end();\n    }\n  }\n\n  async test_start({ test }) {\n    const metadata = this._getTestMetadata(test);\n    if (metadata.status === 'failed') {\n      this._testsFailedBeforeStart.add(test);\n    }\n\n    log.trace.begin({\n      context: 'test',\n      status: metadata.status,\n      fullName: metadata.fullName,\n      invocations: metadata.invocations,\n    }, metadata.title);\n\n    const circusRetryTimes = +this._env.global[RETRY_TIMES];\n    this._circusRetryTimes = isNaN(circusRetryTimes) ? 1 : 1 + circusRetryTimes;\n  }\n\n  async test_skip({ test }) {\n    log.trace.end({ status: 'skip' }, getFullTestName(test));\n    this._skippedTests.add(test);\n  }\n\n  async test_todo({ test }) {\n    log.trace.end({ status: 'todo' }, getFullTestName(test));\n    this._skippedTests.add(test);\n  }\n\n  async hook_start(event, state) {\n    await this._onBeforeActualTestStart(state.currentlyRunningTest);\n    log.trace.begin({ functionCode: event.hook.fn.toString() }, event.hook.type);\n  }\n\n  async hook_success() {\n    log.trace.end({ success: true });\n  }\n\n  async hook_failure({ error, hook }) {\n    await detoxInternals.onHookFailure({\n      error,\n      hook: hook.type,\n    });\n\n    log.trace.end({ success: false, error });\n  }\n\n  async test_fn_start({ test }) {\n    await this._onBeforeActualTestStart(test);\n\n    if (!this._testsFailedBeforeStart.has(test)) {\n      // Jest bug workaround: beforeAll hook errors result into an unterminated test_fn_start event.\n      log.trace.begin({ functionCode: test.fn.toString() }, 'test_fn');\n    }\n  }\n\n  async test_fn_success() {\n    log.trace.end({ success: true });\n  }\n\n  async test_fn_failure({ error }) {\n    await detoxInternals.onTestFnFailure({ error });\n    log.trace.end({ success: false, error });\n  }\n\n  async test_done({ test }) {\n    const metadata = this._getTestMetadata(test);\n\n    if (this._startedTests.has(test)) {\n      await detoxInternals.onTestDone(metadata);\n      this._startedTests.delete(test);\n    }\n\n    log.trace.end(_.pick(metadata, ['status', 'timedOut']));\n  }\n\n  async _onBeforeActualTestStart(test) {\n    if (!this._isTestActuallyStarting(test)) {\n      return;\n    }\n\n    this._startedTests.add(test);\n    await detoxInternals.onTestStart(this._getTestMetadata(test));\n  }\n\n  _isTestActuallyStarting(test) {\n    return test && !this._isTestSkipped(test) && !this._startedTests.has(test) && !this._testsFailedBeforeStart.has(test);\n  }\n\n  _isTestSkipped(test) {\n    return test && this._skippedTests.has(test);\n  }\n\n  _getTestMetadata(test) {\n    const result = {\n      title: test.name,\n      fullName: getFullTestName(test),\n      status: this._getTestStatus(test),\n      invocations: this._getTestInvocations(test),\n    };\n\n    if (result.status === 'failed') {\n      result.timedOut = hasTimedOut(test);\n    }\n\n    return result;\n  }\n\n  /** @returns { 'failed' | 'passed' | 'running'} */\n  _getTestStatus(test) {\n    if (!_.isEmpty(test.errors)) {\n      return 'failed';\n    }\n\n    if (test.status === 'done') {\n      return 'passed';\n    } else {\n      return test.status || 'running';\n    }\n  }\n\n  _getTestInvocations(test) {\n    const { testSessionIndex } = detoxInternals.session;\n    return testSessionIndex * this._circusRetryTimes + test.invocations;\n  }\n}\n\nmodule.exports = DetoxCoreListener;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/DetoxInitErrorListener.js",
    "content": "const _ = require('lodash');\n\nclass DetoxInitErrorListener {\n  add_hook(event, { unhandledErrors, currentDescribeBlock, rootDescribeBlock }) {\n    if (_.isEmpty(unhandledErrors)) {\n      return;\n    }\n\n    if (currentDescribeBlock !== rootDescribeBlock || currentDescribeBlock.hooks.length > 1) {\n      _.last(currentDescribeBlock.hooks).fn = async () => {};\n    }\n  }\n\n  add_test(event, { unhandledErrors, currentDescribeBlock }) {\n    if (!_.isEmpty(unhandledErrors)) {\n      const currentTest = _.last(currentDescribeBlock.children);\n      const dummyError = new Error('Environment setup failed. See the detailed error below.');\n      dummyError.stack = '';\n\n      currentTest.errors.push(dummyError);\n    }\n  }\n}\n\nmodule.exports = DetoxInitErrorListener;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js",
    "content": "const _ = require('lodash');\n\nconst { device } = require('../../../..');\n\nconst PLATFORM_REGEXP = /^:([^:]+):/;\n\nclass DetoxPlatformFilterListener {\n  setup() {\n    this._platform = device.getPlatform();\n  }\n\n  start_describe_definition(event, state) {\n    const match = event.blockName.match(PLATFORM_REGEXP);\n    if (match && match[1] !== this._platform) {\n      state.currentDescribeBlock.mode = 'skip';\n    }\n  }\n\n  add_test(event, state) {\n    const match = event.testName.match(PLATFORM_REGEXP);\n    if (match && match[1] !== this._platform) {\n      _.last(state.currentDescribeBlock.children).mode = 'skip';\n    }\n  }\n}\n\nmodule.exports = DetoxPlatformFilterListener;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/REPLListener.js",
    "content": "const internals = require('../../../../internals');\nconst { enterREPL } = require('../../../../src/utils/repl');\n\nconst log = internals.log.child({ cat: 'lifecycle,jest-environment' });\nconst noop = () => {};\n\nclass REPLListener {\n  constructor({ env }) {\n    this._env = env;\n  }\n\n  async setup(_events, state) {\n    const repl = internals.config.cli.repl;\n\n    if (repl) {\n      state.testTimeout = 2 * 60 * 60 * 1000; // 2 hours\n    }\n\n    if (repl !== 'auto') {\n      Object.assign(this, {\n        hook_failure: noop,\n        test_fn_failure: noop,\n      });\n    }\n  }\n\n  async hook_failure({ error }) {\n    await this._enterREPL(error);\n  }\n\n  async test_fn_failure({ error }) {\n    await this._enterREPL(error);\n  }\n\n  async _enterREPL(error) {\n    log.error(error);\n    await enterREPL();\n  }\n}\n\nmodule.exports = REPLListener;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/SpecReporter.js",
    "content": "const chalk = require('chalk');\nconst noop = require('lodash/noop');\n\nconst { config, log, session } = require('../../../../internals');\nconst { traceln } = require('../utils/stdout');\n\nconst RESULT_SKIPPED = chalk.yellow('SKIPPED');\nconst RESULT_FAILED = chalk.red('FAIL');\nconst RESULT_PENDING = chalk.yellow('PENDING');\nconst RESULT_SUCCESS = chalk.green('OK');\nconst RESULT_OTHER = 'UNKNOWN';\n\nclass SpecReporter {\n  constructor() {\n    this._suites = [];\n    this._suitesDesc = '';\n  }\n\n  setup() {\n    const jestSection = config.testRunner.jest;\n    const reportSpecs = jestSection && jestSection.reportSpecs;\n    const enabled = reportSpecs !== undefined ? reportSpecs : session.workersCount === 1;\n\n    if (!enabled) {\n      this.run_describe_start = noop;\n      this.run_describe_finish = noop;\n      this.test_start = noop;\n      this.test_done = noop;\n      this.test_skip = noop;\n    }\n  }\n\n  run_describe_start(event) {\n    if (event.describeBlock.parent !== undefined) {\n      this._onSuiteStart({\n        description: event.describeBlock.name,\n      });\n    }\n  }\n\n  run_describe_finish(event) {\n    if (event.describeBlock.parent !== undefined) {\n      this._onSuiteEnd();\n    }\n  }\n\n  test_start(event) {\n    const { test } = event;\n    this._onTestStart({\n      description: test.name,\n      invocations: test.invocations,\n    });\n  }\n\n  test_done(event) {\n    const { test } = event;\n    const testInfo = {\n      description: test.name,\n      invocations: test.invocations,\n    };\n    this._onTestEnd(testInfo, test.errors.length ? 'failed' : 'success');\n  }\n\n  test_skip(event) {\n    const testInfo = {\n      description: event.test.name,\n    };\n    this._onTestEnd(testInfo, 'skipped');\n  }\n\n  _onSuiteStart({ description }) {\n    this._suites.push({ description });\n    this._regenerateSuitesDesc();\n  }\n\n  _onSuiteEnd() {\n    this._suites.pop();\n    this._regenerateSuitesDesc();\n\n    if (!this._suites.length) {\n      traceln('');\n    }\n  }\n\n  _onTestStart({ description, invocations = 1 }) {\n    this._traceTest({ description, invocations });\n  }\n\n  _onTestEnd({ description, invocations = 1 }, result) {\n    let status;\n    switch (result) {\n      case 'skipped': status = RESULT_SKIPPED; break;\n      case 'failed': status = RESULT_FAILED; break;\n      case 'pending': status = RESULT_PENDING; break;\n      case 'success': status = RESULT_SUCCESS; break;\n      default: status = RESULT_OTHER; break;\n    }\n    this._traceTest({ description, invocations }, status);\n  }\n\n  _regenerateSuitesDesc() {\n    this._suitesDesc = '';\n\n    const total = this._suites.length;\n    this._suites.forEach((suite, index) => {\n      this._suitesDesc = this._suitesDesc\n        .concat((index > 0) ? ' > ' : '')\n        .concat(suite.description)\n        .concat((index === total - 1) ? ': ' : '');\n    });\n    this._suitesDesc = chalk.bold(this._suitesDesc);\n  }\n\n  _traceTest({ description, invocations }, _status = undefined) {\n    const testDescription = chalk.gray(description);\n    const retriesDescription = (invocations > 1) ? chalk.gray(` [Retry #${invocations - 1}]`) : '';\n    const status = chalk.gray(_status ? ` [${_status}]` : '');\n    const desc = this._suitesDesc + testDescription + retriesDescription + status;\n    log.info({ cat: 'lifecycle' }, desc);\n  }\n}\n\nmodule.exports = SpecReporter;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js",
    "content": "const path = require('path');\n\nconst chalk = require('chalk');\nconst _ = require('lodash');\n\nconst { device } = require('../../../..');\nconst { config, log } = require('../../../../internals');\n\nclass WorkerAssignReporter {\n  constructor({ env }) {\n    this._testName = path.basename(env.testPath);\n  }\n\n  run_start() {\n    if (config.testRunner.jest.reportWorkerAssign) {\n      log.info({ cat: 'lifecycle' }, `${chalk.bold(this._testName)} is assigned to ${this._formatDeviceName()}`);\n    }\n  }\n\n  _formatDeviceName() {\n    const deviceName = _.attempt(() => device.name);\n    const formattedDeviceName = _.isError(deviceName)\n      ? chalk.redBright('undefined')\n      : chalk.blueBright(deviceName);\n\n    return formattedDeviceName;\n  }\n}\n\nmodule.exports = WorkerAssignReporter;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/listeners/index.js",
    "content": "const DetoxCoreListener = require('./DetoxCoreListener');\nconst DetoxInitErrorListener = require('./DetoxInitErrorListener');\nconst DetoxPlatformFilterListener = require('./DetoxPlatformFilterListener');\nconst REPLListener = require('./REPLListener');\nconst SpecReporter = require('./SpecReporter');\nconst WorkerAssignReporter = require('./WorkerAssignReporter');\n\nmodule.exports = {\n  DetoxCoreListener,\n  DetoxInitErrorListener,\n  DetoxPlatformFilterListener,\n  REPLListener,\n  SpecReporter,\n  WorkerAssignReporter,\n};\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/assertExistingContext.js",
    "content": "// @ts-nocheck\nconst { DetoxRuntimeError } = require('../../../../src/errors/DetoxRuntimeError');\nconst { filterErrorStack } = require('../../../../src/utils/errorUtils');\n\nfunction findUserConstructor() {\n  let wasInBaseClass = false;\n  let wasInUserClass = false;\n\n  return function (line) {\n    if (!wasInBaseClass) {\n      if (/^\\s*at new DetoxCircusEnvironment/.test(line)) {\n        wasInBaseClass = true;\n      }\n\n      return false;\n    }\n\n    if (!wasInUserClass && /^\\s*at new/.test(line)) {\n      wasInUserClass = true;\n    }\n\n    return wasInUserClass;\n  };\n}\n\nfunction assertExistingContext(context) {\n  if (!context) {\n    const error = new DetoxRuntimeError(`Please add both arguments to super() call in your environment constructor, e.g.:\n\n class CustomDetoxEnvironment extends DetoxCircusEnvironment {\n-  constructor(config) {\n-    super(config);\n+  constructor(config, context) {\n+    super(config, context);\n\nCannot proceed further. Please fix your custom Detox environment class.`);\n\n    const userError = filterErrorStack(error, findUserConstructor());\n\n    throw userError;\n  }\n\n  return context;\n}\n\nmodule.exports = assertExistingContext;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/getFullTestName.js",
    "content": "function getFullTestName(test, separator = ' ') {\n  let testName = '';\n  for (let parent = test.parent;\n       parent.parent; // Since there's always an unwanted root made up by jest\n       parent = parent.parent) {\n    testName = parent.name + separator + testName;\n  }\n  testName += test.name;\n  return testName;\n}\n\nmodule.exports = getFullTestName;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/hasTimedOut.js",
    "content": "const _ = require('lodash');\n\nfunction hasTimedOut(test) {\n  const { errors } = test;\n  const errorsArray = (_.isArray(errors) ? errors : [errors]);\n  const timedOut = _.chain(errorsArray)\n    .flattenDeep()\n    .filter(_.isObject)\n    .some(e => _.includes(e.message, 'Exceeded timeout'))\n    .value();\n\n  return timedOut;\n}\n\nmodule.exports = hasTimedOut;\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/index.js",
    "content": "module.exports = {\n  getFullTestName: require('./getFullTestName'),\n  hasTimedOut: require('./hasTimedOut'),\n};\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/stdout.js",
    "content": "const { EOL } = require('os');\n\nfunction trace(message) {\n  process.stdout.write(message);\n}\n\nfunction traceln(message) {\n  if (message) {\n    trace(message);\n  }\n\n  trace(EOL);\n}\n\nmodule.exports = {\n  trace,\n  traceln,\n};\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/validateAndPatchProjectConfig.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst findUp = require('find-up');\nconst resolveFrom = require('resolve-from');\nconst semver = require('semver');\n\nconst { log } = require('../../../../internals');\nconst detoxPackageJson = require('../../../../package.json');\nconst { DetoxRuntimeError } = require('../../../../src/errors');\n\nfunction validateAndPatchProjectConfig(maybeProjectConfig) {\n  const projectConfig = maybeProjectConfig.projectConfig || maybeProjectConfig;\n\n  if (!/jest-circus/.test(projectConfig.testRunner)) {\n    throw new DetoxRuntimeError({\n      message: 'Cannot continue without Jest Circus test runner underneath, exiting.',\n      hint: 'Make sure that in your Jest config you have no \"testRunner\" property or it is explicitly set to \"jest-circus/runner\".',\n      debugInfo: `The test runner powering your configuration is:\\n${projectConfig.testRunner}`,\n    });\n  }\n\n  const circusPackageJson = findUp.sync('package.json', { cwd: path.dirname(projectConfig.testRunner) });\n  if (!circusPackageJson) {\n    throw new DetoxRuntimeError({\n      message: 'Check that you have an installed copy of \"jest-circus\" npm package, exiting.',\n      debugInfo: `Its package.json file is missing in the directory: ${path.dirname(projectConfig.testRunner)}`,\n    });\n  }\n\n  const jestManifestPath = resolveFrom(process.cwd(), 'jest/package.json');\n  const jestManifest = require(jestManifestPath);\n  assertSupportedVersion(jestManifest.version);\n\n  const circusVersion = require(circusPackageJson).version;\n  if (!circusVersion) {\n    throw new DetoxRuntimeError({\n      message: 'Check that you have an valid copy of \"jest-circus\" npm package, exiting.',\n      debugInfo: `Its package.json file has no \"version\" property. See:\\n` + circusPackageJson,\n    });\n  }\n\n  if (jestManifest.version !== circusVersion) {\n    log.warn([\n      `jest-circus@${circusVersion} does not match jest@${jestManifest.version}.\\n`,\n      `- jest@${jestManifest.version} resolved path:\\n\\t${jestManifestPath}`,\n      `- jest-circus@${circusVersion} resolved path:\\n\\t${circusPackageJson}`,\n      `\\nPlease make sure that your versions match to avoid unexpected behavior!`,\n    ].join('\\n'));\n  }\n\n  // TODO: This is a workaround to prevent Jest from failing on teardown.\n  // PROBLEM: Detox uses proxies which throw in non-initialized or torn down state on purpose.\n  // So, either we need to implement a distinction between BEFORE and AFTER the test execution,\n  // or we need to change dramatically the way we export those proxies (possible only in a major version bump).\n  if (projectConfig && projectConfig.testEnvironmentOptions) {\n    projectConfig.testEnvironmentOptions.globalsCleanup = 'off';\n  }\n\n  return maybeProjectConfig;\n}\n\nfunction assertSupportedVersion(actualVersion) {\n  const supportedRange = detoxPackageJson.peerDependencies.jest;\n  const minSupportedVersion = semver.minVersion(supportedRange);\n  const action = semver.lt(actualVersion, minSupportedVersion) ? 'upgrade' : 'downgrade';\n\n  if (!semver.satisfies(actualVersion, supportedRange, { includePrerelease: true })) {\n    throw new DetoxRuntimeError({\n      message: `Detected an unsupported jest@${actualVersion} version.`,\n      hint: `Please ${action} your Jest test runner to the supported range: ${supportedRange}.`\n    });\n  }\n}\n\nmodule.exports = {\n  assertSupportedVersion,\n  validateAndPatchProjectConfig,\n};\n"
  },
  {
    "path": "detox/runners/jest/testEnvironment/utils/validateAndPatchProjectConfig.test.js",
    "content": "const { assertSupportedVersion } = require('./validateAndPatchProjectConfig');\n\ndescribe('assertSupportedVersion', () => {\n  test.each([\n    ['27.2.5'],\n    ['27.2.6-prerelease.0'],\n    ['27.3.0'],\n    ['28.0.0-alpha.1'],\n    ['28.0.0'],\n    ['28.1.0'],\n    ['29.0.0-next.0'],\n  ])('should pass for %j', (version) => {\n    expect(() => assertSupportedVersion(version)).not.toThrow();\n  });\n\n  test.each([\n    ['26.0.0'],\n    ['27.2.4'],\n  ])('should throw an error for %j', (version) => {\n    expect(() => assertSupportedVersion(version)).toThrow(/unsupported jest.*version/);\n  });\n});\n"
  },
  {
    "path": "detox/runners/jest-circus/environment/index.js",
    "content": "const path = require('path');\n\nmodule.exports = require('../../migration')(\n  __filename,\n  path.join(__dirname, '../../jest/testEnvironment/index.js')\n);\n"
  },
  {
    "path": "detox/runners/jest-circus/index.js",
    "content": "module.exports = require('../migration')(__filename);\n"
  },
  {
    "path": "detox/runners/jest-circus/reporter.js",
    "content": "module.exports = require('../migration')(__filename);\n"
  },
  {
    "path": "detox/runners/migration.js",
    "content": "const path = require('path');\n\nconst chalk = require('chalk');\nconst _ = require('lodash');\n\nconst SEARCH_VALUE = ['', 'detox', 'runners', 'jest-circus', ''].join(path.sep);\nconst REPLACE_VALUE = ['', 'detox', 'runners', 'jest', ''].join(path.sep);\n\nfunction jsify(pathToFile) {\n  return 'detox/' + path\n    .relative(\n      path.join(__dirname, '..'),\n      pathToFile\n    )\n    .replace(/\\\\/g, '/')\n    .replace(/(?:\\/index)?\\.js$/, '');\n}\n\nconst redirectWithWarning = _.memoize((\n  oldPath,\n  newPath = oldPath.replace(SEARCH_VALUE, REPLACE_VALUE)\n) => {\n  redirectWithWarning._log([\n    '[DEPRECATION] Detox detected an attempt to require a module from an outdated location, please change in your project:',\n    `- ${jsify(oldPath)}`,\n    `+ ${jsify(newPath)}`,\n    '',\n  ].join('\\n'));\n\n  return require(newPath);\n});\n\n// @ts-ignore\n// istanbul ignore next\nredirectWithWarning._log = msg => process.stderr.write(chalk.yellow(msg) + '\\n');\n\nmodule.exports = redirectWithWarning;\n"
  },
  {
    "path": "detox/runners/mocha/DetoxMochaAdapter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/runners/mocha/adapter.d.ts",
    "content": "/**\n * @deprecated Mocha integration is no longer supported since Detox v20.0.0\n */\ndeclare const adapter: never;\n\nexport = adapter;\n"
  },
  {
    "path": "detox/runners/mocha/adapter.js",
    "content": "/** @deprecated */\n/** @type {never} */\nmodule.exports = require('../deprecation');\n"
  },
  {
    "path": "detox/scripts/build_framework.ios.sh",
    "content": "#!/bin/bash -e\n\nPROJECT=$1\nFRAMEWORK_OUTPUT_DIR=$2\nCONFIGURATION=Release\nPROJECT_NAME=Detox\n\n# Make sure the output directory exists\n\nrm -fr \"${FRAMEWORK_OUTPUT_DIR}\"\nmkdir -p \"${FRAMEWORK_OUTPUT_DIR}\"\n\n# Step 0. Xcode version\n\nUSE_NEW_BUILD_SYSTEM=\"YES\"\necho \"Using -UseNewBuildSystem=${USE_NEW_BUILD_SYSTEM}\"\n\n# Step 1. Build Device and Simulator versions\n\nBUILD_SIM=`xcodebuild -project \"${PROJECT}\" -scheme \"Detox\" -UseNewBuildSystem=${USE_NEW_BUILD_SYSTEM} -configuration \"${CONFIGURATION}\" -sdk iphonesimulator -destination \"generic/platform=iOS Simulator\" build -showBuildSettings  | awk -F= '/TARGET_BUILD_DIR/{x=$NF; gsub(/^[ \\t]+|[ \\t]+$/,\"\",x); print x}'`\n\necho ${BUILD_SIM}\n\nxcodebuild -project \"${PROJECT}\" -scheme \"Detox\" -UseNewBuildSystem=${USE_NEW_BUILD_SYSTEM} -configuration \"${CONFIGURATION}\" -sdk iphonesimulator -destination \"generic/platform=iOS Simulator\" build -quiet\n\n# Step 2. Copy the framework to output folder\n\ncp -fR \"${BUILD_SIM}/${PROJECT_NAME}.framework\" \"${FRAMEWORK_OUTPUT_DIR}\"/\n"
  },
  {
    "path": "detox/scripts/build_local_framework.ios.sh",
    "content": "#!/bin/bash -e\n\n# Ensure Xcode is installed or print a warning message and return.\nxcodebuild -version &>/dev/null || { echo \"WARNING: Xcode is not installed on this machine. Skipping iOS framework build phase\"; exit 0; }\n\ndetoxRootPath=\"$(dirname \"$(dirname \"$0\")\")\"\ndetoxVersion=`node -p \"require('${detoxRootPath}/package.json').version\"`\n\nsha1=`(echo \"${detoxVersion}\" && xcodebuild -version) | shasum | awk '{print $1}' #\"${2}\"`\ndetoxFrameworkDirPath=\"$HOME/Library/Detox/ios/framework/${sha1}\"\ndetoxFrameworkPath=\"${detoxFrameworkDirPath}/Detox.framework\"\n\n\nfunction prepareAndBuildFramework () {\n  if [ -d \"$detoxRootPath\"/ios ]; then\n    detoxSourcePath=\"${detoxRootPath}\"/ios\n    echo \"Dev mode, building from ${detoxSourcePath}\"\n    buildFramework \"${detoxSourcePath}\"\n  else\n    extractFramework\n  fi\n}\n\nfunction extractFramework () {\n  echo \"Extracting Detox framework...\"\n  mkdir -p \"${detoxFrameworkDirPath}\"\n  tar -xjf \"${detoxRootPath}\"/Detox-ios-framework.tbz -C \"${detoxFrameworkDirPath}\"\n}\n\nfunction buildFramework () {\n  detoxSourcePath=\"${1}\"\n  echo \"Building Detox.framework from ${detoxSourcePath} into ${detoxFrameworkDirPath}\"\n  mkdir -p \"${detoxFrameworkDirPath}\"\n  logPath=\"${detoxFrameworkDirPath}\"/detox_ios.log\n  echo \"Build log: ${logPath}\"\n  echo -n \"\" > \"${logPath}\"\n  \"${detoxRootPath}\"/scripts/build_framework.ios.sh \"${detoxSourcePath}\"/Detox.xcodeproj \"${detoxFrameworkDirPath}\" &> \"${logPath}\" || {\n    echo -e \"#################################\\nError building Detox.framework:\\n----------------------------------\\n\"\n    cat \"${logPath}\"\n    echo \"#################################\"\n    exit 1\n  }\n}\n\nfunction main () {\n  if [ -d \"${detoxFrameworkDirPath}\" ]; then\n    if [ ! -d \"${detoxFrameworkPath}\" ]; then\n      echo \"${detoxFrameworkDirPath} was found, but could not find Detox.framework inside it. This means that the Detox framework build process was interrupted.\n         deleting ${detoxFrameworkDirPath} and trying to rebuild.\"\n      rm -rf \"${detoxFrameworkDirPath}\"\n      prepareAndBuildFramework\n    else\n      echo \"Detox.framework exists, skipping...\"\n    fi\n  else\n    prepareAndBuildFramework\n  fi\n\n  echo \"Done\"\n}\n\nmain\n"
  },
  {
    "path": "detox/scripts/build_local_xcuitest.ios.sh",
    "content": "#!/bin/bash -e\n\n# Ensure Xcode is installed or print a warning message and return.\nxcodebuild -version &>/dev/null || { echo \"WARNING: Xcode is not installed on this machine. Skipping iOS xctest runner build phase\"; exit 0; }\n\ndetoxRootPath=\"$(dirname \"$(dirname \"$0\")\")\"\ndetoxVersion=`node -p \"require('${detoxRootPath}/package.json').version\"`\n\nsha1=`(echo \"${detoxVersion}\" && xcodebuild -version) | shasum | awk '{print $1}' #\"${2}\"`\ndetoxXctestRunnerDirPath=\"$HOME/Library/Detox/ios/xcuitest-runner/${sha1}\"\n\nfunction prepareAndBuildXctestRunner () {\n  if [ -d \"$detoxRootPath\"/ios ]; then\n    detoxSourcePath=\"${detoxRootPath}\"/ios\n    echo \"Dev mode, building XCUITest runner from ${detoxSourcePath}\"\n    buildXctestRunner \"${detoxSourcePath}\"\n  else\n    extractXctestRunner\n  fi\n}\n\nfunction extractXctestRunner () {\n  echo \"Extracting Detox XCUITest runner...\"\n  mkdir -p \"${detoxXctestRunnerDirPath}\"\n  tar -xjf \"${detoxRootPath}\"/Detox-ios-xcuitest.tbz -C \"${detoxXctestRunnerDirPath}\"\n}\n\nfunction buildXctestRunner () {\n  detoxSourcePath=\"${1}\"\n  echo \"Building XCUITest runner from ${detoxSourcePath} into ${detoxXctestRunnerDirPath}\"\n  mkdir -p \"${detoxXctestRunnerDirPath}\"\n  logPath=\"${detoxXctestRunnerDirPath}\"/detox_ios_xcuitest.log\n  echo \"Build log: ${logPath}\"\n  echo -n \"\" > \"${logPath}\"\n  \"${detoxRootPath}\"/scripts/build_xcuitest.ios.sh \"${detoxSourcePath}\"/DetoxXCUITestRunner/DetoxXCUITestRunner.xcodeproj \"${detoxXctestRunnerDirPath}\" &> \"${logPath}\" || {\n    echo -e \"#################################\\nError building DetoxXCUITestRunner.xctestrun:\\n----------------------------------\\n\"\n    cat \"${logPath}\"\n    echo \"#################################\"\n    exit 1\n  }\n}\n\nfunction main () {\n  if [ ! -d \"${detoxXctestRunnerDirPath}\" ]; then\n    prepareAndBuildXctestRunner\n  else\n    echo \"XCUITest-runner exists, skipping...\"\n  fi\n\n  echo \"Done\"\n}\n\nmain\n"
  },
  {
    "path": "detox/scripts/build_xcuitest.ios.sh",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nCONFIGURATION=\"Release\"\nPROJECT_NAME=\"DetoxXCUITestRunner\"\n\nprint_usage() {\n    echo \"Usage: $0 <xcodeproj_path> <xcuitest_output_dir>\"\n    exit 1\n}\n\nsetup_output_dir() {\n    local output_dir=\"$1\"\n    rm -rf \"${output_dir}\"\n    mkdir -p \"${output_dir}\"\n}\n\ncreate_temp_dir() {\n    local temp_dir\n    temp_dir=$(mktemp -d)\n    echo \"${temp_dir}\"\n}\n\nbuild_for_simulator() {\n    local xcodeproj=\"$1\"\n    local temp_dir=\"$2\"\n\n    env -i xcodebuild \\\n        -project \"${xcodeproj}\" \\\n        -scheme \"${PROJECT_NAME}\" \\\n        -UseNewBuildSystem=\"YES\" \\\n        -configuration \"${CONFIGURATION}\" \\\n        -sdk iphonesimulator \\\n        -destination 'generic/platform=iOS Simulator' \\\n        -derivedDataPath \"${temp_dir}\" \\\n        build-for-testing \\\n        -quiet\n}\n\nprocess_xctestrun() {\n    local temp_dir=\"$1\"\n    local output_dir=\"$2\"\n\n    local xctestrun_file\n    xctestrun_file=$(find \"${temp_dir}\" -name \"*.xctestrun\")\n\n    # Copy the parent directory of the .xctestrun file, which contains the .xctestrun file and its associated binaries\n    cp -r \"$(dirname \"${xctestrun_file}\")\" \"${output_dir}\"\n}\n\nmain() {\n    if [ $# -ne 2 ]; then\n        print_usage\n    fi\n\n    local xcodeproj=\"$1\"\n    local output_dir=\"$2\"\n\n    setup_output_dir \"${output_dir}\"\n    local temp_dir\n    temp_dir=$(create_temp_dir)\n\n    # Ensure cleanup happens on script exit\n    trap \"[[ -d ${temp_dir} ]] && rm -rf ${temp_dir}\" EXIT\n\n    build_for_simulator \"${xcodeproj}\" \"${temp_dir}\"\n    process_xctestrun \"${temp_dir}\" \"${output_dir}\"\n}\n\nmain \"$@\"\n"
  },
  {
    "path": "detox/scripts/pack_ios.sh",
    "content": "#!/bin/bash -e\n\nrm -rf Detox-ios-src.tbz\nrm -rf Detox-ios-framework.tbz\nrm -rf Detox-ios-xcuitest.tbz\nrm -rf build_temp\n\nfind ./ios -name Build -type d -exec rm -rf {} \\;\n\n# Package sources\ncd ios\ntar --exclude-from=.tbzignore -cjf ../Detox-ios-src.tbz .\ncd ..\n\necho \"Packaging iOS sources and prebuilt frameworks\"\n\n# Create temp build directory\nmkdir build_temp_framework\n\n# Package prebuilt framework\nscripts/build_framework.ios.sh \"ios/Detox.xcodeproj\" \"build_temp_framework\"\ncd build_temp_framework\ntar --exclude-from=../ios/.tbzignore -cjf ../Detox-ios-framework.tbz .\ncd ..\nrm -rf build_temp_framework\n\n\n# Create temp build directory\nmkdir build_temp_xcuitest\n\n# Package prebuilt XCUITest runner\nscripts/build_xcuitest.ios.sh \"ios/DetoxXCUITestRunner/DetoxXCUITestRunner.xcodeproj\" \"build_temp_xcuitest\"\ncd build_temp_xcuitest\ntar --exclude-from=../ios/.tbzignore -cjf ../Detox-ios-xcuitest.tbz .\ncd ..\nrm -rf build_temp_xcuitest\n"
  },
  {
    "path": "detox/scripts/postinstall.js",
    "content": "const { platform, env } = process;\n\nconst { patchGradleByRNVersion } = require('./updateGradle');\n\nconst isDarwin = platform === 'darwin';\nconst shouldInstallDetox = !env.DETOX_DISABLE_POSTINSTALL;\n\nif (isDarwin && shouldInstallDetox) {\n  const execFileSync = require('child_process').execFileSync;\n\n  execFileSync(`${__dirname}/build_local_framework.ios.sh`, { stdio: 'inherit' });\n  execFileSync(`${__dirname}/build_local_xcuitest.ios.sh`, { stdio: 'inherit' });\n}\n\npatchGradleByRNVersion();\n"
  },
  {
    "path": "detox/scripts/updateGradle.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst rnMinor = require('../src/utils/rn-consts/rn-consts').rnVersion.minor;\n\nfunction getGradleVersionByRNVersion() {\n  switch (rnMinor) {\n    default:\n      return '8.14.3';\n    case '79':\n    case '78':\n    case '77':\n    case '76':\n      return '8.10.2';\n    case '75':\n      return '8.8';\n    case '74':\n      return '8.6';\n    case '73':\n      return '8.3';\n    case '72':\n      return '8.0';\n    case '71':\n      return '7.6.1';\n  }\n}\n\n/**\n * Update the Gradle wrapper to the version that matches the React Native version.\n */\nfunction patchGradleByRNVersion() {\n  updateGradleWrapperSync();\n  patchSettingsGradle();\n  patchGradlePropertiesSync();\n}\n\n/**\n * By default gralde.properties has new arch enabled. Disable it by adding evn var\n */\nfunction patchGradlePropertiesSync() {\n  // Read the evn var to check if the new arch is enabled\n  let isNewArch;\n\n  if (!process.env.ENABLE_NEW_ARCH) {\n    isNewArch = true;\n  } else {\n    isNewArch = process.env.ENABLE_NEW_ARCH === 'true';\n  }\n\n  function readGradlePropertiesFile() {\n    const gradlePropertiesFile = path.join(process.cwd(), 'android', 'gradle.properties');\n    console.log(`Patching gradle.properties. File: ${gradlePropertiesFile}`);\n    const data = fs.readFileSync(gradlePropertiesFile, 'utf8');\n    return { gradlePropertiesFile, data };\n  }\n\n  function writeGradlePropertiesFile(gradlePropertiesFile, data) {\n    const updatedData = data.replace('newArchEnabled=true', 'newArchEnabled=false');\n    fs.writeFileSync(gradlePropertiesFile, updatedData, 'utf8');\n    console.log('gradle.properties patched successfully.');\n  }\n\n  if (!isNewArch) {\n    try {\n      const { gradlePropertiesFile, data } = readGradlePropertiesFile();\n      writeGradlePropertiesFile(gradlePropertiesFile, data);\n    } catch (e) {\n      console.error('Error:', e);\n    }\n  }\n}\n\n/**\n * In RN75 and above the settings.gradle file should contain the following lines. We can't wrap them in 'if' statement\n * because they should be the first line in the settings file. This patch could be safely removed after dropping support\n * for RN74.\n */\nfunction patchSettingsGradle() {\n  if (parseInt(rnMinor) >= 75) {\n    return;\n  }\n\n  const settingsGradlePath = path.join(process.cwd(), 'android', 'settings.gradle');\n  console.log(`Patching settings.gradle. File: ${settingsGradlePath}`);\n\n  try {\n    let data = fs.readFileSync(settingsGradlePath, 'utf8');\n    const blockRegex = /\\/\\/ RN75\\+_BLOCK_START[\\s\\S]*?\\/\\/ RN75\\+_BLOCK_END/g;\n\n    // Replace the block with an empty string\n    const updatedData = data.replace(blockRegex, '');\n\n    fs.writeFileSync(settingsGradlePath, updatedData, 'utf8');\n    console.log('settings.gradle patched successfully.');\n  } catch (err) {\n    console.error('Error:', err);\n  }\n}\n\n/**\n * Update the Gradle wrapper to the specified version.\n */\nfunction updateGradleWrapperSync() {\n  const newVersion = getGradleVersionByRNVersion();\n\n  const gradleWrapperPath = path.join(process.cwd(), 'android', 'gradle', 'wrapper', 'gradle-wrapper.properties');\n  console.log(`Updating Gradle wrapper to version$ {newVersion}. File: ${gradleWrapperPath}`);\n\n  try {\n    let data = fs.readFileSync(gradleWrapperPath, 'utf8');\n    let updatedData = data.replace(/distributionUrl=.+\\n/, `distributionUrl=https\\\\://services.gradle.org/distributions/gradle-${newVersion}-bin.zip\\n`);\n\n    fs.writeFileSync(gradleWrapperPath, updatedData, 'utf8');\n    console.log(`Gradle wrapper updated successfully to version ${newVersion}.`);\n  } catch (err) {\n    console.error('Error:', err);\n  }\n}\n\nmodule.exports = {\n  patchGradleByRNVersion: patchGradleByRNVersion\n};\n"
  },
  {
    "path": "detox/scripts/utils.js",
    "content": "const childProcess = require('child_process');\n\nfunction sh(cmdline, opts) {\n  const args = cmdline.split(' ');\n  const cmd = args.shift();\n  return childProcess.execFileSync(cmd, args, opts);\n}\n\nmodule.exports = {\n  sh\n};\n"
  },
  {
    "path": "detox/src/DetoxWorker.js",
    "content": "const CAF = require('caf');\nconst _ = require('lodash');\n\nconst Client = require('./client/Client');\nconst environmentFactory = require('./environmentFactory');\nconst { DetoxRuntimeErrorComposer } = require('./errors');\nconst { InvocationManager } = require('./invoke');\nconst DetoxPilot = require('./pilot/DetoxPilot');\nconst symbols = require('./realms/symbols');\nconst AsyncEmitter = require('./utils/AsyncEmitter');\nconst uuid = require('./utils/uuid');\n\nclass DetoxWorker {\n  constructor(context) {\n    this._context = context;\n    this._injectedGlobalProperties = [];\n    this._config = context[symbols.config];\n    this._runtimeErrorComposer = new DetoxRuntimeErrorComposer(this._config);\n    this._client = null;\n    this._artifactsManager = null;\n    this._eventEmitter = new AsyncEmitter({\n      events: [\n        'bootDevice',\n        'beforeShutdownDevice',\n        'shutdownDevice',\n        'beforeTerminateApp',\n        'terminateApp',\n        'beforeUninstallApp',\n        'beforeLaunchApp',\n        'launchApp',\n        'appReady',\n        'createExternalArtifact',\n      ],\n      onError: this._onEmitError.bind(this),\n    });\n\n    /** @type {DetoxInternals.RuntimeConfig['apps']} */\n    this._appsConfig = null;\n    /** @type {DetoxInternals.RuntimeConfig['artifacts']} */\n    this._artifactsConfig = null;\n    /** @type {DetoxInternals.RuntimeConfig['behavior']} */\n    this._behaviorConfig = null;\n    /** @type {DetoxInternals.RuntimeConfig['device']} */\n    this._deviceConfig = null;\n    /** @type {DetoxInternals.RuntimeConfig['session']} */\n    this._sessionConfig = null;\n\n    /** @type {string} */\n    this.id = 'worker';\n    /** @type {Detox.Device} */\n    this.device = null;\n    /** @type {Detox.ElementFacade} */\n    this.element = null;\n    /** @type {Detox.WaitForFacade} */\n    this.waitFor = null;\n    /** @type {Detox.ExpectFacade} */\n    this.expect = null;\n    /** @type {Detox.ByFacade} */\n    this.by = null;\n    /** @type {Detox.WebFacade} */\n    this.web = null;\n    /** @type {Detox.SystemFacade} */\n    this.system = null;\n    /** @type {Detox.PilotFacade} */\n    this.pilot = null;\n    /** @type {Detox.PilotFacade} */\n    this.copilot = null;\n    /** @type {Function} */\n    this.REPL = context.REPL;\n\n    this._deviceCookie = null;\n\n    this.trace = this._context.trace;\n    /** @deprecated */\n    this.traceCall = this._context.traceCall;\n\n    this._reinstallAppsOnDevice = CAF(this._reinstallAppsOnDevice.bind(this));\n    this._initToken = new CAF.cancelToken();\n\n    this._cafWrap([\n      'init',\n      'onRunDescribeStart',\n      'onTestStart',\n      'onHookFailure',\n      'onTestFnFailure',\n      'onTestDone',\n      'onRunDescribeFinish',\n    ]);\n  }\n\n  /** @this {DetoxWorker} */\n  init = function* (signal) {\n    const {\n      apps: appsConfig,\n      artifacts: artifactsConfig,\n      behavior: behaviorConfig,\n      device: deviceConfig,\n      session: sessionConfig\n    } = this._config;\n\n    this._appsConfig = appsConfig;\n    this._artifactsConfig = artifactsConfig;\n    this._behaviorConfig = behaviorConfig;\n    this._deviceConfig = deviceConfig;\n    this._sessionConfig = sessionConfig;\n    // @ts-ignore\n    this._sessionConfig.sessionId = sessionConfig.sessionId || uuid.UUID();\n    this._runtimeErrorComposer.appsConfig = this._appsConfig;\n    this._client = new Client(sessionConfig);\n    this._client.terminateApp = async () => {\n      // @ts-ignore\n      if (this.device && this.device._isAppRunning()) {\n        await this.device.terminateApp();\n      }\n    };\n    this.pilot = new DetoxPilot();\n    Object.defineProperty(this, 'copilot', {\n      get: () => {\n        console.warn('Warning: \"copilot\" is deprecated. Please use \"pilot\" instead.');\n        return this.pilot;\n      },\n      configurable: true,\n    });\n\n    yield this._client.connect();\n\n    const invocationManager = new InvocationManager(this._client);\n\n    const {\n      // @ts-ignore\n      envValidatorFactory,\n      // @ts-ignore\n      artifactsManagerFactory,\n      // @ts-ignore\n      matchersFactory,\n      // @ts-ignore\n      runtimeDeviceFactory,\n    } = environmentFactory.createFactories(deviceConfig);\n\n    const envValidator = envValidatorFactory.createValidator();\n    yield envValidator.validate();\n\n    const commonDeps = {\n      invocationManager,\n      client: this._client,\n      eventEmitter: this._eventEmitter,\n      runtimeErrorComposer: this._runtimeErrorComposer,\n    };\n\n    this._artifactsManager = artifactsManagerFactory.createArtifactsManager(this._artifactsConfig, commonDeps);\n    this._deviceCookie = yield this._context[symbols.allocateDevice](this._deviceConfig);\n\n    this.device = runtimeDeviceFactory.createRuntimeDevice(\n      this._deviceCookie,\n      commonDeps,\n      {\n        appsConfig: this._appsConfig,\n        behaviorConfig: this._behaviorConfig,\n        deviceConfig: this._deviceConfig,\n        sessionConfig,\n      });\n\n    const matchers = matchersFactory.createMatchers({\n      invocationManager,\n      runtimeDevice: this.device,\n      eventEmitter: this._eventEmitter,\n    });\n    Object.assign(this, matchers);\n\n    yield this._eventEmitter.emit('bootDevice', { deviceId: this.device.id });\n\n    if (behaviorConfig.init.exposeGlobals) {\n      const injectedGlobals = {\n        ...matchers,\n        device: this.device,\n        pilot: this.pilot,\n        REPL: this.REPL,\n        detox: this,\n      };\n\n      this._injectedGlobalProperties = Object.keys(injectedGlobals);\n      Object.assign(DetoxWorker.global, injectedGlobals);\n      Object.defineProperty(DetoxWorker.global, 'copilot', {\n        get: () => this.copilot,\n        configurable: true,\n      });\n    }\n\n    // @ts-ignore\n    yield this.device.installUtilBinaries();\n\n    if (behaviorConfig.init.reinstallApp) {\n      yield this._reinstallAppsOnDevice(signal);\n    }\n\n    const appAliases = Object.keys(this._appsConfig);\n    if (appAliases.length === 1) {\n      yield this.device.selectApp(appAliases[0]);\n    } else {\n      yield this.device.selectApp(null);\n    }\n  };\n\n  async cleanup() {\n    this._initToken.abort('CLEANUP');\n\n    for (const key of this._injectedGlobalProperties) {\n      delete DetoxWorker.global[key];\n    }\n\n    if (this._artifactsManager) {\n      await this._artifactsManager.onBeforeCleanup();\n      this._artifactsManager = null;\n    }\n\n    if (this._client) {\n      this._client.dumpPendingRequests();\n      await this._client.cleanup();\n      this._client = null;\n    }\n\n    if (this.device) {\n      // @ts-ignore\n      await this.device._cleanup();\n    }\n\n    if (this._deviceCookie) {\n      await this._context[symbols.deallocateDevice](this._deviceCookie);\n    }\n\n    this._deviceCookie = null;\n    this.device = null;\n  }\n\n  get log() {\n    return this._context.log;\n  }\n\n  onRunDescribeStart = function* (_signal, ...args) {\n    yield this._artifactsManager.onRunDescribeStart(...args);\n  };\n\n  onTestStart = function* (_signal, testSummary){\n    if (this.pilot.isInitialized()) {\n      this.pilot.start();\n    }\n\n    this._validateTestSummary('beforeEach', testSummary);\n\n    yield this._dumpUnhandledErrorsIfAny({\n      pendingRequests: false,\n      testName: testSummary.fullName,\n    });\n\n    yield this._artifactsManager.onTestStart(testSummary);\n  };\n\n  onHookFailure = function* (_signal, ...args) {\n    yield this._artifactsManager.onHookFailure(...args);\n  };\n\n  onTestFnFailure = function* (_signal, ...args) {\n    yield this._artifactsManager.onTestFnFailure(...args);\n  };\n\n  onTestDone = function* (_signal, testSummary) {\n    this._validateTestSummary('afterEach', testSummary);\n\n    yield this._artifactsManager.onTestDone(testSummary);\n\n    yield this._dumpUnhandledErrorsIfAny({\n      pendingRequests: testSummary.timedOut,\n      testName: testSummary.fullName,\n    });\n\n    if (this.pilot.isInitialized()) {\n      this.pilot.end(testSummary.status === 'passed');\n    }\n  };\n\n  onRunDescribeFinish = function* (_signal, ...args) {\n    yield this._artifactsManager.onRunDescribeFinish(...args);\n  };\n\n  *_reinstallAppsOnDevice(_signal) {\n    const appNames = _(this._appsConfig)\n      .map((config, key) => [key, `${config.binaryPath}:${config.testBinaryPath}`])\n      .uniqBy(1)\n      .map(0)\n      .value();\n\n    for (const appName of appNames) {\n      yield this.device.selectApp(appName);\n      yield this.device.uninstallApp();\n    }\n\n    for (const appName of appNames) {\n      yield this.device.selectApp(appName);\n      yield this.device.installApp();\n    }\n  }\n\n  _validateTestSummary(methodName, testSummary) {\n    if (!_.isPlainObject(testSummary)) {\n      throw this._runtimeErrorComposer.invalidTestSummary(methodName, testSummary);\n    }\n\n    switch (testSummary.status) {\n      case 'running':\n      case 'passed':\n      case 'failed':\n        break;\n      default:\n        throw this._runtimeErrorComposer.invalidTestSummaryStatus(methodName, testSummary);\n    }\n  }\n\n  async _dumpUnhandledErrorsIfAny({ testName, pendingRequests }) {\n    if (pendingRequests) {\n      this._client.dumpPendingRequests({ testName });\n    }\n  }\n\n  _onEmitError({ error, eventName, eventObj }) {\n    this.log.error(\n      { event: 'EMIT_ERROR', fn: eventName },\n      `Caught an exception in: emitter.emit(\"${eventName}\", ${JSON.stringify(eventObj)})\\n\\n`,\n      error\n    );\n  }\n\n  _cafWrap(methodNames) {\n    for (const methodName of methodNames) {\n      const cafMethod = CAF(this[methodName].bind(this));\n      this[methodName] = async (...args) => {\n        try {\n          await cafMethod(this._initToken.signal, ...args);\n        } catch (e) {\n          if (e !== 'CLEANUP') {\n            throw e;\n          }\n        }\n\n        return this;\n      };\n    }\n  }\n\n}\n\n/**\n * @type {NodeJS.Global | {}}\n */\nDetoxWorker.global = global;\n\nmodule.exports = DetoxWorker;\n"
  },
  {
    "path": "detox/src/DetoxWorker.test.js",
    "content": "// @ts-nocheck\nconst testSummaries = require('./artifacts/__mocks__/testSummaries.mock');\nconst configuration = require('./configuration');\nconst DetoxPilot = require('./pilot/DetoxPilot');\nconst Deferred = require('./utils/Deferred');\njest.mock('@wix-pilot/detox', () => ({\n  DetoxFrameworkDriver: jest.fn(),\n}));\n\njest.mock('./utils/logger');\njest.mock('./client/Client');\njest.mock('./utils/AsyncEmitter');\njest.mock('./invoke');\njest.mock('./utils/wrapWithStackTraceCutter');\njest.mock('./environmentFactory');\n\n\njest.mock('./pilot/DetoxPilot', () => {\n  return jest.fn().mockImplementation(() => {\n    return {\n      init: jest.fn(),\n      start: jest.fn(),\n      perform: jest.fn(),\n      autopilot: jest.fn(),\n      extendAPICatalog: jest.fn(),\n      end: jest.fn(),\n      isInitialized: jest.fn().mockReturnValue(false),\n    };\n  });\n});\n\ndescribe('DetoxWorker', () => {\n  const fakeCookie = {\n    chocolate: 'yum',\n  };\n\n  const client = () => Client.mock.instances[0];\n  const invocationManager = () => invoke.InvocationManager.mock.instances[0];\n  const eventEmitter = () => AsyncEmitter.mock.instances[0];\n  eventEmitter.errorCallback = () => AsyncEmitter.mock.calls[0][0].onError;\n\n  let symbols;\n  let detoxConfig;\n  let detoxContext;\n\n  let envValidatorFactory;\n  let artifactsManagerFactory;\n  let deviceAllocatorFactory;\n  let matchersFactory;\n  let runtimeDeviceFactory;\n  let artifactsManager;\n\n  let logger;\n  let Client;\n  let AsyncEmitter;\n  let invoke;\n  let envValidator;\n  let deviceAllocator;\n  let runtimeDevice;\n  let Detox;\n  let detox;\n\n  beforeEach(() => {\n    mockEnvironmentFactories();\n\n    const environmentFactory = require('./environmentFactory');\n    environmentFactory.createFactories.mockReturnValue({\n      envValidatorFactory,\n      deviceAllocatorFactory,\n      artifactsManagerFactory,\n      matchersFactory,\n      runtimeDeviceFactory,\n    });\n  });\n\n  beforeEach(async () => {\n    detoxConfig = await configuration.composeDetoxConfig({\n      override: {\n        configurations: {\n          test: {\n            device: {\n              type: 'fake.device',\n              device: 'a device',\n            },\n            app: {\n              type: 'fake.app',\n              binaryPath: '/tmp/fake/path',\n            },\n          },\n        },\n      },\n    });\n\n    logger = require('./utils/logger');\n    invoke = require('./invoke');\n    Client = require('./client/Client');\n    AsyncEmitter = require('./utils/AsyncEmitter');\n\n    Detox = require('./DetoxWorker');\n    symbols = require('./realms/symbols');\n    detoxContext = {\n      log: logger,\n      [symbols.config]: detoxConfig,\n      [symbols.allocateDevice]: jest.fn().mockResolvedValue(fakeCookie),\n      [symbols.deallocateDevice]: jest.fn(),\n    };\n\n  });\n\n  describe('when DetoxWorker#init() is called', () => {\n    let mockGlobalMatcher;\n\n    const init = async () => {\n      detox = await new Detox(detoxContext).init();\n    };\n\n    beforeEach(() => {\n      mockGlobalMatcher = jest.fn();\n      matchersFactory.createMatchers.mockReturnValue({\n        globalMatcher: mockGlobalMatcher,\n      });\n    });\n\n    afterEach(() => {\n      // cleanup spilled globals after detox.init()\n      delete global.device;\n      delete global.globalMatcher;\n    });\n\n    describe('', () => {\n      beforeEach(init);\n\n      it('should create a new Client', () =>\n        expect(Client).toHaveBeenCalled());\n\n      it('should create an invocation manager', () =>\n        expect(invoke.InvocationManager).toHaveBeenCalledWith(client()));\n\n      it('should connect a client to the server', () =>\n        expect(client().connect).toHaveBeenCalled());\n\n      it('should inject terminateApp method into client', async () => {\n        await client().terminateApp();\n        expect(runtimeDevice._isAppRunning).toHaveBeenCalled();\n        expect(runtimeDevice.terminateApp).not.toHaveBeenCalled();\n\n        runtimeDevice._isAppRunning.mockReturnValue(true);\n        await client().terminateApp();\n        expect(runtimeDevice.terminateApp).toHaveBeenCalled();\n      });\n\n      it('should pre-validate the using the environment validator', () =>\n        expect(envValidator.validate).toHaveBeenCalled());\n\n      it('should allocate a device', () => {\n        expect(detoxContext[symbols.allocateDevice]).toHaveBeenCalledWith(expect.objectContaining({\n          type: 'fake.device',\n        }));\n      });\n\n      it('should create a runtime-device based on the allocation result (cookie)', () =>\n        expect(runtimeDeviceFactory.createRuntimeDevice).toHaveBeenCalledWith(\n          fakeCookie,\n          {\n            invocationManager: invocationManager(),\n            eventEmitter: eventEmitter(),\n            client: client(),\n            runtimeErrorComposer: expect.any(Object),\n          },\n          {\n            appsConfig: detoxConfig.apps,\n            behaviorConfig: detoxConfig.behavior,\n            deviceConfig: detoxConfig.device,\n            sessionConfig: expect.any(Object),\n          },\n        ));\n\n      it('should create matchers', () => {\n        expect(matchersFactory.createMatchers).toHaveBeenCalledWith({\n          invocationManager: invocationManager(),\n          eventEmitter: eventEmitter(),\n          runtimeDevice,\n        });\n      });\n\n      it('should take the matchers from the matchers-registry to Detox', () =>\n        expect(detox.globalMatcher).toBe(mockGlobalMatcher));\n\n      it('should take device to Detox', () =>\n        expect(detox.device).toBe(runtimeDevice));\n\n      it('should expose device to global', () =>\n        expect(global.device).toBe(runtimeDevice));\n\n      it('should expose matchers to global', () =>\n        expect(global.globalMatcher).toBe(mockGlobalMatcher));\n\n      it('should create artifacts manager', () =>\n        expect(artifactsManagerFactory.createArtifactsManager).toHaveBeenCalledWith(detoxConfig.artifacts, expect.objectContaining({\n          client: client(),\n          eventEmitter: eventEmitter(),\n        })));\n\n      it('should select and reinstall the app', () => {\n        expect(runtimeDevice.selectApp).toHaveBeenCalledWith('default');\n        expect(runtimeDevice.uninstallApp).toHaveBeenCalled();\n        expect(runtimeDevice.installApp).toHaveBeenCalled();\n      });\n\n      it('should not unselect the app if it is the only one', () => {\n        expect(runtimeDevice.selectApp).not.toHaveBeenCalledWith(null);\n      });\n\n      it('should return itself', async () =>\n        expect(await detox.init()).toBeInstanceOf(Detox));\n    });\n\n    describe('with multiple apps', () => {\n      beforeEach(() => {\n        detoxConfig.apps['extraApp'] = {\n          type: 'ios.app',\n          binaryPath: 'path/to/app',\n        };\n\n        detoxConfig.apps['extraAppWithAnotherArguments'] = {\n          type: 'ios.app',\n          binaryPath: 'path/to/app',\n          launchArgs: {\n            overrideArg: 2,\n          },\n        };\n      });\n\n      beforeEach(init);\n\n      it('should install only apps with unique binary paths, and deselect app on device', () => {\n        expect(runtimeDevice.uninstallApp).toHaveBeenCalledTimes(2);\n        expect(runtimeDevice.installApp).toHaveBeenCalledTimes(2);\n\n        expect(runtimeDevice.selectApp).toHaveBeenCalledTimes(5);\n        expect(runtimeDevice.selectApp.mock.calls[0]).toEqual(['default']);\n        expect(runtimeDevice.selectApp.mock.calls[1]).toEqual(['extraApp']);\n        expect(runtimeDevice.selectApp.mock.calls[2]).toEqual(['default']);\n        expect(runtimeDevice.selectApp.mock.calls[3]).toEqual(['extraApp']);\n        expect(runtimeDevice.selectApp.mock.calls[4]).toEqual([null]);\n      });\n    });\n\n    describe('with behavior.init.exposeGlobals = false', () => {\n      beforeEach(() => {\n        detoxConfig.behavior.init.exposeGlobals = false;\n      });\n\n      beforeEach(init);\n\n      it('should take the matchers from the matchers-registry to Detox', () =>\n        expect(detox.globalMatcher).toBe(mockGlobalMatcher));\n\n      it('should take device to Detox', () => {\n        expect(detox.device).toBe(runtimeDevice);\n      });\n\n      it('should not expose device to globals', () =>\n        expect(global.device).toBe(undefined));\n\n      it('should not expose matchers to globals', () =>\n        expect(global.globalMatcher).toBe(undefined));\n    });\n\n    describe('with behavior.init.reinstallApp = false', () => {\n      beforeEach(() => {\n        detoxConfig.behavior.init.reinstallApp = false;\n      });\n\n      beforeEach(init);\n\n      it('should not reinstall the app', () => {\n        expect(runtimeDevice.uninstallApp).not.toHaveBeenCalled();\n        expect(runtimeDevice.installApp).not.toHaveBeenCalled();\n      });\n    });\n\n    describe('and it gets an error event', () => {\n      beforeEach(init);\n\n      it(`should log EMIT_ERROR if the internal emitter throws an error`, async () => {\n        const emitterErrorCallback = eventEmitter.errorCallback();\n\n        const error = new Error();\n        emitterErrorCallback({ error, eventName: 'mockEvent' });\n\n        expect(logger.error).toHaveBeenCalledWith(\n          { event: 'EMIT_ERROR', fn: 'mockEvent' },\n          expect.stringMatching(/^Caught an exception.*mockEvent/),\n          error\n        );\n      });\n    });\n\n    describe('and environment validation fails', () => {\n      it('should fail with an error', async () => {\n        envValidator.validate.mockRejectedValue(new Error('Mock validation failure'));\n        await expect(init).rejects.toThrow('Mock validation failure');\n      });\n    });\n\n    describe('and allocation fails', () => {\n      it('should fail with an error', async () => {\n        detoxContext[symbols.allocateDevice].mockRejectedValue(new Error('Mock validation failure'));\n        await expect(init).rejects.toThrow('Mock validation failure');\n      });\n    });\n\n    describe('pilot initialization', () => {\n      beforeEach(async () => {\n        await init();\n      });\n\n\n      it('should assign the DetoxPilot instance to the pilot property', () => {\n        expect(detox.pilot).toBeDefined();\n\n        const detoxPilot = new DetoxPilot();\n        expect(typeof detox.pilot).toBe(typeof detoxPilot);\n      });\n\n      it('should not initialize the pilot', () => {\n        expect(detox.pilot.init).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('when DetoxWorker#@onTestStart() is called', () => {\n    beforeEach(async () => {\n      detox = await new Detox(detoxContext).init();\n    });\n\n    describe('with an invalid test summary', () => {\n      it('should validate test summary object', async () => {\n        await expect(detox.onTestStart('Test')).rejects.toThrow(\n          /Invalid test summary was passed/\n        );\n      });\n\n      it('should validate test summary status', async () => {\n        await expect(detox.onTestStart({\n          ...testSummaries.running(),\n          status: undefined,\n        })).rejects.toThrow(/Invalid test summary status/);\n      });\n    });\n\n    describe('with a valid test summary', () => {\n      beforeEach(() => {\n        detox.onTestStart(testSummaries.running());\n      });\n\n      it('should notify artifacts manager about \"testStart', () =>\n        expect(artifactsManager.onTestStart).toHaveBeenCalledWith(testSummaries.running()));\n\n      it('should not start pilot if pilot init was not called', async () => {\n        try {\n          await detox.onTestStart('Test');\n        } catch {}\n\n        expect(detox.pilot.start).not.toHaveBeenCalled();\n      });\n\n      it('should start pilot if pilot init was called', async () => {\n        detox.pilot.isInitialized = () => true;\n\n        try {\n          await detox.onTestStart('Test');\n        } catch {}\n\n        expect(detox.pilot.start).toHaveBeenCalled();\n      });\n\n      it('should not relaunch app', async () => {\n        expect(runtimeDevice.launchApp).not.toHaveBeenCalled();\n      });\n\n      it('should not dump pending network requests', async () => {\n        expect(client().dumpPendingRequests).not.toHaveBeenCalled();\n      });\n\n    });\n  });\n\n  describe('when DetoxWorker#@onTestDone() is called', () => {\n    beforeEach(async () => {\n      detox = await new Detox(detoxContext).init();\n      await detox.onTestStart(testSummaries.running());\n    });\n\n    it('should validate non-object test summary', () =>\n      expect(detox.onTestDone).rejects.toThrow(/Invalid test summary was passed/));\n\n    it('should validate against invalid test summary status', () =>\n      expect(detox.onTestDone({})).rejects.toThrow(/Invalid test summary status/));\n\n    describe('with a passing test summary', () => {\n      beforeEach(() => detox.onTestDone(testSummaries.passed()));\n\n      it('should notify artifacts manager about \"testDone\"', () =>\n        expect(artifactsManager.onTestDone).toHaveBeenCalledWith(testSummaries.passed()));\n\n      it('should not end pilot if pilot init was not called', async () => {\n        expect(detox.pilot.end).not.toHaveBeenCalled();\n      });\n    });\n\n    describe('with a failed test summary (due to failed asseration)', () => {\n      beforeEach(() => detox.onTestDone(testSummaries.failed()));\n\n      it('should not dump pending network requests', () =>\n        expect(client().dumpPendingRequests).not.toHaveBeenCalled());\n    });\n\n    describe('with a failed test summary (due to a timeout)', () => {\n      beforeEach(() => detox.onTestDone(testSummaries.timedOut()));\n\n      it('should dump pending network requests', () =>\n        expect(client().dumpPendingRequests).toHaveBeenCalled());\n    });\n\n    it('should end pilot with cache enabled if test has passed', async () => {\n      detox.pilot.isInitialized = () => true;\n\n      await detox.onTestDone(testSummaries.passed());\n\n      expect(detox.pilot.end).toHaveBeenCalledWith(true);\n    });\n\n    it('should end pilot without cache if test has failed', async () => {\n      detox.pilot.isInitialized = () => true;\n\n      await detox.onTestDone(testSummaries.failed());\n\n      expect(detox.pilot.end).toHaveBeenCalledWith(false);\n    });\n  });\n\n  describe('when DetoxWorker#cleanup() is called', () => {\n    let deferred;\n    let initPromise;\n\n    const startInit = () => {\n      detox = new Detox(detoxContext);\n      initPromise = detox.init();\n    };\n\n    beforeEach(() => {\n      deferred = new Deferred();\n    });\n\n    describe('before detox.init()', () => {\n      describe('has been called', () => {\n        it(`should not throw`, async () => {\n          await expect(new Detox(detoxContext).cleanup()).resolves.not.toThrow();\n        });\n\n        it(`should not try to create a Websocket client`, async () => {\n          detox = new Detox(detoxContext);\n          await expect(Promise.all([detox.cleanup(), detox.init()])).resolves.not.toThrow();\n          await expect(Client).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('connects WS client', () => {\n        beforeEach(() => Client.setInfiniteConnect());\n        beforeEach(startInit);\n\n        it(`should stop the execution and skip creation of the invocation manager`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          await expect(initPromise).resolves.not.toThrow();\n          await expect(invocationManager()).not.toBeDefined();\n        });\n      });\n\n      describe('validates the config', () => {\n        beforeEach(() => {\n          envValidator.validate.mockReturnValue(deferred.promise);\n        });\n\n        beforeEach(startInit);\n\n        it(`should stop the execution and skip allocating the device`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          deferred.resolve();\n          await expect(initPromise).resolves.toBe(detox);\n          await expect(deviceAllocator.allocate).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('allocates the device', () => {\n        beforeEach(() => {\n          detoxContext[symbols.allocateDevice].mockReturnValue(deferred.promise);\n        });\n\n        beforeEach(startInit);\n\n        it(`should stop the execution and skip uninstall the app`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          deferred.resolve();\n          await expect(initPromise).resolves.toBe(detox);\n          await expect(runtimeDevice.installUtilBinaries).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('before util binaries have been installed', () => {\n        beforeEach(() => {\n          runtimeDevice.installUtilBinaries.mockReturnValue(deferred.promise);\n        });\n\n        beforeEach(startInit);\n\n        it(`should stop the execution and skip uninstalling the app`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          deferred.resolve();\n          await expect(initPromise).resolves.toBe(detox);\n          await expect(runtimeDevice.uninstallApp).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('before app has been uninstalled', () => {\n        beforeEach(() => {\n          runtimeDevice.uninstallApp.mockReturnValue(deferred.promise);\n        });\n\n        beforeEach(startInit);\n\n        it(`should stop the execution and skip installing the app`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          deferred.resolve();\n          await expect(initPromise).resolves.not.toThrow();\n          await expect(runtimeDevice.installApp).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('before app has been installed', () => {\n        beforeEach(() => {\n          runtimeDevice.installApp.mockReturnValue(deferred.promise);\n        });\n\n        beforeEach(startInit);\n\n        it(`should not throw, but should reject detox.init() promise`, async () => {\n          await expect(detox.cleanup()).resolves.not.toThrow();\n          deferred.resolve();\n          await expect(initPromise).resolves.not.toThrow();\n        });\n      });\n    });\n\n    describe('after detox.init()', () => {\n      beforeEach(async () => {\n        detox = new Detox(detoxContext);\n        await detox.init();\n      });\n\n      describe('if the device has not been allocated', () => {\n        beforeEach(async () => {\n          await detox.cleanup();\n        });\n\n        it(`should omit calling runtimeDevice._cleanup()`, async () => {\n          await detox.cleanup();\n          expect(runtimeDevice._cleanup).toHaveBeenCalledTimes(1);\n        });\n      });\n\n      describe('if the device has been allocated', function() {\n        beforeEach(async () => {\n          await detox.cleanup();\n        });\n\n        it(`should call runtimeDevice._cleanup()`, () =>\n          expect(runtimeDevice._cleanup).toHaveBeenCalled());\n\n        it(`should free the device`, () =>\n          expect(detoxContext[symbols.deallocateDevice]).toHaveBeenCalledWith(fakeCookie));\n\n        it(`should trigger artifactsManager.onBeforeCleanup()`, () =>\n          expect(artifactsManager.onBeforeCleanup).toHaveBeenCalled());\n\n        it(`should dump pending network requests`, () =>\n          expect(client().dumpPendingRequests).toHaveBeenCalled());\n\n        it(`should clean up the exposed globals`, () =>\n          expect(global).not.toHaveProperty('device'));\n      });\n    });\n\n    describe('when behavior.init.exposeGlobals = false', () => {\n      beforeEach(async () => {\n        detoxConfig.behavior.init.exposeGlobals = false;\n        detox = await new Detox(detoxContext).init();\n      });\n\n      it(`should not clean up the existing global properties`, async () => {\n        global.device = 'foo';\n        await detox.cleanup();\n        expect(global.device).toBe('foo');\n      });\n    });\n  });\n\n  describe.each([\n    ['onRunDescribeStart', { name: 'testSuiteName' }],\n    ['onTestStart', testSummaries.running()],\n    ['onHookFailure', { error: new Error() }],\n    ['onTestFnFailure', { error: new Error() }],\n    ['onTestDone', testSummaries.passed()],\n    ['onRunDescribeFinish', { name: 'testSuiteName' }],\n  ])('when DetoxWorker#@%s(%j) is called', (method, arg) => {\n    beforeEach(async () => {\n      detox = await new Detox(detoxContext).init();\n    });\n\n    it(`should pass it through to artifactsManager.${method}()`, async () => {\n      await detox[method](arg);\n      expect(artifactsManager[method]).toHaveBeenCalledWith(arg);\n    });\n  });\n\n  function mockEnvironmentFactories() {\n    const EnvValidator = jest.createMockFromModule('./devices/validation/EnvironmentValidatorBase');\n    const EnvValidatorFactory = jest.createMockFromModule('./devices/validation/factories').External;\n    envValidator = new EnvValidator();\n    envValidatorFactory = new EnvValidatorFactory();\n    envValidatorFactory.createValidator.mockReturnValue(envValidator);\n\n    const ArtifactsManager = jest.createMockFromModule('./artifacts/ArtifactsManager');\n    const ArtifactsManagerFactory = jest.createMockFromModule('./artifacts/factories').External;\n    artifactsManager = new ArtifactsManager();\n    artifactsManagerFactory = new ArtifactsManagerFactory();\n    artifactsManagerFactory.createArtifactsManager.mockReturnValue(artifactsManager);\n\n    const MatchersFactory = jest.createMockFromModule('./matchers/factories/index').External;\n    matchersFactory = new MatchersFactory();\n\n    const DeviceAllocator = jest.createMockFromModule('./devices/allocation/DeviceAllocator');\n    const DeviceAllocatorFactory = jest.createMockFromModule('./devices/allocation/factories').External;\n    deviceAllocator = new DeviceAllocator();\n    deviceAllocatorFactory = new DeviceAllocatorFactory();\n    deviceAllocatorFactory.createDeviceAllocator.mockReturnValue(deviceAllocator);\n    deviceAllocator.allocate.mockResolvedValue(fakeCookie);\n\n    const RuntimeDevice = jest.createMockFromModule('./devices/runtime/RuntimeDevice');\n    const RuntimeDeviceFactory = jest.createMockFromModule('./devices/runtime/factories').External;\n    runtimeDevice = new RuntimeDevice();\n    runtimeDeviceFactory = new RuntimeDeviceFactory();\n    runtimeDeviceFactory.createRuntimeDevice.mockReturnValue(runtimeDevice);\n  }\n});\n"
  },
  {
    "path": "detox/src/__mocks__/DetoxWorker.js",
    "content": "class FakeDetoxWorker {\n  static mock = {\n    instances: [],\n  };\n\n  constructor() {\n    this.init = jest.fn();\n    this.cleanup = jest.fn();\n\n    // Jest-mimicking hack\n    FakeDetoxWorker.mock.instances.push(this);\n  }\n}\n\nmodule.exports = FakeDetoxWorker;\n"
  },
  {
    "path": "detox/src/android/AndroidExpect.js",
    "content": "// @ts-nocheck\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nconst { NativeElement } = require('./core/NativeElement');\nconst { NativeExpectElement } = require('./core/NativeExpect');\nconst { NativeMatcher } = require('./core/NativeMatcher');\nconst { NativeWaitForElement } = require('./core/NativeWaitFor');\nconst { WebElement, WebViewElement } = require('./core/WebElement');\nconst { WebExpectElement } = require('./core/WebExpect');\nconst matchers = require('./matchers');\n\nclass AndroidExpect {\n  constructor({ invocationManager, device, emitter }) {\n    this._device = device;\n    this._emitter = emitter;\n    this._invocationManager = invocationManager;\n\n    this.by = matchers;\n    this.element = this.element.bind(this);\n    this.expect = this.expect.bind(this);\n    this.waitFor = this.waitFor.bind(this);\n    this.web = this.web.bind(this);\n    this.web.element = (...args) => this.web().element(...args);\n    this.system = { element: (...args) => this.systemElement(...args) };\n  }\n\n  element(matcher) {\n    if (matcher instanceof NativeMatcher) {\n      return new NativeElement(this._invocationManager, this._emitter, matcher);\n    }\n\n    throw new DetoxRuntimeError(`element() argument is invalid, expected a native matcher, but got ${typeof element}`);\n  }\n\n  // Matcher can be null only if there is only one webview on the hierarchy tree.\n  web(matcher) {\n    if (matcher == null || matcher instanceof NativeMatcher) {\n      return new WebViewElement({\n        device: this._device,\n        emitter: this._emitter,\n        invocationManager: this._invocationManager,\n        matcher,\n      });\n    }\n\n    throw new DetoxRuntimeError(`web() argument is invalid, expected a native matcher, but got ${typeof element}`);\n  }\n\n  systemElement(_matcher) {\n    throw new DetoxRuntimeError('System interactions are not supported on Android, use UiDevice APIs directly instead');\n  }\n\n  expect(element) {\n    if (element instanceof WebElement) return new WebExpectElement(this._invocationManager, element);\n    if (element instanceof NativeElement) return new NativeExpectElement(this._invocationManager, element);\n    throw new DetoxRuntimeError(`expect() argument is invalid, expected a native or web matcher, but got ${typeof element}`);\n  }\n\n  waitFor(element) {\n    if (element instanceof NativeElement) return new NativeWaitForElement(this._invocationManager, element);\n    throw new DetoxRuntimeError(`waitFor() argument is invalid, got ${typeof element}`);\n  }\n}\n\nmodule.exports = AndroidExpect;\n"
  },
  {
    "path": "detox/src/android/AndroidExpect.test.js",
    "content": "// @ts-nocheck\n\ndescribe('AndroidExpect', () => {\n  let e;\n\n  let mockExecutor;\n  let emitter;\n  let device;\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    jest.mock('../utils/tempfile');\n    jest.mock('fs-extra');\n\n    mockExecutor = new MockExecutor();\n\n    const Emitter = jest.createMockFromModule('../utils/AsyncEmitter');\n    emitter = new Emitter();\n\n    device = {\n      _typeText: jest.fn(),\n    };\n\n    const AndroidExpect = require('./AndroidExpect');\n    e = new AndroidExpect({\n      invocationManager: mockExecutor,\n      device,\n      emitter,\n    });\n  });\n\n  describe('native', () => {\n    it(`element by accessibilityLabel`, async () => {\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible(35);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeNotVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toBeVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toExist();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotExist();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toExist();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveText('text');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveText('text');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveText('text');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveText(/text/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveText(/text/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveText(/text/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveLabel('label');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveLabel('label');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveLabel('label');\n      await e.expect(e.element(e.by.accessibilityLabel(/test/))).toHaveLabel(/label/);\n      await e.expect(e.element(e.by.accessibilityLabel(/test/))).toNotHaveLabel(/label/);\n      await e.expect(e.element(e.by.accessibilityLabel(/test/))).not.toHaveLabel(/label/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveId('id');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveId('id');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveId('id');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveId(/id/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveId(/id/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveId(/id/);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveValue('value');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveValue('value');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveValue('value');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveToggleValue(true);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveToggleValue(true);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeFocused();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeNotFocused();\n    });\n\n    it(`element by label (for backwards compat)`, async () => {\n      await e.expect(e.element(e.by.label('test'))).toBeVisible();\n      await e.expect(e.element(e.by.label('test'))).toBeVisible(35);\n      await e.expect(e.element(e.by.label('test'))).toBeNotVisible();\n      await e.expect(e.element(e.by.label('test'))).toExist();\n      await e.expect(e.element(e.by.label('test'))).toNotExist();\n      await e.expect(e.element(e.by.label('test'))).toHaveText('text');\n      await e.expect(e.element(e.by.label('test'))).toHaveLabel('label');\n      await e.expect(e.element(e.by.label('test'))).toHaveId('id');\n      await e.expect(e.element(e.by.label('test'))).toHaveValue('value');\n      await e.expect(e.element(e.by.label('test'))).toHaveToggleValue(false);\n      await e.expect(e.element(e.by.label('test'))).not.toHaveToggleValue(false);\n      await e.expect(e.element(e.by.label('test'))).toBeFocused();\n    });\n\n    it(`element by id`, async () => {\n      await e.expect(e.element(e.by.id('test'))).toBeVisible();\n    });\n\n    it(`element by type`, async () => {\n      await e.expect(e.element(e.by.type('test'))).toBeVisible();\n    });\n\n    it(`element by traits`, async () => {\n      await e.expect(e.element(e.by.traits(['button', 'link', 'header', 'search']))).toBeVisible();\n      await e.expect(e.element(e.by.traits(['image', 'selected', 'plays', 'key']))).toBeNotVisible();\n      await e.expect(e.element(e.by.traits(['text', 'summary', 'disabled', 'frequentUpdates']))).toBeNotVisible();\n      await e.expect(e.element(e.by.traits(['startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn']))).toBeNotVisible();\n    });\n\n    it(`matcher helpers`, async () => {\n      await e.expect(e.element(e.by.id('test').withAncestor(e.by.id('ancestor')))).toBeVisible();\n      await e.expect(e.element(e.by.id('test').withDescendant(e.by.id('descendant')))).toBeVisible();\n      await e.expect(e.element(e.by.id('test').and(e.by.type('type')))).toBeVisible();\n      await e.expect(e.element(e.by.id('test'))).not.toBeVisible();\n      await e.expect(e.element(e.by.id('test').or(e.by.id('test2')))).toBeVisible();\n    });\n\n    test.each([\n      ['withAncestor'],\n      ['withDescendant'],\n      ['and'],\n    ])(`matcher immutability: %s`, async (combineMethodName) => {\n      const base = e.by.id('test');\n      const modifier = e.by.id('ancestor');\n\n      expect(base[combineMethodName](modifier)).not.toBe(base);\n      expect(base).toEqual(e.by.id('test'));\n      expect(modifier).toEqual(e.by.id('ancestor'));\n    });\n\n    it(`should throw for invalid toBeVisible parameters`, async () => {\n      const stubMatcher = e.element(e.by.label('test'));\n      const expectedErrorMsg = 'must be an integer between 1 and 100';\n\n      await expect(() => e.expect(stubMatcher).toBeVisible(0)).rejects.toThrow(expectedErrorMsg);\n      await expect(() => e.expect(stubMatcher).not.toBeVisible(0)).rejects.toThrow(expectedErrorMsg);\n      await expect(() => e.expect(stubMatcher).toBeVisible(101)).rejects.toThrow(expectedErrorMsg);\n      await expect(() => e.expect(stubMatcher).not.toBeVisible(101)).rejects.toThrow(expectedErrorMsg);\n\n      expect(() => e.waitFor(stubMatcher).toBeVisible(0)).toThrow(expectedErrorMsg);\n      expect(() => e.waitFor(stubMatcher).toBeVisible(101)).toThrow(expectedErrorMsg);\n    });\n\n    it(`expect with wrong parameters should throw`, async () => {\n      expect(() => e.expect('notAnElement')).toThrow();\n      expect(() => e.expect(e.element('notAMatcher'))).toThrow();\n    });\n\n    it(`matchers with wrong parameters should throw`, async () => {\n      expect(() => e.by.label(5)).toThrow();\n      expect(() => e.by.accessibilityLabel(5)).toThrow();\n      expect(() => e.by.id(5)).toThrow();\n      expect(() => e.by.type(0)).toThrow();\n      expect(() => e.by.traits(1)).toThrow();\n      expect(() => e.by.value(0)).toThrow();\n      expect(() => e.by.text(0)).toThrow();\n\n      const expectedErrorMsg = 'Expected a matcher, got: \\'notAMatcher\\'';\n      expect(() => e.element(e.by.id('test').withAncestor('notAMatcher'))).toThrow(expectedErrorMsg);\n      expect(() => e.element(e.by.id('test').withDescendant('notAMatcher'))).toThrow(expectedErrorMsg);\n      expect(() => e.element(e.by.id('test').and('notAMatcher'))).toThrow(expectedErrorMsg);\n      expect(() => e.element(e.by.id('test').or('notAMatcher'))).toThrow(expectedErrorMsg);\n    });\n\n    it(`waitFor (element)`, async () => {\n      await e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).not.toExist().withTimeout(0);\n\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible(35);\n      await e.waitFor(e.element(e.by.id('id'))).toBeNotVisible();\n      await e.waitFor(e.element(e.by.id('id'))).not.toBeVisible();\n\n      await e.waitFor(e.element(e.by.id('id'))).toExist();\n      await e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toNotExist().withTimeout(0);\n\n      await e.waitFor(e.element(e.by.id('id'))).toHaveText('text');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveText('value');\n      await e.waitFor(e.element(e.by.id('id'))).not.toHaveText('text');\n\n      await e.waitFor(e.element(e.by.id('id'))).toHaveLabel('text');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveLabel('text');\n      await e.waitFor(e.element(e.by.id('id'))).not.toHaveLabel('text');\n\n      await e.waitFor(e.element(e.by.id('id'))).toHaveId('id');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveId('id');\n      await e.waitFor(e.element(e.by.id('id'))).not.toHaveId('id');\n\n      await e.waitFor(e.element(e.by.id('id'))).toHaveValue('value');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveValue('value');\n      await e.waitFor(e.element(e.by.id('id'))).not.toHaveValue('value');\n\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50, 'down');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50);\n\n      await e.waitFor(e.element(e.by.id('id'))).toBeFocused().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeNotFocused().withTimeout(0);\n    });\n\n    it(`waitFor (element) with wrong parameters should throw`, async () => {\n      expect(() => e.waitFor('notAnElement')).toThrow();\n      expect(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement('notAnElement')).toThrow();\n\n      await expect(() => e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout('notANumber')).rejects.toThrow();\n      await expect(() => e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(-1)).rejects.toThrow();\n    });\n\n    it(`waitFor (element) with non-elements should throw`, async () => {\n      expect(() => e.waitFor('notAnElement')).toThrow();\n    });\n\n    it('toHaveSliderPosition', async () => {\n      await e.expect(e.element(e.by.id('sliderWithASimpleID'))).toHaveSliderPosition(0.25);\n      await e.expect(e.element(e.by.id('sliderWithASimpleID'))).toHaveSliderPosition(0.25, 0.1);\n      await e.expect(e.element(e.by.id('sliderWithASimpleID'))).not.toHaveSliderPosition(0.25);\n      await e.expect(e.element(e.by.id('sliderWithASimpleID'))).not.toHaveSliderPosition(0.25, 0.1);\n    });\n\n    describe('element interactions', () => {\n      it('should tap and long-press', async () => {\n        await e.element(e.by.label('Tap Me')).tap();\n        await e.element(e.by.label('Tap Me')).tap({ x: 10, y: 10 });\n        await e.element(e.by.label('Tap Me')).tapAtPoint({ x: 100, y: 200 });\n        await e.element(e.by.label('Tap Me')).longPress();\n        await e.element(e.by.label('Tap Me')).longPress(1000);\n        await e.element(e.by.label('Tap Me')).longPress({ x: 10, y: 10 }, 1000);\n        await e.element(e.by.label('Tap Me')).longPress({ x: 10, y: 10 });\n        await e.element(e.by.id('UniqueId819')).multiTap(3);\n      });\n\n      it('should not tap and long-press given bad args', async () => {\n        await [null, undefined, 0, -1, 'NaN'].forEach(item => {\n          expect(() => e.element(e.by.id('UniqueId819')).multiTap(item)).rejects.toThrow();\n        });\n\n        await expect(() => e.element(e.by.label('Tap Me')).longPress('NaN')).rejects.toThrow();\n        await expect(() => e.element(e.by.label('Tap Me')).longPress('NaN', 1000)).rejects.toThrow();\n        await expect(() => e.element(e.by.label('Tap Me')).longPress({ x: 'NaN', y: 10 }, 1000)).rejects.toThrow();\n        await expect(() => e.element(e.by.label('Tap Me')).longPress({ x: 10, y: 'NaN' }, 1000)).rejects.toThrow();\n      });\n\n      it('should press special keys', async () => {\n        await e.element(e.by.id('UniqueId937')).tapBackspaceKey();\n        await e.element(e.by.id('UniqueId937')).tapReturnKey();\n      });\n\n      it('should edit text', async () => {\n        await e.element(e.by.id('UniqueId937')).typeText('passcode');\n        await e.element(e.by.id('UniqueId005')).clearText();\n        await e.element(e.by.id('UniqueId005')).replaceText('replaceTo');\n      });\n\n      it('should not edit text given bad args', async () => {\n        await expect(() => e.element(e.by.id('UniqueId937')).typeText(0)).rejects.toThrow();\n        await expect(() => e.element(e.by.id('UniqueId005')).replaceText(3)).rejects.toThrow();\n      });\n\n      it('should scroll', async () => {\n        await e.element(e.by.id('ScrollView161')).scroll(100);\n        await e.element(e.by.id('ScrollView161')).scroll(100, 'down');\n        await e.element(e.by.id('ScrollView161')).scroll(100, 'up');\n        await e.element(e.by.id('ScrollView161')).scroll(100, 'right');\n        await e.element(e.by.id('ScrollView161')).scroll(100, 'left');\n        await e.element(e.by.id('ScrollView161')).scrollTo('bottom');\n        await e.element(e.by.id('ScrollView161')).scrollTo('top');\n        await e.element(e.by.id('ScrollView161')).scrollTo('left');\n        await e.element(e.by.id('ScrollView161')).scrollTo('right');\n        await e.element(e.by.id('ScrollView161')).scrollToIndex(0);\n      });\n\n      it('should not scroll given bad args', async () => {\n        await expect(() => e.element(e.by.id('ScrollView161')).scroll('NaN', 'down')).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView161')).scroll(100, 'noDirection')).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView161')).scroll(100, 0)).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView161')).scrollTo(0)).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView161')).scrollTo('noDirection')).rejects.toThrow();\n      });\n\n      it('should setDatePickerDate', async () => {\n        await e.element(e.by.type('android.widget.DatePicker')).setDatePickerDate('2019-02-06T05:10:00-08:00', 'ISO8601');\n        await e.element(e.by.type('android.widget.DatePicker')).setDatePickerDate('2019/02/06', 'YYYY/MM/DD');\n        await e.element(e.by.type('android.widget.DatePicker')).setDatePickerDate('2019-02-06', 'YYYY-MM-DD');\n      });\n\n      it('should not setDatePickerDate given bad args', async () => {\n        await expect(() => e.element(e.by.type('android.widget.DatePicker')).setDatePickerDate('2019-02-06T05:10:00-08:00')).rejects.toThrow();\n        await expect(() => e.element(e.by.type('android.widget.DatePicker')).setDatePickerDate(2019, 'ISO8601')).rejects.toThrow();\n      });\n\n      it('should swipe', async () => {\n        await e.element(e.by.id('ScrollView799')).swipe('down');\n        await e.element(e.by.id('ScrollView799')).swipe('down', 'fast');\n        await e.element(e.by.id('ScrollView799')).swipe('up', 'slow');\n        await e.element(e.by.id('ScrollView799')).swipe('left', 'fast');\n        await e.element(e.by.id('ScrollView799')).swipe('right', 'slow');\n        await e.element(e.by.id('ScrollView799')).swipe('down', 'fast', 0.9);\n        await e.element(e.by.id('ScrollView799')).swipe('up', 'slow', 0.9);\n        await e.element(e.by.id('ScrollView799')).swipe('left', 'fast', 0.9);\n        await e.element(e.by.id('ScrollView799')).swipe('right', 'slow', 0.9);\n        await e.element(e.by.id('ScrollView799')).swipe('down', 'fast', undefined, undefined, 0.25);\n        await e.element(e.by.id('ScrollView799')).swipe('up', 'slow', 0.9, 0.5, 0.5);\n      });\n\n      it('should long press and drag', async () => {\n        await e.element(e.by.id('draggable')).longPressAndDrag(1000, 0.5, 0.5, e.element(e.by.id('DragAndDropTarget')), 0.5, 0.5, 'fast', 0);\n        await e.element(e.by.id('draggable')).longPressAndDrag(1000, 0.5, 0.5, e.element(e.by.id('DragAndDropTarget')), 0.5, 0.5, 'slow', 0);\n      });\n\n      it('should not swipe given bad args', async () => {\n        await expect(() => e.element(e.by.id('ScrollView799')).swipe(4, 'fast')).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView799')).swipe('noDirection', 0)).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView799')).swipe('noDirection', 'fast')).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView799')).swipe('down', 'NotFastNorSlow')).rejects.toThrow();\n        await expect(() => e.element(e.by.id('ScrollView799')).swipe('down', 'NotFastNorSlow', 0.9)).rejects.toThrow();\n      });\n\n      it('should allow for index-based element discrepancy resolution', async () => {\n        await e.element(e.by.id('ScrollView799')).atIndex(1);\n      });\n\n      it('should fail to find index-based element given invalid args', async () => {\n        expect(() => e.element(e.by.id('ScrollView799')).atIndex('NaN')).toThrow();\n      });\n\n      it('should retrieve attributes', async () => {\n        const execResult = {\n          text: 'hello',\n          value: 1,\n        };\n        mockExecutor.executeResult = Promise.resolve(execResult);\n        const result = await e.element(e.by.id('UniqueId005')).getAttributes();\n        expect(result).toEqual(execResult);\n      });\n\n      it('should adjust slider to position', async () => {\n        await e.element(e.by.id('sliderWithASimpleID')).adjustSliderToPosition(75);\n      });\n\n      it('should perform accessibility actions', async () => {\n        await e.element(e.by.id('View7991')).performAccessibilityAction('activate');\n      });\n    });\n\n    describe('element screenshots', () => {\n      const tempFilePath = '/path/to/temp-file.png';\n      const invokeResultInBase64 = 'VGhlcmUgaXMgbm8gc3Bvb24h';\n\n      let tempfile;\n      let fs;\n      let _element;\n      beforeEach(() => {\n        mockExecutor.executeResult = Promise.resolve(invokeResultInBase64);\n\n        fs = require('fs-extra');\n        tempfile = require('../utils/tempfile');\n        tempfile.mockReturnValue(tempFilePath);\n\n        _element = e.element(e.by.id('FancyElement'));\n      });\n\n      it('should take and save the screenshot in a temp-file', async () => {\n        await _element.takeScreenshot();\n        expect(fs.writeFile).toHaveBeenCalledWith(tempFilePath, invokeResultInBase64, 'base64');\n        expect(tempfile).toHaveBeenCalledWith('detox.element-screenshot.png');\n      });\n\n      it('should return the path to the temp-file containing screenshot data', async () => {\n        const result = await _element.takeScreenshot();\n        expect(result).toEqual(tempFilePath);\n      });\n\n      it('should emit a named-artifact creation event', async () => {\n        const screenshotName = 'mock-screenshot-name';\n        await _element.takeScreenshot(screenshotName);\n        expect(emitter.emit).toHaveBeenCalledWith('createExternalArtifact', {\n          pluginId: 'screenshot',\n          artifactName: screenshotName,\n          artifactPath: tempFilePath,\n        });\n      });\n\n      it('should emit an artifact creation event with a default name', async () => {\n        await _element.takeScreenshot(undefined);\n        expect(emitter.emit).toHaveBeenCalledWith(\n          expect.any(String),\n          expect.objectContaining({\n              artifactName: 'temp-file',\n            },\n          ));\n      });\n    });\n  });\n\n  describe('web', () => {\n    describe('General', () => {\n      it('should return undefined', async () => {\n        mockExecutor.executeResult = Promise.resolve(undefined);\n        await e.web(e.by.id('webview_id')).element(e.by.web.id('any')).tap();\n      });\n    });\n\n    describe('web', () => {\n      it('default', async () => {\n        await e.web.element(e.by.web.id('id')).tap();\n      });\n\n      it('default explicit', async () => {\n        await e.web().element(e.by.web.id('id')).tap();\n      });\n\n      it('with webview matcher', async () => {\n        await e.web(e.by.id('webview_id')).element(e.by.web.id('id')).tap();\n      });\n\n      it(`with wrong matcher arguments - should throw`, async () => {\n        expect(() => e.web(e.by.web.className('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.cssSelector('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.id('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.href('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.name('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.hrefContains('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.tag('webMatcher'))).toThrow();\n        expect(() => e.web(e.by.web.xpath('webMatcher'))).toThrow();\n      });\n\n      it('with at-index should throw', async () => {\n        expect(() => e.web(e.by.id('webview_id')).atIndex(1).element(e.by.web.id('id')).tap()).toThrow();\n      });\n\n      it(`inner element with wrong matcher should throw`, async () => {\n        expect(() => e.web.element(e.by.accessibilityLabel('nativeMatcher'))).toThrow();\n        expect(() => e.web.element(e.by.id('nativeMatcher'))).toThrow();\n        expect(() => e.web.element(e.by.label('nativeMatcher'))).toThrow();\n        expect(() => e.web.element(e.by.text('nativeMatcher'))).toThrow();\n        expect(() => e.web.element(e.by.traits('nativeMatcher'))).toThrow();\n        expect(() => e.web.element(e.by.value('nativeMatcher'))).toThrow();\n      });\n    });\n\n    describe('WebElement Actions', () => {\n      let handle;\n\n      beforeEach(() => {\n        jest.useFakeTimers({ doNotFake: ['clearInterval', 'setInterval'] });\n        handle = setInterval(() => jest.runAllTimers(), 5);\n      });\n\n      afterEach(() => {\n        clearInterval(handle);\n        jest.useRealTimers();\n      });\n\n      it('tap', async () => {\n        await e.web.element(e.by.web.id('id')).tap();\n        await e.web.element(e.by.web.className('className')).tap();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).tap();\n        await e.web.element(e.by.web.name('name')).tap();\n        await e.web.element(e.by.web.xpath('xpath')).tap();\n        await e.web.element(e.by.web.href('linkText')).tap();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).tap();\n        await e.web.element(e.by.web.tag('tag')).tap();\n      });\n\n      it('typeText', async () => {\n        await e.web.element(e.by.web.id('id')).typeText('text');\n        await e.web.element(e.by.web.className('className')).typeText('text');\n        await e.web.element(e.by.web.cssSelector('cssSelector')).typeText('text');\n        await e.web.element(e.by.web.name('name')).typeText('text');\n        await e.web.element(e.by.web.xpath('xpath')).typeText('text');\n        await e.web.element(e.by.web.href('linkText')).typeText('text');\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).typeText('text');\n        await e.web.element(e.by.web.tag('tag')).typeText('text');\n      });\n\n      it('typeText with isContentEditable=false', async () => {\n        await e.web.element(e.by.web.id('id')).typeText('text', false);\n        global.expect(device._typeText).not.toHaveBeenCalled();\n      });\n\n      it('typeText with isContentEditable=true', async () => {\n        await e.web.element(e.by.web.id('id')).typeText('text', true);\n        global.expect(device._typeText).toHaveBeenCalled();\n      });\n\n      it('typeText default isContentEditable is false', async () => {\n        await e.web.element(e.by.web.id('id')).typeText('text');\n        global.expect(device._typeText).not.toHaveBeenCalled();\n      });\n\n      it('replaceText', async () => {\n        await e.web.element(e.by.web.id('id')).replaceText('text');\n        await e.web.element(e.by.web.className('className')).replaceText('text');\n        await e.web.element(e.by.web.cssSelector('cssSelector')).replaceText('text');\n        await e.web.element(e.by.web.name('name')).replaceText('text');\n        await e.web.element(e.by.web.xpath('xpath')).replaceText('text');\n        await e.web.element(e.by.web.href('linkText')).replaceText('text');\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).replaceText('text');\n        await e.web.element(e.by.web.tag('tag')).replaceText('text');\n      });\n\n      it('clearText', async () => {\n        await e.web.element(e.by.web.id('id')).clearText();\n        await e.web.element(e.by.web.className('className')).clearText();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).clearText();\n        await e.web.element(e.by.web.name('name')).clearText();\n        await e.web.element(e.by.web.xpath('xpath')).clearText();\n        await e.web.element(e.by.web.href('linkText')).clearText();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).clearText();\n        await e.web.element(e.by.web.tag('tag')).clearText();\n      });\n\n      it('scrollToView', async () => {\n        await e.web.element(e.by.web.id('id')).scrollToView();\n        await e.web.element(e.by.web.className('className')).scrollToView();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).scrollToView();\n        await e.web.element(e.by.web.name('name')).scrollToView();\n        await e.web.element(e.by.web.xpath('xpath')).scrollToView();\n        await e.web.element(e.by.web.href('linkText')).scrollToView();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).scrollToView();\n        await e.web.element(e.by.web.tag('tag')).scrollToView();\n      });\n\n      it('getText', async () => {\n        await e.web.element(e.by.web.id('id')).getText();\n        await e.web.element(e.by.web.className('className')).getText();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).getText();\n        await e.web.element(e.by.web.name('name')).getText();\n        await e.web.element(e.by.web.xpath('xpath')).getText();\n        await e.web.element(e.by.web.href('linkText')).getText();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).getText();\n        await e.web.element(e.by.web.tag('tag')).getText();\n      });\n\n      it('focus', async () => {\n        await e.web.element(e.by.web.id('id')).focus();\n        await e.web.element(e.by.web.className('className')).focus();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).focus();\n        await e.web.element(e.by.web.name('name')).focus();\n        await e.web.element(e.by.web.xpath('xpath')).focus();\n        await e.web.element(e.by.web.href('linkText')).focus();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).focus();\n        await e.web.element(e.by.web.tag('tag')).focus();\n      });\n\n      it('selectAllText', async () => {\n        await e.web.element(e.by.web.id('id')).selectAllText();\n        await e.web.element(e.by.web.className('className')).selectAllText();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).selectAllText();\n        await e.web.element(e.by.web.name('name')).selectAllText();\n        await e.web.element(e.by.web.xpath('xpath')).selectAllText();\n        await e.web.element(e.by.web.href('linkText')).selectAllText();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).selectAllText();\n        await e.web.element(e.by.web.tag('tag')).selectAllText();\n      });\n\n      it('moveCursorToEnd', async () => {\n        await e.web.element(e.by.web.id('id')).moveCursorToEnd();\n        await e.web.element(e.by.web.className('className')).moveCursorToEnd();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).moveCursorToEnd();\n        await e.web.element(e.by.web.name('name')).moveCursorToEnd();\n        await e.web.element(e.by.web.xpath('xpath')).moveCursorToEnd();\n        await e.web.element(e.by.web.href('linkText')).moveCursorToEnd();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).moveCursorToEnd();\n        await e.web.element(e.by.web.tag('tag')).moveCursorToEnd();\n      });\n\n      it('runScript', async () => {\n        const script = 'function named(el) { return el.textContent; }';\n        await e.web.element(e.by.web.id('id')).runScript(function () {});\n        await e.web.element(e.by.web.className('className')).runScript((el) => el.textContent);\n        await e.web.element(e.by.web.cssSelector('cssSelector')).runScript(function named(..._args) {});\n        await e.web.element(e.by.web.name('name')).runScript(script);\n        await e.web.element(e.by.web.xpath('xpath')).runScript(script);\n        await e.web.element(e.by.web.href('linkText')).runScript(script);\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).runScript(script);\n        await e.web.element(e.by.web.tag('tag')).runScript(script);\n      });\n\n      it('runScript (unhappy)', async () => {\n        await expect(e.web.element(e.by.web.id('id')).runScript(/nonsense/)).rejects.toThrow(/script should be a string, but got \\/nonsense\\//);\n        await expect(e.web.element(e.by.web.id('id')).runScript(null, [])).rejects.toThrow(/script should be a string, but got null/);\n        await expect(e.web.element(e.by.web.id('id')).runScript('return el.textContent')).rejects.toThrow(/Expected a valid function string, but got: return el.textContent/);\n      });\n\n      it('runScript (with args)', async () => {\n        const script = 'function bar(a,b) {}';\n        const argsArr = ['fooA', 40];\n        await e.web.element(e.by.web.id('id')).runScript(script, argsArr);\n        await e.web.element(e.by.web.className('className')).runScript(script, argsArr);\n        await e.web.element(e.by.web.cssSelector('cssSelector')).runScript(script, argsArr);\n        await e.web.element(e.by.web.name('name')).runScript(script, argsArr);\n        await e.web.element(e.by.web.xpath('xpath')).runScript(script, argsArr);\n        await e.web.element(e.by.web.href('linkText')).runScript(script, argsArr);\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).runScript(script, argsArr);\n        await e.web.element(e.by.web.tag('tag')).runScript(script, argsArr);\n      });\n\n      it('getCurrentUrl', async () => {\n        await e.web.element(e.by.web.id('id')).getCurrentUrl();\n        await e.web.element(e.by.web.className('className')).getCurrentUrl();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).getCurrentUrl();\n        await e.web.element(e.by.web.name('name')).getCurrentUrl();\n        await e.web.element(e.by.web.xpath('xpath')).getCurrentUrl();\n        await e.web.element(e.by.web.href('linkText')).getCurrentUrl();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).getCurrentUrl();\n        await e.web.element(e.by.web.tag('tag')).getCurrentUrl();\n      });\n\n      it('getTitle', async () => {\n        await e.web.element(e.by.web.id('id')).getTitle();\n        await e.web.element(e.by.web.className('className')).getTitle();\n        await e.web.element(e.by.web.cssSelector('cssSelector')).getTitle();\n        await e.web.element(e.by.web.name('name')).getTitle();\n        await e.web.element(e.by.web.xpath('xpath')).getTitle();\n        await e.web.element(e.by.web.href('linkText')).getTitle();\n        await e.web.element(e.by.web.hrefContains('partialLinkText')).getTitle();\n        await e.web.element(e.by.web.tag('tag')).getTitle();\n      });\n\n      it('should allow for access to by via element', async () => {\n        const webview = await e.web;\n        await webview.element(e.by.web.id('id')).tap();\n      });\n    });\n\n    describe('Web Matchers',() => {\n      it('by.web.id', async () => {\n        await e.expect(e.web.element(e.by.web.id('id'))).toExist();\n        await e.expect(e.web.element(e.by.web.id('id'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.id('id'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.id('id'))).not.toHaveText('text');\n      });\n\n      it('by.web.className', async () => {\n        await e.expect(e.web.element(e.by.web.className('className'))).toExist();\n        await e.expect(e.web.element(e.by.web.className('className'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.className('className'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.className('className'))).not.toHaveText('text');\n      });\n\n      it('by.web.cssSelector', async () => {\n        await e.expect(e.web.element(e.by.web.cssSelector('cssSelector'))).toExist();\n        await e.expect(e.web.element(e.by.web.cssSelector('cssSelector'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.cssSelector('cssSelector'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.cssSelector('cssSelector'))).not.toHaveText('text');\n      });\n\n      it('by.web.name', async () => {\n        await e.expect(e.web.element(e.by.web.name('name'))).toExist();\n        await e.expect(e.web.element(e.by.web.name('name'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.name('name'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.name('name'))).not.toHaveText('text');\n      });\n\n      it('by.web.xpath', async () => {\n        await e.expect(e.web.element(e.by.web.xpath('xpath'))).toExist();\n        await e.expect(e.web.element(e.by.web.xpath('xpath'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.xpath('xpath'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.xpath('xpath'))).not.toHaveText('text');\n      });\n\n      it('by.web.href', async () => {\n        await e.expect(e.web.element(e.by.web.href('link'))).toExist();\n        await e.expect(e.web.element(e.by.web.href('link'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.href('link'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.href('link'))).not.toHaveText('text');\n      });\n\n      it('by.web.hrefContains', async () => {\n        await e.expect(e.web.element(e.by.web.hrefContains('lin'))).toExist();\n        await e.expect(e.web.element(e.by.web.hrefContains('lin'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.hrefContains('lin'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.hrefContains('lin'))).not.toHaveText('text');\n      });\n\n      it('by.web.tag', async () => {\n        await e.expect(e.web.element(e.by.web.tag('tag'))).toExist();\n        await e.expect(e.web.element(e.by.web.tag('tag'))).not.toExist();\n        await e.expect(e.web.element(e.by.web.tag('tag'))).toHaveText('text');\n        await e.expect(e.web.element(e.by.web.tag('tag'))).not.toHaveText('text');\n      });\n\n      it('should allow for access to except via element', async () => {\n        const webview = e.web();\n        await e.expect(webview.element(e.by.web.id('id'))).toExist();\n      });\n    });\n\n    it('should throw for secured web interactions (`asSecured()` in unsupported)', async () => {\n      expect(() => e.web.element(e.by.web.id('id')).asSecured().tap()).toThrow();\n    });\n  });\n\n  describe('System (unsupported)', () => {\n    const unsupportedErrorMessage =\n        /System interactions are not supported on Android, use UiDevice APIs directly instead/;\n\n    it('should throw for system element call', async () => {\n      await expect(async () => e.system.element('anything')).rejects.toThrow(unsupportedErrorMessage);\n    });\n\n    it('should throw for system type matcher', async () => {\n      await expect(async () => e.by.system.type('type')).rejects.toThrow(unsupportedErrorMessage);\n    });\n\n    it('should throw for system label matcher', async () => {\n      await expect(async () => e.by.system.label('label')).rejects.toThrow(unsupportedErrorMessage);\n    });\n  });\n});\n\nclass MockExecutor {\n  constructor() {\n    this.executeResult = undefined;\n  }\n\n  async execute(invocation) {\n    if (typeof invocation === 'function') {\n      invocation = invocation();\n    }\n    expect(invocation.target).toBeDefined();\n    expect(invocation.target.type).toBeDefined();\n    expect(invocation.target.value).toBeDefined();\n\n    this.recurse(invocation);\n    await this.timeout(1);\n    return this.executeResult ? {\n      result: this.executeResult,\n    } : undefined;\n  }\n\n  recurse(invocation) {\n    for (const key in invocation) {\n      if (invocation.hasOwnProperty(key)) {\n        if (invocation[key] instanceof Object) {\n          this.recurse(invocation[key]);\n        }\n        if (key === 'target' && invocation[key].type === 'Invocation') {\n          const innerValue = invocation.target.value;\n          expect(innerValue.target.type).toBeDefined();\n          expect(innerValue.target.value).toBeDefined();\n        }\n      }\n    }\n  }\n\n  async timeout(ms) {\n    return new Promise((resolve) => setTimeout(resolve, ms));\n  }\n}\n"
  },
  {
    "path": "detox/src/android/actions/native.js",
    "content": "const invoke = require('../../invoke');\nconst { assertEnum, assertNormalized } = require('../../utils/assertArgument');\nconst DetoxActionApi = require('../espressoapi/DetoxAction');\nconst DetoxViewActionsApi = require('../espressoapi/DetoxViewActions');\nconst ViewActionsApi = require('../espressoapi/ViewActions');\n\nconst assertDirection = assertEnum(['left', 'right', 'up', 'down']);\nconst assertSpeed = assertEnum(['fast', 'slow']);\n\nclass Action {\n}\n\nclass TapAction extends Action {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(value ? DetoxActionApi.tapAtLocation(value.x, value.y) : DetoxViewActionsApi.click());\n  }\n}\n\nclass TapAtPointAction extends Action {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.tapAtLocation(value.x, value.y));\n  }\n}\n\nclass LongPressAction extends Action {\n  constructor(point, duration) {\n    super();\n\n    const filteredArgs = (point ? [point.x, point.y] : []).concat(duration ? [duration] : []);\n    this._call = invoke.callDirectly(DetoxActionApi.longPress(...filteredArgs));\n  }\n}\n\nclass MultiClickAction extends Action {\n  constructor(times) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.multiClick(times));\n  }\n}\n\nclass PressKeyAction extends Action {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(ViewActionsApi.pressKey(value));\n  }\n}\n\nclass LongPressAndDragAction extends Action {\n  constructor(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration) {\n    super();\n\n    assertNormalized({ normalizedPositionX });\n    assertNormalized({ normalizedPositionY });\n    assertNormalized({ normalizedTargetPositionX });\n    assertNormalized({ normalizedTargetPositionY });\n    assertSpeed({ speed });\n\n    this._call = invoke.callDirectly(\n      DetoxActionApi.longPressAndDrag(\n        duration,\n        normalizedPositionX,\n        normalizedPositionY,\n        targetElement._call(),\n        normalizedTargetPositionX,\n        normalizedTargetPositionY,\n        speed === 'fast',\n        holdDuration\n      )\n    );\n  }\n\n}\n\nclass TypeTextAction extends Action {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(DetoxViewActionsApi.typeText(value));\n  }\n}\n\nclass ReplaceTextAction extends Action {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(ViewActionsApi.replaceText(value));\n  }\n}\n\nclass ClearTextAction extends Action {\n  constructor() {\n    super();\n    this._call = invoke.callDirectly(ViewActionsApi.clearText());\n  }\n}\n\nclass ScrollAmountAction extends Action {\n  constructor(direction, amount, startPositionX = -1, startPositionY = -1) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.scrollInDirection(direction, amount, startPositionX, startPositionY));\n  }\n}\n\nclass ScrollAmountStopAtEdgeAction extends Action {\n  constructor(direction, amount, startPositionX = -1, startPositionY = -1) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.scrollInDirectionStaleAtEdge(direction, amount, startPositionX, startPositionY));\n  }\n}\n\nclass ScrollEdgeAction extends Action {\n  constructor(edge, startPositionX = -1, startPositionY = -1) {\n    super();\n\n    this._call = invoke.callDirectly(DetoxActionApi.scrollToEdge(edge, startPositionX, startPositionY));\n  }\n}\n\nclass SwipeAction extends Action {\n  constructor(direction, speed, normalizedSwipeOffset, normalizedStartingPointX, normalizedStartingPointY) {\n    super();\n\n    assertDirection({ direction });\n    assertSpeed({ speed });\n    assertNormalized({ normalizedSwipeOffset });\n    assertNormalized({ normalizedStartingPointX });\n    assertNormalized({ normalizedStartingPointY });\n\n    this._call = invoke.callDirectly(\n      DetoxActionApi.swipeInDirection(\n        direction,\n        speed === 'fast',\n        normalizedSwipeOffset,\n        normalizedStartingPointX,\n        normalizedStartingPointY\n      )\n    );\n  }\n}\n\nclass GetAttributes extends Action {\n  constructor() {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.getAttributes());\n  }\n}\n\nclass ScrollToIndex extends Action {\n  constructor(index) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.scrollToIndex(index));\n  }\n}\n\nclass SetDatePickerDateAction extends Action {\n  constructor(dateString, formatString) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.setDatePickerDate(dateString, formatString));\n  }\n}\n\nclass AdjustSliderToPosition extends Action {\n  constructor(newPosition) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.adjustSliderToPosition(newPosition));\n  }\n}\n\nclass TakeElementScreenshot extends Action {\n  constructor() {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.takeViewScreenshot());\n  }\n}\n\nclass AccessibilityActionAction extends Action {\n  constructor(actionName) {\n    super();\n    this._call = invoke.callDirectly(DetoxActionApi.accessibilityAction(actionName));\n  }\n}\n\nmodule.exports = {\n  Action,\n  TapAction,\n  TapAtPointAction,\n  LongPressAction,\n  LongPressAndDragAction,\n  MultiClickAction,\n  PressKeyAction,\n  TypeTextAction,\n  ReplaceTextAction,\n  ClearTextAction,\n  GetAttributes,\n  ScrollAmountAction,\n  ScrollAmountStopAtEdgeAction,\n  ScrollEdgeAction,\n  SwipeAction,\n  TakeElementScreenshot,\n  ScrollToIndex,\n  SetDatePickerDateAction,\n  AdjustSliderToPosition,\n  AccessibilityActionAction\n};\n"
  },
  {
    "path": "detox/src/android/actions/web.js",
    "content": "const WebElementApi = require('../espressoapi/web/WebElement');\nconst WebExpectApi = require('../espressoapi/web/WebExpect');\nconst simpleAtoms = require('../espressoapi/web/simpleAtoms');\n\nclass WebAction {\n}\n\nclass WebTapAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.tap(element._call);\n  }\n}\n\nclass WebTypeTextAction extends WebAction {\n  constructor(element, text) {\n    super();\n    this._call = WebElementApi.typeText(element._call, text);\n  }\n}\n\nclass WebReplaceTextAction extends WebAction {\n  constructor(element, text) {\n    super();\n    this._call = WebElementApi.replaceText(element._call, text);\n  }\n}\n\nclass WebClearTextAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.clearText(element._call);\n  }\n}\n\nclass WebScrollToViewAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.scrollToView(element._call);\n  }\n}\n\nclass WebGetTextAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.getText(element._call);\n  }\n}\n\nclass WebRunScriptAction extends WebAction {\n  constructor(element, script) {\n    super();\n    this._call = WebElementApi.runScript(element._call, script);\n  }\n}\n\nclass WebRunScriptWithArgsAction extends WebAction {\n  constructor(element, script, args) {\n    super();\n    this._call = WebElementApi.runScriptWithArgs(element._call, script, args);\n  }\n}\n\nclass WebGetCurrentUrlAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.getCurrentUrl(element._call);\n  }\n}\n\nclass WebGetTitleAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.getTitle(element._call);\n  }\n}\n\nclass WebFocusAction extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.runScript(element._call, simpleAtoms.focus);\n  }\n}\n\nclass WebSelectAllText extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.runScript(element._call, simpleAtoms.selectElementContents);\n  }\n}\n\nclass WebMoveCursorEnd extends WebAction {\n  constructor(element) {\n    super();\n    this._call = WebElementApi.runScript(element._call, simpleAtoms.moveCursorToEnd);\n  }\n}\n\nclass WebExistsAssertion extends WebAction {\n  constructor(webExpect) {\n    super();\n    if (webExpect._notCondition) {\n      this._call = WebExpectApi.toNotExist(webExpect._call);\n    } else {\n      this._call = WebExpectApi.toExist(webExpect._call);\n    }\n  }\n}\n\nclass WebHasTextAssertion extends WebAction {\n  constructor(webExpect, text) {\n    super();\n    if (webExpect._notCondition) {\n      this._call = WebExpectApi.toNotHaveText(webExpect._call, text);\n    } else {\n      this._call = WebExpectApi.toHaveText(webExpect._call, text);\n    }\n  }\n}\n\nmodule.exports = {\n  WebAction,\n  WebTapAction,\n  WebTypeTextAction,\n  WebReplaceTextAction,\n  WebClearTextAction,\n  WebScrollToViewAction,\n  WebGetTextAction,\n  WebRunScriptAction,\n  WebRunScriptWithArgsAction,\n  WebGetCurrentUrlAction,\n  WebGetTitleAction,\n  WebFocusAction,\n  WebSelectAllText,\n  WebMoveCursorEnd,\n  WebExistsAssertion,\n  WebHasTextAssertion,\n};\n"
  },
  {
    "path": "detox/src/android/core/NativeElement.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\n\n\nconst DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst invoke = require('../../invoke');\nconst { removeMilliseconds } = require('../../utils/dateUtils');\nconst { actionDescription } = require('../../utils/invocationTraceDescriptions');\nconst mapLongPressArguments = require('../../utils/mapLongPressArguments');\nconst tempfile = require('../../utils/tempfile');\nconst actions = require('../actions/native');\nconst DetoxMatcherApi = require('../espressoapi/DetoxMatcher');\nconst { ActionInteraction } = require('../interactions/native');\n\nclass NativeElement {\n  constructor(invocationManager, emitter, matcher) {\n    this._invocationManager = invocationManager;\n    this._emitter = emitter;\n    this._matcher = matcher;\n  }\n\n  get _call() {\n    return invoke.call(invoke.Espresso, 'onView', this._matcher._call);\n  }\n\n  atIndex(index) {\n    if (typeof index !== 'number') throw new DetoxRuntimeError({ message: `Element atIndex argument must be a number, got ${typeof index}` });\n    const matcher = this._matcher;\n    this._matcher._call = invoke.callDirectly(DetoxMatcherApi.matcherForAtIndex(index, matcher._call.value));\n\n    return this;\n  }\n\n  async tap(value) {\n    const action = new actions.TapAction(value);\n    const traceDescription = actionDescription.tapAtPoint(value);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async tapAtPoint(value) {\n    const action = new actions.TapAtPointAction(value);\n    const traceDescription = actionDescription.tapAtPoint(value);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async longPress(optionalPointOrDuration, optionalDuration) {\n    const { point, duration } = mapLongPressArguments(optionalPointOrDuration, optionalDuration);\n\n    const action = new actions.LongPressAction(point, duration);\n    const traceDescription = actionDescription.longPress(point, duration);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration) {\n    const action = new actions.LongPressAndDragAction(\n      duration,\n      normalizedPositionX,\n      normalizedPositionY,\n      targetElement,\n      normalizedTargetPositionX,\n      normalizedTargetPositionY,\n      speed,\n      holdDuration);\n    const traceDescription = actionDescription.longPressAndDrag(\n      duration,\n      normalizedPositionX,\n      normalizedPositionY,\n      targetElement,\n      normalizedTargetPositionX,\n      normalizedTargetPositionY,\n      speed,\n      holdDuration);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async multiTap(times) {\n    if (typeof times !== 'number') throw new Error('times should be a number, but got ' + (times + (' (' + (typeof times + ')'))));\n    if (times < 1) throw new Error('times should be greater than 0, but got ' + times);\n\n    const action = new actions.MultiClickAction(times);\n    const traceDescription = actionDescription.multiTap(times);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async tapBackspaceKey() {\n    const action = new actions.PressKeyAction(67);\n    const traceDescription = actionDescription.tapBackspaceKey();\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async tapReturnKey() {\n    const action = new actions.TypeTextAction('\\n');\n    const traceDescription = actionDescription.tapReturnKey();\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async typeText(value) {\n    const action = new actions.TypeTextAction(value);\n    const traceDescription = actionDescription.typeText(value);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async replaceText(value) {\n    const action = new actions.ReplaceTextAction(value);\n    const traceDescription = actionDescription.replaceText(value);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async clearText() {\n    const action = new actions.ClearTextAction();\n    const traceDescription = actionDescription.clearText();\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async scroll(amount, direction = 'down', startPositionX, startPositionY) {\n    const action = new actions.ScrollAmountAction(direction, amount, startPositionX, startPositionY);\n    const traceDescription = actionDescription.scroll(amount, direction, startPositionX, startPositionY);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async scrollTo(edge, startPositionX, startPositionY) {\n    // override the user's element selection with an extended matcher that looks for UIScrollView children\n    this._matcher = this._matcher._extendToDescendantScrollViews();\n\n    const action = new actions.ScrollEdgeAction(edge, startPositionX, startPositionY);\n    const traceDescription = actionDescription.scrollTo(edge, startPositionX, startPositionY);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async scrollToIndex(index) {\n    // override the user's element selection with an extended matcher that looks for UIScrollView children\n    this._matcher = this._matcher._extendToDescendantScrollViews();\n\n    const action = new actions.ScrollToIndex(index);\n    const traceDescription = actionDescription.scrollToIndex(index);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async setDatePickerDate(rawDateString, formatString) {\n    const dateString = formatString === 'ISO8601'\n      ? removeMilliseconds(rawDateString)\n      : rawDateString;\n\n    const action = new actions.SetDatePickerDateAction(dateString, formatString);\n    const traceDescription = actionDescription.setDatePickerDate(dateString, formatString);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  /**\n   * @param {'up' | 'right' | 'down' | 'left'} direction\n   * @param {'slow' | 'fast'} [speed]\n   * @param {number} [normalizedSwipeOffset] - swipe amount relative to the screen width/height\n   * @param {number} [normalizedStartingPointX] - X coordinate of swipe starting point, relative to the view width\n   * @param {number} [normalizedStartingPointY] - Y coordinate of swipe starting point, relative to the view height\n   */\n  async swipe(direction, speed = 'fast', normalizedSwipeOffset = NaN, normalizedStartingPointX = NaN, normalizedStartingPointY = NaN) {\n    normalizedSwipeOffset = Number.isNaN(normalizedSwipeOffset) ? 0.75 : normalizedSwipeOffset;\n\n    // override the user's element selection with an extended matcher that avoids RN issues with RCTScrollView\n    this._matcher = this._matcher._avoidProblematicReactNativeElements();\n\n    const action = new actions.SwipeAction(direction, speed, normalizedSwipeOffset, normalizedStartingPointX, normalizedStartingPointY);\n    const traceDescription = actionDescription.swipe(direction, speed, normalizedSwipeOffset, normalizedStartingPointX, normalizedStartingPointY);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async takeScreenshot(screenshotName) {\n    const action = new actions.TakeElementScreenshot();\n    const traceDescription = actionDescription.takeScreenshot(screenshotName);\n    const resultBase64 = await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n    const filePath = tempfile('detox.element-screenshot.png');\n    await fs.writeFile(filePath, resultBase64, 'base64');\n\n    await this._emitter.emit('createExternalArtifact', {\n      pluginId: 'screenshot',\n      artifactName: screenshotName || path.basename(filePath, '.png'),\n      artifactPath: filePath,\n    });\n    return filePath;\n  }\n\n  async getAttributes() {\n    const action = new actions.GetAttributes();\n    const traceDescription = actionDescription.getAttributes();\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async adjustSliderToPosition(newPosition) {\n    const action = new actions.AdjustSliderToPosition(newPosition);\n    const traceDescription = actionDescription.adjustSliderToPosition(newPosition);\n    return await new ActionInteraction(this._invocationManager, this._matcher, action, traceDescription).execute();\n  }\n\n  async performAccessibilityAction(actionName) {\n    const traceDescription = actionDescription.performAccessibilityAction(actionName);\n    return await new ActionInteraction(this._invocationManager, this._matcher, new actions.AccessibilityActionAction(actionName), traceDescription).execute();\n  }\n}\n\nmodule.exports = {\n  NativeElement,\n};\n"
  },
  {
    "path": "detox/src/android/core/NativeExpect.js",
    "content": "const { expectDescription } = require('../../utils/invocationTraceDescriptions');\nconst { MatcherAssertionInteraction } = require('../interactions/native');\nconst matchers = require('../matchers/native');\n\nclass NativeExpect {\n  constructor(invocationManager) {\n    this._invocationManager = invocationManager;\n  }\n\n  get not() {\n    this._notCondition = true;\n    return this;\n  }\n}\n\nclass NativeExpectElement extends NativeExpect {\n  constructor(invocationManager, element) {\n    super(invocationManager);\n    this._element = element;\n  }\n\n  async toBeVisible(pct) {\n    const matcher = new matchers.VisibleMatcher(pct);\n    const traceDescription = expectDescription.toBeVisible(pct);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toBeNotVisible() {\n    return await this.not.toBeVisible();\n  }\n\n  async toExist() {\n    const matcher = new matchers.ExistsMatcher();\n    const traceDescription = expectDescription.toExist();\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toNotExist() {\n    return await this.not.toExist();\n  }\n\n  async toHaveText(text) {\n    const matcher = new matchers.TextMatcher(text);\n    const traceDescription = expectDescription.toHaveText(text);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toNotHaveText(text) {\n    return await this.not.toHaveText(text);\n  }\n\n  async toHaveLabel(value) {\n    const matcher = new matchers.LabelMatcher(value);\n    const traceDescription = expectDescription.toHaveLabel(value);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toNotHaveLabel(value) {\n    return await this.not.toHaveLabel(value);\n  }\n\n  async toHaveId(value) {\n    const matcher = new matchers.IdMatcher(value);\n    const traceDescription = expectDescription.toHaveId(value);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toNotHaveId(value) {\n    return await this.not.toHaveId(value);\n  }\n\n  async toHaveValue(value) {\n    const matcher = new matchers.ValueMatcher(value);\n    const traceDescription = expectDescription.toHaveValue(value);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toNotHaveValue(value) {\n    return await this.not.toHaveValue(value);\n  }\n\n  async toHaveToggleValue(value) {\n    const matcher = new matchers.ToggleMatcher(value);\n    const traceDescription = expectDescription.toHaveToggleValue(value);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toHaveSliderPosition(value, tolerance = 0) {\n    const matcher = new matchers.SliderPositionMatcher(value, tolerance);\n    const traceDescription = expectDescription.toHaveSliderPosition(value, tolerance);\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toBeFocused() {\n    const matcher = new matchers.FocusMatcher();\n    const traceDescription = expectDescription.toBeFocused();\n    return await new MatcherAssertionInteraction(this._invocationManager, this._element, matcher, this._notCondition, traceDescription).execute();\n  }\n\n  async toBeNotFocused() {\n    return await this.not.toBeFocused();\n  }\n}\n\nmodule.exports = {\n  NativeExpect,\n  NativeExpectElement,\n};\n"
  },
  {
    "path": "detox/src/android/core/NativeMatcher.js",
    "content": "const { inspect } = require('util');\n\nconst { DetoxRuntimeError } = require('../../errors');\nconst invoke = require('../../invoke');\nconst DetoxMatcherApi = require('../espressoapi/DetoxMatcher');\n\nclass NativeMatcher {\n  static _assertMatcher(matcher) {\n    if (!(matcher instanceof NativeMatcher)) {\n      throw new DetoxRuntimeError({ message: `Expected a matcher, got: ${inspect(matcher)}` });\n    }\n  }\n\n  constructor(call) {\n    this._call = call || null;\n  }\n\n  withAncestor(matcher) {\n    NativeMatcher._assertMatcher(matcher);\n\n    const call = invoke.callDirectly(DetoxMatcherApi.matcherWithAncestor(this, matcher));\n    return new NativeMatcher(call);\n  }\n\n  withDescendant(matcher) {\n    NativeMatcher._assertMatcher(matcher);\n\n    const call = invoke.callDirectly(DetoxMatcherApi.matcherWithDescendant(this, matcher));\n    return new NativeMatcher(call);\n  }\n\n  and(matcher) {\n    NativeMatcher._assertMatcher(matcher);\n\n    const call = invoke.callDirectly(DetoxMatcherApi.matcherForAnd(this, matcher));\n    return new NativeMatcher(call);\n  }\n\n  or(matcher) {\n    NativeMatcher._assertMatcher(matcher);\n\n    const call = invoke.callDirectly(DetoxMatcherApi.matcherForOr(this, matcher));\n    return new NativeMatcher(call);\n  }\n\n  get not() {\n    const call = invoke.callDirectly(DetoxMatcherApi.matcherForNot(this));\n    return new NativeMatcher(call);\n  }\n\n  _avoidProblematicReactNativeElements() {\n    /*\n    const _originalMatcherCall = this._call;\n    this._call = invoke.call(invoke.IOS.Class('GREYMatchers'), 'detoxMatcherAvoidingProblematicReactNativeElements:', _originalMatcherCall);\n    */\n    return this;\n  }\n  _extendToDescendantScrollViews() {\n    /*\n    const _originalMatcherCall = this._call;\n    this._call = invoke.call(invoke.IOS.Class('GREYMatchers'), 'detoxMatcherForScrollChildOfMatcher:', _originalMatcherCall);\n    */\n    return this;\n  }\n}\n\nmodule.exports = {\n  NativeMatcher,\n};\n"
  },
  {
    "path": "detox/src/android/core/NativeWaitFor.js",
    "content": "const { WaitForInteraction } = require('../interactions/native');\nconst matchers = require('../matchers/native');\n\nclass NativeWaitFor {\n  constructor(invocationManager) {\n    this._invocationManager = invocationManager;\n  }\n}\n\nclass NativeWaitForElement extends NativeWaitFor {\n  constructor(invocationManager, element) {\n    super(invocationManager);\n    this._element = element;\n  }\n\n  get not() {\n    this._notCondition = true;\n    return this;\n  }\n\n  toBeVisible(pct) {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.VisibleMatcher(pct).not : new matchers.VisibleMatcher(pct));\n  }\n\n  toBeNotVisible() {\n    return this.not.toBeVisible();\n  }\n\n  toExist() {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.ExistsMatcher().not : new matchers.ExistsMatcher());\n  }\n\n  toNotExist() {\n    return this.not.toExist();\n  }\n\n  toHaveText(text) {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.TextMatcher(text).not : new matchers.TextMatcher(text));\n  }\n\n  toNotHaveText(text) {\n    return this.not.toHaveText(text);\n  }\n\n  toHaveLabel(value) {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.LabelMatcher(value).not : new matchers.LabelMatcher(value));\n  }\n\n  toNotHaveLabel(value) {\n    return this.not.toHaveLabel(value);\n  }\n\n  toHaveId(value) {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.IdMatcher(value).not : new matchers.IdMatcher(value));\n  }\n\n  toNotHaveId(value) {\n    return this.not.toHaveId(value);\n  }\n\n  toHaveValue(value) {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.ValueMatcher(value).not : new matchers.ValueMatcher(value));\n  }\n\n  toNotHaveValue(value) {\n    return this.not.toHaveValue(value);\n  }\n\n  toBeFocused() {\n    return new WaitForInteraction(this._invocationManager, this._element, this._notCondition ? new matchers.FocusMatcher().not : new matchers.FocusMatcher());\n  }\n\n  toBeNotFocused() {\n    return this.not.toBeFocused();\n  }\n}\n\nmodule.exports = {\n  NativeWaitFor,\n  NativeWaitForElement,\n};\n"
  },
  {
    "path": "detox/src/android/core/WebElement.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst invoke = require('../../invoke');\nconst assertIsFunction = require('../../utils/assertIsFunction');\nconst isArrowFunction = require('../../utils/isArrowFunction');\nconst actions = require('../actions/web');\nconst EspressoWebDetoxApi = require('../espressoapi/web/EspressoWebDetox');\nconst WebViewElementApi = require('../espressoapi/web/WebViewElement');\nconst { ActionInteraction } = require('../interactions/web');\n\nconst { WebMatcher } = require('./WebMatcher');\n\nconst _device = Symbol('device');\nconst _emitter = Symbol('emitter');\nconst _matcher = Symbol('matcher');\nconst _invocationManager = Symbol('invocationManager');\nconst _webMatcher = Symbol('webMatcher');\nconst _webViewElement = Symbol('webViewElement');\n\nclass WebElement {\n  constructor({ device, invocationManager, webMatcher, webViewElement }) {\n    this[_device] = device;\n    this[_invocationManager] = invocationManager;\n    this[_webMatcher] = webMatcher;\n    this[_webViewElement] = webViewElement;\n\n    this.atIndex(0);\n  }\n\n  asSecured() {\n    throw new DetoxRuntimeError('asSecured() is not supported for Android WebElement');\n  }\n\n  atIndex(index) {\n    const webViewElementCall = this[_webViewElement]._call;\n    const webMatcherCall = this[_webMatcher]._call;\n\n    this._call = invoke.callDirectly(WebViewElementApi.element(webViewElementCall, webMatcherCall.value, index));\n    return this;\n  }\n\n  async executeAction(action) {\n    const result = await new ActionInteraction(this[_invocationManager], action).execute();\n    // Workaround since Detox doesn't wait for the action to complete.\n    await new Promise(resolve => setTimeout(resolve, 500));\n    return result;\n  }\n\n  async tap() {\n    return await this.executeAction(new actions.WebTapAction(this));\n  }\n\n  async typeText(text, isContentEditable = false) {\n    if (isContentEditable) {\n      return await this[_device]._typeText(text);\n    }\n    return await this.executeAction(new actions.WebTypeTextAction(this, text));\n  }\n\n  // At the moment not working on content-editable\n  async replaceText(text) {\n    return await this.executeAction(new actions.WebReplaceTextAction(this, text));\n  }\n\n  // At the moment not working on content-editable\n  async clearText() {\n    return await this.executeAction(new actions.WebClearTextAction(this));\n  }\n\n  async scrollToView() {\n    return await this.executeAction(new actions.WebScrollToViewAction(this));\n  }\n\n  async getText() {\n    return await this.executeAction(new actions.WebGetTextAction(this));\n  }\n\n  async focus() {\n    return await this.executeAction(new actions.WebFocusAction(this));\n  }\n\n  async selectAllText() {\n    return await this.executeAction(new actions.WebSelectAllText(this));\n  }\n\n  async moveCursorToEnd() {\n    return await this.executeAction(new actions.WebMoveCursorEnd(this));\n  }\n\n  async runScript(maybeFunction, args) {\n    const script = stringifyScript(maybeFunction);\n\n    if (args) {\n      return await this.executeAction(new actions.WebRunScriptWithArgsAction(this, script, args));\n    } else {\n      return await this.executeAction(new actions.WebRunScriptAction(this, script));\n    }\n  }\n\n  async getCurrentUrl() {\n    return await this.executeAction(new actions.WebGetCurrentUrlAction(this));\n  }\n\n  async getTitle() {\n    return await this.executeAction(new actions.WebGetTitleAction(this));\n  }\n}\n\nclass WebViewElement {\n  constructor({ device, emitter, invocationManager, matcher }) {\n    this[_device] = device;\n    this[_emitter] = emitter;\n    this[_invocationManager] = invocationManager;\n    this[_matcher] = matcher;\n\n    if (matcher !== undefined) {\n      this._call = invoke.callDirectly(EspressoWebDetoxApi.getWebView(matcher._call.value));\n    } else {\n      this._call = invoke.callDirectly(EspressoWebDetoxApi.getWebView());\n  }\n\n    this.element = this.element.bind(this);\n  }\n\n  element(webMatcher) {\n    if (webMatcher instanceof WebMatcher) {\n      return new WebElement({\n        device: this[_device],\n        invocationManager: this[_invocationManager],\n        webViewElement: this,\n        webMatcher,\n      });\n    }\n\n    throw new DetoxRuntimeError(`element() argument is invalid, expected a web matcher, but got ${typeof webMatcher}`);\n  }\n\n  atIndex(_index) {\n    // Not implemented yet\n    throw new DetoxRuntimeError('atIndex() is not supported for Android WebViewElement');\n  }\n}\n\nfunction stringifyScript(maybeFunction) {\n  if (typeof maybeFunction !== 'string' && typeof maybeFunction !== 'function') {\n    return maybeFunction;\n  }\n\n  const script = (typeof maybeFunction === 'function' ? maybeFunction.toString() : assertIsFunction(maybeFunction)).trim();\n  // WebElement interactions don't support arrow functions for some reason.\n  if (isArrowFunction(script)) {\n    return `function arrowWorkaround() { return (${script}).apply(this, arguments); }`;\n  }\n\n  return script;\n}\n\nmodule.exports = {\n  WebElement,\n  WebViewElement,\n};\n"
  },
  {
    "path": "detox/src/android/core/WebExpect.js",
    "content": "const invoke = require('../../invoke');\nconst { WebExistsAssertion, WebHasTextAssertion } = require('../actions/web');\nconst EspressoWebDetoxApi = require('../espressoapi/web/EspressoWebDetox');\nconst { WebAssertionInteraction } = require('../interactions/web');\n\nclass WebExpect {\n  constructor(invocationManager) {\n    this._invocationManager = invocationManager;\n    this._notCondition = false;\n  }\n\n  get not() {\n    this._notCondition = true;\n    return this;\n  }\n}\n\nclass WebExpectElement extends WebExpect {\n  constructor(invocationManager, webElement) {\n    super(invocationManager);\n    this._call = invoke.callDirectly(EspressoWebDetoxApi.expect(webElement._call.value));\n  }\n\n  async toHaveText(text) {\n    return await new WebAssertionInteraction(this._invocationManager, new WebHasTextAssertion(this, text)).execute();\n  }\n\n  async toExist() {\n    return await new WebAssertionInteraction(this._invocationManager, new WebExistsAssertion(this)).execute();\n  }\n}\n\nmodule.exports = {\n  WebExpect,\n  WebExpectElement,\n};\n"
  },
  {
    "path": "detox/src/android/core/WebMatcher.js",
    "content": "class WebMatcher {\n\n}\n\nmodule.exports = {\n  WebMatcher,\n};\n"
  },
  {
    "path": "detox/src/android/espressoapi/Detox.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass Detox {\n  static setUpCustomEspressoIdlingResources(element) {\n    return {\n      target: element,\n      method: \"setUpCustomEspressoIdlingResources\",\n      args: []\n    };\n  }\n\n  static runDetoxTests(element) {\n    return {\n      target: element,\n      method: \"runDetoxTests\",\n      args: []\n    };\n  }\n\n  static launchMainActivity() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.Detox\"\n      },\n      method: \"launchMainActivity\",\n      args: []\n    };\n  }\n\n  static startActivityFromUrl(url) {\n    if (typeof url !== \"string\") throw new Error(\"url should be a string, but got \" + (url + (\" (\" + (typeof url + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.Detox\"\n      },\n      method: \"startActivityFromUrl\",\n      args: [url]\n    };\n  }\n\n  static startActivityFromNotification(dataFilePath) {\n    if (typeof dataFilePath !== \"string\") throw new Error(\"dataFilePath should be a string, but got \" + (dataFilePath + (\" (\" + (typeof dataFilePath + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.Detox\"\n      },\n      method: \"startActivityFromNotification\",\n      args: [dataFilePath]\n    };\n  }\n\n  static getAppContext() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.Detox\"\n      },\n      method: \"getAppContext\",\n      args: []\n    };\n  }\n\n  static generateViewHierarchyXml(shouldInjectTestIds) {\n    if (typeof shouldInjectTestIds !== \"boolean\") throw new Error(\"shouldInjectTestIds should be a boolean, but got \" + (shouldInjectTestIds + (\" (\" + (typeof shouldInjectTestIds + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.Detox\"\n      },\n      method: \"generateViewHierarchyXml\",\n      args: [{\n        type: \"boolean\",\n        value: shouldInjectTestIds\n      }]\n    };\n  }\n\n}\n\nmodule.exports = Detox;"
  },
  {
    "path": "detox/src/android/espressoapi/DetoxAction.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_android_edge(edge) {\n  switch (edge) {\n    case 'left':\n      return 1;\n    case 'right':\n      return 2;\n    case 'top':\n      return 3;\n    case 'bottom':\n      return 4;\n    default:\n      throw new Error(`edge must be a 'left'/'right'/'top'/'bottom', got ${edge}`);\n  }\n} \nfunction sanitize_android_direction(direction) {\n  switch (direction) {\n    case 'left':\n      return 1;\n    case 'right':\n      return 2;\n    case 'up':\n      return 3;\n    case 'down':\n      return 4;\n    default:\n      throw new Error(`direction must be a 'left'/'right'/'up'/'down', got ${direction}`);\n  }\n} \nclass DetoxAction {\n  static multiClick(times) {\n    if (typeof times !== \"number\") throw new Error(\"times should be a number, but got \" + (times + (\" (\" + (typeof times + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"multiClick\",\n      args: [{\n        type: \"Integer\",\n        value: times\n      }]\n    };\n  }\n\n  static tapAtLocation(x, y) {\n    if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n    if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"tapAtLocation\",\n      args: [{\n        type: \"Integer\",\n        value: x\n      }, {\n        type: \"Integer\",\n        value: y\n      }]\n    };\n  }\n\n  static createCoordinatesProvider(x, y) {\n    if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n    if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"createCoordinatesProvider\",\n      args: [{\n        type: \"Integer\",\n        value: x\n      }, {\n        type: \"Integer\",\n        value: y\n      }]\n    };\n  }\n\n  static scrollToEdge(edge, startOffsetPercentX, startOffsetPercentY) {\n    if (typeof edge !== \"string\") throw new Error(\"edge should be a string, but got \" + (edge + (\" (\" + (typeof edge + \")\"))));\n    if (typeof startOffsetPercentX !== \"number\") throw new Error(\"startOffsetPercentX should be a number, but got \" + (startOffsetPercentX + (\" (\" + (typeof startOffsetPercentX + \")\"))));\n    if (typeof startOffsetPercentY !== \"number\") throw new Error(\"startOffsetPercentY should be a number, but got \" + (startOffsetPercentY + (\" (\" + (typeof startOffsetPercentY + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"scrollToEdge\",\n      args: [{\n        type: \"Integer\",\n        value: sanitize_android_edge(edge)\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentX\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentY\n      }]\n    };\n  }\n\n  static scrollInDirection(direction, amountInDP, startOffsetPercentX, startOffsetPercentY) {\n    if (typeof direction !== \"string\") throw new Error(\"direction should be a string, but got \" + (direction + (\" (\" + (typeof direction + \")\"))));\n    if (typeof amountInDP !== \"number\") throw new Error(\"amountInDP should be a number, but got \" + (amountInDP + (\" (\" + (typeof amountInDP + \")\"))));\n    if (typeof startOffsetPercentX !== \"number\") throw new Error(\"startOffsetPercentX should be a number, but got \" + (startOffsetPercentX + (\" (\" + (typeof startOffsetPercentX + \")\"))));\n    if (typeof startOffsetPercentY !== \"number\") throw new Error(\"startOffsetPercentY should be a number, but got \" + (startOffsetPercentY + (\" (\" + (typeof startOffsetPercentY + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"scrollInDirection\",\n      args: [{\n        type: \"Integer\",\n        value: sanitize_android_direction(direction)\n      }, {\n        type: \"Double\",\n        value: amountInDP\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentX\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentY\n      }]\n    };\n  }\n\n  static scrollInDirectionStaleAtEdge(direction, amountInDP, startOffsetPercentX, startOffsetPercentY) {\n    if (typeof direction !== \"string\") throw new Error(\"direction should be a string, but got \" + (direction + (\" (\" + (typeof direction + \")\"))));\n    if (typeof amountInDP !== \"number\") throw new Error(\"amountInDP should be a number, but got \" + (amountInDP + (\" (\" + (typeof amountInDP + \")\"))));\n    if (typeof startOffsetPercentX !== \"number\") throw new Error(\"startOffsetPercentX should be a number, but got \" + (startOffsetPercentX + (\" (\" + (typeof startOffsetPercentX + \")\"))));\n    if (typeof startOffsetPercentY !== \"number\") throw new Error(\"startOffsetPercentY should be a number, but got \" + (startOffsetPercentY + (\" (\" + (typeof startOffsetPercentY + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"scrollInDirectionStaleAtEdge\",\n      args: [{\n        type: \"Integer\",\n        value: sanitize_android_direction(direction)\n      }, {\n        type: \"Double\",\n        value: amountInDP\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentX\n      }, {\n        type: \"Double\",\n        value: startOffsetPercentY\n      }]\n    };\n  }\n\n  static swipeInDirection(direction, fast, normalizedOffset, normalizedStartingPointX, normalizedStartingPointY) {\n    if (typeof direction !== \"string\") throw new Error(\"direction should be a string, but got \" + (direction + (\" (\" + (typeof direction + \")\"))));\n    if (typeof fast !== \"boolean\") throw new Error(\"fast should be a boolean, but got \" + (fast + (\" (\" + (typeof fast + \")\"))));\n    if (typeof normalizedOffset !== \"number\") throw new Error(\"normalizedOffset should be a number, but got \" + (normalizedOffset + (\" (\" + (typeof normalizedOffset + \")\"))));\n    if (typeof normalizedStartingPointX !== \"number\") throw new Error(\"normalizedStartingPointX should be a number, but got \" + (normalizedStartingPointX + (\" (\" + (typeof normalizedStartingPointX + \")\"))));\n    if (typeof normalizedStartingPointY !== \"number\") throw new Error(\"normalizedStartingPointY should be a number, but got \" + (normalizedStartingPointY + (\" (\" + (typeof normalizedStartingPointY + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"swipeInDirection\",\n      args: [{\n        type: \"Integer\",\n        value: sanitize_android_direction(direction)\n      }, {\n        type: \"boolean\",\n        value: fast\n      }, {\n        type: \"Double\",\n        value: normalizedOffset\n      }, {\n        type: \"Double\",\n        value: normalizedStartingPointX\n      }, {\n        type: \"Double\",\n        value: normalizedStartingPointY\n      }]\n    };\n  }\n\n  static getAttributes() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"getAttributes\",\n      args: []\n    };\n  }\n\n  static scrollToIndex(index) {\n    if (typeof index !== \"number\") throw new Error(\"index should be a number, but got \" + (index + (\" (\" + (typeof index + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"scrollToIndex\",\n      args: [{\n        type: \"Integer\",\n        value: index\n      }]\n    };\n  }\n\n  static setDatePickerDate(dateString, formatString) {\n    if (typeof dateString !== \"string\") throw new Error(\"dateString should be a string, but got \" + (dateString + (\" (\" + (typeof dateString + \")\"))));\n    if (typeof formatString !== \"string\") throw new Error(\"formatString should be a string, but got \" + (formatString + (\" (\" + (typeof formatString + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"setDatePickerDate\",\n      args: [dateString, formatString]\n    };\n  }\n\n  static adjustSliderToPosition(newPosition) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"adjustSliderToPosition\",\n      args: [{\n        type: \"Float\",\n        value: newPosition\n      }]\n    };\n  }\n\n  static longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, isFast, holdDuration) {\n    if (typeof duration !== \"number\") throw new Error(\"duration should be a number, but got \" + (duration + (\" (\" + (typeof duration + \")\"))));\n    if (typeof normalizedPositionX !== \"number\") throw new Error(\"normalizedPositionX should be a number, but got \" + (normalizedPositionX + (\" (\" + (typeof normalizedPositionX + \")\"))));\n    if (typeof normalizedPositionY !== \"number\") throw new Error(\"normalizedPositionY should be a number, but got \" + (normalizedPositionY + (\" (\" + (typeof normalizedPositionY + \")\"))));\n    if (typeof normalizedTargetPositionX !== \"number\") throw new Error(\"normalizedTargetPositionX should be a number, but got \" + (normalizedTargetPositionX + (\" (\" + (typeof normalizedTargetPositionX + \")\"))));\n    if (typeof normalizedTargetPositionY !== \"number\") throw new Error(\"normalizedTargetPositionY should be a number, but got \" + (normalizedTargetPositionY + (\" (\" + (typeof normalizedTargetPositionY + \")\"))));\n    if (typeof isFast !== \"boolean\") throw new Error(\"isFast should be a boolean, but got \" + (isFast + (\" (\" + (typeof isFast + \")\"))));\n    if (typeof holdDuration !== \"number\") throw new Error(\"holdDuration should be a number, but got \" + (holdDuration + (\" (\" + (typeof holdDuration + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"longPressAndDrag\",\n      args: [{\n        type: \"Integer\",\n        value: duration\n      }, {\n        type: \"Double\",\n        value: normalizedPositionX\n      }, {\n        type: \"Double\",\n        value: normalizedPositionY\n      }, {\n        type: \"Invocation\",\n        value: targetElement\n      }, {\n        type: \"Double\",\n        value: normalizedTargetPositionX\n      }, {\n        type: \"Double\",\n        value: normalizedTargetPositionY\n      }, {\n        type: \"boolean\",\n        value: isFast\n      }, {\n        type: \"Integer\",\n        value: holdDuration\n      }]\n    };\n  }\n\n  static longPress() {\n    function longPress0() {\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.DetoxAction\"\n        },\n        method: \"longPress\",\n        args: []\n      };\n    }\n\n    function longPress1(duration) {\n      if (typeof duration !== \"number\") throw new Error(\"duration should be a number, but got \" + (duration + (\" (\" + (typeof duration + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.DetoxAction\"\n        },\n        method: \"longPress\",\n        args: [{\n          type: \"Integer\",\n          value: duration\n        }]\n      };\n    }\n\n    function longPress2(x, y) {\n      if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n      if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.DetoxAction\"\n        },\n        method: \"longPress\",\n        args: [{\n          type: \"Integer\",\n          value: x\n        }, {\n          type: \"Integer\",\n          value: y\n        }]\n      };\n    }\n\n    function longPress3(x, y, duration) {\n      if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n      if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n      if (typeof duration !== \"number\") throw new Error(\"duration should be a number, but got \" + (duration + (\" (\" + (typeof duration + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.DetoxAction\"\n        },\n        method: \"longPress\",\n        args: [{\n          type: \"Integer\",\n          value: x\n        }, {\n          type: \"Integer\",\n          value: y\n        }, {\n          type: \"Integer\",\n          value: duration\n        }]\n      };\n    }\n\n    if (arguments.length === 0) {\n      return longPress0.apply(null, arguments);\n    }\n\n    if (arguments.length === 1) {\n      return longPress1.apply(null, arguments);\n    }\n\n    if (arguments.length === 2) {\n      return longPress2.apply(null, arguments);\n    }\n\n    if (arguments.length === 3) {\n      return longPress3.apply(null, arguments);\n    }\n  }\n\n  static takeViewScreenshot() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"takeViewScreenshot\",\n      args: []\n    };\n  }\n\n  static accessibilityAction(actionName) {\n    if (typeof actionName !== \"string\") throw new Error(\"actionName should be a string, but got \" + (actionName + (\" (\" + (typeof actionName + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"accessibilityAction\",\n      args: [actionName]\n    };\n  }\n\n  static parseDateISO8601(dateString) {\n    if (typeof dateString !== \"string\") throw new Error(\"dateString should be a string, but got \" + (dateString + (\" (\" + (typeof dateString + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAction\"\n      },\n      method: \"parseDateISO8601\",\n      args: [dateString]\n    };\n  }\n\n}\n\nmodule.exports = DetoxAction;"
  },
  {
    "path": "detox/src/android/espressoapi/DetoxAssertion.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} \nclass DetoxAssertion {\n  static assertMatcher(viewInteraction, viewMatcher) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAssertion\"\n      },\n      method: \"assertMatcher\",\n      args: [{\n        type: \"Invocation\",\n        value: viewInteraction\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(viewMatcher)\n      }]\n    };\n  }\n\n  static assertNotVisible(viewInteraction) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAssertion\"\n      },\n      method: \"assertNotVisible\",\n      args: [{\n        type: \"Invocation\",\n        value: viewInteraction\n      }]\n    };\n  }\n\n  static assertNotExists(viewInteraction) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAssertion\"\n      },\n      method: \"assertNotExists\",\n      args: [{\n        type: \"Invocation\",\n        value: viewInteraction\n      }]\n    };\n  }\n\n  static waitForAssertMatcher(viewInteraction, viewMatcher, timeoutSeconds) {\n    if (typeof timeoutSeconds !== \"number\") throw new Error(\"timeoutSeconds should be a number, but got \" + (timeoutSeconds + (\" (\" + (typeof timeoutSeconds + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAssertion\"\n      },\n      method: \"waitForAssertMatcher\",\n      args: [{\n        type: \"Invocation\",\n        value: viewInteraction\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(viewMatcher)\n      }, {\n        type: \"Double\",\n        value: timeoutSeconds\n      }]\n    };\n  }\n\n  static waitForAssertMatcherWithSearchAction(viewInteraction, viewMatcher, searchAction, searchMatcher\n  ) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxAssertion\"\n      },\n      method: \"waitForAssertMatcherWithSearchAction\",\n      args: [{\n        type: \"Invocation\",\n        value: viewInteraction\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(viewMatcher)\n      }, searchAction, {\n        type: \"Invocation\",\n        value: sanitize_matcher(searchMatcher\n        )\n      }]\n    };\n  }\n\n}\n\nmodule.exports = DetoxAssertion;"
  },
  {
    "path": "detox/src/android/espressoapi/DetoxGenymotionManager.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass DetoxGenymotionManager {\n  static setLocation(lat, lon) {\n    if (typeof lat !== \"number\") throw new Error(\"lat should be a number, but got \" + (lat + (\" (\" + (typeof lat + \")\"))));\n    if (typeof lon !== \"number\") throw new Error(\"lon should be a number, but got \" + (lon + (\" (\" + (typeof lon + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.genymotion.DetoxGenymotionManager\"\n      },\n      method: \"setLocation\",\n      args: [{\n        type: \"Double\",\n        value: lat\n      }, {\n        type: \"Double\",\n        value: lon\n      }]\n    };\n  }\n\n  static getGenymotionManager() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.genymotion.DetoxGenymotionManager\"\n      },\n      method: \"getGenymotionManager\",\n      args: []\n    };\n  }\n\n}\n\nmodule.exports = DetoxGenymotionManager;"
  },
  {
    "path": "detox/src/android/espressoapi/DetoxMatcher.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} \nclass DetoxMatcher {\n  static matcherForText(text, isRegex) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    if (typeof isRegex !== \"boolean\") throw new Error(\"isRegex should be a boolean, but got \" + (isRegex + (\" (\" + (typeof isRegex + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForText\",\n      args: [text, {\n        type: \"boolean\",\n        value: isRegex\n      }]\n    };\n  }\n\n  static matcherForAccessibilityLabel(label, isRegex) {\n    if (typeof label !== \"string\") throw new Error(\"label should be a string, but got \" + (label + (\" (\" + (typeof label + \")\"))));\n    if (typeof isRegex !== \"boolean\") throw new Error(\"isRegex should be a boolean, but got \" + (isRegex + (\" (\" + (typeof isRegex + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForAccessibilityLabel\",\n      args: [label, {\n        type: \"boolean\",\n        value: isRegex\n      }]\n    };\n  }\n\n  static matcherForShallowAccessibilityLabel(label, isRegex) {\n    if (typeof label !== \"string\") throw new Error(\"label should be a string, but got \" + (label + (\" (\" + (typeof label + \")\"))));\n    if (typeof isRegex !== \"boolean\") throw new Error(\"isRegex should be a boolean, but got \" + (isRegex + (\" (\" + (typeof isRegex + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForShallowAccessibilityLabel\",\n      args: [label, {\n        type: \"boolean\",\n        value: isRegex\n      }]\n    };\n  }\n\n  static matcherForContentDescription(contentDescription) {\n    if (typeof contentDescription !== \"string\") throw new Error(\"contentDescription should be a string, but got \" + (contentDescription + (\" (\" + (typeof contentDescription + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForContentDescription\",\n      args: [contentDescription]\n    };\n  }\n\n  static matcherForTestId(testId, isRegex) {\n    if (typeof testId !== \"string\") throw new Error(\"testId should be a string, but got \" + (testId + (\" (\" + (typeof testId + \")\"))));\n    if (typeof isRegex !== \"boolean\") throw new Error(\"isRegex should be a boolean, but got \" + (isRegex + (\" (\" + (typeof isRegex + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForTestId\",\n      args: [testId, {\n        type: \"boolean\",\n        value: isRegex\n      }]\n    };\n  }\n\n  static matcherForToggleable(value) {\n    if (typeof value !== \"boolean\") throw new Error(\"value should be a boolean, but got \" + (value + (\" (\" + (typeof value + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForToggleable\",\n      args: [{\n        type: \"boolean\",\n        value: value\n      }]\n    };\n  }\n\n  static matcherForAnd(m1, m2) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForAnd\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(m1)\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(m2)\n      }]\n    };\n  }\n\n  static matcherForOr(m1, m2) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForOr\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(m1)\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(m2)\n      }]\n    };\n  }\n\n  static matcherForNot(m) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForNot\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(m)\n      }]\n    };\n  }\n\n  static matcherWithAncestor(m, ancestorMatcher) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherWithAncestor\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(m)\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(ancestorMatcher)\n      }]\n    };\n  }\n\n  static matcherWithDescendant(m, descendantMatcher) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherWithDescendant\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(m)\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(descendantMatcher)\n      }]\n    };\n  }\n\n  static matcherForClass(className) {\n    if (typeof className !== \"string\") throw new Error(\"className should be a string, but got \" + (className + (\" (\" + (typeof className + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForClass\",\n      args: [className]\n    };\n  }\n\n  static matcherForSufficientlyVisible(pct) {\n    if (typeof pct !== \"number\") throw new Error(\"pct should be a number, but got \" + (pct + (\" (\" + (typeof pct + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForSufficientlyVisible\",\n      args: [{\n        type: \"Integer\",\n        value: pct\n      }]\n    };\n  }\n\n  static matcherForNotVisible() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForNotVisible\",\n      args: []\n    };\n  }\n\n  static matcherForNotNull() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForNotNull\",\n      args: []\n    };\n  }\n\n  static matcherForNull() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForNull\",\n      args: []\n    };\n  }\n\n  static matcherForAtIndex(index, innerMatcher) {\n    if (typeof index !== \"number\") throw new Error(\"index should be a number, but got \" + (index + (\" (\" + (typeof index + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForAtIndex\",\n      args: [{\n        type: \"Integer\",\n        value: index\n      }, {\n        type: \"Invocation\",\n        value: sanitize_matcher(innerMatcher)\n      }]\n    };\n  }\n\n  static matcherForAnything() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForAnything\",\n      args: []\n    };\n  }\n\n  static matcherForFocus() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForFocus\",\n      args: []\n    };\n  }\n\n  static matcherForSliderPosition(position, tolerance) {\n    if (typeof position !== \"number\") throw new Error(\"position should be a number, but got \" + (position + (\" (\" + (typeof position + \")\"))));\n    if (typeof tolerance !== \"number\") throw new Error(\"tolerance should be a number, but got \" + (tolerance + (\" (\" + (typeof tolerance + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxMatcher\"\n      },\n      method: \"matcherForSliderPosition\",\n      args: [{\n        type: \"Double\",\n        value: position\n      }, {\n        type: \"Double\",\n        value: tolerance\n      }]\n    };\n  }\n\n}\n\nmodule.exports = DetoxMatcher;"
  },
  {
    "path": "detox/src/android/espressoapi/DetoxViewActions.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass DetoxViewActions {\n  static click() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxViewActions\"\n      },\n      method: \"click\",\n      args: []\n    };\n  }\n\n  static typeText(text) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.DetoxViewActions\"\n      },\n      method: \"typeText\",\n      args: [text]\n    };\n  }\n\n}\n\nmodule.exports = DetoxViewActions;"
  },
  {
    "path": "detox/src/android/espressoapi/EspressoDetox.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} \nclass EspressoDetox {\n  static perform(matcher, action) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.EspressoDetox\"\n      },\n      method: \"perform\",\n      args: [{\n        type: \"Invocation\",\n        value: sanitize_matcher(matcher)\n      }, action]\n    };\n  }\n\n  static changeOrientation(orientation) {\n    if (typeof orientation !== \"number\") throw new Error(\"orientation should be a number, but got \" + (orientation + (\" (\" + (typeof orientation + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.EspressoDetox\"\n      },\n      method: \"changeOrientation\",\n      args: [{\n        type: \"Integer\",\n        value: orientation\n      }]\n    };\n  }\n\n  static setSynchronization(enabled) {\n    if (typeof enabled !== \"boolean\") throw new Error(\"enabled should be a boolean, but got \" + (enabled + (\" (\" + (typeof enabled + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.EspressoDetox\"\n      },\n      method: \"setSynchronization\",\n      args: [{\n        type: \"boolean\",\n        value: enabled\n      }]\n    };\n  }\n\n  static setURLBlacklist(urls) {\n    if (typeof urls !== 'object' || !Array.isArray(urls)) {\n      throw new Error('urls must be an array, got ' + typeof urls);\n    }\n\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.EspressoDetox\"\n      },\n      method: \"setURLBlacklist\",\n      args: [urls]\n    };\n  }\n\n  static tap(x, y, shouldIgnoreStatusBar) {\n    if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n    if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n    if (typeof shouldIgnoreStatusBar !== \"boolean\") throw new Error(\"shouldIgnoreStatusBar should be a boolean, but got \" + (shouldIgnoreStatusBar + (\" (\" + (typeof shouldIgnoreStatusBar + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.EspressoDetox\"\n      },\n      method: \"tap\",\n      args: [{\n        type: \"Integer\",\n        value: x\n      }, {\n        type: \"Integer\",\n        value: y\n      }, {\n        type: \"boolean\",\n        value: shouldIgnoreStatusBar\n      }]\n    };\n  }\n\n  static longPress(x, y, shouldIgnoreStatusBar) {\n    function longPress3(x, y, shouldIgnoreStatusBar) {\n      if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n      if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n      if (typeof shouldIgnoreStatusBar !== \"boolean\") throw new Error(\"shouldIgnoreStatusBar should be a boolean, but got \" + (shouldIgnoreStatusBar + (\" (\" + (typeof shouldIgnoreStatusBar + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.EspressoDetox\"\n        },\n        method: \"longPress\",\n        args: [{\n          type: \"Integer\",\n          value: x\n        }, {\n          type: \"Integer\",\n          value: y\n        }, {\n          type: \"boolean\",\n          value: shouldIgnoreStatusBar\n        }]\n      };\n    }\n\n    function longPress4(x, y, duration, shouldIgnoreStatusBar) {\n      if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n      if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n      if (typeof duration !== \"number\") throw new Error(\"duration should be a number, but got \" + (duration + (\" (\" + (typeof duration + \")\"))));\n      if (typeof shouldIgnoreStatusBar !== \"boolean\") throw new Error(\"shouldIgnoreStatusBar should be a boolean, but got \" + (shouldIgnoreStatusBar + (\" (\" + (typeof shouldIgnoreStatusBar + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.EspressoDetox\"\n        },\n        method: \"longPress\",\n        args: [{\n          type: \"Integer\",\n          value: x\n        }, {\n          type: \"Integer\",\n          value: y\n        }, {\n          type: \"Integer\",\n          value: duration\n        }, {\n          type: \"boolean\",\n          value: shouldIgnoreStatusBar\n        }]\n      };\n    }\n\n    if (arguments.length === 3) {\n      return longPress3.apply(null, arguments);\n    }\n\n    if (arguments.length === 4) {\n      return longPress4.apply(null, arguments);\n    }\n  }\n\n}\n\nmodule.exports = EspressoDetox;"
  },
  {
    "path": "detox/src/android/espressoapi/UIAutomator.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass UiAutomator {\n  static uiDevice() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.uiautomator.UiAutomator\"\n      },\n      method: \"uiDevice\",\n      args: []\n    };\n  }\n\n}\n\nmodule.exports = UiAutomator;"
  },
  {
    "path": "detox/src/android/espressoapi/UIDevice.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass UiDevice {\n  static setCompressedLayoutHeirarchy(element, compressed) {\n    if (typeof compressed !== \"boolean\") throw new Error(\"compressed should be a boolean, but got \" + (compressed + (\" (\" + (typeof compressed + \")\"))));\n    return {\n      target: element,\n      method: \"setCompressedLayoutHeirarchy\",\n      args: [{\n        type: \"boolean\",\n        value: compressed\n      }]\n    };\n  }\n\n  static getInstance() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.android.uiautomator.core.UiDevice\"\n      },\n      method: \"getInstance\",\n      args: []\n    };\n  }\n\n  static getDisplaySizeDp(element) {\n    return {\n      target: element,\n      method: \"getDisplaySizeDp\",\n      args: []\n    };\n  }\n\n  static getProductName(element) {\n    return {\n      target: element,\n      method: \"getProductName\",\n      args: []\n    };\n  }\n\n  static getLastTraversedText(element) {\n    return {\n      target: element,\n      method: \"getLastTraversedText\",\n      args: []\n    };\n  }\n\n  static clearLastTraversedText(element) {\n    return {\n      target: element,\n      method: \"clearLastTraversedText\",\n      args: []\n    };\n  }\n\n  static pressMenu(element) {\n    return {\n      target: element,\n      method: \"pressMenu\",\n      args: []\n    };\n  }\n\n  static pressBack(element) {\n    return {\n      target: element,\n      method: \"pressBack\",\n      args: []\n    };\n  }\n\n  static pressHome(element) {\n    return {\n      target: element,\n      method: \"pressHome\",\n      args: []\n    };\n  }\n\n  static pressSearch(element) {\n    return {\n      target: element,\n      method: \"pressSearch\",\n      args: []\n    };\n  }\n\n  static pressDPadCenter(element) {\n    return {\n      target: element,\n      method: \"pressDPadCenter\",\n      args: []\n    };\n  }\n\n  static pressDPadDown(element) {\n    return {\n      target: element,\n      method: \"pressDPadDown\",\n      args: []\n    };\n  }\n\n  static pressDPadUp(element) {\n    return {\n      target: element,\n      method: \"pressDPadUp\",\n      args: []\n    };\n  }\n\n  static pressDPadLeft(element) {\n    return {\n      target: element,\n      method: \"pressDPadLeft\",\n      args: []\n    };\n  }\n\n  static pressDPadRight(element) {\n    return {\n      target: element,\n      method: \"pressDPadRight\",\n      args: []\n    };\n  }\n\n  static pressDelete(element) {\n    return {\n      target: element,\n      method: \"pressDelete\",\n      args: []\n    };\n  }\n\n  static pressEnter(element) {\n    return {\n      target: element,\n      method: \"pressEnter\",\n      args: []\n    };\n  }\n\n  static pressKeyCode(element, keyCode) {\n    function pressKeyCode2(element, keyCode) {\n      if (typeof keyCode !== \"number\") throw new Error(\"keyCode should be a number, but got \" + (keyCode + (\" (\" + (typeof keyCode + \")\"))));\n      return {\n        target: element,\n        method: \"pressKeyCode\",\n        args: [{\n          type: \"Integer\",\n          value: keyCode\n        }]\n      };\n    }\n\n    function pressKeyCode3(element, keyCode, metaState) {\n      if (typeof keyCode !== \"number\") throw new Error(\"keyCode should be a number, but got \" + (keyCode + (\" (\" + (typeof keyCode + \")\"))));\n      if (typeof metaState !== \"number\") throw new Error(\"metaState should be a number, but got \" + (metaState + (\" (\" + (typeof metaState + \")\"))));\n      return {\n        target: element,\n        method: \"pressKeyCode\",\n        args: [{\n          type: \"Integer\",\n          value: keyCode\n        }, {\n          type: \"Integer\",\n          value: metaState\n        }]\n      };\n    }\n\n    if (arguments.length === 2) {\n      return pressKeyCode2.apply(null, arguments);\n    }\n\n    if (arguments.length === 3) {\n      return pressKeyCode3.apply(null, arguments);\n    }\n  }\n\n  static pressRecentApps(element) {\n    return {\n      target: element,\n      method: \"pressRecentApps\",\n      args: []\n    };\n  }\n\n  static openNotification(element) {\n    return {\n      target: element,\n      method: \"openNotification\",\n      args: []\n    };\n  }\n\n  static openQuickSettings(element) {\n    return {\n      target: element,\n      method: \"openQuickSettings\",\n      args: []\n    };\n  }\n\n  static getDisplayWidth(element) {\n    return {\n      target: element,\n      method: \"getDisplayWidth\",\n      args: []\n    };\n  }\n\n  static getDisplayHeight(element) {\n    return {\n      target: element,\n      method: \"getDisplayHeight\",\n      args: []\n    };\n  }\n\n  static click(element, x, y) {\n    if (typeof x !== \"number\") throw new Error(\"x should be a number, but got \" + (x + (\" (\" + (typeof x + \")\"))));\n    if (typeof y !== \"number\") throw new Error(\"y should be a number, but got \" + (y + (\" (\" + (typeof y + \")\"))));\n    return {\n      target: element,\n      method: \"click\",\n      args: [{\n        type: \"Integer\",\n        value: x\n      }, {\n        type: \"Integer\",\n        value: y\n      }]\n    };\n  }\n\n  static swipe(element, startX, startY, endX, endY, steps) {\n    if (typeof startX !== \"number\") throw new Error(\"startX should be a number, but got \" + (startX + (\" (\" + (typeof startX + \")\"))));\n    if (typeof startY !== \"number\") throw new Error(\"startY should be a number, but got \" + (startY + (\" (\" + (typeof startY + \")\"))));\n    if (typeof endX !== \"number\") throw new Error(\"endX should be a number, but got \" + (endX + (\" (\" + (typeof endX + \")\"))));\n    if (typeof endY !== \"number\") throw new Error(\"endY should be a number, but got \" + (endY + (\" (\" + (typeof endY + \")\"))));\n    if (typeof steps !== \"number\") throw new Error(\"steps should be a number, but got \" + (steps + (\" (\" + (typeof steps + \")\"))));\n    return {\n      target: element,\n      method: \"swipe\",\n      args: [{\n        type: \"Integer\",\n        value: startX\n      }, {\n        type: \"Integer\",\n        value: startY\n      }, {\n        type: \"Integer\",\n        value: endX\n      }, {\n        type: \"Integer\",\n        value: endY\n      }, {\n        type: \"Integer\",\n        value: steps\n      }]\n    };\n  }\n\n  static drag(element, startX, startY, endX, endY, steps) {\n    if (typeof startX !== \"number\") throw new Error(\"startX should be a number, but got \" + (startX + (\" (\" + (typeof startX + \")\"))));\n    if (typeof startY !== \"number\") throw new Error(\"startY should be a number, but got \" + (startY + (\" (\" + (typeof startY + \")\"))));\n    if (typeof endX !== \"number\") throw new Error(\"endX should be a number, but got \" + (endX + (\" (\" + (typeof endX + \")\"))));\n    if (typeof endY !== \"number\") throw new Error(\"endY should be a number, but got \" + (endY + (\" (\" + (typeof endY + \")\"))));\n    if (typeof steps !== \"number\") throw new Error(\"steps should be a number, but got \" + (steps + (\" (\" + (typeof steps + \")\"))));\n    return {\n      target: element,\n      method: \"drag\",\n      args: [{\n        type: \"Integer\",\n        value: startX\n      }, {\n        type: \"Integer\",\n        value: startY\n      }, {\n        type: \"Integer\",\n        value: endX\n      }, {\n        type: \"Integer\",\n        value: endY\n      }, {\n        type: \"Integer\",\n        value: steps\n      }]\n    };\n  }\n\n  static waitForIdle(element) {\n    return {\n      target: element,\n      method: \"waitForIdle\",\n      args: []\n    };\n  }\n\n  static getCurrentActivityName(element) {\n    return {\n      target: element,\n      method: \"getCurrentActivityName\",\n      args: []\n    };\n  }\n\n  static getCurrentPackageName(element) {\n    return {\n      target: element,\n      method: \"getCurrentPackageName\",\n      args: []\n    };\n  }\n\n  static removeWatcher(element, name) {\n    if (typeof name !== \"string\") throw new Error(\"name should be a string, but got \" + (name + (\" (\" + (typeof name + \")\"))));\n    return {\n      target: element,\n      method: \"removeWatcher\",\n      args: [name]\n    };\n  }\n\n  static runWatchers(element) {\n    return {\n      target: element,\n      method: \"runWatchers\",\n      args: []\n    };\n  }\n\n  static resetWatcherTriggers(element) {\n    return {\n      target: element,\n      method: \"resetWatcherTriggers\",\n      args: []\n    };\n  }\n\n  static hasWatcherTriggered(element, watcherName) {\n    if (typeof watcherName !== \"string\") throw new Error(\"watcherName should be a string, but got \" + (watcherName + (\" (\" + (typeof watcherName + \")\"))));\n    return {\n      target: element,\n      method: \"hasWatcherTriggered\",\n      args: [watcherName]\n    };\n  }\n\n  static hasAnyWatcherTriggered(element) {\n    return {\n      target: element,\n      method: \"hasAnyWatcherTriggered\",\n      args: []\n    };\n  }\n\n  static setWatcherTriggered(element, watcherName) {\n    if (typeof watcherName !== \"string\") throw new Error(\"watcherName should be a string, but got \" + (watcherName + (\" (\" + (typeof watcherName + \")\"))));\n    return {\n      target: element,\n      method: \"setWatcherTriggered\",\n      args: [watcherName]\n    };\n  }\n\n  static isNaturalOrientation(element) {\n    return {\n      target: element,\n      method: \"isNaturalOrientation\",\n      args: []\n    };\n  }\n\n  static getDisplayRotation(element) {\n    return {\n      target: element,\n      method: \"getDisplayRotation\",\n      args: []\n    };\n  }\n\n  static freezeRotation(element) {\n    return {\n      target: element,\n      method: \"freezeRotation\",\n      args: []\n    };\n  }\n\n  static unfreezeRotation(element) {\n    return {\n      target: element,\n      method: \"unfreezeRotation\",\n      args: []\n    };\n  }\n\n  static setOrientationLeft(element) {\n    return {\n      target: element,\n      method: \"setOrientationLeft\",\n      args: []\n    };\n  }\n\n  static setOrientationRight(element) {\n    return {\n      target: element,\n      method: \"setOrientationRight\",\n      args: []\n    };\n  }\n\n  static setOrientationNatural(element) {\n    return {\n      target: element,\n      method: \"setOrientationNatural\",\n      args: []\n    };\n  }\n\n  static wakeUp(element) {\n    return {\n      target: element,\n      method: \"wakeUp\",\n      args: []\n    };\n  }\n\n  static isScreenOn(element) {\n    return {\n      target: element,\n      method: \"isScreenOn\",\n      args: []\n    };\n  }\n\n  static sleep(element) {\n    return {\n      target: element,\n      method: \"sleep\",\n      args: []\n    };\n  }\n\n  static dumpWindowHierarchy(element, fileName) {\n    if (typeof fileName !== \"string\") throw new Error(\"fileName should be a string, but got \" + (fileName + (\" (\" + (typeof fileName + \")\"))));\n    return {\n      target: element,\n      method: \"dumpWindowHierarchy\",\n      args: [fileName]\n    };\n  }\n\n}\n\nmodule.exports = UiDevice;"
  },
  {
    "path": "detox/src/android/espressoapi/UiDeviceProxy.js",
    "content": "const uiDevice = require('./UIDevice');\nconst uiAutomator = require('./UIAutomator');\nconst invoke = require('../../invoke');\n\nclass UiDeviceProxy {\n  constructor(invocationManager) {\n    this.invocationManager = invocationManager;\n    this.getUIDevice = this.getUIDevice.bind(this);\n  }\n\n  getUIDevice() {\n   return new Proxy(uiDevice, {\n      get: (target, prop) => {\n        if (target[prop] !== undefined) {\n          return async (...params) => {\n            const call = target[prop](invoke.callDirectly(uiAutomator.uiDevice()), ...params);\n            const invokeResult = await this.invocationManager.execute(call);\n            if (invokeResult && invokeResult.result) {\n                return invokeResult.result;\n            }\n          }\n        }\n      }\n    });\n  }\n}\n\nmodule.exports = UiDeviceProxy;\n"
  },
  {
    "path": "detox/src/android/espressoapi/UiDeviceProxy.test.js",
    "content": "const someCall = 'some_call';\nconst someInstance = 'some_instance';\nconst someDisplayHeight = 1920;\nconst invocationManager = {\n  execute() {\n    return {result: someDisplayHeight};\n  }\n};\ndescribe('ui device proxy', () => {\n  let uut;\n  let UiDeviceProxy;\n  let uiAutomation;\n  let uiDevice;\n  let invoke;\n\n  beforeEach(() => {\n    jest.clearAllMocks();\n    jest.mock('./UIAutomator');\n    jest.mock('./UIDevice');\n    jest.mock('../../invoke');\n    uiAutomation = require('./UIAutomator');\n    uiDevice = require('./UIDevice');\n    invoke = require('../../invoke');\n    UiDeviceProxy = require('./UiDeviceProxy');\n    uut = new UiDeviceProxy(invocationManager);\n  });\n\n  it('should delegate pressBack to UiDevice', async () => {\n    uiAutomation.uiDevice.mockReturnValue(someInstance);\n    await uut.getUIDevice().pressBack();\n\n    expect(uiAutomation.uiDevice).toHaveBeenCalled();\n    expect(invoke.callDirectly).toHaveBeenCalledWith(someInstance);\n    expect(uiDevice.pressBack).toHaveBeenCalled();\n  });\n\n  it('should return invokeResult from UiDevice getDisplayHeight', async () => {\n    uiAutomation.uiDevice.mockReturnValue(someInstance);\n    invoke.callDirectly.mockReturnValue(someCall);\n    const displayHeight = await uut.getUIDevice().getDisplayHeight();\n\n    expect(uiDevice.getDisplayHeight).toHaveBeenCalledWith(someCall);\n    expect(displayHeight).toEqual(someDisplayHeight);\n  });\n\n  it('should pass click params to UiDevice when calling click', async () => {\n    const x = 10;\n    const y = 10;\n    uiAutomation.uiDevice.mockReturnValue(someInstance);\n    invoke.callDirectly.mockReturnValue(someCall);\n    await uut.getUIDevice().click(x, y);\n\n    expect(uiDevice.click).toHaveBeenCalledWith(someCall, x, y);\n  });\n});\n"
  },
  {
    "path": "detox/src/android/espressoapi/ViewActions.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} \nclass ViewActions {\n  static clearGlobalAssertions() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"clearGlobalAssertions\",\n      args: []\n    };\n  }\n\n  static actionWithAssertions(viewAction) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"actionWithAssertions\",\n      args: [viewAction]\n    };\n  }\n\n  static clearText() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"clearText\",\n      args: []\n    };\n  }\n\n  static click(inputDevice, buttonState) {\n    function click2(inputDevice, buttonState) {\n      if (typeof inputDevice !== \"number\") throw new Error(\"inputDevice should be a number, but got \" + (inputDevice + (\" (\" + (typeof inputDevice + \")\"))));\n      if (typeof buttonState !== \"number\") throw new Error(\"buttonState should be a number, but got \" + (buttonState + (\" (\" + (typeof buttonState + \")\"))));\n      return {\n        target: {\n          type: \"Class\",\n          value: \"androidx.test.espresso.action.ViewActions\"\n        },\n        method: \"click\",\n        args: [{\n          type: \"Integer\",\n          value: inputDevice\n        }, {\n          type: \"Integer\",\n          value: buttonState\n        }]\n      };\n    }\n\n    function click0() {\n      return {\n        target: {\n          type: \"Class\",\n          value: \"androidx.test.espresso.action.ViewActions\"\n        },\n        method: \"click\",\n        args: []\n      };\n    }\n\n    function click1(rollbackAction) {\n      return {\n        target: {\n          type: \"Class\",\n          value: \"androidx.test.espresso.action.ViewActions\"\n        },\n        method: \"click\",\n        args: [rollbackAction]\n      };\n    }\n\n    if (arguments.length === 2) {\n      return click2.apply(null, arguments);\n    }\n\n    if (arguments.length === 0) {\n      return click0.apply(null, arguments);\n    }\n\n    if (arguments.length === 1) {\n      return click1.apply(null, arguments);\n    }\n  }\n\n  static swipeLeft() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"swipeLeft\",\n      args: []\n    };\n  }\n\n  static swipeRight() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"swipeRight\",\n      args: []\n    };\n  }\n\n  static swipeDown() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"swipeDown\",\n      args: []\n    };\n  }\n\n  static swipeUp() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"swipeUp\",\n      args: []\n    };\n  }\n\n  static closeSoftKeyboard() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"closeSoftKeyboard\",\n      args: []\n    };\n  }\n\n  static pressImeActionButton() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"pressImeActionButton\",\n      args: []\n    };\n  }\n\n  static pressBack() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"pressBack\",\n      args: []\n    };\n  }\n\n  static pressBackUnconditionally() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"pressBackUnconditionally\",\n      args: []\n    };\n  }\n\n  static pressMenuKey() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"pressMenuKey\",\n      args: []\n    };\n  }\n\n  static pressKey(keyCode) {\n    if (typeof keyCode !== \"number\") throw new Error(\"keyCode should be a number, but got \" + (keyCode + (\" (\" + (typeof keyCode + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"pressKey\",\n      args: [{\n        type: \"Integer\",\n        value: keyCode\n      }]\n    };\n  }\n\n  static doubleClick() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"doubleClick\",\n      args: []\n    };\n  }\n\n  static longClick() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"longClick\",\n      args: []\n    };\n  }\n\n  static scrollTo() {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"scrollTo\",\n      args: []\n    };\n  }\n\n  static typeTextIntoFocusedView(stringToBeTyped) {\n    if (typeof stringToBeTyped !== \"string\") throw new Error(\"stringToBeTyped should be a string, but got \" + (stringToBeTyped + (\" (\" + (typeof stringToBeTyped + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"typeTextIntoFocusedView\",\n      args: [stringToBeTyped]\n    };\n  }\n\n  static typeText(stringToBeTyped) {\n    if (typeof stringToBeTyped !== \"string\") throw new Error(\"stringToBeTyped should be a string, but got \" + (stringToBeTyped + (\" (\" + (typeof stringToBeTyped + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"typeText\",\n      args: [stringToBeTyped]\n    };\n  }\n\n  static replaceText(stringToBeSet) {\n    if (typeof stringToBeSet !== \"string\") throw new Error(\"stringToBeSet should be a string, but got \" + (stringToBeSet + (\" (\" + (typeof stringToBeSet + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"replaceText\",\n      args: [stringToBeSet]\n    };\n  }\n\n  static openLinkWithText(linkText) {\n    if (typeof linkText !== \"string\") throw new Error(\"linkText should be a string, but got \" + (linkText + (\" (\" + (typeof linkText + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"openLinkWithText\",\n      args: [linkText]\n    };\n  }\n\n  static openLinkWithUri(uri) {\n    if (typeof uri !== \"string\") throw new Error(\"uri should be a string, but got \" + (uri + (\" (\" + (typeof uri + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"openLinkWithUri\",\n      args: [uri]\n    };\n  }\n\n  static repeatedlyUntil(action, desiredStateMatcher, maxAttempts) {\n    if (typeof maxAttempts !== \"number\") throw new Error(\"maxAttempts should be a number, but got \" + (maxAttempts + (\" (\" + (typeof maxAttempts + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"androidx.test.espresso.action.ViewActions\"\n      },\n      method: \"repeatedlyUntil\",\n      args: [action, {\n        type: \"Invocation\",\n        value: sanitize_matcher(desiredStateMatcher)\n      }, {\n        type: \"Integer\",\n        value: maxAttempts\n      }]\n    };\n  }\n\n}\n\nmodule.exports = ViewActions;"
  },
  {
    "path": "detox/src/android/espressoapi/web/DetoxWebAtomMatcher.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass DetoxWebAtomMatcher {\n  static matcherForId(id) {\n    if (typeof id !== \"string\") throw new Error(\"id should be a string, but got \" + (id + (\" (\" + (typeof id + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForId\",\n      args: [id]\n    };\n  }\n\n  static matcherForClassName(className) {\n    if (typeof className !== \"string\") throw new Error(\"className should be a string, but got \" + (className + (\" (\" + (typeof className + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForClassName\",\n      args: [className]\n    };\n  }\n\n  static matcherForCssSelector(cssSelector) {\n    if (typeof cssSelector !== \"string\") throw new Error(\"cssSelector should be a string, but got \" + (cssSelector + (\" (\" + (typeof cssSelector + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForCssSelector\",\n      args: [cssSelector]\n    };\n  }\n\n  static matcherForName(name) {\n    if (typeof name !== \"string\") throw new Error(\"name should be a string, but got \" + (name + (\" (\" + (typeof name + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForName\",\n      args: [name]\n    };\n  }\n\n  static matcherForXPath(xpath) {\n    if (typeof xpath !== \"string\") throw new Error(\"xpath should be a string, but got \" + (xpath + (\" (\" + (typeof xpath + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForXPath\",\n      args: [xpath]\n    };\n  }\n\n  static matcherForLinkText(linkText) {\n    if (typeof linkText !== \"string\") throw new Error(\"linkText should be a string, but got \" + (linkText + (\" (\" + (typeof linkText + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForLinkText\",\n      args: [linkText]\n    };\n  }\n\n  static matcherForPartialLinkText(partialLinkText) {\n    if (typeof partialLinkText !== \"string\") throw new Error(\"partialLinkText should be a string, but got \" + (partialLinkText + (\" (\" + (typeof partialLinkText + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForPartialLinkText\",\n      args: [partialLinkText]\n    };\n  }\n\n  static matcherForTagName(tag) {\n    if (typeof tag !== \"string\") throw new Error(\"tag should be a string, but got \" + (tag + (\" (\" + (typeof tag + \")\"))));\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.DetoxWebAtomMatcher\"\n      },\n      method: \"matcherForTagName\",\n      args: [tag]\n    };\n  }\n\n}\n\nmodule.exports = DetoxWebAtomMatcher;"
  },
  {
    "path": "detox/src/android/espressoapi/web/EspressoWebDetox.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} \nclass EspressoWebDetox {\n  static getWebView() {\n    function getWebView0() {\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.web.EspressoWebDetox\"\n        },\n        method: \"getWebView\",\n        args: []\n      };\n    }\n\n    function getWebView1(matcher) {\n      return {\n        target: {\n          type: \"Class\",\n          value: \"com.wix.detox.espresso.web.EspressoWebDetox\"\n        },\n        method: \"getWebView\",\n        args: [{\n          type: \"Invocation\",\n          value: sanitize_matcher(matcher)\n        }]\n      };\n    }\n\n    if (arguments.length === 0) {\n      return getWebView0.apply(null, arguments);\n    }\n\n    if (arguments.length === 1) {\n      return getWebView1.apply(null, arguments);\n    }\n  }\n\n  static expect(webElement) {\n    return {\n      target: {\n        type: \"Class\",\n        value: \"com.wix.detox.espresso.web.EspressoWebDetox\"\n      },\n      method: \"expect\",\n      args: [{\n        type: \"Invocation\",\n        value: webElement\n      }]\n    };\n  }\n\n}\n\nmodule.exports = EspressoWebDetox;"
  },
  {
    "path": "detox/src/android/espressoapi/web/WebElement.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass WebElement {\n  static tap(element) {\n    return {\n      target: element,\n      method: \"tap\",\n      args: []\n    };\n  }\n\n  static typeText(element, text) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    return {\n      target: element,\n      method: \"typeText\",\n      args: [text]\n    };\n  }\n\n  static replaceText(element, text) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    return {\n      target: element,\n      method: \"replaceText\",\n      args: [text]\n    };\n  }\n\n  static clearText(element) {\n    return {\n      target: element,\n      method: \"clearText\",\n      args: []\n    };\n  }\n\n  static scrollToView(element) {\n    return {\n      target: element,\n      method: \"scrollToView\",\n      args: []\n    };\n  }\n\n  static getText(element) {\n    return {\n      target: element,\n      method: \"getText\",\n      args: []\n    };\n  }\n\n  static runScript(element, script) {\n    if (typeof script !== \"string\") throw new Error(\"script should be a string, but got \" + (script + (\" (\" + (typeof script + \")\"))));\n    return {\n      target: element,\n      method: \"runScript\",\n      args: [script]\n    };\n  }\n\n  static runScriptWithArgs(element, script, args) {\n    if (typeof script !== \"string\") throw new Error(\"script should be a string, but got \" + (script + (\" (\" + (typeof script + \")\"))));\n\n    if (typeof args !== 'object' || !Array.isArray(args)) {\n      throw new Error('args must be an array, got ' + typeof args);\n    }\n\n    return {\n      target: element,\n      method: \"runScriptWithArgs\",\n      args: [script, args]\n    };\n  }\n\n  static getCurrentUrl(element) {\n    return {\n      target: element,\n      method: \"getCurrentUrl\",\n      args: []\n    };\n  }\n\n  static getTitle(element) {\n    return {\n      target: element,\n      method: \"getTitle\",\n      args: []\n    };\n  }\n\n}\n\nmodule.exports = WebElement;"
  },
  {
    "path": "detox/src/android/espressoapi/web/WebExpect.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass WebExpect {\n  static toNotExist(element) {\n    return {\n      target: element,\n      method: \"toNotExist\",\n      args: []\n    };\n  }\n\n  static toExist(element) {\n    return {\n      target: element,\n      method: \"toExist\",\n      args: []\n    };\n  }\n\n  static toHaveText(element, text) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    return {\n      target: element,\n      method: \"toHaveText\",\n      args: [text]\n    };\n  }\n\n  static toNotHaveText(element, text) {\n    if (typeof text !== \"string\") throw new Error(\"text should be a string, but got \" + (text + (\" (\" + (typeof text + \")\"))));\n    return {\n      target: element,\n      method: \"toNotHaveText\",\n      args: [text]\n    };\n  }\n\n}\n\nmodule.exports = WebExpect;"
  },
  {
    "path": "detox/src/android/espressoapi/web/WebViewElement.js",
    "content": "/**\n\n\tThis code is generated.\n\tFor more information see generation/README.md.\n*/\n\n\n\nclass WebViewElement {\n  static element(element, webMatcher) {\n    function element2(element, webMatcher) {\n      return {\n        target: element,\n        method: \"element\",\n        args: [{\n          type: \"Invocation\",\n          value: webMatcher\n        }]\n      };\n    }\n\n    function element3(element, webMatcher, index) {\n      if (typeof index !== \"number\") throw new Error(\"index should be a number, but got \" + (index + (\" (\" + (typeof index + \")\"))));\n      return {\n        target: element,\n        method: \"element\",\n        args: [{\n          type: \"Invocation\",\n          value: webMatcher\n        }, {\n          type: \"Integer\",\n          value: index\n        }]\n      };\n    }\n\n    if (arguments.length === 2) {\n      return element2.apply(null, arguments);\n    }\n\n    if (arguments.length === 3) {\n      return element3.apply(null, arguments);\n    }\n  }\n\n}\n\nmodule.exports = WebViewElement;"
  },
  {
    "path": "detox/src/android/espressoapi/web/simpleAtoms.js",
    "content": "const selectElementContents = `\nfunction selectElementContents(el) {\n  el.focus();\n  if (el.contentEditable) {\n    var range = document.createRange();\n    range.selectNodeContents(el);\n    var sel = window.getSelection();\n    sel.removeAllRanges();\n    sel.addRange(range);\n  } else {\n    el.setSelectionRange(0, el.value.length);\n  }\n}`;\n\nconst moveCursorToEnd = `\nfunction moveCursorToEnd(el) {\n  el.focus();\n  if (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\n      var range = document.createRange();\n      range.selectNodeContents(el);\n      range.collapse(false);\n      var sel = window.getSelection();\n      sel.removeAllRanges();\n      sel.addRange(range);\n  } else if (typeof document.body.createTextRange != \"undefined\") {\n      var textRange = document.body.createTextRange();\n      textRange.moveToElementText(el);\n      textRange.collapse(false);\n      textRange.select();\n  }\n}`;\n\nconst setCursorPosition = `\n  function setPos(pos, el) {\n    const isContentEditable = el && el.contentEditable;\n    // for ContentEditable field\n    if (isContentEditable) {\n        el.focus();\n        document.getSelection().collapse(el, pos);\n        return;\n    }\n    el.setSelectionRange(pos, pos);\n}`;\n\nconst focus = `\nfunction focusElement(el) {\n  el.focus();\n}\n`;\n\nconst getBoundingClientRect = `\nfunction getBoundingClientRect(el) {\n  return el.getBoundingClientRect();\n}`;\n\nmodule.exports = {\n  selectElementContents,\n  moveCursorToEnd,\n  setCursorPosition,\n  focus,\n  getBoundingClientRect\n}"
  },
  {
    "path": "detox/src/android/interactions/native.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst { expectDescription, actionDescription } = require('../../utils/invocationTraceDescriptions');\nconst log = require('../../utils/logger').child({ cat: 'ws-client, ws' });\nconst traceInvocationCall = require('../../utils/traceInvocationCall').bind(null, log);\nconst { ScrollAmountStopAtEdgeAction } = require('../actions/native');\nconst { NativeMatcher } = require('../core/NativeMatcher');\nconst DetoxAssertionApi = require('../espressoapi/DetoxAssertion');\nconst EspressoDetoxApi = require('../espressoapi/EspressoDetox');\n\nfunction call(maybeAFunction) {\n  return maybeAFunction instanceof Function ? maybeAFunction() : maybeAFunction;\n}\n\nclass Interaction {\n  constructor(invocationManager, traceDescription) {\n    this._call = undefined;\n    this._traceDescription = traceDescription;\n    this._invocationManager = invocationManager;\n  }\n\n  async execute() {\n    return traceInvocationCall(this._traceDescription, this._call,\n      this._invocationManager.execute(this._call).then((resultObj) => resultObj ? resultObj.result : undefined));\n  }\n}\n\nclass ActionInteraction extends Interaction {\n  constructor(invocationManager, matcher, action, traceDescription) {\n    super(invocationManager, traceDescription);\n    this._call = EspressoDetoxApi.perform(matcher, action._call);\n    // TODO [2024-12-01]: move this.execute() here from the caller\n  }\n}\n\nclass MatcherAssertionInteraction extends Interaction {\n  constructor(invocationManager, element, matcher, notCondition, traceDescription) {\n    traceDescription = expectDescription.full(traceDescription, notCondition);\n    super(invocationManager, traceDescription);\n\n    matcher = notCondition ? matcher.not : matcher;\n    this._call = DetoxAssertionApi.assertMatcher(call(element._call), matcher._call.value);\n    // TODO [2024-12-01]: move this.execute() here from the caller\n  }\n}\n\nclass WaitForInteraction extends Interaction {\n  constructor(invocationManager, element, assertionMatcher, expectTraceDescription) {\n    super(invocationManager, expectTraceDescription);\n    this._element = element;\n    this._assertionMatcher = assertionMatcher;\n  }\n\n  async withTimeout(timeout) {\n    if (typeof timeout !== 'number') throw new DetoxRuntimeError({ message: `WaitForInteraction withTimeout argument must be a number, got ${typeof timeout}` });\n    if (timeout < 0) throw new DetoxRuntimeError({ message: 'timeout must be larger than 0' });\n\n    this._traceDescription = expectDescription.waitForWithTimeout(this._traceDescription, timeout);\n    this._call = DetoxAssertionApi.waitForAssertMatcher(call(this._element._call), this._assertionMatcher._call.value, timeout / 1000);\n    await this.execute();\n  }\n\n  whileElement(searchMatcher) {\n    return new WaitForActionInteraction(this._invocationManager, this._element, this._assertionMatcher, searchMatcher);\n  }\n}\n\nclass WaitForActionInteractionBase extends Interaction {\n  constructor(invocationManager, element, matcher, searchMatcher, traceDescription) {\n    super(invocationManager, traceDescription);\n\n    if (!(searchMatcher instanceof NativeMatcher))\n      throw new DetoxRuntimeError({ message: `WaitForActionInteraction ctor 3rd argument must be a valid NativeMatcher, got ${typeof searchMatcher}` });\n\n    this._element = element;\n    this._originalMatcher = matcher;\n    this._searchMatcher = searchMatcher;\n  }\n\n  _prepare(searchAction) {\n    this._call = DetoxAssertionApi.waitForAssertMatcherWithSearchAction(\n      call(this._element._call),\n      call(this._originalMatcher._call).value,\n      call(searchAction._call),\n      call(this._searchMatcher._call).value\n    );\n  }\n}\n\nclass WaitForActionInteraction extends WaitForActionInteractionBase {\n  async scroll(amount, direction = 'down', scrollPositionX, scrollPositionY) {\n    this._traceDescription = expectDescription.waitFor(actionDescription.scroll(amount, direction, scrollPositionX, scrollPositionY));\n    this._prepare(new ScrollAmountStopAtEdgeAction(direction, amount, scrollPositionX, scrollPositionY));\n    await this.execute();\n  }\n}\n\nmodule.exports = {\n  Interaction,\n  ActionInteraction,\n  MatcherAssertionInteraction,\n  WaitForActionInteraction,\n  WaitForActionInteractionBase,\n  WaitForInteraction,\n};\n"
  },
  {
    "path": "detox/src/android/interactions/web.js",
    "content": "class WebInteraction {\n  constructor(invocationManager) {\n    this._call = undefined;\n    this._invocationManager = invocationManager;\n  }\n\n  async execute() {\n    const resultObj = await this._invocationManager.execute(this._call);\n    return resultObj ? resultObj.result : undefined;\n  }\n}\n\nclass ActionInteraction extends WebInteraction {\n  constructor(invocationManager, action) {\n    super(invocationManager);\n    this._call = action._call;\n  }\n}\n\nclass WebAssertionInteraction extends WebInteraction {\n  constructor(invocationManager, assertion) {\n    super(invocationManager);\n    this._call = assertion._call;\n  }\n}\n\nmodule.exports = {\n  WebInteraction,\n  ActionInteraction,\n  WebAssertionInteraction,\n};\n"
  },
  {
    "path": "detox/src/android/matchers/index.js",
    "content": "const { DetoxRuntimeError } = require('../../errors');\n\nconst native = require('./native');\nconst web = require('./web');\n\nmodule.exports = {\n  id: (value) => new native.IdMatcher(value),\n  label: (value) => new native.ShallowLabelMatcher(value),\n  accessibilityLabel: (value) => new native.ShallowLabelMatcher(value),\n  text: (value) => new native.TextMatcher(value),\n  traits: (value) => new native.TraitsMatcher(value),\n  type: (value) => new native.TypeMatcher(value),\n  value: (value) => new native.ValueMatcher(value),\n\n  web: {\n    id: (value) => new web.IdMatcher(value),\n    className: (value) => new web.ClassNameMatcher(value),\n    cssSelector: (value) => new web.CssSelectorMatcher(value),\n    name: (value) => new web.NameMatcher(value),\n    tag: (value) => new web.TagNameMatcher(value),\n    xpath: (value) => new web.XPathMatcher(value),\n    href: (value) => new web.LinkTextMatcher(value),\n    hrefContains: (value) => new web.PartialLinkTextMatcher(value),\n    label: (_value) => { throw new DetoxRuntimeError('Label matcher is not supported on Android'); },\n    value: (_value) => { throw new DetoxRuntimeError('Value matcher is not supported on Android'); },\n  },\n\n  system: {\n    label: (_value) => { throw new DetoxRuntimeError('System interactions are not supported on Android, use UiDevice APIs directly instead'); },\n    type: (_value) => { throw new DetoxRuntimeError('System interactions are not supported on Android, use UiDevice APIs directly instead'); },\n  }\n};\n"
  },
  {
    "path": "detox/src/android/matchers/native.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst invoke = require('../../invoke');\nconst semanticTypes = require('../../matchers/semanticTypes');\nconst { isRegExp } = require('../../utils/isRegExp');\nconst { NativeMatcher } = require('../core/NativeMatcher');\nconst DetoxMatcherApi = require('../espressoapi/DetoxMatcher');\n\nconst createClassMatcher = (className) =>\n  new NativeMatcher(invoke.callDirectly(DetoxMatcherApi.matcherForClass(className)));\n\nconst combineWithOr = (matchers) =>\n  matchers.reduce((acc, matcher) => acc.or(matcher));\n\nclass LabelMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    const isRegex = isRegExp(value);\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForAccessibilityLabel(isRegex ? value.toString() : value, isRegex));\n  }\n}\n\nclass ShallowLabelMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    const isRegex = isRegExp(value);\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForShallowAccessibilityLabel(isRegex ? value.toString() : value, isRegex));\n  }\n}\n\nclass IdMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    const isRegex = isRegExp(value);\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForTestId(isRegex ? value.toString() : value, isRegex));\n  }\n}\n\nclass TypeMatcher extends NativeMatcher {\n  constructor(typeOrSemanticType) {\n    super();\n\n    const descriptors = semanticTypes.getClasses(typeOrSemanticType, 'android');\n    if (!descriptors.length) {\n      throw new DetoxRuntimeError(`No class names found for: ${typeOrSemanticType}`);\n    }\n\n    const matchers = descriptors.map(({ className, excludes }) => {\n      const includeMatcher = createClassMatcher(className);\n      return excludes.length\n        ? includeMatcher.and(combineWithOr(excludes.map(createClassMatcher)).not)\n        : includeMatcher;\n    });\n\n    const combinedMatcher = combineWithOr(matchers);\n    this._call = { ...combinedMatcher._call, rawType: typeOrSemanticType };\n  }\n}\n\nclass VisibleMatcher extends NativeMatcher {\n  constructor(pct = 75) {\n    super();\n\n    if (pct !== undefined && (!Number.isSafeInteger(pct) || pct < 1 || pct > 100)) {\n      throw new DetoxRuntimeError('VisibleMatcher argument must be an integer between 1 and 100');\n    }\n\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForSufficientlyVisible(pct));\n  }\n}\n\nclass ExistsMatcher extends NativeMatcher {\n  constructor() {\n    super();\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForNotNull());\n  }\n}\n\nclass TextMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    const isRegex = isRegExp(value);\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForText(isRegex ? value.toString() : value, isRegex));\n  }\n}\n\nclass ValueMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForContentDescription(value));\n  }\n}\n\nclass ToggleMatcher extends NativeMatcher {\n  constructor(toggleState) {\n    super();\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForToggleable(toggleState));\n  }\n}\n\n// NOTE: Please be aware, that this is just a dummy matcher\nclass TraitsMatcher extends NativeMatcher {\n  constructor(value) {\n    super();\n    if (!Array.isArray(value)) throw new DetoxRuntimeError(`TraitsMatcher ctor argument must be an array, got ${typeof value}`);\n\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForAnything());\n  }\n}\n\nclass FocusMatcher extends NativeMatcher {\n  constructor() {\n    super();\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForFocus());\n  }\n}\n\nclass SliderPositionMatcher extends NativeMatcher {\n  constructor(value, tolerance) {\n    super();\n    this._call = invoke.callDirectly(DetoxMatcherApi.matcherForSliderPosition(value, tolerance));\n  }\n}\n\nmodule.exports = {\n  LabelMatcher,\n  ShallowLabelMatcher,\n  IdMatcher,\n  TypeMatcher,\n  TraitsMatcher,\n  VisibleMatcher,\n  ExistsMatcher,\n  TextMatcher,\n  ValueMatcher,\n  ToggleMatcher,\n  FocusMatcher,\n  SliderPositionMatcher,\n};\n"
  },
  {
    "path": "detox/src/android/matchers/native.test.js",
    "content": "// @ts-nocheck\njest.mock('../../matchers/semanticTypes', () => ({\n  getTypes: jest.fn(),\n  getClasses: jest.fn(),\n  includes: jest.fn()\n}));\n\n\nconst semanticTypes = require('../../matchers/semanticTypes');\n\nconst { TypeMatcher } = require('./native');\n\ndescribe('Native Matchers', () => {\n  describe('TypeMatcher', () => {\n    beforeEach(() => {\n      jest.clearAllMocks();\n    });\n\n    it('should handle regular class names', () => {\n      semanticTypes.includes.mockReturnValue(false);\n      semanticTypes.getClasses.mockReturnValue([\n        { className: 'com.example.CustomView', excludes: [] }\n      ]);\n\n      expect(() => {\n        new TypeMatcher('com.example.CustomView');\n      }).not.toThrow();\n    });\n\n    it('should handle semantic types automatically', () => {\n      semanticTypes.includes.mockReturnValue(true);\n      semanticTypes.getClasses.mockReturnValue([\n        { className: 'android.widget.ImageView', excludes: [] },\n        { className: 'com.facebook.react.views.image.ReactImageView', excludes: [] }\n      ]);\n\n      expect(() => {\n        new TypeMatcher('image');\n      }).not.toThrow();\n    });\n\n    it('should handle exclusion objects for semantic types', () => {\n      semanticTypes.includes.mockReturnValue(true);\n      semanticTypes.getClasses.mockReturnValue([\n        {\n          className: 'android.widget.ProgressBar',\n          excludes: ['android.widget.AbsSeekBar']\n        },\n        {\n          className: 'androidx.core.widget.ContentLoadingProgressBar',\n          excludes: ['android.widget.AbsSeekBar']\n        }\n      ]);\n\n      expect(() => {\n        new TypeMatcher('activity-indicator');\n      }).not.toThrow();\n    });\n\n    it('should handle mixed string and exclusion objects', () => {\n      semanticTypes.includes.mockReturnValue(true);\n      semanticTypes.getClasses.mockReturnValue([\n        {\n          className: 'android.widget.ProgressBar',\n          excludes: ['android.widget.AbsSeekBar']\n        },\n        {\n          className: 'androidx.core.widget.ContentLoadingProgressBar',\n          excludes: ['android.widget.AbsSeekBar']\n        }\n      ]);\n\n      expect(() => {\n        new TypeMatcher('progress');\n      }).not.toThrow();\n    });\n\n    it('should handle regular class names when not semantic types', () => {\n      semanticTypes.includes.mockReturnValue(false);\n      semanticTypes.getClasses.mockReturnValue([\n        { className: 'android.widget.ImageView', excludes: [] }\n      ]);\n\n      expect(() => {\n        new TypeMatcher('android.widget.ImageView');\n      }).not.toThrow();\n    });\n\n    it('should throw error when no class names are found', () => {\n      semanticTypes.includes.mockReturnValue(false);\n      semanticTypes.getClasses.mockReturnValue([]);\n\n      expect(() => {\n        new TypeMatcher('empty-type');\n      }).toThrow('No class names found for: empty-type');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/android/matchers/web.js",
    "content": "const invoke = require('../../invoke');\nconst { WebMatcher } = require('../core/WebMatcher');\nconst DetoxWebMatcherApi = require('../espressoapi/web/DetoxWebAtomMatcher');\n\nclass IdMatcher extends WebMatcher {\n  constructor(id) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForId(id));\n  }\n}\n\nclass ClassNameMatcher extends WebMatcher {\n  constructor(className) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForClassName(className));\n  }\n}\n\nclass CssSelectorMatcher extends WebMatcher {\n  constructor(cssSelector) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForCssSelector(cssSelector));\n  }\n}\n\nclass NameMatcher extends WebMatcher {\n  constructor(name) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForName(name));\n  }\n}\n\nclass XPathMatcher extends WebMatcher {\n  constructor(xpath) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForXPath(xpath));\n  }\n}\n\nclass LinkTextMatcher extends WebMatcher {\n  constructor(linkText) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForLinkText(linkText));\n  }\n}\n\nclass PartialLinkTextMatcher extends WebMatcher {\n  constructor(partialLinkText) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForPartialLinkText(partialLinkText));\n  }\n}\n\nclass TagNameMatcher extends WebMatcher {\n  constructor(tag) {\n    super();\n    this._call = invoke.callDirectly(DetoxWebMatcherApi.matcherForTagName(tag));\n  }\n}\n\nmodule.exports = {\n  IdMatcher,\n  ClassNameMatcher,\n  CssSelectorMatcher,\n  NameMatcher,\n  XPathMatcher,\n  LinkTextMatcher,\n  PartialLinkTextMatcher,\n  TagNameMatcher\n};\n"
  },
  {
    "path": "detox/src/artifacts/ArtifactsManager.js",
    "content": "const EventEmitter = require('events');\nconst path = require('path');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst log = require('../utils/logger').child({ cat: 'artifacts-manager,artifact' });\nconst resolveModuleFromPath = require('../utils/resolveModuleFromPath');\nconst traceMethods = require('../utils/traceMethods');\n\nconst FileArtifact = require('./templates/artifact/FileArtifact');\nconst ArtifactPathBuilder = require('./utils/ArtifactPathBuilder');\n\nclass ArtifactsManager extends EventEmitter {\n  constructor({ rootDir, pathBuilder, plugins }) {\n    super();\n\n    this._pluginConfigs = plugins;\n    this._idlePromise = Promise.resolve();\n    this._idleCallbackRequests = [];\n    this._artifactPlugins = {};\n    this._pathBuilder = this._resolveArtifactsPathBuilder(pathBuilder, rootDir);\n\n    traceMethods(log, this, [\n      'onAppReady',\n      'onBeforeCleanup',\n      'onBeforeLaunchApp',\n      'onBeforeShutdownDevice',\n      'onBeforeTerminateApp',\n      'onBeforeUninstallApp',\n      'onBootDevice',\n      'onCreateExternalArtifact',\n      'onHookFailure',\n      'onLaunchApp',\n      'onRunDescribeFinish',\n      'onRunDescribeStart',\n      'onShutdownDevice',\n      'onTerminateApp',\n      'onTestDone',\n      'onTestFnFailure',\n      'onTestStart',\n    ]);\n  }\n\n  _resolveArtifactsPathBuilder(pathBuilder, rootDir) {\n    if (typeof pathBuilder === 'string') {\n      pathBuilder = resolveModuleFromPath(pathBuilder);\n    }\n\n    if (typeof pathBuilder === 'function') {\n      try {\n        pathBuilder = pathBuilder({ rootDir });\n      } catch (e) {\n        pathBuilder = new pathBuilder({ rootDir });\n      }\n    }\n\n    if (!pathBuilder) {\n      pathBuilder = new ArtifactPathBuilder({ rootDir });\n    }\n\n    return pathBuilder;\n  }\n\n  _instantiateArtifactPlugin(pluginFactory, pluginUserConfig) {\n    const artifactsApi = {\n      plugin: null,\n\n      userConfig: { ...pluginUserConfig },\n\n      preparePathForArtifact: async (artifactName, testSummary) => {\n        const artifactPath = this._pathBuilder.buildPathForTestArtifact(artifactName, testSummary);\n        const artifactDir = path.dirname(artifactPath);\n        await fs.ensureDir(artifactDir);\n\n        return artifactPath;\n      },\n\n      trackArtifact: (artifact) => {\n        this.emit('trackArtifact', artifact);\n      },\n\n      untrackArtifact: (artifact) => {\n        this.emit('untrackArtifact', artifact);\n      },\n\n      requestIdleCallback: (callback) => {\n        this._idleCallbackRequests.push({\n          caller: artifactsApi.plugin,\n          callback,\n        });\n\n        this._idlePromise = this._idlePromise.then(() => {\n          const nextCallbackRequest = this._idleCallbackRequests.shift();\n\n          /* istanbul ignore else  */\n          if (nextCallbackRequest) {\n            return this._executeIdleCallbackRequest(nextCallbackRequest);\n          }\n        });\n\n        return this._idlePromise;\n      },\n    };\n\n    const plugin = pluginFactory(artifactsApi);\n    artifactsApi.plugin = plugin;\n\n    return plugin;\n  }\n\n  _executeIdleCallbackRequest({ callback, caller }) {\n    return Promise.resolve()\n      .then(callback)\n      .catch(e => this._idleCallbackErrorHandle(e, caller));\n  }\n\n  registerArtifactPlugins(artifactPluginFactoriesMap) {\n    for (const [key, factory] of Object.entries(artifactPluginFactoriesMap)) {\n      const config = this._pluginConfigs[key];\n      this._artifactPlugins[key] = this._instantiateArtifactPlugin(factory, config);\n    }\n  }\n\n  subscribeToDeviceEvents(deviceEmitter) {\n    deviceEmitter.on('bootDevice', this.onBootDevice.bind(this));\n    deviceEmitter.on('beforeShutdownDevice', this.onBeforeShutdownDevice.bind(this));\n    deviceEmitter.on('shutdownDevice', this.onShutdownDevice.bind(this));\n    deviceEmitter.on('beforeLaunchApp', this.onBeforeLaunchApp.bind(this));\n    deviceEmitter.on('launchApp', this.onLaunchApp.bind(this));\n    deviceEmitter.on('appReady', this.onAppReady.bind(this));\n    deviceEmitter.on('beforeUninstallApp', this.onBeforeUninstallApp.bind(this));\n    deviceEmitter.on('beforeTerminateApp', this.onBeforeTerminateApp.bind(this));\n    deviceEmitter.on('terminateApp', this.onTerminateApp.bind(this));\n    deviceEmitter.on('createExternalArtifact', this.onCreateExternalArtifact.bind(this));\n  }\n\n  async onBootDevice(deviceInfo) {\n    await this._callPlugins('plain', 'onBootDevice', deviceInfo);\n  }\n\n  async onBeforeLaunchApp(appLaunchInfo) {\n    await this._callPlugins('plain', 'onBeforeLaunchApp', appLaunchInfo);\n  }\n\n  async onLaunchApp(appLaunchInfo) {\n    await this._callPlugins('plain', 'onLaunchApp', appLaunchInfo);\n  }\n\n  async onAppReady(appInfo) {\n    await this._callPlugins('plain', 'onAppReady', appInfo);\n  }\n\n  async onBeforeTerminateApp(appInfo) {\n    await this._callPlugins('plain', 'onBeforeTerminateApp', appInfo);\n  }\n\n  async onTerminateApp(appInfo) {\n    await this._callPlugins('plain', 'onTerminateApp', appInfo);\n  }\n\n  async onBeforeUninstallApp(appInfo) {\n    await this._callPlugins('plain', 'onBeforeUninstallApp', appInfo);\n  }\n\n  async onBeforeShutdownDevice(deviceInfo) {\n    await this._callPlugins('plain', 'onBeforeShutdownDevice', deviceInfo);\n  }\n\n  async onShutdownDevice(deviceInfo) {\n    await this._callPlugins('plain', 'onShutdownDevice', deviceInfo);\n  }\n\n  async onCreateExternalArtifact({ pluginId, artifactName, artifactPath }) {\n    await this._callSinglePlugin(pluginId, 'onCreateExternalArtifact', {\n      artifact: new FileArtifact({ temporaryPath: artifactPath }),\n      name: artifactName,\n    });\n  }\n\n  async onRunDescribeStart(suite) {\n    await this._callPlugins('ascending', 'onRunDescribeStart', suite);\n  }\n\n  async onTestStart(testSummary) {\n    await this._callPlugins('ascending', 'onTestStart', testSummary);\n  }\n\n  async onHookFailure(testSummary) {\n    await this._callPlugins('plain', 'onHookFailure', testSummary);\n  }\n\n  async onTestFnFailure(testSummary) {\n    await this._callPlugins('plain', 'onTestFnFailure', testSummary);\n  }\n\n  async onTestDone(testSummary) {\n    await this._callPlugins('descending', 'onTestDone', testSummary);\n  }\n\n  async onRunDescribeFinish(suite) {\n    await this._callPlugins('descending', 'onRunDescribeFinish', suite);\n  }\n\n  async onBeforeCleanup() {\n    await this._callPlugins('descending', 'onBeforeCleanup');\n    await this._idlePromise;\n  }\n\n  async _callSinglePlugin(pluginId, methodName, ...args) {\n    const plugin = this._artifactPlugins[pluginId];\n    try {\n      await plugin[methodName](...args);\n    } catch (e) {\n      this._unhandledPluginExceptionHandler(e, { plugin, methodName });\n    }\n  }\n\n  async _callPlugins(strategy, methodName, ...args) {\n    for (const pluginGroup of this._groupPlugins(strategy)) {\n      await Promise.all(pluginGroup.map(async (plugin) => {\n        try {\n          await plugin[methodName](...args);\n        } catch (e) {\n          this._unhandledPluginExceptionHandler(e, { plugin, methodName });\n        }\n      }));\n    }\n  }\n\n  _groupPlugins(strategy) {\n    if (strategy === 'plain') {\n      return [_.values(this._artifactPlugins)];\n    }\n\n    const pluginsByPriority = _.chain(this._artifactPlugins)\n      .values()\n      .groupBy('priority')\n      .entries()\n      .sortBy(([priority]) => Number(priority))\n      .map(1)\n      .value();\n\n    switch (strategy) {\n      case 'descending':\n        return pluginsByPriority.reverse();\n      case 'ascending':\n        return pluginsByPriority;\n      /* istanbul ignore next */\n      default: // is\n        throw new DetoxRuntimeError(`Unknown plugins grouping strategy: ${strategy}`);\n    }\n  }\n\n  _unhandledPluginExceptionHandler(err, { plugin, methodName }) {\n    const logObject = {\n      plugin: plugin.name,\n      methodName,\n      err,\n    };\n\n    log.warn(logObject, `Suppressed error inside function call.`);\n  }\n\n  _idleCallbackErrorHandle(err, caller) {\n    this._unhandledPluginExceptionHandler(err, {\n      plugin: caller,\n      methodName: 'onIdleCallback',\n    });\n  }\n}\n\nmodule.exports = ArtifactsManager;\n"
  },
  {
    "path": "detox/src/artifacts/ArtifactsManager.test.js",
    "content": "const path = require('path');\n\nconst sleep = require('../utils/sleep');\n\nconst testSummaries = require('./__mocks__/testSummaries.mock');\nconst testSuite = require('./templates/plugin/__mocks__/testSuite.mock');\nconst testHookError = () => ({ hook: 'beforeEach', error: new Error() });\nconst testError = () => ({ error: new Error() });\n\ndescribe('ArtifactsManager', () => {\n  let proxy;\n\n  beforeEach(() => {\n    jest.mock('fs-extra');\n    jest.mock('./utils/ArtifactPathBuilder');\n    jest.mock('../utils/logger');\n\n    proxy = {\n      get ArtifactPathBuilder() {\n        return require('./utils/ArtifactPathBuilder');\n      },\n      get ArtifactsManager() {\n        return require('./ArtifactsManager');\n      },\n      get logger() {\n        return require('../utils/logger');\n      },\n      get fs() {\n        return require('fs-extra');\n      },\n    };\n  });\n\n  describe('when created by default', () => {\n    it('should have a default PathBuilder instance', () => {\n      new proxy.ArtifactsManager({ plugins: {} });\n      expect(proxy.ArtifactPathBuilder).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('when plugin factory is registered', () => {\n    let artifactsManager, factory, plugin;\n\n    beforeEach(() => {\n      plugin = {\n        onBeforeLaunchApp: jest.fn(),\n      };\n      factory = jest.fn().mockReturnValue(plugin);\n\n      artifactsManager = new proxy.ArtifactsManager({\n        pathBuilder: new proxy.ArtifactPathBuilder({\n          rootDir: '/tmp',\n        }),\n        plugins: {\n          mock: { setting: 'value' },\n        },\n      });\n      artifactsManager.registerArtifactPlugins({ mock: factory });\n    });\n\n    it('should get called immediately', () => {\n      expect(factory).toHaveBeenCalledWith(expect.objectContaining({\n        userConfig: { setting: 'value' },\n        preparePathForArtifact: expect.any(Function),\n        trackArtifact: expect.any(Function),\n        untrackArtifact: expect.any(Function),\n        requestIdleCallback: expect.any(Function),\n      }));\n    });\n  });\n\n  describe('.artifactsApi', () => {\n    let artifactsManager, artifactsApi;\n    let testPluginFactory, testPlugin;\n    let pathBuilder;\n\n    beforeEach(async () => {\n      testPlugin = null;\n      testPluginFactory = (api) => {\n        artifactsApi = api;\n\n        return (testPlugin = {\n          name: 'testPlugin',\n          userConfig: api.userConfig,\n          disable: jest.fn(),\n          onBootDevice: jest.fn(),\n          onBeforeShutdownDevice: jest.fn(),\n          onShutdownDevice: jest.fn(),\n          onBeforeUninstallApp: jest.fn(),\n          onBeforeTerminateApp: jest.fn(),\n          onTerminateApp: jest.fn(),\n          onBeforeLaunchApp: jest.fn(),\n          onLaunchApp: jest.fn(),\n          onAppReady: jest.fn(),\n          onCreateExternalArtifact: jest.fn(),\n          onTestStart: jest.fn(),\n          onHookFailure: jest.fn(),\n          onTestFnFailure: jest.fn(),\n          onTestDone: jest.fn(),\n          onRunDescribeStart: jest.fn(),\n          onRunDescribeFinish: jest.fn(),\n          onBeforeCleanup: jest.fn(),\n        });\n      };\n\n      artifactsManager = new proxy.ArtifactsManager({\n        pathBuilder: path.join(__dirname, '__mocks__/FakePathBuilder.js'),\n        plugins: {\n          testPlugin: {\n            lifecycle: 'all',\n          }\n        }\n      });\n      artifactsManager.registerArtifactPlugins({ testPlugin: testPluginFactory });\n      pathBuilder = artifactsManager._pathBuilder;\n      jest.spyOn(pathBuilder, 'buildPathForTestArtifact');\n    });\n\n    describe('.userConfig', () => {\n      it('should contain plugin config', async () => {\n        expect(artifactsApi.userConfig).toEqual({ lifecycle: 'all' });\n      });\n    });\n\n    describe('.preparePathForArtifact()', () => {\n      let fs;\n\n      beforeEach(() => {\n        fs = require('fs-extra');\n      });\n\n      it('should prepare directory for test artifact at given path', async () => {\n        const testSummary = {};\n        const givenArtifactPath = path.join('artifacts', 'something', 'startup.log');\n        pathBuilder.buildPathForTestArtifact.mockReturnValue(givenArtifactPath);\n\n        const returnedArtifactPath = await artifactsApi.preparePathForArtifact('test', testSummary);\n\n        expect(pathBuilder.buildPathForTestArtifact).toHaveBeenCalledWith('test', testSummary);\n        expect(returnedArtifactPath).toBe(givenArtifactPath);\n        expect(fs.ensureDir).toHaveBeenCalledWith(path.join('artifacts', 'something'));\n      });\n    });\n\n    describe('.requestIdleCallback()', () => {\n      let callbacks, resolves, rejects;\n\n      beforeEach(() => {\n        callbacks = new Array(3);\n        resolves = new Array(3);\n        rejects = new Array(3);\n\n        for (const index of [0, 1, 2]) {\n          const promise = new Promise((resolve, reject) => {\n            resolves[index] = resolve;\n            rejects[index] = reject;\n          });\n\n          callbacks[index] = jest.fn(() => promise);\n        }\n      });\n\n      it('should enqueue an async operation to a queue that executes operations only one by one', async () => {\n        artifactsApi.requestIdleCallback(callbacks[0], testPlugin);\n        artifactsApi.requestIdleCallback(callbacks[1], testPlugin);\n\n        expect(callbacks[0]).toHaveBeenCalledTimes(0);\n        expect(callbacks[1]).toHaveBeenCalledTimes(0);\n\n        await sleep(0);\n        expect(callbacks[0]).toHaveBeenCalledTimes(1);\n        expect(callbacks[1]).toHaveBeenCalledTimes(0);\n\n        await (resolves[0](), sleep(0));\n        expect(callbacks[1]).toHaveBeenCalledTimes(1);\n      });\n\n      it('should catch errors, report them if callback fails, and move on ', async () => {\n        artifactsApi.requestIdleCallback(callbacks[0], testPlugin);\n        artifactsApi.requestIdleCallback(callbacks[1], testPlugin);\n        rejects[0](new Error('test onIdleCallback error'));\n        resolves[1]();\n\n        expect(callbacks[0]).not.toHaveBeenCalled();\n        expect(callbacks[1]).not.toHaveBeenCalled();\n        expect(proxy.logger.warn.mock.calls.length).toBe(0);\n\n        await sleep(0);\n\n        expect(callbacks[0]).toHaveBeenCalled();\n        expect(callbacks[1]).toHaveBeenCalled();\n        expect(proxy.logger.warn.mock.calls.length).toBe(1);\n      });\n\n      it('should work correctly for onBeforeCleanup', async () => {\n        resolves[0](); resolves[1](); resolves[2]();\n        artifactsApi.requestIdleCallback(callbacks[0], testPlugin);\n        artifactsApi.requestIdleCallback(callbacks[1], testPlugin);\n        artifactsApi.requestIdleCallback(callbacks[2], testPlugin);\n\n        await artifactsManager.onBeforeCleanup();\n        expect(callbacks[0]).toHaveBeenCalledTimes(1);\n        expect(callbacks[1]).toHaveBeenCalledTimes(1);\n        expect(callbacks[2]).toHaveBeenCalledTimes(1);\n      });\n    });\n\n    describe('.trackArtifact()', () => {\n      it('should emit \"trackArtifact\" event from the artifacts manaager', () => {\n        const artifact = {};\n        const listener = jest.fn();\n        artifactsManager.on('trackArtifact', listener);\n        artifactsApi.trackArtifact(artifact);\n        expect(listener).toHaveBeenCalledWith(artifact);\n      });\n    });\n\n    describe('.untrackArtifact()', () => {\n      it('should emit \"untrackArtifact\" event from the artifacts manaager', () => {\n        const artifact = {};\n        const listener = jest.fn();\n        artifactsManager.on('untrackArtifact', listener);\n        artifactsApi.untrackArtifact(artifact);\n        expect(listener).toHaveBeenCalledWith(artifact);\n      });\n    });\n\n    describe('hooks', () => {\n      describe('error handling', () => {\n        function itShouldCatchErrorsOnPhase(hookName, argFactory) {\n          it(`should catch .${hookName} errors`, async () => {\n            testPlugin[hookName].mockImplementation(() => {\n              throw new Error(`test ${hookName} error`);\n            });\n\n            await artifactsManager[hookName](argFactory());\n            expect(proxy.logger.warn.mock.calls).toEqual([[\n              {\n                err: expect.any(Error),\n                methodName: hookName,\n                plugin: 'testPlugin',\n              },\n              expect.stringContaining(`Suppressed error inside function call.`)\n            ]]);\n          });\n        }\n\n        itShouldCatchErrorsOnPhase('onTestStart', () => testSummaries.running());\n\n        itShouldCatchErrorsOnPhase('onHookFailure', () => testHookError());\n\n        itShouldCatchErrorsOnPhase('onTestFnFailure', () => testError());\n\n        itShouldCatchErrorsOnPhase('onTestDone', () => testSummaries.passed());\n\n        itShouldCatchErrorsOnPhase('onRunDescribeStart', () => (testSuite.mock()));\n\n        itShouldCatchErrorsOnPhase('onRunDescribeFinish', () => (testSuite.mock()));\n\n        itShouldCatchErrorsOnPhase('onBeforeCleanup', () => undefined);\n\n        itShouldCatchErrorsOnPhase('onBootDevice', () => ({\n          coldBoot: false,\n          deviceId: 'testDeviceId',\n        }));\n\n        itShouldCatchErrorsOnPhase('onCreateExternalArtifact', () => ({\n          pluginId: 'testPlugin',\n          artifactName: 'example',\n          artifactPath: '/tmp/path/to/artifact',\n        }));\n\n        itShouldCatchErrorsOnPhase('onBeforeShutdownDevice', () => ({\n          deviceId: 'testDeviceId'\n        }));\n\n        itShouldCatchErrorsOnPhase('onShutdownDevice', () => ({\n          deviceId: 'testDeviceId'\n        }));\n\n        itShouldCatchErrorsOnPhase('onBeforeLaunchApp', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n        }));\n\n        itShouldCatchErrorsOnPhase('onLaunchApp', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n          pid: 2018,\n        }));\n\n        itShouldCatchErrorsOnPhase('onAppReady', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n          pid: 2018,\n        }));\n\n        itShouldCatchErrorsOnPhase('onBeforeTerminateApp', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n        }));\n\n        itShouldCatchErrorsOnPhase('onTerminateApp', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n        }));\n\n        itShouldCatchErrorsOnPhase('onBeforeUninstallApp', () => ({\n          bundleId: 'testBundleId',\n          deviceId: 'testDeviceId',\n        }));\n      });\n\n      describe('onTestStart', () => {\n        it('should call onTestStart in plugins with the passed argument', async () => {\n          const testSummary = testSummaries.running();\n\n          expect(testPlugin.onTestStart).not.toHaveBeenCalled();\n          await artifactsManager.onTestStart(testSummary);\n          expect(testPlugin.onTestStart).toHaveBeenCalledWith(testSummary);\n        });\n      });\n\n      describe('onHookFailure', () => {\n        it('should call onHookFailure in plugins with the passed argument', async () => {\n          const error = testError();\n\n          expect(testPlugin.onHookFailure).not.toHaveBeenCalled();\n          await artifactsManager.onHookFailure(error);\n          expect(testPlugin.onHookFailure).toHaveBeenCalledWith(error);\n        });\n      });\n\n      describe('onTestFnFailure', () => {\n        it('should call onTestFnFailure in plugins with the passed argument', async () => {\n          const error = testError();\n\n          expect(testPlugin.onTestFnFailure).not.toHaveBeenCalled();\n          await artifactsManager.onTestFnFailure(error);\n          expect(testPlugin.onTestFnFailure).toHaveBeenCalledWith(error);\n        });\n      });\n\n      describe('onTestDone', () => {\n        it('should call onTestDone in plugins with the passed argument', async () => {\n          const testSummary = testSummaries.passed();\n\n          expect(testPlugin.onTestDone).not.toHaveBeenCalled();\n          await artifactsManager.onTestDone(testSummary);\n          expect(testPlugin.onTestDone).toHaveBeenCalledWith(testSummary);\n        });\n      });\n\n      describe('onRunDescribeStart', () => {\n        it('should call onRunDescribeStart in plugins with the passed argument', async () => {\n          const suite = testSuite.mock();\n\n          expect(testPlugin.onRunDescribeStart).not.toHaveBeenCalled();\n          await artifactsManager.onRunDescribeStart(suite);\n          expect(testPlugin.onRunDescribeStart).toHaveBeenCalledWith(suite);\n        });\n      });\n\n      describe('onRunDescribeFinish', () => {\n        it('should call onRunDescribeFinish in plugins with the passed argument', async () => {\n          const suite = testSuite.mock();\n\n          expect(testPlugin.onRunDescribeFinish).not.toHaveBeenCalled();\n          await artifactsManager.onRunDescribeFinish(suite);\n          expect(testPlugin.onRunDescribeFinish).toHaveBeenCalledWith(suite);\n        });\n      });\n\n      describe('onBeforeCleanup', () => {\n        it('should call onBeforeCleanup in plugins', async () => {\n          expect(testPlugin.onBeforeCleanup).not.toHaveBeenCalled();\n          await artifactsManager.onBeforeCleanup();\n          expect(testPlugin.onBeforeCleanup).toHaveBeenCalled();\n        });\n      });\n\n      describe('onBootDevice', () => {\n        it('should call onBootDevice in plugins', async () => {\n          const bootInfo = {\n            coldBoot: false,\n            deviceId: 'testDeviceId',\n          };\n\n          expect(testPlugin.onBootDevice).not.toHaveBeenCalled();\n          await artifactsManager.onBootDevice(bootInfo);\n          expect(testPlugin.onBootDevice).toHaveBeenCalledWith(bootInfo);\n        });\n      });\n\n      describe('onBeforeTerminateApp', () => {\n        it('should call onBeforeTerminateApp in plugins', async () => {\n          const terminateInfo = {\n            deviceId: 'testDeviceId',\n            bundleId: 'testBundleId',\n          };\n\n          expect(testPlugin.onBeforeTerminateApp).not.toHaveBeenCalled();\n          await artifactsManager.onBeforeTerminateApp(terminateInfo);\n          expect(testPlugin.onBeforeTerminateApp).toHaveBeenCalledWith(terminateInfo);\n        });\n      });\n\n      describe('onTerminateApp', () => {\n        it('should call onTerminateApp in plugins', async () => {\n          const terminateInfo = {\n            deviceId: 'testDeviceId',\n            bundleId: 'testBundleId',\n          };\n\n          expect(testPlugin.onBeforeTerminateApp).not.toHaveBeenCalled();\n          await artifactsManager.onBeforeTerminateApp(terminateInfo);\n          expect(testPlugin.onBeforeTerminateApp).toHaveBeenCalledWith(terminateInfo);\n        });\n      });\n\n      describe('onBeforeUninstallApp', () => {\n        it('should call onBeforeUninstallApp in plugins', async () => {\n          const uninstallInfo = {\n            deviceId: 'testDeviceId',\n            bundleId: 'testBundleId',\n          };\n\n          expect(testPlugin.onBeforeUninstallApp).not.toHaveBeenCalled();\n          await artifactsManager.onBeforeUninstallApp(uninstallInfo);\n          expect(testPlugin.onBeforeUninstallApp).toHaveBeenCalledWith(uninstallInfo);\n        });\n      });\n\n      describe('onBeforeShutdownDevice', () => {\n        it('should call onBeforeShutdownDevice in plugins', async () => {\n          const shutdownInfo = {\n            deviceId: 'testDeviceId',\n          };\n\n          expect(testPlugin.onBeforeShutdownDevice).not.toHaveBeenCalled();\n          await artifactsManager.onBeforeShutdownDevice(shutdownInfo);\n          expect(testPlugin.onBeforeShutdownDevice).toHaveBeenCalledWith(shutdownInfo);\n        });\n      });\n\n      describe('onShutdownDevice', () => {\n        it('should call onShutdownDevice in plugins', async () => {\n          const shutdownInfo = {\n            deviceId: 'testDeviceId',\n          };\n\n          expect(testPlugin.onShutdownDevice).not.toHaveBeenCalled();\n          await artifactsManager.onShutdownDevice(shutdownInfo);\n          expect(testPlugin.onShutdownDevice).toHaveBeenCalledWith(shutdownInfo);\n        });\n      });\n    });\n\n    describe('onCreateExternalArtifact', () => {\n      it('should call onCreateExternalArtifact in a specific plugin', async () => {\n        await artifactsManager.onCreateExternalArtifact({\n          pluginId: 'testPlugin',\n          artifactPath: '/tmp/path/to/artifact',\n          artifactName: 'Example',\n        });\n\n        expect(testPlugin.onCreateExternalArtifact).toHaveBeenCalledWith({\n          artifact: expect.any(Object),\n          name: 'Example',\n        });\n      });\n    });\n\n    describe('onBeforeLaunchApp', () => {\n      it('should call onBeforeLaunchApp in plugins', async () => {\n        const launchInfo = {\n          deviceId: 'testDeviceId',\n          bundleId: 'testBundleId',\n        };\n\n        expect(testPlugin.onBeforeLaunchApp).not.toHaveBeenCalledWith(launchInfo);\n        await artifactsManager.onBeforeLaunchApp(launchInfo);\n        expect(testPlugin.onBeforeLaunchApp).toHaveBeenCalledWith(launchInfo);\n      });\n    });\n\n    describe('onLaunchApp', () => {\n      it('should call onLaunchApp in plugins', async () => {\n        const launchInfo = {\n          deviceId: 'testDeviceId',\n          bundleId: 'testBundleId',\n          pid: 2018,\n        };\n\n        await artifactsManager.onBeforeLaunchApp({ ...launchInfo, pid: NaN });\n\n        expect(testPlugin.onLaunchApp).not.toHaveBeenCalled();\n        await artifactsManager.onLaunchApp(launchInfo);\n        expect(testPlugin.onLaunchApp).toHaveBeenCalledWith(launchInfo);\n      });\n    });\n\n    describe('onAppReady', () => {\n      it('should call onAppReady in plugins', async () => {\n        const appInfo = {\n          deviceId: 'testDeviceId',\n          bundleId: 'testBundleId',\n          pid: 2020,\n        };\n\n        expect(testPlugin.onAppReady).not.toHaveBeenCalled();\n        await artifactsManager.onAppReady(appInfo);\n        expect(testPlugin.onAppReady).toHaveBeenCalledWith(appInfo);\n      });\n    });\n  });\n\n  describe('.subscribeToDeviceEvents', () => {\n    let artifactsManager, emitter;\n\n    beforeEach(() => {\n      artifactsManager = new proxy.ArtifactsManager({\n        pathBuilder: new proxy.ArtifactPathBuilder({\n          rootDir: '/tmp',\n        }),\n        plugins: {\n          mock: { setting: 'value' },\n        },\n      });\n\n      emitter = {\n        on: jest.fn(),\n      };\n    });\n\n    it.each([\n      ['bootDevice'],\n      ['beforeShutdownDevice'],\n      ['shutdownDevice'],\n      ['beforeLaunchApp'],\n      ['launchApp'],\n      ['appReady'],\n      ['beforeUninstallApp'],\n      ['beforeTerminateApp'],\n      ['terminateApp'],\n      ['createExternalArtifact'],\n    ])(`should subscribe to emitter's %s event`, (eventName) => {\n      artifactsManager.subscribeToDeviceEvents(emitter);\n      expect(emitter.on).toHaveBeenCalledWith(eventName, expect.any(Function));\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/__mocks__/FakePathBuilder.js",
    "content": "class FakePathBuilder {\n  buildPathForTestArtifact(artifactName, testSummary) {\n    return (testSummary ? (testSummary.fullName + '/') : '') + artifactName;\n  }\n}\n\nmodule.exports = FakePathBuilder;"
  },
  {
    "path": "detox/src/artifacts/__mocks__/testSummaries.mock.js",
    "content": "const running = () => ({\n  title: 'test',\n  fullName: 'Suite test',\n  status: 'running',\n});\n\nconst passed = () => ({\n  title: 'test',\n  fullName: 'Suite test',\n  status: 'passed',\n});\n\nconst failed = () => ({\n  title: 'test',\n  fullName: 'Suite test',\n  status: 'failed',\n});\n\nconst timedOut = () => ({\n  ...failed(),\n  timedOut: true,\n});\n\nmodule.exports = {\n  running,\n  passed,\n  failed,\n  timedOut,\n};"
  },
  {
    "path": "detox/src/artifacts/factories/index.js",
    "content": "// @ts-nocheck\nconst ArtifactsManager = require('../ArtifactsManager');\nconst {\n  AndroidArtifactPluginsProvider,\n  IosArtifactPluginsProvider,\n  IosSimulatorArtifactPluginsProvider,\n  EmptyProvider,\n} = require('../providers');\n\nclass ArtifactsManagerFactory {\n  /**\n   * @param provider { ArtifactPluginsProvider }\n   */\n  constructor(provider) {\n    this._provider = provider;\n  }\n\n  createArtifactsManager(artifactsConfig, { eventEmitter, client }) {\n    const artifactsManager = new ArtifactsManager(artifactsConfig);\n    artifactsManager.subscribeToDeviceEvents(eventEmitter);\n    artifactsManager.registerArtifactPlugins(this._provider.declareArtifactPlugins({ client }));\n    return artifactsManager;\n  }\n}\n\nclass Android extends ArtifactsManagerFactory {\n  constructor() {\n    super(new AndroidArtifactPluginsProvider());\n  }\n}\n\nclass Ios extends ArtifactsManagerFactory {\n  constructor() {\n    super(new IosArtifactPluginsProvider());\n  }\n}\n\nclass IosSimulator extends ArtifactsManagerFactory {\n  constructor() {\n    super(new IosSimulatorArtifactPluginsProvider());\n  }\n}\n\nclass External extends ArtifactsManagerFactory {\n  constructor(module) {\n    super(new (module.ArtifactPluginsProviderClass || EmptyProvider)());\n  }\n}\n\nmodule.exports = {\n  ArtifactsManagerFactory,\n  Android,\n  Ios,\n  IosSimulator,\n  External,\n};\n"
  },
  {
    "path": "detox/src/artifacts/factories/index.test.js",
    "content": "describe('Artifacts manager factory', () => {\n  const config = {\n    mock: 'config',\n  };\n  const eventEmitter = {\n    mock: 'emitter',\n  };\n  const client = {\n    mock: 'client',\n  };\n\n  const givenArtifactPlugins = (plugins) => pluginsProvider.declareArtifactPlugins.mockReturnValue(plugins);\n\n  let ArtifactsManager;\n  let pluginsProvider;\n  let factory;\n  beforeEach(() => {\n    jest.mock('../ArtifactsManager');\n    ArtifactsManager = require('../ArtifactsManager');\n\n    const PluginsProvider = jest.createMockFromModule('../providers').EmptyProvider;\n    pluginsProvider = new PluginsProvider();\n\n    const { ArtifactsManagerFactory } = require('./index');\n    factory = new ArtifactsManagerFactory(pluginsProvider);\n  });\n\n  it('should create an artifacts manager', () => {\n    const artifactsManager = factory.createArtifactsManager(config, { eventEmitter, client });\n    expect(artifactsManager).toBeDefined();\n    expect(ArtifactsManager).toHaveBeenCalledWith(config);\n  });\n\n  it('should subscribe artifacts manager to device events', () => {\n    const artifactsManager = factory.createArtifactsManager(config, { eventEmitter, client });\n    expect(artifactsManager.subscribeToDeviceEvents).toHaveBeenCalledWith(eventEmitter);\n  });\n\n  it('should register plugins in the artifacts manager', () => {\n    const plugins = {\n      'fakePlugin': {},\n    };\n    givenArtifactPlugins(plugins);\n\n    const artifactsManager = factory.createArtifactsManager(config, { eventEmitter, client });\n    expect(artifactsManager.registerArtifactPlugins).toHaveBeenCalledWith(plugins);\n    expect(pluginsProvider.declareArtifactPlugins).toHaveBeenCalledWith({ client });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/InstrumentsArtifactPlugin.js",
    "content": "// @ts-nocheck\nconst WholeTestRecorderPlugin = require('../templates/plugin/WholeTestRecorderPlugin');\n\nclass InstrumentsArtifactPlugin extends WholeTestRecorderPlugin {\n  constructor({ api }) {\n    super({ api });\n  }\n\n  async onBeforeUninstallApp(event) {\n    await super.onBeforeUninstallApp(event);\n    await this._stopRecordingIfExists();\n  }\n\n  async onBeforeTerminateApp(event) {\n    await super.onBeforeTerminateApp(event);\n    await this._stopRecordingIfExists();\n  }\n\n  async onBeforeShutdownDevice(event) {\n    await super.onBeforeShutdownDevice(event);\n    await this._stopRecordingIfExists();\n  }\n\n  async _stopRecordingIfExists() {\n    if (this.testRecording) {\n      await this.testRecording.stop();\n    }\n  }\n\n  async onLaunchApp(event) {\n    await super.onLaunchApp(event);\n\n    if (this.testRecording) {\n      await this.testRecording.start({ dry: true }); // start nominally, to set a correct recording state\n    }\n  }\n\n  /** @param {string} config */\n  static parseConfig(config) {\n    switch (config) {\n      case 'all':\n        return {\n          enabled: true,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n      case 'none':\n      default:\n        return {\n          enabled: false,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n    }\n  }\n}\n\nmodule.exports = InstrumentsArtifactPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/InstrumentsArtifactPlugin.test.js",
    "content": "// @ts-nocheck\nconst InstrumentsArtifactPlugin = require('./InstrumentsArtifactPlugin');\n\ndescribe('InstrumentsArtifactPlugin', () => {\n  describe('static parseConfig(config)', () => {\n    const parseConfig = InstrumentsArtifactPlugin.parseConfig;\n\n    const ENABLE_MODES = ['all'].map(x => [x]);\n    const DISABLE_MODES = ['none', 'manual', 'failing', 'blabla'].map(x => [x]);\n    const INCLUSIVE_MODES = ['all', 'manual', 'none', 'failing', { keepOnlyFailedTestsArtifacts: true }].map(x => [x]);\n\n    it.each(ENABLE_MODES)('should enable plugin if config = %j', (config) =>\n      expect(parseConfig(config).enabled).toBe(true));\n\n    it.each(DISABLE_MODES)('should disable plugin if config = %j', (config) =>\n      expect(parseConfig(config).enabled).toBe(false));\n\n    it.each(INCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n      expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(false));\n  });\n\n  describe('recording', () => {\n    let plugin, testRecording;\n\n    beforeEach(() => {\n      plugin = new InstrumentsArtifactPlugin({\n        api: {\n          userConfig: {\n            enabled: true\n          }\n        }\n      });\n      testRecording = {\n        stop: jest.fn(),\n        start: jest.fn()\n      };\n    });\n\n    describe('not exists in plugin', () => {\n      it('should not be stopped', async () => {\n        await plugin._stopRecordingIfExists();\n        expect(testRecording.stop).not.toHaveBeenCalled();\n      });\n\n      it('should not be started', async () => {\n        const event = {};\n        await plugin.onLaunchApp(event);\n        expect(testRecording.start).not.toHaveBeenCalledWith({\n          dry: true\n        });\n      });\n    });\n\n    describe('exists in plugin', () => {\n      beforeEach(() => {\n        plugin.testRecording = testRecording;\n      });\n\n      it('should be stopped if exists', async () => {\n        await plugin._stopRecordingIfExists();\n        expect(testRecording.stop).toHaveBeenCalled();\n      });\n\n      it('should be stopped on onBeforeUninstallApp', async () => {\n        await plugin.onBeforeUninstallApp();\n        expect(testRecording.stop).toHaveBeenCalled();\n      });\n\n      it('should be stopped on onBeforeTerminateApp', async () => {\n        await plugin.onBeforeTerminateApp();\n        expect(testRecording.stop).toHaveBeenCalled();\n      });\n\n      it('should be stopped on onBeforeShutdownDevice', async () => {\n        await plugin.onBeforeShutdownDevice();\n        expect(testRecording.stop).toHaveBeenCalled();\n      });\n\n      it('should be started on onLaunchApp', async () => {\n        const event = {};\n        await plugin.onLaunchApp(event);\n        expect(testRecording.start).toHaveBeenCalledWith({\n          dry: true\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/InstrumentsArtifactRecording.js",
    "content": "const Artifact = require('../templates/artifact/Artifact');\n\nclass InstrumentsArtifactRecording extends Artifact {\n  constructor({ client, userConfig, temporaryRecordingPath }) {\n    super();\n\n    this._client = client;\n    this._userConfig = userConfig;\n    this.temporaryRecordingPath = temporaryRecordingPath;\n  }\n\n  async doStart({ dry = false } = {}) {\n    if (dry) {\n      return; // nominal start, to preserve state change\n    }\n\n    if (!this._isClientConnected()) {\n      return;\n    }\n\n    await this._client.startInstrumentsRecording({\n      recordingPath: this.temporaryRecordingPath,\n      samplingInterval: this.prepareSamplingInterval(this._userConfig.samplingInterval)\n    });\n  }\n\n  prepareSamplingInterval(samplingInterval) {\n    return samplingInterval;\n  }\n\n  async doStop() {\n    if (this._isClientConnected()) {\n      await this._client.stopInstrumentsRecording();\n    }\n  }\n\n  _isClientConnected() {\n    return this._client.isConnected;\n  }\n}\n\nmodule.exports = InstrumentsArtifactRecording;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/InstrumentsArtifactRecording.test.js",
    "content": "// @ts-nocheck\nconst InstrumentsArtifactRecording = require('./InstrumentsArtifactRecording');\n\ndescribe('InstrumentsArtifactRecording', () => {\n  let mockedClient, mockedPluginContext;\n\n  beforeEach(() => {\n    mockedClient = {\n      startInstrumentsRecording: jest.fn(),\n      stopInstrumentsRecording: jest.fn()\n    };\n  });\n\n  describe('isClientConnected', () => {\n    it('should be connected with real connection', () => {\n      const recording = new InstrumentsArtifactRecording({\n        pluginContext: mockedPluginContext,\n        client: mockedClient,\n      });\n      mockedClient.isConnected = true;\n      expect(recording._isClientConnected()).toBe(true);\n    });\n\n    it('should be disconnected without real connection', () => {\n      const recording = new InstrumentsArtifactRecording({\n        pluginContext: mockedPluginContext,\n        client: mockedClient,\n      });\n      mockedClient.isConnected = false;\n      expect(recording._isClientConnected()).toBe(false);\n    });\n  });\n\n  it('should not start instruments recording as client not connected', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient,\n      userConfig: {\n        enabled: true\n      },\n      temporaryRecordingPath: 'SomeRecordingPath'\n    });\n    mockedClient.isConnected = false;\n    await recording.doStart();\n    expect(mockedClient.startInstrumentsRecording).not.toHaveBeenCalled();\n  });\n\n  it('should not start instruments recording with connected client and DRY', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient,\n      userConfig: {\n        enabled: true\n      },\n      temporaryRecordingPath: 'SomeRecordingPath'\n    });\n    mockedClient.isConnected = true;\n    await recording.doStart({ dry: true });\n    expect(mockedClient.startInstrumentsRecording).not.toHaveBeenCalled();\n  });\n\n  it('should start instruments recording with empty user config', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient,\n      userConfig: {\n        enabled: true\n      },\n      temporaryRecordingPath: 'SomeRecordingPath'\n    });\n    mockedClient.isConnected = true;\n    await recording.doStart();\n    expect(mockedClient.startInstrumentsRecording).toHaveBeenCalledWith({\n      recordingPath: 'SomeRecordingPath'\n    });\n  });\n\n  it('should start instruments recording with sampling interval', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient,\n      userConfig: {\n        enabled: true,\n        samplingInterval: 100500\n      },\n      temporaryRecordingPath: 'SomeRecordingPath'\n    });\n    mockedClient.isConnected = true;\n    await recording.doStart();\n    expect(mockedClient.startInstrumentsRecording).toHaveBeenCalledWith({\n      recordingPath: 'SomeRecordingPath',\n      samplingInterval: 100500\n    });\n  });\n\n  it('should not stop instruments recording with disconnected client', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient\n    });\n    mockedClient.isConnected = false;\n    await recording.doStop();\n    expect(mockedClient.stopInstrumentsRecording).not.toHaveBeenCalled();\n  });\n\n  it('should stop instruments recording with connected client', async () => {\n    const recording = new InstrumentsArtifactRecording({\n      pluginContext: mockedPluginContext,\n      client: mockedClient\n    });\n    mockedClient.isConnected = true;\n    await recording.doStop();\n    expect(mockedClient.stopInstrumentsRecording).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/android/AndroidInstrumentsPlugin.js",
    "content": "// @ts-nocheck\nconst InstrumentsArtifactPlugin = require('../InstrumentsArtifactPlugin');\n\nconst AndroidInstrumentsRecording = require('./AndroidInstrumentsRecording');\n\nclass AndroidInstrumentsPlugin extends InstrumentsArtifactPlugin {\n  constructor({ api, adb, client, devicePathBuilder }) {\n    super({ api });\n\n    this.adb = adb;\n    this.client = client;\n    this.devicePathBuilder = devicePathBuilder;\n  }\n\n  async onBeforeLaunchApp(event) {\n    await super.onBeforeLaunchApp(event);\n\n    if (this.testRecording) {\n      event.launchArgs['detoxInstrumRecPath'] = this.testRecording.temporaryRecordingPath;\n      if (this.api.userConfig.samplingInterval) {\n        event.launchArgs['detoxInstrumSamplingInterval'] = this.api.userConfig.samplingInterval;\n      }\n    }\n  }\n\n  async preparePathForTestArtifact(testSummary) {\n    return this.api.preparePathForArtifact('test.dtxplain', testSummary);\n  }\n\n  createTestRecording() {\n    return new AndroidInstrumentsRecording({\n      adb: this.adb,\n      pluginContext: this.context,\n      client: this.client,\n      deviceId: this.context.deviceId,\n      userConfig: this.api.userConfig,\n      temporaryRecordingPath: this.devicePathBuilder.buildTemporaryArtifactPath('.dtxplain'),\n    });\n  }\n}\n\nmodule.exports = AndroidInstrumentsPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/android/AndroidInstrumentsPlugin.test.js",
    "content": "const AndroidInstrumentsPlugin = require('./AndroidInstrumentsPlugin');\n\ndescribe('AndroidInstrumentsPlugin', () => {\n  const testSummary = 'SomeTestSummary';\n  let pluginConfig;\n\n  beforeEach(() => {\n    const mockedApi = {\n      trackArtifact: jest.fn(),\n      untrackArtifact: jest.fn()\n    };\n    const mockedClient = {\n      isConnected: true,\n      startInstrumentsRecording: jest.fn(),\n    };\n    const mockedDevicePathBuilder = {\n      buildTemporaryArtifactPath: () => {\n        return 'test123';\n      }\n    };\n    pluginConfig = {\n      api: {\n        ...mockedApi,\n        userConfig: {\n          enabled: true\n        }\n      },\n      client: mockedClient,\n      devicePathBuilder: mockedDevicePathBuilder\n    };\n  });\n\n  it('should not build launchArgs without started test', async () => {\n    const plugin = new AndroidInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs).toEqual({});\n  });\n\n  it('should build launchArgs with started test and empty config', async () => {\n    const plugin = new AndroidInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onTestStart(testSummary);\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs.detoxInstrumRecPath).toBe(pluginConfig.devicePathBuilder.buildTemporaryArtifactPath());\n    expect(event.launchArgs.detoxInstrumSamplingInterval).toBeUndefined();\n  });\n\n  it('should build launchArgs with started test and samplingInterval from config', async () => {\n    pluginConfig.api.userConfig.samplingInterval = 100500;\n\n    const plugin = new AndroidInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onTestStart(testSummary);\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs.detoxInstrumSamplingInterval).toBe(100500);\n  });\n\n  it('should prepare path for artifact ', async () => {\n    const preparedPath = 'SomePreparedPath';\n    const preparePathForArtifact = jest.fn();\n    pluginConfig.api.preparePathForArtifact = preparePathForArtifact;\n    preparePathForArtifact.mockReturnValueOnce(preparedPath);\n\n    const plugin = new AndroidInstrumentsPlugin(pluginConfig);\n    const path = await plugin.preparePathForTestArtifact(testSummary);\n    expect(preparePathForArtifact).toHaveBeenCalledWith('test.dtxplain', testSummary);\n    expect(path).toBe(preparedPath);\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/android/AndroidInstrumentsRecording.js",
    "content": "// @ts-nocheck\nconst InstrumentsArtifactRecording = require('../InstrumentsArtifactRecording');\n\nclass AndroidInstrumentsRecording extends InstrumentsArtifactRecording {\n  constructor({ adb, pluginContext, client, deviceId, userConfig, temporaryRecordingPath }) {\n    super({ pluginContext, client, userConfig, temporaryRecordingPath });\n    this.adb = adb;\n    this.deviceId = deviceId;\n  }\n\n  async doSave(artifactPath) {\n    await super.doSave(artifactPath);\n    await this.adb.pull(this.deviceId, this.temporaryRecordingPath, artifactPath);\n    await this.adb.rm(this.deviceId, this.temporaryRecordingPath, true);\n  }\n\n  async doDiscard() {\n    await this.adb.rm(this.deviceId, this.temporaryRecordingPath, true);\n  }\n}\n\nmodule.exports = AndroidInstrumentsRecording;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/android/AndroidInstrumentsRecording.test.js",
    "content": "// @ts-nocheck\nconst AndroidInstrumentsRecording = require('./AndroidInstrumentsRecording');\n\ndescribe('AndroidInstrumentsRecording', () => {\n  const deviceId = 'SomeDeviceId';\n  const temporaryRecordingPath = 'SomeTemporaryRecordingPath';\n  const artifactPath = 'SomeArtifactPath';\n\n  let mockedAdb, recording;\n\n  beforeEach(() => {\n    mockedAdb = {\n      pull: jest.fn(),\n      rm: jest.fn()\n    };\n    recording = new AndroidInstrumentsRecording({\n      adb: mockedAdb,\n      deviceId,\n      temporaryRecordingPath\n    });\n  });\n\n  it('should pull & remove artifact via adb on save', async () => {\n    await recording.doSave(artifactPath);\n    expect(mockedAdb.pull).toHaveBeenCalledWith(deviceId, temporaryRecordingPath, artifactPath);\n    expect(mockedAdb.rm).toHaveBeenCalledWith(deviceId, temporaryRecordingPath, true);\n  });\n\n  it('should remove artifact via adb on discard', async () => {\n    await recording.doDiscard(artifactPath);\n    expect(mockedAdb.rm).toHaveBeenCalledWith(deviceId, temporaryRecordingPath, true);\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/ios/SimulatorInstrumentsPlugin.js",
    "content": "// @ts-nocheck\nconst temporaryPath = require('../../utils/temporaryPath');\nconst InstrumentsArtifactPlugin = require('../InstrumentsArtifactPlugin');\n\nconst SimulatorInstrumentsRecording = require('./SimulatorInstrumentsRecording');\n\nclass SimulatorInstrumentsPlugin extends InstrumentsArtifactPlugin {\n  constructor({ api, client }) {\n    super({ api });\n\n    this.client = client;\n  }\n\n  async onBeforeLaunchApp(event) {\n    await super.onBeforeLaunchApp(event);\n\n    if (this.testRecording) {\n      event.launchArgs['recordingPath'] = this.testRecording.temporaryRecordingPath;\n      event.launchArgs['samplingInterval'] =\n        SimulatorInstrumentsRecording.prepareSamplingInterval(this.api.userConfig.samplingInterval);\n    }\n\n    if (process.env.DETOX_INSTRUMENTS_PATH) {\n      event.launchArgs['instrumentsPath'] = process.env.DETOX_INSTRUMENTS_PATH;\n    }\n  }\n\n  async preparePathForTestArtifact(testSummary) {\n    return this.api.preparePathForArtifact('test.dtxrec', testSummary);\n  }\n\n  createTestRecording() {\n    return new SimulatorInstrumentsRecording({\n      pluginContext: this.context,\n      client: this.client,\n      userConfig: this.api.userConfig,\n      temporaryRecordingPath: temporaryPath.for.dtxrec(),\n    });\n  }\n}\n\nmodule.exports = SimulatorInstrumentsPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/ios/SimulatorInstrumentsPlugin.test.js",
    "content": "// @ts-nocheck\nconst temporaryPath = require('../../utils/temporaryPath');\n\nconst SimulatorInstrumentsPlugin = require('./SimulatorInstrumentsPlugin');\n\njest.mock('../../utils/temporaryPath');\n\ndescribe('SimulatorInstrumentsPlugin', () => {\n  const testSummary = 'TestSummary';\n  const testPath = 'TestPath';\n\n  let pluginConfig;\n\n  beforeEach(() => {\n    const mockedApi = {\n      trackArtifact: jest.fn(),\n      untrackArtifact: jest.fn()\n    };\n    const mockedClient = {\n      isConnected: true,\n      startInstrumentsRecording: jest.fn(),\n    };\n    pluginConfig = {\n      api: {\n        ...mockedApi,\n        userConfig: {\n          enabled: true\n        }\n      },\n      client: mockedClient\n    };\n    temporaryPath.for.dtxrec.mockReturnValueOnce(testPath);\n  });\n\n  it('should not build launchArgs without started test', async () => {\n    const plugin = new SimulatorInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs.recordingPath).toBeUndefined();\n  });\n\n  it('should build launchArgs with empty config', async () => {\n    const plugin = new SimulatorInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onTestStart(testSummary);\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs.recordingPath).toBe(testPath);\n    expect(event.launchArgs.samplingInterval).toBe(0.25);\n    expect(event.launchArgs.instrumentsPath).toBeUndefined();\n  });\n\n  it('should build launchArgs with samplingInterval from config', async () => {\n    pluginConfig.api.userConfig.samplingInterval = 100500;\n\n    const plugin = new SimulatorInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onTestStart(testSummary);\n    await plugin.onBeforeLaunchApp(event);\n    expect(event.launchArgs.samplingInterval).toBe(100.5);\n  });\n\n  it('should build launchArgs with instrumentsPath from ENV', async () => {\n    const plugin = new SimulatorInstrumentsPlugin(pluginConfig);\n    const event = {\n      launchArgs: {}\n    };\n    await plugin.onTestStart(testSummary);\n    const detoxInstrumentsPath = '/DETOX/INSTRUMENTS/PATH';\n    process.env.DETOX_INSTRUMENTS_PATH = detoxInstrumentsPath;\n    await plugin.onBeforeLaunchApp(event);\n    delete process.env.DETOX_INSTRUMENTS_PATH;\n    expect(event.launchArgs.instrumentsPath).toBe(detoxInstrumentsPath);\n  });\n\n  it('should prepare path for artifact ', async () => {\n    const preparePathForArtifact = jest.fn();\n    pluginConfig.api.preparePathForArtifact = preparePathForArtifact;\n\n    const plugin = new SimulatorInstrumentsPlugin(pluginConfig);\n    preparePathForArtifact.mockReturnValueOnce(testPath);\n    const path = await plugin.preparePathForTestArtifact(testSummary);\n    expect(preparePathForArtifact).toHaveBeenCalledWith('test.dtxrec', testSummary);\n    expect(path).toBe(testPath);\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/instruments/ios/SimulatorInstrumentsRecording.js",
    "content": "// @ts-nocheck\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst log = require('../../../utils/logger').child({ cat: 'artifact' });\nconst FileArtifact = require('../../templates/artifact/FileArtifact');\nconst InstrumentsArtifactRecording = require('../InstrumentsArtifactRecording');\n\nclass SimulatorInstrumentsRecording extends InstrumentsArtifactRecording {\n  constructor({ pluginContext, client, userConfig, temporaryRecordingPath }) {\n    super({ pluginContext, client, userConfig, temporaryRecordingPath });\n  }\n\n  static prepareSamplingInterval(samplingInterval) {\n    if (samplingInterval) {\n      return samplingInterval / 1000;\n    }\n    return 0.25;\n  }\n\n  prepareSamplingInterval(samplingInterval) {\n    return SimulatorInstrumentsRecording.prepareSamplingInterval(samplingInterval);\n  }\n\n  async doSave(artifactPath) {\n    const success = await FileArtifact.moveTemporaryFile(log, this.temporaryRecordingPath, artifactPath);\n    if (!success) {\n      SimulatorInstrumentsRecording.hintAboutDetoxInstruments();\n    }\n  }\n\n  async doDiscard() {\n    await fs.remove(this.temporaryRecordingPath);\n  }\n}\n\nSimulatorInstrumentsRecording.hintAboutDetoxInstruments = _.once(() => {\n  log.warn(`Make sure either:\n1. You have installed Detox Instruments:\n   https://github.com/wix/DetoxInstruments#installation\n2. You have integrated Detox Instruments in your app:\n   https://github.com/wix/DetoxInstruments/blob/master/Documentation/XcodeIntegrationGuide.md\n3. You have set the environment variable with your custom Detox Instruments location:\n   export DETOX_INSTRUMENTS_PATH=\"/path/to/Detox Instruments.app\"`);\n});\n\nmodule.exports = SimulatorInstrumentsRecording;\n"
  },
  {
    "path": "detox/src/artifacts/instruments/ios/SimulatorInstrumentsRecording.test.js",
    "content": "// @ts-nocheck\nconst fs = require('fs-extra');\n\nconst log = require('../../../utils/logger');\nconst FileArtifact = require('../../templates/artifact/FileArtifact');\n\nconst SimulatorInstrumentsRecording = require('./SimulatorInstrumentsRecording');\n\njest.mock('fs-extra');\njest.mock('../../templates/artifact/FileArtifact');\njest.mock('../../../utils/logger');\n\ndescribe('SimulatorInstrumentsRecording', () => {\n  const temporaryRecordingPath = 'SomeTemporaryRecordingPath';\n  const artifactPath = 'SomeArtifactPath';\n\n  let recording;\n\n  beforeEach(() => {\n    recording = new SimulatorInstrumentsRecording({\n      temporaryRecordingPath\n    });\n  });\n\n  it('should prepare sampling interval', () => {\n    expect(recording.prepareSamplingInterval(100500)).toBe(100.5);\n  });\n\n  it('should move artifact to temporary path', async () => {\n    FileArtifact.moveTemporaryFile.mockReturnValueOnce(true);\n    await recording.doSave(artifactPath);\n    expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(expect.anything(), temporaryRecordingPath, artifactPath);\n  });\n\n  it('should not warn console on moving artifact success', async () => {\n    FileArtifact.moveTemporaryFile.mockReturnValueOnce(true);\n    await recording.doSave(artifactPath);\n    expect(log.warn).not.toHaveBeenCalled();\n  });\n\n  it('should warn console only on moving artifact failure', async () => {\n    FileArtifact.moveTemporaryFile.mockReturnValueOnce(false);\n    await recording.doSave(artifactPath);\n    expect(log.warn).toHaveBeenCalled();\n  });\n\n  it('should remove artifact on discard', async () => {\n    await recording.doDiscard(artifactPath);\n    expect(fs.remove).toHaveBeenCalledWith(temporaryRecordingPath);\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/log/LogArtifactPlugin.js",
    "content": "// @ts-nocheck\nconst logger = require('../../utils/logger');\nconst FileArtifact = require('../templates/artifact/FileArtifact');\nconst StartupAndTestRecorderPlugin = require('../templates/plugin/StartupAndTestRecorderPlugin');\nconst getTimeStampString = require('../utils/getTimeStampString');\n\n/***\n * @abstract\n */\nclass LogArtifactPlugin extends StartupAndTestRecorderPlugin {\n  constructor({ api }) {\n    super({ api });\n  }\n\n  async onBeforeCleanup() {\n    await super.onBeforeCleanup();\n\n    if (this.shouldKeepArtifactOfSession()) {\n      this.api.requestIdleCallback(async () => {\n        const [jsonLogPath, plainLogPath] = await Promise.all([\n          this.api.preparePathForArtifact(`detox_pid_${process.pid}.json.log`),\n          this.api.preparePathForArtifact(`detox_pid_${process.pid}.log`),\n        ]);\n\n        await Promise.all([\n          new FileArtifact({ temporaryPath: logger.jsonFileStreamPath }).save(jsonLogPath, { append: true }),\n          new FileArtifact({ temporaryPath: logger.plainFileStreamPath }).save(plainLogPath, { append: true })\n        ]);\n      });\n    }\n  }\n\n  async onBeforeShutdownDevice(event) {\n    await super.onBeforeShutdownDevice(event);\n\n    if (this.currentRecording) {\n      await this.currentRecording.stop();\n    }\n  }\n\n  async preparePathForStartupArtifact() {\n    const deviceId = this.context.deviceId;\n    const timestamp = getTimeStampString();\n\n    return this.api.preparePathForArtifact(`${deviceId} ${timestamp}.startup.log`);\n  }\n\n  async preparePathForTestArtifact(testSummary) {\n    return this.api.preparePathForArtifact('device.log', testSummary);\n  }\n\n  /** @param {string} config */\n  static parseConfig(config) {\n    switch (config) {\n      case 'failing':\n        return {\n          enabled: true,\n          keepOnlyFailedTestsArtifacts: true,\n        };\n      case 'all':\n        return {\n          enabled: true,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n      case 'none':\n      default:\n        return {\n          enabled: false,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n    }\n  }\n}\n\nmodule.exports = LogArtifactPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/log/LogArtifactPlugin.test.js",
    "content": "const LogArtifactPlugin = require('./LogArtifactPlugin');\n\ndescribe('LogArtifactPlugin', () => {\n    describe('static parseConfig(config)', () => {\n        const parseConfig = LogArtifactPlugin.parseConfig;\n\n        const ENABLE_MODES = ['all', 'failing'].map(x => [x]);\n        const DISABLE_MODES = ['none', 'blabla'].map(x => [x]);\n\n        const INCLUSIVE_MODES = ['all', 'manual', 'none', 'blabla'].map(x => [x]);\n        const EXCLUSIVE_MODES = ['failing'].map(x => [x]);\n\n        it.each(ENABLE_MODES)('should enable plugin if config = %j', (config) =>\n            expect(parseConfig(config).enabled).toBe(true));\n\n        it.each(DISABLE_MODES)('should disable plugin if config = %j', (config) =>\n            expect(parseConfig(config).enabled).toBe(false));\n\n        it.each(INCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n            expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(false));\n\n        it.each(EXCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n            expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(true));\n    });\n});\n"
  },
  {
    "path": "detox/src/artifacts/log/android/ADBLogcatPlugin.js",
    "content": "// @ts-nocheck\nconst LogArtifactPlugin = require('../LogArtifactPlugin');\n\nconst ADBLogcatRecording = require('./ADBLogcatRecording');\n\nclass ADBLogcatPlugin extends LogArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this._adb = config.adb;\n    this._devicePathBuilder = config.devicePathBuilder;\n    this._lastTimestamp = '';\n  }\n\n  async onBeforeLaunchApp(event) {\n    await super.onBeforeLaunchApp(event);\n    this._lastTimestamp = await this._adb.now(event.deviceId);\n  }\n\n  async onLaunchApp(event) {\n    await super.onLaunchApp(event);\n    await this.onReadyToRecord();\n\n    if (this.currentRecording) {\n      await this.currentRecording.start();\n    }\n  }\n\n  createStartupRecording() {\n    return this.createTestRecording();\n  }\n\n  createTestRecording() {\n    const { deviceId, bundleId } = this.context;\n\n    return new ADBLogcatRecording({\n      adb: this._adb,\n      deviceId,\n      bundleId,\n      pid: {\n        get: () => this.context.pid,\n      },\n      since: {\n        get: () => this._lastTimestamp,\n        set: (value) => { this._lastTimestamp = value; },\n      },\n      pathToLogOnDevice: this._devicePathBuilder.buildTemporaryArtifactPath('.log'),\n    });\n  }\n}\n\nmodule.exports = ADBLogcatPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/log/android/ADBLogcatRecording.js",
    "content": "const DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');\nconst { interruptProcess } = require('../../../utils/childProcess');\nconst retry = require('../../../utils/retry');\nconst sleep = require('../../../utils/sleep');\nconst Artifact = require('../../templates/artifact/Artifact');\n\nclass ADBLogcatRecording extends Artifact {\n  constructor({\n    adb,\n    deviceId,\n    pid,\n    since,\n    pathToLogOnDevice,\n  }) {\n    super();\n    this.adb = adb;\n\n    this.deviceId = deviceId;\n    this.pid = pid;\n    this.since = since;\n\n    this.pathToLogOnDevice = pathToLogOnDevice;\n    this.processPromise = null;\n\n    this._waitUntilLogFileIsCreated = null;\n  }\n\n  async doStart() {\n    const pid = this.pid.get();\n\n    this.processPromise = this.adb.logcat(this.deviceId, {\n      file: this.pathToLogOnDevice,\n      time: this.since.get(),\n      pid: pid > 0 ? pid : 0,\n    });\n\n    this._waitUntilLogFileIsCreated = sleep(300).then(() => {\n      return retry(() => this._assertLogIsCreated());\n    });\n  }\n\n  async doStop() {\n    try {\n      await this._waitUntilLogFileIsCreated;\n      this.since.set(await this.adb.now(this.deviceId));\n    } finally {\n      if (this.processPromise) {\n        await interruptProcess(this.processPromise);\n        this.processPromise = null;\n      }\n    }\n  }\n\n  async doSave(artifactPath) {\n    await this.adb.pull(this.deviceId, this.pathToLogOnDevice, artifactPath);\n    await this.adb.rm(this.deviceId, this.pathToLogOnDevice);\n  }\n\n  async doDiscard() {\n    await this.adb.rm(this.deviceId, this.pathToLogOnDevice);\n  }\n\n  async _assertLogIsCreated() {\n    const size = await this.adb.getFileSize(this.deviceId, this.pathToLogOnDevice);\n\n    if (size < 0) {\n      throw new DetoxRuntimeError({\n        message: `The log is not being recorded on device (${this.deviceId}) at path: ${this.pathToLogOnDevice}`,\n      });\n    }\n  }\n}\n\nmodule.exports = ADBLogcatRecording;\n"
  },
  {
    "path": "detox/src/artifacts/log/ios/SimulatorLogPlugin.js",
    "content": "// @ts-nocheck\nconst temporaryPath = require('../../utils/temporaryPath');\nconst LogArtifactPlugin = require('../LogArtifactPlugin');\n\nconst SimulatorLogRecording = require('./SimulatorLogRecording');\n\nclass SimulatorLogPlugin extends LogArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this.appleSimUtils = config.appleSimUtils;\n    this.priority = 8;\n  }\n\n  async onBeforeLaunchApp(event) {\n    await super.onBeforeLaunchApp(event);\n    await this.onReadyToRecord();\n\n    if (this.currentRecording) {\n      await this.currentRecording.start({\n        udid: event.deviceId,\n        bundleId: event.bundleId,\n      });\n    }\n  }\n\n  createStartupRecording() {\n    return this.createTestRecording();\n  }\n\n  createTestRecording() {\n    return new SimulatorLogRecording({\n      udid: this.context.deviceId,\n      bundleId: this.context.bundleId,\n      appleSimUtils: this.appleSimUtils,\n      temporaryLogPath: temporaryPath.for.log(),\n      config: {\n        delayAfterStart: 50,\n        delayBeforeStop: 50,\n        delayBeforeSigterm: 200,\n      },\n    });\n  }\n}\n\nmodule.exports = SimulatorLogPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/log/ios/SimulatorLogPlugin.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../utils/logger');\n\nconst path = require('path');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst childProcess = require('../../../utils/childProcess');\nconst tempfile = require('../../../utils/tempfile');\n\n\ndescribe('SimulatorLogPlugin', () => {\n  async function majorWorkflow() {\n    let fakePathBuilder = null;\n    let fakeSources = null;\n    let fakeAppleSimUtils = null;\n    let artifactsManager = null;\n    let SimulatorLogPlugin = null;\n    let ArtifactsManager = null;\n    let createdArtifacts = null;\n\n    function init() {\n      SimulatorLogPlugin = require('./SimulatorLogPlugin');\n      ArtifactsManager = require('../../ArtifactsManager');\n\n      createdArtifacts = [];\n      fakePathBuilder = {\n        buildPathForTestArtifact: jest.fn((artifactName, summary) => {\n          const artifactPath = tempfile(summary ? '.log' : '.startup.log');\n          if (!artifactName.includes('detox_')) {\n            createdArtifacts.push(artifactPath);\n          }\n\n          return artifactPath;\n        }),\n      };\n\n      fakeSources = {\n        stdin: tempfile('.stdin.log'),\n      };\n\n      fakeAppleSimUtils = {\n        logStream({ /* udid, processImagePath, level, */ stdout, stderr }) {\n          // fs.writeFileSync(fakeSources.stdin, '');\n\n          const handle = fs.openSync(fakeSources.stdin, 'r');\n          const process = childProcess.spawnAndLog('cat', [], {\n            stdio: [handle, stdout, stderr],\n            silent: true,\n          });\n\n          process.catch(e => e).then(() => fs.close(handle));\n\n          return process;\n        },\n        getAppContainer(udid, bundleId) {\n          return `/path/to/simulators/${udid}/apps/${bundleId}.app`;\n        },\n      };\n\n      artifactsManager = new ArtifactsManager({\n        pathBuilder: fakePathBuilder,\n        plugins: {\n          log: {\n            enabled: true,\n            keepOnlyFailedTestsArtifacts: false,\n          },\n        },\n      });\n      artifactsManager.registerArtifactPlugins({\n        log: (api) => new SimulatorLogPlugin({\n          api,\n          appleSimUtils: fakeAppleSimUtils,\n        }),\n      });\n    }\n\n    async function logToDeviceLogs(line) {\n      await fs.appendFile(fakeSources.stdin, line + '\\n');\n      await fs.readFile(fakeSources.stdin, 'utf8');\n    }\n\n    await init();\n    await artifactsManager.onBootDevice({ deviceId: 'booted' });\n    await logToDeviceLogs('omit - after boot');\n\n    await artifactsManager.onBeforeLaunchApp({ device: 'booted', bundleId: 'com.test' });\n    await logToDeviceLogs('omit - during launch inside detox.init()');\n    await artifactsManager.onLaunchApp({ device: 'booted', bundleId: 'com.test', pid: 8000 });\n    await logToDeviceLogs('omit - after launch inside detox.init()');\n\n    await artifactsManager.onTestStart({ title: 'test', fullName: 'some test', status: 'running' });\n    await logToDeviceLogs('take - before relaunch inside test');\n\n    await artifactsManager.onBeforeLaunchApp({ device: 'booted', bundleId: 'com.test' });\n    await logToDeviceLogs('take - during relaunch inside test');\n    await artifactsManager.onLaunchApp({ device: 'booted', bundleId: 'com.test', pid: 8001 });\n\n    await logToDeviceLogs('take - after relaunch inside test');\n    await artifactsManager.onTestDone({ title: 'test', fullName: 'some test', status: 'passed' });\n\n    await logToDeviceLogs('omit - before cleanup');\n    await artifactsManager.onBeforeCleanup();\n    await logToDeviceLogs('omit - after cleanup');\n\n    const result = {};\n\n    expect(fakePathBuilder.buildPathForTestArtifact).toHaveBeenCalledTimes(4);\n    for (const artifact of createdArtifacts) {\n      const contents = (await fs.readFile(artifact, 'utf8')).trim().split('\\n');\n      const extension = path.basename(artifact).split('.').slice(1).join('.');\n\n      result[extension] = contents;\n    }\n\n    const allCreatedFiles = [...Object.values(fakeSources), ...createdArtifacts];\n    await Promise.all(allCreatedFiles.map(filename => fs.remove(filename)));\n\n    return result;\n  }\n\n  it.skip('should work through-out boots, launches and relaunches', async () => {\n    const snapshots = await majorWorkflow();\n    for (const [snapshotName, value] of Object.entries(snapshots)) {\n      expect(value).toMatchSnapshot(snapshotName);\n    }\n  });\n\n  it.skip('should work consistently in a stressed environment', async () => {\n    const results = await Promise.all(_.times(16, majorWorkflow));\n\n    for (const result of results) {\n      expect(result).toEqual(results[0]);\n    }\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/log/ios/SimulatorLogRecording.js",
    "content": "// @ts-nocheck\nconst fs = require('fs-extra');\n\nconst childProcess = require('../../../utils/childProcess');\nconst log = require('../../../utils/logger').child({ cat: 'artifact' });\nconst sleep = require('../../../utils/sleep');\nconst Artifact = require('../../templates/artifact/Artifact');\nconst FileArtifact = require('../../templates/artifact/FileArtifact');\n\nclass SimulatorLogRecording extends Artifact {\n  constructor({\n    udid,\n    bundleId,\n    appleSimUtils,\n    temporaryLogPath,\n    config,\n  }) {\n    super();\n\n    this._udid = udid;\n    this._bundleId = bundleId;\n    this._appleSimUtils = appleSimUtils;\n    this._logPath = temporaryLogPath;\n    this._logContext = null;\n    this._config = config;\n  }\n\n  async doStart({ udid, bundleId } = {}) {\n    if (udid) {this._udid = udid; }\n    if (bundleId) {this._bundleId = bundleId; }\n\n    await fs.ensureFile(this._logPath);\n    const fileHandle = await fs.open(this._logPath, 'a');\n\n    this._logContext = {\n      fileHandle,\n      process: this._appleSimUtils.logStream({\n        udid: this._udid,\n        processImagePath: await this._getProcessImagePath(),\n        stdout: fileHandle,\n        level: 'debug',\n        style: 'compact',\n      }),\n    };\n\n    await sleep(this._config.delayAfterStart);\n  }\n\n  async doStop() {\n    if (this._logContext) {\n      const { fileHandle, process } = this._logContext;\n      await sleep(this._config.delayBeforeStop);\n      await this._tryInterruptProcessGracefully(process);\n      await fs.close(fileHandle);\n      this._logContext = null;\n    }\n  }\n\n  async _tryInterruptProcessGracefully(process) {\n    await childProcess.interruptProcess(process, {\n      SIGINT: 0,\n      SIGTERM: this._config.delayBeforeSigterm,\n    });\n  }\n\n  async doSave(artifactPath) {\n    await FileArtifact.moveTemporaryFile(log, this._logPath, artifactPath);\n  }\n\n  async doDiscard() {\n    await fs.remove(this._logPath);\n  }\n\n  async _getProcessImagePath() {\n    return this._bundleId\n      ? this._appleSimUtils.getAppContainer(this._udid, this._bundleId)\n      : '';\n  }\n}\n\nmodule.exports = SimulatorLogRecording;\n\n"
  },
  {
    "path": "detox/src/artifacts/providers/index.js",
    "content": "class ArtifactPluginsProvider {\n  declareArtifactPlugins({ client }) {} // eslint-disable-line no-unused-vars,@typescript-eslint/no-unused-vars\n}\n\nclass AndroidArtifactPluginsProvider extends ArtifactPluginsProvider {\n  declareArtifactPlugins({ client }) {\n    const serviceLocator = require('../../devices/servicelocator/android');\n    const adb = serviceLocator.adb;\n    const devicePathBuilder = serviceLocator.devicePathBuilder;\n\n    const AndroidInstrumentsPlugin = require('../instruments/android/AndroidInstrumentsPlugin');\n    const ADBLogcatPlugin = require('../log/android/ADBLogcatPlugin');\n    const ADBScreencapPlugin = require('../screenshot/ADBScreencapPlugin');\n    const ADBScreenrecorderPlugin = require('../video/ADBScreenrecorderPlugin');\n\n    return {\n      instruments: (api) => new AndroidInstrumentsPlugin({ api, adb, client, devicePathBuilder }),\n      log: (api) => new ADBLogcatPlugin({ api, adb, devicePathBuilder }),\n      screenshot: (api) => new ADBScreencapPlugin({ api, adb, devicePathBuilder }),\n      video: (api) => new ADBScreenrecorderPlugin({ api, adb, devicePathBuilder }),\n    };\n  }\n}\n\nclass IosArtifactPluginsProvider extends ArtifactPluginsProvider {\n  declareArtifactPlugins({ client }) {\n    const IosUIHierarchyPlugin = require('../uiHierarchy/IosUIHierarchyPlugin');\n\n    return {\n      uiHierarchy: (api) => new IosUIHierarchyPlugin({ api, client }),\n    };\n  }\n}\n\nclass IosSimulatorArtifactPluginsProvider extends IosArtifactPluginsProvider {\n  declareArtifactPlugins({ client }) {\n    const AppleSimUtils = require('../../devices/common/drivers/ios/tools/AppleSimUtils');\n    const appleSimUtils = new AppleSimUtils();\n\n    const SimulatorInstrumentsPlugin = require('../instruments/ios/SimulatorInstrumentsPlugin');\n    const SimulatorLogPlugin = require('../log/ios/SimulatorLogPlugin');\n    const SimulatorScreenshotPlugin = require('../screenshot/SimulatorScreenshotPlugin');\n    const SimulatorRecordVideoPlugin = require('../video/SimulatorRecordVideoPlugin');\n\n    return {\n      ...super.declareArtifactPlugins({ client }),\n\n      log: (api) => new SimulatorLogPlugin({ api, appleSimUtils }),\n      screenshot: (api) => new SimulatorScreenshotPlugin({ api, appleSimUtils, client }),\n      video: (api) => new SimulatorRecordVideoPlugin({ api, appleSimUtils }),\n      instruments: (api) => new SimulatorInstrumentsPlugin({ api, client }),\n    };\n  }\n}\n\nclass EmptyProvider extends ArtifactPluginsProvider {\n  constructor() {\n    super();\n    this.declareArtifactPlugins = () => ({});\n  }\n}\n\nmodule.exports = {\n  AndroidArtifactPluginsProvider,\n  IosArtifactPluginsProvider,\n  IosSimulatorArtifactPluginsProvider,\n  EmptyProvider,\n};\n"
  },
  {
    "path": "detox/src/artifacts/screenshot/ADBScreencapPlugin.js",
    "content": "const Artifact = require('../templates/artifact/Artifact');\n\nconst ScreenshotArtifactPlugin = require('./ScreenshotArtifactPlugin');\n\nclass ADBScreencapPlugin extends ScreenshotArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this._adb = config.adb;\n    this._devicePathBuilder = config.devicePathBuilder;\n  }\n\n  createTestArtifact() {\n    const adb = this._adb;\n    const deviceId = this.context.deviceId;\n    const pathToScreenshotOnDevice = this._devicePathBuilder.buildTemporaryArtifactPath('.png');\n\n    return new Artifact({\n      name: 'ADBScreencapRecording',\n\n      async start() {\n        await adb.screencap(deviceId, pathToScreenshotOnDevice);\n      },\n\n      async save(artifactPath) {\n        await adb.pull(deviceId, pathToScreenshotOnDevice, artifactPath);\n        await adb.rm(deviceId, pathToScreenshotOnDevice);\n      },\n\n      async discard() {\n        await adb.rm(deviceId, pathToScreenshotOnDevice);\n      },\n    });\n  }\n}\n\nmodule.exports = ADBScreencapPlugin;"
  },
  {
    "path": "detox/src/artifacts/screenshot/ScreenshotArtifactPlugin.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst TwoSnapshotsPerTestPlugin = require('../templates/plugin/TwoSnapshotsPerTestPlugin');\n\n/***\n * @abstract\n */\nclass ScreenshotArtifactPlugin extends TwoSnapshotsPerTestPlugin {\n  constructor({ api }) {\n    super({ api });\n\n    _.defaults(this.takeAutomaticSnapshots, {\n      appNotReady: true,\n    });\n  }\n\n  async preparePathForSnapshot(testSummary, artifactName) {\n    return this.api.preparePathForArtifact(`${artifactName}.png`, testSummary);\n  }\n\n  async onBeforeCleanup(e) {\n    if (this.context.isAppReady === false) {\n      this._hasFailingTests = true;\n      await this._takeAutomaticSnapshot('appNotReady');\n    }\n\n    await super.onBeforeCleanup(e);\n  }\n\n  /** @param {string} config */\n  static parseConfig(config) {\n    switch (config) {\n      case 'failing':\n        return {\n          enabled: true,\n          shouldTakeAutomaticSnapshots: true,\n          keepOnlyFailedTestsArtifacts: true,\n        };\n      case 'all':\n        return {\n          enabled: true,\n          shouldTakeAutomaticSnapshots: true,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n      case 'none':\n        return {\n          enabled: false,\n          shouldTakeAutomaticSnapshots: false,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n      case 'manual':\n      default:\n        return {\n          enabled: true,\n          shouldTakeAutomaticSnapshots: false,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n    }\n  }\n}\n\nmodule.exports = ScreenshotArtifactPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/screenshot/ScreenshotArtifactPlugin.test.js",
    "content": "const ScreenshotArtifactPlugin = require('./ScreenshotArtifactPlugin');\n\ndescribe('ScreenshotArtifactPlugin', () => {\n  describe('default options', () => {\n    it('should have takeAutomaticSnapshots.appReady = true', () => {\n      const plugin = new ScreenshotArtifactPlugin({\n        api: {\n          userConfig: {\n            takeWhen: {},\n          },\n        }\n      });\n\n      expect(plugin.takeAutomaticSnapshots.appNotReady).toBe(true);\n    });\n\n    it('should allow to set takeAutomaticSnapshots.appReady to false', () => {\n      const plugin = new ScreenshotArtifactPlugin({\n        api: {\n          userConfig: {\n            takeWhen: {\n              appNotReady: false,\n            },\n          },\n        }\n      });\n\n      expect(plugin.takeAutomaticSnapshots.appNotReady).toBe(false);\n    });\n  });\n\n  describe('static parseConfig(config)', () => {\n    const parseConfig = ScreenshotArtifactPlugin.parseConfig;\n\n    const ENABLE_MODES = ['all', 'manual', 'failing', 'blabla'].map(x => [x]);\n    const DISABLE_MODES = ['none'].map(x => [x]);\n\n    const AUTOMATIC_MODES = ['all', 'failing'].map(x => [x]);\n    const MANUAL_MODES = ['manual', 'none', 'blabla'].map(x => [x]);\n\n    const INCLUSIVE_MODES = ['all', 'manual', 'none', 'blabla'].map(x => [x]);\n    const EXCLUSIVE_MODES = ['failing'].map(x => [x]);\n\n    it.each(ENABLE_MODES)('should enable plugin if config = %j', (config) =>\n        expect(parseConfig(config).enabled).toBe(true));\n\n    it.each(DISABLE_MODES)('should disable plugin if config = %j', (config) =>\n        expect(parseConfig(config).enabled).toBe(false));\n\n    it.each(AUTOMATIC_MODES)('should take automatic screenshots if config = %j', (config) =>\n        expect(parseConfig(config).shouldTakeAutomaticSnapshots).toBe(true));\n\n    it.each(MANUAL_MODES)('should not take automatic screenshots if config = %j', (config) =>\n        expect(parseConfig(config).shouldTakeAutomaticSnapshots).toBe(false));\n\n    it.each(INCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n        expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(false));\n\n    it.each(EXCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n        expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(true));\n  });\n});\n\n"
  },
  {
    "path": "detox/src/artifacts/screenshot/SimulatorScreenshotPlugin.js",
    "content": "const path = require('path');\n\nconst fs = require('../../utils/fsext');\nconst FileArtifact = require('../templates/artifact/FileArtifact');\nconst temporaryPath = require('../utils/temporaryPath');\n\nconst ScreenshotArtifactPlugin = require('./ScreenshotArtifactPlugin');\n\nclass SimulatorScreenshotPlugin extends ScreenshotArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this.appleSimUtils = config.appleSimUtils;\n    this.client = config.client;\n    this.client.setEventCallback('testFailed', this._onInvokeFailure.bind(this));\n  }\n\n  async onBeforeLaunchApp({ launchArgs }) {\n    if (this.enabled && this.shouldTakeAutomaticSnapshots && this.takeAutomaticSnapshots.testFailure) {\n      launchArgs.detoxDebugVisibility = 'YES';\n    }\n  }\n\n  async onBeforeUninstallApp(event) {\n    await this.api.requestIdleCallback(async () => {\n      const snapshots = [\n        ...Object.values(this.snapshots.fromTest),\n        ...Object.values(this.snapshots.fromSession)\n      ];\n\n      await Promise.all(snapshots.map(s => s && s.relocate()));\n    });\n\n    await super.onBeforeUninstallApp(event);\n  }\n\n  _onInvokeFailure({ params }) {\n    const visibilityArtifactDirs = [\n      params.visibilityFailingScreenshotsURL,\n      params.visibilityFailingRectsURL\n    ].filter(Boolean);\n\n    for (const visibilityDir of visibilityArtifactDirs) {\n      for (const innerFile of fs.readdirSync(visibilityDir)) {\n        const ext = path.extname(innerFile);\n        if (ext === '.png') {\n          const artifactName = path.basename(innerFile, ext).replace(/ /g, '_');\n          this._registerSnapshot(artifactName, new FileArtifact({\n            temporaryPath: path.join(visibilityDir, innerFile),\n          }));\n        }\n      }\n    }\n  }\n\n  createTestArtifact() {\n    const { context, appleSimUtils } = this;\n\n    return new FileArtifact({\n      name: 'SimulatorScreenshot',\n\n      async start() {\n        this.temporaryPath = temporaryPath.for.png();\n        await appleSimUtils.takeScreenshot(context.deviceId, this.temporaryPath);\n      },\n    });\n  }\n}\n\nmodule.exports = SimulatorScreenshotPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/templates/artifact/Artifact.js",
    "content": "// @ts-nocheck\nconst log = require('../../../utils/logger').child({ cat: 'artifact' });\n\nclass Artifact {\n  constructor(template) {\n    defineNonEnumerableProperties(this, Artifact.nonEnumerableProperties);\n\n    if (template) {\n      const { name, start, stop, save, discard, ...misc } = template;\n\n      Object.assign(this, misc);\n      this._name = name;\n\n      if (typeof start === 'function') {\n        this.doStart = start.bind(this);\n      }\n\n      if (typeof stop === 'function') {\n        this.doStop = stop.bind(template);\n      }\n\n      if (typeof save === 'function') {\n        this.doSave = save.bind(template);\n      }\n\n      if (typeof discard === 'function') {\n        this.doDiscard = discard.bind(template);\n      }\n    }\n\n    this._startPromise = null;\n    this._stopPromise = null;\n    this._savePromise = null;\n    this._discardPromise = null;\n    this.logger = log.child({ class: this.name });\n  }\n\n  get name() {\n    return this._name || this.constructor.name;\n  }\n\n  start(...args) {\n    this.logger.trace({ event: 'ARTIFACT_START' }, `starting ${this.name}`, ...args);\n\n    if (this._savePromise) {\n      this._startPromise = this._savePromise.then(() => this.doStart(...args));\n    } else if (this._discardPromise) {\n      this._startPromise = this._discardPromise.then(() => this.doStart(...args));\n    } else if (this._startPromise || this._stopPromise) {\n      this._startPromise = this.stop().then(() => this.doStart(...args));\n    } else {\n      this._startPromise = this.doStart(...args);\n    }\n\n    this._stopPromise = this._savePromise = this._discardPromise = null;\n    return this._startPromise;\n  }\n\n  stop(...args) {\n    if (!this._stopPromise) {\n      this.logger.trace({ event: 'ARTIFACT_STOP' }, `stopping ${this.name}`, ...args);\n\n      if (this._startPromise) {\n        this._stopPromise = this._startPromise.then(() => this.doStop(...args));\n      } else {\n        this._stopPromise = this._startPromise = Promise.resolve();\n      }\n    }\n\n    return this._stopPromise;\n  }\n\n  save(artifactPath, ...args) {\n    if (!this._savePromise) {\n      this.logger.trace({ event: 'ARTIFACT_SAVE' }, `saving ${this.name} to: ${artifactPath}`, ...args);\n\n      if (this._discardPromise) {\n        this.logger.warn({ event: 'ERROR' }, `cannot save an already discarded artifact to: ${artifactPath}`);\n        this._savePromise = this._discardPromise;\n      } else if (this._startPromise) {\n        this._savePromise = this.stop().then(() => this.doSave(artifactPath, ...args));\n      } else {\n        this._savePromise = this._stopPromise = this._startPromise = Promise.resolve();\n      }\n    }\n\n    return this._savePromise;\n  }\n\n  discard(...args) {\n    if (!this._discardPromise) {\n      this.logger.trace({ event: 'ARTIFACT_DISCARD' }, `discarding ${this.name}`, ...args);\n\n      if (this._savePromise) {\n        this._discardPromise = this._savePromise;\n      } else if (this._startPromise) {\n        this._discardPromise = this.stop().then(() => this.doDiscard(...args));\n      } else {\n        this._discardPromise = this._stopPromise = this._startPromise = Promise.resolve();\n      }\n    }\n\n    return this._discardPromise;\n  }\n\n  async doStart() {}\n\n  async doStop() {}\n\n  async doSave(_artifactPath) {}\n\n  async doDiscard() {}\n}\n\nArtifact.nonEnumerableProperties = [\n  '_name',\n  '_startPromise',\n  '_stopPromise',\n  '_savePromise',\n  '_discardPromise',\n  'logger',\n  'doStart',\n  'doStop',\n  'doSave',\n  'doDiscard',\n];\n\nfunction defineNonEnumerableProperties(obj, props) {\n  for (const prop of props) {\n    Object.defineProperty(obj, prop, {\n      enumerable: false,\n      writable: true,\n      value: obj[prop],\n    });\n  }\n}\n\nmodule.exports = Artifact;\n"
  },
  {
    "path": "detox/src/artifacts/templates/artifact/Artifact.test.js",
    "content": "const util = require('util');\n\nconst _ = require('lodash');\n\ndescribe('Artifact', () => {\n  let Artifact;\n\n  beforeEach(() => {\n    jest.mock('../../../utils/logger');\n    Artifact = require('./Artifact');\n  });\n\n  describe('extends Artifact', () => {\n    let artifact;\n    let ArifactExtensionTest;\n\n\n    beforeEach(() => {\n      ArifactExtensionTest = class extends Artifact {\n        constructor() {\n          super();\n\n          this.doStart = jest.fn().mockImplementation(() => super.doStart());\n          this.doStop = jest.fn().mockImplementation(() => super.doStop());\n          this.doSave = jest.fn().mockImplementation(() => super.doSave());\n          this.doDiscard = jest.fn().mockImplementation(() => super.doDiscard());\n        }\n      };\n\n      artifact = new ArifactExtensionTest();\n    });\n\n    it('should have a name', () => {\n      expect(artifact.name).toBe(ArifactExtensionTest.name);\n    });\n\n    it('should pass a regular save flow', async () => {\n      expect(artifact.doStart).not.toHaveBeenCalled();\n      await artifact.start();\n      expect(artifact.doStart).toHaveBeenCalled();\n\n      expect(artifact.doStop).not.toHaveBeenCalled();\n      await artifact.stop();\n      expect(artifact.doStop).toHaveBeenCalled();\n\n      expect(artifact.doSave).not.toHaveBeenCalled();\n      await artifact.save('path/to/artifact');\n      expect(artifact.doSave).toHaveBeenCalledWith('path/to/artifact');\n    });\n\n    it('should pass a regular discard flow', async () => {\n      expect(artifact.doStart).not.toHaveBeenCalled();\n      await artifact.start();\n      expect(artifact.doStart).toHaveBeenCalled();\n\n      expect(artifact.doStop).not.toHaveBeenCalled();\n      await artifact.stop();\n      expect(artifact.doStop).toHaveBeenCalled();\n\n      expect(artifact.doDiscard).not.toHaveBeenCalled();\n      await artifact.discard();\n      expect(artifact.doDiscard).toHaveBeenCalled();\n    });\n\n    it('should pass a fast synchronous workflow', async () => {\n      artifact.start();\n      artifact.stop();\n      artifact.save('/path/to/artifact');\n      await artifact.save();\n\n      expect(artifact.doStart).toHaveBeenCalledTimes(1);\n      expect(artifact.doStop).toHaveBeenCalledTimes(1);\n      expect(artifact.doSave).toHaveBeenCalledTimes(1);\n      expect(artifact.doSave).toHaveBeenCalledWith('/path/to/artifact');\n    });\n\n    describe('.start()', () => {\n      describe('if no other methods have been called', () => {\n        it('should call protected .doStart() method and pass args to it', async () => {\n          await artifact.start(1, 2, 3);\n          expect(artifact.doStart).toHaveBeenCalledWith(1, 2, 3);\n        });\n\n        it('should reject if the protected .doStart() rejects', async () => {\n          const err = new Error();\n\n          artifact.doStart.mockReturnValue(Promise.reject(err));\n          await expect(artifact.start()).rejects.toThrow(err);\n        });\n      });\n\n      describe('if .start() has been called before', () => {\n        beforeEach(async () => artifact.start());\n\n        it('should call .stop() and .start() again', async () => {\n          expect(artifact.doStop).not.toHaveBeenCalled();\n\n          await artifact.start(1, 2, 3, 4);\n          expect(artifact.doStop).toHaveBeenCalled();\n          expect(artifact.doStart).toHaveBeenCalledTimes(2);\n        });\n      });\n\n      describe('if .save() has been called before', () => {\n        beforeEach(async () => {\n          await artifact.start();\n          await artifact.save('artifactPath');\n        });\n\n        it('should wait till .save() ends and .start() again', async () => {\n          await artifact.start(1, 2, 3, 4);\n          expect(artifact.doStart).toHaveBeenCalledTimes(2);\n        });\n      });\n\n      describe('if .save() has been rejected before', () => {\n        let err;\n\n        beforeEach(async () => {\n          artifact.doSave.mockReturnValue(Promise.reject(err = new Error()));\n          await artifact.start();\n          await artifact.save('artifactPath').catch(_.noop);\n        });\n\n        it('should reject as well', async () => {\n          await expect(artifact.start()).rejects.toThrow(err);\n        });\n      });\n\n      describe('if .discard() has been called before', () => {\n        beforeEach(async () => {\n          await artifact.start();\n          await artifact.discard();\n        });\n\n        it('should wait till .discard() ends and .start() again', async () => {\n          await artifact.start(1, 2, 3, 4);\n          expect(artifact.doStart).toHaveBeenCalledTimes(2);\n        });\n      });\n\n      describe('if .discard() has been rejected before', () => {\n        let err;\n\n        beforeEach(async () => {\n          artifact.doDiscard.mockReturnValue(Promise.reject(err = new Error()));\n          await artifact.start();\n          await artifact.discard().catch(_.noop);\n        });\n\n        it('should reject as well', async () => {\n          await expect(artifact.start()).rejects.toThrow(err);\n        });\n      });\n    });\n\n    describe('.stop()', () => {\n      describe('if .start() has never been called', () => {\n        it('should resolve as an empty stub', async () => {\n          await artifact.stop();\n        });\n\n        it('should not call protected .doStop()', async () => {\n          await artifact.stop();\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doStart()', async () => {\n          await artifact.stop();\n          expect(artifact.doStart).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('if .start() has been resolved', () => {\n        beforeEach(async () => artifact.start());\n\n        it('should call protected .doStop()', async () => {\n          await artifact.stop(9, 1, 1);\n          expect(artifact.doStop).toHaveBeenCalledWith(9, 1, 1);\n        });\n\n        it('should keep returning the same promise on consequent calls', async () => {\n          expect(artifact.stop()).toBe(artifact.stop());\n          await artifact.stop();\n          expect(artifact.doStop).toHaveBeenCalledTimes(1);\n        });\n\n        it('should reject if .doStop() rejects', async () => {\n          const err = new Error();\n          artifact.doStop.mockReturnValue(Promise.reject(err));\n\n          await expect(artifact.stop()).rejects.toThrow(err);\n        });\n      });\n\n      describe('if .start() has been rejected', () => {\n        let error;\n\n        beforeEach(async () => {\n          error = new Error();\n\n          artifact.doStart.mockReturnValue(Promise.reject(error));\n          await artifact.start().catch(_.noop);\n        });\n\n        it('should reject the same error too', async () => {\n          await expect(artifact.stop()).rejects.toThrow(error);\n        });\n\n        it('should not call protected .doStop()', async () => {\n          await artifact.stop().catch(_.noop);\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n      });\n    });\n\n    describe('.discard()', () => {\n      describe('if .start() has never been called', () => {\n        it('should not throw an error', async () => {\n          await artifact.discard();\n        });\n\n        it('should not call protected .doStart()', async () => {\n          await artifact.discard();\n          expect(artifact.doStart).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doStop()', async () => {\n          await artifact.discard();\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doDiscard()', async () => {\n          await artifact.discard();\n          expect(artifact.doDiscard).not.toHaveBeenCalled();\n        });\n\n        it('should resolve .stop() with the same stub promise', async () => {\n          expect(artifact.discard()).toBe(artifact.stop());\n        });\n      });\n\n      describe('if .start() has been resolved', () => {\n        beforeEach(async () => artifact.start());\n\n        it('should call protected .doStop()', async () => {\n          await artifact.discard();\n          expect(artifact.doStop).toHaveBeenCalled();\n        });\n\n        it('should call protected .doDiscard()', async () => {\n          await artifact.discard();\n          expect(artifact.doDiscard).toHaveBeenCalled();\n        });\n\n        it('should keep returning the same promise on consequent calls', async () => {\n          expect(artifact.discard()).toBe(artifact.discard());\n          await artifact.discard();\n\n          expect(artifact.doStop).toHaveBeenCalledTimes(1);\n          expect(artifact.doDiscard).toHaveBeenCalledTimes(1);\n        });\n      });\n\n      describe('if .start() has been rejected', () => {\n        let error;\n\n        beforeEach(async () => {\n          error = new Error();\n\n          artifact.doStart.mockReturnValue(Promise.reject(error));\n          await artifact.start().catch(_.noop);\n        });\n\n        it('should return the .start() error', async () => {\n          await artifact.discard().catch(_.noop);\n          await expect(artifact.discard()).rejects.toThrow(error);\n        });\n\n        it('should not call protected .doStop()', async () => {\n          await artifact.discard().catch(_.noop);\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doDiscard()', async () => {\n          await artifact.discard().catch(_.noop);\n          expect(artifact.doDiscard).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('if .stop() has been rejected', () => {\n        let error;\n\n        beforeEach(async () => {\n          error = new Error();\n\n          artifact.doStop.mockReturnValue(Promise.reject(error));\n          await artifact.start();\n          await artifact.stop().catch(_.noop);\n        });\n\n        it('should return the .stop() error', async () => {\n          await artifact.discard().catch(_.noop);\n          await expect(artifact.discard()).rejects.toThrow(error);\n        });\n\n        it('should not call protected .doDiscard()', async () => {\n          await artifact.discard().catch(_.noop);\n          expect(artifact.doDiscard).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('if .save() has been called', () => {\n        beforeEach(async () => {\n          await artifact.start();\n          await artifact.stop();\n          await artifact.save('artifactPath');\n        });\n\n        it('should not call protected .doDiscard()', async () => {\n          await artifact.discard();\n          expect(artifact.doDiscard).not.toHaveBeenCalled();\n        });\n\n        it('should return .save() promise', () => {\n          expect(artifact.discard()).toBe(artifact.save());\n        });\n      });\n    });\n\n    describe('.save(artifactPath)', () => {\n      describe('if .start() has never been called', () => {\n        beforeEach(async () => artifact.save('artifactPath'));\n\n        it('should not call protected .doStart()', async () => {\n          expect(artifact.doStart).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doStop()', async () => {\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doDiscard()', async () => {\n          expect(artifact.doDiscard).not.toHaveBeenCalled();\n        });\n\n        it('should return the same promise on next calls', async () => {\n          expect(artifact.save('artifactPath')).toBe(artifact.stop());\n        });\n\n        it('should resolve .stop() with the same stub promise', async () => {\n          expect(artifact.save()).toBe(artifact.stop());\n        });\n      });\n\n      describe('if .discard() has been called before', () => {\n        beforeEach(async () => artifact.discard());\n\n        it('should return discard promise instead', async () => {\n          expect(artifact.save('artifactPath')).toBe(artifact.discard());\n        });\n\n        it('should not call protected .doSave(artifactPath)', async () => {\n          await artifact.save('artifactPath');\n          expect(artifact.doSave).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('if .start() has been called', () => {\n        beforeEach(async () => artifact.start());\n\n        it('should call protected .doSave(artifactPath)', async () => {\n          await artifact.save('artifactPath');\n          expect(artifact.doSave).toHaveBeenCalledWith('artifactPath');\n        });\n\n        it('should call protected .doStop()', async () => {\n          await artifact.save('artifactPath');\n          expect(artifact.doStop).toHaveBeenCalled();\n        });\n      });\n\n      describe('if .start() has been rejected', () => {\n        let error;\n\n        beforeEach(async () => {\n          error = new Error();\n          artifact.doStart.mockReturnValue(Promise.reject(error));\n          await artifact.start().catch(_.noop);\n        });\n\n        it('should return the same error', async () => {\n          await expect(artifact.save('artifactPath')).rejects.toThrow(error);\n        });\n\n        it('should not call protected .doStop()', async () => {\n          await artifact.save('artifactPath').catch(_.noop);\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doSave()', async () => {\n          await artifact.save('artifactPath').catch(_.noop);\n          expect(artifact.doSave).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('if .stop() has been rejected', () => {\n        let error;\n\n        beforeEach(async () => {\n          error = new Error();\n          artifact.doStop.mockReturnValue(Promise.reject(error));\n          await artifact.start();\n          await artifact.stop().catch(_.noop);\n        });\n\n        it('should return the same error', async () => {\n          await expect(artifact.save('artifactPath')).rejects.toThrow(error);\n        });\n\n        it('should not call protected .doStop()', async () => {\n          artifact.doStop.mockClear();\n          await artifact.save('artifactPath').catch(_.noop);\n          expect(artifact.doStop).not.toHaveBeenCalled();\n        });\n\n        it('should not call protected .doSave()', async () => {\n          await artifact.save('artifactPath').catch(_.noop);\n          expect(artifact.doSave).not.toHaveBeenCalled();\n        });\n      });\n    });\n  });\n\n  describe('methods as constructor arg', () => {\n    let artifact;\n\n    it('should replace protected .name with arg.name', () => {\n      artifact = new Artifact({ name: 'SomeName' });\n      expect(artifact.name).toBe('SomeName');\n    });\n\n    it('should replace protected .doStart() with arg.start()', async () => {\n      const start = jest.fn();\n      artifact = new Artifact({ start });\n\n      await artifact.start(1, 2, 3);\n      expect(start).toHaveBeenCalledWith(1, 2, 3);\n    });\n\n    it('should replace protected .doStop() with arg.stop()', async () => {\n      const stop = jest.fn();\n      artifact = new Artifact({ stop });\n\n      await artifact.start();\n      await artifact.stop(3, 4, 5);\n      expect(stop).toHaveBeenCalledWith(3, 4, 5);\n    });\n\n    it('should replace protected .doSave() with arg.save()', async () => {\n      const save = jest.fn();\n      artifact = new Artifact({ save });\n\n      await artifact.start();\n      await artifact.save('path', 100);\n      expect(save).toHaveBeenCalledWith('path', 100);\n    });\n\n    it('should replace protected .doDiscard() with arg.discard()', async () => {\n      const discard = jest.fn();\n      artifact = new Artifact({ discard });\n\n      await artifact.start();\n      await artifact.discard(200);\n      expect(discard).toHaveBeenCalledWith(200);\n    });\n  });\n\n  describe('util.inspect()', () => {\n    it('should print clean contents of Artifact instance', () => {\n      expect(util.inspect(new Artifact({\n        extraProp: 42,\n        start() {}\n      }))).toEqual(`Artifact { extraProp: 42 }`);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/templates/artifact/FileArtifact.js",
    "content": "// @ts-nocheck\nconst path = require('path');\n\nconst fs = require('fs-extra');\n\nconst appendFile = require('../../../utils/appendFile');\nconst tempfile = require('../../../utils/tempfile');\n\n\nconst Artifact = require('./Artifact');\n\nclass FileArtifact extends Artifact {\n  constructor(template) {\n    super(template);\n\n    if (template.temporaryPath || template.temporaryData) {\n      this.start();\n      this.stop();\n    }\n  }\n\n  async relocate() {\n    if (!this.temporaryPath || !(await fs.exists(this.temporaryPath))) {\n      return;\n    }\n\n    const newTemporaryPath = tempfile(path.extname(this.temporaryPath));\n    await FileArtifact.moveTemporaryFile(this.logger, this.temporaryPath, newTemporaryPath);\n    this.temporaryPath = newTemporaryPath;\n  }\n\n  async doSave(artifactPath, options = {}) {\n    if (this.temporaryPath) {\n      await FileArtifact.moveTemporaryFile(this.logger, this.temporaryPath, artifactPath, options.append);\n    } else /* if (this.temporaryData) */ {\n      await FileArtifact.writeFile(this.logger, this.temporaryData, artifactPath, options.append);\n    }\n  }\n\n  async doDiscard() {\n    await fs.remove(this.temporaryPath);\n  }\n\n  static async writeFile(logger, data, destination, canAppend = false) {\n    if (!data) {\n      logger.warn({ event: 'FILE_WRITE_EMPTY_DATA' }, `there is no data to write to \"${destination}\"`);\n\n      return false;\n    }\n\n    if (!await fs.exists(destination)) {\n      logger.debug({ event: 'FILE_WRITE_CREATE' }, `creating file \"${destination}\"`);\n    } else if (!canAppend) {\n      logger.warn({ event: 'FILE_WRITE_EXISTS' }, `cannot overwrite \"${destination}\"`);\n\n      return false;\n    }\n\n    if (canAppend) {\n      logger.debug({ event: 'FILE_WRITE' }, `writing to \"${destination}\" via appending`);\n      await fs.appendFile(destination, data);\n\n      return true;\n    } else {\n      logger.debug({ event: 'FILE_WRITE' }, `writing to \"${destination}\"`);\n      await fs.writeFile(destination, data);\n\n      return true;\n    }\n  }\n\n  static async moveTemporaryFile(logger, source, destination, canAppend = false) {\n    if (!await fs.exists(source)) {\n      logger.warn({ event: 'MOVE_FILE_MISSING' }, `did not find temporary file: ${source}`);\n      return false;\n    }\n\n    if (!await fs.exists(destination)) {\n      logger.debug({ event: 'MOVE_FILE' }, `moving \"${source}\" to ${destination}`);\n      await fs.move(source, destination);\n      return true;\n    }\n\n    if (canAppend) {\n      logger.debug({ event: 'MOVE_FILE' }, `moving \"${source}\" to ${destination} via appending`);\n      await appendFile(source, destination);\n      await fs.remove(source);\n      return true;\n    }\n\n    logger.warn({ event: 'MOVE_FILE_EXISTS' }, `cannot overwrite: \"${source}\" => \"${destination}\"`);\n    await fs.remove(source);\n    return false;\n  }\n}\n\nmodule.exports = FileArtifact;\n"
  },
  {
    "path": "detox/src/artifacts/templates/artifact/FileArtifact.test.js",
    "content": "const fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst tempfile = require('../../../utils/tempfile');\n\ndescribe('FileArtifact', () => {\n  let FileArtifact, fileArtifact, logger, temporaryPath, temporaryData, destinationPath;\n\n  beforeEach(async () => {\n    jest.mock('../../../utils/logger');\n    logger = require('../../../utils/logger');\n    FileArtifact = require('./FileArtifact');\n    fileArtifact = null;\n    temporaryPath = tempfile('.artifact');\n    destinationPath = tempfile('.artifact');\n    temporaryData = 'Just a usual string to be saved to the file';\n  });\n\n  afterEach(async () => {\n    await Promise.all([\n      fs.remove(temporaryPath),\n      fs.remove(destinationPath)\n    ]);\n  });\n\n  describe('save', () => {\n    beforeEach(() => {\n      jest.spyOn(FileArtifact, 'moveTemporaryFile').mockImplementation(_.noop);\n      jest.spyOn(FileArtifact, 'writeFile').mockImplementation(_.noop);\n    });\n\n    describe('if temporary file is passed to constructor', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          temporaryPath,\n        });\n      });\n\n      describe('when called simply', () => {\n        beforeEach(async () => {\n          await fileArtifact.save(destinationPath);\n        });\n\n        it('should call FileArtifact.moveTemporaryFile', async () => {\n          expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(logger, temporaryPath, destinationPath, undefined);\n        });\n      });\n\n      describe('when called with { append: true }', () => {\n        beforeEach(async () => {\n          await fileArtifact.save(destinationPath, { append: true });\n        });\n\n        it('should call FileArtifact.moveTemporaryFile with extra param', async () => {\n          expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(logger, temporaryPath, destinationPath, true);\n        });\n      });\n    });\n\n    describe('if temporary file is created in start()', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          async start() {\n            await fs.ensureFile(temporaryPath);\n            this.temporaryPath = temporaryPath;\n          }\n        });\n      });\n\n      describe('when save() is called without start()', () => {\n        beforeEach(async () => {\n          await fileArtifact.save(destinationPath);\n        });\n\n        it('should not call FileArtifact.moveTemporaryFile', async () => {\n          await fileArtifact.save(destinationPath);\n          expect(FileArtifact.moveTemporaryFile).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('and start() was called', () => {\n        beforeEach(async () => {\n          await fileArtifact.start();\n          await fileArtifact.save(destinationPath);\n        });\n\n        it('should call FileArtifact.moveTemporaryFile', async () => {\n          expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(logger, temporaryPath, destinationPath, undefined);\n        });\n      });\n    });\n\n    describe('if temporary data is passed to constructor', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          temporaryData,\n        });\n      });\n\n      describe('when called simply', () => {\n        beforeEach(async () => {\n          await fileArtifact.save(destinationPath);\n        });\n\n        it('should call FileArtifact.writeFile', async () => {\n          expect(FileArtifact.writeFile).toHaveBeenCalledWith(logger, temporaryData, destinationPath, undefined);\n        });\n      });\n\n      describe('when called with { append: true }', () => {\n        beforeEach(async () => {\n          await fileArtifact.save(destinationPath, { append: true });\n        });\n\n        it('should call FileArtifact.moveTemporaryFile with extra param', async () => {\n          expect(FileArtifact.writeFile).toHaveBeenCalledWith(logger, temporaryData, destinationPath, true);\n        });\n      });\n    });\n  });\n\n  describe('discard', () => {\n    describe('if temporary file exists', () => {\n      beforeEach(async () => {\n        await fs.ensureFile(temporaryPath);\n      });\n\n      it('should remove the temporary file', async () => {\n        const fileArtifact = new FileArtifact({ temporaryPath });\n        await fileArtifact.discard(destinationPath);\n        expect(fs.existsSync(temporaryPath)).toBe(false);\n      });\n    });\n\n    describe('if temporary file does not exist', () => {\n      beforeEach(async () => {\n        await fs.remove(temporaryPath);\n      });\n\n      it('should not log warnings', async () => {\n        const fileArtifact = new FileArtifact({ temporaryPath });\n        await fileArtifact.discard(destinationPath);\n\n        expect(logger.warn).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('relocate', () => {\n    beforeEach(() => {\n      jest.spyOn(FileArtifact, 'moveTemporaryFile').mockImplementation(_.noop);\n      jest.spyOn(FileArtifact, 'writeFile').mockImplementation(_.noop);\n    });\n\n    describe('if temporary file is passed to constructor', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          temporaryPath,\n        });\n      });\n\n      describe('and the file exists', () => {\n        beforeEach(async () => {\n          await fs.ensureFile(temporaryPath);\n        });\n\n        describe('when called', () => {\n          beforeEach(async () => {\n            await fileArtifact.relocate();\n          });\n\n          it('should call FileArtifact.moveTemporaryFile', async () => {\n            expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(logger, temporaryPath, expect.stringMatching(/\\.artifact$/));\n          });\n        });\n      });\n\n      describe('and the file does not exist', () => {\n        beforeEach(async () => {\n          await fs.remove(temporaryPath);\n        });\n\n        describe('when called', () => {\n          beforeEach(async () => {\n            await fileArtifact.relocate();\n          });\n\n          it('should call FileArtifact.moveTemporaryFile', async () => {\n            expect(FileArtifact.moveTemporaryFile).not.toHaveBeenCalled();\n          });\n        });\n      });\n    });\n\n    describe('if temporary file is created in start()', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          async start() {\n            await fs.ensureFile(temporaryPath);\n            this.temporaryPath = temporaryPath;\n          }\n        });\n      });\n\n      describe('when relocate() is called without start()', () => {\n        beforeEach(async () => {\n          await fileArtifact.relocate();\n        });\n\n        it('should not call FileArtifact.moveTemporaryFile', async () => {\n          expect(FileArtifact.moveTemporaryFile).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('and start() was called', () => {\n        beforeEach(async () => {\n          await fileArtifact.start();\n          await fileArtifact.relocate();\n        });\n\n        it('should call FileArtifact.moveTemporaryFile', async () => {\n          expect(FileArtifact.moveTemporaryFile).toHaveBeenCalledWith(logger, temporaryPath, expect.stringMatching(/\\.artifact$/));\n        });\n      });\n    });\n\n    describe('if temporary data is passed to constructor', () => {\n      beforeEach(() => {\n        fileArtifact = new FileArtifact({\n          name: 'CustomArtifact',\n          temporaryData,\n        });\n      });\n\n      describe('when called', () => {\n        beforeEach(async () => {\n          await fileArtifact.relocate();\n        });\n\n        it('should not do anything', async () => {\n          expect(FileArtifact.moveTemporaryFile).not.toHaveBeenCalled();\n        });\n      });\n    });\n  });\n\n  describe('static helper methods', () => {\n    describe('.moveTemporaryFile', () => {\n      describe('if temporary file does not exist', () => {\n        beforeEach(async () => {\n          await fs.remove(temporaryPath);\n          await fs.writeFile(destinationPath, 'Hello');\n        });\n\n        it('should log a warning', async () => {\n          const result = await FileArtifact.moveTemporaryFile(logger, temporaryPath, destinationPath);\n\n          expect(result).toBe(false);\n          expect(await fs.readFile(destinationPath, 'utf8')).toBe('Hello');\n          expect(logger.warn).toHaveBeenCalledWith({ event: 'MOVE_FILE_MISSING' }, expect.any(String));\n        });\n      });\n\n      describe('if temporary file exists', () => {\n        beforeEach(async () => {\n          await fs.ensureFile(temporaryPath);\n        });\n\n        describe('and the destination file does not exist', () => {\n          beforeEach(async () => {\n            await fs.remove(destinationPath);\n          });\n\n          it('should move file to the specified location and log a message', async () => {\n            const result = await FileArtifact.moveTemporaryFile(logger, temporaryPath, destinationPath);\n\n            expect(result).toBe(true);\n            expect(fs.existsSync(destinationPath)).toBe(true);\n            expect(fs.existsSync(temporaryPath)).toBe(false);\n\n            expect(logger.debug).toHaveBeenCalledWith({ event: 'MOVE_FILE' }, expect.any(String));\n          });\n        });\n\n        describe('and the destination file exists', () => {\n          beforeEach(async () => {\n            await fs.writeFile(destinationPath, 'My file');\n            await fs.writeFile(temporaryPath, ' and more to it');\n          });\n\n          it('should remove temporary file but refuse to append file', async () => {\n            const result = await FileArtifact.moveTemporaryFile(logger, temporaryPath, destinationPath);\n\n            expect(result).toBe(false);\n            expect(fs.existsSync(temporaryPath)).toBe(false);\n            expect(await fs.readFile(destinationPath, 'utf8')).toBe('My file');\n\n            expect(logger.warn).toHaveBeenCalledWith({ event: 'MOVE_FILE_EXISTS' }, expect.any(String));\n          });\n\n          it('should move temporary file via appending if canAppend = true', async () => {\n            const result = await FileArtifact.moveTemporaryFile(logger, temporaryPath, destinationPath, true);\n\n            expect(result).toBe(true);\n            expect(fs.existsSync(temporaryPath)).toBe(false);\n            expect(await fs.readFile(destinationPath, 'utf8')).toBe('My file and more to it');\n\n            expect(logger.debug).toHaveBeenCalledWith({ event: 'MOVE_FILE' }, expect.stringContaining('appending'));\n          });\n        });\n      });\n    });\n\n    describe('.writeFile', () => {\n      describe('if there is no temporary data', () => {\n        beforeEach(async () => {\n          await fs.writeFile(destinationPath, 'Hello');\n        });\n\n        it('should log a warning', async () => {\n          const result = await FileArtifact.writeFile(logger, undefined, destinationPath);\n\n          expect(result).toBe(false);\n          expect(await fs.readFile(destinationPath, 'utf8')).toBe('Hello');\n          expect(logger.warn).toHaveBeenCalledWith({ event: 'FILE_WRITE_EMPTY_DATA' }, expect.any(String));\n        });\n      });\n\n      describe('if there is a data', () => {\n        describe('if there is no destination file', () => {\n          beforeEach(async () => {\n            await fs.remove(destinationPath);\n          });\n\n          it('should log a debug message', async () => {\n            const result = await FileArtifact.writeFile(logger, temporaryData, destinationPath);\n\n            expect(result).toBe(true);\n            expect(logger.debug).toHaveBeenCalledWith({ event: 'FILE_WRITE_CREATE' }, expect.any(String));\n          });\n\n          it('should create the file', async () => {\n            const result = await FileArtifact.writeFile(logger, temporaryData, destinationPath);\n\n            expect(result).toBe(true);\n            expect(await fs.readFile(destinationPath, 'utf8')).toBe(temporaryData);\n          });\n        });\n\n        describe('if the destination file exists', () => {\n          const fileContent = 'Hello';\n\n          beforeEach(async () => {\n            await fs.writeFile(destinationPath, fileContent);\n          });\n\n          describe('usual mode', () => {\n            it('should refuse overwriting the file', async () => {\n              const result = await FileArtifact.writeFile(logger, temporaryData, destinationPath);\n\n              expect(result).toBe(false);\n              expect(logger.warn).toHaveBeenCalledWith({ event: 'FILE_WRITE_EXISTS' }, expect.any(String));\n            });\n          });\n\n          describe('append mode', () => {\n            it('should append to the file', async () => {\n              const result = await FileArtifact.writeFile(logger, temporaryData, destinationPath, true);\n\n              expect(result).toBe(true);\n              expect(await fs.readFile(destinationPath, 'utf8')).toBe(fileContent + temporaryData);\n              expect(logger.debug).toHaveBeenCalledWith({ event: 'FILE_WRITE' }, expect.any(String));\n            });\n          });\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/templates/artifact/__mocks__/ArtifactMock.js",
    "content": "// @ts-nocheck\nconst Artifact = require('../Artifact');\n\nclass ArtifactMock extends Artifact {\n  constructor(type) {\n    super({\n      start: jest.fn(),\n      stop: jest.fn(),\n      save: jest.fn(),\n      discard: jest.fn(),\n    });\n\n    this.type = type;\n\n    jest.spyOn(this, 'start');\n    jest.spyOn(this, 'stop');\n    jest.spyOn(this, 'save');\n    jest.spyOn(this, 'discard');\n  }\n}\n\nmodule.exports = ArtifactMock;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/ArtifactPlugin.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\n// @ts-nocheck\n\nconst _ = require('lodash');\n\nconst log = require('../../../utils/logger').child({ cat: 'artifacts-plugin,artifacts' });\n\n/***\n * Almost non-opinionated building block for any artifact type\n * You might derive from it if your workflow extremely differs from\n * the already existing artifact plugin templates.\n *\n * @abstract\n */\nclass ArtifactPlugin {\n  constructor({ api }) {\n    this.api = api;\n    this.context = { testSummary: null , suite: null };\n    this.enabled = api.userConfig.enabled;\n    this.keepOnlyFailedTestsArtifacts = api.userConfig.keepOnlyFailedTestsArtifacts;\n    this.priority = 16;\n    this._disableReason = '';\n    this._hasFailingTests = false;\n    this._finishedTests = false;\n  }\n\n  get name() {\n    return this.constructor.name;\n  }\n\n  disable(reason) {\n    if (!this.enabled) {\n      return;\n    }\n\n    this.enabled = false;\n    this._disableReason = reason;\n    this._logDisableWarning();\n  }\n\n  /**\n   * Hook that is called inside device.launchApp() before\n   * the current app on the current device is relaunched.\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Launch app event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Current bundleId\n   * @param {Object} event.launchArgs - Mutable key-value pairs of args before the launch\n   * @return {Promise<void>} - when done\n   */\n  async onBeforeLaunchApp(event) {\n    Object.assign(this.context, {\n      isAppReady: false,\n    });\n  }\n\n  /**\n   * Hook that is called inside device.launchApp() and\n   * provides a new pid for the relaunched app for the\n   * artifacts that are dependent on pid.\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Launch app event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Current bundleId\n   * @param {Object} event.launchArgs - key-value pairs of launch args\n   * @param {number} event.pid - Process id of the running app\n   * @return {Promise<void>} - when done\n   */\n  async onLaunchApp(event) {\n    Object.assign(this.context, {\n      bundleId: event.bundleId,\n      launchArgs: event.launchArgs,\n      pid: event.pid,\n   });\n  }\n\n  /**\n   * Hook that is called after app sends ready signal\n   * over the web socket.\n   *\n   * @protected\n   * @async\n   * @param {Object} event - App ready event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Current bundleId\n   * @param {number} event.pid - Process id of the running app\n   * @return {Promise<void>} - when done\n   */\n  async onAppReady(event) {\n    Object.assign(this.context, {\n      isAppReady: true,\n    });\n  }\n\n  /**\n   * Hook that is supposed to be called from device.boot()\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Device boot event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {boolean} event.coldBoot - true, if the device gets turned on from the shutdown state.\n   * @return {Promise<void>} - when done\n   */\n  async onBootDevice(event) {\n    Object.assign(this.context, {\n      deviceId: event.deviceId,\n    });\n  }\n\n  /**\n   * Hook that is supposed to be called before app is terminated\n   *\n   * @protected\n   * @async\n   * @param {Object} event - App termination event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Current bundleId\n   * @return {Promise<void>} - when done\n   */\n  async onBeforeTerminateApp(event) {}\n\n  /**\n   * Hook that is supposed to be called after app has been terminated\n   *\n   * @protected\n   * @async\n   * @param {Object} event - App termination event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Terminated bundleId\n   * @return {Promise<void>} - when done\n   */\n  async onTerminateApp(event) {\n    Object.assign(this.context, {\n      bundleId: '',\n      launchArgs: null,\n      pid: NaN,\n      isAppReady: undefined,\n    });\n  }\n\n  /**\n   * Hook that is supposed to be called before app is uninstalled\n   *\n   * @protected\n   * @async\n   * @param {Object} event - App uninstall event object\n   * @param {string} event.deviceId - Current deviceId\n   * @param {string} event.bundleId - Current bundleId\n   * @return {Promise<void>} - when done\n   */\n  async onBeforeUninstallApp(event) {}\n\n  /**\n   * Hook that is supposed to be called before device.shutdown() happens\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Device shutdown event object\n   * @param {string} event.deviceId - Current deviceId\n   * @return {Promise<void>} - when done\n   */\n  async onBeforeShutdownDevice(event) {}\n\n  /**\n   * Hook that is supposed to be called from device.shutdown()\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Device shutdown event object\n   * @param {string} event.deviceId - Current deviceId\n   * @return {Promise<void>} - when done\n   */\n  async onShutdownDevice(event) {\n    Object.assign(this.context, {\n      deviceId: '',\n      bundleId: '',\n      launchArgs: null,\n      pid: NaN,\n      isAppReady: undefined,\n    });\n  }\n\n  /**\n   * Hook that is supposed to be called when an artifact has been created indirectly,\n   * outside of lifecycle of the plugin.\n   *\n   * @protected\n   * @async\n   * @param {Object} event - Information about an indirectly created artifact\n   * @param {string} event.name - Target name for the artifact\n   * @param {Artifact} event.artifact - Artifact instance\n   * @return {Promise<void>} - when done\n   */\n  async onCreateExternalArtifact(event) {}\n\n  /**\n   * Hook that is called before a test begins\n   *\n   * @protected\n   * @async\n   * @param {TestSummary} testSummary - has name of currently running test\n   * @return {Promise<void>} - when done\n   */\n  async onTestStart(testSummary) {\n    this.context.testSummary = testSummary;\n  }\n\n  /**\n   * Hook that is called if a hook of a test fails\n   * e.g.: beforeAll, beforeEach, afterEach, afterAll\n   *\n   * @protected\n   * @async\n   * @param {string} failureDetails.hook\n   * @param {*} failureDetails.error\n   * @return {Promise<void>} - when done\n   */\n  async onHookFailure(failureDetails) {\n    this._hasFailingTests = true;\n  }\n\n  /**\n   * Hook that is called if a test function fails\n   *\n   * @protected\n   * @async\n   * @param {*} failureDetails.error\n   * @return {Promise<void>} - when done\n   */\n  async onTestFnFailure(failureDetails) {\n    this._hasFailingTests = true;\n  }\n\n  /***\n   * @protected\n   * @async\n   * @param {TestSummary} testSummary - has name and status of test that ran\n   * @return {Promise<void>} - when done\n   */\n  async onTestDone(testSummary) {\n    this.context.testSummary = testSummary;\n\n    if (testSummary.status === 'failed') {\n      this._hasFailingTests = true;\n    }\n  }\n\n  /**\n   * Hook that is called when test suite starts\n   *\n   * @protected\n   * @async\n   * @param {Suite} suite - has name of currently running test suite\n   * @return {Promise<void>} - when done\n   */\n  async onRunDescribeStart(suite) {\n    this.context.suite = suite;\n  }\n\n  /**\n   * Hook that is called when test suite finishes\n   *\n   * @protected\n   * @async\n   * @param {Suite} suite - has name of currently running test suite\n   * @return {Promise<void>} - when done\n   */\n  async onRunDescribeFinish(suite) {\n    this.context.suite = null;\n  }\n\n  /**\n   * Hook that is called when detox.cleanup() just begins\n   *\n   * @protected\n   * @async\n   * @return {Promise<void>} - when done\n   */\n  async onBeforeCleanup() {\n    this.context.testSummary = null;\n    this._finishedTests = true;\n    this._logDisableWarning();\n  }\n\n  /**\n   * Hook that is called on SIGINT and SIGTERM\n   *\n   * @protected\n   * @async\n   * @return {Promise<void>} - when done\n   */\n  async onTerminate() {\n    this.disable('it was terminated by SIGINT or SIGTERM');\n\n    this.onTerminate = _.noop;\n    this.onBootDevice = _.noop;\n    this.onBeforeShutdownDevice = _.noop;\n    this.onShutdownDevice = _.noop;\n    this.onBeforeTerminateApp = _.noop;\n    this.onTerminateApp = _.noop;\n    this.onBeforeLaunchApp = _.noop;\n    this.onLaunchApp = _.noop;\n    this.onTestStart = _.noop;\n    this.onHookFailure = _.noop;\n    this.onTestFnFailure = _.noop;\n    this.onTestDone = _.noop;\n    this.onRunDescribeStart = _.noop;\n    this.onRunDescribeFinish = _.noop;\n    this.onBeforeCleanup = _.noop;\n  }\n\n  _logDisableWarning() {\n    if (!this.enabled && this._disableReason) {\n      log.warn({ event: 'PLUGIN_DISABLED' }, `Artifact plugin ${this.constructor.name} was disabled because ${this._disableReason}`);\n    }\n  }\n\n  shouldKeepArtifactOfSession() {\n    if (!this.enabled) {\n      return false;\n    }\n\n    if (!this.keepOnlyFailedTestsArtifacts) {\n      return true;\n    }\n\n    if (this._hasFailingTests) {\n      return true;\n    }\n\n    if (this._finishedTests) {\n      return false;\n    }\n\n    return undefined;\n  }\n\n  shouldKeepArtifactOfTest(testSummary) {\n    if (!this.enabled) {\n      return false;\n    }\n\n    if (this.keepOnlyFailedTestsArtifacts && testSummary.status !== 'failed') {\n      return false;\n    }\n\n    return true;\n  }\n}\n\nmodule.exports = ArtifactPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/ArtifactPlugin.test.js",
    "content": "jest.mock('../../../utils/logger');\nconst logger = jest.requireMock('../../../utils/logger');\nconst testSummaries = require('../../__mocks__/testSummaries.mock');\nconst FileArtifact = require('../artifact/FileArtifact');\n\nconst ArtifactPlugin = require('./ArtifactPlugin');\nconst testSuite = require('./__mocks__/testSuite.mock');\n\nclass TestArtifactPlugin extends ArtifactPlugin {}\n\ndescribe('ArtifactPlugin', () => {\n  let api;\n  let plugin;\n\n  beforeEach(() => {\n    api = {\n      userConfig: {\n        enabled: false,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    };\n\n    plugin = new TestArtifactPlugin({ api });\n  });\n\n  it('should have name', () =>\n    expect(plugin.name).toBe(TestArtifactPlugin.name));\n\n  it('should be disabled by default', () =>\n    expect(plugin.enabled).toBe(false));\n\n  describe('when enabled', () => {\n    beforeEach(() => {\n      plugin.enabled = true;\n    });\n\n    describe('when it is disabled with no reason', () => {\n      beforeEach(() => plugin.disable());\n\n      it('should gain state .enabled = false', () =>\n        expect(plugin.enabled).toBe(false));\n\n      it('should not write warnings to log', () =>\n        expect(logger.warn.mock.calls.length).toBe(0));\n    });\n\n    describe('if it is disabled with a reason', () => {\n      beforeEach(() => plugin.disable('a reason why it is disabled'));\n\n      it('should gain state .enabled = false', () =>\n        expect(plugin.enabled).toBe(false));\n\n      it('should log warning to log with that reason', () => {\n        expect(logger.warn.mock.calls).toHaveLength(1);\n      });\n    });\n  });\n\n  describe('when already disabled', () => {\n    beforeEach(() => {\n      plugin.enabled = false;\n    });\n\n    describe('when .disable() called with a reason', () => {\n      beforeEach(() => {\n        plugin.disable('a reason why it is disabled');\n      });\n\n      it('should not write any warnings to log', () => {\n        expect(logger.warn.mock.calls.length).toBe(0);\n      });\n    });\n  });\n\n  describe('lifecycle hooks', () => {\n    beforeEach(() => {\n      plugin.context = {\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty'\n      };\n    });\n\n    it('should set isAppReady = false on .onBeforeLaunchApp', async () => {\n      await expect(plugin.onBeforeLaunchApp({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n        launchArgs: {\n          detoxSessionId: 'test',\n        },\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty',\n        isAppReady: false,\n      });\n    });\n\n    it('should update context .onLaunchApp', async () => {\n      await expect(plugin.onLaunchApp({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n        launchArgs: {\n          detoxSessionId: 'test',\n        },\n        pid: 2018\n      }));\n\n      expect(plugin.context).toEqual({\n        bundleId: 'testBundleId',\n        deviceId: 'someOriginalDeviceId',\n        launchArgs: {\n          detoxSessionId: 'test',\n        },\n        pid: 2018,\n        shouldNotBeDeletedFromContext: 'extraProperty',\n      });\n    });\n\n    it('should set isAppReady = true on .onAppReady', async () => {\n      await expect(plugin.onAppReady({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n        pid: 2020\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty',\n        isAppReady: true,\n      });\n    });\n\n    it('should not update context on .onBeforeUninstallApp', async () => {\n      await expect(plugin.onBeforeUninstallApp({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty'\n      });\n    });\n\n    it('should not update context on .onBeforeTerminateApp', async () => {\n      await expect(plugin.onBeforeTerminateApp({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty'\n      });\n    });\n\n    it('should update context on .onTerminateApp', async () => {\n      await expect(plugin.onTerminateApp({\n        deviceId: 'testDeviceId',\n        bundleId: 'testBundleId',\n      }));\n\n      expect(plugin.context).toEqual({\n        bundleId: '',\n        launchArgs: null,\n        pid: NaN,\n        isAppReady: undefined,\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty',\n      });\n    });\n\n    it('should update context on .onBootDevice', async () => {\n      await expect(plugin.onBootDevice({\n        deviceId: 'testDeviceId',\n        coldBoot: true\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'testDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty',\n      });\n    });\n\n    it('should not update context on .onBeforeShutdownDevice', async () => {\n      await expect(plugin.onBeforeShutdownDevice({\n        deviceId: 'testDeviceId'\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: 'someOriginalDeviceId',\n        shouldNotBeDeletedFromContext: 'extraProperty',\n      });\n    });\n\n    it('should have .onShutdownDevice', async () => {\n      await expect(plugin.onShutdownDevice({\n        deviceId: 'testDeviceId'\n      }));\n\n      expect(plugin.context).toEqual({\n        deviceId: '',\n        bundleId: '',\n        launchArgs: null,\n        pid: NaN,\n        isAppReady: undefined,\n        shouldNotBeDeletedFromContext: 'extraProperty',\n      });\n    });\n\n    it('should have .onCreateExternalArtifact', async () => {\n      await expect(plugin.onCreateExternalArtifact({\n        name: 'The custom artifact',\n        artifact: new FileArtifact({\n          temporaryPath: '/tmp/path/to/artifact.file'\n        }),\n      })).resolves.toBe(void 0);\n    });\n\n    it('should have .onTestStart, which updates context.testSummary if called', async () => {\n      const testSummary = testSummaries.running();\n      await plugin.onTestStart(testSummary);\n      expect(plugin.context.testSummary).toBe(testSummary);\n    });\n\n    it('should have .onHookFailure(), which remembers that there were failing tests ', async () => {\n      plugin.enabled = true;\n      plugin.keepOnlyFailedTestsArtifacts = true;\n\n      expect(plugin.shouldKeepArtifactOfSession()).toBe(undefined);\n      await plugin.onHookFailure({ error: new Error, hook: 'beforeEach' });\n      expect(plugin.shouldKeepArtifactOfSession()).toBe(true);\n    });\n\n    it('should have .onTestFnFailure(), which remembers that there were failing tests ', async () => {\n      plugin.enabled = true;\n      plugin.keepOnlyFailedTestsArtifacts = true;\n\n      expect(plugin.shouldKeepArtifactOfSession()).toBe(undefined);\n      await plugin.onTestFnFailure({ error: new Error });\n      expect(plugin.shouldKeepArtifactOfSession()).toBe(true);\n    });\n\n    it('should have .onTestDone, which updates context.testSummary if called', async () => {\n      const testSummary = testSummaries.failed();\n      await plugin.onTestDone(testSummary);\n      expect(plugin.context.testSummary).toBe(testSummary);\n    });\n\n    it('should have .onRunDescribeStart, which updates context.suite if called', async () => {\n      const suite = testSuite.mock();\n      await plugin.onRunDescribeStart(suite);\n      expect(plugin.context.suite).toBe(suite);\n    });\n\n    it('should have .onRunDescribeFinish, which updates context.suite if called', async () => {\n      plugin.context.suite = testSuite.mock();\n      await plugin.onRunDescribeFinish();\n      expect(plugin.context.suite).toBe(null);\n    });\n\n    it('should have .onBeforeCleanup, which resets context.testSummary if called', async () => {\n      plugin.context.testSummary = {};\n      await plugin.onBeforeCleanup();\n      expect(plugin.context.testSummary).toBe(null);\n    });\n\n    describe('.onTerminate', () => {\n      it('should disable plugin with a reason', async () => {\n        plugin.disable = jest.fn();\n        await expect(plugin.onTerminate()).resolves.toBe(void 0);\n        expect(plugin.disable.mock.calls).toEqual([['it was terminated by SIGINT or SIGTERM']]);\n      });\n\n      it('should replace the other lifecycle hooks with the same noop function', async () => {\n        await plugin.onTerminate();\n\n        expect(plugin.onBootDevice).toBe(plugin.onTerminate);\n        expect(plugin.onBeforeShutdownDevice).toBe(plugin.onTerminate);\n        expect(plugin.onShutdownDevice).toBe(plugin.onTerminate);\n        expect(plugin.onBeforeLaunchApp).toBe(plugin.onTerminate);\n        expect(plugin.onLaunchApp).toBe(plugin.onTerminate);\n        expect(plugin.onBeforeTerminateApp).toBe(plugin.onTerminate);\n        expect(plugin.onTerminateApp).toBe(plugin.onTerminate);\n        expect(plugin.onTestStart).toBe(plugin.onTerminate);\n        expect(plugin.onTestDone).toBe(plugin.onTerminate);\n        expect(plugin.onRunDescribeStart).toBe(plugin.onTerminate);\n        expect(plugin.onRunDescribeFinish).toBe(plugin.onTerminate);\n        expect(plugin.onBeforeCleanup).toBe(plugin.onTerminate);\n      });\n\n      it('should not work after the first call', async () => {\n        const realOnTerminate = plugin.onTerminate;\n        await plugin.onTerminate();\n        expect(plugin.onTerminate).not.toBe(realOnTerminate);\n\n        plugin.disable = jest.fn();\n        await plugin.onTerminate();\n        expect(plugin.disable).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('.shouldKeepArtifactOfTest', () => {\n    it('should by default have a setting to keep all', () => {\n      expect(plugin.keepOnlyFailedTestsArtifacts).toBe(false);\n    });\n\n    describe('if should not keep specifically failed test artifacts', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = false;\n        plugin.enabled = true;\n      });\n\n      it('should return false if it is disabled', () => {\n        plugin.enabled = false;\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.running())).toBe(false);\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.passed())).toBe(false);\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.failed())).toBe(false);\n      });\n\n      it('should return true for testSummary.status === running', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.running())).toBe(true));\n\n      it('should return true for testSummary.status === passed', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.passed())).toBe(true));\n\n      it('should return true for testSummary.status === failed', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.failed())).toBe(true));\n    });\n\n    describe('if should keep only failed test artifacts', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = true;\n        plugin.enabled = true;\n      });\n\n      it('should return false if it is disabled', () => {\n        plugin.enabled = false;\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.running())).toBe(false);\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.passed())).toBe(false);\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.failed())).toBe(false);\n      });\n\n      it('should return false for testSummary.status === running', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.running())).toBe(false));\n\n      it('should return false for testSummary.status === passed', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.passed())).toBe(false));\n\n      it('should return true for testSummary.status === failed', () =>\n        expect(plugin.shouldKeepArtifactOfTest(testSummaries.failed())).toBe(true));\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/StartupAndTestRecorderPlugin.js",
    "content": "// @ts-nocheck\nconst WholeTestRecorderPlugin = require('./WholeTestRecorderPlugin');\n\n/***\n * @abstract\n */\nclass StartupAndTestRecorderPlugin extends WholeTestRecorderPlugin {\n  constructor({ api }) {\n    super({ api });\n\n    this.startupRecording = null;\n    this._isInStartupPhase = true;\n    this._isRecordingStartup = false;\n  }\n\n  /***\n   * @protected\n   */\n  get currentRecording() {\n    return this._isRecordingStartup\n      ? this.startupRecording\n      : this.testRecording;\n  }\n\n  /***\n   * @protected\n   */\n  async onReadyToRecord() {\n    if (this.enabled && this._isInStartupPhase && !this.startupRecording) {\n      const recording = this.createStartupRecording();\n\n      this.startupRecording = recording;\n      this.api.trackArtifact(recording);\n      this._isRecordingStartup = true;\n    }\n  }\n\n  async onTestStart(testSummary) {\n    this._isInStartupPhase = false;\n\n    if (this._isRecordingStartup) {\n      await this.startupRecording.stop();\n      this._isRecordingStartup = false;\n    }\n\n    await super.onTestStart(testSummary);\n  }\n\n  async onTestDone(testSummary) {\n    await super.onTestDone(testSummary);\n\n    if (this.startupRecording) {\n      this._tryToFinalizeStartupRecording();\n    }\n  }\n\n  async onBeforeCleanup() {\n    await super.onBeforeCleanup();\n\n    if (this.startupRecording) {\n      this._tryToFinalizeStartupRecording();\n    }\n\n    await super.onBeforeCleanup();\n  }\n\n  /***\n   * @abstract\n   * @protected\n   */\n  createStartupRecording() {}\n\n  /***\n   * @abstract\n   * @protected\n   */\n  async preparePathForStartupArtifact() {}\n\n  _tryToFinalizeStartupRecording() {\n    const shouldKeep = this.shouldKeepArtifactOfSession();\n\n    if (shouldKeep === true) {\n      this._startSavingStartupRecording(this.startupRecording);\n      this.startupRecording = null;\n    }\n\n    if (shouldKeep === false) {\n      this._startDiscardingStartupRecording(this.startupRecording);\n      this.startupRecording = null;\n    }\n  }\n\n  _startSavingStartupRecording(startupRecording) {\n    this.api.requestIdleCallback(async () => {\n      const artifactPath = await this.preparePathForStartupArtifact();\n      await startupRecording.save(artifactPath);\n      this.api.untrackArtifact(startupRecording);\n    });\n  }\n\n  _startDiscardingStartupRecording(startupRecording) {\n    this.api.requestIdleCallback(async () => {\n      await startupRecording.discard();\n      this.api.untrackArtifact(startupRecording);\n    });\n  }\n}\n\nmodule.exports = StartupAndTestRecorderPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/StartupAndTestRecorderPlugin.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../utils/logger.js');\nconst testSummaries = require('../../__mocks__/testSummaries.mock');\nconst ArtifactMock = require('../artifact/__mocks__/ArtifactMock');\n\nconst StartupAndTestRecorderPlugin = require('./StartupAndTestRecorderPlugin');\nconst ArtifactsApi = require('./__mocks__/ArtifactsApi.mock');\n\ndescribe('StartupAndTestRecorderPlugin', () => {\n  let api;\n  let plugin;\n\n  beforeEach(() => {\n    api = new ArtifactsApi({\n      config: {\n        enabled: false,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    });\n    plugin = new FakeStartupAndTestRecorderPlugin({ api });\n  });\n\n  describe('when disabled', () => {\n    beforeEach(() => {\n      plugin.disable();\n    });\n\n    describe('onReadyToRecord', () => {\n      beforeEach(async () => {\n        await plugin.onReadyToRecord();\n      });\n\n      it('should end correctly, but do nothing', expectThatNothingActuallyHappens);\n    });\n\n    describe('onTestStart', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n      });\n\n      it('should end correctly, but do nothing', expectThatNothingActuallyHappens);\n    });\n\n    describe('onTestDone', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.failed());\n      });\n\n      it('should end correctly, but do nothing', expectThatNothingActuallyHappens);\n    });\n\n    describe('onBeforeCleanup', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.failed());\n        await plugin.onBeforeCleanup();\n      });\n\n      it('should end correctly, but do nothing', expectThatNothingActuallyHappens);\n    });\n\n    async function expectThatNothingActuallyHappens() {\n      expect(plugin.createStartupRecording).not.toHaveBeenCalled();\n      expect(plugin.createTestRecording).not.toHaveBeenCalled();\n      expect(plugin.startupRecording).toBe(null);\n      expect(plugin.testRecording).toBe(null);\n      expect(plugin.currentRecording).toBe(null);\n    }\n  });\n\n  describe('app launch in start-up phase', () => {\n    beforeEach(async () => {\n      await plugin.onReadyToRecord();\n    });\n\n    it('should create start-up recording', () => {\n      expect(plugin.createStartupRecording).toHaveBeenCalled();\n    });\n\n    it('should set it to protected .startupRecording property', () => {\n      expect(plugin.startupRecording).toBe(plugin.createdArtifacts[0]);\n    });\n\n    it('should set it to protected .currentRecording property', () => {\n      expect(plugin.currentRecording).toBe(plugin.startupRecording);\n    });\n\n    it('should put the start-up recording under the tracking system', () => {\n      expect(api.trackArtifact).toHaveBeenCalledWith(plugin.startupRecording);\n    });\n  });\n\n  describe('onTestStart', () => {\n    describe('if app was launched before', () => {\n      beforeEach(async () => {\n        await plugin.onReadyToRecord();\n        await plugin.onTestStart(testSummaries.running());\n      });\n\n      it('should stop start-up recording', () => {\n        expect(plugin.startupRecording.stop).toHaveBeenCalled();\n      });\n\n      it('should change protected .current property value', () => {\n        expect(plugin.currentRecording).toBe(plugin.createdArtifacts[1]);\n      });\n    });\n\n    describe('', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n      });\n\n      it('should create test recording', () => {\n        expect(plugin.createTestRecording).toHaveBeenCalled();\n      });\n\n      it('should set to protected .testRecording property', () => {\n        expect(plugin.testRecording).toBe(plugin.createdArtifacts[0]);\n      });\n\n      it('should set to protected .currentRecording property', () => {\n        expect(plugin.currentRecording).toBe(plugin.testRecording);\n      });\n\n      it('should start test recording', () => {\n        expect(plugin.testRecording.start).toHaveBeenCalled();\n      });\n\n      it('should put the test recording under the tracking system', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.testRecording);\n      });\n    });\n  });\n\n  describe('onTestDone', () => {\n    describe('when plugin is keeping only artifacts from failed tests', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = true;\n      });\n\n      describe('and current test passed well', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n          await api.emulateRunningAllIdleCallbacks();\n        });\n\n        it('should not clean start-up recording property', () => {\n          expect(plugin.startupRecording).toBeTruthy();\n        });\n\n        it('should not interact with start-up property anyhow', () => {\n          expect(plugin.startupRecording.save).not.toHaveBeenCalled();\n          expect(plugin.startupRecording.discard).not.toHaveBeenCalled();\n        });\n      });\n\n      describe('and current test failed', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.failed());\n        });\n\n        itShouldScheduleSavingAndUntrackingOfBothArtifacts();\n      });\n    });\n\n    describe('when plugin is keeping all artifacts', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = false;\n      });\n\n      describe('and test finished anyhow', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n        });\n\n        itShouldScheduleSavingAndUntrackingOfBothArtifacts();\n      });\n    });\n  });\n\n  describe('onBeforeCleanup', () => {\n    describe('when the plugin is configured to keep all artifacts', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = false;\n      });\n\n      describe('when there were no calls to .onTestStart and .onTestDone', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onBeforeCleanup();\n        });\n\n        it('should schedule saving of the start-up recording', () => {\n          expect(api.requestIdleCallback).toHaveBeenCalledTimes(1);\n          expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n        });\n\n        it('should reset .startupRecording property to null', async () => {\n          expect(plugin.startupRecording).toBe(null);\n        });\n\n        it('should eventually save the start-up recording', async () => {\n          const [saveStartupRecordingRequest] = api.requestIdleCallback.mock.calls[0];\n          const [startupRecording] = plugin.createdArtifacts;\n\n          expect(startupRecording.save).not.toHaveBeenCalled();\n          await saveStartupRecordingRequest();\n          expect(startupRecording.save).toHaveBeenCalledWith('/tmp/fakeStartupArtifact');\n        });\n\n        it('should eventually untrack the start-up recording', async () => {\n          const [saveStartupRecordingRequest] = api.requestIdleCallback.mock.calls[0];\n          const [startupRecording] = plugin.createdArtifacts;\n\n          expect(api.untrackArtifact).not.toHaveBeenCalledWith(startupRecording);\n          await saveStartupRecordingRequest();\n          expect(api.untrackArtifact).toHaveBeenCalledWith(startupRecording);\n        });\n      });\n\n      describe('when there were already calls to .onTestDone', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n          api.requestIdleCallback.mockClear();\n        });\n\n        it('should already have reset .startupRecording to null', () => {\n          expect(plugin.startupRecording).toBe(null);\n        });\n\n        it('should not schedule anything extra', async () => {\n          expect(api.requestIdleCallback).not.toHaveBeenCalled();\n        });\n      });\n    });\n\n    describe('when the plugin is configured to keep only failing artifacts', () => {\n      beforeEach(() => {\n        plugin.keepOnlyFailedTestsArtifacts = true;\n      });\n\n      describe('when there were no calls to .onTestStart and .onTestDone', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n\n          api.requestIdleCallback.mockClear();\n          await plugin.onBeforeCleanup();\n        });\n\n        itShouldScheduleDiscardingAndUntrackingOfStartupArtifact();\n      });\n\n      describe('when all tests were successful', () => {\n        beforeEach(async () => {\n          await plugin.onReadyToRecord();\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n\n          api.requestIdleCallback.mockClear();\n          await plugin.onBeforeCleanup();\n        });\n\n        itShouldScheduleDiscardingAndUntrackingOfStartupArtifact();\n      });\n    });\n  });\n\n  function itShouldScheduleSavingAndUntrackingOfBothArtifacts() {\n    it('should reset .startupRecording property', () => {\n      expect(plugin.startupRecording).toBe(null);\n    });\n\n    it('should schedule two operations', () => {\n      expect(api.requestIdleCallback).toHaveBeenCalledTimes(2);\n      expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n      expect(api.requestIdleCallback.mock.calls[1]).toEqual([expect.any(Function)]);\n    });\n\n    it('should schedule saving of the test recording', async () => {\n      const [,testRecording] = plugin.createdArtifacts;\n      const [saveTestRecordingRequest] = api.requestIdleCallback.mock.calls[0];\n      expect(testRecording.save).not.toHaveBeenCalled();\n\n      await saveTestRecordingRequest();\n      expect(testRecording.save).toHaveBeenCalledWith('/tmp/test/fakeArtifact');\n    });\n\n    it('should schedule saving of the start-up recording', async () => {\n      const [startupRecording] = plugin.createdArtifacts;\n      const [saveStartupRecordingRequest] = api.requestIdleCallback.mock.calls[1];\n\n      expect(startupRecording.save).not.toHaveBeenCalled();\n      await saveStartupRecordingRequest();\n      expect(startupRecording.save).toHaveBeenCalledWith('/tmp/fakeStartupArtifact');\n    });\n\n    it('should untrack the start-up recording after it is saved', async () => {\n      const [startupRecording] = plugin.createdArtifacts;\n      const [saveStartupRecordingRequest] = api.requestIdleCallback.mock.calls[1];\n\n      expect(api.untrackArtifact).not.toHaveBeenCalledWith(startupRecording);\n      await saveStartupRecordingRequest();\n      expect(api.untrackArtifact).toHaveBeenCalledWith(startupRecording);\n    });\n  }\n\n  function itShouldScheduleDiscardingAndUntrackingOfStartupArtifact() {\n    it('should schedule discarding of the start-up recording', () => {\n      expect(api.requestIdleCallback).toHaveBeenCalledTimes(1);\n      expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n    });\n\n    it('should reset .startupRecording property to null', async () => {\n      expect(plugin.startupRecording).toBe(null);\n    });\n\n    it('should eventually discard the start-up recording', async () => {\n      const [discardRequest] = api.requestIdleCallback.mock.calls[0];\n      const [startupRecording] = plugin.createdArtifacts;\n\n      expect(startupRecording.discard).not.toHaveBeenCalled();\n      await discardRequest();\n      expect(startupRecording.discard).toHaveBeenCalled();\n    });\n\n    it('should eventually untrack the start-up recording', async () => {\n      const [discardRequest] = api.requestIdleCallback.mock.calls[0];\n      const [startupRecording] = plugin.createdArtifacts;\n\n      expect(api.untrackArtifact).not.toHaveBeenCalledWith(startupRecording);\n      await discardRequest();\n      expect(api.untrackArtifact).toHaveBeenCalledWith(startupRecording);\n    });\n  }\n});\n\nclass FakeStartupAndTestRecorderPlugin extends StartupAndTestRecorderPlugin {\n  constructor(...args) {\n    super(...args);\n\n    this.enabled = true;\n    this.createStartupRecording = jest.fn(this.createStartupRecording.bind(this));\n    this.createTestRecording = jest.fn(this.createTestRecording.bind(this));\n    this.createdArtifacts = [];\n  }\n\n  preparePathForStartupArtifact() {\n    super.preparePathForStartupArtifact();\n    return '/tmp/fakeStartupArtifact';\n  }\n\n  preparePathForTestArtifact(testSummary) {\n    super.preparePathForTestArtifact(testSummary);\n    return `/tmp/${testSummary.title}/fakeArtifact`;\n  }\n\n  createStartupRecording() {\n    super.createStartupRecording();\n    return this._createArtifactMock('startup');\n  }\n\n  createTestRecording() {\n    super.createTestRecording();\n    return this._createArtifactMock('test');\n  }\n\n  _createArtifactMock(type) {\n    const artifact = new ArtifactMock(type);\n    this.createdArtifacts.push(artifact);\n    return artifact;\n  }\n}\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/TwoSnapshotsPerTestPlugin.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\n// @ts-nocheck\nconst DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');\n\nconst ArtifactPlugin = require('./ArtifactPlugin');\n\n/***\n * @abstract\n */\nclass TwoSnapshotsPerTestPlugin extends ArtifactPlugin {\n  constructor({ api }) {\n    super({ api });\n\n    this.shouldTakeAutomaticSnapshots = this.api.userConfig.shouldTakeAutomaticSnapshots;\n    this.keepOnlyFailedTestsArtifacts = this.api.userConfig.keepOnlyFailedTestsArtifacts;\n\n    this.takeAutomaticSnapshots = this.api.userConfig.takeWhen\n      ? {\n        testStart: false,\n        testFailure: true,\n        testDone: false,\n        ...this.api.userConfig.takeWhen\n      }\n      : {\n        testStart: true,\n        testFailure: true,\n        testDone: true,\n      };\n\n    this.snapshots = {\n      fromTest: {},\n      fromSession: {},\n    };\n  }\n\n  async onTestStart(testSummary) {\n    this.context.testSummary = null;\n    this._flushSessionSnapshots();\n\n    await super.onTestStart(testSummary);\n    await this._takeAutomaticSnapshot('testStart');\n  }\n\n  async onHookFailure(event) {\n    await super.onHookFailure(event);\n\n    const shouldTake = this.takeAutomaticSnapshots.testFailure;\n    await this._takeAutomaticSnapshot(`${event.hook}Failure`, shouldTake);\n  }\n\n  async onTestFnFailure(event) {\n    await super.onTestFnFailure(event);\n\n    const shouldTake = this.takeAutomaticSnapshots.testFailure;\n    await this._takeAutomaticSnapshot('testFnFailure', shouldTake);\n  }\n\n  async onTestDone(testSummary) {\n    await super.onTestDone(testSummary);\n\n    if (this.shouldKeepArtifactOfTest(testSummary)) {\n      await this._takeAutomaticSnapshot('testDone');\n      this._startSavingSnapshots('fromTest');\n    } else {\n      this._startDiscardingSnapshots('fromTest');\n    }\n\n    this.context.testSummary = null;\n    this._flushSessionSnapshots();\n  }\n\n  async onBeforeCleanup() {\n    await super.onBeforeCleanup();\n    this._flushSessionSnapshots();\n  }\n\n  async onCreateExternalArtifact(e) {\n    if (!e.artifact) {\n      throw new DetoxRuntimeError('Internal error: expected Artifact instance in the event');\n    }\n\n    this._registerSnapshot(e.name, e.artifact);\n  }\n\n  /***\n   * @protected\n   * @abstract\n   */\n  async preparePathForSnapshot(testSummary, snapshotName) {}\n\n  /***\n   * Creates a handle for a test artifact (video recording, log, etc.)\n   *\n   * @abstract\n   * @protected\n   * @return {Artifact} - an object with synchronous .discard() and .save(path) methods\n   */\n  createTestArtifact() {}\n\n  async _takeAutomaticSnapshot(name, force) {\n    if (this.enabled && this.shouldTakeAutomaticSnapshots) {\n      if (this.takeAutomaticSnapshots[name] || force) {\n        await this._takeSnapshot(name);\n      }\n    }\n  }\n\n  async _takeSnapshot(name) {\n    const snapshot = this.createTestArtifact();\n    await snapshot.start();\n    await snapshot.stop();\n\n    this._registerSnapshot(name, snapshot);\n  }\n\n  _registerSnapshot(name, snapshot) {\n    const snapshots = this.context.testSummary\n      ? this.snapshots.fromTest\n      : this.snapshots.fromSession;\n\n    snapshots[name] = snapshot;\n    this.api.trackArtifact(snapshot);\n  }\n\n  _startSavingSnapshots(where) {\n    const { testSummary } = this.context;\n    const snapshots = this.snapshots[where];\n\n    for (const [name, snapshot] of Object.entries(snapshots)) {\n      delete this.snapshots[name];\n\n      this.api.requestIdleCallback(async () => {\n        const snapshotArtifactPath = await this.preparePathForSnapshot(testSummary, name);\n        await snapshot.save(snapshotArtifactPath);\n        this.api.untrackArtifact(snapshot);\n      });\n    }\n  }\n\n  _startDiscardingSnapshots(where) {\n    const snapshots = this.snapshots[where];\n\n    for (const [name, snapshot] of Object.entries(snapshots)) {\n      delete this.snapshots[name];\n\n      this.api.requestIdleCallback(async () => {\n        await snapshot.discard();\n        this.api.untrackArtifact(snapshot);\n      });\n    }\n  }\n\n  _flushSessionSnapshots() {\n    if (this.shouldKeepArtifactOfSession() === true) {\n      this._startSavingSnapshots('fromSession');\n    }\n\n    if (this.shouldKeepArtifactOfSession() === false) {\n      this._startDiscardingSnapshots('fromSession');\n    }\n  }\n}\n\nmodule.exports = TwoSnapshotsPerTestPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/TwoSnapshotsPerTestPlugin.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../utils/logger.js');\nconst testSummaries = require('../../__mocks__/testSummaries.mock');\nconst ArtifactMock = require('../artifact/__mocks__/ArtifactMock');\n\nconst TwoSnapshotsPerTestPlugin = require('./TwoSnapshotsPerTestPlugin');\nconst ArtifactsApi = require('./__mocks__/ArtifactsApi.mock');\n\ndescribe('TwoSnapshotsPerTestPlugin', () => {\n  let api;\n  let plugin;\n\n  beforeEach(() => {\n    api = new ArtifactsApi({\n      config: {\n        enabled: true,\n        shouldTakeAutomaticSnapshots: true,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    });\n\n    plugin = new FakeTwoSnapshotsPerTestPlugin({ api });\n  });\n\n  describe('when disabled', () => {\n    beforeEach(() => plugin.disable());\n\n    describe('onTestStart', () => {\n      beforeEach(async () => plugin.onTestStart(testSummaries.running()));\n\n      it('should not create artifact onTestStart', async () =>\n        expect(plugin.createTestArtifact).not.toHaveBeenCalled());\n    });\n\n    describe('when configured to keep artifacts', function() {\n      beforeEach(() => plugin.configureToKeepArtifacts(true));\n\n      describe('onTestDone', () => {\n        beforeEach(async () => plugin.onTestDone(testSummaries.passed()));\n\n        it('should not do create artifacts', async () =>\n          expect(plugin.createTestArtifact).not.toHaveBeenCalled());\n\n        it('should not do request idle callbacks', async () =>\n          expect(api.requestIdleCallback).not.toHaveBeenCalled());\n      });\n    });\n\n    describe('when configured to keep artifacts', function() {\n      beforeEach(() => plugin.configureToKeepArtifacts(false));\n\n      describe('onTestDone', () => {\n        beforeEach(async () => plugin.onTestDone(testSummaries.passed()));\n\n        it('should not do create artifacts', async () =>\n          expect(plugin.createTestArtifact).not.toHaveBeenCalled());\n\n        it('should not do request idle callbacks', async () =>\n          expect(api.requestIdleCallback).not.toHaveBeenCalled());\n      });\n    });\n  });\n\n  describe('when takeWhen.testStart is false', () => {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testStart: false }));\n\n    describe('when onTestStart called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n      });\n\n      it('should not create any tests artifacts', () => {\n        expect(plugin.createTestArtifact).not.toHaveBeenCalled();\n        expect(plugin.snapshots.fromTest['testStart']).toBe(undefined);\n      });\n    });\n  });\n\n  describe('when takeWhen.testStart is true', () => {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testStart: true }));\n\n    describe('when onTestStart called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n      });\n\n      it('should create test artifact', () => {\n        expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n      });\n\n      it('should start and stop recording in the artifact', () => {\n        expect(plugin.snapshots.fromTest['testStart'].start).toHaveBeenCalledTimes(1);\n        expect(plugin.snapshots.fromTest['testStart'].stop).toHaveBeenCalledTimes(1);\n      });\n\n      it('should put the artifact under tracking', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testStart']);\n      });\n    });\n  });\n\n  describe('when takeWhen.testDone is false', () => {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testDone: false }));\n\n    describe('when onTestStart and onTestEnd called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.passed());\n      });\n\n      it('should not create any test artifacts', () => {\n        expect(plugin.createTestArtifact).not.toHaveBeenCalled();\n        expect(plugin.snapshots.fromTest['testDone']).toBe(undefined);\n      });\n    });\n\n    describe('and takeWhen.testStart is true', () => {\n      beforeEach(() => plugin.configureAutomaticSnapshots({ testStart: true }));\n\n      describe('when onTestStart and onTestEnd called', function() {\n        it('should save a test artifact from testStart', async () => {\n          await plugin.onTestStart(testSummaries.running());\n          expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n\n          const startArtifact = plugin.snapshots.fromTest['testStart'];\n          expect(startArtifact.save).not.toHaveBeenCalled();\n\n          await plugin.onTestDone(testSummaries.passed());\n          await api.emulateRunningAllIdleCallbacks();\n\n          expect(startArtifact.save).toHaveBeenCalled();\n        });\n      });\n    });\n  });\n\n  describe('when takeWhen.testDone is true', () => {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testDone: true }));\n\n    describe('when onTestStart and onTestDone called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.passed());\n      });\n\n      it('should create 1 test artifact', () => {\n        expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n      });\n\n      it('should start and stop recording in the \"testDone\" artifact', () => {\n        expect(plugin.snapshots.fromTest['testDone'].start).toHaveBeenCalledTimes(1);\n        expect(plugin.snapshots.fromTest['testDone'].stop).toHaveBeenCalledTimes(1);\n      });\n\n      it('should put the \"testDone\" artifact under tracking', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testDone']);\n      });\n\n      it('should eventually save the \"testDone\" artifact', async () => {\n        await api.emulateRunningAllIdleCallbacks();\n        expect(plugin.snapshots.fromTest['testDone'].save).toHaveBeenCalledTimes(1);\n      });\n    });\n  });\n\n  describe('when takeWhen.testFailure is false', () =>     {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testFailure: false }));\n    beforeEach(() => plugin.onTestStart(testSummaries.running()));\n\n    describe('when onHookFailure called', function() {\n      beforeEach(async () => {\n        await plugin.onHookFailure({ hook: 'beforeEach', error: new Error() });\n      });\n\n      it('should not create any tests artifacts', () => {\n        expect(plugin.createTestArtifact).not.toHaveBeenCalled();\n        expect(plugin.snapshots.fromTest['beforeEachFailure']).toBe(undefined);\n      });\n    });\n\n    describe('when onTestFnFailure called', function() {\n      beforeEach(async () => {\n        await plugin.onTestFnFailure({ error: new Error() });\n      });\n\n      it('should not create any tests artifacts', () => {\n        expect(plugin.createTestArtifact).not.toHaveBeenCalled();\n        expect(plugin.snapshots.fromTest['testFailure']).toBe(undefined);\n      });\n    });\n  });\n\n  describe('when takeWhen.testFailure is true', () => {\n    beforeEach(() => plugin.configureAutomaticSnapshots({ testFailure: true }));\n\n    describe('when onHookFailure (beforeAll) called', function() {\n      beforeEach(async () => {\n        await plugin.onHookFailure({ hook: 'beforeAll', error: new Error() });\n      });\n\n      it('should create test artifact', () => {\n        expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n      });\n\n      it('should start and stop recording in the artifact', () => {\n        expect(plugin.snapshots.fromSession['beforeAllFailure'].start).toHaveBeenCalledTimes(1);\n        expect(plugin.snapshots.fromSession['beforeAllFailure'].stop).toHaveBeenCalledTimes(1);\n      });\n\n      it('should put the artifact under tracking', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromSession['beforeAllFailure']);\n      });\n    });\n\n    describe('when onHookFailure (beforeEach) called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onHookFailure({ hook: 'beforeEach', error: new Error() });\n      });\n\n      it('should create test artifact', () => {\n        expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n      });\n\n      it('should start and stop recording in the artifact', () => {\n        expect(plugin.snapshots.fromTest['beforeEachFailure'].start).toHaveBeenCalledTimes(1);\n        expect(plugin.snapshots.fromTest['beforeEachFailure'].stop).toHaveBeenCalledTimes(1);\n      });\n\n      it('should put the artifact under tracking', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['beforeEachFailure']);\n      });\n    });\n\n    describe('when onTestFnFailure called', function() {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestFnFailure({ error: new Error() });\n      });\n\n      it('should create test artifact', () => {\n        expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n      });\n\n      it('should start and stop recording in the artifact', () => {\n        expect(plugin.snapshots.fromTest['testFnFailure'].start).toHaveBeenCalledTimes(1);\n        expect(plugin.snapshots.fromTest['testFnFailure'].stop).toHaveBeenCalledTimes(1);\n      });\n\n      it('should put the artifact under tracking', () => {\n        expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testFnFailure']);\n      });\n    });\n  });\n\n  describe('onCreateExternalArtifact', () => {\n    it('should throw error if { artifact } is not defined', async () => {\n      await expect(plugin.onCreateExternalArtifact({ name: 'Hello' })).rejects.toThrow();\n    });\n\n    it('should set snapshot in key-value map and track it', async () => {\n      const artifact = new ArtifactMock('test');\n      await plugin.onCreateExternalArtifact({ name: 'hello', artifact });\n\n      expect(plugin.snapshots.fromSession['hello']).toBe(artifact);\n      expect(api.trackArtifact).toHaveBeenCalledWith(artifact);\n    });\n  });\n\n  describe('when takeWhen.testStart and takeWhen.testDone have default values', function() {\n    describe('when the plugin should keep a test artifact', () => {\n      beforeEach(() => plugin.configureToKeepArtifacts(true));\n\n      describe('when onTestStart and onTestDone are called', () => {\n        beforeEach(async () => {\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n        });\n\n        it('should create the second test artifact', () => {\n          expect(plugin.createTestArtifact).toHaveBeenCalledTimes(2);\n        });\n\n        it('should start and stop the second test artifact', () => {\n          expect(plugin.snapshots.fromTest['testDone'].start).toHaveBeenCalledTimes(1);\n          expect(plugin.snapshots.fromTest['testDone'].stop).toHaveBeenCalledTimes(1);\n        });\n\n        it('should put the second test artifact under tracking', () => {\n          expect(api.trackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testDone']);\n        });\n\n        it('should schedule two saving operations and specify itself as an initiator', () => {\n          expect(api.requestIdleCallback).toHaveBeenCalledTimes(2);\n          expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n          expect(api.requestIdleCallback.mock.calls[1]).toEqual([expect.any(Function)]);\n        });\n\n        it('should schedule to save and untrack the first artifact', async () => {\n          const [saveRequest] = api.requestIdleCallback.mock.calls[0];\n\n          expect(plugin.snapshots.fromTest['testStart'].save).not.toHaveBeenCalled();\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await saveRequest();\n\n          expect(plugin.snapshots.fromTest['testStart'].save).toHaveBeenCalledWith('test/testStart.png');\n          expect(api.untrackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testStart']);\n        });\n\n        it('should ultimately save and untrack the second artifact', async () => {\n          const [saveRequest] = api.requestIdleCallback.mock.calls[1];\n\n          expect(plugin.snapshots.fromTest['testDone'].save).not.toHaveBeenCalled();\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await saveRequest();\n\n          expect(plugin.snapshots.fromTest['testDone'].save).toHaveBeenCalledWith('test/testDone.png');\n          expect(api.untrackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testDone']);\n        });\n      });\n\n      describe('when an external snapshot is created in the midst of a test', function() {\n        let artifact;\n\n        beforeEach(async () => {\n          artifact = new ArtifactMock('screenshot');\n\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onCreateExternalArtifact({\n            artifact,\n            name: 'final_name',\n          });\n          await plugin.onTestDone(testSummaries.passed());\n        });\n\n        it('should be saved using the suggested name and untracked', async () => {\n          expect(artifact.save).not.toHaveBeenCalledWith('test/final_name.png');\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await Promise.all(api.requestIdleCallback.mock.calls.map(s => s[0]()));\n\n          expect(artifact.save).toHaveBeenCalledWith('test/final_name.png');\n          expect(api.untrackArtifact).toHaveBeenCalled();\n        });\n      });\n\n      describe('when an external snapshot is created before beforeEach', function() {\n        let artifact;\n\n        beforeEach(async () => {\n          artifact = new ArtifactMock('screenshot');\n\n          await plugin.onCreateExternalArtifact({\n            artifact,\n            name: 'final_name',\n          });\n          await plugin.onTestStart(testSummaries.running());\n        });\n\n        it('should be saved using the suggested name and untracked', async () => {\n          expect(artifact.save).not.toHaveBeenCalledWith('final_name.png');\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await Promise.all(api.requestIdleCallback.mock.calls.map(s => s[0]()));\n\n          expect(artifact.save).toHaveBeenCalledWith('final_name.png');\n          expect(api.untrackArtifact).toHaveBeenCalled();\n        });\n      });\n\n      describe('when an external snapshot is created before Detox cleanup', function() {\n        let artifact;\n\n        beforeEach(async () => {\n          artifact = new ArtifactMock('screenshot');\n\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n          await plugin.onCreateExternalArtifact({\n            artifact,\n            name: 'final_name',\n          });\n          await plugin.onBeforeCleanup();\n        });\n\n        it('should be saved using the suggested name and untracked', async () => {\n          expect(artifact.save).not.toHaveBeenCalledWith('final_name.png');\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await Promise.all(api.requestIdleCallback.mock.calls.map(s => s[0]()));\n\n          expect(artifact.save).toHaveBeenCalledWith('final_name.png');\n          expect(api.untrackArtifact).toHaveBeenCalled();\n        });\n      });\n    });\n\n    describe('when the plugin should not keep a test artifact', () => {\n      beforeEach(() => plugin.configureToKeepArtifacts(false));\n\n      describe('when onTestStart and onTestDone are called', () => {\n        beforeEach(async () => {\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onTestDone(testSummaries.passed());\n        });\n\n        it('should not create the second test artifact', () => {\n          expect(plugin.createTestArtifact).toHaveBeenCalledTimes(1);\n        });\n\n        it('should schedule a discard operation for the first artifact and specify itself as an initiator', () => {\n          expect(api.requestIdleCallback).toHaveBeenCalledTimes(1);\n          expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n        });\n\n        it('should ultimately discard and untrack the first artifact', async () => {\n          const [discardRequest] = api.requestIdleCallback.mock.calls[0];\n\n          expect(plugin.snapshots.fromTest['testStart'].discard).not.toHaveBeenCalled();\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await discardRequest();\n\n          expect(plugin.snapshots.fromTest['testStart'].discard).toHaveBeenCalledTimes(1);\n          expect(api.untrackArtifact).toHaveBeenCalledWith(plugin.snapshots.fromTest['testStart']);\n        });\n      });\n\n      describe('when an external snapshot is created in the midst of a test', function() {\n        let artifact;\n\n        beforeEach(async () => {\n          artifact = new ArtifactMock('screenshot');\n\n          await plugin.onTestStart(testSummaries.running());\n          await plugin.onCreateExternalArtifact({\n            artifact,\n            name: 'final_name',\n          });\n          await plugin.onTestDone(testSummaries.passed());\n        });\n\n        it('should be discarded and untracked', async () => {\n          expect(artifact.discard).not.toHaveBeenCalled();\n          expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n          await Promise.all(api.requestIdleCallback.mock.calls.map(s => s[0]()));\n\n          expect(artifact.discard).toHaveBeenCalled();\n          expect(api.untrackArtifact).toHaveBeenCalledWith(artifact);\n        });\n      });\n    });\n  });\n});\n\nclass FakeTwoSnapshotsPerTestPlugin extends TwoSnapshotsPerTestPlugin {\n  constructor({ api }) {\n    super({ api });\n    this.createTestArtifact = jest.fn(this.createTestArtifact.bind(this));\n\n    const nonDeletable = { deleteProperty: () => true };\n    this.snapshots.fromSession = new Proxy(this.snapshots.fromSession, nonDeletable);\n    this.snapshots.fromTest = new Proxy(this.snapshots.fromTest, nonDeletable);\n  }\n\n  configureAutomaticSnapshots(value) {\n    this.takeAutomaticSnapshots = value;\n  }\n\n  configureToKeepArtifacts(shouldKeep) {\n    this.shouldKeepArtifactOfTest = this.shouldKeepArtifactOfSession = () => shouldKeep;\n  }\n\n  createTestArtifact() {\n    super.createTestArtifact();\n    return new ArtifactMock('test');\n  }\n\n  preparePathForSnapshot(testSummary, snapshotName) {\n    super.preparePathForSnapshot(testSummary, snapshotName);\n\n    if (testSummary) {\n      return `${testSummary.title}/${snapshotName}.png`;\n    } else {\n      return `${snapshotName}.png`;\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/WholeTestRecorderPlugin.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\nconst ArtifactPlugin = require('./ArtifactPlugin');\n\n/***\n * @abstract\n */\nclass WholeTestRecorderPlugin extends ArtifactPlugin {\n  constructor({ api }) {\n    super({ api });\n\n    /** @type {*} */\n    this.testRecording = null;\n  }\n\n  async onTestStart(testSummary) {\n    await super.onTestStart(testSummary);\n\n    if (this.enabled) {\n      this.testRecording = this.createTrackedTestRecording();\n      await this.testRecording.start();\n    }\n  }\n\n  async onTestDone(testSummary) {\n    await super.onTestDone(testSummary);\n\n    if (this.testRecording) {\n      const testRecording = this.testRecording;\n      await testRecording.stop();\n\n      if (this.shouldKeepArtifactOfTest(testSummary)) {\n        this._startSavingTestRecording(testRecording, testSummary);\n      } else {\n        this._startDiscardingTestRecording(testRecording);\n      }\n\n      this.testRecording = null;\n    }\n  }\n\n  /***\n   * @protected\n   */\n  createTrackedTestRecording(config) {\n    const recording = this.createTestRecording(config);\n    this.api.trackArtifact(recording);\n\n    return recording;\n  }\n\n  /***\n   * @abstract\n   * @protected\n   */\n  createTestRecording(config) {}\n\n  /***\n   * @abstract\n   */\n  async preparePathForTestArtifact(testSummary) {} // eslint-disable-line no-unused-vars\n\n  _startSavingTestRecording(testRecording, testSummary) {\n    this.api.requestIdleCallback(async () => {\n      const recordingArtifactPath = await this.preparePathForTestArtifact(testSummary);\n      await testRecording.save(recordingArtifactPath);\n      this.api.untrackArtifact(testRecording);\n    });\n  }\n\n  _startDiscardingTestRecording(testRecording) {\n    this.api.requestIdleCallback(async () => {\n      await testRecording.discard();\n      this.api.untrackArtifact(testRecording);\n    });\n  }\n}\n\nmodule.exports = WholeTestRecorderPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/WholeTestRecorderPlugin.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../utils/logger.js');\nconst testSummaries = require('../../__mocks__/testSummaries.mock');\n\nconst WholeTestRecorderPlugin = require('./WholeTestRecorderPlugin');\nconst ArtifactsApi = require('./__mocks__/ArtifactsApi.mock');\n\ndescribe('WholeTestRecorderPlugin', () => {\n  let api;\n  let plugin;\n\n  beforeEach(() => {\n    api = new ArtifactsApi({\n      config: {\n        enabled: false,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    });\n    plugin = new FakeWholeTestRecorderPlugin({ api });\n  });\n\n  describe('when disabled', () => {\n    beforeEach(() => plugin.disable());\n\n    describe('onTestStart', () => {\n      beforeEach(async () => plugin.onTestStart(testSummaries.running()));\n\n      it('should not create recording onTestStart', async () =>\n        expect(plugin.createTestRecording).not.toHaveBeenCalled());\n    });\n\n    describe('onTestDone', () => {\n      beforeEach(async () => plugin.onTestDone(testSummaries.passed()));\n\n      it('should not create recording', async () =>\n        expect(plugin.createTestRecording).not.toHaveBeenCalled());\n\n      it('should not do request idle callbacks', async () =>\n        expect(api.requestIdleCallback).not.toHaveBeenCalled());\n    });\n  });\n\n  describe('onTestStart', () => {\n    beforeEach(async () => plugin.onTestStart(testSummaries.running()));\n\n    it('should create artifact', async () => {\n      expect(plugin.createTestRecording).toHaveBeenCalled();\n    });\n\n    it('should start recording artifact', async () => {\n      expect(plugin.createdArtifacts[0].start).toHaveBeenCalledTimes(1);\n    });\n\n    it('should not stop recording artifact', async () => {\n      expect(plugin.createdArtifacts[0].stop).not.toHaveBeenCalled();\n    });\n\n    it('should put the artifact under tracking', async () => {\n      expect(api.trackArtifact).toHaveBeenCalledWith(plugin.createdArtifacts[0]);\n    });\n  });\n\n  describe('when the plugin should keep a test artifact', () => {\n    beforeEach(() => plugin.configureToKeepArtifacts(true));\n\n    describe('onTestDone', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.failed());\n      });\n\n      it('should stop artifact recording', async () => {\n        expect(plugin.createdArtifacts[0].stop).toHaveBeenCalled();\n      });\n\n      it('should schedule a save operation and specify itself as an initiator', () => {\n        expect(api.requestIdleCallback).toHaveBeenCalledTimes(1);\n        expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n      });\n\n      it('should ultimately save the artifact and untrack it', async () => {\n        const [saveRequest] = api.requestIdleCallback.mock.calls[0];\n\n        expect(plugin.createdArtifacts[0].save).not.toHaveBeenCalled();\n        expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n        await saveRequest();\n\n        expect(plugin.createdArtifacts[0].save).toHaveBeenCalledWith('/tmp/test/fakeArtifact');\n        expect(api.untrackArtifact).toHaveBeenCalledWith(plugin.createdArtifacts[0]);\n      });\n    });\n  });\n\n  describe('when the plugin should discard a test artifact', () => {\n    beforeEach(() => plugin.configureToKeepArtifacts(false));\n\n    describe('onTestDone', () => {\n      beforeEach(async () => {\n        await plugin.onTestStart(testSummaries.running());\n        await plugin.onTestDone(testSummaries.failed());\n      });\n\n      it('should stop artifact recording', async () => {\n        expect(plugin.createdArtifacts[0].stop).toHaveBeenCalled();\n      });\n\n      it('should schedule a discard operation and specify itself as an initiator', () => {\n        expect(api.requestIdleCallback).toHaveBeenCalledTimes(1);\n        expect(api.requestIdleCallback.mock.calls[0]).toEqual([expect.any(Function)]);\n      });\n\n      it('should ultimately discard the artifact and untrack it', async () => {\n        const [discardRequest] = api.requestIdleCallback.mock.calls[0];\n\n        expect(plugin.createdArtifacts[0].discard).not.toHaveBeenCalled();\n        expect(api.untrackArtifact).not.toHaveBeenCalled();\n\n        await discardRequest();\n\n        expect(plugin.createdArtifacts[0].discard).toHaveBeenCalled();\n        expect(api.untrackArtifact).toHaveBeenCalledWith(plugin.createdArtifacts[0]);\n      });\n    });\n  });\n});\n\nclass FakeWholeTestRecorderPlugin extends WholeTestRecorderPlugin {\n  constructor(...args) {\n    super(...args);\n\n    this.enabled = true;\n    this.createTestRecording = jest.fn(this.createTestRecording.bind(this));\n    this.createdArtifacts = [];\n  }\n\n  configureToKeepArtifacts(shouldKeep) {\n    this.shouldKeepArtifactOfTest = () => shouldKeep;\n  }\n\n  preparePathForTestArtifact(testSummary) {\n    super.preparePathForTestArtifact(testSummary);\n    return `/tmp/${testSummary.title}/fakeArtifact`;\n  }\n\n  createTestRecording() {\n    super.createTestRecording();\n\n    const artifact = {\n      start: jest.fn(),\n      stop: jest.fn(),\n      save: jest.fn(),\n      discard: jest.fn(),\n    };\n\n    this.createdArtifacts.push(artifact);\n    return artifact;\n  }\n}\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/__mocks__/ArtifactsApi.mock.js",
    "content": "class ArtifactsApiMock {\n  constructor({ config }) {\n    this.userConfig = config;\n\n    this.preparePathForArtifact = jest.fn();\n    this.trackArtifact = jest.fn();\n    this.untrackArtifact = jest.fn();\n    this.requestIdleCallback = jest.fn();\n  }\n\n  async emulateRunningAllIdleCallbacks() {\n    for (const [callback] of this.requestIdleCallback.mock.calls) {\n      await callback();\n    }\n  }\n}\n\nmodule.exports = ArtifactsApiMock;\n"
  },
  {
    "path": "detox/src/artifacts/templates/plugin/__mocks__/testSuite.mock.js",
    "content": "const mock = () => ({ name: 'testSuiteName' });\n\nmodule.exports = { mock };\n"
  },
  {
    "path": "detox/src/artifacts/timeline/TimelineContextTypes.js",
    "content": "const TIMELINE_CONTEXT_TYPES = {\n  TEST: 'test',\n  DESCRIBE: 'describe',\n  INVOCATION: 'invocation'\n};\n\nmodule.exports = TIMELINE_CONTEXT_TYPES;\n"
  },
  {
    "path": "detox/src/artifacts/uiHierarchy/IosUIHierarchyPlugin.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst DetoxInternalError = require('../../errors/DetoxInternalError');\nconst setUniqueProperty = require('../../utils/setUniqueProperty');\nconst FileArtifact = require('../templates/artifact/FileArtifact');\nconst ArtifactPlugin = require('../templates/plugin/ArtifactPlugin');\n\nclass IosUIHierarchyPlugin extends ArtifactPlugin {\n  /**\n   * @param {ArtifactsApi} api\n   * @param {Client} client\n   */\n  constructor({ api, client }) {\n    super({ api });\n\n    this._pendingDeletions = [];\n    this._artifacts = {\n      perTest: {},\n      perSession: {},\n    };\n\n    client.setEventCallback('testFailed', this._onInvokeFailure.bind(this));\n  }\n\n  async onBeforeLaunchApp(event) {\n    await super.onBeforeLaunchApp(event);\n\n    if (!this.enabled && !event.launchArgs.hasOwnProperty('detoxDisableHierarchyDump')) {\n      event.launchArgs['detoxDisableHierarchyDump'] = 'YES';\n    }\n  }\n\n  async onCreateExternalArtifact(e) {\n    if (!e.artifact) {\n      throw new DetoxInternalError('Expected Artifact instance in the event');\n    }\n\n    this._registerSnapshot(e.name, e.artifact);\n  }\n\n  _onInvokeFailure({ params: { viewHierarchyURL } }) {\n    if (viewHierarchyURL) {\n      this._registerSnapshot('ui', new FileArtifact({\n        temporaryPath: viewHierarchyURL,\n      }));\n    }\n  }\n\n  _registerSnapshot(name, artifact) {\n    if (this.enabled) {\n      const scope = this.context.testSummary ? 'perTest' : 'perSession';\n      setUniqueProperty(this._artifacts[scope], name, artifact);\n      this.api.trackArtifact(artifact);\n    } else {\n      this._pendingDeletions.push(artifact.discard());\n    }\n  }\n\n  async onTestStart(testSummary) {\n    this.context.testSummary = null;\n    await this._flushArtifacts();\n    await super.onTestStart(testSummary);\n  }\n\n  async onTestDone(testSummary) {\n    await super.onTestDone(testSummary);\n    await this._flushArtifacts(testSummary);\n\n    this.context.testSummary = null;\n    await this._flushArtifacts();\n  }\n\n  async onBeforeUninstallApp(event) {\n    await this.api.requestIdleCallback(async () => {\n      const artifacts = [\n        ...Object.values(this._artifacts.perTest),\n        ...Object.values(this._artifacts.perSession)\n      ];\n\n      await Promise.all(artifacts.map(s => s && s.relocate()));\n    });\n\n    await super.onBeforeUninstallApp(event);\n  }\n\n  async onBeforeCleanup() {\n    await this._flushArtifacts();\n    await super.onBeforeCleanup();\n  }\n\n  async _flushArtifacts(testSummary) {\n    const scope = testSummary ? 'perTest' : 'perSession';\n    const artifacts = this._artifacts[scope];\n    const pendingSaves = _(artifacts)\n      .pickBy(_.identity)\n      .entries()\n      .map(async ([key, artifact]) => {\n        const destination = await this.api.preparePathForArtifact(`${key}.viewhierarchy`, testSummary);\n        await artifact.save(destination);\n        this.api.untrackArtifact(artifact);\n      })\n      .value();\n\n    const pendingDeletions = this._pendingDeletions.splice(0);\n    this._artifacts[scope] = _.mapValues(artifacts, _.constant(null));\n\n    await Promise.all([...pendingSaves, ...pendingDeletions]);\n  }\n\n  /** @param {string} config */\n  static parseConfig(config) {\n    return {\n      enabled: config === 'enabled',\n      keepOnlyFailedTestsArtifacts: false,\n    };\n  }\n}\n\nmodule.exports = IosUIHierarchyPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/uiHierarchy/IosUIHierarchyPlugin.test.js",
    "content": "// @ts-nocheck\nconst testSummaries = require('../__mocks__/testSummaries.mock');\n\njest.mock('../templates/artifact/FileArtifact');\njest.mock('../../client/Client');\n\ndescribe('IosUIHierarchyPlugin', () => {\n  let Client, FileArtifact, IosUIHierarchyPlugin;\n  let plugin, api, client, onTestFailed;\n  const testSummary = 'TestSummary';\n\n  beforeEach(() => {\n    Client = require('../../client/Client');\n    FileArtifact = require('../templates/artifact/FileArtifact');\n    IosUIHierarchyPlugin = require('./IosUIHierarchyPlugin');\n\n    client = new Client();\n    client.setEventCallback.mockImplementation((event, callback) => {\n      if (event === 'testFailed') {\n        onTestFailed = callback;\n      }\n    });\n\n    api = {\n      preparePathForArtifact: jest.fn((name, testSummary) => {\n        if (testSummary) {\n          return 'artifacts/test/' + name;\n        } else {\n          return 'artifacts/' + name;\n        }\n      }),\n      requestIdleCallback: jest.fn(async (callback) => {\n        await callback();\n      }),\n      trackArtifact: jest.fn(),\n      untrackArtifact: jest.fn(),\n      userConfig: {\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    };\n\n    plugin = new IosUIHierarchyPlugin({ api, client });\n  });\n\n  describe('behavior for \"testFailed\" client events', () => {\n    it('should ignore empty view hierarchy on test failure', () => {\n      onTestFailed({ params: {} });\n      expect(FileArtifact.mock.instances.length).toBe(0);\n    });\n\n    it('should capture view hierarchy inside and outside of running test', async () => {\n      onTestFailed(aTestFailedPayload(0));\n\n      await plugin.onTestStart(testSummaries.running());\n      onTestFailed(aTestFailedPayload(1));\n      onTestFailed(aTestFailedPayload(2));\n      await plugin.onTestDone(testSummaries.failed());\n\n      onTestFailed(aTestFailedPayload(3));\n\n      await plugin.onBeforeCleanup();\n\n      const [session1, test1, test2, session2] = FileArtifact.mock.instances;\n\n      expect(session1.save).toHaveBeenCalledWith('artifacts/ui.viewhierarchy');\n      expect(session2.save).toHaveBeenCalledWith('artifacts/ui2.viewhierarchy');\n      expect(test1.save).toHaveBeenCalledWith('artifacts/test/ui.viewhierarchy');\n      expect(test2.save).toHaveBeenCalledWith('artifacts/test/ui2.viewhierarchy');\n      expect(api.trackArtifact).toHaveBeenCalledTimes(4);\n      expect(api.untrackArtifact).toHaveBeenCalledTimes(4);\n    });\n\n    it('should relocate existing artifacts before the app gets uninstalled', async () => {\n      await plugin.onTestStart(testSummaries.running());\n      onTestFailed(aTestFailedPayload(1));\n      onTestFailed(aTestFailedPayload(2));\n\n      await plugin.onBeforeUninstallApp({ deviceId: 'deviceId', bundleId: 'bundleId' });\n\n      const [test1, test2] = FileArtifact.mock.instances;\n\n      expect(test1.relocate).toHaveBeenCalled();\n      expect(test2.relocate).toHaveBeenCalled();\n    });\n  });\n\n  describe('behavior for externally created artifacts', () => {\n    it('should validate event.artifact', async () => {\n      await expect(plugin.onCreateExternalArtifact({ name: 'invalid' }))\n        .rejects\n        .toThrow(/Expected Artifact instance/);\n    });\n\n    it('should register snapshots inside and outside of running test', async () => {\n      const artifacts = [0, 1, 2, 3].map(() => new FileArtifact());\n\n      await plugin.onCreateExternalArtifact({ name: 'session', artifact: artifacts[0] });\n      await plugin.onTestStart(testSummaries.running());\n      await plugin.onCreateExternalArtifact({ name: 'test', artifact: artifacts[1] });\n      await plugin.onCreateExternalArtifact({ name: 'test', artifact: artifacts[2] });\n      await plugin.onTestDone(testSummaries.failed());\n      await plugin.onCreateExternalArtifact({ name: 'session', artifact: artifacts[3] });\n      await plugin.onBeforeCleanup();\n\n      expect(artifacts[0].save).toHaveBeenCalledWith('artifacts/session.viewhierarchy');\n      expect(artifacts[1].save).toHaveBeenCalledWith('artifacts/test/test.viewhierarchy');\n      expect(artifacts[2].save).toHaveBeenCalledWith('artifacts/test/test2.viewhierarchy');\n      expect(artifacts[3].save).toHaveBeenCalledWith('artifacts/session2.viewhierarchy');\n    });\n  });\n\n  describe('when disabled', () => {\n    beforeEach(() => {\n      api.userConfig.enabled = false;\n      plugin = new IosUIHierarchyPlugin({ api, client });\n    });\n\n    it('should propagate -detoxDisableHierarchyDump YES to native', async () => {\n      const event = {\n        launchArgs: {}\n      };\n\n      await plugin.onTestStart(testSummary);\n      await plugin.onBeforeLaunchApp(event);\n      expect(event.launchArgs.detoxDisableHierarchyDump).toBe('YES');\n    });\n\n    it('should not propagate -detoxDisableHierarchyDump YES to native if there is a custom value set', async () => {\n      const event = {\n        launchArgs: {\n          detoxDisableHierarchyDump: 'NO'\n        }\n      };\n\n      await plugin.onTestStart(testSummary);\n      await plugin.onBeforeLaunchApp(event);\n      expect(event.launchArgs.detoxDisableHierarchyDump).toBe('NO');\n    });\n\n    it('should remove the file artifact', () => {\n      onTestFailed(aTestFailedPayload(1));\n      const [fileArtifact] = FileArtifact.mock.instances;\n\n      expect(fileArtifact.discard).toHaveBeenCalled();\n    });\n  });\n\n  describe('static parseConfig(config)', () => {\n    it('should return .enabled === true if config === \"enabled\"', () => {\n      expect(IosUIHierarchyPlugin.parseConfig('enabled')).toEqual({\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: false,\n      });\n    });\n\n    it('should return .enabled === false if config === \"enabled\"', () => {\n      expect(IosUIHierarchyPlugin.parseConfig('enabled')).toEqual({\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: false,\n      });\n    });\n  });\n\n  function aTestFailedPayload(index) {\n    return {\n      params: {\n        viewHierarchyURL: `/tmp/${index}.viewhierarchy`\n      },\n    };\n  }\n});\n"
  },
  {
    "path": "detox/src/artifacts/utils/AndroidDevicePathBuilder.js",
    "content": "class AndroidDevicePathBuilder {\n  constructor(time = new Date()) {\n    // NOTE: this is a workaround for Jest workers + Android\n    this.prefix = `${time.getHours()}${time.getMinutes()}${time.getSeconds()}${time.getMilliseconds()}`;\n    this.counter = 0;\n  }\n\n  buildTemporaryArtifactPath(extension) {\n    return `/sdcard/${this.prefix}_${this.counter++}${extension}`;\n  }\n}\n\nmodule.exports = AndroidDevicePathBuilder;\n\n"
  },
  {
    "path": "detox/src/artifacts/utils/AndroidDevicePathBuilder.test.js",
    "content": "const AndroidDevicePathBuilder = require('./AndroidDevicePathBuilder');\n\ndescribe(AndroidDevicePathBuilder, () => {\n  it('should generate process id dependent paths with a counter', () => {\n    const date = new Date(2015, 5, 15, 15, 2, 58);\n    const builder = new AndroidDevicePathBuilder(date);\n\n    expect(builder.buildTemporaryArtifactPath('.png')).toBe('/sdcard/152580_0.png');\n    expect(builder.buildTemporaryArtifactPath('.png')).toBe('/sdcard/152580_1.png');\n  });\n\n  it('should generate current timestamp string by default', () => {\n    const builder = new AndroidDevicePathBuilder();\n    expect(builder.buildTemporaryArtifactPath('.log')).toMatch(/^\\/sdcard\\/\\d+_\\d+\\.log$/);\n  });\n});\n\n"
  },
  {
    "path": "detox/src/artifacts/utils/ArtifactPathBuilder.js",
    "content": "const path = require('path');\n\nconst constructSafeFilename = require('../../utils/constructSafeFilename');\n\nclass ArtifactPathBuilder {\n  constructor({ rootDir }) {\n    this._rootDir = rootDir;\n  }\n\n  get rootDir() {\n    return this._rootDir;\n  }\n\n  buildPathForTestArtifact(artifactName, testSummary = null) {\n    if (!testSummary) {\n      return this._buildPathForRunArtifact(artifactName);\n    }\n\n    const testArtifactPath = path.join(\n      this._rootDir,\n      this._constructDirectoryNameForCurrentRunningTest(testSummary),\n      constructSafeFilename('', artifactName),\n    );\n\n    return testArtifactPath;\n  }\n\n  _buildPathForRunArtifact(artifactName) {\n    return path.join(\n      this._rootDir,\n      constructSafeFilename('', artifactName),\n    );\n  }\n\n  _constructDirectoryNameForCurrentRunningTest(testSummary) {\n    const prefix = this._buildTestDirectoryPrefix(testSummary);\n    const suffix = testSummary.invocations > 1 ? ` (${testSummary.invocations})` : '';\n    const testArtifactsDirname = constructSafeFilename(prefix, testSummary.fullName, suffix);\n\n    return testArtifactsDirname;\n  }\n\n  _buildTestDirectoryPrefix(testSummary) {\n    return this._getStatusSign(testSummary);\n  }\n\n  _getStatusSign(testSummary) {\n    switch (testSummary.status) {\n      case 'passed': return '✓ ';\n      case 'failed': return '✗ ';\n      default: return '';\n    }\n  }\n}\n\nmodule.exports = ArtifactPathBuilder;\n"
  },
  {
    "path": "detox/src/artifacts/utils/ArtifactPathBuilder.test.js",
    "content": "const path = require('path');\n\nconst ArtifactPathBuilder = require('./ArtifactPathBuilder');\n\ndescribe(ArtifactPathBuilder, () => {\n  let pathBuilder;\n\n  describe('precise tests', () => {\n    beforeEach(() => {\n      pathBuilder = new ArtifactPathBuilder({\n        rootDir: '/tmp'\n      });\n    });\n\n    it('should give paths inside a timestamp-based subdirectory inside artifacts root', () => {\n      expect(pathBuilder.rootDir).toBe('/tmp');\n    });\n\n    it('should provide path for unique (per test runner run) artifacts', () => {\n      const artifactPath1 = pathBuilder.buildPathForTestArtifact('before-tests-began.log');\n      const expectedPath1 = path.join(pathBuilder.rootDir, 'before-tests-began.log');\n\n      expect(artifactPath1).toBe(expectedPath1);\n    });\n\n    it('should provide nested path for test artifact', () => {\n      const test1 = { title: 'test 1', fullName: 'some test 1', status: 'running' };\n      const artifactPath1 = pathBuilder.buildPathForTestArtifact('1.log', test1);\n      const expectedPath1 = path.join(pathBuilder.rootDir, test1.fullName, '1.log');\n\n      expect(artifactPath1).toBe(expectedPath1);\n    });\n  });\n\n  describe('snapshot tests', () => {\n    beforeEach(() => {\n      pathBuilder = new ArtifactPathBuilder({\n        rootDir: '/tmp/subdir',\n      });\n    });\n\n    it('should defend against accidental resolving outside of root directory', () => {\n      const maliciousName = 'some/../../../../../../home/build-server';\n\n      const [path1, path2, path3] = [\n        pathBuilder.buildPathForTestArtifact('.bashrc', { title: '', fullName: maliciousName }),\n        pathBuilder.buildPathForTestArtifact(maliciousName, { title: '', fullName: 'test' }),\n        pathBuilder.buildPathForTestArtifact(maliciousName, { title: '', fullName: maliciousName }),\n      ].map(asPosixPath);\n\n      expect(path1).toBe('/tmp/subdir/some_.._.._.._.._.._.._home_build-server/.bashrc');\n      expect(path2).toBe('/tmp/subdir/test/some_.._.._.._.._.._.._home_build-server');\n      expect(path3).toBe('/tmp/subdir/some_.._.._.._.._.._.._home_build-server/some_.._.._.._.._.._.._home_build-server');\n    });\n\n    it('should trim too long filenames', () => {\n      const actualPath = pathBuilder.buildPathForTestArtifact('2'.repeat(256), { title: 'test', fullName: '1'.repeat(512) });\n      const expectedPath = path.join(pathBuilder.rootDir, '1'.repeat(255), '2'.repeat(255));\n\n      expect(actualPath).toBe(expectedPath);\n    });\n\n    it('should prepend checkmark to an artifact of a passed test', () => {\n      const testSummary = { title: '', fullName: 'test', status: 'passed' };\n      const artifactPath = pathBuilder.buildPathForTestArtifact('1.log', testSummary);\n\n      expect(asPosixPath(artifactPath)).toBe('/tmp/subdir/✓ test/1.log');\n    });\n\n    it('should prepend x sign to an artifact of a failed test', () => {\n      const testSummary = { title: '', fullName: 'test', status: 'failed' };\n      const artifactPath = pathBuilder.buildPathForTestArtifact('1.log', testSummary);\n\n      expect(asPosixPath(artifactPath)).toBe('/tmp/subdir/✗ test/1.log');\n    });\n\n    it('should append (2) invocations count for a test that fails for the second time', () => {\n      const testSummary = { title: '', fullName: 'test', status: 'failed', invocations: 2 };\n      const artifactPath = pathBuilder.buildPathForTestArtifact('1.log', testSummary);\n\n      expect(asPosixPath(artifactPath)).toBe('/tmp/subdir/✗ test (2)/1.log');\n    });\n\n    it('should append (3) invocations count for a test that passes for the third time', () => {\n      const testSummary = { title: '', fullName: 'test', status: 'passed', invocations: 3 };\n      const artifactPath = pathBuilder.buildPathForTestArtifact('1.log', testSummary);\n\n      expect(asPosixPath(artifactPath)).toBe('/tmp/subdir/✓ test (3)/1.log');\n    });\n  });\n\n  function asPosixPath(maybeWin32Path) {\n    return maybeWin32Path.replace(asPosixPath.regexp, path.posix.sep);\n  }\n\n  asPosixPath.regexp = new RegExp('\\\\' + path.win32.sep, 'g');\n});\n"
  },
  {
    "path": "detox/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js",
    "content": "const path = require('path');\n\nconst getTimeStampString = require('./getTimeStampString');\n\nfunction buildDefaultRootForArtifactsRootDirpath(configuration, rootDir) {\n  if (rootDir.endsWith('/') || rootDir.endsWith('\\\\')) {\n    return rootDir.slice(0, -1);\n  }\n\n  return path.join(rootDir, `${configuration}.${getTimeStampString(new Date())}`);\n}\n\nmodule.exports = buildDefaultRootForArtifactsRootDirpath;\n"
  },
  {
    "path": "detox/src/artifacts/utils/buildDefaultArtifactsRootDirpath.test.js",
    "content": "jest.useFakeTimers();\n\nconst path = require('path');\n\nconst getTimeStampString = require('./getTimeStampString');\n\ndescribe('buildDefaultArtifactsRootDirpath', () => {\n  let buildDefaultArtifactsRootDirpath;\n\n  beforeEach(() => {\n    buildDefaultArtifactsRootDirpath = require('./buildDefaultArtifactsRootDirpath');\n  });\n\n  it('should append \"<configurationName>.YYYY-MM-DD HH-MM-SSZ\" subdir if dir does not end with /', () => {\n    expect(buildDefaultArtifactsRootDirpath('iphone8', 'artifacts')).toBe(path.join('artifacts', `iphone8.${getTimeStampString()}`));\n  });\n\n  it('should not append subdir if dir ends with /', () => {\n    expect(buildDefaultArtifactsRootDirpath('iphone8', 'artifacts/')).toBe('artifacts');\n  });\n\n  it('should not append subdir if dir ends with \\\\', () => {\n    expect(buildDefaultArtifactsRootDirpath('iphone8', 'artifacts\\\\')).toBe('artifacts');\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/utils/getTimeStampString.js",
    "content": "function getTimeStampString(date = new Date()) {\n  return date.toISOString()\n    .replace(/T/, ' ')\n    .replace(/\\.\\d{3}/, '')\n    .replace(/:/g, '-');\n}\n\nmodule.exports = getTimeStampString;\n"
  },
  {
    "path": "detox/src/artifacts/utils/getTimeStampString.test.js",
    "content": "const getTimeStampString = require('./getTimeStampString');\n\ndescribe(getTimeStampString.name, () => {\n  it('should format date', () => {\n    const date = new Date(Date.UTC(2015, 5, 15, 15, 2, 58));\n    expect(getTimeStampString(date)).toBe('2015-06-15 15-02-58Z');\n    expect(typeof getTimeStampString()).toBe('string');\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/utils/temporaryPath.js",
    "content": "const path = require('path');\nconst { promisify } = require('util');\n\nconst glob = require('glob');\nconst _ = require('lodash');\n\nconst { useForwardSlashes } = require('../../utils/shellUtils');\nconst tempfile = require('../../utils/tempfile');\n\n\nconst globSync = glob.sync;\nconst globAsync = promisify(glob);\nconst getRoot = _.once(() => path.dirname(tempfile()));\n\nfunction createGlobber(ext) {\n  const fullExt = `.detox.${ext}`;\n\n  return {\n    sync: (pattern) => {\n      const cwd = getRoot();\n      const files = globSync(useForwardSlashes(pattern + fullExt), { cwd });\n      return files.map(f => path.join(cwd, f));\n    },\n    async: async (pattern) => {\n      const cwd = getRoot();\n      const files = await globAsync(useForwardSlashes(pattern + fullExt), { cwd });\n      return files.map(f => path.join(cwd, f));\n    },\n  };\n}\n\nfunction createTempFileBuilderFn(fileExtension) {\n  /**\n   * @param {string} [basename]\n   */\n  return (basename) => {\n    return basename\n      ? path.join(getRoot(), `${basename}.detox.${fileExtension}`)\n      : tempfile(`.detox.${fileExtension}`);\n  };\n}\n\nmodule.exports = {\n  for: {\n    json: createTempFileBuilderFn('json'),\n    jsonl: createTempFileBuilderFn('jsonl'),\n    png: createTempFileBuilderFn('png'),\n    log: createTempFileBuilderFn('log'),\n    mp4: createTempFileBuilderFn('mp4'),\n    dtxrec: createTempFileBuilderFn('dtxrec'),\n    viewhierarchy: createTempFileBuilderFn('viewhierarchy'),\n  },\n  find: {\n    jsonl: createGlobber('jsonl'),\n  },\n};\n"
  },
  {
    "path": "detox/src/artifacts/utils/temporaryPath.test.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\n\nconst tempfile = require('../../utils/tempfile');\n\nconst temporaryPath = require('./temporaryPath');\n\ndescribe('temporaryPath', () => {\n  describe.each([\n    ['json'],\n    ['jsonl'],\n    ['png'],\n    ['log'],\n    ['mp4'],\n    ['dtxrec'],\n    ['viewhierarchy'],\n  ])('for.%s', (ext) => {\n    it(`should generate a temporary path with the correct extension`, () => {\n      expect(path.dirname(temporaryPath.for[ext]())).toBe(path.dirname(tempfile()));\n      expect(temporaryPath.for[ext]()).toMatch(new RegExp(`.+\\\\.detox\\\\.${ext}$`));\n    });\n\n    it(`should generate a temporary path with specified name and correct extension`, () => {\n      const basename = Math.random().toString(36).slice(2);\n      const tempPath = temporaryPath.for[ext](basename);\n      expect(path.dirname(temporaryPath.for[ext]())).toBe(path.dirname(tempfile()));\n      expect(path.basename(tempPath, `.detox.${ext}`)).toBe(basename);\n    });\n  });\n\n  describe.each([\n    ['jsonl'],\n  ])('find.%s', (ext) => {\n    let file1, file2;\n\n    beforeEach(async () => {\n      file1 = temporaryPath.for[ext]('ABC.DEF');\n      file2 = temporaryPath.for[ext]('XYZ.DEF');\n      await fs.ensureFile(file1);\n      await fs.ensureFile(file2);\n    });\n\n    afterEach(async () => {\n      await fs.remove(file1);\n      await fs.remove(file2);\n    });\n\n    describe('.sync', () => {\n      it('should find temporary files by mask synchronously', async () => {\n        expect(temporaryPath.find[ext].sync('ABC.DEF')).toEqual([file1]);\n        expect(temporaryPath.find[ext].sync('ABC.*')).toEqual([file1]);\n        expect(temporaryPath.find[ext].sync('*.DEF')).toEqual([file1, file2]);\n      });\n    });\n\n    describe('.async', () => {\n      it('should find temporary files by mask asynchronously', async () => {\n        await expect(temporaryPath.find[ext].async('ABC.DEF')).resolves.toEqual([file1]);\n        await expect(temporaryPath.find[ext].async('ABC.*')).resolves.toEqual([file1]);\n        await expect(temporaryPath.find[ext].async('*.DEF')).resolves.toEqual([file1, file2]);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/artifacts/video/ADBScreenrecorderArtifact.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst { interruptProcess } = require('../../utils/childProcess');\nconst retry = require('../../utils/retry');\nconst sleep = require('../../utils/sleep');\nconst Artifact = require('../templates/artifact/Artifact');\n\nclass ADBVideoRecording extends Artifact {\n  constructor(config) {\n    super(config);\n\n    this.adb = config.adb;\n    this.deviceId = config.deviceId;\n    this.pathToVideoOnDevice = config.pathToVideoOnDevice;\n    this.screenRecordOptions = config.screenRecordOptions || {};\n\n    this.processPromise = null;\n    this._waitWhileVideoIsBusy = null;\n  }\n\n  async doStart() {\n    this.processPromise = this.adb.screenrecord(this.deviceId, {\n      ...this.screenRecordOptions,\n      path: this.pathToVideoOnDevice\n    });\n\n    await sleep(300); // wait while video is most likely empty\n    await retry(() => this._assertVideoIsBeingRecorded());\n  }\n\n  async doStop() {\n    if (this.processPromise) {\n      await interruptProcess(this.processPromise);\n      this.processPromise = null;\n\n      this._waitWhileVideoIsBusy = sleep(500).then(() => {\n        return retry(() => this._assertVideoIsNotOpenedByProcesses());\n      });\n    }\n  }\n\n  async doSave(artifactPath) {\n    await this._waitWhileVideoIsBusy;\n    await this.adb.pull(this.deviceId, this.pathToVideoOnDevice, artifactPath);\n    await this.adb.rm(this.deviceId, this.pathToVideoOnDevice);\n  }\n\n  async doDiscard() {\n    await this._waitWhileVideoIsBusy;\n    await this.adb.rm(this.deviceId, this.pathToVideoOnDevice);\n  }\n\n  async _assertVideoIsBeingRecorded() {\n    const size = await this.adb.getFileSize(this.deviceId, this.pathToVideoOnDevice);\n\n    if (size < 1) {\n      throw new DetoxRuntimeError({\n        message: `The video is not being recorded on device (${this.deviceId}) at path: ${this.pathToVideoOnDevice}`,\n      });\n    }\n  }\n\n  async _assertVideoIsNotOpenedByProcesses() {\n    const size = await this.adb.getFileSize(this.deviceId, this.pathToVideoOnDevice);\n\n    if (size < 1) {\n      throw new DetoxRuntimeError({\n        message: `The video is not being recorded on device (${this.deviceId}) at path: ${this.pathToVideoOnDevice}`,\n      });\n    }\n  }\n}\n\nmodule.exports = ADBVideoRecording;\n"
  },
  {
    "path": "detox/src/artifacts/video/ADBScreenrecorderPlugin.js",
    "content": "const ADBScreenrecorderArtifact = require('./ADBScreenrecorderArtifact');\nconst VideoArtifactPlugin = require('./VideoArtifactPlugin');\n\nclass ADBScreenrecorderPlugin extends VideoArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this._adb = config.adb;\n    this._devicePathBuilder = config.devicePathBuilder;\n  }\n\n  createTestRecording() {\n    return new ADBScreenrecorderArtifact({\n      adb: this._adb,\n      deviceId: this.context.deviceId,\n      pathToVideoOnDevice: this._devicePathBuilder.buildTemporaryArtifactPath('.mp4'),\n      screenRecordOptions: this.api.userConfig.android,\n    });\n  }\n}\n\nmodule.exports = ADBScreenrecorderPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/video/SimulatorRecordVideoPlugin.js",
    "content": "const fs = require('fs-extra');\n\nconst { interruptProcess } = require('../../utils/childProcess');\nconst log = require('../../utils/logger').child({ cat: 'artifacts-plugin,artifact' });\nconst Artifact = require('../templates/artifact/Artifact');\nconst FileArtifact = require('../templates/artifact/FileArtifact');\nconst temporaryPath = require('../utils/temporaryPath');\n\nconst VideoArtifactPlugin = require('./VideoArtifactPlugin');\n\nclass SimulatorRecordVideoPlugin extends VideoArtifactPlugin {\n  constructor(config) {\n    super(config);\n\n    this.appleSimUtils = config.appleSimUtils;\n  }\n\n  createTestRecording() {\n    const { api, context, appleSimUtils } = this;\n    const temporaryFilePath = temporaryPath.for.mp4();\n    let processPromise = null;\n\n    return new Artifact({\n      name: 'SimulatorVideoRecording',\n      start: async () => {\n        processPromise = appleSimUtils.recordVideo(context.deviceId, temporaryFilePath, api.userConfig.simulator);\n      },\n      stop: async () => {\n        if (processPromise) {\n          await interruptProcess(processPromise, {\n            SIGINT: 0,\n            SIGTERM: 5000,\n            SIGKILL: 6000,\n          });\n        }\n      },\n      save: async (artifactPath) => {\n        await FileArtifact.moveTemporaryFile(log, temporaryFilePath, artifactPath);\n      },\n      discard: async () => {\n        await fs.remove(temporaryFilePath);\n      },\n    });\n  }\n}\n\nmodule.exports = SimulatorRecordVideoPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/video/VideoArtifactPlugin.js",
    "content": "const WholeTestRecorderPlugin = require('../templates/plugin/WholeTestRecorderPlugin');\n\nclass VideoArtifactPlugin extends WholeTestRecorderPlugin {\n  constructor({ api }) {\n    super({ api });\n  }\n\n  async preparePathForTestArtifact(testSummary) {\n    return this.api.preparePathForArtifact('test.mp4', testSummary);\n  }\n\n  /** @param {string} config */\n  static parseConfig(config) {\n    switch (config) {\n      case 'failing':\n        return {\n          enabled: true,\n          keepOnlyFailedTestsArtifacts: true,\n        };\n      case 'all':\n        return {\n          enabled: true,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n      case 'none':\n      default:\n        return {\n          enabled: false,\n          keepOnlyFailedTestsArtifacts: false,\n        };\n    }\n  }\n}\n\nmodule.exports = VideoArtifactPlugin;\n"
  },
  {
    "path": "detox/src/artifacts/video/VideoArtifactPlugin.test.js",
    "content": "const VideoArtifactPlugin = require('./VideoArtifactPlugin');\n\ndescribe('VideoArtifactPlugin', () => {\n  describe('static parseConfig(config)', () => {\n    const parseConfig = VideoArtifactPlugin.parseConfig;\n\n    const ENABLE_MODES = ['all', 'failing'].map(x => [x]);\n    const DISABLE_MODES = ['none', 'blabla'].map(x => [x]);\n\n    const INCLUSIVE_MODES = ['all', 'manual', 'none', 'blabla'].map(x => [x]);\n    const EXCLUSIVE_MODES = ['failing'].map(x => [x]);\n\n    it.each(ENABLE_MODES)('should enable plugin if config = %j', (config) =>\n        expect(parseConfig(config).enabled).toBe(true));\n\n    it.each(DISABLE_MODES)('should disable plugin if config = %j', (config) =>\n        expect(parseConfig(config).enabled).toBe(false));\n\n    it.each(INCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n        expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(false));\n\n    it.each(EXCLUSIVE_MODES)('should save all screenshots if config = %j', (config) =>\n        expect(parseConfig(config).keepOnlyFailedTestsArtifacts).toBe(true));\n  });\n});\n\n"
  },
  {
    "path": "detox/src/client/AsyncWebSocket.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\n// @ts-nocheck\nconst _ = require('lodash');\nconst WebSocket = require('ws');\n\nconst DetoxInternalError = require('../errors/DetoxInternalError');\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst Deferred = require('../utils/Deferred');\nconst log = require('../utils/logger').child({ cat: 'ws-client,ws' });\n\nconst InflightRequest = require('./InflightRequest');\n\nconst DEFAULT_SEND_OPTIONS = {\n  timeout: 0,\n};\n\nclass AsyncWebSocket {\n  constructor({ url, ignoreUnexpectedMessages = false }) {\n    this._url = url;\n    this._ws = null;\n    this._eventCallbacks = {};\n    this._messageIdCounter = 0;\n    this._opening = null;\n    this._closing = null;\n    this._abortedMessageIds = new Set();\n    this._ignoreUnexpectedMessages = ignoreUnexpectedMessages;\n\n    this.inFlightPromises = {};\n  }\n\n  async open() {\n    if (this._ws) {\n      throw new DetoxInternalError(`Cannot open an already ${this.status} web socket.`);\n    }\n\n    this._opening = new Deferred();\n\n    try {\n      this._ws = new WebSocket(this._url);\n      this._ws.onopen = this._onOpen.bind(this);\n      this._ws.onerror = this._onError.bind(this);\n      this._ws.onmessage = this._onMessage.bind(this);\n      this._ws.onclose = this._onClose.bind(this);\n    } catch (e) {\n      this._unlinkSocket();\n\n      throw new DetoxRuntimeError({\n        message: 'Unexpected error occurred when opening a web socket connection.\\nSee the error details below.',\n        hint: DetoxRuntimeError.reportIssue,\n        debugInfo: e,\n      });\n    }\n\n    return this._opening.promise;\n  }\n\n  async close() {\n    if (!this._ws) {\n      return;\n    }\n\n    if (this._closing) {\n      throw new DetoxInternalError('Detected an attempt to close an already closing or closed web socket.');\n    }\n\n    const closing = this._closing = new Deferred();\n\n    try {\n      this._ws.close();\n    } catch (error) {\n      this._onError({ error });\n    }\n\n    return closing.promise;\n  }\n\n  async send(message, options = DEFAULT_SEND_OPTIONS) {\n    if (!this.isOpen) {\n      throw new DetoxRuntimeError({\n        message: 'Cannot send a message over the closed web socket. See the payload below:',\n        hint: DetoxRuntimeError.reportIssue,\n        debugInfo: message,\n      });\n    }\n\n    if (!_.isNumber(message.messageId)) {\n      message.messageId = this._messageIdCounter++;\n    }\n\n    const messageId = message.messageId;\n    const inFlight = this.inFlightPromises[messageId] = new InflightRequest(message).withTimeout(options.timeout);\n\n    this.handleMultipleNonAtomicPendingActions();\n\n    const payload = JSON.stringify(message);\n    log.trace({ data: payload }, 'send message');\n    this._ws.send(payload);\n\n    return inFlight.promise;\n  }\n\n  handleMultipleNonAtomicPendingActions() {\n    const pendingNonAtomicRequests = this.getNonAtomicPendingActions();\n    for (const inflight of pendingNonAtomicRequests) {\n        inflight.reject(new DetoxRuntimeError({\n          message: 'Detox has detected multiple interactions taking place simultaneously. Have you forgotten to apply an await over one of the Detox actions in your test code?',\n        }));\n    }\n  }\n\n  getNonAtomicPendingActions() {\n    const remaining = Object.keys(this.inFlightPromises).map((key) => {\n      return this.inFlightPromises[key];\n    }).filter(item => {\n      return item.message.isAtomic === true;\n    });\n\n    return remaining.length > 1 ? remaining : [];\n  }\n\n  setEventCallback(event, callback) {\n    if (_.isEmpty(this._eventCallbacks[event])) {\n      this._eventCallbacks[event] = [callback];\n    } else {\n      this._eventCallbacks[event].push(callback);\n    }\n  }\n\n  resetInFlightPromises() {\n    for (const messageId of _.keys(this.inFlightPromises)) {\n      const inFlight = this.inFlightPromises[messageId];\n      inFlight.clearTimeout();\n      delete this.inFlightPromises[messageId];\n      this._abortedMessageIds.add(+messageId);\n    }\n  }\n\n  // TODO [2024-12-01]: handle this leaked abstraction some day\n  hasPendingActions() {\n    return _.some(this.inFlightPromises, p => p.message.type !== 'currentStatus');\n  }\n\n  rejectAll(error) {\n    const hasPendingActions = this.hasPendingActions();\n    const inFlightPromises = _.values(this.inFlightPromises);\n\n    this.resetInFlightPromises();\n    for (const inflight of inFlightPromises) {\n      inflight.reject(error);\n    }\n\n    if (!hasPendingActions) {\n      log.error({ error });\n    }\n  }\n\n  get isOpen() {\n    return this.status === 'open';\n  }\n\n  get status() {\n    if (!this._ws) {\n      return 'non-initialized';\n    }\n\n    switch (this._ws.readyState) {\n      case WebSocket.CLOSED: return 'closed';\n      case WebSocket.CLOSING: return 'closing';\n      case WebSocket.CONNECTING: return 'opening';\n      case WebSocket.OPEN: return 'open';\n      /* istanbul ignore next */\n      default:\n        return undefined;\n    }\n  }\n\n  /**\n   * @param {WebSocket.OpenEvent} event\n   * @private\n   */\n  _onOpen(event) {\n    log.trace(`opened web socket to: ${this._url}`);\n    this._opening.resolve();\n    this._opening = null;\n  }\n\n  /**\n   * @param {Error} event.error\n   * @private\n   */\n  _onError(event) {\n    const { error } = event;\n\n    if (this._opening && this._opening.isPending()) {\n      this._opening.reject(new DetoxRuntimeError({\n        message: 'Failed to open a connection to the Detox server.',\n        debugInfo: error,\n        noStack: true,\n      }));\n\n      return this._unlinkSocket();\n    }\n\n    if (this._closing && this._closing.isPending()) {\n      this._closing.reject(new DetoxRuntimeError({\n        message: 'Failed to close a connection to the Detox server.',\n        debugInfo: error,\n        noStack: true,\n      }));\n\n      return this._unlinkSocket();\n    }\n\n    this.rejectAll(new DetoxRuntimeError({\n      message: 'Failed to deliver the message to the Detox server:',\n      debugInfo: error,\n      noStack: true,\n    }));\n  }\n\n  /**\n   *\n   * @param {WebSocket.MessageEvent} event\n   * @private\n   */\n  _onMessage(event) {\n    const data = event && event.data || null;\n\n    try {\n      log.trace({ data }, 'get message');\n\n      const json = JSON.parse(data);\n      if (!json || !json.type) {\n        throw new DetoxRuntimeError('Empty or non-typed message received over the web socket.');\n      }\n\n      let handled = false;\n\n      if (this.inFlightPromises.hasOwnProperty(json.messageId)) {\n        this.inFlightPromises[json.messageId].resolve(json);\n        delete this.inFlightPromises[json.messageId];\n        handled = true;\n      }\n\n      if (this._eventCallbacks.hasOwnProperty(json.type)) {\n        for (const callback of this._eventCallbacks[json.type]) {\n          callback(json);\n        }\n\n        handled = true;\n      }\n\n      if (!handled) {\n        if (this._abortedMessageIds.has(json.messageId)) {\n          log.debug({ messageId: json.messageId }, `late response`);\n        } else {\n            const errorMessage = 'Unexpected message received over the web socket: ' + json.type;\n            if (this._ignoreUnexpectedMessages) {\n              log.warn({ messageId: json.messageId, type: json.type }, errorMessage + ' (ignored due to configuration)');\n            } else {\n              throw new DetoxRuntimeError(errorMessage);\n            }\n          }\n      }\n    } catch (error) {\n      this.rejectAll(new DetoxRuntimeError({\n        message: 'Unexpected error on an attempt to handle the response received over the web socket.',\n        hint: 'Examine the inner error:\\n\\n' + DetoxRuntimeError.format(error) + '\\n\\nThe payload was:',\n        debugInfo: data,\n      }));\n    }\n  }\n\n  /**\n   * @param {WebSocket.CloseEvent | null} event\n   * @private\n   */\n  _onClose(event) {\n    if (this._closing) {\n      this._closing.resolve();\n    }\n\n    this._unlinkSocket();\n  }\n\n  _unlinkSocket() {\n    if (this._ws) {\n      this._ws.onopen = null;\n      this._ws.onerror = null;\n      this._ws.onmessage = null;\n      this._ws.onclose = null;\n      this._ws = null;\n    }\n\n    this._opening = null;\n    this._closing = null;\n  }\n}\n\nmodule.exports = AsyncWebSocket;\n"
  },
  {
    "path": "detox/src/client/AsyncWebSocket.test.js",
    "content": "// @ts-nocheck\njest.useFakeTimers('modern');\n\nconst permaproxy = require('funpermaproxy');\nconst _ = require('lodash');\n\nconst config = require('../configuration/configurations.mock').validSession;\n\ndescribe('AsyncWebSocket', () => {\n  let AsyncWebSocket;\n  let WebSocket;\n  /**\n   * @type {import('./AsyncWebSocket')}\n   */\n  let aws;\n  let log;\n\n  const socket = permaproxy(() => _.last(WebSocket.mock.instances));\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    jest.mock('ws');\n    WebSocket = require('ws');\n    WebSocket.CONNECTING = 0;\n    WebSocket.OPEN = 1;\n    WebSocket.CLOSING = 2;\n    WebSocket.CLOSED = 3;\n\n    WebSocket.prototype._socket = { localPort: NaN };\n    WebSocket.prototype.readyState = WebSocket.CONNECTING;\n    WebSocket.prototype.mockOpen = function () {\n      this.readyState = WebSocket.OPEN;\n      this.onopen && this.onopen({ target: this });\n    };\n    WebSocket.prototype.mockError = function (error) {\n      this.onerror && this.onerror({ error });\n    };\n    WebSocket.prototype.mockMessage = function (data) {\n      this.onmessage && this.onmessage({ data: JSON.stringify(data) });\n    };\n    WebSocket.prototype.mockClose = function () {\n      this.onclose && this.onclose(null);\n    };\n    WebSocket.prototype.mockCloseError = function (error) {\n      this.close.mockImplementation(() => { throw error; });\n    };\n\n    AsyncWebSocket = require('./AsyncWebSocket');\n    aws = new AsyncWebSocket({ url: config.server });\n    log = require('../utils/logger');\n  });\n\n  afterEach(() => {\n    jest.clearAllTimers();\n  });\n\n  describe('.open()', () => {\n    it(`should normally resolve`, async () => {\n      await expect(connect()).resolves.not.toThrow();\n    });\n\n    it(`should reject if called twice simultaneously`, async () => {\n      const [, connectTwice] = [aws.open(), connect()];\n      await expect(connectTwice).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it(`should reject if called twice sequentially`, async () => {\n      await connect();\n      await expect(connect()).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it(`should reject on a constructor error`, async () => {\n      WebSocket.mockImplementation(() => { throw anError(); });\n      await expect(connect()).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it(`should reject on an error event`, async () => {\n      const promise = aws.open();\n      socket.mockError(anError());\n      await expect(promise).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it(`should allow to open a connection after an error`, async () => {\n      const promise1 = aws.open();\n      socket.mockError(anError());\n      await expect(promise1).rejects.toThrow();\n\n      const promise2 = aws.open();\n      socket.mockOpen();\n      await expect(promise2).resolves.not.toThrow();\n    });\n  });\n\n  describe('.send()', () => {\n    it(`should throw for a closed connection`, async () => {\n      await expect(aws.send(generateRequest())).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    describe('when opened', () => {\n      beforeEach(() => connect());\n\n      it(`should mutate messages without .messageId by auto-incrementing it`, async () => {\n        const expected1 = generateResponse('onmessage', 0);\n        const request1 = generateRequest();\n        const response1 = aws.send(request1);\n        socket.mockMessage(expected1);\n        expect(await response1).toEqual(expected1);\n        expect(request1.messageId).toEqual(0);\n\n        const expected2 = generateResponse('onmessage', 1);\n        const request2 = generateRequest();\n        const response2 = aws.send(request2);\n        socket.mockMessage(expected2);\n        expect(await response2).toEqual(expected2);\n        expect(request2.messageId).toEqual(1);\n      });\n\n      it(`should not mutate an existing messageId in a message`, async () => {\n        const expected1 = generateResponse('cleanupDone', -0xc1ea);\n\n        const request1 = generateRequest(-0xc1ea);\n        const response1 = aws.send(request1);\n        socket.mockMessage(expected1);\n        expect(await response1).toEqual(expected1);\n      });\n\n      it(`should not set expiration timers by default`, async () => {\n        aws.send(generateRequest());\n        expect(jest.getTimerCount()).toBe(0);\n      });\n\n      it(`should set an expiration timer if sent with timeout > 0`, async () => {\n        aws.send(generateRequest(), { timeout: 100 });\n        expect(jest.getTimerCount()).toBe(1);\n      });\n\n      it(`should reject all messages in the flight if there's an error`, async () => {\n        const sendPromise1 = aws.send(generateRequest());\n        socket.mockError(anError());\n\n        await expect(sendPromise1).rejects.toThrowErrorMatchingSnapshot();\n      });\n\n      it(`should call an event handler when it matches the message type in the flight`, async () => {\n        const onErrorCallback = jest.fn();\n        const someResponse = generateResponse('error message', 100);\n        someResponse.type = 'error';\n\n        aws.setEventCallback('error', onErrorCallback);\n        const sendPromise1 = aws.send(generateRequest(100));\n\n        // we have one matching in-flight promise with messageId=100\n        socket.mockMessage(someResponse);\n        await expect(sendPromise1).resolves.toEqual(someResponse);\n        expect(onErrorCallback).toHaveBeenCalledWith(someResponse);\n        expect(onErrorCallback).toHaveBeenCalledTimes(1);\n\n        // now there are no matching in-flight promises\n        socket.mockMessage(someResponse);\n        expect(onErrorCallback).toHaveBeenCalledTimes(2);\n      });\n\n      it(`should log an error if the incoming message was completely unexpected`, async () => {\n        const onErrorCallback = jest.fn();\n        aws.setEventCallback('error', onErrorCallback);\n        socket.mockMessage({ type: 'somethingElse' });\n\n        expect(onErrorCallback).not.toHaveBeenCalled();\n        expect(log.error).toHaveBeenCalledWith({ error: expect.anything() });\n\n        const { error } = log.error.mock.calls[0][0];\n        expect(error).toMatchSnapshot();\n      });\n\n      it(`should fail if the message timeout has expired`, async () => {\n        const sendPromise = aws.send(generateRequest(), { timeout: 5000 });\n        expect(jest.getTimerCount()).toBe(1);\n        jest.advanceTimersByTime(5000);\n        await expect(sendPromise).rejects.toThrowErrorMatchingSnapshot();\n        expect(jest.getTimerCount()).toBe(0);\n      });\n\n      it(`should cancel the expiration timer if the request has been answered`, async () => {\n        aws.send(generateRequest(100), { timeout: 5000 });\n        expect(jest.getTimerCount()).toBe(1);\n        socket.mockMessage({ messageId: 100, type: 'response' });\n        expect(jest.getTimerCount()).toBe(0);\n      });\n\n      it(`should cancel the expiration timer if all in-flights have been reset`, async () => {\n        aws.send(generateRequest(100), { timeout: 5000 });\n        await aws.resetInFlightPromises();\n        expect(jest.getTimerCount()).toBe(0);\n      });\n\n      it(`should cancel the expiration timer if all in-flights have been rejected`, async () => {\n        const promise = aws.send(generateRequest(100), { timeout: 5000 });\n        await aws.rejectAll(new Error('Just because'));\n        expect(jest.getTimerCount()).toBe(0);\n        await expect(promise).rejects.toThrow('Just because');\n      });\n    });\n  });\n\n  describe('.close()', () => {\n    it('should silently exit if the socket is not open', async () => {\n      await expect(aws.close()).resolves.not.toThrow();\n    });\n\n    it('should close the socket when onclose is called', async () => {\n      await connect();\n      const closePromise = aws.close();\n      socket.mockClose();\n      await expect(closePromise).resolves.not.toThrow();\n    });\n\n    it('should throw on a consequent attempt to close the socket', async () => {\n      await connect();\n      const closePromise1 = aws.close();\n      const closePromise2 = aws.close();\n      socket.mockClose();\n      await expect(closePromise1).resolves.not.toThrow();\n      await expect(closePromise2).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw on a sync socket.close() error', async () => {\n      await connect();\n      socket.mockCloseError(anError());\n      await expect(aws.close()).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw on an emitted socket.close() error', async () => {\n      await connect();\n      const closePromise = aws.close();\n      socket.mockError(anError());\n      await expect(closePromise).rejects.toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('.isOpen', () => {\n    it(`should return false when closed`, async () => {\n      expect(aws.isOpen).toBe(false);\n    });\n\n    it(`should return true when opened`, async () => {\n      await connect();\n      expect(aws.isOpen).toBe(true);\n    });\n  });\n\n  describe('.status', () => {\n    it(`should return \"non-initialized\" at the beginning`, async () => {\n      expect(aws.status).toBe('non-initialized');\n    });\n\n    it(`should return \"opening\" when connecting`, async () => {\n      aws.open();\n      socket.readyState = WebSocket.CONNECTING;\n      expect(aws.status).toBe('opening');\n    });\n\n    it(`should return \"open\" when opened`, async () => {\n      await connect();\n      expect(aws.status).toBe('open');\n    });\n\n    it(`should return \"closing\" when closing`, async () => {\n      aws.open();\n      socket.readyState = WebSocket.CLOSING;\n      expect(aws.status).toBe('closing');\n    });\n\n    it(`should return \"closed\" when closed`, async () => {\n      aws.open();\n      socket.readyState = WebSocket.CLOSED;\n      expect(aws.status).toBe('closed');\n    });\n  });\n\n  describe('.setEventCallback(type, event)', () => {\n    it('should set as many callbacks as you want', async () => {\n      const f1 = jest.fn();\n      const f2 = jest.fn();\n      aws.setEventCallback('foo', f1);\n      aws.setEventCallback('foo', f2);\n\n      await connect();\n      const someMessage = { type: 'foo' };\n      socket.mockMessage(someMessage);\n\n      expect(f1).toHaveBeenCalledWith(someMessage);\n      expect(f2).toHaveBeenCalledWith(someMessage);\n    });\n  });\n\n  describe('.rejectAll()', () => {\n    it(`should throw error for all pending promises`, async () => {\n      await connect();\n      const message1 = aws.send(generateRequest(0, 'invoke'));\n      const message2 = aws.send(generateRequest(1, 'currentStatus', false));\n\n      aws.rejectAll(anError('TestError'));\n      await expect(message1).rejects.toThrow(/TestError/);\n      await expect(message2).rejects.toThrow(/TestError/);\n    });\n  });\n\n  describe('.resetInFlightPromises', () => {\n    it(`should reset all pending promises`, async () => {\n      await connect();\n      aws.send(generateRequest(1, 'currentStatus', false));\n      aws.send(generateRequest(2, 'currentStatus', false));\n\n      expect(_.size(aws.inFlightPromises)).toBe(2);\n\n      aws.resetInFlightPromises();\n\n      expect(_.size(aws.inFlightPromises)).toBe(0);\n    });\n\n    it(`should handle late responses to aborted in-flight requests`, async () => {\n      await connect();\n      aws.send(generateRequest(1));\n      aws.resetInFlightPromises();\n\n      socket.mockMessage({ type: 'someReply', messageId: 1 });\n      expect(log.debug).toHaveBeenCalledWith({ messageId: 1 }, 'late response');\n    });\n  });\n\n  describe('pending interactions', () => {\n    beforeEach(async () => {\n      await connect();\n    });\n\n    const multipleInteractionsWarning = 'Detox has detected multiple interactions taking place simultaneously. ' +\n      'Have you forgotten to apply an await over one of the Detox actions in your test code?';\n\n    it('should throw on multiple pending requests that cannot be concurrent', async () => {\n      const response1 = aws.send(generateRequest(1, 'invoke'));\n      const response2 = aws.send(generateRequest(2, 'currentStatus', false));\n      const response3 = aws.send(generateRequest(3, 'invoke'));\n\n      socket.mockMessage(generateResponse('invokeDone', 1));\n      socket.mockMessage(generateResponse('currentStatusDone', 2));\n      socket.mockMessage(generateResponse('invokeDone', 3));\n\n      await expect(response1).rejects.toThrow(multipleInteractionsWarning);\n      await expect(response2).resolves.not.toThrow();\n      await expect(response3).rejects.toThrow(multipleInteractionsWarning);\n    });\n\n    it('should not throw on multiple pending requests that be concurrent', async () => {\n      const response1 = aws.send(generateRequest(1, 'invoke'));\n      const response2 = aws.send(generateRequest(2, 'currentStatus', false));\n      const response3 = aws.send(generateRequest(3, 'currentStatus', false));\n\n      socket.mockMessage(generateResponse('invokeDone', 1));\n      socket.mockMessage(generateResponse('currentStatusDone', 2));\n      socket.mockMessage(generateResponse('currentStatusDone', 3));\n\n      await expect(response1).resolves.not.toThrow();\n      await expect(response2).resolves.not.toThrow();\n      await expect(response3).resolves.not.toThrow();\n    });\n  });\n\n  describe('edge cases', () => {\n    it('should close normally even when \"close\" comes from the event, not our intent', async () => {\n      await connect();\n      expect(aws.isOpen).toBe(true);\n      await socket.mockClose();\n      expect(aws.isOpen).toBe(false);\n    });\n\n    it('should elaborate about null-like messages', async () => {\n      await connect();\n\n      const response = aws.send(generateRequest());\n      socket.onmessage({ data: null });\n\n      const error = await response.then(() => {\n        throw new Error('Assertion: the call should have failed');\n      }, _.identity);\n      delete error.stack;\n      expect(error).toMatchSnapshot();\n    });\n\n    it('should throw on unexpected message types by default', async () => {\n      await connect();\n\n      const response = aws.send(generateRequest());\n      socket.mockMessage({ type: 'unknownMessageType', messageId: 999 });\n\n      await expect(response).rejects.toThrow('Unexpected message received over the web socket: unknownMessageType');\n    });\n\n    it('should log warning instead of throwing when ignoreUnexpectedMessages is enabled via options', async () => {\n      aws = new AsyncWebSocket({ url: config.server, ignoreUnexpectedMessages: true });\n      await connect();\n\n      socket.mockMessage({ type: 'unknownMessageType', messageId: 999 });\n\n      expect(log.warn).toHaveBeenCalledWith(\n        { messageId: 999, type: 'unknownMessageType' },\n        'Unexpected message received over the web socket: unknownMessageType (ignored due to configuration)'\n      );\n    });\n\n    it('should still log debug for late responses when ignoreUnexpectedMessages is enabled', async () => {\n      aws = new AsyncWebSocket({ url: config.server, ignoreUnexpectedMessages: true });\n      await connect();\n      aws.send(generateRequest(1));\n      aws.resetInFlightPromises();\n\n      socket.mockMessage({ type: 'someReply', messageId: 1 });\n      \n      expect(log.debug).toHaveBeenCalledWith({ messageId: 1 }, 'late response');\n      expect(log.warn).not.toHaveBeenCalled();\n    });\n  });\n\n  function connect() {\n    return Promise.race([\n      aws.open(),\n      new Promise(() => { socket.mockOpen(); }),\n    ]);\n  }\n\n\n  function generateRequest(messageId, type = 'invoke', isAtomic = true) {\n    return {\n      type,\n      message: 'a message',\n      messageId,\n      timeout: 0,\n      isAtomic,\n    };\n  }\n\n  function generateResponse(message, messageId) {\n    return {\n      type: message,\n      response: message,\n      messageId: messageId\n    };\n  }\n\n  function anError(msg = 'TestError') {\n    const err = new Error(msg);\n    delete err.stack;\n    return err;\n  }\n});\n"
  },
  {
    "path": "detox/src/client/Client.js",
    "content": "// @ts-nocheck\nconst util = require('util');\n\nconst _ = require('lodash');\nconst { deserializeError } = require('serialize-error');\n\nconst DetoxInternalError = require('../errors/DetoxInternalError');\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst failedToReachTheApp = require('../errors/longreads/failedToReachTheApp');\nconst Deferred = require('../utils/Deferred');\nconst { asError, createErrorWithUserStack, replaceErrorStack } = require('../utils/errorUtils');\nconst log = require('../utils/logger').child({ cat: 'ws-client,ws' });\n\nconst AsyncWebSocket = require('./AsyncWebSocket');\nconst actions = require('./actions/actions');\n\nclass Client {\n  /**\n   * @param {number} debugSynchronization\n   * @param {string} server\n   * @param {string} sessionId\n   * @param {boolean} [ignoreUnexpectedMessages]\n   */\n  constructor({ debugSynchronization, server, sessionId, ignoreUnexpectedMessages }) {\n    this._onAppConnected = this._onAppConnected.bind(this);\n    this._onAppReady = this._onAppReady.bind(this);\n    this._onAppUnresponsive = this._onAppUnresponsive.bind(this);\n    this._onBeforeAppCrash = this._onBeforeAppCrash.bind(this);\n    this._onAppDisconnected = this._onAppDisconnected.bind(this);\n    this._onUnhandledServerError = this._onUnhandledServerError.bind(this);\n    this._logError = this._logError.bind(this);\n\n    this._sessionId = sessionId;\n    this._slowInvocationTimeout = debugSynchronization;\n    this._slowInvocationStatusHandle = null;\n    this._whenAppIsConnected = this._invalidState('before connecting to the app');\n    this._whenAppIsReady = this._whenAppIsConnected;\n    this._whenAppDisconnected = Deferred.resolved();\n    this._isCleaningUp = false;\n    this._pendingAppCrash = null;\n    this._appTerminationHandle = null;\n\n    this._successfulTestRun = true; // flag for cleanup\n    this._asyncWebSocket = new AsyncWebSocket({ url: server, ignoreUnexpectedMessages });\n    this._serverUrl = server;\n\n    this.setEventCallback('appConnected', this._onAppConnected);\n    this.setEventCallback('ready', this._onAppReady);\n    this.setEventCallback('AppNonresponsiveDetected', this._onAppUnresponsive);\n    this.setEventCallback('AppWillTerminateWithError', this._onBeforeAppCrash);\n    this.setEventCallback('appDisconnected', this._onAppDisconnected);\n    this.setEventCallback('serverError', this._onUnhandledServerError);\n  }\n\n  /**\n   * Tells whether the DetoxManager (from native side) is connected to Detox server.\n   * In other words, if we can communicate with the app and send actions to it.\n   *\n   * @returns {boolean}\n   */\n  get isConnected() {\n    return this._asyncWebSocket.isOpen && this._whenAppIsConnected.isResolved();\n  }\n\n  get serverUrl() {\n    return this._serverUrl;\n  }\n\n  async open() {\n    return this._asyncWebSocket.open();\n  }\n\n  async connect() {\n    await this.open();\n    const sessionStatus = await this.sendAction(new actions.Login(this._sessionId));\n    if (sessionStatus.appConnected) {\n      this._onAppConnected();\n    }\n  }\n\n  async cleanup() {\n    this._isCleaningUp = true;\n    this._unscheduleSlowInvocationQuery();\n\n    try {\n      if (this.isConnected) {\n        await this.sendAction(new actions.Cleanup(this._successfulTestRun)).catch(this._logError);\n\n        this._whenAppIsConnected = this._invalidState('while cleaning up');\n        this._whenAppIsReady = this._whenAppIsConnected;\n      }\n    } finally {\n      await this._asyncWebSocket.close().catch(this._logError);\n    }\n\n    delete this.terminateApp; // property injection\n  }\n\n  setEventCallback(event, callback) {\n    this._asyncWebSocket.setEventCallback(event, callback);\n  }\n\n  dumpPendingRequests({ testName } = {}) {\n    if (this._whenAppIsConnected.isPending()) {\n      const unreachableError = failedToReachTheApp.evenThoughAppWasLaunched();\n      log.error({ event: 'APP_UNREACHABLE' }, DetoxRuntimeError.format(unreachableError) + '\\n\\n');\n    }\n\n    if (this._asyncWebSocket.hasPendingActions()) {\n      const messages = _.values(this._asyncWebSocket.inFlightPromises).map(p => p.message);\n      let dump = 'The app has not responded to the network requests below:';\n      for (const msg of messages) {\n        dump += `\\n  (id = ${msg.messageId}) ${msg.type}: ${JSON.stringify(msg.params)}`;\n      }\n\n      const notice = testName\n        ? `That might be the reason why the test \"${testName}\" has timed out.`\n        : `Unresponded network requests might result in timeout errors in Detox tests.`;\n\n      dump += `\\n\\n${notice}\\n`;\n      log.warn({ event: 'PENDING_REQUESTS' }, dump);\n    }\n\n    this._asyncWebSocket.resetInFlightPromises();\n  }\n\n  async execute(invocation) {\n    if (typeof invocation === 'function') {\n      invocation = invocation();\n    }\n\n    try {\n      return await this.sendAction(new actions.Invoke(invocation));\n    } catch (err) {\n      this._successfulTestRun = false;\n      throw err;\n    }\n  }\n\n  async sendAction(action) {\n    if (this._pendingAppCrash) {\n      throw this._pendingAppCrash;\n    }\n\n    const { shouldQueryStatus, ...options } = this._inferSendOptions(action);\n\n    return await (shouldQueryStatus\n      ? this._sendMonitoredAction(action, options)\n      : this._doSendAction(action, options));\n  }\n\n  _inferSendOptions(action) {\n    const timeout = action.timeout;\n    const shouldQueryStatus = timeout === 0;\n\n    return { shouldQueryStatus, timeout };\n  }\n\n  async _sendMonitoredAction(action, options) {\n    try {\n      this._scheduleSlowInvocationQuery();\n      return await this._doSendAction(action, options);\n    } finally {\n      this._unscheduleSlowInvocationQuery();\n    }\n  }\n\n  async _doSendAction(action, options) {\n    const errorWithUserStack = createErrorWithUserStack();\n\n    try {\n      const parsedResponse = await this._asyncWebSocket.send(action, options);\n      if (parsedResponse && parsedResponse.type === 'serverError') {\n        throw deserializeError(parsedResponse.params.error);\n      }\n\n      return await action.handle(parsedResponse);\n    } catch (err) {\n      throw replaceErrorStack(errorWithUserStack, asError(err));\n    }\n  }\n\n  async reloadReactNative() {\n    this._whenAppIsReady = new Deferred();\n    await this.sendAction(new actions.ReloadReactNative());\n    this._whenAppIsReady.resolve();\n  }\n\n  async waitUntilReady() {\n    if (!this._whenAppIsConnected.isResolved()) {\n      this._whenAppIsConnected = new Deferred();\n      this._whenAppIsReady = new Deferred();\n\n      await this._whenAppIsConnected.promise;\n      // TODO [2024-12-01]: optimize traffic (!) - we can just listen for 'ready' event\n      // if app always sends it upon load completion. On iOS it works,\n      // but not on Android. Afterwards, this will suffice:\n      //\n      // await this._whenAppIsReady.promise;\n    }\n\n    // TODO [2024-12-01]: move to else branch after the optimization ↑↑\n    if (!this._whenAppIsReady.isResolved()) {\n      this._whenAppIsReady = new Deferred();\n      await this.sendAction(new actions.Ready());\n      this._whenAppIsReady.resolve();\n    }\n  }\n\n  /** @async */\n  waitUntilDisconnected() {\n    return this._whenAppDisconnected.promise;\n  }\n\n  async waitForBackground() {\n    await this.sendAction(new actions.WaitForBackground());\n  }\n\n  async waitForActive() {\n    await this.sendAction(new actions.WaitForActive());\n  }\n\n  async captureViewHierarchy({ viewHierarchyURL }) {\n    return await this.sendAction(new actions.CaptureViewHierarchy({\n      viewHierarchyURL\n    }));\n  }\n\n  async generateViewHierarchyXml({ shouldInjectTestIds }) {\n    return await this.sendAction(new actions.GenerateViewHierarchyXml({\n      shouldInjectTestIds\n    }));\n  }\n\n  async currentStatus() {\n    return await this.sendAction(new actions.CurrentStatus());\n  }\n\n  async setSyncSettings(params) {\n    await this.sendAction(new actions.SetSyncSettings(params));\n  }\n\n  async shake() {\n    await this.sendAction(new actions.Shake());\n  }\n\n  async setOrientation(orientation) {\n    await this.sendAction(new actions.SetOrientation(orientation));\n  }\n\n  async startInstrumentsRecording({ recordingPath, samplingInterval }) {\n    await this.sendAction(new actions.SetInstrumentsRecordingState({\n      recordingPath, samplingInterval\n    }));\n  }\n\n  async stopInstrumentsRecording() {\n    await this.sendAction(new actions.SetInstrumentsRecordingState());\n  }\n\n  async deliverPayload(params) {\n    await this.sendAction(new actions.DeliverPayload(params));\n  }\n\n  async terminateApp() {\n    /* see the property injection from Detox.js */\n  }\n\n  _scheduleSlowInvocationQuery() {\n    if (this._slowInvocationTimeout > 0 && !this._isCleaningUp) {\n      this._slowInvocationStatusHandle = setTimeout(async () => {\n        let status;\n\n        try {\n          status = await this.currentStatus();\n          log.info({ event: 'APP_STATUS' }, status);\n        } catch (_e) {\n          log.debug({ event: 'APP_STATUS' }, 'Failed to execute the current status query.', _e);\n          this._slowInvocationStatusHandle = null;\n        }\n\n        if (status) {\n          this._scheduleSlowInvocationQuery();\n        }\n      }, this._slowInvocationTimeout);\n    } else {\n      this._slowInvocationStatusHandle = null;\n    }\n  }\n\n  _unscheduleSlowInvocationQuery() {\n    if (this._slowInvocationStatusHandle) {\n      clearTimeout(this._slowInvocationStatusHandle);\n      this._slowInvocationStatusHandle = null;\n    }\n  }\n\n  _scheduleAppTermination() {\n    this._appTerminationHandle = setTimeout(async () => {\n      try {\n        await this.terminateApp();\n      } catch (e) {\n        log.error({ event: 'ERROR' }, DetoxRuntimeError.format(e));\n      }\n    }, 5000);\n  }\n\n  _unscheduleAppTermination() {\n    if (this._appTerminationHandle) {\n      clearTimeout(this._appTerminationHandle);\n      this._appTerminationHandle = null;\n    }\n  }\n\n  _onAppConnected() {\n    this._pendingAppCrash = null;\n\n    if (this._whenAppIsConnected.isPending()) {\n      this._whenAppIsConnected.resolve();\n    } else {\n      this._whenAppIsConnected = Deferred.resolved();\n    }\n\n    this._whenAppDisconnected = new Deferred();\n  }\n\n  _onAppReady() {\n    this._whenAppIsReady.resolve();\n  }\n\n  _onAppUnresponsive({ params }) {\n    const message = [\n      'Application nonresponsiveness detected!',\n      'On Android, this could imply an ANR alert, which evidently causes tests to fail.',\n      'Here\\'s the native main-thread stacktrace from the device, to help you out (refer to device logs for the complete thread dump):',\n      params.threadDump,\n      'Refer to https://developer.android.com/training/articles/perf-anr for further details.'\n    ].join('\\n');\n\n    log.warn({ event: 'APP_NONRESPONSIVE' }, message);\n  }\n\n  _onBeforeAppCrash({ params }) {\n    if (this._pendingAppCrash) {\n      return;\n    }\n\n    this._pendingAppCrash = new DetoxRuntimeError({\n      message: 'The app has crashed, see the details below:',\n      debugInfo: params.errorDetails,\n    });\n\n    this._unscheduleSlowInvocationQuery();\n    this._whenAppIsConnected = this._invalidState('while the app is crashing');\n    this._whenAppIsReady = this._whenAppIsConnected;\n    this._scheduleAppTermination();\n  }\n\n  _onAppDisconnected() {\n    this._unscheduleSlowInvocationQuery();\n    this._unscheduleAppTermination();\n    this._whenAppIsConnected = this._invalidState('after the app has disconnected');\n    this._whenAppIsReady = this._whenAppIsConnected;\n\n    if (this._pendingAppCrash) {\n      this._whenAppDisconnected.reject(this._pendingAppCrash);\n      this._asyncWebSocket.rejectAll(this._pendingAppCrash);\n    } else if (this._asyncWebSocket.hasPendingActions()) {\n      const error = new DetoxRuntimeError('The app has unexpectedly disconnected from Detox server.');\n      this._asyncWebSocket.rejectAll(error);\n      this._whenAppDisconnected.resolve();\n    } else {\n      this._whenAppDisconnected.resolve();\n    }\n  }\n\n  _onUnhandledServerError(message) {\n    const { params } = message;\n    if (!params || !params.error) {\n      const err = new DetoxInternalError('Received an empty error message from Detox Server:\\n' + util.inspect(message));\n      log.error({ event: 'ERROR' }, err.toString());\n    } else {\n      log.error({ event: 'ERROR' }, deserializeError(params.error).message);\n    }\n  }\n\n  _invalidState(state) {\n    return Deferred.rejected(\n      new DetoxInternalError(`Detected an attempt to interact with Detox Client ${state}.`)\n    );\n  }\n\n  _logError(e) {\n    log.error({ event: 'ERROR' }, DetoxRuntimeError.format(e));\n  }\n}\n\nmodule.exports = Client;\n"
  },
  {
    "path": "detox/src/client/Client.test.js",
    "content": "// @ts-nocheck\njest.useFakeTimers('modern');\n\nconst { serializeError } = require('serialize-error');\n\n\nconst { validSession } = require('../configuration/configurations.mock');\nconst Deferred = require('../utils/Deferred');\nconst tempfile = require('../utils/tempfile');\n\nconst actions = require('./actions/actions');\n\ndescribe('Client', () => {\n  let log;\n  let sessionConfig;\n  let Client;\n  /** @type {Client} */\n  let client;\n  /** @type {AsyncWebSocket} */\n  let mockAws;\n  let DetoxRuntimeError;\n  let DetoxInternalError;\n\n  beforeEach(() => {\n    jest.clearAllTimers();\n    sessionConfig = { ...validSession };\n\n    jest.mock('../utils/logger');\n    log = require('../utils/logger');\n    log._level.mockReturnValue('debug');\n\n    const AsyncWebSocket = jest.createMockFromModule('./AsyncWebSocket');\n    mockAws = new AsyncWebSocket();\n    mockAws.isOpen = false;\n    mockAws.__appConnected = true;\n    mockAws.open.mockImplementation(async () => {\n      mockAws.isOpen = true;\n      for (const [type, params] of mockAws._responseQueue) {\n        mockAws.mockResponse(type, params);\n      }\n\n      mockAws.mockResponse('loginSuccess', {\n        testerConnected: true,\n        appConnected: mockAws.__appConnected,\n      });\n    });\n\n    mockAws.close.mockImplementation(async () => {\n\n    });\n\n    mockAws.mockBusy = () => {\n      const deferred = new Deferred();\n      mockAws.send.mockImplementationOnce(() => deferred.promise);\n      return deferred;\n    };\n\n    mockAws.mockResponse = (type, params) => {\n      mockAws.send.mockResolvedValueOnce({ type, params });\n    };\n\n    mockAws._responseQueue = [];\n    mockAws.mockResponseAfterOpen = (type, params) => {\n      mockAws._responseQueue.push([type, params]);\n    };\n\n    mockAws.mockSyncError = (message) => {\n      mockAws.send.mockImplementation(() => {\n        throw new Error(message);\n      });\n    };\n\n    const mockEvents = {};\n    mockAws.setEventCallback.mockImplementation((eventType, handler) => {\n      mockEvents[eventType] = mockEvents[eventType] || [];\n      mockEvents[eventType].push(handler);\n    });\n\n    mockAws.mockEventCallback = (eventType, ...args) => {\n      const handlers = mockEvents[eventType] || [];\n      for (const handler of handlers) {\n        handler(...args);\n      }\n    };\n\n    jest.mock('./AsyncWebSocket', () => {\n      return class FakeAsyncWebSocket {\n        constructor() {\n          return mockAws;\n        }\n      };\n    });\n\n    Client = require('./Client');\n    client = new Client(sessionConfig);\n    ({ DetoxInternalError, DetoxRuntimeError } = require('../errors'));\n  });\n\n  describe('.isConnected', () => {\n    it('should be false if the web socket is closed', () => {\n      mockAws.isOpen = false;\n      expect(client.isConnected).toBe(false);\n    });\n\n    it('should be false if the web socket is closed although app has sent the \"appConnected\" message previously', () => {\n      mockAws.isOpen = true;\n      mockAws.mockEventCallback('appConnected');\n      mockAws.isOpen = false;\n\n      expect(client.isConnected).toBe(false);\n    });\n\n    it('should be false if the server has not sent the \"appConnected\" message', () => {\n      mockAws.isOpen = true;\n      expect(client.isConnected).toBe(false);\n    });\n\n    it('should be true if the web socket is open and the server has sent \"appConnected\" message', () => {\n      expect(client.isConnected).toBe(false);\n      mockAws.isOpen = true;\n      mockAws.mockEventCallback('appConnected');\n      expect(client.isConnected).toBe(true);\n    });\n  });\n\n  describe('.serverUrl', () => {\n    it('should return sessionConfig.server', () => {\n      expect(client.serverUrl).toBe(sessionConfig.server);\n    });\n  });\n\n  describe('.open()', () => {\n    it('should open the web socket', async () => {\n      mockAws.mockResponse('loginSuccess', {});\n      expect(mockAws.open).not.toHaveBeenCalled();\n      await client.open();\n      expect(mockAws.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('.connect()', () => {\n    it('should open the web socket', async () => {\n      mockAws.mockResponse('loginSuccess', {});\n      expect(mockAws.open).not.toHaveBeenCalled();\n      await client.connect();\n      expect(mockAws.open).toHaveBeenCalled();\n    });\n\n    it('should send \"login\" action', async () => {\n      mockAws.mockResponse('loginSuccess', {});\n      expect(mockAws.send).not.toHaveBeenCalled();\n      await client.connect();\n      expect(mockAws.send).toHaveBeenCalledWith(new actions.Login(validSession.sessionId), SEND_OPTIONS.TIMED_SHORT);\n    });\n\n    it('should not consider itself connected to the app if \"loginSuccess\" params.appConnected = false', async () => {\n      mockAws.__appConnected = false;\n      await client.connect();\n      expect(client.isConnected).toBe(false);\n    });\n\n    it('should consider itself connected to the app if \"loginSuccess\" params.appConnected = true', async () => {\n      mockAws.__appConnected = true;\n      await client.connect();\n      expect(client.isConnected).toBe(true);\n    });\n\n    it('should not schedule \"currentStatus\" query for the \"login\" action', async () => {\n      mockAws.mockBusy();\n      client.connect();\n      await Promise.resolve();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n  });\n\n  describe('.sendAction()', () => {\n\n    class ActionWithoutParams extends actions.Action {\n      constructor() {\n        super('ActionWithoutParams');\n      }\n\n      async handle(response) {\n        this.expectResponseOfType(response, 'ActionWithoutParams');\n      }\n    }\n\n    beforeEach(async () => {\n      await client.connect();\n    });\n\n    it('should throw error for actions without isAtomic', async () => {\n      const withoutConcurrent = new ActionWithoutParams();\n      await expect(() => !withoutConcurrent.isAtomic).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error for actions without timeout', async () => {\n      const withoutTimeout = new ActionWithoutParams();\n      await expect(() => withoutTimeout.timeout).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should not throw .isAtomic getter errors for exported actions', () => {\n      for (const ActionClass of Object.values(actions)) {\n        if (ActionClass !== actions.Action && ActionClass.prototype instanceof actions.Action) {\n          expect(() => ActionClass.prototype.isAtomic).not.toThrow();\n        }\n      }\n    });\n\n    it('should not throw .timeout getter errors for exported actions', () => {\n      for (const ActionClass of Object.values(actions)) {\n        if (ActionClass !== actions.Action && ActionClass.prototype instanceof actions.Action) {\n          expect(() => ActionClass.prototype.timeout).not.toThrow();\n        }\n      }\n    });\n\n    it('should return value for isAtomic', async () => {\n      const withoutConcurrent = new actions.ReloadReactNative();\n      await expect(withoutConcurrent.isAtomic).toBe(false);\n    });\n\n    it('should return value for timeout', async () => {\n      const withoutTimeout = new actions.Login(123);\n      await expect(withoutTimeout.timeout).toEqual(1000);\n    });\n\n    it('should schedule \"currentStatus\" query when it takes too long', async () => {\n      const { action } = await simulateInFlightAction();\n      expect(mockAws.send).toHaveBeenCalledWith(action, SEND_OPTIONS.DEFAULT);\n      expect(mockAws.send).toHaveBeenCalledTimes(2); // action + login\n\n      mockAws.mockBusy(); // for the current status query\n      jest.advanceTimersByTime(validSession.debugSynchronization);\n      await fastForwardAllPromises();\n\n      expect(mockAws.send).toHaveBeenCalledWith(new actions.CurrentStatus(), SEND_OPTIONS.TIMED);\n      expect(jest.getTimerCount()).toBe(0); // should not spam with \"currentStatus\" queries\n    });\n\n    it('should not schedule \"currentStatus\" query if config.debugSynchronization = 0', async () => {\n      client = new Client({\n        ...sessionConfig,\n        debugSynchronization: 0,\n      });\n\n      await client.connect();\n      await simulateInFlightAction();\n\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should consistently run \"currentStatus\" queries when it takes too long', async () => {\n      await simulateInFlightAction();\n\n      mockAws.mockResponse('currentStatusResult', { status: { app_status: 'idle' } });\n      jest.advanceTimersByTime(validSession.debugSynchronization);\n\n      expect(jest.getTimerCount()).toBe(0);\n      await fastForwardAllPromises();\n      expect(jest.getTimerCount()).toBe(1); // should schedule next \"currentStatus\"\n    });\n\n    it('should unschedule \"currentStatus\" query when there is a response', async () => {\n      const { deferred } = await simulateInFlightAction();\n\n      expect(jest.getTimerCount()).toBe(1);\n\n      deferred.resolve(JSON.stringify({ type: 'whateverDone' }));\n      await fastForwardAllPromises();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should unschedule \"currentStatus\" query when app suddenly disconnects', async () => {\n      await simulateInFlightAction();\n      expect(jest.getTimerCount()).toBe(1);\n      mockAws.mockEventCallback('appDisconnected');\n      jest.advanceTimersByTime(validSession.debugSynchronization);\n      await fastForwardAllPromises();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should unschedule \"currentStatus\" query when we eventually get an error', async () => {\n      const { deferred, sendPromise } = await simulateInFlightAction();\n      expect(jest.getTimerCount()).toBe(1);\n\n      deferred.reject(new Error());\n      await expect(sendPromise).rejects.toThrow();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should unschedule \"currentStatus\" query on unforeseen non-async errors', async () => {\n      mockAws.mockSyncError('Socket error');\n      await expect(client.sendAction(anAction())).rejects.toThrow('Socket error');\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should not spam with \"currentStatus\" queries when the previous currentStatus is not answered', async () => {\n      await simulateInFlightAction();\n      mockAws.mockBusy(); // for currentStatus\n      jest.advanceTimersByTime(validSession.debugSynchronization);\n      await fastForwardAllPromises();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should stop querying the \"currentStatus\" if the request completes badly', async () => {\n      const testError = new Error('GenericServerError');\n      await simulateInFlightAction();\n      mockAws.mockResponse('serverError', { error: serializeError(testError) }); // for currentStatus\n      jest.advanceTimersByTime(validSession.debugSynchronization);\n      await fastForwardAllPromises();\n\n      expect(log.debug).toHaveBeenCalledWith({ event: 'APP_STATUS' }, 'Failed to execute the current status query.', expect.any(Error));\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should rethrow generic \"serverError\" message from the server', async () => {\n      const testError = new Error('GenericServerError');\n      mockAws.mockResponse('serverError', { error: serializeError(testError) });\n\n      await expect(client.sendAction(anAction())).rejects.toThrow('GenericServerError');\n    });\n\n    it('should pass action to async web socket', async () => {\n      mockAws.mockResponse('whateverDone');\n      const action = anAction();\n      await client.sendAction(action);\n      expect(mockAws.send).toHaveBeenCalledWith(action, SEND_OPTIONS.DEFAULT);\n    });\n\n    it('should pass the parsed response to action.handle()', async () => {\n      const action = anAction();\n      const response = {\n        type: 'whateverDone',\n        params: {\n          foo: 'bar',\n        },\n      };\n      mockAws.mockResponse(response.type, response.params);\n      await client.sendAction(action);\n      expect(action.handle).toHaveBeenCalledWith(response);\n    });\n\n    it('should return the result from action.handle()', async () => {\n      const action = anAction();\n      action.handle.mockResolvedValue(42);\n\n      mockAws.mockResponse('whateverDone');\n      await expect(client.sendAction(action)).resolves.toBe(42);\n    });\n  });\n\n  describe('wrapper methods', () => {\n    describe.each([\n      ['reloadReactNative', 'ready', actions.ReloadReactNative],\n      ['deliverPayload', 'deliverPayloadDone', actions.DeliverPayload, { foo: 'bar' }],\n      ['setSyncSettings', 'setSyncSettingsDone', actions.SetSyncSettings, { foo: 'bar' }],\n      ['shake', 'shakeDeviceDone', actions.Shake],\n      ['setOrientation', 'setOrientationDone', actions.SetOrientation, 'portrait'],\n      ['startInstrumentsRecording', 'setRecordingStateDone', actions.SetInstrumentsRecordingState, { recordingPath: 'foo', samplingInterval: 500 }],\n      ['stopInstrumentsRecording', 'setRecordingStateDone', actions.SetInstrumentsRecordingState],\n      ['captureViewHierarchy', 'captureViewHierarchyDone', actions.CaptureViewHierarchy, { viewHierarchyURL: 'foo' }, {}],\n      ['waitForBackground', 'waitForBackgroundDone', actions.WaitForBackground],\n      ['waitForActive', 'waitForActiveDone', actions.WaitForActive],\n      ['waitUntilReady', 'ready', actions.Ready],\n      ['currentStatus', 'currentStatusResult', actions.CurrentStatus, {}, { status: { app_status: 'idle' } }],\n      ['generateViewHierarchyXml', 'generateViewHierarchyXmlResult', actions.GenerateViewHierarchyXml, { shouldInjectTestIds: false }, { viewHierarchy: 'mock-hierarchy' }]\n    ])('.%s', (methodName, expectedResponseType, Action, params, expectedResponseParams) => {\n      beforeEach(async () => {\n        await client.connect();\n      });\n\n      it(`should receive \"${expectedResponseType}\" from device and resolve`, async () => {\n        mockAws.mockResponse(expectedResponseType, expectedResponseParams);\n        await client[methodName](params);\n\n        const action = new Action(params);\n        expect(mockAws.send).toHaveBeenCalledWith(action, { timeout: expect.any(Number) });\n      });\n\n      it(`should throw on a wrong response from device`, async () => {\n        mockAws.mockResponse('boo');\n        await expect(client[methodName](params)).rejects.toThrow();\n      });\n    });\n  });\n\n  describe('.waitUntilDisconnected()', () => {\n    it(`should be resolved before connecting to the app`, async () => {\n      const result = await Promise.race([client.waitUntilDisconnected(), Promise.resolve('pending')]);\n      expect(result).not.toBe('pending');\n    });\n\n    it(`should be pending after connecting to the app`, async () => {\n      await client.connect();\n      const result = await Promise.race([client.waitUntilDisconnected(), Promise.resolve('pending')]);\n      expect(result).toBe('pending');\n    });\n\n    it(`should be resolve after the app disconnects`, async () => {\n      await client.connect();\n      mockAws.mockEventCallback('appDisconnected', {});\n      const result = await Promise.race([client.waitUntilDisconnected(), Promise.resolve('pending')]);\n      expect(result).not.toBe('pending');\n    });\n  });\n\n  describe('.captureViewHierarchy()', () => {\n    beforeEach(async () => {\n      await client.connect();\n    });\n\n    it(`should throw an error if the response has \"captureViewHierarchyError\" in params`, async () => {\n      mockAws.mockResponse('captureViewHierarchyDone', {\n        captureViewHierarchyError: 'Test error to check',\n      });\n\n      const viewHierarchyURL = tempfile('.viewhierarchy');\n      await expect(client.captureViewHierarchy({ viewHierarchyURL })).rejects.toThrow(/Test error to check/m);\n    });\n  });\n\n  describe('.cleanup()', () => {\n    it('should cancel \"currentStatus\" query', async () => {\n      await simulateInFlightAction();\n      expect(jest.getTimerCount()).toBe(1);\n\n      await client.cleanup();\n      expect(jest.getTimerCount()).toBe(0);\n    });\n\n    it('should not send cleanup action if it is not connected to the app', async () => {\n      await client.cleanup();\n      expect(mockAws.send).not.toHaveBeenCalled();\n    });\n\n    it('should not send cleanup action if the app is crashing', async () => {\n      await client.connect();\n      mockAws.send.mockReset();\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: new Error() }\n      });\n\n      await client.cleanup();\n      expect(mockAws.send).not.toHaveBeenCalled();\n    });\n\n    it('should send cleanup action to the app', async () => {\n      await client.connect();\n      mockAws.mockResponse('cleanupDone');\n      await client.cleanup();\n      expect(mockAws.send).toHaveBeenCalledWith(new actions.Cleanup(true), SEND_OPTIONS.TIMED);\n    });\n\n    it('should send cleanup action (stopRunner=false) to the app if there were failed invocations', async () => {\n      await client.connect();\n      mockAws.mockResponse('testFailed', { details: 'SomeDetails' });\n      await expect(client.execute(anInvocation)).rejects.toThrow(/Test Failed.*SomeDetails/);\n      mockAws.mockResponse('cleanupDone');\n      await client.cleanup();\n      expect(mockAws.send).toHaveBeenCalledWith(new actions.Cleanup(false), SEND_OPTIONS.TIMED);\n    });\n\n    it('should close the websocket upon \"cleanupDone\" from the app', async () => {\n      await client.connect();\n      mockAws.mockResponse('cleanupDone');\n      await client.cleanup();\n      expect(mockAws.close).toHaveBeenCalled();\n    });\n\n    it('should close the websocket even if getting \"cleanupDone\" fails', async () => {\n      await client.connect();\n      mockAws.mockResponse('serverError');\n      await client.cleanup();\n      expect(mockAws.close).toHaveBeenCalled();\n    });\n\n    it('should close the websocket even on an inner error', async () => {\n      await client.connect();\n      mockAws.mockSyncError('MyError');\n      await client.cleanup();\n      expect(mockAws.close).toHaveBeenCalled();\n      expect(log.error).toHaveBeenCalledWith({ event: 'ERROR' }, expect.stringContaining('MyError'));\n    });\n\n    it('should not bail even if the world is crashing, instead it should log errors and exit calmly', async () => {\n      await client.connect();\n\n      mockAws.send.mockRejectedValue('MyError1');\n      mockAws.close.mockRejectedValue('MyError2');\n\n      await client.cleanup();\n\n      expect(mockAws.close).toHaveBeenCalled();\n      expect(log.error).toHaveBeenCalledWith({ event: 'ERROR' }, expect.stringContaining('MyError1'));\n      expect(log.error).toHaveBeenCalledWith({ event: 'ERROR' }, expect.stringContaining('MyError2'));\n    });\n\n    it('should delete the injected .terminateApp method', async () => {\n      const injected = client.terminateApp = jest.fn();\n      await client.cleanup();\n      expect(client.terminateApp).not.toBe(injected);\n    });\n  });\n\n  describe('.execute()', () => {\n    beforeEach(async () => {\n      await client.connect();\n    });\n\n    test(`\"invokeResult\" on an invocation object should return invokeResult`, async () => {\n      mockAws.mockResponse('invokeResult', { result: 'some_result' });\n      const invokeObject = anInvocation();\n      const invokeResult = await client.execute(invokeObject);\n      expect(invokeResult).toEqual({ result: 'some_result' });\n    });\n\n    test(`\"invokeResult\" on an invocation function should resolve`, async () => {\n      mockAws.mockResponse('invokeResult', { result: 'some_result' });\n      const invokeResult = await client.execute(anInvocation);\n      expect(invokeResult).toEqual({ result: 'some_result' });\n    });\n\n    it.each([\n      ['debug'],\n      ['trace'],\n    ])(`should throw \"testFailed\" error with view hierarchy (on --loglevel %s)`, async (loglevel) => {\n      log._level.mockReturnValue(loglevel);\n      mockAws.mockResponse('testFailed',  { details: 'this is an error', viewHierarchy: 'mock-hierarchy' });\n      await expect(client.execute(anInvocation)).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it.each([\n      ['error'],\n      ['warn'],\n      ['info'],\n    ])(`should throw \"testFailed\" error without view hierarchy but with a hint (on --loglevel %s)`, async (loglevel) => {\n      log._level.mockReturnValue(loglevel);\n      mockAws.mockResponse('testFailed',  { details: 'this is an error', viewHierarchy: 'mock-hierarchy' });\n      const executionPromise = client.execute(anInvocation);\n      await expect(executionPromise).rejects.toThrowErrorMatchingSnapshot();\n      await expect(executionPromise).rejects.toThrow(DetoxRuntimeError);\n    });\n\n    it(`should throw \"testFailed\" error even if it has no a view hierarchy`, async () => {\n      mockAws.mockResponse('testFailed',  { details: 'this is an error', viewHierarchy: undefined });\n\n      const executionPromise = client.execute(anInvocation);\n      await expect(executionPromise).rejects.toThrowErrorMatchingSnapshot();\n      await expect(executionPromise).rejects.toThrow(DetoxRuntimeError);\n    });\n\n    it(`should rethrow an \"error\" result`, async () => {\n      mockAws.mockResponse('error',  { error: 'this is an error' });\n      const executionPromise = client.execute(anInvocation);\n      await expect(executionPromise).rejects.toThrowErrorMatchingSnapshot();\n      await expect(executionPromise).rejects.toThrow(DetoxRuntimeError);\n    });\n\n    it(`should throw even if a non-error object is thrown`, async () => {\n      mockAws.send.mockRejectedValueOnce('non-error');\n      await expect(client.execute(anInvocation)).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it(`should throw on an unsupported result`, async () => {\n      mockAws.mockResponse('unsupportedResult',  { foo: 'bar' });\n      const executionPromise = client.execute(anInvocation);\n      await expect(executionPromise).rejects.toThrowErrorMatchingSnapshot();\n      await expect(executionPromise).rejects.toThrow(DetoxInternalError);\n    });\n  });\n\n  describe('.dumpPendingRequests()', () => {\n    beforeEach(async () => {\n      await client.connect();\n    });\n\n    describe('if there was a prior unsuccessful attempt to launch the app launch', () => {\n      beforeEach(async () => {\n        mockAws.mockEventCallback('appDisconnected');\n        client.waitUntilReady();\n      });\n\n      it(`should log an error about the app being unreachable over web sockets`, async () => {\n        await client.dumpPendingRequests();\n        expect(log.error.mock.calls[0][0]).toEqual({ event: 'APP_UNREACHABLE' });\n        expect(log.error.mock.calls[0][1]).toMatch(/Detox can't seem to connect to the test app./);\n      });\n    });\n\n    it(`should not dump if there are no pending requests`, async () => {\n      client.dumpPendingRequests();\n      expect(log.warn).not.toHaveBeenCalled();\n    });\n\n    it(`should not dump if there are only currentStatus requests (debug-synchronization)`, async () => {\n      const currentStatus = new Deferred();\n      currentStatus.message = new actions.CurrentStatus();\n      mockAws.inFlightPromises = { 1: currentStatus };\n\n      client.dumpPendingRequests();\n      expect(log.warn).not.toHaveBeenCalled();\n    });\n\n    describe('if there are pending requests -', () => {\n      beforeEach(async () => {\n        const stuckRequest = new Deferred();\n        stuckRequest.message = new actions.ReloadReactNative();\n\n        mockAws.hasPendingActions.mockReturnValue(true);\n        mockAws.inFlightPromises = {\n          [stuckRequest.message.messageId]: stuckRequest\n        };\n      });\n\n      it(`should dump generic message if not testName is specified`, async () => {\n        client.dumpPendingRequests();\n        expect(log.warn.mock.calls[0][0]).toEqual({ event: 'PENDING_REQUESTS' });\n        expect(log.warn.mock.calls[0][1]).toMatch(/Unresponded network requests/);\n      });\n\n      it(`should dump specific message if testName is specified`, async () => {\n        client.dumpPendingRequests({ testName: 'Login screen should log in' });\n        expect(log.warn.mock.calls[0][0]).toEqual({ event: 'PENDING_REQUESTS' });\n        expect(log.warn.mock.calls[0][1]).toMatch(/Login screen should log in/);\n      });\n\n      it(`should reset in flight promises`, async () => {\n        expect(mockAws.resetInFlightPromises).not.toHaveBeenCalled();\n        client.dumpPendingRequests();\n        expect(mockAws.resetInFlightPromises).toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('on AppNonresponsiveDetected', () => {\n    it('should log a warning', () => {\n      mockAws.mockEventCallback('AppNonresponsiveDetected', {\n        params: { threadDump: 'THREAD_DUMP' }\n      });\n\n      expect(log.warn).toHaveBeenCalledWith({ event: 'APP_NONRESPONSIVE' }, expect.stringContaining('THREAD_DUMP'));\n      expect(log.warn.mock.calls[0][1]).toMatchSnapshot();\n    });\n  });\n\n  describe('.waitUntilReady()', () => {\n    it('should wait until connected, then send Ready action', async () => {\n      let isReady = false;\n      client.waitUntilReady().then(() => { isReady = true; });\n\n      await fastForwardAllPromises();\n      expect(isReady).toBe(false);\n      expect(mockAws.send).not.toHaveBeenCalled();\n\n      mockAws.__appConnected = false;\n      await client.connect();\n      mockAws.mockEventCallback('appConnected');\n      mockAws.mockResponse('ready');\n      await fastForwardAllPromises();\n      expect(mockAws.send).toHaveBeenCalledWith(new actions.Ready(), SEND_OPTIONS.DEFAULT);\n      expect(isReady).toBe(true);\n    });\n\n    it('should wait until connected and ready, if the app sends ready status beforehand', async () => {\n      let isReady = false;\n      client.waitUntilReady().then(() => { isReady = true; });\n\n      mockAws.mockEventCallback('ready');\n      await fastForwardAllPromises();\n      expect(isReady).toBe(false);\n\n      await client.connect();\n      await fastForwardAllPromises();\n      expect(isReady).toBe(true);\n      expect(mockAws.send).not.toHaveBeenCalledWith(new actions.Ready(), expect.anything());\n    });\n  });\n\n  describe('on AppWillTerminateWithError', () => {\n    it('should schedule the app termination in 5 seconds, and reject pending', async () => {\n      jest.spyOn(client, 'terminateApp');\n\n      await client.connect();\n\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: 'SIGSEGV whatever' },\n      });\n      expect(client.terminateApp).not.toHaveBeenCalled();\n      expect(mockAws.rejectAll).not.toHaveBeenCalled();\n\n      jest.advanceTimersByTime(5000);\n      await fastForwardAllPromises();\n      expect(client.terminateApp).toHaveBeenCalled();\n      expect(mockAws.rejectAll).not.toHaveBeenCalled();\n\n      mockAws.mockEventCallback('appDisconnected');\n      expect(mockAws.rejectAll.mock.calls[0][0]).toMatchSnapshot();\n      expect(log.error).not.toHaveBeenCalled();\n    });\n\n    describe('after app exits', () => {\n      beforeEach(async () => {\n        jest.spyOn(client, 'terminateApp');\n\n        await client.connect();\n\n        mockAws.mockEventCallback('AppWillTerminateWithError', {\n          params: { errorDetails: 'SIGSEGV whatever' },\n        });\n\n        jest.advanceTimersByTime(5000);\n        await fastForwardAllPromises();\n        mockAws.mockEventCallback('appDisconnected');\n        await fastForwardAllPromises();\n      });\n\n      it('should reject pending and future requests', async () => {\n        // any future requests should be rejected\n        mockAws.mockResponse('invokeResult', { result: 'some_result' });\n        await expect(client.sendAction(new actions.Invoke(anInvocation()))).rejects.toThrow('SIGSEGV whatever');\n\n        // pending requests should be rejected\n        await expect(client.waitUntilDisconnected()).rejects.toThrow('SIGSEGV whatever');\n      });\n\n      it('should allow new requests after the app reconnects', async () => {\n        mockAws.mockEventCallback('appConnected');\n        mockAws.mockResponse('invokeResult', { result: 'some_result' });\n        await expect(client.sendAction(new actions.Invoke(anInvocation()))).resolves.not.toThrow();\n      });\n    });\n\n    it('should log errors if the app termination does not go well', async () => {\n      jest.spyOn(client, 'terminateApp');\n      client.terminateApp.mockImplementation(() => {\n        throw new Error('TestError');\n      });\n\n      await client.connect();\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: 'SIGSEGV whatever' },\n      });\n\n      jest.advanceTimersByTime(5000);\n      await fastForwardAllPromises();\n\n      expect(client.terminateApp).toHaveBeenCalled();\n      expect(log.error).toHaveBeenCalledWith({ event: 'ERROR' }, expect.stringContaining('TestError'));\n    });\n\n    it('should unschedule the app termination if it disconnects earlier', async () => {\n      jest.spyOn(client, 'terminateApp');\n\n      await client.connect();\n\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: 'SIGSEGV whatever' },\n      });\n      mockAws.mockEventCallback('appDisconnected');\n\n      expect(client.terminateApp).not.toHaveBeenCalled();\n      expect(mockAws.rejectAll.mock.calls[0][0]).toMatchSnapshot();\n\n      jest.advanceTimersByTime(5000);\n      await fastForwardAllPromises();\n\n      expect(client.terminateApp).not.toHaveBeenCalled();\n    });\n\n    it('should ignore consequent AppWillTerminateWithError notifications', async () => {\n      jest.spyOn(client, 'terminateApp');\n\n      await client.connect();\n\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: 'SIGSEGV whatever' },\n      });\n      mockAws.mockEventCallback('AppWillTerminateWithError', {\n        params: { errorDetails: 'collateral damage' },\n      });\n\n      jest.advanceTimersByTime(5000);\n      await fastForwardAllPromises();\n\n      expect(client.terminateApp).toHaveBeenCalledTimes(1);\n\n      mockAws.mockEventCallback('appDisconnected');\n      await expect(client.waitUntilDisconnected()).rejects.toThrow('SIGSEGV whatever');\n    });\n  });\n\n  describe('on appDisconnected', () => {\n    it('should reject pending actions', async () => {\n      await client.connect();\n      await simulateInFlightAction(new actions.Invoke(anInvocation()));\n      mockAws.mockEventCallback('appDisconnected');\n      await fastForwardAllPromises();\n      expect(mockAws.rejectAll).toHaveBeenCalled();\n    });\n\n    it('should return .isConnected = false', async () => {\n      await client.connect();\n      expect(client.isConnected).toBe(true);\n      mockAws.mockEventCallback('appDisconnected');\n      await fastForwardAllPromises();\n      expect(client.isConnected).toBe(false);\n    });\n  });\n\n  describe('on unhandled serverError', () => {\n    beforeEach(async () => client.connect());\n\n    it('should log an error', async () => {\n      const testError = new Error('TEST ERROR');\n      mockAws.mockEventCallback('serverError', {\n        params: {\n          error: serializeError(testError)\n        },\n      });\n\n      expect(log.error.mock.calls[0][1]).toMatchSnapshot();\n    });\n\n    it('should log a fallback error if the details were empty', async () => {\n      mockAws.mockEventCallback('serverError', { somethingElse: 0 });\n      expect(log.error.mock.calls[0][1]).toMatchSnapshot();\n      mockAws.mockEventCallback('serverError', { somethingElse: 0, params: {} });\n      expect(log.error.mock.calls[1][1]).toMatchSnapshot();\n    });\n  });\n\n  function anAction(overrides) {\n    return {\n      type: 'whatever',\n      params: {},\n      handle: jest.fn(),\n      get timeout() { return 0; },\n      get isAtomic() { return true; },\n      ...overrides,\n    };\n  }\n\n  function anInvocation() {\n    return {\n      type: 'SomeInvocation',\n    };\n  }\n\n  async function simulateInFlightAction(action = anAction()) {\n    const deferred = mockAws.mockBusy();\n    mockAws.hasPendingActions.mockReturnValue(true);\n\n    const sendPromise = client.sendAction(action);\n    await Promise.resolve();\n    return { sendPromise, action, deferred };\n  }\n\n  async function fastForwardAllPromises() {\n    for (let i = 0; i < 10; i++) {\n      await Promise.resolve();\n    }\n  }\n\n  const SEND_OPTIONS = {\n    DEFAULT: { timeout: 0 },\n    TIMED: { timeout: 5000 },\n    TIMED_SHORT: { timeout: 1000 }\n  };\n});\n"
  },
  {
    "path": "detox/src/client/InflightRequest.js",
    "content": "const DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst Deferred = require('../utils/Deferred');\n\nclass InflightRequest extends Deferred {\n  constructor(message) {\n    super();\n\n    this._timeoutHandle = null;\n    this.message = message;\n  }\n\n  resolve(value) {\n    this.clearTimeout();\n    return super.resolve(value);\n  }\n\n  reject(reason) {\n    this.clearTimeout();\n\n    const { messageId, type } = this.message;\n    return super.reject(new DetoxRuntimeError({\n      message: `The pending request #${messageId} (\"${type}\") has been rejected due to the following error:`,\n      debugInfo: reason,\n    }));\n  }\n\n  withTimeout(ms) {\n    if (ms > 0) {\n      this._timeoutHandle = setTimeout(() => {\n        this.reject(new DetoxRuntimeError({\n          message: `The tester has not received a response within ${ms}ms timeout to the message:`,\n          debugInfo: this.message,\n        }));\n      }, ms);\n    }\n\n    return this;\n  }\n\n  clearTimeout() {\n    if (this._timeoutHandle) {\n      clearTimeout(this._timeoutHandle);\n      this._timeoutHandle = null;\n    }\n\n    return this;\n  }\n}\n\nmodule.exports = InflightRequest;\n"
  },
  {
    "path": "detox/src/client/__mocks__/Client.js",
    "content": "const Deferred = require('../../utils/Deferred');\nconst FakeClient = jest.createMockFromModule('../Client');\n\nFakeClient.setInfiniteConnect = () => {\n  FakeClient.mockImplementationOnce(() => {\n    const client = new FakeClient();\n    client.deferred = new Deferred();\n    client.connect.mockReturnValue(client.deferred.promise);\n    client.cleanup.mockImplementation(() => {\n      client.deferred.reject(new Error('Fake error: aborted connection'));\n    });\n\n    return client;\n  });\n};\n\nmodule.exports = FakeClient;\n"
  },
  {
    "path": "detox/src/client/__snapshots__/AsyncWebSocket.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`AsyncWebSocket .close() should throw on a consequent attempt to close the socket 1`] = `\n\"Detected an attempt to close an already closing or closed web socket.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`AsyncWebSocket .close() should throw on a sync socket.close() error 1`] = `\n\"Failed to close a connection to the Detox server.\n\nError: TestError\"\n`;\n\nexports[`AsyncWebSocket .close() should throw on an emitted socket.close() error 1`] = `\n\"Failed to close a connection to the Detox server.\n\nError: TestError\"\n`;\n\nexports[`AsyncWebSocket .open() should reject if called twice sequentially 1`] = `\n\"Cannot open an already open web socket.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`AsyncWebSocket .open() should reject if called twice simultaneously 1`] = `\n\"Cannot open an already opening web socket.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`AsyncWebSocket .open() should reject on a constructor error 1`] = `\n\"Unexpected error occurred when opening a web socket connection.\nSee the error details below.\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\nError: TestError\"\n`;\n\nexports[`AsyncWebSocket .open() should reject on an error event 1`] = `\n\"Failed to open a connection to the Detox server.\n\nError: TestError\"\n`;\n\nexports[`AsyncWebSocket .send() should throw for a closed connection 1`] = `\n\"Cannot send a message over the closed web socket. See the payload below:\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'invoke',\n  message: 'a message',\n  messageId: undefined,\n  timeout: 0,\n  isAtomic: true\n}\"\n`;\n\nexports[`AsyncWebSocket .send() when opened should fail if the message timeout has expired 1`] = `\n\"The pending request #0 (\"invoke\") has been rejected due to the following error:\n\nThe tester has not received a response within 5000ms timeout to the message:\n\n{\n  type: 'invoke',\n  message: 'a message',\n  messageId: 0,\n  timeout: 0,\n  isAtomic: true\n}\"\n`;\n\nexports[`AsyncWebSocket .send() when opened should log an error if the incoming message was completely unexpected 1`] = `\n[DetoxRuntimeError: Unexpected error on an attempt to handle the response received over the web socket.\n\nHINT: Examine the inner error:\n\nUnexpected message received over the web socket: somethingElse\n\nThe payload was:\n\n{\"type\":\"somethingElse\"}]\n`;\n\nexports[`AsyncWebSocket .send() when opened should reject all messages in the flight if there's an error 1`] = `\n\"The pending request #0 (\"invoke\") has been rejected due to the following error:\n\nFailed to deliver the message to the Detox server:\n\nError: TestError\"\n`;\n\nexports[`AsyncWebSocket edge cases should elaborate about null-like messages 1`] = `\n[DetoxRuntimeError: The pending request #0 (\"invoke\") has been rejected due to the following error:\n\nUnexpected error on an attempt to handle the response received over the web socket.\n\nHINT: Examine the inner error:\n\nEmpty or non-typed message received over the web socket.\n\nThe payload was:\n\nnull]\n`;\n"
  },
  {
    "path": "detox/src/client/__snapshots__/Client.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Client .execute() should rethrow an \"error\" result 1`] = `\"this is an error\"`;\n\nexports[`Client .execute() should throw \"testFailed\" error even if it has no a view hierarchy 1`] = `\"Test Failed: this is an error\"`;\n\nexports[`Client .execute() should throw \"testFailed\" error with view hierarchy (on --loglevel debug) 1`] = `\n\"Test Failed: this is an error\n\nView Hierarchy:\nmock-hierarchy\"\n`;\n\nexports[`Client .execute() should throw \"testFailed\" error with view hierarchy (on --loglevel trace) 1`] = `\n\"Test Failed: this is an error\n\nView Hierarchy:\nmock-hierarchy\"\n`;\n\nexports[`Client .execute() should throw \"testFailed\" error without view hierarchy but with a hint (on --loglevel error) 1`] = `\n\"Test Failed: this is an error\n\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\"\n`;\n\nexports[`Client .execute() should throw \"testFailed\" error without view hierarchy but with a hint (on --loglevel info) 1`] = `\n\"Test Failed: this is an error\n\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\"\n`;\n\nexports[`Client .execute() should throw \"testFailed\" error without view hierarchy but with a hint (on --loglevel warn) 1`] = `\n\"Test Failed: this is an error\n\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\"\n`;\n\nexports[`Client .execute() should throw even if a non-error object is thrown 1`] = `\"non-error\"`;\n\nexports[`Client .execute() should throw on an unsupported result 1`] = `\n\"Tried to invoke an action on app, got an unsupported response: {\"type\":\"unsupportedResult\",\"params\":{\"foo\":\"bar\"}}\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Client .sendAction() should throw error for actions without isAtomic 1`] = `\n\"Action.prototype.isAtomic must be defined for ActionWithoutParams\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Client .sendAction() should throw error for actions without timeout 1`] = `\n\"Action.prototype.timeout getter must be defined for ActionWithoutParams\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Client on AppNonresponsiveDetected should log a warning 1`] = `\n\"Application nonresponsiveness detected!\nOn Android, this could imply an ANR alert, which evidently causes tests to fail.\nHere's the native main-thread stacktrace from the device, to help you out (refer to device logs for the complete thread dump):\nTHREAD_DUMP\nRefer to https://developer.android.com/training/articles/perf-anr for further details.\"\n`;\n\nexports[`Client on AppWillTerminateWithError should schedule the app termination in 5 seconds, and reject pending 1`] = `\n[DetoxRuntimeError: The app has crashed, see the details below:\n\nSIGSEGV whatever]\n`;\n\nexports[`Client on AppWillTerminateWithError should unschedule the app termination if it disconnects earlier 1`] = `\n[DetoxRuntimeError: The app has crashed, see the details below:\n\nSIGSEGV whatever]\n`;\n\nexports[`Client on unhandled serverError should log a fallback error if the details were empty 1`] = `\n\"DetoxInternalError: Received an empty error message from Detox Server:\n{ somethingElse: 0 }\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Client on unhandled serverError should log a fallback error if the details were empty 2`] = `\n\"DetoxInternalError: Received an empty error message from Detox Server:\n{ somethingElse: 0, params: {} }\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Client on unhandled serverError should log an error 1`] = `\"TEST ERROR\"`;\n"
  },
  {
    "path": "detox/src/client/actions/SyncStatusSchema.json",
    "content": "{\n  \"oneOf\":[\n    {\n      \"type\":\"object\",\n      \"properties\":{\n        \"app_status\":{\n          \"const\":\"idle\"\n        }\n      },\n      \"required\":[\n        \"app_status\"\n      ],\n      \"additionalProperties\":false\n    },\n    {\n      \"type\":\"object\",\n      \"properties\":{\n        \"app_status\":{\n          \"const\":\"busy\"\n        },\n        \"busy_resources\":{\n          \"type\":\"array\",\n          \"minItems\":1,\n          \"items\":{\n            \"type\":\"object\",\n            \"anyOf\":[\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"delayed_perform_selector\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"pending_selectors\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      }\n                    },\n                    \"required\":[\n                      \"pending_selectors\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"dispatch_queue\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"queue\":{\n                        \"type\":\"string\"\n                      },\n                      \"works_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      }\n                    },\n                    \"required\":[\n                      \"queue\",\n                      \"works_count\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"run_loop\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"name\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"required\":[\n                      \"name\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"one_time_events\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"event\":{\n                        \"type\":\"string\"\n                      },\n                      \"object\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"required\":[\n                      \"event\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"timers\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"timers\":{\n                        \"type\":\"array\",\n                        \"items\":{\n                          \"type\":\"object\",\n                          \"properties\":{\n                            \"fire_date\":{\n                              \"type\":\"string\"\n                            },\n                            \"time_until_fire\":{\n                              \"type\":\"number\"\n                            },\n                            \"repeat_interval\":{\n                              \"type\":\"number\"\n                            },\n                            \"is_recurring\":{\n                              \"type\":\"boolean\"\n                            }\n                          },\n                          \"required\":[\n                            \"fire_date\",\n                            \"time_until_fire\",\n                            \"repeat_interval\",\n                            \"is_recurring\"\n                          ],\n                          \"additionalProperties\":false\n                        },\n                        \"minItems\":1\n                      }\n                    },\n                    \"required\":[],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"ui\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"layer_animation_pending_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"layer_needs_display_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"layer_needs_layout_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"layer_pending_animation_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"view_animation_pending_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"view_controller_will_appear_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"view_controller_will_disappear_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"view_needs_display_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"view_needs_layout_count\":{\n                        \"type\":\"number\",\n                        \"minimum\":1\n                      },\n                      \"mount_items\":{\n                        \"type\":\"number\"\n                      },\n                      \"view_command_mount_items\":{\n                        \"type\":\"number\"\n                      },\n                      \"reason\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"bg\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"reason\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"network\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"urls\":{\n                        \"type\":\"array\",\n                        \"items\":{\n                          \"type\":\"string\"\n                        },\n                        \"minItems\":1\n                      }\n                    },\n                    \"required\":[\n                      \"urls\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"js_timers\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"timers\":{\n                        \"type\":\"array\",\n                        \"items\":{\n                          \"type\":\"object\",\n                          \"properties\":{\n                            \"timer_id\":{\n                              \"type\":\"number\"\n                            },\n                            \"duration\":{\n                              \"type\":\"number\"\n                            },\n                            \"elapsed\":{\n                              \"type\":\"number\"\n                            },\n                            \"is_recurring\":{\n                              \"type\":\"boolean\"\n                            }\n                          },\n                          \"required\":[\n                            \"timer_id\",\n                            \"duration\"\n                          ],\n                          \"additionalProperties\":false\n                        },\n                        \"minItems\":1\n                      }\n                    },\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"looper\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"thread\":{\n                        \"type\":\"string\"\n                      },\n                      \"execution_type\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"required\":[\n                      \"thread\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"io\"\n                  }\n                },\n                \"required\":[\n                  \"name\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"bridge\"\n                  }\n                },\n                \"required\":[\n                  \"name\"\n                ],\n                \"additionalProperties\":false\n              },\n              {\n                \"properties\": {\n                  \"name\": {\n                    \"const\": \"animation_updates\"\n                  },\n                  \"description\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"pending_updates\": {\n                        \"type\": \"number\"\n                      }\n                    },\n                    \"required\": [\n                      \"pending_updates\"\n                    ],\n                    \"additionalProperties\": false\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\": false\n              },\n              {\n                \"properties\":{\n                  \"name\":{\n                    \"const\":\"unknown\"\n                  },\n                  \"description\":{\n                    \"type\":\"object\",\n                    \"properties\":{\n                      \"identifier\":{\n                        \"type\":\"string\"\n                      }\n                    },\n                    \"required\":[\n                      \"identifier\"\n                    ],\n                    \"additionalProperties\":false\n                  }\n                },\n                \"required\":[\n                  \"name\",\n                  \"description\"\n                ],\n                \"additionalProperties\":false\n              }\n            ]\n          }\n        }\n      },\n      \"required\":[\n        \"app_status\",\n        \"busy_resources\"\n      ],\n      \"additionalProperties\":false\n    }\n  ]\n}\n"
  },
  {
    "path": "detox/src/client/actions/actions.js",
    "content": "// @ts-nocheck\nconst { DetoxInternalError, DetoxRuntimeError } = require('../../errors');\nconst logger = require('../../utils/logger');\nconst formatJSONStatus = require('../actions/formatters/SyncStatusFormatter');\n\nclass Action {\n  constructor(type, params = {}) {\n    this.type = type;\n    this.params = params;\n    this.messageId = undefined;\n  }\n\n  expectResponseOfType(response, type) {\n    if (response.type !== type) {\n      throw new DetoxInternalError(`was expecting '${type}' , got ${JSON.stringify(response)}`);\n    }\n  }\n\n  /** @returns {boolean} */\n  get isAtomic() {\n    throw new DetoxInternalError(`Action.prototype.isAtomic must be defined for ${this.type}`);\n  }\n\n  /** @returns {number} */\n  get timeout() {\n    throw new DetoxInternalError(`Action.prototype.timeout getter must be defined for ${this.type}`);\n  }\n}\n\nclass Login extends Action {\n  constructor(sessionId) {\n    const params = {\n      sessionId: sessionId,\n      role: 'tester'\n    };\n    super('login', params);\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 1000;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'loginSuccess');\n    return response.params;\n  }\n}\n\nclass Ready extends Action {\n  constructor() {\n    super('isReady');\n    this.messageId = -1000;\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'ready');\n  }\n}\n\nclass ReloadReactNative extends Action {\n  constructor() {\n    super('reactNativeReload');\n    this.messageId = -1000;\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'ready');\n  }\n}\n\nclass WaitForBackground extends Action {\n  constructor() {\n    super('waitForBackground');\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'waitForBackgroundDone');\n  }\n}\n\nclass WaitForActive extends Action {\n  constructor() {\n    super('waitForActive');\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'waitForActiveDone');\n  }\n}\n\nclass Shake extends Action {\n  constructor() {\n    super('shakeDevice');\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'shakeDeviceDone');\n  }\n}\n\nclass SetOrientation extends Action {\n  constructor(params) {\n    super('setOrientation', params);\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'setOrientationDone');\n  }\n}\n\nclass Cleanup extends Action {\n  constructor(stopRunner) {\n    super('cleanup', { stopRunner });\n    this.messageId = -0xc1ea;\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 5000;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'cleanupDone');\n  }\n}\n\nclass Invoke extends Action {\n  constructor(params) {\n    super('invoke', params);\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    switch (response.type) {\n      case 'testFailed':\n        let message = 'Test Failed: ' + response.params.details;\n        let hint;\n        let debugInfo;\n\n        if (response.params.viewHierarchy) {\n          /* istanbul ignore next */\n          if (/^(debug|trace)$/.test(logger.level)) {\n            debugInfo = 'View Hierarchy:\\n' + response.params.viewHierarchy;\n          } else {\n            hint = 'To print view hierarchy on failed actions/matches, use log-level verbose or higher.';\n          }\n        }\n\n        throw new DetoxRuntimeError({ message, hint, debugInfo });\n      case 'invokeResult':\n        return response.params;\n      case 'error':\n        throw new DetoxRuntimeError(response.params.error);\n      default:\n        throw new DetoxInternalError(`Tried to invoke an action on app, got an unsupported response: ${JSON.stringify(response)}`);\n    }\n  }\n}\n\nclass DeliverPayload extends Action {\n  constructor(params) {\n    super('deliverPayload', params);\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'deliverPayloadDone');\n  }\n}\n\nclass SetSyncSettings extends Action {\n  constructor(params) {\n    super('setSyncSettings', params);\n  }\n\n  get isAtomic() {\n    return true;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'setSyncSettingsDone');\n  }\n}\n\nclass CurrentStatus extends Action {\n  constructor(params) {\n    super('currentStatus', params);\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 5000;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'currentStatusResult');\n    return formatJSONStatus(response.params.status);\n  }\n}\n\nclass SetInstrumentsRecordingState extends Action {\n  constructor(params) {\n    super('setRecordingState', params);\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'setRecordingStateDone');\n  }\n}\n\nclass GenerateViewHierarchyXml extends Action {\n  constructor(params) {\n    super('generateViewHierarchyXml', params);\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'generateViewHierarchyXmlResult');\n    return response.params.viewHierarchy;\n  }\n}\n\nclass CaptureViewHierarchy extends Action {\n  constructor(params) {\n    super('captureViewHierarchy', params);\n  }\n\n  get isAtomic() {\n    return false;\n  }\n\n  get timeout() {\n    return 0;\n  }\n\n  async handle(response) {\n    this.expectResponseOfType(response, 'captureViewHierarchyDone');\n\n    const { captureViewHierarchyError } = response.params;\n    if (captureViewHierarchyError) {\n      throw new DetoxRuntimeError({\n        message: 'Failed to capture view hierarchy. Reason:\\n',\n        debugInfo: captureViewHierarchyError\n      });\n    }\n\n    return response;\n  }\n}\n\nmodule.exports = {\n  Action,\n  Login,\n  WaitForBackground,\n  WaitForActive,\n  Ready,\n  Invoke,\n  ReloadReactNative,\n  Cleanup,\n  DeliverPayload,\n  SetSyncSettings,\n  CurrentStatus,\n  Shake,\n  SetOrientation,\n  SetInstrumentsRecordingState,\n  CaptureViewHierarchy,\n  GenerateViewHierarchyXml\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/SyncStatusFormatter.js",
    "content": "// @ts-nocheck\nconst Ajv = require('ajv');\n\nconst DetoxInternalError = require('../../../errors/DetoxInternalError');\nconst statusSchema = require('../SyncStatusSchema.json');\n\nconst animationUpdateFormatter = require('./sync-resources/AnimationUpdateResourceFormatter');\nconst bgThreadFormatter = require('./sync-resources/BgThreadFormatter');\nconst delayedPerformSelectorFormatter = require('./sync-resources/DelayedPerformSelectorFormatter');\nconst dispatchQueueFormatter = require('./sync-resources/DispatchQueueFormatter');\nconst jsTimersFormatter = require('./sync-resources/JavaScriptTimersFormatter');\nconst looperFormatter = require('./sync-resources/LooperFormatter');\nconst networkFormatter = require('./sync-resources/NetworkFormatter');\nconst oneTimeEventsFormatter = require('./sync-resources/OneTimeEventsFormatter');\nconst runLoopFormatter = require('./sync-resources/RunLoopFormatter');\nconst timersFormatter = require('./sync-resources/TimersFormatter');\nconst uiFormatter = require('./sync-resources/UIFormatter');\nconst unknownResourceFormatter = require('./sync-resources/UnknownResourceFormatter');\nconst { makeResourceTitle } = require('./sync-resources/utils');\n\nconst ajv = new Ajv();\nconst isValidJSONStatus = ajv.compile(statusSchema);\n\nfunction formatJSONStatus(jsonStatus) {\n  if (!isValidJSONStatus(jsonStatus)) {\n    const errorMessages = isValidJSONStatus.errors.map(\n      error => `• ${error.message} in path \"${error.schemaPath}\" with params: ${JSON.stringify(error.params)}`\n    );\n    throw new DetoxInternalError(`Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), ` +\n      `given status: ${JSON.stringify(jsonStatus)}.\\nWith reasons:\\n${errorMessages.join('\\n')}\\n`);\n  }\n\n  if (isAppIdle(jsonStatus)) {\n    return 'The app seems to be idle';\n  }\n\n  const resourcesDescriptions = resourcesDescriptionsFromJSON(jsonStatus.busy_resources);\n  return `The app is busy with the following tasks:\\n${resourcesDescriptions.join('\\n')}`;\n}\n\nfunction isAppIdle(jsonStatus) {\n  return jsonStatus.app_status === 'idle';\n}\n\nfunction resourcesDescriptionsFromJSON(jsonDescriptions) {\n  let descriptions = [];\n  for (const jsonDescription of jsonDescriptions) {\n    const description = resourceDescriptionFromJSON(jsonDescription);\n    descriptions.push(description);\n  }\n\n  return descriptions;\n}\n\nconst resourceFormatters = {\n  bg: bgThreadFormatter,\n  delayed_perform_selector: delayedPerformSelectorFormatter,\n  dispatch_queue: dispatchQueueFormatter,\n  run_loop: runLoopFormatter,\n  one_time_events: oneTimeEventsFormatter,\n  timers: timersFormatter,\n  ui: uiFormatter,\n  js_timers: jsTimersFormatter,\n  network: networkFormatter,\n  looper: looperFormatter,\n  io: () => { return makeResourceTitle(`Disk I/O activity.`); },\n  animation_updates: animationUpdateFormatter,\n  unknown: unknownResourceFormatter,\n  bridge: () => { return makeResourceTitle(`Activity on the React-Native bridge.`); },\n};\n\nfunction resourceDescriptionFromJSON(jsonDescription) {\n  const resourceName = jsonDescription.name;\n  const formatter = resourceFormatters[resourceName];\n  const properties = jsonDescription.description;\n  return formatter(properties);\n}\n\nmodule.exports = formatJSONStatus;\n"
  },
  {
    "path": "detox/src/client/actions/formatters/SyncStatusFormatter.test.js",
    "content": "const format = require('./SyncStatusFormatter');\n\ndescribe('Sync Status Formatter', () => {\n  describe('assertions', () => {\n    it('should throw error when `app_status` is missing', async () => {\n      let invalidStatus = {\n        busy_resource: []\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error when `app_status` is invalid', async () => {\n      let invalidStatus = {\n        app_status: 'foo'\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error when `app_status` is `busy` but `busy_resources` is missing', async () => {\n      let invalidStatus = {\n        app_status: 'busy'\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error when `app_status` is `busy` but `busy_resources` is empty', async () => {\n      let invalidStatus = {\n        app_status: 'busy',\n        busy_resources: []\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error when resource `name` is missing', async () => {\n      let invalidStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            description: {\n              foo: 'bar'\n            }\n          }\n        ]\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw error when a busy resource is invalid', async () => {\n      let invalidStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'foo'\n          }\n        ]\n      };\n\n      await expect(() => {\n        format(invalidStatus);\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  it('should format idle status correctly', async () => {\n    let idleStatus = {\n      app_status: 'idle'\n    };\n\n    await expect(format(idleStatus)).toMatchSnapshot();\n  });\n\n  describe('busy status', () => {\n    it('should format \"delayed_perform_selector\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'delayed_perform_selector',\n            description: {\n              pending_selectors: 123\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"dispatch_queue\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'dispatch_queue',\n            description: {\n              queue: 'foo',\n              works_count: 123\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"run_loop\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'run_loop',\n            description: {\n              name: 'foo'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"one_time_events\" correctly when there is no object', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'one_time_events',\n            description: {\n              event: 'foo'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"one_time_events\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'one_time_events',\n            description: {\n              event: 'foo',\n              object: 'bar'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"timers\" correctly when there is no description', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'timers'\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"timers\" correctly when there are timers in description', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'timers',\n            description: {\n              timers: [\n                {\n                  fire_date: 'foo',\n                  time_until_fire: 0.468978,\n                  repeat_interval: 1,\n                  is_recurring: true\n                },\n                {\n                  fire_date: 'bar',\n                  time_until_fire: 0.98798,\n                  repeat_interval: 0,\n                  is_recurring: false\n                }\n              ]\n            }\n          }\n\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"ui\" correctly #1', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'ui',\n            description: {\n              layer_animation_pending_count: 3,\n              layer_needs_display_count: 5,\n              layer_needs_layout_count: 1,\n              layer_pending_animation_count: 12\n            }\n          }\n\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"ui\" correctly #2', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'ui',\n            description: {\n              view_animation_pending_count: 3,\n              view_controller_will_appear_count: 5,\n              view_controller_will_disappear_count: 1,\n              view_needs_display_count: 12,\n              view_needs_layout_count: 15\n            }\n          }\n\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"ui\" correctly #3', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'ui',\n            description: {\n              reason: 'foo'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"ui\" correctly with Fabric UI properties', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'ui',\n            description: {\n              mount_items: 5,\n              view_command_mount_items: 2\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"network\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'network',\n            description: {\n              urls: [\n                'foo://bar.baz',\n                'qux://quux.quuz'\n              ]\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"js_timers\" correctly (old-arch)', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'js_timers',\n            description: {\n              timers: [\n                {\n                  timer_id: 4,\n                  duration: 1,\n                  is_recurring: false\n                },\n                {\n                  timer_id: 12,\n                  duration: 2,\n                  is_recurring: true\n                }\n              ]\n            }\n          }\n\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"js_timers\" correctly (new-arch)', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'js_timers',\n            description: {\n              timers: [\n                {\n                  timer_id: 4,\n                  duration: 1,\n                  elapsed: 0.2\n                },\n                {\n                  timer_id: 12,\n                  duration: 2,\n                  elapsed: 0.3\n                }\n              ]\n            }\n          }\n\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"animation_updates\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'animation_updates',\n            description: {\n              pending_updates: 42\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"looper\" correctly #1', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'looper',\n            description: {\n              thread: 'Foo Looper',\n              execution_type: 'baz execution'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"looper\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'looper',\n            description: {\n              thread: 'Foo Looper'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"io\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'io'\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"bridge\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'bridge'\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"unknown\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'unknown',\n            description: {\n              identifier: 'foo.bar#baz'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n\n    it('should format \"bg\" correctly', async () => {\n      let busyStatus = {\n        app_status: 'busy',\n        busy_resources: [\n          {\n            name: 'bg',\n            description: {\n              reason: 'asynctasks'\n            }\n          }\n        ]\n      };\n\n      await expect(format(busyStatus)).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/client/actions/formatters/__snapshots__/SyncStatusFormatter.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Sync Status Formatter assertions should throw error when \\`app_status\\` is \\`busy\\` but \\`busy_resources\\` is empty 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"app_status\":\"busy\",\"busy_resources\":[]}.\nWith reasons:\n• must NOT have additional properties in path \"#/oneOf/0/additionalProperties\" with params: {\"additionalProperty\":\"busy_resources\"}\n• must NOT have fewer than 1 items in path \"#/oneOf/1/properties/busy_resources/minItems\" with params: {\"limit\":1}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter assertions should throw error when \\`app_status\\` is \\`busy\\` but \\`busy_resources\\` is missing 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"app_status\":\"busy\"}.\nWith reasons:\n• must be equal to constant in path \"#/oneOf/0/properties/app_status/const\" with params: {\"allowedValue\":\"idle\"}\n• must have required property 'busy_resources' in path \"#/oneOf/1/required\" with params: {\"missingProperty\":\"busy_resources\"}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter assertions should throw error when \\`app_status\\` is invalid 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"app_status\":\"foo\"}.\nWith reasons:\n• must be equal to constant in path \"#/oneOf/0/properties/app_status/const\" with params: {\"allowedValue\":\"idle\"}\n• must have required property 'busy_resources' in path \"#/oneOf/1/required\" with params: {\"missingProperty\":\"busy_resources\"}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter assertions should throw error when \\`app_status\\` is missing 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"busy_resource\":[]}.\nWith reasons:\n• must have required property 'app_status' in path \"#/oneOf/0/required\" with params: {\"missingProperty\":\"app_status\"}\n• must have required property 'app_status' in path \"#/oneOf/1/required\" with params: {\"missingProperty\":\"app_status\"}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter assertions should throw error when a busy resource is invalid 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"app_status\":\"busy\",\"busy_resources\":[{\"name\":\"foo\"}]}.\nWith reasons:\n• must NOT have additional properties in path \"#/oneOf/0/additionalProperties\" with params: {\"additionalProperty\":\"busy_resources\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/0/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/1/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/2/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/3/required\" with params: {\"missingProperty\":\"description\"}\n• must be equal to constant in path \"#/oneOf/1/properties/busy_resources/items/anyOf/4/properties/name/const\" with params: {\"allowedValue\":\"timers\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/5/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/6/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/7/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/8/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/9/required\" with params: {\"missingProperty\":\"description\"}\n• must be equal to constant in path \"#/oneOf/1/properties/busy_resources/items/anyOf/10/properties/name/const\" with params: {\"allowedValue\":\"io\"}\n• must be equal to constant in path \"#/oneOf/1/properties/busy_resources/items/anyOf/11/properties/name/const\" with params: {\"allowedValue\":\"bridge\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/12/required\" with params: {\"missingProperty\":\"description\"}\n• must have required property 'description' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/13/required\" with params: {\"missingProperty\":\"description\"}\n• must match a schema in anyOf in path \"#/oneOf/1/properties/busy_resources/items/anyOf\" with params: {}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter assertions should throw error when resource \\`name\\` is missing 1`] = `\n\"Given sync status is not compatible with the status schema (\\`SyncStatusSchema.js\\`), given status: {\"app_status\":\"busy\",\"busy_resources\":[{\"description\":{\"foo\":\"bar\"}}]}.\nWith reasons:\n• must NOT have additional properties in path \"#/oneOf/0/additionalProperties\" with params: {\"additionalProperty\":\"busy_resources\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/0/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/1/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/2/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/3/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/4/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/5/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/6/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/7/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/8/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/9/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/10/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/11/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/12/required\" with params: {\"missingProperty\":\"name\"}\n• must have required property 'name' in path \"#/oneOf/1/properties/busy_resources/items/anyOf/13/required\" with params: {\"missingProperty\":\"name\"}\n• must match a schema in anyOf in path \"#/oneOf/1/properties/busy_resources/items/anyOf\" with params: {}\n• must match exactly one schema in oneOf in path \"#/oneOf\" with params: {\"passingSchemas\":null}\n\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"animation_updates\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• There are 42 pending React Native node animation updates.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"bg\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Background work taking place in asynctasks.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"bridge\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Activity on the React-Native bridge.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"delayed_perform_selector\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• There are 123 pending delayed selectors to be performed.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"dispatch_queue\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• There are 123 work items pending on the dispatch queue: \"foo\".\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"io\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Disk I/O activity.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"js_timers\" correctly (new-arch) 1`] = `\n\"The app is busy with the following tasks:\n• 2 enqueued JavaScript timers:\n  - Timer #1:\n    + JS timer ID: 4.\n    + Duration: 1.\n    + Elapsed: 0.2.\n\n  - Timer #2:\n    + JS timer ID: 12.\n    + Duration: 2.\n    + Elapsed: 0.3.\n\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"js_timers\" correctly (old-arch) 1`] = `\n\"The app is busy with the following tasks:\n• 2 enqueued JavaScript timers:\n  - Timer #1:\n    + JS timer ID: 4.\n    + Duration: 1.\n    + Is recurring: NO.\n\n  - Timer #2:\n    + JS timer ID: 12.\n    + Duration: 2.\n    + Is recurring: YES.\n\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"looper\" correctly #1 1`] = `\n\"The app is busy with the following tasks:\n• Foo Looper is executing (baz execution).\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"looper\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Foo Looper is executing.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"network\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• 2 network requests with URLs:\n  - URL #1: foo://bar.baz\n  - URL #2: qux://quux.quuz\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"one_time_events\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• The event \"foo\" is taking place with object: \"bar\".\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"one_time_events\" correctly when there is no object 1`] = `\n\"The app is busy with the following tasks:\n• The event \"foo\" is taking place.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"run_loop\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Run loop \"foo\" is awake.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"timers\" correctly when there are timers in description 1`] = `\n\"The app is busy with the following tasks:\n• 2 enqueued native timers:\n  - Timer #1:\n    + Fire date: foo.\n    + Time until fire: 0.469.\n    + Repeat interval: 1.\n    + Is recurring: YES.\n  - Timer #2:\n    + Fire date: bar.\n    + Time until fire: 0.988.\n    + Repeat interval: 0.\n    + Is recurring: NO.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"timers\" correctly when there is no description 1`] = `\n\"The app is busy with the following tasks:\n• There are enqueued timers.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"ui\" correctly #1 1`] = `\n\"The app is busy with the following tasks:\n• UI elements are busy:\n  - Layer animations pending: 3.\n  - Layers needs display: 5.\n  - Layers needs layout: 1.\n  - Layers pending animations: 12.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"ui\" correctly #2 1`] = `\n\"The app is busy with the following tasks:\n• UI elements are busy:\n  - View animations pending: 3.\n  - View controllers will appear: 5.\n  - View controllers will disappear: 1.\n  - View needs display: 12.\n  - View needs layout: 15.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"ui\" correctly #3 1`] = `\n\"The app is busy with the following tasks:\n• UI elements are busy:\n  - Reason: foo.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"ui\" correctly with Fabric UI properties 1`] = `\n\"The app is busy with the following tasks:\n• UI elements are busy:\n  - Mount items pending: 5.\n  - View command mount items pending: 2.\"\n`;\n\nexports[`Sync Status Formatter busy status should format \"unknown\" correctly 1`] = `\n\"The app is busy with the following tasks:\n• Resource \"foo.bar#baz\" is busy.\"\n`;\n\nexports[`Sync Status Formatter should format idle status correctly 1`] = `\"The app seems to be idle\"`;\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/AnimationUpdateResourceFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return makeResourceTitle(\n    `There are ${properties.pending_updates} pending React Native node animation updates.`\n  );\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/BgThreadFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return `${makeResourceTitle(`Background work taking place in ${properties.reason}.`)}`;\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/DelayedPerformSelectorFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return makeResourceTitle(\n    `There are ${properties.pending_selectors} pending delayed selectors to be performed.`\n  );\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/DispatchQueueFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return makeResourceTitle(\n    `There are ${properties.works_count} work items pending on the dispatch queue: \"${properties.queue}\".`\n  );\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/JavaScriptTimersFormatter.js",
    "content": "const { makeResourceTitle, makeResourceSubTitle, makeResourceSubSubTitle } = require('./utils');\n\nfunction makeTimerDescription(timer, timerCount) {\n  return (\n    `${makeResourceSubTitle(`Timer #${timerCount}:`)}\\n` +\n    `${makeResourceSubSubTitle(`JS timer ID: ${timer.timer_id}`)}.\\n` +\n    `${makeResourceSubSubTitle(`Duration: ${timer.duration}`)}.\\n` +\n    (timer.is_recurring !== undefined\n      ? `${makeResourceSubSubTitle(`Is recurring: ${timer.is_recurring ? 'YES' : 'NO'}`)}.\\n`\n      : '') +\n    (timer.elapsed !== undefined\n      ? `${makeResourceSubSubTitle(`Elapsed: ${timer.elapsed}`)}.\\n`\n      : '')\n  );\n}\n\nmodule.exports = function(properties) {\n  let timerCount = 0;\n  let timersDescriptions = [];\n\n  for (const timer of properties.timers) {\n    timerCount++;\n    timersDescriptions.push(makeTimerDescription(timer, timerCount));\n  }\n\n  return `${makeResourceTitle(`${timerCount} enqueued JavaScript timers:`)}\\n${timersDescriptions.join('\\n')}`;\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/LooperFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  const executionType = properties.execution_type;\n  return makeResourceTitle(\n    `${properties.thread} is executing${executionType !== undefined ? ` (${executionType}).` : `.`}`\n  );\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/NetworkFormatter.js",
    "content": "const { makeResourceTitle, makeResourceSubTitle } = require('./utils');\n\nfunction makeURLDescription(url, urlCount) {\n  return makeResourceSubTitle(`URL #${urlCount}: ${url}`);\n}\n\nmodule.exports = function(properties) {\n  let urlCount = 0;\n  let urlsDescriptions = [];\n  for (const url of properties.urls) {\n    urlCount++;\n    urlsDescriptions.push(makeURLDescription(url, urlCount));\n  }\n\n  return `${makeResourceTitle(`${urlCount} network requests with URLs:`)}\\n${urlsDescriptions.join('\\n')}`;\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/OneTimeEventsFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  const objectName = properties.object;\n  return makeResourceTitle(\n    `The event \"${properties.event}\" is taking place${(objectName === undefined) ? `.` : ` with object: \"${objectName}\".`}`\n  );\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/RunLoopFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return makeResourceTitle(`Run loop \"${properties.name}\" is awake.`);\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/TimersFormatter.js",
    "content": "const { makeResourceTitle, makeResourceSubTitle, makeResourceSubSubTitle } = require('./utils');\n\nfunction makeTimerDescription(timer, timerCount) {\n  return `${makeResourceSubTitle(`Timer #${timerCount}:`)}\\n` +\n    `${makeResourceSubSubTitle(`Fire date: ${timer.fire_date}`)}.\\n` +\n    `${makeResourceSubSubTitle(`Time until fire: ${timer.time_until_fire.toFixed(3)}`)}.\\n` +\n    `${makeResourceSubSubTitle(`Repeat interval: ${timer.repeat_interval}`)}.\\n` +\n    `${makeResourceSubSubTitle(`Is recurring: ${timer.is_recurring ? `YES` : `NO`}`)}.`;\n}\n\nmodule.exports = function(properties) {\n  if (properties === undefined) {\n    return makeResourceTitle(`There are enqueued timers.`);\n  }\n\n  let timerCount = 0;\n  let timersDescriptions = [];\n  for (const timer of properties.timers) {\n    timerCount++;\n    timersDescriptions.push(makeTimerDescription(timer, timerCount));\n  }\n\n  return `${makeResourceTitle(`${timerCount} enqueued native timers:`)}\\n${timersDescriptions.join('\\n')}`;\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/UIFormatter.js",
    "content": "const { makeResourceTitle, makeResourceSubTitle } = require('./utils');\n\nconst propertyToDescriptionMapping = {\n  'layer_animation_pending_count':  `Layer animations pending`,\n  'layer_needs_display_count': `Layers needs display`,\n  'layer_needs_layout_count': `Layers needs layout`,\n  'layer_pending_animation_count': `Layers pending animations`,\n  'view_animation_pending_count': `View animations pending`,\n  'view_controller_will_appear_count': `View controllers will appear`,\n  'view_controller_will_disappear_count': `View controllers will disappear`,\n  'view_needs_display_count': `View needs display`,\n  'view_needs_layout_count': `View needs layout`,\n  'mount_items': `Mount items pending`,\n  'view_command_mount_items': `View command mount items pending`,\n  'reason': `Reason`\n};\n\nmodule.exports = function(properties) {\n  let countersDescriptions = [];\n  for (const [key, value] of Object.entries(properties)) {\n    countersDescriptions.push(makeResourceSubTitle(`${propertyToDescriptionMapping[key]}: ${value}`));\n  }\n\n  return `${makeResourceTitle(`UI elements are busy:`)}\\n${countersDescriptions.join('.\\n')}.`;\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/UnknownResourceFormatter.js",
    "content": "const { makeResourceTitle } = require('./utils');\n\nmodule.exports = function(properties) {\n  return makeResourceTitle(`Resource \"${properties.identifier}\" is busy.`);\n};\n"
  },
  {
    "path": "detox/src/client/actions/formatters/sync-resources/utils.js",
    "content": "function makeResourceTitle(string) {\n  return `• ${string}`;\n}\n\nfunction makeResourceSubTitle(string) {\n  return `  - ${string}`;\n}\n\nfunction makeResourceSubSubTitle(string) {\n  return `    + ${string}`;\n}\n\nmodule.exports = {\n  makeResourceTitle,\n  makeResourceSubTitle,\n  makeResourceSubSubTitle,\n};\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/badconfig/detox.config.js",
    "content": "// @ts-nocheck\n/* eslint-disable */\nmodule.exports = require('something-that-does-not-exist');\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/cjs/.detoxrc.cjs",
    "content": "module.exports = {\n    configurations: {\n        simple: {\n          device: {\n            type: \"android.attached\",\n            device: \"Hello from .detoxrc\",\n          },\n          apps: [],\n        },\n    },\n};\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/extends/.detoxrc.json",
    "content": "{\n  \"extends\": \"./middle\",\n  \"artifacts\": {\n    \"plugins\": {\n      \"video\": \"all\"\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/extends/badPointer.json",
    "content": "{\n  \"extends\": \"it-does-not-exist... really\"\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/extends/base.json",
    "content": "{\n  \"artifacts\": {\n    \"rootDir\": \"base\",\n    \"plugins\": {\n      \"log\": \"all\"\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/extends/middle/index.js",
    "content": "module.exports = {\n  extends: '../base.json',\n  artifacts: {\n    rootDir: 'someRootDir',\n    plugins: {\n      screenshot: 'all',\n    },\n  },\n};\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/oldschema/package.json",
    "content": "{\n  \"name\": \"oldschema\",\n  \"version\": \"1.0.0\",\n  \"dependencies\": {\n  },\n  \"detox\": {\n    \"configurations\": {\n      \"single\": {\n        \"type\": \"ios.simulator\",\n        \"device\": \"iPhone 12\",\n        \"binaryPath\": \"/some/path/to.app\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/packagejson/package.json",
    "content": "{\n  \"name\": \"test-project\",\n  \"version\": \"0.0.1\",\n  \"detox\": {\n    \"session\": {\n      \"server\": \"ws://localhost:9999\",\n      \"sessionId\": \"external file works\"\n    },\n    \"configurations\": {\n      \"simple\": {\n        \"device\": {\n          \"type\": \"android.attached\",\n          \"device\": \"Hello from package.json\"\n        },\n        \"apps\": []\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/priority/.detoxrc.js",
    "content": "module.exports = {\n    configurations: {\n        simple: {\n          device: {\n            type: \"android.attached\",\n            device: \"Hello from .detoxrc\",\n          },\n          apps: [],\n        },\n    },\n};\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/priority/detox-config.json",
    "content": "{\n    \"configurations\": {\n        \"simple\": {\n          \"device\": {\n            \"type\": \"android.attached\",\n            \"device\": \"Hello from detox-config.json\"\n          },\n          \"apps\": []\n        }\n    }\n}\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/priority/empty.js",
    "content": "module.exports = {};\n"
  },
  {
    "path": "detox/src/configuration/__mocks__/configuration/priority/package.json",
    "content": "{\n  \"detox\": {\n    \"configurations\": {\n      \"simple\": {\n        \"device\": {\n          \"type\": \"android.attached\",\n          \"device\": \"Hello from detox-config.json\"\n        },\n        \"apps\": []\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/configuration/__snapshots__/composeRunnerConfig.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`composeRunnerConfig unhappy scenarios deprecated \"testRunner\" in local config 1`] = `\n\"testRunner should be an object, not a string\n\nHINT: Check that in your Detox config.\n\n{\n  configurations: {\n    default: {\n      testRunner: 'nyc jest'\n    }\n  }\n}\"\n`;\n\nexports[`composeRunnerConfig unhappy scenarios non-string and non-object \"testRunner\" in global config 1`] = `\n\"testRunner should be an object, not a number\n\nHINT: Check that in your Detox config.\n\n{\n  testRunner: 0,\n  configurations: [Object]\n}\"\n`;\n"
  },
  {
    "path": "detox/src/configuration/collectCliConfig.js",
    "content": "const _ = require('lodash');\n\nconst { DetoxConfigErrorComposer } = require('../errors');\nconst argparse = require('../utils/argparse');\n\nconst asBoolean = (value) => {\n  if (typeof value === 'boolean') {\n    return value;\n  }\n\n  return value != null\n    ? (value !== 'false' && value !== '0' && value !== '')\n    : undefined;\n};\n\nconst asNumber = (value) => {\n  if (typeof value === 'number') {\n    return value;\n  }\n\n  return value != null && value !== ''\n    ? Number(value)\n    : undefined;\n};\n\nconst asBooleanEnum = (value) => {\n  if (value == null || value === '') {\n    return undefined;\n  }\n  if (value === 'true') return true;\n  if (value === 'false') return false;\n  return value;\n};\n\n/**\n * @param {object} opts\n * @param {Record<string, any>} [opts.argv]\n * @param {DetoxConfigErrorComposer} [opts.errorComposer]\n */\nfunction collectCliConfig({ argv, errorComposer }) {\n  const env = (key) => argparse.getEnvValue(key);\n  const get = (key, fallback) => {\n    const value = argv && Reflect.has(argv, key) ? argv[key] : env(key);\n    return value === undefined ? fallback : value;\n  };\n\n  const inspectBrk = asBoolean(get('inspect-brk'));\n  const repl = asBooleanEnum(get('repl'));\n  if (inspectBrk && repl) {\n    throw errorComposer.mutuallyExclusiveCliOptions('--inspect-brk', '--repl');\n  }\n\n  return _.omitBy({\n    artifactsLocation: get('artifacts-location'),\n    captureViewHierarchy: get('capture-view-hierarchy'),\n    recordLogs: get('record-logs'),\n    takeScreenshots: get('take-screenshots'),\n    recordVideos: get('record-videos'),\n    recordPerformance: get('record-performance'),\n    cleanup: asBoolean(get('cleanup')),\n    configPath: get('config-path'),\n    configuration: get('configuration'),\n    debugSynchronization: asNumber(get('debug-synchronization')),\n    deviceBootArgs: get('device-boot-args'),\n    appLaunchArgs: get('app-launch-args'),\n    deviceName: get('device-name'),\n    forceAdbInstall: asBoolean(get('force-adb-install')),\n    gpu: get('gpu'),\n    headless: asBoolean(get('headless')),\n    readonlyEmu: asBoolean(env('readOnlyEmu')),\n    jestReportSpecs: asBoolean(get('jest-report-specs')),\n    keepLockFile: asBoolean(get('keepLockFile')),\n    loglevel: get('loglevel'),\n    noColor: asBoolean(get('no-color')),\n    reuse: asBoolean(get('reuse')),\n    useCustomLogger: asBoolean(get('use-custom-logger')),\n    retries: asNumber(get('retries')),\n    start: get('start'),\n    ignoreUnexpectedWsMessages: asBoolean(get('ignore-unexpected-ws-messages')),\n    repl,\n    inspectBrk,\n  }, _.isUndefined);\n}\n\nmodule.exports = collectCliConfig;\n"
  },
  {
    "path": "detox/src/configuration/collectCliConfig.test.js",
    "content": "const inspect = require('util').inspect;\n\njest.mock('../utils/logger');\n\nconst J = x => inspect(x);\n\ndescribe('collectCliConfig', () => {\n  let collectCliConfig;\n  let argv, env;\n  let logger;\n  let __env__;\n  let errorComposer;\n  let DetoxConfigErrorComposer;\n\n  beforeEach(() => {\n    __env__ = process.env;\n    env = process.env = { ...__env__ };\n    argv = {};\n\n    DetoxConfigErrorComposer = require('../errors').DetoxConfigErrorComposer;\n    errorComposer = new DetoxConfigErrorComposer();\n    collectCliConfig = () => require('./collectCliConfig')({ argv, errorComposer });\n    logger = require('../utils/logger');\n  });\n\n  afterEach(() => {\n    process.env = __env__;\n  });\n\n  function multiplyTest(testCase, pairs) {\n    return pairs.map(([input, expected]) => [...testCase, input, expected]);\n  }\n\n  function asString(testCase) {\n    return multiplyTest(testCase, [\n      [undefined, undefined],\n      ['', ''],\n      ['some', 'some'],\n    ]);\n  }\n\n  function asNumber(testCase) {\n    return multiplyTest(testCase, [\n      [undefined, undefined],\n      [null, undefined],\n      ['', undefined],\n      ['some', NaN],\n      ['0', 0],\n      ['1', 1],\n      ['3000', 3000],\n      [-10.3, -10.3],\n    ]);\n  }\n\n  function asBoolean(testCase) {\n    return multiplyTest(testCase, [\n      [undefined, undefined],\n      [null, undefined],\n      ['', false],\n      ['false', false],\n      ['0', false],\n      ['1', true],\n      ['true', true],\n      ['anything', true],\n      [false, false],\n      [true, true],\n    ]);\n  }\n\n  function asBooleanEnum(testCase, enumValues) {\n    return multiplyTest(testCase, [\n      [undefined, undefined],\n      [null, undefined],\n      ['', undefined],\n      ['true', true],\n      ['false', false],\n      ...(enumValues || []).map((value) => [value, value]),\n    ]);\n  }\n\n  describe('mutual exclusivity', () => {\n    it('should throw error if both --inspect-brk and --repl are set', () => {\n      argv['inspect-brk'] = true;\n      argv['repl'] = true;\n\n      const mutuallyExclusiveError = errorComposer.mutuallyExclusiveCliOptions('--inspect-brk', '--repl');\n      expect(collectCliConfig).toThrow(mutuallyExclusiveError);\n    });\n\n    it('should not throw if only --inspect-brk is set', () => {\n      argv['inspect-brk'] = true;\n\n      expect(collectCliConfig).not.toThrow();\n    });\n\n    it('should not throw if only --repl is set', () => {\n      argv['repl'] = true;\n\n      expect(collectCliConfig).not.toThrow();\n    });\n\n    it('should not throw if neither --inspect-brk nor --repl is set', () => {\n      expect(collectCliConfig).not.toThrow();\n    });\n  });\n\n  describe.each([\n    ...asString( ['artifactsLocation',    'DETOX_ARTIFACTS_LOCATION',     'artifacts-location']),\n    ...asString( ['captureViewHierarchy', 'DETOX_CAPTURE_VIEW_HIERARCHY', 'capture-view-hierarchy']),\n    ...asString( ['recordLogs',           'DETOX_RECORD_LOGS',            'record-logs']),\n    ...asString( ['takeScreenshots',      'DETOX_TAKE_SCREENSHOTS',       'take-screenshots']),\n    ...asString( ['recordVideos',         'DETOX_RECORD_VIDEOS',          'record-videos']),\n    ...asString( ['recordPerformance',    'DETOX_RECORD_PERFORMANCE',     'record-performance']),\n    ...asBoolean(['cleanup',              'DETOX_CLEANUP',                'cleanup']),\n    ...asString( ['configPath',            'DETOX_CONFIG_PATH',            'config-path']),\n    ...asString( ['configuration' ,        'DETOX_CONFIGURATION',          'configuration']),\n    ...asNumber( ['debugSynchronization', 'DETOX_DEBUG_SYNCHRONIZATION',  'debug-synchronization']),\n    ...asString( ['deviceBootArgs',       'DETOX_DEVICE_BOOT_ARGS',       'device-boot-args']),\n    ...asString( ['appLaunchArgs',        'DETOX_APP_LAUNCH_ARGS',        'app-launch-args']),\n    ...asString( ['deviceName',           'DETOX_DEVICE_NAME',            'device-name']),\n    ...asBoolean(['forceAdbInstall',      'DETOX_FORCE_ADB_INSTALL',      'force-adb-install']),\n    ...asString( ['gpu',                  'DETOX_GPU',                    'gpu']),\n    ...asBoolean(['headless',             'DETOX_HEADLESS',               'headless']),\n    ...asBoolean(['jestReportSpecs',      'DETOX_JEST_REPORT_SPECS',      'jest-report-specs']),\n    ...asBoolean(['keepLockFile',         'DETOX_KEEP_LOCK_FILE',         'keepLockFile']),\n    ...asString( ['loglevel',             'DETOX_LOGLEVEL',               'loglevel']),\n    ...asBoolean(['noColor',              'DETOX_NO_COLOR',               'no-color']),\n    ...asBoolean(['reuse',                'DETOX_REUSE',                  'reuse']),\n    ...asNumber( ['retries',              'DETOX_RETRIES',                'retries']),\n    ...asBoolean(['readonlyEmu',          'DETOX_READ_ONLY_EMU',          null]),\n    ...asBoolean(['useCustomLogger',      'DETOX_USE_CUSTOM_LOGGER',      'use-custom-logger']),\n    ...asBoolean(['inspectBrk',           'DETOX_INSPECT_BRK',            'inspect-brk']),\n    ...asString( ['start',                'DETOX_START',                  'start']),\n    ...asBoolean(['ignoreUnexpectedWsMessages', 'DETOX_IGNORE_UNEXPECTED_WS_MESSAGES', 'ignore-unexpected-ws-messages']),\n    ...asBooleanEnum(['repl',             'DETOX_REPL',                   'repl'], ['auto']),\n  ])('.%s property' , (key, envName, argName, input, expected) => {\n    beforeEach(() => {\n      if (envName) env[envName] = input;\n      if (argName) argv[argName] = input;\n    });\n\n    describe('when provided inside argv', () => {\n      if (!argName) return;\n\n      it(`should be extracted from there (${J(input)} -> ${J(expected)})`, () => {\n        expect(collectCliConfig()[key]).toBe(expected);\n      });\n    });\n\n    describe('when not provided inside argv', () => {\n      if (!envName) return;\n\n      it(`should be extracted from $DETOX_SNAKE_CASE-named var (${J(input)} -> ${J(expected)})`, () => {\n        expect(collectCliConfig()[key]).toBe(expected);\n      });\n    });\n\n    describe('as a regular CLI override', () => {\n      it(`should not print a warning`, () =>\n        expect(logger.warn).not.toHaveBeenCalled());\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeAppsConfig.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\nconst parse = require('yargs-parser');\n\nconst deviceAppTypes = require('./utils/deviceAppTypes');\n\nconst CLI_PARSER_OPTIONS = {\n  configuration: {\n    'short-option-groups': false,\n  },\n};\n\n/**\n * @param {DetoxConfigErrorComposer} opts.errorComposer\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxDeviceConfig} opts.deviceConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @param {*} opts.cliConfig\n * @returns {Record<string, Detox.DetoxAppConfig>}\n */\nfunction composeAppsConfig(opts) {\n  const appsConfig = composeAppsConfigFromAliased(opts);\n  overrideAppLaunchArgs(appsConfig, opts.cliConfig);\n\n  return appsConfig;\n}\n\n/**\n * @param {DetoxConfigErrorComposer} opts.errorComposer\n * @param {string} opts.configurationName\n * @param {Detox.DetoxDeviceConfig} opts.deviceConfig\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @returns {Record<string, Detox.DetoxAppConfig>}\n */\nfunction composeAppsConfigFromAliased(opts) {\n  /* @type {Record<string, Detox.DetoxAppConfig>} */\n  const result = {};\n  const { configurationName, errorComposer, deviceConfig, globalConfig, localConfig } = opts;\n\n  const isBuiltinDevice = Boolean(deviceAppTypes[deviceConfig.type]);\n  if (localConfig.app == null && localConfig.apps == null) {\n    if (isBuiltinDevice) {\n      throw errorComposer.noAppIsDefined(deviceConfig.type);\n    } else {\n      return result;\n    }\n  }\n\n  if (localConfig.app != null && localConfig.apps != null) {\n    throw errorComposer.ambiguousAppAndApps();\n  }\n\n  if (localConfig.app && Array.isArray(localConfig.app)) {\n    throw errorComposer.multipleAppsConfigArrayTypo();\n  }\n\n  if (localConfig.apps && !Array.isArray(localConfig.apps)) {\n    throw errorComposer.multipleAppsConfigShouldBeArray();\n  }\n\n  const appPathsMap = new Map();\n  const preliminaryAppPaths = Array.isArray(localConfig.apps)\n    ? localConfig.apps.map((_alias, index) => ['configurations', configurationName, 'apps', index])\n    : [['configurations', configurationName, 'app']];\n\n  for (const maybeAppPath of preliminaryAppPaths) {\n    const maybeAlias = _.get(globalConfig, maybeAppPath);\n    const isAlias = _.isString(maybeAlias);\n    const appPath = isAlias\n      ? ['apps', maybeAlias]\n      : maybeAppPath;\n\n    const appConfig = _.get(globalConfig, appPath);\n    if (_.isEmpty(appConfig)) {\n      if (isAlias) {\n        if (_.size(globalConfig.apps) > 0) {\n          throw errorComposer.cantResolveAppAlias(maybeAlias);\n        } else {\n          throw errorComposer.thereAreNoAppConfigs(maybeAlias);\n        }\n      } else {\n        throw errorComposer.appConfigIsUndefined(appPath);\n      }\n    }\n\n    const appName = appConfig.name || 'default';\n    appPathsMap.set(appConfig, appPath);\n\n    validateAppConfig({\n      errorComposer,\n      deviceConfig,\n      appConfig,\n      appPath\n    });\n\n    if (!result[appName]) {\n      result[appName] = appConfig;\n    } else {\n      throw opts.errorComposer.duplicateAppConfig({\n        appPath,\n        appName: appConfig.name,\n        preExistingAppPath: appPathsMap.get(result[appName]),\n      });\n    }\n  }\n\n  return _.mapValues(result, value => _.clone(value));\n}\n\nfunction overrideAppLaunchArgs(appsConfig, cliConfig) {\n  const cliLaunchArgs = cliConfig.appLaunchArgs\n    ? _.omit(parse(cliConfig.appLaunchArgs, CLI_PARSER_OPTIONS), ['_', '--'])\n    : null;\n\n  for (const appConfig of _.values(appsConfig)) {\n    if (!appConfig.launchArgs && !cliLaunchArgs) {\n      continue;\n    }\n\n    appConfig.launchArgs = _.chain(cliLaunchArgs)\n      .defaults(appConfig.launchArgs)\n      .omitBy(value => value == null || value === false)\n      .value();\n  }\n}\n\nfunction validateAppConfig({ appConfig, appPath, deviceConfig, errorComposer }) {\n  const deviceType = deviceConfig.type;\n  const allowedAppTypes = deviceAppTypes[deviceType];\n\n  if (allowedAppTypes && !allowedAppTypes.includes(appConfig.type)) {\n    throw errorComposer.invalidAppType({\n      appPath,\n      allowedAppTypes,\n      deviceType,\n    });\n  }\n\n  if (allowedAppTypes && !appConfig.binaryPath) {\n    throw errorComposer.missingAppBinaryPath(appPath);\n  }\n\n  if (appConfig.launchArgs && !_.isObject(appConfig.launchArgs)) {\n    throw errorComposer.malformedAppLaunchArgs(appPath);\n  }\n\n  if (appConfig.type !== 'android.apk' && appConfig.reversePorts) {\n    throw errorComposer.unsupportedReversePorts(appPath);\n  }\n}\n\nmodule.exports = composeAppsConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeAppsConfig.test.js",
    "content": "// @ts-nocheck\nconst DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\nconst {\n  appWithAbsoluteBinaryPath,\n  appWithRelativeBinaryPath,\n} = require('./configurations.mock');\n\ndescribe('composeAppsConfig', () => {\n  let composeAppsConfig;\n\n  /** @type {*} */\n  let cliConfig;\n  /** @type {string} */\n  let configurationName;\n  /** @type {Detox.DetoxDeviceConfig} */\n  let deviceConfig;\n  /** @type {Detox.DetoxConfiguration} */\n  let localConfig;\n  /** @type {Detox.DetoxConfig} */\n  let globalConfig;\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n\n  beforeEach(() => {\n    composeAppsConfig = require('./composeAppsConfig');\n    cliConfig = {};\n    localConfig = {};\n    deviceConfig = { device: 'someMatcher' };\n    configurationName = 'someConfig';\n    globalConfig = {\n      configurations: {\n        [configurationName]: localConfig,\n      },\n    };\n\n    errorComposer = new DetoxConfigErrorComposer()\n      .setDetoxConfig(globalConfig)\n      .setConfigurationName(configurationName);\n  });\n\n  const compose = () => composeAppsConfig({\n    errorComposer,\n    configurationName,\n    globalConfig,\n    localConfig,\n    deviceConfig,\n    cliConfig,\n  });\n\n  describe('given a configuration with single app', () => {\n    beforeEach(() => {\n      deviceConfig.type = 'ios.simulator';\n      globalConfig.apps = {\n        example1: appWithAbsoluteBinaryPath,\n        example2: appWithRelativeBinaryPath,\n      };\n    });\n\n    describe('when the app is aliased', () => {\n      beforeEach(() => {\n        localConfig.app = 'example1';\n      });\n\n      it('should resolve the alias and extract the app config', () => {\n        expect(compose()).toEqual({\n          default: globalConfig.apps.example1\n        });\n      });\n    });\n\n    describe('when the app is inlined', () => {\n      beforeEach(() => {\n        localConfig.app = { ...globalConfig.apps.example2 };\n      });\n\n      it('should resolve the alias and extract the app config', () => {\n        expect(compose()).toEqual({\n          default: globalConfig.apps.example2,\n        });\n      });\n    });\n  });\n\n  describe('given a configuration with multiple apps', () => {\n    beforeEach(() => {\n      deviceConfig.type = 'ios.simulator';\n      globalConfig.apps = {\n        example1: { ...appWithAbsoluteBinaryPath, name: 'app1' },\n        example2: { ...appWithRelativeBinaryPath, name: 'app2' },\n      };\n    });\n\n    describe('when the apps are aliased', () => {\n      beforeEach(() => {\n        localConfig.apps = ['example1', 'example2'];\n      });\n\n      it('should resolve the alias and extract the app config', () => {\n        expect(compose()).toEqual({\n          app1: globalConfig.apps.example1,\n          app2: globalConfig.apps.example2,\n        });\n      });\n\n      describe('and there is a CLI override', () => {\n        beforeEach(() => {\n          globalConfig.apps.example2.launchArgs = {\n            arg1: 'value1',\n            arg2: 'value2',\n            arg3: 'value3',\n          };\n\n          cliConfig.appLaunchArgs = '--no-arg2 -arg3=override';\n        });\n\n        it('should parse it and merge the values inside', () => {\n          const { app1, app2 } = compose();\n\n          expect(app1.launchArgs).toEqual({ arg3: 'override' });\n          expect(app2.launchArgs).toEqual({ arg1: 'value1', arg3: 'override' });\n        });\n      });\n    });\n\n    describe('when the apps are inlined', () => {\n      beforeEach(() => {\n        localConfig.apps = [\n          { ...globalConfig.apps.example1 },\n          { ...globalConfig.apps.example2 },\n        ];\n      });\n\n      it('should resolve the alias and extract the app config', () => {\n        expect(compose()).toEqual({\n          app1: globalConfig.apps.example1,\n          app2: globalConfig.apps.example2,\n        });\n      });\n    });\n  });\n\n  describe('given a configuration with no apps', () => {\n    beforeEach(() => {\n      delete localConfig.app;\n      delete localConfig.apps;\n    });\n\n    describe('when the device is powered by a custom driver', () => {\n      beforeEach(() => {\n        deviceConfig.type = './stub/driver';\n      });\n\n      it('should return an empty app config', () => {\n        expect(compose()).toEqual({});\n      });\n    });\n  });\n\n  describe('unhappy scenarios:', () => {\n    describe('aliased configuration:', () => {\n      beforeEach(() => {\n        globalConfig.apps = {\n          example1: { ...appWithAbsoluteBinaryPath },\n          example2: { ...appWithRelativeBinaryPath },\n        };\n\n        delete localConfig.type;\n      });\n\n      test.each([\n        ['ios.simulator'],\n        ['android.attached'],\n        ['android.emulator'],\n        ['android.genycloud'],\n      ])('no app/apps is defined when device is %s', (deviceType) => {\n        delete localConfig.app;\n        delete localConfig.apps;\n        deviceConfig.type = deviceType;\n\n        expect(compose).toThrow(errorComposer.noAppIsDefined(deviceType));\n      });\n\n      test('both app/apps are defined', () => {\n        localConfig.app = 'example1';\n        localConfig.apps = ['example1', 'example2'];\n\n        expect(compose).toThrow(errorComposer.ambiguousAppAndApps());\n      });\n\n      test('app is defined as an array', () => {\n        localConfig.app = ['example1', 'example2'];\n\n        expect(compose).toThrow(errorComposer.multipleAppsConfigArrayTypo());\n      });\n\n      test('apps are defined as a string', () => {\n        localConfig.apps = 'example1';\n\n        expect(compose).toThrow(errorComposer.multipleAppsConfigShouldBeArray());\n      });\n\n      test('\"apps\" dictionary is undefined', () => {\n        delete globalConfig.apps;\n        localConfig.app = 'example1';\n\n        expect(compose).toThrow(errorComposer.thereAreNoAppConfigs('example1'));\n      });\n\n      test('non-existent app, cannot resolve alias', () => {\n        localConfig.app = 'elbereth';\n\n        expect(compose).toThrow(errorComposer.cantResolveAppAlias('elbereth'));\n      });\n\n      test('undefined inline app', () => {\n        localConfig.apps = ['example1', null];\n\n        expect(compose).toThrow(\n          errorComposer.appConfigIsUndefined(['configurations', configurationName, 'apps', 1])\n        );\n      });\n\n      test('apps have no name (collision)', () => {\n        localConfig.apps = ['example1', 'example2'];\n\n        expect(compose).toThrow(errorComposer.duplicateAppConfig({\n          appName: undefined,\n          appPath: ['apps', 'example2'],\n          preExistingAppPath: ['apps', 'example1'],\n        }));\n      });\n\n      test('apps have the same name (collision)', () => {\n        globalConfig.apps.example1.name = 'sameApp';\n        globalConfig.apps.example2.name = 'sameApp';\n        localConfig.apps = ['example1', 'example2'];\n\n        expect(compose).toThrow(errorComposer.duplicateAppConfig({\n          appName: 'sameApp',\n          appPath: ['apps', 'example2'],\n          preExistingAppPath: ['apps', 'example1'],\n        }));\n      });\n\n      test.each([\n        ['ios.app', 'ios.simulator'],\n        ['android.apk', 'android.attached'],\n        ['android.apk', 'android.emulator'],\n        ['android.apk', 'android.genycloud'],\n      ])('known app (device type = %s) has no binaryPath', (appType, deviceType) => {\n        delete globalConfig.apps.example1.binaryPath;\n        globalConfig.apps.example1.type = appType;\n        deviceConfig.type = deviceType;\n        localConfig.app = 'example1';\n\n        expect(compose).toThrow(errorComposer.missingAppBinaryPath(\n          ['apps', 'example1']\n        ));\n      });\n\n      test.each([\n        ['ios.app', 'ios.simulator'],\n        ['android.apk', 'android.attached'],\n        ['android.apk', 'android.emulator'],\n        ['android.apk', 'android.genycloud'],\n      ])('known app (device type = %s) has malformed launchArgs', (appType, deviceType) => {\n        globalConfig.apps.example1.launchArgs = '-hello -world';\n        globalConfig.apps.example1.type = appType;\n        deviceConfig.type = deviceType;\n        localConfig.app = 'example1';\n\n        expect(compose).toThrow(errorComposer.malformedAppLaunchArgs(\n          ['apps', 'example1']\n        ));\n      });\n\n      test.each([\n        ['ios.app', 'ios.simulator'],\n      ])('known app (device type = %s) has unsupported reversePorts', (appType, deviceType) => {\n        globalConfig.apps.example1.reversePorts = [3000];\n        globalConfig.apps.example1.type = appType;\n        deviceConfig.type = deviceType;\n        localConfig.app = 'example1';\n\n        expect(compose).toThrow(errorComposer.unsupportedReversePorts(\n          ['apps', 'example1']\n        ));\n      });\n\n      test.each([\n        ['android.apk', 'ios.simulator'],\n        ['ios.app', 'android.attached'],\n        ['ios.app', 'android.emulator'],\n        ['ios.app', 'android.genycloud'],\n      ])('app type (%s) is incompatible with device (%s)', (appType, deviceType) => {\n        localConfig.app = 'example1';\n        globalConfig.apps.example1.type = appType;\n        deviceConfig.type = deviceType;\n\n        expect(compose).toThrow(\n          errorComposer.invalidAppType({\n            appPath: ['apps', 'example1'],\n            allowedAppTypes: [appType === 'android.apk' ? 'ios.app' : 'android.apk'],\n            deviceType,\n          })\n        );\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeArtifactsConfig.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst InstrumentsArtifactPlugin = require('../artifacts/instruments/InstrumentsArtifactPlugin');\nconst LogArtifactPlugin = require('../artifacts/log/LogArtifactPlugin');\nconst ScreenshotArtifactPlugin = require('../artifacts/screenshot/ScreenshotArtifactPlugin');\nconst IosUIHierarchyPlugin = require('../artifacts/uiHierarchy/IosUIHierarchyPlugin');\nconst buildDefaultArtifactsRootDirpath = require('../artifacts/utils/buildDefaultArtifactsRootDirpath');\nconst VideoArtifactPlugin = require('../artifacts/video/VideoArtifactPlugin');\n\n/**\n * @param {*} cliConfig\n * @param {string} configurationName\n * @param {Detox.DetoxConfig} globalConfig\n * @param {Detox.DetoxConfiguration} localConfig\n */\nfunction composeArtifactsConfig({\n  cliConfig,\n  configurationName,\n  localConfig,\n  globalConfig,\n}) {\n  const artifactsConfig = _.defaultsDeep(\n    extendArtifactsConfig({\n      rootDir: cliConfig.artifactsLocation,\n      plugins: {\n        log: cliConfig.recordLogs,\n        screenshot: cliConfig.takeScreenshots,\n        video: cliConfig.recordVideos,\n        instruments: cliConfig.recordPerformance,\n        uiHierarchy: cliConfig.captureViewHierarchy,\n      },\n    }),\n    extendArtifactsConfig(localConfig.artifacts),\n    extendArtifactsConfig(globalConfig.artifacts),\n    extendArtifactsConfig(false),\n  );\n\n  if (!artifactsConfig.pathBuilder) {\n    artifactsConfig.pathBuilder = undefined;\n  }\n\n  artifactsConfig.rootDir = buildDefaultArtifactsRootDirpath(\n    configurationName,\n    artifactsConfig.rootDir\n  );\n\n  return artifactsConfig;\n}\n\nfunction extendArtifactsConfig(config) {\n  if (config === false) {\n    return extendArtifactsConfig({\n      rootDir: 'artifacts',\n      pathBuilder: '',\n      plugins: {\n        log: 'none',\n        screenshot: 'manual',\n        video: 'none',\n        instruments: 'none',\n        uiHierarchy: 'disabled',\n      },\n    });\n  }\n\n  const p = config && config.plugins;\n  if (!p) {\n    return config;\n  }\n\n  return {\n    ...config,\n    plugins: {\n      ...config.plugins,\n      log: ifString(p.log, LogArtifactPlugin.parseConfig),\n      screenshot: ifString(p.screenshot, ScreenshotArtifactPlugin.parseConfig),\n      video: ifString(p.video, VideoArtifactPlugin.parseConfig),\n      instruments: ifString(p.instruments, InstrumentsArtifactPlugin.parseConfig),\n      uiHierarchy: ifString(p.uiHierarchy, IosUIHierarchyPlugin.parseConfig),\n    },\n  };\n}\n\nfunction ifString(value, mapper) {\n  return typeof value === 'string' ? mapper(value) : value;\n}\n\nmodule.exports = composeArtifactsConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeArtifactsConfig.test.js",
    "content": "const schemes = require('./configurations.mock');\n\ndescribe('composeArtifactsConfig', () => {\n  let composeArtifactsConfig;\n\n  beforeEach(() => {\n    composeArtifactsConfig = require('./composeArtifactsConfig');\n  });\n\n  it('should produce a default config', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'abracadabra',\n      localConfig: {},\n      globalConfig: {},\n      cliConfig: {},\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^artifacts[\\\\/]abracadabra\\.\\d{4}/),\n      plugins: schemes.pluginsDefaultsResolved,\n    });\n  });\n\n  it('should use artifacts configuration from the local config', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'abracadabra',\n      localConfig: {\n        artifacts: {\n          ...schemes.allArtifactsConfiguration,\n          rootDir: 'otherPlace',\n          pathBuilder: '@local/pathbuilder',\n        }\n      },\n      globalConfig: {},\n      cliConfig: {},\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^otherPlace[\\\\/]abracadabra\\.\\d{4}/),\n      pathBuilder: '@local/pathbuilder',\n      plugins: schemes.pluginsAllResolved,\n    });\n  });\n\n  it('should use artifacts configuration from the global config', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'abracadabra',\n      localConfig: {},\n      globalConfig: {\n        artifacts: {\n          ...schemes.allArtifactsConfiguration,\n          rootDir: 'otherPlace',\n          pathBuilder: '@global/pathbuilder',\n        }\n      },\n      cliConfig: {},\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^otherPlace[\\\\/]abracadabra\\.\\d{4}/),\n      plugins: schemes.pluginsAllResolved,\n    });\n  });\n\n  it('should disable global artifacts config if local config has artifacts = false', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'abracadabra',\n      localConfig: {\n        artifacts: false,\n      },\n      globalConfig: {\n        artifacts: {\n          ...schemes.allArtifactsConfiguration,\n          rootDir: 'otherPlace',\n          pathBuilder: '@global/pathbuilder',\n        }\n      },\n      cliConfig: {},\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^artifacts[\\\\/]abracadabra\\.\\d{4}/),\n      pathBuilder: undefined,\n      plugins: schemes.pluginsDefaultsResolved,\n    });\n  });\n\n  it('should also use CLI config', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'abracadabra',\n      localConfig: {},\n      globalConfig: {},\n      cliConfig: {\n        artifactsLocation: 'otherPlace',\n        recordLogs: 'all',\n        recordPerformance: 'all',\n        recordVideos: 'all',\n        takeScreenshots: 'all',\n        captureViewHierarchy: 'enabled',\n      },\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^otherPlace[\\\\/]abracadabra\\.\\d{4}/),\n      plugins: schemes.pluginsAllResolved,\n    });\n  });\n\n  it('should prefer CLI config over the local config and over the global config', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'priority',\n      cliConfig: {\n        artifactsLocation: 'cli',\n      },\n      localConfig: {\n        artifacts: {\n          rootDir: 'configuration',\n          pathBuilder: '@local/pathbuilder',\n          plugins: {\n            log: 'failing',\n          },\n        },\n      },\n      globalConfig: {\n        artifacts: {\n          rootDir: 'global',\n          pathBuilder: '@global/pathbuilder',\n          plugins: {\n            screenshot: 'all',\n          },\n        },\n      },\n    })).toMatchObject({\n      rootDir: expect.stringMatching(/^cli[\\\\/]priority\\.\\d{4}/),\n      pathBuilder: '@local/pathbuilder',\n      plugins: {\n        log: schemes.pluginsFailingResolved.log,\n        screenshot: schemes.pluginsAllResolved.screenshot,\n        video: schemes.pluginsDefaultsResolved.video,\n        instruments: schemes.pluginsDefaultsResolved.instruments,\n      },\n    });\n  });\n\n  it('should not append configuration with timestamp if rootDir ends with slash', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'customization',\n      localConfig: {\n        artifacts: {\n          rootDir: '.artifacts/'\n        },\n      },\n      globalConfig: {},\n      cliConfig: {},\n    })).toMatchObject({\n      rootDir: '.artifacts',\n    });\n  });\n\n  it('should allow passing custom plugin configurations', () => {\n    expect(composeArtifactsConfig({\n      configurationName: 'custom',\n      cliConfig: {\n        takeScreenshots: 'all',\n      },\n      globalConfig: {\n        artifacts: {\n          rootDir: 'configuration',\n          plugins: {\n            screenshot: {\n              takeWhen: {\n                testDone: true,\n              },\n            },\n            video: {\n              android: { bitRate: 4000000 },\n              simulator: { codec: 'hevc' },\n            }\n          },\n        },\n      },\n      localConfig: {},\n    })).toMatchObject({\n      plugins: expect.objectContaining({\n        screenshot: {\n          ...schemes.pluginsAllResolved.screenshot,\n          takeWhen: {\n            testDone: true,\n          },\n        },\n        video: {\n          ...schemes.pluginsDefaultsResolved.video,\n          android: { bitRate: 4000000 },\n          simulator: { codec: 'hevc' },\n        },\n      }),\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeBehaviorConfig.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\n/**\n * @param {*} cliConfig\n * @param {Detox.DetoxConfig} globalConfig\n * @param {Detox.DetoxConfiguration} localConfig\n */\nfunction composeBehaviorConfig({\n  cliConfig,\n  globalConfig,\n  localConfig,\n}) {\n  return _.chain({})\n    .defaultsDeep(\n      {\n        init: {\n          keepLockFile: cliConfig.keepLockFile ? true : undefined,\n          reinstallApp: cliConfig.reuse ? false : undefined,\n        },\n        cleanup: {\n          shutdownDevice: cliConfig.cleanup ? true : undefined,\n        },\n      },\n      localConfig.behavior,\n      globalConfig.behavior,\n      {\n        init: {\n          exposeGlobals: true,\n          keepLockFile: false,\n          reinstallApp: undefined,\n        },\n        launchApp: 'auto',\n        cleanup: {\n          shutdownDevice: false,\n        },\n      }\n    )\n    .tap(config => {\n      if (config.init.reinstallApp === undefined) {\n        config.init.reinstallApp = config.launchApp !== 'manual';\n      }\n    })\n    .value();\n}\n\nmodule.exports = composeBehaviorConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeBehaviorConfig.test.js",
    "content": "const _ = require('lodash');\n\ndescribe('composeBehaviorConfig', () => {\n  let composeBehaviorConfig;\n  let cliConfig, localConfig, globalConfig;\n\n  beforeEach(() => {\n    cliConfig = {};\n    localConfig = {};\n    globalConfig = {};\n\n    composeBehaviorConfig = require('./composeBehaviorConfig');\n  });\n\n  let composed = () => composeBehaviorConfig({\n    cliConfig,\n    localConfig,\n    globalConfig,\n  });\n\n  it('should return a default behavior if nothing is set', () => {\n    expect(composed()).toEqual({\n      init: {\n        keepLockFile: false,\n        exposeGlobals: true,\n        reinstallApp: true,\n      },\n      launchApp: 'auto',\n      cleanup: {\n        shutdownDevice: false,\n      },\n    });\n  });\n\n  describe('if a custom config has only .launchApp = \"manual\" override', () => {\n    beforeEach(() => {\n      globalConfig = {\n        behavior: { launchApp: 'manual' }\n      };\n    });\n\n    it('should implicitly override behavior.init.reinstallApp = false', () => {\n      const actual = composed();\n\n      expect(actual.init.reinstallApp).toBe(false);\n    });\n  });\n\n  describe('if global config is set', () => {\n    beforeEach(() => {\n      globalConfig = {\n        behavior: {\n          init: {\n            exposeGlobals: false,\n            keepLockFile: true,\n            reinstallApp: false,\n          },\n          launchApp: 'manual',\n          cleanup: {\n            shutdownDevice: true,\n          },\n        },\n      };\n    });\n\n    it('should override the defaults', () => {\n      const expected = _.cloneDeep(globalConfig.behavior);\n      const actual = composed();\n\n      expect(actual).toEqual(expected);\n    });\n\n    describe('if local config is set', () => {\n      beforeEach(() => {\n        localConfig = {\n          behavior: {\n            init: {\n              exposeGlobals: true,\n              keepLockFile: false,\n              reinstallApp: true,\n            },\n            launchApp: 'auto',\n            cleanup: {\n              shutdownDevice: false,\n            },\n          },\n        };\n      });\n\n      it('should override the defaults from global config', () => {\n        const expected = _.cloneDeep(localConfig.behavior);\n        const actual = composed();\n\n        expect(actual).toEqual(expected);\n      });\n    });\n\n    describe('if CLI config is set', () => {\n      beforeEach(() => {\n        cliConfig = {\n          keepLockFile: true,\n          reuse: true,\n          cleanup: true,\n        };\n      });\n\n      it('should override the defaults from global config', () => {\n        expect(composed()).toEqual(expect.objectContaining({\n          init: expect.objectContaining({\n            keepLockFile: true,\n            reinstallApp: false,\n          }),\n          cleanup: expect.objectContaining({\n            shutdownDevice: true,\n          }),\n        }));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeCommandsConfig.js",
    "content": "/**\n * @param {{\n *  appsConfig: Record<string, Detox.DetoxAppConfig>\n *  localConfig: Detox.DetoxConfiguration;\n * }} options\n * @returns {DetoxInternals.RuntimeCommandsGroup[]}\n */\nfunction composeCommandsConfig(options) {\n  const { appsConfig, localConfig } = options;\n  /** @type {[string | undefined, Detox.DetoxAppConfig | Detox.DetoxConfiguration][]} */\n  const entries = [[undefined, localConfig], ...Object.entries(appsConfig)];\n\n  return entries.map(extractGroup).filter(hasCommands);\n}\n\n/**\n * @param {[string | undefined, any]} script\n * @param {number} index\n * @param {[string | undefined, any][]} array\n * @returns {DetoxInternals.RuntimeCommandsGroup}\n */\nfunction extractGroup([appName, { build, start }], index, [[, config]]) {\n  if (index === 0) {\n    return { build, start };\n  }\n\n  return {\n    appName,\n    build: config.build ? undefined : build,\n    start: config.start ? undefined : start\n  };\n}\n\n/**\n * @param {DetoxInternals.RuntimeCommandsGroup} script\n * @returns {boolean}\n */\nfunction hasCommands({ build, start }) {\n  return Boolean(build || start);\n}\n\nmodule.exports = composeCommandsConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeCommandsConfig.test.js",
    "content": "const composeCommandsConfig = require('./composeCommandsConfig');\n\ndescribe('composeCommandsConfig', () => {\n  let appsConfig, localConfig;\n\n  beforeEach(() => {\n    appsConfig = {};\n    localConfig = {};\n  });\n\n  const composed = () => composeCommandsConfig({ appsConfig, localConfig });\n\n  it('should return an empty array if no commands are defined', () => {\n    expect(composed()).toEqual([]);\n  });\n\n  it('should use commands from the local config', () => {\n    localConfig = {\n      build: 'multi build',\n      start: 'multi start'\n    };\n\n    expect(composed()).toEqual([\n      { build: 'multi build', start: 'multi start' }\n    ]);\n  });\n\n  it('should use app commands from the apps config', () => {\n    appsConfig = {\n      app1: { build: 'app1 build', start: 'app1 start' },\n      app2: { build: 'app2 build' }\n    };\n\n    expect(composed()).toEqual([\n      { appName: 'app1', build: 'app1 build', start: 'app1 start' },\n      { appName: 'app2', build: 'app2 build' }\n    ]);\n  });\n\n  it('should combine commands from localConfig and appsConfig', () => {\n    localConfig = {\n      build: 'global build',\n    };\n    appsConfig = {\n      app1: { build: 'app1 build', start: 'app1 start' },\n      app2: { build: 'app2 build' }\n    };\n\n    expect(composed()).toEqual([\n      { build: 'global build' },\n      { appName: 'app1', start: 'app1 start' },\n    ]);\n  });\n\n  it('should not include app commands if the local config has such commands', () => {\n    localConfig = {\n      build: 'global build',\n      start: 'global start'\n    };\n    appsConfig = {\n      app1: { build: 'app1 build', start: 'app1 start' }\n    };\n\n    expect(composed()).toEqual([\n      { build: 'global build', start: 'global start' },\n    ]);\n  });\n\n  it('should filter out entries without build or start commands', () => {\n    appsConfig = {\n      app1: { build: 'app1 build' },\n      app2: {},\n      app3: { start: 'app3 start' }\n    };\n\n    expect(composed()).toEqual([\n      { appName: 'app1', build: 'app1 build' },\n      { appName: 'app3', start: 'app3 start' }\n    ]);\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeDeviceConfig.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst environmentFactory = require('../environmentFactory');\nconst log = require('../utils/logger').child({ cat: 'config' });\n\n/**\n * @param {DetoxConfigErrorComposer} opts.errorComposer\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @param {*} opts.cliConfig\n * @returns {Detox.DetoxDeviceConfig}\n */\nfunction composeDeviceConfig(opts) {\n  const deviceConfig = composeDeviceConfigFromAliased(opts);\n  applyCLIOverrides(deviceConfig, opts.cliConfig);\n  deviceConfig.device = unpackDeviceQuery(deviceConfig);\n\n  return deviceConfig;\n}\n\n/**\n * @param {DetoxConfigErrorComposer} opts.errorComposer\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @returns {Detox.DetoxDeviceConfig}\n */\nfunction composeDeviceConfigFromAliased(opts) {\n  const { errorComposer, globalConfig, localConfig } = opts;\n\n  /** @type {Detox.DetoxDeviceConfig} */\n  let deviceConfig;\n\n  const isAliased = typeof localConfig.device === 'string';\n\n  if (isAliased) {\n    if (_.isEmpty(globalConfig.devices)) {\n      throw errorComposer.thereAreNoDeviceConfigs(localConfig.device);\n    } else {\n      deviceConfig = globalConfig.devices[localConfig.device];\n    }\n\n    if (!deviceConfig) {\n      throw errorComposer.cantResolveDeviceAlias(localConfig.device);\n    }\n  } else {\n    if (!localConfig.device) {\n      throw errorComposer.deviceConfigIsUndefined();\n    }\n\n    deviceConfig = localConfig.device;\n  }\n\n  validateDeviceConfig({\n    deviceConfig,\n    errorComposer,\n    deviceAlias: isAliased ? localConfig.device : undefined\n  });\n\n  return { ...deviceConfig };\n}\n\n/**\n * Validates systemUI configuration\n * @param {string | object} systemUI - The systemUI configuration\n * @param {string} deviceAlias - The device alias for error reporting\n * @param {DetoxConfigErrorComposer} errorComposer - Error composer instance\n */\nfunction validateSystemUIConfig(systemUI, deviceAlias, errorComposer) {\n  if (_.isString(systemUI)) {\n    if (!['minimal', 'genymotion'].includes(systemUI)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n    return;\n  }\n\n  if (!_.isObject(systemUI)) {\n    throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n  }\n\n  if (systemUI.extends !== undefined) {\n    if (!['minimal', 'genymotion'].includes(systemUI.extends)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (systemUI.keyboard !== undefined && systemUI.keyboard !== null) {\n    if (!['hide', 'show'].includes(systemUI.keyboard)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (systemUI.touches !== undefined && systemUI.touches !== null) {\n    if (!['hide', 'show'].includes(systemUI.touches)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (systemUI.pointerLocationBar !== undefined && systemUI.pointerLocationBar !== null) {\n    if (!['hide', 'show'].includes(systemUI.pointerLocationBar)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (systemUI.navigationMode !== undefined && systemUI.navigationMode !== null) {\n    if (!['3-button', 'gesture'].includes(systemUI.navigationMode)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (systemUI.statusBar !== undefined && systemUI.statusBar !== null) {\n    if (!_.isObject(systemUI.statusBar)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n    }\n\n    if (systemUI.statusBar.notifications !== undefined && systemUI.statusBar.notifications !== null) {\n      if (!['hide', 'show'].includes(systemUI.statusBar.notifications)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n\n    if (systemUI.statusBar.wifiSignal !== undefined && systemUI.statusBar.wifiSignal !== null) {\n      if (!['weak', 'strong', 'none'].includes(systemUI.statusBar.wifiSignal)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n\n    if (systemUI.statusBar.cellSignal !== undefined && systemUI.statusBar.cellSignal !== null) {\n      if (!['strong', 'weak', 'none'].includes(systemUI.statusBar.cellSignal)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n\n    if (systemUI.statusBar.batteryLevel !== undefined && systemUI.statusBar.batteryLevel !== null) {\n      if (!['full', 'half', 'low'].includes(systemUI.statusBar.batteryLevel)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n\n    if (systemUI.statusBar.charging !== undefined && systemUI.statusBar.charging !== null) {\n      if (!_.isBoolean(systemUI.statusBar.charging)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n\n    if (systemUI.statusBar.clock !== undefined && systemUI.statusBar.clock !== null) {\n      if (!_.isString(systemUI.statusBar.clock) || !/^\\d{2}\\d{2}$/.test(systemUI.statusBar.clock)) {\n        throw errorComposer.malformedDeviceProperty(deviceAlias, 'systemUI');\n      }\n    }\n  }\n}\n\n/**\n * @param {DetoxConfigErrorComposer} errorComposer\n * @param {Detox.DetoxDeviceConfig} deviceConfig\n * @param {String | undefined} deviceAlias\n */\nfunction validateDeviceConfig({ deviceConfig, errorComposer, deviceAlias }) {\n  if (!deviceConfig.type) {\n    throw errorComposer.missingDeviceType(deviceAlias);\n  }\n\n  const maybeError = _.attempt(() => environmentFactory.validateConfig(deviceConfig));\n  if (_.isError(maybeError)) {\n      throw errorComposer.invalidDeviceType(deviceAlias, deviceConfig, maybeError);\n  }\n\n  if (!KNOWN_TYPES.has(deviceConfig.type)) {\n    return;\n  }\n\n  if (deviceConfig.bootArgs != null) {\n    if (!_.isString(deviceConfig.bootArgs)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'bootArgs');\n    }\n\n    if (deviceConfig.type !== 'ios.simulator' && deviceConfig.type !== 'android.emulator') {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'bootArgs');\n    }\n  }\n\n  if (deviceConfig.utilBinaryPaths != null) {\n    if (!Array.isArray(deviceConfig.utilBinaryPaths)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'utilBinaryPaths');\n    }\n\n    if (deviceConfig.utilBinaryPaths.some(s => !_.isString(s))) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'utilBinaryPaths');\n    }\n\n    if (!deviceConfig.type.match(/^android\\.(attached|emulator|genycloud)$/)) {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'utilBinaryPaths');\n    }\n  }\n\n  if (deviceConfig.forceAdbInstall !== undefined) {\n    if (!_.isBoolean(deviceConfig.forceAdbInstall)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'forceAdbInstall');\n    }\n\n    if (!deviceConfig.type.match(/^android\\.(attached|emulator|genycloud)$/)) {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'forceAdbInstall');\n    }\n  }\n\n  if (deviceConfig.gpuMode !== undefined) {\n    if (!_.isString(deviceConfig.gpuMode)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'gpuMode');\n    }\n\n    if (!deviceConfig.gpuMode.match(/^(auto|host|swiftshader_indirect|angle_indirect|guest|off)$/)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'gpuMode');\n    }\n\n    if (deviceConfig.type !== 'android.emulator') {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'gpuMode');\n    }\n  }\n\n  if (deviceConfig.headless !== undefined) {\n    if (!_.isBoolean(deviceConfig.headless)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'headless');\n    }\n\n    if (deviceConfig.type !== 'ios.simulator' && deviceConfig.type !== 'android.emulator') {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'headless');\n    }\n  }\n\n  if (deviceConfig.readonly !== undefined) {\n    if (!_.isBoolean(deviceConfig.readonly)) {\n      throw errorComposer.malformedDeviceProperty(deviceAlias, 'readonly');\n    }\n\n    if (deviceConfig.type !== 'android.emulator') {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'readonly');\n    }\n  }\n\n  if (deviceConfig.systemUI !== undefined) {\n    validateSystemUIConfig(deviceConfig.systemUI, deviceAlias, errorComposer);\n\n    if (!deviceConfig.type.match(/^android\\.(emulator|genycloud|attached)$/)) {\n      throw errorComposer.unsupportedDeviceProperty(deviceAlias, 'systemUI');\n    }\n  }\n\n  if (_.isObject(deviceConfig.device)) {\n    const expectedProperties = EXPECTED_DEVICE_MATCHER_PROPS[deviceConfig.type];\n    /* istanbul ignore else */\n    if (!_.isEmpty(expectedProperties)) {\n      const minimalShape = _.pick(deviceConfig.device, expectedProperties);\n\n      if (_.isEmpty(minimalShape)) {\n        throw errorComposer.missingDeviceMatcherProperties(deviceAlias, expectedProperties);\n      }\n    }\n  }\n}\n\nfunction applyCLIOverrides(deviceConfig, cliConfig) {\n  _assignCLIConfigIfSupported('device-name', cliConfig.deviceName, deviceConfig, 'device');\n  _assignCLIConfigIfSupported('device-boot-args', cliConfig.deviceBootArgs, deviceConfig, 'bootArgs');\n  _assignCLIConfigIfSupported('headless', cliConfig.headless, deviceConfig, 'headless');\n  _assignCLIConfigIfSupported('force-adb-install', cliConfig.forceAdbInstall, deviceConfig, 'forceAdbInstall');\n  _assignCLIConfigIfSupported('gpu', cliConfig.gpu, deviceConfig, 'gpuMode');\n  _assignCLIConfigIfSupported('readonly-emu', cliConfig.readonlyEmu, deviceConfig, 'readonly');\n}\n\nfunction _assignCLIConfigIfSupported(argName, argValue, deviceConfig, propertyName) {\n  if (argValue === undefined) {\n    return;\n  }\n\n  const deviceType = deviceConfig.type;\n  const supportedDeviceTypesPrefixes = _supportedDeviceTypesPrefixes(argName);\n  if (!supportedDeviceTypesPrefixes.some((prefix) => deviceType.startsWith(prefix))) {\n    log.warn(`--${argName} CLI override is not supported by device type = \"${deviceType}\" and will be ignored`);\n    return;\n  }\n\n  deviceConfig[propertyName] = argValue;\n}\n\nfunction _supportedDeviceTypesPrefixes(argName) {\n  switch (argName) {\n    case 'device-name':\n      return [''];\n\n    case 'force-adb-install':\n      return ['android.'];\n\n    case 'gpu':\n    case 'readonly-emu':\n      return ['android.emulator'];\n\n    case 'device-boot-args':\n    case 'headless':\n      return ['ios.simulator', 'android.emulator'];\n  }\n}\n\nfunction unpackDeviceQuery(deviceConfig) {\n  const query = deviceConfig.device;\n  if (!_.isString(query)) {\n    return query;\n  }\n\n  switch (deviceConfig.type) {\n    case 'ios.simulator':\n      if (_.includes(query, ',')) {\n        const [type, os] = _.split(query, /\\s*,\\s*/);\n        return { type, os };\n      }\n\n      return { type: query };\n    case 'android.attached':\n      return { adbName: query };\n    case 'android.emulator':\n      return { avdName: query };\n    case 'android.genycloud':\n      return { recipeName: query };\n    default:\n      return query;\n  }\n}\n\nconst EXPECTED_DEVICE_MATCHER_PROPS = {\n  'ios.simulator': ['type', 'name', 'id'],\n  'android.attached': ['adbName'],\n  'android.emulator': ['avdName'],\n  'android.genycloud': ['recipeUUID', 'recipeName'],\n};\n\nconst KNOWN_TYPES = new Set(Object.keys(EXPECTED_DEVICE_MATCHER_PROPS));\n\nmodule.exports = composeDeviceConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeDeviceConfig.test.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\ndescribe('composeDeviceConfig', () => {\n  /** @type {Function} */\n  let composeDeviceConfig;\n  /** @type {*} */\n  let cliConfig;\n  /** @type {Detox.DetoxConfiguration} */\n  let localConfig;\n  /** @type {Detox.DetoxDeviceConfig} */\n  let deviceConfig;\n  /** @type {Detox.DetoxConfig} */\n  let globalConfig;\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n  /** @type { { validateConfig: Function } */\n  let environmentFactory;\n\n  /** @type {Logger} */\n  let logger;\n\n  const compose = () => composeDeviceConfig({\n    errorComposer,\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const givenConfigValidationSuccess = () => environmentFactory.validateConfig.mockReturnValue(undefined);\n  const givenConfigValidationError = (error) => environmentFactory.validateConfig.mockImplementation(() => { throw error; });\n\n  const KNOWN_CONFIGURATIONS = [['inline'], ['aliased']];\n\n  const KNOWN_DEVICES = [\n    'ios.simulator',\n    'android.attached',\n    'android.emulator',\n    'android.genycloud',\n    './customDriver'\n  ];\n\n  const KNOWN_GPU_MODES = ['auto', 'host', 'swiftshader_indirect', 'angle_indirect', 'guest', 'off'];\n\n  /**\n   * @param {'ios.simulator' | 'android.attached' | 'android.emulator' | 'android.genycloud' | './customDriver'} deviceType\n   * @param {'inline' | 'aliased' } configType\n   */\n  function setConfig(deviceType, configType = 'aliased') {\n    const mixins = {\n      bootArgs: { bootArgs: '--someArg' },\n      forceAdbInstall: { forceAdbInstall: false },\n      utilBinaryPaths: { utilBinaryPaths: ['/path/to/apk'] },\n      iosDevice: {\n        device: {\n          type: 'iPhone 7 Plus',\n          os: 'iOS 10.2',\n        },\n      },\n    };\n\n    const deviceTemplates = {\n      'ios.simulator': {\n        type: 'ios.simulator',\n        ...mixins.iosDevice,\n        ...mixins.bootArgs,\n      },\n      'android.attached': {\n        type: 'android.attached',\n        device: { adbName: 'emulator-5554' },\n        ...mixins.utilBinaryPaths,\n        ...mixins.forceAdbInstall,\n      },\n      'android.emulator': {\n        type: 'android.emulator',\n        device: { avdName: 'Pixel_API_28' },\n        gpu: 'auto',\n        headless: true,\n        readonly: true,\n        ...mixins.bootArgs,\n        ...mixins.utilBinaryPaths,\n        ...mixins.forceAdbInstall,\n      },\n      'android.genycloud': {\n        type: 'android.genycloud',\n        device: { recipeName: 'myRecipe' },\n        ...mixins.utilBinaryPaths,\n        ...mixins.forceAdbInstall,\n      },\n      './customDriver': {\n        type: './customDriver',\n        device: 'firefox',\n        binaryPath: 'https://example.com',\n      },\n    };\n\n    const deviceId = _.uniqueId('device');\n    deviceConfig = _.cloneDeep(deviceTemplates[deviceType] || deviceTemplates[undefined]);\n\n    switch (configType) {\n      case 'inline':\n        localConfig.device = deviceConfig;\n        break;\n      case 'aliased':\n        localConfig.device = deviceId;\n        globalConfig.devices = { [deviceId]: deviceConfig };\n        break;\n    }\n }\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    logger = require('../utils/logger');\n\n    jest.mock('../environmentFactory');\n    environmentFactory = require('../environmentFactory');\n    givenConfigValidationSuccess();\n\n    cliConfig = {};\n    localConfig = {};\n    deviceConfig = null;\n    globalConfig = {\n      configurations: {\n        someConfig: localConfig,\n      },\n    };\n\n    errorComposer = new DetoxConfigErrorComposer()\n      .setDetoxConfig(globalConfig)\n      .setConfigurationName('someConfig');\n\n    composeDeviceConfig = require('./composeDeviceConfig');\n  });\n\n  describe('by config type', () => {\n    describe.each(KNOWN_DEVICES)('given a device (%j)', (deviceType) => {\n      describe('inlined', () => {\n        beforeEach(() => setConfig(deviceType, 'inline'));\n\n        it('should extract type and device', () =>\n          expect(compose()).toEqual(deviceConfig));\n\n        describe('unhappy scenarios', () => {\n          test('should throw if device config is not found', () => {\n            delete localConfig.device;\n            expect(compose).toThrow(errorComposer.deviceConfigIsUndefined());\n          });\n\n          test('should throw on no .type in device config', () => {\n            delete deviceConfig.type;\n            expect(compose).toThrow(errorComposer.missingDeviceType(undefined));\n          });\n        });\n      });\n\n      describe('aliased', () => {\n        beforeEach(() => setConfig(deviceType, 'aliased'));\n\n        it('should extract type and device', () =>\n          expect(compose()).toEqual(deviceConfig));\n\n        describe('unhappy scenarios', () => {\n          test('should throw if devices are not declared', () => {\n            globalConfig.devices = {};\n            expect(compose).toThrow(errorComposer.thereAreNoDeviceConfigs(localConfig.device));\n          });\n\n          test('should throw if device config is not found', () => {\n            localConfig.device = 'unknownDevice';\n            expect(compose).toThrow(errorComposer.cantResolveDeviceAlias('unknownDevice'));\n          });\n\n          test('should throw on no .type in device config', () => {\n            delete deviceConfig.type;\n            expect(compose).toThrow(errorComposer.missingDeviceType(localConfig.device));\n          });\n        });\n      });\n    });\n\n    describe('given a custom device', () => {\n      describe('inlined', () => {\n        beforeEach(() => setConfig('./customDriver', 'inline'));\n\n        it('should extract type and device', () =>\n          expect(compose()).toEqual(deviceConfig));\n\n        describe('unhappy scenarios', () => {\n          test('should throw on no .type in device config', () => {\n            delete deviceConfig.type;\n            expect(compose).toThrow(errorComposer.missingDeviceType(undefined));\n          });\n        });\n      });\n\n      describe('aliased', () => {\n        beforeEach(() => setConfig('./customDriver', 'aliased'));\n\n        it('should extract type and device', () =>\n          expect(compose()).toEqual(deviceConfig));\n\n        describe('unhappy scenarios', () => {\n          test('should throw if devices are not declared', () => {\n            globalConfig.devices = {};\n            expect(compose).toThrow(errorComposer.thereAreNoDeviceConfigs(localConfig.device));\n          });\n\n          test('should throw on no .type in device config', () => {\n            delete deviceConfig.type;\n            expect(compose).toThrow(errorComposer.missingDeviceType(localConfig.device));\n          });\n        });\n      });\n    });\n  });\n\n  describe('by device type', () => {\n    describe.each(KNOWN_CONFIGURATIONS)('given %s configuration', (configType) => {\n      let alias = () => configType === 'aliased' ? localConfig.device : undefined;\n\n      describe('CLI overrides', () => {\n        describe('--device-name', () => {\n          describe.each([\n            ['ios.simulator'],\n          ])('given iOS (%s) device', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            test('should override .type', () => {\n              cliConfig.deviceName = 'iPad';\n              expect(compose().device).toEqual({ type: 'iPad' });\n            });\n\n            test('should override .type and .os', () => {\n              cliConfig.deviceName = 'iPhone SE, iOS 9.3.5';\n              expect(compose().device).toEqual({ type: 'iPhone SE', os: 'iOS 9.3.5' });\n            });\n          });\n\n          describe('given android.emulator device', () => {\n            beforeEach(() => setConfig('android.emulator', configType));\n\n            test('should override .avdName', () => {\n              cliConfig.deviceName = 'Galaxy_S100';\n              expect(compose().device).toEqual({ avdName: 'Galaxy_S100' });\n            });\n          });\n\n          describe('given android.attached device', () => {\n            beforeEach(() => setConfig('android.attached', configType));\n\n            test('should override .adbName', () => {\n              cliConfig.deviceName = 'emu.*tor';\n              expect(compose().device).toEqual({ adbName: 'emu.*tor' });\n            });\n          });\n\n          describe('given android.genycloud device', () => {\n            beforeEach(() => setConfig('android.genycloud', configType));\n\n            test('should override .recipeName', () => {\n              cliConfig.deviceName = 'anotherRecipe';\n              expect(compose().device).toEqual({ recipeName: 'anotherRecipe' });\n            });\n          });\n\n          describe('given a custom device', () => {\n            beforeEach(() => setConfig('./customDriver', configType));\n\n            test('should override .device', () => {\n              cliConfig.deviceName = 'aCustomValue';\n              expect(compose().device).toEqual('aCustomValue');\n            });\n          });\n        });\n\n        describe('--device-boot-args', () => {\n          describe.each([\n            ['ios.simulator'],\n            ['android.emulator'],\n          ])('given a supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should override .bootArgs without warnings', () => {\n              cliConfig.deviceBootArgs = '--example';\n              expect(compose()).toEqual(expect.objectContaining({\n                bootArgs: '--example'\n              }));\n\n              expect(logger.warn).not.toHaveBeenCalled();\n            });\n          });\n\n          describe.each([\n            ['android.attached'],\n            ['android.genycloud'],\n            ['./customDriver'],\n          ])('given a non-supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should print a warning and refuse to override .bootArgs', () => {\n              cliConfig.deviceBootArgs = '--example';\n              expect(compose()).not.toEqual(expect.objectContaining({\n                bootArgs: '--example'\n              }));\n\n              expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/--device-boot-args.*not supported/));\n            });\n          });\n        });\n\n        describe('--force-adb-install', () => {\n          describe.each([\n            ['android.attached'],\n            ['android.emulator'],\n            ['android.genycloud'],\n          ])('given an Android device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should override .forceAdbInstall without warnings', () => {\n              cliConfig.forceAdbInstall = true;\n              expect(compose()).toEqual(expect.objectContaining({\n                forceAdbInstall: true,\n              }));\n\n              expect(logger.warn).not.toHaveBeenCalled();\n            });\n          });\n\n          describe.each([\n            ['ios.simulator'],\n            ['./customDriver'],\n          ])('given a non-supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should print a warning and refuse to override .forceAdbInstall', () => {\n              cliConfig.forceAdbInstall = true;\n              expect(compose()).not.toEqual(expect.objectContaining({\n                forceAdbInstall: true,\n              }));\n\n              expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/--force-adb-install.*not supported/));\n            });\n          });\n        });\n\n        describe('--headless', () => {\n          describe.each([\n            ['ios.simulator'],\n            ['android.emulator']\n          ])('given a supported device type (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should override .headless without warnings', () => {\n              cliConfig.headless = false;\n              expect(compose()).toEqual(expect.objectContaining({\n                headless: false,\n              }));\n\n              expect(logger.warn).not.toHaveBeenCalled();\n            });\n          });\n\n          describe.each([\n            ['android.attached'],\n            ['android.genycloud'],\n            ['./customDriver']\n          ])('given a non-supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should print a warning and refuse to override .headless', () => {\n              cliConfig.headless = false;\n              expect(compose()).not.toEqual(expect.objectContaining({\n                headless: false,\n              }));\n\n              expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/--headless.*not supported/));\n            });\n          });\n        });\n\n        describe('--gpu', () => {\n          describe('given android.emulator device', () => {\n            beforeEach(() => setConfig('android.emulator', configType));\n\n            it('should override .gpuMode without warnings', () => {\n              cliConfig.gpu = 'auto';\n              expect(compose()).toEqual(expect.objectContaining({\n                gpuMode: 'auto',\n              }));\n\n              expect(logger.warn).not.toHaveBeenCalled();\n            });\n          });\n\n          describe.each([\n            ['ios.simulator'],\n            ['android.attached'],\n            ['./customDriver'],\n          ])('given a non-supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should print a warning and refuse to override .gpuMode', () => {\n              cliConfig.gpu = 'auto';\n              expect(compose()).not.toEqual(expect.objectContaining({\n                gpuMode: 'auto',\n              }));\n\n              expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/--gpu.*not supported/));\n            });\n          });\n        });\n\n        describe('--readonlyEmu', () => {\n          describe('given android.emulator device', () => {\n            beforeEach(() => setConfig('android.emulator', configType));\n\n            it('should override .readonly without warnings', () => {\n              cliConfig.readonlyEmu = true;\n              expect(compose()).toEqual(expect.objectContaining({\n                readonly: true\n              }));\n\n              expect(logger.warn).not.toHaveBeenCalled();\n            });\n          });\n\n          describe.each([\n            ['ios.simulator'],\n            ['android.attached'],\n            ['android.genycloud'],\n            ['./customDriver'],\n          ])('given a non-supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should print a warning and refuse to override .readonly', () => {\n              cliConfig.readonlyEmu = true;\n              expect(compose()).not.toEqual(expect.objectContaining({\n                readonly: true\n              }));\n\n              expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/--readonly-emu.*not supported/));\n            });\n          });\n        });\n      });\n\n      describe('Unhappy scenarios', () => {\n        describe('missing device matcher properties', () => {\n          test.each([\n            [['type', 'name', 'id'], 'ios.simulator'],\n            [['adbName'], 'android.attached'],\n            [['avdName'], 'android.emulator'],\n            [['recipeUUID', 'recipeName'], 'android.genycloud'],\n          ])('should throw for missing %s for \"%s\" device', (expectedProps, deviceType) => {\n            setConfig(deviceType, configType);\n            for (const key of expectedProps) {\n              delete deviceConfig.device[key];\n            }\n            deviceConfig.device.misspelled = 'value';\n\n            expect(compose).toThrow(errorComposer.missingDeviceMatcherProperties(alias(), expectedProps));\n\n            // ...and now prove the opposite:\n            deviceConfig.device[_.sample(expectedProps)] = 'someValue';\n            expect(compose).not.toThrow();\n          });\n        });\n\n        test('should throw if a device type cannot be resolved', () => {\n          setConfig('./customDriver', configType);\n          const someError = new Error('Some error');\n          givenConfigValidationError(someError);\n\n          expect(compose).toThrow(errorComposer.invalidDeviceType(\n            alias(),\n            deviceConfig,\n            someError\n          ));\n        });\n\n        describe('.bootArgs validation', () => {\n          test.each([\n            'android.attached',\n            'android.genycloud',\n          ])('cannot be used for %j device', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.bootArgs = '--someArg';\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'bootArgs'));\n          });\n\n          describe.each([\n            'ios.simulator',\n            'android.emulator',\n          ])('for a supported device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should throw if .bootArgs are malformed (e.g., array)', () => {\n              deviceConfig.bootArgs = ['--someArg'];\n\n              expect(compose).toThrow(\n                errorComposer.malformedDeviceProperty(alias(), 'bootArgs')\n              );\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.bootArgs = [0xAC, 0xDC];\n            expect(compose).not.toThrow();\n          });\n        });\n\n        describe('.forceAdbInstall validation', () => {\n          test.each([\n            'ios.simulator',\n          ])('cannot be used for iOS device (%j)', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.forceAdbInstall = false;\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'forceAdbInstall'));\n          });\n\n          describe.each([\n            'android.attached',\n            'android.emulator',\n            'android.genycloud',\n          ])('for Android device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should throw if .forceAdbInstall is malformed (e.g., string)', () => {\n              deviceConfig.forceAdbInstall = 'yes';\n\n              expect(compose).toThrow(\n                errorComposer.malformedDeviceProperty(alias(), 'forceAdbInstall')\n              );\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.forceAdbInstall = /anything/;\n            expect(compose).not.toThrow();\n          });\n        });\n\n        describe('.gpuMode validation', () => {\n          test.each([\n            'ios.simulator',\n            'android.attached',\n            'android.genycloud',\n          ])('cannot be used for a non-emulator device (%j)', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.gpuMode = 'auto';\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'gpuMode'));\n          });\n\n          describe('given android.emulator device', () => {\n            beforeEach(() => setConfig('android.emulator', configType));\n\n            test(`should throw if value is not a string`, () => {\n              deviceConfig.gpuMode = ['auto'];\n              expect(compose).toThrow(errorComposer.malformedDeviceProperty(alias(), 'gpuMode'));\n            });\n\n            test(`should throw if value is not in (${KNOWN_GPU_MODES})`, () => {\n              for (const gpuMode of KNOWN_GPU_MODES) {\n                deviceConfig.gpuMode = gpuMode;\n                expect(compose).not.toThrow();\n\n                deviceConfig.gpuMode = gpuMode.slice(1);\n                expect(compose).toThrow(errorComposer.malformedDeviceProperty(alias(), 'gpuMode'));\n              }\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.gpuMode = class Whatever {};\n            expect(compose).not.toThrow();\n          });\n        });\n\n        describe('.headless validation', () => {\n          test.each([\n            'android.attached',\n            'android.genycloud'\n          ])('cannot be used for a non-emulator device (%j)', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.headless = true;\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'headless'));\n          });\n\n          describe.each([\n            'ios.simulator',\n            'android.emulator'\n          ])('given supporting device type (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            test(`should throw if value is not a boolean (e.g., string)`, () => {\n              deviceConfig.headless = `${Math.random() > 0.5}`;\n              expect(compose).toThrow(errorComposer.malformedDeviceProperty(alias(), 'headless'));\n            });\n\n            test('should not throw if value is a boolean', () => {\n              deviceConfig.headless = false;\n              expect(compose).not.toThrow();\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.headless = NaN;\n            expect(compose).not.toThrow();\n          });\n        });\n\n        describe('.readonly validation', () => {\n          test.each([\n            'ios.simulator',\n            'android.attached',\n            'android.genycloud',\n          ])('cannot be used for a non-emulator device (%j)', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.readonly = true;\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'readonly'));\n          });\n\n          describe('given android.emulator device', () => {\n            beforeEach(() => setConfig('android.emulator', configType));\n\n            test(`should throw if value is not a boolean (e.g., string)`, () => {\n              deviceConfig.readonly = `${Math.random() > 0.5}`; // string\n              expect(compose).toThrow(errorComposer.malformedDeviceProperty(alias(), 'readonly'));\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.readonly = () => {};\n            expect(compose).not.toThrow();\n          });\n        });\n\n        describe('.utilBinaryPaths validation', () => {\n          test.each([\n            'ios.simulator',\n          ])('cannot be used for a non-Android device (%j)', (deviceType) => {\n            setConfig(deviceType, configType);\n            deviceConfig.utilBinaryPaths = [];\n            expect(compose).toThrow(errorComposer.unsupportedDeviceProperty(alias(), 'utilBinaryPaths'));\n          });\n\n          describe.each([\n            'android.attached',\n            'android.emulator',\n            'android.genycloud',\n          ])('for Android device (%j)', (deviceType) => {\n            beforeEach(() => setConfig(deviceType, configType));\n\n            it('should throw if .utilBinaryPaths are malformed (array of non-strings)', () => {\n              deviceConfig.utilBinaryPaths = [{ path: 'valid/path/not/in/array' }];\n\n              expect(compose).toThrow(\n                errorComposer.malformedDeviceProperty(alias(), 'utilBinaryPaths')\n              );\n            });\n\n            it('should throw if device.utilBinaryPaths are malformed (string)', () => {\n              deviceConfig.utilBinaryPaths = 'valid/path/not/in/array';\n\n              expect(compose).toThrow(\n                errorComposer.malformedDeviceProperty(alias(), 'utilBinaryPaths')\n              );\n            });\n          });\n\n          test('should be disabled for custom devices', () => {\n            setConfig('./customDriver', configType);\n            deviceConfig.utilBinaryPaths = 42;\n            expect(compose).not.toThrow();\n          });\n        });\n      });\n    });\n\n    describe('systemUI property validation', () => {\n      beforeEach(() => {\n        setConfig('android.emulator', 'aliased');\n        givenConfigValidationSuccess();\n      });\n\n      describe('valid configurations', () => {\n        it('should accept string \"minimal\"', () => {\n          deviceConfig.systemUI = 'minimal';\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept string \"genymotion\"', () => {\n          deviceConfig.systemUI = 'genymotion';\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept object with all properties', () => {\n          deviceConfig.systemUI = {\n            keyboard: 'hide',\n            touches: 'show',\n            pointerLocationBar: 'hide',\n            navigationMode: '3-button',\n            statusBar: {\n              notifications: 'hide',\n              wifiSignal: 'strong',\n              cellSignal: 'strong',\n              networkBar: 'hidden',\n              batteryLevel: 'full',\n              charging: true,\n              clock: '1234',\n            },\n          };\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept object with extends property (minimal)', () => {\n          deviceConfig.systemUI = {\n            extends: 'minimal',\n            navigationMode: 'gesture',\n            statusBar: {\n              charging: false,\n            },\n          };\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept object with extends property (genymotion)', () => {\n          deviceConfig.systemUI = {\n            extends: 'genymotion',\n            keyboard: 'show',\n            statusBar: {\n              notifications: 'show',\n            },\n          };\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept partial object configuration', () => {\n          deviceConfig.systemUI = {\n            keyboard: 'hide',\n            touches: 'show',\n          };\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept empty object', () => {\n          deviceConfig.systemUI = {};\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept valid statusBar.clock format', () => {\n          deviceConfig.systemUI = {\n            statusBar: {\n              clock: '1234',\n            },\n          };\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept valid statusBar.cellSignal values', () => {\n          ['strong', 'weak', 'none'].forEach(cellSignal => {\n            deviceConfig.systemUI = {\n              statusBar: {\n                cellSignal,\n              },\n            };\n            expect(compose).not.toThrow();\n          });\n        });\n      });\n\n      describe('invalid configurations', () => {\n        it('should reject non-string, non-object values', () => {\n          deviceConfig.systemUI = 42;\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid string values', () => {\n          deviceConfig.systemUI = 'invalid';\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid extends value', () => {\n          deviceConfig.systemUI = { extends: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid keyboard value', () => {\n          deviceConfig.systemUI = { keyboard: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid touches value', () => {\n          deviceConfig.systemUI = { touches: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid pointerLocationBar value', () => {\n          deviceConfig.systemUI = { pointerLocationBar: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid navigationMode value', () => {\n          deviceConfig.systemUI = { navigationMode: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject non-object statusBar', () => {\n          deviceConfig.systemUI = { statusBar: 'invalid' };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.notifications', () => {\n          deviceConfig.systemUI = { statusBar: { notifications: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.wifiSignal', () => {\n          deviceConfig.systemUI = { statusBar: { wifiSignal: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.cellSignal', () => {\n          deviceConfig.systemUI = { statusBar: { cellSignal: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.batteryLevel', () => {\n          deviceConfig.systemUI = { statusBar: { batteryLevel: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.charging', () => {\n          deviceConfig.systemUI = { statusBar: { charging: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.clock (non-string)', () => {\n          deviceConfig.systemUI = { statusBar: { clock: 1234 } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should reject invalid statusBar.clock (wrong format)', () => {\n          deviceConfig.systemUI = { statusBar: { clock: 'invalid' } };\n          expect(compose).toThrow(\"Expected 'minimal', 'genymotion' or an object\");\n        });\n\n        it('should accept statusBar.clock', () => {\n          deviceConfig.systemUI = { statusBar: { clock: '1234' } };\n          expect(compose).not.toThrow();\n        });\n      });\n\n      describe('device type restrictions', () => {\n        it('should reject systemUI for ios.simulator', () => {\n          setConfig('ios.simulator', 'aliased');\n          deviceConfig.systemUI = 'minimal';\n          expect(compose).toThrow('does not support \"systemUI\" property');\n        });\n\n        it('should accept systemUI for android.attached', () => {\n          setConfig('android.attached', 'aliased');\n          deviceConfig.systemUI = 'minimal';\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept systemUI for android.emulator', () => {\n          setConfig('android.emulator', 'aliased');\n          deviceConfig.systemUI = 'minimal';\n          expect(compose).not.toThrow();\n        });\n\n        it('should accept systemUI for android.genycloud', () => {\n          setConfig('android.genycloud', 'aliased');\n          deviceConfig.systemUI = 'minimal';\n          expect(compose).not.toThrow();\n        });\n      });\n    });\n\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeLoggerConfig.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\nconst _ = require('lodash');\n\nconst { castLevel, defaultOptions } = require('../logger/DetoxLogger');\n\n/**\n * @param {object} opts\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @param {*} opts.cliConfig\n */\nfunction composeLoggerConfig(opts) {\n  const { globalConfig, localConfig, cliConfig } = opts;\n\n  const items = [\n    {\n      level: 'info',\n      overrideConsole: true,\n      options: defaultOptions,\n    },\n    globalConfig.logger,\n    localConfig.logger,\n    adaptCLI(cliConfig),\n  ];\n\n  return items.reduce(\n    /**\n     * @param {Partial<Detox.DetoxLoggerConfig>} acc\n     * @param config\n     */\n    (acc, config) => {\n      if (!config) return acc;\n      const { options } = config;\n      return _.merge(acc, {\n        // @ts-ignore-line\n        options: typeof options === 'function' ? options(acc) : options\n      });\n    },\n    items.reduce((a, b) => _.merge(a, _.omit(b, 'options')), {})\n  );\n}\n\nfunction adaptCLI(cliConfig) {\n  const result = {};\n\n  if (cliConfig.loglevel !== undefined) {\n    result.level = castLevel(cliConfig.loglevel);\n  }\n\n  if (cliConfig.useCustomLogger !== undefined) {\n    result.overrideConsole = cliConfig.useCustomLogger;\n  }\n\n  if (cliConfig.noColor) {\n    result.options = { colors: false };\n  }\n\n  return result;\n}\n\nmodule.exports = composeLoggerConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeLoggerConfig.test.js",
    "content": "describe('composeLoggerConfig', () => {\n  let composeLoggerConfig;\n  let cliConfig, localConfig, globalConfig;\n\n  beforeEach(() => {\n    cliConfig = {};\n    localConfig = {};\n    globalConfig = {};\n\n    composeLoggerConfig = require('./composeLoggerConfig');\n  });\n\n  let composed = () => composeLoggerConfig({\n    cliConfig,\n    localConfig,\n    globalConfig,\n  });\n\n  it('should return a default behavior if nothing is set', () => {\n    expect(composed()).toEqual({\n      level: 'info',\n      overrideConsole: true,\n      options: {\n        showDate: expect.any(Function),\n        showLoggerName: true,\n        showPid: true,\n        showLevel: false,\n        showMetadata: false,\n        showPrefixes: expect.any(Function),\n        basepath: expect.any(String),\n        prefixers: {\n          'ph': expect.any(Function),\n        },\n        stringifiers: {\n          'args': expect.any(Function),\n          'data': expect.any(Function),\n          'error': expect.any(Function),\n        },\n      },\n    });\n  });\n\n  it('should never return \"options\" as a function', () => {\n    expect(composed().options).not.toBeInstanceOf(Function);\n  });\n\n  describe.each([\n    ['local config'],\n    ['global config'],\n  ])('if a %s has overrides', (description) => {\n    beforeEach(() => {\n      const config = description.startsWith('local') ? localConfig : globalConfig;\n      config.logger = {\n        level: 'debug',\n        overrideConsole: false,\n        options: {\n          showLoggerName: false,\n          prefixers: {\n            somethingElse: jest.fn(),\n          }\n        },\n      };\n    });\n\n    it('should apply them upon the defaults', () => {\n      expect(composed()).toEqual({\n        level: 'debug',\n        overrideConsole: false,\n        options: expect.objectContaining({\n          showLoggerName: false,\n          showPrefixes: expect.any(Function),\n          showPid: true,\n          prefixers: expect.objectContaining({\n            'cat': expect.any(Function),\n            somethingElse: expect.any(Function),\n          }),\n        }),\n      });\n    });\n  });\n\n  describe('if a CLI config has overrides', () => {\n    beforeEach(() => {\n      cliConfig.loglevel = 'trace';\n      cliConfig.noColor = true;\n      cliConfig.useCustomLogger = false;\n    });\n\n    it('should apply them upon the defaults', () => {\n      expect(composed()).toEqual({\n        level: 'trace',\n        overrideConsole: false,\n        options: expect.objectContaining({\n          colors: false,\n          showPid: true,\n          prefixers: expect.objectContaining({\n            ph: expect.any(Function),\n            id: expect.any(Function),\n          }),\n        }),\n      });\n    });\n\n    it('should adapt loglevel=verbose -> debug', () => {\n      cliConfig.loglevel = 'verbose';\n\n      expect(composed()).toEqual(expect.objectContaining({\n        level: 'debug',\n      }));\n    });\n  });\n\n  test('configs should have priority: CLI > local > global > defaults', () => {\n    globalConfig.logger = {\n      level: 'warn',\n      overrideConsole: false,\n      options: {\n        colors: {},\n        indent: '\\t',\n        showDate: jest.fn(),\n      },\n    };\n\n    localConfig.logger = {\n      level: 'error',\n      overrideConsole: true,\n      options: {\n        colors: { 40: 'yellow' },\n        showDate: jest.fn(),\n      },\n    };\n\n    cliConfig = {\n      loglevel: 'fatal',\n      noColor: true,\n      useCustomLogger: true,\n    };\n\n    expect(composed()).toEqual({\n      level: 'fatal',\n      overrideConsole: true,\n      options: expect.objectContaining({\n        colors: false,\n        indent: '\\t',\n        showDate: localConfig.logger.options.showDate,\n      }),\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/composeRunnerConfig.js",
    "content": "const path = require('path');\nconst process = require('process');\n\nconst _ = require('lodash');\nconst resolveFrom = require('resolve-from');\n\nconst log = require('../utils/logger');\n\n/**\n * @param {object} opts\n * @param {Detox.DetoxConfig} opts.globalConfig\n * @param {Detox.DetoxConfiguration} opts.localConfig\n * @param {DetoxInternals.CLIConfig} opts.cliConfig\n * @param {Record<string, any>} opts.testRunnerArgv\n * @param {import('../errors/DetoxConfigErrorComposer')} opts.errorComposer\n * @returns {Detox.DetoxTestRunnerConfig} opts.testRunnerArgv\n */\nfunction composeRunnerConfig(opts) {\n  const globalConfig = adaptLegacyRunnerConfig(opts.globalConfig);\n  if (globalConfig != null && typeof globalConfig !== 'object') {\n    throw opts.errorComposer.invalidTestRunnerProperty(true);\n  }\n\n  const localConfig = opts.localConfig.testRunner;\n  if (localConfig != null && typeof localConfig !== 'object') {\n    throw opts.errorComposer.invalidTestRunnerProperty(false);\n  }\n\n  const cliConfig = opts.cliConfig;\n\n  /** @type {Detox.DetoxTestRunnerConfig} */\n  const merged = _.merge(\n    {\n      retries: 0,\n      inspectBrk: inspectBrkHookDefault,\n      forwardEnv: false,\n      detached: false,\n      bail: false,\n      noRetryArgs: ['shard'],\n      jest: {\n        setupTimeout: 300000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: false,\n        reportSpecs: undefined,\n        reportWorkerAssign: true,\n      },\n      args: {\n        $0: 'jest',\n        _: [],\n      },\n    },\n    globalConfig,\n    localConfig,\n    cliConfig.retries != null ? { retries: cliConfig.retries } : null,\n    cliConfig.jestReportSpecs != null ? { jest: { reportSpecs: cliConfig.jestReportSpecs } } : null,\n    {\n      args: _.omitBy(opts.testRunnerArgv, hasEmptyPositionalArgs)\n    }\n  );\n\n  if (typeof merged.inspectBrk === 'function') {\n    if (cliConfig.inspectBrk) {\n      merged.detached = false;\n      merged.forwardEnv = true;\n      merged.retries = 0;\n      merged.inspectBrk(merged);\n    }\n\n    delete merged.inspectBrk;\n  }\n\n  return merged;\n}\n\nfunction adaptLegacyRunnerConfig(globalConfig) {\n  let isLegacy = false;\n\n  const runnerConfigKey = 'runnerConfig' in globalConfig ? 'runnerConfig' : 'runner-config';\n  if (_.isString(globalConfig[runnerConfigKey])) {\n    isLegacy = true;\n    log.warn(`Detected a deprecated \"${runnerConfigKey}\" property (string).`);\n  }\n\n  const testRunnerKey = 'testRunner' in globalConfig ? 'testRunner' : 'test-runner';\n  if (_.isString(globalConfig[testRunnerKey])) {\n    isLegacy = true;\n    log.warn(`Detected a deprecated \"${testRunnerKey}\" property (string).`);\n  }\n\n  if (globalConfig.specs != null) {\n    isLegacy = true;\n    log.warn(`Detected a deprecated \"specs\" property.`);\n  }\n\n  if (!isLegacy) {\n    return globalConfig.testRunner;\n  }\n\n  log.warn(`Please migrate your Detox config according to the guide:\\nhttps://wix.github.io/Detox/docs/guide/migration\\n`);\n  const testRunner = globalConfig[testRunnerKey];\n  const runnerConfig = globalConfig[runnerConfigKey];\n  const specs = globalConfig.specs != null ? String(globalConfig.specs) : undefined;\n\n  const args = {};\n  if (_.isString(testRunner)) {\n    args.$0 = testRunner;\n  }\n\n  if (_.isString(runnerConfig)) {\n    args.config = runnerConfig;\n  }\n\n  if (specs) {\n    args._ = [specs];\n  }\n\n  return { args };\n}\n\nfunction hasEmptyPositionalArgs(value, key) {\n  return key === '_' ? _.isEmpty(value) : false;\n}\n\n/**\n * @param {Detox.DetoxTestRunnerConfig} config\n */\nfunction inspectBrkHookDefault(config) {\n  const cwd = process.cwd();\n  const binAbsolute = resolveFrom(cwd, 'jest/bin/jest');\n  const bin = path.relative(cwd, binAbsolute);\n  config.args.$0 = `node --inspect-brk ${bin}`;\n  config.args.runInBand = true;\n  delete config.args.w;\n  delete config.args.workers;\n}\n\nmodule.exports = composeRunnerConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeRunnerConfig.test.js",
    "content": "describe('composeRunnerConfig', () => {\n  let composeRunnerConfig;\n  let globalConfig, localConfig, cliConfig, testRunnerArgv;\n\n  beforeEach(() => {\n    globalConfig = {};\n    localConfig = {};\n    cliConfig = {};\n    testRunnerArgv = undefined;\n\n    composeRunnerConfig = () => {\n      const { DetoxConfigErrorComposer } = require('../errors');\n      const errorComposer = new DetoxConfigErrorComposer()\n        .setConfigurationName('default')\n        .setDetoxConfig({\n          ...globalConfig,\n          configurations: {\n            default: {\n              ...localConfig,\n            },\n          },\n        });\n\n      return require('./composeRunnerConfig')({\n        globalConfig,\n        localConfig,\n        cliConfig,\n        testRunnerArgv,\n        errorComposer,\n      });\n    };\n  });\n\n  it('should return default test runner args as if it is Jest', () => {\n    expect(composeRunnerConfig()).toEqual({\n      args: {\n        $0: 'jest',\n        _: [],\n      },\n      jest: {\n        setupTimeout: 300000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: false,\n        reportSpecs: undefined,\n        reportWorkerAssign: true,\n      },\n      retries: 0,\n      bail: false,\n      detached: false,\n      forwardEnv: false,\n      noRetryArgs: ['shard'],\n    });\n  });\n\n  it('should take overrides from globalConfig', () => {\n    globalConfig.testRunner = {\n      args: { $0: 'nyc jest' },\n      jest: {\n        setupTimeout: 5000,\n        retryAfterCircusRetries: true,\n        reportSpecs: false,\n      },\n      bail: true,\n      retries: 1,\n      detached: true,\n      forwardEnv: true,\n      noRetryArgs: ['shard', 'customArg'],\n    };\n\n    expect(composeRunnerConfig()).toEqual({\n      args: {\n        $0: 'nyc jest',\n        _: [],\n      },\n      jest: {\n        setupTimeout: 5000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: true,\n        reportSpecs: false,\n        reportWorkerAssign: true,\n      },\n      bail: true,\n      retries: 1,\n      detached: true,\n      forwardEnv: true,\n      noRetryArgs: ['shard', 'customArg'],\n    });\n  });\n\n  it('should take overrides from localConfig', () => {\n    localConfig.testRunner = {\n      args: { $0: 'nyc jest' },\n      jest: {\n        setupTimeout: 120000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: true,\n        reportSpecs: true,\n      },\n      bail: true,\n      retries: 1,\n      detached: true,\n      forwardEnv: true,\n      noRetryArgs: ['anotherArg', 'yetAnotherArg'],\n    };\n\n    expect(composeRunnerConfig()).toEqual({\n      args: {\n        $0: 'nyc jest',\n        _: [],\n      },\n      jest: {\n        setupTimeout: 120000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: true,\n        reportSpecs: true,\n        reportWorkerAssign: true,\n      },\n      bail: true,\n      retries: 1,\n      detached: true,\n      forwardEnv: true,\n      noRetryArgs: ['anotherArg', 'yetAnotherArg'],\n    });\n  });\n\n  it('should take --retries overrides from cliConfig', () => {\n    localConfig.testRunner = {\n      retries: 1,\n    };\n\n    cliConfig.retries = 5;\n\n    expect(composeRunnerConfig()).toEqual(expect.objectContaining({\n      retries: 5,\n    }));\n  });\n\n  it('should take --inspect-brk overrides from cliConfig', () => {\n    globalConfig.testRunner = {\n      forwardEnv: false,\n      retries: 1,\n    };\n\n    cliConfig.inspectBrk = true;\n\n    expect(composeRunnerConfig()).toEqual(expect.objectContaining({\n      args: expect.objectContaining({\n        $0: expect.stringMatching(/--inspect-brk.*jest/),\n        runInBand: true,\n      }),\n      retries: 0,\n      forwardEnv: true,\n    }));\n  });\n\n  it('should not do anything if inspectBrk hook is nullified', () => {\n    globalConfig.testRunner = {\n      args: { $0: 'jest' },\n      retries: 1,\n      inspectBrk: null,\n    };\n\n    cliConfig.inspectBrk = true;\n\n    expect(composeRunnerConfig()).toEqual(expect.objectContaining({\n      args: expect.objectContaining({\n        $0: 'jest',\n      }),\n      retries: 1,\n    }));\n  });\n\n  it('should provide inspectBrk hook customization', () => {\n    const inspectBrk = jest.fn((config) => {\n      config.hello = true;\n    });\n\n    globalConfig.testRunner = { inspectBrk };\n    cliConfig.inspectBrk = true;\n    const runnerConfig = composeRunnerConfig();\n\n    expect(runnerConfig).not.toHaveProperty('inspectBrk');\n    expect(runnerConfig.hello).toBe(true);\n    expect(inspectBrk).toHaveBeenCalledWith(runnerConfig);\n  });\n\n  it('should apply --jest-report-specs overrides from cliConfig onto globalConfig and localConfig', () => {\n    globalConfig.testRunner = {\n      jest: { customProperty: 1 },\n    };\n\n    localConfig.testRunner = {\n      jest: { otherProperty: true },\n    };\n\n    cliConfig.jestReportSpecs = true;\n\n    expect(composeRunnerConfig()).toEqual(expect.objectContaining({\n      jest: {\n        customProperty: 1,\n        setupTimeout: 300000,\n        teardownTimeout: 30000,\n        otherProperty: true,\n        retryAfterCircusRetries: false,\n        reportSpecs: true,\n        reportWorkerAssign: true,\n      },\n    }));\n  });\n\n  it('should take overrides from testRunnerArgv', () => {\n    testRunnerArgv = {\n      listFiles: true,\n    };\n\n    expect(composeRunnerConfig().args).toEqual({\n      $0: 'jest',\n      listFiles: true,\n      _: [],\n    });\n  });\n\n  it('should prefer localConfig to globalConfig when overriding', () => {\n    globalConfig.testRunner = {\n      _privateGlobalProperty: false,\n      args: {\n        $0: 'nyc jest',\n        _: ['first.test.js'],\n        maxWorkers: 3,\n      },\n      jest: {\n        reportSpecs: true,\n      },\n      bail: true,\n      detached: true,\n      retries: 1,\n      noRetryArgs: ['shard', 'customArg'],\n    };\n\n    localConfig.testRunner = {\n      _privateLocalProperty: null,\n      args: {\n        $0: 'jest2',\n        bail: true,\n        _: ['second.test.js'],\n      },\n      jest: {\n        reportSpecs: false,\n      },\n      bail: false,\n      detached: false,\n      retries: 3,\n      noRetryArgs: ['anotherArg', 'yetAnotherArg'],\n    };\n\n    expect(composeRunnerConfig()).toEqual({\n      _privateGlobalProperty: false,\n      _privateLocalProperty: null,\n      args: {\n        $0: 'jest2',\n        bail: true,\n        maxWorkers: 3,\n        _: ['second.test.js'],\n      },\n      jest: {\n        setupTimeout: 300000,\n        teardownTimeout: 30000,\n        retryAfterCircusRetries: false,\n        reportSpecs: false,\n        reportWorkerAssign: true,\n      },\n      bail: false,\n      detached: false,\n      retries: 3,\n      forwardEnv: false,\n      noRetryArgs: ['anotherArg', 'yetAnotherArg'],\n    });\n  });\n\n  it('should support positional CLI args override', () => {\n    localConfig.testRunner = {\n      args: {\n        _: ['default.test.js'],\n        verbose: true,\n      },\n    };\n\n    testRunnerArgv = {\n      _: [],\n      debug: true,\n    };\n\n    expect(composeRunnerConfig().args).toEqual({\n      $0: 'jest',\n      debug: true,\n      verbose: true,\n      _: ['default.test.js'],\n    });\n\n    testRunnerArgv._[0] = 'specific.test.js';\n    expect(composeRunnerConfig().args._).toEqual(['specific.test.js']);\n  });\n\n  it('should also support simple positional arguments merging with CLI args', () => {\n    localConfig.testRunner = {\n      args: {\n        _: ['fallback.test.js']\n      },\n    };\n\n    testRunnerArgv = { _: [] };\n    expect(composeRunnerConfig().args._).toEqual(['fallback.test.js']);\n\n    testRunnerArgv = { _: undefined };\n    expect(composeRunnerConfig().args._).toEqual(['fallback.test.js']);\n\n    testRunnerArgv = { _: ['override.test.js'] };\n    expect(composeRunnerConfig().args._).toEqual(['override.test.js']);\n  });\n\n  describe('legacy fallbacks', () => {\n    let log;\n\n    beforeEach(() => {\n      jest.mock('../utils/logger');\n      log = require('../utils/logger');\n    });\n\n    test('deprecated \"test-runner\"', () => {\n      globalConfig['test-runner'] = 'nyc jest';\n      expect(composeRunnerConfig().args).toEqual({ $0: 'nyc jest', _: [] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"test-runner\" property'));\n    });\n\n    test('deprecated \"testRunner\"', () => {\n      globalConfig['testRunner'] = 'nyc jest';\n      expect(composeRunnerConfig().args).toEqual({ $0: 'nyc jest', _: [] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"testRunner\" property'));\n    });\n\n    test('deprecated \"runner-config\"', () => {\n      globalConfig['runner-config'] = 'e2e/config.json';\n      expect(composeRunnerConfig().args).toEqual({ $0: 'jest', config: 'e2e/config.json', _: [] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"runner-config\" property'));\n    });\n\n    test('deprecated \"runnerConfig\"', () => {\n      globalConfig['runnerConfig'] = 'e2e/config.json';\n      expect(composeRunnerConfig().args).toEqual({ $0: 'jest', config: 'e2e/config.json', _: [] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"runnerConfig\" property'));\n    });\n\n    test('deprecated \"specs\"', () => {\n      globalConfig['specs'] = '.';\n      expect(composeRunnerConfig().args).toEqual({ $0: 'jest', _: ['.'] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"specs\" property'));\n    });\n\n    test('deprecated \"specs\": empty array workaround', () => {\n      globalConfig['specs'] = [];\n      expect(composeRunnerConfig().args).toEqual({ $0: 'jest', _: [] });\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('\"specs\" property'));\n    });\n  });\n\n  describe('unhappy scenarios', () => {\n    test('non-string and non-object \"testRunner\" in global config', () => {\n      globalConfig['testRunner'] = 0;\n      expect(composeRunnerConfig).toThrowErrorMatchingSnapshot();\n    });\n\n    test('deprecated \"testRunner\" in local config', () => {\n      localConfig['testRunner'] = 'nyc jest';\n      expect(composeRunnerConfig).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n});\n"
  },
  {
    "path": "detox/src/configuration/composeSessionConfig.js",
    "content": "const isValidWebsocketURL = require('../utils/isValidWebsocketURL');\n\n/**\n * @param {{\n *  cliConfig: Record<string, any>;\n *  globalConfig: Detox.DetoxConfig;\n *  localConfig: Detox.DetoxConfiguration;\n *  errorComposer: import('../errors/DetoxConfigErrorComposer');\n * }} options\n */\nasync function composeSessionConfig(options) {\n  const { errorComposer, cliConfig, globalConfig, localConfig } = options;\n\n  const session = {\n    ...globalConfig.session,\n    ...localConfig.session,\n  };\n\n  if (session.server != null) {\n    const value = session.server;\n    if (typeof value !== 'string' || !isValidWebsocketURL(value)) {\n      throw errorComposer.invalidServerProperty();\n    }\n  }\n\n  if (session.sessionId != null) {\n    const value = session.sessionId;\n    if (typeof value !== 'string' || value.length === 0) {\n      throw errorComposer.invalidSessionIdProperty();\n    }\n  }\n\n  if (session.debugSynchronization != null) {\n    const value = session.debugSynchronization;\n    if (typeof value !== 'number' || value < 0) {\n      throw errorComposer.invalidDebugSynchronizationProperty();\n    }\n  }\n\n  if (session.ignoreUnexpectedMessages != null) {\n    const value = session.ignoreUnexpectedMessages;\n    if (typeof value !== 'boolean') {\n      throw errorComposer.invalidIgnoreUnexpectedMessagesProperty();\n    }\n  }\n\n  if (Number.parseInt(cliConfig.debugSynchronization, 10) >= 0) {\n    session.debugSynchronization = +cliConfig.debugSynchronization;\n  }\n\n  if (cliConfig.ignoreUnexpectedWsMessages != null) {\n    session.ignoreUnexpectedMessages = cliConfig.ignoreUnexpectedWsMessages;\n  }\n\n  const result = {\n    autoStart: !session.server,\n    debugSynchronization: 10000,\n\n    ...session,\n  };\n\n  if (!result.server && !result.autoStart) {\n    throw errorComposer.cannotSkipAutostartWithMissingServer();\n  }\n\n  return result;\n}\n\nmodule.exports = composeSessionConfig;\n"
  },
  {
    "path": "detox/src/configuration/composeSessionConfig.test.js",
    "content": "const DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\ndescribe('composeSessionConfig', () => {\n  let composeSessionConfig;\n  let cliConfig, globalConfig, localConfig;\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n\n  beforeEach(() => {\n    composeSessionConfig = require('./composeSessionConfig');\n    errorComposer = new DetoxConfigErrorComposer();\n    cliConfig = {};\n    globalConfig = {};\n    localConfig = {};\n  });\n\n  const compose = () => composeSessionConfig({\n    cliConfig,\n    globalConfig,\n    localConfig,\n    errorComposer,\n  });\n\n  it('should generate a default config', async () => {\n    expect(await compose()).toEqual({\n      autoStart: true,\n      debugSynchronization: 10000,\n      server: undefined,\n      sessionId: undefined,\n    });\n  });\n\n  describe('sessionId', function() {\n    it('should pass validations', async () => {\n      globalConfig.session = { sessionId: 1234 };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidSessionIdProperty());\n\n      globalConfig.session = { sessionId: '' };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidSessionIdProperty());\n    });\n\n    describe('when defined in global config', () => {\n      beforeEach(() => {\n        globalConfig.session = { sessionId: 'someSessionId' };\n      });\n\n      it('should use the specified value', async () => {\n        expect((await compose()).sessionId).toBe('someSessionId');\n      });\n\n      describe('and in local config', () => {\n        beforeEach(() => {\n          localConfig.session = { sessionId: 'otherSessionId' };\n        });\n\n        it('should use the specified value', async () => {\n          expect((await compose()).sessionId).toBe('otherSessionId');\n        });\n      });\n    });\n  });\n\n  describe('server', function() {\n    describe('by default', () => {\n      it('should be undefined', async () => {\n        expect(await compose()).not.toHaveProperty('server');\n      });\n    });\n\n    it('should pass validations', async () => {\n      globalConfig.session = { server: 1234 };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidServerProperty());\n\n      globalConfig.session = { server: 'http://invalid-protocol.com' };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidServerProperty());\n    });\n\n    describe('when defined in global config', () => {\n      beforeEach(() => {\n        globalConfig.session = { server: 'ws://myserver:1100' };\n      });\n\n      it('should use the specified value', async () => {\n        expect(await compose()).toMatchObject({\n          server: 'ws://myserver:1100',\n        });\n      });\n\n      describe('and in local config', () => {\n        beforeEach(() => {\n          localConfig.session = { server: 'ws://otherserver:1100' };\n        });\n\n        it('should use the specified value', async () => {\n          expect(await compose()).toMatchObject({\n            server: 'ws://otherserver:1100',\n          });\n        });\n      });\n    });\n  });\n\n  describe('autoStart', function() {\n    describe('by default', () => {\n      it('should be true', async () => {\n        expect(await compose()).toMatchObject({ autoStart: true });\n      });\n    });\n\n    describe('when autoStart is explicitly false', function() {\n      beforeEach(() => {\n        globalConfig.session = { autoStart: false };\n      });\n\n      it('should throw an error if the server is not defined', async () => {\n        await expect(compose).rejects.toThrow(errorComposer.cannotSkipAutostartWithMissingServer());\n      });\n    });\n\n    describe('when server is defined', () => {\n      beforeEach(() => {\n        globalConfig.session = { server: 'ws://localhost:1100' };\n      });\n\n      it('should be false', async () => {\n        expect(await compose()).toMatchObject({ autoStart: false });\n      });\n\n      describe('when autoStart is explicitly true', function() {\n        beforeEach(() => {\n          globalConfig.session.autoStart = true;\n        });\n\n        it('should override the value', async () => {\n          expect(await compose()).toMatchObject({ autoStart: true });\n        });\n      });\n    });\n  });\n\n  describe('debugSynchronization', function () {\n    describe('by default', () => {\n      it('should be 10000ms', async () => {\n        expect(await compose()).toMatchObject({\n          debugSynchronization: 10000,\n        });\n      });\n    });\n\n    it('should pass validations', async () => {\n      globalConfig.session = { debugSynchronization: -1 };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidDebugSynchronizationProperty());\n\n      globalConfig.session = { debugSynchronization: '3000' };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidDebugSynchronizationProperty());\n    });\n\n    describe('when defined in global config', () => {\n      beforeEach(() => {\n        globalConfig.session = { debugSynchronization: 9999 };\n      });\n\n      it('should use that value', async () => {\n        expect(await compose()).toMatchObject({\n          debugSynchronization: 9999,\n        });\n      });\n\n      describe('and in local config', () => {\n        beforeEach(() => {\n          localConfig.session = { debugSynchronization: 20000 };\n        });\n\n        it('should use that value', async () => {\n          expect(await compose()).toMatchObject({\n            debugSynchronization: 20000,\n          });\n        });\n\n        describe('and in CLI config', () => {\n          it('should use that value if it is valid', async () => {\n            cliConfig.debugSynchronization = '0';\n            expect(await compose()).toMatchObject({\n              debugSynchronization: 0,\n            });\n          });\n\n          it('should ignore that value if it is invalid', async () => {\n            cliConfig.debugSynchronization = 'true';\n            expect(await compose()).toMatchObject({\n              debugSynchronization: 20000,\n            });\n          });\n\n          it('should ignore that value if it is empty', async () => {\n            cliConfig.debugSynchronization = '';\n            expect(await compose()).toMatchObject({\n              debugSynchronization: 20000,\n            });\n          });\n        });\n      });\n    });\n  });\n\n  describe('ignoreUnexpectedMessages', function () {\n    describe('by default', () => {\n      it('should be undefined', async () => {\n        const config = await compose();\n        expect(config.ignoreUnexpectedMessages).toBeUndefined();\n      });\n    });\n\n    it('should pass validations', async () => {\n      globalConfig.session = { ignoreUnexpectedMessages: 'true' };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidIgnoreUnexpectedMessagesProperty());\n\n      globalConfig.session = { ignoreUnexpectedMessages: 1 };\n      await expect(compose()).rejects.toThrow(errorComposer.invalidIgnoreUnexpectedMessagesProperty());\n    });\n\n    describe('when defined in global config', () => {\n      beforeEach(() => {\n        globalConfig.session = { ignoreUnexpectedMessages: true };\n      });\n\n      it('should use that value', async () => {\n        expect(await compose()).toMatchObject({\n          ignoreUnexpectedMessages: true,\n        });\n      });\n\n      describe('and in local config', () => {\n        beforeEach(() => {\n          localConfig.session = { ignoreUnexpectedMessages: false };\n        });\n\n        it('should use the local config value', async () => {\n          expect(await compose()).toMatchObject({\n            ignoreUnexpectedMessages: false,\n          });\n        });\n\n        describe('and in CLI config', () => {\n          it('should use CLI config value when true', async () => {\n            cliConfig.ignoreUnexpectedWsMessages = true;\n            expect(await compose()).toMatchObject({\n              ignoreUnexpectedMessages: true,\n            });\n          });\n\n          it('should use CLI config value when false', async () => {\n            localConfig.session = { ignoreUnexpectedMessages: true };\n            cliConfig.ignoreUnexpectedWsMessages = false;\n            expect(await compose()).toMatchObject({\n              ignoreUnexpectedMessages: false,\n            });\n          });\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/configurations.mock.js",
    "content": "const InstrumentsArtifactPlugin = require('../artifacts/instruments/InstrumentsArtifactPlugin');\nconst LogArtifactPlugin = require('../artifacts/log/LogArtifactPlugin');\nconst ScreenshotArtifactPlugin = require('../artifacts/screenshot/ScreenshotArtifactPlugin');\nconst IosUIHierarchyPlugin = require('../artifacts/uiHierarchy/IosUIHierarchyPlugin');\nconst VideoArtifactPlugin = require('../artifacts/video/VideoArtifactPlugin');\n\nconst defaultArtifactsConfiguration = {\n  rootDir: 'artifacts',\n  pathBuilder: null,\n  plugins: {\n    log: 'none',\n    screenshot: 'manual',\n    video: 'none',\n    instruments: 'none',\n    uiHierarchy: 'disabled',\n  },\n};\n\nconst allArtifactsConfiguration = {\n  rootDir: 'artifacts',\n  pathBuilder: null,\n  plugins: {\n    log: 'all',\n    screenshot: 'all',\n    video: 'all',\n    instruments: 'all',\n    uiHierarchy: 'enabled',\n  },\n};\n\nconst pluginsDefaultsResolved = {\n  log: LogArtifactPlugin.parseConfig('none'),\n  screenshot: ScreenshotArtifactPlugin.parseConfig('manual'),\n  video: VideoArtifactPlugin.parseConfig('none'),\n  instruments: InstrumentsArtifactPlugin.parseConfig('none'),\n  uiHierarchy: IosUIHierarchyPlugin.parseConfig('disabled'),\n};\n\nconst pluginsFailingResolved = {\n  log: LogArtifactPlugin.parseConfig('failing'),\n  screenshot: ScreenshotArtifactPlugin.parseConfig('failing'),\n  video: VideoArtifactPlugin.parseConfig('failing'),\n};\n\nconst pluginsAllResolved = {\n  log: LogArtifactPlugin.parseConfig('all'),\n  screenshot: ScreenshotArtifactPlugin.parseConfig('all'),\n  video: VideoArtifactPlugin.parseConfig('all'),\n  instruments: InstrumentsArtifactPlugin.parseConfig('all'),\n  uiHierarchy: IosUIHierarchyPlugin.parseConfig('enabled'),\n};\n\nconst appWithNoBinary = {\n  type: 'ios.app',\n  bundleId: 'com.detox.example',\n};\n\nconst appWithRelativeBinaryPath = {\n  type: 'ios.app',\n  binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/example.app',\n};\n\nconst appWithAbsoluteBinaryPath = {\n  type: 'ios.app',\n  binaryPath: process.platform === 'win32' ? 'C:\\\\Temp\\\\abcdef\\\\123' : '/tmp/abcdef/123',\n};\n\nconst appWithBinaryAndBundleId = {\n  type: 'ios.app',\n  binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/example.app',\n  bundleId: 'com.detox.example',\n};\n\nconst apkWithBinary = {\n  type: 'android.apk',\n  binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n  testBinaryPath: 'android/app/build/outputs/apk/release/app-release-androidTest.apk',\n};\n\nconst iosSimulatorWithShorthandQuery = {\n  type: 'ios.simulator',\n  device: 'iPhone 7 Plus, iOS 10.2'\n};\n\nconst iosSimulatorWithDetailedQuery = {\n  type: 'ios.simulator',\n  device: {\n    type: 'iPhone 7 Plus',\n    os: 'iOS 10.2',\n  },\n};\n\nconst validSession = {\n  server: 'ws://localhost:8099',\n  sessionId: 'test',\n  debugSynchronization: 10000,\n};\n\nconst androidEmulator = {\n  'type': 'android.emulator',\n  'device': {\n    'avdName': 'Pixel_API_28',\n  },\n};\n\nconst androidEmulatorWithShorthandQuery = {\n  'type': 'android.emulator',\n  'device': 'Pixel_API_28',\n};\n\nmodule.exports = {\n  allArtifactsConfiguration,\n  defaultArtifactsConfiguration,\n  pluginsAllResolved,\n  pluginsDefaultsResolved,\n  pluginsFailingResolved,\n\n  validSession,\n\n  appWithNoBinary,\n  appWithRelativeBinaryPath,\n  appWithAbsoluteBinaryPath,\n  appWithBinaryAndBundleId,\n  apkWithBinary,\n\n  iosSimulatorWithShorthandQuery,\n  iosSimulatorWithDetailedQuery,\n  androidEmulator,\n  androidEmulatorWithShorthandQuery,\n};\n"
  },
  {
    "path": "detox/src/configuration/index.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\nconst collectCliConfig = require('./collectCliConfig');\nconst composeAppsConfig = require('./composeAppsConfig');\nconst composeArtifactsConfig = require('./composeArtifactsConfig');\nconst composeBehaviorConfig = require('./composeBehaviorConfig');\nconst composeCommandsConfig = require('./composeCommandsConfig');\nconst composeDeviceConfig = require('./composeDeviceConfig');\nconst composeLoggerConfig = require('./composeLoggerConfig');\nconst composeRunnerConfig = require('./composeRunnerConfig');\nconst composeSessionConfig = require('./composeSessionConfig');\nconst loadExternalConfig = require('./loadExternalConfig');\nconst selectConfiguration = require('./selectConfiguration');\n\nasync function composeDetoxConfig({\n  cwd = process.cwd(),\n  argv = undefined,\n  testRunnerArgv = undefined,\n  errorComposer = new DetoxConfigErrorComposer(),\n  override = undefined,\n}) {\n  const cliConfig = collectCliConfig({ argv, errorComposer });\n  const findupResult = await loadExternalConfig({\n    errorComposer,\n    configPath: cliConfig.configPath,\n    cwd,\n  });\n\n  const externalConfig = findupResult && findupResult.config;\n  errorComposer.setDetoxConfigPath(findupResult && findupResult.filepath);\n  errorComposer.setDetoxConfig(externalConfig);\n\n  /** @type {Detox.DetoxConfig} */\n  const globalConfig = _.merge({}, externalConfig, override);\n  if (_.isEmpty(globalConfig) && !externalConfig) {\n    // Advise to create .detoxrc somewhere\n    throw errorComposer.noConfigurationSpecified();\n  }\n  errorComposer.setDetoxConfig(globalConfig);\n\n  const { configurations } = globalConfig;\n\n  const configurationName = selectConfiguration({\n    errorComposer,\n    globalConfig,\n    cliConfig,\n  });\n\n  const localConfig = configurations[configurationName];\n\n  if (localConfig['type']) {\n    throw errorComposer.configurationShouldNotUseLegacyFormat();\n  }\n\n  const runnerConfig = composeRunnerConfig({\n    globalConfig,\n    localConfig,\n    cliConfig,\n    testRunnerArgv,\n    errorComposer,\n  });\n\n  const deviceConfig = composeDeviceConfig({\n    errorComposer,\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const appsConfig = composeAppsConfig({\n    errorComposer,\n    configurationName,\n    deviceConfig,\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const artifactsConfig = composeArtifactsConfig({\n    configurationName,\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const behaviorConfig = composeBehaviorConfig({\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const loggerConfig = composeLoggerConfig({\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const sessionConfig = await composeSessionConfig({\n    errorComposer,\n    globalConfig,\n    localConfig,\n    cliConfig,\n  });\n\n  const commandsConfig = composeCommandsConfig({\n    appsConfig,\n    localConfig,\n  });\n\n  const result = {\n    configurationName,\n\n    apps: appsConfig,\n    artifacts: artifactsConfig,\n    behavior: behaviorConfig,\n    cli: cliConfig,\n    commands: commandsConfig,\n    device: deviceConfig,\n    logger: loggerConfig,\n    testRunner: runnerConfig,\n    session: sessionConfig,\n  };\n\n  Object.defineProperty(result, 'errorComposer', {\n    enumerable: false,\n    value: errorComposer,\n  });\n\n  return result;\n}\n\nmodule.exports = {\n  composeDetoxConfig,\n};\n"
  },
  {
    "path": "detox/src/configuration/index.test.js",
    "content": "// @ts-nocheck\njest.mock('../utils/argparse');\n\nconst os = require('os');\nconst path = require('path');\n\nconst DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\ndescribe('composeDetoxConfig', () => {\n  let args;\n  let configuration;\n\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n\n  beforeEach(() => {\n    errorComposer = new DetoxConfigErrorComposer();\n\n    args = {};\n\n    require('../utils/argparse').getEnvValue.mockImplementation(key => args[key]);\n    configuration = require('./index');\n  });\n\n  describe('composeDetoxConfig', () => {\n    it('should throw an error if no config is found in package.json', async () => {\n      await expect(configuration.composeDetoxConfig({})).rejects.toThrow(\n        /external .detoxrc.json configuration/\n      );\n    });\n\n    it('should throw an error if empty config is found at path', async () => {\n      await expect(configuration.composeDetoxConfig({\n        argv: {\n          'config-path': path.join(__dirname, '__mocks__/configuration/priority/empty.js'),\n        },\n      })).rejects.toThrow(/are no configurations in/);\n    });\n\n    it('should throw an error if no config is found at all', async () => {\n      await expect(configuration.composeDetoxConfig({\n        cwd: os.homedir(),\n      })).rejects.toThrow(\n        errorComposer.noConfigurationSpecified().message\n      );\n    });\n\n    it('should throw an error if the local config has the old schema', async () => {\n      try {\n        await configuration.composeDetoxConfig({\n          cwd: path.join(__dirname, '__mocks__/configuration/oldschema'),\n          errorComposer,\n        });\n      } catch (e) {\n        // NOTE: we want errorComposer to be mutated, that's why we assert inside try-catch\n        expect(e).toEqual(errorComposer.configurationShouldNotUseLegacyFormat());\n      }\n    });\n\n    it('should return a complete Detox config merged with the file configuration', async () => {\n      const config = await configuration.composeDetoxConfig({\n        cwd: path.join(__dirname, '__mocks__/configuration/packagejson'),\n        argv: {\n          configuration: 'another',\n          'device-name': 'iPhone XS',\n          cleanup: true,\n          reuse: true,\n          'record-logs': 'all',\n        },\n        testRunnerArgv: {\n          config: 'e2e/jest.config.js',\n        },\n        override: {\n          artifacts: {\n            pathBuilder: '@some/pathbuilder-implementation',\n            plugins: {\n              log: 'none',\n              video: 'failing',\n            },\n          },\n          configurations: {\n            another: {\n              device: {\n                type: 'ios.simulator',\n                device: 'iPhone X'\n              },\n              app: {\n                type: 'ios.app',\n                binaryPath: 'path/to/app',\n              },\n            },\n          },\n        }\n      });\n\n      expect(config).toMatchObject({\n        errorComposer: {\n          configurationName: 'another',\n          filepath: path.join(__dirname, '__mocks__/configuration/packagejson/package.json'),\n        },\n        artifacts: {\n          pathBuilder: '@some/pathbuilder-implementation',\n          plugins: {\n            log: {\n              enabled: true,\n              keepOnlyFailedTestsArtifacts: false,\n            },\n            video: {\n              enabled: true,\n              keepOnlyFailedTestsArtifacts: true,\n            },\n          },\n        },\n        behavior: {\n          init: {\n            exposeGlobals: true,\n            reinstallApp: false,\n          },\n          cleanup: {\n            shutdownDevice: true,\n          }\n        },\n        cli: {\n          configuration: 'another',\n          deviceName: 'iPhone XS',\n          cleanup: true,\n          reuse: true,\n          recordLogs: 'all',\n        },\n        device: expect.objectContaining({\n          type: 'ios.simulator',\n          device: {\n            type: 'iPhone XS',\n          },\n        }),\n        logger: {\n          level: 'info',\n          overrideConsole: true,\n          options: expect.objectContaining({}),\n        },\n        testRunner: {\n          args: {\n            $0: 'jest',\n            config: 'e2e/jest.config.js',\n            _: [],\n          },\n        },\n        session: expect.objectContaining({\n          server: 'ws://localhost:9999',\n          sessionId: 'external file works',\n        }),\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/loadExternalConfig.js",
    "content": "// @ts-nocheck\nconst path = require('path');\n\nconst findUp = require('find-up');\nconst fs = require('fs-extra');\nconst _ = require('lodash');\nconst resolveFrom = require('resolve-from');\n\nconst log = require('../utils/logger').child({ cat: 'config' });\n\nasync function locateExternalConfig(cwd) {\n  return findUp([\n    '.detoxrc.cjs',\n    '.detoxrc.js',\n    '.detoxrc.json',\n    '.detoxrc',\n    'detox.config.cjs',\n    'detox.config.js',\n    'detox.config.json',\n    'package.json',\n  ], { cwd });\n}\n\nasync function loadConfig(configPath) {\n  let config = isJS(path.extname(configPath))\n    ? require(configPath)\n    : JSON.parse(await fs.readFile(configPath, 'utf8'));\n\n  if (path.basename(configPath) === 'package.json') {\n    config = config.detox;\n  }\n\n  return {\n    config,\n    filepath: configPath,\n  };\n}\n\nfunction isJS(ext) {\n  return ext === '.js' || ext === '.cjs';\n}\n\nasync function resolveConfigPath(configPath, cwd) {\n  if (!configPath) {\n    return locateExternalConfig(cwd);\n  }\n\n  const viaNodeResolution = resolveFrom.silent(cwd, configPath);\n  if (viaNodeResolution) {\n    return viaNodeResolution;\n  }\n\n  if (fs.existsSync(configPath)) {\n    log.warn('Cannot resolve Detox config path by using Node.js require() mechanism:\\n' +\n      `require(${JSON.stringify(configPath)})\\n\\n` +\n      'Detox now will resort to legacy filesystem-based path resolution.\\n' +\n      'Please fix your config path, so it conforms to `require(modulePath)` resolution.');\n\n    return path.resolve(configPath);\n  }\n\n  return null;\n}\n\nasync function tryExtendConfig({ config, errorComposer, cwd }) {\n  if (!config || !config.extends) {\n    return config;\n  }\n\n  const { config: baseConfig } = await loadExternalConfig({\n    configPath: config.extends,\n    errorComposer: errorComposer.clone().setExtends(true),\n    cwd,\n  });\n\n  return _.merge({}, baseConfig, config);\n}\n\n/**\n * @param {DetoxConfigErrorComposer} errorComposer\n * @param {string} configPath\n * @param {string} cwd\n * @returns {Promise<null|{filepath: *, config: any}>}\n */\nasync function loadExternalConfig({ errorComposer, configPath, cwd }) {\n  const resolvedConfigPath = await resolveConfigPath(configPath, cwd);\n\n  if (resolvedConfigPath) {\n    errorComposer.setDetoxConfigPath(resolvedConfigPath);\n\n    let result;\n    try {\n      result = await loadConfig(resolvedConfigPath);\n    } catch (e) {\n      throw errorComposer.failedToReadConfiguration(e);\n    }\n\n    result.config = await tryExtendConfig({\n      config: result.config,\n      cwd: path.dirname(resolvedConfigPath),\n      errorComposer,\n    });\n\n    return result;\n  } else if (configPath) {\n    throw errorComposer.noConfigurationAtGivenPath(configPath);\n  }\n\n  return null;\n}\n\nmodule.exports = loadExternalConfig;\n"
  },
  {
    "path": "detox/src/configuration/loadExternalConfig.test.js",
    "content": "const os = require('os');\nconst path = require('path');\n\ndescribe('loadExternalConfig', () => {\n  const DIR_CJS = path.join(__dirname, '__mocks__/configuration/cjs');\n  const DIR_PACKAGEJSON = path.join(__dirname, '__mocks__/configuration/packagejson');\n  const DIR_PRIORITY = path.join(__dirname, '__mocks__/configuration/priority');\n  const DIR_EXTENDS = path.join(__dirname, '__mocks__/configuration/extends');\n  const DIR_BADCONFIG = path.join(__dirname, '__mocks__/configuration/badconfig');\n\n  let DetoxConfigErrorComposer;\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n  let loadExternalConfig;\n  let logger;\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    logger = require('../utils/logger');\n\n    DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n    errorComposer = new DetoxConfigErrorComposer();\n\n    loadExternalConfig = (opts) => require('./loadExternalConfig')({\n      cwd: process.cwd(),\n      errorComposer,\n      ...opts,\n    });\n  });\n\n  it('should implicitly use .detoxrc.js, even if there is package.json', async () => {\n    const { filepath, config } = await loadExternalConfig({ cwd: DIR_PRIORITY });\n\n    expect(filepath).toBe(path.join(DIR_PRIORITY, '.detoxrc.js'));\n    expect(config).toMatchObject({ configurations: expect.anything() });\n    expect(logger.warn).not.toHaveBeenCalled();\n  });\n\n  it('should implicitly use .detoxrc.cjs', async () => {\n    const { filepath, config } = await loadExternalConfig({ cwd: DIR_CJS });\n    expect(filepath).toBe(path.join(DIR_CJS, '.detoxrc.cjs'));\n    expect(config).toMatchObject({ configurations: expect.anything() });\n    expect(logger.warn).not.toHaveBeenCalled();\n  });\n\n  it('should implicitly use package.json, even if there is no .detoxrc', async () => {\n    const { filepath, config } = await loadExternalConfig({ cwd: DIR_PACKAGEJSON });\n\n    expect(filepath).toBe(path.join(DIR_PACKAGEJSON, 'package.json'));\n    expect(config).toMatchObject({ configurations: expect.anything() });\n    expect(logger.warn).not.toHaveBeenCalled();\n  });\n\n  it('should return an empty result if a config cannot be implicitly found', async () => {\n    const result = await loadExternalConfig({ cwd: os.homedir() });\n    expect(result).toBe(null);\n  });\n\n  it('should explicitly use the specified config (via env-cli args)', async () => {\n    const configPath = path.join(DIR_PRIORITY, 'detox-config.json');\n    const { filepath, config } = await loadExternalConfig({ configPath });\n\n    expect(filepath).toBe(configPath);\n    expect(config).toMatchObject({ configurations: expect.anything() });\n    expect(logger.warn).not.toHaveBeenCalled();\n  });\n\n  it('should merge in the base config from \"extends\" property', async () => {\n    const { filepath, config } = await loadExternalConfig({ cwd: DIR_EXTENDS });\n\n    expect(filepath).toBe(path.join(DIR_EXTENDS, '.detoxrc.json'));\n    expect(config).toEqual({\n      extends: './middle',\n      artifacts: {\n        rootDir: 'someRootDir',\n        plugins: {\n          log: 'all',\n          screenshot: 'all',\n          video: 'all',\n        },\n      },\n    });\n  });\n\n  it('should throw noConfigurationAtGivenPath error if the explicitly given config is not found', async () => {\n    const configPath = path.join(DIR_PRIORITY, 'non-existent.json');\n\n    await expect(loadExternalConfig({ configPath })).rejects.toThrow(\n      errorComposer.noConfigurationAtGivenPath(configPath)\n    );\n  });\n\n  it('should throw noConfigurationAtGivenPath error if the \"extends\" base config is not found', async () => {\n    const configPath = path.join(DIR_EXTENDS, 'badPointer.json');\n\n    await expect(loadExternalConfig({ configPath })).rejects.toThrow(\n      errorComposer\n        .setDetoxConfigPath(configPath)\n        .setExtends(true)\n        .noConfigurationAtGivenPath(require(configPath).extends)\n    );\n  });\n\n  it('should throw failedToReadConfiguration error if the implicitly resolved config throws \"Cannot find module...\"', async () => {\n    await expect(loadExternalConfig({ cwd: DIR_BADCONFIG })).rejects.toThrow('something-that-does-not-exist');\n  });\n\n  it('should fall back to fs-based config path resolution', async () => {\n    const absoluteConfigPath = path.join(DIR_PRIORITY, 'detox-config.json');\n    const relativeConfigPath = path.relative(process.cwd(), absoluteConfigPath);\n\n    const absoluteConfig = await loadExternalConfig({ configPath: absoluteConfigPath });\n    expect(logger.warn).not.toHaveBeenCalled();\n    const relativeConfig = await loadExternalConfig({ configPath: relativeConfigPath });\n    expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('legacy filesystem'));\n\n    expect(absoluteConfig).toEqual(relativeConfig);\n  });\n\n  it('should rethrow if an unexpected error occurs', async () => {\n    const configPath = os.homedir();\n\n    await expect(loadExternalConfig({ configPath })).rejects.toThrow(/EISDIR/);\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/selectConfiguration.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\n/**\n * @param {require('../errors/DetoxConfigErrorComposer')} errorComposer\n * @param {Detox.DetoxConfig} detoxConfig\n * @param {*} cliConfig\n * @returns {string}\n */\nfunction selectConfiguration({ errorComposer, globalConfig, cliConfig }) {\n  const { configurations } = globalConfig;\n\n  if (_.isEmpty(configurations)) {\n    throw errorComposer.noConfigurationsInside();\n  }\n\n  let configurationName = cliConfig.configuration || globalConfig.selectedConfiguration;\n  if (!configurationName && _.size(configurations) === 1) {\n    configurationName = _.keys(configurations)[0];\n  }\n\n  if (!configurationName) {\n    throw errorComposer.cantChooseConfiguration();\n  }\n\n  errorComposer.setConfigurationName(configurationName);\n\n  if (!configurations.hasOwnProperty(configurationName)) {\n    throw errorComposer.noConfigurationWithGivenName();\n  }\n\n  if (_.isEmpty(configurations[configurationName])) {\n    throw errorComposer.configurationShouldNotBeEmpty();\n  }\n\n  return configurationName;\n}\n\nmodule.exports = selectConfiguration;\n"
  },
  {
    "path": "detox/src/configuration/selectConfiguration.test.js",
    "content": "const DetoxConfigErrorComposer = require('../errors/DetoxConfigErrorComposer');\n\nconst { androidEmulator, apkWithBinary } = require('./configurations.mock');\n\ndescribe('selectConfiguration', () => {\n  let selectConfiguration;\n  /** @type {DetoxConfigErrorComposer} */\n  let errorComposer;\n  let configLocation, globalConfig, cliConfig;\n\n  beforeEach(() => {\n    configLocation = '/etc/detox/config.js';\n    globalConfig = {};\n    cliConfig = {};\n    errorComposer = new DetoxConfigErrorComposer().setDetoxConfig(globalConfig);\n\n    selectConfiguration = require('./selectConfiguration');\n  });\n\n  const select = () => selectConfiguration({\n    configLocation,\n    cliConfig,\n    globalConfig,\n    errorComposer,\n  });\n\n  it('should throw if there are no .configurations in Detox config', () => {\n    configLocation = '';\n    delete globalConfig.configurations;\n    expect(select).toThrow(errorComposer.noConfigurationsInside());\n  });\n\n  it('should throw if there is an empty .configurations object in Detox config and its location is unknown', () => {\n    configLocation = '';\n    globalConfig.configurations = {};\n    expect(select).toThrow(errorComposer.noConfigurationsInside());\n  });\n\n  it('should return the name of a single configuration', () => {\n    globalConfig.configurations = { single: { ...apkWithBinary, ...androidEmulator } };\n    expect(select()).toBe('single');\n  });\n\n  it('should throw if a configuration with the specified name does not exist', () => {\n    globalConfig.configurations = { single: { ...apkWithBinary, ...androidEmulator } };\n    globalConfig.selectedConfiguration = 'double';\n\n    expect(select).toThrow(); // generating a correct error expectation in errorComposer\n\n    jest.spyOn(errorComposer, 'setConfigurationName');\n    expect(select).toThrow(errorComposer.noConfigurationWithGivenName());\n    expect(errorComposer.setConfigurationName).toHaveBeenCalledWith('double');\n  });\n\n  it('should throw if a configuration with the specified name is empty ', () => {\n    globalConfig.configurations = { single: {} };\n    globalConfig.selectedConfiguration = 'single';\n\n    expect(select).toThrow(); // generating a correct error expectation in errorComposer\n\n    jest.spyOn(errorComposer, 'setConfigurationName');\n    expect(select).toThrow(errorComposer.configurationShouldNotBeEmpty());\n    expect(errorComposer.setConfigurationName).toHaveBeenCalledWith('single');\n  });\n\n  it('should throw if there is more than 1 configuration, and no one is specified', () => {\n    configLocation = '';\n    globalConfig.configurations = {\n      config1: { ...apkWithBinary, ...androidEmulator },\n      config2: { ...apkWithBinary, ...androidEmulator }\n    };\n    expect(select).toThrow(errorComposer.cantChooseConfiguration());\n  });\n\n  describe('priority', () => {\n    beforeEach(() => {\n      globalConfig.configurations = {\n        cli: { type: 'ios.simulator' },\n        config: { type: 'android.emulator' },\n      };\n    });\n\n    it('should be given to CLI --configuration (first)', () => {\n      globalConfig.selectedConfiguration = 'config';\n      cliConfig.configuration = 'cli';\n\n      expect(select()).toBe('cli');\n    });\n\n    it('should be given to config file value (second)', () => {\n      globalConfig.selectedConfiguration = 'config';\n\n      expect(select()).toBe('config');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/configuration/utils/deviceAppTypes.js",
    "content": "module.exports = {\n  'ios.simulator': ['ios.app'],\n  'android.attached': ['android.apk'],\n  'android.emulator': ['android.apk'],\n  'android.genycloud': ['android.apk'],\n};\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceAllocator.js",
    "content": "/**\n * @typedef {import('./drivers/AllocationDriverBase').AllocationDriverBase} AllocationDriverBase\n * @typedef {import('./drivers/AllocationDriverBase').DeallocOptions} DeallocOptions\n * @typedef {import('../common/drivers/DeviceCookie').DeviceCookie} DeviceCookie\n */\n\nconst _ = require('lodash');\n\nconst log = require('../../utils/logger').child({ cat: 'device,device-allocation' });\nconst traceMethods = require('../../utils/traceMethods');\n\nclass DeviceAllocator {\n  /**\n   * @param {AllocationDriverBase} allocationDriver\n   */\n  constructor(allocationDriver) {\n    this._driver = allocationDriver;\n    this._counter = 0;\n    this._ids = new Map();\n    traceMethods(log, this, ['init', 'cleanup', 'emergencyCleanup']);\n\n    // Init and cleanup should be called once for each allocation driver type\n    this.init = _.once(this.init.bind(this));\n    this.cleanup = _.once(this.cleanup.bind(this));\n    this.emergencyCleanup = _.once(this.emergencyCleanup.bind(this));\n  }\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async init() {\n    if (typeof this._driver.init === 'function') {\n      await this._driver.init();\n    }\n  }\n\n  /**\n   * @param {Detox.DetoxDeviceConfig} deviceConfig\n   * @returns {Promise<DeviceCookie>}\n   */\n  async allocate(deviceConfig) {\n    const tid = this._counter++;\n    return await log.trace.complete({ data: deviceConfig, id: tid }, 'allocate', async () => {\n      const cookie = await this._driver.allocate(deviceConfig);\n      log.debug({ data: cookie }, `settled on ${cookie.name || cookie.id}`);\n      this._ids.set(cookie.id, tid);\n      return cookie;\n    });\n  }\n\n  /**\n   * @param {DeviceCookie} cookie\n   * @param {{ deviceConfig: Detox.DetoxDeviceConfig }} [configs]\n   * @returns {Promise<DeviceCookie>}\n   */\n  async postAllocate(cookie, configs) {\n    const tid = this._ids.get(cookie.id);\n    return await log.trace.complete({ data: cookie, id: tid }, `post-allocate: ${cookie.id}`, async () => {\n      const updatedCookie = typeof this._driver.postAllocate === 'function'\n        ? await this._driver.postAllocate(cookie, configs)\n        : undefined;\n\n      return updatedCookie || cookie;\n    });\n  }\n\n  /**\n   * @param {DeviceCookie} cookie\n   * @param {DeallocOptions} options\n   * @returns {Promise<void>}\n   */\n  async free(cookie, options = {}) {\n    const tid = this._ids.get(cookie.id);\n    await log.trace.complete({ data: options, id: tid }, `free: ${cookie.id}`, async () => {\n      await this._driver.free(cookie, options);\n    });\n  }\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async cleanup() {\n    if (typeof this._driver.cleanup === 'function') {\n      await this._driver.cleanup();\n    }\n  }\n\n  /**\n   * @returns {void}\n   */\n  emergencyCleanup() {\n    if (typeof this._driver.emergencyCleanup === 'function') {\n      this._driver.emergencyCleanup();\n    }\n  }\n\n  isRecoverableError(error) {\n    if (typeof this._driver.isRecoverableError !== 'function') {\n      return false;\n    }\n    return this._driver.isRecoverableError(error);\n  }\n}\n\nmodule.exports = DeviceAllocator;\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceAllocator.test.js",
    "content": "describe('Device allocator', () => {\n  let allocDriver;\n\n  /** @type {import('./DeviceAllocator')} */\n  let deviceAllocator;\n\n  beforeEach(() => {\n    allocDriver = {\n      allocate: jest.fn(),\n      free: jest.fn(),\n    };\n\n    const DeviceAllocator = require('./DeviceAllocator');\n    deviceAllocator = new DeviceAllocator(allocDriver);\n  });\n\n  describe('#init()', function() {\n    test('should not init if the driver does not implement this function', async () => {\n      delete allocDriver.init;\n      await expect(deviceAllocator.init()).resolves.not.toThrow();\n    });\n\n    test('should init via driver', async () => {\n      allocDriver.init = jest.fn();\n      await deviceAllocator.init();\n      expect(allocDriver.init).toHaveBeenCalled();\n    });\n  });\n\n  describe('#allocate()', function() {\n    test('should allocate via driver', async () => {\n      const cookie = { id: 'mock', };\n      const deviceConfig = {\n        type: 'some-device-type',\n        device: 'some query',\n      };\n\n      allocDriver.allocate.mockResolvedValue(cookie);\n\n      const result = await deviceAllocator.allocate(deviceConfig);\n\n      expect(result).toEqual(cookie);\n      expect(allocDriver.allocate).toHaveBeenCalledWith(deviceConfig);\n    });\n  });\n\n  describe('#postAllocate()', function() {\n    test('should post-allocate via driver', async () => {\n      const cookie = { id: 'mock' };\n      const deviceConfig = {\n        type: 'some-device-type',\n        device: 'some query',\n      };\n\n      allocDriver.postAllocate = jest.fn();\n      await expect(deviceAllocator.postAllocate(cookie, { deviceConfig })).resolves.toBe(cookie);\n      expect(allocDriver.postAllocate).toHaveBeenCalledWith(cookie, { deviceConfig });\n    });\n\n    test('should replace the cookie if the driver returns a new one', async () => {\n      const cookie = { id: 'mock' };\n      const newCookie = { id: 'new mock' };\n      const deviceConfig = {\n        type: 'some-device-type',\n        device: 'some query',\n      };\n\n      allocDriver.postAllocate = jest.fn().mockResolvedValue(newCookie);\n      await expect(deviceAllocator.postAllocate(cookie, { deviceConfig })).resolves.toBe(newCookie);\n      expect(allocDriver.postAllocate).toHaveBeenCalledWith(cookie, { deviceConfig });\n    });\n\n    test('should not post-allocate if the driver does not implement this function', async () => {\n      const deviceConfig = {\n        type: 'some-device-type',\n        device: 'some query',\n      };\n      delete allocDriver.postAllocate;\n      await expect(deviceAllocator.postAllocate({ id: 'mock' }, { deviceConfig })).resolves.not.toThrow();\n    });\n  });\n\n  describe('#free()', function() {\n    test('should deallocate via driver', async () => {\n      const cookie = { id: 'mock' };\n      const options = { shutdown: true };\n      const device = {\n        mock: 'device',\n      };\n\n      allocDriver.free.mockResolvedValue(device);\n\n      await deviceAllocator.free(cookie, options);\n      expect(allocDriver.free).toHaveBeenCalledWith(cookie, options);\n      await deviceAllocator.free(cookie); // no options\n      expect(allocDriver.free).toHaveBeenCalledWith(cookie, {});\n    });\n  });\n\n  describe('#cleanup()', function() {\n    test('should not cleanup if the driver does not implement this function', async () => {\n      delete allocDriver.cleanup;\n      await expect(deviceAllocator.cleanup()).resolves.not.toThrow();\n    });\n\n    test('should cleanup via driver', async () => {\n      allocDriver.cleanup = jest.fn();\n      await deviceAllocator.cleanup();\n      expect(allocDriver.cleanup).toHaveBeenCalled();\n    });\n  });\n\n  describe('#emergencyCleanup()', function() {\n    test('should not emergencyCleanup if the driver does not implement this function', () => {\n      delete allocDriver.emergencyCleanup;\n      expect(() => deviceAllocator.emergencyCleanup()).not.toThrow();\n    });\n\n    test('should emergencyCleanup via driver', () => {\n      allocDriver.emergencyCleanup = jest.fn();\n      deviceAllocator.emergencyCleanup();\n      expect(allocDriver.emergencyCleanup).toHaveBeenCalled();\n    });\n  });\n\n  describe('#isRecoverableError()', function() {\n    test('should return false if the driver does not implement this function', () => {\n      delete allocDriver.isRecoverableError;\n      expect(deviceAllocator.isRecoverableError(new Error())).toBe(false);\n    });\n\n    test('should return the driver\\'s isRecoverableError result', () => {\n      allocDriver.isRecoverableError = jest.fn().mockReturnValue(true);\n      expect(deviceAllocator.isRecoverableError(new Error())).toBe(true);\n      expect(allocDriver.isRecoverableError).toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceList.js",
    "content": "class DeviceListReadonly {\n  constructor(devices = []) {\n    this._devices = new Map(devices.map(device => [device.id, device]));\n  }\n\n  concat(other) {\n    return new DeviceListReadonly([...this, ...other]);\n  }\n\n  getIds() {\n    return [...this._devices.keys()];\n  }\n\n  [Symbol.iterator]() {\n    return this._devices.values();\n  }\n\n  /**\n   * @param {string} deviceId\n   * @returns {boolean}\n   */\n  includes(deviceId) {\n    return this._devices.has(deviceId);\n  }\n}\n\nclass DeviceList extends DeviceListReadonly {\n  filter(predicate) {\n    return new DeviceListReadonly([...this].filter(predicate));\n  }\n\n  add(deviceId, data) {\n    this._devices.set(deviceId, {\n      id: deviceId,\n      ...data,\n    });\n  }\n\n  delete(deviceId) {\n    this._devices.delete(deviceId);\n  }\n}\n\nmodule.exports = DeviceList;\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceList.test.js",
    "content": "const DeviceList = require('./DeviceList'); // Update with the actual path\n\ndescribe('DeviceList', () => {\n  let deviceList;\n\n  beforeEach(() => {\n    deviceList = new DeviceList([{ id: 'device1' }, { id: 'device2' }]);\n  });\n\n  it('should concat with another list', () => {\n    const other = new DeviceList([{ id: 'device3' }]);\n    const concatenated = deviceList.concat(other);\n    expect(concatenated.getIds()).toEqual(['device1', 'device2', 'device3']);\n  });\n\n  it('should concat with empty list', () => {\n    const other = new DeviceList();\n    const concatenated = deviceList.concat(other);\n    expect(concatenated.getIds()).toEqual(['device1', 'device2']);\n  });\n\n  it('should return device ids', () => {\n    expect(deviceList.getIds()).toEqual(['device1', 'device2']);\n  });\n\n  it('should check if a device id is included', () => {\n    expect(deviceList.includes('device1')).toBe(true);\n    expect(deviceList.includes('unknownDevice')).toBe(false);\n  });\n\n  it('should filter devices', () => {\n    const filteredList = deviceList.filter(device => device.id === 'device1');\n    expect(filteredList.getIds()).toEqual(['device1']);\n  });\n\n  it('should add a new device', () => {\n    deviceList.add('device3', { prop: 'value' });\n    expect(deviceList.includes('device3')).toBe(true);\n  });\n\n  it('should delete a device', () => {\n    deviceList.delete('device1');\n    expect(deviceList.includes('device1')).toBe(false);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceRegistry.js",
    "content": "const ExclusiveLockfile = require('../../utils/ExclusiveLockfile');\nconst PIDService = require('../../utils/PIDService');\nconst { getDeviceRegistryPath } = require('../../utils/environment');\nconst safeAsync = require('../../utils/safeAsync');\n\nconst DeviceList = require('./DeviceList');\n\nconst readOptions = {\n  encoding: 'utf8',\n};\n\nclass DeviceRegistry {\n  constructor({\n    lockfilePath = getDeviceRegistryPath(),\n    sessionId = '',\n    pidService = new PIDService(),\n  } = {}) {\n    /***\n     * @private\n     * @type {string}\n     */\n    this._lockfilePath = lockfilePath;\n    /***\n     * @private\n     * @type {string}\n     */\n    this._sessionId = sessionId;\n    /***\n     * @private\n     */\n    this._pidService = pidService;\n    /***\n     * @protected\n     * @type {ExclusiveLockfile}\n     */\n    this._lockfile = new ExclusiveLockfile(this._lockfilePath, {\n      getInitialState: this._getInitialLockFileState.bind(this),\n      readOptions,\n    });\n  }\n\n  get lockFilePath() {\n    return this._lockfilePath;\n  }\n\n  /**\n   * Safety method to ensure that there are no remains of previously crashed Detox sessions.\n   */\n  async reset() {\n    await this._lockfile.exclusively(() => {\n      const empty = this._getInitialLockFileState();\n      this._lockfile.write(empty);\n    });\n  }\n\n  /***\n   * @param {string|Function} getDeviceId\n   * @returns {Promise<string>}\n   */\n  async registerDevice(getDeviceId) {\n    return this._lockfile.exclusively(async () => {\n      const deviceId = await safeAsync(getDeviceId);\n      if (deviceId) {\n        this._upsertDevice(deviceId, {\n          busy: true,\n          sessionId: this._sessionId,\n          pid: this._pidService.getPid(),\n        });\n      }\n      return deviceId;\n    });\n  }\n\n  /***\n   * @param {string|Function} getDeviceId\n   * @returns {Promise<string>}\n   */\n  async releaseDevice(getDeviceId) {\n    return this._lockfile.exclusively(async () => {\n      const deviceId = await safeAsync(getDeviceId);\n      if (deviceId) {\n        this._upsertDevice(deviceId, {\n          busy: false,\n          sessionId: this._sessionId,\n          pid: this._pidService.getPid(),\n        });\n      }\n      return deviceId;\n    });\n  }\n\n  /***\n   * @param {string|Function} getDeviceId\n   * @returns {Promise<void>}\n   */\n  async unregisterDevice(getDeviceId) {\n    await this._lockfile.exclusively(async () => {\n      const deviceId = await safeAsync(getDeviceId);\n      if (deviceId) {\n        this._deleteDevice(deviceId);\n      }\n    });\n  }\n\n  async unregisterSessionDevices() {\n    await this._lockfile.exclusively(async () => {\n      const allDevices = this._getRegisteredDevices();\n      const sessionDevices = allDevices.filter(device => device.sessionId === this._sessionId);\n      for (const id of sessionDevices.getIds()) {\n        allDevices.delete(id);\n      }\n      this._lockfile.write([...allDevices]);\n    });\n  }\n\n  async unregisterZombieDevices() {\n    await this._lockfile.exclusively(async () => {\n      const allDevices = this._getRegisteredDevices();\n      const zombieDevices = allDevices.filter(device => {\n        return device.sessionId !== this._sessionId && !this._pidService.isAlive(device.pid);\n      });\n\n      for (const id of zombieDevices.getIds()) {\n        allDevices.delete(id);\n      }\n      this._lockfile.write([...allDevices]);\n    });\n  }\n\n  /**\n   * @returns {Promise<DeviceList>}\n   */\n  async readSessionDevices() {\n    let devices;\n    await this._lockfile.exclusively(() => {\n      devices = this._getSessionDevicesSync();\n    });\n    return devices;\n  }\n\n  getTakenDevicesSync() {\n    const allDevices = this._getRegisteredDevices();\n    const busyDevices = allDevices.filter(device => device.busy);\n    const externalDevices = allDevices.filter(device => device.sessionId !== this._sessionId);\n    return busyDevices.concat(externalDevices);\n  }\n\n  /***\n   * @private\n   */\n  _getInitialLockFileState() {\n    return [];\n  }\n\n  /**\n   * @private\n   */\n  _upsertDevice(deviceId, data) {\n    const devices = this._getRegisteredDevices();\n    devices.add(deviceId, data);\n    this._lockfile.write([...devices]);\n  }\n\n  /**\n   * @private\n   */\n  _deleteDevice(deviceId) {\n    const devices = this._getRegisteredDevices();\n    devices.delete(deviceId);\n    this._lockfile.write([...devices]);\n  }\n\n  /***\n   * @private\n   * @returns {DeviceList}\n   */\n  _getRegisteredDevices() {\n    const devices = this._lockfile.read();\n    return new DeviceList(devices);\n  }\n\n  _getSessionDevicesSync() {\n    const devices = this._getRegisteredDevices();\n    const sessionDevices = devices.filter(device => device.sessionId === this._sessionId);\n    return sessionDevices;\n  }\n}\n\nmodule.exports = DeviceRegistry;\n"
  },
  {
    "path": "detox/src/devices/allocation/DeviceRegistry.test.js",
    "content": "const fs = require('fs-extra');\n\nconst tempfile = require('../../utils/tempfile');\n\nconst DeviceRegistry = require('./DeviceRegistry');  // Adjust the path to your actual file\n\ndescribe('DeviceRegistry', () => {\n  const session1 = 'session1';\n\n  let lockfilePath;\n  let registry;\n  /** @type {jest.Mocked<import('../../utils/PIDService')>} */\n  let pidService1, pidService2;\n\n  beforeEach(() => {\n    const PIDService = jest.requireMock('../../utils/PIDService');\n    ([pidService1, pidService2] = [1, 2].map((pid) => {\n      const pidService = new PIDService();\n      pidService.getPid.mockReturnValue(pid);\n      pidService.isAlive.mockImplementation((value) => value === pid);\n      return pidService;\n    }));\n  });\n\n  beforeEach(() => {\n    lockfilePath = tempfile('.test');\n\n    registry = new DeviceRegistry({\n      lockfilePath,\n      sessionId: session1,\n      pidService: pidService1,\n    });\n  });\n\n  afterEach(async () => {\n    await fs.remove(lockfilePath);\n  });\n\n  it('can be created with default options', () => {\n    const registry = new DeviceRegistry();\n    expect(registry.lockFilePath).toBeDefined();\n  });\n\n  it('should be initialized correctly', async () => {\n    expect(registry.lockFilePath).toBe(lockfilePath);\n    const sessionDevices = await registry.readSessionDevices();\n    expect([...sessionDevices]).toEqual([]);\n  });\n\n  it('should register a device', async () => {\n    const deviceId = 'device1';\n    const registeredDeviceId = await registry.registerDevice(() => deviceId);\n    expect(registeredDeviceId).toBe(deviceId); // Check if it returns the registered deviceId\n\n    const sessionDevices = await registry.readSessionDevices();\n    expect(sessionDevices.getIds()).toEqual([deviceId]);\n  });\n\n  it('should not register a device if the callback returns undefined', async () => {\n    const registeredDeviceId = await registry.registerDevice(() => { /* noop */ });\n    expect(registeredDeviceId).toBe(undefined); // Check if it returns the registered deviceId\n\n    const sessionDevices = await registry.readSessionDevices();\n    expect(sessionDevices.getIds()).toHaveLength(0);\n  });\n\n  it('should unregister a device', async () => {\n    const deviceId = 'device1';\n    await registry.registerDevice(() => deviceId);\n    await registry.unregisterDevice(() => deviceId);\n    const sessionDevices = await registry.readSessionDevices();\n    expect(sessionDevices.getIds()).toEqual([]);\n  });\n\n  it('should not unregister a device if the callback returns undefined', async () => {\n    const deviceId = 'device1';\n    await registry.registerDevice(() => deviceId);\n    await registry.unregisterDevice(() => { /* noop */ });\n    const sessionDevices = await registry.readSessionDevices();\n    expect(sessionDevices.getIds()).toEqual([deviceId]);\n  });\n\n  it('should reset the device registry', async () => {\n    await registry.registerDevice(() => 'device1');\n    await registry.reset();\n    const devices = await registry.readSessionDevices();\n    expect(devices.getIds()).toEqual([]);\n  });\n\n  describe('when there are multiple sessions', () => {\n    const session2 = 'session2';\n    let registry2;\n\n    beforeEach(() => {\n      registry2 = new DeviceRegistry({\n        lockfilePath,\n        sessionId: session2,\n        pidService: pidService2,\n      });\n    });\n\n    it('should not see devices from other sessions', async () => {\n      await registry.registerDevice(() => 'device1');\n      await registry2.registerDevice(() => 'device2');\n      const devices1 = await registry.readSessionDevices();\n      const devices2 = await registry2.readSessionDevices();\n      expect(devices1.getIds()).toEqual(['device1']);\n      expect(devices2.getIds()).toEqual(['device2']);\n    });\n\n    it('should see taken devices from all sessions', async () => {\n      expect.assertions(2);\n\n      await registry.registerDevice(() => 'device1');\n      await registry.registerDevice(() => 'device2');\n      await registry.releaseDevice(() => 'device1');\n\n      await registry2.registerDevice(() => 'device3');\n      await registry2.registerDevice(() => 'device4');\n      await registry2.releaseDevice(() => 'device3');\n\n      let taken1, taken2;\n      await registry.releaseDevice(() => {\n        taken1 = registry.getTakenDevicesSync();\n        expect(taken1.getIds().sort()).toEqual(['device2', 'device3', 'device4']);\n      });\n\n      await registry2.releaseDevice(() => {\n        taken2 = registry2.getTakenDevicesSync();\n        expect(taken2.getIds().sort()).toEqual(['device1', 'device2', 'device4']);\n      });\n    });\n\n    it('should unregister only from the current session', async () => {\n      expect.assertions(2);\n\n      await registry.registerDevice(() => 'device1');\n      await registry.registerDevice(() => 'device2');\n      await registry2.registerDevice(() => 'device3');\n      await registry2.registerDevice(() => 'device4');\n\n      await registry.unregisterSessionDevices();\n      const devices1 = await registry.readSessionDevices();\n      const devices2 = await registry2.readSessionDevices();\n\n      expect(devices1.getIds()).toEqual([]);\n      expect(devices2.getIds()).toEqual(['device3', 'device4']);\n    });\n\n    it('should be able to unregister zombie devices', async () => {\n      await registry.registerDevice(() => 'device1');\n      await registry2.unregisterZombieDevices();\n      const firstSessionDevices = await registry.readSessionDevices();\n      expect([...firstSessionDevices]).toEqual([]);\n    });\n  });\n});\n\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/AllocationDriverBase.d.ts",
    "content": "/* eslint-disable import/no-unresolved,node/no-missing-import,node/no-unsupported-features/es-syntax */\nimport { DeviceCookie } from '../../common/drivers/DeviceCookie';\n\nexport interface DeallocOptions {\n  shutdown?: boolean;\n}\n\nexport interface AllocationDriverBase {\n  init?(): Promise<void>;\n  allocate(deviceConfig: any): Promise<DeviceCookie>;\n  postAllocate?(deviceCookie: DeviceCookie, configs?: { deviceConfig: Detox.DetoxDeviceConfig }): Promise<DeviceCookie | void>;\n  free(cookie: DeviceCookie, options: DeallocOptions): Promise<void>;\n  cleanup?(): Promise<void>;\n  emergencyCleanup?(): void;\n  isRecoverableError?(error: any): boolean;\n}\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/AndroidAllocDriver.js",
    "content": "/**\n * @typedef {import('../AllocationDriverBase').AllocationDriverBase} AllocationDriverBase\n * @typedef {import('../../../common/drivers/DeviceCookie').DeviceCookie} DeviceCookie\n */\n\nconst log = require('../../../../utils/logger').child({ __filename });\n\nconst DeviceInitCache = require('./utils/DeviceInitCache');\nconst SystemUIDemoMode = require('./utils/SystemUICfgHelper');\n\nconst SYS_UI_CFG = { event: 'DEVICE_SYS_UI_CFG' };\n\n/**\n * @abstract {AllocationDriverBase}\n */\nclass AndroidAllocDriver {\n  /**\n   * @param {object} options\n   * @param {import('../../../common/drivers/android/exec/ADB')} options.adb\n   */\n  constructor({\n    adb\n  }) {\n    this._adb = adb;\n    this._systemUIInitCache = new DeviceInitCache();\n  }\n\n  /**\n   * @param {DeviceCookie & { adbName: string }} deviceCookie\n   * @param {{ deviceConfig: Detox.DetoxSharedAndroidDriverConfig }} configs\n   * @returns {Promise<DeviceCookie>}\n   */\n  async postAllocate(deviceCookie, { deviceConfig }) {\n    const { adbName } = deviceCookie;\n\n    if (deviceConfig.systemUI) {\n      if (this._systemUIInitCache.hasInitialized(adbName)) {\n        log.debug(SYS_UI_CFG, `Skipping System UI setup for ${adbName}, already initialized`);\n      } else {\n        await this._setupSystemUI(deviceCookie, deviceConfig);\n        this._systemUIInitCache.setInitialized(adbName);\n      }\n    }\n    return deviceCookie;\n  }\n\n  /**\n   * @param {DeviceCookie & { adbName: string }} deviceCookie\n   * @param {Detox.DetoxSharedAndroidDriverConfig} deviceConfig\n   * @private\n   */\n  async _setupSystemUI(deviceCookie, deviceConfig) {\n    const { adbName } = deviceCookie;\n\n    const systemUIDemoMode = new SystemUIDemoMode({ adb: this._adb, adbName });\n    const systemUIConfig = systemUIDemoMode.resolveConfig(deviceConfig.systemUI);\n\n    log.debug(SYS_UI_CFG, `Running keyboard behavior setup for ${adbName}`);\n    await systemUIDemoMode.setupKeyboardBehavior(systemUIConfig);\n\n    log.debug(SYS_UI_CFG, `Running system UI setup for ${adbName}`);\n    await systemUIDemoMode.setupPointerIndicators(systemUIConfig);\n    await systemUIDemoMode.setupNavigationMode(systemUIConfig);\n    await systemUIDemoMode.setupStatusBar(systemUIConfig);\n    log.debug(SYS_UI_CFG, `Finished system UI setup for ${adbName}`);\n  }\n}\n\nmodule.exports = AndroidAllocDriver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/FreeDeviceFinder.js",
    "content": "const log = require('../../../../utils/logger').child({ cat: 'device' });\n\nconst DEVICE_LOOKUP = { event: 'DEVICE_LOOKUP' };\n\nclass FreeDeviceFinder {\n  constructor(adb, deviceRegistry) {\n    this.adb = adb;\n    this.deviceRegistry = deviceRegistry;\n  }\n\n  async findFreeDevice(deviceQuery) {\n    const { devices } = await this.adb.devices();\n    const takenDevices = this.deviceRegistry.getTakenDevicesSync();\n    for (const candidate of devices) {\n      if (await this._isDeviceFreeAndMatching(takenDevices, candidate, deviceQuery)) {\n        return candidate.adbName;\n      }\n    }\n    return null;\n  }\n\n  /**\n   * @private\n   */\n  async _isDeviceFreeAndMatching(takenDevices, candidate, deviceQuery) {\n    const { adbName } = candidate;\n\n    const isTaken = takenDevices.includes(adbName);\n    if (isTaken) {\n      log.debug(DEVICE_LOOKUP, `Device ${adbName} is already taken, skipping...`);\n      return false;\n    }\n\n    const isOffline = candidate.status === 'offline';\n    if (isOffline) {\n      log.debug(DEVICE_LOOKUP, `Device ${adbName} is offline, skipping...`);\n      return false;\n    }\n\n    const isMatching = await this._isDeviceMatching(candidate, deviceQuery);\n    if (!isMatching) {\n      log.debug(DEVICE_LOOKUP, `Device ${adbName} does not match \"${deviceQuery}\"`);\n      return false;\n    }\n\n    log.debug(DEVICE_LOOKUP, `Found a matching & free device ${candidate.adbName}`);\n    return true;\n  }\n\n  /**\n   * @protected\n   */\n  async _isDeviceMatching(candidate, deviceQuery) {\n    return RegExp(deviceQuery).test(candidate.adbName);\n  }\n}\n\nmodule.exports = FreeDeviceFinder;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/FreeDeviceFinder.test.js",
    "content": "const DeviceList = require('../../DeviceList');\n\nconst FreeDeviceFinder = require('./FreeDeviceFinder');\nconst { deviceOffline, emulator5556, ip5557, localhost5555 } = require('./__mocks__/handles');\n\ndescribe('FreeDeviceFinder', () => {\n  const mockAdb = { devices: jest.fn() };\n\n  /** @type {DeviceList} */\n  let fakeDeviceList;\n  let mockDeviceRegistry;\n  let uut;\n\n  beforeEach(() => {\n    fakeDeviceList = new DeviceList();\n    const DeviceRegistry = jest.createMockFromModule('../../DeviceRegistry');\n    mockDeviceRegistry = new DeviceRegistry();\n    mockDeviceRegistry.getTakenDevicesSync.mockImplementation(() => fakeDeviceList);\n\n    uut = new FreeDeviceFinder(mockAdb, mockDeviceRegistry);\n  });\n\n  it('should return the only device when it matches, is online and not already taken by other workers', async () => {\n    mockAdbDevices([emulator5556]);\n\n    const result = await uut.findFreeDevice(emulator5556.adbName);\n    expect(result).toEqual(emulator5556.adbName);\n  });\n\n  it('should return null when there are no devices', async () => {\n    mockAdbDevices([]);\n\n    const result = await uut.findFreeDevice(emulator5556.adbName);\n    expect(result).toEqual(null);\n  });\n\n  it('should return null when device is already taken by other workers', async () => {\n    mockAdbDevices([emulator5556]);\n    mockAllDevicesTaken();\n\n    expect(await uut.findFreeDevice(emulator5556.adbName)).toEqual(null);\n  });\n\n  it('should return null when device is offline', async () => {\n    mockAdbDevices([deviceOffline]);\n    expect(await uut.findFreeDevice(deviceOffline.adbName)).toEqual(null);\n  });\n\n  it('should return first device that matches a regular expression', async () => {\n    mockAdbDevices([emulator5556, localhost5555, ip5557]);\n    const localhost = '^localhost:\\\\d+$';\n    expect(await uut.findFreeDevice(localhost)).toBe(localhost5555.adbName);\n  });\n\n  const mockAdbDevices = (devices) => mockAdb.devices.mockResolvedValue({ devices });\n  const mockAllDevicesTaken = () => {\n    fakeDeviceList.add(emulator5556.adbName, { busy: true });\n    fakeDeviceList.add(localhost5555.adbName, { busy: true });\n    fakeDeviceList.add(ip5557.adbName, { busy: true });\n  };\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/__mocks__/handles.js",
    "content": "const mockAvdName = 'mockAvdName';\n\nconst aDeviceHandle = (adbName, status = 'device') => ({\n  adbName,\n  status,\n  type: 'device',\n});\n\nconst anEmulatorHandle = (adbName, status) => ({\n  ...aDeviceHandle(adbName, status),\n  type: 'emulator',\n  queryName: () => Promise.resolve(mockAvdName),\n});\n\nmodule.exports = {\n  mockAvdName,\n  emulator5556: anEmulatorHandle('emulator-5556'),\n  localhost5555: aDeviceHandle('localhost:5555'),\n  ip5557: aDeviceHandle('192.168.4.19:5557'),\n  deviceOffline: aDeviceHandle('192.168.4.19:5559', 'offline'),\n};\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/attached/AttachedAndroidAllocDriver.js",
    "content": "/**\n * @typedef {import('../../../../common/drivers/android/cookies').AndroidDeviceCookie} AndroidDeviceCookie\n */\n\nconst AndroidAllocDriver = require('../AndroidAllocDriver');\n\nclass AttachedAndroidAllocDriver extends AndroidAllocDriver {\n  /**\n   * @param {object} options\n   * @param {import('../../../../common/drivers/android/exec/ADB')} options.adb\n   * @param {import('../../../DeviceRegistry')} options.deviceRegistry\n   * @param {import('../FreeDeviceFinder')} options.freeDeviceFinder\n   */\n  constructor({ adb, deviceRegistry, freeDeviceFinder }) {\n    super({ adb });\n    this._deviceRegistry = deviceRegistry;\n    this._freeDeviceFinder = freeDeviceFinder;\n  }\n\n  async init() {\n    await this._deviceRegistry.unregisterZombieDevices();\n  }\n\n  /**\n   * @param deviceConfig\n   * @return {Promise<AndroidDeviceCookie>}\n   */\n  async allocate(deviceConfig) {\n    const adbNamePattern = deviceConfig.device.adbName;\n    const adbName = await this._deviceRegistry.registerDevice(() => this._freeDeviceFinder.findFreeDevice(adbNamePattern));\n\n    return { id: adbName, adbName };\n  }\n\n  /**\n   * @param {AndroidDeviceCookie} deviceCookie\n   * @param {{ deviceConfig: Detox.DetoxSharedAndroidDriverConfig }} configs\n   * @returns {Promise<AndroidDeviceCookie>}\n   */\n  async postAllocate(deviceCookie, configs) {\n    const { adbName } = deviceCookie;\n\n    await this._adb.apiLevel(adbName);\n    await this._adb.unlockScreen(adbName);\n    await super.postAllocate(deviceCookie, configs);\n\n    return deviceCookie;\n  }\n\n  /**\n   * @param cookie { AndroidDeviceCookie }\n   * @return {Promise<void>}\n   */\n  async free(cookie) {\n    const { adbName } = cookie;\n    await this._deviceRegistry.unregisterDevice(adbName);\n  }\n}\n\nmodule.exports = AttachedAndroidAllocDriver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/AVDValidator.js",
    "content": "const _ = require('lodash');\n\nconst DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst environment = require('../../../../../utils/environment');\nconst logger = require('../../../../../utils/logger').child({ cat: 'device' });\n\nconst REQUIRED_EMULATOR_MAJOR = 29;\n\nclass AVDValidator {\n  constructor(avdsResolver, emulatorVersionResolver) {\n    this._avdsResolver = avdsResolver;\n    this._emulatorVersionResolver = emulatorVersionResolver;\n  }\n\n  async validate(avdName, isHeadless) {\n    const avds = await this._avdsResolver.resolve(avdName);\n    this._assertAVDs(avds);\n    await this._assertAVDMatch(avds, avdName);\n    await this._validateEmulatorVer(isHeadless);\n  }\n\n  _assertAVDs(avds) {\n    if (!avds) {\n      const usageExample = `${environment.getAvdManagerPath()} create avd --force --name Pixel_API_28 --abi x86_64 --package \"system-images;android-28;default;x86_64\" --device \"pixel\"`;\n      const message = 'Could not find any configured Android Emulator.';\n      const hint = `Try creating a device first (example: ${usageExample}),`\n        + ' or go to https://developer.android.com/studio/run/managing-avds.html for details on how to create an Emulator.';\n      throw new DetoxRuntimeError({ message, hint });\n    }\n  }\n\n  _assertAVDMatch(avds, avdName) {\n    if (_.indexOf(avds, avdName) === -1) {\n      const message = `Cannot boot Android Emulator with the name: '${avdName}'`;\n      const hint = `Make sure you choose one of the available emulators: ${avds.toString()}`;\n      throw new DetoxRuntimeError({ message, hint });\n    }\n  }\n\n  async _validateEmulatorVer(isHeadless) {\n    const emulatorVersion = await this._emulatorVersionResolver.resolve(isHeadless);\n    if (!emulatorVersion) {\n      logger.warn({ event: 'AVD_VALIDATION' }, 'Emulator version detection failed (See previous logs)');\n      return;\n    }\n\n    if (emulatorVersion.major < REQUIRED_EMULATOR_MAJOR) {\n      logger.warn({ event: 'AVD_VALIDATION' }, [\n          `Your installed emulator binary version (${emulatorVersion}) is too old, and may not be suitable for parallel test execution.`,\n          `We strongly recommend you upgrade to the latest version using the SDK manager: ${environment.getAndroidSdkManagerPath()} --list`\n        ].join('\\n'));\n    }\n  }\n}\n\nmodule.exports = AVDValidator;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/AVDValidator.test.js",
    "content": "describe('AVD validator', () => {\n  let logger;\n  let environment;\n  let avdsResolver;\n  let versionResolver;\n  let uut;\n  beforeEach(() => {\n    jest.mock('../../../../../utils/logger');\n    logger = require('../../../../../utils/logger');\n\n    jest.mock('../../../../../utils/environment');\n    environment = require('../../../../../utils/environment');\n\n    const AVDsResolver = jest.createMockFromModule('./AVDsResolver');\n    avdsResolver = new AVDsResolver();\n\n    const EmulatorVersionResolver = jest.createMockFromModule('./EmulatorVersionResolver');\n    versionResolver = new EmulatorVersionResolver();\n    versionResolver.resolve.mockResolvedValue('');\n\n    const AVDValidator = require('./AVDValidator');\n    uut = new AVDValidator(avdsResolver, versionResolver);\n  });\n\n  const givenExpectedAVD = () => avdsResolver.resolve.mockResolvedValue(['mock-avd-name']);\n  const givenNoAVDs = () => avdsResolver.resolve.mockResolvedValue(undefined);\n  const givenOtherAVDs = () => avdsResolver.resolve.mockResolvedValue(['other-avd', 'yet-another']);\n\n  const givenOldEmulatorVersion = () => versionResolver.resolve.mockResolvedValue({\n    major: 28,\n    minor: 999,\n    patch: 999,\n    toString: () => '28.mock.ver',\n  });\n  const givenProperEmulatorVersion = () => versionResolver.resolve.mockResolvedValue({\n    major: 29,\n    minor: 0,\n    patch: 0,\n    toString: () => '29.x.y',\n  });\n  const givenUnknownEmulatorVersion = () => versionResolver.resolve.mockResolvedValue(null);\n\n  const givenMockedAvdManagerPath = () => environment.getAvdManagerPath.mockReturnValue('mock/path/avdmng');\n  const givenMockedAndroidSdkPath = () => environment.getAndroidSdkManagerPath.mockReturnValue('mock/path/sdkmng');\n\n  it('should return safely if AVD exists', async () => {\n    givenExpectedAVD();\n    await uut.validate('mock-avd-name');\n  });\n\n  it('should throw if no AVDs found', async () => {\n    givenMockedAvdManagerPath();\n    givenNoAVDs();\n\n    try {\n      await uut.validate();\n      throw 'expected to throw';\n    } catch (err) {\n      const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\n      expect(err).toBeInstanceOf(DetoxRuntimeError);\n      expect(err.toString()).toEqual(expect.stringContaining('Could not find any configured Android Emulator.'));\n      expect(err.toString()).toEqual(expect.stringContaining('mock/path/avdmng create avd'));\n    }\n  });\n\n  it('should throw if specific AVD not found', async () => {\n    givenOtherAVDs();\n\n    try {\n      await uut.validate('mock-avd-name');\n      throw 'expected to throw';\n    } catch (err) {\n      const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\n      expect(err).toBeInstanceOf(DetoxRuntimeError);\n      expect(err.toString()).toEqual(expect.stringContaining(`Cannot boot Android Emulator with the name: 'mock-avd-name'`));\n      expect(err.toString()).toEqual(expect.stringContaining(`Make sure you choose one of the available emulators`));\n    }\n  });\n\n  it('should warn about emulators that are too old', async () => {\n    givenMockedAndroidSdkPath();\n    givenExpectedAVD();\n    givenOldEmulatorVersion();\n\n    await uut.validate('mock-avd-name');\n\n    expect(logger.warn).toHaveBeenCalledWith({ event: 'AVD_VALIDATION' }, [\n      `Your installed emulator binary version (28.mock.ver) is too old, and may not be suitable for parallel test execution.`,\n      'We strongly recommend you upgrade to the latest version using the SDK manager: mock/path/sdkmng --list'\n    ].join('\\n'));\n    expect(versionResolver.resolve).toHaveBeenCalled();\n  });\n\n  it('should not warn about emulators that are sufficiently new', async () => {\n    givenExpectedAVD();\n    givenProperEmulatorVersion();\n\n    await uut.validate('mock-avd-name');\n\n    expect(logger.warn).not.toHaveBeenCalled();\n  });\n\n  it('should provide specific warning if emulator version detection failed', async () => {\n    givenExpectedAVD();\n    givenUnknownEmulatorVersion();\n\n    await uut.validate('mock-avd-name');\n\n    expect(logger.warn).toHaveBeenCalledWith(\n      { event: 'AVD_VALIDATION' },\n      'Emulator version detection failed (See previous logs)'\n      );\n  });\n\n  it('should run emulator version resolver as headless if required', async () => {\n    givenExpectedAVD();\n    givenProperEmulatorVersion();\n\n    await uut.validate('mock-avd-name', true);\n\n    expect(versionResolver.resolve).toHaveBeenCalledWith(true);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/AVDsResolver.js",
    "content": "const { ListAVDsCommand } = require('../../../../common/drivers/android/emulator/exec/EmulatorExec');\n\nclass AVDsResolver {\n  constructor(emulatorExec) {\n    this._emulatorExec = emulatorExec;\n  }\n\n  async resolve() {\n    const output = await this._emulatorExec.exec(new ListAVDsCommand());\n    const avds = output.trim().split('\\n').map(x => x.trim());\n    return avds;\n  }\n}\n\nmodule.exports = AVDsResolver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/AVDsResolver.test.js",
    "content": "describe('AVDs resolver', () => {\n  let MockListAVDsCommand;\n  let emulatorExec;\n  let uut;\n  beforeEach(() => {\n    MockListAVDsCommand = jest.createMockFromModule('../../../../common/drivers/android/emulator/exec/EmulatorExec').ListAVDsCommand;\n    jest.mock('../../../../common/drivers/android/emulator/exec/EmulatorExec', () => ({\n      ListAVDsCommand: MockListAVDsCommand,\n    }));\n\n    emulatorExec = {\n      exec: jest.fn().mockResolvedValue(''),\n    };\n\n    const AVDsResolver = require('./AVDsResolver');\n    uut = new AVDsResolver(emulatorExec);\n  });\n\n  it('should exec command', async () => {\n    await uut.resolve();\n    expect(emulatorExec.exec).toHaveBeenCalledWith(expect.any(MockListAVDsCommand));\n  });\n\n  it('should parse emulators list given as text', async () => {\n    emulatorExec.exec.mockResolvedValue('avd-device1\\navd-device2\\n');\n    expect(await uut.resolve()).toEqual(['avd-device1', 'avd-device2']);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js",
    "content": "/**\n * @typedef {import('../../../../common/drivers/android/cookies').AndroidDeviceCookie} AndroidDeviceCookie\n */\n\nconst _ = require('lodash');\n\nconst log = require('../../../../../utils/logger').child({ cat: 'device,device-allocation' });\nconst AndroidAllocDriver = require('../AndroidAllocDriver');\n\nconst { patchAvdSkinConfig } = require('./patchAvdSkinConfig');\n\nclass EmulatorAllocDriver extends AndroidAllocDriver {\n  /**\n   * @param {object} options\n   * @param {import('../../../../common/drivers/android/exec/ADB')} options.adb\n   * @param {import('./AVDValidator')} options.avdValidator\n   * @param {DetoxInternals.RuntimeConfig} options.detoxConfig\n   * @param {import('../../../DeviceRegistry')} options.deviceRegistry\n   * @param {import('./FreeEmulatorFinder')} options.freeDeviceFinder\n   * @param {import('./FreePortFinder')} options.freePortFinder\n   * @param {import('./EmulatorLauncher')} options.emulatorLauncher\n   * @param {import('./EmulatorVersionResolver')} options.emulatorVersionResolver\n   */\n  constructor({\n    adb,\n    avdValidator,\n    detoxConfig,\n    deviceRegistry,\n    freeDeviceFinder,\n    freePortFinder,\n    emulatorVersionResolver,\n    emulatorLauncher\n  }) {\n    super({ adb });\n    this._avdValidator = avdValidator;\n    this._deviceRegistry = deviceRegistry;\n    this._emulatorVersionResolver = emulatorVersionResolver;\n    this._emulatorLauncher = emulatorLauncher;\n    this._freeDeviceFinder = freeDeviceFinder;\n    this._freePortFinder = freePortFinder;\n    this._shouldShutdown = detoxConfig.behavior.cleanup.shutdownDevice;\n    this._fixAvdConfigIniSkinNameIfNeeded = _.memoize(this._fixAvdConfigIniSkinNameIfNeeded.bind(this));\n  }\n\n  async init() {\n    await this._deviceRegistry.unregisterZombieDevices();\n  }\n\n  /**\n   * @param deviceConfig\n   * @returns {Promise<AndroidDeviceCookie>}\n   */\n  async allocate(deviceConfig) {\n    const avdName = deviceConfig.device.avdName;\n\n    await this._avdValidator.validate(avdName, deviceConfig.headless);\n    await this._fixAvdConfigIniSkinNameIfNeeded(avdName, deviceConfig.headless);\n\n    const adbName = await this._deviceRegistry.registerDevice(async () => {\n      let adbName = await this._freeDeviceFinder.findFreeDevice(avdName);\n      if (!adbName) {\n        const port = await this._freePortFinder.findFreePort();\n        adbName = `emulator-${port}`;\n\n        await this._emulatorLauncher.launch({\n          bootArgs: deviceConfig.bootArgs,\n          gpuMode: deviceConfig.gpuMode,\n          headless: deviceConfig.headless,\n          readonly: deviceConfig.readonly,\n          avdName,\n          adbName,\n          port,\n        });\n      }\n\n      return adbName;\n    });\n\n    return {\n      id: adbName,\n      adbName,\n      name: `${adbName} (${avdName})`,\n    };\n  }\n\n  /**\n   * @param {AndroidDeviceCookie} deviceCookie\n   * @param {{ deviceConfig: Detox.DetoxSharedAndroidDriverConfig }} configs\n   * @returns {Promise<AndroidDeviceCookie>}\n   */\n  async postAllocate(deviceCookie, configs) {\n    const { adbName } = deviceCookie;\n\n    await this._emulatorLauncher.awaitEmulatorBoot(adbName);\n    await this._adb.apiLevel(adbName);\n    await this._adb.disableAndroidAnimations(adbName);\n    await this._adb.unlockScreen(adbName);\n    await super.postAllocate(deviceCookie, configs);\n\n    return deviceCookie;\n  }\n\n  /**\n   * @param cookie {AndroidDeviceCookie}\n   * @param options {Partial<import('../../AllocationDriverBase').DeallocOptions>}\n   * @return {Promise<void>}\n   */\n  async free(cookie, options = {}) {\n    const { adbName } = cookie;\n\n    if (options.shutdown) {\n      await this._doShutdown(adbName);\n      await this._deviceRegistry.unregisterDevice(adbName);\n    } else {\n      await this._deviceRegistry.releaseDevice(adbName);\n    }\n  }\n\n  async cleanup() {\n    if (this._shouldShutdown) {\n      const { devices } = await this._adb.devices();\n      const actualEmulators = devices.map((device) => device.adbName);\n      const sessionDevices = await this._deviceRegistry.readSessionDevices();\n      const emulatorsToShutdown = _.intersection(sessionDevices.getIds(), actualEmulators);\n      const shutdownPromises = emulatorsToShutdown.map((adbName) => this._doShutdown(adbName));\n      await Promise.all(shutdownPromises);\n    }\n\n    await this._deviceRegistry.unregisterSessionDevices();\n  }\n\n  /**\n   * @param {string} adbName\n   * @return {Promise<void>}\n   */\n  async _doShutdown(adbName) {\n    try {\n      await this._emulatorLauncher.shutdown(adbName);\n    } catch (err) {\n      log.warn({ err }, `Failed to shutdown emulator ${adbName}`);\n    }\n  }\n\n  async _fixAvdConfigIniSkinNameIfNeeded(avdName, isHeadless) {\n    const rawBinaryVersion = await this._emulatorVersionResolver.resolve(isHeadless);\n    const binaryVersion = _.get(rawBinaryVersion, 'major');\n    return await patchAvdSkinConfig(avdName, binaryVersion);\n  }\n}\n\nmodule.exports = EmulatorAllocDriver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js",
    "content": "// @ts-nocheck\nconst { DetoxRuntimeError } = require('../../../../../errors');\nconst retry = require('../../../../../utils/retry');\nconst { LaunchCommand } = require('../../../../common/drivers/android/emulator/exec/EmulatorExec');\n\nconst { launchEmulatorProcess } = require('./launchEmulatorProcess');\n\nconst isUnknownEmulatorError = (err) => (err.message || '').includes('failed with code null');\n\nclass EmulatorLauncher {\n  constructor({ adb, emulatorExec }) {\n    this._adb = adb;\n    this._emulatorExec = emulatorExec;\n  }\n\n  /**\n   * @param {object} options\n   * @param {string} options.avdName\n   * @param {string} options.adbName\n   * @param {number} options.port\n   * @param {string | undefined} options.bootArgs\n   * @param {string | undefined} options.gpuMode\n   * @param {boolean} options.headless\n   * @param {boolean} options.readonly\n   */\n  async launch(options) {\n    const launchCommand = new LaunchCommand(options);\n    await retry({\n      retries: 2,\n      interval: 100,\n      conditionFn: isUnknownEmulatorError,\n    }, () => launchEmulatorProcess(this._emulatorExec, this._adb, launchCommand));\n  }\n\n  /**\n   * @param {string} adbName\n   */\n  async awaitEmulatorBoot(adbName) {\n    await retry({ retries: 240, interval: 2500, shouldUnref: true }, async () => {\n      const isBootComplete = await this._adb.isBootComplete(adbName);\n\n      if (!isBootComplete) {\n        throw new DetoxRuntimeError({\n          message: `Waited for ${adbName} to complete booting for too long!`,\n        });\n      }\n    });\n  }\n\n  async shutdown(adbName) {\n    await this._adb.emuKill(adbName);\n    await retry({\n      retries: 5,\n      interval: 1000,\n      initialSleep: 2000,\n    }, async () => {\n      if (await this._adb.getState(adbName) !== 'none') {\n        throw new DetoxRuntimeError({\n          message: `Failed to shut down the emulator ${adbName}`,\n          hint: `Try terminating manually all processes named \"qemu-system-x86_64\"`,\n        });\n      }\n    });\n  }\n}\n\nmodule.exports = EmulatorLauncher;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.test.js",
    "content": "describe('Emulator launcher', () => {\n  const avdName = 'Pixel_Mock';\n  const adbName = 'mock-emulator:1234';\n\n  let retry;\n  let emulatorExec;\n  let adb;\n  let launchEmulatorProcess;\n  let uut;\n\n  beforeEach(() => {\n    jest.mock('../../../../../utils/logger');\n\n    jest.mock('../../../../../utils/retry');\n    retry = jest.requireMock('../../../../../utils/retry');\n    retry.mockImplementation((options, func) => func());\n\n    const ADB = jest.createMockFromModule('../../../../common/drivers/android/exec/ADB');\n    adb = new ADB();\n    adb.isBootComplete.mockReturnValue(true);\n\n    const { EmulatorExec } = jest.createMockFromModule('../../../../common/drivers/android/emulator/exec/EmulatorExec');\n    emulatorExec = new EmulatorExec();\n\n    jest.mock('./launchEmulatorProcess');\n    launchEmulatorProcess = require('./launchEmulatorProcess').launchEmulatorProcess;\n\n    const EmulatorLauncher = require('./EmulatorLauncher');\n    uut = new EmulatorLauncher({\n      adb,\n      emulatorExec,\n    });\n  });\n\n  describe('launch', () => {\n    it('should launch the specified emulator in a separate process', async () => {\n      await uut.launch({ avdName, adbName });\n      expect(launchEmulatorProcess).toHaveBeenCalledWith(emulatorExec, adb, expect.objectContaining({\n        avdName,\n        adbName,\n      }));\n    });\n\n    it('should launch using a specific emulator port, if provided', async () => {\n      const port = 1234;\n      await uut.launch({ avdName, adbName, port });\n\n      const [[,,command]] = launchEmulatorProcess.mock.calls;\n      expect(command.port).toEqual(port);\n    });\n\n    it('should retry emulator process launching with custom args', async () => {\n      const expectedRetryOptions = {\n        retries: 2,\n        interval: 100,\n      };\n\n      await uut.launch({ avdName, adbName });\n\n      expect(retry).toHaveBeenCalledWith(\n        expect.objectContaining(expectedRetryOptions),\n        expect.any(Function),\n      );\n    });\n\n    it('should retry emulator process launching with a conditional to check whether error was specified through binary as unknown', async () => {\n      const messageUnknownError = 'failed with code null';\n\n      await uut.launch({ avdName, adbName });\n\n      const mockedCallToRetry = retry.mock.calls[0];\n      const callOptions = mockedCallToRetry[0];\n      expect(callOptions.conditionFn).toBeDefined();\n\n      expect(callOptions.conditionFn(new Error(messageUnknownError))).toEqual(true);\n      expect(callOptions.conditionFn(new Error('other error message'))).toEqual(false);\n      expect(callOptions.conditionFn(new Error())).toEqual(false);\n    });\n  });\n\n  describe('awaitEmulatorBoot', () => {\n    const givenDeviceBootCompleted = () => adb.isBootComplete.mockResolvedValue(true);\n    const givenDeviceBootIncomplete = () => adb.isBootComplete.mockResolvedValue(false);\n\n    it('should poll for boot completion', async () => {\n      expect.assertions(2);\n      givenDeviceBootCompleted();\n\n      retry\n        .mockImplementationOnce(async (options, func) => {\n          expect(adb.isBootComplete).not.toHaveBeenCalled();\n          await func();\n          expect(adb.isBootComplete).toHaveBeenCalledWith(adbName);\n        });\n\n      await uut.awaitEmulatorBoot(adbName);\n    });\n\n    it('should throw if boot completion check returns negative', async () => {\n      givenDeviceBootIncomplete();\n\n      try {\n        await uut.awaitEmulatorBoot(adbName);\n      } catch (e) {\n        expect(e.constructor.name).toEqual('DetoxRuntimeError');\n        expect(e.toString()).toContain(`Waited for ${adbName} to complete booting for too long!`);\n        return;\n      }\n      throw new Error('Expected an error');\n    });\n\n    it('should call retry for boot completion - with decent options', async () => {\n      const expectedRetryOptions = {\n        retries: 240,\n        interval: 2500,\n      };\n\n      givenDeviceBootCompleted();\n\n      await uut.awaitEmulatorBoot(adbName);\n\n      expect(retry).toHaveBeenCalledWith(\n        expect.objectContaining(expectedRetryOptions),\n        expect.any(Function)\n      );\n    });\n\n    it('should poll for boot completion even if emulator is already running', async () => {\n      await uut.awaitEmulatorBoot(adbName);\n      expect(adb.isBootComplete).toHaveBeenCalledWith(adbName);\n    });\n  });\n\n  describe('shutdown', () => {\n    beforeEach(() => {\n      retry.mockImplementation(async ({ retries }, func) => {\n        while (retries > 0) {\n          try {\n            return await func();\n          } catch (e) {\n            if (!--retries) throw e;\n          }\n        }\n      });\n    });\n\n    describe('if it goes as expected', () => {\n      beforeEach(async () => {\n        adb.getState.mockResolvedValueOnce('device');\n        adb.getState.mockResolvedValueOnce('offline');\n        adb.getState.mockResolvedValueOnce('none');\n\n        await uut.shutdown(avdName);\n      });\n\n      it('should kill device via adb', async () => {\n        expect(adb.emuKill).toHaveBeenCalledWith(avdName);\n      });\n\n      it('should wait until the device cannot be found', async () => {\n        expect(adb.getState).toHaveBeenCalledTimes(3);\n      });\n    });\n\n    describe('if shutdown does not go well', () => {\n      beforeEach(async () => {\n        adb.getState.mockResolvedValue('offline');\n        await expect(uut.shutdown(avdName)).rejects.toThrow(new RegExp(`Failed to shut down.*${avdName}`));\n      });\n\n      it('should keep polling the emulator status until it is \"none\"', async () => {\n        expect(adb.getState).toHaveBeenCalledTimes(5);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/EmulatorVersionResolver.js",
    "content": "const log = require('../../../../../utils/logger').child({ cat: 'device' });\nconst { QueryVersionCommand } = require('../../../../common/drivers/android/emulator/exec/EmulatorExec');\n\nclass EmulatorVersionResolver {\n  constructor(emulatorExec) {\n    this._emulatorExec = emulatorExec;\n    this.version = undefined;\n  }\n\n  async resolve(isHeadless = false) {\n    if (!this.version) {\n      this.version = await this._resolve(isHeadless);\n    }\n    return this.version;\n  }\n\n  async _resolve(headless) {\n    let rawOutput;\n    try {\n      rawOutput = await this._emulatorExec.exec(new QueryVersionCommand({ headless })) || '';\n    } catch (error) {\n      log.error({ success: false, error }, 'Could not detect emulator binary version', error);\n      return null;\n    }\n\n    const matches = rawOutput.match(/Android emulator version ([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]*)/);\n    if (!matches) {\n      log.warn({ success: false }, 'Could not detect emulator binary version, got:', rawOutput);\n      return null;\n    }\n\n    const version = this._parseVersionString(matches[1]);\n    log.debug({ success: true }, 'Detected emulator binary version', version);\n    return version;\n  }\n\n  _parseVersionString(versionRaw) {\n    const [major, minor, patch] = versionRaw.split('.');\n    return {\n      major: Number(major),\n      minor: Number(minor),\n      patch: Number(patch),\n      toString: () => versionRaw,\n    };\n  }\n}\nmodule.exports = EmulatorVersionResolver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/EmulatorVersionResolver.test.js",
    "content": "describe('Emulator binary version', () => {\n  const versionResult = [\n    'Android emulator version 30.1.2.3 (build_id 6306047) (CL:N/A)',\n    'Copyright (C) 2006-2017 The Android Open Source Project and many others.',\n    'This program is a derivative of the QEMU CPU emulator (www.qemu.org).',\n    '  This software is licensed under the terms of the GNU General Public',\n    '  License version 2, as published by the Free Software Foundation, and',\n    '  may be copied, distributed, and modified under those terms.',\n    '  This program is distributed in the hope that it will be useful,',\n    '  but WITHOUT ANY WARRANTY; without even the implied warranty of',\n    '  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the',\n    '  GNU General Public License for more details.',\n  ].join('\\n');\n  const expectedVersion = {\n    major: 30,\n    minor: 1,\n    patch: 2,\n  };\n  const expectedVersionRaw = '30.1.2.3';\n\n  let MockQueryVersionCommand;\n  let emulatorExec;\n  let log;\n  let uut;\n  beforeEach(() => {\n    MockQueryVersionCommand = jest.createMockFromModule('../../../../common/drivers/android/emulator/exec/EmulatorExec').QueryVersionCommand;\n    jest.mock('../../../../common/drivers/android/emulator/exec/EmulatorExec', () => ({\n      QueryVersionCommand: MockQueryVersionCommand,\n    }));\n\n    emulatorExec = {\n      exec: jest.fn().mockResolvedValue(versionResult),\n    };\n\n    jest.mock('../../../../../utils/logger');\n    log = require('../../../../../utils/logger').child();\n\n    const EmulatorVersionResolver = require('./EmulatorVersionResolver');\n    uut = new EmulatorVersionResolver(emulatorExec);\n  });\n\n  it('should query the emulator', async () => {\n    await uut.resolve();\n    expect(emulatorExec.exec).toHaveBeenCalledWith(expect.any(MockQueryVersionCommand));\n    expect(MockQueryVersionCommand).toHaveBeenCalledWith({ headless: false });\n  });\n\n  it('should apply headless arg', async () => {\n    await uut.resolve(true);\n    expect(MockQueryVersionCommand).toHaveBeenCalledWith({ headless: true });\n  });\n\n  it('should extract version from common log', async () => {\n    const version = await uut.resolve();\n    expect(version).toEqual(expect.objectContaining(expectedVersion));\n    expect(version.toString()).toEqual(expectedVersionRaw);\n  });\n\n  it('should return null for an empty query result', async () => {\n    emulatorExec.exec.mockResolvedValue(undefined);\n    const version = await uut.resolve();\n    expect(version).toEqual(null);\n  });\n\n  it('should return null for a query result that has an invalid syntax', async () => {\n    emulatorExec.exec.mockResolvedValue('Android emulator version <invalid> (build_id 6306047) (CL:N/A)');\n    const version = await uut.resolve();\n    expect(version).toEqual(null);\n  });\n\n  it('should log in case of a parsing error', async () => {\n    emulatorExec.exec.mockResolvedValue('non-parsable result');\n    await uut.resolve();\n    expect(log.warn).toHaveBeenCalledWith({ success: false }, expect.any(String), 'non-parsable result');\n  });\n\n  it('should return null in case of a version-query failure', async () => {\n    emulatorExec.exec.mockRejectedValue(new Error('some error'));\n    const version = await uut.resolve();\n    expect(version).toEqual(null);\n  });\n\n  it('should log in case of a version-query failure', async () => {\n    const error = new Error('some error');\n    emulatorExec.exec.mockRejectedValue(error);\n    await uut.resolve();\n    expect(log.error).toHaveBeenCalledWith({ success: false, error }, expect.any(String), error);\n  });\n\n  it('should cache the version', async () => {\n    await uut.resolve();\n    const version = await uut.resolve();\n\n    expect(emulatorExec.exec).toHaveBeenCalledTimes(1);\n    expect(version).toEqual(expect.objectContaining(expectedVersion));\n  });\n\n  it('should log the version', async () => {\n    await uut.resolve();\n    expect(log.debug).toHaveBeenCalledWith({ success: true }, expect.any(String), expect.objectContaining(expectedVersion));\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/FreeEmulatorFinder.js",
    "content": "const FreeDeviceFinder = require('../FreeDeviceFinder');\n\nclass FreeEmulatorFinder extends FreeDeviceFinder {\n  /**\n   * @override\n   */\n  async _isDeviceMatching(candidate, avdName) {\n    return candidate.type === 'emulator' && (await candidate.queryName()) === avdName;\n  }\n}\n\nmodule.exports = FreeEmulatorFinder;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/FreeEmulatorFinder.test.js",
    "content": "const DeviceList = require('../../../DeviceList');\nconst { emulator5556, localhost5555, mockAvdName } = require('../__mocks__/handles');\n\ndescribe('FreeEmulatorFinder', () => {\n  const mockAdb = { devices: jest.fn() };\n\n  /** @type {DeviceList} */\n  let fakeDeviceList;\n  /** @type {jest.Mocked<import('../../../DeviceRegistry')>} */\n  let mockDeviceRegistry;\n  let uut;\n\n  beforeEach(() => {\n    fakeDeviceList = new DeviceList();\n\n    const DeviceRegistry = jest.createMockFromModule('../../../DeviceRegistry');\n    mockDeviceRegistry = new DeviceRegistry();\n    mockDeviceRegistry.getTakenDevicesSync.mockImplementation(() => fakeDeviceList);\n\n    const FreeEmulatorFinder = require('./FreeEmulatorFinder');\n    uut = new FreeEmulatorFinder(mockAdb, mockDeviceRegistry);\n  });\n\n  it('should return device when it is an emulator and avdName matches', async () => {\n    mockAdbDevices([emulator5556]);\n    const result = await uut.findFreeDevice(mockAvdName);\n    expect(result).toBe(emulator5556.adbName);\n  });\n\n  it('should return null when avdName does not match', async () => {\n    mockAdbDevices([emulator5556]);\n    expect(await uut.findFreeDevice('wrongAvdName')).toBe(null);\n  });\n\n  it('should return null when not an emulator', async () => {\n    mockAdbDevices([localhost5555]);\n    expect(await uut.findFreeDevice(mockAvdName)).toBe(null);\n  });\n\n  const mockAdbDevices = (devices) => mockAdb.devices.mockResolvedValue({ devices });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/FreePortFinder.js",
    "content": "const net = require('net');\n\nclass FreePortFinder {\n  constructor({ min = 10000, max = 20000 } = {}) {\n    this._min = min;\n    this._max = max;\n  }\n\n  async findFreePort() {\n    let port;\n\n    do {\n      const min = this._min;\n      const max = this._max;\n      port = Math.random() * (max - min) + min;\n      port = port & 0xFFFFFFFE; // Should always be even\n    } while (await this.isPortTaken(port));\n\n    return port;\n  }\n\n  async isPortTaken(port) {\n    return new Promise((resolve, reject) => {\n      const tester = net.createServer()\n        .once('error', /** @param {*} err */ (err) => {\n          /* istanbul ignore next */\n          return err && err.code === 'EADDRINUSE' ? resolve(true) : reject(err);\n        })\n        .once('listening', () => {\n          tester.once('close', () => resolve(false)).close();\n        })\n        .listen(port);\n    });\n  }\n}\n\nmodule.exports = FreePortFinder;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/FreePortFinder.test.js",
    "content": "const net = require('net');\n\nconst FreePortFinder = require('./FreePortFinder');\n\ndescribe('FreePortFinder', () => {\n  let finder;\n  let server;\n\n  beforeEach(() => {\n    finder = new FreePortFinder();\n  });\n\n  afterEach(done => {\n    if (server) {\n      server.close(done);\n    } else {\n      done();\n    }\n  });\n\n  test('should find a free port', async () => {\n    const port = await finder.findFreePort();\n    expect(port).toBeGreaterThanOrEqual(10000);\n    expect(port).toBeLessThanOrEqual(20000);\n    expect(port % 2).toBe(0);\n    await expect(finder.isPortTaken(port)).resolves.toBe(false);\n  });\n\n  test('should identify a taken port', async () => {\n    server = net.createServer();\n    const portTaken = await new Promise(resolve => {\n      server.listen(0, () => { // 0 means random available port\n        resolve(server.address().port);\n      });\n    });\n\n    await expect(finder.isPortTaken(portTaken)).resolves.toBe(true);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js",
    "content": "const fs = require('fs');\n\nconst _ = require('lodash');\n\nconst unitLogger = require('../../../../../utils/logger').child({ cat: 'device' });\n\nfunction launchEmulatorProcess(emulatorExec, adb, emulatorLaunchCommand) {\n  let childProcessOutput;\n  const portName = emulatorLaunchCommand.port ? `-${emulatorLaunchCommand.port}` : '';\n  const tempLog = `./${emulatorLaunchCommand.avdName}${portName}.log`;\n  const stdout = fs.openSync(tempLog, 'a');\n  const stderr = fs.openSync(tempLog, 'a');\n\n  function detach() {\n    if (childProcessOutput) {\n      return;\n    }\n\n    childProcessOutput = fs.readFileSync(tempLog, 'utf8');\n\n    fs.closeSync(stdout);\n    fs.closeSync(stderr);\n    fs.unlink(tempLog, _.noop);\n  }\n\n  let log = unitLogger.child({ fn: 'boot' });\n  log.debug({ event: 'SPAWN_CMD' }, emulatorExec.toString(), emulatorLaunchCommand.toString());\n\n  const childProcessPromise = emulatorExec.spawn(emulatorLaunchCommand, stdout, stderr);\n  childProcessPromise.childProcess.unref();\n\n  log = log.child({ child_pid: childProcessPromise.childProcess.pid });\n\n  // Create a deferred promise that resolves when the device is ready\n  let resolveEmulatorReady;\n  const emulatorReadyPromise = new Promise(resolve => {\n    resolveEmulatorReady = resolve;\n  });\n\n  // Wait for the device to be ready\n  adb.waitForDevice(emulatorLaunchCommand.adbName).then(() => {\n    resolveEmulatorReady();\n  });\n\n  // Use Promise.race to resolve with the first one to complete - either the emulator process exits\n  // or the emulator device is ready\n  return Promise.race([childProcessPromise, emulatorReadyPromise])\n    .then(() => true)\n    .catch((err) => {\n      detach();\n\n      if (childProcessOutput && childProcessOutput.includes(`There's another emulator instance running with the current AVD`)) {\n        return false;\n      }\n\n      log.error({ event: 'SPAWN_FAIL', error: true, err }, err.message);\n      log.error({ event: 'SPAWN_FAIL', stderr: true }, childProcessOutput);\n      throw err;\n    })\n    .then((coldBoot) => {\n      detach();\n      log.debug({ event: 'SPAWN_SUCCESS', stdout: true }, childProcessOutput);\n      return coldBoot;\n    });\n}\n\nmodule.exports = { launchEmulatorProcess };\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/emulator/patchAvdSkinConfig.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst ini = require('ini');\n\nconst DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst environment = require('../../../../../utils/environment');\nconst log = require('../../../../../utils/logger');\n\nconst EMU_BIN_STABLE_SKIN_VER = 28;\n\nasync function patchAvdSkinConfig(avdName, binaryVersion) {\n  if (!binaryVersion) {\n    log.warn({ event: 'EMU_SKIN_CFG_PATCH' }, [\n      'Failed to detect emulator version! (see previous logs)',\n      'This leaves Detox unable to tell if it should automatically apply this patch-fix: https://stackoverflow.com/a/47265664/453052, which seems to be needed in emulator versions < 28.',\n      'If you feel this is not needed, you can either ignore this message, or otherwise apply the patch manually.',\n    ].join('\\n'));\n    return;\n  }\n\n  if (binaryVersion >= EMU_BIN_STABLE_SKIN_VER) {\n    return;\n  }\n\n  const avdPath = environment.getAvdDir(avdName);\n  const configFile = path.join(avdPath, 'config.ini');\n  const config = ini.parse(fs.readFileSync(configFile, 'utf-8'));\n\n  if (!config['skin.name']) {\n    const width = config['hw.lcd.width'];\n    const height = config['hw.lcd.height'];\n\n    if (width === undefined || height === undefined) {\n      throw new DetoxRuntimeError(`Emulator with name ${avdName} has a corrupt config.ini file (${configFile}), try fixing it by recreating an emulator.`);\n    }\n\n    config['skin.name'] = `${width}x${height}`;\n    fs.writeFileSync(configFile, ini.stringify(config));\n  }\n}\n\nmodule.exports = { patchAvdSkinConfig };\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js",
    "content": "/**\n * @typedef {import('../../../../common/drivers/android/cookies').GenycloudEmulatorCookie} GenycloudEmulatorCookie\n */\n\nconst Timer = require('../../../../../utils/Timer');\nconst log = require('../../../../../utils/logger').child({ cat: 'device' });\nconst AndroidAllocDriver = require('../AndroidAllocDriver');\n\nconst GenyRegistry = require('./GenyRegistry');\n\nconst events = {\n  GENYCLOUD_INIT: { event: 'GENYCLOUD_INIT' },\n  GENYCLOUD_TEARDOWN: { event: 'GENYCLOUD_TEARDOWN' },\n};\n\nclass GenyAllocDriver extends AndroidAllocDriver {\n  /**\n   * @param {object} options\n   * @param {import('../../../../common/drivers/android/exec/ADB')} options.adb\n   * @param {DetoxInternals.SessionState} options.detoxSession\n   * @param {import('./GenyRegistry')} options.genyRegistry\n   * @param {import('./GenyInstanceLauncher')} options.instanceLauncher\n   * @param {import('./GenyRecipeQuerying')} options.recipeQuerying\n   */\n  constructor({\n    adb,\n    detoxSession,\n    genyRegistry = new GenyRegistry(),\n    instanceLauncher,\n    recipeQuerying,\n  }) {\n    super({ adb });\n    this._detoxSessionId = detoxSession.id;\n    this._genyRegistry = genyRegistry;\n    this._instanceLauncher = instanceLauncher;\n    this._recipeQuerying = recipeQuerying;\n    this._instanceCounter = 0;\n  }\n\n  async init() {\n    try {\n      await this._adb.startDaemon();\n    } catch (error) {\n      log.warn({ ...events.GENYCLOUD_INIT, error }, 'ADB server start failed; error ignored');\n    }\n  }\n\n  /**\n   * @param deviceConfig { Object }\n   * @return {Promise<GenycloudEmulatorCookie>}\n   */\n  async allocate(deviceConfig) {\n    const deviceQuery = deviceConfig.device;\n    const recipe = await this._recipeQuerying.getRecipeFromQuery(deviceQuery);\n\n    let instance = this._genyRegistry.findFreeInstance(recipe);\n    if (!instance) {\n      const instanceName = `Detox.${this._detoxSessionId}.${this._instanceCounter++}`;\n      instance = await this._instanceLauncher.launch(recipe, instanceName);\n      this._genyRegistry.addInstance(instance, recipe);\n    }\n\n    return {\n      id: instance.uuid,\n      adbName: instance.adbName,\n      name: instance.name,\n      instance,\n    };\n  }\n\n  /**\n   * @param {GenycloudEmulatorCookie} cookie\n   * @param {{ deviceConfig: Detox.DetoxSharedAndroidDriverConfig }} configs\n   * @returns {Promise<GenycloudEmulatorCookie>}\n   */\n  async postAllocate(cookie, configs) {\n    const instance = await this._instanceLauncher.connect(cookie.instance);\n    this._genyRegistry.updateInstance(instance);\n\n    if (this._genyRegistry.pollNewInstance(instance.uuid)) {\n      const { adbName } = instance;\n\n      await Timer.run(20000, 'waiting for device to respond', async () => {\n        await this._adb.disableAndroidAnimations(adbName);\n        await this._adb.setWiFiToggle(adbName, true);\n        await this._adb.apiLevel(adbName);\n      });\n    }\n\n    await super.postAllocate(cookie, configs);\n\n    return {\n      ...cookie,\n      adbName: instance.adbName,\n    };\n  }\n\n  /**\n   * @param cookie {Omit<GenycloudEmulatorCookie, 'instance'>}\n   * @param options {Partial<import('../../AllocationDriverBase').DeallocOptions>}\n   * @return {Promise<void>}\n   */\n  async free(cookie, options = {}) {\n    try {\n      if (!options.shutdown) {\n        await Timer.run(10000, 'waiting for device to respond', async () => {\n          await this._adb.shell(cookie.adbName, 'echo ok');\n        });\n      }\n    } catch {\n      options.shutdown = true;\n    }\n\n    // Known issue: cookie won't have a proper 'instance' field due to (de)serialization\n    if (options.shutdown) {\n      this._genyRegistry.removeInstance(cookie.id);\n      await this._instanceLauncher.shutdown(cookie.id);\n    } else {\n      this._genyRegistry.markAsFree(cookie.id);\n    }\n  }\n\n  async cleanup() {\n    log.info(events.GENYCLOUD_TEARDOWN, 'Initiating Genymotion SaaS instances teardown...');\n\n    const killPromises = this._genyRegistry.getInstances().map((instance) => {\n      this._genyRegistry.markAsBusy(instance.uuid);\n      const onSuccess = () => this._genyRegistry.removeInstance(instance.uuid);\n      const onError = (error) => ({ ...instance, error });\n      return this._instanceLauncher.shutdown(instance.uuid).then(onSuccess, onError);\n    });\n\n    const deletionLeaks = (await Promise.all(killPromises)).filter(Boolean);\n    this._reportGlobalCleanupSummary(deletionLeaks);\n  }\n\n  /**\n   * The current error we could recover from in the context of Genymotion Cloud is when the device is not found.\n   * The error message will contain the following text adb: device 'localhost:xxxxx' not found\n   * @param error\n   * @returns {boolean}\n   */\n  isRecoverableError(error) {\n    const errorStr = JSON.stringify(error);\n    return errorStr.indexOf('adb: device \\'localhost:') !== -1;\n  }\n\n  emergencyCleanup() {\n    const instances = this._genyRegistry.getInstances();\n    this._reportGlobalCleanupSummary(instances);\n  }\n\n  _reportGlobalCleanupSummary(deletionLeaks) {\n    if (deletionLeaks.length) {\n      log.warn(events.GENYCLOUD_TEARDOWN, 'WARNING! Detected a Genymotion SaaS instance leakage, for the following instances:');\n\n      deletionLeaks.forEach(({ uuid, name, error }) => {\n        log.warn(events.GENYCLOUD_TEARDOWN, [\n          `Instance ${name} (${uuid})${error ? `: ${error}` : ''}`,\n          `    Kill it by visiting https://cloud.geny.io/instance/${uuid}, or by running:`,\n          `    gmsaas instances stop ${uuid}`,\n        ].join('\\n'));\n      });\n\n      log.info(events.GENYCLOUD_TEARDOWN, 'Instances teardown completed with warnings');\n    } else {\n      log.info(events.GENYCLOUD_TEARDOWN, 'Instances teardown completed successfully');\n    }\n  }\n}\n\nmodule.exports = GenyAllocDriver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyInstanceLauncher.js",
    "content": "const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst logger = require('../../../../../utils/logger').child({ cat: 'device' });\nconst retry = require('../../../../../utils/retry');\n\nconst GenyInstance = require('./services/dto/GenyInstance');\n\nconst events = {\n  CREATE_DEVICE: { event: 'CREATE_DEVICE' },\n};\n\nclass GenyInstanceLauncher {\n  constructor({ genyCloudExec, instanceLifecycleService }) {\n    this._genyCloudExec = genyCloudExec;\n    this._instanceLifecycleService = instanceLifecycleService;\n  }\n\n  /**\n   * @param {import('./services/dto/GenyRecipe')} recipe\n   * @param {string} instanceName\n   * @returns {Promise<GenyInstance>}\n   */\n  async launch(recipe, instanceName) {\n    logger.debug(events.CREATE_DEVICE, `Trying to create a device based on \"${recipe}\"`);\n    const instance = await this._instanceLifecycleService.createInstance(recipe.uuid, instanceName);\n    const { name, uuid } = instance;\n    logger.info(events.CREATE_DEVICE, `Allocating Genymotion Cloud instance ${name} for testing. To access it via a browser, go to: https://cloud.geny.io/instance/${uuid}`);\n\n    return instance;\n  }\n\n  /**\n   * @param {GenyInstance} instance The freshly allocated cloud-instance.\n   * @returns {Promise<GenyInstance>}\n   */\n  async connect(instance) {\n    const bootedInstance = await this._waitForInstanceBoot(instance);\n    const connectedInstance = await this._adbConnectIfNeeded(bootedInstance);\n\n    return connectedInstance;\n  }\n\n  /**\n   * @param {string} instanceId\n   */\n  async shutdown(instanceId) {\n    await this._instanceLifecycleService.deleteInstance(instanceId);\n  }\n\n  async _waitForInstanceBoot(instance) {\n    if (instance.isOnline()) {\n      return instance;\n    }\n\n    const options = {\n      backoff: 'none',\n      retries: 20,\n      interval: 5000,\n      initialSleep: 45000,\n      shouldUnref: true,\n    };\n\n    return await retry(options, async () => {\n      const { instance: _instance } = await this._genyCloudExec.getInstance(instance.uuid);\n      const anInstance = new GenyInstance(_instance);\n\n      if (!anInstance.isOnline()) {\n        throw new DetoxRuntimeError(`Timeout waiting for instance ${instance.uuid} to be ready`);\n      }\n\n      return anInstance;\n    });\n  }\n\n  async _adbConnectIfNeeded(instance) {\n    if (!instance.isAdbConnected()) {\n      instance = await this._instanceLifecycleService.adbConnectInstance(instance.uuid);\n    }\n    return instance;\n  }\n}\n\nmodule.exports = GenyInstanceLauncher;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyInstanceLauncher.test.js",
    "content": "const GenyInstance = require('./services/dto/GenyInstance');\n\ndescribe('Genymotion-Cloud instance launcher', () => {\n  const recipeName = 'mock-recipe-name';\n\n  const anInstance = (overrides) => new GenyInstance({\n    uuid: 'mock-instance-uuid',\n    name: 'mock-instance-name',\n    adb_serial: '0.0.0.0',\n    adb_serial_port: 0,\n    state: 'OFFLINE',\n    recipe: {\n      name: recipeName,\n    },\n    ...overrides,\n  });\n\n  const anOfflineInstance = () => anInstance({ state: 'OFFLINE' });\n  const anOnlineInstance = () => anInstance({ state: 'ONLINE' });\n  const aDisconnectedInstance = anOnlineInstance;\n  const aFullyConnectedInstance = () => anInstance({\n    adb_serial: 'localhost:1234',\n    adb_serial_port: 1234,\n    state: 'ONLINE',\n  });\n\n  const givenInstanceGetResult = (instance) => genyCloudExec.getInstance.mockResolvedValue({ instance: instance.toJSON() });\n  const givenInstanceCreateResult = (instance) => instanceLifecycleService.createInstance.mockResolvedValue(instance);\n  const givenAnInstanceDeletionError = () => instanceLifecycleService.deleteInstance.mockRejectedValue(new Error());\n  const givenInstanceConnectResult = (instance) => instanceLifecycleService.adbConnectInstance.mockResolvedValue(instance);\n\n  let genyCloudExec;\n  let instanceLifecycleService;\n  let uut;\n  let retry;\n\n  beforeEach(() => {\n    jest.mock('../../../../../utils/logger');\n\n    jest.mock('../../../../../utils/retry');\n    retry = jest.requireMock('../../../../../utils/retry');\n    retry.mockImplementation((options, func) => func());\n\n    const InstanceLifecycleService = jest.createMockFromModule('./services/GenyInstanceLifecycleService');\n    instanceLifecycleService = new InstanceLifecycleService();\n\n    const GenyCloudExec = jest.createMockFromModule('./exec/GenyCloudExec');\n    genyCloudExec = new GenyCloudExec();\n\n    const GenyInstanceLauncher = require('./GenyInstanceLauncher');\n    uut = new GenyInstanceLauncher({\n      genyCloudExec,\n      instanceLifecycleService,\n    });\n  });\n\n  describe('launch', () => {\n    it('should create an unconnected instance', async () => {\n      const recipe = {};\n      const instance = anOnlineInstance();\n      givenInstanceCreateResult(instance);\n      givenInstanceConnectResult(instance);\n\n      await expect(uut.launch(recipe, instance.name)).resolves.toEqual(instance);\n    });\n  });\n\n  describe('connect', () => {\n    it('should wait for the cloud instance to become online', async () => {\n      const instance = anOfflineInstance();\n      const instanceOnline = anOnlineInstance();\n      givenInstanceGetResult(instanceOnline);\n      givenInstanceConnectResult(instanceOnline);\n\n      retry.mockImplementationOnce(async (options, func) => {\n        const instance = await func();\n        expect(genyCloudExec.getInstance).toHaveBeenCalledWith(instance.uuid);\n        return instance;\n      });\n\n      const result = await uut.connect(instance);\n      expect(result).toEqual(instanceOnline);\n      expect(retry).toHaveBeenCalled();\n    });\n\n    it('should not wait for cloud instance to become online if already online', async () => {\n      const instance = anOnlineInstance();\n      givenInstanceCreateResult(instance);\n      givenInstanceConnectResult(instance);\n\n      const result = await uut.connect(instance);\n      expect(genyCloudExec.getInstance).not.toHaveBeenCalled();\n      expect(retry).not.toHaveBeenCalled();\n      expect(result).toEqual(instance);\n    });\n\n    it('should fail if instance never becomes online', async () => {\n      const instanceOffline = anOfflineInstance();\n      givenInstanceGetResult(instanceOffline);\n      givenInstanceConnectResult(instanceOffline);\n\n      await expect(uut.connect(instanceOffline))\n        .rejects\n        .toThrow(`Timeout waiting for instance ${instanceOffline.uuid} to be ready`);\n    });\n\n    it('should wait for the cloud instance to become online, with decent retry arguments', async () => {\n      const expectedRetryArgs = {\n        initialSleep: 45000,\n        backoff: 'none',\n        interval: 5000,\n        retries: 20,\n      };\n      const instance = anOfflineInstance();\n      const instanceOnline = anOnlineInstance();\n      givenInstanceGetResult(instanceOnline);\n      givenInstanceConnectResult(instanceOnline);\n\n      await uut.connect(instance);\n      expect(retry).toHaveBeenCalledWith(expect.objectContaining(expectedRetryArgs), expect.any(Function));\n    });\n\n    it('should adb-connect to instance if disconnected', async () => {\n      const disconnectedInstance = aDisconnectedInstance();\n      const connectedInstance = aFullyConnectedInstance();\n      givenInstanceCreateResult(disconnectedInstance);\n      givenInstanceConnectResult(connectedInstance);\n\n      const result = await uut.connect(disconnectedInstance);\n      expect(instanceLifecycleService.adbConnectInstance).toHaveBeenCalledWith(disconnectedInstance.uuid);\n      expect(result).toEqual(connectedInstance);\n    });\n\n    it('should not connect a connected instance', async () => {\n      const connectedInstance = aFullyConnectedInstance();\n      givenInstanceCreateResult(connectedInstance);\n      givenInstanceConnectResult(connectedInstance);\n\n      await uut.connect(connectedInstance);\n\n      expect(instanceLifecycleService.adbConnectInstance).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('Shutdown', () => {\n    it('should delete the associated instance', async () => {\n      const instance = anInstance();\n      await uut.shutdown(instance.uuid);\n      expect(instanceLifecycleService.deleteInstance).toHaveBeenCalledWith(instance.uuid);\n    });\n\n    it('should fail if deletion fails', async () => {\n      givenAnInstanceDeletionError();\n\n      const instance = anInstance();\n      await expect(uut.shutdown(instance.uuid)).rejects.toThrow();\n    });\n\n    it('should remove the instance from the cleanup registry', async () => {\n      const instance = anInstance();\n      await uut.shutdown(instance);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyRecipeQuerying.js",
    "content": "class GenyRecipeQuerying {\n  /**\n   * @param {import('./services/GenyRecipesService')} recipesService\n   */\n  constructor(recipesService) {\n    this.recipesService = recipesService;\n  }\n\n  async getRecipeFromQuery({ recipeName, recipeUUID }) {\n    return recipeUUID\n      ? this.recipesService.getRecipeByUUID(recipeUUID)\n      : this.recipesService.getRecipeByName(recipeName);\n  }\n}\n\nmodule.exports = GenyRecipeQuerying;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyRecipeQuerying.test.js",
    "content": "describe('Genymotion-cloud recipe-query', () => {\n\n  let recipesService;\n  let uut;\n  beforeEach(() => {\n    const RecipesService = jest.createMockFromModule('./services/GenyRecipesService');\n    recipesService = new RecipesService();\n\n    const DeviceQueryHelper = require('./GenyRecipeQuerying');\n    uut = new DeviceQueryHelper(recipesService);\n  });\n\n  const aRecipe = () => ({\n    uuid: 'mock-recipe-uuid',\n    name: 'mock-recipe-name',\n  });\n  const anotherRecipe = () => ({\n    uuid: 'mock-recipe-uuid2',\n    name: 'mock-recipe-name2',\n  });\n\n  const givenRecipeByNameResult = (recipe) => recipesService.getRecipeByName.mockResolvedValue(recipe);\n  const givenRecipeByUUIDResult = (recipe) => recipesService.getRecipeByUUID.mockResolvedValue(recipe);\n\n  it('should query based on an object containing recipe name', async () => {\n    const deviceQuery = {\n      recipeName: 'recipe-mock-name',\n    };\n    const recipe = aRecipe();\n    givenRecipeByNameResult(recipe);\n\n    const result = await uut.getRecipeFromQuery(deviceQuery);\n    expect(result).toEqual(recipe);\n    expect(recipesService.getRecipeByName).toHaveBeenCalledWith(deviceQuery.recipeName);\n  });\n\n  it('should query based on an object containing recipe UUID', async () => {\n    const deviceQuery = {\n      recipeUUID: 'recipe-mock-name',\n    };\n    const recipe1 = aRecipe();\n    const recipe2 = anotherRecipe();\n    givenRecipeByNameResult(recipe1);\n    givenRecipeByUUIDResult(recipe2);\n\n    const result = await uut.getRecipeFromQuery(deviceQuery);\n    expect(result).toEqual(recipe2);\n    expect(recipesService.getRecipeByUUID).toHaveBeenCalledWith(deviceQuery.recipeUUID);\n    expect(recipesService.getRecipeByName).not.toHaveBeenCalledWith();\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyRegistry.js",
    "content": "const { DetoxInternalError } = require('../../../../../errors');\n\nclass GenyRegistry {\n  constructor() {\n    /** @type {Map<string, import('./services/dto/GenyRecipe')>} */\n    this._recipes = new Map();\n    /** @type {Map<string, import('./services/dto/GenyInstance')>} */\n    this._freeInstances = new Map();\n    /** @type {Map<string, import('./services/dto/GenyInstance')>} */\n    this._busyInstances = new Map();\n    /** @type {Set<string>} */\n    this._newInstances = new Set();\n  }\n\n  /**\n   * @returns {import('./services/dto/GenyInstance')[]}\n   */\n  getInstances() {\n    return [\n      ...this._freeInstances.values(),\n      ...this._busyInstances.values(),\n    ];\n  }\n\n  /**\n   * @param {import('./services/dto/GenyInstance')} instance\n   * @param {import('./services/dto/GenyRecipe')} recipe\n   */\n  addInstance(instance, recipe) {\n    this._recipes.set(instance.uuid, recipe);\n    this._busyInstances.set(instance.uuid, instance);\n    this._newInstances.add(instance.uuid);\n  }\n\n  /**\n   * @param {string} instanceId\n   * @returns {boolean}\n   */\n  pollNewInstance(instanceId) {\n    const result = this._newInstances.has(instanceId);\n    this._newInstances.delete(instanceId);\n    return result;\n  }\n\n  /** @param {import('./services/dto/GenyInstance')} instance */\n  updateInstance(instance) {\n    let found = false;\n\n    if (this._freeInstances.has(instance.uuid)) {\n      this._freeInstances.set(instance.uuid, instance);\n      found = true;\n    }\n\n    if (this._busyInstances.has(instance.uuid)) {\n       this._busyInstances.set(instance.uuid, instance);\n       found = true;\n    }\n\n    if (!found) {\n      throw new DetoxInternalError(`Cannot update an unknown instance ${instance.uuid}`);\n    }\n  }\n\n  /** @param {string} instanceId */\n  removeInstance(instanceId) {\n    this._freeInstances.delete(instanceId);\n    this._busyInstances.delete(instanceId);\n    this._newInstances.delete(instanceId);\n    this._recipes.delete(instanceId);\n  }\n\n  /**\n   * @param {string} instanceId\n   * @returns {import('./services/dto/GenyInstance')}\n   */\n  markAsBusy(instanceId) {\n    if (this._busyInstances.has(instanceId)) {\n      return this._busyInstances.get(instanceId);\n    }\n\n    const instance = this._freeInstances.get(instanceId);\n    if (!instance) {\n      throw new DetoxInternalError(`Cannot mark an unknown instance ${instanceId} as busy`);\n    }\n\n    this._busyInstances.set(instanceId, instance);\n    this._freeInstances.delete(instanceId);\n    return instance;\n  }\n\n  /**\n   * @param {string} instanceId\n   * @returns {import('./services/dto/GenyInstance')}\n   */\n  markAsFree(instanceId) {\n    if (this._freeInstances.has(instanceId)) {\n      return this._freeInstances.get(instanceId);\n    }\n\n    const instance = this._busyInstances.get(instanceId);\n    if (!instance) {\n      throw new DetoxInternalError(`Cannot mark an unknown instance ${instanceId} as free`);\n    }\n\n    this._busyInstances.delete(instanceId);\n    this._freeInstances.set(instanceId, instance);\n    return instance;\n  }\n\n  /** @returns {import('./services/dto/GenyInstance') | undefined} */\n  findFreeInstance(recipe) {\n    for (const instance of this._freeInstances.values()) {\n      const aRecipe = this._recipes.get(instance.uuid);\n      if (recipe.uuid === aRecipe.uuid) {\n        return this.markAsBusy(instance.uuid);\n      }\n    }\n  }\n}\n\nmodule.exports = GenyRegistry;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/GenyRegistry.test.js",
    "content": "const GenyRegistry = require('./GenyRegistry');\nconst GenyInstance = require('./services/dto/GenyInstance');\n\nconst sampleRecipe = { uuid: 'sample-recipe-uuid' };\n\nconst sampleInstance = new GenyInstance({\n  uuid: 'sample-instance-uuid',\n  name: 'sample-instance-name',\n  state: 'CREATING',\n  recipe: sampleRecipe,\n});\n\ndescribe('GenyRegistry', () => {\n  let registry;\n\n  beforeEach(() => {\n    registry = new GenyRegistry();\n  });\n\n  it('should be empty when created', () => {\n    expect(registry.getInstances()).toEqual([]);\n  });\n\n  describe('when added an instance', () => {\n    beforeEach(() => registry.addInstance(sampleInstance, sampleRecipe));\n\n    it('should be able to return that instance among all instances', () => {\n      expect(registry.getInstances()).toEqual([sampleInstance]);\n    });\n\n    it('should mark it as new', () => {\n      expect(registry.pollNewInstance(sampleInstance.uuid)).toBe(true);\n\n      // The pollNewInstance() method should reset the new instance flag\n      expect(registry.pollNewInstance(sampleInstance.uuid)).toBe(false);\n    });\n\n    it('should automatically mark it as busy', () => {\n      expect(registry.findFreeInstance(sampleRecipe)).toBeUndefined();\n    });\n\n    describe.each([\n      ['busy state', true],\n      ['free state', false],\n    ])('when updated that instance in %s', (_label, isBusy) => {\n      let updatedInstance;\n\n      beforeEach(() => isBusy\n        ? registry.markAsBusy(sampleInstance.uuid)\n        : registry.markAsFree(sampleInstance.uuid));\n\n      beforeEach(() => {\n        updatedInstance = new GenyInstance(sampleInstance);\n        registry.updateInstance(updatedInstance);\n      });\n\n      it('should return the updated instance', () => {\n        const instances = registry.getInstances();\n        expect(instances).toHaveLength(1);\n        expect(instances[0]).toBe(updatedInstance);\n      });\n    });\n\n    describe('and removed that instance', () => {\n      beforeEach(() => registry.removeInstance(sampleInstance.uuid));\n\n      it('should be empty again', () => {\n        expect(registry.getInstances()).toEqual([]);\n      });\n\n      it('should fail to update that instance', () => {\n        expect(() => registry.updateInstance(sampleInstance)).toThrow(/unknown instance/);\n      });\n    });\n\n    describe('and marked it as free', () => {\n      beforeEach(() => registry.markAsFree(sampleInstance.uuid));\n\n      it('should return it as free', () => {\n        expect(registry.findFreeInstance(sampleRecipe)).toBe(sampleInstance);\n      });\n\n      it('should not confuse it with another recipe', () => {\n        expect(registry.findFreeInstance({ uuid: 'another-recipe-uuid' })).toBeUndefined();\n      });\n\n      it('should return that instance again and again when marking it as free', () => {\n        expect(registry.markAsFree(sampleInstance.uuid)).toBe(sampleInstance);\n      });\n\n      describe('and then marked it as busy', () => {\n        beforeEach(() => registry.markAsBusy(sampleInstance.uuid));\n\n        it('should return it as busy', () => {\n          expect(registry.findFreeInstance(sampleRecipe)).toBeUndefined();\n        });\n\n        it('should return that instance again and again when marking it as busy', () => {\n          expect(registry.markAsBusy(sampleInstance.uuid)).toBe(sampleInstance);\n        });\n      });\n    });\n  });\n\n  describe('when marking an unknown instance', () => {\n    it('should fail to mark it as free', () => {\n      expect(() => registry.markAsFree(sampleInstance.uuid)).toThrow(/unknown instance/);\n    });\n\n    it('should fail to mark it as busy', () => {\n      expect(() => registry.markAsBusy(sampleInstance.uuid)).toThrow(/unknown instance/);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/exec/GenyCloudExec.js",
    "content": "// @ts-nocheck\nconst exec = require('../../../../../../utils/childProcess').execWithRetriesAndLogs;\n\nclass GenyCloudExec {\n  constructor(binaryPath) {\n    this.binaryExec = binaryPath;\n    process.env.GMSAAS_USER_AGENT_EXTRA_DATA = process.env.GMSAAS_USER_AGENT_EXTRA_DATA || 'detox';\n  }\n\n  getVersion() {\n    return this._exec('--version');\n  }\n\n  doctor() {\n    return this._exec('doctor', { retries: 0 }, 'text');\n  }\n\n  getRecipe(name) {\n    return this._exec(`recipes list --name \"${name}\"`);\n  }\n\n  getInstance(instanceUUID) {\n    return this._exec(`instances get ${instanceUUID}`);\n  }\n\n  getInstances() {\n    return this._exec('instances list -q');\n  }\n\n  startInstance(recipeUUID, instanceName) {\n    return this._exec(`instances start --no-wait ${recipeUUID} \"${instanceName}\"`, { retries: 0 });\n  }\n\n  adbConnect(instanceUUID) {\n    return this._exec(`instances adbconnect ${instanceUUID}`, { retries: 0 });\n  }\n\n  stopInstance(instanceUUID) {\n    const options = {\n      retries: 3,\n    };\n    return this._exec(`instances stop ${instanceUUID}`, options);\n  }\n\n  async _exec(args, options, format = 'compactjson') {\n    try {\n      const rawResult = await this.__exec(args, options, format);\n      return (\n        format === 'compactjson' ? JSON.parse(rawResult) : rawResult\n      );\n    } catch (error) {\n      throw new Error(error.stderr);\n    }\n  }\n\n  async __exec(args, options, format) {\n    const _options = {\n      ...options,\n      statusLogs: {\n        retrying: true,\n      },\n    };\n    return (await exec(`\"${this.binaryExec}\" --format ${format} ${args}`, _options )).stdout;\n  }\n}\n\nmodule.exports = GenyCloudExec;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/exec/GenyCloudExec.test.js",
    "content": "\nconst aResponse = (exit_code = 0, exit_code_desc = 'NO_ERROR') => ({\n  exit_code,\n  exit_code_desc,\n});\nconst anErrorResponse = (exit_code, exit_code_desc, error_desc) => ({\n  ...aResponse(exit_code, exit_code_desc),\n  error: {\n    message: `API return unexpected code: ${exit_code}. Error: {\"code\":\"${error_desc}\",\"message\":\"Oh no, mocked error has occurred!\"}`,\n    details: '',\n  }\n});\n\ndescribe('Genymotion-cloud executable', () => {\n  const successResponse = aResponse();\n  const failResponse = anErrorResponse(4, 'API_ERROR', 'TOO_MANY_RUNNING_VDS');\n  const recipeName = 'mock-recipe-name';\n  const recipeUUID = 'mock-recipe-uuid';\n  const instanceUUID = 'mock-uuid';\n  const instanceName = 'detox-instance1';\n\n  const givenSuccessJSONResult = () => exec.mockResolvedValue({\n    stdout: JSON.stringify(successResponse),\n  });\n  const givenSuccessTextualResult = () => exec.mockResolvedValue({\n    stdout: successResponse,\n  });\n  const givenErrorJSONResult = () => exec.mockRejectedValue({\n    stderr: JSON.stringify(failResponse),\n  });\n  const givenErrorTextualResult = (errorMessage) => exec.mockRejectedValue({\n    stderr: errorMessage,\n  });\n\n  let exec;\n  let uut;\n  beforeEach(() => {\n    jest.mock('../../../../../../utils/childProcess');\n    exec = require('../../../../../../utils/childProcess').execWithRetriesAndLogs;\n\n    const GenyCloudExec = require('./GenyCloudExec');\n    uut = new GenyCloudExec('mock/path/to/gmsaas');\n  });\n\n  afterEach(() => {\n    delete process.env.GMSAAS_USER_AGENT_EXTRA_DATA;\n  });\n\n  describe('JSON command', () => {\n    describe.each([\n      ['version', () => uut.getVersion(), `\"mock/path/to/gmsaas\" --format compactjson --version`],\n      ['Get Recipe', () => uut.getRecipe(recipeName), `\"mock/path/to/gmsaas\" --format compactjson recipes list --name \"${recipeName}\"`],\n      ['Get Instance', () => uut.getInstance(instanceUUID), `\"mock/path/to/gmsaas\" --format compactjson instances get ${instanceUUID}`],\n      ['Get Instances', () => uut.getInstances(), `\"mock/path/to/gmsaas\" --format compactjson instances list -q`],\n      ['Start Instance', () => uut.startInstance(recipeUUID, instanceName), `\"mock/path/to/gmsaas\" --format compactjson instances start --no-wait ${recipeUUID} \"${instanceName}\"`, { retries: 0 }],\n      ['ADB Connect', () => uut.adbConnect(instanceUUID), `\"mock/path/to/gmsaas\" --format compactjson instances adbconnect ${instanceUUID}`, { retries: 0 }],\n      ['Stop Instance', () => uut.stopInstance(instanceUUID), `\"mock/path/to/gmsaas\" --format compactjson instances stop ${instanceUUID}`, { retries: 3 }],\n    ])(`%s`, (commandName, commandExecFn, expectedExec, expectedExecOptions) => {\n      it('should execute command by name', async () => {\n        givenSuccessJSONResult();\n\n        await commandExecFn();\n        expect(exec).toHaveBeenCalledWith(expectedExec, expect.objectContaining(expectedExecOptions || {}));\n      });\n\n      it('should return the result', async () => {\n        givenSuccessJSONResult();\n\n        const result = await commandExecFn();\n        expect(result).toEqual(successResponse);\n      });\n\n      it('should fail upon an error result', async () => {\n        givenErrorJSONResult();\n\n        await expect(commandExecFn()).rejects.toThrow(JSON.stringify(failResponse));\n      });\n    });\n  });\n\n  describe('Textual command', () => {\n    describe.each([\n      ['Doctor', () => uut.doctor(), `\"mock/path/to/gmsaas\" --format text doctor`, { retries: 0 }],\n    ])(`%s`, (commandName, commandExecFn, expectedExec, expectedExecOptions) => {\n      it('should execute command by name', async () => {\n        givenSuccessTextualResult();\n\n        await commandExecFn();\n        expect(exec).toHaveBeenCalledWith(expectedExec, expect.objectContaining(expectedExecOptions || {}));\n      });\n\n      it('should return the result', async () => {\n        givenSuccessTextualResult();\n\n        const result = await commandExecFn();\n        expect(result).toEqual(successResponse);\n      });\n\n      it('should fail upon an error result', async () => {\n        const errorMessage = 'Oh no, mocked error has occurred!';\n        givenErrorTextualResult(errorMessage);\n\n        await expect(commandExecFn()).rejects.toThrow(errorMessage);\n      });\n    });\n  });\n\n  describe('User-agent bundling into gmsaas requests', () => {\n    it('should set up \\'detox\\' as the default user-agent', () => {\n      delete process.env.GMSAAS_USER_AGENT_EXTRA_DATA;\n\n      const GenyCloudExec = require('./GenyCloudExec');\n      new GenyCloudExec('mock/path/to/gmsaas');\n\n      expect(process.env.GMSAAS_USER_AGENT_EXTRA_DATA).toEqual('detox');\n    });\n\n    it('should retain any value prespecified for user-agent', () => {\n      delete process.env.GMSAAS_USER_AGENT_EXTRA_DATA;\n      process.env.GMSAAS_USER_AGENT_EXTRA_DATA = 'mockUserAgent';\n\n      const GenyCloudExec = require('./GenyCloudExec');\n      new GenyCloudExec('mock/path/to/gmsaas');\n\n      expect(process.env.GMSAAS_USER_AGENT_EXTRA_DATA).toEqual('mockUserAgent');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/GenyInstanceLifecycleService.js",
    "content": "const log = require('../../../../../../utils/logger').child({ cat: 'device' });\nconst retry = require('../../../../../../utils/retry');\n\nconst Instance = require('./dto/GenyInstance');\n\nclass GenyInstanceLifecycleService {\n  /**\n   * @param { import('../exec/GenyCloudExec') } genyCloudExec\n   * @param { import('../../../../../common/drivers/android/exec/ADB') } adb\n   */\n  constructor(genyCloudExec, adb) {\n    this._genyCloudExec = genyCloudExec;\n    this._adb = adb;\n  }\n\n  async createInstance(recipeUUID, instanceName) {\n    const result = await this._genyCloudExec.startInstance(recipeUUID, instanceName);\n    return new Instance(result.instance);\n  }\n\n  async adbConnectInstance(instanceUUID){\n    const doAdbConnect = async () =>\n      this._genyCloudExec.adbConnect(instanceUUID);\n    const beforeEachRetry = async () => {\n      try {\n        const { stdout } = await this._adb.devices({ retries: 0, verbosity: 'low' });\n        log.warn('adb-connect command failed, current ADB devices list:\\n', stdout);\n      } catch (e) {\n        log.warn('adb-connect command failed; couldn\\'t get the list of current devices (see error)', e);\n      }\n      return true;\n    };\n    const options = {\n      conditionFn: beforeEachRetry,\n      retries: 2,\n    };\n\n    const result = await retry(options, doAdbConnect);\n    return new Instance(result.instance);\n  }\n\n  async deleteInstance(instanceUUID) {\n    const result = await this._genyCloudExec.stopInstance(instanceUUID);\n    return new Instance(result.instance);\n  }\n}\n\nmodule.exports = GenyInstanceLifecycleService;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/GenyInstanceLifecycleService.test.js",
    "content": "describe('Genymotion-Cloud instance-lifecycle service', () => {\n  const anInstance = () => ({\n    uuid: 'mock-instance-uuid',\n    name: 'mock-instance-name',\n    adb_serial: 'mock-serial:1111',\n    recipe: {\n      name: 'mock-recipe-name',\n    }\n  });\n\n  const adbDevicesOutput = [\n    'List of devices attached',\n    'localhost:12345\\tdevice',\n  ].join('\\n');\n\n  let log;\n  /** @type { jest.Mocked<*> } */\n  let retry;\n  let adb;\n  let exec;\n  let uut;\n\n  beforeEach(() => {\n    jest.mock('../../../../../../utils/logger');\n    log = require('../../../../../../utils/logger');\n\n    jest.mock('../../../../../../utils/retry'/*, () => (_options, func) => func()*/);\n    retry = require('../../../../../../utils/retry');\n    retry.mockImplementation((_options, func) => func());\n\n    const ADB = jest.createMockFromModule('../../../../../common/drivers/android/exec/ADB');\n    adb = new ADB();\n    adb.devices.mockResolvedValue({\n      stdout: adbDevicesOutput,\n    });\n\n    const GenyCloudExec = jest.createMockFromModule('../exec/GenyCloudExec');\n    exec = new GenyCloudExec();\n\n    const GenyInstanceLifecycleService = require('./GenyInstanceLifecycleService');\n    uut = new GenyInstanceLifecycleService(exec, adb);\n  });\n\n  describe('device instance creation', () => {\n    const givenResultedInstance = (instance) => exec.startInstance.mockResolvedValue({ instance });\n\n    it('should exec instance creation according to recipe', async () => {\n      const instance = anInstance();\n      givenResultedInstance(instance);\n\n      await uut.createInstance(instance.recipe.uuid, instance.name);\n      expect(exec.startInstance).toHaveBeenCalledWith(instance.recipe.uuid, instance.name);\n    });\n\n    it('should return the newly created instance', async () => {\n      const instance = anInstance();\n      givenResultedInstance(instance);\n\n      const result = await uut.createInstance(instance.recipe.name, instance.name);\n      expect(result).toBeDefined();\n      expect(result.uuid).toEqual(instance.uuid);\n      expect(result.name).toEqual(instance.name);\n      expect(result.recipeUUID).toEqual(instance.recipe.uuid);\n      expect(result.constructor.name).toContain('Instance');\n    });\n  });\n\n  describe('device adb-connect setup', () => {\n    const givenAdbConnectResult = (instance) => exec.adbConnect.mockResolvedValue({ instance });\n\n    it('should exec adb-connect', async () => {\n      const instance = anInstance();\n      givenAdbConnectResult(instance);\n\n      await uut.adbConnectInstance(instance.uuid);\n      expect(exec.adbConnect).toHaveBeenCalledWith(instance.uuid);\n    });\n\n    it('should return the updated instance', async () => {\n      const instance = anInstance();\n      givenAdbConnectResult(instance);\n\n      const result = await uut.adbConnectInstance(instance.uuid);\n      expect(result.uuid).toEqual(instance.uuid);\n      expect(result.constructor.name).toContain('Instance');\n    });\n\n    it('should wrap the command with a retry', async () => {\n      const instance = anInstance();\n      givenAdbConnectResult(instance);\n      givenRetryOnce();\n\n      await uut.adbConnectInstance(instance.uuid);\n      expect(retry).toHaveBeenCalledWith(expect.objectContaining({ retries: 2 }), expect.any(Function));\n      expect(exec.adbConnect).toHaveBeenCalledTimes(2);\n      expect(exec.adbConnect).toHaveBeenLastCalledWith(instance.uuid);\n    });\n\n    it('should log an adb-devices dump on retry', async () => {\n      const instance = anInstance();\n      givenAdbConnectResult(instance);\n      givenRetryOnce();\n\n      await uut.adbConnectInstance(instance.uuid);\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('adb-connect command failed'), adbDevicesOutput);\n    });\n\n    it('should overcome failing adb-devices dumping attempts', async () => {\n      const adbError = new Error('Yet another unexpected ADB adbError');\n      const instance = anInstance();\n      givenAdbConnectResult(instance);\n      givenRetryOnce();\n      adb.devices.mockRejectedValue(adbError);\n\n      await uut.adbConnectInstance(instance.uuid);\n      expect(log.warn).toHaveBeenCalledWith(expect.stringContaining('adb-connect command failed'), adbError);\n    });\n  });\n\n  describe('device instance deletion', () => {\n    const givenResult = (instance) => exec.stopInstance.mockResolvedValue({ instance });\n\n    it('should exec instance deletion', async () => {\n      const instance = anInstance();\n      givenResult(instance);\n\n      await uut.deleteInstance(instance.uuid);\n\n      expect(exec.stopInstance).toHaveBeenCalledWith(instance.uuid);\n    });\n\n    it('should return result', async () => {\n      const instance = anInstance();\n      givenResult(instance);\n\n      const result = await uut.deleteInstance(instance.uuid);\n      expect(result.uuid).toEqual(instance.uuid);\n      expect(result.constructor.name).toContain('Instance');\n    });\n  });\n\n  function givenRetryOnce() {\n    retry.mockImplementationOnce(async ({ conditionFn }, func) => {\n      await func();\n      await conditionFn();\n      return await func();\n    });\n  }\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/GenyRecipesService.js",
    "content": "const { DetoxRuntimeError } = require('../../../../../../errors');\n\nconst Recipe = require('./dto/GenyRecipe');\n\nclass GenyRecipesService {\n  constructor(genyCloudExec) {\n    this.genyCloudExec = genyCloudExec;\n  }\n\n  async getRecipeByName(recipeName) {\n    const { recipes } = await this.genyCloudExec.getRecipe(recipeName);\n    if (!recipes.length) {\n      throw new DetoxRuntimeError({\n        message: `No Genymotion-Cloud recipe found for recipe name \"${recipeName}\"`,\n        hint: `Please check your recipe name or use recipe UUID instead.`,\n      });\n    }\n\n    if (recipes.length > 1) {\n      const recipesInfoList = recipes.map((recipe) => `  ${recipe.name} (${recipe.uuid})`).join('\\n');\n      throw new DetoxRuntimeError({\n        message: `More than one Genymotion-Cloud recipe found for recipe name ${recipeName}:\\n${recipesInfoList}`,\n        hint: `Please specify a unique recipe name or use recipe UUID instead.`,\n      });\n    }\n    return new Recipe(recipes[0]);\n  }\n\n  async getRecipeByUUID(uuid) {\n    return new Recipe({ uuid });\n  }\n}\n\nmodule.exports = GenyRecipesService;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/GenyRecipesService.test.js",
    "content": "describe('Genymotion-Cloud recipes service', () => {\n  const givenNoRecipes = () => {\n    exec.getRecipe.mockResolvedValue({\n      recipes: [],\n    });\n  };\n\n  const givenRecipes = (...recipes) => {\n    exec.getRecipe.mockResolvedValue({\n      recipes: [...recipes],\n    });\n  };\n\n  const aRecipe = () => ({\n    uuid: 'mock-recipe-uuid',\n    name: 'mock-recipe-name',\n  });\n\n  const anotherRecipe = () => ({\n    uuid: 'another-mock-recipe-uuid',\n    name: 'another-mock-recipe-name',\n  });\n\n  let exec;\n  let uut;\n  beforeEach(() => {\n    const GenyCloudExec = jest.createMockFromModule('../exec/GenyCloudExec');\n    exec = new GenyCloudExec();\n\n    const GenyRecipesService = require('./GenyRecipesService');\n    uut = new GenyRecipesService(exec);\n  });\n\n  describe('getting a recipe by name', () => {\n    it('should throw an error if no recipes found', async () => {\n      givenNoRecipes();\n      await expect(uut.getRecipeByName('mock-name')).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should return the recipe if exactly one match is found', async () => {\n      const recipe = aRecipe();\n      givenRecipes(recipe);\n\n      const result = await uut.getRecipeByName(recipe.name);\n\n      expect(result.uuid).toEqual(recipe.uuid);\n    });\n\n    it('should return a recipe DTO', async () => {\n      const recipe = aRecipe();\n      givenRecipes(recipe);\n\n      const result = await uut.getRecipeByName(recipe.name);\n      expect(result.constructor.name).toContain('Recipe');\n    });\n\n    it('should throw an error if there are multiple matches', async () => {\n      const recipe = aRecipe();\n      const recipe2 = anotherRecipe();\n      givenRecipes(recipe, recipe2);\n\n      await expect(uut.getRecipeByName(recipe.name)).rejects.toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('Getting a recipe by UUID', () => {\n    it('should immediately return a recipe', async () => {\n      const recipe = aRecipe();\n\n      const result = await uut.getRecipeByUUID(recipe.uuid);\n\n      expect(result.uuid).toEqual(recipe.uuid);\n      expect(result.constructor.name).toContain('Recipe');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/__snapshots__/GenyRecipesService.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Genymotion-Cloud recipes service getting a recipe by name should throw an error if no recipes found 1`] = `\n\"No Genymotion-Cloud recipe found for recipe name \"mock-name\"\n\nHINT: Please check your recipe name or use recipe UUID instead.\"\n`;\n\nexports[`Genymotion-Cloud recipes service getting a recipe by name should throw an error if there are multiple matches 1`] = `\n\"More than one Genymotion-Cloud recipe found for recipe name mock-recipe-name:\n  mock-recipe-name (mock-recipe-uuid)\n  another-mock-recipe-name (another-mock-recipe-uuid)\n\nHINT: Please specify a unique recipe name or use recipe UUID instead.\"\n`;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/dto/GenyInstance.js",
    "content": "const Recipe = require('./GenyRecipe');\n\nconst STATE_ONLINE = 'ONLINE';\nconst STATE_CREATING = 'CREATING';\nconst STATE_BOOTING = 'BOOTING';\nconst STATE_STARTING = 'STARTING';\nconst initStates = new Set([\n  STATE_CREATING,\n  STATE_BOOTING,\n  STATE_STARTING,\n]);\n\nconst data = Symbol('data');\nconst recipe = Symbol('recipe');\n\nclass GenyInstance {\n  constructor(rawInstance) {\n    this[data] = rawInstance;\n    this[recipe] = new Recipe(rawInstance.recipe);\n  }\n\n  get uuid() {\n    return this[data].uuid;\n  }\n\n  get name() {\n    return this[data].name;\n  }\n\n  /**\n   * According to Genymotion's API docs, state is an enum with these possible values (description is not official):\n   * - \"CREATING\": Handling instance creation request\n   * - \"STARTING\": Instance created but not yet available for usage\n   * - \"BOOTING\": Instance created & started; Android OS is not booting\n   * - \"ONLINE\": Instance is ready for action\n   * - \"RECYCLED\": Instance has been automatically shut down due an idle timeout\n   * - \"STOPPING\": Instance is being shut-down\n   *\n   * Additional states: \"OFFLINE\", \"SAVING\", \"SAVED\", \"DELETING\", \"ERROR\", \"REVOKED\", \"EXPIRED\".\n   */\n  get state() {\n    return this[data].state;\n  }\n\n  get adbName() {\n    return this[data].adb_serial;\n  }\n\n  get recipeName() {\n    return this[recipe].name;\n  }\n\n  get recipeUUID() {\n    return this[recipe].uuid;\n  }\n\n  isAdbConnected() {\n    return this.adbName !== '0.0.0.0';\n  }\n\n  isOnline() {\n    return this.state === STATE_ONLINE;\n  }\n\n  isInitializing() {\n    return initStates.has(this.state);\n  }\n\n  toString() {\n    const description = [\n      this.uuid,\n      this.adbName\n    ].filter(Boolean).join('/');\n\n    return `${this.name} (${description})`;\n  }\n\n  toJSON() {\n    return this[data];\n  }\n}\n\nmodule.exports = GenyInstance;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/dto/GenyInstance.test.js",
    "content": "describe('Genymotion-Cloud Instance DTO', () => {\n  const rawInstance = {\n    uuid: 'mock-uuid',\n    name: 'mock-name',\n    state: undefined,\n    recipe: {\n      uuid: 'mock-recipe-uuid',\n      name: 'mock-recipe-name',\n    },\n  };\n\n  const disconnectedRawInstance = {\n    ...rawInstance,\n    state: 'ONLINE',\n    adb_serial: '0.0.0.0',\n    adb_serial_port: 0,\n  };\n\n  const connectedRawInstance = {\n    ...rawInstance,\n    state: 'ONLINE',\n    adb_serial: 'localhost:7777',\n    adb_serial_port: 7777,\n  };\n\n  const bootingInstance = {\n    ...disconnectedRawInstance,\n    state: 'BOOTING',\n  };\n  const startingInstance = {\n    ...disconnectedRawInstance,\n    state: 'STARTING',\n  };\n  const creatingInstance = {\n    ...disconnectedRawInstance,\n    state: 'CREATING',\n  };\n  const onlineInstance = disconnectedRawInstance;\n\n  let Instance;\n  beforeEach(() => {\n    Instance = require('./GenyInstance');\n  });\n\n  it('should have proper fields', () => {\n    const rawInstance = connectedRawInstance;\n\n    const instance = new Instance(rawInstance);\n\n    expect(instance.uuid).toEqual('mock-uuid');\n    expect(instance.name).toEqual('mock-name');\n    expect(instance.adbName).toEqual(rawInstance.adb_serial);\n    expect(instance.recipeName).toEqual('mock-recipe-name');\n    expect(instance.recipeUUID).toEqual('mock-recipe-uuid');\n    expect(instance.state).toEqual('ONLINE');\n  });\n\n  it('should indicate an ADB-connection', () => {\n    const instance = new Instance(connectedRawInstance);\n    expect(instance.isAdbConnected()).toEqual(true);\n  });\n\n  it('should indicate an ADB-disconnection', () => {\n    const instance = new Instance(disconnectedRawInstance);\n    expect(instance.isAdbConnected()).toEqual(false);\n  });\n\n  it('should indicate instance is online', () => {\n    const instance = new Instance(onlineInstance);\n    expect(instance.isOnline()).toEqual(true);\n  });\n\n  it('should indicate instance in not online-state', () => {\n    const instance = new Instance(bootingInstance);\n    expect(instance.isOnline()).toEqual(false);\n  });\n\n  it('should indicate an instance that is under creation is initializing', () => {\n    const instance = new Instance(creatingInstance);\n    expect(instance.isInitializing()).toEqual(true);\n  });\n\n  it('should indicate an online instance is not initializing', () => {\n    const instance = new Instance(onlineInstance);\n    expect(instance.isInitializing()).toEqual(false);\n  });\n\n  it('should indicate a booting instance is initializing', () => {\n    const instance = new Instance(bootingInstance);\n    expect(instance.isInitializing()).toEqual(true);\n  });\n\n  it('should indicate a starting-up instance is initializing', () => {\n    const instance = new Instance(startingInstance);\n    expect(instance.isInitializing()).toEqual(true);\n  });\n\n  it('should override toString()', () => {\n    const instance = new Instance(connectedRawInstance);\n    expect(`${instance}`).toEqual(`${instance.name} (${instance.uuid}/${instance.adbName})`);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/dto/GenyRecipe.js",
    "content": "const data = Symbol('data');\n\nclass GenyRecipe {\n  constructor(rawRecipe) {\n    this[data] = rawRecipe;\n  }\n\n  get uuid() {\n    return this[data].uuid;\n  }\n\n  get name() {\n    return this[data].name || 'Anonymous GMSaaS Recipe';\n  }\n\n  toString() {\n    return this[data].name ? `${this.name} (${this.uuid})` : `Recipe of ${this.uuid}`;\n  }\n\n  toJSON() {\n    return this[data];\n  }\n}\n\nmodule.exports = GenyRecipe;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/genycloud/services/dto/GenyRecipe.test.js",
    "content": "describe('Genymotion-Cloud Recipe DTO', () => {\n  const rawRecipe = {\n    uuid: 'mock-uuid',\n    name: 'mock-name',\n  };\n\n  let Recipe;\n  beforeEach(() => {\n    Recipe = require('./GenyRecipe');\n  });\n\n  it('should have a uuid', () => {\n    const recipe = new Recipe(rawRecipe);\n\n    expect(recipe.uuid).toEqual('mock-uuid');\n    expect(recipe.name).toEqual('mock-name');\n  });\n\n  it('should allow for anonymous (name-less) recipes', () => {\n    const recipe = new Recipe({\n      uuid: rawRecipe.uuid,\n    });\n    expect(recipe.name).toEqual('Anonymous GMSaaS Recipe');\n  });\n\n  it('should override toString()', () => {\n    const recipe = new Recipe(rawRecipe);\n    expect(recipe.toString()).toEqual('mock-name (mock-uuid)');\n  });\n\n  it('should implement toString() for anonymous recipes', () => {\n    const recipe = new Recipe({\n      uuid: rawRecipe.uuid,\n    });\n    expect(recipe.toString()).toEqual('Recipe of mock-uuid');\n  });\n\n  it('should implement toJSON()', () => {\n    const recipe = new Recipe(rawRecipe);\n    expect(recipe.toJSON()).toBe(rawRecipe);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/utils/DeviceInitCache.js",
    "content": "class DeviceInitCache {\n  constructor() {\n    this._cache = new Map();\n  }\n\n  /**\n   * @param {string} adbName\n   * @returns {boolean}\n   */\n  hasInitialized(adbName) {\n    return this._cache.get(adbName) === true;\n  }\n\n  /** @param {string} adbName */\n  setInitialized(adbName) {\n    this._cache.set(adbName, true);\n  }\n}\n\nmodule.exports = DeviceInitCache;\n\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/utils/SystemUICfgHelper.js",
    "content": "/**\n * @typedef {import('../../../../common/drivers/DeviceCookie').DeviceCookie} DeviceCookie\n */\n\nconst _ = require('lodash');\n\nconst { DetoxConfigError } = require('../../../../../errors');\nconst sleep = require('../../../../../utils/sleep');\n\nconst presets = require('./systemUICfgPresets');\n\nconst batteryPrecents = {\n  full: 100,\n  half: 50,\n  low: 20,\n};\n\nconst navigationModes = {\n//  For clarity: 2-button mode is not supported in recent Android versions; Detox ignores it to avoid confusion\n//  '2-button': 'com.android.internal.systemui.navbar.twobutton',\n  '3-button': 'com.android.internal.systemui.navbar.threebutton',\n  'gesture': 'com.android.internal.systemui.navbar.gestural',\n};\n\n/**\n * Maps a nullish value (null or undefined) to undefined, otherwise applies the function.\n *\n * @param {any | undefined | null} value\n * @param {(value: any) => any | undefined} fn\n * @returns {any | undefined}\n */\nconst nullishOrMap = (value, fn) => (value === undefined || value === null) ? undefined : fn(value);\n\n/**\n * Helper class for initializing Android System UI demo mode.\n */\nclass SystemUICfgHelper {\n  /**\n   * @param {object} options\n   * @param {object} options.adb An ADB shell wrapper with a shell method\n   * @param {string} options.adbName The ADB device name\n   */\n  constructor({ adb, adbName }) {\n    this._adb = {\n      shell: async (cmd) => {\n        await adb.shell(adbName, cmd);\n        await sleep(200);\n      },\n    };\n  }\n\n  /**\n   * Resolves the system UI configuration, handling presets and extends.\n   *\n   * @param {Detox.DetoxSystemUI} systemUICfg\n   * @returns {Detox.DetoxSystemUIConfig}\n   */\n  resolveConfig(systemUICfg) {\n    const preset = _.isString(systemUICfg) && this._resolvePreset(systemUICfg);\n    if (preset) {\n      return preset;\n    }\n\n    /** @type {Detox.DetoxSystemUIConfig} */\n    // @ts-ignore\n    const _systemUICfg = systemUICfg;\n\n    if (_systemUICfg.extends) {\n      const preset = this._resolvePreset(_systemUICfg.extends);\n      return _.chain({})\n        .merge(preset)\n        .merge(_systemUICfg)\n        .omit('extends')\n        .value();\n    }\n    return _systemUICfg;\n  }\n\n  /**\n   * @param {Detox.DetoxSystemUIConfig} systemUIConfig\n   */\n  async setupKeyboardBehavior(systemUIConfig) {\n    const showKbd = nullishOrMap(systemUIConfig.keyboard, (keyboard) => Number(keyboard === 'show'));\n\n    if (showKbd !== undefined) {\n      await this._adb.shell(`settings put Secure show_ime_with_hard_keyboard ${showKbd}`);\n    }\n  }\n\n  /**\n   * @param {Detox.DetoxSystemUIConfig} systemUIConfig\n   */\n  async setupPointerIndicators(systemUIConfig) {\n    const showTouches = nullishOrMap(systemUIConfig.touches, (touches) => Number(touches === 'show'));\n    if (showTouches !== undefined) {\n      await this._adb.shell(`settings put system show_touches ${showTouches}`);\n    }\n\n    const showPointerLocationBar = nullishOrMap(systemUIConfig.pointerLocationBar, (pointerLocationBar) => Number(pointerLocationBar === 'show'));\n    if (showPointerLocationBar !== undefined) {\n      await this._adb.shell(`settings put system pointer_location ${showPointerLocationBar}`);\n    }\n  }\n\n  /**\n   * @param {Detox.DetoxSystemUIConfig} systemUIConfig\n   */\n  async setupNavigationMode(systemUIConfig) {\n    const navigationMode = nullishOrMap(systemUIConfig.navigationMode, (navigationMode) => navigationModes[navigationMode]);\n    if (navigationMode !== undefined) {\n      await this._adb.shell(`cmd overlay enable ${navigationMode}`);\n    }\n  }\n\n  /**\n   * Ref: https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md\n   *\n   * @param {Detox.DetoxSystemUIConfig} systemUIConfig\n   */\n  async setupStatusBar(systemUIConfig) {\n    const { statusBar: statusBarConfig } = systemUIConfig;\n    if (_.isUndefined(statusBarConfig)) {\n      return;\n    }\n\n    // Enable, then get out (= reset status-bar) and back into demo mode\n    await this._adb.shell('settings put global sysui_demo_allowed 1');\n    await this._adb.shell('am broadcast -a com.android.systemui.demo -e command exit');\n    await this._adb.shell('am broadcast -a com.android.systemui.demo -e command enter');\n\n    // Force status bar content\n    const notificationsVisible = nullishOrMap(statusBarConfig.notifications, (notifications) => (notifications === 'show'));\n    if (notificationsVisible !== undefined) {\n      await this._adb.shell(`am broadcast -a com.android.systemui.demo -e command notifications -e visible ${notificationsVisible}`);\n    }\n\n    const wifiSignal = nullishOrMap(statusBarConfig.wifiSignal, (wifiSignal) => wifiSignal);\n    if (wifiSignal !== undefined) {\n      await this._adb.shell('am broadcast -a com.android.systemui.demo -e command network -e wifi hide');\n      if (wifiSignal !== 'none') {\n        const wifiLevel = wifiSignal === 'strong' ? 4 : 2;\n        await this._adb.shell(`am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level ${wifiLevel} -e fully true`);\n      }\n    }\n\n    const cellSignal = nullishOrMap(statusBarConfig.cellSignal, (cellSignal) => cellSignal);\n    if (cellSignal !== undefined) {\n      await this._adb.shell('am broadcast -a com.android.systemui.demo -e command network -e mobile hide -e satellite hide');\n      if (cellSignal !== 'none') {\n        const cellLevel = cellSignal === 'strong' ? 4 : 2;\n        await this._adb.shell(`am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level ${cellLevel} -e fully true -e datatype none`);\n      }\n    }\n\n    const clock = nullishOrMap(statusBarConfig.clock, (clock) => clock);\n    if (clock !== undefined) {\n      await this._adb.shell(`am broadcast -a com.android.systemui.demo -e command clock -e hhmm ${clock}`);\n    }\n\n    // Best to keep this last due to a \"charging\" indicator animation which can\n    // break UI changes made by consequent commands\n    const batteryLevel = nullishOrMap(statusBarConfig.batteryLevel, (level) => batteryPrecents[level]);\n    const charging = nullishOrMap(statusBarConfig.charging, (isCharging) => String(isCharging));\n    if (batteryLevel !== undefined || charging !== undefined) {\n      const command = 'am broadcast -a com.android.systemui.demo -e command battery' +\n        (batteryLevel !== undefined ? ` -e level ${batteryLevel}` : '') +\n        (charging !== undefined ? ` -e plugged ${charging}` : '');\n      await this._adb.shell(command);\n      await sleep(1500); // Wait for the charging animation to finish\n    }\n  }\n\n  /**\n   * @param {Detox.DetoxSystemUI} presetName\n   * @returns {Detox.DetoxSystemUIConfig | null}\n   * @private\n   */\n  _resolvePreset(presetName) {\n    const preset = presets[presetName];\n    if (!preset) {\n      throw new DetoxConfigError(`Invalid system UI preset name '${presetName}'`);\n    }\n    return preset;\n  }\n}\n\nmodule.exports = SystemUICfgHelper;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/utils/SystemUICfgHelper.test.js",
    "content": "describe('Android system UI configuration helper', () => {\n  const minimalPreset = {\n    keyboard: 'hide',\n    touches: 'show',\n    navigationMode: '3-button',\n    statusBar: {\n      notifications: 'hide',\n      wifiSignal: 'strong',\n      cellSignal: 'none',\n      batteryLevel: 'full',\n      charging: false,\n      clock: '1337',\n    },\n  };\n\n  const genymotionPreset = {\n    keyboard: 'hide',\n    statusBar: {\n      notifications: 'hide',\n      wifiSignal: 'strong',\n      cellSignal: 'none',\n      batteryLevel: 'full',\n      charging: true,\n    },\n  };\n\n  const adbName = 'test-device';\n\n  let mockAdb;\n  let mockSleep;\n  let uut;\n\n  beforeEach(() => {\n    mockAdb = {\n      shell: jest.fn().mockResolvedValue(undefined),\n    };\n\n    jest.mock('../../../../../utils/sleep', () => jest.fn().mockResolvedValue(undefined));\n    mockSleep = require('../../../../../utils/sleep');\n\n    const SystemUICfgHelper = require('./SystemUICfgHelper');\n    uut = new SystemUICfgHelper({ adb: mockAdb, adbName });\n  });\n\n  describe('resolveConfig', () => {\n    it('should return object as-is by default', () => {\n      const systemUI = {\n        keyboard: 'show',\n        touches: 'hide',\n        statusBar: {\n          notifications: 'show',\n        },\n      };\n\n      const result = uut.resolveConfig(systemUI);\n\n      expect(result).toBe(systemUI);\n      expect(result).toStrictEqual(systemUI);\n    });\n\n    it('should use minimal preset', () => {\n      const result = uut.resolveConfig('minimal');\n      expect(result).toEqual(minimalPreset);\n    });\n\n    it('should use genymotion preset', () => {\n      const result = uut.resolveConfig('genymotion');\n      expect(result).toEqual(genymotionPreset);\n    });\n\n    it('should throw when invalid preset name is provided', () => {\n      expect(() => uut.resolveConfig('non-existing-preset'))\n        .toThrow(\"Invalid system UI preset name 'non-existing-preset'\");\n    });\n\n    it('should (deep!) merge extended preset when extends is specified', () => {\n      const expectedOverrides = {\n        keyboard: 'show',\n        statusBar: {\n          notifications: 'show',\n        },\n      };\n      const systemUI = {\n        extends: 'minimal',\n        ...expectedOverrides,\n      };\n\n      const result = uut.resolveConfig(systemUI);\n      expect(result).toMatchSnapshot();\n    });\n  });\n\n  describe('setupKeyboardBehavior', () => {\n    const keyboardCmd = (show) => `settings put Secure show_ime_with_hard_keyboard ${show ? 1 : 0}`;\n\n    it('should set keyboard to show when keyboard is \"show\"', async () => {\n      await uut.setupKeyboardBehavior({ keyboard: 'show' });\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, keyboardCmd(true));\n    });\n\n    it('should set keyboard to hide when keyboard is \"hide\"', async () => {\n      await uut.setupKeyboardBehavior({ keyboard: 'hide' });\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, keyboardCmd(false));\n    });\n\n    it('should not call adb.shell when keyboard is undefined', async () => {\n      await uut.setupKeyboardBehavior({});\n      expect(mockAdb.shell).not.toHaveBeenCalled();\n    });\n\n    it('should not call adb.shell when keyboard is null', async () => {\n      await uut.setupKeyboardBehavior({ keyboard: null });\n      expect(mockAdb.shell).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('setupPointerIndicators', () => {\n    const touchesCmd = (show) => `settings put system show_touches ${show ? 1 : 0}`;\n    const pointerLocationCmd = (show) => `settings put system pointer_location ${show ? 1 : 0}`;\n\n    describe('touches', () => {\n      it('should set show_touches to 1 when touches is \"show\"', async () => {\n        await uut.setupPointerIndicators({ touches: 'show' });\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, touchesCmd(true));\n      });\n\n      it('should set show_touches to 0 when touches is \"hide\"', async () => {\n        await uut.setupPointerIndicators({ touches: 'hide' });\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, touchesCmd(false));\n      });\n\n      it('should not call adb.shell for show_touches when touches is undefined', async () => {\n        await uut.setupPointerIndicators({});\n        expect(mockAdb.shell).not.toHaveBeenCalled();\n      });\n\n      it('should not call adb.shell for show_touches when touches is null', async () => {\n        await uut.setupPointerIndicators({ touches: null });\n        expect(mockAdb.shell).not.toHaveBeenCalled();\n      });\n    });\n\n    describe('pointerLocationBar', () => {\n      it('should set pointer_location to 1 when pointerLocationBar is \"show\"', async () => {\n        await uut.setupPointerIndicators({ pointerLocationBar: 'show' });\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, pointerLocationCmd(true));\n      });\n\n      it('should set pointer_location when pointerLocationBar is \"hide\"', async () => {\n        await uut.setupPointerIndicators({ pointerLocationBar: 'hide' });\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, pointerLocationCmd(false));\n      });\n\n      it('should not call adb.shell for pointer_location when pointerLocationBar is undefined', async () => {\n        await uut.setupPointerIndicators({});\n        expect(mockAdb.shell).not.toHaveBeenCalled();\n      });\n\n      it('should not call adb.shell for pointer_location when pointerLocationBar is null', async () => {\n        await uut.setupPointerIndicators({ pointerLocationBar: null });\n        expect(mockAdb.shell).not.toHaveBeenCalled();\n      });\n    });\n\n    it('should handle both touches and pointerLocationBar together', async () => {\n      await uut.setupPointerIndicators({\n        touches: 'show',\n        pointerLocationBar: 'show',\n      });\n\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, touchesCmd(true));\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, pointerLocationCmd(true));\n      expect(mockAdb.shell).toHaveBeenCalledTimes(2);\n    });\n  });\n\n  describe('setupNavigationMode', () => {\n    const navThreeButtonCmd = () => 'cmd overlay enable com.android.internal.systemui.navbar.threebutton';\n    const navGestureCmd = () => 'cmd overlay enable com.android.internal.systemui.navbar.gestural';\n\n    it('should enable 3-button navigation when navigationMode is \"3-button\"', async () => {\n      await uut.setupNavigationMode({ navigationMode: '3-button' });\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, navThreeButtonCmd());\n    });\n\n    it('should enable gesture navigation when navigationMode is \"gesture\"', async () => {\n      await uut.setupNavigationMode({ navigationMode: 'gesture' });\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, navGestureCmd());\n    });\n\n    it('should not call adb.shell when navigationMode is undefined', async () => {\n      await uut.setupNavigationMode({ navigationMode: undefined });\n      expect(mockAdb.shell).not.toHaveBeenCalled();\n    });\n\n    it('should not call adb.shell when navigationMode is null', async () => {\n      await uut.setupNavigationMode({ navigationMode: null });\n      expect(mockAdb.shell).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('setupStatusBar', () => {\n    const demoModeAllowedCmd = () => 'settings put global sysui_demo_allowed 1';\n    const demoExitCmd = () => 'am broadcast -a com.android.systemui.demo -e command exit';\n    const demoEnterCmd = () => 'am broadcast -a com.android.systemui.demo -e command enter';\n    const notificationsCmd = (show) => `am broadcast -a com.android.systemui.demo -e command notifications -e visible ${show}`;\n    const wifiHideCmd = () => 'am broadcast -a com.android.systemui.demo -e command network -e wifi hide';\n    const wifiShowCmd = (level) => `am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level ${level} -e fully true`;\n    const mobileHideCmd = () => 'am broadcast -a com.android.systemui.demo -e command network -e mobile hide -e satellite hide';\n    const mobileShowCmd = (level) => `am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level ${level} -e fully true -e datatype none`;\n    const clockCmd = (time = '1234') => `am broadcast -a com.android.systemui.demo -e command clock -e hhmm ${time}`;\n    /**\n     * @param {{ batteryLevel?: number, charging?: boolean }} opts\n     * @returns {string}\n     */\n    const batteryCmd = ({ batteryLevel, charging }) =>\n      `am broadcast -a com.android.systemui.demo -e command battery` +\n        (batteryLevel !== undefined ? ` -e level ${batteryLevel}` : '') +\n        (charging !== undefined ? ` -e plugged ${charging}` : '');\n\n    it('should not call adb.shell when statusBar is undefined', async () => {\n      await uut.setupStatusBar({});\n\n      expect(mockAdb.shell).not.toHaveBeenCalled();\n    });\n\n    it('should initialize demo mode and enter it', async () => {\n      await uut.setupStatusBar({ statusBar: {} });\n\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, demoModeAllowedCmd());\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, demoExitCmd());\n      expect(mockAdb.shell).toHaveBeenCalledWith(adbName, demoEnterCmd());\n    });\n\n    describe('notifications', () => {\n      it('should set notifications to visible when notifications is \"show\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { notifications: 'show' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, notificationsCmd(true));\n      });\n\n      it('should set notifications to hidden when notifications is \"hide\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { notifications: 'hide' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, notificationsCmd(false));\n      });\n\n      it('should not set notifications when notifications is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const notificationsCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('notifications')\n        );\n        expect(notificationsCalls).toHaveLength(0);\n      });\n\n      it('should not set notifications when notifications is null', async () => {\n        await uut.setupStatusBar({ statusBar: { notifications: null } });\n\n        const notificationsCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('notifications')\n        );\n        expect(notificationsCalls).toHaveLength(0);\n      });\n    });\n\n    describe('wifiSignal', () => {\n      it('should hide wifi when wifiSignal is \"none\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { wifiSignal: 'none' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, wifiHideCmd());\n        expect(mockAdb.shell).not.toHaveBeenCalledWith(\n          expect.stringContaining('network -e wifi show')\n        );\n      });\n\n      it('should show wifi with strong signal when wifiSignal is \"strong\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { wifiSignal: 'strong' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, wifiHideCmd());\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, wifiShowCmd(4));\n      });\n\n      it('should show wifi with weak signal when wifiSignal is \"weak\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { wifiSignal: 'weak' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, wifiHideCmd());\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, wifiShowCmd(2));\n      });\n\n      it('should not set wifi when wifiSignal is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const wifiCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('network -e wifi')\n        );\n        expect(wifiCalls).toHaveLength(0);\n      });\n\n      it('should not set wifi when wifiSignal is null', async () => {\n        await uut.setupStatusBar({ statusBar: { wifiSignal: null } });\n\n        const wifiCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('network -e wifi')\n        );\n        expect(wifiCalls).toHaveLength(0);\n      });\n    });\n\n    describe('cellSignal', () => {\n      it('should hide mobile when cellSignal is \"none\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { cellSignal: 'none' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, mobileHideCmd());\n        expect(mockAdb.shell).not.toHaveBeenCalledWith(\n          expect.stringContaining('network -e mobile show')\n        );\n      });\n\n      it('should show mobile with strong signal when cellSignal is \"strong\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { cellSignal: 'strong' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, mobileHideCmd());\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, mobileShowCmd(4));\n      });\n\n      it('should show mobile with weak signal when cellSignal is \"weak\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { cellSignal: 'weak' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, mobileHideCmd());\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, mobileShowCmd(2));\n      });\n\n      it('should not set mobile when cellSignal is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const mobileCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('network -e mobile')\n        );\n        expect(mobileCalls).toHaveLength(0);\n      });\n\n      it('should not set mobile when cellSignal is null', async () => {\n        await uut.setupStatusBar({ statusBar: { cellSignal: null } });\n\n        const mobileCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('network -e mobile')\n        );\n        expect(mobileCalls).toHaveLength(0);\n      });\n    });\n\n    describe('clock', () => {\n      it('should set clock when clock is provided', async () => {\n        await uut.setupStatusBar({\n          statusBar: { clock: '1234' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, clockCmd());\n      });\n\n      it('should not set clock when clock is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const clockCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('clock')\n        );\n        expect(clockCalls).toHaveLength(0);\n      });\n\n      it('should not set clock when clock is null', async () => {\n        await uut.setupStatusBar({ statusBar: { clock: null } });\n\n        const clockCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('clock')\n        );\n        expect(clockCalls).toHaveLength(0);\n      });\n    });\n\n    describe('batteryLevel', () => {\n      it('should set battery level to 100 when batteryLevel is \"full\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { batteryLevel: 'full' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ batteryLevel: 100 }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should set battery level to 50 when batteryLevel is \"half\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { batteryLevel: 'half' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ batteryLevel: 50 }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should set battery level to 20 when batteryLevel is \"low\"', async () => {\n        await uut.setupStatusBar({\n          statusBar: { batteryLevel: 'low' },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ batteryLevel: 20 }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should not set battery level when batteryLevel is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const batteryCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('battery')\n        );\n        expect(batteryCalls).toHaveLength(0);\n      });\n\n      it('should not set battery level when batteryLevel is null', async () => {\n        await uut.setupStatusBar({ statusBar: { batteryLevel: null } });\n\n        const batteryCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('battery')\n        );\n        expect(batteryCalls).toHaveLength(0);\n      });\n    });\n\n    describe('charging', () => {\n      it('should set charging to true when charging is true', async () => {\n        await uut.setupStatusBar({\n          statusBar: { charging: true },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ charging: true }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should set charging to false when charging is false', async () => {\n        await uut.setupStatusBar({\n          statusBar: { charging: false },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ charging: false }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should not set charging when charging is undefined', async () => {\n        await uut.setupStatusBar({ statusBar: {} });\n\n        const adbCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('battery')\n        );\n        expect(adbCalls).toHaveLength(0);\n      });\n\n      it('should not set charging when charging is null', async () => {\n        await uut.setupStatusBar({ statusBar: { charging: null } });\n\n        const adbCalls = mockAdb.shell.mock.calls.filter(call =>\n          call[0].includes('battery')\n        );\n        expect(adbCalls).toHaveLength(0);\n      });\n    });\n\n    describe('batteryLevel and charging combinations', () => {\n      it('should set both battery level and charging when both are provided', async () => {\n        await uut.setupStatusBar({\n          statusBar: {\n            batteryLevel: 'half',\n            charging: true,\n          },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ batteryLevel: 50, charging: true }));\n        expect(mockSleep).toHaveBeenCalledWith(1500);\n      });\n\n      it('should set only battery level when charging is null', async () => {\n        await uut.setupStatusBar({\n          statusBar: {\n            batteryLevel: 'full',\n            charging: null,\n          },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ batteryLevel: 100 }));\n      });\n\n      it('should set only charging when batteryLevel is null', async () => {\n        await uut.setupStatusBar({\n          statusBar: {\n            batteryLevel: null,\n            charging: false,\n          },\n        });\n\n        expect(mockAdb.shell).toHaveBeenCalledWith(adbName, batteryCmd({ charging: false }));\n      });\n    });\n\n    it('should handle all statusBar properties together', async () => {\n      await uut.setupStatusBar({\n        statusBar: {\n          notifications: 'show',\n          wifiSignal: 'strong',\n          cellSignal: 'weak',\n          batteryLevel: 'half',\n          charging: true,\n          clock: '0915',\n        },\n      });\n\n      const adbShellCmds = mockAdb.shell.mock.calls.map((/** @type {string[]} */ call) => call[1]);\n      expect(adbShellCmds).toMatchSnapshot();\n      expect(mockSleep).toHaveBeenCalledWith(1500);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/utils/__snapshots__/SystemUICfgHelper.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Android system UI configuration helper resolveConfig should (deep!) merge extended preset when extends is specified 1`] = `\n{\n  \"keyboard\": \"show\",\n  \"navigationMode\": \"3-button\",\n  \"statusBar\": {\n    \"batteryLevel\": \"full\",\n    \"cellSignal\": \"none\",\n    \"charging\": false,\n    \"clock\": \"1337\",\n    \"notifications\": \"show\",\n    \"wifiSignal\": \"strong\",\n  },\n  \"touches\": \"show\",\n}\n`;\n\nexports[`Android system UI configuration helper setupStatusBar should handle all statusBar properties together 1`] = `\n[\n  \"settings put global sysui_demo_allowed 1\",\n  \"am broadcast -a com.android.systemui.demo -e command exit\",\n  \"am broadcast -a com.android.systemui.demo -e command enter\",\n  \"am broadcast -a com.android.systemui.demo -e command notifications -e visible true\",\n  \"am broadcast -a com.android.systemui.demo -e command network -e wifi hide\",\n  \"am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 -e fully true\",\n  \"am broadcast -a com.android.systemui.demo -e command network -e mobile hide -e satellite hide\",\n  \"am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 2 -e fully true -e datatype none\",\n  \"am broadcast -a com.android.systemui.demo -e command clock -e hhmm 0915\",\n  \"am broadcast -a com.android.systemui.demo -e command battery -e level 50 -e plugged true\",\n]\n`;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/android/utils/systemUICfgPresets.js",
    "content": "/**\n * @type Detox.DetoxSystemUIConfig\n */\nconst minimalConfigPreset = {\n  keyboard: 'hide',\n  touches: 'show',\n  navigationMode: '3-button',\n  statusBar: {\n    notifications: 'hide',\n    wifiSignal: 'strong',\n    cellSignal: 'none',\n    batteryLevel: 'full',\n    charging: false,\n    clock: '1337',\n  },\n};\n\n/**\n * @type Detox.DetoxSystemUIConfig\n */\n const genyConfigPreset = {\n  keyboard: 'hide',\n  statusBar: {\n    notifications: 'hide',\n    wifiSignal: 'strong',\n    cellSignal: 'none',\n    batteryLevel: 'full',\n    charging: true,\n  },\n};\n\nmodule.exports = {\n  minimal: minimalConfigPreset,\n  genymotion: genyConfigPreset,\n};\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js",
    "content": "/**\n * @typedef {import('../AllocationDriverBase').AllocationDriverBase} AllocationDriverBase\n * @typedef {import('../AllocationDriverBase').DeallocOptions} DeallocOptions\n * @typedef {import('../../../common/drivers/ios/cookies').IosSimulatorCookie} IosSimulatorCookie\n */\n\nconst _ = require('lodash');\n\nconst { DetoxRuntimeError } = require('../../../../errors');\nconst log = require('../../../../utils/logger').child({ cat: 'device,device-allocation' });\nconst SimulatorAppCache = require('../../../common/drivers/ios/tools/SimulatorAppCache');\n\nconst SimulatorQuery = require('./SimulatorQuery');\n\n/**\n * @implements {AllocationDriverBase}\n */\nclass SimulatorAllocDriver {\n  /**\n   * @param {object} options\n   * @param {import('../../DeviceRegistry')} options.deviceRegistry\n   * @param {DetoxInternals.RuntimeConfig} options.detoxConfig\n   * @param {import('../../../common/drivers/ios/tools/AppleSimUtils')} options.applesimutils\n   */\n  constructor({ detoxConfig, deviceRegistry, applesimutils }) {\n    this._deviceRegistry = deviceRegistry;\n    this._applesimutils = applesimutils;\n    this._appCache = new SimulatorAppCache({ applesimutils });\n    this._launchInfo = {};\n    this._shouldShutdown = detoxConfig.behavior.cleanup.shutdownDevice;\n  }\n\n  async init() {\n    await this._deviceRegistry.unregisterZombieDevices();\n  }\n\n  /**\n   * @param deviceConfig { Object }\n   * @return {Promise<IosSimulatorCookie>}\n   */\n  async allocate(deviceConfig) {\n    const deviceQuery = new SimulatorQuery(deviceConfig.device);\n\n    const udid = await this._deviceRegistry.registerDevice(async () => {\n      return await this._findOrCreateDevice(deviceQuery);\n    });\n\n    if (!udid) {\n      throw new DetoxRuntimeError(`Failed to find device matching ${deviceQuery.getDeviceComment()}`);\n    }\n\n    this._launchInfo[udid] = { deviceConfig };\n    return { id: udid, udid };\n  }\n\n  /**\n   * @param {IosSimulatorCookie} deviceCookie\n   * @returns {Promise<IosSimulatorCookie>}\n   */\n  async postAllocate(deviceCookie) {\n    const { udid } = deviceCookie;\n    const { deviceConfig } = this._launchInfo[udid];\n\n    await this._applesimutils.boot(udid, deviceConfig.bootArgs, deviceConfig.headless);\n    await this._appCache.cleanupOnce(udid);\n\n    return {\n      id: udid,\n      udid,\n      type: deviceConfig.type,\n      bootArgs: deviceConfig.bootArgs,\n      headless: deviceConfig.headless,\n    };\n  }\n\n  /**\n   * @param cookie { IosSimulatorCookie }\n   * @param options { DeallocOptions }\n   * @return {Promise<void>}\n   */\n  async free(cookie, options = {}) {\n    const { udid } = cookie;\n\n    if (options.shutdown) {\n      await this._doShutdown(udid);\n      await this._deviceRegistry.unregisterDevice(udid);\n    } else {\n      await this._deviceRegistry.releaseDevice(udid);\n    }\n  }\n\n  async cleanup() {\n    const sessionDevices = await this._deviceRegistry.readSessionDevices();\n    const deviceIds = sessionDevices.getIds();\n\n    if (this._shouldShutdown) {\n      const shutdownPromises = deviceIds.map((udid) => this._doShutdown(udid));\n      await Promise.all(shutdownPromises);\n    }\n\n    await Promise.all(deviceIds.map((udid) => this._appCache.cleanup(udid)));\n    await this._deviceRegistry.unregisterSessionDevices();\n  }\n\n  /**\n   * @param {string} udid\n   * @returns {Promise<void>}\n   * @private\n   */\n  async _doShutdown(udid) {\n    try {\n      await this._applesimutils.shutdown(udid);\n    } catch (err) {\n      log.warn({ err }, `Failed to shutdown simulator ${udid}`);\n    }\n  }\n\n  /***\n   * @private\n   * @param {SimulatorQuery} deviceQuery\n   * @returns {Promise<String>}\n   */\n  async _findOrCreateDevice(deviceQuery) {\n    let udid;\n\n    const { free, taken } = await this._groupDevicesByStatus(deviceQuery);\n\n    if (_.isEmpty(free)) {\n      const prototypeDevice = taken[0];\n      udid = this._applesimutils.create(prototypeDevice);\n      await this._runScreenshotWorkaround(udid);\n    } else {\n      udid = free[0].udid;\n    }\n\n    return udid;\n  }\n\n  async _runScreenshotWorkaround(udid) {\n    await this._applesimutils.takeScreenshot(udid, '/dev/null').catch(() => {\n      log.debug({}, `\n          NOTE: For an unknown yet reason, taking the first screenshot is apt\n          to fail when booting iOS Simulator in a hidden window mode (or on CI).\n          Detox applies a workaround by taking a dummy screenshot to ensure\n          that the future ones are going to work fine. This screenshot is not\n          saved anywhere, and the error above is suppressed for all log levels\n          except for \"debug\" and \"trace.\"\n        `.trim());\n    });\n  }\n\n  /**\n   * @private\n   * @param {SimulatorQuery} deviceQuery\n   */\n  async _groupDevicesByStatus(deviceQuery) {\n    const searchResults = await this._queryDevices(deviceQuery);\n    const takenDevices = this._deviceRegistry.getTakenDevicesSync();\n\n    const { taken, free }  = _.groupBy(searchResults, ({ udid }) => {\n      return takenDevices.includes(udid) ? 'taken' : 'free';\n    });\n\n    const targetOS = _.get(taken, '0.os.identifier');\n    const isMatching = targetOS && { os: { identifier: targetOS } };\n\n    return {\n      taken: _.filter(taken, isMatching),\n      free: _.filter(free, isMatching),\n    };\n  }\n\n  /**\n   * @private\n   * @param {SimulatorQuery} deviceQuery\n   */\n  async _queryDevices(deviceQuery) {\n    const result = await this._applesimutils.list(\n      deviceQuery,\n      {\n        trying: `Searching for device ${deviceQuery} ...`,\n        fields: ['udid', 'name', 'deviceType', 'os', 'identifier'],\n      }\n    );\n\n    if (_.isEmpty(result)) {\n      throw new DetoxRuntimeError({\n        message: `Failed to find a device ${deviceQuery}`,\n        hint: `Run 'applesimutils --list' to list your supported devices. ` +\n          `It is advised only to specify a device type, e.g., \"iPhone Xʀ\" and avoid explicit search by OS version.`\n      });\n    }\n    return result;\n  }\n}\n\nmodule.exports = SimulatorAllocDriver;\n"
  },
  {
    "path": "detox/src/devices/allocation/drivers/ios/SimulatorQuery.js",
    "content": "class SimulatorQuery {\n  /** @param {Partial<Detox.IosSimulatorQuery>} query */\n  constructor({ id, name, os, type }) {\n    if (id != null) this.byId = id;\n    if (name != null) this.byName = name;\n    if (os != null) this.byOS = os;\n    if (type != null) this.byType = type;\n  }\n\n  getDeviceComment() {\n    return this.byId || [this.byName, this.byType, this.byOS].filter(Boolean).join(', ');\n  }\n\n  toString() {\n    return [\n      this.byId && `by UDID = ${JSON.stringify(this.byId)}`,\n      this.byName && `by name = ${JSON.stringify(this.byName)}`,\n      this.byType && `by type = ${JSON.stringify(this.byType)}`,\n      this.byOS && `by OS = ${JSON.stringify(this.byOS)}`,\n    ].filter(Boolean).join(' and ');\n  }\n}\n\nmodule.exports = SimulatorQuery;\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/__snapshots__/external.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`External allocator factory validation given no allocation-driver class should throw an error 1`] = `\"The custom driver at '../fake/module/path' does not export the DeviceAllocationDriverClass property\"`;\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/android.js",
    "content": "// @ts-nocheck\nconst DeviceAllocatorFactory = require('./base');\n\nclass AndroidEmulator extends DeviceAllocatorFactory {\n  _createDriver({ detoxSession, detoxConfig }) {\n    const serviceLocator = require('../../servicelocator/android');\n    const adb = serviceLocator.adb;\n    const emulatorExec = serviceLocator.emulator.exec;\n    const DeviceRegistry = require('../../allocation/DeviceRegistry');\n    const deviceRegistry = new DeviceRegistry({ sessionId: detoxSession.id });\n\n    const AVDsResolver = require('../drivers/android/emulator/AVDsResolver');\n    const avdsResolver = new AVDsResolver(emulatorExec);\n\n    const EmulatorVersionResolver = require('../drivers/android/emulator/EmulatorVersionResolver');\n    const emulatorVersionResolver = new EmulatorVersionResolver(emulatorExec);\n\n    const AVDValidator = require('../drivers/android/emulator/AVDValidator');\n    const avdValidator = new AVDValidator(avdsResolver, emulatorVersionResolver);\n\n    const FreeEmulatorFinder = require('../drivers/android/emulator/FreeEmulatorFinder');\n    const freeEmulatorFinder = new FreeEmulatorFinder(adb, deviceRegistry);\n\n    const FreePortFinder = require('../drivers/android/emulator/FreePortFinder');\n    const freePortFinder = new FreePortFinder();\n\n    const EmulatorLauncher = require('../drivers/android/emulator/EmulatorLauncher');\n    const emulatorLauncher = new EmulatorLauncher({ adb, emulatorExec });\n\n    const EmulatorAllocDriver = require('../drivers/android/emulator/EmulatorAllocDriver');\n    return new EmulatorAllocDriver({\n      adb,\n      avdValidator,\n      detoxConfig,\n      deviceRegistry,\n      emulatorVersionResolver,\n      emulatorLauncher,\n      freeDeviceFinder: freeEmulatorFinder,\n      freePortFinder,\n    });\n  }\n}\n\nclass AndroidAttached extends DeviceAllocatorFactory {\n  _createDriver({ detoxSession }) {\n    const serviceLocator = require('../../servicelocator/android');\n    const adb = serviceLocator.adb;\n    const DeviceRegistry = require('../../allocation/DeviceRegistry');\n    const deviceRegistry = new DeviceRegistry({ sessionId: detoxSession.id });\n\n    const FreeDeviceFinder = require('../drivers/android/FreeDeviceFinder');\n    const freeDeviceFinder = new FreeDeviceFinder(adb, deviceRegistry);\n\n    const AttachedAndroidAllocDriver = require('../drivers/android/attached/AttachedAndroidAllocDriver');\n    return new AttachedAndroidAllocDriver({ adb, deviceRegistry, freeDeviceFinder });\n  }\n}\n\nclass Genycloud extends DeviceAllocatorFactory {\n  _createDriver(deps) {\n    const serviceLocator = require('../../servicelocator/android');\n    const adb = serviceLocator.adb;\n    const exec = serviceLocator.genycloud.exec;\n\n    const RecipesService = require('../drivers/android/genycloud/services/GenyRecipesService');\n    const recipeService = new RecipesService(exec);\n\n    const InstanceLifecycleService = require('../drivers/android/genycloud/services/GenyInstanceLifecycleService');\n    const instanceLifecycleService = new InstanceLifecycleService(exec, adb);\n\n    const RecipeQuerying = require('../drivers/android/genycloud/GenyRecipeQuerying');\n    const recipeQuerying = new RecipeQuerying(recipeService);\n\n    const InstanceLauncher = require('../drivers/android/genycloud/GenyInstanceLauncher');\n    const instanceLauncher = new InstanceLauncher({ genyCloudExec: exec, instanceLifecycleService });\n\n    const GenyAllocDriver = require('../drivers/android/genycloud/GenyAllocDriver');\n\n    return new GenyAllocDriver({\n      adb,\n      instanceLauncher,\n      instanceLifecycleService,\n      recipeQuerying,\n      ...deps,\n    });\n  }\n}\n\nmodule.exports = {\n  AndroidEmulator,\n  AndroidAttached,\n  Genycloud,\n};\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/base.js",
    "content": "// @ts-nocheck\nconst DeviceAllocator = require('../DeviceAllocator');\n\nclass DeviceAllocatorFactory {\n  /**\n   * @param deps { Object }\n   * @returns { DeviceAllocator }\n   */\n  createDeviceAllocator(deps) {\n    const allocDriver = this._createDriver(deps);\n    return new DeviceAllocator(allocDriver);\n  }\n\n  /**\n   * @param deps\n   * @returns { AllocationDriverBase }\n   * @private\n   */\n  _createDriver(deps) {} // eslint-disable-line @typescript-eslint/no-unused-vars\n}\n\nmodule.exports = DeviceAllocatorFactory;\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/external.js",
    "content": "// @ts-nocheck\nconst DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');\n\nconst DeviceAllocatorFactory = require('./base');\n\nclass External extends DeviceAllocatorFactory {\n  static validateModule(module, path) {\n    if (!module.DeviceAllocationDriverClass) {\n      throw new DetoxRuntimeError(`The custom driver at '${path}' does not export the DeviceAllocationDriverClass property`);\n    }\n  }\n\n  constructor(module, path) {\n    super();\n    External.validateModule(module, path);\n\n    this._module = module;\n  }\n\n  _createDriver(deps) {\n    return new this._module.DeviceAllocationDriverClass(deps);\n  }\n}\n\nmodule.exports = { External };\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/external.test.js",
    "content": "describe('External allocator factory', () => {\n  describe('validation', () => {\n    const path = '../fake/module/path';\n\n    let factoryClass;\n    beforeEach(() => {\n      factoryClass = require('./external').External;\n    });\n\n    describe('given no allocation-driver class', () => {\n      it('should throw an error', () => {\n        const module = {\n          DeviceAllocationDriverClass: undefined,\n        };\n        expect(() => factoryClass.validateModule(module, path)).toThrowErrorMatchingSnapshot();\n      });\n    });\n\n    describe('given allocation driver class', () => {\n      it('should not throw an error', () => {\n        const module = {\n          DeviceAllocationDriverClass: class {},\n        };\n        factoryClass.validateModule(module, path);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/index.js",
    "content": "module.exports = {\n  ...require('./android'),\n  ...require('./ios'),\n  ...require('./external'),\n};\n"
  },
  {
    "path": "detox/src/devices/allocation/factories/ios.js",
    "content": "// @ts-nocheck\nconst DeviceAllocatorFactory = require('./base');\n\nclass IosSimulator extends DeviceAllocatorFactory {\n  _createDriver({ detoxConfig, detoxSession }) {\n    const AppleSimUtils = require('../../../devices/common/drivers/ios/tools/AppleSimUtils');\n    const applesimutils = new AppleSimUtils();\n\n    const DeviceRegistry = require('../../../devices/allocation/DeviceRegistry');\n    const deviceRegistry = new DeviceRegistry({ sessionId: detoxSession.id });\n\n    const SimulatorAllocDriver = require('../drivers/ios/SimulatorAllocDriver');\n    return new SimulatorAllocDriver({ detoxConfig, deviceRegistry, applesimutils });\n  }\n}\n\nmodule.exports = { IosSimulator };\n"
  },
  {
    "path": "detox/src/devices/common/drivers/DeviceCookie.d.ts",
    "content": "/* eslint-disable import/no-unresolved,node/no-missing-import,node/no-unsupported-features/es-syntax */\n\n/**\n * A serializable object that represents a device.\n */\nexport interface DeviceCookie {\n  /** The device's unique identifier. */\n  id: string;\n  /** The display name of the device. */\n  name?: string;\n}\n\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/cookies.d.ts",
    "content": "/* eslint-disable import/no-unresolved,node/no-missing-import,node/no-unsupported-features/es-syntax */\nimport GenyInstance from '../../../allocation/drivers/android/genycloud/services/dto/GenyInstance';\nimport { DeviceCookie } from '../DeviceCookie';\n\ninterface AndroidDeviceCookie extends DeviceCookie {\n  adbName: string;\n}\n\ninterface GenycloudEmulatorCookie extends AndroidDeviceCookie {\n  instance: GenyInstance;\n}\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js",
    "content": "const os = require('os');\n\nconst _ = require('lodash');\n\nconst { getAndroidEmulatorPath } = require('../../../../../../utils/environment');\nconst {\n  BinaryExec,\n  ExecCommand,\n} = require('../../exec/BinaryExec');\n\nclass EmulatorExec extends BinaryExec {\n  constructor() {\n    super(getAndroidEmulatorPath());\n  }\n}\n\nclass ListAVDsCommand extends ExecCommand {\n  _getArgs() {\n    return ['-list-avds', '--verbose'];\n  }\n}\n\nclass QueryVersionCommand extends ExecCommand {\n  constructor({ headless }) {\n    super();\n    this._headless = headless;\n  }\n\n  _getArgs() {\n    return ['-version', this._headless ? '-no-window' : ''];\n  }\n}\n\nclass LaunchCommand extends ExecCommand {\n  constructor(options) {\n    super();\n    this._options = options;\n    this._args = this._getEmulatorArgs();\n  }\n\n  get adbName() {\n    return this._options.adbName;\n  }\n\n  get avdName() {\n    return this._options.avdName;\n  }\n\n  get port() {\n    return this._options.port;\n  }\n\n  _getArgs() {\n    return this._args;\n  }\n\n  _getEmulatorArgs() {\n    const {\n      avdName,\n      bootArgs,\n      gpuMode = this._getDefaultGPUMode(),\n      headless,\n      readonly = true,\n      port,\n    } = this._options;\n\n    const deviceBootArgs = (bootArgs || '').split(/\\s+/);\n    const emulatorArgs = _.compact([\n      '-verbose',\n      '-no-audio',\n      '-no-boot-anim',\n      headless ? '-no-window' : '',\n      readonly ? '-read-only' : '',\n      gpuMode !== undefined ? '-gpu' : '',\n      gpuMode !== undefined ? `${gpuMode}` : '',\n      port ? '-port' : '',\n      port ? `${port}` : '',\n      ...deviceBootArgs,\n      `@${avdName}`\n    ]);\n\n    return emulatorArgs;\n  }\n\n  _getDefaultGPUMode() {\n    if (this._options.headless) {\n      switch (os.platform()) {\n        case 'darwin':\n          return 'host';\n        case 'linux':\n          return 'swiftshader_indirect';\n        case 'win32':\n          return 'angle_indirect';\n        default:\n          return 'auto';\n      }\n    }\n\n    return undefined;\n  }\n}\n\nmodule.exports = {\n  EmulatorExec,\n  ListAVDsCommand,\n  QueryVersionCommand,\n  LaunchCommand,\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/AAPT.js",
    "content": "// @ts-nocheck\nconst exec = require('../../../../../utils/childProcess').execWithRetriesAndLogs;\nconst { getAaptPath } = require('../../../../../utils/environment');\nconst pipeCommands = require('../../../../../utils/pipeCommands');\n\nconst escape = pipeCommands.escape.inQuotedString;\n\nclass AAPT {\n  constructor() {\n    this.aaptBin = null;\n  }\n\n  async _prepare() {\n    this.aaptBin = this.aaptBin || `\"${escape(await getAaptPath())}\"`;\n  }\n\n  async getPackageName(apkPath) {\n    await this._prepare();\n\n    const command = `${this.aaptBin} dump badging \"${escape(apkPath)}\"`;\n    const process = await exec(command, { retries: 1 });\n    const packageName = new RegExp(/^package: name='([^']+)'/gm).exec(process.stdout);\n    return packageName && packageName[1];\n  }\n\n  async isTestAPK(apkPath) {\n    await this._prepare();\n\n    const command = `${this.aaptBin} dump xmlstrings \"${escape(apkPath)}\" AndroidManifest.xml`;\n    const process = await exec(command, { retries: 1, verbosity: 'low' });\n    return new RegExp(/^String #[0-9]*: instrumentation/gm).test(process.stdout);\n  }\n}\n\nmodule.exports = AAPT;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/AAPT.test.js",
    "content": "const aaptMockResults = require('./__mocks__/aapt-results');\n\ndescribe('AAPT', () => {\n  const mockAPKPath = 'path/to/app.apk';\n  const mockAAPTPath = 'mockSdk/build-tools/30.0.0/aapt';\n  const mockEscapeFunc = (source) => `escaped(${source})`;\n\n  const givenAAPTResult = (result) => {\n    exec.mockResolvedValue({\n      stdout: result,\n    });\n  };\n  const execCommand = () => exec.mock.calls[0][0];\n\n  let environment;\n  let escape;\n  let exec;\n  let aapt;\n  beforeEach(() => {\n    jest.mock('../../../../../utils/environment');\n    environment = jest.requireMock('../../../../../utils/environment');\n    environment.getAaptPath.mockResolvedValue(mockAAPTPath);\n\n    jest.mock('../../../../../utils/childProcess');\n    exec = require('../../../../../utils/childProcess').execWithRetriesAndLogs;\n    givenAAPTResult('');\n\n    jest.mock('../../../../../utils/pipeCommands');\n    escape = jest.requireMock('../../../../../utils/pipeCommands').escape.inQuotedString;\n    escape.mockImplementation(mockEscapeFunc);\n\n    const AAPT = require('./AAPT');\n    aapt = new AAPT();\n  });\n\n  describe('Reading package name', () => {\n    it('should execute the AAPT command with proper args', async () => {\n      await aapt.getPackageName(mockAPKPath);\n      expect(execCommand()).toMatchSnapshot();\n    });\n\n    it('should execute the command with retries', async () => {\n      await aapt.getPackageName(mockAPKPath);\n      expect(exec).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ retries: 1 }));\n    });\n\n    it('should extract the package name', async () => {\n      givenAAPTResult(aaptMockResults.dumpBadging);\n\n      const pacakageName = await aapt.getPackageName('path/to/file.apk');\n      expect(pacakageName).toEqual('com.wix.detox.test');\n    });\n\n    it(`should configure aaptBin only once`, async () => {\n      givenAAPTResult(aaptMockResults.dumpBadging);\n\n      await aapt.getPackageName('path/to/file.apk');\n      await aapt.getPackageName('path/to/file.apk');\n\n      expect(environment.getAaptPath).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('Checking whether APK holds instrumentation testing', () => {\n    it('should execute the AAPT command with proper args', async () => {\n      await aapt.isTestAPK(mockAPKPath);\n      expect(execCommand()).toMatchSnapshot();\n    });\n\n    it('should execute the command with retries', async () => {\n      await aapt.isTestAPK(mockAPKPath);\n      expect(exec).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ retries: 1 }));\n    });\n\n    it('should execute the command in non-verbose mode', async () => {\n      await aapt.isTestAPK(mockAPKPath);\n      expect(exec).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ verbosity: 'low' }));\n    });\n\n    it('should return true for a test APK', async () => {\n      givenAAPTResult(aaptMockResults.dumpXmlStrings.testApk);\n\n      const result = await aapt.isTestAPK(mockAPKPath);\n      expect(result).toEqual(true);\n    });\n\n    it('should return false for a non-test APK', async () => {\n      givenAAPTResult(aaptMockResults.dumpXmlStrings.prodApk);\n\n      const result = await aapt.isTestAPK(mockAPKPath);\n      expect(result).toEqual(false);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/ADB.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst { execWithRetriesAndLogs, spawnWithRetriesAndLogs, spawnAndLog } = require('../../../../../utils/childProcess');\nconst { getAdbPath } = require('../../../../../utils/environment');\nconst logger = require('../../../../../utils/logger');\nconst { escape } = require('../../../../../utils/pipeCommands');\nconst DeviceHandle = require('../tools/DeviceHandle');\nconst EmulatorHandle = require('../tools/EmulatorHandle');\n\nconst log = logger.child({ cat: 'device' });\n\nconst DEFAULT_EXEC_OPTIONS = {\n  retries: 1,\n};\nconst DEFAULT_INSTALL_OPTIONS = {\n  timeout: 60000,\n  retries: 3,\n};\n\nclass ADB {\n  constructor() {\n    this._cachedApiLevels = new Map();\n    this.defaultExecOptions = DEFAULT_EXEC_OPTIONS;\n    this.installOptions = DEFAULT_INSTALL_OPTIONS;\n    this.adbBin = getAdbPath();\n  }\n\n  async startDaemon() {\n    await this.adbCmd('', 'start-server', { retries: 0, verbosity: 'high' });\n  }\n\n  async devices(options) {\n    const { stdout } = await this.adbCmd('', 'devices', { verbosity: 'high', ...options });\n    /** @type {DeviceHandle[]} */\n    const devices = _.chain(stdout)\n      .trim()\n      .split('\\n')\n      .slice(1)\n      .map(s => _.trim(s))\n      .map(s => s.startsWith('emulator-')\n        ? new EmulatorHandle(s)\n        : new DeviceHandle(s))\n      .value();\n    return { devices, stdout };\n  }\n\n  async getState(deviceId) {\n    try {\n      const output = await this.adbCmd(deviceId, `get-state`, {\n        verbosity: 'low'\n      });\n\n      return output.stdout.trim();\n    } catch (e) {\n      const stderr = e.stderr || '';\n      if (stderr.includes('not found')) {\n        return 'none';\n      } else {\n        throw e;\n      }\n    }\n  }\n\n  async unlockScreen(deviceId) {\n    const {\n      mWakefulness,\n      mUserActivityTimeoutOverrideFromWindowManager,\n    } = await this._getPowerStatus(deviceId);\n\n    if (mWakefulness === 'Asleep' || mWakefulness === 'Dozing') {\n      await this.pressPowerDevice(deviceId);\n    }\n\n    if (mUserActivityTimeoutOverrideFromWindowManager === '10000') { // screen is locked\n      await this.pressOptionsMenu(deviceId);\n    }\n  }\n\n  async _getPowerStatus(deviceId) {\n    const stdout = await this.shell(deviceId, `dumpsys power | grep \"^[ ]*m[UW].*=\"`, { retries: 5 });\n    return stdout\n      .split('\\n')\n      .map(s => s.trim().split('='))\n      .reduce((acc, [key, value]) => ({\n        ...acc,\n        [key]: value,\n      }), {});\n  }\n\n  async pressOptionsMenu(deviceId) {\n    await this._sendKeyEvent(deviceId, 'KEYCODE_MENU');\n  }\n\n  async pressPowerDevice(deviceId) {\n    await this._sendKeyEvent(deviceId, 'KEYCODE_POWER');\n  }\n\n  async typeText(deviceId, text) {\n    const actualText = text.replace(/ /g, '%s');\n    await this.shell(deviceId, `input text ${actualText}`);\n  }\n\n  async _sendKeyEvent(deviceId, keyevent) {\n    await this.shell(deviceId, `input keyevent ${keyevent}`);\n  }\n\n  async now(deviceId) {\n    return this.shell(deviceId, `date +\"%m-%d %T.000\"`);\n  }\n\n  async isPackageInstalled(deviceId, packageId) {\n    const output = await this.shell(deviceId, `pm list packages ${packageId}`);\n    const packageRegexp = new RegExp(`^package:${escape.inQuotedRegexp(packageId)}$`, 'm');\n    const isInstalled = packageRegexp.test(output);\n\n    return isInstalled;\n  }\n\n  async install(deviceId, _apkPath) {\n    const apkPath = escape.inQuotedString(_apkPath);\n    const apiLvl = await this.apiLevel(deviceId);\n    const command = (apiLvl >= 23)\n      ? `install -r -g -t ${apkPath}`\n      : `install -rg ${apkPath}`;\n    const result = await this.adbCmdSpawned(deviceId, command, this.installOptions);\n\n    const [failure] = (result.stdout || '').match(/^Failure \\[.*\\]$/m) || [];\n    if (failure) {\n      throw new DetoxRuntimeError({\n        message: `Failed to install app on ${deviceId}: ${apkPath}`,\n        debugInfo: failure,\n      });\n    }\n  }\n\n  async remoteInstall(deviceId, path) {\n    const apiLvl = await this.apiLevel(deviceId);\n    const command = (apiLvl >= 23)\n      ? `pm install -r -g -t ${path}`\n      : `pm install -rg ${path}`;\n    return this.shellSpawned(deviceId, command, this.installOptions);\n  }\n\n  async uninstall(deviceId, appId) {\n    await this.adbCmd(deviceId, `uninstall ${appId}`);\n  }\n\n  async terminate(deviceId, appId) {\n    await this.shell(deviceId, `am force-stop ${appId}`);\n  }\n\n  async clearAppData(deviceId, packageId) {\n    try {\n      return await this.shell(deviceId, `pm clear ${packageId}`);\n    } catch (reason) {\n      throw new DetoxRuntimeError({\n        message: `Failed to clear ${packageId} app data on ${deviceId}`,\n        hint: `Please verify that the package is installed on the device:\\nadb -s ${deviceId} shell pm list packages ${packageId}`,\n        debugInfo: reason,\n      });\n    }\n  }\n\n  async grantAllPermissions(deviceId, packageId) {\n    try {\n      await this.shell(deviceId, `pm grant --all-permissions ${packageId}`);\n    } catch (e) {\n      const message = e.stderr || e.message || '';\n      if (message.includes('no permission specified')) {\n        log.warn(\n          `Cannot restore permissions after resetAppState(). Please update Android version to API 35 or higher.`\n        );\n      } else {\n        throw e;\n      }\n    }\n  }\n\n  async setLocation(deviceId, lat, lon) {\n    // NOTE: QEMU for Android for the telnet part relies on C stdlib\n    // function `strtod` which is locale-sensitive, meaning that depending\n    // on user environment you'll have to send either comma-separated\n    // numbers or dot-separated ones.\n    //\n    // See: https://android.googlesource.com/platform/external/qemu/+/ae0eaf51751391abea2639a65200e724131dc3d6/android/console.c#2273\n    //\n    // As by default Node.js is distributed without ICU, the locale issue\n    // becomes tricky to solve across different platforms, that's why\n    // it's easier for us just to send 2 commands in a row, ignoring one\n    // which will obviously fail.\n    //\n    // Since `adb emu` commands fail silently, .catch() is not necessary.\n\n    const dot = `${lon} ${lat}`;\n    const comma = dot.replace(/\\./g, ',');\n\n    await this.emu(deviceId, `geo fix ${dot}`);\n    await this.emu(deviceId, `geo fix ${comma}`);\n  }\n\n  async pidof(deviceId, bundleId) {\n    const bundleIdRegex = escape.inQuotedRegexp(bundleId) + '$';\n    const command = `ps | grep \"${bundleIdRegex}\"`;\n    const options = { silent: true };\n\n    const processes = await this.shell(deviceId, command, options).catch(() => '');\n    if (!processes) {\n      return NaN;\n    }\n\n    return parseInt(processes.split(' ').filter(Boolean)[1], 10);\n  }\n\n  async getFileSize(deviceId, filename) {\n    const { stdout, stderr } = await this.adbCmd(deviceId, 'shell du ' + filename).catch(e => e);\n\n    if (stderr.includes('No such file or directory')) {\n      return -1;\n    }\n\n    return Number(stdout.slice(0, stdout.indexOf(' ')));\n  }\n\n  async isBootComplete(deviceId) {\n    try {\n      const bootComplete = await this.shell(deviceId, `getprop dev.bootcomplete`, { retries: 0, silent: true });\n      return (bootComplete === '1');\n    } catch (ex) {\n      return false;\n    }\n  }\n\n  async waitForDevice(deviceId) {\n    return await this.adbCmd(deviceId, 'wait-for-device');\n  }\n\n  async apiLevel(deviceId) {\n    if (this._cachedApiLevels.has(deviceId)) {\n      return this._cachedApiLevels.get(deviceId);\n    }\n\n    const lvl = Number(await this.shell(deviceId, `getprop ro.build.version.sdk`, { retries: 5 }));\n    this._cachedApiLevels.set(deviceId, lvl);\n\n    return lvl;\n  }\n\n  async disableAndroidAnimations(deviceId) {\n    await this.shell(deviceId, `settings put global animator_duration_scale 0`);\n    await this.shell(deviceId, `settings put global window_animation_scale 0`);\n    await this.shell(deviceId, `settings put global transition_animation_scale 0`);\n  }\n\n  async setWiFiToggle(deviceId, state) {\n    const value = (state === true ? 'enable' : 'disable');\n    await this.shell(deviceId, `svc wifi ${value}`);\n  }\n\n  async screencap(deviceId, path) {\n    await this.shell(deviceId, `screencap ${path}`);\n  }\n\n  /***\n   * @returns ChildProcessPromise\n   */\n  screenrecord(deviceId, { path, size, bitRate, timeLimit, verbose }) {\n    const [width = 0, height = 0] = size || [];\n\n    const _size = (width > 0) && (height > 0)\n      ? ['--size', `${width}x${height}`]\n      : [];\n\n    const _bitRate = (bitRate > 0)\n      ? ['--bit-rate', String(bitRate)]\n      : [];\n\n    const _timeLimit = (timeLimit > 0)\n      ? [`--time-limit`, timeLimit]\n      : [];\n\n    const _verbose = verbose ? ['--verbose'] : [];\n    const screenRecordArgs = [..._size, ..._bitRate, ..._timeLimit, ..._verbose, path];\n\n    return this.spawn(deviceId, ['shell', 'screenrecord', ...screenRecordArgs]);\n  }\n\n  /***\n   * @returns ChildProcessPromise\n   */\n  logcat(deviceId, { file, pid, time }) {\n    let shellCommand = 'logcat';\n\n    // HACK: cannot make this function async, otherwise ChildProcessPromise.childProcess field will get lost,\n    // and this will break interruptProcess() call for any logcat promise.\n    const apiLevel = this._cachedApiLevels.get(deviceId);\n    if (time && apiLevel >= 21) {\n      shellCommand += ` -T \"${time}\"`;\n    }\n\n    if (apiLevel < 24) {\n      if (pid > 0) {\n        const __pid = String(pid).padStart(5);\n        shellCommand += ` -v brief | grep \"(${__pid}):\"`;\n      }\n\n      if (file) {\n        shellCommand += ` >> ${file}`;\n      }\n    } else {\n      if (pid > 0) {\n        shellCommand += ` --pid=${pid}`;\n      }\n\n      if (file) {\n        shellCommand += ` -f ${file}`;\n      }\n    }\n\n    return this.spawn(deviceId, ['shell', shellCommand]);\n  }\n\n  async push(deviceId, src, dst) {\n    await this.adbCmd(deviceId, `push \"${src}\" \"${dst}\"`);\n  }\n\n  async pull(deviceId, src, dst = '') {\n    await this.adbCmd(deviceId, `pull \"${src}\" \"${dst}\"`);\n  }\n\n  async rm(deviceId, path, force = false) {\n    await this.shell(deviceId, `rm ${force ? '-f' : ''} \"${path}\"`);\n  }\n\n  /***\n   * @returns {ChildProcessPromise}\n   */\n  spawnInstrumentation(deviceId, userArgs, testRunner) {\n    const spawnArgs = ['shell', 'am', 'instrument', '-w', '-r', ...userArgs, testRunner];\n    return this.spawn(deviceId, spawnArgs, { detached: false });\n  }\n\n  async listInstrumentation(deviceId) {\n    return this.shell(deviceId, 'pm list instrumentation');\n  }\n\n  async getInstrumentationRunner(deviceId, bundleId) {\n    const instrumentationRunners = await this.listInstrumentation(deviceId);\n    const instrumentationRunner = this._instrumentationRunnerForBundleId(instrumentationRunners, bundleId);\n    if (instrumentationRunner === 'undefined') {\n      throw new DetoxRuntimeError(`No instrumentation runner found on device ${deviceId} for package ${bundleId}`);\n    }\n\n    return instrumentationRunner;\n  }\n\n  _instrumentationRunnerForBundleId(instrumentationRunners, bundleId) {\n    const runnerForBundleRegEx = new RegExp(`^instrumentation:(.*) \\\\(target=${bundleId.replace(new RegExp('\\\\.', 'g'), '\\\\.')}\\\\)$`, 'gm');\n    return _.get(runnerForBundleRegEx.exec(instrumentationRunners), [1], 'undefined');\n  }\n\n  async shell(deviceId, command, options) {\n    const result = await this.adbCmd(deviceId, `shell \"${escape.inQuotedString(command)}\"`, options);\n    return result.stdout.trim();\n  }\n\n  async shellSpawned(deviceId, command, options) {\n    const _command = `shell ${command}`;\n    const result = await this.adbCmdSpawned(deviceId, _command, options);\n    return result.stdout.trim();\n  }\n\n  async emu(deviceId, cmd, options) {\n    return (await this.adbCmd(deviceId, `emu \"${escape.inQuotedString(cmd)}\"`, options)).stdout.trim();\n  }\n\n  async reverse(deviceId, port) {\n    return this.adbCmd(deviceId, `reverse tcp:${port} tcp:${port}`);\n  }\n\n  async reverseRemove(deviceId, port) {\n    return this.adbCmd(deviceId, `reverse --remove tcp:${port}`);\n  }\n\n  async emuKill(deviceId) {\n    return this.adbCmd(deviceId, `emu kill`);\n  }\n\n  async adbCmd(deviceId, params, options = {}) {\n    const serial = `${deviceId ? `-s ${deviceId}` : ''}`;\n    const cmd = `\"${this.adbBin}\" ${serial} ${params}`;\n    const _options = {\n      ...this.defaultExecOptions,\n      ...options,\n    };\n    return execWithRetriesAndLogs(cmd, _options);\n  }\n\n  async adbCmdSpawned(deviceId, command, spawnOptions = {}) {\n    const flags = command.split(/\\s+/);\n    const serial = deviceId ? ['-s', deviceId] : [];\n    const _flags = [...serial, ...flags];\n    const _spawnOptions = {\n      ...this.defaultExecOptions,\n      ...spawnOptions,\n      capture: ['stdout'],\n      encoding: 'utf8',\n    };\n    return spawnWithRetriesAndLogs(this.adbBin, _flags, _spawnOptions);\n  }\n\n  /***\n   * @returns {ChildProcessPromise}\n   */\n  spawn(deviceId, params, spawnOptions) {\n    const serial = deviceId ? ['-s', deviceId] : [];\n    return spawnAndLog(this.adbBin, [...serial, ...params], spawnOptions);\n  }\n}\n\nmodule.exports = ADB;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/ADB.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../../../utils/logger');\n\ndescribe('ADB', () => {\n  const deviceId = 'mockEmulator';\n  const adbBinPath = `/Android/sdk-mock/platform-tools/adb`;\n\n  let ADB;\n  let adb;\n  let DeviceHandle;\n  let EmulatorHandle;\n  let execWithRetriesAndLogs;\n  let spawnAndLog;\n  let spawnWithRetriesAndLogs;\n  let logger;\n\n  beforeEach(() => {\n    logger = require('../../../../../utils/logger');\n\n    jest.mock('../../../../../utils/environment');\n    require('../../../../../utils/environment').getAdbPath.mockReturnValue(adbBinPath);\n\n    jest.mock('../../../../../utils/encoding', () => ({\n      encodeBase64: (text) => `base64(${text})`,\n    }));\n\n    jest.mock('../tools/DeviceHandle');\n    DeviceHandle = require('../tools/DeviceHandle');\n\n    jest.mock('../tools/EmulatorHandle');\n    EmulatorHandle = require('../tools/EmulatorHandle');\n\n    jest.mock('../../../../../utils/childProcess', () => ({\n      execWithRetriesAndLogs: jest.fn().mockReturnValue({ stdout: '' }),\n      spawnAndLog: jest.fn(),\n      spawnWithRetriesAndLogs: jest.fn().mockReturnValue({ stdout: '' }),\n    }));\n    execWithRetriesAndLogs = require('../../../../../utils/childProcess').execWithRetriesAndLogs;\n    spawnAndLog = require('../../../../../utils/childProcess').spawnAndLog;\n    spawnWithRetriesAndLogs = require('../../../../../utils/childProcess').spawnWithRetriesAndLogs;\n\n    ADB = require('./ADB');\n    adb = new ADB();\n  });\n\n  describe('devices', () => {\n    const mockDevices = [\n      'MOCK_SERIAL\\tdevice',\n      '192.168.60.101:6666\\tdevice',\n      'emulator-5554\\tdevice',\n      'emulator-5556\\toffline',\n    ];\n    const adbDevices = ['List of devices attached', ...mockDevices, ''].join('\\n');\n\n    it(`should invoke ADB`, async () => {\n      await adb.devices();\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\"  devices`, { verbosity: 'high', retries: 1 });\n      expect(execWithRetriesAndLogs).toHaveBeenCalledTimes(1);\n    });\n\n    it('should return proper, type-based device handles', async () => {\n      execWithRetriesAndLogs.mockReturnValue({ stdout: adbDevices });\n\n      const { devices, stdout } = await adb.devices();\n\n      expect(stdout).toBe(adbDevices);\n      expect(devices).toHaveLength(4);\n      expect(devices).toEqual([\n        DeviceHandle.mock.instances[0],\n        DeviceHandle.mock.instances[1],\n        EmulatorHandle.mock.instances[0],\n        EmulatorHandle.mock.instances[1],\n      ]);\n      expect(DeviceHandle).toHaveBeenCalledWith(mockDevices[0]);\n      expect(DeviceHandle).toHaveBeenCalledWith(mockDevices[1]);\n      expect(EmulatorHandle).toHaveBeenCalledWith(mockDevices[2]);\n      expect(EmulatorHandle).toHaveBeenCalledWith(mockDevices[3]);\n    });\n\n    it(`should return an empty list if no devices are available`, async () => {\n      execWithRetriesAndLogs.mockReturnValue({\n        stdout: 'List of devices attached\\n'\n      });\n\n      const { devices } = await adb.devices();\n      expect(devices.length).toEqual(0);\n    });\n\n    it(`should allow for option overrides`, async () => {\n      const options = {\n        retries: 100,\n        verbosity: 'low',\n      };\n\n      await adb.devices(options);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(expect.any(String), options);\n    });\n  });\n\n  describe('ADB Daemon (server)', () => {\n    it('should start the daemon', async () => {\n      await adb.startDaemon();\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\"  start-server`, { retries: 0, verbosity: 'high' });\n    });\n  });\n\n  it('should await device boot', async () => {\n    await adb.waitForDevice(deviceId);\n\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n      expect.stringContaining(`\"${adbBinPath}\" -s ${deviceId} wait-for-device`),\n      expect.any(Object));\n  });\n\n  it('should install an APK (api≤22)', async () => {\n    jest.spyOn(adb, 'apiLevel').mockImplementation(async () => 22);\n    await adb.install(deviceId, 'path/to/bin.apk');\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(\n      adbBinPath,\n      ['-s', deviceId, 'install', '-rg', 'path/to/bin.apk'],\n      expect.any(Object));\n  });\n\n  it('should install an APK (api≥23)', async () => {\n    jest.spyOn(adb, 'apiLevel').mockImplementation(async () => 23);\n    await adb.install(deviceId, 'path/to/bin.apk');\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(\n      adbBinPath,\n      ['-s', deviceId, 'install', '-r', '-g', '-t', 'path/to/bin.apk'],\n      expect.any(Object));\n  });\n\n  it('should install with proper spawning/retry options', async () => {\n    const expectedOptions = {\n      retries: 3,\n      timeout: 60000,\n      capture: ['stdout'],\n      encoding: 'utf8',\n    };\n    await adb.install(deviceId, 'path/to/bin.apk');\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(expect.any(String), expect.any(Array), expectedOptions);\n  });\n\n  it('show allow for installing with external exec and install options', async () => {\n    adb.defaultExecOptions = {\n      retries: 66,\n      interval: 123123,\n    };\n    // Expect to override the default options\n    adb.installOptions = {\n      retries: 99,\n      timeout: 1337,\n    };\n    await adb.install(deviceId, 'dont-care/path');\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(expect.any(String), expect.any(Array), expect.objectContaining({\n      retries: 99,\n      interval: 123123,\n      timeout: 1337,\n    }));\n  });\n\n  it(`uninstall`, async () => {\n    await adb.uninstall('com.package');\n    expect(execWithRetriesAndLogs).toHaveBeenCalledTimes(1);\n  });\n\n  it('show allow for uninstalling with external exec options', async () => {\n    adb.defaultExecOptions = {\n      retries: 66,\n      interval: 123123,\n    };\n    // Expect to be ignored\n    adb.installOptions = {\n      retries: 99,\n      timeout: 1337,\n    };\n    await adb.uninstall('com.dontcare');\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({\n      retries: 66,\n      interval: 123123,\n    }));\n  });\n\n  it(`terminate`, async () => {\n    await adb.terminate('com.package');\n    expect(execWithRetriesAndLogs).toHaveBeenCalledTimes(1);\n  });\n\n  it(`sets location both with commas and dots due to the locale issue`, async () => {\n    const lat = 30.5;\n    const lon = -70.5;\n\n    await adb.setLocation(deviceId, lat, lon);\n\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n      expect.stringContaining(`-s mockEmulator emu \"geo fix -70.5 30.5\"`),\n      expect.anything());\n\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n      expect.stringContaining(`-s mockEmulator emu \"geo fix -70,5 30,5\"`),\n      expect.anything());\n  });\n\n  it(`pidof (success)`, async () => {\n    jest.spyOn(adb, 'shell').mockImplementation(async () =>\n      `u0_a19        2199  1701 3554600  70264 0                   0 s com.google.android.ext.services `);\n\n    expect(await adb.pidof('', 'com.google.android.ext.services')).toBe(2199);\n  });\n\n  it(`pidof (failure)`, async () => {\n    jest.spyOn(adb, 'shell').mockImplementation(async () => '');\n    expect(await adb.pidof('', 'com.google.android.ext.services')).toBe(NaN);\n  });\n\n  it('push', async () => {\n    const sourceFile = '/mock-source/file.xyz';\n    const destFile = '/sdcard/file.abc';\n    await adb.push(deviceId, sourceFile, destFile);\n\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n      expect.stringContaining(`-s mockEmulator push \"${sourceFile}\" \"${destFile}\"`),\n      expect.anything());\n  });\n\n  it('should remote-install (api≤22)', async () => {\n    jest.spyOn(adb, 'apiLevel').mockImplementation(async () => 22);\n    const binaryPath = '/mock-path/filename.mock';\n    await adb.remoteInstall(deviceId, binaryPath);\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(\n      adbBinPath,\n      ['-s', deviceId, 'shell', 'pm', 'install', '-rg', binaryPath],\n      expect.any(Object));\n  });\n\n  it('should remote-install (api≥22)', async () => {\n    jest.spyOn(adb, 'apiLevel').mockImplementation(async () => 23);\n    const binaryPath = '/mock-path/filename.mock';\n    await adb.remoteInstall(deviceId, binaryPath);\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(\n      adbBinPath,\n      ['-s', deviceId, 'shell', 'pm', 'install', '-r', '-g', '-t', binaryPath],\n      expect.any(Object));\n  });\n\n  it('should remote-install with proper spawning/retry options', async () => {\n    const expectedOptions = {\n      retries: 3,\n      timeout: 60000,\n      capture: ['stdout'],\n      encoding: 'utf8',\n    };\n    const binaryPath = '/mock-path/filename.mock';\n    await adb.install(deviceId, binaryPath);\n\n    expect(spawnWithRetriesAndLogs).toHaveBeenCalledWith(expect.any(String), expect.any(Array), expectedOptions);\n  });\n\n  it('global text-typing', async () => {\n    const text = 'some-text-with spaces';\n    const expectedText = 'some-text-with%sspaces';\n    await adb.typeText(deviceId, text);\n    expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n      expect.stringContaining(`-s mockEmulator shell \"input text ${expectedText}\"`),\n      expect.anything());\n  });\n\n  describe('unlockScreen', () => {\n    async function unlockScreenWithPowerStatus(mWakefulness, mUserActivityTimeoutOverrideFromWindowManager) {\n      jest.spyOn(adb, 'shell').mockImplementation(async () => `\n        mWakefulness=${mWakefulness}\n        mWakefulnessChanging=false\n        mWakeLockSummary=0x0\n        mUserActivitySummary=0x1\n        mWakeUpWhenPluggedOrUnpluggedConfig=false\n        mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false\n        mUserActivityTimeoutOverrideFromWindowManager=${mUserActivityTimeoutOverrideFromWindowManager}\n        mUserInactiveOverrideFromWindowManager=false\n      `);\n\n      await adb.unlockScreen(deviceId);\n    }\n\n    describe('when unlocking an awake and unlocked device', function() {\n      beforeEach(async () => unlockScreenWithPowerStatus('Awake', '-1'));\n\n      it('should not press power button', () =>\n        expect(adb.shell).not.toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_POWER'));\n\n      it('should not press menu button', () =>\n        expect(adb.shell).not.toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_MENU'));\n    });\n\n    describe('when unlocking a sleeping and locked device', function() {\n      beforeEach(async () => unlockScreenWithPowerStatus('Asleep', '10000'));\n\n      it('should press power button first', () =>\n        expect(adb.shell.mock.calls[1]).toEqual([deviceId, 'input keyevent KEYCODE_POWER']));\n\n      it('should press menu afterwards', () =>\n        expect(adb.shell.mock.calls[2]).toEqual([deviceId, 'input keyevent KEYCODE_MENU']));\n    });\n\n    describe('when unlocking an awake but locked device', function() {\n      beforeEach(async () => unlockScreenWithPowerStatus('Awake', '10000'));\n\n      it('should not press power button', () =>\n        expect(adb.shell).not.toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_POWER'));\n\n      it('should press menu button', () =>\n        expect(adb.shell).toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_MENU'));\n    });\n\n    describe('when unlocking a sleeping but unlocked device', function() {\n      beforeEach(async () => unlockScreenWithPowerStatus('Asleep', '-1'));\n\n      it('should press power button', () =>\n        expect(adb.shell).toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_POWER'));\n\n      it('should not press menu button', () =>\n        expect(adb.shell).not.toHaveBeenCalledWith(deviceId, 'input keyevent KEYCODE_MENU'));\n    });\n  });\n\n  describe('spawnInstrumentation', () => {\n    const testRunner = 'aTestRunner';\n\n    it('should spawn instrumentation', async () => {\n      const userArgs = [];\n      const expectedArgs = ['-s', deviceId, 'shell', 'am', 'instrument', '-w', '-r', testRunner];\n      await adb.spawnInstrumentation(deviceId, userArgs, testRunner);\n      expect(spawnAndLog).toHaveBeenCalledWith(adbBinPath, expectedArgs, expect.any(Object));\n    });\n\n    it('should pass through additional args', async () => {\n      const userArgs = ['-mock', '-args'];\n      await adb.spawnInstrumentation(deviceId, userArgs, testRunner);\n      expect(spawnAndLog).toHaveBeenCalledWith(adbBinPath, expect.arrayContaining([...userArgs, testRunner]), expect.any(Object));\n    });\n\n    it('should set detaching=false as spawn-options', async () => {\n      const expectedOptions = {\n        detached: false,\n      };\n      const userArgs = [];\n\n      await adb.spawnInstrumentation(deviceId, userArgs, testRunner);\n\n      expect(spawnAndLog).toHaveBeenCalledWith(adbBinPath, expect.any(Array), expectedOptions);\n    });\n\n    it('should chain-return the promise from spawn util', async () => {\n      const userArgs = [];\n      const mockPromise = Promise.resolve('mock');\n      spawnAndLog.mockReturnValue(mockPromise);\n\n      const childProcessPromise = adb.spawnInstrumentation(deviceId, userArgs, testRunner);\n      expect(childProcessPromise).toEqual(mockPromise);\n    });\n  });\n\n  it(`listInstrumentation passes the right deviceId`, async () => {\n    const deviceId = 'aDeviceId';\n    jest.spyOn(adb, 'shell');\n\n    await adb.listInstrumentation(deviceId);\n\n    expect(adb.shell).toHaveBeenCalledWith(deviceId, 'pm list instrumentation');\n  });\n\n  it(`getInstrumentationRunner parses the correct runner for the package`, async () => {\n    const expectedRunner = 'com.example.android.apis/.app.LocalSampleInstrumentation';\n    const expectedPackage = 'com.example.android.apis';\n    const instrumentationRunnersShellOutput =\n      'instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)\\n' +\n      'instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)\\n' +\n      `instrumentation:${expectedRunner} (target=${expectedPackage})\\n` +\n      'instrumentation:org.chromium.webview_shell/.WebViewLayoutTestRunner (target=org.chromium.webview_shell)\\n';\n\n    jest.spyOn(adb, 'shell').mockImplementation(async () => instrumentationRunnersShellOutput);\n\n    const result = await adb.getInstrumentationRunner('aDeviceId', expectedPackage);\n\n    expect(adb.shell).toHaveBeenCalledWith('aDeviceId', 'pm list instrumentation');\n    expect(result).toEqual(expectedRunner);\n  });\n\n  describe('animation disabling', () => {\n    it('should disable animator (e.g. ObjectAnimator) animations', async () => {\n      await adb.disableAndroidAnimations(deviceId);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\" -s ${deviceId} shell \"settings put global animator_duration_scale 0\"`, { retries: 1 });\n    });\n\n    it('should disable window animations', async () => {\n      await adb.disableAndroidAnimations(deviceId);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\" -s ${deviceId} shell \"settings put global window_animation_scale 0\"`, { retries: 1 });\n    });\n\n    it('should disable transition (e.g. activity launch) animations', async () => {\n      await adb.disableAndroidAnimations(deviceId);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\" -s ${deviceId} shell \"settings put global transition_animation_scale 0\"`, { retries: 1 });\n    });\n  });\n\n  describe('WiFi toggle', () => {\n    it('should enable wifi', async () => {\n      await adb.setWiFiToggle(deviceId, true);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\" -s ${deviceId} shell \"svc wifi enable\"`, { retries: 1 });\n    });\n\n    it('should disable wifi', async () => {\n      await adb.setWiFiToggle(deviceId, false);\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(`\"${adbBinPath}\" -s ${deviceId} shell \"svc wifi disable\"`, { retries: 1 });\n    });\n  });\n\n  describe('clearAppData', () => {\n    it('should invoke pm clear for given package', async () => {\n      await adb.clearAppData(deviceId, 'com.example.app');\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n        expect.stringContaining(`\"${adbBinPath}\" -s ${deviceId} shell \"pm clear com.example.app\"`),\n        expect.any(Object)\n      );\n    });\n\n    it('should throw an error if the package is not installed', async () => {\n      execWithRetriesAndLogs.mockRejectedValue('Command failed');\n      await expect(adb.clearAppData(deviceId, 'com.example.app')).rejects.toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('grantAllPermissions', () => {\n    it('should invoke pm grant --all-permissions for given package', async () => {\n      await adb.grantAllPermissions(deviceId, 'com.example.app');\n      expect(execWithRetriesAndLogs).toHaveBeenCalledWith(\n        expect.stringContaining(`\"${adbBinPath}\" -s ${deviceId} shell \"pm grant --all-permissions com.example.app\"`),\n        expect.any(Object)\n      );\n    });\n\n    it('should log warning on \"no permission specified\" error (older Android)', async () => {\n      execWithRetriesAndLogs.mockRejectedValueOnce({\n        stderr: 'Error: no permission specified',\n        message: 'Error: no permission specified',\n      });\n\n      await adb.grantAllPermissions(deviceId, 'com.example.app');\n\n      expect(logger.warn).toHaveBeenCalledWith(\n        'Cannot restore permissions after resetAppState(). Please update Android version to API 35 or higher.'\n      );\n    });\n\n    it('should re-throw unexpected errors', async () => {\n      const unexpectedError = new Error('Unexpected error');\n      execWithRetriesAndLogs.mockRejectedValueOnce(unexpectedError);\n\n      await expect(adb.grantAllPermissions(deviceId, 'com.example.app'))\n        .rejects.toThrow('Unexpected error');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/BinaryExec.js",
    "content": "const { execAsync, spawnAndLog } = require('../../../../../utils/childProcess');\n\nclass ExecCommand {\n  toString() {\n    return this._getArgsString();\n  }\n\n  _getArgs() {\n    return [];\n  }\n\n  _getArgsString() {\n    return this._getArgs().join(' ');\n  }\n}\n\nclass BinaryExec {\n  constructor(binary) {\n    this.binary = binary;\n  }\n\n  toString() {\n    return this.binary;\n  }\n\n  async exec(command) {\n    return await execAsync(`\"${this.binary}\" ${command._getArgsString()}`);\n  }\n\n  spawn(command, stdout, stderr) {\n    return spawnAndLog(this.binary, command._getArgs(), {\n      detached: true,\n      encoding: 'utf8',\n      stdio: ['ignore', stdout, stderr]\n    });\n  }\n}\n\nmodule.exports = {\n  ExecCommand,\n  BinaryExec\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/BinaryExec.test.js",
    "content": "/* eslint-disable node/no-extraneous-require */\ndescribe('BinaryExec', () => {\n  const binaryPath = '/binary/mock';\n\n  let exec;\n  let spawn;\n  let binaryExec;\n  beforeEach(() => {\n    jest.mock('../../../../../utils/childProcess', () => ({\n      execAsync: jest.fn().mockResolvedValue(''),\n      spawnAndLog: jest.fn()\n    }));\n    exec = require('../../../../../utils/childProcess').execAsync;\n    spawn = require('../../../../../utils/childProcess').spawnAndLog;\n\n    const { BinaryExec } = require('./BinaryExec');\n    binaryExec = new BinaryExec(binaryPath);\n  });\n\n  it('should return the binary-path as the toString()', async () => {\n    expect(binaryExec.toString()).toEqual(binaryPath);\n  });\n\n  describe('exec-command', () => {\n    it('exec-command should return args as toString()', () => {\n      const { ExecCommand } = require('./BinaryExec');\n      class MockExecCommand extends ExecCommand {\n        _getArgsString() {\n          return 'test args';\n        }\n      }\n\n      expect(new MockExecCommand().toString()).toEqual('test args');\n    });\n  });\n\n  describe('exec', () => {\n    it('should execute the binary with a real command', async () => {\n      const command = anEmptyCommand();\n\n      await binaryExec.exec(command);\n\n      expect(exec).toHaveBeenCalledWith(`\"${binaryPath}\" `);\n    });\n\n    it('should utilize command-args', async () => {\n      const command = aCommandMockWithArgsString('-mock -argz');\n\n      await binaryExec.exec(command);\n\n      expect(exec).toHaveBeenCalledWith(`\"${binaryPath}\" -mock -argz`);\n    });\n\n    it('should return content of resolved promise', async () => {\n      const execResult = 'mock stdout content';\n      exec.mockResolvedValue(execResult);\n\n      const { ExecCommand } = require('./BinaryExec');\n      const command = new ExecCommand();\n      const result = await binaryExec.exec(command);\n\n      expect(result).toEqual(execResult);\n    });\n  });\n\n  describe('spawn', () => {\n    it('should spawn the binary with a real command', async () => {\n      const command = anEmptyCommand();\n\n      await binaryExec.spawn(command);\n\n      expect(spawn).toHaveBeenCalledWith(binaryPath, expect.anything(), expect.anything());\n    });\n\n    it('should pass through command-args', async () => {\n      const commandArgs = ['-mock', '-args'];\n      const command = aCommandMockWithArgs(commandArgs);\n\n      await binaryExec.spawn(command);\n\n      expect(spawn).toHaveBeenCalledWith(binaryPath, commandArgs, expect.anything());\n    });\n\n    it('should chain-return spawn result', async () => {\n      const spawnResult = Promise.resolve('mock result');\n      spawn.mockReturnValue(spawnResult);\n\n      const command = anEmptyCommand();\n\n      const result = binaryExec.spawn(command);\n      expect(result).toEqual(spawnResult);\n    });\n  });\n});\n\nconst anEmptyCommand = () => {\n  const { ExecCommand } = require('./BinaryExec');\n  return new ExecCommand();\n};\n\nconst aCommandMockWithArgsString = (argsString) => {\n  const { ExecCommand } = jest.createMockFromModule('./BinaryExec');\n  const command = new ExecCommand();\n  command._getArgsString.mockReturnValue(argsString);\n  return command;\n};\n\nconst aCommandMockWithArgs = (commandArgs) => {\n  const { ExecCommand } = jest.createMockFromModule('./BinaryExec');\n  const command = new ExecCommand();\n  command._getArgs.mockReturnValue(commandArgs);\n  return command;\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/__mocks__/aapt-results.js",
    "content": "const dumpBadingResult = `package: name='com.wix.detox.test' versionCode='1' versionName='1.0' platformBuildVersionName='7.1.1'\nsdkVersion:'18'\ntargetSdkVersion:'25'\nuses-permission: name='android.permission.INTERNET'\nuses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'\nuses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'\nuses-permission: name='android.permission.READ_PHONE_STATE'\nuses-permission: name='android.permission.READ_EXTERNAL_STORAGE'\napplication-label:'Detox Test'\napplication-label-ca:'Detox Test'\napplication-label-da:'Detox Test'\napplication-label-fa:'Detox Test'\napplication-label-ja:'Detox Test'\napplication-label-nb:'Detox Test'\napplication-label-de:'Detox Test'\napplication-label-af:'Detox Test'\napplication-label-bg:'Detox Test'\napplication-label-th:'Detox Test'\napplication-label-fi:'Detox Test'\napplication-label-hi:'Detox Test'\napplication-label-vi:'Detox Test'\napplication-label-sk:'Detox Test'\napplication-label-uk:'Detox Test'\napplication-label-el:'Detox Test'\napplication-label-nl:'Detox Test'\napplication-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png'\napplication-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png'\napplication-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png'\napplication-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png'\napplication-icon-640:'res/mipmap-xxhdpi-v4/ic_launcher.png'\napplication: label='Detox Test' icon='res/mipmap-mdpi-v4/ic_launcher.png'\nlaunchable-activity: name='com.example.MainActivity'  label='Detox Test' icon=''\nfeature-group: label=''\n  uses-feature: name='android.hardware.touchscreen'\n  uses-implied-feature: name='android.hardware.touchscreen' reason='default feature for all apps'\nmain\nother-activities\nsupports-screens: 'small' 'normal' 'large' 'xlarge'\nsupports-any-density: 'true'\nlocales: '--_--' 'ca' 'da' 'fa' 'ja' 'nb' 'de' 'af' 'bg' 'th' 'fi' 'hi' 'vi' 'sk' 'uk' 'el' 'nl' 'pl' 'sl' 'tl' 'am' 'in' 'ko' 'ro' 'ar' 'fr' 'hr' 'sr' 'sr-Latn' 'tr' 'cs' 'es' 'it' 'lt' 'pt' 'hu' 'ru' 'zu' 'lv' 'sv' 'iw' 'sw' 'bs-BA' 'fr-CA' 'lo-LA' 'en-GB' 'bn-BD' 'et-EE' 'ka-GE' 'ky-KG' 'km-KH' 'zh-HK' 'si-LK' 'mk-MK' 'ur-PK' 'sq-AL' 'hy-AM' 'my-MM' 'zh-CN' 'pa-IN' 'ta-IN' 'te-IN' 'ml-IN' 'en-IN' 'kn-IN' 'mr-IN' 'gu-IN' 'mn-MN' 'ne-NP' 'pt-BR' 'gl-ES' 'eu-ES' 'is-IS' 'es-US' 'pt-PT' 'en-AU' 'zh-TW' 'be-BY' 'ms-MY' 'az-AZ' 'kk-KZ' 'uz-UZ'\ndensities: '160' '240' '320' '480' '640'\nnative-code: 'armeabi-v7a' 'x86'`;\n\nconst dumpXmlStringsResultTestAPK = `String pool of 59 unique UTF-16 non-sorted strings, 59 entries and 0 styles using 3144 bytes:\nString #0: theme\nString #1: label\nString #2: name\nString #46: instrumentation\nString #57: uses-permission\nString #58: uses-sdk`;\n\nconst dumpXmlStringResultProdAPK = `String pool of 59 unique UTF-16 non-sorted strings, 59 entries and 0 styles using 3144 bytes:\nString #0: theme\nString #1: label\nString #2: name\nString #57: uses-permission\nString #58: uses-sdk`;\n\nmodule.exports = {\n  dumpBadging: dumpBadingResult,\n  dumpXmlStrings: {\n    prodApk: dumpXmlStringResultProdAPK,\n    testApk: dumpXmlStringsResultTestAPK,\n  },\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/__snapshots__/AAPT.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`AAPT Checking whether APK holds instrumentation testing should execute the AAPT command with proper args 1`] = `\"\"escaped(mockSdk/build-tools/30.0.0/aapt)\" dump xmlstrings \"escaped(path/to/app.apk)\" AndroidManifest.xml\"`;\n\nexports[`AAPT Reading package name should execute the AAPT command with proper args 1`] = `\"\"escaped(mockSdk/build-tools/30.0.0/aapt)\" dump badging \"escaped(path/to/app.apk)\"\"`;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/exec/__snapshots__/ADB.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`ADB clearAppData should throw an error if the package is not installed 1`] = `\n\"Failed to clear com.example.app app data on mockEmulator\n\nHINT: Please verify that the package is installed on the device:\nadb -s mockEmulator shell pm list packages com.example.app\n\nCommand failed\"\n`;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/ApkValidator.js",
    "content": "const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\n\nconst setupGuideHint = 'For further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup';\n\nclass ApkValidator {\n  constructor(aapt) {\n    this._aapt = aapt;\n  }\n\n  async validateAppApk(binaryPath) {\n    let isAppApk;\n\n    try {\n      isAppApk = !await this._aapt.isTestAPK(binaryPath);\n    } catch (e) {\n      throw this._composeAaptBasedError(e, binaryPath, 'binary');\n    }\n\n    if (!isAppApk) {\n      throw new DetoxRuntimeError({\n        message: `App APK at path ${binaryPath} was detected as the *test* APK!`,\n        hint: `Your binary path was probably wrongly set in the active Detox configuration.\\n${setupGuideHint}`,\n      });\n    }\n  }\n\n  async validateTestApk(binaryPath) {\n    let isTestApk;\n    try {\n      isTestApk = await this._aapt.isTestAPK(binaryPath);\n    } catch (e) {\n      throw this._composeAaptBasedError(e, binaryPath, 'test-binary');\n    }\n\n    if (!isTestApk) {\n      throw new DetoxRuntimeError({\n        message: `Test APK at path ${binaryPath} was detected as the *app* APK!`,\n        hint: `Your test test-binary path was probably wrongly set in the active Detox configuration.\\n${setupGuideHint}`,\n      });\n    }\n  }\n\n  _composeAaptBasedError(aaptError, binaryPath, configKeyType) {\n    return new DetoxRuntimeError({\n      message: `Failed to get details about the APK at path ${binaryPath}. Root cause:\\n${aaptError}`,\n      hint: `Check that the ${configKeyType} path in the active Detox configuration has been set to a path of an APK file.\\n${setupGuideHint}`,\n    });\n  }\n\n}\n\nmodule.exports = ApkValidator;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/ApkValidator.test.js",
    "content": "\ndescribe('APK validation', () => {\n\n  const binaryPath = 'mock-bin-path';\n  const testBinaryPath = 'mock-test-bin-path';\n\n  let aapt;\n  let uut;\n  beforeEach(() => {\n    const AAPT = jest.createMockFromModule('../exec/AAPT');\n    aapt = new AAPT();\n\n    const ApkValidator = require('./ApkValidator');\n    uut = new ApkValidator(aapt);\n  });\n\n  const givenAAPTResult = (result) => aapt.isTestAPK.mockResolvedValue(result);\n  const givenAAPTError = (error) => aapt.isTestAPK.mockRejectedValue(error);\n\n  describe('App APK validation', () => {\n    it('should validate the APK is not a test APK', async () => {\n      givenAAPTResult(false);\n      await uut.validateAppApk(binaryPath);\n      expect(aapt.isTestAPK).toHaveBeenCalledWith(binaryPath);\n    });\n\n    it('should throw a descriptive error if app APK happens to be a test APK', async () => {\n      givenAAPTResult(true);\n      await expect(uut.validateAppApk(binaryPath)).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw a specific error if AAPT throws', async () => {\n      givenAAPTError(new Error('mock error'));\n      await expect(uut.validateAppApk(binaryPath)).rejects.toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('Test APK validation', () => {\n    it('should validate the APK is indeed a test APK', async () => {\n      givenAAPTResult(true);\n      await uut.validateTestApk(testBinaryPath);\n      expect(aapt.isTestAPK).toHaveBeenCalledWith(testBinaryPath);\n    });\n\n    it('should throw a descriptive error if APK happens to be an app APK', async () => {\n      givenAAPTResult(false);\n      await expect(uut.validateTestApk(testBinaryPath)).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw a specific error if AAPT throws', async () => {\n      givenAAPTError(new Error('mock error'));\n      await expect(uut.validateTestApk(testBinaryPath)).rejects.toThrowErrorMatchingSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/AppInstallHelper.js",
    "content": "class AppInstallHelper {\n  constructor(adb, fileTransfer) {\n    this._adb = adb;\n    this._fileTransfer = fileTransfer;\n  }\n\n  async install(deviceId, appBinaryPath, testBinaryPath) {\n    await this._fileTransfer.prepareDestinationDir(deviceId);\n    await this._pushAndInstallBinary(deviceId, appBinaryPath, 'Application.apk');\n    if (testBinaryPath) {\n      await this._pushAndInstallBinary(deviceId, testBinaryPath, 'Test.apk');\n    }\n  }\n\n  async _pushAndInstallBinary(deviceId, binaryPath, binaryFilenameOnTarget) {\n    const binaryPathOnTarget = await this._fileTransfer.send(deviceId, binaryPath, binaryFilenameOnTarget);\n    await this._adb.remoteInstall(deviceId, binaryPathOnTarget);\n  }\n}\n\nmodule.exports = AppInstallHelper;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/AppInstallHelper.test.js",
    "content": "const deviceId = 'mock-device-id';\nconst appBinaryPath = '/mock-app-binary-path/binary.apk';\nconst testBinaryPath = '/mock-test-binary-path/test/binary.apk';\n\ndescribe('Android app installation helper', () => {\n  let adb;\n\n  beforeEach(() => {\n    const ADBMock = jest.createMockFromModule('../exec/ADB');\n    adb = new ADBMock();\n  });\n\n  let fileTransfer;\n  let uut;\n  beforeEach(() => {\n    const FileTransfer = jest.createMockFromModule('./FileTransfer');\n    fileTransfer = new FileTransfer(adb, '/mock-destination-dir');\n\n    const AppInstallHelper = require('./AppInstallHelper');\n    uut = new AppInstallHelper(adb, fileTransfer);\n  });\n\n  it('should recreate the transient dir on the device', async () => {\n    await uut.install(deviceId, appBinaryPath, testBinaryPath);\n    expect(fileTransfer.prepareDestinationDir).toHaveBeenCalledWith(deviceId);\n  });\n\n  it('should throw if transient dir prep fails', async () => {\n    fileTransfer.prepareDestinationDir.mockRejectedValue(new Error('mocked error in adb-shell'));\n\n    await expect(uut.install(deviceId, appBinaryPath, testBinaryPath)).rejects.toThrow();\n  });\n\n  it('should push app-binary file to the device', async () => {\n    await uut.install(deviceId, appBinaryPath, testBinaryPath);\n    expect(fileTransfer.send).toHaveBeenCalledWith(deviceId, appBinaryPath, 'Application.apk');\n  });\n\n  it('should push test-binary file to the device', async () => {\n    await uut.install(deviceId, appBinaryPath, testBinaryPath);\n    expect(fileTransfer.send).toHaveBeenCalledWith(deviceId, testBinaryPath, 'Test.apk');\n  });\n\n  it('should break if file push fails', async () => {\n    fileTransfer.send.mockRejectedValue(new Error('mocked error in adb-push'));\n\n    await expect(uut.install(deviceId, appBinaryPath, testBinaryPath)).rejects.toThrow();\n  });\n\n  it('should remote-install both binaries via shell', async () => {\n    fileTransfer.send\n      .mockReturnValueOnce('/mocked-final-dir/first.apk')\n      .mockReturnValueOnce('/mocked-final-dir/second.apk');\n\n    await uut.install(deviceId, appBinaryPath, testBinaryPath);\n    expect(adb.remoteInstall).toHaveBeenCalledWith(deviceId, '/mocked-final-dir/first.apk');\n    expect(adb.remoteInstall).toHaveBeenCalledWith(deviceId, '/mocked-final-dir/second.apk');\n  });\n\n  it('should break if remote-install fails', async () => {\n    adb.remoteInstall.mockRejectedValue(new Error('mocked error in remote-install'));\n\n    await expect(uut.install(deviceId, appBinaryPath, testBinaryPath)).rejects.toThrow();\n  });\n\n  it('should allow for an install with no test binary', async () => {\n    fileTransfer.send\n      .mockReturnValueOnce('/mocked-final-dir/first.apk')\n      .mockReturnValueOnce('/mocked-final-dir/second.apk');\n\n    await uut.install(deviceId, appBinaryPath, undefined);\n    expect(fileTransfer.send).toHaveBeenCalledTimes(1);\n    expect(adb.remoteInstall).toHaveBeenCalledWith(deviceId, '/mocked-final-dir/first.apk');\n    expect(adb.remoteInstall).toHaveBeenCalledTimes(1);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/AppUninstallHelper.js",
    "content": "class AppUninstallHelper {\n  constructor(adb) {\n    this._adb = adb;\n  }\n\n  async uninstall(deviceId, bundleId) {\n    if (await this._adb.isPackageInstalled(deviceId, bundleId)) {\n      await this._adb.uninstall(deviceId, bundleId);\n    }\n\n    const testBundleId = `${bundleId}.test`;\n    if (await this._adb.isPackageInstalled(deviceId, testBundleId)) {\n      await this._adb.uninstall(deviceId, testBundleId);\n    }\n  }\n}\n\nmodule.exports = AppUninstallHelper;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/AppUninstallHelper.test.js",
    "content": "const deviceId = 'mock-device-id';\nconst bundleId = 'mock-bundle-id';\nconst testBundleId = 'mock-bundle-id.test';\n\ndescribe('Android app uninstall helper', () => {\n  let adb;\n  beforeEach(() => {\n    const ADBClass = jest.createMockFromModule('../exec/ADB');\n    adb = new ADBClass();\n    adb.isPackageInstalled.mockResolvedValue(true);\n  });\n\n  let uut;\n  beforeEach(() => {\n    const AppUninstallHelper = require('./AppUninstallHelper');\n    uut = new AppUninstallHelper(adb);\n  });\n\n  it('should uninstall the app\\'s binary using adb', async () => {\n    await uut.uninstall(deviceId, bundleId);\n    expect(adb.uninstall).toHaveBeenCalledWith(deviceId, bundleId);\n  });\n\n  it('should fail if app uninstall fails', async () => {\n    adb.uninstall.mockRejectedValue(new Error('mocked error in adb.uninstall'));\n    await expect(uut.uninstall(deviceId, bundleId)).rejects.toThrow();\n  });\n\n  it('should avoid uninstalling app if not already installed', async () => {\n    adb.isPackageInstalled.mockResolvedValue(false);\n\n    await uut.uninstall(deviceId, bundleId);\n\n    expect(adb.isPackageInstalled).toHaveBeenCalledWith(deviceId, bundleId);\n    expect(adb.uninstall).not.toHaveBeenCalledWith(deviceId, bundleId);\n  });\n\n  it('should uninstall the test binary using adb', async () => {\n    await uut.uninstall(deviceId, bundleId);\n    expect(adb.uninstall).toHaveBeenCalledWith(deviceId, testBundleId);\n  });\n\n  it('should fail if test binary uninstall fails', async () => {\n    adb.uninstall\n      .mockResolvedValueOnce(true)\n      .mockRejectedValueOnce(new Error('mocked error in adb.uninstall'));\n\n    await expect(uut.uninstall(deviceId, bundleId)).rejects.toThrow();\n  });\n\n  it('should avoid uninstalling test binary if not already installed', async () => {\n    adb.isPackageInstalled\n      .mockResolvedValueOnce(true)\n      .mockResolvedValueOnce(false);\n\n    await uut.uninstall(deviceId, bundleId);\n\n    expect(adb.isPackageInstalled).toHaveBeenCalledWith(deviceId, testBundleId);\n    expect(adb.uninstall).not.toHaveBeenCalledWith(deviceId, testBundleId);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/DeviceHandle.js",
    "content": "class DeviceHandle {\n  constructor(deviceString) {\n    const [adbName, status] = deviceString.split('\\t');\n    this.type = this._inferDeviceType(adbName);\n    this.adbName = adbName;\n    this.status = status;\n  }\n\n  _inferDeviceType(adbName) {\n    if (adbName.startsWith('emulator-')) {\n      return 'emulator';\n    }\n\n    if (/^((1?\\d?\\d|25[0-5]|2[0-4]\\d)(\\.|:)){4}[0-9]{4}/.test(adbName)) {\n      return 'genymotion';\n    }\n\n    return 'device';\n  }\n}\n\nmodule.exports = DeviceHandle;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/DeviceHandle.test.js",
    "content": "describe('Device-handle', () => {\n\n  let DeviceHandle;\n  beforeEach(() => {\n    DeviceHandle = require('./DeviceHandle');\n  });\n\n  const deviceHandle = (adbName, status) => new DeviceHandle(`${adbName}\\t${status}`);\n\n  it('should extract the device\\'s adb name', () => {\n    const uut = deviceHandle('mockdevice', 'online');\n    expect(uut.adbName).toEqual('mockdevice');\n  });\n\n  it('should extract the device status', () => {\n    const uut = deviceHandle('mockdevice', 'mockstatus');\n    expect(uut.status).toEqual('mockstatus');\n  });\n\n  it('should deduce: device-type = emulator', () => {\n    expect(deviceHandle('emulator-5554', 'mockstatus').type).toEqual('emulator');\n  });\n\n  it('should deduce: device-type = genymotion', () => {\n    expect(deviceHandle('127.0.0.1:1234', 'mockstatus').type).toEqual('genymotion');\n    expect(deviceHandle('192.168.60.101:6666', 'mockstatus').type).toEqual('genymotion');\n  });\n\n  it('should deduce: device-type = device, as the default', () => {\n    expect(deviceHandle('MOCK_SERIAL', 'mockstatus').type).toEqual('device');\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/EmulatorHandle.js",
    "content": "const DeviceHandle = require('./DeviceHandle');\nconst EmulatorTelnet = require('./EmulatorTelnet');\n\nclass EmulatorHandle extends DeviceHandle {\n  constructor(deviceString) {\n    super(deviceString);\n    this._telnet = new EmulatorTelnet();\n\n    this.port = this.adbName.split('-')[1];\n  }\n\n  /* async */ queryName() {\n    if (!this._namePromise) {\n      this._namePromise = this._queryNameViaTelnet();\n    }\n    return this._namePromise;\n  }\n\n  async _queryNameViaTelnet() {\n    await this._telnet.connect(this.port);\n    try {\n      return await this._telnet.avdName();\n    } finally {\n      await this._telnet.quit();\n    }\n  }\n}\n\nmodule.exports = EmulatorHandle;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/EmulatorHandle.test.js",
    "content": "describe('Emulator handle', () => {\n\n  let EmulatorHandle;\n  let EmulatorTelnet;\n  beforeEach(() => {\n    jest.mock('./EmulatorTelnet');\n    EmulatorTelnet = require('./EmulatorTelnet');\n    EmulatorHandle = require('./EmulatorHandle');\n  });\n\n  const emulatorHandle = (adbName, status) => new EmulatorHandle(`${adbName}\\t${status}`);\n\n  it('should extract the name and status', () => {\n    const uut = emulatorHandle('emulator-6667', 'mock-status');\n    expect(uut.adbName).toEqual('emulator-6667');\n    expect(uut.status).toEqual('mock-status');\n  });\n\n  it('should extract the emulator\\'s port', () => {\n    const uut = emulatorHandle('emulator-1234', 'offline');\n    expect(uut.port).toEqual('1234');\n  });\n\n  describe('Device name querying via telnet', () => {\n    let uut;\n    let telnet;\n    beforeEach(() => {\n      uut = emulatorHandle('emulator-2345', 'offline');\n      telnet = EmulatorTelnet.mock.instances[0];\n    });\n\n    it('should telnet-connect', async () => {\n      await uut.queryName();\n      expect(telnet.connect).toHaveBeenCalledWith('2345');\n    });\n\n    it('should fail if telnet-connect fails', async () => {\n      telnet.connect.mockRejectedValue(new Error('mock telnet error'));\n      await expect(uut.queryName()).rejects.toThrow();\n    });\n\n    it('should return name from telnet command', async () => {\n      const avdName = 'mock AVD';\n      telnet.avdName.mockReturnValue(avdName);\n\n      const result = await uut.queryName();\n      expect(result).toEqual(avdName);\n    });\n\n    it('should close telnet when done', async () => {\n      await uut.queryName();\n      expect(telnet.quit).toHaveBeenCalled();\n    });\n\n    it('should close telnet even if name resolution fails', async () => {\n      telnet.avdName.mockRejectedValue(new Error('mock name resolution error'));\n\n      await expect(uut.queryName()).rejects.toThrow();\n      expect(telnet.quit).toHaveBeenCalled();\n    });\n\n    it('should only query once', async () => {\n      const avdName = 'mock AVD';\n      telnet.avdName\n        .mockReturnValueOnce(avdName)\n        .mockReturnValueOnce('some other name');\n\n      await uut.queryName();\n      const result = await uut.queryName();\n      expect(result).toEqual(avdName);\n      expect(telnet.avdName).toHaveBeenCalledTimes(1);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/EmulatorTelnet.js",
    "content": "// @ts-nocheck\nconst os = require('os');\nconst path = require('path');\n\nconst fs = require('fs-extra');\nconst Telnet = require('telnet-client');\n\nconst log = require('../../../../../utils/logger').child({ cat: 'device' });\n\nclass EmulatorTelnet {\n  constructor() {\n    this.connection = new Telnet();\n    this.connection.on('timeout', () => log.error({ event: 'TELNET_TIMEOUT' }));\n    this.connection.on('error', (err) => log.error({ event: 'TELNET_ERROR', err }));\n  }\n\n  async connect(port) {\n    const params = {\n      host: 'localhost',\n      port: port,\n      shellPrompt: /^OK$/m,\n      timeout: 1500,\n      execTimeout: 1500,\n      sendTimeout: 1500,\n      echoLines: -2,\n      stripShellPrompt: true\n    };\n\n    log.trace({ event: 'TELNET_CONNECTING' }, `port: ${port}, host: ${params.host}`);\n    await this.connection.connect(params);\n    const auth = await fs.readFile(path.join(os.homedir(), '.emulator_console_auth_token'), 'utf8');\n    await this.exec(`auth ${auth}`);\n  }\n\n  async exec(command) {\n    let res = await this.connection.exec(`${command}`);\n    res = res.split('\\n')[0];\n    return res;\n  }\n\n  async shell(command) {\n    return new Promise((resolve) => {\n      this.connection.shell((error, stream) => {\n        stream.write(`${command}\\n`);\n        stream.on('data', (data) => {\n            const result = data.toString();\n            if (result.includes('\\n')) {\n              resolve(result);\n            }\n          }\n        );\n      });\n    });\n  }\n\n  async avdName() {\n    return this.exec('avd name');\n  }\n\n  async kill() {\n    await this.shell('kill');\n    await this.quit();\n  }\n\n  async quit() {\n    await this.connection.end();\n    await this.connection.destroy();\n  }\n\n  async rotate() {\n    return this.shell('rotate');\n  }\n}\n\nmodule.exports = EmulatorTelnet;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/FileTransfer.js",
    "content": "const path = require('path');\n\nclass FileTransfer {\n  constructor(adb, destinationDir) {\n    this._adb = adb;\n    this._dir = destinationDir;\n  }\n\n  async prepareDestinationDir(deviceId) {\n    await this._adb.shell(deviceId, `rm -fr ${this._dir}`);\n    await this._adb.shell(deviceId, `mkdir -p ${this._dir}`);\n  }\n\n  async send(deviceId, sourcePath, destinationFilename) {\n    const destinationPath = path.posix.join(this._dir, destinationFilename);\n    await this._adb.push(deviceId, sourcePath, destinationPath);\n    return destinationPath;\n  }\n}\n\nmodule.exports = FileTransfer;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/FileTransfer.test.js",
    "content": "const deviceId = 'mock-device-id';\nconst deviceDestinationDir = '/mock-tmp-dir';\n\ndescribe('File-transfer util', () => {\n  let adb;\n  let uut;\n\n  beforeEach(() => {\n    const ADBMock = jest.createMockFromModule('../exec/ADB');\n    adb = new ADBMock();\n\n    const FileTransfer = require('./FileTransfer');\n    uut = new FileTransfer(adb, deviceDestinationDir);\n  });\n\n  it('should create the destination directory on the device', async () => {\n    await uut.prepareDestinationDir(deviceId);\n\n    expect(adb.shell).toHaveBeenCalledWith(deviceId, `rm -fr ${deviceDestinationDir}`);\n    expect(adb.shell).toHaveBeenCalledWith(deviceId, `mkdir -p ${deviceDestinationDir}`);\n  });\n\n  it('should send a file by path', async () => {\n    const sourcePath = '/source/path/source-file.src';\n    const destFilename = 'dest-file.dst';\n\n    await uut.send(deviceId, sourcePath, destFilename);\n\n    expect(adb.push).toHaveBeenCalledWith(deviceId, sourcePath, '/mock-tmp-dir/dest-file.dst');\n  });\n\n  it('should return final destination path', async () => {\n    const sourcePath = '/source/path/source-file.src';\n    const destFilename = 'dest-file.dst';\n\n    const destPath = await uut.send(deviceId, sourcePath, destFilename);\n\n    expect(destPath).toEqual(`${deviceDestinationDir}/${destFilename}`);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/Instrumentation.js",
    "content": "const _ = require('lodash');\n\nconst { interruptProcess } = require('../../../../../utils/childProcess');\n\nconst { prepareInstrumentationArgs } = require('./instrumentationArgs');\n\nclass Instrumentation {\n  constructor(adb, logger, userTerminationFn = _.noop, userLogListenFn = _.noop) {\n    this.adb = adb;\n    this.logger = logger;\n    this.userTerminationFn = userTerminationFn;\n    this.userLogListenFn = userLogListenFn;\n    this.instrumentationProcess = null;\n    this._onTerminated = this._onTerminated.bind(this);\n    this._onLogData = this._onLogData.bind(this);\n  }\n\n  async launch(deviceId, bundleId, userLaunchArgs) {\n    const spawnArgs = this._getSpawnArgs(userLaunchArgs);\n\n    const testRunner = await this.adb.getInstrumentationRunner(deviceId, bundleId);\n\n    this.instrumentationProcess = this.adb.spawnInstrumentation(deviceId, spawnArgs, testRunner);\n    this.instrumentationProcess.childProcess.stdout.setEncoding('utf8');\n    this.instrumentationProcess.childProcess.stdout.on('data', this._onLogData);\n    this.instrumentationProcess.childProcess.on('close', this._onTerminated);\n  }\n\n  async terminate() {\n    if (this.instrumentationProcess) {\n      await this._killProcess();\n    }\n  }\n\n  isRunning() {\n    return !!this.instrumentationProcess;\n  }\n\n  _getSpawnArgs(userLaunchArgs) {\n    const launchArgs = prepareInstrumentationArgs(userLaunchArgs);\n    const additionalLaunchArgs = prepareInstrumentationArgs({ debug: false });\n    this._warnReservedArgsUsedIfNeeded(launchArgs);\n\n    return [...launchArgs.args, ...additionalLaunchArgs.args];\n  }\n\n  async _onLogData(data) {\n    await this.userLogListenFn(data);\n  }\n\n  async _onTerminated() {\n    if (this.instrumentationProcess) {\n      await this._killProcess();\n      await this.userTerminationFn();\n    }\n  }\n\n  async _killProcess() {\n    await interruptProcess(this.instrumentationProcess);\n    this.instrumentationProcess = null;\n  }\n\n  _warnReservedArgsUsedIfNeeded(preparedArgs) {\n    if (preparedArgs.usedReservedArgs.length) {\n      this.logger.warn([`Arguments [${preparedArgs.usedReservedArgs}] were passed in as launchArgs to device.launchApp() `,\n        'but are reserved to Android\\'s test-instrumentation and will not be passed into the app. ',\n        'Ignore this message if this is what you meant to do. Refer to ',\n        'https://developer.android.com/studio/test/command-line#AMOptionsSyntax for ',\n        'further details.'].join(''));\n    }\n  }\n}\n\nmodule.exports = Instrumentation;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/Instrumentation.test.js",
    "content": "// @ts-nocheck\ndescribe('Instrumentation', () => {\n  const deviceId = 'mock-device-id';\n  const bundleId = 'mock-bundle-id';\n\n  let childProcessUtils;\n  let adb;\n  let instrumentationArgs;\n  let logger;\n  beforeEach(() => {\n    const ADB = jest.createMockFromModule('../exec/ADB');\n    adb = new ADB();\n\n    jest.mock('../../../../../utils/childProcess');\n    childProcessUtils = require('../../../../../utils/childProcess');\n\n    jest.mock('./instrumentationArgs');\n    instrumentationArgs = require('./instrumentationArgs');\n    instrumentationArgs.prepareInstrumentationArgs.mockReturnValue({ args: [], usedReservedArgs: [] });\n\n    logger = {\n      warn: jest.fn(),\n    };\n  });\n\n  let childProcess;\n  let instrumentationProcess;\n  let logListenCallback;\n  let userTerminationCallback;\n  let uut;\n  beforeEach(() => {\n    childProcess = {\n      on: jest.fn(),\n      stdout: {\n        setEncoding: jest.fn(),\n        on: jest.fn(),\n      },\n    };\n    instrumentationProcess = {\n      childProcess,\n    };\n    adb.spawnInstrumentation.mockReturnValue(instrumentationProcess);\n\n    logListenCallback = jest.fn();\n    userTerminationCallback = jest.fn();\n\n    const Instrumentation = require('./Instrumentation');\n    uut = new Instrumentation(adb, logger, userTerminationCallback, logListenCallback);\n  });\n\n  it('should spawn Android instrumentation with device ID', async () => {\n    await uut.launch(deviceId, bundleId, []);\n    expect(adb.spawnInstrumentation).toHaveBeenCalledWith(deviceId, expect.anything(), undefined);\n  });\n\n  it('should spawn instrumentation with test runner', async () => {\n    const testRunner = 'mock-android-test-runner-name';\n    adb.getInstrumentationRunner.mockResolvedValue(testRunner);\n\n    await uut.launch(deviceId, bundleId, []);\n    expect(adb.spawnInstrumentation).toHaveBeenCalledWith(expect.anything(), expect.anything(), testRunner);\n    expect(adb.getInstrumentationRunner).toHaveBeenCalledWith(deviceId, bundleId);\n  });\n\n  describe('spawning launch-arguments processing', () => {\n    it('should prepare user launch-arguments', async () => {\n      instrumentationArgs.prepareInstrumentationArgs.mockReturnValue({ args: [], usedReservedArgs: [] });\n      const userArgs = {\n        arg1: 'value1',\n      };\n      await uut.launch(deviceId, bundleId, userArgs);\n\n      expect(instrumentationArgs.prepareInstrumentationArgs).toHaveBeenCalledWith(userArgs);\n    });\n\n    it('should prepare forced debug=false launch argument', async () => {\n      instrumentationArgs.prepareInstrumentationArgs.mockReturnValue({ args: [], usedReservedArgs: [] });\n      await uut.launch(deviceId, bundleId, { });\n      expect(instrumentationArgs.prepareInstrumentationArgs).toHaveBeenCalledWith({ debug: false });\n    });\n\n    it('should spawn instrumentation with processed user launch-arguments', async () => {\n      const mockedPreparedUserArgs = ['mocked', 'prepared-args'];\n      const mockedPreparedDebugArg = ['debug', 'mocked'];\n      instrumentationArgs.prepareInstrumentationArgs\n        .mockReturnValueOnce({ args: mockedPreparedUserArgs, usedReservedArgs: [] })\n        .mockReturnValueOnce({ args: mockedPreparedDebugArg, usedReservedArgs: [] });\n\n      await uut.launch(deviceId, bundleId, {});\n      expect(adb.spawnInstrumentation).toHaveBeenCalledWith(expect.anything(), [...mockedPreparedUserArgs, ...mockedPreparedDebugArg], undefined);\n    });\n\n    it('should log reserved instrumentation args usage if used in user args', async () => {\n      const mockedPreparedUserArgs = ['mocked', 'prepared-args'];\n      const mockedPreparedDebugArg = ['debug', 'mocked'];\n      const usedReservedArgs = ['aaa', 'zzz'];\n      instrumentationArgs.prepareInstrumentationArgs\n        .mockReturnValueOnce({ args: mockedPreparedUserArgs, usedReservedArgs })\n        .mockReturnValueOnce({ args: mockedPreparedDebugArg, usedReservedArgs: ['shouldnt', 'care'] });\n\n      await uut.launch(deviceId, bundleId, {});\n\n      expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('Arguments [aaa,zzz] were passed in as launchArgs to device.launchApp()'));\n      expect(logger.warn).toHaveBeenCalledTimes(1);\n    });\n\n    it('should NOT log reserved instrumentation args usage if none used by user', async () => {\n      const mockedPreparedUserArgs = ['mocked', 'prepared-args'];\n      const mockedPreparedDebugArg = ['debug', 'mocked'];\n      instrumentationArgs.prepareInstrumentationArgs\n        .mockReturnValueOnce({ args: mockedPreparedUserArgs, usedReservedArgs: [] })\n        .mockReturnValueOnce({ args: mockedPreparedDebugArg, usedReservedArgs: ['shouldnt', 'care'] });\n\n      await uut.launch(deviceId, bundleId, {});\n\n      expect(logger.warn).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('instrumentation child-process unplanned termination', () => {\n    it('should terminate instrumentation', async () => {\n      await uut.launch(deviceId, bundleId, []);\n\n      expect(childProcess.on).toHaveBeenCalledWith('close', expect.any(Function));\n\n      await invokeTerminationCallback();\n      expect(childProcessUtils.interruptProcess).toHaveBeenCalledWith(instrumentationProcess);\n    });\n\n    it('should fail if termination callback breaks', async () => {\n      childProcessUtils.interruptProcess.mockRejectedValue(new Error());\n\n      await uut.launch(deviceId, bundleId, []);\n      await expect(invokeTerminationCallback()).rejects.toThrow();\n    });\n\n    it('should not terminate if dispatched twice', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await invokeTerminationCallback();\n      await invokeTerminationCallback();\n      expect(childProcessUtils.interruptProcess).toHaveBeenCalledTimes(1);\n    });\n\n    it('should exec user\\'s top-level custom termination callback', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await invokeTerminationCallback();\n      expect(userTerminationCallback).toHaveBeenCalled();\n    });\n  });\n\n  describe('user-initiated termination', () => {\n    it('should terminate upon a termination API call', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await uut.terminate();\n      expect(childProcessUtils.interruptProcess).toHaveBeenCalledWith(instrumentationProcess);\n    });\n\n    it('should break if process interruption fails', async () => {\n      childProcessUtils.interruptProcess.mockRejectedValue(new Error());\n      await uut.launch(deviceId, bundleId, []);\n      await expect(uut.terminate()).rejects.toThrow();\n    });\n\n    it('should not terminate if not running', async () => {\n      await uut.terminate();\n      expect(childProcessUtils.interruptProcess).not.toHaveBeenCalled();\n    });\n\n    it('should not terminate if already terminated', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await uut.terminate();\n      await uut.terminate();\n      expect(childProcessUtils.interruptProcess).toHaveBeenCalledTimes(1);\n    });\n\n    it('should NOT exec user\\'s top-level custom termination callback', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await uut.terminate();\n      expect(userTerminationCallback).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('instrumentation run-status querying', () => {\n    it('should be true when running', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      expect(uut.isRunning()).toEqual(true);\n    });\n\n    it('should false if terminated', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      await uut.terminate();\n      expect(uut.isRunning()).toEqual(false);\n    });\n  });\n\n  describe('instrumentation output-log tapping', () => {\n    it('should be made possible to tap into, with utf-8 encoding', async () => {\n      await uut.launch(deviceId, bundleId, []);\n      expect(childProcess.stdout.on).toHaveBeenCalledWith('data', expect.any(Function));\n      expect(childProcess.stdout.setEncoding).toHaveBeenCalledWith('utf8');\n\n      await invokeDataCallbackWith('mock data');\n      expect(logListenCallback).toHaveBeenCalledWith('mock data');\n    });\n  });\n\n  it('should work with no user callbacks registration', async () => {\n    const Instrumentation = require('./Instrumentation');\n    uut = new Instrumentation(adb, logger, undefined, undefined);\n    await uut.launch(deviceId, bundleId, []);\n    await uut.terminate();\n  });\n\n  const extractDataCallback = () => childProcess.stdout.on.mock.calls[0][1];\n  const invokeDataCallbackWith = async (data) => {\n    const fn = extractDataCallback();\n    await fn(data);\n  };\n\n  const extractTerminationCallback = () => childProcess.on.mock.calls[0][1];\n  const invokeTerminationCallback = async () => {\n    const terminationFn = extractTerminationCallback();\n    await terminationFn();\n  };\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/InstrumentationLogsParser.js",
    "content": "const _ = require('lodash');\n\nconst LOG_PREFIX = 'INSTRUMENTATION_STATUS';\nconst START_WITH_PREFIX = new RegExp(`^${LOG_PREFIX}(?:_[A-Z]+)*:[\\\\s]+`, 'm');\nconst STACKTRACE_PREFIX = 'stack=';\n\nclass InstrumentationLogsParser {\n  constructor() {\n    this._partialLog = undefined;\n    this._stackTrace = undefined;\n  }\n\n  parse(logsDump) {\n    this._analyzeLogs(logsDump);\n  }\n\n  containsStackTraceLog() {\n    return !_.isUndefined(this._stackTrace);\n  }\n\n  getStackTrace() {\n    return this._stackTrace || '';\n  }\n\n  _analyzeLogs(_logsDump) {\n    const logsDump = this._partialLog ? this._partialLog.concat(_logsDump) : _logsDump;\n    const logs = logsDump.split(START_WITH_PREFIX);\n    this._extractStackTraceLogIfExists(logs);\n    this._keepPartialLogIfNeeded(logs);\n  }\n\n  _extractStackTraceLogIfExists(logs) {\n    const stackTraceLogs = logs.filter(this._verifyStackTraceLog);\n    if (!_.isEmpty(stackTraceLogs)) {\n      this._stackTrace = _.last(stackTraceLogs).replace(STACKTRACE_PREFIX, '').trim().concat('\\n');\n    }\n  }\n\n  _keepPartialLogIfNeeded(logs) {\n    const lastLog = _.last(logs);\n    if (this._isPartialLog(lastLog)) {\n      this._partialLog = lastLog;\n    }\n  }\n\n  _verifyStackTraceLog(log) {\n    return log.startsWith(STACKTRACE_PREFIX) && log.endsWith('\\n\\n');\n  }\n\n  _isPartialLog(log) {\n    return (\n      this._isPartialStackTraceLog(log) ||\n      this._isPartialAnyLog(log)\n    );\n  }\n\n  _isPartialStackTraceLog(log) {\n    return log.startsWith(STACKTRACE_PREFIX) && !log.endsWith('\\n\\n');\n  }\n\n  _isPartialAnyLog(log) {\n    return !log.endsWith('\\n');\n  }\n}\n\nmodule.exports = {\n  InstrumentationLogsParser\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/InstrumentationLogsParser.test.js",
    "content": "describe('Instrumentation logs parser', () => {\n  describe('stack trace parser', () => {\n    let uut;\n    beforeEach(() => {\n      const { InstrumentationLogsParser } = require('./InstrumentationLogsParser');\n      uut = new InstrumentationLogsParser();\n    });\n\n    it('should query stacktrace for false for a no-string', () => {\n      const logsDump = '';\n      uut.parse(logsDump);\n      expect(uut.containsStackTraceLog()).toEqual(false);\n    });\n\n    it('should query stacktrace for true for a log matching the stacktrace prefix', () => {\n      const logsDump = 'INSTRUMENTATION_STATUS: stack=\\n\\n';\n      uut.parse(logsDump);\n      expect(uut.containsStackTraceLog()).toEqual(true);\n    });\n\n    it('should query stacktrace for true for a log that holds the stacktrace prefix alongside other stuff', () => {\n      const logsDump = [\n        'INSTRUMENTATION_STATUS: stream=\\ncom.example.DetoxTest\\n',\n        'INSTRUMENTATION_STATUS: stack=stackFrame1\\n\\tstackFrame2\\n\\n',\n        'INSTRUMENTATION_STATUS: id=AndroidJUnitRunner\\n',\n      ].join('');\n      uut.parse(logsDump);\n      expect(uut.containsStackTraceLog()).toEqual(true);\n    });\n\n    it('should return empty stacktrace for a no-string', () => {\n      const logsDump = '';\n      uut.parse(logsDump);\n      expect(uut.getStackTrace(logsDump)).toEqual('');\n    });\n\n    it('should return stacktrace for a stack-trace logs dump', () => {\n      const logsDump = 'INSTRUMENTATION_STATUS: stack=stackFrame1\\n\\tstackFrame2\\n\\n';\n      uut.parse(logsDump);\n      expect(uut.getStackTrace(logsDump)).toEqual('stackFrame1\\n\\tstackFrame2\\n');\n    });\n\n    it('should return stacktrace for a multi-content logs dump', () => {\n      const logsDump = [\n        'INSTRUMENTATION_STATUS: stream=\\ncom.example.DetoxTest\\n',\n        'INSTRUMENTATION_STATUS: stack=stackFrame1\\n\\tstackFrame2\\n\\n',\n        'INSTRUMENTATION_STATUS_CODE: 1\\n',\n        'INSTRUMENTATION_STATUS: id=AndroidJUnitRunner\\n',\n      ].join('');\n\n      uut.parse(logsDump);\n      expect(uut.getStackTrace()).toEqual('stackFrame1\\n\\tstackFrame2\\n');\n    });\n\n    it('should return stacktrace for a stack split across 2 log dumps', () => {\n      const logsDump1 = [\n        'INSTRUMENTATION_STATUS: stream=\\ncom.example.DetoxTest\\n',\n        'INSTRUMENTATION_STATUS: stack=stackFrame1\\n',\n      ].join('');\n      const logsDump2 = [\n        '\\tstackFrame2\\n\\n',\n        'INSTRUMENTATION_STATUS_CODE: 1\\n',\n      ].join('');\n\n      uut.parse(logsDump1);\n      uut.parse(logsDump2);\n      expect(uut.getStackTrace()).toEqual('stackFrame1\\n\\tstackFrame2\\n');\n    });\n\n    it('should return stacktrace for a split-stack cut in prefix', () => {\n      const logsDump1 = [\n        'INSTRUMENTATION_STATUS: stream=\\ncom.example.DetoxTest\\n',\n        'INSTRUM',\n      ].join('');\n      const logsDump2 = [\n        'ENTATION_STATUS: stack=stackFrame1\\n\\tstackFrame2\\n\\n',\n        'INSTRUMENTATION_STATUS_CODE: 1\\n',\n      ].join('');\n\n      uut.parse(logsDump1);\n      uut.parse(logsDump2);\n      expect(uut.getStackTrace()).toEqual('stackFrame1\\n\\tstackFrame2\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst Deferred = require('../../../../../utils/Deferred');\nconst logger = require('../../../../../utils/logger');\n\nconst Instrumentation = require('./Instrumentation');\nconst { InstrumentationLogsParser } = require('./InstrumentationLogsParser');\n\nclass MonitoredInstrumentation {\n  constructor(adb) {\n    this.instrumentationLogsParser = null;\n    this.instrumentationStackTrace = '';\n    this.instrumentation = new Instrumentation(adb, logger, this._onInstrumentationTerminated.bind(this), this._onInstrumentationLogData.bind(this));\n    this.userTerminationFn = _.noop;\n    this.pendingPromise = Deferred.resolved();\n  }\n\n  async launch(deviceId, bundleId, userLaunchArgs) {\n    this.instrumentationLogsParser = new InstrumentationLogsParser();\n    await this.instrumentation.launch(deviceId, bundleId, userLaunchArgs);\n  }\n\n  setTerminationFn(userTerminationFn) {\n    this.userTerminationFn = userTerminationFn || _.noop;\n  }\n\n  waitForCrash() {\n    if (this.pendingPromise.isPending()) {\n      return this.pendingPromise.promise;\n    }\n\n    this.pendingPromise = new Deferred();\n    if (!this.instrumentation.isRunning()) {\n      this._rejectPendingCrashPromise();\n    }\n    return this.pendingPromise.promise;\n  }\n\n  abortWaitForCrash() {\n    this.pendingPromise.resolve();\n  }\n\n  isRunning() {\n    return this.instrumentation.isRunning();\n  }\n\n  async terminate() {\n    await this.instrumentation.terminate();\n    this._rejectPendingCrashPromise();\n  }\n\n  async _onInstrumentationTerminated() {\n    this._rejectPendingCrashPromise();\n    await this.userTerminationFn();\n  }\n\n  _rejectPendingCrashPromise() {\n    this.pendingPromise.reject(this._getInstrumentationCrashError());\n  }\n\n  _onInstrumentationLogData(logsDump) {\n    this.instrumentationLogsParser.parse(logsDump);\n\n    if (this.instrumentationLogsParser.containsStackTraceLog(logsDump)) {\n      this.instrumentationStackTrace = this.instrumentationLogsParser.getStackTrace(logsDump);\n    }\n  }\n\n  _getInstrumentationCrashError() {\n    return new DetoxRuntimeError({\n      message: 'Failed to run application on the device',\n      hint: this.instrumentationStackTrace\n        ? 'Most likely, your main activity has crashed prematurely.'\n        : 'Most likely, your tests have timed out and called detox.cleanup() ' +\n        'while it was waiting for \"ready\" message (over WebSocket) ' +\n        'from the instrumentation process.',\n      debugInfo: this.instrumentationStackTrace\n        ? `Native stacktrace dump:\\n${this.instrumentationStackTrace}`\n        : '',\n    });\n  }\n}\n\nmodule.exports = MonitoredInstrumentation;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.test.js",
    "content": "// @ts-nocheck\ndescribe('Monitored instrumentation', () => {\n  const deviceId = 'mock-device-id';\n  const bundleId = 'mock-bundle-id';\n  const INSTRUMENTATION_STACKTRACE_MOCK = 'Stacktrace mock';\n\n  let adb;\n  let logger;\n  beforeEach(() => {\n    jest.mock('../../../../../utils/logger');\n    logger = require('../../../../../utils/logger');\n\n    const ADB = jest.createMockFromModule('../exec/ADB');\n    adb = new ADB();\n  });\n\n  let InstrumentationClass;\n  let InstrumentationLogsParserClass;\n  beforeEach(() => {\n    jest.mock('./Instrumentation');\n    InstrumentationClass = require('./Instrumentation');\n\n    jest.mock('./InstrumentationLogsParser');\n    InstrumentationLogsParserClass = require('./InstrumentationLogsParser').InstrumentationLogsParser;\n    InstrumentationLogsParserClass.mockImplementation(() => {\n      const instances = InstrumentationLogsParserClass.mock.instances;\n      const _this = instances[instances.length - 1];\n      _this.getStackTrace.mockReturnValue(INSTRUMENTATION_STACKTRACE_MOCK);\n    });\n  });\n\n  const instrumentationObj = () => InstrumentationClass.mock.instances[0];\n  const instrumentationLogsParserObj = () => InstrumentationLogsParserClass.mock.instances[0];\n\n  let uut;\n  beforeEach(() => {\n    const MonitoredInstrumentation = require('./MonitoredInstrumentation');\n    uut = new MonitoredInstrumentation(adb);\n  });\n\n  it('should properly init the underlying instrumentation', () => {\n    expect(InstrumentationClass).toHaveBeenCalledWith(adb, logger, expect.any(Function), expect.any(Function));\n  });\n\n  describe('launch', () => {\n    it('should launch the underlying instrumentation', async () => {\n      const launchArgs = {};\n      await uut.launch(deviceId, bundleId, launchArgs);\n      expect(instrumentationObj().launch).toHaveBeenCalledWith(deviceId, bundleId, launchArgs);\n    });\n\n    it('should break if underlying launch fails', async () => {\n      instrumentationObj().launch.mockRejectedValue(new Error());\n\n      await expect(uut.launch(deviceId, bundleId, {})).rejects.toThrow();\n    });\n  });\n\n  describe('Unexpected termination', () => {\n    it('should invoke user termination callback', async () => {\n      const terminationFn = jest.fn();\n      uut.setTerminationFn(terminationFn);\n      await uut.launch(deviceId, bundleId, {});\n      await invokeUnderlyingTerminationCallback();\n      expect(terminationFn).toHaveBeenCalled();\n    });\n  });\n\n  describe('Initiation termination', () => {\n    it('should terminate the underlying instrumentation', async () => {\n      await uut.launch(deviceId, bundleId, {});\n      await uut.terminate();\n      expect(instrumentationObj().terminate).toHaveBeenCalled();\n    });\n\n    it('should break if underlying termination fails', async () => {\n      instrumentationObj().terminate.mockRejectedValue(new Error());\n\n      await uut.launch(deviceId, bundleId, {});\n\n      await expect(uut.terminate()).rejects.toThrow();\n    });\n\n    it('should allow for termination without launch', async () => {\n      await uut.terminate();\n      expect(instrumentationObj().terminate).toHaveBeenCalled();\n    });\n  });\n\n  it('should allow for user-initiated clearing of termination callback function', async () => {\n    const terminationFn = jest.fn();\n    uut.setTerminationFn(terminationFn);\n    await uut.launch(deviceId, bundleId, {});\n\n    uut.setTerminationFn(null);\n    await invokeUnderlyingTerminationCallback();\n    expect(terminationFn).not.toHaveBeenCalled();\n  });\n\n  it('should query underlying instrumentation for status', async () => {\n    mockUnderlyingInstrumentationRunning();\n    expect(uut.isRunning()).toEqual(true);\n\n    mockUnderlyingInstrumentationDead();\n    expect(uut.isRunning()).toEqual(false);\n  });\n\n  describe('Crash monitoring', () => {\n    let onReject;\n    beforeEach(async () => {\n      onReject = jest.fn();\n\n      await uut.launch(deviceId, bundleId, {});\n      mockUnderlyingInstrumentationRunning();\n    });\n\n    it('should signal termination due to unexpected underlying termination, if waited-for', async () => {\n      uut.waitForCrash().catch(onReject);\n\n      await invokeUnderlyingTerminationCallback();\n      expect(onReject).toHaveBeenCalled();\n    });\n\n    it('should signal termination due to initiated termination, if waited-for', async () => {\n      uut.waitForCrash().catch(onReject);\n\n      await uut.terminate();\n      expect(onReject).toHaveBeenCalled();\n    });\n\n    it('should signal termination with a parsed stack-trace', async () => {\n      mockLogsParserHasStacktrace();\n\n      uut.waitForCrash().catch(onReject);\n\n      await invokeUnderlyingLogListenerCallbackWith('mock data');\n      await invokeUnderlyingTerminationCallback();\n\n      assertRejectedWithNativeStacktrace();\n    });\n\n    it('should signal termination with no stack-trace, if none available', async () => {\n      mockLogsParserHasNoStacktrace();\n\n      uut.waitForCrash().catch(onReject);\n\n      await invokeUnderlyingLogListenerCallbackWith('mock data');\n      await invokeUnderlyingTerminationCallback();\n\n      expect(instrumentationLogsParserObj().parse).toHaveBeenCalledWith('mock data');\n\n      assertRejectedWithoutStacktrace();\n    });\n\n    it('should allow for user-initiated clearing of app-wait', async () => {\n      const onResolve = jest.fn();\n\n      const promise = uut.waitForCrash().then(onResolve);\n      uut.abortWaitForCrash();\n\n      await promise;\n      expect(onResolve).toHaveBeenCalled();\n    });\n\n    it('should immediately signal termination if already terminated', async () => {\n      mockUnderlyingInstrumentationDead();\n      await uut.waitForCrash().catch(onReject);\n\n      expect(onReject).toHaveBeenCalled();\n    });\n\n    it('should account for all waiting crash-wait clients', async () => {\n      uut.waitForCrash().catch(onReject);\n      uut.waitForCrash().catch(onReject);\n\n      await uut.terminate();\n\n      expect(onReject).toHaveBeenCalledTimes(2);\n    });\n\n    const assertRejectedWithNativeStacktrace = () => {\n      const e = onReject.mock.calls[0][0];\n      expect(e.toString()).toContain('DetoxRuntimeError: Failed to run application on the device');\n      expect(e.toString()).toContain(`Native stacktrace dump:\\n${INSTRUMENTATION_STACKTRACE_MOCK}`);\n    };\n\n    const assertRejectedWithoutStacktrace = () => {\n      const e = onReject.mock.calls[0][0];\n      expect(e.toString()).toContain('DetoxRuntimeError: Failed to run application on the device');\n      expect(e.toString()).not.toContain('Native stacktrace dump');\n    };\n  });\n\n  const extractUnderlyingTerminationCallback = () => InstrumentationClass.mock.calls[0][2];\n  const invokeUnderlyingTerminationCallback = async () => {\n    const fn = extractUnderlyingTerminationCallback();\n    await fn();\n  };\n  const extractUnderlyingLogListenerCallback = () => InstrumentationClass.mock.calls[0][3];\n  const invokeUnderlyingLogListenerCallbackWith = async (data) => {\n    const fn = extractUnderlyingLogListenerCallback();\n    await fn(data);\n  };\n\n  const mockUnderlyingInstrumentationRunning = () => instrumentationObj().isRunning.mockReturnValue(true);\n  const mockUnderlyingInstrumentationDead = () => instrumentationObj().isRunning.mockReturnValue(false);\n\n  const mockLogsParserHasStacktrace = () => instrumentationLogsParserObj().containsStackTraceLog.mockReturnValue(true);\n  const mockLogsParserHasNoStacktrace = () => instrumentationLogsParserObj().containsStackTraceLog.mockReturnValue(false);\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/TempFileTransfer.js",
    "content": "const FileTransfer = require('./FileTransfer');\n\nconst FILE_PATH = '/data/local/tmp/detox';\n\nclass TempFileTransfer extends FileTransfer {\n  constructor(adb) {\n    super(adb, FILE_PATH);\n  }\n}\n\nmodule.exports = {\n  TempFileTransfer,\n  FILE_PATH\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/TempFileTransfer.test.js",
    "content": "describe('Temp file transfer', () => {\n  let adb;\n  let uut;\n  beforeEach(() => {\n    const ADB = jest.createMockFromModule('../exec/ADB');\n    adb = new ADB();\n\n    const { TempFileTransfer } = require('./TempFileTransfer');\n    uut = new TempFileTransfer(adb);\n  });\n\n  it('should use the default temp-dir', async () => {\n    await uut.prepareDestinationDir('device-id');\n\n    expect(adb.shell).toHaveBeenCalledWith('device-id', `rm -fr /data/local/tmp/detox`);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/__snapshots__/ApkValidator.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`APK validation App APK validation should throw a descriptive error if app APK happens to be a test APK 1`] = `\n\"App APK at path mock-bin-path was detected as the *test* APK!\n\nHINT: Your binary path was probably wrongly set in the active Detox configuration.\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup\"\n`;\n\nexports[`APK validation App APK validation should throw a specific error if AAPT throws 1`] = `\n\"Failed to get details about the APK at path mock-bin-path. Root cause:\nError: mock error\n\nHINT: Check that the binary path in the active Detox configuration has been set to a path of an APK file.\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup\"\n`;\n\nexports[`APK validation Test APK validation should throw a descriptive error if APK happens to be an app APK 1`] = `\n\"Test APK at path mock-test-bin-path was detected as the *app* APK!\n\nHINT: Your test test-binary path was probably wrongly set in the active Detox configuration.\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup\"\n`;\n\nexports[`APK validation Test APK validation should throw a specific error if AAPT throws 1`] = `\n\"Failed to get details about the APK at path mock-test-bin-path. Root cause:\nError: mock error\n\nHINT: Check that the test-binary path in the active Detox configuration has been set to a path of an APK file.\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup\"\n`;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/apk.js",
    "content": "const path = require('path');\n\nconst _ = require('lodash');\n\nconst string = require('../../../../../utils/string');\n\nfunction getTestApkPath(originalApkPath) {\n  const originalApkPathObj = path.parse(originalApkPath);\n  let tempPath = originalApkPathObj.dir.split(path.sep);\n  const splitFileName = originalApkPathObj.name.split('-');\n\n  const buildType = _.last(splitFileName);\n  const flavorDimensions = _.slice(splitFileName, 1, splitFileName.length - 1);\n\n  tempPath = _.dropRight(tempPath, 1); // buildType\n\n  let flavorDimensionsPath = '';\n  if (flavorDimensions.length > 0) {\n    flavorDimensionsPath = string.lowerCamelCaseJoin(flavorDimensions);\n    tempPath = _.dropRight(tempPath, 1); // flavorDimensions\n  }\n\n  const finalFileName = `${originalApkPathObj.name}-androidTest${originalApkPathObj.ext}`;\n  return path.join(tempPath.join(path.sep), 'androidTest', flavorDimensionsPath, buildType, finalFileName);\n}\n\nmodule.exports = {\n  getTestApkPath,\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/apk.test.js",
    "content": "const path = require('path'); // Using path methods will normalize slashes to backslashes on win32, so tests must match.\nconst rootPath = process.platform === 'win32' ? 'C:\\\\Users\\\\SomeUser' : '~/somePath';\n\ndescribe('APK utils', () => {\n\n  let apkUtils;\n  beforeEach(() => {\n    apkUtils = require('./apk');\n  });\n\n  describe('Test-APK heuristic path resolution', () => {\n    it('should properly resolve a simple path', async () => {\n      const inputApkPath = path.join(rootPath, 'build/outputs/apk/debug/app-debug.apk');\n      const expectedTestApkPath = path.join(rootPath, 'build/outputs/apk/androidTest/debug/app-debug-androidTest.apk');\n      expect(apkUtils.getTestApkPath(inputApkPath)).toEqual(expectedTestApkPath);\n    });\n\n    it('should properly resolve given a gradle build flavor', async () => {\n      const inputApkPath = path.join(rootPath, 'build/outputs/apk/development/debug/app-development-debug.apk');\n      const expectedTestApkPath = path.join(rootPath, 'build/outputs/apk/androidTest/development/debug/app-development-debug-androidTest.apk');\n      expect(apkUtils.getTestApkPath(inputApkPath)).toEqual(expectedTestApkPath);\n    });\n\n    it('should properly resolve given a gradle build with multiple flavors', async () => {\n      const inputApkPath = path.join(rootPath, 'build/outputs/apk/pocPlayStore/debug/app-poc-playStore-debug.apk');\n      const expectedTestApkPath = path.join(rootPath, 'build/outputs/apk/androidTest/pocPlayStore/debug/app-poc-playStore-debug-androidTest.apk');\n      expect(apkUtils.getTestApkPath(inputApkPath)).toEqual(expectedTestApkPath);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/instrumentationArgs.js",
    "content": "const _ = require('lodash');\n\nconst { encodeBase64 } = require('../../../../../utils/encoding');\nconst { autoEscape } = require('../../../../../utils/shellUtils');\n\nconst reservedInstrumentationArgs = new Set(['class', 'package', 'func', 'unit', 'size', 'perf', 'debug', 'log', 'emma', 'coverageFile']);\nconst isReservedInstrumentationArg = (arg) => reservedInstrumentationArgs.has(arg);\n\nfunction prepareInstrumentationArgs(args) {\n  const usedReservedArgs = [];\n  const preparedLaunchArgs = _.reduce(args, (result, value, key) => {\n    const valueAsString = _.isString(value) ? value : JSON.stringify(value);\n\n    let valueEncoded = valueAsString;\n    if (isReservedInstrumentationArg(key)) {\n      usedReservedArgs.push(key);\n    } else if (!key.startsWith('detox')) {\n      valueEncoded = encodeBase64(valueAsString);\n    }\n\n    const valueEscaped = hasLegacyIssues(key) ? valueEncoded : autoEscape.shell(valueEncoded);\n    result.push('-e', key, valueEscaped);\n    return result;\n  }, []);\n\n  return {\n    args: preparedLaunchArgs,\n    usedReservedArgs,\n  };\n}\n\nfunction hasLegacyIssues(key) {\n  return key === 'detoxURLBlacklistRegex';\n}\n\nmodule.exports = {\n  prepareInstrumentationArgs,\n};\n"
  },
  {
    "path": "detox/src/devices/common/drivers/android/tools/instrumentationArgs.test.js",
    "content": "/* eslint-disable no-useless-escape */\n// @ts-nocheck\ndescribe('Instrumentation arguments', () => {\n  let uut;\n  let encodeBase64;\n\n  beforeEach(() => {\n    jest.mock('../../../../../utils/encoding');\n    const encoding = require('../../../../../utils/encoding');\n    encodeBase64 = encoding.encodeBase64;\n\n    uut = require('./instrumentationArgs');\n  });\n\n  it('should prepare arguments with no-args', () => {\n    const result = uut.prepareInstrumentationArgs({});\n    expect(result.args).toEqual([]);\n  });\n\n  it('should prepare arguments with base-64 encoding', () => {\n    const args = {\n      mockMe: 'this',\n      andMockMe: 'that',\n    };\n    const expectedArgs = [\n      ...expectedArgEncoded('mockMe', 'this'),\n      ...expectedArgEncoded('andMockMe', 'that'),\n    ];\n    const result = uut.prepareInstrumentationArgs(args);\n    expect(result.args).toEqual(expectedArgs);\n  });\n\n  it('should stringify non-string values', () => {\n    const args = {\n      'object-arg': {\n        such: 'wow',\n        much: 'amaze',\n        very: 111,\n      },\n      'string-arg': 'text, with commas-and-dashes,',\n    };\n    const expectedArgs = [\n      ...expectedArgEncoded('object-arg', '{\"such\":\"wow\",\"much\":\"amaze\",\"very\":111}'),\n      ...expectedArgEncoded('string-arg', 'text, with commas-and-dashes,'),\n    ];\n    const result = uut.prepareInstrumentationArgs(args);\n    expect(result.args).toEqual(expectedArgs);\n  });\n\n  // Ref: https://developer.android.com/studio/test/command-line#AMOptionsSyntax\n  it('should whitelist reserved instrumentation args with respect to base64 encoding', async () => {\n    const blackListRegexps = [\n      /http:\\/\\/meaningless\\.first\\.url/,\n      /^http:\\/\\/localhost(?::\\d{4,5})?\\/[a-z]+(?:\\/\\d{4})?$/\n    ];\n\n    const args = {\n      // Free arg\n      'user-arg': 'merry christ-nukah',\n      // Reserved instrumentation args\n      'detoxURLOverride': 'https://example.com/?q=search term&ref=source',\n      'detoxURLBlacklistRegex': `(${blackListRegexps.map(r => r.source)})`,\n      'class': 'class-value',\n      'package': 'package-value',\n      'func': 'func-value',\n      'unit': 'unit-value',\n      'size': 'size-value',\n      'perf': 'perf-value',\n      'debug': 'debug-value',\n      'log': 'log-value',\n      'emma': 'emma-value',\n      'coverageFile': 'coverageFile-value',\n    };\n\n    const result = uut.prepareInstrumentationArgs(args);\n    expect(result.args).toEqual([\n      ...expectedArgEncoded('user-arg', 'merry christ-nukah'),\n      ...expectedArgUnencoded('detoxURLOverride', \"'https://example.com/?q=search term&ref=source'\"),\n      ...expectedArgUnencoded('detoxURLBlacklistRegex', '(http:\\\\/\\\\/meaningless\\\\.first\\\\.url,^http:\\\\/\\\\/localhost(?::\\\\d{4,5})?\\\\/[a-z]+(?:\\\\/\\\\d{4})?$)'),\n      ...expectedArgUnencoded('class', 'class-value'),\n      ...expectedArgUnencoded('package', 'package-value'),\n      ...expectedArgUnencoded('func', 'func-value'),\n      ...expectedArgUnencoded('unit', 'unit-value'),\n      ...expectedArgUnencoded('size', 'size-value'),\n      ...expectedArgUnencoded('perf', 'perf-value'),\n      ...expectedArgUnencoded('debug', 'debug-value'),\n      ...expectedArgUnencoded('log', 'log-value'),\n      ...expectedArgUnencoded('emma', 'emma-value'),\n      ...expectedArgUnencoded('coverageFile', 'coverageFile-value'),\n    ]);\n  });\n\n  it('should collect and separately return reserved instrumentation args', async () => {\n    const args = {\n      'class': 'class-value',\n      'package': 'package-value',\n    };\n    const result = uut.prepareInstrumentationArgs(args);\n    expect(result.usedReservedArgs).toEqual(Object.keys(args));\n  });\n\n  it('should whitelist args with \\'detox\\' prefix with respect to base64 encoding', () => {\n    const args = {\n      mockMe: 'this',\n      detoxMockMe: 'that',\n    };\n    const expectedArgs = [\n      ...expectedArgEncoded('mockMe', 'this'),\n      ...expectedArgUnencoded('detoxMockMe', 'that'),\n    ];\n    const result = uut.prepareInstrumentationArgs(args);\n    expect(result.args).toEqual(expectedArgs);\n  });\n\n  const expectedArgEncoded = (key, value) => (['-e', key, encodeBase64(value)]);\n  const expectedArgUnencoded = (key, value) => (['-e', key, value]);\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/cookies.d.ts",
    "content": "/* eslint-disable import/no-unresolved,node/no-missing-import,node/no-unsupported-features/es-syntax */\nimport { DeviceCookie } from '../DeviceCookie';\n\ninterface IosSimulatorCookie extends DeviceCookie {\n  udid: string;\n  type?: string;\n  bootArgs?: string;\n  headless?: boolean;\n}\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/AppleSimUtils.js",
    "content": "// @ts-nocheck\nconst path = require('path');\n\nconst _ = require('lodash');\nconst semver = require('semver');\n\nconst DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');\nconst { joinArgs } = require('../../../../../utils/argparse');\nconst childProcess = require('../../../../../utils/childProcess');\nconst environment = require('../../../../../utils/environment');\nconst log = require('../../../../../utils/logger').child({ cat: 'device' });\nconst { quote } = require('../../../../../utils/shellQuote');\n\nconst PERMISSIONS_VALUES = {\n  YES: 'YES',\n  NO: 'NO',\n  UNSET: 'unset',\n  LIMITED: 'limited',\n};\n\nconst SIMCTL_SET_PERMISSION_ACTIONS ={\n  GRANT: 'grant',\n  REVOKE: 'revoke',\n  RESET: 'reset',\n};\n\nclass AppleSimUtils {\n  async setPermissions(udid, bundleId, permissionsObj) {\n    for (const [service, value] of Object.entries(permissionsObj)) {\n      switch (service) {\n        case 'location':\n          switch (value) {\n            case 'always':\n              await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.GRANT, 'location-always');\n              break;\n\n            case 'inuse':\n              await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.GRANT, 'location');\n              break;\n\n            case 'never':\n              await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.REVOKE, 'location');\n              break;\n\n            case 'unset':\n              await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.RESET, 'location');\n              break;\n          }\n\n          break;\n\n        case 'contacts':\n          if (value === PERMISSIONS_VALUES.LIMITED) {\n            await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.GRANT, 'contacts-limited');\n          } else {\n            await this.setPermissionWithAppleSimUtils(udid, bundleId, service, value);\n          }\n          break;\n\n        case 'photos':\n          if (value === PERMISSIONS_VALUES.LIMITED) {\n            await this.setPermissionWithSimctl(udid, bundleId, SIMCTL_SET_PERMISSION_ACTIONS.GRANT, 'photos-add');\n          } else {\n            await this.setPermissionWithAppleSimUtils(udid, bundleId, service, value);\n          }\n          break;\n\n        // eslint-disable-next-line no-fallthrough\n        case 'calendar':\n        case 'camera':\n        case 'medialibrary':\n        case 'microphone':\n        case 'motion':\n        case 'reminders':\n        case 'siri':\n          // Simctl uses kebab-case for service names.\n          const simctlService = service.replace('medialibrary', 'media-library');\n          await this.setPermissionWithSimctl(udid, bundleId, this.basicPermissionValueToSimctlAction(value), simctlService);\n          break;\n\n        // Requires AppleSimUtils: unsupported by latest Simctl at the moment of writing this code.\n        // eslint-disable-next-line no-fallthrough\n        case 'notifications':\n        case 'health':\n        case 'homekit':\n        case 'speech':\n        case 'faceid':\n        case 'userTracking':\n          await this.setPermissionWithAppleSimUtils(udid, bundleId, service, value);\n          break;\n      }\n    }\n  }\n\n  basicPermissionValueToSimctlAction(value) {\n    switch (value) {\n      case PERMISSIONS_VALUES.YES:\n        return SIMCTL_SET_PERMISSION_ACTIONS.GRANT;\n\n      case PERMISSIONS_VALUES.NO:\n        return SIMCTL_SET_PERMISSION_ACTIONS.REVOKE;\n\n      case PERMISSIONS_VALUES.UNSET:\n        return SIMCTL_SET_PERMISSION_ACTIONS.RESET;\n    }\n  }\n\n  async setPermissionWithSimctl(udid, bundleId, action, service) {\n    const options = {\n      cmd: `privacy ${udid} ${action} ${service} ${bundleId}`,\n      statusLogs: {\n        trying: `Trying to set permissions with Simctl: ${action} ${service}...`,\n        successful: `${service} permissions are set`\n      },\n      retries: 1,\n    };\n\n    await this._execSimctl(options);\n  }\n\n  async setPermissionWithAppleSimUtils(udid, bundleId, service, value) {\n    const options = {\n      args: `--byId ${udid} --bundle ${bundleId} --restartSB --setPermissions ${service}=${value}`,\n      statusLogs: {\n        trying: `Trying to set permissions with AppleSimUtils: ${service}=${value}...`,\n        successful: `${service} permissions are set`\n      },\n      retries: 1,\n    };\n\n    await this._execAppleSimUtils(options);\n  }\n\n  async list(query, listOptions = {}) {\n    const fields = await this._buildFields(listOptions.fields);\n    const options = {\n      args: `--list ${joinArgs(query)} ${fields}`,\n      retries: 1,\n      statusLogs: listOptions.trying ? { trying: listOptions.trying } : undefined,\n      maxBuffer: 4 * 1024 * 1024,\n    };\n    const response = await this._execAppleSimUtils(options);\n    const parsed = this._parseResponseFromAppleSimUtils(response);\n    return parsed;\n  }\n\n  /***\n   * Boots the simulator if it is not booted already.\n   *\n   * @param {String} udid iOS Simulator UDID.\n   * @param {String} deviceBootArgs simctl boot command arguments.\n   * @param {Boolean} headless If false, opens the Simulator app after the Simulator has booted.\n   * @returns {Promise<boolean>} true, if device has been booted up from the shutdown state.\n   */\n  async boot(udid, deviceBootArgs = '', headless = false) {\n    const isBooted = await this.isBooted(udid);\n\n    if (isBooted) {\n      return false;\n    }\n\n    const statusLogs = { trying: `Booting device ${udid}...` };\n    await this._execSimctl({ cmd: `boot ${udid} ${deviceBootArgs}`, statusLogs, retries: 10 });\n    await this._execSimctl({ cmd: `bootstatus ${udid}`, retries: 1 });\n\n    if (!headless) {\n      await this._openSimulatorApp(udid);\n    }\n\n    return true;\n  }\n\n  async isBooted(udid) {\n    const device = await this._findDeviceByUDID(udid);\n    return (_.isEqual(device.state, 'Booted') || _.isEqual(device.state, 'Booting'));\n  }\n\n  async _findDeviceByUDID(udid) {\n    const [device] = await this.list({ byId: udid, maxResults: 1 }, { fields: ['udid', 'os', 'version', 'state'] });\n    if (!device) {\n      throw new DetoxRuntimeError(`Can't find device with UDID = \"${udid}\"`);\n    }\n\n    return device;\n  }\n\n  async _openSimulatorApp(udid) {\n    try {\n      await childProcess.execWithRetriesAndLogs(`open -a Simulator --args -CurrentDeviceUDID ${udid}`, { retries: 0 });\n    } catch (error) {\n      this._logUnableToOpenSimulator();\n    }\n  }\n\n  _logUnableToOpenSimulator() {\n    log.warn(\n      `Unable to open the Simulator app. Please make sure you have Xcode and iOS Simulator installed ` +\n      `(https://developer.apple.com/xcode/). In case you already have the latest Xcode version installed, ` +\n      `try run the command: \\`sudo xcode-select -s /Applications/Xcode.app\\`. If you are running tests from CI, ` +\n      `we recommend running them with \"--headless\" device configuration (see: ` +\n      `https://wix.github.io/Detox/docs/cli/test/#options).`\n    );\n  }\n\n  /***\n   * @param deviceInfo - an item in output of `applesimutils --list`\n   * @returns {Promise<string>} UDID of a new device\n   */\n  async create(deviceInfo) {\n    const deviceName = _.get(deviceInfo, 'name');\n    const deviceTypeIdentifier = _.get(deviceInfo, 'deviceType.identifier');\n    const deviceRuntimeIdentifier = _.get(deviceInfo, 'os.identifier');\n\n    if (!deviceTypeIdentifier || !deviceRuntimeIdentifier) {\n      const deviceInfoStr = JSON.stringify(deviceInfo, null, 4);\n      throw new DetoxRuntimeError(`Unable to create device from: ${deviceInfoStr}`);\n    }\n\n    const { stdout: udid } = await this._execSimctl({\n      cmd: `create \"${deviceName}-Detox\" \"${deviceTypeIdentifier}\" \"${deviceRuntimeIdentifier}\"`\n    });\n\n    return (udid || '').trim();\n  }\n\n  async install(udid, absPath) {\n    const statusLogs = {\n      trying: `Installing ${absPath}...`,\n      successful: `${absPath} installed`\n    };\n    await this._execSimctl({ cmd: `install ${udid} \"${absPath}\"`, statusLogs, retries: 2 });\n  }\n\n  async uninstall(udid, bundleId) {\n    const statusLogs = {\n      trying: `Uninstalling ${bundleId}...`,\n      successful: `${bundleId} uninstalled`\n    };\n    try {\n      await this._execSimctl({ cmd: `uninstall ${udid} ${bundleId}`, statusLogs });\n    } catch (e) {\n      // that's fine\n    }\n  }\n\n  async launch(udid, bundleId, launchArgs, languageAndLocale) {\n    const frameworkPath = await environment.getFrameworkPath();\n    const result = await this._launchMagically(frameworkPath, udid, bundleId, launchArgs, languageAndLocale);\n    await this._printLoggingHint(udid, bundleId);\n\n    return this._parseLaunchId(result);\n  }\n\n  printLaunchHint(udid, bundleId, launchArgs, languageAndLocale) {\n    log.info({},\n      'Waiting for you to manually launch your app in Xcode.\\n' +\n      'Make sure to pass the launch arguments listed below:\\n' +\n      '  --args\\n' +\n      this._mergeLaunchArgs(launchArgs, languageAndLocale).map(keyValue => `  ${quote(keyValue)}\\n`).join(''),\n      '\\nPress any key to continue...'\n    );\n  }\n\n  async sendToHome(udid) {\n    if (await this._isSpringBoardInaccessible(udid)) {\n      // SpringBoard is not directly accessible by Simctl on iOS 16.0 and above, therefore we launch and terminate the\n      // Settings app instead. This sends the currently open app to the background and brings the home screen to the\n      // foreground.\n      await this._launchAndTerminateSettings(udid);\n      return;\n    }\n\n    await this._launchSpringBoard(udid);\n  }\n\n  async _isSpringBoardInaccessible(udid) {\n    const device = await this._findDeviceByUDID(udid);\n    const majorIOSVersion = parseInt(device.os.version.split('.')[0]);\n    return majorIOSVersion >= 16;\n  }\n\n  async _launchAndTerminateSettings(udid) {\n    const bundleId = 'com.apple.Preferences';\n    await this._execSimctl({ cmd: `launch ${udid} ${bundleId}`, retries: 10 });\n    await this._execSimctl({ cmd: `terminate ${udid} ${bundleId}`, retries: 10 });\n  }\n\n  async _launchSpringBoard(udid) {\n    await this._execSimctl({ cmd: `launch ${udid} com.apple.springboard`, retries: 10 });\n  }\n\n  async matchBiometric(udid, matchType) {\n    if (!_.includes(['Face', 'Finger'], matchType)) {\n      return;\n    }\n\n    const options = {\n      args: `--byId ${udid} --match${matchType}`,\n      retries: 1,\n      statusLogs: {\n        trying: `Trying to match ${matchType}...`,\n        successful: `Matched ${matchType}!`\n      },\n    };\n    await this._execAppleSimUtils(options);\n  }\n\n  async unmatchBiometric(udid, matchType) {\n    if (!_.includes(['Face', 'Finger'], matchType)) {\n      return;\n    }\n\n    const options = {\n      args: `--byId ${udid} --unmatch${matchType}`,\n      retries: 1,\n      statusLogs: {\n        trying: `Trying to unmatch ${matchType}...`,\n        successful: `Unmatched ${matchType}!`\n      },\n    };\n    await this._execAppleSimUtils(options);\n  }\n\n  async setBiometricEnrollment(udid, yesOrNo) {\n    if (!_.includes(['YES', 'NO'], yesOrNo)) {\n      return;\n    }\n\n    const toggle = yesOrNo === 'YES';\n    const options = {\n      args: `--byId ${udid} --biometricEnrollment ${yesOrNo}`,\n      retries: 1,\n      statusLogs: {\n        trying: `Turning ${toggle ? 'on' : 'off'} biometric enrollment...`,\n        successful: toggle ? 'Activated!' : 'Deactivated!'\n      },\n    };\n    await this._execAppleSimUtils(options);\n  }\n\n  async clearKeychain(udid) {\n    const options = {\n      args: `--byId ${udid} --clearKeychain`,\n      retries: 1,\n      statusLogs: {\n        trying: `Clearing Keychain...`,\n        successful: 'Cleared Keychain!'\n      },\n    };\n    await this._execAppleSimUtils(options);\n  }\n\n  async getAppContainer(udid, bundleId) {\n    return _.trim((await this._execSimctl({ cmd: `get_app_container ${udid} ${bundleId}` })).stdout);\n  }\n\n  logStream({ udid, stdout, level, processImagePath, style }) {\n    const args = ['simctl', 'spawn', udid, 'log', 'stream'];\n\n    if (level) {\n      args.push('--level', level);\n    }\n\n    if (style) {\n      args.push('--style', style);\n    }\n\n    if (processImagePath) {\n      args.push('--predicate', `processImagePath beginsWith \"${processImagePath}\"`);\n    }\n\n    const promise = childProcess.spawnAndLog('/usr/bin/xcrun', args, {\n      stdio: ['ignore', stdout, 'ignore'],\n      silent: true,\n    });\n\n    return promise;\n  }\n\n  async terminate(udid, bundleId) {\n    const statusLogs = {\n      trying: `Terminating ${bundleId}...`,\n      successful: `${bundleId} terminated`\n    };\n\n    try {\n      await this._execSimctl({\n        cmd: `terminate ${udid} ${bundleId}`,\n        statusLogs: statusLogs,\n        silent: true\n      });\n    } catch (err) {\n      // Since we have no convenient way to check whether the app is currently running or not, we might execute this\n      // command (terminate) even if the app is not currently running, or even installed.\n      // We have encountered some case where the following error is thrown in a case where the app did not run:\n      // ```\n      // An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):\n      // Application termination failed.\n      // FBSSystemService reported failure without an error, possibly because the app is not currently running.\n      // ```\n      // This workaround is done to ignore the error above, as we do not care if the app was running before, we just\n      // want to make sure it isn't now.\n      if (err.code === 3 &&\n          (err.stderr.includes(`the app is not currently running`) ||\n           err.stderr.includes(`found nothing to terminate`))) {\n        return;\n      }\n\n      throw err;\n    }\n  }\n\n  async shutdown(udid) {\n    const statusLogs = {\n      trying: `Shutting down ${udid}...`,\n      successful: `${udid} shut down`\n    };\n    await this._execSimctl({ cmd: `shutdown ${udid}`, statusLogs });\n  }\n\n  async openUrl(udid, url) {\n    await this._execSimctl({ cmd: `openurl ${udid} ${url}` });\n  }\n\n  async setLocation(udid, lat, lon) {\n    await this._execSimctl({ cmd: `location ${udid} set ${lat},${lon}` });\n  }\n\n  async resetContentAndSettings(udid) {\n    await this._execSimctl({ cmd: `erase ${udid}` });\n  }\n\n  async takeScreenshot(udid, destination) {\n    await this._execSimctl({\n      cmd: `io ${udid} screenshot \"${destination}\"`,\n      silent: destination === '/dev/null',\n    });\n  }\n\n  recordVideo(udid, destination, options = {}) {\n    const args = ['simctl', 'io', udid, 'recordVideo', destination];\n    if (options.codec) {\n      args.push('--codec', options.codec);\n    }\n\n    return childProcess.spawnAndLog('/usr/bin/xcrun', args, {\n      logLevelPatterns: {\n        trace: [\n          /^Recording started/,\n          /^Wrote video to/,\n        ],\n      },\n    });\n  }\n\n  async _execAppleSimUtils(options) {\n    const bin = `applesimutils`;\n    return await childProcess.execWithRetriesAndLogs(bin, options);\n  }\n\n  async _execSimctl({ cmd, statusLogs = {}, retries = 1, silent = false }) {\n    const options = {\n      verbosity: silent ? 'low' : 'normal',\n      statusLogs,\n      retries,\n    };\n    return await childProcess.execWithRetriesAndLogs(`/usr/bin/xcrun simctl ${cmd}`, options);\n  }\n\n  _parseResponseFromAppleSimUtils(response) {\n    let out = _.get(response, 'stdout');\n    if (_.isEmpty(out)) {\n      out = _.get(response, 'stderr');\n    }\n    if (_.isEmpty(out)) {\n      return undefined;\n    }\n\n    let parsed;\n    try {\n      parsed = JSON.parse(out);\n\n    } catch (ex) {\n      throw new DetoxRuntimeError(`Could not parse response from applesimutils, please update applesimutils and try again.\n      'brew uninstall applesimutils && brew tap wix/brew && brew install applesimutils'`);\n    }\n    return parsed;\n  }\n\n  _mergeLaunchArgs(launchArgs, languageAndLocale) {\n    const args = {\n      ...launchArgs,\n    };\n\n    if (languageAndLocale) {\n      if (languageAndLocale.language) {\n        args.AppleLanguages = `(${languageAndLocale.language})`;\n      }\n\n      if (languageAndLocale.locale) {\n        args.AppleLocale = languageAndLocale.locale;\n      }\n    }\n\n    return _.map(args, (v, k) => [`-${k}`, `${v}`]);\n  }\n\n  async _launchMagically(frameworkPath, udid, bundleId, launchArgs, languageAndLocale) {\n    let dylibs = `${frameworkPath}/Detox`;\n    if (process.env.SIMCTL_CHILD_DYLD_INSERT_LIBRARIES) {\n      dylibs = `${process.env.SIMCTL_CHILD_DYLD_INSERT_LIBRARIES}:${dylibs}`;\n    }\n\n    const cmdArgs = quote(_.flatten(this._mergeLaunchArgs(launchArgs, languageAndLocale)));\n    let launchBin = `SIMCTL_CHILD_GULGeneratedClassDisposeDisabled=YES SIMCTL_CHILD_DYLD_INSERT_LIBRARIES=\"${dylibs}\" ` +\n      `/usr/bin/xcrun simctl launch ${udid} ${bundleId} --args ${cmdArgs}`;\n\n    const result = await childProcess.execWithRetriesAndLogs(launchBin, {\n      retries: 1,\n      statusLogs: {\n        trying: `Launching ${bundleId}...`,\n      },\n    });\n\n    return result;\n  }\n\n  async _printLoggingHint(udid, bundleId) {\n    const appContainer = await this.getAppContainer(udid, bundleId);\n    const CFBundleExecutable = await childProcess.execAsync(`/usr/libexec/PlistBuddy -c \"Print CFBundleExecutable\" \"${path.join(appContainer, 'Info.plist')}\"`);\n    const predicate = `process == \"${CFBundleExecutable}\"`;\n    const command = `/usr/bin/xcrun simctl spawn ${udid} log stream --level debug --style compact --predicate '${predicate}'`;\n\n    log.info(`${bundleId} launched. To watch simulator logs, run:\\n        ${command}`);\n  }\n\n  _parseLaunchId(result) {\n    return parseInt(_.get(result, 'stdout', ':').trim().split(':')[1]);\n  }\n\n  async statusBarOverride(udid, flags) {\n    if (udid && flags) {\n      let overrides = [];\n      if (flags.time)\n        overrides.push(`--time \"${flags.time}\"`);\n      if (flags.dataNetwork)\n        overrides.push(`--dataNetwork \"${flags.dataNetwork}\"`);\n      if (flags.wifiMode)\n        overrides.push(`--wifiMode \"${flags.wifiMode}\"`);\n      if (flags.wifiBars)\n        overrides.push(`--wifiBars \"${flags.wifiBars}\"`);\n      if (flags.cellularMode)\n        overrides.push(`--cellularMode \"${flags.cellularMode}\"`);\n      if (flags.cellularBars)\n        overrides.push(`--cellularBars \"${flags.cellularBars}\"`);\n      if (flags.operatorName)\n        overrides.push(`--operatorName \"${flags.operatorName}\"`);\n      if (flags.batteryState)\n        overrides.push(`--batteryState \"${flags.batteryState}\"`);\n      if (flags.batteryLevel)\n        overrides.push(`--batteryLevel \"${flags.batteryLevel}\"`);\n\n      await this._execSimctl({ cmd: `status_bar ${udid} override ${overrides.join(' ')}` });\n    }\n  }\n\n  async statusBarReset(udid) {\n    await this._execSimctl({ cmd: `status_bar ${udid} clear` });\n  }\n\n  async getPid(udid, bundleId) {\n    const result = await this._execSimctl({\n      cmd: `spawn ${udid} launchctl list | grep -F '${bundleId}' || true`,\n      retries: 0,\n    });\n\n    if (result && result.stdout) {\n      const [pid] = result.stdout.split(/\\s/);\n      return Number(pid);\n    }\n\n    return Number.NaN;\n  }\n\n  async _buildFields(fields) {\n    const version = await environment.getAppleSimUtilsVersion();\n    if (fields && semver.gt(version, '0.9.10')) {\n      return `--fields ${fields.join(',')}`;\n    }\n\n    return '';\n  }\n}\n\nmodule.exports = AppleSimUtils;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/SimulatorAppCache.js",
    "content": "const path = require('path');\n\nconst { DetoxInternalError, DetoxRuntimeError } = require('../../../../../errors');\nconst { getDetoxAppsCachePath } = require('../../../../../utils/environment');\nconst fse = require('../../../../../utils/fsext');\nconst log = require('../../../../../utils/logger').child({ cat: 'device,app-cache' });\n\nclass SimulatorAppCache {\n  constructor({ applesimutils, rootDir = getDetoxAppsCachePath() }) {\n    this.applesimutils = applesimutils;\n    this.rootDir = rootDir;\n    this.cleanDeviceIds = new Set();\n  }\n\n  /**\n   * Add an app to cache from a binary path\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   * @param {string} binaryPath - Path to the app binary\n   */\n  async add(deviceId, bundleId, binaryPath) {\n    log.trace({ deviceId }, `Caching app (${bundleId}) from binary path: ${binaryPath}`);\n\n    const cacheAppPath = this._getAppCachePath(deviceId, bundleId);\n    await fse.ensureDir(path.dirname(cacheAppPath));\n    await fse.remove(cacheAppPath);\n    await fse.copy(binaryPath, cacheAppPath);\n  }\n\n  /**\n   * Back up an app to cache, if it is not already cached\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   */\n  async backup(deviceId, bundleId) {\n    const appContainerPath = await this.applesimutils.getAppContainer(deviceId, bundleId).catch((reason) => {\n      throw new DetoxRuntimeError({\n        message: `App with bundle ID '${bundleId}' is not installed on this device (${deviceId}). Please install the app first before attempting to reset its state.`,\n        hint: `To check apps installed on the device, use: xcrun simctl listapps ${deviceId}`,\n        debugInfo: reason,\n      });\n    });\n\n    if (!await this.exists(deviceId, bundleId)) {\n      await this.add(deviceId, bundleId, appContainerPath);\n    }\n  }\n\n  /**\n   * Restore an app from cache\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   * @returns {Promise<void>}\n   */\n  async restore(deviceId, bundleId) {\n    log.trace(`Restoring app (${bundleId}) from cache to device (${deviceId})`);\n\n    const cacheAppPath = this._getAppCachePath(deviceId, bundleId);\n\n    if (!await fse.exists(cacheAppPath)) {\n      throw new DetoxInternalError(`No backup found for bundle ID '${bundleId}' on device ${deviceId}. This should not happen unless you're calling SimulatorAppCache#restore() directly.`);\n    }\n\n    await this.applesimutils.install(deviceId, cacheAppPath);\n  }\n\n  /**\n   * Check if an app is cached\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   * @returns {Promise<boolean>} True if the app is cached\n   */\n  async exists(deviceId, bundleId) {\n    const cacheAppPath = this._getAppCachePath(deviceId, bundleId);\n    return await fse.exists(cacheAppPath);\n  }\n\n  /**\n   * Remove cache for a specific app\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   * @returns {Promise<void>}\n   */\n  async remove(deviceId, bundleId) {\n    try {\n      const cacheAppPath = this._getAppCachePath(deviceId, bundleId);\n      if (await fse.remove(cacheAppPath)) {\n        log.trace({ path: cacheAppPath }, `Removed cached app (${bundleId}) for device (${deviceId})`);\n      }\n    } catch (err) {\n      log.warn({ err }, `Failed to remove app cache for ${bundleId} on device ${deviceId}`);\n    }\n  }\n\n  /**\n   * Clean up cache for a device\n   * @param {string} deviceId - The device identifier\n   * @returns {Promise<void>}\n   */\n  async cleanup(deviceId) {\n    try {\n      const deviceCachePath = this._getDeviceCachePath(deviceId);\n      if (await fse.remove(deviceCachePath)) {\n        log.trace({ path: deviceCachePath }, `Cleaned up the app cache for device (${deviceId})`);\n      }\n    } catch (err) {\n      log.warn({ err }, `Failed to cleanup app cache for device ${deviceId}`);\n    }\n\n    this.cleanDeviceIds.add(deviceId);\n  }\n\n  /**\n   * Clean up cache for a device only once per instance.\n   * If the device has already been cleaned, this is a no-op.\n   *\n   * @param {string} deviceId - The device identifier\n   * @returns {Promise<void>}\n   */\n  async cleanupOnce(deviceId) {\n    if (!this.cleanDeviceIds.has(deviceId)) {\n      await this.cleanup(deviceId);\n    }\n  }\n\n  /**\n   * Get the cache path for a specific app on a device\n   * @param {string} deviceId - The device identifier\n   * @param {string} bundleId - The app's bundle identifier\n   * @returns {string} The full path to the cached app\n   * @private\n   */\n  _getAppCachePath(deviceId, bundleId) {\n    return path.join(this._getDeviceCachePath(deviceId), `${bundleId}.app`);\n  }\n\n  /**\n   * Get the device cache directory path\n   * @param {string} deviceId - The device identifier\n   * @returns {string} The device cache directory path\n   * @private\n   */\n  _getDeviceCachePath(deviceId) {\n    return path.join(this.rootDir, deviceId);\n  }\n}\n\nmodule.exports = SimulatorAppCache;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/SimulatorAppCache.test.js",
    "content": "const cp = require('child_process');\n\njest.mock('../../../../../utils/fsext');\njest.mock('../../../../../utils/logger');\njest.mock('../../../../common/drivers/ios/tools/AppleSimUtils');\n\n/** @type {*} */\nconst { getDetoxAppsCachePath } = require('../../../../../utils/environment');\n/** @type {*} */\nconst AppleSimUtils = require('../../../../common/drivers/ios/tools/AppleSimUtils');\n\ndescribe('SimulatorAppCache', () => {\n  let applesimutils;\n  let appCache;\n  let fse;\n  let SimulatorAppCache;\n\n  const deviceId = 'test-device-123';\n  const bundleId = 'com.test.app';\n  const mockAppPath = '/mock/app/path';\n\n  beforeEach(() => {\n    applesimutils = new AppleSimUtils();\n    applesimutils.install.mockResolvedValue();\n\n    // Mock fsext functions\n    fse = jest.requireMock('../../../../../utils/fsext');\n    fse.ensureDir.mockResolvedValue();\n    fse.copy.mockResolvedValue();\n    fse.remove.mockResolvedValue();\n\n    SimulatorAppCache = require('./SimulatorAppCache');\n    appCache = new SimulatorAppCache({ applesimutils });\n  });\n\n  describe('constructor', () => {\n    it('should use default cache path when rootDir not provided', () => {\n      expect(appCache.rootDir).toBe(getDetoxAppsCachePath());\n    });\n\n    it('should use custom rootDir when provided', () => {\n      const customPath = '/custom/cache/path';\n      const customCache = new SimulatorAppCache({ applesimutils, rootDir: customPath });\n      expect(customCache.rootDir).toBe(customPath);\n    });\n  });\n\n  describe('add', () => {\n    const binaryPath = '/path/to/app/binary.app';\n\n    it('should successfully add app to cache from binary path', async () => {\n      await appCache.add(deviceId, bundleId, binaryPath);\n\n      expect(fse.ensureDir).toHaveBeenCalled();\n      expect(fse.remove).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n      expect(fse.copy).toHaveBeenCalledWith(binaryPath, expect.stringContaining(`${bundleId}.app`));\n    });\n\n    it('should remove existing cache before copying', async () => {\n      await appCache.add(deviceId, bundleId, binaryPath);\n\n      expect(fse.remove).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n      expect(fse.copy).toHaveBeenCalledWith(binaryPath, expect.stringContaining(`${bundleId}.app`));\n    });\n  });\n\n  describe('backup', () => {\n    beforeEach(() => {\n      applesimutils.getAppContainer.mockResolvedValue(mockAppPath);\n    });\n\n    it('should successfully back up app to cache', async () => {\n      await appCache.backup(deviceId, bundleId);\n\n      expect(applesimutils.getAppContainer).toHaveBeenCalledWith(deviceId, bundleId);\n      expect(fse.ensureDir).toHaveBeenCalled();\n      expect(fse.copy).toHaveBeenCalledWith(mockAppPath, expect.stringContaining(`${bundleId}.app`));\n    });\n\n    it('should remove existing cache before copying', async () => {\n      await appCache.backup(deviceId, bundleId);\n\n      expect(fse.remove).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n      expect(fse.copy).toHaveBeenCalled();\n    });\n\n    it('should throw error when app not found on device', async () => {\n      applesimutils.getAppContainer.mockImplementation(async () => cp.execSync('node -e process.exitCode=1'));\n      await expect(appCache.backup(deviceId, bundleId)).rejects.toMatchSnapshot();\n    });\n  });\n\n  describe('restore', () => {\n    it('should successfully restore app from cache', async () => {\n      fse.exists.mockResolvedValue(true);\n\n      await appCache.restore(deviceId, bundleId);\n\n      expect(fse.exists).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n      expect(applesimutils.install).toHaveBeenCalledWith(deviceId, expect.stringContaining(`${bundleId}.app`));\n    });\n\n    it('should throw error when cache not found', async () => {\n      fse.exists.mockResolvedValue(false);\n\n      await expect(appCache.restore(deviceId, bundleId)).rejects.toMatchSnapshot();\n    });\n  });\n\n  describe('exists', () => {\n    it('should return true when app exists in cache', async () => {\n      fse.exists.mockResolvedValue(true);\n\n      const result = await appCache.exists(deviceId, bundleId);\n\n      expect(fse.exists).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n      expect(result).toBe(true);\n    });\n\n    it('should return false when app does not exist in cache', async () => {\n      fse.exists.mockResolvedValue(false);\n\n      const result = await appCache.exists(deviceId, bundleId);\n\n      expect(result).toBe(false);\n    });\n  });\n\n  describe('remove', () => {\n    it('should remove app from cache when it exists', async () => {\n      await appCache.remove(deviceId, bundleId);\n\n      expect(fse.remove).toHaveBeenCalledWith(expect.stringContaining(`${bundleId}.app`));\n    });\n\n    it('should handle removal errors gracefully', async () => {\n      fse.remove.mockRejectedValue(new Error('Removal failed'));\n\n      await expect(appCache.remove(deviceId, bundleId)).resolves.not.toThrow();\n    });\n  });\n\n  describe('cleanup', () => {\n    it('should clean up entire device cache', async () => {\n      await appCache.cleanup(deviceId);\n\n      expect(fse.remove).toHaveBeenCalledWith(expect.stringContaining(deviceId));\n    });\n\n    it('should handle cleanup errors gracefully', async () => {\n      fse.remove.mockRejectedValue(new Error('Cleanup failed'));\n\n      await expect(appCache.cleanup(deviceId)).resolves.not.toThrow();\n    });\n  });\n\n  describe('cleanupOnce', () => {\n    it('should clean up device cache on first call', async () => {\n      await appCache.cleanupOnce(deviceId);\n\n      expect(fse.remove).toHaveBeenCalled();\n    });\n\n    it('should not clean up device cache on subsequent calls', async () => {\n      await appCache.cleanupOnce(deviceId);\n      await appCache.cleanupOnce(deviceId);\n\n      expect(fse.remove).toHaveBeenCalledTimes(1);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/__snapshots__/SimulatorAppCache.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`SimulatorAppCache backup should throw error when app not found on device 1`] = `\n[DetoxRuntimeError: App with bundle ID 'com.test.app' is not installed on this device (test-device-123). Please install the app first before attempting to reset its state.\n\nHINT: To check apps installed on the device, use: xcrun simctl listapps test-device-123\n\nCommand failed: node -e process.exitCode=1]\n`;\n\nexports[`SimulatorAppCache restore should throw error when cache not found 1`] = `\n[DetoxInternalError: No backup found for bundle ID 'com.test.app' on device test-device-123. This should not happen unless you're calling SimulatorAppCache#restore() directly.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues]\n`;\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/applesimutils.mock.json",
    "content": "{\n  \"--list\": [\n    {\n      \"deviceType\" : {\n        \"name\" : \"iPhone X\",\n        \"bundlePath\" : \"\\/Applications\\/Xcode.app\\/Contents\\/Developer\\/Platforms\\/iPhoneOS.platform\\/Developer\\/Library\\/CoreSimulator\\/Profiles\\/DeviceTypes\\/iPhone X.simdevicetype\",\n        \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-X\"\n      },\n      \"state\" : \"Shutdown\",\n      \"isAvailable\" : true,\n      \"name\" : \"iPhone X\",\n      \"udid\" : \"FBA6D413-0A3D-466F-BF40-ECC019133E43\",\n      \"os\" : {\n        \"buildversion\" : \"16B91\",\n        \"bundlePath\" : \"\\/Applications\\/Xcode.app\\/Contents\\/Developer\\/Platforms\\/iPhoneOS.platform\\/Developer\\/Library\\/CoreSimulator\\/Profiles\\/Runtimes\\/iOS.simruntime\",\n        \"isAvailable\" : true,\n        \"name\" : \"iOS 12.1\",\n        \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.iOS-12-1\",\n        \"version\" : \"12.1\"\n      }\n    }\n  ]\n}\n\n"
  },
  {
    "path": "detox/src/devices/common/drivers/ios/tools/xcrunSimctlList.mock.json",
    "content": "{\n  \"devicetypes\" : [\n    {\n      \"name\" : \"iPhone 4s\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-4s\"\n    },\n    {\n      \"name\" : \"iPhone 5\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-5\"\n    },\n    {\n      \"name\" : \"iPhone 5s\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-5s\"\n    },\n    {\n      \"name\" : \"iPhone 6\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-6\"\n    },\n    {\n      \"name\" : \"iPhone 6 Plus\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus\"\n    },\n    {\n      \"name\" : \"iPhone 6s\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-6s\"\n    },\n    {\n      \"name\" : \"iPhone 6s Plus\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus\"\n    },\n    {\n      \"name\" : \"iPhone 7\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-7\"\n    },\n    {\n      \"name\" : \"iPhone 7 Plus\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus\"\n    },\n    {\n      \"name\" : \"iPhone 8\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-8\"\n    },\n    {\n      \"name\" : \"iPhone 8 Plus\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus\"\n    },\n    {\n      \"name\" : \"iPhone SE\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-SE\"\n    },\n    {\n      \"name\" : \"iPhone X\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPhone-X\"\n    },\n    {\n      \"name\" : \"iPad 2\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-2\"\n    },\n    {\n      \"name\" : \"iPad Retina\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Retina\"\n    },\n    {\n      \"name\" : \"iPad Air\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Air\"\n    },\n    {\n      \"name\" : \"iPad Air 2\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Air-2\"\n    },\n    {\n      \"name\" : \"iPad (5th generation)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-\"\n    },\n    {\n      \"name\" : \"iPad Pro (9.7-inch)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-\"\n    },\n    {\n      \"name\" : \"iPad Pro (12.9-inch)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Pro\"\n    },\n    {\n      \"name\" : \"iPad Pro (12.9-inch) (2nd generation)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-\"\n    },\n    {\n      \"name\" : \"iPad Pro (10.5-inch)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-\"\n    },\n    {\n      \"name\" : \"Apple TV\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p\"\n    },\n    {\n      \"name\" : \"Apple TV 4K\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K\"\n    },\n    {\n      \"name\" : \"Apple TV 4K (at 1080p)\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p\"\n    },\n    {\n      \"name\" : \"Apple Watch - 38mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm\"\n    },\n    {\n      \"name\" : \"Apple Watch - 42mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm\"\n    },\n    {\n      \"name\" : \"Apple Watch Series 2 - 38mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm\"\n    },\n    {\n      \"name\" : \"Apple Watch Series 2 - 42mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm\"\n    },\n    {\n      \"name\" : \"Apple Watch Series 3 - 38mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm\"\n    },\n    {\n      \"name\" : \"Apple Watch Series 3 - 42mm\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm\"\n    }\n  ],\n  \"runtimes\" : [\n    {\n      \"buildversion\" : \"13C75\",\n      \"availability\" : \"(available)\",\n      \"name\" : \"iOS 9.2\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.iOS-9-2\",\n      \"version\" : \"9.2\"\n    },\n    {\n      \"buildversion\" : \"15C107\",\n      \"availability\" : \"(available)\",\n      \"name\" : \"iOS 11.2\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.iOS-11-2\",\n      \"version\" : \"11.2\"\n    },\n    {\n      \"buildversion\" : \"15E217\",\n      \"availability\" : \"(available)\",\n      \"name\" : \"iOS 11.3\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.iOS-11-3\",\n      \"version\" : \"11.3\"\n    },\n    {\n      \"buildversion\" : \"15L211\",\n      \"availability\" : \"(available)\",\n      \"name\" : \"tvOS 11.3\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.tvOS-11-3\",\n      \"version\" : \"11.3\"\n    },\n    {\n      \"buildversion\" : \"15T212\",\n      \"availability\" : \"(available)\",\n      \"name\" : \"watchOS 4.3\",\n      \"identifier\" : \"com.apple.CoreSimulator.SimRuntime.watchOS-4-3\",\n      \"version\" : \"4.3\"\n    }\n  ],\n  \"devices\" : {\n    \"watchOS 4.3\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"C6EC2279-A6EB-40BE-99D2-5F11949F25E5\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"498D4237-8640-43A7-BC80-61F112287C61\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"68B8DF0C-9837-49B9-BDB4-A6C6E34BA6EB\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"84D9A184-FDF3-4666-9B45-765E2DA1867A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch Series 3 - 38mm\",\n        \"udid\" : \"D08B8137-371E-424C-B067-F659B9CDCFAC\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple Watch Series 3 - 42mm\",\n        \"udid\" : \"3B04A39B-5BAC-4523-B23E-847B20672959\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.watchOS-2-2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"631E3AFD-DDB4-406A-A668-556D4FEDF07C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"6E2F9E53-7659-476A-9C14-5E48C428BC36\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.watchOS-3-1\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"240C26E6-FE33-41A3-8EF0-7858DA2F53B6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"C5366104-3578-4E59-9212-F2B3138D7A9E\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"06636736-4EE6-4CBF-9D5F-436CF2260448\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"DA3753BB-0B7D-4745-9530-9F2A08356A75\"\n      }\n    ],\n    \"tvOS 11.3\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple TV\",\n        \"udid\" : \"84CCF063-F06F-409E-A264-F3971CB899AF\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple TV 4K\",\n        \"udid\" : \"5F5EC33F-55CF-4917-8509-789240BE3598\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"Apple TV 4K (at 1080p)\",\n        \"udid\" : \"962331E1-1D80-4644-89ED-BFFB46EBE7E3\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.watchOS-4-0\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"98631D9A-A2B3-4752-8A3E-92E990BAE106\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"79E7E680-0D9F-40A2-9EE4-2F7EB351A094\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"6812D5A9-2931-467F-A349-7F46953B0F32\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"70FB6CDE-A5CB-4995-9CCB-9288E93C7308\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 3 - 38mm\",\n        \"udid\" : \"F080A29E-2615-46D3-B32E-D0C27EAC7D58\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 3 - 42mm\",\n        \"udid\" : \"2F5B3F90-3279-4542-A08E-0A10578DBDE7\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.iOS-10-3\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5\",\n        \"udid\" : \"D4D2213B-1A98-4EBD-8E03-F52B4E739B45\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"F069D970-41D1-44C6-A1B1-8C0E3A10D5A0\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"15DD6668-072D-444E-BD56-C143665F6CD6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"908DC74E-FA0B-48FE-AD88-6FBBCB017250\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"6609FFB6-08C8-4195-ADBE-D1EDC4004ECF\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"08E4145F-5AE4-4BD2-8937-169F7793E6E2\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"1187FB7A-61B9-4892-B812-4E97C950C1A9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"D12A1E7C-3E50-4168-8731-AE8DFB702C6C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"ABDC82BE-A1AA-4AC3-AC63-20C3200CA868\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"36E04E65-EDC4-4199-9B8D-F5F20D907BE9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"9B5CEB84-A78B-471D-BCDF-A5406A2C78B9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad (5th generation)\",\n        \"udid\" : \"EE27F2B8-4ECA-48D5-9AAA-5B6B71E4B47A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (9.7 inch)\",\n        \"udid\" : \"DF67BCEB-1E98-4862-8E29-4262E45C36DD\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9 inch)\",\n        \"udid\" : \"464C614E-0B52-459E-81F8-5D48E6726A01\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9-inch) (2nd generation)\",\n        \"udid\" : \"4243CB58-55C7-4668-8F75-868B6FC1E411\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (10.5-inch)\",\n        \"udid\" : \"FA595536-1EFD-412E-8FC8-4E9945CF59A1\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.iOS-10-2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5\",\n        \"udid\" : \"601A6052-401B-4D5F-9969-D1B252BFB63A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"AC2800F6-6B9F-4952-BDAD-28A0F43B621C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"5FE03940-89F3-4DED-B924-9DD0630C5D3B\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"4E51342E-1F41-45ED-A6EA-6313FDED9E27\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"D39174C7-0DCB-4881-BD1C-18A7C82B1DC4\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"BE906158-376A-4733-A6ED-65E2B79B2351\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"A3C93900-6D17-4830-8FBE-E102E4BBCBB9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"AE64887B-7B6F-439E-8039-99D43FD1FD8C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"109BD1B5-21D0-491C-998D-98EC6F2E6AD3\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Retina\",\n        \"udid\" : \"555728C2-B1FF-410B-B096-83EC1F491BE2\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"21A8B777-4B51-4A7B-9788-1A0E39727614\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air - 2\",\n        \"udid\" : \"0A607DDB-9785-430E-8561-2E0B4B367E0E\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"95F63516-E360-49CF-B576-FB93EEFE0A1F\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (9.7 inch)\",\n        \"udid\" : \"B3E96CEE-622A-4B36-8D19-5FB3165155CB\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9 inch)\",\n        \"udid\" : \"FACC38D5-1F64-4081-9078-378C4B51C582\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.iOS-10-1\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5\",\n        \"udid\" : \"69E9738A-271D-409E-AAF8-F843C2C9CB3B\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"6CA27F3D-0F40-4BDF-81F7-D5799181F1F7\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"CB66B6DD-393A-436A-A52D-9D22A332CC65\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"F2A4AE49-FC71-43F2-B9C4-2BF0398549A7\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"2828C5F5-540F-470C-A17D-82A3E401E855\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"6249369E-BBE7-4A27-B1AC-B079209C74EC\"\n      },\n      {\n        \"state\" : \"Creating\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"9C9ABE4D-70C7-49DC-A396-3CB1D0E82846\"\n      },\n      {\n        \"state\" : \"Creating\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"8C2A47A6-A415-4A5F-8372-4FF4CA232BD8\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"39CDBD89-A8CB-42E9-B4EB-E28E2958E4C9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Retina\",\n        \"udid\" : \"9C029A8A-7096-4CA1-94DD-EA8F720C5FD9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"D1CE0B39-B724-438B-935D-97C915817B19\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"193D0394-2580-44DC-8A04-F5823FB039CC\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (9.7 inch)\",\n        \"udid\" : \"518D94EB-75B2-453D-A141-7A1E1F49F382\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9 inch)\",\n        \"udid\" : \"058A009B-4348-4281-8B9C-B5C0CE06EFF8\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.iOS-11-0\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"0A66E373-5A8D-4C43-9E67-DF88CAE6263C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"739D456A-A219-411E-8F11-409B5B9C76E7\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"2F84EC3D-ED0E-4D8A-9902-1F3FC1A9851A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"08973AB7-9BDB-4BC0-9DF1-CA8D01B59E03\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"551A4179-C45E-44BF-82CD-235D410ECAC3\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"07F56D62-25E9-4119-95CE-69E87350D1D4\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 8\",\n        \"udid\" : \"A84142C2-3E25-49C2-AFA3-EF7046AB55D6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"E8170B7C-98DC-4EA2-AA76-DF41CC546634\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone2017-B-Detox\",\n        \"udid\" : \"F9DF6AB8-C186-4E38-9D56-2BAA3729EC20\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"095EBCAC-5BF3-4B1E-83BD-483B9AEA25AE\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone X\",\n        \"udid\" : \"D53474CF-7DD1-4673-8517-E75DAD6C34D6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"9FB9BBB8-A04E-4FEA-83A4-769243D3047A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"9DEBD82B-4F4D-4FBF-8612-44440C2F1130\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad (5th generation)\",\n        \"udid\" : \"EEC5C875-1E7F-430D-BE85-AB77C713C7CC\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (9.7-inch)\",\n        \"udid\" : \"054F9054-251E-4748-98A9-247F95CFE324\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9-inch)\",\n        \"udid\" : \"49AD50FC-8201-43F3-8AFB-03A80B9910D4\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (12.9-inch) (2nd generation)\",\n        \"udid\" : \"BA18412F-5BB4-40B6-8C0C-D49E88343632\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro (10.5-inch)\",\n        \"udid\" : \"A8E67E06-D791-46E8-835D-9EA26900166A\"\n      }\n    ],\n    \"iOS 11.2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"AA74BAAB-6253-457D-90F3-294F15299CD6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"418B18D4-26EE-46AC-B76D-6574A6DDC4A0\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"85474103-1335-4047-A4D5-91C4D1CDBD58\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"90010B41-74A6-40DC-AEC9-974E4F6264E7\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"2BA073FB-6172-4334-A655-2B31C6C82657\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"06962D58-6401-45F5-82F7-413977796685\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"34B6906D-9A1A-440B-96CD-34CC3C3E1720\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8\",\n        \"udid\" : \"2A62AB9F-5592-46EB-BAA4-725424DF0D79\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"BA78368D-C17E-4804-A566-C9113C2AD0C6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"A0FEE9AE-A47F-4702-BEEF-BF7CDCB0E07F\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8 Plus-Detox\",\n        \"udid\" : \"700BA886-CF0F-4264-85AE-48DF552B61DC\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"203BB3AB-1DF7-4E42-9725-F6A536D3AD00\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone X\",\n        \"udid\" : \"DF1DBE73-B9B0-4754-A2AD-40CDB50E0D2D\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"B29729B8-4B5C-45DB-BA50-86E5F50CC4DB\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"DA9863FC-0FBF-43A0-A505-A47AB05E4895\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad (5th generation)\",\n        \"udid\" : \"D360469E-B8F5-4303-B95A-1BB44606EC14\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (9.7-inch)\",\n        \"udid\" : \"0AE4EEEB-013D-49F9-AEAB-ED52D293AFA5\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (12.9-inch)\",\n        \"udid\" : \"1DDD896F-FA47-4E3F-8977-1C6196A2835E\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (12.9-inch) (2nd generation)\",\n        \"udid\" : \"DA4721B5-AFD4-4A73-BCC3-ED19640B7AED\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (10.5-inch)\",\n        \"udid\" : \"5069E6F3-92EC-41FE-919B-26289FF3A3A4\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-10-2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"40EDC654-D61C-4B8D-B277-95D67D543DD3\"\n      }\n    ],\n    \"iOS 11.3\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"39B78018-71A0-48B0-8154-A6603D559984\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"A50461D5-1FDD-4231-BBE6-FE861646E95B\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"35F6AC74-F66C-4A20-943F-8C9D64BE790E\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"0D16FA74-F551-4113-9F5F-84D452CABF6A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"2459F12D-2D36-46B2-B947-D9A90B6C6A42\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"10027F45-177A-47EB-AD7E-24103CB75AFF\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"E32FE642-DD89-482B-BE16-4EBDAD3A6117\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8\",\n        \"udid\" : \"DDD18C72-F2BC-4DD5-8312-D5E7066C37AB\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"E99A163B-1D42-4F8E-801A-B59B90F09B0C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone SE\",\n        \"udid\" : \"94DA9917-F76E-4CE9-A53E-88D2F76270E9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone X\",\n        \"udid\" : \"A48A5681-0859-41C1-A05C-1210FE1CC07B\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"38279B65-D75D-4544-BA09-1AA7D1F8BE7A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"B7DD7F19-AFCE-42AC-96FC-B3414A5A643B\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad (5th generation)\",\n        \"udid\" : \"4CF3B64A-A77F-402C-98A1-008256C57630\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (9.7-inch)\",\n        \"udid\" : \"BCF27E08-E4DF-451F-86FC-0205C0797040\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (12.9-inch)\",\n        \"udid\" : \"2F2DEC15-B92C-4D5E-AECC-E5BD01F694C7\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (12.9-inch) (2nd generation)\",\n        \"udid\" : \"FAEF24DF-877D-4C65-9754-F3E0D54F5B80\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPad Pro (10.5-inch)\",\n        \"udid\" : \"A5BFDF79-9AC5-4ABF-91F7-BCEB6E7877FA\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-10-1\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"95A9A35D-9C9D-4360-A266-1AB1D5D0A8CA\"\n      }\n    ],\n    \"iOS 9.2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \"(available)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"9E22FA5C-1225-4BB0-9883-03AA139BA731\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-10-0\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"9EC2F2E1-3FCC-4635-BC69-7558AB64E2B8\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.watchOS-3-2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"65216D2D-8329-4720-B7B7-56DE1DA223DE\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"B288646D-8B92-4799-A5F8-55ACF7EAB4FC\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"C41A6B35-7FBD-4A25-BC59-A11DD490E543\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"1089EFA6-E851-42DD-B88F-945193DBC47C\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-9-2\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"86C23AE7-E9E0-4358-91EB-DEA118CF5B4C\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-9-1\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"3727084D-1D11-4D5F-B1C9-AE12D9EA25D0\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.tvOS-11-0\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 1080p\",\n        \"udid\" : \"4F521FFA-99FF-4815-B1FE-0B19AC2A740D\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 4K\",\n        \"udid\" : \"C0A6390F-C364-4922-AE22-C983A46409A3\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"Apple TV 4K (at 1080p)\",\n        \"udid\" : \"8C1B1F1E-5FED-449F-A918-6C0E808EAA3D\"\n      }\n    ],\n    \"com.apple.CoreSimulator.SimRuntime.iOS-9-3\" : [\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 4s\",\n        \"udid\" : \"A0C05A53-04A7-4D19-BEC9-5BF961483DD9\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5\",\n        \"udid\" : \"6AEBE78B-E6B3-443B-8B8F-D91F8E766A23\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 5s\",\n        \"udid\" : \"F2132AC3-CECF-4EAF-9763-58CE584A1C94\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6\",\n        \"udid\" : \"A26635FD-0DCA-4679-9934-19AA7DEC59DB\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6 Plus\",\n        \"udid\" : \"03743681-7CA5-47C2-B4F8-CF8D03272FB6\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"291E8BFF-2576-43A1-9B14-AF07937BED6A\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"FA4ACAFA-8CA1-4EF0-B594-6A856C006B51\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad 2\",\n        \"udid\" : \"FEF98A7E-0630-4C4C-83C1-1FB7F2129D83\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Retina\",\n        \"udid\" : \"FBCD1D2D-B9AC-4201-B850-BB6363CA2D7C\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air\",\n        \"udid\" : \"85D3A5F6-E982-4751-8C2F-3FB68A6ED2E4\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Air 2\",\n        \"udid\" : \"CAE43B00-1766-4804-8D4B-99A48B8D7858\"\n      },\n      {\n        \"state\" : \"Shutdown\",\n        \"availability\" : \" (unavailable, runtime profile not found)\",\n        \"name\" : \"iPad Pro\",\n        \"udid\" : \"880C4E47-C6DC-45F8-BDF6-8B167561C274\"\n      }\n    ]\n  },\n  \"pairs\" : {\n    \"997DB5F5-8B56-4DE6-A753-B56E8719FA18\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"B288646D-8B92-4799-A5F8-55ACF7EAB4FC\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"08E4145F-5AE4-4BD2-8937-169F7793E6E2\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"21CC02B2-F853-40BE-96D1-B9607EBFDE31\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch - 42mm\",\n        \"udid\" : \"6E2F9E53-7659-476A-9C14-5E48C428BC36\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 6s Plus\",\n        \"udid\" : \"FA4ACAFA-8CA1-4EF0-B594-6A856C006B51\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"A5DC73DC-7CFB-4B28-8EC4-F403BDDA3E73\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"98631D9A-A2B3-4752-8A3E-92E990BAE106\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"08973AB7-9BDB-4BC0-9DF1-CA8D01B59E03\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"D5FF253C-4716-4335-81E5-5205D108DD90\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"70FB6CDE-A5CB-4995-9CCB-9288E93C7308\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"07F56D62-25E9-4119-95CE-69E87350D1D4\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"43CCD05A-9B61-42BF-8609-83CEFF47C683\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 3 - 38mm\",\n        \"udid\" : \"F080A29E-2615-46D3-B32E-D0C27EAC7D58\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 8\",\n        \"udid\" : \"A84142C2-3E25-49C2-AFA3-EF7046AB55D6\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"B6D42DDC-5779-401D-BA30-6BECB6CCAF95\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"1089EFA6-E851-42DD-B88F-945193DBC47C\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"D12A1E7C-3E50-4168-8731-AE8DFB702C6C\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"B657FA55-A960-4089-84FC-288C093A615B\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 3 - 42mm\",\n        \"udid\" : \"3B04A39B-5BAC-4523-B23E-847B20672959\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"E99A163B-1D42-4F8E-801A-B59B90F09B0C\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(active, disconnected)\"\n    },\n    \"5B8FD9F2-1A06-403A-9B70-588D3ECA304E\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"631E3AFD-DDB4-406A-A668-556D4FEDF07C\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"291E8BFF-2576-43A1-9B14-AF07937BED6A\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"83D9FFEA-D9E0-4A24-A65C-3B3DE9ECBD34\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch - 38mm\",\n        \"udid\" : \"65216D2D-8329-4720-B7B7-56DE1DA223DE\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 6s\",\n        \"udid\" : \"6609FFB6-08C8-4195-ADBE-D1EDC4004ECF\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"77ADF31D-FFBC-4415-B5F7-CB1C17B822F2\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"6812D5A9-2931-467F-A349-7F46953B0F32\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"551A4179-C45E-44BF-82CD-235D410ECAC3\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"BDB6FE82-D93B-4979-9559-C570C176FBF0\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"DA3753BB-0B7D-4745-9530-9F2A08356A75\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"AE64887B-7B6F-439E-8039-99D43FD1FD8C\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"395AFC29-C727-404F-ACBA-6D81A7D499EC\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 3 - 42mm\",\n        \"udid\" : \"2F5B3F90-3279-4542-A08E-0A10578DBDE7\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 8 Plus\",\n        \"udid\" : \"E8170B7C-98DC-4EA2-AA76-DF41CC546634\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"AF4B7649-054B-40A6-A5BC-F2A0915863A3\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"06636736-4EE6-4CBF-9D5F-436CF2260448\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"A3C93900-6D17-4830-8FBE-E102E4BBCBB9\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"0CFC50E9-BABF-47C0-8668-BAA97E8CCB83\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"C41A6B35-7FBD-4A25-BC59-A11DD490E543\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"1187FB7A-61B9-4892-B812-4E97C950C1A9\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(unavailable)\"\n    },\n    \"5A604D2C-2774-465C-A3B6-0C0BFA8DAF54\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 3 - 38mm\",\n        \"udid\" : \"D08B8137-371E-424C-B067-F659B9CDCFAC\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 8\",\n        \"udid\" : \"DDD18C72-F2BC-4DD5-8312-D5E7066C37AB\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(active, disconnected)\"\n    },\n    \"F6A07D71-D43A-42BE-BFBF-CD4C5A224D1C\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 38mm\",\n        \"udid\" : \"68B8DF0C-9837-49B9-BDB4-A6C6E34BA6EB\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7\",\n        \"udid\" : \"10027F45-177A-47EB-AD7E-24103CB75AFF\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(active, disconnected)\"\n    },\n    \"016936FC-0A77-4BD5-950B-951FBD1798A2\" : {\n      \"watch\" : {\n        \"name\" : \"Apple Watch Series 2 - 42mm\",\n        \"udid\" : \"84D9A184-FDF3-4666-9B45-765E2DA1867A\",\n        \"state\" : \"Shutdown\"\n      },\n      \"phone\" : {\n        \"name\" : \"iPhone 7 Plus\",\n        \"udid\" : \"E32FE642-DD89-482B-BE16-4EBDAD3A6117\",\n        \"state\" : \"Shutdown\"\n      },\n      \"state\" : \"(active, disconnected)\"\n    }\n  }\n}\n"
  },
  {
    "path": "detox/src/devices/cookies/index.js",
    "content": ""
  },
  {
    "path": "detox/src/devices/runtime/RuntimeDevice.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst debug = require('../../utils/debug'); // debug utils, leave here even if unused\nconst log = require('../../utils/logger').child({ cat: 'device' });\nconst mapDeviceLongPressArguments = require('../../utils/mapDeviceLongPressArguments');\nconst traceMethods = require('../../utils/traceMethods');\nconst wrapWithStackTraceCutter = require('../../utils/wrapWithStackTraceCutter');\n\nconst LaunchArgsEditor = require('./utils/LaunchArgsEditor');\n\nclass RuntimeDevice {\n  constructor({\n    appsConfig,\n    behaviorConfig,\n    deviceConfig,\n    eventEmitter,\n    sessionConfig,\n    runtimeErrorComposer,\n  }, deviceDriver) {\n    const methodNames = [\n      'captureViewHierarchy',\n      'clearKeychain',\n      'disableSynchronization',\n      'enableSynchronization',\n      'generateViewHierarchyXml',\n      'installApp',\n      'installUtilBinaries',\n      'launchApp',\n      'matchFace',\n      'matchFinger',\n      'openURL',\n      'pressBack',\n      'relaunchApp',\n      'reloadReactNative',\n      'resetAppState',\n      'resetContentAndSettings',\n      'resetStatusBar',\n      'reverseTcpPort',\n      'selectApp',\n      'sendToHome',\n      'sendUserActivity',\n      'sendUserNotification',\n      'setBiometricEnrollment',\n      'setLocation',\n      'setOrientation',\n      'setStatusBar',\n      'setURLBlacklist',\n      'shake',\n      'takeScreenshot',\n      'terminateApp',\n      'uninstallApp',\n      'unmatchFace',\n      'unmatchFinger',\n      'unreverseTcpPort',\n    ];\n\n    traceMethods(log, this, methodNames);\n    wrapWithStackTraceCutter(this, methodNames);\n\n    this._appsConfig = appsConfig;\n    this._behaviorConfig = behaviorConfig;\n    this._deviceConfig = deviceConfig;\n    this._sessionConfig = sessionConfig;\n    this._emitter = eventEmitter;\n    this._errorComposer = runtimeErrorComposer;\n\n    /** @type {Detox.DetoxAppConfig | null} */\n    this._currentApp = null;\n    this._currentAppLaunchArgs = new LaunchArgsEditor();\n    this._processes = {};\n\n    this.deviceDriver = deviceDriver;\n    this.deviceDriver.validateDeviceConfig(deviceConfig);\n    this.debug = debug;\n  }\n\n  get id() {\n    return this.deviceDriver.getExternalId();\n  }\n\n  get name() {\n    return this.deviceDriver.getDeviceName();\n  }\n\n  get type() {\n    return this._deviceConfig.type;\n  }\n\n  get appLaunchArgs() {\n    return this._currentAppLaunchArgs;\n  }\n\n  async selectApp(name) {\n    if (name === undefined) {\n      throw this._errorComposer.cantSelectEmptyApp();\n    }\n\n    if (this._currentApp) {\n      await this.terminateApp();\n    }\n\n    if (name === null) { // Internal use to unselect the app\n      this._currentApp = null;\n      return;\n    }\n\n    const appConfig = this._appsConfig[name];\n    if (!appConfig) {\n      throw this._errorComposer.cantFindApp(name);\n    }\n\n    this._currentApp = appConfig;\n    this._currentAppLaunchArgs.reset();\n    this._currentAppLaunchArgs.modify(this._currentApp.launchArgs);\n    await this._inferBundleIdFromBinary();\n  }\n\n  async launchApp(params = {}, bundleId = this._bundleId) {\n    const payloadParams = ['url', 'userNotification', 'userActivity'];\n    const hasPayload = this._assertHasSingleParam(payloadParams, params);\n    const newInstance = params.newInstance !== undefined\n      ? params.newInstance\n      : this._processes[bundleId] == null;\n\n    if (params.resetAppState) {\n      await this.terminateApp(bundleId);\n      await this.resetAppState(bundleId);\n    } else if (params.delete) {\n      await this.terminateApp(bundleId);\n      await this.uninstallApp();\n      await this.installApp();\n    } else if (newInstance) {\n      await this.terminateApp(bundleId);\n    }\n\n    const baseLaunchArgs = {\n      ...this._currentAppLaunchArgs.get(),\n      ...params.launchArgs,\n    };\n\n    if (params.url) {\n      baseLaunchArgs['detoxURLOverride'] = params.url;\n      if (params.sourceApp) {\n        baseLaunchArgs['detoxSourceAppOverride'] = params.sourceApp;\n      }\n    } else if (params.userNotification) {\n      this._createPayloadFileAndUpdatesParamsObject('userNotification', 'detoxUserNotificationDataURL', params, baseLaunchArgs);\n    } else if (params.userActivity) {\n      this._createPayloadFileAndUpdatesParamsObject('userActivity', 'detoxUserActivityDataURL', params, baseLaunchArgs);\n    }\n\n    if (params.permissions) {\n      await this.deviceDriver.setPermissions(bundleId, params.permissions);\n    }\n\n    if (params.disableTouchIndicators) {\n      baseLaunchArgs['detoxDisableTouchIndicators'] = true;\n    }\n\n    if (this._isAppRunning(bundleId) && hasPayload) {\n      await this.deviceDriver.deliverPayload({ ...(params), delayPayload: true });\n    }\n\n    if (this._behaviorConfig.launchApp === 'manual') {\n      this._processes[bundleId] = await this.deviceDriver.waitForAppLaunch(bundleId, this._prepareLaunchArgs(baseLaunchArgs), params.languageAndLocale);\n    } else {\n      this._processes[bundleId] = await this.deviceDriver.launchApp(bundleId, this._prepareLaunchArgs(baseLaunchArgs), params.languageAndLocale);\n      await this.deviceDriver.waitUntilReady();\n      await this.deviceDriver.waitForActive();\n    }\n\n    await this._emitter.emit('appReady', {\n      deviceId: this.deviceDriver.getExternalId(),\n      bundleId,\n      pid: this._processes[bundleId],\n    });\n\n    if (params.detoxUserNotificationDataURL) {\n      await this.deviceDriver.cleanupRandomDirectory(params.detoxUserNotificationDataURL);\n    }\n\n    if (params.detoxUserActivityDataURL) {\n      await this.deviceDriver.cleanupRandomDirectory(params.detoxUserActivityDataURL);\n    }\n  }\n\n  async relaunchApp(params = {}, bundleId) {\n    if (params.newInstance === undefined) {\n      params['newInstance'] = true;\n    }\n    await this.launchApp(params, bundleId);\n  }\n\n  async takeScreenshot(name) {\n    if (!name) {\n      throw new DetoxRuntimeError('Cannot take a screenshot with an empty name.');\n    }\n\n    return this.deviceDriver.takeScreenshot(name);\n  }\n\n  async captureViewHierarchy(name = 'capture') {\n    return this.deviceDriver.captureViewHierarchy(name);\n  }\n\n  async generateViewHierarchyXml(shouldInjectTestIds = false) {\n    return await this.deviceDriver.generateViewHierarchyXml(shouldInjectTestIds);\n  }\n\n  async sendToHome() {\n    await this.deviceDriver.sendToHome();\n    await this.deviceDriver.waitForBackground();\n  }\n\n  async setBiometricEnrollment(toggle) {\n    const yesOrNo = toggle ? 'YES' : 'NO';\n    await this.deviceDriver.setBiometricEnrollment(yesOrNo);\n  }\n\n  async matchFace() {\n    await this.deviceDriver.matchFace();\n    await this.deviceDriver.waitForActive();\n  }\n\n  async unmatchFace() {\n    await this.deviceDriver.unmatchFace();\n    await this.deviceDriver.waitForActive();\n  }\n\n  async matchFinger() {\n    await this.deviceDriver.matchFinger();\n    await this.deviceDriver.waitForActive();\n  }\n\n  async unmatchFinger() {\n    await this.deviceDriver.unmatchFinger();\n    await this.deviceDriver.waitForActive();\n  }\n\n  async shake() {\n    await this.deviceDriver.shake();\n  }\n\n  async terminateApp(bundleId) {\n    const _bundleId = bundleId || this._bundleId;\n    await this.deviceDriver.terminate(_bundleId);\n    this._processes[_bundleId] = undefined;\n  }\n\n  async installApp(binaryPath, testBinaryPath) {\n    const currentApp = binaryPath ? { binaryPath, testBinaryPath } : this._getCurrentApp();\n    await this.deviceDriver.installApp(currentApp.binaryPath, currentApp.testBinaryPath);\n\n    // This abstraction leaks because our drivers themselves leak,\n    // so don't blame me - DeviceBaseDriver itself has `reverseTcpPort`,\n    // setting a vicious downward spiral. I can't refactor everything\n    // in a single pull request, so let's bear with it for now.\n    if (Array.isArray(currentApp.reversePorts)) {\n      for (const port of currentApp.reversePorts) {\n        await this.reverseTcpPort(port);\n      }\n    }\n  }\n\n  async uninstallApp(bundleId) {\n    const _bundleId = bundleId || this._bundleId;\n    await this.deviceDriver.uninstallApp(_bundleId);\n  }\n\n  async resetAppState(...bundleIds) {\n    const _bundleIds = bundleIds.length > 0 ? bundleIds : [this._bundleId];\n    await this.deviceDriver.resetAppState(..._bundleIds);\n  }\n\n  async installUtilBinaries() {\n    const paths = this._deviceConfig.utilBinaryPaths;\n    if (paths) {\n      await this.deviceDriver.installUtilBinaries(paths);\n    }\n  }\n\n  async reloadReactNative() {\n    await this.deviceDriver.reloadReactNative();\n  }\n\n  async openURL(params) {\n    if (typeof params !== 'object' || !params.url) {\n      throw new DetoxRuntimeError(`openURL must be called with JSON params, and a value for 'url' key must be provided. example: await device.openURL({url: \"url\", sourceApp[optional]: \"sourceAppBundleID\"}`);\n    }\n\n    await this.deviceDriver.deliverPayload(params);\n  }\n\n  async setOrientation(orientation) {\n    await this.deviceDriver.setOrientation(orientation);\n  }\n\n  async tap(point, shouldIgnoreStatusBar) {\n    await this.deviceDriver.tap(point, shouldIgnoreStatusBar, this._bundleId);\n  }\n\n  async longPress(arg1, arg2, arg3) {\n    let { point, duration, shouldIgnoreStatusBar } = mapDeviceLongPressArguments(arg1, arg2, arg3);\n\n    await this.deviceDriver.longPress(point, duration, shouldIgnoreStatusBar, this._bundleId);\n  }\n\n  async setLocation(lat, lon) {\n    lat = String(lat);\n    lon = String(lon);\n    await this.deviceDriver.setLocation(lat, lon);\n  }\n\n  async reverseTcpPort(port) {\n    await this.deviceDriver.reverseTcpPort(port);\n  }\n\n  async unreverseTcpPort(port) {\n    await this.deviceDriver.unreverseTcpPort(port);\n  }\n\n  async clearKeychain() {\n    await this.deviceDriver.clearKeychain();\n  }\n\n  async sendUserActivity(params) {\n    await this._sendPayload('detoxUserActivityDataURL', params);\n  }\n\n  async sendUserNotification(params) {\n    await this._sendPayload('detoxUserNotificationDataURL', params);\n  }\n\n  async setURLBlacklist(urlList) {\n    await this.deviceDriver.setURLBlacklist(urlList);\n  }\n\n  async enableSynchronization() {\n    await this.deviceDriver.enableSynchronization();\n  }\n\n  async disableSynchronization() {\n    await this.deviceDriver.disableSynchronization();\n  }\n\n  async resetContentAndSettings() {\n    await this.deviceDriver.resetContentAndSettings();\n  }\n\n  getPlatform() {\n    return this.deviceDriver.getPlatform();\n  }\n\n  async _cleanup() {\n    const bundleId = this._currentApp && this._currentApp.bundleId;\n    await this.deviceDriver.cleanup(bundleId);\n  }\n\n  async pressBack() {\n    await this.deviceDriver.pressBack();\n  }\n\n  getUiDevice() {\n    return this.deviceDriver.getUiDevice();\n  }\n\n  async setStatusBar(params) {\n    await this.deviceDriver.setStatusBar(params);\n  }\n\n  async resetStatusBar() {\n    await this.deviceDriver.resetStatusBar();\n  }\n\n  /**\n   * @internal\n   */\n  async _typeText(text) {\n    await this.deviceDriver.typeText(text);\n  }\n\n  get _bundleId() {\n    return this._getCurrentApp().bundleId;\n  }\n\n  _getCurrentApp() {\n    if (!this._currentApp) {\n      throw this._errorComposer.appNotSelected();\n    }\n    return this._currentApp;\n  }\n  async _sendPayload(key, params) {\n    const payloadFilePath = this.deviceDriver.createPayloadFile(params);\n    const payload = {\n      [key]: payloadFilePath,\n    };\n    await this.deviceDriver.deliverPayload(payload);\n    this.deviceDriver.cleanupRandomDirectory(payloadFilePath);\n  }\n\n  _createPayloadFileAndUpdatesParamsObject(key, launchKey, params, baseLaunchArgs) {\n    const payloadFilePath = this.deviceDriver.createPayloadFile(params[key]);\n    baseLaunchArgs[launchKey] = payloadFilePath;\n    //`params` will be used later for `predeliverPayload`, so remove the actual notification and add the file URL\n    delete params[key];\n    params[launchKey] = payloadFilePath;\n  }\n\n  _isAppRunning(bundleId = this._bundleId) {\n    return this._processes[bundleId] != null;\n  }\n\n  _assertHasSingleParam(singleParams, params) {\n    let paramsCounter = 0;\n\n    singleParams.forEach((item) => {\n      if(params[item]) {\n        paramsCounter += 1;\n      }\n    });\n\n    if (paramsCounter > 1) {\n      throw new DetoxRuntimeError(`Call to 'launchApp(${JSON.stringify(params)})' must contain only one of ${JSON.stringify(singleParams)}.`);\n    }\n\n    return (paramsCounter === 1);\n  }\n\n  _prepareLaunchArgs(additionalLaunchArgs) {\n    return {\n      detoxServer: this._sessionConfig.server,\n      detoxSessionId: this._sessionConfig.sessionId,\n      ...additionalLaunchArgs\n    };\n  }\n\n  async _inferBundleIdFromBinary() {\n    const { binaryPath, bundleId } = this._currentApp;\n\n    if (!bundleId) {\n      this._currentApp.bundleId = await this.deviceDriver.getBundleIdFromBinary(binaryPath);\n    }\n  }\n}\n\nmodule.exports = RuntimeDevice;\n"
  },
  {
    "path": "detox/src/devices/runtime/RuntimeDevice.test.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\n\nconst configurationsMock = require('../../configuration/configurations.mock');\n\ndescribe('Device', () => {\n  const bundleId = 'test.bundle';\n\n  let DeviceDriverBase;\n  let DetoxRuntimeErrorComposer;\n  let errorComposer;\n  let emitter;\n  let RuntimeDevice;\n  let Client;\n  let client;\n  let driverMock;\n\n  beforeEach(async () => {\n    jest.mock('../../utils/logger');\n\n    jest.mock('./drivers/DeviceDriverBase');\n    DeviceDriverBase = require('./drivers/DeviceDriverBase');\n\n    jest.mock('../../client/Client');\n    Client = require('../../client/Client');\n\n    jest.mock('../../utils/AsyncEmitter');\n    const AsyncEmitter = require('../../utils/AsyncEmitter');\n    emitter = new AsyncEmitter({});\n    DetoxRuntimeErrorComposer = require('../../errors/DetoxRuntimeErrorComposer');\n\n    RuntimeDevice = require('./RuntimeDevice');\n  });\n\n  beforeEach(async () => {\n    client = new Client(configurationsMock.validSession);\n    await client.connect();\n\n    driverMock = new DeviceDriverMock();\n  });\n\n  class DeviceDriverMock {\n    constructor() {\n      this.driver = new DeviceDriverBase({\n        client,\n        emitter,\n      });\n    }\n\n    expectExternalIdCalled() {\n      expect(this.driver.getExternalId).toHaveBeenCalled();\n    }\n\n    expectLaunchCalledWithArgs(bundleId, expectedArgs, languageAndLocale) {\n      expect(this.driver.launchApp).toHaveBeenCalledWith(bundleId, expectedArgs, languageAndLocale);\n    }\n\n    expectLaunchCalledContainingArgs(expectedArgs) {\n      expect(this.driver.launchApp).toHaveBeenCalledWith(\n        this.driver.getBundleIdFromBinary(),\n        expect.objectContaining(expectedArgs),\n        undefined);\n    }\n\n    expectWaitForLaunchCalled(bundleId, expectedArgs, languageAndLocale) {\n      expect(this.driver.waitForAppLaunch).toHaveBeenCalledWith(bundleId, expectedArgs, languageAndLocale);\n    }\n\n    expectReinstallCalled() {\n      expect(this.driver.uninstallApp).toHaveBeenCalled();\n      expect(this.driver.installApp).toHaveBeenCalled();\n    }\n\n    expectReinstallNotCalled() {\n      expect(this.driver.uninstallApp).not.toHaveBeenCalled();\n      expect(this.driver.installApp).not.toHaveBeenCalled();\n    }\n\n    expectTerminateCalled() {\n      expect(this.driver.terminate).toHaveBeenCalled();\n    }\n\n    expectTerminateNotCalled() {\n      expect(this.driver.terminate).not.toHaveBeenCalled();\n    }\n\n    expectReverseTcpPortCalled(port) {\n      expect(this.driver.reverseTcpPort).toHaveBeenCalledWith(port);\n    }\n\n    expectUnreverseTcpPortCalled(port) {\n      expect(this.driver.unreverseTcpPort).toHaveBeenCalledWith(port);\n    }\n  }\n\n  function aDevice(overrides) {\n    const appsConfig = overrides.appsConfig || {};\n    errorComposer = new DetoxRuntimeErrorComposer({ appsConfig });\n\n    const device = new RuntimeDevice({\n      appsConfig,\n      behaviorConfig: {},\n      deviceConfig: {},\n      sessionConfig: {},\n      runtimeErrorComposer: errorComposer,\n      eventEmitter: emitter,\n\n      ...overrides,\n    }, driverMock.driver);\n\n    device.deviceDriver.getBundleIdFromBinary.mockReturnValue(bundleId);\n    return device;\n  }\n\n  function aValidUnpreparedDevice(overrides) {\n    const configs = _.merge(_.cloneDeep({\n      appsConfig: {\n        default: configurationsMock.appWithRelativeBinaryPath,\n      },\n      deviceConfig: configurationsMock.iosSimulatorWithShorthandQuery,\n      sessionConfig: configurationsMock.validSession,\n    }), overrides);\n\n    if (overrides && overrides.appsConfig === null) {\n      configs.appsConfig = {};\n    }\n\n    return aDevice(configs);\n  }\n\n  async function aValidDevice(overrides) {\n    const device = aValidUnpreparedDevice(overrides);\n    await device.selectApp('default');\n    return device;\n  }\n\n  async function aValidDeviceWithLaunchArgs(launchArgs) {\n    return await aValidDevice({\n      appsConfig: {\n        default: {\n          launchArgs,\n        },\n      },\n    });\n  }\n\n  it('should return the name from the driver', async () => {\n    driverMock.driver.getDeviceName.mockReturnValue('mock-device-name-from-driver');\n\n    const device = await aValidDevice();\n    expect(device.name).toEqual('mock-device-name-from-driver');\n  });\n\n  it('should return the type from the configuration', async () => {\n    const device = await aValidDevice();\n    expect(device.type).toEqual('ios.simulator');\n  });\n\n  it('should return the device ID, as provided by acquireFreeDevice', async () => {\n    const device = await aValidUnpreparedDevice();\n\n    driverMock.driver.getExternalId.mockReturnValue('mockExternalId');\n    expect(device.id).toEqual('mockExternalId');\n\n    driverMock.expectExternalIdCalled();\n  });\n\n  describe('selectApp()', () => {\n    let device;\n\n    describe('when there is a single app', () => {\n      beforeEach(async () => {\n        device = await aValidUnpreparedDevice();\n        await device.selectApp('default');\n      });\n\n      it(`should function as usual when the app is selected`, async () => {\n        await device.launchApp();\n        expect(driverMock.driver.launchApp).toHaveBeenCalled();\n      });\n\n      it(`should throw on call without args`, async () => {\n        await expect(device.selectApp()).rejects.toThrow(errorComposer.cantSelectEmptyApp());\n      });\n\n      it(`should throw on app interactions with no selected app`, async () => {\n        await device.selectApp(null);\n        await expect(device.launchApp()).rejects.toThrow(errorComposer.appNotSelected());\n      });\n\n      it(`should throw on attempt to select a non-existent app`, async () => {\n        await expect(device.selectApp('nonExistent')).rejects.toThrow();\n      });\n    });\n\n    describe('when there are multiple apps', () => {\n      beforeEach(async () => {\n        device = await aValidUnpreparedDevice({\n          appsConfig: {\n            withBinaryPath: {\n              binaryPath: 'path/to/app',\n            },\n            withBundleId: {\n              binaryPath: 'path/to/app2',\n              bundleId: 'com.app2'\n            },\n          },\n        });\n\n        jest.spyOn(device, 'selectApp');\n        driverMock.driver.getBundleIdFromBinary.mockReturnValue('com.app1');\n      });\n\n      it(`upon select, it should infer bundleId if it is missing`, async () => {\n        await device.selectApp('withBinaryPath');\n        expect(driverMock.driver.getBundleIdFromBinary).toHaveBeenCalledWith('path/to/app');\n      });\n\n      it(`upon select, it should terminate the previous app`, async () => {\n        jest.spyOn(device, 'terminateApp');\n\n        await device.selectApp('withBinaryPath');\n        expect(device.terminateApp).not.toHaveBeenCalled(); // because no app was running before\n\n        await device.selectApp('withBundleId');\n        expect(device.terminateApp).toHaveBeenCalled(); // because there is a running app\n      });\n\n      it(`upon select, it should not infer bundleId if it is specified`, async () => {\n        await device.selectApp('withBundleId');\n        expect(driverMock.driver.getBundleIdFromBinary).not.toHaveBeenCalled();\n      });\n\n      it(`upon re-selecting the same app, it should not infer bundleId twice`, async () => {\n        await device.selectApp('withBinaryPath');\n        await device.selectApp('withBundleId');\n        await device.selectApp('withBinaryPath');\n        expect(driverMock.driver.getBundleIdFromBinary).toHaveBeenCalledTimes(1);\n      });\n    });\n\n    describe('when there are no apps', () => {\n      beforeEach(async () => {\n        device = await aValidUnpreparedDevice({\n          appsConfig: null\n        });\n\n        jest.spyOn(device, 'selectApp');\n      });\n\n      it(`should not select the app at all`, async () => {\n        expect(device.selectApp).not.toHaveBeenCalled();\n      });\n\n      it(`should be able to execute actions with an explicit bundleId`, async () => {\n        const bundleId = 'com.example.app';\n        jest.spyOn(device, 'terminateApp');\n\n        await device.uninstallApp(bundleId);\n        expect(driverMock.driver.uninstallApp).toHaveBeenCalledWith(bundleId);\n\n        await device.installApp('/tmp/app', '/tmp/app-test');\n        expect(driverMock.driver.installApp).toHaveBeenCalledWith('/tmp/app', '/tmp/app-test');\n\n        await device.launchApp({}, bundleId);\n        expect(driverMock.driver.launchApp).toHaveBeenCalledWith(bundleId, expect.anything(), undefined);\n\n        await device.terminateApp(bundleId);\n        expect(driverMock.driver.terminate).toHaveBeenCalledWith(bundleId);\n\n        await device.uninstallApp(bundleId);\n        expect(driverMock.driver.uninstallApp).toHaveBeenCalledWith(bundleId);\n      });\n    });\n  });\n\n  describe('re/launchApp()', () => {\n    const expectedDriverArgs = {\n      'detoxServer': 'ws://localhost:8099',\n      'detoxSessionId': 'test',\n    };\n\n    it(`with no args should launch app with defaults`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice();\n      await device.launchApp();\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`given behaviorConfig.launchApp == 'manual' should wait for the app launch`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice({\n        behaviorConfig: { launchApp: 'manual' }\n      });\n      await device.launchApp();\n\n      expect(driverMock.driver.launchApp).not.toHaveBeenCalled();\n      driverMock.expectWaitForLaunchCalled(bundleId, expectedArgs);\n    });\n\n    it(`args should launch app and emit appReady`, async () => {\n      driverMock.driver.launchApp = async () => 42;\n\n      const device = await aValidDevice();\n      await device.launchApp();\n\n      expect(emitter.emit).toHaveBeenCalledWith('appReady', {\n        deviceId: device.id,\n        bundleId: device._bundleId,\n        pid: 42,\n      });\n    });\n\n    it(`(relaunch) with no args should use defaults`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice();\n\n      await device.relaunchApp();\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with no args should terminate the app before launch - backwards compat`, async () => {\n      const device = await aValidDevice();\n\n      await device.relaunchApp();\n\n      driverMock.expectTerminateCalled();\n    });\n\n    it(`(relaunch) with newInstance=false should not terminate the app before launch`, async () => {\n      const device = await aValidDevice();\n\n      await device.relaunchApp({ newInstance: false });\n\n      driverMock.expectTerminateNotCalled();\n    });\n\n    it(`(relaunch) with newInstance=true should terminate the app before launch`, async () => {\n      const device = await aValidDevice();\n\n      await device.relaunchApp({ newInstance: true });\n\n      driverMock.expectTerminateCalled();\n    });\n\n    it(`(relaunch) with delete=true`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice({});\n\n      await device.relaunchApp({ delete: true });\n\n      driverMock.expectReinstallCalled();\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with resetAppState=true`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice({});\n\n      await device.relaunchApp({ resetAppState: true });\n\n      expect(driverMock.driver.resetAppState).toHaveBeenCalledWith(bundleId);\n      expect(driverMock.driver.uninstallApp).not.toHaveBeenCalled();\n      expect(driverMock.driver.installApp).not.toHaveBeenCalled();\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with delete=false when reuse is enabled should not uninstall and install`, async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice();\n\n      await device.relaunchApp();\n\n      driverMock.expectReinstallNotCalled();\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with url should send the url as a param in launchParams`, async () => {\n      const expectedArgs = { ...expectedDriverArgs, 'detoxURLOverride': 'scheme://some.url' };\n      const device = await aValidDevice();\n\n      await device.relaunchApp({ url: `scheme://some.url` });\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with url should send the url as a param in launchParams`, async () => {\n      const expectedArgs = {\n        ...expectedDriverArgs,\n        'detoxURLOverride': 'scheme://some.url',\n        'detoxSourceAppOverride': 'sourceAppBundleId',\n      };\n      const device = await aValidDevice();\n      await device.relaunchApp({ url: `scheme://some.url`, sourceApp: 'sourceAppBundleId' });\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with userNofitication should send the userNotification as a param in launchParams`, async () => {\n      const expectedArgs = {\n        ...expectedDriverArgs,\n        'detoxUserNotificationDataURL': 'url',\n      };\n      const device = await aValidDevice();\n\n      device.deviceDriver.createPayloadFile = jest.fn(() => 'url');\n\n      await device.relaunchApp({ userNotification: 'json' });\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`(relaunch) with url and userNofitication should throw`, async () => {\n      const device = await aValidDevice();\n      await expect(device.relaunchApp({ url: 'scheme://some.url', userNotification: 'notif' })).rejects.toThrow();\n    });\n\n    it(`(relaunch) with permissions should send trigger setpermissions before app starts`, async () => {\n      const device = await aValidDevice();\n      await device.relaunchApp({ permissions: { calendar: 'YES' } });\n\n      expect(driverMock.driver.setPermissions).toHaveBeenCalledWith(bundleId, { calendar: 'YES' });\n    });\n\n    it('with languageAndLocale should launch app with a specific language/locale', async () => {\n      const expectedArgs = expectedDriverArgs;\n      const device = await aValidDevice();\n\n      const languageAndLocale = {\n        language: 'es-MX',\n        locale: 'es-MX'\n      };\n\n      await device.launchApp({ languageAndLocale });\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs, languageAndLocale);\n    });\n\n    it(`with disableTouchIndicators should send a boolean switch as a param in launchParams`, async () => {\n      const expectedArgs = { ...expectedDriverArgs, 'detoxDisableTouchIndicators': true };\n      const device = await aValidDevice();\n\n      await device.launchApp({ disableTouchIndicators: true });\n\n      driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n    });\n\n    it(`with newInstance=false should check if process is in background and reopen it`, async () => {\n      const processId = 1;\n      const device = await aValidDevice();\n\n      device.deviceDriver.launchApp.mockReturnValue(processId);\n\n      await device.launchApp({ newInstance: true });\n      await device.launchApp({ newInstance: false });\n\n      expect(driverMock.driver.deliverPayload).not.toHaveBeenCalled();\n    });\n\n    it(`with a url should check if process is in background and use openURL() instead of launch args`, async () => {\n      const processId = 1;\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValue(processId);\n\n      await device.launchApp({ newInstance: true });\n      await device.launchApp({ url: 'url://me' });\n\n      expect(driverMock.driver.deliverPayload).toHaveBeenCalledTimes(1);\n    });\n\n    it(`with a url should check if process is in background and if not use launch args`, async () => {\n      const launchParams = { url: 'url://me' };\n      const processId = 1;\n      const newProcessId = 2;\n\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValueOnce(processId).mockReturnValueOnce(newProcessId);\n\n      await device.launchApp(launchParams);\n\n      expect(driverMock.driver.deliverPayload).not.toHaveBeenCalled();\n    });\n\n    it(`with a url should check if process is in background and use openURL() instead of launch args`, async () => {\n      const launchParams = { url: 'url://me' };\n      const processId = 1;\n\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValue(processId);\n\n      await device.launchApp({ newInstance: true });\n      await device.launchApp(launchParams);\n\n      expect(driverMock.driver.deliverPayload).toHaveBeenCalledWith({ delayPayload: true, url: 'url://me' });\n    });\n\n    it('with userActivity should check if process is in background and if it is use deliverPayload', async () => {\n      const launchParams = { userActivity: 'userActivity' };\n      const processId = 1;\n\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValueOnce(processId).mockReturnValueOnce(processId);\n      device.deviceDriver.createPayloadFile = () => 'url';\n\n      await device.launchApp({ newInstance: true });\n      await device.launchApp(launchParams);\n\n      expect(driverMock.driver.deliverPayload).toHaveBeenCalledWith({ delayPayload: true, detoxUserActivityDataURL: 'url' });\n    });\n\n    it('with userNotification should check if process is in background and if it is use deliverPayload', async () => {\n      const launchParams = { userNotification: 'notification' };\n      const processId = 1;\n\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValueOnce(processId).mockReturnValueOnce(processId);\n      device.deviceDriver.createPayloadFile = () => 'url';\n\n      await device.launchApp({ newInstance: true });\n      await device.launchApp(launchParams);\n\n      expect(driverMock.driver.deliverPayload).toHaveBeenCalledTimes(1);\n    });\n\n    it(`with userNotification should check if process is in background and if not use launch args`, async () => {\n      const launchParams = { userNotification: 'notification' };\n      const processId = 1;\n      const newProcessId = 2;\n\n      const device = await aValidDevice();\n      device.deviceDriver.launchApp.mockReturnValueOnce(processId).mockReturnValueOnce(newProcessId);\n\n      await device.launchApp(launchParams);\n\n      expect(driverMock.driver.deliverPayload).not.toHaveBeenCalled();\n    });\n\n    it(`with userNotification and url should fail`, async () => {\n      const launchParams = { userNotification: 'notification', url: 'url://me' };\n      const processId = 1;\n      driverMock.driver.launchApp.mockReturnValueOnce(processId).mockReturnValueOnce(processId);\n\n      const device = await aValidDevice();\n\n      await expect(device.launchApp(launchParams)).rejects.toThrow();\n      expect(device.deviceDriver.deliverPayload).not.toHaveBeenCalled();\n    });\n\n    it('should keep user params unmodified', async () => {\n      const params = {\n        url: 'some.url',\n        launchArgs: {\n          some: 'userArg',\n        }\n      };\n      const paramsClone = _.cloneDeep(params);\n\n      const device = await aValidDevice();\n      await device.launchApp(params);\n\n      expect(params).toStrictEqual(paramsClone);\n    });\n\n    describe('launch arguments', () => {\n      const baseArgs = {\n        detoxServer: 'ws://localhost:8099',\n        detoxSessionId: 'test',\n      };\n      const someLaunchArgs = () => ({\n        argX: 'valX',\n        argY: { value: 'Y' },\n      });\n\n      it('should pass preconfigured launch-args to device via driver', async () => {\n        const launchArgs = someLaunchArgs();\n        const device = await aValidDeviceWithLaunchArgs(launchArgs);\n        await device.launchApp();\n\n        driverMock.expectLaunchCalledContainingArgs(launchArgs);\n      });\n\n      it('should pass on-site launch-args to device via driver', async () => {\n        const launchArgs = someLaunchArgs();\n        const expectedArgs = {\n          ...baseArgs,\n          ...launchArgs,\n        };\n\n        const device = await aValidDevice();\n        await device.launchApp({ launchArgs });\n\n        driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n      });\n\n      it('should allow for launch-args modification', async () => {\n        const launchArgs = someLaunchArgs();\n        const argsModifier = {\n          argY: null,\n          argZ: 'valZ',\n        };\n        const expectedArgs = {\n          argX: 'valX',\n          argZ: 'valZ',\n        };\n\n        const device = await aValidDeviceWithLaunchArgs(launchArgs);\n        device.appLaunchArgs.modify(argsModifier);\n        await device.launchApp();\n\n        driverMock.expectLaunchCalledContainingArgs(expectedArgs);\n      });\n\n      it('should override launch-args with on-site launch-args', async () => {\n        const launchArgs = {\n          aLaunchArg: 'aValue?',\n        };\n\n        const device = await aValidDeviceWithLaunchArgs();\n        device.appLaunchArgs.modify(launchArgs);\n        await device.launchApp({\n          launchArgs: {\n            aLaunchArg: 'aValue!',\n          },\n        });\n\n        driverMock.expectLaunchCalledContainingArgs({ aLaunchArg: 'aValue!' });\n      });\n\n      it('should allow for resetting all args', async () => {\n        const launchArgs = someLaunchArgs();\n        const expectedArgs = { ...baseArgs };\n\n        const device = await aValidDeviceWithLaunchArgs(launchArgs);\n        device.appLaunchArgs.modify({ argZ: 'valZ' });\n        device.appLaunchArgs.reset();\n        await device.launchApp();\n\n        driverMock.expectLaunchCalledWithArgs(bundleId, expectedArgs);\n      });\n    });\n  });\n\n  describe('installApp()', () => {\n    it(`with a custom app path should use custom app path`, async () => {\n      const device = await aValidDevice();\n\n      await device.installApp('newAppPath');\n      expect(driverMock.driver.installApp).toHaveBeenCalledWith('newAppPath', device._deviceConfig.testBinaryPath);\n    });\n\n    it(`with no args should use the default path given in configuration`, async () => {\n      const device = await aValidDevice();\n      await device.installApp();\n      expect(driverMock.driver.installApp).toHaveBeenCalledWith(device._currentApp.binaryPath, device._currentApp.testBinaryPath);\n      expect(driverMock.driver.reverseTcpPort).not.toHaveBeenCalled();\n    });\n\n    it(`with reversePorts, it should reverse the ports`, async () => {\n      const device = await aValidDevice({\n        appsConfig: {\n          default: { reversePorts: [3000] },\n        },\n      });\n\n      await device.installApp();\n      expect(driverMock.driver.reverseTcpPort).toHaveBeenCalledWith(3000);\n    });\n  });\n\n  describe('uninstallApp()', () => {\n    it(`with a custom app path should use custom app path`, async () => {\n      const device = await aValidDevice();\n      await device.uninstallApp('newBundleId');\n      expect(driverMock.driver.uninstallApp).toHaveBeenCalledWith('newBundleId');\n    });\n\n    it(`with no args should use the default path given in configuration`, async () => {\n      const device = await aValidDevice();\n      await device.uninstallApp();\n      expect(driverMock.driver.uninstallApp).toHaveBeenCalledWith(bundleId);\n    });\n  });\n\n  describe('installBinary()', () => {\n    it('should install the set of util binaries', async () => {\n      const device = await aValidDevice({\n        deviceConfig: {\n          utilBinaryPaths: ['path/to/util/binary']\n        },\n      });\n\n      await device.installUtilBinaries();\n      expect(driverMock.driver.installUtilBinaries).toHaveBeenCalledWith(['path/to/util/binary']);\n    });\n\n    it('should break if driver installation fails', async () => {\n      driverMock.driver.installUtilBinaries.mockRejectedValue(new Error());\n\n      const device = await aValidDevice({\n        deviceConfig: {\n          utilBinaryPaths: ['path/to/util/binary']\n        },\n      });\n\n      await expect(device.installUtilBinaries()).rejects.toThrow();\n    });\n\n    it('should not install anything if util-binaries havent been configured', async () => {\n      const device = await aValidDevice({});\n\n      await device.installUtilBinaries();\n      expect(driverMock.driver.installUtilBinaries).not.toHaveBeenCalled();\n    });\n  });\n\n  it(`sendToHome() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.sendToHome();\n\n    expect(driverMock.driver.sendToHome).toHaveBeenCalledTimes(1);\n  });\n\n  it(`setBiometricEnrollment(true) should pass YES to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.setBiometricEnrollment(true);\n\n    expect(driverMock.driver.setBiometricEnrollment).toHaveBeenCalledWith('YES');\n    expect(driverMock.driver.setBiometricEnrollment).toHaveBeenCalledTimes(1);\n  });\n\n  it(`setBiometricEnrollment(false) should pass NO to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.setBiometricEnrollment(false);\n\n    expect(driverMock.driver.setBiometricEnrollment).toHaveBeenCalledWith('NO');\n    expect(driverMock.driver.setBiometricEnrollment).toHaveBeenCalledTimes(1);\n  });\n\n  it(`matchFace() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.matchFace();\n\n    expect(driverMock.driver.matchFace).toHaveBeenCalledTimes(1);\n  });\n\n  it(`unmatchFace() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.unmatchFace();\n\n    expect(driverMock.driver.unmatchFace).toHaveBeenCalledTimes(1);\n  });\n\n  it(`matchFinger() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.matchFinger();\n\n    expect(driverMock.driver.matchFinger).toHaveBeenCalledTimes(1);\n  });\n\n  it(`unmatchFinger() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.unmatchFinger();\n\n    expect(driverMock.driver.unmatchFinger).toHaveBeenCalledTimes(1);\n  });\n\n  it(`setStatusBar() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    const params = {};\n    await device.setStatusBar(params);\n\n    expect(driverMock.driver.setStatusBar).toHaveBeenCalledWith(params);\n  });\n\n  it(`resetStatusBar() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.resetStatusBar();\n\n    expect(driverMock.driver.resetStatusBar).toHaveBeenCalledWith();\n  });\n\n  it(`typeText() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device._typeText('Text');\n\n    expect(driverMock.driver.typeText).toHaveBeenCalledWith('Text');\n  });\n\n  it(`shake() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.shake();\n\n    expect(driverMock.driver.shake).toHaveBeenCalledTimes(1);\n  });\n\n  it(`terminateApp() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.terminateApp();\n\n    expect(driverMock.driver.terminate).toHaveBeenCalledTimes(1);\n  });\n\n  it(`openURL({url:url}) should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.openURL({ url: 'url' });\n\n    expect(driverMock.driver.deliverPayload).toHaveBeenCalledWith({ url: 'url' });\n  });\n\n  it(`openURL(notAnObject) should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await expect(device.openURL('url')).rejects.toThrow();\n  });\n\n  it(`reloadReactNative() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.reloadReactNative();\n\n    expect(driverMock.driver.reloadReactNative).toHaveBeenCalledTimes(1);\n  });\n\n  it(`setOrientation() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.setOrientation('param');\n\n    expect(driverMock.driver.setOrientation).toHaveBeenCalledWith('param');\n  });\n\n  it(`tap() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    const points = { x: 200, y: 200 };\n    await device.tap(points);\n\n    expect(driverMock.driver.tap).toHaveBeenCalled();\n  });\n\n  it(`longPress() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    const points = { x: 200, y: 200 };\n    const duration = 2000;\n    await device.longPress(points, duration);\n\n    expect(driverMock.driver.longPress).toHaveBeenCalled();\n  });\n\n  it(`sendUserNotification() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.sendUserNotification('notif');\n\n    expect(driverMock.driver.createPayloadFile).toHaveBeenCalledTimes(1);\n    expect(driverMock.driver.deliverPayload).toHaveBeenCalledTimes(1);\n  });\n\n  it(`sendUserActivity() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.sendUserActivity('notif');\n\n    expect(driverMock.driver.createPayloadFile).toHaveBeenCalledTimes(1);\n    expect(driverMock.driver.deliverPayload).toHaveBeenCalledTimes(1);\n  });\n\n  it(`setLocation() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.setLocation(30.1, 30.2);\n\n    expect(driverMock.driver.setLocation).toHaveBeenCalledWith('30.1', '30.2');\n  });\n\n  it(`reverseTcpPort should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.reverseTcpPort(666);\n\n    await driverMock.expectReverseTcpPortCalled(666);\n  });\n\n  it(`unreverseTcpPort should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.unreverseTcpPort(777);\n\n    await driverMock.expectUnreverseTcpPortCalled(777);\n  });\n\n  it(`setURLBlacklist() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.setURLBlacklist();\n\n    expect(driverMock.driver.setURLBlacklist).toHaveBeenCalledTimes(1);\n  });\n\n  it(`enableSynchronization() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.enableSynchronization();\n\n    expect(driverMock.driver.enableSynchronization).toHaveBeenCalledTimes(1);\n  });\n\n  it(`disableSynchronization() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.disableSynchronization();\n\n    expect(driverMock.driver.disableSynchronization).toHaveBeenCalledTimes(1);\n  });\n\n  it(`resetContentAndSettings() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device.resetContentAndSettings();\n\n    expect(driverMock.driver.resetContentAndSettings).toHaveBeenCalledTimes(1);\n  });\n\n  it(`getPlatform() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    device.getPlatform();\n\n    expect(driverMock.driver.getPlatform).toHaveBeenCalledTimes(1);\n  });\n\n  it(`_cleanup() should pass to device driver`, async () => {\n    const device = await aValidDevice();\n    await device._cleanup();\n\n    expect(driverMock.driver.cleanup).toHaveBeenCalledTimes(1);\n  });\n\n  it(`should accept absolute path for binary`, async () => {\n    const actualPath = await launchAndTestBinaryPath('absolute');\n    expect(actualPath).toEqual(configurationsMock.appWithAbsoluteBinaryPath.binaryPath);\n  });\n\n  it(`should accept relative path for binary`, async () => {\n    const actualPath = await launchAndTestBinaryPath('relative');\n    expect(actualPath).toEqual(configurationsMock.appWithRelativeBinaryPath.binaryPath);\n  });\n\n  it(`pressBack() should invoke driver's pressBack()`, async () => {\n    const device = await aValidDevice();\n\n    await device.pressBack();\n\n    expect(driverMock.driver.pressBack).toHaveBeenCalledWith();\n  });\n\n  it(`clearKeychain() should invoke driver's clearKeychain()`, async () => {\n    const device = await aValidDevice();\n\n    await device.clearKeychain();\n\n    expect(driverMock.driver.clearKeychain).toHaveBeenCalledWith();\n  });\n\n  describe('get ui device', () => {\n    it(`getUiDevice should invoke driver's getUiDevice`, async () => {\n      const device = await aValidDevice();\n\n      await device.getUiDevice();\n\n      expect(driverMock.driver.getUiDevice).toHaveBeenCalled();\n    });\n\n    it('should call return UiDevice when call getUiDevice', async () => {\n      const uiDevice = {\n        uidevice: true,\n      };\n\n      const device = await aValidDevice();\n      driverMock.driver.getUiDevice = () =>  uiDevice;\n\n      const result = await device.getUiDevice();\n\n      expect(result).toEqual(uiDevice);\n    });\n  });\n\n  it('takeScreenshot(name) should throw an exception if given name is empty', async () => {\n    await expect((await aValidDevice()).takeScreenshot()).rejects.toThrow(/empty name/);\n  });\n\n  it('takeScreenshot(name) should delegate the work to the driver', async () => {\n    const device = await aValidDevice();\n\n    await device.takeScreenshot('name');\n    expect(device.deviceDriver.takeScreenshot).toHaveBeenCalledWith('name');\n  });\n\n  it('captureViewHierarchy(name) should delegate the work to the driver', async () => {\n    const device = await aValidDevice();\n\n    await device.captureViewHierarchy('name');\n    expect(device.deviceDriver.captureViewHierarchy).toHaveBeenCalledWith('name');\n  });\n\n  it('captureViewHierarchy([name]) should set name = \"capture\" by default', async () => {\n    const device = await aValidDevice();\n\n    await device.captureViewHierarchy();\n    expect(device.deviceDriver.captureViewHierarchy).toHaveBeenCalledWith('capture');\n  });\n\n  it('generateViewHierarchyXml() should return the result of the driver', async () => {\n    driverMock.driver.generateViewHierarchyXml = async () => { return 'xml'; };\n    const device = await aValidDevice();\n    const hierarchy = await device.generateViewHierarchyXml();\n    expect(hierarchy).toEqual('xml');\n  });\n\n  describe('_isAppRunning (internal method)', () => {\n    let device;\n\n    beforeEach(async () => {\n      device = await aValidDevice();\n      driverMock.driver.launchApp = async () => 42;\n      await device.launchApp();\n    });\n\n    it('should return the value for the current app if called with no args', async () => {\n      expect(device._isAppRunning()).toBe(true);\n    });\n\n    it('should return the value for the given bundleId', async () => {\n      expect(device._isAppRunning('test.bundle')).toBe(true);\n      expect(device._isAppRunning('somethingElse')).toBe(false);\n    });\n  });\n\n  async function launchAndTestBinaryPath(absoluteOrRelative) {\n    const appConfig = absoluteOrRelative === 'absolute'\n      ? configurationsMock.appWithAbsoluteBinaryPath\n      : configurationsMock.appWithRelativeBinaryPath;\n\n    const device = await aValidDevice({ appsConfig: { default: appConfig } });\n    await device.installApp();\n\n    return driverMock.driver.installApp.mock.calls[0][0];\n  }\n\n  it('should call resetAppState on the driver', async () => {\n    const device = await aValidDevice();\n    await device.resetAppState();\n    expect(driverMock.driver.resetAppState).toHaveBeenCalledWith(bundleId);\n  });\n\n  it('should call resetAppState with custom bundleId', async () => {\n    const device = await aValidDevice();\n    const customBundleId = 'com.custom.app';\n    await device.resetAppState(customBundleId);\n    expect(driverMock.driver.resetAppState).toHaveBeenCalledWith(customBundleId);\n  });\n\n  it('should call resetAppState with multiple bundleIds', async () => {\n    const device = await aValidDevice();\n    const bundleId1 = 'com.app1';\n    const bundleId2 = 'com.app2';\n    await device.resetAppState(bundleId1, bundleId2);\n    expect(driverMock.driver.resetAppState).toHaveBeenCalledWith(bundleId1, bundleId2);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/DeviceDriverBase.js",
    "content": "// @ts-nocheck\nconst os = require('os');\nconst path = require('path');\n\nconst fs = require('fs-extra');\n\nconst log = require('../../../utils/logger').child({ cat: 'device' });\n\n/**\n * @typedef DeviceDriverDeps\n * @property client { Client }\n * @property eventEmitter { AsyncEmitter }\n */\n\nclass DeviceDriverBase {\n  /**\n   * @param deps { DeviceDriverDeps }\n   */\n  constructor({ client, eventEmitter }) {\n    this.client = client;\n    this.emitter = eventEmitter;\n  }\n\n  /**\n   * @returns { String | undefined }\n   */\n  getExternalId() {\n    return undefined;\n  }\n\n  /**\n   * @returns { String | undefined }\n   */\n  getDeviceName() {\n    return undefined;\n  }\n\n  declareArtifactPlugins() {\n    return {};\n  }\n\n  async launchApp() {\n    return NaN;\n  }\n\n  async waitForAppLaunch() {\n    return NaN;\n  }\n\n  async takeScreenshot(_screenshotName) {\n    return '';\n  }\n\n  async tap(_bundleId) {\n    return '';\n  }\n\n  async longPress(_bundleId) {\n    return '';\n  }\n\n  async sendToHome() {\n    return '';\n  }\n\n  async setBiometricEnrollment() {\n    return '';\n  }\n\n  async matchFace() {\n    return '';\n  }\n\n  async unmatchFace() {\n    return '';\n  }\n\n  async matchFinger() {\n    return '';\n  }\n\n  async unmatchFinger() {\n    return '';\n  }\n\n  async shake() {\n    return '';\n  }\n\n  async installApp(_binaryPath, _testBinaryPath) {\n    return '';\n  }\n\n  async resetAppState(..._bundleIds) {\n    return undefined;\n  }\n\n  async uninstallApp() {\n    return '';\n  }\n\n  installUtilBinaries() {\n    return '';\n  }\n\n  async deliverPayload(params) {\n    return await this.client.deliverPayload(params);\n  }\n\n  async setLocation(_lat, _lon) {\n    return '';\n  }\n\n  async reverseTcpPort() {\n    return '';\n  }\n\n  async unreverseTcpPort() {\n    return '';\n  }\n\n  async clearKeychain(_udid) {\n    return '';\n  }\n\n  async waitUntilReady() {\n    return await this.client.waitUntilReady();\n  }\n\n  async waitForActive() {\n    return '';\n  }\n\n  async waitForBackground() {\n    return '';\n  }\n\n  async reloadReactNative() {\n    return await this.client.reloadReactNative();\n  }\n\n  createPayloadFile(notification) {\n    const notificationFilePath = path.join(this.createRandomDirectory(), `payload.json`);\n    fs.writeFileSync(notificationFilePath, JSON.stringify(notification, null, 2));\n    return notificationFilePath;\n  }\n\n  async setPermissions(_bundleId, _permissions) {\n    return '';\n  }\n\n  async terminate(_bundleId) {\n    return '';\n  }\n\n  async setOrientation(_orientation) {\n    return '';\n  }\n\n  async setURLBlacklist(_urlList) {\n    return '';\n  }\n\n  async enableSynchronization() {\n    return '';\n  }\n\n  async disableSynchronization() {\n    return '';\n  }\n\n  async resetContentAndSettings(_deviceId, _deviceConfig) {\n    return '';\n  }\n\n  createRandomDirectory() {\n    const randomDir = fs.mkdtempSync(path.join(os.tmpdir(), 'detoxrand-'));\n    fs.ensureDirSync(randomDir);\n    return randomDir;\n  }\n\n  cleanupRandomDirectory(fileOrDir) {\n    if(path.basename(fileOrDir).startsWith('detoxrand-')) {\n      fs.removeSync(fileOrDir);\n    }\n  }\n\n  getBundleIdFromBinary(_appPath) {\n    return '';\n  }\n\n  validateDeviceConfig(_deviceConfig) {\n  }\n\n  getPlatform() {\n    return '';\n  }\n\n  async getUiDevice() {\n    log.warn(`getUiDevice() is an Android-specific function, it exposes UiAutomator's UiDevice API (https://developer.android.com/reference/android/support/test/uiautomator/UiDevice).`);\n    log.warn(`Make sure you create an Android-specific test for this scenario.`);\n\n    return await Promise.resolve('');\n  }\n\n  async cleanup(_bundleId) {\n    this.emitter.off(); // clean all listeners\n  }\n\n  getLogsPaths() {\n    return {\n      stdout: undefined,\n      stderr: undefined\n    };\n  }\n\n  async pressBack() {\n    log.warn('pressBack() is an Android-specific function.');\n    log.warn(`Make sure you create an Android-specific test for this scenario.`);\n\n    return await Promise.resolve('');\n  }\n\n  async typeText(_text) {\n    return await Promise.resolve('');\n  }\n\n  async setStatusBar(_flags) {\n  }\n\n  async resetStatusBar() {\n  }\n\n  async captureViewHierarchy() {\n    return '';\n  }\n\n  async generateViewHierarchyXml(_shouldInjectTestIds) {\n    return '';\n  }\n}\n\nmodule.exports = DeviceDriverBase;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/AndroidDriver.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\n// @ts-nocheck\nconst path = require('path');\nconst URL = require('url').URL;\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst DetoxApi = require('../../../../android/espressoapi/Detox');\nconst EspressoDetoxApi = require('../../../../android/espressoapi/EspressoDetox');\nconst UiDeviceProxy = require('../../../../android/espressoapi/UiDeviceProxy');\nconst temporaryPath = require('../../../../artifacts/utils/temporaryPath');\nconst DetoxRuntimeError = require('../../../../errors/DetoxRuntimeError');\nconst getAbsoluteBinaryPath = require('../../../../utils/getAbsoluteBinaryPath');\nconst logger = require('../../../../utils/logger');\nconst pressAnyKey = require('../../../../utils/pressAnyKey');\nconst retry = require('../../../../utils/retry');\nconst sleep = require('../../../../utils/sleep');\nconst apkUtils = require('../../../common/drivers/android/tools/apk');\nconst DeviceDriverBase = require('../DeviceDriverBase');\n\nconst log = logger.child({ cat: 'device' });\n\n/**\n * @typedef AndroidDriverProps\n * @property adbName { String } The unique identifier associated with ADB\n */\n\n/**\n * @typedef { DeviceDriverDeps } AndroidDriverDeps\n * @property invocationManager { InvocationManager }\n * @property adb { ADB }\n * @property aapt { AAPT }\n * @property apkValidator { ApkValidator }\n * @property fileTransfer { FileTransfer }\n * @property appInstallHelper { AppInstallHelper }\n * @property appUninstallHelper { AppUninstallHelper }\n * @property devicePathBuilder { AndroidDevicePathBuilder }\n * @property instrumentation { MonitoredInstrumentation }\n */\n\nclass AndroidDriver extends DeviceDriverBase {\n  /**\n   * @param deps { AndroidDriverDeps }\n   * @param props { AndroidDriverProps }\n   */\n  constructor(deps, { adbName }) {\n    super(deps);\n\n    this.adbName = adbName;\n    this.adb = deps.adb;\n    this.aapt = deps.aapt;\n    this.apkValidator = deps.apkValidator;\n    this.invocationManager = deps.invocationManager;\n    this.fileTransfer = deps.fileTransfer;\n    this.appInstallHelper = deps.appInstallHelper;\n    this.appUninstallHelper = deps.appUninstallHelper;\n    this.devicePathBuilder = deps.devicePathBuilder;\n    this.instrumentation = deps.instrumentation;\n\n    this.uiDevice = new UiDeviceProxy(this.invocationManager).getUIDevice();\n  }\n\n  getExternalId() {\n    return this.adbName;\n  }\n\n  async getBundleIdFromBinary(apkPath) {\n    const binaryPath = getAbsoluteBinaryPath(apkPath);\n    return await this.aapt.getPackageName(binaryPath);\n  }\n\n  async installApp(_appBinaryPath, _testBinaryPath) {\n    const {\n      appBinaryPath,\n      testBinaryPath,\n    } = this._getAppInstallPaths(_appBinaryPath, _testBinaryPath);\n    await this._validateAppBinaries(appBinaryPath, testBinaryPath);\n    await this._installAppBinaries(appBinaryPath, testBinaryPath);\n  }\n\n  async uninstallApp(bundleId) {\n    await this.emitter.emit('beforeUninstallApp', { deviceId: this.adbName, bundleId });\n    await this.appUninstallHelper.uninstall(this.adbName, bundleId);\n  }\n\n  async resetAppState(...bundleIds) {\n    for (const bundleId of bundleIds) {\n      await this.adb.clearAppData(this.adbName, bundleId);\n      await this.adb.grantAllPermissions(this.adbName, bundleId);\n    }\n  }\n\n  async installUtilBinaries(paths) {\n    for (const path of paths) {\n      const packageId = await this.getBundleIdFromBinary(path);\n      if (!await this.adb.isPackageInstalled(this.adbName, packageId)) {\n        await this.appInstallHelper.install(this.adbName, path);\n      }\n    }\n  }\n\n  async launchApp(bundleId, launchArgs, languageAndLocale) {\n    return await this._handleLaunchApp({\n      manually: false,\n      bundleId,\n      launchArgs,\n      languageAndLocale,\n    });\n  }\n\n  async waitForAppLaunch(bundleId, launchArgs, languageAndLocale) {\n    return await this._handleLaunchApp({\n      manually: true,\n      bundleId,\n      launchArgs,\n      languageAndLocale,\n    });\n  }\n\n  async _handleLaunchApp({ manually, bundleId, launchArgs }) {\n    const { adbName } = this;\n\n    await this.emitter.emit('beforeLaunchApp', { deviceId: adbName, bundleId, launchArgs });\n\n    launchArgs = await this._modifyArgsForNotificationHandling(adbName, bundleId, launchArgs);\n\n    if (manually) {\n      await this._waitForAppLaunch(adbName, bundleId, launchArgs);\n    } else {\n      await this._launchApp(adbName, bundleId, launchArgs);\n    }\n\n    const pid = await this._waitForProcess(adbName, bundleId);\n    if (manually) {\n      log.info({}, `Found the app (${bundleId}) with process ID = ${pid}. Proceeding...`);\n    }\n\n    await this.emitter.emit('launchApp', { deviceId: adbName, bundleId, launchArgs, pid });\n    return pid;\n  }\n\n  async deliverPayload(params) {\n    if (params.delayPayload) {\n      return;\n    }\n\n    const { url, detoxUserNotificationDataURL } = params;\n    if (url) {\n      await this._startActivityWithUrl(url);\n    } else if (detoxUserNotificationDataURL) {\n      const payloadPathOnDevice = await this._sendNotificationDataToDevice(detoxUserNotificationDataURL, this.adbName);\n      await this._startActivityFromNotification(payloadPathOnDevice);\n    }\n  }\n\n  async waitUntilReady() {\n      try {\n        await Promise.race([\n          super.waitUntilReady(),\n          this.instrumentation.waitForCrash()\n        ]);\n      } catch (e) {\n        log.warn({ error: e }, 'An error occurred while waiting for the app to become ready. Waiting for disconnection...');\n        await this.client.waitUntilDisconnected();\n        log.warn('The app disconnected.');\n        throw e;\n      } finally {\n        this.instrumentation.abortWaitForCrash();\n      }\n  }\n\n  async pressBack() {\n    await this.uiDevice.pressBack();\n  }\n\n  async sendToHome(params) {\n    await this.uiDevice.pressHome();\n  }\n\n  async typeText(text) {\n    await this.adb.typeText(this.adbName, text);\n  }\n\n  async terminate(bundleId) {\n    const { adbName } = this;\n    await this.emitter.emit('beforeTerminateApp', { deviceId: adbName, bundleId });\n    await this._terminateInstrumentation();\n    await this.adb.terminate(adbName, bundleId);\n    await this.emitter.emit('terminateApp', { deviceId: adbName, bundleId });\n  }\n\n  async cleanup(bundleId) {\n    await this._terminateInstrumentation();\n    await super.cleanup(bundleId);\n  }\n\n  getPlatform() {\n    return 'android';\n  }\n\n  getUiDevice() {\n    return this.uiDevice;\n  }\n\n  async reverseTcpPort(port) {\n    await this.adb.reverse(this.adbName, port);\n  }\n\n  async unreverseTcpPort(port) {\n    await this.adb.reverseRemove(this.adbName, port);\n  }\n\n  async setURLBlacklist(urlList) {\n    await this.invocationManager.execute(EspressoDetoxApi.setURLBlacklist(urlList));\n  }\n\n  async enableSynchronization() {\n    await this.invocationManager.execute(EspressoDetoxApi.setSynchronization(true));\n  }\n\n  async disableSynchronization() {\n    await this.invocationManager.execute(EspressoDetoxApi.setSynchronization(false));\n  }\n\n  async takeScreenshot(screenshotName) {\n    const { adbName } = this;\n\n    const pathOnDevice = this.devicePathBuilder.buildTemporaryArtifactPath('.png');\n    await this.adb.screencap(adbName, pathOnDevice);\n\n    const tempPath = temporaryPath.for.png();\n    await this.adb.pull(adbName, pathOnDevice, tempPath);\n    await this.adb.rm(adbName, pathOnDevice);\n\n    await this.emitter.emit('createExternalArtifact', {\n      pluginId: 'screenshot',\n      artifactName: screenshotName || path.basename(tempPath, '.png'),\n      artifactPath: tempPath,\n    });\n\n    return tempPath;\n  }\n\n  async setOrientation(orientation) {\n    const orientationMapping = {\n      landscape: 1, // top at left side landscape\n      portrait: 0 // non-reversed portrait.\n    };\n\n    const call = EspressoDetoxApi.changeOrientation(orientationMapping[orientation]);\n    await this.invocationManager.execute(call);\n  }\n\n  async tap(point, shouldIgnoreStatusBar) {\n    let x = point?.x ?? 100;\n    let y = point?.y ?? 100;\n    let _shouldIgnoreStatusBar = shouldIgnoreStatusBar ?? true;\n    const call = EspressoDetoxApi.tap(x, y, _shouldIgnoreStatusBar);\n    await this.invocationManager.execute(call);\n  }\n\n  async longPress(point, duration, shouldIgnoreStatusBar) {\n    let x = point?.x ?? 100;\n    let y = point?.y ?? 100;\n    let _shouldIgnoreStatusBar = shouldIgnoreStatusBar ?? true;\n    const call = duration ? EspressoDetoxApi.longPress(x, y, duration, _shouldIgnoreStatusBar): EspressoDetoxApi.longPress(x, y, _shouldIgnoreStatusBar);\n    await this.invocationManager.execute(call);\n  }\n\n  async generateViewHierarchyXml(shouldInjectTestIds) {\n    const hierarchy = await this.invocationManager.execute(DetoxApi.generateViewHierarchyXml(shouldInjectTestIds));\n    return hierarchy.result;\n  }\n\n  _getAppInstallPaths(_appBinaryPath, _testBinaryPath) {\n    const appBinaryPath = getAbsoluteBinaryPath(_appBinaryPath);\n    const testBinaryPath = _testBinaryPath ? getAbsoluteBinaryPath(_testBinaryPath) : this._getTestApkPath(appBinaryPath);\n    return {\n      appBinaryPath,\n      testBinaryPath,\n    };\n  }\n\n  async _validateAppBinaries(appBinaryPath, testBinaryPath) {\n    try {\n      await this.apkValidator.validateAppApk(appBinaryPath);\n    } catch (e) {\n      logger.warn(e.toString());\n    }\n\n    try {\n      await this.apkValidator.validateTestApk(testBinaryPath);\n    } catch (e) {\n      logger.warn(e.toString());\n    }\n  }\n\n  async _installAppBinaries(appBinaryPath, testBinaryPath) {\n    await this.adb.install(this.adbName, appBinaryPath);\n    await this.adb.install(this.adbName, testBinaryPath);\n  }\n\n  _getTestApkPath(originalApkPath) {\n    const testApkPath = apkUtils.getTestApkPath(originalApkPath);\n\n    if (!fs.existsSync(testApkPath)) {\n      throw new DetoxRuntimeError({\n        message: `The test APK could not be found at path: '${testApkPath}'`,\n        hint: 'Try running the detox build command, and make sure it was configured to execute a build command (e.g. \\'./gradlew assembleAndroidTest\\')' +\n          '\\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup',\n      });\n    }\n    return testApkPath;\n  }\n\n  async _modifyArgsForNotificationHandling(adbName, bundleId, launchArgs) {\n    let _launchArgs = launchArgs;\n    if (launchArgs.detoxUserNotificationDataURL) {\n      const notificationPayloadTargetPath = await this._sendNotificationDataToDevice(launchArgs.detoxUserNotificationDataURL, adbName);\n      _launchArgs = {\n        ...launchArgs,\n        detoxUserNotificationDataURL: notificationPayloadTargetPath,\n      };\n    }\n    return _launchArgs;\n  }\n\n  async _launchApp(adbName, bundleId, launchArgs) {\n    if (!this.instrumentation.isRunning()) {\n      await this._launchInstrumentationProcess(adbName, bundleId, launchArgs);\n      await sleep(500);\n    } else if (launchArgs.detoxURLOverride) {\n      await this._startActivityWithUrl(launchArgs.detoxURLOverride);\n    } else if (launchArgs.detoxUserNotificationDataURL) {\n      await this._startActivityFromNotification(launchArgs.detoxUserNotificationDataURL);\n    } else {\n      await this._resumeMainActivity();\n    }\n  }\n\n  async _launchInstrumentationProcess(adbName, bundleId, userLaunchArgs) {\n    const serverPort = await this._reverseServerPort(adbName);\n    this.instrumentation.setTerminationFn(async () => {\n      await this._terminateInstrumentation();\n      await this.adb.reverseRemove(adbName, serverPort);\n    });\n    await this.instrumentation.launch(adbName, bundleId, userLaunchArgs);\n  }\n\n  async _reverseServerPort(adbName) {\n    const serverPort = new URL(this.client.serverUrl).port;\n    await this.adb.reverse(adbName, serverPort);\n    return serverPort;\n  }\n\n  async _terminateInstrumentation() {\n    await this.instrumentation.terminate();\n    await this.instrumentation.setTerminationFn(null);\n  }\n\n  async _sendNotificationDataToDevice(dataFileLocalPath, adbName) {\n    await this.fileTransfer.prepareDestinationDir(adbName);\n    return await this.fileTransfer.send(adbName, dataFileLocalPath, 'notification.json');\n  }\n\n  _startActivityWithUrl(url) {\n    return this.invocationManager.execute(DetoxApi.startActivityFromUrl(url));\n  }\n\n  _startActivityFromNotification(dataFilePath) {\n    return this.invocationManager.execute(DetoxApi.startActivityFromNotification(dataFilePath));\n  }\n\n  _resumeMainActivity() {\n    return this.invocationManager.execute(DetoxApi.launchMainActivity());\n  }\n\n  async _waitForProcess(adbName, bundleId) {\n    let pid = NaN;\n    try {\n      const queryPid = () => this._queryPID(adbName, bundleId);\n      const retryQueryPid = () => retry({ backoff: 'none', retries: 4 }, queryPid);\n      const retryQueryPidMultiple = () => retry({ backoff: 'linear' }, retryQueryPid);\n      pid = await retryQueryPidMultiple();\n    } catch (e) {\n      log.warn(await this.adb.shell(adbName, 'ps'));\n      throw e;\n    }\n    return pid;\n  }\n\n  async _queryPID(adbName, bundleId) {\n    const pid = await this.adb.pidof(adbName, bundleId);\n    if (!pid) {\n      throw new DetoxRuntimeError('PID still not available');\n    }\n    return pid;\n  }\n\n  async _waitForAppLaunch(adbName, bundleId, launchArgs) {\n    const instrumentationClass = await this.adb.getInstrumentationRunner(adbName, bundleId);\n    this._printInstrumentationHint({ instrumentationClass, launchArgs });\n    await pressAnyKey();\n    await this._reverseServerPort(adbName);\n  }\n\n  _printInstrumentationHint({ instrumentationClass, launchArgs }) {\n    const keyMaxLength = Math.max(3, _(launchArgs).keys().maxBy('length').length);\n    const valueMaxLength = Math.max(5, _(launchArgs).values().map(String).maxBy('length').length);\n    const rows = _.map(launchArgs, (v, k) => {\n      const paddedKey = k.padEnd(keyMaxLength, ' ');\n      const paddedValue = `${v}`.padEnd(valueMaxLength, ' ');\n      return `${paddedKey} | ${paddedValue}`;\n    });\n\n    const keyHeader = 'Key'.padEnd(keyMaxLength, ' ');\n    const valueHeader = 'Value'.padEnd(valueMaxLength, ' ');\n    const header = `${keyHeader} | ${valueHeader}`;\n    const separator = '-'.repeat(header.length);\n\n    log.info({},\n      'Waiting for you to manually launch your app in Android Studio.\\n\\n' +\n      `Instrumentation class: ${instrumentationClass}\\n` +\n      'Instrumentation arguments:\\n' +\n      `${separator}\\n` +\n      `${header}\\n` +\n      `${separator}\\n` +\n      `${rows.join('\\n')}\\n` +\n      `${separator}\\n\\n` +\n      'Press any key to continue...'\n    );\n  }\n}\n\nmodule.exports = AndroidDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/AndroidDriver.test.js",
    "content": "const Deferred = require('../../../../utils/Deferred');\n\n// @ts-nocheck\ndescribe('Android driver', () => {\n  const adbName = 'device-adb-name';\n  const bundleId = 'bundle-id-mock';\n  const detoxServerPort = 1234;\n  const mockNotificationDataTargetPath = '/ondevice/path/to/notification.json';\n\n  let logger;\n  let fs; // on the next rewrite, do your best not to mock fs\n  let client;\n  let getAbsoluteBinaryPath;\n  let eventEmitter;\n  let detoxApi;\n  let espressoDetoxApi;\n  let invocationManager;\n  let adb;\n  let aapt;\n  let apkValidator;\n  let fileTransfer;\n  let appInstallHelper;\n  let appUninstallHelper;\n  let instrumentation;\n\n  let uut;\n  beforeEach(() => {\n    setUpModuleDepMocks();\n    setUpClassDepMocks();\n\n    const AndroidDriver = require('./AndroidDriver');\n    uut = new AndroidDriver({\n      client,\n      invocationManager,\n      eventEmitter,\n      adb,\n      aapt,\n      apkValidator,\n      fileTransfer,\n      appInstallHelper,\n      appUninstallHelper,\n      instrumentation,\n    }, { adbName });\n  });\n\n  describe('Instrumentation bootstrap', () => {\n    it('should launch instrumentation upon app launch', async () => {\n      const userArgs = {\n        anArg: 'aValue',\n      };\n      await uut.launchApp(bundleId, userArgs, '');\n      expect(instrumentation.launch).toHaveBeenCalledWith(adbName, bundleId, userArgs);\n    });\n\n    it('should break if instrumentation launch fails', async () => {\n      instrumentation.launch.mockRejectedValue(new Error('Simulated failure'));\n\n      await expect(uut.launchApp(bundleId, {}, '')).rejects.toThrow('Simulated failure');\n    });\n\n    it('should set a termination callback function', async () => {\n      await uut.launchApp(bundleId, {}, '');\n      expect(instrumentation.setTerminationFn).toHaveBeenCalledWith(expect.any(Function));\n    });\n\n    it('should adb-reverse the detox server port', async () => {\n      await uut.launchApp(bundleId, {}, '');\n      await expect(adb.reverse).toHaveBeenCalledWith(adbName, detoxServerPort.toString());\n    });\n  });\n\n  describe('Instrumentation unexpected termination', () => {\n    beforeEach(async () => {\n      await uut.launchApp(bundleId, {}, '');\n      await invokeTerminationCallbackFn();\n    });\n\n    it('should clear out the termination callback function', () =>\n      expect(instrumentation.setTerminationFn).toHaveBeenCalledWith(null));\n\n    it('should adb-unreverse the detox server port', () =>\n      expect(adb.reverseRemove).toHaveBeenCalledWith(adbName, detoxServerPort.toString()));\n\n    const extractTerminationCallbackFn = () => instrumentation.setTerminationFn.mock.calls[0][0];\n    const invokeTerminationCallbackFn = async () => {\n      const fn = extractTerminationCallbackFn();\n      await fn();\n    };\n  });\n\n  describe('App termination', () => {\n    beforeEach(async () => {\n      await uut.launchApp(bundleId, {}, '');\n      await uut.terminate();\n    });\n\n    it('should terminate instrumentation', () =>\n      expect(instrumentation.terminate).toHaveBeenCalled());\n\n    it('should clear out the termination callback function', () =>\n      expect(instrumentation.setTerminationFn).toHaveBeenCalledWith(null));\n\n    it('should terminate ADB altogether', () =>\n      expect(adb.terminate).toHaveBeenCalled());\n  });\n\n  describe('Cleanup', () => {\n    beforeEach(async () => await uut.cleanup());\n\n    it('should terminate instrumentation', () =>\n      expect(instrumentation.terminate).toHaveBeenCalled());\n\n    it('should clear out the termination callback function', () =>\n      expect(instrumentation.setTerminationFn).toHaveBeenCalledWith(null));\n\n    it('should turn off the events emitter', () =>\n      expect(eventEmitter.off).toHaveBeenCalled());\n  });\n\n  describe('URL runtime delivery handling', () => {\n    const detoxURLOverride = 'schema://android-url';\n\n    const detoxApiInvocation = {\n      method: 'startActivityFromUrl-mocked'\n    };\n    const mockStartActivityInvokeApi = () => detoxApi.startActivityFromUrl.mockReturnValue(detoxApiInvocation);\n    const assertActivityStartInvoked = () => {\n      expect(invocationManager.execute).toHaveBeenCalledWith(detoxApiInvocation);\n      expect(detoxApi.startActivityFromUrl).toHaveBeenCalledWith(detoxURLOverride);\n    };\n    const assertActivityStartNotInvoked = () => expect(detoxApi.startActivityFromUrl).not.toHaveBeenCalled();\n\n    const assertInstrumentationLaunchedWith = (args) => expect(instrumentation.launch).toHaveBeenCalledWith(adbName, bundleId, args);\n    const assertInstrumentationNotLaunched = () => expect(instrumentation.launch).not.toHaveBeenCalled();\n\n    describe('in app launch (with dedicated arg)', () => {\n      const args = {\n        detoxURLOverride,\n      };\n\n      it('should launch instrumentation with the URL in a clean launch', async () => {\n        adb.getInstrumentationRunner.mockResolvedValue('mock test-runner');\n\n        await uut.launchApp(bundleId, args, '');\n\n        assertInstrumentationLaunchedWith(args);\n      });\n\n      it('should start the app with URL via invocation-manager', async () => {\n        mockStartActivityInvokeApi();\n        mockInstrumentationRunning();\n\n        await uut.launchApp(bundleId, args, '');\n\n        assertActivityStartInvoked();\n        assertInstrumentationNotLaunched();\n      });\n    });\n\n    describe('via explicit payload-delivery call', () => {\n      const args = {\n        url: detoxURLOverride,\n      };\n      const argsDelayed = {\n        ...args,\n        delayPayload: true,\n      };\n\n      it('should start the app via invocation-manager', async () => {\n        mockStartActivityInvokeApi();\n\n        await uut.launchApp(bundleId, {}, '');\n        await uut.deliverPayload(args);\n\n        assertActivityStartInvoked();\n      });\n\n      it('should not start the app via invocation-manager', async () => {\n        mockStartActivityInvokeApi();\n\n        await uut.launchApp(bundleId, {}, '');\n        await uut.deliverPayload(argsDelayed);\n\n        assertActivityStartNotInvoked();\n      });\n    });\n\n  });\n\n  describe('Notification data handling', () => {\n    const notificationArgs = Object.freeze({\n      detoxUserNotificationDataURL: '/path/to/notif.data',\n    });\n\n    const detoxApiInvocation = {\n      method: 'startActivityFromNotification-mocked'\n    };\n    const mockStartActivityInvokeApi = () => detoxApi.startActivityFromNotification.mockReturnValue(detoxApiInvocation);\n    const assertActivityStartInvoked = () => {\n      expect(invocationManager.execute).toHaveBeenCalledWith(detoxApiInvocation);\n      expect(detoxApi.startActivityFromNotification).toHaveBeenCalledWith(mockNotificationDataTargetPath);\n    };\n    const assertActivityStartNotInvoked = () => {\n      expect(detoxApi.startActivityFromNotification).not.toHaveBeenCalled();\n    };\n\n    const assertInstrumentationLaunchedWith = (args) => expect(instrumentation.launch).toHaveBeenCalledWith(adbName, bundleId, args);\n    const assertInstrumentationNotSpawned = () => expect(instrumentation.launch).not.toHaveBeenCalled();\n\n    describe('in app launch (with dedicated arg)', () => {\n      it('should prepare the device for receiving notification data file', async () => {\n        await uut.launchApp(bundleId, notificationArgs, '');\n        expect(fileTransfer.prepareDestinationDir).toHaveBeenCalledWith(adbName);\n      });\n\n      it('should transfer the notification data file to the device', async () => {\n        await uut.launchApp(bundleId, notificationArgs, '');\n        expect(fileTransfer.send).toHaveBeenCalledWith(adbName, notificationArgs.detoxUserNotificationDataURL, 'notification.json');\n      });\n\n      it('should not send the data if device prep fails', async () => {\n        fileTransfer.prepareDestinationDir.mockRejectedValue(new Error());\n        await expect(uut.launchApp(bundleId, notificationArgs, '')).rejects.toThrow();\n      });\n\n      it('should launch instrumentation with a modified notification data URL arg', async () => {\n        fileTransfer.send.mockReturnValue(mockNotificationDataTargetPath);\n\n        await uut.launchApp(bundleId, notificationArgs, '');\n\n        assertInstrumentationLaunchedWith({ detoxUserNotificationDataURL: mockNotificationDataTargetPath });\n      });\n    });\n\n    [\n      {\n        description: 'in app launch when already running',\n        applyFn: () => {\n          mockInstrumentationRunning();\n          return uut.launchApp(bundleId, notificationArgs, '');\n        },\n      },\n      {\n        description: 'via explicit payload-delivery call',\n        applyFn: () => uut.deliverPayload(notificationArgs),\n      },\n    ].forEach((spec) => {\n      describe(spec.description, () => {\n        it('should pre-transfer notification data to device', async () => {\n          await spec.applyFn();\n\n          expect(fileTransfer.prepareDestinationDir).toHaveBeenCalledWith(adbName);\n          expect(fileTransfer.send).toHaveBeenCalledWith(adbName, notificationArgs.detoxUserNotificationDataURL, 'notification.json');\n        });\n\n        it('should start the app with notification data using invocation-manager', async () => {\n          mockStartActivityInvokeApi();\n\n          await spec.applyFn();\n\n          assertActivityStartInvoked();\n          assertInstrumentationNotSpawned();\n        });\n      });\n    });\n\n    describe('via explicit payload-delivery call', () => {\n      const notificationArgsDelayed = {\n        ...notificationArgs,\n        delayPayload: true,\n      };\n\n      it('should not send notification data is payload send-out is set as delayed', async () => {\n        await uut.launchApp(bundleId, {}, '');\n        await uut.deliverPayload(notificationArgsDelayed);\n\n        expect(fileTransfer.send).not.toHaveBeenCalled();\n      });\n\n      it('should not start the app using invocation-manager', async () => {\n        await uut.launchApp(bundleId, {}, '');\n        await uut.deliverPayload(notificationArgsDelayed, adbName);\n\n        assertActivityStartNotInvoked();\n      });\n    });\n\n  });\n\n  describe('Device ready-wait', () => {\n    it('should delegate wait to device being ready via client api', async () => {\n      await uut.waitUntilReady();\n      expect(client.waitUntilReady).toHaveBeenCalled();\n    }, 2000);\n\n    it('should fail if instrumentation async\\'ly-dies prematurely while waiting for device-ready resolution', async () => {\n      const instrumentationError = new Error('mock instrumentation crash error');\n      const waitForCrash = new Deferred();\n      instrumentation.waitForCrash.mockReturnValue(waitForCrash.promise);\n\n      await uut.launchApp(bundleId, {}, '');\n\n      const clientWait = new Deferred();\n      client.waitUntilReady.mockReturnValue(clientWait.promise);\n\n      const promise = uut.waitUntilReady();\n      setTimeout(waitForCrash.reject, 1, instrumentationError);\n\n      try {\n        await expect(promise).rejects.toThrow(instrumentationError);\n      } finally {\n        clientWait.resolve();\n      }\n    }, 2000);\n\n    it('should fail with client error if instrumentation dies because of client terminating the app', async () => {\n      const instrumentationError = new Error('mock instrumentation crash error');\n      const clientCrashError = new Error('mock client crash error');\n\n      const clientWait = new Deferred();\n      const clientDisconnect = new Deferred();\n      const waitForCrash = new Deferred();\n\n      client.waitUntilReady.mockReturnValue(clientWait.promise);\n      client.waitUntilDisconnected.mockReturnValue(clientDisconnect.promise);\n      instrumentation.waitForCrash.mockReturnValue(waitForCrash.promise);\n\n      waitForCrash.promise.catch(() => setTimeout(clientWait.reject, 1));\n      clientWait.promise.catch(() => setTimeout(clientDisconnect.reject, 2, clientCrashError));\n\n      await uut.launchApp(bundleId, {}, '');\n\n      const promise = uut.waitUntilReady();\n      setTimeout(waitForCrash.reject, 1, instrumentationError);\n\n      try {\n        await expect(promise).rejects.toThrow(clientCrashError);\n      } finally {\n        clientWait.resolve();\n      }\n    }, 2000);\n\n    it('should abort crash-wait if instrumentation doesnt crash', async () => {\n      client.waitUntilReady.mockResolvedValue('mocked');\n      await uut.waitUntilReady();\n      expect(instrumentation.abortWaitForCrash).toHaveBeenCalled();\n    });\n\n    it('should abort crash-wait if instrumentation crashes', async () => {\n      client.waitUntilReady.mockResolvedValue('mocked');\n      instrumentation.waitForCrash.mockRejectedValue(new Error());\n\n      await uut.launchApp(bundleId, {}, '');\n      await expect(uut.waitUntilReady()).rejects.toThrow();\n      expect(instrumentation.abortWaitForCrash).toHaveBeenCalled();\n    });\n  });\n\n  describe('App installation', () => {\n    const binaryPath = 'mock-bin-path';\n    const testBinaryPath = 'mock-test-bin-path';\n\n    const givenAppApkValidationFailure = (error) => apkValidator.validateAppApk.mockRejectedValue(error);\n    const givenTestApkValidationFailure = (error) => apkValidator.validateTestApk.mockRejectedValue(error);\n    const loggerWarnMessage = () => logger.warn.mock.calls[0][0];\n\n    it('should adb-install the app\\'s binary', async () => {\n      await uut.installApp(binaryPath, testBinaryPath);\n\n      expect(getAbsoluteBinaryPath).toHaveBeenCalledWith(binaryPath);\n      expect(adb.install).toHaveBeenCalledWith(adbName, mockGetAbsoluteBinaryPathImpl(binaryPath));\n    });\n\n    it('should adb-install the test binary', async () => {\n      await uut.installApp(binaryPath, testBinaryPath);\n\n      expect(getAbsoluteBinaryPath).toHaveBeenCalledWith(binaryPath);\n      expect(adb.install).toHaveBeenCalledWith(adbName, mockGetAbsoluteBinaryPathImpl(testBinaryPath));\n    });\n\n    it('should resort to auto test-binary path resolution, if not specific', async () => {\n      const expectedTestBinPath = mockAPKPathGetTestApkPathImpl(mockGetAbsoluteBinaryPathImpl(binaryPath));\n\n      fs.existsSync.mockReturnValue(true);\n\n      await uut.installApp(binaryPath, undefined);\n\n      expect(fs.existsSync).toHaveBeenCalledWith(expectedTestBinPath);\n      expect(adb.install).toHaveBeenCalledWith(adbName, expectedTestBinPath);\n    });\n\n    it('should throw if auto test-binary path resolves an invalid file', async () => {\n      const expectedTestBinPath = mockAPKPathGetTestApkPathImpl(mockGetAbsoluteBinaryPathImpl(binaryPath));\n\n      fs.existsSync.mockReturnValue(false);\n\n      await expect(uut.installApp(binaryPath, undefined))\n        .rejects\n        .toThrowErrorMatchingSnapshot(expectedTestBinPath);\n    });\n\n    it('should warn if app APK validation fails', async () => {\n      const error = new Error('app apk validation failure');\n      givenAppApkValidationFailure(error);\n\n      await uut.installApp(binaryPath, testBinaryPath);\n      expect(loggerWarnMessage()).toEqual(error.toString());\n      expect(apkValidator.validateAppApk).toHaveBeenCalledWith(mockGetAbsoluteBinaryPathImpl(binaryPath));\n    });\n\n    it('should warn if test APK validation fails', async () => {\n      const error = new Error('test apk validation failure');\n      givenTestApkValidationFailure(error);\n\n      await uut.installApp(binaryPath, testBinaryPath);\n      expect(loggerWarnMessage()).toEqual(error.toString());\n      expect(apkValidator.validateTestApk).toHaveBeenCalledWith(mockGetAbsoluteBinaryPathImpl(testBinaryPath));\n    });\n  });\n\n  describe('Util-binaries installation', () => {\n    const binaryPaths = ['path/to/bin1.apk', '/path/to/bin/2.apk'];\n\n    it('should install using an app-install helper', async () => {\n      await uut.installUtilBinaries(binaryPaths);\n      expect(appInstallHelper.install).toHaveBeenCalledWith(adbName, binaryPaths[0]);\n      expect(appInstallHelper.install).toHaveBeenCalledWith(adbName, binaryPaths[1]);\n    });\n\n    it('should break if one installation fails', async () => {\n      appInstallHelper.install\n        .mockResolvedValueOnce()\n        .mockRejectedValueOnce(new Error())\n        .mockResolvedValueOnce();\n\n      await expect(uut.installUtilBinaries(binaryPaths)).rejects.toThrow();\n      expect(appInstallHelper.install).toHaveBeenCalledWith(adbName, binaryPaths[0]);\n      expect(appInstallHelper.install).toHaveBeenCalledWith(adbName, binaryPaths[1]);\n      expect(appInstallHelper.install).toHaveBeenCalledTimes(2);\n    });\n\n    it('should not install if already installed', async () => {\n      adb.isPackageInstalled.mockResolvedValueOnce(false).mockResolvedValueOnce(true);\n      await uut.installUtilBinaries(binaryPaths);\n      expect(appInstallHelper.install).toHaveBeenCalledWith(adbName, binaryPaths[0]);\n      expect(appInstallHelper.install).not.toHaveBeenCalledWith(adbName, binaryPaths[1]);\n    });\n\n    it('should properly check for preinstallation', async () => {\n      const packageId = 'mockPackageId';\n      const binaryPath = 'some/path/file.apk';\n      aapt.getPackageName.mockResolvedValue(packageId);\n\n      await uut.installUtilBinaries([binaryPath]);\n      expect(adb.isPackageInstalled).toHaveBeenCalledWith(adbName, packageId);\n      expect(aapt.getPackageName).toHaveBeenCalledWith(mockGetAbsoluteBinaryPathImpl(binaryPath));\n    });\n  });\n\n  describe('net-port reversing', () => {\n    const port = 1337;\n\n    it(`should invoke ADB's reverse`, async () => {\n      await uut.reverseTcpPort(port);\n      expect(adb.reverse).toHaveBeenCalledWith(adbName, port);\n    });\n\n    it(`should invoke ADB's reverse, given a device handle`, async () => {\n      await uut.reverseTcpPort(port);\n      expect(adb.reverse).toHaveBeenCalledWith(adbName, port);\n    });\n\n    it(`should invoke ADB's reverse-remove`, async () => {\n      await uut.unreverseTcpPort(port);\n      expect(adb.reverseRemove).toHaveBeenCalledWith(adbName, port);\n    });\n\n    it(`should invoke ADB's reverse-remove, given a device handle`, async () => {\n      await uut.unreverseTcpPort(port);\n      expect(adb.reverseRemove).toHaveBeenCalledWith(adbName, port);\n    });\n  });\n\n  describe('resetAppState', () => {\n    it('should clear app data and grant all permissions for a single bundleId', async () => {\n      await uut.resetAppState(bundleId);\n      expect(adb.clearAppData).toHaveBeenCalledWith(adbName, bundleId);\n      expect(adb.grantAllPermissions).toHaveBeenCalledWith(adbName, bundleId);\n    });\n\n    it('should clear app data and grant all permissions for multiple bundleIds', async () => {\n      const bundleId1 = 'com.example.app1';\n      const bundleId2 = 'com.example.app2';\n\n      await uut.resetAppState(bundleId1, bundleId2);\n\n      expect(adb.clearAppData).toHaveBeenCalledWith(adbName, bundleId1);\n      expect(adb.clearAppData).toHaveBeenCalledWith(adbName, bundleId2);\n      expect(adb.grantAllPermissions).toHaveBeenCalledWith(adbName, bundleId1);\n      expect(adb.grantAllPermissions).toHaveBeenCalledWith(adbName, bundleId2);\n    });\n  });\n\n  describe('text-typing (global)', () => {\n    const text = 'text to type';\n\n    it(`should invoke ADB's text typing`, async () => {\n      await uut.typeText( text);\n      expect(adb.typeText).toHaveBeenCalledWith(adbName, text);\n    });\n\n    it(`should invoke ADB's text typing, given a device handle`, async () => {\n      await uut.typeText(text);\n      expect(adb.typeText).toHaveBeenCalledWith(adbName, text);\n    });\n  });\n\n  describe('device tap and longPress', () => {\n    const point = { x: 100, y: 200 };\n    const duration = 900;\n    const shouldIgnoreStatusBar = false;\n\n    it(`should call tap with the right params`, async () => {\n      await uut.tap(point, shouldIgnoreStatusBar);\n      expect(espressoDetoxApi.tap).toHaveBeenCalledWith(point.x, point.y, shouldIgnoreStatusBar);\n    });\n\n    it(`should call longPress with the right params`, async () => {\n      await uut.longPress(point, duration, shouldIgnoreStatusBar);\n      expect(espressoDetoxApi.longPress).toHaveBeenCalledWith(point.x, point.y, duration, shouldIgnoreStatusBar);\n    });\n  });\n\n  const setUpModuleDepMocks = () => {\n    jest.mock('../../../../utils/logger');\n    logger = require('../../../../utils/logger');\n\n    jest.mock('fs-extra', () => ({\n      existsSync: jest.fn(),\n      realpathSync: jest.fn(),\n    }));\n    fs = require('fs-extra');\n\n    jest.mock('../../../../utils/encoding', () => ({\n      encodeBase64: (x) => `base64(${x})`,\n    }));\n\n    jest.mock('../../../../utils/sleep', () => jest.fn().mockResolvedValue(''));\n    jest.mock('../../../../utils/retry', () => jest.fn().mockResolvedValue(''));\n\n    jest.mock('../../../../utils/getAbsoluteBinaryPath', () =>\n      jest.fn().mockImplementation((x) => `absolutePathOf(${x})`),\n    );\n    getAbsoluteBinaryPath = require('../../../../utils/getAbsoluteBinaryPath');\n\n    jest.mock('../../../common/drivers/android/tools/apk', () => ({\n      getTestApkPath: mockAPKPathGetTestApkPathImpl,\n    }));\n\n    jest.mock('../../../../utils/childProcess');\n\n    client = {\n      serverUrl: `ws://localhost:${detoxServerPort}`,\n      waitUntilReady: jest.fn(),\n      waitUntilDisconnected: jest.fn().mockResolvedValue(),\n    };\n\n    eventEmitter = {\n      emit: jest.fn(),\n      off: jest.fn(),\n    };\n\n    jest.mock('../../../../android/espressoapi/Detox');\n    detoxApi = require('../../../../android/espressoapi/Detox');\n\n    jest.mock('../../../../android/espressoapi/EspressoDetox');\n    espressoDetoxApi = require('../../../../android/espressoapi/EspressoDetox');\n\n    const InvocationManager = jest.createMockFromModule('../../../../invoke').InvocationManager;\n    invocationManager = new InvocationManager();\n  };\n\n  const setUpClassDepMocks = () => {\n    jest.mock('../../../common/drivers/android/tools/MonitoredInstrumentation');\n    const MonitoredInstrumentation = require('../../../common/drivers/android/tools/MonitoredInstrumentation');\n    instrumentation = new MonitoredInstrumentation();\n    mockInstrumentationDead();\n\n    jest.mock('../../../common/drivers/android/exec/ADB');\n    const ADB = jest.requireMock('../../../common/drivers/android/exec/ADB');\n    adb = new ADB();\n    adb.adbBin = 'ADB binary mock';\n    adb.spawnInstrumentation.mockReturnValue({\n      childProcess: {\n        on: jest.fn(),\n        stdout: {\n          setEncoding: jest.fn(),\n          on: jest.fn(),\n        }\n      }\n    });\n\n    jest.mock('../../../common/drivers/android/exec/AAPT');\n    const AAPT = require('../../../common/drivers/android/exec/AAPT');\n    aapt = new AAPT();\n\n    jest.mock('../../../common/drivers/android/tools/ApkValidator');\n    const ApkValidator = require('../../../common/drivers/android/tools/ApkValidator');\n    apkValidator = new ApkValidator();\n\n    jest.mock('../../../common/drivers/android/tools/FileTransfer');\n    const FileTransfer = jest.requireMock('../../../common/drivers/android/tools/FileTransfer');\n    fileTransfer = new FileTransfer();\n    fileTransfer.send.mockResolvedValue(mockNotificationDataTargetPath);\n\n    jest.mock('../../../common/drivers/android/tools/AppInstallHelper');\n    const AppInstallHelper = require('../../../common/drivers/android/tools/AppInstallHelper');\n    appInstallHelper = new AppInstallHelper();\n\n    jest.mock('../../../common/drivers/android/tools/AppUninstallHelper');\n    const AppUninstallHelper = require('../../../common/drivers/android/tools/AppUninstallHelper');\n    appUninstallHelper = new AppUninstallHelper();\n\n\n    jest.mock('../../../allocation/DeviceRegistry');\n  };\n\n  const mockGetAbsoluteBinaryPathImpl = (x) => `absolutePathOf(${x})`;\n  const mockAPKPathGetTestApkPathImpl = (x) => `testApkPathOf(${x})`;\n\n  const mockInstrumentationRunning = () => instrumentation.isRunning.mockReturnValue(true);\n  const mockInstrumentationDead = () => instrumentation.isRunning.mockReturnValue(false);\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/__snapshots__/AndroidDriver.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Android driver App installation should throw if auto test-binary path resolves an invalid file: testApkPathOf(absolutePathOf(mock-bin-path)) 1`] = `\n\"The test APK could not be found at path: 'testApkPathOf(absolutePathOf(mock-bin-path))'\n\nHINT: Try running the detox build command, and make sure it was configured to execute a build command (e.g. './gradlew assembleAndroidTest')\nFor further assistance, visit the project setup guide (select the Android tabs): https://wix.github.io/Detox/docs/introduction/project-setup\"\n`;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/attached/AttachedAndroidDriver.js",
    "content": "const AndroidDriver = require('../AndroidDriver');\n\nclass AttachedAndroidDriver extends AndroidDriver {\n  getDeviceName() {\n    return `AttachedDevice:${this.adbName}`;\n  }\n}\n\nmodule.exports = AttachedAndroidDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/attached/AttachedAndroidDriver.test.js",
    "content": "describe('Attached android device driver', () => {\n  const adbName = '9A291FFAZ005S9';\n\n  let emitter;\n  let uut;\n  beforeEach(() => {\n    jest.mock('../../../../../utils/logger');\n\n    const Emitter = jest.createMockFromModule('../../../../../utils/AsyncEmitter');\n    emitter = new Emitter();\n\n    const { InvocationManager } = jest.createMockFromModule('../../../../../invoke');\n    const invocationManager = new InvocationManager();\n\n    const AttachedAndroidDriver = require('./AttachedAndroidDriver');\n    uut = new AttachedAndroidDriver({\n      invocationManager,\n      emitter,\n      client: {},\n    }, { adbName });\n  });\n\n  it('should return the adb-name as the external ID', () => {\n    expect(uut.getExternalId()).toEqual(adbName);\n  });\n\n  it('should return the instance description as the external ID', () => {\n    expect(uut.getDeviceName()).toEqual(`AttachedDevice:${adbName}`);\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/emulator/EmulatorDriver.js",
    "content": "// @ts-nocheck\nconst AndroidDriver = require('../AndroidDriver');\n\n/**\n * @typedef { AndroidDriverDeps } EmulatorDriverDeps\n */\n\n/**\n * @typedef { AndroidDriverProps } EmulatorDriverProps\n * @property avdName { String }\n * @property forceAdbInstall { Boolean }\n */\n\nclass EmulatorDriver extends AndroidDriver {\n  /**\n   * @param deps { EmulatorDriverDeps }\n   * @param props { EmulatorDriverProps }\n   */\n  constructor(deps, { adbName, avdName, forceAdbInstall }) {\n    super(deps, { adbName });\n\n    this._deviceName = `${adbName} (${avdName})`;\n    this._forceAdbInstall = forceAdbInstall;\n  }\n\n  getDeviceName() {\n    return this._deviceName;\n  }\n\n  async _installAppBinaries(appBinaryPath, testBinaryPath) {\n    if (this._forceAdbInstall) {\n      await super._installAppBinaries(appBinaryPath, testBinaryPath);\n    } else {\n      await this.__installAppBinaries(appBinaryPath, testBinaryPath);\n    }\n  }\n\n  async setLocation(lat, lon) {\n    await this.adb.setLocation(this.adbName, lat, lon);\n  }\n\n  async __installAppBinaries(appBinaryPath, testBinaryPath) {\n    await this.appInstallHelper.install(this.adbName, appBinaryPath, testBinaryPath);\n  }\n}\n\nmodule.exports = EmulatorDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.js",
    "content": "// @ts-nocheck\nconst DetoxGenymotionManager = require('../../../../../android/espressoapi/DetoxGenymotionManager');\nconst AndroidDriver = require('../AndroidDriver');\n\n/**\n * @typedef { AndroidDriverDeps } GenycloudDriverDeps\n */\n\n/**\n * @typedef GenycloudDriverProps\n * @property adbName { GenyInstance } The DTO associated with the cloud instance\n */\n\nclass GenyCloudDriver extends AndroidDriver {\n  /**\n   * @param deps { GenycloudDriverDeps }\n   * @param props { GenycloudEmulatorCookie }\n   */\n  constructor(deps, { adbName, name }) {\n    super(deps, { adbName });\n\n    // Make ADB more resilient to network latency and connection hiccups\n    this.adb.defaultExecOptions = {\n      retries: 5,\n      interval: 3000,\n      backoff: 'linear',\n    };\n    this._instanceName = name;\n  }\n\n  getDeviceName() {\n    return this._instanceName;\n  }\n\n  async setLocation(lat, lon) {\n    await this.invocationManager.execute(DetoxGenymotionManager.setLocation(parseFloat(lat), parseFloat(lon)));\n  }\n\n  async _installAppBinaries(appBinaryPath, testBinaryPath) {\n    await this.appInstallHelper.install(this.adbName, appBinaryPath, testBinaryPath);\n  }\n}\n\nmodule.exports = GenyCloudDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.test.js",
    "content": "describe('Genymotion-cloud driver', () => {\n  const aCookie = () => ({\n    id: 'mock-instance-uuid',\n    name: 'mock-instance-name',\n    adbName: 'mock-instance-adb-name',\n  });\n\n  /** @type {jest.Mocked<*>} */\n  let adb;\n  /** @type {jest.Mocked<*>} */\n  let aapt;\n  /** @type {jest.Mocked<*>} */\n  let eventEmitter;\n  /** @type {jest.Mocked<*>} */\n  let invocationManager;\n  /** @type {jest.Mocked<*>} */\n  let appInstallHelper;\n  /** @type {jest.Mocked<*>} */\n  let apkValidator;\n  /** @type {jest.Mocked<*>} */\n  let instrumentation;\n  /** @type {jest.Mocked<*>} */\n  let detoxGenymotionManager;\n\n  beforeEach(() => {\n    jest.mock('../../../../common/drivers/android/exec/ADB');\n    const ADB = jest.requireMock('../../../../common/drivers/android/exec/ADB');\n    adb = new ADB();\n\n    jest.mock('../../../../common/drivers/android/exec/AAPT');\n    const AAPT = jest.requireMock('../../../../common/drivers/android/exec/AAPT');\n    aapt = new AAPT();\n    aapt.isTestAPK\n      .mockResolvedValueOnce(false)\n      .mockResolvedValueOnce(true);\n\n    jest.mock('../../../../../utils/getAbsoluteBinaryPath');\n\n    const Emitter = jest.createMockFromModule('../../../../../utils/AsyncEmitter');\n    eventEmitter = new Emitter();\n\n    const { InvocationManager } = jest.createMockFromModule('../../../../../invoke');\n    invocationManager = new InvocationManager();\n\n    jest.mock('../../../../common/drivers/android/tools/AppUninstallHelper');\n\n    jest.mock('../../../../common/drivers/android/tools/AppInstallHelper');\n    const AppInstallHelper = jest.requireMock('../../../../common/drivers/android/tools/AppInstallHelper');\n    appInstallHelper = new AppInstallHelper();\n\n    jest.mock('../../../../common/drivers/android/tools/ApkValidator');\n    const ApkValidator = jest.requireMock('../../../../common/drivers/android/tools/ApkValidator');\n    apkValidator = new ApkValidator();\n\n    jest.mock('../../../../common/drivers/android/tools/MonitoredInstrumentation');\n    const Instrumentation = jest.requireMock('../../../../common/drivers/android/tools/MonitoredInstrumentation');\n    instrumentation = new Instrumentation();\n\n    jest.mock('../../../../../android/espressoapi/DetoxGenymotionManager');\n    detoxGenymotionManager = jest.requireMock('../../../../../android/espressoapi/DetoxGenymotionManager');\n  });\n\n  describe('instance scope', () => {\n    let GenyCloudDriver;\n    let uut;\n    beforeEach(() => {\n      adb.defaultExecOptions = {};\n      GenyCloudDriver = require('./GenyCloudDriver');\n      uut = new GenyCloudDriver({\n        adb,\n        aapt,\n        apkValidator,\n        invocationManager,\n        eventEmitter,\n        client: {},\n        appInstallHelper,\n        instrumentation,\n      }, aCookie());\n    });\n\n    it('should ease the default ADB exec options with more cloud-suitable settings', () => {\n      expect(adb.defaultExecOptions).toEqual({\n        retries: 5,\n        interval: 3000,\n        backoff: 'linear',\n      });\n    });\n\n    it('should return the adb-name as the external ID', () => {\n      expect(uut.getExternalId()).toEqual(aCookie().adbName);\n    });\n\n    it('should return the instance description as the external ID', () => {\n      expect(uut.getDeviceName()).toEqual(aCookie().name);\n    });\n\n    describe('app installation', () => {\n      let getAbsoluteBinaryPath;\n      beforeEach(() => {\n        getAbsoluteBinaryPath = require('../../../../../utils/getAbsoluteBinaryPath');\n      });\n\n      it('should install using install helper', async () => {\n        getAbsoluteBinaryPath\n          .mockReturnValueOnce('bin-install-path')\n          .mockReturnValueOnce('testbin-install-path');\n\n        await uut.installApp('bin-path', 'testbin-path');\n        expect(appInstallHelper.install).toHaveBeenCalledWith(aCookie().adbName, 'bin-install-path', 'testbin-install-path');\n      });\n    });\n\n    describe('clean-up', () => {\n      it('should kill instrumentation', async () => {\n        await uut.cleanup('bundle-id');\n        expect(instrumentation.terminate).toHaveBeenCalled();\n      });\n    });\n\n    describe('setLocation', () => {\n      it('should invoke `DetoxGenymotionManager.setLocation` with specified coordinates', async () => {\n        const invocation = {\n          method: 'setLocation'\n        };\n        detoxGenymotionManager.setLocation.mockReturnValue(invocation);\n\n        await uut.setLocation('40.5', '55.5');\n        expect(invocationManager.execute).toHaveBeenCalledWith(invocation);\n        expect(detoxGenymotionManager.setLocation).toHaveBeenCalledWith(40.5, 55.5);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/index.js",
    "content": "module.exports = {\n  AndroidEmulatorRuntimeDriver: require('./android/emulator/EmulatorDriver'),\n  AttachedAndroidRuntimeDriver: require('./android/attached/AttachedAndroidDriver'),\n  GenycloudRuntimeDriver: require('./android/genycloud/GenyCloudDriver'),\n  IosSimulatorRuntimeDriver: require('./ios/SimulatorDriver'),\n};\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/ios/AppStateResetFallback.js",
    "content": "const SimulatorAppCache = require('../../../common/drivers/ios/tools/SimulatorAppCache');\n\n/**\n * AppStateResetFallback provides app state reset functionality for iOS simulators.\n *\n * This class serves as a fallback implementation because iOS does not provide a native\n * way to reset an app's state (unlike Android's `pm clear` command). To achieve app\n * state reset on iOS, this class implements a backup-uninstall-reinstall strategy:\n *\n * 1. Backs up the app installation to cache\n * 2. Uninstalls the current app instance\n * 3. Restores the app installation from cache\n *\n * This approach ensures the app is returned to a clean state without requiring\n * a full app reinstallation from the original bundle, making it more friendly\n * to local development flows.\n *\n * @class AppStateResetFallback\n */\nclass AppStateResetFallback {\n  /**\n   * Creates an instance of AppStateResetFallback.\n   * @param {Object} config\n   * @param {import('../../../common/drivers/ios/tools/AppleSimUtils')} config.applesimutils - AppleSimUtils instance\n   * @param {SimulatorAppCache} [config.appCache] - Optional SimulatorAppCache instance (for testing/mocking)\n   */\n  constructor({ applesimutils, appCache }) {\n    this.applesimutils = applesimutils;\n    this.appCache = appCache ?? new SimulatorAppCache({ applesimutils });\n  }\n\n  /**\n   * Resets the app state for multiple apps by backing them up and restoring them.\n   * This effectively clears the app state while preserving the app installation.\n   *\n   * @param {string} udid - The device identifier\n   * @param {string[]} bundleIds - Array of app bundle identifiers to reset\n   * @returns {Promise<void>}\n   */\n  async resetAppState(udid, bundleIds) {\n    for (const bundleId of bundleIds) {\n      await this.appCache.backup(udid, bundleId);\n      await this.applesimutils.uninstall(udid, bundleId);\n    }\n\n    for (const bundleId of bundleIds) {\n      await this.appCache.restore(udid, bundleId);\n    }\n  }\n\n  /**\n   * Ensures removal of cached app(s) after a potentially\n   * destructive action (such as install or uninstall),\n   * so {@link resetAppState} can't use a stale backup from cache.\n   *\n   * @param {string} udid - The device identifier\n   * @param {string} [bundleId] - Optional bundle identifier for specific app invalidation\n   * @returns {Promise<void>}\n   */\n  async invalidate(udid, bundleId) {\n    if (bundleId) {\n      await this.appCache.remove(udid, bundleId);\n    } else {\n      await this.appCache.cleanup(udid);\n    }\n  }\n}\n\nmodule.exports = AppStateResetFallback;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/ios/AppStateResetFallback.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../common/drivers/ios/tools/AppleSimUtils');\njest.mock('../../../common/drivers/ios/tools/SimulatorAppCache');\n\ndescribe('AppStateResetFallback', () => {\n  let AppStateResetFallback;\n  let appStateResetFallback;\n  let AppleSimUtils;\n  let applesimutils;\n  let SimulatorAppCache;\n  let simulatorAppCache;\n\n  beforeEach(() => {\n    AppleSimUtils = jest.requireMock('../../../common/drivers/ios/tools/AppleSimUtils');\n    applesimutils = new AppleSimUtils();\n    applesimutils.uninstall.mockResolvedValue();\n\n    SimulatorAppCache = jest.requireMock('../../../common/drivers/ios/tools/SimulatorAppCache');\n    simulatorAppCache = new SimulatorAppCache({ applesimutils });\n    simulatorAppCache.backup.mockResolvedValue();\n    simulatorAppCache.restore.mockResolvedValue();\n\n    AppStateResetFallback = require('./AppStateResetFallback');\n    appStateResetFallback = new AppStateResetFallback({ applesimutils, appCache: simulatorAppCache });\n  });\n\n  it('should create SimulatorAppCache with applesimutils', () => {\n    expect(() => new AppStateResetFallback({ applesimutils })).not.toThrow();\n    expect(SimulatorAppCache).toHaveBeenCalledWith({ applesimutils });\n  });\n\n  it('should reset app state by backing up then restoring all apps', async () => {\n    const udid = 'test-device-123';\n    const bundleIds = ['com.app1', 'com.app2'];\n\n    await appStateResetFallback.resetAppState(udid, bundleIds);\n\n    expect(simulatorAppCache.backup).toHaveBeenCalledTimes(2);\n    expect(simulatorAppCache.backup).toHaveBeenCalledWith(udid, 'com.app1');\n    expect(simulatorAppCache.backup).toHaveBeenCalledWith(udid, 'com.app2');\n\n    expect(applesimutils.uninstall).toHaveBeenCalledTimes(2);\n    expect(applesimutils.uninstall).toHaveBeenCalledWith(udid, 'com.app1');\n    expect(applesimutils.uninstall).toHaveBeenCalledWith(udid, 'com.app2');\n\n    expect(simulatorAppCache.restore).toHaveBeenCalledTimes(2);\n    expect(simulatorAppCache.restore).toHaveBeenCalledWith(udid, 'com.app1');\n    expect(simulatorAppCache.restore).toHaveBeenCalledWith(udid, 'com.app2');\n  });\n\n  it('should handle empty bundle IDs array', async () => {\n    await appStateResetFallback.resetAppState('udid', []);\n\n    expect(simulatorAppCache.backup).not.toHaveBeenCalled();\n    expect(applesimutils.uninstall).not.toHaveBeenCalled();\n    expect(simulatorAppCache.restore).not.toHaveBeenCalled();\n  });\n\n  describe('invalidate', () => {\n    const udid = 'test-device-123';\n    const bundleId = 'com.test.app';\n    const binaryPath = '/path/to/app/binary.app';\n\n    beforeEach(() => {\n      simulatorAppCache.remove.mockResolvedValue();\n      simulatorAppCache.cleanup.mockResolvedValue();\n    });\n\n    it('should invalidate specific app cache when bundleId is provided', async () => {\n      await appStateResetFallback.invalidate(udid, bundleId);\n\n      expect(simulatorAppCache.remove).toHaveBeenCalledWith(udid, bundleId);\n      expect(simulatorAppCache.cleanup).not.toHaveBeenCalled();\n    });\n\n    it('should invalidate entire device cache when bundleId is not provided', async () => {\n      await appStateResetFallback.invalidate(udid);\n\n      expect(simulatorAppCache.cleanup).toHaveBeenCalledWith(udid);\n      expect(simulatorAppCache.remove).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/ios/IosDriver.js",
    "content": "// @ts-nocheck\nconst fs = require('fs');\nconst path = require('path');\n\nconst DetoxRuntimeError = require('../../../../errors/DetoxRuntimeError');\nconst DeviceDriverBase = require('../DeviceDriverBase');\n\nclass IosDriver extends DeviceDriverBase {\n  createPayloadFile(notification) {\n    const notificationFilePath = path.join(this.createRandomDirectory(), `payload.json`);\n    fs.writeFileSync(notificationFilePath, JSON.stringify(notification, null, 2));\n    return notificationFilePath;\n  }\n\n  async setURLBlacklist(blacklistURLs) {\n    await this.client.setSyncSettings({ blacklistURLs: blacklistURLs });\n  }\n\n  async enableSynchronization() {\n    await this.client.setSyncSettings({ enabled: true });\n  }\n\n  async disableSynchronization() {\n    await this.client.setSyncSettings({ enabled: false });\n  }\n\n  async shake() {\n    await this.client.shake();\n  }\n\n  async setOrientation(orientation) {\n    if (!['portrait', 'landscape'].some(option => option === orientation)) throw new DetoxRuntimeError(\"orientation should be either 'portrait' or 'landscape', but got \" + (orientation + ')'));\n    await this.client.setOrientation({ orientation });\n  }\n\n  getPlatform() {\n    return 'ios';\n  }\n}\n\nmodule.exports = IosDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/ios/SimulatorDriver.js",
    "content": "// @ts-nocheck\nconst path = require('path');\n\nconst _ = require('lodash');\n\n\nconst temporaryPath = require('../../../../artifacts/utils/temporaryPath');\nconst DetoxRuntimeError = require('../../../../errors/DetoxRuntimeError');\nconst XCUITestRunner = require('../../../../ios/XCUITestRunner');\nconst { assertTraceDescription } = require('../../../../utils/assertArgument');\nconst { execAsync } = require('../../../../utils/childProcess');\nconst getAbsoluteBinaryPath = require('../../../../utils/getAbsoluteBinaryPath');\nconst { actionDescription } = require('../../../../utils/invocationTraceDescriptions');\nconst log = require('../../../../utils/logger').child({ cat: 'device' });\nconst pressAnyKey = require('../../../../utils/pressAnyKey');\nconst traceInvocationCall = require('../../../../utils/traceInvocationCall').bind(null, log);\n\nconst AppStateResetFallback = require('./AppStateResetFallback');\nconst IosDriver = require('./IosDriver');\n\n/**\n * @typedef SimulatorDriverDeps { DeviceDriverDeps }\n * @property applesimutils { AppleSimUtils }\n */\n\n/**\n * @typedef SimulatorDriverProps\n * @property udid { String } The unique cross-OS identifier of the simulator\n * @property type { String }\n * @property bootArgs { Object }\n */\n\nclass SimulatorDriver extends IosDriver {\n  /**\n   * @param deps { SimulatorDriverDeps }\n   * @param props { SimulatorDriverProps }\n   */\n  constructor(deps, { udid, type, bootArgs, headless }) {\n    super(deps);\n\n    this.getBundleIdFromBinary = _.memoize(this.getBundleIdFromBinary.bind(this));\n\n    this.udid = udid;\n    this._type = type;\n    this._bootArgs = bootArgs;\n    this._headless = headless;\n    this._deviceName = `${udid} (${this._type})`;\n    this._applesimutils = deps.applesimutils;\n    this._appStateResetFallback = new AppStateResetFallback({ applesimutils: this._applesimutils });\n  }\n\n  withAction(xcuitestRunner, action, traceDescription, ...params) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = {\n      ...(params.length !== 0 && { params }),\n      type: 'systemAction',\n      ...(this.index !== undefined && { systemAtIndex: this.index }),\n      systemAction: action\n    };\n\n    return traceInvocationCall(traceDescription, invocation, xcuitestRunner.execute(invocation));\n  }\n\n  getExternalId() {\n    return this.udid;\n  }\n\n  getDeviceName() {\n    return this._deviceName;\n  }\n\n  async getBundleIdFromBinary(appPath) {\n    appPath = getAbsoluteBinaryPath(appPath);\n    try {\n      const bundleId = await execAsync(`/usr/libexec/PlistBuddy -c \"Print CFBundleIdentifier\" \"${path.join(appPath, 'Info.plist')}\"`);\n      if (_.isEmpty(bundleId)) {\n        throw new Error();\n      }\n      return bundleId;\n    } catch (ex) {\n      throw new DetoxRuntimeError(`field CFBundleIdentifier not found inside Info.plist of app binary at ${appPath}`);\n    }\n  }\n\n  async installApp(binaryPath) {\n    const absoluteBinaryPath = getAbsoluteBinaryPath(binaryPath);\n    await this._applesimutils.install(this.udid, absoluteBinaryPath);\n\n    const bundleId = await this.getBundleIdFromBinary(binaryPath);\n    await this._appStateResetFallback.invalidate(this.udid, bundleId);\n  }\n\n  async uninstallApp(bundleId) {\n    const { udid } = this;\n    await this.emitter.emit('beforeUninstallApp', { deviceId: udid, bundleId });\n    await this._applesimutils.uninstall(udid, bundleId);\n    await this._appStateResetFallback.invalidate(udid, bundleId);\n  }\n\n  async resetAppState(...bundleIds) {\n    const { udid } = this;\n    const _bundleIds = bundleIds.length > 0 ? bundleIds : [this._bundleId];\n    await this._appStateResetFallback.resetAppState(udid, _bundleIds);\n  }\n\n  async launchApp(bundleId, launchArgs, languageAndLocale) {\n    const { udid } = this;\n    await this.emitter.emit('beforeLaunchApp', { bundleId, deviceId: udid, launchArgs });\n    const pid = await this._applesimutils.launch(udid, bundleId, launchArgs, languageAndLocale);\n    await this.emitter.emit('launchApp', { bundleId, deviceId: udid, launchArgs, pid });\n\n    return pid;\n  }\n\n  async waitForAppLaunch(bundleId, launchArgs, languageAndLocale) {\n    const { udid } = this;\n\n    await this.emitter.emit('beforeLaunchApp', { bundleId, deviceId: udid, launchArgs });\n\n    this._applesimutils.printLaunchHint(udid, bundleId, launchArgs, languageAndLocale);\n    await pressAnyKey();\n\n    const pid = await this._applesimutils.getPid(udid, bundleId);\n    if (Number.isNaN(pid)) {\n      throw new DetoxRuntimeError({\n        message: `Failed to find a process corresponding to the app bundle identifier (${bundleId}).`,\n        hint: `Make sure that the app is running on the device (${udid}), visually or via CLI:\\n` +\n              `xcrun simctl spawn ${this.udid} launchctl list | grep -F '${bundleId}'\\n`,\n      });\n    } else {\n      log.info({}, `Found the app (${bundleId}) with process ID = ${pid}. Proceeding...`);\n    }\n\n    await this.emitter.emit('launchApp', { bundleId, deviceId: udid, launchArgs, pid });\n    return pid;\n  }\n\n  async terminate(bundleId) {\n    const { udid } = this;\n    await this.emitter.emit('beforeTerminateApp', { deviceId: udid, bundleId });\n    await this._applesimutils.terminate(udid, bundleId);\n    await this.emitter.emit('terminateApp', { deviceId: udid, bundleId });\n  }\n\n  async tap(point, shouldIgnoreStatusBar, _bundleId) {\n    const xcuitestRunner = new XCUITestRunner({ runtimeDevice: { id: this.getExternalId(), _bundleId } });\n    let x = point?.x ?? 100;\n    let y = point?.y ?? 100;\n    const traceDescription = actionDescription.tap({ x, y });\n    return this.withAction(xcuitestRunner, 'coordinateTap', traceDescription, x.toString(), y.toString());\n  }\n\n  async longPress(point, pressDuration, shouldIgnoreStatusBar, _bundleId) {\n    const xcuitestRunner = new XCUITestRunner({ runtimeDevice: { id: this.getExternalId(), _bundleId } });\n    let x = point?.x ?? 100;\n    let y = point?.y ?? 100;\n    let _pressDuration = pressDuration ? pressDuration / 1000 : 1;\n    const traceDescription = actionDescription.longPress({ x, y }, _pressDuration);\n    return this.withAction(xcuitestRunner, 'coordinateLongPress', traceDescription, x.toString(), y.toString(), _pressDuration.toString());\n  }\n\n  async setBiometricEnrollment(yesOrNo) {\n    await this._applesimutils.setBiometricEnrollment(this.udid, yesOrNo);\n  }\n\n  async matchFace() {\n    await this._applesimutils.matchBiometric(this.udid, 'Face');\n  }\n\n  async unmatchFace() {\n    await this._applesimutils.unmatchBiometric(this.udid, 'Face');\n  }\n\n  async matchFinger() {\n    await this._applesimutils.matchBiometric(this.udid, 'Finger');\n  }\n\n  async unmatchFinger() {\n    await this._applesimutils.unmatchBiometric(this.udid, 'Finger');\n  }\n\n  async sendToHome() {\n    await this._applesimutils.sendToHome(this.udid);\n  }\n\n  async setLocation(lat, lon) {\n    await this._applesimutils.setLocation(this.udid, lat, lon);\n  }\n\n  async setPermissions(bundleId, permissions) {\n    await this._applesimutils.setPermissions(this.udid, bundleId, permissions);\n  }\n\n  async clearKeychain() {\n    await this._applesimutils.clearKeychain(this.udid);\n  }\n\n  async resetContentAndSettings() {\n    await this.emitter.emit('beforeShutdownDevice', { deviceId: this.udid });\n    await this._applesimutils.shutdown(this.udid);\n    await this.emitter.emit('shutdownDevice', { deviceId: this.udid });\n    await this._applesimutils.resetContentAndSettings(this.udid);\n    await this._appStateResetFallback.invalidate(this.udid);\n    await this._applesimutils.boot(this.udid, this._bootArgs, this._headless);\n    await this.emitter.emit('bootDevice', { deviceId: this.udid });\n  }\n\n  getLogsPaths() {\n    return this._applesimutils.getLogsPaths(this.udid);\n  }\n\n  async waitForActive() {\n    return await this.client.waitForActive();\n  }\n\n  async waitForBackground() {\n    return await this.client.waitForBackground();\n  }\n\n  async takeScreenshot(screenshotName) {\n    const tempPath = await temporaryPath.for.png();\n    await this._applesimutils.takeScreenshot(this.udid, tempPath);\n\n    await this.emitter.emit('createExternalArtifact', {\n      pluginId: 'screenshot',\n      artifactName: screenshotName || path.basename(tempPath, '.png'),\n      artifactPath: tempPath\n    });\n\n    return tempPath;\n  }\n\n  async captureViewHierarchy(artifactName) {\n    const viewHierarchyURL = temporaryPath.for.viewhierarchy();\n    await this.client.captureViewHierarchy({ viewHierarchyURL });\n\n    await this.emitter.emit('createExternalArtifact', {\n      pluginId: 'uiHierarchy',\n      artifactName: artifactName,\n      artifactPath: viewHierarchyURL\n    });\n\n    return viewHierarchyURL;\n  }\n\n  async generateViewHierarchyXml(shouldInjectTestIds) {\n    return await this.client.generateViewHierarchyXml({ shouldInjectTestIds });\n  }\n\n  async setStatusBar(flags) {\n    await this._applesimutils.statusBarOverride(this.udid, flags);\n  }\n\n  async resetStatusBar() {\n    await this._applesimutils.statusBarReset(this.udid);\n  }\n}\n\nmodule.exports = SimulatorDriver;\n"
  },
  {
    "path": "detox/src/devices/runtime/drivers/ios/SimulatorDriver.test.js",
    "content": "// @ts-nocheck\njest.mock('../../../../ios/XCUITestRunner');\njest.mock('./AppStateResetFallback');\n\ndescribe('IOS simulator driver', () => {\n  const udid = 'UD-1D-MOCK';\n  const type = 'Chika';\n  const bundleId = 'bundle-id-mock';\n  const bootArgs = { boot: 'args' };\n  const headless = true;\n\n  let client;\n  let eventEmitter;\n  let applesimutils;\n  let uut;\n  let AppStateResetFallbackMock;\n  let appStateResetFallbackInstance;\n\n  beforeEach(() => {\n    const AsyncEmitter = require('../../../../utils/AsyncEmitter');\n    eventEmitter = new AsyncEmitter({\n      events: ['beforeLaunchApp'],\n      onError: (e) => { throw e; },\n    });\n\n    const ClientMock = jest.requireMock('../../../../client/Client');\n    client = new ClientMock();\n\n    const AppleSimUtils = jest.createMockFromModule('../../../common/drivers/ios/tools/AppleSimUtils');\n    applesimutils = new AppleSimUtils();\n\n    AppStateResetFallbackMock = jest.requireMock('./AppStateResetFallback');\n    appStateResetFallbackInstance = new AppStateResetFallbackMock();\n    AppStateResetFallbackMock.mockImplementation(() => appStateResetFallbackInstance);\n\n    const SimulatorDriver = require('./SimulatorDriver');\n    uut = new SimulatorDriver(\n      { applesimutils, client, eventEmitter },\n      { udid, type, bootArgs, headless }\n    );\n  });\n\n  it('should return the UDID as the external ID', () => {\n    expect(uut.getExternalId()).toEqual(udid);\n  });\n\n  it('should return the device name', () => {\n    expect(uut.getDeviceName()).toEqual(`${udid} (Chika)`);\n  });\n\n  describe('device-level gestures', () => {\n    let mockExecute;\n    let XCUITestRunner;\n\n    beforeEach(() => {\n      mockExecute = jest.fn().mockResolvedValue();\n\n      // Setup XCUITestRunner mock\n      jest.mock('../../../../ios/XCUITestRunner', () => {\n        return jest.fn().mockImplementation(() => ({\n          execute: mockExecute\n        }));\n      });\n\n      // Get fresh copy of mocked XCUITestRunner\n      XCUITestRunner = require('../../../../ios/XCUITestRunner');\n    });\n\n    describe('tap', () => {\n      it('should create XCUITestRunner with device info', async () => {\n        await uut.tap();\n\n        expect(XCUITestRunner).toHaveBeenCalledWith({\n          runtimeDevice: {\n            id: udid,\n            _bundleId: undefined\n          }\n        });\n      });\n\n      it('should tap with default coordinates when no point provided', async () => {\n        await uut.tap();\n\n        expect(mockExecute).toHaveBeenCalledWith({\n          type: 'systemAction',\n          systemAction: 'coordinateTap',\n          params: ['100', '100']\n        });\n      });\n\n      it('should tap with provided coordinates', async () => {\n        await uut.tap({ x: 200, y: 300 });\n\n        expect(mockExecute).toHaveBeenCalledWith({\n          type: 'systemAction',\n          systemAction: 'coordinateTap',\n          params: ['200', '300']\n        });\n      });\n\n      it('should pass bundleId to XCUITestRunner when provided', async () => {\n        await uut.tap(null, false, 'test.bundle');\n\n        expect(XCUITestRunner).toHaveBeenCalledWith({\n          runtimeDevice: {\n            id: udid,\n            _bundleId: 'test.bundle'\n          }\n        });\n      });\n    });\n\n    describe('longPress', () => {\n      it('should create XCUITestRunner with device info', async () => {\n        await uut.longPress();\n\n        expect(XCUITestRunner).toHaveBeenCalledWith({\n          runtimeDevice: {\n            id: udid,\n            _bundleId: undefined\n          }\n        });\n      });\n\n      it('should long press with default coordinates and duration when no params provided', async () => {\n        await uut.longPress();\n\n        expect(mockExecute).toHaveBeenCalledWith({\n          type: 'systemAction',\n          systemAction: 'coordinateLongPress',\n          params: ['100', '100', '1']\n        });\n      });\n\n      it('should long press with provided coordinates and duration', async () => {\n        await uut.longPress({ x: 200, y: 300 }, 2000);\n\n        expect(mockExecute).toHaveBeenCalledWith({\n          type: 'systemAction',\n          systemAction: 'coordinateLongPress',\n          params: ['200', '300', '2']\n        });\n      });\n\n      it('should convert press duration from milliseconds to seconds', async () => {\n        await uut.longPress({ x: 100, y: 100 }, 3500);\n\n        expect(mockExecute).toHaveBeenCalledWith({\n          type: 'systemAction',\n          systemAction: 'coordinateLongPress',\n          params: ['100', '100', '3.5']\n        });\n      });\n\n      it('should pass bundleId to XCUITestRunner when provided', async () => {\n        await uut.longPress(null, null, false, 'test.bundle');\n\n        expect(XCUITestRunner).toHaveBeenCalledWith({\n          runtimeDevice: {\n            id: udid,\n            _bundleId: 'test.bundle'\n          }\n        });\n      });\n    });\n\n    afterEach(() => {\n      jest.resetModules();\n      jest.clearAllMocks();\n    });\n  });\n\n  describe('launch args', () => {\n    const languageAndLocale = '';\n    let launchArgs;\n\n    beforeEach(() => {\n      launchArgs = {\n        'dog1': 'dharma',\n        'dog2': 'karma',\n      };\n    });\n\n    it('should be passed to AppleSimUtils', async () => {\n      await uut.launchApp(bundleId, launchArgs, languageAndLocale);\n      expect(applesimutils.launch).toHaveBeenCalledWith(udid, bundleId, launchArgs, languageAndLocale);\n    });\n\n    it('should be passed to AppleSimUtils even if some of them were received from `beforeLaunchApp` phase', async () => {\n      eventEmitter.on('beforeLaunchApp', ({ launchArgs }) => {\n        launchArgs.dog3 = 'Chika, from plugin';\n      });\n\n      await uut.launchApp(bundleId, launchArgs, languageAndLocale);\n      expect(applesimutils.launch).toHaveBeenCalledWith(udid, bundleId, {\n        ...launchArgs,\n        dog3: 'Chika, from plugin',\n      }, '');\n    });\n  });\n\n  describe('.installApp', () => {\n    it('should install via AppleSimUtils and invalidate cache with bundleId and binary path', async () => {\n      const binaryPath = '/tmp/MyApp.app';\n      const resolvedBundleId = 'com.example.myapp';\n\n      uut.getBundleIdFromBinary = jest.fn().mockResolvedValue(resolvedBundleId);\n\n      await uut.installApp(binaryPath);\n\n      expect(applesimutils.install).toHaveBeenCalledWith(udid, binaryPath);\n      expect(appStateResetFallbackInstance.invalidate).toHaveBeenCalledWith(udid, resolvedBundleId);\n    });\n  });\n\n  describe('.uninstallApp', () => {\n    it('should uninstall via AppleSimUtils and invalidate specific app cache', async () => {\n      await uut.uninstallApp(bundleId);\n\n      expect(applesimutils.uninstall).toHaveBeenCalledWith(udid, bundleId);\n      expect(appStateResetFallbackInstance.invalidate).toHaveBeenCalledWith(udid, bundleId);\n    });\n  });\n\n  describe('.resetContentAndSettings', () => {\n    it('should shut the device down', async () => {\n      await uut.resetContentAndSettings();\n      expect(applesimutils.shutdown).toHaveBeenCalledWith(udid);\n    });\n\n    it('should reset via apple-sim-utils', async () => {\n      await uut.resetContentAndSettings();\n      expect(applesimutils.resetContentAndSettings).toHaveBeenCalledWith(udid);\n    });\n\n    it('should relaunch the simulator', async () => {\n      await uut.resetContentAndSettings();\n      expect(applesimutils.boot).toHaveBeenCalledWith(udid, bootArgs, true);\n    });\n\n    it('should invalidate the apps cache', async () => {\n      await uut.resetContentAndSettings();\n      expect(appStateResetFallbackInstance.invalidate).toHaveBeenCalledWith(udid);\n    });\n  });\n\n  describe('.captureViewHierarchy', () => {\n    beforeEach(async () => {\n      jest.spyOn(eventEmitter, 'emit');\n\n      await uut.captureViewHierarchy('named hierarchy');\n    });\n\n    it('should call client.captureViewHierarchy', async () => {\n      expect(client.captureViewHierarchy).toHaveBeenCalledWith({\n        viewHierarchyURL: expect.any(String),\n      });\n    });\n\n    it('should emit \"createExternalArtifact\" event for uiHierarchy plugin', async () => {\n      expect(eventEmitter.emit).toHaveBeenCalledWith('createExternalArtifact', {\n        pluginId: 'uiHierarchy',\n        artifactName: 'named hierarchy',\n        artifactPath: expect.any(String),\n      });\n    });\n  });\n\n  describe('biometrics', () => {\n    it('enrolls in biometrics by passing to AppleSimUtils', async () => {\n      await uut.setBiometricEnrollment('YES');\n      expect(applesimutils.setBiometricEnrollment).toHaveBeenCalledWith(udid, 'YES');\n    });\n\n    it('disenrolls in biometrics by passing to AppleSimUtils', async () => {\n      await uut.setBiometricEnrollment('NO');\n      expect(applesimutils.setBiometricEnrollment).toHaveBeenCalledWith(udid, 'NO');\n    });\n\n    it('matches a face by passing to AppleSimUtils', async () => {\n      await uut.matchFace();\n      expect(applesimutils.matchBiometric).toHaveBeenCalledWith(udid, 'Face');\n    });\n\n    it('unmatches a face by passing to AppleSimUtils', async () => {\n      await uut.unmatchFace();\n      expect(applesimutils.unmatchBiometric).toHaveBeenCalledWith(udid, 'Face');\n    });\n\n    it('matches a finger by passing to AppleSimUtils', async () => {\n      await uut.matchFinger();\n      expect(applesimutils.matchBiometric).toHaveBeenCalledWith(udid, 'Finger');\n    });\n\n    it('unmatches a finger by passing to AppleSimUtils', async () => {\n      await uut.unmatchFinger();\n      expect(applesimutils.unmatchBiometric).toHaveBeenCalledWith(udid, 'Finger');\n    });\n  });\n\n  describe('.resetAppState', () => {\n    it('should reset app state using the shim', async () => {\n      await uut.resetAppState(bundleId);\n      expect(appStateResetFallbackInstance.resetAppState).toHaveBeenCalledWith(udid, [bundleId]);\n    });\n\n    it('should use default bundleId when none provided', async () => {\n      uut._bundleId = 'default.bundle';\n      await uut.resetAppState();\n      expect(appStateResetFallbackInstance.resetAppState).toHaveBeenCalledWith(udid, ['default.bundle']);\n    });\n\n    it('should handle multiple bundleIds', async () => {\n      const bundleId1 = 'com.app1';\n      const bundleId2 = 'com.app2';\n\n      await uut.resetAppState(bundleId1, bundleId2);\n      expect(appStateResetFallbackInstance.resetAppState).toHaveBeenCalledWith(udid, [bundleId1, bundleId2]);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/__snapshots__/external.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`External runtime-device factory validation given module with no runtime-driver class should throw an error 1`] = `\"The custom driver at '../fake/path' does not export the RuntimeDriverClass property\"`;\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/android.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\nconst RuntimeDeviceFactory = require('./base');\n\nclass RuntimeDriverFactoryAndroid extends RuntimeDeviceFactory {\n  _createDriverDependencies(commonDeps) {\n    const serviceLocator = require('../../servicelocator/android');\n    const adb = serviceLocator.adb;\n    const aapt = serviceLocator.aapt;\n    const apkValidator = serviceLocator.apkValidator;\n    const fileTransfer = serviceLocator.fileTransfer;\n    const devicePathBuilder = serviceLocator.devicePathBuilder;\n\n    const AppInstallHelper = require('../../common/drivers/android/tools/AppInstallHelper');\n    const AppUninstallHelper = require('../../common/drivers/android/tools/AppUninstallHelper');\n    const MonitoredInstrumentation = require('../../common/drivers/android/tools/MonitoredInstrumentation');\n\n    return {\n      ...commonDeps,\n      adb,\n      aapt,\n      apkValidator,\n      fileTransfer,\n      devicePathBuilder,\n      appInstallHelper: new AppInstallHelper(adb, fileTransfer),\n      appUninstallHelper: new AppUninstallHelper(adb),\n      instrumentation: new MonitoredInstrumentation(adb),\n    };\n  }\n}\n\nclass AndroidEmulator extends RuntimeDriverFactoryAndroid {\n  _createDriver(deviceCookie, deps, { deviceConfig }) {\n    const props = {\n      adbName: deviceCookie.adbName,\n      avdName: deviceConfig.device.avdName,\n      forceAdbInstall: deviceConfig.forceAdbInstall,\n    };\n\n    const { AndroidEmulatorRuntimeDriver } = require('../drivers');\n    return new AndroidEmulatorRuntimeDriver(deps, props);\n  }\n}\n\nclass AndroidAttached extends RuntimeDriverFactoryAndroid {\n  _createDriver(deviceCookie, deps, configs) {\n    const { AttachedAndroidRuntimeDriver } = require('../drivers');\n    return new AttachedAndroidRuntimeDriver(deps, deviceCookie);\n  }\n}\n\nclass Genycloud extends RuntimeDriverFactoryAndroid {\n  _createDriver(deviceCookie, deps, configs) {\n    const { GenycloudRuntimeDriver } = require('../drivers');\n    return new GenycloudRuntimeDriver(deps, deviceCookie);\n  }\n}\n\nmodule.exports = {\n  AndroidEmulator,\n  AndroidAttached,\n  Genycloud,\n};\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/base.js",
    "content": "/* eslint @typescript-eslint/no-unused-vars: [\"error\", { \"args\": \"none\" }] */\nconst RuntimeDevice = require('../RuntimeDevice');\n\nclass RuntimeDeviceFactory {\n  createRuntimeDevice(deviceCookie, commonDeps, configs) {\n    const deps = this._createDriverDependencies(commonDeps);\n    const runtimeDriver = this._createDriver(deviceCookie, deps, configs);\n    return new RuntimeDevice({ ...commonDeps, ...configs }, runtimeDriver);\n  }\n\n  _createDriverDependencies(commonDeps) { }\n  _createDriver(deviceCookie, deps, configs) {}\n}\n\nmodule.exports = RuntimeDeviceFactory;\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/external.js",
    "content": "const RuntimeDeviceFactory = require('./base');\n\nclass External extends RuntimeDeviceFactory {\n  static validateModule(module, path) {\n    const DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');\n\n    if (!module.RuntimeDriverClass) {\n      throw new DetoxRuntimeError(`The custom driver at '${path}' does not export the RuntimeDriverClass property`);\n    }\n  }\n\n  constructor(module, path) {\n    super();\n    External.validateModule(module, path);\n\n    this._module = module;\n  }\n\n  _createDriverDependencies(commonDeps) {\n    return { ...commonDeps };\n  }\n\n  _createDriver(deviceCookie, deps, configs) {\n    return new this._module.RuntimeDriverClass({ ...deps, ...configs }, deviceCookie);\n  }\n}\n\nmodule.exports = {\n  External,\n};\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/external.test.js",
    "content": "describe('External runtime-device factory', () => {\n  describe('validation', () => {\n    const path = '../fake/path';\n\n    let factoryClass;\n    beforeEach(() => {\n      factoryClass = require('./external').External;\n    });\n\n    describe('given module with no runtime-driver class', () => {\n      it('should throw an error', () => {\n        const module = {\n          RuntimeDriverClass: undefined,\n        };\n        expect(() => factoryClass.validateModule(module, path)).toThrowErrorMatchingSnapshot();\n      });\n    });\n\n    describe('given a valid module', () => {\n      it('should not throw', () => {\n        const module = {\n          RuntimeDriverClass: class {},\n        };\n        factoryClass.validateModule(module, path);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/index.js",
    "content": "module.exports = {\n  ...require('./android'),\n  ...require('./ios'),\n  ...require('./external'),\n};\n"
  },
  {
    "path": "detox/src/devices/runtime/factories/ios.js",
    "content": "const RuntimeDeviceFactory = require('./base');\n\nclass RuntimeDriverFactoryIos extends RuntimeDeviceFactory {\n  _createDriverDependencies(commonDeps) {\n    const AppleSimUtils = require('../../../devices/common/drivers/ios/tools/AppleSimUtils');\n    const applesimutils = new AppleSimUtils();\n\n    return {\n      ...commonDeps,\n      applesimutils,\n    };\n  }\n}\n\nclass IosSimulator extends RuntimeDriverFactoryIos {\n  _createDriver(deviceCookie, deps, { deviceConfig }) {\n    const props = {\n      udid: deviceCookie.udid,\n      type: deviceConfig.device.type,\n      bootArgs: deviceConfig.bootArgs,\n      headless: deviceConfig.headless\n    };\n\n    const { IosSimulatorRuntimeDriver } = require('../drivers');\n    return new IosSimulatorRuntimeDriver(deps, props);\n  }\n}\n\nmodule.exports = {\n  IosSimulator,\n};\n"
  },
  {
    "path": "detox/src/devices/runtime/utils/LaunchArgsEditor.js",
    "content": "const _ = require('lodash');\n\nconst ScopedLaunchArgsEditor = require('./ScopedLaunchArgsEditor');\n\nclass LaunchArgsEditor {\n  constructor() {\n    this._local = new ScopedLaunchArgsEditor();\n    this._shared = new ScopedLaunchArgsEditor();\n  }\n\n  get shared() {\n    return this._shared;\n  }\n\n  modify(launchArgs) {\n    this._local.modify(launchArgs);\n    return this;\n  }\n\n  reset() {\n    this._local.reset();\n    return this;\n  }\n\n  get() {\n    return _.merge(this._shared.get(), this._local.get());\n  }\n}\n\nmodule.exports = LaunchArgsEditor;\n"
  },
  {
    "path": "detox/src/devices/runtime/utils/LaunchArgsEditor.test.js",
    "content": "// @ts-nocheck\ndescribe('Device launch-args editor', () => {\n  /** @type {typeof import('./LaunchArgsEditor')} */\n  let LaunchArgsEditor;\n  /** @type {LaunchArgsEditor} */\n  let launchArgsEditor;\n\n  beforeEach(() => {\n    LaunchArgsEditor = require('./LaunchArgsEditor');\n    launchArgsEditor = new LaunchArgsEditor();\n  });\n\n  it('should have empty value at first', () => {\n    expect(launchArgsEditor.get()).toEqual({});\n  });\n\n  it('should not throw if modify() is called with undefined', () => {\n    expect(launchArgsEditor.modify().get()).toEqual({});\n  });\n\n  it('should merge values', () => {\n    expect(launchArgsEditor\n      .modify({ a: 1 })\n      .modify({ b: 2 })\n      .get()).toEqual({ a: 1, b: 2 });\n  });\n\n  it('should merge both local and shared values', () => {\n    launchArgsEditor\n      .modify({ a: 1 })\n      .shared.modify({ b: 2 });\n\n    expect(launchArgsEditor.get()).toEqual({ a: 1, b: 2 });\n  });\n\n  it('should not return transient values if permanent values were requested', () =>\n    expect(launchArgsEditor\n      .modify({ a: 1 })\n      .shared.modify({ b: 2 })\n      .get()).toEqual({ b: 2 }));\n\n  it('should reset only transient values by default', () => {\n    launchArgsEditor.shared.modify({ b: 2 });\n\n    expect(launchArgsEditor\n      .modify({ a: 1 })\n      .reset()\n      .get()).toEqual({ b: 2 });\n  });\n\n  it('should reset both permanent and transient values if requested', () => {\n    launchArgsEditor.modify({ a: 1 }).shared.modify({ b: 2 });\n    launchArgsEditor.reset().shared.reset();\n    expect(launchArgsEditor.get()).toEqual({});\n  });\n\n  it('should return every time a copy of values', () => {\n    expect(launchArgsEditor.get()).not.toBe(launchArgsEditor.get());\n    expect(launchArgsEditor.shared.get()).not.toBe(launchArgsEditor.shared.get());\n  });\n\n  it('should return every time a deep copy of values', () => {\n    launchArgsEditor.modify({ a: { b: 'c' } });\n    launchArgsEditor.get().a.b = 'd';\n    expect(launchArgsEditor.get()).toEqual({ a: { b: 'c' } });\n\n    launchArgsEditor.shared.modify({ a: { b: 'c' } });\n    launchArgsEditor.shared.get().a.b = 'd';\n    expect(launchArgsEditor.shared.get()).toEqual({ a: { b: 'c' } });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/runtime/utils/ScopedLaunchArgsEditor.js",
    "content": "const Storage = require('./Storage');\n\nclass ScopedLaunchArgsEditor {\n  constructor() {\n    this._storage = new Storage();\n  }\n\n  get() {\n    return this._storage.get();\n  }\n\n  reset() {\n    this._storage.reset();\n    return this;\n  }\n\n  modify(launchArgs) {\n    this._storage.assign(launchArgs);\n    return this;\n  }\n}\n\nmodule.exports = ScopedLaunchArgsEditor;\n"
  },
  {
    "path": "detox/src/devices/runtime/utils/Storage.js",
    "content": "const _ = require('lodash');\n\nclass Storage {\n  constructor() {\n    this._map = {};\n  }\n\n  keys() {\n    return Object.keys(this._map);\n  }\n\n  get() {\n    return _.cloneDeep(this._map);\n  }\n\n  assign(map) {\n    if (_.isEmpty(map)) {\n      return;\n    }\n\n    for (const key of Object.keys(map)) {\n      this.set(key, map[key]);\n    }\n  }\n\n  set(key, value) {\n    if (value != null) {\n      this._map[key] = value;\n    } else {\n      this.remove(key);\n    }\n  }\n\n  reset() {\n    for (const key of this.keys()) {\n      this.remove(key);\n    }\n  }\n\n  remove(key) {\n    delete this._map[key];\n  }\n}\n\nmodule.exports = Storage;\n"
  },
  {
    "path": "detox/src/devices/servicelocator/android/emulatorServiceLocator.js",
    "content": "const { EmulatorExec } = require('../../common/drivers/android/emulator/exec/EmulatorExec');\n\nclass EmulatorServiceLocator {\n  constructor() {\n    this.exec = new EmulatorExec();\n  }\n}\n\nmodule.exports = new EmulatorServiceLocator();\n"
  },
  {
    "path": "detox/src/devices/servicelocator/android/genycloudServiceLocator.js",
    "content": "class GenycloudServiceLocator {\n  constructor() {\n    this._exec = null;\n  }\n\n  // Note: important to keep lazy because of implicit validations that are sensitive (inside environment, in particular).\n  get exec() {\n    if (!this._exec) {\n      const Exec = require('../../allocation/drivers/android/genycloud/exec/GenyCloudExec');\n      const environment = require('../../../utils/environment');\n      this._exec = new Exec(environment.getGmsaasPath());\n    }\n    return this._exec;\n  }\n}\n\nmodule.exports = new GenycloudServiceLocator();\n"
  },
  {
    "path": "detox/src/devices/servicelocator/android/index.js",
    "content": "const AndroidDevicePathBuilder = require('../../../artifacts/utils/AndroidDevicePathBuilder');\nconst AAPT = require('../../common/drivers/android/exec/AAPT');\nconst ADB = require('../../common/drivers/android/exec/ADB');\nconst ApkValidator = require('../../common/drivers/android/tools/ApkValidator');\nconst { TempFileTransfer } = require('../../common/drivers/android/tools/TempFileTransfer');\n\nconst AndroidServiceLocator = {\n  get emulator() {\n    return require('./emulatorServiceLocator');\n  },\n\n  get genycloud() {\n    return require('./genycloudServiceLocator');\n  },\n};\n\nAndroidServiceLocator.adb = new ADB();\nAndroidServiceLocator.aapt = new AAPT();\nAndroidServiceLocator.apkValidator = new ApkValidator(AndroidServiceLocator.aapt);\nAndroidServiceLocator.fileTransfer = new TempFileTransfer(AndroidServiceLocator.adb);\nAndroidServiceLocator.devicePathBuilder = new AndroidDevicePathBuilder();\n\nmodule.exports = AndroidServiceLocator;\n"
  },
  {
    "path": "detox/src/devices/validation/EnvironmentValidatorBase.js",
    "content": "class EnvironmentValidatorBase {\n  /* istanbul ignore next */\n  validate() {}\n}\n\nmodule.exports = EnvironmentValidatorBase;\n"
  },
  {
    "path": "detox/src/devices/validation/android/GenycloudEnvValidator.js",
    "content": "// @ts-nocheck\nconst semver = require('semver');\n\nconst { DetoxRuntimeError } = require('../../../errors');\nconst environment = require('../../../utils/environment');\nconst EnvironmentValidatorBase = require('../EnvironmentValidatorBase');\n\nconst MIN_GMSAAS_VERSION = '1.6.0';\nconst MIN_GMSAAS_VERSION_WITH_DOCTOR = '1.11.0';\n\nclass GenycloudEnvValidator extends EnvironmentValidatorBase {\n  /**\n   * @param authService { GenyAuthService }\n   * @param exec { GenyCloudExec }\n   */\n  constructor({ exec }) {\n    super();\n    this._exec = exec;\n  }\n\n  async validate() {\n    const { version } = await this._exec.getVersion();\n\n    await this._validateGmsaasVersion(version);\n    await this._validateGmsaasDoctorCheck(version);\n  }\n\n  async _validateGmsaasVersion(version) {\n    if (semver.lt(version, MIN_GMSAAS_VERSION)) {\n      throw new DetoxRuntimeError({\n        message: `Your Genymotion-Cloud executable (found in ${environment.getGmsaasPath()}) is too old! (version ${version})`,\n        hint: `Detox requires version 1.6.0, or newer. To use 'android.genycloud' type devices, you must upgrade it, first.`,\n      });\n    }\n  }\n\n  async _validateGmsaasDoctorCheck(version) {\n    if (semver.lt(version, MIN_GMSAAS_VERSION_WITH_DOCTOR)) {\n      return;\n    }\n\n    try {\n      await this._exec.doctor();\n    } catch (e) {\n      throw new DetoxRuntimeError({\n        message: e.message,\n      });\n    }\n  }\n}\n\nmodule.exports = GenycloudEnvValidator;\n"
  },
  {
    "path": "detox/src/devices/validation/android/GenycloudEnvValidator.test.js",
    "content": "// @ts-nocheck\ndescribe('Genymotion-cloud test environment validator', () => {\n\n  const MOCK_GMSAAS_PATH = '/path/to/gmsaas';\n\n  let exec;\n  let uut;\n  beforeEach(() => {\n    jest.mock('../../../utils/environment');\n\n    const environment = require('../../../utils/environment');\n    environment.getGmsaasPath.mockReturnValue(MOCK_GMSAAS_PATH);\n\n    const GenyExec = jest.createMockFromModule('../../allocation/drivers/android/genycloud/exec/GenyCloudExec');\n    exec = new GenyExec();\n\n    const GenycloudEnvValidator = require('./GenycloudEnvValidator');\n    uut = new GenycloudEnvValidator({ exec });\n  });\n\n  const givenGmsaasVersion = (version) => exec.getVersion.mockResolvedValue({ version });\n  const givenMinimalGmsaasVersion = () => givenGmsaasVersion('1.6.0');\n  const givenFirstGmsaasVersionWithDoctor = () => givenGmsaasVersion('1.11.0');\n  const givenLastGmsaasVersionWithoutDoctor = () => givenGmsaasVersion('1.10.0');\n  const givenValidDoctorCheck = () => exec.doctor.mockResolvedValue({ exit_code: 0 });\n  const givenFailedDoctorChecks = () => exec.doctor.mockRejectedValue(new Error(\n    'Error: gmsaas is not configured properly' +\n      '\\nOne or several issues have been detected:' +\n      '\\n- Android SDK not configured.'));\n\n  describe('version validations', () => {\n    beforeEach(() => {\n      givenValidDoctorCheck();\n    });\n\n    it('should throw an error if gmsaas exec is too old (minor version < 6)', async () => {\n      givenGmsaasVersion('1.5.9');\n\n      try {\n        await uut.validate();\n      } catch (e) {\n        expect(e.constructor.name).toEqual('DetoxRuntimeError');\n        expect(e).toMatchSnapshot();\n        return;\n      }\n      throw new Error('Expected an error');\n    });\n\n    it('should accept the gmsaas exec if version is sufficiently new', async () => {\n      givenMinimalGmsaasVersion();\n      await uut.validate();\n    });\n\n    it('should accept the gmsaas exec if version is more than sufficiently new', async () => {\n      givenGmsaasVersion('1.7.2');\n      await uut.validate();\n    });\n\n    it('should throw an error if gmsaas exec is too old (major version < 1)', async () => {\n      givenGmsaasVersion('0.6.0');\n\n      await expect(uut.validate())\n        .rejects\n        .toThrow(`Your Genymotion-Cloud executable (found in ${MOCK_GMSAAS_PATH}) is too old! (version 0.6.0)`);\n    });\n  });\n\n  describe('health validations', () => {\n    it('should throw if gmsaas doctor detects an error', async () => {\n      givenFirstGmsaasVersionWithDoctor();\n      givenFailedDoctorChecks();\n\n      await expect(uut.validate()).rejects.toMatchSnapshot();\n    });\n\n    it('should pass if gmsaas doctor checks pass', async () => {\n      givenFirstGmsaasVersionWithDoctor();\n      givenValidDoctorCheck();\n\n      await uut.validate();\n    });\n\n    it('should not run doctor checks if gmsaas version is too old', async () => {\n      givenLastGmsaasVersionWithoutDoctor();\n      givenFailedDoctorChecks();\n\n      await uut.validate();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/devices/validation/android/__snapshots__/GenycloudEnvValidator.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Genymotion-cloud test environment validator health validations should throw if gmsaas doctor detects an error 1`] = `\n[DetoxRuntimeError: Error: gmsaas is not configured properly\nOne or several issues have been detected:\n- Android SDK not configured.]\n`;\n\nexports[`Genymotion-cloud test environment validator version validations should throw an error if gmsaas exec is too old (minor version < 6) 1`] = `\n[DetoxRuntimeError: Your Genymotion-Cloud executable (found in /path/to/gmsaas) is too old! (version 1.5.9)\n\nHINT: Detox requires version 1.6.0, or newer. To use 'android.genycloud' type devices, you must upgrade it, first.]\n`;\n"
  },
  {
    "path": "detox/src/devices/validation/factories/index.js",
    "content": "class EnvValidatorFactory {\n  createValidator() {}\n}\n\nclass Genycloud extends EnvValidatorFactory {\n  createValidator() {\n    const serviceLocator = require('../../servicelocator/android');\n    const exec = serviceLocator.genycloud.exec;\n\n    const GenycloudEnvValidator = require('../android/GenycloudEnvValidator');\n    return new GenycloudEnvValidator({ exec });\n  }\n}\n\nclass IosSimulator extends EnvValidatorFactory {\n  createValidator() {\n    const IosSimulatorEnvValidator = require('../ios/IosSimulatorEnvValidator');\n    return new IosSimulatorEnvValidator();\n  }\n}\n\nclass Noop extends EnvValidatorFactory {\n  createValidator() {\n    const EnvironmentValidatorBase = require('../EnvironmentValidatorBase');\n    return new EnvironmentValidatorBase();\n  }\n}\n\nclass External extends EnvValidatorFactory {\n  constructor(module) {\n    super();\n    this._module = module;\n  }\n\n  createValidator() {\n    if (this._module.EnvironmentValidatorClass) {\n      return new this._module.EnvironmentValidatorClass();\n    }\n    return new Noop().createValidator();\n  }\n}\n\nmodule.exports = {\n  Genycloud,\n  IosSimulator,\n  Noop,\n  External,\n};\n"
  },
  {
    "path": "detox/src/devices/validation/ios/IosSimulatorEnvValidator.js",
    "content": "const fs = require('fs');\n\nconst DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');\nconst environment = require('../../../utils/environment');\nconst EnvironmentValidatorBase = require('../EnvironmentValidatorBase');\n\nclass IosSimulatorEnvValidator extends EnvironmentValidatorBase {\n  async validate() {\n    const detoxFrameworkPath = await environment.getFrameworkPath();\n\n    if (!this._frameworkPathExists(detoxFrameworkPath)) {\n      throw new DetoxRuntimeError(`${detoxFrameworkPath} could not be found, this means either you changed a version of Xcode or Detox postinstall script was unsuccessful.\n        To attempt a fix try running 'detox clean-framework-cache && detox build-framework-cache'`);\n    }\n  }\n\n  _frameworkPathExists(detoxFrameworkPath) {\n    return fs.existsSync(detoxFrameworkPath);\n  }\n}\n\nmodule.exports = IosSimulatorEnvValidator;\n"
  },
  {
    "path": "detox/src/devices/validation/ios/IosSimulatorEnvValidator.test.js",
    "content": "describe('iOS simulator test environment validator', () => {\n  let environment;\n  let uut;\n\n  const givenFrameworkPathExists = () => environment.getFrameworkPath.mockResolvedValue(__dirname);\n  const givenFrameworkPathNotExists = () => environment.getFrameworkPath.mockResolvedValue('/path/to/framework');\n\n  beforeEach(() => {\n    jest.mock('../../../utils/environment');\n    environment = jest.requireMock('../../../utils/environment');\n\n    const IosSimulatorEnvValidator = require('./IosSimulatorEnvValidator');\n    uut = new IosSimulatorEnvValidator();\n  });\n\n  describe('given detox framework path doesn\\'t exist', () => {\n    it('should throw an error, with instruction to remedy', async () => {\n      givenFrameworkPathNotExists();\n      await expect(() => uut.validate()).rejects.toThrow('/path/to/framework could not be found');\n    });\n  });\n\n  describe('given detox framework path exists', () => {\n    it('should not throw an error', async () => {\n      givenFrameworkPathExists();\n      await uut.validate();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/environmentFactory.js",
    "content": "// @ts-nocheck\nconst artifactsManagerFactories = require('./artifacts/factories');\nconst deviceAllocationFactories = require('./devices/allocation/factories');\nconst runtimeDeviceFactories = require('./devices/runtime/factories');\nconst envValidationFactories = require('./devices/validation/factories');\nconst matchersFactories = require('./matchers/factories');\nconst resolveModuleFromPath = require('./utils/resolveModuleFromPath');\n\nfunction validateConfig(deviceConfig) {\n  const classes = _getFactoryClasses(deviceConfig);\n  if (!classes) {\n    const modulePath = deviceConfig.type;\n    const module = resolveModuleFromPath(modulePath);\n\n    deviceAllocationFactories.External.validateModule(module, modulePath);\n    matchersFactories.External.validateModule(module, modulePath);\n    runtimeDeviceFactories.External.validateModule(module, modulePath);\n  }\n}\n\n/**\n * @param deviceConfig\n * @returns {{ deviceAllocatorFactory: DeviceAllocatorFactory }}\n */\nfunction createFactories(deviceConfig) {\n  const classes = _getFactoryClasses(deviceConfig);\n  if (classes) {\n    return {\n      envValidatorFactory: new classes.envValidatorFactoryClass(),\n      artifactsManagerFactory: new classes.artifactsManagerFactoryClass(),\n      deviceAllocatorFactory: new classes.deviceAllocatorFactoryClass(),\n      matchersFactory: new classes.matchersFactoryClass(),\n      runtimeDeviceFactory: new classes.runtimeDeviceFactoryClass(),\n    };\n  }\n  return _getExternalModuleFactories(deviceConfig);\n}\n\nfunction _getFactoryClasses(deviceConfig) {\n  let envValidatorFactoryClass;\n  let artifactsManagerFactoryClass;\n  let deviceAllocatorFactoryClass;\n  let matchersFactoryClass;\n  let runtimeDeviceFactoryClass;\n\n  switch (deviceConfig.type) {\n    case 'android.emulator':\n      envValidatorFactoryClass = envValidationFactories.Noop;\n      deviceAllocatorFactoryClass = deviceAllocationFactories.AndroidEmulator;\n      artifactsManagerFactoryClass = artifactsManagerFactories.Android;\n      matchersFactoryClass = matchersFactories.Android;\n      runtimeDeviceFactoryClass = runtimeDeviceFactories.AndroidEmulator;\n      break;\n\n    case 'android.attached':\n      envValidatorFactoryClass = envValidationFactories.Noop;\n      deviceAllocatorFactoryClass = deviceAllocationFactories.AndroidAttached;\n      artifactsManagerFactoryClass = artifactsManagerFactories.Android;\n      matchersFactoryClass = matchersFactories.Android;\n      runtimeDeviceFactoryClass = runtimeDeviceFactories.AndroidAttached;\n      break;\n\n    case 'android.genycloud':\n      envValidatorFactoryClass = envValidationFactories.Genycloud;\n      deviceAllocatorFactoryClass = deviceAllocationFactories.Genycloud;\n      artifactsManagerFactoryClass = artifactsManagerFactories.Android;\n      matchersFactoryClass = matchersFactories.Android;\n      runtimeDeviceFactoryClass = runtimeDeviceFactories.Genycloud;\n      break;\n\n    case 'ios.simulator':\n      envValidatorFactoryClass = envValidationFactories.IosSimulator;\n      deviceAllocatorFactoryClass = deviceAllocationFactories.IosSimulator;\n      artifactsManagerFactoryClass = artifactsManagerFactories.IosSimulator;\n      matchersFactoryClass = matchersFactories.Ios;\n      runtimeDeviceFactoryClass = runtimeDeviceFactories.IosSimulator;\n      break;\n\n    default: {\n      return null;\n    }\n  }\n\n  return {\n    envValidatorFactoryClass,\n    artifactsManagerFactoryClass,\n    deviceAllocatorFactoryClass,\n    matchersFactoryClass,\n    runtimeDeviceFactoryClass,\n  };\n}\n\nfunction _getExternalModuleFactories(deviceConfig) {\n  const modulePath = deviceConfig.type;\n  const module = resolveModuleFromPath(modulePath);\n\n  return {\n    envValidatorFactory: new envValidationFactories.External(module),\n    deviceAllocatorFactory: new deviceAllocationFactories.External(module),\n    artifactsManagerFactory: new artifactsManagerFactories.External(module),\n    matchersFactory: new matchersFactories.External(module, modulePath),\n    runtimeDeviceFactory: new runtimeDeviceFactories.External(module, modulePath),\n  };\n}\n\nmodule.exports = {\n  validateConfig,\n  createFactories,\n};\n"
  },
  {
    "path": "detox/src/environmentFactory.test.js",
    "content": "describe('Main environment factory', () => {\n  const mockFakeModule = {\n    fake: 'module',\n  };\n\n  let deviceAllocationFactories;\n  let matchersFactories;\n  let runtimeDeviceFactories;\n  let environmentFactory;\n  beforeEach(() => {\n    jest.mock('./devices/allocation/factories');\n    deviceAllocationFactories = require('./devices/allocation/factories');\n\n    jest.mock('./matchers/factories');\n    matchersFactories = require('./matchers/factories');\n\n    jest.mock('./devices/runtime/factories');\n    runtimeDeviceFactories = require('./devices/runtime/factories');\n\n    jest.mock('./utils/resolveModuleFromPath', () => () => mockFakeModule);\n\n    environmentFactory = require('./environmentFactory');\n  });\n\n  describe('validation', () => {\n    [\n      'ios.simulator',\n      'android.attached',\n      'android.emulator',\n      'android.genycloud',\n    ].forEach((type) => {\n      it(`should confirm known type ${type}`, () => {\n        const deviceConfig = {\n          type,\n        };\n        environmentFactory.validateConfig(deviceConfig);\n      });\n    });\n\n    it('should try to validate assuming the type is a node.js dependency', () => {\n      const fakeType = 'fake.type';\n      const deviceConfig = {\n        type: fakeType,\n      };\n      environmentFactory.validateConfig(deviceConfig);\n      expect(deviceAllocationFactories.External.validateModule).toHaveBeenCalledWith(mockFakeModule, 'fake.type');\n      expect(matchersFactories.External.validateModule).toHaveBeenCalledWith(mockFakeModule, 'fake.type');\n      expect(runtimeDeviceFactories.External.validateModule).toHaveBeenCalledWith(mockFakeModule, 'fake.type');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/errors/DetoxConfigError.js",
    "content": "const DetoxRuntimeError = require('./DetoxRuntimeError');\n\nclass DetoxConfigError extends DetoxRuntimeError {\n  constructor(opts) {\n    super(opts);\n    this.name = 'DetoxConfigError';\n  }\n}\n\nmodule.exports = DetoxConfigError;\n"
  },
  {
    "path": "detox/src/errors/DetoxConfigErrorComposer.js",
    "content": "const _ = require('lodash');\n\nconst deviceAppTypes = require('../configuration/utils/deviceAppTypes');\n\nconst DetoxConfigError = require('./DetoxConfigError');\nconst DetoxInternalError = require('./DetoxInternalError');\nconst J = s => JSON.stringify(s);\n\nclass DetoxConfigErrorComposer {\n  constructor() {\n    this.setConfigurationName();\n    this.setDetoxConfigPath();\n    this.setDetoxConfig();\n    this.setExtends();\n  }\n\n  clone() {\n    return new DetoxConfigErrorComposer()\n      .setConfigurationName(this.configurationName)\n      .setDetoxConfigPath(this.filepath)\n      .setDetoxConfig(this.contents)\n      .setExtends(this._extends);\n  }\n\n  _atPath() {\n    return this.filepath ? ` at path:\\n${this.filepath}` : '.';\n  }\n  _getSelectedConfiguration() {\n    return _.get(this.contents, ['configurations', this.configurationName]);\n  }\n\n  _focusOnConfiguration(postProcess = _.identity) {\n    const configuration = _.get(this.contents, ['configurations', this.configurationName]);\n    if (configuration === undefined) {\n      return;\n    }\n\n    return {\n      configurations: {\n        [this.configurationName]: postProcess(configuration)\n      },\n    };\n  }\n\n  _getDeviceConfig(deviceAlias) {\n    let config = undefined;\n\n    this._focusOnDeviceConfig(deviceAlias, (value) => {\n      config = value;\n      return value;\n    });\n\n    return config;\n  }\n\n  _focusOnDeviceConfig(deviceAlias, postProcess = _.identity) {\n    const { device } = this._getSelectedConfiguration();\n    if (!deviceAlias) {\n      // istanbul ignore next\n      if (!device) {\n        return this._focusOnConfiguration(postProcess);\n      } else {\n        return this._focusOnConfiguration(c => {\n          postProcess(c.device);\n          return _.pick(c, 'device');\n        });\n      }\n    }\n\n    return {\n      devices: {\n        [device]: postProcess(this.contents.devices[device]),\n      },\n    };\n  }\n\n  _focusOnAppConfig(appPath, postProcess = _.identity) {\n    const value = _.get(this.contents, appPath);\n    return _.set({}, appPath, postProcess(value));\n  }\n\n  _resolveSelectedDeviceConfig(alias) {\n    if (alias) {\n      return this.contents.devices[alias];\n    } else {\n      return this._getSelectedConfiguration().device;\n    }\n  }\n\n  _ensureProperty(...names) {\n    return obj => {\n      for (const name of names) {\n        return _.set(obj, name, _.get(obj, name));\n      }\n    };\n  }\n\n  // region setters\n  setConfigurationName(configurationName) {\n    this.configurationName = configurationName || '';\n    return this;\n  }\n\n  setDetoxConfigPath(filepath) {\n    this.filepath = filepath || '';\n    return this;\n  }\n\n  setDetoxConfig(contents) {\n    this.contents = contents || null;\n    return this;\n  }\n\n  setExtends(value) {\n    this._extends = !!value;\n    return this;\n  }\n  // endregion\n\n  // region CLI options validation\n\n  mutuallyExclusiveCliOptions(option1, option2) {\n    return new DetoxConfigError({\n      message: `The ${J(option1)} and ${J(option2)} options cannot be used together`,\n      hint: `These options are mutually exclusive. Please use either ${option1} or ${option2}, but not both.`\n    });\n  }\n\n  // endregion\n\n  // region configuration/index\n\n  noConfigurationSpecified() {\n    return new DetoxConfigError({\n      message: 'Cannot run Detox without a configuration file.',\n      hint: _.endsWith(this.filepath, 'package.json')\n        ? `Create an external .detoxrc.json configuration, or add \"detox\" configuration section to your package.json at:\\n${this.filepath}`\n        : 'Make sure to create external .detoxrc.json configuration in the working directory before you run Detox.'\n    });\n  }\n\n  noConfigurationAtGivenPath(givenPath) {\n    const message = this._extends\n      ? `Failed to find the base Detox config specified in:\\n{\\n  \"extends\": ${J(givenPath)}\\n}`\n      : `Failed to find Detox config at ${J(givenPath)}`;\n\n    const hint = this._extends\n      ? `Check your Detox config${this._atPath()}`\n      : 'Make sure the specified path is correct.';\n\n    return new DetoxConfigError({ message, hint });\n  }\n\n  failedToReadConfiguration(unknownError) {\n    return new DetoxConfigError({\n      message: 'An error occurred while trying to load Detox config from:\\n' + this.filepath,\n      debugInfo: unknownError,\n    });\n  }\n\n  noConfigurationsInside() {\n    return new DetoxConfigError({\n      message: `There are no configurations in the given Detox config${this._atPath()}`,\n      hint: `Examine the config:`,\n      debugInfo: this.contents ? {\n        configurations: undefined,\n        ...this.contents,\n      } : {},\n      inspectOptions: { depth: 1 },\n    });\n  }\n\n  cantChooseConfiguration() {\n    const configurations = this.contents.configurations;\n\n    return new DetoxConfigError({\n      message: `Cannot determine which configuration to use from Detox config${this._atPath()}`,\n      hint: 'Use --configuration to choose one of the following:\\n' + hintList(configurations),\n    });\n  }\n\n  noConfigurationWithGivenName() {\n    const configurations = this.contents.configurations;\n\n    return new DetoxConfigError({\n      message: `Failed to find a configuration named ${J(this.configurationName)} in Detox config${this._atPath()}`,\n      hint: 'Below are the configurations Detox was able to find:\\n' + hintList(configurations),\n    });\n  }\n\n  configurationShouldNotBeEmpty() {\n    const name = this.configurationName;\n    const configurations = this.contents.configurations;\n\n    return new DetoxConfigError({\n      message: `Cannot use an empty configuration ${J(name)}.`,\n      hint: `A valid configuration should have \"device\" and \"app\" properties defined, e.g.:\\n\n{\n  \"apps\": {\n*-->\"myApp.ios\": {\n|     \"type\": \"ios.app\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"devices\": {\n|*->\"simulator\": {\n||    \"type\": \"ios.simulator\",\n||    \"device\": { type: \"iPhone 12\" }\n||  },\n||},\n||\"configurations\": {\n||  ${J(name)}: {\n|*--- \"device\": \"simulator\",\n*---- \"app\": \"myApp.ios\"\n    }\n  }\n}\nExamine your Detox config${this._atPath()}`,\n      debugInfo: {\n        configurations: {\n          [name]: configurations[name],\n          ...configurations,\n        }\n      },\n      inspectOptions: { depth: 1 }\n    });\n  }\n\n  configurationShouldNotUseLegacyFormat() {\n    const name = this.configurationName;\n    const localConfig = this._getSelectedConfiguration();\n    /* istanbul ignore next */\n    const deviceType = localConfig.type || '';\n    const isAndroid = deviceType.startsWith('android.');\n    const isIOS = deviceType.startsWith('ios.');\n    const appName = 'myApp' + (isIOS ? '.ios' : '') + (isAndroid ? '.android' : '');\n    const deviceName = isIOS ? 'simulator' : isAndroid ? 'emulator' : 'myDevice';\n    const appType = isIOS ? 'ios.app' : isAndroid ? 'android.apk' : '<optional property>';\n    const binaryPath = isIOS || isAndroid ? localConfig.binaryPath : (localConfig.binaryPath || '<optional property>');\n    const deviceQuery = isIOS || isAndroid ? localConfig.device : (localConfig.device || '<optional property>');\n\n    return new DetoxConfigError({\n      message: `The ${J(name)} configuration utilizes a deprecated all-in-one schema, that is not supported ` +\n        `by the current version of Detox.`,\n      hint: `Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases ` +\n        `pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\\n\n{\n  \"apps\": {\n*-->${J(appName)}: {\n|     \"type\": ${J(appType)},\n|     \"binaryPath\": ${J(binaryPath)},\n|   },\n| },\n| \"devices\": {\n|*->${J(deviceName)}: {\n||    \"type\": ${J(deviceType)},\n||    \"device\": ${J(deviceQuery)}\n||  },\n||},\n||\"configurations\": {\n||  ${J(name)}: {\n||    /* REMOVE (!) \"type\": ${J(deviceType)} */\n|*--- \"device\": ${J(deviceName)},\n*---- \"app\": ${J(appName)},\n      ...\n    }\n  }\n}\nExamine your Detox config${this._atPath()}`,\n      debugInfo: {\n        apps: this.contents.apps\n          ? _.mapValues(this.contents.apps, _.constant({}))\n          : undefined,\n        devices: this.contents.devices\n          ? _.mapValues(this.contents.devices, _.constant({}))\n          : undefined,\n\n        ...this._focusOnConfiguration(),\n      },\n      inspectOptions: { depth: 2 }\n    });\n  }\n\n  // endregion\n\n  // region composeDeviceConfig\n\n  thereAreNoDeviceConfigs(deviceAlias) {\n    return new DetoxConfigError({\n      message: `Cannot use device alias ${J(deviceAlias)} since there is no \"devices\" config in Detox config${this._atPath()}`,\n      hint: `\\\nYou should create a dictionary of device configurations in Detox config, e.g.:\n{\n  \"devices\": {\n*-> ${J(deviceAlias)}: {\n|     \"type\": \"ios.simulator\", // or \"android.emulator\", or etc...\n|     \"device\": { \"type\": \"iPhone 12\" }, // or e.g.: { \"avdName\": \"Pixel_API_29\" }\n|   }\n| },\n| \"configurations\": {\n|   ${J(this.configurationName)}: {\n*---- \"device\": ${J(deviceAlias)},\n      ...\n    }\n  }\n}\\n`,\n    });\n  }\n\n  cantResolveDeviceAlias(alias) {\n    return new DetoxConfigError({\n      message: `Failed to find a device config ${J(alias)} in the \"devices\" dictionary of Detox config${this._atPath()}`,\n      hint: 'Below are the device configurations Detox was able to find:\\n'\n        + hintList(this.contents.devices) + '\\n\\n'\n        + `Check your configuration ${J(this.configurationName)}:`,\n      debugInfo: this._getSelectedConfiguration(),\n      inspectOptions: { depth: 0 },\n    });\n  }\n\n  deviceConfigIsUndefined() {\n    return new DetoxConfigError({\n      message: `Missing \"device\" property in the selected configuration ${J(this.configurationName)}:`,\n      hint: `It should be an alias to the device config, or the device config itself, e.g.:\n{\n  ...\n  \"devices\": {\n*-> \"myDevice\": {\n|     \"type\": \"ios.simulator\", // or \"android.emulator\", or etc...\n|     \"device\": { \"type\": \"iPhone 12\" }, // or e.g.: { \"avdName\": \"Pixel_API_29\" }\n|   }\n| },\n| \"configurations\": {\n|   ${J(this.configurationName)}: {\n*---- \"device\": \"myDevice\", // or { type: 'ios.simulator', ... }\n      ...\n    },\n    ...\n  }\n}\n\nExamine your Detox config${this._atPath()}`,\n    });\n  }\n\n  missingDeviceType(deviceAlias) {\n    return new DetoxConfigError({\n      message: `Missing \"type\" inside the device configuration.`,\n      hint: `Usually, \"type\" property should hold the device type to test on (e.g. \"ios.simulator\" or \"android.emulator\").\\n` +\n        `Check that in your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnDeviceConfig(deviceAlias, this._ensureProperty('type')),\n      inspectOptions: { depth: 3 },\n    });\n  }\n\n  invalidDeviceType(deviceAlias, deviceConfig, innerError) {\n    return new DetoxConfigError({\n      message: `Invalid device type ${J(deviceConfig.type)} inside your configuration.`,\n      hint: `Did you mean to use one of these?\n${hintList(deviceAppTypes)}\n\nP.S. If you intended to use a third-party driver, please resolve this error:\n\n${innerError.message}\n\nPlease check your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnDeviceConfig(deviceAlias, this._ensureProperty('type')),\n      inspectOptions: { depth: 3 },\n    });\n  }\n\n  _invalidPropertyType(propertyName, expectedType, deviceAlias) {\n    return new DetoxConfigError({\n      message: `Invalid type of ${J(propertyName)} inside the device configuration.\\n`\n        + `Expected ${expectedType}.`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnDeviceConfig(deviceAlias),\n      inspectOptions: { depth: 3 },\n    });\n  }\n\n  _unsupportedPropertyByDeviceType(propertyName, supportedDeviceTypes, deviceAlias) {\n    const { type } = this._getDeviceConfig(deviceAlias);\n\n    return new DetoxConfigError({\n      message: `The current device type ${J(type)} does not support ${J(propertyName)} property.`,\n      hint: `You can use this property only with the following device types:\\n` +\n        hintList(supportedDeviceTypes) + '\\n\\n' +\n        `Please fix your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnDeviceConfig(deviceAlias),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  malformedDeviceProperty(deviceAlias, propertyName) {\n    switch (propertyName) {\n      case 'bootArgs':\n        return this._invalidPropertyType('bootArgs', 'a string', deviceAlias);\n      case 'utilBinaryPaths':\n        return this._invalidPropertyType('utilBinaryPaths', 'an array of strings', deviceAlias);\n      case 'forceAdbInstall':\n        return this._invalidPropertyType('forceAdbInstall', 'a boolean value', deviceAlias);\n      case 'gpuMode':\n        return this._invalidPropertyType('gpuMode', \"'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest' | 'off'\", deviceAlias);\n      case 'headless':\n        return this._invalidPropertyType('headless', 'a boolean value', deviceAlias);\n      case 'readonly':\n        return this._invalidPropertyType('readonly', 'a boolean value', deviceAlias);\n      case 'systemUI':\n        return this._invalidPropertyType('systemUI', \"'minimal', 'genymotion' or an object\", deviceAlias);\n      default:\n        throw new DetoxInternalError(`Composing .malformedDeviceProperty(${propertyName}) is not implemented`);\n    }\n  }\n\n  unsupportedDeviceProperty(deviceAlias, propertyName) {\n    switch (propertyName) {\n      case 'bootArgs':\n        return this._unsupportedPropertyByDeviceType('bootArgs', ['ios.simulator', 'android.emulator'], deviceAlias);\n      case 'forceAdbInstall':\n        return this._unsupportedPropertyByDeviceType('forceAdbInstall', ['android.attached', 'android.emulator', 'android.genycloud'], deviceAlias);\n      case 'gpuMode':\n        return this._unsupportedPropertyByDeviceType('gpuMode', ['android.emulator'], deviceAlias);\n      case 'headless':\n        return this._unsupportedPropertyByDeviceType('headless', ['ios.simulator', 'android.emulator'], deviceAlias);\n      case 'readonly':\n        return this._unsupportedPropertyByDeviceType('readonly', ['android.emulator'], deviceAlias);\n      case 'utilBinaryPaths':\n        return this._unsupportedPropertyByDeviceType('utilBinaryPaths', ['android.attached', 'android.emulator', 'android.genycloud'], deviceAlias);\n      case 'systemUI':\n        return this._unsupportedPropertyByDeviceType('systemUI', ['android.emulator', 'android.genycloud', 'android.attached'], deviceAlias);\n      default:\n        throw new DetoxInternalError(`Composing .unsupportedDeviceProperty(${propertyName}) is not implemented`);\n    }\n  }\n\n  missingDeviceMatcherProperties(deviceAlias, expectedProperties) {\n    const { type } = this._resolveSelectedDeviceConfig(deviceAlias);\n    return new DetoxConfigError({\n      message: `Invalid or empty \"device\" matcher inside the device config.`,\n      hint: `It should have the device query to run on, e.g.:\\n\n{\n  \"type\": ${J(type)},\n  \"device\": ${expectedProperties.map(p => `{ ${J(p)}: ... }`).join('\\n      // or ')}\n}\nCheck that in your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnDeviceConfig(deviceAlias),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  // endregion\n\n  // region composeAppsConfig\n\n  thereAreNoAppConfigs(appAlias) {\n    return new DetoxConfigError({\n      message: `Cannot use app alias ${J(appAlias)} since there is no \"apps\" config in Detox config${this._atPath()}`,\n      hint: `\\\nYou should create a dictionary of app configurations in Detox config, e.g.:\n{\n  \"apps\": {\n*-> ${J(appAlias)}: {\n|     \"type\": \"ios.app\", // or \"android.apk\", or etc...\n|     \"binaryPath\": \"path/to/your/app\", // ... and so on\n|   }\n| },\n| \"configurations\": {\n|   ${J(this.configurationName)}: {\n*---- \"app\": ${J(appAlias)},\n      ...\n    }\n  }\n}\\n`,\n    });\n  }\n\n  cantResolveAppAlias(appAlias) {\n    return new DetoxConfigError({\n      message: `Failed to find an app config ${J(appAlias)} in the \"apps\" dictionary of Detox config${this._atPath()}`,\n      hint: 'Below are the app configurations Detox was able to find:\\n' + hintList(this.contents.apps) +\n        `\\n\\nCheck your configuration ${J(this.configurationName)}:`,\n      debugInfo: this._getSelectedConfiguration(),\n      inspectOptions: { depth: 1 },\n    });\n  }\n\n  appConfigIsUndefined(appPath) {\n    const appProperty = appPath[2] === 'apps'\n      ? `\"apps\": [..., \"myApp\", ...]`\n      : `\"app\": \"myApp\"`;\n\n    return new DetoxConfigError({\n      message: `Undefined or empty app config in the selected ${J(this.configurationName)} configuration:`,\n      hint: `\\\nIt should be an alias to an existing app config in \"apps\" dictionary, or the config object itself, e.g.:\n\n{\n  \"apps\": {\n*-> \"myApp\": {\n|     \"type\": \"ios.app\", // or \"android.apk\", or etc...\n|     \"binaryPath\": \"path/to/your/app\", // ... and so on\n|   }\n| },\n| \"configurations\": {\n|   ${J(this.configurationName)}: {\n*---- ${appProperty}\n      ...\n    }\n  }\nExamine your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnConfiguration(),\n      inspectOptions: { depth: 2 }\n    });\n  }\n\n  malformedAppLaunchArgs(appPath) {\n    return new DetoxConfigError({\n      message: `Invalid type of \"launchArgs\" property in the app config.\\nExpected an object:`,\n      debugInfo: this._focusOnAppConfig(appPath),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  unsupportedReversePorts(appPath) {\n    return new DetoxConfigError({\n      message: `Non-Android app configs cannot have \"reversePorts\" property:`,\n      debugInfo: this._focusOnAppConfig(appPath),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  missingAppBinaryPath(appPath) {\n    return new DetoxConfigError({\n      message: `Missing \"binaryPath\" property in the app config.\\nExpected a string:`,\n      debugInfo: this._focusOnAppConfig(appPath, this._ensureProperty('binaryPath')),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  invalidAppType({ appPath, allowedAppTypes, deviceType }) {\n    return new DetoxConfigError({\n      message: `Invalid app \"type\" property in the app config.\\nExpected ${allowedAppTypes.map(J).join(' or ')}.`,\n      hint: `\\\nYou have a few options:\n1. Replace the value with the suggestion.\n2. Use a correct device type with this app config. Currently you have ${J(deviceType)}.`,\n      debugInfo: this._focusOnAppConfig(appPath),\n      inspectOptions: { depth: 4 },\n    });\n  }\n\n  duplicateAppConfig({ appName, appPath, preExistingAppPath }) {\n    const config1 = { ..._.get(this.contents, preExistingAppPath) };\n    config1.name = config1.name || '<GIVE IT A NAME>';\n    const config2 = { ..._.get(this.contents, appPath) };\n    config2.name = '<GIVE IT ANOTHER NAME>';\n\n    const name = this.configurationName;\n    const hintMessage = appName\n      ? `Both apps use the same name ${J(appName)} — try giving each app a unique name.`\n      : `The app configs are missing \"name\" property that serves to distinct them.`;\n\n    return new DetoxConfigError({\n      message: `App collision detected in the selected configuration ${J(name)}.`,\n      hint: `\\\n${hintMessage}\n\ndetox → ${preExistingAppPath.join(' → ')}:\n${DetoxConfigError.inspectObj(config1, { depth: 0 })}\n\ndetox → ${appPath.join(' → ')}:\n${DetoxConfigError.inspectObj(config2, { depth: 0 })}\n\nExamine your Detox config${this._atPath()}`,\n    });\n  }\n\n  noAppIsDefined(deviceType) {\n    const name = this.configurationName;\n    const [appType] = deviceAppTypes[deviceType] || [''];\n    const [appPlatform] = appType.split('.');\n    const appAlias = appType ? `myApp.${appPlatform}` : 'myApp';\n\n    return new DetoxConfigError({\n      message: `The ${J(name)} configuration has no defined \"app\" config.`,\n      hint: `There should be an inlined object or an alias to the app config, e.g.:\\n\n{\n  \"apps\": {\n*-->\"${appAlias}\": {\n|     \"type\": \"${appType || 'someAppType'}\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"configurations\": {\n|   ${J(name)}: {\n*---- \"app\": \"${appAlias}\"\n      ...\n    }\n  }\n}\n\nExamine your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnConfiguration(),\n      inspectOptions: { depth: 0 }\n    });\n  }\n\n  ambiguousAppAndApps() {\n    return new DetoxConfigError({\n      message: `You can't have both \"app\" and \"apps\" defined in the ${J(this.configurationName)} configuration.`,\n      hint: 'Use \"app\" if you have a single app to test.' +\n        '\\nUse \"apps\" if you have multiple apps to test.' +\n        `\\n\\nCheck your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnConfiguration(this._ensureProperty('app', 'apps')),\n      inspectOptions: { depth: 2 },\n    });\n  }\n\n  multipleAppsConfigArrayTypo() {\n    return new DetoxConfigError({\n      message: `Invalid type of the \"app\" property in the selected configuration ${J(this.configurationName)}.`,\n      hint: 'Rename \"app\" to \"apps\" if you plan to work with multiple apps.' +\n        `\\n\\nCheck your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnConfiguration(this._ensureProperty('app')),\n      inspectOptions: { depth: 2 },\n    });\n  }\n\n  multipleAppsConfigShouldBeArray() {\n    return new DetoxConfigError({\n      message: `Expected an array in \"apps\" property in the selected configuration ${J(this.configurationName)}.`,\n      hint: 'Rename \"apps\" to \"app\" if you plan to work with a single app.' +\n        '\\nOtherwise, make sure \"apps\" contains a valid array of app aliases or inlined app configs.' +\n        `\\n\\nCheck your Detox config${this._atPath()}`,\n      debugInfo: this._focusOnConfiguration(this._ensureProperty('apps')),\n      inspectOptions: { depth: 3 },\n    });\n  }\n\n  // endregion\n\n  // region composeSessionConfig\n\n  invalidServerProperty() {\n    return new DetoxConfigError({\n      message: `session.server property is not a valid WebSocket URL`,\n      hint: `Expected something like \"ws://localhost:8099\".\\nCheck that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: 3 },\n      debugInfo: _.omitBy({\n        session: _.get(this.contents, ['session']),\n        ...this._focusOnConfiguration(c => _.pick(c, ['session'])),\n      }, _.isEmpty),\n    });\n  }\n\n  invalidSessionIdProperty() {\n    return new DetoxConfigError({\n      message: `session.sessionId property should be a non-empty string`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: 3 },\n      debugInfo: _.omitBy({\n        session: _.get(this.contents, ['session']),\n        ...this._focusOnConfiguration(c => _.pick(c, ['session'])),\n      }, _.isEmpty),\n    });\n  }\n\n  invalidDebugSynchronizationProperty() {\n    return new DetoxConfigError({\n      message: `session.debugSynchronization should be a positive number`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: 3 },\n      debugInfo: _.omitBy({\n        session: _.get(this.contents, ['session']),\n        ...this._focusOnConfiguration(c => _.pick(c, ['session'])),\n      }, _.isEmpty),\n    });\n  }\n\n  invalidIgnoreUnexpectedMessagesProperty() {\n    return new DetoxConfigError({\n      message: `session.ignoreUnexpectedMessages should be a boolean value`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: 3 },\n      debugInfo: _.omitBy({\n        session: _.get(this.contents, ['session']),\n        ...this._focusOnConfiguration(c => _.pick(c, ['session'])),\n      }, _.isEmpty),\n    });\n  }\n\n  invalidTestRunnerProperty(isGlobal) {\n    const testRunner = _.get(\n      isGlobal\n        ? this.contents\n        : this._getSelectedConfiguration(),\n      ['testRunner']\n    );\n\n    return new DetoxConfigError({\n      message: `testRunner should be an object, not a ${typeof testRunner}`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: isGlobal ? 0 : 3 },\n      debugInfo: isGlobal ? {\n        testRunner,\n        ...this.contents,\n      } : {\n        ...this._focusOnConfiguration(c => _.pick(c, ['testRunner'])),\n      },\n    });\n  }\n\n  cannotSkipAutostartWithMissingServer() {\n    return new DetoxConfigError({\n      message: `Cannot have both an undefined session.server URL and session.autoStart set to false`,\n      hint: `Check that in your Detox config${this._atPath()}`,\n      inspectOptions: { depth: 3 },\n      debugInfo: _.omitBy({\n        session: _.get(this.contents, ['session']),\n        ...this._focusOnConfiguration(c => _.pick(c, ['session'])),\n      }, _.isEmpty),\n    });\n  }\n\n  // endregion\n\n  missingBuildScript(appConfig) {\n    return new DetoxConfigError({\n      message: `\\\nFailed to build the app for the configuration ${J(this.configurationName)}, because \\\nthere was no \"build\" script inside.\nCheck contents of your Detox config${this._atPath()}`,\n      debugInfo: { build: undefined, ...appConfig },\n      inspectOptions: { depth: 0 },\n    });\n  }\n}\n\nfunction hintList(items) {\n  const values = Array.isArray(items) ? items : _.keys(items);\n  return values.map(c => `* ${c}`).join('\\n');\n}\n\nmodule.exports = DetoxConfigErrorComposer;\n"
  },
  {
    "path": "detox/src/errors/DetoxConfigErrorComposer.test.js",
    "content": "// @ts-nocheck\nconst fs = require('fs');\nconst os = require('os');\n\nconst _ = require('lodash');\n\nconst DetoxConfigErrorComposer = require('./DetoxConfigErrorComposer');\n\ndescribe('DetoxConfigErrorComposer', () => {\n  /** @type DetoxConfigErrorComposer */\n  let builder;\n  let build;\n  let config;\n\n  beforeEach(() => {\n    /** @type Detox.DetoxConfig */\n    config = {\n      devices: {\n        aDevice: {\n          type: 'ios.simulator',\n          device: {\n            type: 'iPhone 12',\n          },\n        }\n      },\n      apps: {\n        someApp: {\n          type: 'ios.app',\n          binaryPath: 'path/to/app',\n        },\n      },\n      configurations: {\n        aliased: {\n          device: 'aDevice',\n          apps: ['someApp'],\n        },\n        inlined: {\n          device: null,\n          app: null,\n        },\n        inlinedMulti: {\n          device: null,\n          apps: [],\n        },\n      },\n    };\n\n    config.configurations.inlined.device = { ...config.devices.aDevice };\n    config.configurations.inlined.app = { ...config.apps.someApp };\n    config.configurations.inlinedMulti.device = { ...config.devices.aDevice };\n    config.configurations.inlinedMulti.apps = [{ ...config.apps.someApp }];\n\n    builder = new DetoxConfigErrorComposer()\n      .setDetoxConfigPath('/home/detox/myproject/.detoxrc.json')\n      .setDetoxConfig(config);\n  });\n\n  describe('(from configuration/index)', () => {\n    describe('.noConfigurationSpecified', () => {\n      beforeEach(() => {\n        build = () => builder.noConfigurationSpecified();\n      });\n\n      it('should create error 1, if the configuration file is not package.json', () => {\n        builder.setDetoxConfigPath('somethingElse');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create error 2, if the configuration file is package.json', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/package.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.noConfigurationAtGivenPath', () => {\n      it('should create an error with the attempted config path', () => {\n        expect(builder.noConfigurationAtGivenPath('./some/detox-config.js')).toMatchSnapshot();\n      });\n\n      it('should create an error with the attempted \"extends\" path', () => {\n        expect(\n          builder\n            .setExtends(true)\n            .setDetoxConfigPath('package.json')\n            .noConfigurationAtGivenPath('some-detox-preset')\n        ).toMatchSnapshot();\n      });\n    });\n\n    describe('.failedToReadConfiguration', () => {\n      it('should create a generic error, if I/O error is unknown', () => {\n        expect(builder.failedToReadConfiguration()).toMatchSnapshot();\n      });\n\n      it('should create a simple error, but with the original intercepted IO error', () => {\n        const ioError = _.attempt(() => fs.readFileSync(os.homedir()));\n        delete ioError.stack;\n        expect(builder.failedToReadConfiguration(ioError)).toMatchSnapshot();\n      });\n    });\n\n    describe('.noConfigurationsInside', () => {\n      beforeEach(() => {\n        config.configurations = {};\n        build = () => builder.noConfigurationsInside();\n      });\n\n      it('should create a generic error if all is unknown', () => {\n        builder.setDetoxConfig(null);\n        builder.setDetoxConfigPath('');\n\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with Detox config fragment, if the path is not known', () => {\n        builder.setDetoxConfigPath('');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with Detox config location hint, if it is known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.cantChooseConfiguration', () => {\n      beforeEach(() => {\n        build = () => builder.cantChooseConfiguration();\n      });\n\n      it('should create an error with --configuration suggestions', () => {\n        builder.setDetoxConfigPath('/etc/detox/config.js');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.noConfigurationWithGivenName', () => {\n      beforeEach(() => {\n        build = () => builder.noConfigurationWithGivenName();\n        builder.setConfigurationName('otherConf');\n      });\n\n      it('should create an error with configuration suggestions', () => {\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.configurationShouldNotBeEmpty', () => {\n      beforeEach(() => {\n        build = () => builder.configurationShouldNotBeEmpty();\n        builder.setConfigurationName('empty');\n        config.configurations.empty = {};\n      });\n\n      it('should create a helpful error', () => {\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.configurationShouldNotUseLegacyFormat', () => {\n      describe.each([\n        'ios.simulator',\n        'android.emulator',\n        'android.genycloud',\n      ])('for %j device type', (deviceType) => {\n        beforeEach(() => {\n          build = () => builder.configurationShouldNotUseLegacyFormat();\n          builder.setConfigurationName('legacy');\n          config.configurations.legacy = {\n            type: deviceType,\n            device: `some-query(${deviceType})`,\n            binaryPath: '/path/' + deviceType + '.app',\n          };\n        });\n\n        it('should create a helpful error', () => {\n          expect(build()).toMatchSnapshot();\n        });\n      });\n\n      describe('for custom driver type', () => {\n        beforeEach(() => {\n          build = () => builder.configurationShouldNotUseLegacyFormat();\n          builder.setConfigurationName('legacy');\n          config.configurations.legacy = {\n            type: './custom-driver',\n            webUrl: 'https://example.com',\n          };\n        });\n\n        it('should create a helpful error', () => {\n          expect(build()).toMatchSnapshot();\n        });\n      });\n\n      describe('for missing global .apps and .devices', () => {\n        beforeEach(() => {\n          build = () => builder.configurationShouldNotUseLegacyFormat();\n          builder.setConfigurationName('legacy');\n          delete config.devices;\n          delete config.apps;\n          config.configurations.legacy = {\n            type: 'ios.simulator',\n            device: 'iPhone 12',\n            binaryPath: '/some/path',\n          };\n        });\n\n        it('should create a helpful error', () => {\n          expect(build()).toMatchSnapshot();\n        });\n      });\n    });\n  });\n\n  describe('(from composeDeviceConfig)', () => {\n    describe('.thereAreNoDeviceConfigs', () => {\n      beforeEach(() => {\n        build = () => builder.thereAreNoDeviceConfigs('aDevice');\n        config.devices = {};\n        builder.setConfigurationName('aliased');\n      });\n\n      it('should create an error with a hint', () => {\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.cantResolveDeviceAlias', () => {\n      it('should create a helpful error', () => {\n        builder.setConfigurationName('aliased');\n        expect(builder.cantResolveDeviceAlias('otherDevice')).toMatchSnapshot();\n      });\n    });\n\n    describe('.malformedDeviceProperty', () => {\n      test.each([\n        ['bootArgs', 'inlined', ['--arg']],\n        ['bootArgs', 'aliased', ['--arg']],\n        ['forceAdbInstall', 'inlined', 'true'],\n        ['forceAdbInstall', 'aliased', 'false'],\n        ['gpuMode', 'inlined', 'something_odd'],\n        ['gpuMode', 'aliased', true],\n        ['headless', 'inlined', 'non-boolean'],\n        ['headless', 'aliased', 'non-boolean'],\n        ['readonly', 'inlined', 'non-boolean'],\n        ['readonly', 'aliased', 'non-boolean'],\n        ['utilBinaryPaths', 'inlined', [NaN, 'valid']],\n        ['utilBinaryPaths', 'aliased', [NaN, 'valid']],\n      ])('(%j) should create an error for %s configuration', (propertyName, configurationType, invalidValue) => {\n        builder.setConfigurationName(configurationType);\n        const deviceAlias = configurationType === 'aliased' ? 'aDevice' : undefined;\n        const deviceConfig = configurationType === 'inlined'\n          ? config.configurations[configurationType].device\n          : config.devices.aDevice;\n\n        deviceConfig[propertyName] = invalidValue;\n        expect(builder.malformedDeviceProperty(deviceAlias, propertyName)).toMatchSnapshot();\n      });\n\n      it('should throw on an unknown argument', () => {\n        expect(() => builder.malformedDeviceProperty(undefined, 'unknown')).toThrowErrorMatchingSnapshot();\n      });\n    });\n\n    describe('.unsupportedDeviceProperty', () => {\n      test.each([\n        ['bootArgs', 'inlined', '--no-window'],\n        ['bootArgs', 'aliased', '--no-window'],\n        ['forceAdbInstall', 'inlined', true],\n        ['forceAdbInstall', 'aliased', false],\n        ['gpuMode', 'inlined', 'auto'],\n        ['gpuMode', 'aliased', 'auto'],\n        ['headless', 'inlined', true],\n        ['headless', 'aliased', true],\n        ['readonly', 'inlined', false],\n        ['readonly', 'aliased', false],\n        ['utilBinaryPaths', 'inlined', []],\n        ['utilBinaryPaths', 'aliased', []],\n      ])('(%j) should create an error for %s configuration', (propertyName, configurationType, invalidValue) => {\n        builder.setConfigurationName(configurationType);\n        const deviceAlias = configurationType === 'aliased' ? 'aDevice' : undefined;\n        const deviceConfig = configurationType === 'inlined'\n          ? config.configurations[configurationType].device\n          : config.devices.aDevice;\n\n        deviceConfig[propertyName] = invalidValue;\n        expect(builder.unsupportedDeviceProperty(deviceAlias, propertyName)).toMatchSnapshot();\n      });\n\n      it('should throw on an unknown argument', () => {\n        expect(() => builder.unsupportedDeviceProperty(undefined, 'unknown')).toThrowErrorMatchingSnapshot();\n      });\n    });\n\n    describe('.deviceConfigIsUndefined', () => {\n      beforeEach(() => {\n        build = () => builder.deviceConfigIsUndefined();\n      });\n\n      it('should produce a helpful error', () => {\n        builder.setConfigurationName('aliased');\n        delete config.configurations.aliased.device;\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.missingDeviceType', () => {\n      beforeEach(() => {\n        build = (alias) => builder.missingDeviceType(alias);\n      });\n\n      it('should create an error for inlined configuration', () => {\n        delete config.configurations.inlined.device.type;\n        builder.setConfigurationName('inlined');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error for aliased configuration', () => {\n        delete config.devices.aDevice.type;\n        builder.setConfigurationName('aliased');\n        expect(build('aDevice')).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidDeviceType', () => {\n      beforeEach(() => {\n        build = (deviceConfig, alias) => {\n          // eslint-disable-next-line node/no-missing-require\n          const err = _.attempt(() => require('android.apk'));\n          return builder.invalidDeviceType(alias, deviceConfig, err);\n        };\n      });\n\n      it('should create an error for inlined configuration', () => {\n        const deviceConfig = config.configurations.inlined.device;\n        deviceConfig.type = 'android.apk';\n        builder.setConfigurationName('inlined');\n        expect(build(deviceConfig)).toMatchSnapshot();\n      });\n\n      it('should create an error for aliased configuration', () => {\n        const deviceConfig = config.devices.aDevice;\n        deviceConfig.type = 'android.apk';\n        builder.setConfigurationName('aliased');\n        expect(build(deviceConfig, 'aDevice')).toMatchSnapshot();\n      });\n    });\n\n    describe('.missingDeviceMatcherProperties', () => {\n      beforeEach(() => {\n        build = (alias) => builder.missingDeviceMatcherProperties(alias, ['foo', 'bar']);\n      });\n\n      it('should work with inlined configurations', () => {\n        builder.setConfigurationName('inlined');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should work with aliased configurations', () => {\n        builder.setConfigurationName('aliased');\n        expect(build('aDevice')).toMatchSnapshot();\n      });\n    });\n  });\n\n  describe('(from composeAppsConfig)', () => {\n    describe('.thereAreNoAppConfigs', () => {\n      it('should create an error for aliased configuration', () => {\n        delete config.apps.someApp;\n        builder.setConfigurationName('aliased');\n\n        expect(builder.thereAreNoAppConfigs('someApp')).toMatchSnapshot();\n      });\n    });\n\n    describe('.cantResolveAppAlias', () => {\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        expect(builder.cantResolveAppAlias('anotherApp')).toMatchSnapshot();\n      });\n    });\n\n    describe('.appConfigIsUndefined', () => {\n      beforeEach(() => {\n        build = (appPath) => builder.appConfigIsUndefined(appPath);\n        builder.setConfigurationName('android.release');\n      });\n\n      it('should take into account if it is \"app\" missing', () => {\n        expect(build(['configurations', 'android.release', 'app'])).toMatchSnapshot();\n      });\n\n      it('should take into account if it is \"apps\" array has an empty element', () => {\n        expect(build(['configurations', 'android.release', 'apps', 0])).toMatchSnapshot();\n      });\n    });\n\n    describe('.malformedAppLaunchArgs', () => {\n      beforeEach(() => {\n        build = (appPath) => builder.malformedAppLaunchArgs(appPath);\n      });\n\n      it('should work with inlined configurations', () => {\n        config.configurations.inlinedMulti.apps[0].launchArgs = 'invalid';\n        builder.setConfigurationName('inlinedMulti');\n        expect(build(['configurations', 'inlinedMulti', 'apps', 0])).toMatchSnapshot();\n      });\n\n      it('should work with aliased configurations', () => {\n        config.apps.someApp.launchArgs = 'invalid';\n        builder.setConfigurationName('aliased');\n        expect(build(['apps', 'someApp'])).toMatchSnapshot();\n      });\n    });\n\n    describe('.unsupportedReversePorts', () => {\n      beforeEach(() => {\n        build = (appPath) => builder.unsupportedReversePorts(appPath);\n      });\n\n      it('should work with inlined configurations', () => {\n        config.configurations.inlinedMulti.apps[0].reversePorts = [3000];\n        builder.setConfigurationName('inlinedMulti');\n        expect(build(['configurations', 'inlinedMulti', 'apps', 0])).toMatchSnapshot();\n      });\n\n      it('should work with aliased configurations', () => {\n        config.apps.someApp.reversePorts = [3000];\n        builder.setConfigurationName('aliased');\n        expect(build(['apps', 'someApp'])).toMatchSnapshot();\n      });\n    });\n\n    describe('.missingAppBinaryPath', () => {\n      beforeEach(() => {\n        build = (appPath) => builder.missingAppBinaryPath(appPath);\n      });\n\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        delete config.apps.someApp.binaryPath;\n        expect(build(['apps', 'someApp'])).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined configuration', () => {\n        builder.setConfigurationName('inlined');\n        delete config.configurations.inlined.app.binaryPath;\n        expect(build(['configurations', 'inlined', 'app'])).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined multi-app configuration', () => {\n        builder.setConfigurationName('inlinedMulti');\n        delete config.configurations.inlinedMulti.apps[0].binaryPath;\n        expect(build(['configurations', 'inlined', 'apps', 0])).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidAppType', () => {\n      beforeEach(() => {\n        build = (appPath) => builder.invalidAppType(appPath);\n      });\n\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        config.apps.someApp.type = 'invalid.app';\n        expect(build({\n          appPath: ['apps', 'someApp'],\n          allowedAppTypes: ['ios.app'],\n          deviceType: 'ios.simulator',\n        })).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined configuration', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.apps[0].type = 'invalid.app';\n        expect(build({\n          appPath: ['configurations', 'inlinedMulti', 'apps', 0],\n          allowedAppTypes: ['ios.app'],\n          deviceType: 'ios.simulator',\n        })).toMatchSnapshot();\n      });\n    });\n\n    describe('.duplicateAppConfig', () => {\n      beforeEach(() => {\n        build = (args) => builder.duplicateAppConfig(args);\n        config.apps.otherApp = { ...config.apps.someApp };\n      });\n\n      it('should help with aliased non-named apps', () => {\n        builder.setConfigurationName('aliased');\n        config.configurations.aliased.apps.push('otherApp');\n        expect(build({\n          appName: undefined,\n          appPath: ['apps', 'otherApp'],\n          preExistingAppPath: ['apps', 'someApp'],\n        })).toMatchSnapshot();\n      });\n\n      it('should help with aliased named apps', () => {\n        builder.setConfigurationName('aliased');\n        config.configurations.aliased.apps.push('otherApp');\n        config.apps.someApp.name = config.apps.otherApp.name = 'TheApp';\n        expect(build({\n          appName: 'TheApp',\n          appPath: ['apps', 'otherApp'],\n          preExistingAppPath: ['apps', 'someApp'],\n        })).toMatchSnapshot();\n      });\n\n      it('should help with inlined non-named apps', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.apps.push({\n          ...config.apps.otherApp,\n        });\n\n        expect(build({\n          appName: undefined,\n          appPath: ['configurations', 'inlinedMulti', 'apps', 1],\n          preExistingAppPath: ['configurations', 'inlinedMulti', 'apps', 0],\n        })).toMatchSnapshot();\n      });\n\n      it('should help with inlined named apps', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.apps.push({\n          ...config.apps.otherApp,\n        });\n        config.configurations.inlinedMulti.apps.forEach(a => {\n          a.name = 'TheApp';\n        });\n\n        expect(build({\n          appName: 'TheApp',\n          appPath: ['configurations', 'inlinedMulti', 'apps', 1],\n          preExistingAppPath: ['configurations', 'inlinedMulti', 'apps', 0],\n        })).toMatchSnapshot();\n      });\n    });\n\n    describe('.noAppIsDefined', () => {\n      beforeEach(() => {\n        build = (deviceType) => builder.noAppIsDefined(deviceType);\n        builder.setConfigurationName('android.release');\n      });\n\n      it('should create same versions for device subtypes', () => {\n        expect(build('android.emulator')).toEqual(build('android.attached'));\n        expect(build('android.emulator')).toEqual(build('android.genycloud'));\n      });\n\n      it('should create different versions depending on device type', () => {\n        expect(build('ios.simulator')).not.toEqual(build('android.emulator'));\n        expect(build('ios.simulator')).not.toEqual(build('./stub/driver'));\n        expect(build('android.emulator')).not.toEqual(build('./stub/driver'));\n      });\n\n      it('should produce iOS-specific error message', () => {\n        expect(build('ios.simulator')).toMatchSnapshot();\n      });\n\n      it('should produce Android-specific error message', () => {\n        expect(build('android.genycloud')).toMatchSnapshot();\n      });\n\n      it('should produce a custom error message for unknown device type', () => {\n        expect(build('unknown')).toMatchSnapshot();\n      });\n    });\n\n    describe('.ambiguousAppAndApps', () => {\n      beforeEach(() => {\n        build = () => builder.ambiguousAppAndApps();\n      });\n\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        config.configurations.aliased.app = config.configurations.aliased.apps[0];\n\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined configuration', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.app = {\n          ...config.configurations.inlinedMulti.apps[0]\n        };\n\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.multipleAppsConfigArrayTypo', () => {\n      beforeEach(() => {\n        build = () => builder.multipleAppsConfigArrayTypo();\n      });\n\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        config.configurations.aliased.app = config.configurations.aliased.apps;\n        delete config.configurations.aliased.apps;\n\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined configuration', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.app = config.configurations.inlinedMulti.apps;\n        delete config.configurations.inlinedMulti.apps;\n\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.multipleAppsConfigShouldBeArray', () => {\n      beforeEach(() => {\n        build = () => builder.multipleAppsConfigShouldBeArray();\n      });\n\n      it('should create an error for aliased configuration', () => {\n        builder.setConfigurationName('aliased');\n        config.configurations.aliased.apps = config.configurations.aliased.apps[0];\n\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error for inlined configuration', () => {\n        builder.setConfigurationName('inlinedMulti');\n        config.configurations.inlinedMulti.apps = config.configurations.inlinedMulti.apps[0];\n\n        expect(build()).toMatchSnapshot();\n      });\n    });\n  });\n\n  describe('(from composeSessionConfig)', () => {\n    describe('.invalidServerProperty', () => {\n      beforeEach(() => {\n        build = () => builder.invalidServerProperty();\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          session: {\n            server: 'localhost',\n          },\n          configurations: {\n            'android.release': {\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29'\n              }\n            }\n          }\n        });\n      });\n\n      it('should create a generic error, if the config location is not known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with a hint, if the config location is known', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidSessionId', () => {\n      beforeEach(() => {\n        build = () => builder.invalidSessionIdProperty();\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          configurations: {\n            'android.release': {\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29',\n              },\n              session: {\n                sessionId: 234589798234,\n              },\n            }\n          }\n        });\n      });\n\n      it('should create a generic error, if the config location is not known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with a hint, if the config location is known', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should point to global session if there is one', () => {\n        builder.setDetoxConfig({\n          session: {\n            server: 'ws://localhost:12837',\n          },\n          configurations: {},\n        });\n\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidDebugSynchronizationProperty', () => {\n      beforeEach(() => {\n        build = () => builder.invalidDebugSynchronizationProperty();\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          configurations: {\n            'android.release': {\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29',\n              },\n              session: {\n                debugSynchronization: '3000',\n              },\n            }\n          }\n        });\n      });\n\n      it('should create a generic error, if the config location is not known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with a hint, if the config location is known', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should point to global session if there is one', () => {\n        builder.setDetoxConfig({\n          session: {\n            server: 'ws://localhost:12837',\n          },\n          configurations: {},\n        });\n\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidIgnoreUnexpectedMessagesProperty', () => {\n      beforeEach(() => {\n        build = () => builder.invalidIgnoreUnexpectedMessagesProperty();\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          configurations: {\n            'android.release': {\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29',\n              },\n              session: {\n                ignoreUnexpectedMessages: 'true',\n              },\n            }\n          }\n        });\n      });\n\n      it('should create a generic error, if the config location is not known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with a hint, if the config location is known', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should point to global session if there is one', () => {\n        builder.setDetoxConfig({\n          session: {\n            ignoreUnexpectedMessages: 'not a boolean',\n          },\n          configurations: {},\n        });\n\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n\n    describe('.invalidTestRunnerProperty', () => {\n      beforeEach(() => {\n        build = (isGlobal) => builder.invalidTestRunnerProperty(isGlobal);\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          testRunner: 'jest',\n          configurations: {\n            'android.release': {\n              testRunner: 'mocha',\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29',\n              },\n              session: {\n                autoStart: false,\n              },\n            }\n          }\n        });\n      });\n\n      it('should be able to create a global config error', () => {\n        expect(build(true)).toMatchSnapshot();\n      });\n\n      it('should be able to create a local config error', () => {\n        expect(build(false)).toMatchSnapshot();\n      });\n    });\n\n    describe('.cannotSkipAutostartWithMissingServer', () => {\n      beforeEach(() => {\n        build = () => builder.cannotSkipAutostartWithMissingServer();\n        builder.setConfigurationName('android.release');\n        builder.setDetoxConfig({\n          configurations: {\n            'android.release': {\n              type: 'android.emulator',\n              device: {\n                avdName: 'Pixel_2_API_29',\n              },\n              session: {\n                autoStart: false,\n              },\n            }\n          }\n        });\n      });\n\n      it('should create a generic error, if the config location is not known', () => {\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should create an error with a hint, if the config location is known', () => {\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n\n      it('should point to global session if there is one', () => {\n        builder.setDetoxConfig({\n          session: {\n            autoStart: false\n          },\n          configurations: {},\n        });\n\n        builder.setDetoxConfigPath('/home/detox/myproject/.detoxrc.json');\n        expect(build()).toMatchSnapshot();\n      });\n    });\n  });\n\n  describe('(from local-cli/build)', () => {\n    it('should create a generic error, if the config location is not known', () => {\n      delete config.apps.someApp.build;\n      builder.setConfigurationName('aliased');\n      expect(builder.missingBuildScript(config.apps.someApp)).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/errors/DetoxError.js",
    "content": "const util = require('util');\n\nconst _ = require('lodash');\n\nclass DetoxError extends Error {\n  constructor(message) {\n    super(message);\n    this.name = 'DetoxError';\n  }\n\n  format() {\n    return this.message;\n  }\n\n  static get reportIssue() {\n    return 'Please report this issue on our GitHub tracker:\\nhttps://github.com/wix/Detox/issues';\n  }\n\n  static get reportIssueIfJest() {\n    return `If you are using Detox with Jest according to the latest guide, ${_.lowerFirst(this.reportIssue)}`;\n  }\n\n  static inspectObj(obj, options) {\n    return util.inspect(obj, {\n      colors: false,\n      compact: false,\n      depth: 0,\n      showHidden: false,\n\n      ...options,\n    });\n  }\n\n  /**\n   * @param {*} err\n   */\n  static format(err, inspectOptions = { depth: 1 }) {\n    if (err instanceof DetoxError) {\n      return err.format();\n    }\n\n    if (_.isError(err) && /^Command failed:/.test(err.message)) {\n      return err.message;\n    }\n\n    if (_.isError(err) && (err.stack || err.message)) {\n      return String(err.stack || err);\n    }\n\n    return this.inspectObj(err, inspectOptions);\n  }\n}\n\nmodule.exports = DetoxError;\n"
  },
  {
    "path": "detox/src/errors/DetoxInternalError.js",
    "content": "const DetoxError = require('./DetoxError');\n\nclass DetoxInternalError extends DetoxError {\n  constructor(message) {\n    super(message + '\\n' + DetoxError.reportIssue);\n    this.name = 'DetoxInternalError';\n  }\n\n  static from(message) {\n    return new DetoxInternalError(message).toString();\n  }\n}\n\nmodule.exports = DetoxInternalError;\n"
  },
  {
    "path": "detox/src/errors/DetoxInternalError.test.js",
    "content": "const DetoxInternalError = require('./DetoxInternalError');\n\ndescribe('DetoxInternalError', () => {\n  it('should append a Report-Issue hint', () => {\n    expect(() => { throw new DetoxInternalError('Should do better'); })\n      .toThrowErrorMatchingSnapshot();\n  });\n\n  it('.from(message) should wrap the error message ', () => {\n    expect(DetoxInternalError.from('Should do better')).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "detox/src/errors/DetoxRuntimeError.js",
    "content": "const _ = require('lodash');\n\nconst DetoxError = require('./DetoxError');\n\n/**\n * @typedef DetoxRuntimeErrorOptions\n * @property [message] { String }\n * @property [hint] { String }\n * @property [debugInfo] { * }\n * @property [noStack] { Boolean }\n * @property [inspectOptions] { Object }\n */\n\nclass DetoxRuntimeError extends DetoxError {\n  /**\n   * @param [options] { String | DetoxRuntimeErrorOptions }\n   */\n  constructor(options) {\n    super(formatOptions(options));\n    this.name = 'DetoxRuntimeError';\n\n    if (options && typeof options !== 'string' && options.noStack) {\n      this.stack = '';\n    }\n  }\n}\n\nfunction formatOptions(options) {\n  if (_.isObject(options)) {\n    const {\n      message = '',\n      hint = '',\n      debugInfo = '',\n      inspectOptions = null,\n    } = options;\n\n    return _.compact([\n      message,\n      hint && `HINT: ${hint}`,\n      _.isString(debugInfo)\n        ? debugInfo\n        : DetoxError.format(debugInfo, inspectOptions),\n    ]).join('\\n\\n');\n  }\n\n  return options;\n}\n\nmodule.exports = DetoxRuntimeError;\n"
  },
  {
    "path": "detox/src/errors/DetoxRuntimeError.test.js",
    "content": "const DetoxRuntimeError = require('./DetoxRuntimeError');\n\ndescribe('DetoxRuntimeError', () => {\n  it.each(varietiesOfInstantiation())('should be created with %s', (description, error) => {\n    expect(error).toMatchSnapshot();\n  });\n\n  it('should format string as well, similar to Error', () => {\n    expect(new DetoxRuntimeError('Test')).toEqual(new DetoxRuntimeError({\n      message: 'Test'\n    }));\n  });\n\n  it('should format any object to an error message', () => {\n    expect(DetoxRuntimeError.format({})).toBe('{}');\n\n    const err = new Error('Command failed: echo Hello world');\n    expect(DetoxRuntimeError.format(err)).toBe(err.message);\n\n    err.message = 'Other error message';\n    expect(DetoxRuntimeError.format(err)).toBe(err.stack);\n\n    delete err.stack;\n    expect(DetoxRuntimeError.format(err)).toBe(err.toString());\n\n    delete err.message;\n    expect(DetoxRuntimeError.format(err)).toBe('[Error]');\n\n    const runtimeError = new DetoxRuntimeError({\n      message: 'msg',\n      hint: 'hint',\n    });\n\n    expect(DetoxRuntimeError.format(runtimeError)).toBe(runtimeError.message);\n  });\n\n  function varietiesOfInstantiation() {\n    return Object.entries({\n      'no args': new DetoxRuntimeError(),\n      'plain string': new DetoxRuntimeError('A plain message'),\n      'empty object': new DetoxRuntimeError({}),\n      'only message': new DetoxRuntimeError({\n        message: `The video is not being recorded on device (${'emulator-5554'}) at path: ${'/sdcard/712398.mp4'}`,\n      }),\n      'message with no stack': new DetoxRuntimeError({\n        message: 'Test message without a stack',\n        noStack: true,\n      }),\n      'message with \"Command failed\" error': new DetoxRuntimeError({\n        message: 'Cannot run Detox due to an internal error',\n        debugInfo: new Error('Command failed: jest runMyTests'),\n      }),\n      'message with hint': new DetoxRuntimeError({\n        message: 'Detox adapter to Jest is malfunctioning.',\n        hint: `Make sure you register it as Jasmine reporter inside init.js:\\n` +\n              `-------------------------------------------------------------\\n` +\n              'jasmine.getEnv().addReporter(adapter);',\n      }),\n      'message with debug info': new DetoxRuntimeError({\n        message: 'no filename was given to constructSafeFilename()',\n        debugInfo: 'the arguments were: ' + JSON.stringify({\n          prefix: 'detox - ',\n          trimmable: undefined,\n          suffix: undefined,\n        }, null, 2),\n      }),\n      'message with debug info object': new DetoxRuntimeError({\n        message: 'no filename was given to constructSafeFilename()',\n        debugInfo: {\n          prefix: 'detox - ',\n          trimmable: undefined,\n          suffix: undefined,\n        },\n      }),\n      'message with hint and debug info': new DetoxRuntimeError({\n        message: `Invalid test summary was passed to detox.beforeEach(testSummary)` +\n        '\\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }',\n        hint: 'Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?' +\n        '\\nSee the article for the guidance: ' +\n        'https://wix.github.io/Detox/docs/api/test-lifecycle',\n        debugInfo: `testSummary was: ${JSON.stringify('test name')}`,\n      }),\n    });\n  }\n});\n"
  },
  {
    "path": "detox/src/errors/DetoxRuntimeErrorComposer.js",
    "content": "const _ = require('lodash');\n\nconst DetoxRuntimeError = require('./DetoxRuntimeError');\n\nconst J = s => JSON.stringify(s);\n\nclass DetoxRuntimeErrorComposer {\n  constructor({ appsConfig }) {\n    this.appsConfig = appsConfig;\n  }\n\n  abortedDetoxInit() {\n    return new DetoxRuntimeError({\n      message: 'Aborted detox.init() execution, and now running detox.cleanup()',\n      hint: 'Most likely, your test runner is tearing down the suite due to the timeout error'\n    });\n  }\n\n  invalidTestSummary(methodName, testSummary) {\n    return new DetoxRuntimeError({\n      message: `Invalid test summary was passed to detox.${methodName}(testSummary)` +\n        '\\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }',\n      hint: 'Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?' +\n        '\\nSee the article for the guidance: ' +\n        'https://wix.github.io/Detox/docs/api/test-lifecycle' +\n        '\\ntestSummary was: ',\n        debugInfo: testSummary,\n    });\n  }\n\n  invalidTestSummaryStatus(methodName, testSummary) {\n    return new DetoxRuntimeError({\n      message: `Invalid test summary status was passed to detox.${methodName}(testSummary). Valid values are: \"running\", \"passed\", \"failed\"`,\n      hint: \"It seems like you've hit a Detox integration issue with a test runner. \" +\n        'You are encouraged to report it in Detox issues on GitHub.' +\n        '\\ntestSummary was: ',\n      debugInfo: testSummary,\n    });\n  }\n\n  cantFindApp(attemptedName) {\n    const appCount = _.keys(this.appsConfig).length;\n\n    return new DetoxRuntimeError({\n      message: `Can't find an app config with name ${J(attemptedName)}.`,\n      hint: appCount < 2\n        ? `Actually, you don't have multiple apps defined in your config.\\n` +\n          `Hence, either you don't need to call device.selectApp(${J(attemptedName)}) at all,\\n` +\n          `or, your apps config is missing that app. See the actual contents:`\n        : `Maybe you meant one of these app names?\\n` + toStarlist(this.appsConfig),\n      debugInfo: appCount < 2 ? this.appsConfig : undefined,\n      inspectOptions: { depth: 2 },\n    });\n  }\n\n  cantSelectEmptyApp() {\n    return new DetoxRuntimeError({\n      message: `Forbidden method call: device.selectApp(app) cannot be called without arguments.`,\n      hint: 'Pass the name of the app or an app config. See Device API docs for more details.'\n    });\n  }\n\n  appNotSelected() {\n    return new DetoxRuntimeError({\n      message: `To perform any app-specific action on the device, you should select the app first.`,\n      hint: 'Make sure you call `await device.selectApp(\"your app name\")`, where the app name is one of:\\n' +\n        toStarlist(this.appsConfig)\n    });\n  }\n}\n\nfunction toStarlist(dictionary) {\n  return _.keys(dictionary).map(c => `* ${c}`).join('\\n');\n}\n\nmodule.exports = DetoxRuntimeErrorComposer;\n"
  },
  {
    "path": "detox/src/errors/DetoxRuntimeErrorComposer.test.js",
    "content": "// @ts-nocheck\nconst DetoxRuntimeErrorComposer = require('./DetoxRuntimeErrorComposer');\n\ndescribe('DetoxRuntimeErrorComposer', () => {\n  /** @type () => DetoxRuntimeErrorComposer */\n  let builder;\n  let appsConfig;\n\n  beforeEach(() => {\n    builder = () => new DetoxRuntimeErrorComposer({ appsConfig });\n  });\n\n  test('abortedDetoxInit', () => {\n    expect(builder().abortedDetoxInit()).toMatchSnapshot();\n  });\n\n  test('invalidTestSummary - beforeEach', () => {\n    expect(builder().invalidTestSummary('beforeEach', 'deviceName')).toMatchSnapshot();\n  });\n\n  test('invalidTestSummary - afterEach', () => {\n    expect(builder().invalidTestSummary('afterEach', { weird: [['string']] })).toMatchSnapshot();\n  });\n\n  test('invalidTestSummary - afterEach', () => {\n    expect(builder().invalidTestSummary('afterEach', {\n      title: 'foo test',\n      fullName: 'suite foo test',\n      status: 'uncertain',\n    })).toMatchSnapshot();\n  });\n\n  test('invalidTestSummaryStatus - afterEach', () => {\n    expect(builder().invalidTestSummaryStatus('afterEach', {\n      summary: 'invalid stuff',\n    })).toMatchSnapshot();\n  });\n\n  test('cantFindApp - single app', () => {\n    appsConfig = {\n      default: {\n        type: 'ios.app',\n        binaryPath: 'path/to/app',\n      }\n    };\n\n    expect(builder().cantFindApp('unicorn')).toMatchSnapshot();\n  });\n\n  test('cantFindApp - multiple apps', () => {\n    appsConfig = {\n      fish: {},\n      chips: {},\n      hummus: {},\n      beer: {},\n    };\n\n    expect(builder().cantFindApp('steak')).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "detox/src/errors/__snapshots__/DetoxConfigErrorComposer.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .ambiguousAppAndApps should create an error for aliased configuration 1`] = `\n[DetoxConfigError: You can't have both \"app\" and \"apps\" defined in the \"aliased\" configuration.\n\nHINT: Use \"app\" if you have a single app to test.\nUse \"apps\" if you have multiple apps to test.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    aliased: {\n      device: 'aDevice',\n      apps: [Array],\n      app: 'someApp'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .ambiguousAppAndApps should create an error for inlined configuration 1`] = `\n[DetoxConfigError: You can't have both \"app\" and \"apps\" defined in the \"inlinedMulti\" configuration.\n\nHINT: Use \"app\" if you have a single app to test.\nUse \"apps\" if you have multiple apps to test.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlinedMulti: {\n      device: [Object],\n      apps: [Array],\n      app: [Object]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .appConfigIsUndefined should take into account if it is \"app\" missing 1`] = `\n[DetoxConfigError: Undefined or empty app config in the selected \"android.release\" configuration:\n\nHINT: It should be an alias to an existing app config in \"apps\" dictionary, or the config object itself, e.g.:\n\n{\n  \"apps\": {\n*-> \"myApp\": {\n|     \"type\": \"ios.app\", // or \"android.apk\", or etc...\n|     \"binaryPath\": \"path/to/your/app\", // ... and so on\n|   }\n| },\n| \"configurations\": {\n|   \"android.release\": {\n*---- \"app\": \"myApp\"\n      ...\n    }\n  }\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .appConfigIsUndefined should take into account if it is \"apps\" array has an empty element 1`] = `\n[DetoxConfigError: Undefined or empty app config in the selected \"android.release\" configuration:\n\nHINT: It should be an alias to an existing app config in \"apps\" dictionary, or the config object itself, e.g.:\n\n{\n  \"apps\": {\n*-> \"myApp\": {\n|     \"type\": \"ios.app\", // or \"android.apk\", or etc...\n|     \"binaryPath\": \"path/to/your/app\", // ... and so on\n|   }\n| },\n| \"configurations\": {\n|   \"android.release\": {\n*---- \"apps\": [..., \"myApp\", ...]\n      ...\n    }\n  }\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .cantResolveAppAlias should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Failed to find an app config \"anotherApp\" in the \"apps\" dictionary of Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: Below are the app configurations Detox was able to find:\n* someApp\n\nCheck your configuration \"aliased\":\n\n{\n  device: 'aDevice',\n  apps: [\n    'someApp'\n  ]\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .duplicateAppConfig should help with aliased named apps 1`] = `\n[DetoxConfigError: App collision detected in the selected configuration \"aliased\".\n\nHINT: Both apps use the same name \"TheApp\" — try giving each app a unique name.\n\ndetox → apps → someApp:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: 'TheApp'\n}\n\ndetox → apps → otherApp:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT ANOTHER NAME>'\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .duplicateAppConfig should help with aliased non-named apps 1`] = `\n[DetoxConfigError: App collision detected in the selected configuration \"aliased\".\n\nHINT: The app configs are missing \"name\" property that serves to distinct them.\n\ndetox → apps → someApp:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT A NAME>'\n}\n\ndetox → apps → otherApp:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT ANOTHER NAME>'\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .duplicateAppConfig should help with inlined named apps 1`] = `\n[DetoxConfigError: App collision detected in the selected configuration \"inlinedMulti\".\n\nHINT: Both apps use the same name \"TheApp\" — try giving each app a unique name.\n\ndetox → configurations → inlinedMulti → apps → 0:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: 'TheApp'\n}\n\ndetox → configurations → inlinedMulti → apps → 1:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT ANOTHER NAME>'\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .duplicateAppConfig should help with inlined non-named apps 1`] = `\n[DetoxConfigError: App collision detected in the selected configuration \"inlinedMulti\".\n\nHINT: The app configs are missing \"name\" property that serves to distinct them.\n\ndetox → configurations → inlinedMulti → apps → 0:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT A NAME>'\n}\n\ndetox → configurations → inlinedMulti → apps → 1:\n{\n  type: 'ios.app',\n  binaryPath: 'path/to/app',\n  name: '<GIVE IT ANOTHER NAME>'\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .invalidAppType should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid app \"type\" property in the app config.\nExpected \"ios.app\".\n\nHINT: You have a few options:\n1. Replace the value with the suggestion.\n2. Use a correct device type with this app config. Currently you have \"ios.simulator\".\n\n{\n  apps: {\n    someApp: {\n      type: 'invalid.app',\n      binaryPath: 'path/to/app'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .invalidAppType should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid app \"type\" property in the app config.\nExpected \"ios.app\".\n\nHINT: You have a few options:\n1. Replace the value with the suggestion.\n2. Use a correct device type with this app config. Currently you have \"ios.simulator\".\n\n{\n  configurations: {\n    inlinedMulti: {\n      apps: [\n        {\n          type: 'invalid.app',\n          binaryPath: 'path/to/app'\n        }\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .malformedAppLaunchArgs should work with aliased configurations 1`] = `\n[DetoxConfigError: Invalid type of \"launchArgs\" property in the app config.\nExpected an object:\n\n{\n  apps: {\n    someApp: {\n      type: 'ios.app',\n      binaryPath: 'path/to/app',\n      launchArgs: 'invalid'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .malformedAppLaunchArgs should work with inlined configurations 1`] = `\n[DetoxConfigError: Invalid type of \"launchArgs\" property in the app config.\nExpected an object:\n\n{\n  configurations: {\n    inlinedMulti: {\n      apps: [\n        {\n          type: 'ios.app',\n          binaryPath: 'path/to/app',\n          launchArgs: 'invalid'\n        }\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .missingAppBinaryPath should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Missing \"binaryPath\" property in the app config.\nExpected a string:\n\n{\n  apps: {\n    someApp: {\n      type: 'ios.app',\n      binaryPath: undefined\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .missingAppBinaryPath should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Missing \"binaryPath\" property in the app config.\nExpected a string:\n\n{\n  configurations: {\n    inlined: {\n      app: {\n        type: 'ios.app',\n        binaryPath: undefined\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .missingAppBinaryPath should create an error for inlined multi-app configuration 1`] = `\n[DetoxConfigError: Missing \"binaryPath\" property in the app config.\nExpected a string:\n\n{\n  configurations: {\n    inlined: {\n      apps: [\n        undefined\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .multipleAppsConfigArrayTypo should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of the \"app\" property in the selected configuration \"aliased\".\n\nHINT: Rename \"app\" to \"apps\" if you plan to work with multiple apps.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    aliased: {\n      device: 'aDevice',\n      app: [Array]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .multipleAppsConfigArrayTypo should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of the \"app\" property in the selected configuration \"inlinedMulti\".\n\nHINT: Rename \"app\" to \"apps\" if you plan to work with multiple apps.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlinedMulti: {\n      device: [Object],\n      app: [Array]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .multipleAppsConfigShouldBeArray should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Expected an array in \"apps\" property in the selected configuration \"aliased\".\n\nHINT: Rename \"apps\" to \"app\" if you plan to work with a single app.\nOtherwise, make sure \"apps\" contains a valid array of app aliases or inlined app configs.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    aliased: {\n      device: 'aDevice',\n      apps: 'someApp'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .multipleAppsConfigShouldBeArray should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Expected an array in \"apps\" property in the selected configuration \"inlinedMulti\".\n\nHINT: Rename \"apps\" to \"app\" if you plan to work with a single app.\nOtherwise, make sure \"apps\" contains a valid array of app aliases or inlined app configs.\n\nCheck your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlinedMulti: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object]\n      },\n      apps: {\n        type: 'ios.app',\n        binaryPath: 'path/to/app'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .noAppIsDefined should produce Android-specific error message 1`] = `\n[DetoxConfigError: The \"android.release\" configuration has no defined \"app\" config.\n\nHINT: There should be an inlined object or an alias to the app config, e.g.:\n\n{\n  \"apps\": {\n*-->\"myApp.android\": {\n|     \"type\": \"android.apk\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"configurations\": {\n|   \"android.release\": {\n*---- \"app\": \"myApp.android\"\n      ...\n    }\n  }\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .noAppIsDefined should produce a custom error message for unknown device type 1`] = `\n[DetoxConfigError: The \"android.release\" configuration has no defined \"app\" config.\n\nHINT: There should be an inlined object or an alias to the app config, e.g.:\n\n{\n  \"apps\": {\n*-->\"myApp\": {\n|     \"type\": \"someAppType\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"configurations\": {\n|   \"android.release\": {\n*---- \"app\": \"myApp\"\n      ...\n    }\n  }\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .noAppIsDefined should produce iOS-specific error message 1`] = `\n[DetoxConfigError: The \"android.release\" configuration has no defined \"app\" config.\n\nHINT: There should be an inlined object or an alias to the app config, e.g.:\n\n{\n  \"apps\": {\n*-->\"myApp.ios\": {\n|     \"type\": \"ios.app\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"configurations\": {\n|   \"android.release\": {\n*---- \"app\": \"myApp.ios\"\n      ...\n    }\n  }\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .thereAreNoAppConfigs should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Cannot use app alias \"someApp\" since there is no \"apps\" config in Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: You should create a dictionary of app configurations in Detox config, e.g.:\n{\n  \"apps\": {\n*-> \"someApp\": {\n|     \"type\": \"ios.app\", // or \"android.apk\", or etc...\n|     \"binaryPath\": \"path/to/your/app\", // ... and so on\n|   }\n| },\n| \"configurations\": {\n|   \"aliased\": {\n*---- \"app\": \"someApp\",\n      ...\n    }\n  }\n}\n]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .unsupportedReversePorts should work with aliased configurations 1`] = `\n[DetoxConfigError: Non-Android app configs cannot have \"reversePorts\" property:\n\n{\n  apps: {\n    someApp: {\n      type: 'ios.app',\n      binaryPath: 'path/to/app',\n      reversePorts: [\n        3000\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeAppsConfig) .unsupportedReversePorts should work with inlined configurations 1`] = `\n[DetoxConfigError: Non-Android app configs cannot have \"reversePorts\" property:\n\n{\n  configurations: {\n    inlinedMulti: {\n      apps: [\n        {\n          type: 'ios.app',\n          binaryPath: 'path/to/app',\n          reversePorts: [Array]\n        }\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .cantResolveDeviceAlias should create a helpful error 1`] = `\n[DetoxConfigError: Failed to find a device config \"otherDevice\" in the \"devices\" dictionary of Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: Below are the device configurations Detox was able to find:\n* aDevice\n\nCheck your configuration \"aliased\":\n\n{\n  device: 'aDevice',\n  apps: [Array]\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .deviceConfigIsUndefined should produce a helpful error 1`] = `\n[DetoxConfigError: Missing \"device\" property in the selected configuration \"aliased\":\n\nHINT: It should be an alias to the device config, or the device config itself, e.g.:\n{\n  ...\n  \"devices\": {\n*-> \"myDevice\": {\n|     \"type\": \"ios.simulator\", // or \"android.emulator\", or etc...\n|     \"device\": { \"type\": \"iPhone 12\" }, // or e.g.: { \"avdName\": \"Pixel_API_29\" }\n|   }\n| },\n| \"configurations\": {\n|   \"aliased\": {\n*---- \"device\": \"myDevice\", // or { type: 'ios.simulator', ... }\n      ...\n    },\n    ...\n  }\n}\n\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .invalidDeviceType should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid device type \"android.apk\" inside your configuration.\n\nHINT: Did you mean to use one of these?\n* ios.simulator\n* android.attached\n* android.emulator\n* android.genycloud\n\nP.S. If you intended to use a third-party driver, please resolve this error:\n\nCannot find module 'android.apk' from 'src/errors/DetoxConfigErrorComposer.test.js'\n\nPlease check your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'android.apk',\n      device: {\n        type: 'iPhone 12'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .invalidDeviceType should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid device type \"android.apk\" inside your configuration.\n\nHINT: Did you mean to use one of these?\n* ios.simulator\n* android.attached\n* android.emulator\n* android.genycloud\n\nP.S. If you intended to use a third-party driver, please resolve this error:\n\nCannot find module 'android.apk' from 'src/errors/DetoxConfigErrorComposer.test.js'\n\nPlease check your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'android.apk',\n        device: [Object]\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"bootArgs\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"bootArgs\" inside the device configuration.\nExpected a string.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      bootArgs: [\n        '--arg'\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"bootArgs\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"bootArgs\" inside the device configuration.\nExpected a string.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        bootArgs: [Array]\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"forceAdbInstall\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"forceAdbInstall\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      forceAdbInstall: 'false'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"forceAdbInstall\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"forceAdbInstall\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        forceAdbInstall: 'true'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"gpuMode\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"gpuMode\" inside the device configuration.\nExpected 'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest' | 'off'.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      gpuMode: true\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"gpuMode\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"gpuMode\" inside the device configuration.\nExpected 'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest' | 'off'.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        gpuMode: 'something_odd'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"headless\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"headless\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      headless: 'non-boolean'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"headless\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"headless\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        headless: 'non-boolean'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"readonly\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"readonly\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      readonly: 'non-boolean'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"readonly\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"readonly\" inside the device configuration.\nExpected a boolean value.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        readonly: 'non-boolean'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"utilBinaryPaths\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Invalid type of \"utilBinaryPaths\" inside the device configuration.\nExpected an array of strings.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      utilBinaryPaths: [\n        NaN,\n        'valid'\n      ]\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty (\"utilBinaryPaths\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Invalid type of \"utilBinaryPaths\" inside the device configuration.\nExpected an array of strings.\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: [Object],\n        utilBinaryPaths: [Array]\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .malformedDeviceProperty should throw on an unknown argument 1`] = `\n\"Composing .malformedDeviceProperty(unknown) is not implemented\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .missingDeviceMatcherProperties should work with aliased configurations 1`] = `\n[DetoxConfigError: Invalid or empty \"device\" matcher inside the device config.\n\nHINT: It should have the device query to run on, e.g.:\n\n{\n  \"type\": \"ios.simulator\",\n  \"device\": { \"foo\": ... }\n      // or { \"bar\": ... }\n}\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .missingDeviceMatcherProperties should work with inlined configurations 1`] = `\n[DetoxConfigError: Invalid or empty \"device\" matcher inside the device config.\n\nHINT: It should have the device query to run on, e.g.:\n\n{\n  \"type\": \"ios.simulator\",\n  \"device\": { \"foo\": ... }\n      // or { \"bar\": ... }\n}\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        }\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .missingDeviceType should create an error for aliased configuration 1`] = `\n[DetoxConfigError: Missing \"type\" inside the device configuration.\n\nHINT: Usually, \"type\" property should hold the device type to test on (e.g. \"ios.simulator\" or \"android.emulator\").\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      device: {\n        type: 'iPhone 12'\n      },\n      type: undefined\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .missingDeviceType should create an error for inlined configuration 1`] = `\n[DetoxConfigError: Missing \"type\" inside the device configuration.\n\nHINT: Usually, \"type\" property should hold the device type to test on (e.g. \"ios.simulator\" or \"android.emulator\").\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        device: [Object],\n        type: undefined\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .thereAreNoDeviceConfigs should create an error with a hint 1`] = `\n[DetoxConfigError: Cannot use device alias \"aDevice\" since there is no \"devices\" config in Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: You should create a dictionary of device configurations in Detox config, e.g.:\n{\n  \"devices\": {\n*-> \"aDevice\": {\n|     \"type\": \"ios.simulator\", // or \"android.emulator\", or etc...\n|     \"device\": { \"type\": \"iPhone 12\" }, // or e.g.: { \"avdName\": \"Pixel_API_29\" }\n|   }\n| },\n| \"configurations\": {\n|   \"aliased\": {\n*---- \"device\": \"aDevice\",\n      ...\n    }\n  }\n}\n]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"bootArgs\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"bootArgs\" property.\n\nHINT: You can use this property only with the following device types:\n* ios.simulator\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      bootArgs: '--no-window'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"bootArgs\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"bootArgs\" property.\n\nHINT: You can use this property only with the following device types:\n* ios.simulator\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        bootArgs: '--no-window'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"forceAdbInstall\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"forceAdbInstall\" property.\n\nHINT: You can use this property only with the following device types:\n* android.attached\n* android.emulator\n* android.genycloud\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      forceAdbInstall: false\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"forceAdbInstall\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"forceAdbInstall\" property.\n\nHINT: You can use this property only with the following device types:\n* android.attached\n* android.emulator\n* android.genycloud\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        forceAdbInstall: true\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"gpuMode\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"gpuMode\" property.\n\nHINT: You can use this property only with the following device types:\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      gpuMode: 'auto'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"gpuMode\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"gpuMode\" property.\n\nHINT: You can use this property only with the following device types:\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        gpuMode: 'auto'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"headless\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"headless\" property.\n\nHINT: You can use this property only with the following device types:\n* ios.simulator\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      headless: true\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"headless\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"headless\" property.\n\nHINT: You can use this property only with the following device types:\n* ios.simulator\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        headless: true\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"readonly\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"readonly\" property.\n\nHINT: You can use this property only with the following device types:\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      readonly: false\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"readonly\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"readonly\" property.\n\nHINT: You can use this property only with the following device types:\n* android.emulator\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        readonly: false\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"utilBinaryPaths\") should create an error for aliased configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"utilBinaryPaths\" property.\n\nHINT: You can use this property only with the following device types:\n* android.attached\n* android.emulator\n* android.genycloud\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  devices: {\n    aDevice: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 12'\n      },\n      utilBinaryPaths: []\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty (\"utilBinaryPaths\") should create an error for inlined configuration 1`] = `\n[DetoxConfigError: The current device type \"ios.simulator\" does not support \"utilBinaryPaths\" property.\n\nHINT: You can use this property only with the following device types:\n* android.attached\n* android.emulator\n* android.genycloud\n\nPlease fix your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    inlined: {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 12'\n        },\n        utilBinaryPaths: []\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeDeviceConfig) .unsupportedDeviceProperty should throw on an unknown argument 1`] = `\n\"Composing .unsupportedDeviceProperty(unknown) is not implemented\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .cannotSkipAutostartWithMissingServer should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: Cannot have both an undefined session.server URL and session.autoStart set to false\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        autoStart: false\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .cannotSkipAutostartWithMissingServer should create an error with a hint, if the config location is known 1`] = `\n[DetoxConfigError: Cannot have both an undefined session.server URL and session.autoStart set to false\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        autoStart: false\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .cannotSkipAutostartWithMissingServer should point to global session if there is one 1`] = `\n[DetoxConfigError: Cannot have both an undefined session.server URL and session.autoStart set to false\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    autoStart: false\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidDebugSynchronizationProperty should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: session.debugSynchronization should be a positive number\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        debugSynchronization: '3000'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidDebugSynchronizationProperty should create an error with a hint, if the config location is known 1`] = `\n[DetoxConfigError: session.debugSynchronization should be a positive number\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        debugSynchronization: '3000'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidDebugSynchronizationProperty should point to global session if there is one 1`] = `\n[DetoxConfigError: session.debugSynchronization should be a positive number\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    server: 'ws://localhost:12837'\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidIgnoreUnexpectedMessagesProperty should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: session.ignoreUnexpectedMessages should be a boolean value\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        ignoreUnexpectedMessages: 'true'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidIgnoreUnexpectedMessagesProperty should create an error with a hint, if the config location is known 1`] = `\n[DetoxConfigError: session.ignoreUnexpectedMessages should be a boolean value\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        ignoreUnexpectedMessages: 'true'\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidIgnoreUnexpectedMessagesProperty should point to global session if there is one 1`] = `\n[DetoxConfigError: session.ignoreUnexpectedMessages should be a boolean value\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    ignoreUnexpectedMessages: 'not a boolean'\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidServerProperty should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: session.server property is not a valid WebSocket URL\n\nHINT: Expected something like \"ws://localhost:8099\".\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    server: 'localhost'\n  },\n  configurations: {\n    'android.release': {}\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidServerProperty should create an error with a hint, if the config location is known 1`] = `\n[DetoxConfigError: session.server property is not a valid WebSocket URL\n\nHINT: Expected something like \"ws://localhost:8099\".\nCheck that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    server: 'localhost'\n  },\n  configurations: {\n    'android.release': {}\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidSessionId should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: session.sessionId property should be a non-empty string\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        sessionId: 234589798234\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidSessionId should create an error with a hint, if the config location is known 1`] = `\n[DetoxConfigError: session.sessionId property should be a non-empty string\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      session: {\n        sessionId: 234589798234\n      }\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidSessionId should point to global session if there is one 1`] = `\n[DetoxConfigError: session.sessionId property should be a non-empty string\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  session: {\n    server: 'ws://localhost:12837'\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidTestRunnerProperty should be able to create a global config error 1`] = `\n[DetoxConfigError: testRunner should be an object, not a string\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  testRunner: 'jest',\n  configurations: [Object]\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from composeSessionConfig) .invalidTestRunnerProperty should be able to create a local config error 1`] = `\n[DetoxConfigError: testRunner should be an object, not a string\n\nHINT: Check that in your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    'android.release': {\n      testRunner: 'mocha'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .cantChooseConfiguration should create an error with --configuration suggestions 1`] = `\n[DetoxConfigError: Cannot determine which configuration to use from Detox config at path:\n/etc/detox/config.js\n\nHINT: Use --configuration to choose one of the following:\n* aliased\n* inlined\n* inlinedMulti]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotBeEmpty should create a helpful error 1`] = `\n[DetoxConfigError: Cannot use an empty configuration \"empty\".\n\nHINT: A valid configuration should have \"device\" and \"app\" properties defined, e.g.:\n\n{\n  \"apps\": {\n*-->\"myApp.ios\": {\n|     \"type\": \"ios.app\",\n|     \"binaryPath\": \"path/to/app\"\n|   },\n| },\n| \"devices\": {\n|*->\"simulator\": {\n||    \"type\": \"ios.simulator\",\n||    \"device\": { type: \"iPhone 12\" }\n||  },\n||},\n||\"configurations\": {\n||  \"empty\": {\n|*--- \"device\": \"simulator\",\n*---- \"app\": \"myApp.ios\"\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  configurations: {\n    empty: {},\n    aliased: [Object],\n    inlined: [Object],\n    inlinedMulti: [Object]\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotUseLegacyFormat for \"android.emulator\" device type should create a helpful error 1`] = `\n[DetoxConfigError: The \"legacy\" configuration utilizes a deprecated all-in-one schema, that is not supported by the current version of Detox.\n\nHINT: Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\n\n{\n  \"apps\": {\n*-->\"myApp.android\": {\n|     \"type\": \"android.apk\",\n|     \"binaryPath\": \"/path/android.emulator.app\",\n|   },\n| },\n| \"devices\": {\n|*->\"emulator\": {\n||    \"type\": \"android.emulator\",\n||    \"device\": \"some-query(android.emulator)\"\n||  },\n||},\n||\"configurations\": {\n||  \"legacy\": {\n||    /* REMOVE (!) \"type\": \"android.emulator\" */\n|*--- \"device\": \"emulator\",\n*---- \"app\": \"myApp.android\",\n      ...\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  apps: {\n    someApp: {}\n  },\n  devices: {\n    aDevice: {}\n  },\n  configurations: {\n    legacy: {\n      type: 'android.emulator',\n      device: 'some-query(android.emulator)',\n      binaryPath: '/path/android.emulator.app'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotUseLegacyFormat for \"android.genycloud\" device type should create a helpful error 1`] = `\n[DetoxConfigError: The \"legacy\" configuration utilizes a deprecated all-in-one schema, that is not supported by the current version of Detox.\n\nHINT: Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\n\n{\n  \"apps\": {\n*-->\"myApp.android\": {\n|     \"type\": \"android.apk\",\n|     \"binaryPath\": \"/path/android.genycloud.app\",\n|   },\n| },\n| \"devices\": {\n|*->\"emulator\": {\n||    \"type\": \"android.genycloud\",\n||    \"device\": \"some-query(android.genycloud)\"\n||  },\n||},\n||\"configurations\": {\n||  \"legacy\": {\n||    /* REMOVE (!) \"type\": \"android.genycloud\" */\n|*--- \"device\": \"emulator\",\n*---- \"app\": \"myApp.android\",\n      ...\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  apps: {\n    someApp: {}\n  },\n  devices: {\n    aDevice: {}\n  },\n  configurations: {\n    legacy: {\n      type: 'android.genycloud',\n      device: 'some-query(android.genycloud)',\n      binaryPath: '/path/android.genycloud.app'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotUseLegacyFormat for \"ios.simulator\" device type should create a helpful error 1`] = `\n[DetoxConfigError: The \"legacy\" configuration utilizes a deprecated all-in-one schema, that is not supported by the current version of Detox.\n\nHINT: Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\n\n{\n  \"apps\": {\n*-->\"myApp.ios\": {\n|     \"type\": \"ios.app\",\n|     \"binaryPath\": \"/path/ios.simulator.app\",\n|   },\n| },\n| \"devices\": {\n|*->\"simulator\": {\n||    \"type\": \"ios.simulator\",\n||    \"device\": \"some-query(ios.simulator)\"\n||  },\n||},\n||\"configurations\": {\n||  \"legacy\": {\n||    /* REMOVE (!) \"type\": \"ios.simulator\" */\n|*--- \"device\": \"simulator\",\n*---- \"app\": \"myApp.ios\",\n      ...\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  apps: {\n    someApp: {}\n  },\n  devices: {\n    aDevice: {}\n  },\n  configurations: {\n    legacy: {\n      type: 'ios.simulator',\n      device: 'some-query(ios.simulator)',\n      binaryPath: '/path/ios.simulator.app'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotUseLegacyFormat for custom driver type should create a helpful error 1`] = `\n[DetoxConfigError: The \"legacy\" configuration utilizes a deprecated all-in-one schema, that is not supported by the current version of Detox.\n\nHINT: Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\n\n{\n  \"apps\": {\n*-->\"myApp\": {\n|     \"type\": \"<optional property>\",\n|     \"binaryPath\": \"<optional property>\",\n|   },\n| },\n| \"devices\": {\n|*->\"myDevice\": {\n||    \"type\": \"./custom-driver\",\n||    \"device\": \"<optional property>\"\n||  },\n||},\n||\"configurations\": {\n||  \"legacy\": {\n||    /* REMOVE (!) \"type\": \"./custom-driver\" */\n|*--- \"device\": \"myDevice\",\n*---- \"app\": \"myApp\",\n      ...\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  apps: {\n    someApp: {}\n  },\n  devices: {\n    aDevice: {}\n  },\n  configurations: {\n    legacy: {\n      type: './custom-driver',\n      webUrl: 'https://example.com'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .configurationShouldNotUseLegacyFormat for missing global .apps and .devices should create a helpful error 1`] = `\n[DetoxConfigError: The \"legacy\" configuration utilizes a deprecated all-in-one schema, that is not supported by the current version of Detox.\n\nHINT: Remove the \"type\" property. A valid configuration is expected to have both the \"device\" and \"app\" aliases pointing to the corresponding keys in the 'devices' and 'apps' config sections. For example:\n\n{\n  \"apps\": {\n*-->\"myApp.ios\": {\n|     \"type\": \"ios.app\",\n|     \"binaryPath\": \"/some/path\",\n|   },\n| },\n| \"devices\": {\n|*->\"simulator\": {\n||    \"type\": \"ios.simulator\",\n||    \"device\": \"iPhone 12\"\n||  },\n||},\n||\"configurations\": {\n||  \"legacy\": {\n||    /* REMOVE (!) \"type\": \"ios.simulator\" */\n|*--- \"device\": \"simulator\",\n*---- \"app\": \"myApp.ios\",\n      ...\n    }\n  }\n}\nExamine your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  apps: undefined,\n  devices: undefined,\n  configurations: {\n    legacy: {\n      type: 'ios.simulator',\n      device: 'iPhone 12',\n      binaryPath: '/some/path'\n    }\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .failedToReadConfiguration should create a generic error, if I/O error is unknown 1`] = `\n[DetoxConfigError: An error occurred while trying to load Detox config from:\n/home/detox/myproject/.detoxrc.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .failedToReadConfiguration should create a simple error, but with the original intercepted IO error 1`] = `\n[DetoxConfigError: An error occurred while trying to load Detox config from:\n/home/detox/myproject/.detoxrc.json\n\nError: EISDIR: illegal operation on a directory, read]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationAtGivenPath should create an error with the attempted \"extends\" path 1`] = `\n[DetoxConfigError: Failed to find the base Detox config specified in:\n{\n  \"extends\": \"some-detox-preset\"\n}\n\nHINT: Check your Detox config at path:\npackage.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationAtGivenPath should create an error with the attempted config path 1`] = `\n[DetoxConfigError: Failed to find Detox config at \"./some/detox-config.js\"\n\nHINT: Make sure the specified path is correct.]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationSpecified should create error 1, if the configuration file is not package.json 1`] = `\n[DetoxConfigError: Cannot run Detox without a configuration file.\n\nHINT: Make sure to create external .detoxrc.json configuration in the working directory before you run Detox.]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationSpecified should create error 2, if the configuration file is package.json 1`] = `\n[DetoxConfigError: Cannot run Detox without a configuration file.\n\nHINT: Create an external .detoxrc.json configuration, or add \"detox\" configuration section to your package.json at:\n/home/detox/myproject/package.json]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationWithGivenName should create an error with configuration suggestions 1`] = `\n[DetoxConfigError: Failed to find a configuration named \"otherConf\" in Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: Below are the configurations Detox was able to find:\n* aliased\n* inlined\n* inlinedMulti]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationsInside should create a generic error if all is unknown 1`] = `\n[DetoxConfigError: There are no configurations in the given Detox config.\n\nHINT: Examine the config:\n\n{}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationsInside should create an error with Detox config fragment, if the path is not known 1`] = `\n[DetoxConfigError: There are no configurations in the given Detox config.\n\nHINT: Examine the config:\n\n{\n  configurations: {},\n  devices: {\n    aDevice: [Object]\n  },\n  apps: {\n    someApp: [Object]\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from configuration/index) .noConfigurationsInside should create an error with Detox config location hint, if it is known 1`] = `\n[DetoxConfigError: There are no configurations in the given Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\nHINT: Examine the config:\n\n{\n  configurations: {},\n  devices: {\n    aDevice: [Object]\n  },\n  apps: {\n    someApp: [Object]\n  }\n}]\n`;\n\nexports[`DetoxConfigErrorComposer (from local-cli/build) should create a generic error, if the config location is not known 1`] = `\n[DetoxConfigError: Failed to build the app for the configuration \"aliased\", because there was no \"build\" script inside.\nCheck contents of your Detox config at path:\n/home/detox/myproject/.detoxrc.json\n\n{\n  build: undefined,\n  type: 'ios.app',\n  binaryPath: 'path/to/app'\n}]\n`;\n"
  },
  {
    "path": "detox/src/errors/__snapshots__/DetoxInternalError.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxInternalError .from(message) should wrap the error message  1`] = `\n\"DetoxInternalError: Should do better\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxInternalError should append a Report-Issue hint 1`] = `\n\"Should do better\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n"
  },
  {
    "path": "detox/src/errors/__snapshots__/DetoxRuntimeError.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxRuntimeError should be created with empty object 1`] = `[DetoxRuntimeError]`;\n\nexports[`DetoxRuntimeError should be created with message with \"Command failed\" error 1`] = `\n[DetoxRuntimeError: Cannot run Detox due to an internal error\n\nCommand failed: jest runMyTests]\n`;\n\nexports[`DetoxRuntimeError should be created with message with debug info 1`] = `\n[DetoxRuntimeError: no filename was given to constructSafeFilename()\n\nthe arguments were: {\n  \"prefix\": \"detox - \"\n}]\n`;\n\nexports[`DetoxRuntimeError should be created with message with debug info object 1`] = `\n[DetoxRuntimeError: no filename was given to constructSafeFilename()\n\n{\n  prefix: 'detox - ',\n  trimmable: undefined,\n  suffix: undefined\n}]\n`;\n\nexports[`DetoxRuntimeError should be created with message with hint 1`] = `\n[DetoxRuntimeError: Detox adapter to Jest is malfunctioning.\n\nHINT: Make sure you register it as Jasmine reporter inside init.js:\n-------------------------------------------------------------\njasmine.getEnv().addReporter(adapter);]\n`;\n\nexports[`DetoxRuntimeError should be created with message with hint and debug info 1`] = `\n[DetoxRuntimeError: Invalid test summary was passed to detox.beforeEach(testSummary)\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }\n\nHINT: Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?\nSee the article for the guidance: https://wix.github.io/Detox/docs/api/test-lifecycle\n\ntestSummary was: \"test name\"]\n`;\n\nexports[`DetoxRuntimeError should be created with message with no stack 1`] = `[DetoxRuntimeError: Test message without a stack]`;\n\nexports[`DetoxRuntimeError should be created with no args 1`] = `[DetoxRuntimeError]`;\n\nexports[`DetoxRuntimeError should be created with only message 1`] = `[DetoxRuntimeError: The video is not being recorded on device (emulator-5554) at path: /sdcard/712398.mp4]`;\n\nexports[`DetoxRuntimeError should be created with plain string 1`] = `[DetoxRuntimeError: A plain message]`;\n"
  },
  {
    "path": "detox/src/errors/__snapshots__/DetoxRuntimeErrorComposer.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxRuntimeErrorComposer abortedDetoxInit 1`] = `\n[DetoxRuntimeError: Aborted detox.init() execution, and now running detox.cleanup()\n\nHINT: Most likely, your test runner is tearing down the suite due to the timeout error]\n`;\n\nexports[`DetoxRuntimeErrorComposer cantFindApp - multiple apps 1`] = `\n[DetoxRuntimeError: Can't find an app config with name \"steak\".\n\nHINT: Maybe you meant one of these app names?\n* fish\n* chips\n* hummus\n* beer]\n`;\n\nexports[`DetoxRuntimeErrorComposer cantFindApp - single app 1`] = `\n[DetoxRuntimeError: Can't find an app config with name \"unicorn\".\n\nHINT: Actually, you don't have multiple apps defined in your config.\nHence, either you don't need to call device.selectApp(\"unicorn\") at all,\nor, your apps config is missing that app. See the actual contents:\n\n{\n  default: {\n    type: 'ios.app',\n    binaryPath: 'path/to/app'\n  }\n}]\n`;\n\nexports[`DetoxRuntimeErrorComposer invalidTestSummary - afterEach 1`] = `\n[DetoxRuntimeError: Invalid test summary was passed to detox.afterEach(testSummary)\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }\n\nHINT: Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?\nSee the article for the guidance: https://wix.github.io/Detox/docs/api/test-lifecycle\ntestSummary was: \n\n{\n  weird: [Array]\n}]\n`;\n\nexports[`DetoxRuntimeErrorComposer invalidTestSummary - afterEach 2`] = `\n[DetoxRuntimeError: Invalid test summary was passed to detox.afterEach(testSummary)\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }\n\nHINT: Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?\nSee the article for the guidance: https://wix.github.io/Detox/docs/api/test-lifecycle\ntestSummary was: \n\n{\n  title: 'foo test',\n  fullName: 'suite foo test',\n  status: 'uncertain'\n}]\n`;\n\nexports[`DetoxRuntimeErrorComposer invalidTestSummary - beforeEach 1`] = `\n[DetoxRuntimeError: Invalid test summary was passed to detox.beforeEach(testSummary)\nExpected to get an object of type: { title: string; fullName: string; status: \"running\" | \"passed\" | \"failed\"; }\n\nHINT: Maybe you are still using an old undocumented signature detox.beforeEach(string, string, string) in init.js ?\nSee the article for the guidance: https://wix.github.io/Detox/docs/api/test-lifecycle\ntestSummary was: \n\ndeviceName]\n`;\n\nexports[`DetoxRuntimeErrorComposer invalidTestSummaryStatus - afterEach 1`] = `\n[DetoxRuntimeError: Invalid test summary status was passed to detox.afterEach(testSummary). Valid values are: \"running\", \"passed\", \"failed\"\n\nHINT: It seems like you've hit a Detox integration issue with a test runner. You are encouraged to report it in Detox issues on GitHub.\ntestSummary was: \n\n{\n  summary: 'invalid stuff'\n}]\n`;\n"
  },
  {
    "path": "detox/src/errors/index.js",
    "content": "const DetoxConfigError = require('./DetoxConfigError');\nconst DetoxConfigErrorComposer = require('./DetoxConfigErrorComposer');\nconst DetoxError = require('./DetoxError');\nconst DetoxInternalError = require('./DetoxInternalError');\nconst DetoxRuntimeError = require('./DetoxRuntimeError');\nconst DetoxRuntimeErrorComposer = require('./DetoxRuntimeErrorComposer');\n\nmodule.exports = {\n  DetoxError,\n  DetoxConfigError,\n  DetoxConfigErrorComposer,\n  DetoxInternalError,\n  DetoxRuntimeError,\n  DetoxRuntimeErrorComposer,\n};\n"
  },
  {
    "path": "detox/src/errors/longreads/__snapshots__/failedToReachTheApp.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`failedToReachTheApp .evenThoughAppWasLaunched() 1`] = `\n[DetoxRuntimeError: Detox can't seem to connect to the test app(s)!\n\nHINT: \n\nThe test app might have crashed prematurely, or has had trouble setting up the connection.\nRefer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs \n]\n`;\n\nexports[`failedToReachTheApp .maybeAppWasNotLaunched(action) 1`] = `\n[DetoxRuntimeError: Detox can't seem to connect to the test app(s)!\n\nHINT: \n\nHave you forgotten to call 'device.launchApp()' in the beginning of your test?\nRefer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs\n\n---\nThe following package could not be delivered:\n\n{\n  type: 'isReady',\n  messageId: -1000\n}]\n`;\n"
  },
  {
    "path": "detox/src/errors/longreads/failedToReachTheApp.js",
    "content": "const DetoxRuntimeError = require('../DetoxRuntimeError');\n\nconst message = 'Detox can\\'t seem to connect to the test app(s)!';\nconst troubleshootingRefMessage = 'Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs';\n\nconst hintMaybeNotLaunched = `\\\nHave you forgotten to call 'device.launchApp()' in the beginning of your test?\n${troubleshootingRefMessage}\\\n`;\n\nconst hintAppWasLaunched = `The test app might have crashed prematurely, or has had trouble setting up the connection.\n${troubleshootingRefMessage} \n`;\n\nconst payloadAppendix = `---\nThe following package could not be delivered:\\\n`;\n\nconst reformatSection = (s) => '\\n\\n' + s;\n\nfunction maybeAppWasNotLaunched(action) {\n  return new DetoxRuntimeError({\n    message,\n    hint: [hintMaybeNotLaunched, payloadAppendix].map(reformatSection).join(''),\n    debugInfo: action,\n  });\n}\n\nfunction evenThoughAppWasLaunched() {\n  return new DetoxRuntimeError({\n    message,\n    hint: reformatSection(hintAppWasLaunched),\n  });\n}\n\nmodule.exports = {\n  maybeAppWasNotLaunched,\n  evenThoughAppWasLaunched,\n};\n"
  },
  {
    "path": "detox/src/errors/longreads/failedToReachTheApp.test.js",
    "content": "const failedToReachTheApp = require('./failedToReachTheApp');\n\ndescribe('failedToReachTheApp', () => {\n  test('.evenThoughAppWasLaunched()', () => {\n    expect(failedToReachTheApp.evenThoughAppWasLaunched()).toMatchSnapshot();\n  });\n\n  test('.maybeAppWasNotLaunched(action)', () => {\n    expect(failedToReachTheApp.maybeAppWasNotLaunched({\n      type: 'isReady',\n      messageId: -1000\n    })).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "detox/src/invoke/Espresso.js",
    "content": "const target = {\n  type: 'Class',\n  value: 'androidx.test.espresso.Espresso'\n};\n\nmodule.exports = {\n  target\n};\n"
  },
  {
    "path": "detox/src/invoke/EspressoWeb.js",
    "content": "const target = {\n  type: 'Class',\n  value: 'androidx.test.espresso.web.sugar.Web'\n};\n\nmodule.exports = {\n  target\n};\n"
  },
  {
    "path": "detox/src/invoke/Invoke.js",
    "content": "function call(target, method, ...args) {\n  return function() {\n    if (typeof target === 'function') {\n      target = {\n        type: 'Invocation',\n        value: target()\n      };\n    }\n    for (let i = 0; i < args.length; i++) {\n      if (typeof args[i] === 'function') {\n        args[i] = {\n          type: 'Invocation',\n          value: args[i]()\n        };\n      }\n    }\n    return {\n      target: target,\n      method: method,\n      args: args\n    };\n  };\n}\n\nfunction callDirectly(json) {\n  return {\n    type: 'Invocation',\n    value: json\n  };\n}\n\nconst genericInvokeObject = new Proxy({},\n  {\n    get: (target, prop) => {\n      return (p) => {\n        return {\n          type: prop,\n          value: p\n        };\n      };\n    }\n  });\n\nmodule.exports = {\n  call,\n  callDirectly,\n  genericInvokeObject\n};\n"
  },
  {
    "path": "detox/src/invoke/Invoke.test.js",
    "content": "const { call } = require('./Invoke');\n\ndescribe('call', () => {\n  it('handles target as thunk', () => {\n    expect(call(() =>  'fn', 'method')()).toEqual({\n      target: { type: 'Invocation', value: 'fn' },\n      method: 'method',\n      args: []\n    });\n  });\n\n  it('handles arguments as thunk', () => {\n    expect(call('fn', 'method', 'no-thunk', () => 'a-thunk')()).toEqual({\n      target: 'fn',\n      method: 'method',\n      args: ['no-thunk', { type: 'Invocation', value: 'a-thunk' }]\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/invoke.js",
    "content": "const Espresso = require('./invoke/Espresso');\nconst EspressoWeb = require('./invoke/EspressoWeb');\nconst Invoke = require('./invoke/Invoke');\n\nclass InvocationManager {\n  constructor(excutionHandler) {\n    this.executionHandler = excutionHandler;\n  }\n\n  async execute(invocation) {\n   return await this.executionHandler.execute(invocation);\n  }\n}\n\nmodule.exports = {\n  InvocationManager,\n  Espresso: Espresso.target,\n  EspressoWeb: EspressoWeb.target,\n  IOS: Invoke.genericInvokeObject,\n  Android: Invoke.genericInvokeObject,\n  call: Invoke.call,\n  callDirectly: Invoke.callDirectly\n};\n"
  },
  {
    "path": "detox/src/invoke.test.js",
    "content": "// @ts-nocheck\nconst invoke = require('./invoke');\n\ndescribe('invoke', () => {\n  let Client;\n\n  beforeEach(() => {\n    jest.mock('./client/Client');\n    jest.mock('./invoke/Invoke');\n    Client = require('./client/Client');\n  });\n\n  it(`execute() should trigger executionHandler.execute()`, () => {\n    const invocationManager = new invoke.InvocationManager(new Client(''));\n    invocationManager.execute();\n    expect(invocationManager.executionHandler.execute).toHaveBeenCalled();\n  });\n\n  it(`execute should return execution result`, async () => {\n    const client = new Client('');\n    const someResult = 'some_result';\n    client.execute.mockReturnValue(someResult);\n    const invocationManager = new invoke.InvocationManager(client);\n    const result = await invocationManager.execute();\n    expect(result).toEqual(someResult);\n  });\n\n  it(`invoke.IOS.{anything} will create an instance of {generic} invoke object`, () => {\n    expect(invoke.IOS.CGPoint({ x: 2, y: 1 })).toEqual({ type: 'CGPoint', value: { x: 2, y: 1 } });\n    expect(invoke.IOS.CGRect({ x: 12, y: 11 })).toEqual({ type: 'CGRect', value: { x: 12, y: 11 } });\n    expect(invoke.IOS.Anything(1)).toEqual({ type: 'Anything', value: 1 });\n  });\n});\n"
  },
  {
    "path": "detox/src/ios/XCUITestRunner.js",
    "content": "const DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst { execAsync } = require('../utils/childProcess');\nconst environment = require('../utils/environment');\nconst log = require('../utils/logger').child({ cat: 'xcuitest-runner' });\n\nclass XCUITestRunner {\n    constructor({ runtimeDevice }) {\n        this.runtimeDevice = runtimeDevice;\n    }\n\n    async execute(invocationParams) {\n        log.trace(\n          { event: 'XCUITEST_RUNNER' },\n          'invocation params: %j, simulator id: %s, bundle id: %s', invocationParams, this.runtimeDevice.id, this.runtimeDevice._bundleId\n        );\n\n        const base64InvocationParams = Buffer.from(JSON.stringify(invocationParams)).toString('base64');\n\n        const runnerPath = await environment.getXCUITestRunnerPath();\n        if (!runnerPath) {\n            throw new DetoxRuntimeError({\n                message: 'XCUITest runner path could not be found',\n                hint: DetoxRuntimeError.reportIssue,\n            });\n        }\n\n        const flags = [\n            '-xctestrun', runnerPath,\n            '-sdk', 'iphonesimulator',\n            '-destination', `\"platform=iOS Simulator,id=${this.runtimeDevice.id}\"`,\n            'test-without-building',\n        ];\n\n        log.info(`Running XUICTest runner. See target logs using:\\n` +\n          `\\t/usr/bin/xcrun simctl spawn ${this.runtimeDevice.id} log stream --level debug --style compact ` +\n          `--predicate 'process == \"DetoxXCUITestRunner-Runner\" && subsystem == \"com.wix.DetoxXCUITestRunner.xctrunner\"'`);\n\n        try {\n            return await execAsync(`TEST_RUNNER_PARAMS=\"${base64InvocationParams}\" TEST_RUNNER_BUNDLE_ID=\"${this.runtimeDevice._bundleId}\" xcodebuild ${flags.join(' ')}`);\n        } catch (e) {\n            const stdout = e.stdout.toString();\n            const innerError = this.findInnerError(stdout);\n            throw new DetoxRuntimeError(innerError);\n        }\n    }\n\n    findInnerError(stdout) {\n        const match = stdout.match(/DTXError: .*/);\n        return match ?\n            match[0].split('DTXError: ')[1] :\n            `XCUITest runner failed with no error message. Runner stdout: ${stdout}`;\n    }\n}\n\nmodule.exports = XCUITestRunner;\n"
  },
  {
    "path": "detox/src/ios/XCUITestRunner.test.js",
    "content": "const XCUITestRunner = require('./XCUITestRunner');\n\njest.mock('promisify-child-process', () => {\n    return {\n        exec: jest.fn(),\n    };\n});\n\nconst { exec } = jest.requireMock('promisify-child-process');\nconst environment = jest.requireMock('../utils/environment');\n\njest.mock('../utils/environment');\n\ndescribe('XCUITestRunner', () => {\n    const runtimeDevice = { id: 'simulator-id', _bundleId: 'bundle-id' };\n    const runner = new XCUITestRunner({ runtimeDevice });\n    const invocationParams = { key: 'value' };\n    const base64InvocationParams = Buffer.from(JSON.stringify(invocationParams)).toString('base64');\n    const runnerPath = '/path/to/xcuitest-runner';\n\n    beforeEach(() => {\n        environment.getXCUITestRunnerPath.mockResolvedValue(runnerPath);\n        exec.mockClear();\n    });\n\n    it('should execute XCUITest runner with given invocation params', async () => {\n        const command = `TEST_RUNNER_PARAMS=\"${base64InvocationParams}\" TEST_RUNNER_BUNDLE_ID=\"${runtimeDevice._bundleId}\" xcodebuild -xctestrun ${runnerPath} -sdk iphonesimulator -destination \"platform=iOS Simulator,id=${runtimeDevice.id}\" test-without-building`;\n        exec.mockResolvedValue({ stdout: 'success' });\n\n        await runner.execute(invocationParams);\n\n        expect(exec).toHaveBeenCalledWith(command);\n    });\n\n    it('should throw error when runner path is not found', async () => {\n        environment.getXCUITestRunnerPath.mockResolvedValue(null);\n\n        await expect(runner.execute(invocationParams)).rejects.toThrow(/XCUITest runner path could not be found/);\n    });\n\n    it('should handle execution errors and throw error with an extracted inner error', async () => {\n        const errorOutput = 'DTXError: Test failure';\n        exec.mockRejectedValue({ stdout: Buffer.from(errorOutput) });\n\n        await expect(runner.execute(invocationParams)).rejects.toThrow(/Test failure/);\n    });\n\n    it('should handle execution errors with no specific error message', async () => {\n        const errorOutput = 'Unknown error occurred';\n        exec.mockRejectedValue({ stdout: Buffer.from(errorOutput) });\n\n        await expect(runner.execute(invocationParams)).rejects\n        .toThrow(/XCUITest runner failed with no error message. Runner stdout: Unknown error occurred/);\n    });\n});\n"
  },
  {
    "path": "detox/src/ios/expectTwo.js",
    "content": "// @ts-nocheck\nconst path = require('path');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst semanticTypes = require('../matchers/semanticTypes');\nconst { assertTraceDescription, assertEnum, assertNormalized } = require('../utils/assertArgument');\nconst { removeMilliseconds } = require('../utils/dateUtils');\nconst { actionDescription, expectDescription } = require('../utils/invocationTraceDescriptions');\nconst { isRegExp } = require('../utils/isRegExp');\nconst log = require('../utils/logger').child({ cat: 'ws-client, ws' });\nconst mapLongPressArguments = require('../utils/mapLongPressArguments');\nconst tempfile = require('../utils/tempfile');\nconst traceInvocationCall = require('../utils/traceInvocationCall').bind(null, log);\n\nconst { systemElement, systemMatcher, systemExpect, isSystemElement } = require('./system');\nconst { webElement, webMatcher, webExpect, isWebElement } = require('./web');\n\nconst createTypePredicate = (className) => ({ type: 'type', value: className });\nconst createOrPredicate = (predicates) => ({ type: 'or', predicates });\nconst createExclusionPredicate = (className, excludes) => ({\n  type: 'and',\n  predicates: [\n    createTypePredicate(className),\n    {\n      type: 'not',\n      predicate: createOrPredicate(excludes.map(createTypePredicate))\n    }\n  ]\n});\n\nconst assertDirection = assertEnum(['left', 'right', 'up', 'down']);\nconst assertSpeed = assertEnum(['fast', 'slow']);\n\nclass Expect {\n  constructor(invocationManager, element) {\n    this._invocationManager = invocationManager;\n    this.element = element;\n    this.modifiers = [];\n  }\n\n  get not() {\n    this.modifiers.push('not');\n    return this;\n  }\n\n  toBeVisible(percent) {\n    if (percent !== undefined && (!Number.isSafeInteger(percent) || percent < 1 || percent > 100)) {\n      throw new Error('`percent` must be an integer between 1 and 100, but got '\n        + (percent + (' (' + (typeof percent + ')'))));\n    }\n\n    const traceDescription = expectDescription.toBeVisible(percent);\n    return this.expect('toBeVisible', traceDescription, percent);\n  }\n\n  toBeNotVisible() {\n    return this.not.toBeVisible();\n  }\n\n  toBeFocused() {\n    const traceDescription = expectDescription.toBeFocused();\n    return this.expect('toBeFocused', traceDescription);\n  }\n\n  toBeNotFocused() {\n    return this.not.toBeFocused();\n  }\n\n  toExist() {\n    const traceDescription = expectDescription.toExist();\n    return this.expect('toExist', traceDescription);\n  }\n\n  toNotExist() {\n    return this.not.toExist();\n  }\n\n  toHaveText(text) {\n    const traceDescription = expectDescription.toHaveText(text);\n    return this.expect('toHaveText', traceDescription, text);\n  }\n\n  toNotHaveText(text) {\n    return this.not.toHaveText(text);\n  }\n\n  toHaveLabel(label) {\n    const traceDescription = expectDescription.toHaveLabel(label);\n    return this.expect('toHaveLabel', traceDescription, label);\n  }\n\n  toNotHaveLabel(label) {\n    return this.not.toHaveLabel(label);\n  }\n\n  toHaveId(id) {\n    const traceDescription = expectDescription.toHaveId(id);\n    return this.expect('toHaveId', traceDescription, id);\n  }\n\n  toNotHaveId(id) {\n    return this.not.toHaveId(id);\n  }\n\n  toHaveValue(value) {\n    const traceDescription = expectDescription.toHaveValue(value);\n    return this.expect('toHaveValue', traceDescription, value);\n  }\n\n  toNotHaveValue(value) {\n    return this.not.toHaveValue(value);\n  }\n\n  toHaveSliderPosition(position, tolerance = 0) {\n    const traceDescription = expectDescription.toHaveSliderPosition(position, tolerance);\n    return this.expect('toHaveSliderPosition', traceDescription, position, tolerance);\n  }\n\n  toHaveToggleValue(value) {\n    const expectedValue = Number(value);\n    const traceDescription = expectDescription.toHaveToggleValue(expectedValue);\n    return this.expect('toHaveToggleValue', traceDescription, expectedValue);\n  }\n\n  createInvocation(expectation, ...params) {\n    const definedParams = _.without(params, undefined);\n    return {\n      type: 'expectation',\n      predicate: this.element.matcher.predicate,\n      ...(this.element.index !== undefined && { atIndex: this.element.index }),\n      ...(this.modifiers.length !== 0 && { modifiers: this.modifiers }),\n      expectation,\n      ...(definedParams.length !== 0 && { params: definedParams })\n    };\n  }\n\n  expect(expectation, traceDescription, ...params) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = this.createInvocation(expectation, ...params);\n    traceDescription = expectDescription.full(traceDescription, this.modifiers.includes('not'));\n    return _executeInvocation(this._invocationManager, invocation, traceDescription);\n  }\n}\n\nclass InternalExpect extends Expect {\n  expect(expectation, _traceDescription, ...params) {\n    return this.createInvocation(expectation, ...params);\n  }\n}\n\nclass Element {\n  constructor(invocationManager, emitter, matcher, index) {\n    this._invocationManager = invocationManager;\n    this._emitter = emitter;\n    this.matcher = matcher;\n    this.index = index;\n  }\n\n  atIndex(index) {\n    if (typeof index !== 'number') throw new Error(`atIndex argument must be a number, got ${typeof index}`);\n    this.index = index;\n    return this;\n  }\n\n  getAttributes() {\n    const traceDescription = actionDescription.getAttributes();\n    return this.withAction('getAttributes', traceDescription);\n  }\n\n  tap(point) {\n    _assertValidPoint(point);\n\n    const traceDescription = actionDescription.tapAtPoint(point);\n    return this.withAction('tap', traceDescription, point);\n  }\n\n  longPress(arg1, arg2) {\n    let { point, duration } = mapLongPressArguments(arg1, arg2);\n\n    const traceDescription = actionDescription.longPress(point, duration);\n    return this.withAction('longPress', traceDescription, point, duration);\n  }\n\n  longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement,\n                   normalizedTargetPositionX = NaN, normalizedTargetPositionY = NaN, speed = 'fast', holdDuration = 1000) {\n    if (typeof duration !== 'number') throw new Error('duration should be a number, but got ' + (duration + (' (' + (typeof duration + ')'))));\n\n    if (!(targetElement instanceof Element)) throwElementError(targetElement);\n\n    if (typeof holdDuration !== 'number') throw new Error('duration should be a number, but got ' + (holdDuration + (' (' + (typeof holdDuration + ')'))));\n\n    assertSpeed({ speed });\n    assertNormalized({ normalizedPositionX });\n    assertNormalized({ normalizedPositionY });\n    assertNormalized({ normalizedTargetPositionX });\n    assertNormalized({ normalizedTargetPositionY });\n\n    const traceDescription = actionDescription.longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement,\n      normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration);\n    return this.withActionAndTargetElement('longPress', targetElement, traceDescription, duration, normalizedPositionX, normalizedPositionY,\n      normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration);\n  }\n\n  multiTap(times) {\n    if (typeof times !== 'number') throw new Error('times should be a number, but got ' + (times + (' (' + (typeof times + ')'))));\n    if (times < 1) throw new Error('times should be greater than 0, but got ' + times);\n\n    const traceDescription = actionDescription.multiTap(times);\n    return this.withAction('multiTap', traceDescription, times);\n  }\n\n  tapAtPoint(point) {\n    return this.tap(point);\n  }\n\n  tapBackspaceKey() {\n    const traceDescription = actionDescription.tapBackspaceKey();\n    return this.withAction('tapBackspaceKey', traceDescription);\n  }\n\n  tapReturnKey() {\n    const traceDescription = actionDescription.tapReturnKey();\n    return this.withAction('tapReturnKey', traceDescription);\n  }\n\n  typeText(text) {\n    if (typeof text !== 'string') throw new Error('text should be a string, but got ' + (text + (' (' + (typeof text + ')'))));\n\n    const traceDescription = actionDescription.typeText(text);\n    return this.withAction('typeText', traceDescription, text);\n  }\n\n  replaceText(text) {\n    if (typeof text !== 'string') throw new Error('text should be a string, but got ' + (text + (' (' + (typeof text + ')'))));\n\n    const traceDescription = actionDescription.replaceText(text);\n    return this.withAction('replaceText', traceDescription, text);\n  }\n\n  clearText() {\n    const traceDescription = actionDescription.clearText();\n    return this.withAction('clearText', traceDescription);\n  }\n\n  performAccessibilityAction(actionName) {\n    if (typeof actionName !== 'string') throw new Error('actionName should be a string, but got ' + (actionName + (' (' + (typeof actionName + ')'))));\n\n    const traceDescription = actionDescription.performAccessibilityAction(actionName);\n    return this.withAction('accessibilityAction', traceDescription, actionName);\n  }\n\n  scroll(pixels, direction = 'down', startPositionX = NaN, startPositionY = NaN) {\n    if (!['left', 'right', 'up', 'down'].some(option => option === direction)) throw new Error('direction should be one of [left, right, up, down], but got ' + direction);\n    if (typeof pixels !== 'number') throw new Error('amount of pixels should be a number, but got ' + (pixels + (' (' + (typeof pixels + ')'))));\n    if (typeof startPositionX !== 'number') throw new Error('startPositionX should be a number, but got ' + (startPositionX + (' (' + (typeof startPositionX + ')'))));\n    if (typeof startPositionY !== 'number') throw new Error('startPositionY should be a number, but got ' + (startPositionY + (' (' + (typeof startPositionY + ')'))));\n\n    const traceDescription = actionDescription.scroll(pixels, direction, startPositionX, startPositionY);\n    return this.withAction('scroll', traceDescription, pixels, direction, startPositionX, startPositionY);\n  }\n\n  scrollTo(edge, startPositionX = NaN, startPositionY = NaN) {\n    if (!['left', 'right', 'top', 'bottom'].some(option => option === edge)) throw new Error('edge should be one of [left, right, top, bottom], but got ' + edge);\n    if (typeof startPositionX !== 'number') throw new Error('startPositionX should be a number, but got ' + (startPositionX + (' (' + (typeof startPositionX + ')'))));\n    if (typeof startPositionY !== 'number') throw new Error('startPositionY should be a number, but got ' + (startPositionY + (' (' + (typeof startPositionY + ')'))));\n\n    const traceDescription = actionDescription.scrollTo(edge, startPositionX, startPositionY);\n    return this.withAction('scrollTo', traceDescription, edge, startPositionX, startPositionY);\n  }\n\n  swipe(direction, speed = 'fast', normalizedSwipeOffset = NaN, normalizedStartingPointX = NaN, normalizedStartingPointY = NaN) {\n    assertDirection({ direction });\n    assertSpeed({ speed });\n    assertNormalized({ normalizedSwipeOffset });\n    assertNormalized({ normalizedStartingPointX });\n    assertNormalized({ normalizedStartingPointY });\n\n    normalizedSwipeOffset = Number.isNaN(normalizedSwipeOffset) ? 0.75 : normalizedSwipeOffset;\n    const traceDescription = actionDescription.swipe(direction, speed, normalizedSwipeOffset, normalizedStartingPointX, normalizedStartingPointY);\n    return this.withAction(\n      'swipe',\n      traceDescription,\n      direction,\n      speed,\n      normalizedSwipeOffset,\n      normalizedStartingPointX,\n      normalizedStartingPointY\n    );\n  }\n\n  setColumnToValue(column, value) {\n    if (typeof column !== 'number') throw new Error('column should be a number, but got ' + (column + (' (' + (typeof column + ')'))));\n    if (typeof value !== 'string') throw new Error('value should be a string, but got ' + (value + (' (' + (typeof value + ')'))));\n\n    const traceDescription = actionDescription.setColumnToValue(column, value);\n    return this.withAction('setColumnToValue', traceDescription, column, value);\n  }\n\n  setDatePickerDate(dateString, dateFormat) {\n    if (typeof dateString !== 'string') throw new Error('dateString should be a string, but got ' + (dateString + (' (' + (typeof dateString + ')'))));\n    if (typeof dateFormat !== 'string') throw new Error('dateFormat should be a string, but got ' + (dateFormat + (' (' + (typeof dateFormat + ')'))));\n    if (dateFormat === 'ISO8601') {\n      dateString = removeMilliseconds(dateString);\n    }\n\n    const traceDescription = actionDescription.setDatePickerDate(dateString, dateFormat);\n    return this.withAction('setDatePickerDate', traceDescription, dateString, dateFormat);\n  }\n\n  pinch(scale, speed = 'fast', angle = 0) {\n    if (typeof scale !== 'number' || !Number.isFinite(scale) || scale < 0) throw new Error(`pinch scale must be a finite number larger than zero`);\n    if (!['slow', 'fast'].includes(speed)) throw new Error(`pinch speed is either 'slow' or 'fast'`);\n    if (typeof angle !== 'number' || !Number.isFinite(angle)) throw new Error(`pinch angle must be a finite number (radian)`);\n\n    const traceDescription = actionDescription.pinch(scale, speed, angle);\n    return this.withAction('pinch', traceDescription, scale, speed, angle);\n  }\n\n  pinchWithAngle(direction, speed = 'slow', angle = 0) {\n    if (!['inward', 'outward'].includes(direction)) throw new Error(`pinchWithAngle direction is either 'inward' or 'outward'`);\n    if (!['slow', 'fast'].includes(speed)) throw new Error(`pinchWithAngle speed is either 'slow' or 'fast'`);\n    if (typeof angle !== 'number') throw new Error(`pinchWithAngle angle must be a number (radiant), got ${typeof angle}`);\n\n    const traceDescription = actionDescription.pinchWithAngle(direction, speed, angle);\n    return this.withAction('pinchWithAngle', traceDescription, direction, speed, angle);\n  }\n\n  adjustSliderToPosition(position) {\n    if (!(typeof position === 'number' && position >= 0 && position <= 1)) throw new Error('position should be a number [0.0, 1.0], but got ' + (position + (' (' + (typeof position + ')'))));\n\n    const traceDescription = actionDescription.adjustSliderToPosition(position);\n    return this.withAction('adjustSliderToPosition', traceDescription, position);\n  }\n\n  async takeScreenshot(fileName) {\n    const traceDescription = actionDescription.takeScreenshot(fileName);\n    const { screenshotPath } = await this.withAction('takeScreenshot', traceDescription, fileName);\n\n    const filePath = tempfile('.detox.element-screenshot.png');\n    await fs.move(screenshotPath, filePath);\n    await this._emitter.emit('createExternalArtifact', {\n      pluginId: 'screenshot',\n      artifactName: fileName || path.basename(filePath, '.png'),\n      artifactPath: filePath,\n    });\n\n    return filePath;\n  }\n\n  createInvocation(action, targetElementMatcher, ...params) {\n    params = _.map(params, (param) => _.isNaN(param) ? null : param);\n\n    const definedParams = _.without(params, undefined);\n    const invocation = {\n      type: 'action',\n      action,\n      ...(this.index !== undefined && { atIndex: this.index }),\n      ...(definedParams.length !== 0 && { params: definedParams }),\n      predicate: this.matcher.predicate\n    };\n\n    if (targetElementMatcher && targetElementMatcher.matcher && targetElementMatcher.matcher.predicate) {\n      invocation.targetElement = {\n        predicate: targetElementMatcher.matcher.predicate\n      };\n    }\n\n    return invocation;\n  }\n\n  withAction(action, traceDescription, ...params) {\n    const invocation = this.createInvocation(action, null, ...params);\n    return _executeInvocation(this._invocationManager, invocation, traceDescription);\n  }\n\n  withActionAndTargetElement(action, targetElement, traceDescription, ...params) {\n    const invocation = this.createInvocation(action, targetElement, ...params);\n    return _executeInvocation(this._invocationManager, invocation, traceDescription);\n  }\n}\n\nclass InternalElement extends Element {\n  withAction(action, _traceDescription, ...params) {\n    return this.createInvocation(action, null, ...params);\n  }\n}\n\nclass By {\n  get web() {\n    return webMatcher();\n  }\n\n  get system() {\n    return systemMatcher();\n  }\n\n  id(id) {\n    return new Matcher().id(id);\n  }\n\n  type(type) {\n    return new Matcher().type(type);\n  }\n\n  text(text) {\n    return new Matcher().text(text);\n  }\n\n  label(label) {\n    return new Matcher().label(label);\n  }\n\n  accessibilityLabel(label) {\n    return new Matcher().accessibilityLabel(label);\n  }\n\n  traits(traits) {\n    return new Matcher().traits(traits);\n  }\n\n  value(value) {\n    return new Matcher().value(value);\n  }\n}\n\nclass Matcher {\n  /** @private */\n  static *predicates(matcher) {\n    if (matcher.predicate.type === 'and') {\n      yield* matcher.predicate.predicates;\n    } else {\n      yield matcher.predicate;\n    }\n  }\n\n  accessibilityLabel(label) {\n    return this.label(label);\n  }\n\n  label(label) {\n    if (typeof label !== 'string' && !isRegExp(label)) throw new Error('label should be a string or regex, but got ' + (label + (' (' + (typeof label + ')'))));\n    this.predicate = { type: 'label', value: label.toString(), isRegex: isRegExp(label) };\n    return this;\n  }\n\n  id(id) {\n    if (typeof id !== 'string' && !isRegExp(id)) throw new Error('id should be a string or regex, but got ' + (id + (' (' + (typeof id + ')'))));\n    this.predicate = { type: 'id', value: id.toString(), isRegex: isRegExp(id) };\n    return this;\n  }\n\n    type(typeOrSemanticType) {\n    if (typeof typeOrSemanticType !== 'string') throw new Error('type should be a string, but got ' + (typeOrSemanticType + (' (' + (typeof typeOrSemanticType + ')'))));\n\n    const descriptors = semanticTypes.getClasses(typeOrSemanticType, 'ios');\n    const predicates = descriptors.map(({ className, excludes }) =>\n      excludes.length ? createExclusionPredicate(className, excludes) : createTypePredicate(className)\n    );\n\n    this.predicate = predicates.length > 1 ? createOrPredicate(predicates) : predicates[0];\n    this.predicate.rawType = typeOrSemanticType;\n    return this;\n  }\n\n  traits(traits) {\n    if (!Array.isArray(traits)) throw new Error('traits must be an array, got ' + typeof traits);\n    this.predicate = { type: 'traits', value: traits };\n    return this;\n  }\n\n  value(value) {\n    if (typeof value !== 'string') throw new Error('value should be a string, but got ' + (value + (' (' + (typeof value + ')'))));\n    this.predicate = { type: 'value', value: value };\n    return this;\n  }\n\n  text(text) {\n    if (typeof text !== 'string' && !isRegExp(text)) throw new Error(`text should be a string or regex, but got ` + (text + (' (' + (typeof text + ')'))));\n    this.predicate = { type: 'text', value: text.toString(), isRegex: isRegExp(text) };\n    return this;\n  }\n\n  withAncestor(matcher) {\n    if (!(matcher instanceof Matcher)) {\n      throwMatcherError(matcher);\n    }\n\n    return this.and({ predicate: { type: 'ancestor', predicate: matcher.predicate } });\n  }\n\n  withDescendant(matcher) {\n    if (!(matcher instanceof Matcher)) {\n      throwMatcherError(matcher);\n    }\n\n    return this.and({ predicate: { type: 'descendant', predicate: matcher.predicate } });\n  }\n\n  and(matcher) {\n    const result = new Matcher();\n\n    result.predicate = {\n      type: 'and',\n      predicates: [\n        ...Matcher.predicates(this),\n        ...Matcher.predicates(matcher),\n      ].map(x => _.cloneDeep(x))\n    };\n\n    return result;\n  }\n}\n\nclass WaitFor {\n  constructor(invocationManager, emitter, element) {\n    this._invocationManager = invocationManager;\n    this.element = new InternalElement(invocationManager, emitter, element.matcher, element.index);\n    this.expectation = new InternalExpect(invocationManager, this.element);\n    this._emitter = emitter;\n  }\n\n  get not() {\n    this.expectation.not;\n    return this;\n  }\n\n  toBeVisible(percent) {\n    this.expectation = this.expectation.toBeVisible(percent);\n    return this;\n  }\n\n  toBeNotVisible() {\n    this.expectation = this.expectation.toBeNotVisible();\n    return this;\n  }\n\n  toExist() {\n    this.expectation = this.expectation.toExist();\n    return this;\n  }\n\n  toNotExist() {\n    this.expectation = this.expectation.toNotExist();\n    return this;\n  }\n\n  toHaveText(text) {\n    this.expectation = this.expectation.toHaveText(text);\n    return this;\n  }\n\n  toNotHaveText(text) {\n    this.expectation = this.expectation.toNotHaveText(text);\n    return this;\n  }\n\n  toHaveLabel(label) {\n    this.expectation = this.expectation.toHaveLabel(label);\n    return this;\n  }\n\n  toNotHaveLabel(label) {\n    this.expectation = this.expectation.toNotHaveLabel(label);\n    return this;\n  }\n\n  toHaveId(id) {\n    this.expectation = this.expectation.toHaveId(id);\n    return this;\n  }\n\n  toNotHaveId(id) {\n    this.expectation = this.expectation.toNotHaveId(id);\n    return this;\n  }\n\n  toHaveValue(value) {\n    this.expectation = this.expectation.toHaveValue(value);\n    return this;\n  }\n\n  toNotHaveValue(value) {\n    this.expectation = this.expectation.toNotHaveValue(value);\n    return this;\n  }\n\n  toBeFocused() {\n    this.expectation = this.expectation.toBeFocused();\n    return this;\n  }\n\n  toBeNotFocused() {\n    this.expectation = this.expectation.toBeNotFocused();\n    return this;\n  }\n\n  withTimeout(timeout) {\n    if (typeof timeout !== 'number') throw new Error('text should be a number, but got ' + (timeout + (' (' + (typeof timeout + ')'))));\n    if (timeout < 0) throw new Error('timeout must be larger than 0');\n    this.timeout = timeout;\n\n    const traceDescription = expectDescription.withTimeout(timeout);\n    return this.waitForWithTimeout(traceDescription);\n  }\n\n  whileElement(matcher) {\n    if (!(matcher instanceof Matcher)) throwMatcherError(matcher);\n    this.actionableElement = new InternalElement(this._invocationManager, this._emitter, matcher);\n    return this;\n  }\n\n  tap(point) {\n    this.action = this.actionableElement.tap(point);\n    const traceDescription = actionDescription.tapAtPoint(point);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  longPress(arg1, arg2) {\n    this.action = this.actionableElement.longPress(arg1, arg2);\n\n    let { point, duration } = mapLongPressArguments(arg1, arg2);\n    const traceDescription = actionDescription.longPress(point, duration);\n\n    return this.waitForWithAction(traceDescription);\n  }\n\n  multiTap(times) {\n    this.action = this.actionableElement.multiTap(times);\n    const traceDescription = actionDescription.multiTap(times);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  tapAtPoint(point) {\n    this.action = this.actionableElement.tap(point);\n    const traceDescription = actionDescription.tapAtPoint(point);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  tapBackspaceKey() {\n    this.action = this.actionableElement.tapBackspaceKey();\n    const traceDescription = actionDescription.tapBackspaceKey();\n    return this.waitForWithAction(traceDescription);\n  }\n\n  tapReturnKey() {\n    this.action = this.actionableElement.tapReturnKey();\n    const traceDescription = actionDescription.tapReturnKey();\n    return this.waitForWithAction(traceDescription);\n  }\n\n  typeText(text) {\n    this.action = this.actionableElement.typeText(text);\n    const traceDescription = actionDescription.typeText(text);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  replaceText(text) {\n    this.action = this.actionableElement.replaceText(text);\n    const traceDescription = actionDescription.replaceText(text);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  clearText() {\n    this.action = this.actionableElement.clearText();\n    const traceDescription = actionDescription.clearText();\n    return this.waitForWithAction(traceDescription);\n  }\n\n  scroll(pixels, direction, startPositionX, startPositionY) {\n    this.action = this.actionableElement.scroll(pixels, direction, startPositionX, startPositionY);\n\n    const traceDescription = actionDescription.scroll(pixels, direction, startPositionX, startPositionY);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  scrollTo(edge) {\n    this.action = this.actionableElement.scrollTo(edge);\n    const traceDescription = actionDescription.scrollTo(edge);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  swipe(direction, speed, percentage) {\n    this.action = this.actionableElement.swipe(direction, speed, percentage);\n    const traceDescription = actionDescription.swipe(direction, speed, percentage);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  setColumnToValue(column, value) {\n    this.action = this.actionableElement.setColumnToValue(column, value);\n    const traceDescription = actionDescription.setColumnToValue(column, value);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  setDatePickerDate(dateString, dateFormat) {\n    this.action = this.actionableElement.setDatePickerDate(dateString, dateFormat);\n    const traceDescription = actionDescription.setDatePickerDate(dateString, dateFormat);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  performAccessibilityAction(actionName) {\n    this.action = this.actionableElement.performAccessibilityAction(actionName);\n    const traceDescription = actionDescription.performAccessibilityAction(actionName);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  pinch(scale, speed, angle) {\n    this.action = this.actionableElement.pinch(scale, speed, angle);\n    const traceDescription = actionDescription.pinch(scale, speed, angle);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  pinchWithAngle(direction, speed, angle) {\n    this.action = this.actionableElement.pinchWithAngle(direction, speed, angle);\n    const traceDescription = actionDescription.pinchWithAngle(direction, speed, angle);\n    return this.waitForWithAction(traceDescription);\n  }\n\n  waitForWithAction(actionTraceDescription) {\n    const expectation = this.expectation;\n    const action = this.action;\n\n    const invocation = this.createWaitForWithActionInvocation(expectation, action);\n\n    const traceDescription = expectDescription.waitFor(actionTraceDescription);\n    return _executeInvocation(this._invocationManager, invocation, traceDescription);\n  }\n\n  createWaitForWithActionInvocation(expectation, action) {\n    return {\n      ...action,\n      while: {\n        ...expectation\n      }\n    };\n  }\n\n  waitForWithTimeout(expectTraceDescription) {\n    const expectation = this.expectation;\n    const action = this.action;\n    const timeout = this.timeout;\n\n    const invocation = this.createWaitForWithTimeoutInvocation(expectation, action, timeout);\n\n    const traceDescription = expectDescription.waitForWithTimeout(expectTraceDescription, timeout);\n    return _executeInvocation(this._invocationManager, invocation, traceDescription);\n  }\n\n  createWaitForWithTimeoutInvocation(expectation, action, timeout) {\n    return {\n      ...action,\n      ...expectation,\n      timeout\n    };\n  }\n}\n\nfunction element(invocationManager, emitter, matcher) {\n  if (!(matcher instanceof Matcher)) {\n    throwMatcherError(matcher);\n  }\n\n  return new Element(invocationManager, emitter, matcher);\n}\n\nfunction expect(invocationManager, element) {\n  if (!(element instanceof Element)) {\n    throwMatcherError(element);\n  }\n\n  return new Expect(invocationManager, element);\n}\n\nfunction waitFor(invocationManager, emitter, element) {\n  if (!(element instanceof Element)) {\n    throwMatcherError(element);\n  }\n  return new WaitFor(invocationManager, emitter, element);\n}\n\nclass IosExpect {\n  constructor({ invocationManager, xcuitestRunner, emitter }) {\n    this._invocationManager = invocationManager;\n    this._xcuitestRunner = xcuitestRunner;\n    this._emitter = emitter;\n    this.element = this.element.bind(this);\n    this.expect = this.expect.bind(this);\n    this.waitFor = this.waitFor.bind(this);\n    this.by = new By();\n    this.web = this.web.bind(this);\n    this.web.element = this.web().element;\n    this.system = this.system.bind(this);\n    this.system.element = this.system().element;\n  }\n\n  element(matcher) {\n    return element(this._invocationManager, this._emitter, matcher);\n  }\n\n  expect(element) {\n    if (isSystemElement(element)) {\n      return systemExpect(this._xcuitestRunner, element);\n    }\n\n    if (isWebElement(element)) {\n      return webExpect(this._invocationManager, this._xcuitestRunner, element);\n    }\n\n    return expect(this._invocationManager, element);\n  }\n\n  waitFor(element) {\n    return waitFor(this._invocationManager, this._emitter, element);\n  }\n\n  web(matcher) {\n    return {\n      atIndex: index => {\n        if (typeof index !== 'number' || index < 0) throw new Error('index should be an integer, got ' + (index + (' (' + (typeof index + ')'))));\n        if (!(matcher instanceof Matcher)) throw new Error('cannot apply atIndex to a non-matcher');\n        matcher.index = index;\n        return this.web(matcher);\n      },\n      element: webMatcher => {\n        if (!(matcher instanceof Matcher) && matcher !== undefined) {\n          throwMatcherError(matcher);\n        }\n\n        const webViewElement = matcher ? element(this._invocationManager, this._emitter, matcher) : undefined;\n        return webElement(this._invocationManager, this._xcuitestRunner, this._emitter, webViewElement, webMatcher);\n      }\n    };\n  }\n\n  system() {\n    return {\n      element: systemMatcher => {\n        return systemElement(this._xcuitestRunner, systemMatcher);\n      }\n    };\n  }\n}\n\nfunction _assertValidPoint(point) {\n  if (!point) {\n    // point is optional\n    return;\n  }\n\n  if (typeof point !== 'object') throw new Error('point should be a object, but got ' + (point + (' (' + (typeof point + ')'))));\n  if (typeof point.x !== 'number') throw new Error('point.x should be a number, but got ' + (point.x + (' (' + (typeof point.x + ')'))));\n  if (typeof point.y !== 'number') throw new Error('point.y should be a number, but got ' + (point.y + (' (' + (typeof point.y + ')'))));\n}\n\nfunction throwMatcherError(param) {\n  throw new Error(`${param} is not a Detox matcher. More about Detox matchers here: https://wix.github.io/Detox/docs/api/matchers`);\n}\n\nfunction throwElementError(param) {\n  throw new Error(`${param} is not a Detox element. More about Detox elements here: https://wix.github.io/Detox/docs/api/matchers`);\n}\n\nfunction _executeInvocation(invocationManager, invocation, traceDescription) {\n  return traceInvocationCall(traceDescription, invocation, invocationManager.execute(invocation));\n}\n\nmodule.exports = IosExpect;\n"
  },
  {
    "path": "detox/src/ios/expectTwo.test.js",
    "content": "// @ts-nocheck\nconst jestExpect = require('expect').default; // eslint-disable-line\nconst _ = require('lodash');\n\ndescribe('expectTwo', () => {\n  let e;\n  let emitter;\n  let invocationManager;\n  let xcuitestRunner;\n  let fs;\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    jest.mock('../utils/tempfile');\n    jest.mock('fs-extra');\n\n    fs = require('fs-extra');\n    const IosExpect = require('./expectTwo');\n    const AsyncEmitter = jest.createMockFromModule('../utils/AsyncEmitter');\n    invocationManager = new MockExecutor();\n    xcuitestRunner = new MockExecutor();\n    emitter = new AsyncEmitter();\n\n    e = new IosExpect({\n      invocationManager,\n      xcuitestRunner,\n      emitter,\n    });\n  });\n\n  it(`should parse correct JSON for tap action`, async () => {\n    const testCall = await e.element(e.by.text('tapMe')).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'text',\n          value: 'tapMe',\n          isRegex: false,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for RegExp text matcher`, async () => {\n    const testCall = await e.element(e.by.text(/tapMe/)).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'text',\n          value: '/tapMe/',\n          isRegex: true,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for tap action with parameters`, async () => {\n    const testCall = await e.element(e.by.text('tapMe')).tap({ x: 1, y: 2 });\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        params: [\n          {\n            x: 1,\n            y: 2\n          }\n        ],\n        predicate: {\n          type: 'text',\n          value: 'tapMe',\n          isRegex: false,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with id and text matchers`, async () => {\n    const testCall = await e.element(e.by.id('uniqueId').and(e.by.text('some text'))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'uniqueId',\n              isRegex: false,\n            },\n            {\n              type: 'text',\n              value: 'some text',\n              isRegex: false,\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with RegExp id and text matchers`, async () => {\n    const testCall = await e.element(e.by.id(/uniqueId/).and(e.by.text(/some text/))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: '/uniqueId/',\n              isRegex: true,\n            },\n            {\n              type: 'text',\n              value: '/some text/',\n              isRegex: true,\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with ancestor matcher`, async () => {\n    const testCall = await e.element(e.by.id('child').withAncestor(e.by.id('parent'))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'child',\n              isRegex: false,\n            },\n            {\n              type: 'ancestor',\n              predicate: {\n                type: 'id',\n                value: 'parent',\n                isRegex: false,\n              }\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with regex ancestor matcher`, async () => {\n    const testCall = await e.element(e.by.id('child').withAncestor(e.by.id(/parent/))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'child',\n              isRegex: false,\n            },\n            {\n              type: 'ancestor',\n              predicate: {\n                type: 'id',\n                value: '/parent/',\n                isRegex: true,\n              }\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with regex label`, async () => {\n    const testCall = await e.element(e.by.label(/tapMe/)).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'label',\n          value: '/tapMe/',\n          isRegex: true,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it.each([\n    ['withAncestor'],\n    ['withDescendant'],\n    ['and'],\n  ])(`should parse immutable objects when combining matchers: %s`, async (combineMethodName) => {\n    const base = e.by.id('abc');\n    const modifier = e.by.id('def');\n\n    expect(base[combineMethodName](modifier)).not.toBe(base);\n    expect(base).toEqual(e.by.id('abc'));\n    expect(modifier).toEqual(e.by.id('def'));\n  });\n\n  it(`should parse correct JSON for element with ancestor and index matchers`, async () => {\n    const testCall = await e.element(e.by.id('child').withAncestor(e.by.id('parent'))).atIndex(0).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        atIndex: 0,\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'child',\n              isRegex: false,\n            },\n            {\n              type: 'ancestor',\n              predicate: {\n                type: 'id',\n                value: 'parent',\n                isRegex: false,\n              }\n            }\n          ]\n        }\n      }\n    };\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with ancestor and test matchers`, async () => {\n    const testCall = await e.element(e.by.id('child').withAncestor(e.by.id('parent').and(e.by.text('text')))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'child',\n              isRegex: false,\n            },\n            {\n              type: 'ancestor',\n              predicate: {\n                type: 'and',\n                predicates: [\n                  {\n                    type: 'id',\n                    value: 'parent',\n                    isRegex: false,\n                  },\n                  {\n                    type: 'text',\n                    value: 'text',\n                    isRegex: false,\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for element with id, text and value matchers`, async () => {\n    const testCall = await e.element(e.by.id('child').and(e.by.text('text').and(e.by.value('value')))).tap();\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        predicate: {\n          type: 'and',\n          predicates: [\n            {\n              type: 'id',\n              value: 'child',\n              isRegex: false,\n            },\n            {\n              type: 'text',\n              value: 'text',\n              isRegex: false,\n            },\n            {\n              type: 'value',\n              value: 'value',\n            }\n          ]\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for tap at point action`, async () => {\n    const testCall = await e.element(e.by.id('tappable')).tapAtPoint({ x: 5, y: 10 });\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'tap',\n        params: [\n          {\n            x: 5,\n            y: 10\n          }\n        ],\n        predicate: {\n          type: 'id',\n          value: 'tappable',\n          isRegex: false,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for long-press and drag action`, async () => {\n    const testCall = await e.element(e.by.id('elementToDrag')).longPressAndDrag(1000, 0.5, 0.5, e.element(e.by.id('targetElement')));\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'longPress',\n        params: [1000, 0.5, 0.5, null, null, 'fast', 1000],\n        predicate: {\n          type: 'id',\n          value: 'elementToDrag',\n          isRegex: false,\n        },\n        targetElement: {\n          predicate: {\n            type: 'id',\n            value: 'targetElement',\n            isRegex: false,\n          }\n        }\n      }\n    };\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for visibility expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.text('Tap Working!!!'))).toBeVisible();\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'text',\n          value: 'Tap Working!!!',\n          isRegex: false,\n        },\n        expectation: 'toBeVisible'\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toBeVisible expectation with parameter`, async () => {\n    const testCall = await e.expect(e.element(e.by.id('foo'))).toBeVisible(25);\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'id',\n          value: 'foo',\n          isRegex: false,\n        },\n        expectation: 'toBeVisible',\n        params: [25]\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toBeNotVisible expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.text('Tap Working!!!'))).toBeNotVisible();\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'text',\n          value: 'Tap Working!!!',\n          isRegex: false,\n        },\n        modifiers: ['not'],\n        expectation: 'toBeVisible'\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toBeFocused expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.text('Tap Working!!!'))).toBeFocused();\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'text',\n          value: 'Tap Working!!!',\n          isRegex: false,\n        },\n        expectation: 'toBeFocused'\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for notToBeFocused expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.text('Tap Working!!!'))).toBeNotFocused();\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'text',\n          value: 'Tap Working!!!',\n          isRegex: false,\n        },\n        modifiers: ['not'],\n        expectation: 'toBeFocused'\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toHaveText expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.id('UniqueId204'))).toHaveText('I contain some text');\n    const jsonOutput = {\n      invocation: {\n        type: 'expectation',\n        predicate: {\n          type: 'id',\n          value: 'UniqueId204',\n          isRegex: false,\n        },\n        expectation: 'toHaveText',\n        params: ['I contain some text']\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toHaveId expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.text('Product')).atIndex(2)).toHaveId('ProductId002');\n    const jsonOutput = {\n      'invocation': {\n        'type': 'expectation',\n        'atIndex': 2,\n        'predicate': {\n          'type': 'text',\n          'value': 'Product',\n          'isRegex': false,\n        },\n        'expectation': 'toHaveId',\n        'params': ['ProductId002']\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toHaveSliderPosition expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.id('slider'))).toHaveSliderPosition(0.5, 1);\n    const jsonOutput = {\n      'invocation': {\n        'type': 'expectation',\n        'predicate': {\n          'type': 'id',\n          'value': 'slider',\n          'isRegex': false,\n        },\n        'expectation': 'toHaveSliderPosition',\n        'params': [0.5, 1]\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for toHaveToggleValue expectation`, async () => {\n    const testCall = await e.expect(e.element(e.by.id('switch'))).toHaveToggleValue(true);\n    const jsonOutput = {\n      'invocation': {\n        'type': 'expectation',\n        'predicate': {\n          'type': 'id',\n          'value': 'switch',\n          'isRegex': false,\n        },\n        'expectation': 'toHaveToggleValue',\n        'params': [1]\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should parse correct JSON for swipe action`, async () => {\n    const testCall = await e.element(e.by.id('ScrollView100')).swipe('up', 'fast', undefined, undefined, 0.5);\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'swipe',\n        params: ['up', 'fast', 0.75, null, 0.5],\n        predicate: {\n          type: 'id',\n          value: 'ScrollView100',\n          isRegex: false,\n        }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should trim milliseconds for setDatePickerDate with ISO8601 format`, async () => {\n    const testCall = await e.element(e.by.id('datePicker')).setDatePickerDate('2019-01-01T00:00:00.000Z', 'ISO8601');\n    const jsonOutput = {\n      'invocation': {\n        'type': 'action',\n        'action': 'setDatePickerDate',\n        'params': ['2019-01-01T00:00:00Z', 'ISO8601'],\n        'predicate': { 'type': 'id', 'value': 'datePicker', 'isRegex': false }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  it(`should not trim milliseconds for setDatePickerDate with a custom format`, async () => {\n    const testCall = await e.element(e.by.id('datePicker')).setDatePickerDate('2019-01-01T00:00:00.000Z', 'YYYY-MM-DDTHH:mm:sss.fT');\n    const jsonOutput = {\n      'invocation': {\n        'type': 'action',\n        'action': 'setDatePickerDate',\n        'params': ['2019-01-01T00:00:00.000Z', 'YYYY-MM-DDTHH:mm:sss.fT'],\n        'predicate': { 'type': 'id', 'value': 'datePicker', 'isRegex': false }\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  describe(`waitFor`, () => {\n    it(`should parse correct JSON for toBeNotVisible expectation`, async () => {\n      const testCall = await e.waitFor(e.element(e.by.text('Text5'))).toBeNotVisible().whileElement(e.by.id('ScrollView630')).scroll(50, 'down');\n      const jsonOutput = {\n        invocation: {\n          type: 'action',\n          action: 'scroll',\n          params: [50, 'down', null, null],\n          predicate: {\n            type: 'id',\n            value: 'ScrollView630',\n            isRegex: false,\n          },\n          while: {\n            type: 'expectation',\n            predicate: {\n              type: 'text',\n              value: 'Text5',\n              isRegex: false,\n            },\n            modifiers: ['not'],\n            expectation: 'toBeVisible'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse correct JSON for toExist expectation`, async () => {\n      const testCall = await e.waitFor(e.element(e.by.id('createdAndVisibleText'))).toExist().withTimeout(2000);\n      const jsonOutput = {\n        invocation:\n            {\n              type: 'expectation',\n              predicate: {\n                type: 'id',\n                value: 'createdAndVisibleText',\n                isRegex: false,\n              },\n              expectation: 'toExist',\n              timeout: 2000\n            }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse correct JSON for text and index matchers`, async () => {\n      const testCall = await e.waitFor(e.element(e.by.text('Item')).atIndex(1)).toExist().withTimeout(2000);\n      const jsonOutput = {\n        invocation:\n            {\n              type: 'expectation',\n              atIndex: 1,\n              predicate: {\n                type: 'text',\n                value: 'Item',\n                isRegex: false,\n              },\n              expectation: 'toExist',\n              timeout: 2000\n            }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse correct JSON for toBeNotVisible expectation`, async () => {\n      const testCall = await e.waitFor(e.element(e.by.id('uniqueId'))).not.toBeVisible().withTimeout(2000);\n      const jsonOutput = {\n        invocation: {\n          type: 'expectation',\n          predicate: {\n            type: 'id',\n            value: 'uniqueId',\n            isRegex: false,\n          },\n          modifiers: ['not'],\n          expectation: 'toBeVisible',\n          timeout: 2000\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n  });\n\n  describe.each([\n    [''],\n    [\"'imageName'\", 'imageName']\n  ])(`e.element(e.by.id('uniqueId')).takeScreenshot(%s)`, (_comment, imageName) => {\n    let deviceTmpFilePath;\n    let tmpFileName;\n    let tmpFilePath;\n    let result;\n\n    beforeEach(async () => {\n      tmpFileName = '2317894723984';\n      tmpFilePath = `/tmp/somewhere/${tmpFileName}.png`;\n      deviceTmpFilePath = '/tmp/path/to/device/file.png';\n\n      invocationManager.execute.mockResolvedValueOnce({\n        screenshotPath: deviceTmpFilePath,\n      });\n\n      require('../utils/tempfile').mockReturnValue(tmpFilePath);\n      result = await e.element(e.by.id('uniqueId')).takeScreenshot(imageName);\n    });\n\n    it(`should send a JSON request via invocation manager`, async () => {\n      expect(invocationManager.execute).toHaveBeenCalledWith({\n        type: 'action',\n        action: 'takeScreenshot',\n        ...(imageName && { params: [imageName] }),\n        predicate: {\n          isRegex: false,\n          type: 'id',\n          value: 'uniqueId'\n        }\n      });\n    });\n\n    it(`should move the temporary file for the device to a local temp location`, async () => {\n      expect(fs.move).toHaveBeenCalledWith(deviceTmpFilePath, tmpFilePath);\n    });\n\n    it(`should emit (for the artifact manager plugin) an event about an external artifact created`, async () => {\n      expect(emitter.emit).toHaveBeenCalledWith('createExternalArtifact', {\n        pluginId: 'screenshot',\n        artifactName: imageName || tmpFileName,\n        artifactPath: tmpFilePath,\n      });\n    });\n\n    it(`should return a temporary path to the screenshot`, async () => {\n      expect(result).toBe(tmpFilePath);\n    });\n  });\n\n  it('toBeVisible() should throw with bad args', async () => {\n    const stubMatcher = e.element(e.by.label('test'));\n    const expectedErrorMsg = 'must be an integer between 1 and 100';\n\n    jestExpect(() => e.expect(stubMatcher).toBeVisible(0)).toThrow(expectedErrorMsg);\n    jestExpect(() => e.expect(stubMatcher).not.toBeVisible(0)).toThrow(expectedErrorMsg);\n    jestExpect(() => e.expect(stubMatcher).toBeVisible(101)).toThrow(expectedErrorMsg);\n    jestExpect(() => e.expect(stubMatcher).not.toBeVisible(101)).toThrow(expectedErrorMsg);\n\n    jestExpect(() => e.waitFor(stubMatcher).toBeVisible(0)).toThrow(expectedErrorMsg);\n    jestExpect(() => e.waitFor(stubMatcher).toBeVisible(101)).toThrow(expectedErrorMsg);\n  });\n\n  it(`element(e.by.text('tapMe')).performAccessibilityAction('activate')`, async () => {\n    const testCall = await e.element(e.by.text('tapMe')).performAccessibilityAction('activate');\n    const jsonOutput = {\n      invocation: {\n        type: 'action',\n        action: 'accessibilityAction',\n        predicate: {\n          type: 'text',\n          value: 'tapMe',\n          isRegex: false,\n        },\n        params: [\n          'activate'\n        ]\n      }\n    };\n\n    expect(testCall).toDeepEqual(jsonOutput);\n  });\n\n  describe('system', () => {\n    it(`should parse system.element(by.system.label('tapMe')).atIndex(1).tap()`, async () => {\n      const testCall = await e.system.element(e.by.system.label('tapMe')).atIndex(1).tap();\n      const jsonOutput = {\n        invocation: {\n          type: 'systemAction',\n          systemAction: 'tap',\n          systemPredicate: {\n            type: 'label',\n            value: 'tapMe'\n          },\n          systemAtIndex: 1\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse expect(system.element(by.system.type('button'))).not.toExist()`, async () => {\n      const testCall = await e.expect(e.system.element(e.by.system.type('button'))).not.toExist();\n      const jsonOutput = {\n        invocation: {\n          type: 'systemExpectation',\n          systemExpectation: 'toExist',\n          systemModifiers: ['not'],\n          systemPredicate: {\n            type: 'type',\n            value: 'button'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n  });\n\n  describe('semantic types', () => {\n    it(`should parse correct JSON for regular class name using by.type()`, async () => {\n      const testCall = await e.element(e.by.type('CustomUIView')).tap();\n      const jsonOutput = {\n        invocation: {\n          type: 'action',\n          action: 'tap',\n          predicate: {\n            type: 'type',\n            value: 'CustomUIView',\n            rawType: 'CustomUIView'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse correct JSON for semantic type 'image' using by.type()`, async () => {\n      const testCall = await e.element(e.by.type('image')).tap();\n      const jsonOutput = {\n        invocation: {\n          type: 'action',\n          action: 'tap',\n          predicate: {\n            type: 'or',\n            predicates: [\n              {\n                type: 'type',\n                value: 'RCTImageView'\n              },\n              {\n                type: 'type',\n                value: 'RCTImageComponentView'\n              },\n              {\n                type: 'type',\n                value: 'UIImageView'\n              },\n            ],\n            rawType: 'image'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse correct JSON for semantic type with exclusions using by.type()`, async () => {\n      const semanticTypes = require('../matchers/semanticTypes');\n      const originalGetClasses = semanticTypes.getClasses;\n\n      semanticTypes.getClasses = jest.fn().mockReturnValue([\n        { className: 'UIActivityIndicatorView', excludes: ['UIProgressView'] }\n      ]);\n\n      const testCall = await e.element(e.by.type('mock-type-with-exclusion')).tap();\n      const jsonOutput = {\n        invocation: {\n          type: 'action',\n          action: 'tap',\n          predicate: {\n            type: 'and',\n            predicates: [\n              { type: 'type', value: 'UIActivityIndicatorView' },\n              {\n                type: 'not',\n                predicate: {\n                  type: 'or',\n                  predicates: [{ type: 'type', value: 'UIProgressView' }]\n                }\n              }\n            ],\n            rawType: 'mock-type-with-exclusion'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n      semanticTypes.getClasses = originalGetClasses;\n    });\n  });\n\n  describe('web views', () => {\n    it(`should parse expect(web(by.id('webViewId').element(web(by.label('tapMe')))).toExist()`, async () => {\n      const testCall = await e.expect(e.web(e.by.id('webViewId')).atIndex(1).element(e.by.web.label('tapMe')).atIndex(2)).toExist();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webExpectation',\n          webExpectation: 'toExist',\n          predicate: {\n            type: 'id',\n            value: 'webViewId',\n            isRegex: false\n          },\n          atIndex: 1,\n          webPredicate: {\n            type: 'label',\n            value: 'tapMe'\n          },\n          webAtIndex: 2\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web(by.id('webViewId').element(web(by.label('tapMe')))).not.toHaveText('Hey')`, async () => {\n      const testCall = await e.expect(e.web(e.by.id('webViewId')).element(e.by.web.label('tapMe'))).not.toHaveText('Hey');\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webExpectation',\n          webExpectation: 'toHaveText',\n          params: ['Hey'],\n          predicate: {\n            type: 'id',\n            value: 'webViewId',\n            isRegex: false\n          },\n          webModifiers: ['not'],\n          webPredicate: {\n            type: 'label',\n            value: 'tapMe'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it('should throw when passing non-web-element matcher to element()', async () => {\n      const expectedErrorMsg = 'is not a Detox web-view matcher';\n\n      jestExpect(() => e.expect(\n          e.web(e.by.id('webViewId')).element(e.by.label('tapMe'))\n      ).toExist()).toThrow(expectedErrorMsg);\n    });\n\n    it('should throw when not passing matcher to web()', async () => {\n      const expectedErrorMsg = 'invalid is not a Detox matcher';\n      jestExpect(() => e.web('invalid').element(e.by.label('tapMe')).toExist()).toThrow(expectedErrorMsg);\n    });\n\n    it('should throw when passing at-index to a non-matcher', async () => {\n      const expectedErrorMsg = 'cannot apply atIndex to a non-matcher';\n      jestExpect(() => e.web('invalid').atIndex(1).element(e.by.web.label('tapMe')).toExist()).toThrow(expectedErrorMsg);\n    });\n\n    it(`should parse web(by.id('webViewId')).atIndex(2).element(web.by.label('tapMe')).atIndex(1).clearText()`, async () => {\n      const testCall =\n          await e.web(e.by.id('webViewId')).atIndex(2).element(e.by.web.label('tapMe')).atIndex(1).clearText();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'clearText',\n          webAtIndex: 1,\n          predicate: {\n            type: 'id',\n            value: 'webViewId',\n            isRegex: false\n          },\n          atIndex: 2,\n          webPredicate: {\n            type: 'label',\n            value: 'tapMe'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it('should raise on invalid at-index', async () => {\n      const expectedErrorMsg = 'index should be an integer, got -1 (number)';\n      jestExpect(() => e.web(e.by.id('webViewId')).atIndex(-1).element(e.by.web.label('tapMe')).atIndex(1).clearText()).toThrow(expectedErrorMsg);\n    });\n\n    it('should raise on invalid web-matcher at-index', async () => {\n      const expectedErrorMsg = 'index should be an integer, got -1 (number)';\n      jestExpect(() => e.web(e.by.id('webViewId')).element(e.by.web.label('tapMe')).atIndex(-1).clearText()).toThrow(expectedErrorMsg);\n    });\n\n    it(`should parse web.element(by.web.label('tapMe')).tap()`, async () => {\n      const testCall = await e.web.element(e.by.web.label('tapMe')).tap();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'tap',\n          webPredicate: {\n            type: 'label',\n            value: 'tapMe'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.id('someValue')).typeText('text')`, async () => {\n      const testCall = await e.web.element(e.by.web.id('someValue')).atIndex(3).typeText('text');\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'typeText',\n          webAtIndex: 3,\n          params: ['text'],\n          webPredicate: {\n            type: 'id',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.id('someValue')).typeText('text', true)`, async () => {\n      const testCall = await e.web.element(e.by.web.id('someValue')).atIndex(3).typeText('text', true);\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'typeText',\n          webAtIndex: 3,\n          params: ['text'],\n          webPredicate: {\n            type: 'id',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.className('someValue')).replaceText('text')`, async () => {\n      const testCall = await e.web.element(e.by.web.className('someValue')).replaceText('text');\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'replaceText',\n          params: ['text'],\n          webPredicate: {\n            type: 'class',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.cssSelector('someValue')).focus()`, async () => {\n      const testCall = await e.web.element(e.by.web.cssSelector('someValue')).focus();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'focus',\n          webPredicate: {\n            type: 'css',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.xpath('someValue')).getCurrentUrl()`, async () => {\n      const testCall = await e.web.element(e.by.web.xpath('someValue')).getCurrentUrl();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'getCurrentUrl',\n          webPredicate: {\n            type: 'xpath',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.name('someValue')).getText()`, async () => {\n      const testCall = await e.web.element(e.by.web.name('someValue')).getText();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'getText',\n          webPredicate: {\n            type: 'name',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.href('someValue')).getTitle()`, async () => {\n      const testCall = await e.web.element(e.by.web.href('someValue')).getTitle();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'getTitle',\n          webPredicate: {\n            type: 'href',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.hrefContains('someValue')).moveCursorToEnd()`, async () => {\n      const testCall = await e.web.element(e.by.web.hrefContains('someValue')).moveCursorToEnd();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'moveCursorToEnd',\n          webPredicate: {\n            type: 'hrefContains',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.tag('someValue')).runScript('script')`, async () => {\n      const testCall = await e.web.element(e.by.web.tag('someValue')).runScript('script');\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'runScript',\n          params: ['script'],\n          webPredicate: {\n            type: 'tag',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.value('someValue')).runScript(() => {}, ['arg'])`, async () => {\n      const testCall = await e.web.element(e.by.web.value('someValue')).runScript(() => {}, ['arg']);\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'runScriptWithArgs',\n          params: ['() => {}', ['arg']],\n          webPredicate: {\n            type: 'value',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.value('someValue')).runScript('() => {}', ['arg'])`, async () => {\n      const testCall = await e.web.element(e.by.web.value('someValue')).runScript('() => {}', ['arg']);\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'runScriptWithArgs',\n          params: ['() => {}', ['arg']],\n          webPredicate: {\n            type: 'value',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.name('someValue')).selectAllText()`, async () => {\n      const testCall = await e.web.element(e.by.web.name('someValue')).selectAllText();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'selectAllText',\n          webPredicate: {\n            type: 'name',\n            value: 'someValue'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it(`should parse web.element(by.web.id('webViewId')).scrollToView()`, async () => {\n      const testCall = await e.web.element(e.by.web.id('webViewId')).scrollToView();\n\n      const jsonOutput = {\n        invocation: {\n          type: 'webAction',\n          webAction: 'scrollToView',\n          webPredicate: {\n            type: 'id',\n            value: 'webViewId'\n          }\n        }\n      };\n\n      expect(testCall).toDeepEqual(jsonOutput);\n    });\n\n    it('should throw when invocation returns an error', async () => {\n      invocationManager.execute.mockResolvedValueOnce({\n        error: 'some error'\n      });\n\n      await expect(() => e.web.element(e.by.web.id('uniqueId')).getTitle()).rejects.toThrow('some error');\n    });\n\n    it('should extract return value (`return`) when exists on getter', async () => {\n      invocationManager.execute.mockResolvedValueOnce({\n        result: 'some result'\n      });\n\n      const result = await e.web.element(e.by.web.id('uniqueId')).getTitle();\n      expect(result).toBe('some result');\n    });\n\n    it('should extract return value (`title`) when exists on getter', async () => {\n      invocationManager.execute.mockResolvedValueOnce({\n        title: 'some result'\n      });\n\n      const result = await e.web.element(e.by.web.id('uniqueId')).getTitle();\n      expect(result).toBe('some result');\n    });\n\n    it('should return undefined value when no return value exists and undefined allowed', async () => {\n      invocationManager.execute.mockResolvedValueOnce({});\n\n      const result = await e.web.element(e.by.web.id('uniqueId')).runScript(() => {});\n      expect(result).toBe(undefined);\n    });\n  });\n});\n\nexpect.extend({\n  toDeepEqual(a, b) {\n    const pass = _.isEqual(a, b);\n\n    return {\n      pass,\n      actual: a,\n      expected: b,\n      message: () => `${JSON.stringify(a)} does not match\n       ${JSON.stringify(b)}`\n    };\n  }\n});\n\nclass MockExecutor {\n  constructor() {\n    jest.spyOn(this, 'execute');\n  }\n\n  execute(invocation) {\n    return Promise.resolve({ invocation });\n  }\n}\n"
  },
  {
    "path": "detox/src/ios/expectTwoApiCoverage.test.js",
    "content": "// @ts-nocheck\ndescribe('expectTwo API Coverage', () => {\n  let e;\n\n  beforeEach(() => {\n    const IosExpect = require('./expectTwo');\n\n    e = new IosExpect({\n      invocationManager: new MockExecutor(),\n      xcuitestRunner: new MockExecutor(),\n    });\n  });\n\n  describe('Matchers', () => {\n    it(`by.accessibilityLabel`, async () => {\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible(25);\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toBeNotVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toBeVisible();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toBeVisible(25);\n\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toExist();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotExist();\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toExist();\n\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveText('text');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveText('text');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveText('text');\n\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveLabel('label');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveLabel('label');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveLabel('label');\n\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveId('id');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveId('id');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveId('id');\n\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toHaveValue('value');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).toNotHaveValue('value');\n      await e.expect(e.element(e.by.accessibilityLabel('test'))).not.toHaveValue('value');\n    });\n\n    it(`by.label (for backwards compat)`, async () => {\n      await e.expect(e.element(e.by.label('test'))).toBeVisible();\n      await e.expect(e.element(e.by.label('test'))).toBeNotVisible();\n      await e.expect(e.element(e.by.label('test'))).toExist();\n      await e.expect(e.element(e.by.label('test'))).toNotExist();\n      await e.expect(e.element(e.by.label('test'))).toHaveText('text');\n      await e.expect(e.element(e.by.label('test'))).toHaveLabel('label');\n      await e.expect(e.element(e.by.label('test'))).toHaveId('id');\n      await e.expect(e.element(e.by.label('test'))).toHaveValue('value');\n    });\n\n    it(`by.id`, async () => {\n      await e.expect(e.element(e.by.id('test'))).toBeVisible();\n    });\n\n    it(`by.traits`, async () => {\n      await e.expect(e.element(e.by.traits(['button', 'link', 'header', 'search']))).toBeVisible();\n      await e.expect(e.element(e.by.traits(['image', 'selected', 'plays', 'key']))).toBeNotVisible();\n      await e.expect(e.element(e.by.traits(['text', 'summary', 'disabled', 'frequentUpdates']))).toBeNotVisible();\n      await e.expect(e.element(e.by.traits(['startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn']))).toBeNotVisible();\n    });\n\n    it(`withAncestor, withDescendant`, async () => {\n      await e.expect(e.element(e.by.id('test').withAncestor(e.by.id('ancestor')))).toBeVisible();\n      await e.expect(e.element(e.by.id('test').withDescendant(e.by.id('descendant')))).toBeVisible();\n      await e.expect(e.element(e.by.id('test').and(e.by.type('type')))).toBeVisible();\n    });\n\n    it(`matchers with wrong parameters should throw`, async () => {\n      await expectToThrow(() => e.element(e.by.label(5)));\n      await expectToThrow(() => e.element(e.by.id(5)));\n      await expectToThrow(() => e.by.type(1));\n      await expectToThrow(() => e.by.traits(1));\n      // await expectToThrow(() => e.by.traits(['nonExistentTrait']));\n      await expectToThrow(() => e.element(e.by.value(0)));\n      await expectToThrow(() => e.element(e.by.text(0)));\n      await expectToThrow(() => e.element(e.by.id('test').withAncestor('notAMatcher')));\n      await expectToThrow(() => e.element(e.by.id('test').withDescendant('notAMatcher')));\n      // await expectToThrow(() => e.element(e.by.id('test').and('notAMatcher')));\n\n      // Web matchers\n      await expectToThrow(() => e.web.element(e.by.web.id(1)));\n      await expectToThrow(() => e.web.element(e.by.web.label(1)));\n      await expectToThrow(() => e.web.element(e.by.web.className(1)));\n      await expectToThrow(() => e.web.element(e.by.web.cssSelector(1)));\n      await expectToThrow(() => e.web.element(e.by.web.name(1)));\n      await expectToThrow(() => e.web.element(e.by.web.xpath(1)));\n      await expectToThrow(() => e.web.element(e.by.web.href(1)));\n      await expectToThrow(() => e.web.element(e.by.web.hrefContains(1)));\n      await expectToThrow(() => e.web.element(e.by.web.tag(1)));\n      await expectToThrow(() => e.web.element(e.by.web.value(1)));\n    });\n\n    it(`should throw for invalid toBeVisible parameters`, async () => {\n      await expectToThrow(() =>e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible(0));\n      await expectToThrow(() =>e.expect(e.element(e.by.accessibilityLabel('test'))).toBeVisible(120));\n      await expectToThrow(() =>e.waitFor(e.element(e.by.accessibilityLabel('test'))).toBeVisible(0));\n      await expectToThrow(() =>e.e.waitFor(e.element(e.by.accessibilityLabel('test'))).toBeVisible(120));\n    });\n\n    describe('System', () => {\n      it('should throw for invalid matcher parameters', async () => {\n        await expectToThrow(() => e.system.element(e.by.system.label(5)));\n        await expectToThrow(() => e.system.element(e.by.system.type(5)));\n      });\n\n      it('should throw for invalid matchers', async () => {\n        await expectToThrow(() => e.system.element(e.by.value('test')));\n      });\n    });\n\n    describe('Secured Web', () => {\n      it('should throw for invalid matcher parameters', async () => {\n        await expectToThrow(() => e.web.element(e.by.web.label(5)).asSecured());\n        await expectToThrow(() => e.web.element(e.by.web.type(5)).asSecured());\n      });\n\n      it('should throw for invalid matchers', async () => {\n        await expectToThrow(() => e.web.element(e.by.web.value('test')).asSecured());\n      });\n    });\n  });\n\n  describe('Expect', () => {\n    it('toHaveSliderPosition', async () => {\n      e.expect(e.element(e.by.id('id'))).toHaveSliderPosition(0.5);\n    });\n\n    it(`expect with wrong parameters should throw`, async () => {\n      await expectToThrow(() => e.expect('notAnElement'));\n      await expectToThrow(() => e.expect(e.element('notAMatcher')));\n      await expectToThrow(() => e.expect(e.web.element('notAMatcher')));\n      await expectToThrow(() => e.expect(e.web.element(e.by.web.id('id'))).toHaveText(0));\n    });\n\n    it('should not throw on system assertions', async () => {\n      await e.expect(e.system.element(e.by.system.label('Tap Me')).atIndex(2)).toExist();\n      await e.expect(e.system.element(e.by.system.type('button'))).not.toExist();\n    });\n\n    it('should not throw on secured web assertions', async () => {\n      await e.expect(e.web.element(e.by.web.label('Tap Me')).atIndex(0).asSecured()).toExist();\n      await e.expect(e.web.element(e.by.web.type('button')).asSecured()).not.toExist();\n    });\n  });\n\n  describe('Actions', () => {\n    it(`setColumnToValue()`, async () => {\n      await e.element(e.by.id('pickerView')).setColumnToValue(1, '6');\n      await expectToThrow(() => e.element(e.by.id('pickerView')).setColumnToValue('notAColumn', 1));\n      await expectToThrow(() => e.element(e.by.id('pickerView')).setColumnToValue(1, 1));\n    });\n\n    it(`interactions`, async () => {\n      await e.element(e.by.label('Tap Me')).getAttributes();\n      await e.element(e.by.label('Tap Me')).tap();\n      await e.element(e.by.label('Tap Me')).tap({ x: 10, y: 10 });\n      await e.element(e.by.label('Tap Me')).tapAtPoint({ x: 10, y: 10 });\n      await e.element(e.by.label('Tap Me')).longPress();\n      await e.element(e.by.label('Tap Me')).longPress(2000);\n      await e.element(e.by.label('Tap Me')).longPress({ x: 10, y: 10 }, 2000);\n      await e.element(e.by.label('Tap Me')).longPress({ x: 10, y: 10 });\n      await e.element(e.by.id('someId')).multiTap(3);\n      await e.element(e.by.id('someId')).typeText('passcode');\n      await e.element(e.by.id('someId')).tapBackspaceKey();\n      await e.element(e.by.id('someId')).tapReturnKey();\n      await e.element(e.by.id('someId')).clearText();\n      await e.element(e.by.id('someId')).replaceText('replaceTo');\n      await e.element(e.by.id('someId')).pinchWithAngle('outward', 'fast', 0);\n      await e.element(e.by.id('someId')).pinchWithAngle('outward');\n      await e.element(e.by.id('someId')).pinch(0.1);\n      await e.element(e.by.id('someId')).pinch(0.1, 'fast', 0);\n      await e.element(e.by.id('someId')).pinch(1.1, 'slow', 1);\n      await e.element(e.by.id('someId')).scroll(100);\n      await e.element(e.by.id('someId')).scroll(100, 'down');\n      await e.element(e.by.id('someId')).scroll(100, 'up');\n      await e.element(e.by.id('someId')).scroll(100, 'right');\n      await e.element(e.by.id('someId')).scroll(100, 'left');\n      await e.element(e.by.id('someId')).scrollTo('bottom');\n      await e.element(e.by.id('someId')).scrollTo('top');\n      await e.element(e.by.id('someId')).scrollTo('left');\n      await e.element(e.by.id('someId')).scrollTo('right');\n      await e.element(e.by.id('someId')).swipe('down');\n      await e.element(e.by.id('someId')).swipe('down', 'fast');\n      await e.element(e.by.id('someId')).swipe('up', 'slow');\n      await e.element(e.by.id('someId')).swipe('left', 'fast');\n      await e.element(e.by.id('someId')).swipe('right', 'slow');\n      await e.element(e.by.id('someId')).swipe('down', 'fast', 0.9);\n      await e.element(e.by.id('someId')).swipe('up', 'slow', 0.9);\n      await e.element(e.by.id('someId')).swipe('left', 'fast', 0.9);\n      await e.element(e.by.id('someId')).swipe('right', 'slow', 0.9);\n      await e.element(e.by.id('someId')).swipe('down', 'fast', undefined, 0.5);\n      await e.element(e.by.id('someId')).swipe('up', 'slow', 0.5, NaN, 1);\n      await e.element(e.by.id('someId')).swipe('left', 'fast', undefined, undefined, 0.5);\n      await e.element(e.by.id('someId')).swipe('right', 'slow', 0.9, 1, 0.5);\n      await e.element(e.by.id('someId')).atIndex(1).tap();\n      await e.element(e.by.id('someId')).setDatePickerDate('2019-2-8T05:10:00-08:00', 'yyyy-MM-dd\\'T\\'HH:mm:ssZZZZZ');\n      await e.element(e.by.id('slider')).adjustSliderToPosition(0.5);\n      await e.element(e.by.id('someId')).performAccessibilityAction('activate');\n    });\n\n    it(`interactions with wrong parameters should throw`, async () => {\n      await [null, undefined, 0, -1, 'NaN'].forEach(item => {\n        expectToThrow(() => e.element(e.by.id('someId')).multiTap(item));\n      });\n      await expectToThrow(() => e.element(e.by.id('someId')).typeText(0));\n      await expectToThrow(() => e.element(e.by.id('someId')).replaceText(3));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).pinch('NaN', 'slow', 0.1));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinch(1, 1, 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinch(1, 'noSpeed', 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinch(1, 'slow', 'NaN'));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).pinchWithAngle('noDirection', 'slow', 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinchWithAngle(1, 'slow', 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinchWithAngle('outward', 1, 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinchWithAngle('outward', 'noDirection', 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).pinchWithAngle('outward', 'slow', 'NaN'));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).replaceText(3));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).scroll('NaN', 'down'));\n      await expectToThrow(() => e.element(e.by.id('someId')).scroll(100, 'noDirection'));\n      await expectToThrow(() => e.element(e.by.id('someId')).scroll(100, 'down', 0, 's'));\n      await expectToThrow(() => e.element(e.by.id('someId')).scroll(100, 'down', 's', 's'));\n      await expectToThrow(() => e.element(e.by.id('someId')).scroll(100, 0));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).scrollTo(0));\n      await expectToThrow(() => e.element(e.by.id('someId')).scrollTo('noDirection'));\n      await expectToThrow(() => e.element(e.by.id('someId')).scrollTo('top','Nan', 0.5));\n      await expectToThrow(() => e.element(e.by.id('someId')).scrollTo('top', 0.5, 'Nan'));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe(4, 'fast'));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('left', 'fast', 20));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('noDirection', 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('noDirection', 'fast'));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('down', 'NotFastNorSlow'));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('down', 'NotFastNorSlow', 0.9));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('down', 'fast', 0.9, 100, 0));\n      await expectToThrow(() => e.element(e.by.id('someId')).swipe('down', 'fast', 0.9, 0, 100));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).atIndex('NaN'));\n\n      await expectToThrow(() => e.element(e.by.id('UIPickerView')).setDatePickerDate(0, 'mm'));\n      await expectToThrow(() => e.element(e.by.id('UIPickerView')).setDatePickerDate('mm', 0));\n      await expectToThrow(() => e.element(e.by.id('UIPickerView')).setDatePickerDate(0, 0));\n\n      await expectToThrow(() => e.element(e.by.id('slider')).adjustSliderToPosition(2));\n      await expectToThrow(() => e.element(e.by.id('slider')).adjustSliderToPosition(-1));\n      await expectToThrow(() => e.element(e.by.id('slider')).adjustSliderToPosition(NaN));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).longPress('notANumber'));\n      await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, 1000));\n      await expectToThrow(() => e.element(e.by.id('someId')).longPress({ x: 'notANumber', y: 10 }, 1000));\n      await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, { x: 10, y: 5 }));\n      await expectToThrow(() => e.element(e.by.id('someId')).longPress({ x: 10, y: 'notANumber' }, 1000));\n\n      await expectToThrow(() => e.element(e.by.id('elementToDrag')).longPressAndDrag(1000, 0.5, 0.5, e.by.id('matcherNotElement')));\n      await expectToThrow(() => e.element(e.by.id('elementToDrag')).longPressAndDrag('notANumber', 0.5, 0.5, e.element(e.by.id('targetElement'))));\n      await expectToThrow(() => e.element(e.by.id('elementToDrag')).longPressAndDrag(1000, 0.5, 0.5, e.element(e.by.id('targetElement')), 0.5, 0.5, 'slow', 'notANumber'));\n\n      await expectToThrow(() => e.element(e.by.id('someId')).performAccessibilityAction());\n    });\n\n    it('should properly call system interactions', async () => {\n      await e.system.element(e.by.system.label('Tap Me')).atIndex(2).tap();\n    });\n\n    it('should throw for invalid element-index for system interactions', async () => {\n      await expectToThrow(() => e.system.element(e.by.system.label('tapMe')).atIndex('NaN'));\n    });\n\n    it('should properly call secured web interactions', async () => {\n      await e.web.element(e.by.web.label('Tap Me')).atIndex(0).asSecured().tap();\n    });\n  });\n\n  describe('WaitFor', () => {\n    it(`waitFor (element)`, async () => {\n      await e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible();\n      await e.waitFor(e.element(e.by.id('id'))).toBeNotVisible();\n      await e.waitFor(e.element(e.by.id('id'))).toExist();\n      await e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toNotExist().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toHaveId('text');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveId('text');\n      await e.waitFor(e.element(e.by.id('id'))).toHaveText('text');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveText('NoText');\n      await e.waitFor(e.element(e.by.id('id'))).toHaveLabel('value');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveLabel('value');\n      await e.waitFor(e.element(e.by.id('id'))).toHaveValue('value');\n      await e.waitFor(e.element(e.by.id('id'))).toNotHaveValue('value');\n      await e.waitFor(e.element(e.by.id('id'))).toBeFocused().withTimeout(0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeNotFocused().withTimeout(0);\n    });\n\n    it(`waitFor (element) with wrong parameters should throw`, async () => {\n      await expectToThrow(() => e.waitFor('notAnElement'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout('notANumber'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(-1));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement('notAMatcher'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress('notANumber'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress(40, 40));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress(40, { x: 43, y: 'notANumber' }));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress(40, { x: 'notANumber', y: 43 }));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).multiTap('notANumber'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapAtPoint('notAPoint'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapAtPoint({ notx: 1, y: 3 }));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapAtPoint({ x: 1, noty: 3 }));\n      // await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapBackspaceKey());\n      // await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapReturnKey());\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).typeText(2));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).replaceText(2));\n      // await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).clearText());\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50, 'notADirection', 0, 0));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scrollTo('notADirection'));\n      await expectToThrow(() => e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).performAccessibilityAction());\n    });\n\n    it(`waitFor....whileElement() actions`, async () => {\n      await e.waitFor(e.element(e.by.id('id'))).toExist().withTimeout(2000);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tap();\n      await e.waitFor(e.element(e.by.id('id'))).not.toBeVisible().whileElement(e.by.id('id2')).tap();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress(20);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress({ x: 15, y: 100 }, 20);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).longPress({ x: 15, y: 100 });\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).multiTap(2);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapAtPoint({ x: 1, y: 1 });\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapBackspaceKey();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).tapReturnKey();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).typeText('text');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).replaceText('text');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).clearText();\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50, 'down');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scroll(50, 'down', 0, 0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scrollTo('left');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).scrollTo('left', 0.1, 0.1);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).swipe('left');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).swipe('left', 'fast');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).swipe('left', 'slow', 0.1);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).setColumnToValue(1, 'value');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).setDatePickerDate('2019-2-8T05:10:00-08:00', 'yyyy-MM-dd\\'T\\'HH:mm:ssZZZZZ');\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).pinchWithAngle('outward', 'fast', 0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).pinch(1, 'fast', 0);\n      await e.waitFor(e.element(e.by.id('id'))).toBeVisible().whileElement(e.by.id('id2')).performAccessibilityAction('activate');\n    });\n\n    it(`waitFor (element) with non-elements should throw`, async () => {\n      await expectToThrow(() => e.waitFor('notAnElement').toBeVisible());\n    });\n  });\n});\n\nasync function expectToThrow(func) {\n  const asyncWrapper = async () => await func();\n  await expect(asyncWrapper()).rejects.toThrow();\n}\n\nclass MockExecutor {\n  async execute(invocation) {\n    return invocation;\n  }\n}\n"
  },
  {
    "path": "detox/src/ios/system.js",
    "content": "const { DetoxRuntimeError } = require('../errors');\nconst { assertTraceDescription } = require('../utils/assertArgument');\nconst { systemActionDescription, expectDescription } = require('../utils/invocationTraceDescriptions');\nconst log = require('../utils/logger').child({ cat: 'ws-client, ws' });\nconst traceInvocationCall = require('../utils/traceInvocationCall').bind(null, log);\n\n\nclass SystemExpect {\n  constructor(xcuitestRunner, element) {\n    this._xcuitestRunner = xcuitestRunner;\n    this.element = element;\n    this.modifiers = [];\n  }\n\n  toExist() {\n    const traceDescription = expectDescription.toExist();\n    return this.expect('toExist', traceDescription);\n  }\n\n  get not() {\n    this.modifiers.push('not');\n    return this;\n  }\n\n  createInvocation(systemExpectation) {\n    return {\n      type: 'systemExpectation',\n      systemPredicate: this.element.matcher.predicate,\n      ...(this.element.index !== undefined && { systemAtIndex: this.element.index }),\n      ...(this.modifiers.length !== 0 && { systemModifiers: this.modifiers }),\n      systemExpectation\n    };\n  }\n\n  expect(expectation, traceDescription) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = this.createInvocation(expectation);\n    traceDescription = expectDescription.full(traceDescription, this.modifiers.includes('not'));\n    return _executeInvocation(this._xcuitestRunner, invocation, traceDescription);\n  }\n}\n\nclass SystemElement {\n  constructor(xcuitestRunner, matcher, index) {\n    this._xcuitestRunner = xcuitestRunner;\n    this.matcher = matcher;\n    this.index = index;\n  }\n\n  atIndex(index) {\n    if (typeof index !== 'number' || index < 0) throw new DetoxRuntimeError(`index should be an integer, got ${index} (${typeof index})`);\n    this.index = index;\n    return this;\n  }\n\n  tap() {\n    const traceDescription = systemActionDescription.tap();\n    return this.withAction('tap', traceDescription);\n  }\n\n  withAction(action, traceDescription) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = {\n      type: 'systemAction',\n      systemPredicate: this.matcher.predicate,\n      ...(this.index !== undefined && { systemAtIndex: this.index }),\n      systemAction: action\n    };\n    traceDescription = systemActionDescription.full(traceDescription);\n    return _executeInvocation(this._xcuitestRunner, invocation, traceDescription);\n  }\n}\n\nclass SystemElementMatcher {\n  label(label) {\n    if (typeof label !== 'string') throw new DetoxRuntimeError('label should be a string, but got ' + (label + (' (' + typeof label + ')')));\n    this.predicate = { type: 'label', value: label.toString() };\n    return this;\n  }\n\n  type(type) {\n    if (typeof type !== 'string') throw new DetoxRuntimeError('type should be a string, but got ' + (type + (' (' + typeof type + ')')));\n    this.predicate = { type: 'type', value: type.toString() };\n    return this;\n  }\n}\n\nfunction systemMatcher() {\n  return new SystemElementMatcher();\n}\n\nfunction systemElement(xcuitestRunner, matcher) {\n  if (!(matcher instanceof SystemElementMatcher)) {\n    throwSystemMatcherError(matcher);\n  }\n\n  return new SystemElement(xcuitestRunner, matcher);\n}\n\nfunction throwSystemMatcherError(param) {\n  const paramDescription = JSON.stringify(param);\n  throw new DetoxRuntimeError(`${paramDescription} is not a Detox system matcher. More about system matchers here: https://wix.github.io/Detox/docs/api/system`);\n}\n\nfunction systemExpect(xcuitestRunner, element) {\n  return new SystemExpect(xcuitestRunner, element);\n}\n\nfunction _executeInvocation(xcuitestRunner, invocation, traceDescription) {\n  return traceInvocationCall(traceDescription, invocation, xcuitestRunner.execute(invocation));\n}\n\nfunction isSystemElement(element) {\n  return element instanceof SystemElement;\n}\n\nmodule.exports = {\n  systemMatcher,\n  systemElement,\n  systemExpect,\n  isSystemElement\n};\n"
  },
  {
    "path": "detox/src/ios/web.js",
    "content": "const _ = require('lodash');\n\nconst { DetoxRuntimeError } = require('../errors');\nconst { assertTraceDescription } = require('../utils/assertArgument');\nconst { webViewActionDescription, expectDescription } = require('../utils/invocationTraceDescriptions');\nconst log = require('../utils/logger').child({ cat: 'ws-client, ws' });\nconst sleep = require('../utils/sleep');\nconst traceInvocationCall = require('../utils/traceInvocationCall').bind(null, log);\n\nclass WebExpect {\n  constructor(invocationManager, xcuitestRunner, element) {\n    this._invocationManager = invocationManager;\n    this._xcuitestRunner = xcuitestRunner;\n    this.element = element;\n    this.modifiers = [];\n  }\n\n  toHaveText(text) {\n    if (typeof text !== 'string') throw new DetoxRuntimeError('text should be a string, but got ' + (text + (' (' + (typeof text + ')'))));\n\n    const traceDescription = expectDescription.toHaveText(text);\n    return this.expect('toHaveText', traceDescription, text);\n  }\n\n  toExist() {\n    const traceDescription = expectDescription.toExist();\n    return this.expect('toExist', traceDescription);\n  }\n\n  get not() {\n    this.modifiers.push('not');\n    return this;\n  }\n\n  createInvocation(webExpectation, ...params) {\n    const definedParams = _.without(params, undefined);\n    return {\n      type: 'webExpectation',\n      ...(this.element.webViewElement !== undefined) && {\n        predicate: this.element.webViewElement.matcher.predicate,\n        ...(this.element.webViewElement.matcher.index !== undefined && { atIndex: this.element.webViewElement.matcher.index }),\n      },\n      webPredicate: this.element.matcher.predicate,\n      ...(this.element.index !== undefined && { webAtIndex: this.element.index }),\n      ...(this.modifiers.length !== 0 && { webModifiers: this.modifiers }),\n      webExpectation,\n      ...(definedParams.length !== 0 && { params: definedParams })\n    };\n  }\n\n  expect(expectation, traceDescription, ...params) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = this.createInvocation(expectation, ...params);\n    traceDescription = expectDescription.full(traceDescription, this.modifiers.includes('not'));\n\n    const invocationRunner = this.element.isSecured ? this._xcuitestRunner : this._invocationManager;\n    return _executeInvocation(invocationRunner, invocation, traceDescription);\n  }\n}\n\nclass WebElement {\n  constructor(invocationManager, xcuitestRunner, emitter, webViewElement, matcher, index) {\n    this._invocationManager = invocationManager;\n    this._xcuitestRunner = xcuitestRunner;\n    this._emitter = emitter;\n    this.webViewElement = webViewElement;\n    this.matcher = matcher;\n    this.index = index;\n    this.isSecured = false;\n  }\n\n  asSecured() {\n    const supportedMatcherTypes = ['label', 'type'];\n    const matcherType = this.matcher.predicate.type;\n\n    if (!supportedMatcherTypes.includes(matcherType)) {\n      throw new DetoxRuntimeError(`Only matchers of type ${supportedMatcherTypes.join(', ')} can be secured, got ${matcherType}`);\n    }\n\n    this.isSecured = true;\n    return this;\n  }\n\n  atIndex(index) {\n    if (typeof index !== 'number' || index < 0) throw new DetoxRuntimeError(`index should be an integer, got ${index} (${typeof index})`);\n    this.index = index;\n    return this;\n  }\n\n  tap() {\n    const traceDescription = webViewActionDescription.tap();\n    return this.withAction('tap', traceDescription);\n  }\n\n  typeText(text, isContentEditable = false) {\n    const traceDescription = webViewActionDescription.typeText(text, isContentEditable);\n    return this.withAction('typeText', traceDescription, text);\n  }\n\n  replaceText(text) {\n    const traceDescription = webViewActionDescription.replaceText(text);\n    return this.withAction('replaceText', traceDescription, text);\n  }\n\n  clearText() {\n    const traceDescription = webViewActionDescription.clearText();\n    return this.withAction('clearText', traceDescription);\n  }\n\n  selectAllText() {\n    const traceDescription = webViewActionDescription.selectAllText();\n    return this.withAction('selectAllText', traceDescription);\n  }\n\n  async getText() {\n    const traceDescription = webViewActionDescription.getText();\n    let result = await this.withAction('getText', traceDescription);\n    return this.extractResult(result, { type: 'text' });\n  }\n\n  extractResult(result, options) {\n    // iOS returns the result under `result` key, while Android returns it under the action `type` key.\n    if (result['error']) {\n      throw new DetoxRuntimeError(`Error thrown in web action: ${result['error']}`);\n    } else if (options.type && result[options.type]) {\n      return result[options.type];\n    } else if (result['result']) {\n      return result['result'];\n    } else if (options.allowUndefined && Object.keys(result).length === 0) {\n      return undefined;\n    } else {\n      log.warn(`Failed to extract ${options.type ?? 'result'} from result: ${JSON.stringify(result)}`);\n      return result;\n    }\n  }\n\n  async scrollToView() {\n    const traceDescription = webViewActionDescription.scrollToView();\n\n    const result = await this.withAction('scrollToView', traceDescription);\n\n    // TODO Synchronization is not perfect here. We have to fix and remove this sleep ASAP.\n    //  See https://github.com/wix/Detox/issues/4741\n    await sleep(50);\n    return result;\n  }\n\n  focus() {\n    const traceDescription = webViewActionDescription.focus();\n    return this.withAction('focus', traceDescription);\n  }\n\n  moveCursorToEnd() {\n    const traceDescription = webViewActionDescription.moveCursorToEnd();\n    return this.withAction('moveCursorToEnd', traceDescription);\n  }\n\n  async runScript(script, args) {\n    if (args !== undefined && args.length !== 0) {\n      return await this.runScriptWithArgs(script, args);\n    }\n\n    if (typeof script === 'function') {\n      script = script.toString();\n    }\n\n    const traceDescription = webViewActionDescription.runScript(script);\n    const result = await this.withAction('runScript', traceDescription, script);\n    return this.extractResult(result, { allowUndefined: true });\n  }\n\n  async runScriptWithArgs(script, args) {\n    if (typeof script === 'function') {\n      script = script.toString();\n    }\n\n    const traceDescription = webViewActionDescription.runScriptWithArgs(script, args);\n    const result = await this.withAction('runScriptWithArgs', traceDescription, script, args);\n    return this.extractResult(result, { allowUndefined: true });\n  }\n\n  async getCurrentUrl() {\n    const traceDescription = webViewActionDescription.getCurrentUrl();\n    let result = await this.withAction('getCurrentUrl', traceDescription);\n    return this.extractResult(result, { type: 'url' });\n  }\n\n  async getTitle() {\n    const traceDescription = webViewActionDescription.getTitle();\n    let result = await this.withAction('getTitle', traceDescription);\n    return this.extractResult(result, { type: 'title' });\n  }\n\n  withAction(action, traceDescription, ...params) {\n    assertTraceDescription(traceDescription);\n\n    const invocation = {\n      type: 'webAction',\n      ...(this.webViewElement !== undefined) && {\n        predicate: this.webViewElement.matcher.predicate,\n        ...(this.webViewElement.matcher.index !== undefined && { atIndex: this.webViewElement.matcher.index }),\n      },\n      webPredicate: this.matcher.predicate,\n      ...(this.index !== undefined && { webAtIndex: this.index }),\n      webAction: action,\n      ...(params.length !== 0 && { params }),\n    };\n    traceDescription = webViewActionDescription.full(traceDescription);\n\n    const invocationRunner = this.isSecured ? this._xcuitestRunner : this._invocationManager;\n    return _executeInvocation(invocationRunner, invocation, traceDescription);\n  }\n}\n\nclass WebElementMatcher {\n  id(id) {\n    if (typeof id !== 'string') throw new DetoxRuntimeError('id should be a string, but got ' + (id + (' (' + (typeof id + ')'))));\n    this.predicate = { type: 'id', value: id.toString() };\n    return this;\n  }\n\n  className(className) {\n    if (typeof className !== 'string') throw new DetoxRuntimeError('className should be a string, but got ' + (className + (' (' + (typeof className + ')'))));\n    this.predicate = { type: 'class', value: className.toString() };\n    return this;\n  }\n\n  cssSelector(cssSelector) {\n    if (typeof cssSelector !== 'string') throw new DetoxRuntimeError('cssSelector should be a string, but got ' + (cssSelector + (' (' + (typeof cssSelector + ')'))));\n    this.predicate = { type: 'css', value: cssSelector.toString() };\n    return this;\n  }\n\n  name(name) {\n    if (typeof name !== 'string') throw new DetoxRuntimeError('name should be a string, but got ' + (name + (' (' + (typeof name + ')'))));\n    this.predicate = { type: 'name', value: name.toString() };\n    return this;\n  }\n\n  xpath(xpath) {\n    if (typeof xpath !== 'string') throw new DetoxRuntimeError('xpath should be a string, but got ' + (xpath + (' (' + (typeof xpath + ')'))));\n    this.predicate = { type: 'xpath', value: xpath.toString() };\n    return this;\n  }\n\n  href(href) {\n    if (typeof href !== 'string') throw new DetoxRuntimeError('href should be a string, but got ' + (href + (' (' + (typeof href + ')'))));\n    this.predicate = { type: 'href', value: href.toString() };\n    return this;\n  }\n\n  hrefContains(href) {\n    if (typeof href !== 'string') throw new DetoxRuntimeError('href should be a string, but got ' + (href + (' (' + (typeof href + ')'))));\n    this.predicate = { type: 'hrefContains', value: href.toString() };\n    return this;\n  }\n\n  tag(tag) {\n    if (typeof tag !== 'string') throw new DetoxRuntimeError('tag should be a string, but got ' + (tag + (' (' + (typeof tag + ')'))));\n    this.predicate = { type: 'tag', value: tag.toString() };\n    return this;\n  }\n\n  label(label) {\n    if (typeof label !== 'string') throw new DetoxRuntimeError('label should be a string, but got ' + (label + (' (' + (typeof label + ')'))));\n    this.predicate = { type: 'label', value: label.toString() };\n    return this;\n  }\n\n  value(value) {\n    if (typeof value !== 'string') throw new DetoxRuntimeError('value should be a string, but got ' + (value + (' (' + (typeof value + ')'))));\n    this.predicate = { type: 'value', value: value.toString() };\n    return this;\n  }\n\n  type(type) {\n    if (typeof type !== 'string') throw new DetoxRuntimeError('type should be a string, but got ' + (type + (' (' + (typeof type + ')'))));\n    this.predicate = { type: 'type', value: type.toString() };\n    return this;\n  }\n}\n\nfunction webMatcher() {\n  return new WebElementMatcher();\n}\n\nfunction webElement(invocationManager, xcuitestRunner, emitter, webViewElement, matcher) {\n  if (!(matcher instanceof WebElementMatcher)) {\n    throwWebViewMatcherError(matcher);\n  }\n\n  return new WebElement(invocationManager, xcuitestRunner, emitter, webViewElement, matcher);\n}\n\nfunction throwWebViewMatcherError(param) {\n  const paramDescription = JSON.stringify(param);\n  throw new DetoxRuntimeError(`${paramDescription} is not a Detox web-view matcher. More about web-view matchers here: https://wix.github.io/Detox/docs/api/webviews`);\n}\n\nfunction webExpect(invocationManager, xcuitestRunner, element) {\n  return new WebExpect(invocationManager, xcuitestRunner, element);\n}\n\nfunction _executeInvocation(invocationManager, invocation, traceDescription) {\n  return traceInvocationCall(traceDescription, invocation, invocationManager.execute(invocation));\n}\n\nfunction isWebElement(element) {\n  return element instanceof WebElement;\n}\n\nmodule.exports = {\n  webMatcher,\n  webElement,\n  webExpect,\n  isWebElement\n};\n"
  },
  {
    "path": "detox/src/ipc/IPCClient.js",
    "content": "const { IPC } = require('node-ipc');\n\nconst { DetoxInternalError } = require('../errors');\nconst { serializeObjectWithError, deserializeObjectWithError } = require('../utils/errorUtils');\n\nclass IPCClient {\n  constructor({ id, logger, sessionState }) {\n    this._id = id;\n    /** @type {import('../logger/DetoxLogger')} logger */\n    this._logger = logger.child({ cat: 'ipc' });\n    /** @type {import('./SessionState')} */\n    this._sessionState = sessionState;\n\n    this._ipc = null;\n    this._serverConnection = null;\n  }\n\n  async init() {\n    this._ipc = new IPC();\n\n    Object.assign(this._ipc.config, {\n      id: this._id,\n      appspace: 'detox.',\n      logger: (msg) => this._logger.trace(msg),\n      stopRetrying: 0,\n      maxRetries: 0,\n    });\n\n    await this._connectToServer();\n    await this._registerContext();\n  }\n\n  async dispose() {\n    this._serverConnection = null;\n\n    if (this._ipc) {\n      await new Promise((resolve, reject) => {\n        this._ipc.of[this.serverId]\n          // @ts-ignore\n          .once('disconnect', resolve)\n          .once('error', reject);\n\n        this._ipc.disconnect(this.serverId);\n      });\n\n      this._ipc = null;\n    }\n  }\n\n  get sessionState() {\n    return this._sessionState;\n  }\n\n  get serverId() {\n    return this.sessionState.detoxIPCServer;\n  }\n\n  async registerWorker(workerId) {\n    const sessionState = await this._emit('registerWorker', { workerId });\n    this._sessionState.patch(sessionState);\n  }\n\n  async allocateDevice(deviceConfig) {\n    const { deviceCookie, error } = deserializeObjectWithError(await this._emit('allocateDevice', { deviceConfig }));\n    if (error) {\n      throw error;\n    }\n\n    return deviceCookie;\n  }\n\n  async deallocateDevice(deviceCookie) {\n    const { error } = deserializeObjectWithError(await this._emit('deallocateDevice', { deviceCookie }));\n    if (error) {\n      throw error;\n    }\n  }\n\n  /**\n   * @param {DetoxInternals.DetoxTestFileReport[]} testResults\n   */\n  async reportTestResults(testResults) {\n    const sessionState = await this._emit('reportTestResults', {\n      testResults: testResults.map(r => serializeObjectWithError(r, 'testExecError')),\n    });\n    this._sessionState.patch(sessionState);\n  }\n\n  async conductEarlyTeardown({ permanent }) {\n    const sessionState = await this._emit('conductEarlyTeardown', { permanent });\n    this._sessionState.patch(sessionState);\n  }\n\n  async _connectToServer() {\n    const serverId = this.serverId;\n\n    this._serverConnection = await new Promise((resolve, reject) => {\n      this._ipc.connectTo(serverId, (client) => {\n        client.of[serverId]\n          .once('error', reject)\n          .once('disconnect', () => reject(new DetoxInternalError('IPC server has unexpectedly disconnected.')))\n          .once('connect', () => resolve(client.of[serverId]));\n      });\n    });\n\n    this._serverConnection.on('sessionStateUpdate', this._onSessionStateUpdate);\n  }\n\n  async _registerContext() {\n    const sessionState = await this._emit('registerContext', { id: this._id });\n    this._sessionState.patch(sessionState);\n  }\n\n  async _emit(event, payload) {\n    if (!this._serverConnection) {\n      throw new DetoxInternalError(`IPC server ${this.serverId} has unexpectedly disconnected.`);\n    }\n\n    return new Promise((resolve, reject) => {\n      const server = this._serverConnection;\n\n      /* istanbul ignore next */\n      function onError(err) {\n        server.off('error', onError);\n        server.off(`${event}Done`, onDone);\n        reject(err);\n      }\n\n      function onDone(response) {\n        server.off(`${event}Done`, onDone);\n        server.off('error', onError);\n        resolve(response);\n      }\n\n      server\n        .on('error', onError)\n        .on(`${event}Done`, onDone)\n        .emit(event, payload);\n    });\n  }\n\n  _onSessionStateUpdate = (payload) => {\n    this._sessionState.patch(payload);\n  };\n}\n\nmodule.exports = IPCClient;\n"
  },
  {
    "path": "detox/src/ipc/IPCServer.js",
    "content": "const { uniqBy } = require('lodash');\nconst { IPC } = require('node-ipc');\n\nconst { serializeObjectWithError } = require('../utils/errorUtils');\n\nclass IPCServer {\n  /**\n   * @param {object} options\n   * @param {import('./SessionState')} options.sessionState\n   * @param {Detox.Logger} options.logger\n   * @param {object} options.callbacks\n   * @param {(deviceConfig: DetoxInternals.RuntimeConfig['device']) => Promise<any>} options.callbacks.onAllocateDevice\n   * @param {(cookie: any) => Promise<void>} options.callbacks.onDeallocateDevice\n   */\n  constructor({ sessionState, logger, callbacks }) {\n    this._sessionState = sessionState;\n    this._logger = logger.child({ cat: 'ipc,ipc-server' });\n    this._ipc = null;\n    this._callbacks = callbacks;\n    this._workers = new Set();\n    this._contexts = new Set();\n  }\n\n  get id() {\n    return this._sessionState.detoxIPCServer;\n  }\n\n  get contexts() {\n    return [...this._contexts];\n  }\n\n  get sessionState() {\n    return this._sessionState;\n  }\n\n  async init() {\n    this._ipc = new IPC();\n    this._ipc.config.id = this.id;\n    this._ipc.config.appspace = 'detox.';\n    this._ipc.config.logger = (msg) => this._logger.trace(msg);\n\n    await new Promise((resolve) => {\n      // It is worth to handle rejection here some day\n      this._ipc.serve(() => resolve());\n      this._ipc.server.on('conductEarlyTeardown', this.onConductEarlyTeardown.bind(this));\n      this._ipc.server.on('registerContext', this.onRegisterContext.bind(this));\n      this._ipc.server.on('registerWorker', this.onRegisterWorker.bind(this));\n      this._ipc.server.on('reportTestResults', this.onReportTestResults.bind(this));\n      this._ipc.server.on('allocateDevice', this.onAllocateDevice.bind(this));\n      this._ipc.server.on('deallocateDevice', this.onDeallocateDevice.bind(this));\n      this._ipc.server.start();\n    });\n  }\n\n  async dispose() {\n    if (!this._ipc) {\n      return;\n    }\n\n    await new Promise((resolve, reject) =>{\n      // @ts-ignore\n      this._ipc.server.server.close(e => /* istanbul ignore next */\n        e ? reject(e) : resolve());\n      this._ipc.server.stop();\n    });\n\n    this._ipc = null;\n  }\n\n  onRegisterContext({ id }, socket) {\n    this._contexts.add(id);\n\n    this._ipc.server.emit(socket, 'registerContextDone', {\n      testResults: this._sessionState.testResults,\n      testSessionIndex: this._sessionState.testSessionIndex,\n      unsafe_earlyTeardown: this._sessionState.unsafe_earlyTeardown,\n    });\n  }\n\n  onRegisterWorker({ workerId }, socket = null) {\n    const workersCount = this._workers.add(workerId).size;\n    const shouldBroadcast = workersCount > this._sessionState.workersCount;\n    this._sessionState.workersCount = workersCount;\n\n    if (socket) {\n      this._ipc.server.emit(socket, 'registerWorkerDone', { workersCount });\n    }\n\n    if (shouldBroadcast) {\n      this._ipc.server.broadcast('sessionStateUpdate', { workersCount });\n    }\n  }\n\n  onConductEarlyTeardown({ permanent }, socket = null) {\n    const newState = { unsafe_earlyTeardown: true };\n    if (permanent) {\n      Object.assign(this._sessionState, newState);\n    }\n\n    if (socket) {\n      this._ipc.server.emit(socket, 'conductEarlyTeardownDone', newState);\n    }\n\n    this._ipc.server.broadcast('sessionStateUpdate', newState);\n  }\n\n  async onAllocateDevice({ deviceConfig }, socket) {\n    let deviceCookie;\n\n    try {\n      deviceCookie = await this._callbacks.onAllocateDevice(deviceConfig);\n      this._ipc.server.emit(socket, 'allocateDeviceDone', { deviceCookie });\n    } catch (error) {\n      this._ipc.server.emit(socket, 'allocateDeviceDone', serializeObjectWithError({ error }));\n    }\n  }\n\n  async onDeallocateDevice({ deviceCookie }, socket) {\n    try {\n      await this._callbacks.onDeallocateDevice(deviceCookie);\n      this._ipc.server.emit(socket, 'deallocateDeviceDone', {});\n    } catch (error) {\n      this._ipc.server.emit(socket, 'deallocateDeviceDone', serializeObjectWithError({ error }));\n    }\n  }\n\n  onReportTestResults({ testResults }, socket = null) {\n    const merged = uniqBy([\n      ...testResults.map(r => serializeObjectWithError(r, 'testExecError')),\n      ...this._sessionState.testResults\n    ], 'testFilePath');\n\n    this._sessionState.testResults.splice(0, Infinity, ...merged);\n\n    if (socket) {\n      this._ipc.server.emit(socket, 'reportTestResultsDone', {\n        testResults: this._sessionState.testResults,\n      });\n    }\n\n    this._ipc.server.broadcast('sessionStateUpdate', {\n      testResults: this._sessionState.testResults,\n    });\n  }\n}\n\nmodule.exports = IPCServer;\n"
  },
  {
    "path": "detox/src/ipc/SessionState.js",
    "content": "const vm = require('vm');\n\nconst cycle = require('json-cycle');\n\nconst context = vm.createContext({ require }, {\n  name: 'VM User Context',\n});\n\nclass SessionState {\n  constructor({\n    id = '',\n    detoxConfig = null,\n    detoxIPCServer = '',\n    testResults = [],\n    testSessionIndex = 0,\n    workersCount = 0\n  }) {\n    this.id = id;\n    this.detoxConfig = detoxConfig;\n    this.detoxIPCServer = detoxIPCServer;\n    this.testResults = testResults;\n    this.testSessionIndex = testSessionIndex;\n    this.unsafe_earlyTeardown = undefined;\n    this.workersCount = workersCount;\n  }\n\n  patch(state) {\n    Object.assign(this, state);\n  }\n\n  stringify() {\n    return cycle.stringify(this, SessionState._stringifier);\n  }\n\n  /**\n   * @return {*}\n   */\n  static parse(stringified) {\n    const Class = this; // eslint-disable-line unicorn/no-this-assignment\n    // @ts-ignore\n    return new Class(cycle.parse(stringified, SessionState._reviver));\n  }\n\n  static _reviver(key, val) {\n    if (typeof val === 'object' && val !== null && typeof val.$fn == 'string') {\n      return vm.runInContext(val.$fn, context);\n    } else {\n      return val;\n    }\n  }\n\n  static _stringifier(key, val) {\n    if (typeof val === 'function') {\n      return { $fn: `(${val})` };\n    } else {\n      return val;\n    }\n  }\n}\n\nmodule.exports = SessionState;\n"
  },
  {
    "path": "detox/src/ipc/SessionState.test.js",
    "content": "const SessionState = require('./SessionState');\n\ndescribe('SessionState', () => {\n  /** @type {function} */\n  let someFunction;\n\n  /** @type {SessionState} */\n  let sessionState;\n\n  beforeEach(() => {\n    someFunction = () => { return 'foo'; };\n\n    sessionState = new SessionState({\n      id: '123',\n      detoxConfig: {\n        someFunction\n      },\n      detoxIPCServer: 'server',\n      testResults: ['result1', 'result2'],\n      testSessionIndex: 1,\n      workersCount: 2,\n    });\n  });\n\n  describe('when created without arguments', () => {\n    it('should have default values', () => {\n      expect(new SessionState({})).toEqual({\n        id: '',\n        detoxConfig: null,\n        detoxIPCServer: '',\n        testResults: [],\n        testSessionIndex: 0,\n        workersCount: 0,\n      });\n    });\n  });\n\n  it('should create the new session state with the given properties', () => {\n    expect(sessionState.id).toEqual('123');\n    expect(sessionState.detoxConfig).toEqual({ someFunction });\n    expect(sessionState.detoxIPCServer).toEqual('server');\n    expect(sessionState.testResults).toEqual(['result1', 'result2']);\n    expect(sessionState.testSessionIndex).toEqual(1);\n    expect(sessionState.workersCount).toEqual(2);\n  });\n\n  describe('patch', () => {\n    it('should update the session state', () => {\n      sessionState.patch({\n        testResults: ['result3', 'result4'],\n        testSessionIndex: 2,\n        workersCount: 3,\n      });\n\n      expect(sessionState.testResults).toEqual(['result3', 'result4']);\n      expect(sessionState.testSessionIndex).toEqual(2);\n      expect(sessionState.workersCount).toEqual(3);\n    });\n\n    it('should not update with null params', () => {\n      sessionState.patch({\n        workersCount: 3,\n      });\n\n      expect(sessionState.testResults).toEqual(['result1', 'result2']);\n      expect(sessionState.testSessionIndex).toEqual(1);\n      expect(sessionState.workersCount).toEqual(3);\n    });\n  });\n\n  it('should stringify correctly', () => {\n    const expected = '{\"id\":\"123\",' +\n      '\"detoxConfig\":{\"someFunction\":{\"$fn\":\"(() => {\\\\n      return \\'foo\\';\\\\n    })\"}},' +\n      '\"detoxIPCServer\":\"server\",\"testResults\":[\"result1\",\"result2\"],\"testSessionIndex\":1,\"workersCount\":2}';\n\n    expect(sessionState.stringify()).toEqual(expected);\n  });\n\n  it('should parse stringified session state to class instance', () => {\n    const stringified = '{\"id\":\"123\",' +\n      '\"detoxConfig\":{\"someFunction\":{\"$fn\":\"(() => {\\\\n      return \\'foo\\';\\\\n    })\"}},' +\n      '\"detoxIPCServer\":\"server\",\"testResults\":[\"result1\",\"result2\"],\"testSessionIndex\":1,\"workersCount\":2}';\n\n    const parsed = SessionState.parse(stringified);\n    // There's no way to compare anonymous functions, so we'll just compare their stringified versions.\n    expect(parsed.detoxConfig.someFunction.toString()).toEqual(someFunction.toString());\n    expect(parsed.detoxConfig.someFunction()).toEqual(someFunction());\n\n    // We're comparing the parsed object to the original object, but we remove the functions from the objects since\n    // there's no way to compare anonymous functions.\n    delete parsed.detoxConfig.someFunction;\n    delete sessionState.detoxConfig.someFunction;\n    expect(parsed).toEqual(sessionState);\n  });\n});\n"
  },
  {
    "path": "detox/src/ipc/ipc.test.js",
    "content": "jest.setTimeout(1000);\njest.mock('../utils/logger');\n\nconst IPCClient = require('./IPCClient');\nconst IPCServer = require('./IPCServer');\nconst SessionState = require('./SessionState');\n\nconst sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n\ndescribe('IPC', () => {\n  /** @type {*} */\n  let logger;\n\n  /** @type {*} */\n  let sessionState;\n\n  /** @type {IPCServer} */\n  let ipcServer;\n\n  /** @type {IPCClient} */\n  let ipcClient1;\n\n  /** @type {IPCClient} */\n  let ipcClient2;\n\n  /**\n   * @type {{\n   *  onAllocateDevice: jest.Mock<any, any>,\n   *  onDeallocateDevice: jest.Mock<any, any>,\n   * }} */\n  let callbacks;\n\n  beforeEach(() => {\n    logger = jest.requireMock('../utils/logger');\n\n    sessionState = {\n      id: 'session-1',\n      detoxIPCServer: 'foo',\n    };\n\n    callbacks = {\n      onAllocateDevice: jest.fn(),\n      onDeallocateDevice: jest.fn(),\n    };\n\n    ipcServer = new IPCServer({\n      logger,\n      sessionState: new SessionState(sessionState),\n      callbacks,\n    });\n\n    ipcClient1 = new IPCClient({\n      id: 'bar',\n      logger,\n      sessionState: new SessionState(sessionState),\n    });\n\n    ipcClient2 = new IPCClient({\n      id: 'baz',\n      logger,\n      sessionState: new SessionState(sessionState)\n    });\n  });\n\n  afterEach(async () => {\n    await ipcClient1.dispose();\n    await ipcClient2.dispose();\n    await ipcServer.dispose();\n  });\n\n  describe('server', () => {\n    it('should have a correct session state', () => {\n      expect(ipcServer.sessionState).toEqual(new SessionState(sessionState));\n    });\n\n    it('should have a correct id', () => {\n      expect(ipcServer.id).toEqual(sessionState.detoxIPCServer);\n    });\n\n    describe('onRegisterContext', () => {\n      beforeEach(() => ipcServer.init());\n\n      it('cannot be called directly, only via IPC', async () => {\n        expect(() => ipcServer.onRegisterContext({ id: 'foo' })).toThrow();\n      });\n    });\n\n    describe('onRegisterWorker', () => {\n      beforeEach(() => ipcServer.init());\n\n      it('when called directly, should register a worker', async () => {\n        await ipcServer.onRegisterWorker({ workerId: 'worker-1' });\n        expect(ipcServer.sessionState.workersCount).toEqual(1);\n\n        await ipcServer.onRegisterWorker({ workerId: 'worker-2' });\n        expect(ipcServer.sessionState.workersCount).toEqual(2);\n      });\n\n      it('should not count the same worker twice', async () => {\n        await ipcServer.onRegisterWorker({ workerId: 'worker-1' });\n        expect(ipcServer.sessionState.workersCount).toEqual(1);\n\n        await ipcServer.onRegisterWorker({ workerId: 'worker-1' });\n        expect(ipcServer.sessionState.workersCount).toEqual(1);\n      });\n    });\n\n    describe('onReportTestResults', () => {\n      beforeEach(() => ipcServer.init());\n\n      const success = (testFilePath) => ({ testFilePath, success: true });\n      const failure = (testFilePath) => ({ testFilePath, success: false, testExecError: { message: 'error' } });\n\n      it('when called directly, should add test results', async () => {\n        const testResults = [success('test-1'), failure('test-2')];\n        await ipcServer.onReportTestResults({ testResults });\n        expect(ipcServer.sessionState.testResults).toEqual(testResults);\n      });\n\n      it('when called more than one time, should merge test results', async () => {\n        const testResults = [failure('test-1'), success('test-2')];\n        await ipcServer.onReportTestResults({ testResults });\n        await ipcServer.onReportTestResults({ testResults: [success('test-1')] });\n\n        expect(ipcServer.sessionState.testResults).toEqual([\n          success('test-1'),\n          success('test-2'),\n        ]);\n      });\n    });\n\n    describe('conductEarlyTeardown', () => {\n      beforeEach(() => ipcServer.init());\n\n      describe('(permanent)', () => {\n        beforeEach(() => ipcServer.onConductEarlyTeardown({ permanent: true }));\n\n        it('should change the session state', async () => {\n          expect(ipcServer.sessionState.unsafe_earlyTeardown).toEqual(true);\n        });\n\n        it('should pass the session state to the client', async () => {\n          await ipcClient1.init();\n          expect(ipcClient1.sessionState.unsafe_earlyTeardown).toEqual(true);\n        });\n      });\n\n      describe('(transient)', () => {\n        beforeEach(() => ipcServer.onConductEarlyTeardown({ permanent: false }));\n\n        it('should not change the session state', async () => {\n          expect(ipcServer.sessionState.unsafe_earlyTeardown).toBe(undefined);\n        });\n\n        it('should not pass the session state to the client', async () => {\n          await ipcClient1.init();\n          expect(ipcClient1.sessionState.unsafe_earlyTeardown).toBe(undefined);\n        });\n      });\n    });\n\n    describe('dispose()', () => {\n      it('should resolve if there are no connected clients', async () => {\n        await ipcServer.init();\n        await expect(ipcServer.dispose()).resolves.toBeUndefined();\n      });\n\n      it('should wait for connected clients to disconnect', async () => {\n        await ipcServer.init();\n        await ipcClient1.init();\n\n        const disposePromise = ipcServer.dispose();\n        const waitPromise = sleep(100).then(() => 'waited');\n        await expect(Promise.race([disposePromise, waitPromise])).resolves.toBe('waited');\n\n        await ipcClient1.dispose();\n        await expect(disposePromise).resolves.toBeUndefined();\n      });\n\n      it('should resolve if all clients have disconnected', async () => {\n        await ipcServer.init();\n\n        await ipcClient1.init();\n        await ipcClient2.init();\n\n        await ipcClient1.dispose();\n        await ipcClient2.dispose();\n\n        await ipcServer.dispose();\n      });\n    });\n  });\n\n  describe('client', () => {\n    beforeEach(async () => {\n      await ipcServer.init();\n    });\n\n    it('should have a session state', () => {\n      expect(ipcClient1.sessionState).toEqual(new SessionState(sessionState));\n    });\n\n    it('should return the correct IPC server id', () => {\n      expect(ipcClient1.serverId).toEqual(sessionState.detoxIPCServer);\n    });\n\n    describe('before init', () => {\n      it('should throw on attempt to report test results', async () => {\n        const expected = 'IPC server foo has unexpectedly disconnected';\n        await expect(ipcClient1.reportTestResults([])).rejects.toThrow(expected);\n      });\n\n      it('should throw on attempt to register the worker', async () => {\n        const expected = 'IPC server foo has unexpectedly disconnected';\n        await expect(ipcClient1.registerWorker('foo')).rejects.toThrow(expected);\n      });\n    });\n\n    describe('upon init', function() {\n      it('should register context', async () => {\n        await ipcClient1.init();\n        expect(ipcServer.contexts).toEqual(['bar']);\n\n        await ipcClient2.init();\n        expect(ipcServer.contexts).toEqual(['bar', 'baz']);\n      });\n    });\n\n    describe('after init', () => {\n      beforeEach(async () => {\n        await ipcClient1.init();\n        await ipcClient2.init();\n      });\n\n      describe('reportTestResults', () => {\n        it('should report test results and synchronize test results', async () => {\n          const testResults = [\n            {\n              testFilePath: 'file1',\n              success: true,\n            },\n          ];\n\n          await ipcClient1.reportTestResults(testResults);\n          expect(ipcServer.sessionState.testResults).toEqual(testResults);\n          expect(ipcClient1.sessionState.testResults).toEqual(testResults);\n\n          await sleep(10); // broadcasting happens with a delay\n          expect(ipcClient2.sessionState.testResults).toEqual(testResults);\n        });\n\n        it('should update test results with tests from another clients', async () => {\n          const testResults1 = [{\n            testFilePath: 'file1',\n            success: true,\n          }];\n\n          const testResults2 = [\n            {\n              testFilePath: 'file2',\n              success: false,\n              testExecError: { name: 'baz', message: 'qux', stack: 'quux' },\n              isPermanentFailure: false,\n            },\n          ];\n\n          await ipcClient1.reportTestResults(testResults1);\n          await ipcClient2.reportTestResults(testResults2);\n          await sleep(10); // broadcasting might happen with a delay\n\n          const expected = [...testResults2, ...testResults1];\n          expect(ipcServer.sessionState.testResults).toEqual(expected);\n          expect(ipcClient1.sessionState.testResults).toEqual(expected);\n          expect(ipcClient2.sessionState.testResults).toEqual(expected);\n        });\n\n        it('should update test results with retried tests', async () => {\n          const testResultsFailure = [\n            {\n              testFilePath: 'file2',\n              success: false,\n              testExecError: { name: 'baz', message: 'qux', stack: 'quux' },\n              isPermanentFailure: false,\n            },\n          ];\n\n          const testResultsRetry = [\n            {\n              testFilePath: 'file2',\n              success: true,\n            },\n          ];\n\n          await ipcClient1.reportTestResults(testResultsFailure);\n          await ipcClient2.reportTestResults(testResultsRetry);\n\n          await sleep(10); // broadcasting might happen with a delay\n\n          const expected = testResultsRetry;\n          expect(ipcServer.sessionState.testResults).toEqual(expected);\n          expect(ipcClient1.sessionState.testResults).toEqual(expected);\n          expect(ipcClient2.sessionState.testResults).toEqual(expected);\n        });\n      });\n\n      describe('conductEarlyTeardown', () => {\n        it('should broadcast early teardown in all connected clients', async () => {\n          expect(ipcClient1.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: undefined }));\n          expect(ipcClient2.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: undefined }));\n\n          await ipcClient1.conductEarlyTeardown({ permanent: false });\n          expect(ipcClient1.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: true }));\n          await sleep(10); // broadcasting might happen with a delay\n          expect(ipcClient2.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: true }));\n        });\n\n        it('should broadcast early teardown in all connected clients (from server)', async () => {\n          expect(ipcClient1.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: undefined }));\n          expect(ipcClient2.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: undefined }));\n          await ipcServer.onConductEarlyTeardown({ permanent: false });\n          await sleep(10); // broadcasting might happen with a delay\n          expect(ipcClient1.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: true }));\n          expect(ipcClient2.sessionState).toEqual(expect.objectContaining({ unsafe_earlyTeardown: true }));\n        });\n      });\n\n      describe('registerWorker', () => {\n        it('should register worker', async () => {\n          await ipcClient1.registerWorker('foo');\n\n          expect(ipcServer.sessionState.workersCount).toEqual(1);\n          expect(ipcClient1.sessionState.workersCount).toEqual(1);\n          await sleep(10); // broadcasting might happen with a delay\n          expect(ipcClient2.sessionState.workersCount).toEqual(1);\n\n          await ipcClient2.registerWorker('bar');\n          await ipcClient2.registerWorker('baz');\n\n          expect(ipcServer.sessionState.workersCount).toEqual(3);\n          expect(ipcClient2.sessionState.workersCount).toEqual(3);\n          await sleep(10); // broadcasting might happen with a delay\n          expect(ipcClient1.sessionState.workersCount).toEqual(3);\n        });\n      });\n\n      describe('and after dispose', () => {\n        beforeEach(async () => {\n          await ipcClient1.dispose();\n        });\n\n        it('should throw upon reporting test results', async () => {\n          const expected = 'IPC server foo has unexpectedly disconnected';\n          await expect(ipcClient1.reportTestResults([])).rejects.toThrow(expected);\n        });\n\n        it('should throw upon registering worker', async () => {\n          const expected = 'IPC server foo has unexpectedly disconnected';\n          await expect(ipcClient1.registerWorker('foo')).rejects.toThrow(expected);\n        });\n      });\n    });\n  });\n\n  describe('integration', () => {\n    const deviceConfig = { type: 'stub.device' };\n\n    beforeEach(() => ipcServer.init());\n    beforeEach(() => ipcClient1.init());\n\n    describe('onAllocateDevice', () => {\n      it('should allocate a device and return its cookie', async () => {\n        callbacks.onAllocateDevice.mockResolvedValue({ id: 'device-1' });\n        await expect(ipcClient1.allocateDevice(deviceConfig)).resolves.toEqual({ id: 'device-1' });\n        expect(callbacks.onAllocateDevice).toHaveBeenCalledWith(deviceConfig);\n      });\n\n      it('should return an error if allocation fails', async () => {\n        callbacks.onAllocateDevice.mockRejectedValue(new Error('foo'));\n        await expect(ipcClient1.allocateDevice(deviceConfig)).rejects.toThrow('foo');\n        expect(callbacks.onAllocateDevice).toHaveBeenCalledWith(deviceConfig);\n      });\n    });\n\n    describe('onDeallocateDevice', () => {\n      it('should deallocate a device by its cookie', async () => {\n        await ipcClient1.deallocateDevice({ id: 'device-1' });\n        expect(callbacks.onDeallocateDevice).toHaveBeenCalledWith({ id: 'device-1' });\n      });\n\n      it('should return an error if allocation fails', async () => {\n        callbacks.onDeallocateDevice.mockRejectedValue(new Error('foo'));\n        await expect(ipcClient1.deallocateDevice({ id: 'device-1' })).rejects.toThrow('foo');\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/logger/DetoxLogger.js",
    "content": "const path = require('path');\n\nconst _ = require('lodash');\n\nconst { DetoxInternalError, DetoxError } = require('../errors');\nconst { shortFormat } = require('../utils/dateUtils');\nconst { isPromiseLike } = require('../utils/isPromise');\n\nconst BunyanLogger = require('./utils/BunyanLogger');\nconst CategoryThreadDispatcher = require('./utils/CategoryThreadDispatcher');\nconst MessageStack = require('./utils/MessageStack');\nconst customConsoleLogger = require('./utils/customConsoleLogger');\nconst sanitizeBunyanContext = require('./utils/sanitizeBunyanContext');\n\n/**\n * @typedef SharedLoggerConfig\n * @property {string} file\n * @property {Detox.DetoxLoggerConfig} [userConfig]\n * @property {CategoryThreadDispatcher} [dispatcher]\n * @property {BunyanLogger} [bunyan]\n * @property {MessageStack} [messageStack]\n * @property {boolean} [unsafeMode] Disables sanitization of user input, used for integration tests.\n */\n\nclass DetoxLogger {\n  /**\n   * @param {SharedLoggerConfig} sharedConfig\n   * @param {object} [context]\n   */\n  constructor(sharedConfig, context) {\n    /**\n     * @type {SharedLoggerConfig}\n     * IMPORTANT: all instances of {@link DetoxLogger} must share the same object instance of this._sharedConfig.\n     */\n    this._sharedConfig = sharedConfig;\n\n    /** @type {object | undefined} */\n    this._context = context;\n\n    /** @public */\n    this.fatal = this._setupLogMethod('fatal');\n    /** @public */\n    this.error = this._setupLogMethod('error');\n    /** @public */\n    this.warn = this._setupLogMethod('warn');\n    /** @public */\n    this.info = this._setupLogMethod('info');\n    /** @public */\n    this.debug = this._setupLogMethod('debug');\n    /** @public */\n    this.trace = this._setupLogMethod('trace');\n\n    if (!context) {\n      // In this branch, `this` refers to the first (root) logger instance.\n\n      this._sharedConfig.userConfig = this._sharedConfig.userConfig || {\n        level: 'info',\n        overrideConsole: false,\n        options: {\n          showDate: false,\n          showLoggerName: false,\n          showProcess: false,\n          showPid: false,\n          showLevel: false,\n          showPrefixes: false,\n          showMetadata: false,\n        },\n      };\n\n      this._sharedConfig.bunyan = new BunyanLogger()\n        .installFileStream(this.file)\n        .installDebugStream(this.config);\n\n      this._sharedConfig.dispatcher = new CategoryThreadDispatcher();\n      this._sharedConfig.messageStack = new MessageStack();\n\n      this.overrideConsole();\n    }\n  }\n\n  /**\n   * @public\n   * @returns {Detox.DetoxLogLevel}\n   */\n  get level() {\n    return this.config.level;\n  }\n\n  /**\n   * @public\n   * @param {object} [overrides]\n   * @returns {DetoxLogger}\n   */\n  child(overrides) {\n    const merged = this._mergeContexts(this._context, this._sanitizeContext(overrides));\n    return new DetoxLogger(this._sharedConfig, merged);\n  }\n\n  /** @internal */\n  get config() {\n    return this._sharedConfig.userConfig;\n  }\n\n  /** @internal */\n  get file() {\n    return this._sharedConfig.file;\n  }\n\n  /**\n   * @internal\n   * @param config\n   */\n  async setConfig(config) {\n    if (this._context) {\n      throw new DetoxInternalError('Trying to set a config in a non-root logger');\n    }\n\n    _.merge(this.config, config);\n    this._sharedConfig.bunyan.installDebugStream(this.config);\n    this.overrideConsole();\n  }\n\n  /**\n   * Closes the file descriptors to make sure that the temporary\n   * JSONL files are flushed and contain the last error messages.\n   * This safety measure is especially important for Windows OS.\n   *\n   * @async\n   * @internal\n   */\n  async close() {\n    if (this._context) {\n      throw new DetoxInternalError(\n        'Trying to close file streams from a non-root logger.\\n' +\n        'If you are not fiddling with Detox internals on purpose, yet you see this error, then...'\n      );\n    }\n\n    await this._sharedConfig.bunyan.closeFileStreams();\n  }\n\n  /**\n   * @internal\n   */\n  overrideConsole(sandbox) {\n    const enabled = this.config.overrideConsole;\n    if (!enabled) {\n      return;\n    }\n\n    customConsoleLogger.overrideConsoleMethods((sandbox || global).console, this);\n  }\n\n  /**\n   * @private\n   */\n  _mergeContexts(...contexts) {\n    const context = Object.assign({}, ...contexts);\n    const categories = _(contexts).flatMap((c) => {\n      if (c && c.cat) {\n        return _.isArray(c.cat) ? c.cat : c.cat.split(',');\n      }\n\n      return [];\n    }).uniq().join(',');\n\n    if (context.error || context.err) {\n      context.error = DetoxError.format(context.error || context.err);\n      delete context.err;\n    }\n\n    if (categories) {\n      context.cat = categories;\n    } else {\n      delete context.cat;\n    }\n\n    if (context.__filename) {\n      context.__filename = path.basename(context.__filename);\n    }\n\n    context.ph = context.ph || 'i';\n    context.tid = this._sharedConfig.dispatcher.resolve(\n      context.ph,\n      context.cat,\n      context.id || 0\n    );\n\n    return context;\n  }\n\n  /**\n   * @private\n   * @param {Detox.DetoxLogLevel} level\n   * @returns {Detox._LogMethod}\n   */\n  _setupLogMethod(level) {\n    const logMethod = this[level] = this._instant.bind(this, level);\n\n    return Object.assign(logMethod, {\n      begin: this._begin.bind(this, level),\n      complete: this._complete.bind(this, level),\n      end: this._end.bind(this, level),\n    });\n  }\n\n  /** @private */\n  _begin(level, ...args) {\n    const { context, msg } = this._parseArgs({ ph: 'B' }, args);\n    this._beginInternal(level, context, msg);\n  }\n\n  /** @private */\n  _beginInternal(level, context, msg) {\n    this._sharedConfig.messageStack.push(context, msg);\n    this._sharedConfig.bunyan.logger[level](context, ...msg);\n  }\n\n  /** @private */\n  _end(level, ...args) {\n    let { context, msg } = this._parseArgs({ ph: 'E' }, args);\n    this._endInternal(level, context, msg);\n  }\n\n  /** @private */\n  _endInternal(level, context, msg) {\n    const beginMsg = this._sharedConfig.messageStack.pop(context);\n    if (msg.length === 0) {\n      msg = beginMsg;\n    }\n\n    this._sharedConfig.bunyan.logger[level](context, ...msg);\n  }\n\n  /**\n   * @private\n   * @param {import('bunyan').LogLevel} level\n   * @param {any[]} args\n   */\n  _instant(level, ...args) {\n    const { context, msg } = this._parseArgs(null, args);\n    this._sharedConfig.bunyan.logger[level](context, ...msg);\n  }\n\n  /**\n   * @param {import('bunyan').LogLevel} level\n   * @private\n   */\n  _complete(level, maybeContext, maybeMessage, maybeAction) {\n    const action = typeof maybeContext !== 'string' ? maybeAction : maybeMessage;\n    const args = maybeAction === action ? [maybeContext, maybeMessage] : [maybeContext];\n    const { context, msg } = this._parseArgs({ ph: 'B' }, args);\n    const end = (ctx) => this[level].end({\n      id: context.id,\n      cat: context.cat,\n      ...ctx,\n    });\n\n    let result;\n    this._beginInternal(level, context, msg);\n    try {\n      result = typeof action === 'function'\n        ? action()\n        : action;\n\n      if (!isPromiseLike(result)) {\n        end({ success: true });\n      } else {\n        result.then(\n          () => end({ success: true }),\n          (err) => end({ success: false, err }),\n        );\n      }\n\n      return result;\n    } catch (err) {\n      end({ success: false, err });\n      throw err;\n    }\n  }\n\n  /** @private */\n  _parseArgs(boundContext, args) {\n    const userContext = _.isError(args[0])\n      ? { err: args[0] }\n      : _.isObject(args[0])\n        ? args[0]\n        : undefined;\n\n    const msg = userContext !== undefined ? args.slice(1) : args;\n\n    const context = this._mergeContexts(\n      this._context,\n      boundContext,\n      this._sanitizeContext(userContext),\n    );\n\n    return { context, msg };\n  }\n\n  /** @private */\n  _sanitizeContext(context) {\n    if (this._sharedConfig.unsafeMode) {\n      return context;\n    }\n\n    return sanitizeBunyanContext(context);\n  }\n\n  /** @internal */\n  static defaultOptions({ level }) {\n    const ph = level === 'trace' || level === 'debug'\n      ? value => require('chalk').grey(value) + ' '\n      : value => require('chalk').grey(value);\n\n    const id = level === 'trace'\n      ? value => require('chalk').yellow(`@${value}`)\n      : undefined;\n\n    const cat = level === 'trace' || level === 'debug'\n      ? (value) => require('chalk').yellow(`${value}`.split(',', 1)[0])\n      : undefined;\n\n    const event = level === 'trace' || level === 'debug'\n      ? (value) => require('chalk').grey(`:${value}`)\n      : undefined;\n\n    const identity = x => x;\n\n    return ({\n      showDate: shortFormat,\n      showLoggerName: true,\n      showPid: true,\n      showLevel: false,\n      showMetadata: false,\n      showPrefixes: (p) => p.join(''),\n      basepath: path.join(__dirname, '..'),\n      prefixers: _.omitBy({\n        ph,\n        cat,\n        event,\n        id,\n      }, _.isUndefined),\n      stringifiers: _.omitBy({\n        // eslint-disable-next-line unicorn/no-array-method-this-argument\n        'args': args => `(${require('lodash').map(args, a => JSON.stringify(a)).join(', ')})`,\n        'error': identity,\n        'data': json => typeof json === 'string' ? json : JSON.stringify(json, null, 2),\n        'stack': level === 'trace' || level === 'debug' ? identity : undefined,\n        'origin': level === 'trace' || level === 'debug' ? identity : undefined,\n      }, _.isUndefined),\n    });\n  }\n\n  /**\n   * @internal\n   * @param {string} level\n   * @returns {Detox.DetoxLogLevel}\n   */\n  static castLevel(level) {\n    switch (level) {\n      case 'fatal':\n      case 'error':\n      case 'warn':\n      case 'info':\n      case 'debug':\n      case 'trace':\n        return level;\n      case 'verbose':\n        return 'debug';\n      default:\n        return 'info';\n    }\n  }\n}\n\nmodule.exports = DetoxLogger;\n"
  },
  {
    "path": "detox/src/logger/DetoxLogger.test.js",
    "content": "jest.unmock('./DetoxLogger');\njest.useFakeTimers({\n  doNotFake: ['setTimeout', 'clearTimeout'],\n  now: new Date(2023, 0, 1),\n});\n\nconst os = require('os');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst sleep = require('../utils/sleep');\nconst tempfile = require('../utils/tempfile');\n\n\njest.retryTimes(2);\n\ndescribe('DetoxLogger', () => {\n  //#region --- Setup ---\n\n  /** @type {typeof import('./DetoxLogger')} */\n  let DetoxLogger;\n  /** @type {import('./DetoxLogger')[]} */\n  let _loggerInstances = [];\n  /** @type {string} */\n  let jsonlLogPath;\n  /** @type {string} */\n  let plainLogPath;\n  /** @type {Promise} */\n  let safetyTimeout;\n\n  /**\n   * @param {{\n   *   level?: Detox.DetoxLogLevel;\n   *   overrideConsole?: boolean;\n   *   options?: import('bunyan-debug-stream').BunyanDebugStreamOptions;\n   * }} [opts]\n   * @returns {import('./DetoxLogger')}\n   */\n  function logger(opts = {}) {\n    const { level = 'trace', overrideConsole = false, options } = opts;\n    DetoxLogger = require('./DetoxLogger');\n\n    const instance = new DetoxLogger({\n      file: jsonlLogPath,\n      userConfig: {\n        level,\n        overrideConsole,\n        options: {\n          ...DetoxLogger.defaultOptions({ level }),\n          colors: false,\n          // @ts-ignore\n          out: fs.createWriteStream(plainLogPath),\n          ...options,\n        },\n      },\n    });\n\n    _loggerInstances = _loggerInstances || [];\n    _loggerInstances.push(instance);\n    return instance;\n  }\n\n  let _env;\n\n  function setupSuite() {\n    _env = process.env;\n    process.env = { ..._env, FORCE_COLOR: '0' };\n    jsonlLogPath = tempfile('.jsonl');\n    plainLogPath = tempfile('.log');\n    safetyTimeout = null;\n  }\n\n  async function teardownSuite() {\n    process.env = _env;\n\n    await Promise.all(_loggerInstances.map((logger) => logger.close()));\n    _loggerInstances = [];\n\n    fs.removeSync(jsonlLogPath);\n    fs.removeSync(plainLogPath);\n  }\n\n  async function jsonl() {\n    safetyTimeout = safetyTimeout || sleep(10);\n    await safetyTimeout;\n    const contents = await fs.readFile(jsonlLogPath, 'utf8');\n    return contents.split('\\n').filter(Boolean).map(line => JSON.parse(line));\n  }\n\n  async function txt() {\n    safetyTimeout = safetyTimeout || sleep(10);\n    await safetyTimeout;\n    const contents = await fs.readFile(plainLogPath, 'utf8');\n    return contents.trim()\n      .replace(/detox\\[\\d+\\]/g, 'detox[PID]');\n  }\n\n  //#endregion\n\n  describe('- main functionality -', () => {\n    beforeEach(setupSuite);\n    afterEach(teardownSuite);\n\n    it('should log messages simultaneously to plain text and JSONL', async () => {\n      logger().info('Hello, world!');\n\n      await expect(txt()).resolves.toBe(`00:00:00.000 detox[PID] i  Hello, world!`);\n      await expect(jsonl()).resolves.toEqual([\n        expect.objectContaining({\n          hostname: os.hostname(),\n          level: 30,\n          msg: 'Hello, world!',\n          name: 'detox',\n          ph: 'i',\n          pid: process.pid,\n          tid: 0,\n          time: new Date().toISOString(),\n          v: 0,\n        })\n      ]);\n    });\n\n    it('should have a log level getter', () => {\n      expect(logger().level).toBe('trace'); // set in tests\n    });\n\n    it('should cast non-standard log levels to the closest standard level', async () => {\n      const LoggerClass = logger().constructor;\n      expect(LoggerClass).toBe(DetoxLogger);\n      expect(DetoxLogger.castLevel('trace')).toBe('trace');\n      expect(DetoxLogger.castLevel('debug')).toBe('debug');\n      expect(DetoxLogger.castLevel('verbose')).toBe('debug');\n      expect(DetoxLogger.castLevel('info')).toBe('info');\n      expect(DetoxLogger.castLevel('warn')).toBe('warn');\n      expect(DetoxLogger.castLevel('error')).toBe('error');\n      expect(DetoxLogger.castLevel('fatal')).toBe('fatal');\n      expect(DetoxLogger.castLevel('unknown')).toBe('info');\n    });\n\n    it('should be able to create a child logger', async () => {\n      const parent = logger();\n      const child1 = parent.child({ cat: 'child1' });\n      const child2 = parent.child({ cat: 'child2' });\n\n      parent.info({ __filename }, 'Message from parent');\n      child1.info('Message from child1');\n      child2.info('Message from child2');\n\n      await expect(jsonl()).resolves.toEqual([\n        expect.objectContaining({ msg: 'Message from parent', __filename: 'DetoxLogger.test.js' }),\n        expect.objectContaining({ cat: 'child1', msg: 'Message from child1' }),\n        expect.objectContaining({ cat: 'child2', msg: 'Message from child2' }),\n      ]);\n    });\n\n    it('should be able to merge categories', async () => {\n      const root = logger();\n      const parent = root.child({ cat: '' });\n      const child = parent.child({ cat: ['test', 'child'] });\n      const grandchild = child.child({ cat: 'test,grandchild' });\n      const troublemaker = grandchild.child({ cat: '' });\n\n      parent.info('Message from parent');\n      child.info('Message from child');\n      grandchild.info('Message from grandchild');\n      troublemaker.info('Cannot reset the categories');\n\n      const actual = await jsonl();\n\n      expect(actual).toEqual([\n        expect.objectContaining({ msg: 'Message from parent' }),\n        expect.objectContaining({ cat: 'test,child', msg: 'Message from child' }),\n        expect.objectContaining({ cat: 'test,child,grandchild', msg: 'Message from grandchild' }),\n        expect.objectContaining({ cat: 'test,child,grandchild', msg: 'Cannot reset the categories' }),\n      ]);\n\n      expect(actual[0]).not.toHaveProperty('cat');\n    });\n\n    it('should hide messages with a lower log level in the plain output', async () => {\n      logger({ level: 'warn' }).info('Hello, world!');\n\n      await expect(txt()).resolves.toBe('');\n      await expect(jsonl()).resolves.toEqual([\n        expect.objectContaining({ msg: 'Hello, world!', level: 30 }),\n      ]);\n    });\n\n    it('should log complete duration events', async () => {\n      const l = logger();\n\n      const syncValue = l.info.complete({ extra: 'data' }, 'Info duration', 42);\n      expect(syncValue).toBe(42);\n\n      const asyncValue = l.warn.complete('Warn duration', sleep(0).then(() => 84));\n      expect(asyncValue).toBeInstanceOf(Promise);\n      expect(await asyncValue).toBe(84);\n\n      const syncResult = l.debug.complete('Debug duration', () => 126);\n      expect(syncResult).toBe(126);\n\n      const asyncResult = l.trace.complete('Trace duration', sleep(0).then(() => 168));\n      expect(asyncResult).toBeInstanceOf(Promise);\n      expect(await asyncResult).toBe(168);\n\n      const promiseLike = { then: jest.fn() };\n      const promiseLikeResult = l.fatal.complete('Fatal (pending)', promiseLike);\n      expect(promiseLikeResult).toBe(promiseLike);\n\n      try {\n        l.error.complete('Error duration (sync)', () => { throw anError('Oops (sync)!'); });\n      } catch (e) {}\n\n      await l.error.complete('Error duration (async)', sleep(0).then(() => {\n        throw anError('Oops (async)!');\n      })).catch(() => {});\n\n      const jsonlOutput = await jsonl();\n      const time = new Date().toISOString();\n      const tid = 0;\n\n      expect(jsonlOutput).toEqual([\n        expect.objectContaining({ msg: 'Info duration', ph: 'B', time, tid, level: 30, extra: 'data' }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 30, success: true }),\n        expect.objectContaining({ msg: 'Warn duration', ph: 'B', time, tid, level: 40 }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 40, success: true }),\n        expect.objectContaining({ msg: 'Debug duration', ph: 'B', time, tid, level: 20 }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 20, success: true }),\n        expect.objectContaining({ msg: 'Trace duration', ph: 'B', time, tid, level: 10 }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 10, success: true }),\n        expect.objectContaining({ msg: 'Fatal (pending)', ph: 'B', time, tid, level: 60 }),\n        expect.objectContaining({ msg: 'Error duration (sync)', ph: 'B', time, tid, level: 50 }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 50, success: false, error: expect.any(String) }),\n        expect.objectContaining({ msg: 'Error duration (async)', ph: 'B', time, tid, level: 50 }),\n        expect.objectContaining({ ph: 'E', time, tid, level: 50, success: false, error: expect.any(String) }),\n      ]);\n\n      await expect(txt()).resolves.toMatchSnapshot();\n    });\n\n    it('should log begin/end duration events', async () => {\n      const l = logger({\n        options: { showLevel: true }\n      }).child({ cat: 'duration' });\n      const activity1 = l.child({ id: 'thread1' });\n      const activity2 = l.child({ id: 'thread2' });\n\n      activity1.info.begin({ meta: 'data' }, 'Activity 1 start');\n      activity2.error.begin('Activity 2');\n      activity1.debug.end({ success: true }, 'Activity 1 start');\n      activity2.warn.end();\n\n      activity2.fatal.end(); // testing the fallback, when there is no begin event\n\n      await expect(txt()).resolves.toMatchSnapshot();\n    });\n\n    it('should log end duration events correctly for different categories', async () => {\n      const parent = logger();\n      const cat1 = parent.child({ cat: 'cat1' });\n      const cat2 = parent.child({ cat: 'cat2' });\n\n      cat1.info.begin('Activity 1 start');\n      cat2.info.begin('Activity 2 start');\n      cat1.info.end();\n      cat2.info.end();\n\n      await expect(txt()).resolves.toMatchSnapshot();\n    });\n\n    it.each([\n      ['trace'],\n      ['debug'],\n      ['info'],\n      ['warn'],\n      ['error'],\n      ['fatal'],\n    ])('should format messages according to the log level: %s', async (level) => {\n      // @ts-ignore\n      const l = logger({ level });\n      const err = anError('Some test err details');\n      const error = anError('Some test error details');\n\n      l.fatal('BLUE SCREEN OF DEATH');\n      l.error({ origin: 'module1', error }, 'An error occurred:');\n      l.error({ origin: 'module2', err }, 'An err (alias) occurred:');\n      l.error(anError('Error as context'), 'Another error occurred:');\n      l.warn({ origin: 'some-module/index.js', stack: 'at index.js:30:73' }, 'Warning message!');\n      l.debug({ cat: 'custom-category', event: 'MESSAGE', data: { foo: 'bar' } }, 'A message with a payload');\n      l.debug({ cat: 'custom-category', data: 'raw string data' }, 'One more message with a payload');\n      l.trace({ cat: 'custom-category', event: 'MESSAGE' }, 'Trace message');\n      l.trace({ args: ['stringArgument', { prop: 'value' }] }, 'someMethodCall');\n\n      await expect(txt()).resolves.toMatchSnapshot();\n    });\n\n    it('should allow customizing prefixers and stringifiers', async () => {\n      const l = logger({\n        options: {\n          showPrefixes: (p) => `[${p.join(', ')}]`,\n          prefixers: {\n            cat: (cat) => cat.toUpperCase(),\n          },\n          stringifiers: {\n            args: (args) => `${args.length}`,\n          },\n        },\n      });\n\n      l.trace({ cat: 'custom-category', args: [10, 20], }, 'Trace message');\n      expect(await txt()).toBe('00:00:00.000 detox[PID] [CUSTOM-CATEGORY] Trace message\\n  args: 2');\n    });\n  });\n\n  describe('- overriding console -', () => {\n    const CONSOLE_METHODS = ['log', 'info', 'warn', 'error', 'debug', 'trace', 'assert'];\n    const LOGGER_METHODS =  ['info', 'info', 'warn', 'error', 'debug', 'info', 'error'];\n\n    let loggerInstance;\n    let spiedConsoleMethods;\n\n    describe('when overrideConsole is true', () => {\n      beforeAll(setupSuite);\n      beforeAll(spyOnLoggerAndConsoleMethods);\n      beforeAll(() => loggerInstance.setConfig({ overrideConsole: true }));\n      afterAll(teardownSuite);\n\n      it.each([\n        ['log', 'info'],\n        ['info', 'info'],\n        ['warn', 'warn'],\n        ['error', 'error'],\n        ['debug', 'debug'],\n      ])('should override console.%s with logger.%s', (consoleMethodName, loggerMethodName) => {\n        console[consoleMethodName](`${consoleMethodName}(%s)`, 'foo');\n\n        expect(spiedConsoleMethods[consoleMethodName]).not.toHaveBeenCalled();\n        expect(loggerInstance[loggerMethodName]).toHaveBeenCalledWith(expect.objectContaining({\n          cat: 'user',\n          origin: expect.any(String),\n        }), `${consoleMethodName}(foo)`);\n      });\n\n      it('should override console.trace with logger.info', () => {\n        console.trace(`trace(%s)`, 'foo');\n\n        expect(spiedConsoleMethods.trace).not.toHaveBeenCalled();\n        expect(loggerInstance.info).toHaveBeenCalledWith(expect.objectContaining({\n          cat: 'user',\n          origin: expect.any(String),\n          stack: expect.any(String),\n        }), `trace(foo)`);\n      });\n\n      it('should override console.assert with logger.error', () => {\n        console.assert(false, `Assertion failed: %s`, 'foo');\n\n        expect(spiedConsoleMethods.assert).not.toHaveBeenCalled();\n        expect(loggerInstance.error).toHaveBeenCalledWith(expect.objectContaining({\n          cat: 'user',\n          origin: expect.any(String),\n        }), 'AssertionError:', `Assertion failed: foo`);\n      });\n    });\n\n    describe('when overrideConsole is false', () => {\n      beforeAll(setupSuite);\n      beforeAll(spyOnLoggerAndConsoleMethods);\n      beforeAll(() => loggerInstance.setConfig({ overrideConsole: false }));\n      afterAll(teardownSuite);\n\n      it.each(CONSOLE_METHODS)('should not override console.%s', (consoleMethodName) => {\n        const loggerMethod = LOGGER_METHODS[CONSOLE_METHODS.indexOf(consoleMethodName)];\n        console[consoleMethodName](`${consoleMethodName}(%s)`, 'foo');\n\n        expect(loggerInstance[loggerMethod]).not.toHaveBeenCalled();\n        expect(spiedConsoleMethods[consoleMethodName]).toHaveBeenCalledWith(`${consoleMethodName}(%s)`, 'foo');\n      });\n    });\n\n    function spyOnLoggerAndConsoleMethods() {\n      spiedConsoleMethods = {};\n      loggerInstance = logger();\n\n      for (const methodName of _.uniq(LOGGER_METHODS)) {\n        jest.spyOn(loggerInstance, methodName);\n      }\n\n      for (const methodName of CONSOLE_METHODS) {\n        // @ts-ignore\n        jest.spyOn(console, methodName);\n        spiedConsoleMethods[methodName] = console[methodName];\n      }\n    }\n  });\n\n  describe('- unhappy paths -', () => {\n    beforeEach(setupSuite);\n    afterEach(teardownSuite);\n\n    it('should not allow setting config in a child logger', async () => {\n      await expect(logger().child().setConfig({ level: 'info' })).rejects.toThrow(/Trying to set a config in a non-root logger/);\n    });\n\n    it('should not allow closing the entire logging capability from a child logger', async () => {\n      await expect(logger().child().close()).rejects.toThrow(/Trying to close file streams from a non-root logger/);\n    });\n\n    it('should escape properties conflicting with Bunyan internal ones', async () => {\n      logger().info({\n        hostname: 'hostname',\n        level: 'level',\n        msg: 'msg',\n        name: 'name',\n        pid: 'pid',\n        tid: 'tid',\n        ph: 'M',\n        time: 'time',\n        custom: 'property',\n      }, 'A very bad message');\n\n      await expect(jsonl()).resolves.toEqual( [{\n        custom: 'property',\n        hostname: os.hostname(),\n        hostname$: 'hostname',\n        level$: 'level',\n        level: 30,\n        msg: 'A very bad message',\n        msg$: 'msg',\n        name: 'detox',\n        name$: 'name',\n        pid: expect.any(Number),\n        pid$: 'pid',\n        ph: 'i',\n        ph$: 'M',\n        tid: 0,\n        tid$: 'tid',\n        time: new Date().toISOString(),\n        time$: 'time',\n        v: 0,\n      }]);\n    });\n\n    it('should allow creating a logger without a config', async () => {\n      const DetoxLogger = require('./DetoxLogger');\n      const noopFilePath = os.platform() === 'win32' ? 'nul' : '/dev/null';\n      const instance = new DetoxLogger({ file: noopFilePath });\n\n      expect(instance.config).toEqual({\n        level: 'info',\n        overrideConsole: false,\n        options: expect.objectContaining({\n          showDate: false,\n          showLevel: false,\n          showLoggerName: false,\n          showMetadata: false,\n          showPid: false,\n          showPrefixes: false,\n          showProcess: false,\n        }),\n      });\n    });\n  });\n\n  function anError(msg) {\n    const err = new Error(msg);\n    err.stack = '';\n    return err;\n  }\n});\n"
  },
  {
    "path": "detox/src/logger/__mocks__/DetoxLogger.js",
    "content": "const DetoxLogger = jest.requireActual('../DetoxLogger');\n\nconst METHODS = [\n  'trace', 'debug', 'info', 'warn', 'error', 'fatal'\n];\n\nclass FakeLogger {\n  static instances = [];\n  static defaultOptions = DetoxLogger.defaultOptions.bind(DetoxLogger);\n  static castLevel = DetoxLogger.castLevel;\n\n  fatal;\n  error;\n  info;\n  warn;\n  debug;\n  trace;\n\n  constructor(opts = {}) {\n    FakeLogger.instances.push(this);\n\n    this.opts = opts;\n    this.log = jest.fn();\n    this._level = jest.fn();\n    Object.defineProperty(this, 'level', {\n      get: () => this._level(),\n    });\n\n    for (const method of METHODS) {\n      this[method] = jest.fn((...args) => {\n        this.log(method, this.opts, ...args);\n      });\n      this[method].begin = jest.fn((...args) => {\n        this.log(method, this.opts, ...args, '(begin)');\n      });\n      this[method].complete = jest.fn((...args) => {\n        const [action] = args.slice(-1);\n        this.log(method, this.opts, ...args, '(begin)');\n        try {\n          return (typeof action === 'function' ? action() : action);\n        } finally {\n          this.log(method, this.opts, ...args, '(end)');\n        }\n      });\n      this[method].end = jest.fn((...args) => {\n        this.log(method, this.opts, ...args, '(end)');\n      });\n    }\n  }\n\n  get config() {\n    return {};\n  }\n\n  setConfig() {}\n\n  async close() {\n\n  }\n\n  child(opts) {\n    this.opts = Object.assign(this.opts, opts);\n    return this;\n  }\n\n  clear() {\n    this.opts = {};\n    return this;\n  }\n}\n\nmodule.exports = FakeLogger;\n"
  },
  {
    "path": "detox/src/logger/__mocks__/index.js",
    "content": "exports.DetoxLogger = require('./DetoxLogger');\nexports.DetoxLogFinalizer = jest.createMockFromModule('../utils/DetoxLogFinalizer');\nexports.installLegacyTracerInterface = jest.fn();\n"
  },
  {
    "path": "detox/src/logger/__snapshots__/DetoxLogger.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: debug 1`] = `\n\"00:00:00.000 detox[PID] i  BLUE SCREEN OF DEATH\n00:00:00.000 detox[PID] i  An error occurred:\n  error: Error: Some test error details\n  origin: module1\n00:00:00.000 detox[PID] i  An err (alias) occurred:\n  error: Error: Some test err details\n  origin: module2\n00:00:00.000 detox[PID] i  Another error occurred:\n  error: Error: Error as context\n00:00:00.000 detox[PID] i  Warning message!\n  stack: at index.js:30:73\n  origin: some-module/index.js\n00:00:00.000 detox[PID] i custom-category:MESSAGE A message with a payload\n  data: {\n    \"foo\": \"bar\"\n  }\n00:00:00.000 detox[PID] i custom-category One more message with a payload\n  data: raw string data\"\n`;\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: error 1`] = `\n\"00:00:00.000 detox[PID] i BLUE SCREEN OF DEATH\n00:00:00.000 detox[PID] i An error occurred:\n  error: Error: Some test error details\n00:00:00.000 detox[PID] i An err (alias) occurred:\n  error: Error: Some test err details\n00:00:00.000 detox[PID] i Another error occurred:\n  error: Error: Error as context\"\n`;\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: fatal 1`] = `\"00:00:00.000 detox[PID] i BLUE SCREEN OF DEATH\"`;\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: info 1`] = `\n\"00:00:00.000 detox[PID] i BLUE SCREEN OF DEATH\n00:00:00.000 detox[PID] i An error occurred:\n  error: Error: Some test error details\n00:00:00.000 detox[PID] i An err (alias) occurred:\n  error: Error: Some test err details\n00:00:00.000 detox[PID] i Another error occurred:\n  error: Error: Error as context\n00:00:00.000 detox[PID] i Warning message!\"\n`;\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: trace 1`] = `\n\"00:00:00.000 detox[PID] i  BLUE SCREEN OF DEATH\n00:00:00.000 detox[PID] i  An error occurred:\n  error: Error: Some test error details\n  origin: module1\n00:00:00.000 detox[PID] i  An err (alias) occurred:\n  error: Error: Some test err details\n  origin: module2\n00:00:00.000 detox[PID] i  Another error occurred:\n  error: Error: Error as context\n00:00:00.000 detox[PID] i  Warning message!\n  stack: at index.js:30:73\n  origin: some-module/index.js\n00:00:00.000 detox[PID] i custom-category:MESSAGE A message with a payload\n  data: {\n    \"foo\": \"bar\"\n  }\n00:00:00.000 detox[PID] i custom-category One more message with a payload\n  data: raw string data\n00:00:00.000 detox[PID] i custom-category:MESSAGE Trace message\n00:00:00.000 detox[PID] i  someMethodCall\n  args: (\"stringArgument\", {\"prop\":\"value\"})\"\n`;\n\nexports[`DetoxLogger - main functionality - should format messages according to the log level: warn 1`] = `\n\"00:00:00.000 detox[PID] i BLUE SCREEN OF DEATH\n00:00:00.000 detox[PID] i An error occurred:\n  error: Error: Some test error details\n00:00:00.000 detox[PID] i An err (alias) occurred:\n  error: Error: Some test err details\n00:00:00.000 detox[PID] i Another error occurred:\n  error: Error: Error as context\n00:00:00.000 detox[PID] i Warning message!\"\n`;\n\nexports[`DetoxLogger - main functionality - should log begin/end duration events 1`] = `\n\"00:00:00.000 detox[PID] INFO:  B duration@thread1 Activity 1 start\n00:00:00.000 detox[PID] ERROR: B duration@thread2 Activity 2\n00:00:00.000 detox[PID] DEBUG: E duration@thread1 Activity 1 start\n00:00:00.000 detox[PID] WARN:  E duration@thread2 Activity 2\n00:00:00.000 detox[PID] FATAL: E duration@thread2 <no begin message>\"\n`;\n\nexports[`DetoxLogger - main functionality - should log complete duration events 1`] = `\n\"00:00:00.000 detox[PID] B  Info duration\n00:00:00.000 detox[PID] E  Info duration\n00:00:00.000 detox[PID] B  Warn duration\n00:00:00.000 detox[PID] E  Warn duration\n00:00:00.000 detox[PID] B  Debug duration\n00:00:00.000 detox[PID] E  Debug duration\n00:00:00.000 detox[PID] B  Trace duration\n00:00:00.000 detox[PID] E  Trace duration\n00:00:00.000 detox[PID] B  Fatal (pending)\n00:00:00.000 detox[PID] B  Error duration (sync)\n00:00:00.000 detox[PID] E  Error duration (sync)\n  error: Error: Oops (sync)!\n00:00:00.000 detox[PID] B  Error duration (async)\n00:00:00.000 detox[PID] E  Error duration (async)\n  error: Error: Oops (async)!\"\n`;\n\nexports[`DetoxLogger - main functionality - should log end duration events correctly for different categories 1`] = `\n\"00:00:00.000 detox[PID] B cat1 Activity 1 start\n00:00:00.000 detox[PID] B cat2 Activity 2 start\n00:00:00.000 detox[PID] E cat1 Activity 1 start\n00:00:00.000 detox[PID] E cat2 Activity 2 start\"\n`;\n"
  },
  {
    "path": "detox/src/logger/index.js",
    "content": "module.exports = {\n  DetoxLogger: require('./DetoxLogger'),\n  DetoxLogFinalizer: require('./utils/DetoxLogFinalizer'),\n  installLegacyTracerInterface: require('./utils/tracerLegacy').install,\n};\n"
  },
  {
    "path": "detox/src/logger/utils/BunyanLogger.js",
    "content": "const { PassThrough } = require('stream');\nconst { promisify } = require('util');\n\nconst bunyan = require('bunyan');\nconst bds = require('bunyan-debug-stream');\nconst _ = require('lodash');\n\nconst { DetoxInternalError } = require('../../errors');\n\nclass BunyanLogger {\n  constructor() {\n    this._bunyan = bunyan.createLogger({ name: 'detox', streams: [] });\n    /** @type {bunyan.Stream} */\n    this._debugStream = null;\n    /** @type {bunyan.Stream} */\n    this._fileStream = null;\n  }\n\n  /**\n   * @returns {bunyan}\n   */\n  get logger() {\n    return this._bunyan;\n  }\n\n  /**\n   * @param {Detox.DetoxLoggerConfig} config\n   * @returns {this}\n   */\n  installDebugStream(config) {\n    if (this._debugStream) {\n      _.remove(this._bunyan['streams'], this._debugStream);\n      // @ts-ignore\n      this._debugStream.stream.end();\n      this._debugStream = null;\n    }\n\n    const streamOptions = { out: null, ...config.options };\n    /* istanbul ignore next */\n    if (!streamOptions.out) {\n      // This is a default if-else branch, used everywhere except for the unit tests.\n      streamOptions.out = new PassThrough().pipe(process.stderr);\n    }\n\n    this._bunyan.addStream({\n      type: 'raw',\n      level: config.level,\n      stream: bds.default(streamOptions),\n    });\n\n    this._debugStream = _.last(this._bunyan['streams']);\n\n    return this;\n  }\n\n  /**\n   * @param {string} file\n   * @returns {this}\n   */\n  installFileStream(file) {\n    /* istanbul ignore next */\n    if (this._fileStream) {\n      // This is an impossible condition, but we keep it here for the sake of completeness.\n      throw new DetoxInternalError('Trying to install a second file stream inside already initialized Bunyan logger');\n    }\n\n    this._fileStream = {\n      level: 'trace',\n      path: file,\n    };\n\n    this._bunyan.addStream(this._fileStream);\n\n    return this;\n  }\n\n  async closeFileStreams() {\n    const internalBunyanStreams = this._bunyan['streams'];\n    const openFileStreams = _.filter(internalBunyanStreams, this._isOpenFileStream);\n    _.remove(internalBunyanStreams, openFileStreams);\n\n    await Promise.all(openFileStreams.map(bunyanStream => {\n      const stream = bunyanStream.stream;\n      return promisify(stream.end.bind(stream))();\n    }));\n  }\n\n  /** @private */\n  _isOpenFileStream = (bunyanStream) => {\n    switch (bunyanStream.type) {\n      case 'file':\n        return bunyanStream.path && !bunyanStream.stream.destroyed;\n      case 'raw':\n        /* istanbul ignore next */\n        const stream = bunyanStream.stream === this._debugStream.stream\n          ? bunyanStream.stream._out\n          : bunyanStream.stream;\n\n        /* istanbul ignore next */\n        return stream.fd > 2 && !stream.closed;\n    }\n  };\n}\n\nmodule.exports = BunyanLogger;\n"
  },
  {
    "path": "detox/src/logger/utils/CategoryThreadDispatcher.js",
    "content": "const ThreadDispatcher = require('./ThreadDispatcher');\nconst getMainCategory = require('./getMainCategory');\n\nclass CategoryThreadDispatcher {\n  constructor() {\n    /** @type {Record<string, ThreadDispatcher>} */\n    this._dispatchers = {};\n  }\n\n  /**\n   * @param {'B' | 'E' | 'i'} ph\n   * @param {string[] | undefined} cat\n   * @param {string | number} id\n   * @returns {number}\n   */\n  resolve(ph, cat, id) {\n    const dispatcher = this._resolveDispatcher(cat);\n\n    switch (ph) {\n      case 'B': return dispatcher.begin(id);\n      case 'E': return dispatcher.end(id);\n      default: return dispatcher.resolve(id);\n    }\n  }\n\n  /** @returns {ThreadDispatcher} */\n  _resolveDispatcher(cat) {\n    const mainCategory = getMainCategory(cat);\n    if (!this._dispatchers[mainCategory]) {\n      this._dispatchers[mainCategory] = new ThreadDispatcher(mainCategory);\n    }\n\n    return this._dispatchers[mainCategory];\n  }\n}\n\nmodule.exports = CategoryThreadDispatcher;\n"
  },
  {
    "path": "detox/src/logger/utils/DetoxLogFinalizer.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\n\nconst temporary = require('../../artifacts/utils/temporaryPath');\n\nconst { BunyanTransformer, ChromeTraceTransformer } = require('./streams');\n\n/**\n * @typedef DetoxLogFinalizerConfig\n * @property {import('../../ipc/SessionState')} session\n * @property {import('../DetoxLogger')} logger\n */\n\nclass DetoxLogFinalizer {\n  /** @param {DetoxLogFinalizerConfig} config */\n  constructor(config) {\n    this._session = config.session;\n    this._bunyanTransformer = new BunyanTransformer(\n      config.logger.child({ cat: 'logger' }),\n    );\n    this._chromeTransformer = new ChromeTraceTransformer();\n  }\n\n  createEventStream() {\n    const sessionId = this._session.id;\n    const logs = temporary.find.jsonl.sync(`${sessionId}.*`);\n\n    const toChromeTrace = this._chromeTransformer.createStream();\n    return this._bunyanTransformer.uniteSessionLogs(logs).pipe(toChromeTrace);\n  }\n\n  async finalize() {\n    const sessionId = this._session.id;\n    const logs = await temporary.find.jsonl.async(`${sessionId}.*`);\n    if (logs.length === 0) {\n      return;\n    }\n\n    if (this._shouldSaveLogs()) {\n      const rootDir = this._config.artifacts.rootDir;\n\n      await fs.mkdirp(rootDir);\n\n      const firstPass = this._bunyanTransformer.uniteSessionLogs(logs);\n      await this._chromeTransformer.scanThreadIDs(firstPass);\n\n      const secondPass = this._bunyanTransformer.uniteSessionLogs(logs);\n      const outStreams = [this._createPlainFileStream(), this._createChromeTraceStream()];\n\n      await Promise.all(outStreams.map(stream => {\n        return new Promise((resolve, reject) => {\n          stream.target\n            .on('finish', resolve)\n            .on('error', reject);\n\n          secondPass.pipe(stream.writable);\n        });\n      }));\n    }\n\n    await Promise.all(logs.map(filepath => fs.remove(filepath)));\n  }\n\n  finalizeSync() {\n    const sessionId = this._session.id;\n    const logs = temporary.find.jsonl.sync(`${sessionId}.*`);\n    if (logs.length === 0) {\n      return;\n    }\n\n    const shouldSaveLogs = this._shouldSaveLogs(true);\n    const rootDir = shouldSaveLogs ? this._config.artifacts.rootDir : '';\n    if (shouldSaveLogs) {\n      fs.mkdirpSync(rootDir);\n    }\n\n    for (const log of logs) {\n      if (shouldSaveLogs) {\n        const dest = path.join(rootDir, path.basename(log));\n        this._safeMoveSync(log, dest);\n      } else {\n        this._safeRemoveSync(log);\n      }\n    }\n  }\n\n  _createPlainFileStream() {\n    const rootDir = this._config.artifacts.rootDir;\n    const bunyanOptions = this._config.logger.options;\n    const transformer = this._bunyanTransformer.createPlainTransformer(bunyanOptions);\n    const fileStream = fs.createWriteStream(path.join(rootDir, 'detox.log'));\n    transformer.readable.pipe(fileStream);\n\n    return { writable: transformer.writable, target: fileStream };\n  }\n\n  _createChromeTraceStream() {\n    const rootDir = this._config.artifacts.rootDir;\n    const transformer = this._chromeTransformer.createSerializedStream();\n    const fileStream = fs.createWriteStream(path.join(rootDir, 'detox.trace.json'));\n    transformer.readable.pipe(fileStream);\n\n    return { writable: transformer.writable, target: fileStream };\n  }\n\n  /* istanbul ignore next */\n  _safeMoveSync(src, dest) {\n    // Using console.* instead of logger.* because this is the end of the execution,\n    // and the logger is already closed.\n\n    try {\n      fs.moveSync(src, dest);\n    } catch (moveError) {\n      console.warn(`Failed to move a log file from: ${src}.\\nReason: ${moveError.message}`);\n      try {\n        fs.copySync(src, dest);\n      } catch (copyError) {\n        console.warn(`Attempt to copy the file also failed.\\nReason: ${copyError.message}`);\n      }\n    }\n  }\n\n  /* istanbul ignore next */\n  _safeRemoveSync(filepath) {\n    try {\n      fs.removeSync(filepath);\n    } catch (removeError) {\n      console.warn(`Failed to remove a log file at: ${filepath}.\\nReason: ${removeError.message}`);\n    }\n  }\n\n  /** @private */\n  get _config() {\n    // The config appears later in the lifecycle, so we need to access it lazily\n    return this._session.detoxConfig;\n  }\n\n  /** @private */\n  _shouldSaveLogs(isEmergencyExit = false) {\n    if (!this._config) {\n      return false;\n    }\n\n    const { rootDir, plugins } = this._config.artifacts;\n    if (!rootDir || !plugins) {\n      return false;\n    }\n\n    if (!plugins.log.enabled) {\n      return false;\n    }\n\n    if (!plugins.log.keepOnlyFailedTestsArtifacts) {\n      return true;\n    }\n\n    if (isEmergencyExit) {\n      return true;\n    }\n\n    return this._session.testResults.some(r => !r.success);\n  }\n}\n\nmodule.exports = DetoxLogFinalizer;\n"
  },
  {
    "path": "detox/src/logger/utils/DetoxLogFinalizer.test.js",
    "content": "jest.unmock('../DetoxLogger');\n\nconst path = require('path');\nconst { PassThrough } = require('stream');\n\nconst fs = require('fs-extra');\nconst glob = require('glob');\n\nconst temporary = require('../../artifacts/utils/temporaryPath');\nconst tempfile = require('../../utils/tempfile');\nconst DetoxLogger = require('../DetoxLogger');\n\nconst DetoxLogFinalizer = require('./DetoxLogFinalizer');\n\ndescribe('DetoxLogFinalizer', () => {\n  /** @type {string[]} */\n  let temporaryFiles = [];\n  /** @type {*} */\n  let session;\n  /** @type {import('./DetoxLogFinalizer')} */\n  let finalizer;\n  /** @type {import('../DetoxLogger')} */\n  let fakeLogger;\n\n  let _env;\n\n  beforeEach(() => {\n    _env = process.env;\n    process.env = { ..._env, FORCE_COLOR: '0' };\n  });\n\n  beforeEach(() => {\n    session = {\n      id: 'session-id',\n      detoxConfig: {\n        artifacts: {\n          rootDir: tempfile(''),\n          plugins: {\n            log: {\n              enabled: true,\n              keepOnlyFailedTestsArtifacts: false,\n            }\n          }\n        },\n        logger: {\n          level: 'info',\n          overrideConsole: false,\n          options: {\n            ...DetoxLogger.defaultOptions({\n              level: 'trace',\n            }),\n            showDate: (date) => date.toISOString(),\n            colors: false,\n          },\n        }\n      }\n    };\n\n    temporaryFiles = [session.detoxConfig.artifacts.rootDir];\n\n    const FakeLogger = jest.requireMock('../DetoxLogger');\n    fakeLogger = new FakeLogger();\n\n    finalizer = new DetoxLogFinalizer({ session, logger: fakeLogger });\n  });\n\n  afterEach(async () => {\n    await Promise.all(temporaryFiles.map(f => fs.remove(f)));\n  });\n\n  afterEach(() => {\n    process.env = _env;\n  });\n\n  describe('finalize', () => {\n    it('should not throw when there are no logs', async () => {\n      await finalizer.finalize();\n      expect(fs.existsSync(artifactsDir())).toBe(false);\n    });\n\n    it('should convert JSONL logs to Chrome Trace format', async () => {\n      await createLogFiles();\n      await finalizer.finalize();\n\n      let plainLog = await fs.readFile(path.join(artifactsDir(), 'detox.log'), 'utf8');\n      let traceLog = JSON.parse(await fs.readFile(path.join(artifactsDir(), 'detox.trace.json'), 'utf8'));\n\n      expect(plainLog).toMatchSnapshot('plain');\n      expect(traceLog).toMatchSnapshot('chrome-trace');\n    });\n\n    it('should not create logs when they are disabled', async () => {\n      session.detoxConfig.artifacts.plugins.log.enabled = false;\n      await createLogFiles();\n      await finalizer.finalize();\n      expect(fs.existsSync(artifactsDir())).toBe(false);\n      expect(fs.existsSync(temporaryFiles[1])).toBe(false);\n      expect(fs.existsSync(temporaryFiles[2])).toBe(false);\n    });\n\n    it('should not create logs for successful run when configured', async () => {\n      session.detoxConfig.artifacts.plugins.log.keepOnlyFailedTestsArtifacts = true;\n      session.testResults = [{ success: true }];\n\n      await createLogFiles();\n      await finalizer.finalize();\n      expect(fs.existsSync(artifactsDir())).toBe(false);\n      expect(fs.existsSync(temporaryFiles[1])).toBe(false);\n      expect(fs.existsSync(temporaryFiles[2])).toBe(false);\n    });\n\n    it('should create logs for failing run when configured', async () => {\n      session.detoxConfig.artifacts.plugins.log.keepOnlyFailedTestsArtifacts = true;\n      session.testResults = [{ success: false }];\n\n      await createLogFiles();\n      await finalizer.finalize();\n\n      const outFiles = glob.sync('*', { cwd: artifactsDir() });\n      expect(outFiles).toEqual([\n        'detox.log',\n        'detox.trace.json',\n      ]);\n    });\n  });\n\n  describe('finalizeSync', () => {\n    it('should not throw for non-initialized state', async () => {\n      await createLogFiles();\n      delete session.detoxConfig.artifacts.plugins;\n      expect(() => finalizer.finalizeSync()).not.toThrow();\n\n      await createLogFiles();\n      delete session.detoxConfig.artifacts.rootDir;\n      expect(() => finalizer.finalizeSync()).not.toThrow();\n\n      await createLogFiles();\n      delete session.detoxConfig;\n      expect(() => finalizer.finalizeSync()).not.toThrow();\n    });\n\n    it('should not throw when there are no logs', async () => {\n      finalizer.finalizeSync();\n      expect(fs.existsSync(artifactsDir())).toBe(false);\n    });\n\n    it('should copy JSONL logs to artifacts dir', async () => {\n      await createLogFiles();\n      finalizer.finalizeSync();\n\n      const outFiles = glob.sync('*', { cwd: artifactsDir() });\n      expect(outFiles.map(f => path.extname(f))).toEqual([\n        '.jsonl',\n        '.jsonl',\n      ]);\n    });\n\n    it('should not create logs when they are disabled', async () => {\n      session.detoxConfig.artifacts.plugins.log.enabled = false;\n      await createLogFiles();\n      finalizer.finalizeSync();\n      expect(fs.existsSync(artifactsDir())).toBe(false);\n      expect(fs.existsSync(temporaryFiles[1])).toBe(false);\n      expect(fs.existsSync(temporaryFiles[2])).toBe(false);\n    });\n\n    it('should create logs even for successful run when configured to keep failing logs', async () => {\n      session.detoxConfig.artifacts.plugins.log.keepOnlyFailedTestsArtifacts = true;\n      session.testResults = [{ success: true }];\n\n      await createLogFiles();\n      finalizer.finalizeSync();\n\n      const outFiles = glob.sync('*', { cwd: artifactsDir() });\n      expect(outFiles.map(f => path.extname(f))).toEqual([\n        '.jsonl',\n        '.jsonl',\n      ]);\n\n      // assert that the temporary files have been moved, not copied\n      expect(fs.existsSync(temporaryFiles[1])).toBe(false);\n      expect(fs.existsSync(temporaryFiles[2])).toBe(false);\n    });\n  });\n\n  describe('createEventStream', () => {\n    it('should create a stream of Chrome Trace format events', async () => {\n      await createLogFiles();\n\n      const events = [];\n      await new Promise((resolve, reject) => {\n        finalizer.createEventStream()\n          .on('end', resolve)\n          .on('error', reject)\n          .on('data', event => events.push(event));\n      });\n\n      events.forEach(t => { t.pid = 1234; });\n\n      expect(events).toMatchSnapshot();\n    });\n  });\n\n  function artifactsDir() {\n    return session.detoxConfig.artifacts.rootDir;\n  }\n\n  async function createLogFiles() {\n    const sessionId = session.id;\n    const logPath1 = temporary.for.jsonl(`${sessionId}.1`);\n    const logPath2 = temporary.for.jsonl(`${sessionId}.2`);\n\n    temporaryFiles.push(logPath1, logPath2);\n\n    const userConfig = {\n      ...session.detoxConfig.logger,\n      options: {\n        ...session.detoxConfig.logger.options,\n        out: new PassThrough(),\n      },\n    };\n\n    const root1 = new DetoxLogger({\n      unsafeMode: true,\n      file: logPath1,\n      userConfig,\n    });\n\n    const root2 = new DetoxLogger({\n      unsafeMode: true,\n      file: logPath2,\n      userConfig,\n    });\n\n    const log1 = root1.child({ pid: 1234 });\n    const log2 = root2.child({ pid: 1235 });\n\n    jest.useFakeTimers();\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:00.000Z'));\n    log1.info({ cat: 'main' }, 'msg1');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:01.000Z'));\n    log1.trace.begin({ id: 1, cat: 'parallel' }, 'duration1');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:01.100Z'));\n    log1.trace.begin({ id: 1, cat: 'parallel' }, 'duration1:stacked');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:01.400Z'));\n    log1.trace.end({ id: 1, cat: 'parallel' }, 'duration1:stacked');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:01.500Z'));\n    log1.trace.begin({ id: 2, cat: 'parallel' }, 'duration2');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:02.000Z'));\n    log1.trace.end({ id: 1, cat: 'parallel' });\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:02.500Z'));\n    log1.trace.end({ id: 2, cat: 'parallel' });\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:00.500Z'));\n    log2.info.begin({ cat: 'parallel' }, 'long-duration');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:01.000Z'));\n    log2.debug('instant event');\n\n    jest.setSystemTime(new Date('2023-01-01T00:00:02.250Z'));\n    log2.trace.end({ cat: 'parallel' });\n\n    jest.useRealTimers();\n    await Promise.all([root1.close(), root2.close()]);\n  }\n});\n"
  },
  {
    "path": "detox/src/logger/utils/MessageStack.js",
    "content": "const getMainCategory = require('./getMainCategory');\n\nclass MessageStack {\n  constructor() {\n    this._map = {};\n  }\n\n  push(context, msg) {\n    const hash = this._hash(context);\n\n    if (this._map[hash] == null) {\n      this._map[hash] = [];\n    }\n\n    return this._map[hash].push(msg);\n  }\n\n  pop(context) {\n    const hash = this._hash(context);\n    const stack = this._map[hash];\n    if (stack == null || stack.length === 0) {\n      return ['<no begin message>'];\n    }\n\n    return stack.pop();\n  }\n\n  _hash(context) {\n    const cat = getMainCategory(context.cat);\n    const tid = context.tid;\n    return `${cat}:${tid}`;\n  }\n}\n\nmodule.exports = MessageStack;\n"
  },
  {
    "path": "detox/src/logger/utils/ThreadDispatcher.js",
    "content": "const isUndefined = (x) => x === undefined;\n\nclass ThreadDispatcher {\n  /**\n   * @param {string} name\n   */\n  constructor(name) {\n    this.name = name;\n    this.stacks = [];\n    this.threads = [];\n  }\n\n  /**\n   * @param {string | number} [id]\n   * @returns {number}\n   */\n  begin(id) {\n    const tid = this._findTID(id);\n    this.threads[tid] = id;\n    this.stacks[tid] = (this.stacks[tid] || 0) + 1;\n    return tid;\n  }\n\n  /**\n   * @param {string | number} [id]\n   * @returns {number}\n   */\n  resolve(id) {\n    return this._findTID(id);\n  }\n\n  /**\n   * @param {string | number} [id]\n   * @returns {number}\n   */\n  end(id) {\n    const tid = this._findTID(id);\n    if (this.stacks[tid] && --this.stacks[tid] === 0) {\n      delete this.threads[tid];\n    }\n    return tid;\n  }\n\n  /**\n   * @param {string | number | undefined} id\n   * @returns {number}\n   * @private\n   *\n   * Memory-efficient finder of a free item index in the threads array.\n   */\n  _findTID(id) {\n    let tid = this.threads.indexOf(id);\n    if (tid === -1) {\n      // Try to find a recently released slot in the array:\n      tid = this.threads.findIndex(isUndefined);\n    }\n    return tid === -1 ? this.threads.length : tid;\n  }\n}\n\nmodule.exports = ThreadDispatcher;\n"
  },
  {
    "path": "detox/src/logger/utils/__snapshots__/DetoxLogFinalizer.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxLogFinalizer createEventStream should create a stream of Chrome Trace format events 1`] = `\n[\n  {\n    \"args\": {\n      \"name\": \"primary\",\n    },\n    \"name\": \"process_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 0,\n    },\n    \"name\": \"process_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"name\": \"main\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 0,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"main\",\n    \"name\": \"msg1\",\n    \"ph\": \"i\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"name\": \"secondary\",\n    },\n    \"name\": \"process_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 1,\n    },\n    \"name\": \"process_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"long-duration\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration1\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"level\": 20,\n      \"v\": 0,\n    },\n    \"cat\": \"undefined\",\n    \"name\": \"instant event\",\n    \"ph\": \"i\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration1:stacked\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531201100000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531201400000,\n  },\n  {\n    \"args\": {\n      \"name\": \"parallel\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 1,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"id\": 2,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration2\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531202000000,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531202250000,\n  },\n  {\n    \"args\": {\n      \"id\": 2,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531202500000,\n  },\n]\n`;\n\nexports[`DetoxLogFinalizer finalize should convert JSONL logs to Chrome Trace format: chrome-trace 1`] = `\n[\n  {\n    \"args\": {\n      \"name\": \"primary\",\n    },\n    \"name\": \"process_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 0,\n    },\n    \"name\": \"process_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"name\": \"main\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 0,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"main\",\n    \"name\": \"msg1\",\n    \"ph\": \"i\",\n    \"pid\": 1234,\n    \"tid\": 0,\n    \"ts\": 1672531200000000,\n  },\n  {\n    \"args\": {\n      \"name\": \"secondary\",\n    },\n    \"name\": \"process_name\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 0,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 1,\n    },\n    \"name\": \"process_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 0,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"name\": \"parallel\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 3,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 3,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 3,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"long-duration\",\n    \"ph\": \"B\",\n    \"pid\": 1235,\n    \"tid\": 3,\n    \"ts\": 1672531200500000,\n  },\n  {\n    \"args\": {\n      \"name\": \"parallel\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 1,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration1\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"name\": \"undefined\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 4,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 4,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1235,\n    \"tid\": 4,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"level\": 20,\n      \"v\": 0,\n    },\n    \"cat\": \"undefined\",\n    \"name\": \"instant event\",\n    \"ph\": \"i\",\n    \"pid\": 1235,\n    \"tid\": 4,\n    \"ts\": 1672531201000000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration1:stacked\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201100000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531201400000,\n  },\n  {\n    \"args\": {\n      \"name\": \"parallel\",\n    },\n    \"name\": \"thread_name\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 2,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"sort_index\": 2,\n    },\n    \"name\": \"thread_sort_index\",\n    \"ph\": \"M\",\n    \"pid\": 1234,\n    \"tid\": 2,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"id\": 2,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"name\": \"duration2\",\n    \"ph\": \"B\",\n    \"pid\": 1234,\n    \"tid\": 2,\n    \"ts\": 1672531201500000,\n  },\n  {\n    \"args\": {\n      \"id\": 1,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 1,\n    \"ts\": 1672531202000000,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1235,\n    \"tid\": 3,\n    \"ts\": 1672531202250000,\n  },\n  {\n    \"args\": {\n      \"id\": 2,\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"parallel\",\n    \"ph\": \"E\",\n    \"pid\": 1234,\n    \"tid\": 2,\n    \"ts\": 1672531202500000,\n  },\n]\n`;\n\nexports[`DetoxLogFinalizer finalize should convert JSONL logs to Chrome Trace format: plain 1`] = `\n\"2023-01-01T00:00:00.000Z detox[1234] i main msg1\n2023-01-01T00:00:00.500Z detox[1235] B parallel long-duration\n2023-01-01T00:00:01.000Z detox[1234] B parallel@1 duration1\n2023-01-01T00:00:01.000Z detox[1235] i  instant event\n2023-01-01T00:00:01.100Z detox[1234] B parallel@1 duration1:stacked\n2023-01-01T00:00:01.400Z detox[1234] E parallel@1 duration1:stacked\n2023-01-01T00:00:01.500Z detox[1234] B parallel@2 duration2\n2023-01-01T00:00:02.000Z detox[1234] E parallel@1 duration1\n2023-01-01T00:00:02.250Z detox[1235] E parallel long-duration\n2023-01-01T00:00:02.500Z detox[1234] E parallel@2 duration2\n\"\n`;\n"
  },
  {
    "path": "detox/src/logger/utils/customConsoleLogger.js",
    "content": "const util = require('util');\n\nconst callsites = require('../../utils/callsites');\n\nconst USER_STACK_FRAME_INDEX = 2;\n\nfunction override(console, method, bunyanLoggerFn) {\n  if (method === 'trace') {\n    console.trace = proxyTracing(bunyanLoggerFn);\n  } else if (method === 'assert') {\n    console.assert = proxyAssert(bunyanLoggerFn);\n  } else {\n    console[method] = proxyLog(bunyanLoggerFn);\n  }\n}\n\nfunction getOrigin() {\n  const userCallSite = callsites.getCallSites()[USER_STACK_FRAME_INDEX];\n  return callsites.getOrigin(userCallSite);\n}\n\nfunction getStackDump() {\n  return callsites.getStackDump(USER_STACK_FRAME_INDEX);\n}\n\nfunction proxyLog(bunyanLoggerFn) {\n  return (...args) => {\n    bunyanLoggerFn({ cat: 'user', origin: getOrigin() }, util.format(...args));\n  };\n}\n\nfunction proxyTracing(bunyanLoggerFn) {\n  return (...args) => {\n    bunyanLoggerFn({ cat: 'user', origin: getOrigin(), stack: getStackDump() }, util.format(...args));\n  };\n}\n\nfunction proxyAssert(bunyanLoggerFn) {\n  return (condition, ...args) => {\n    if (!condition) {\n      bunyanLoggerFn({ cat: 'user', origin: getOrigin() }, 'AssertionError:', util.format(...args));\n    }\n  };\n}\n\nfunction overrideConsoleMethods(console, bunyanLogger) {\n  if (!console.__detox_log__) {\n    const log = bunyanLogger;\n\n    console.__detox_log__ = {\n      log: console.log,\n      info: console.info,\n      warn: console.warn,\n      trace: console.trace,\n      error: console.error,\n      debug: console.debug,\n      assert: console.assert,\n    };\n\n    override(console, 'log', log.info.bind(log));\n    override(console, 'info', log.info.bind(log));\n    override(console, 'warn', log.warn.bind(log));\n    override(console, 'trace', log.info.bind(log));\n    override(console, 'error', log.error.bind(log));\n    override(console, 'debug', log.debug.bind(log));\n    override(console, 'assert', log.error.bind(log));\n  }\n\n  return console;\n}\n\nfunction restoreConsoleMethods(console) {\n  if (console.__detox_log__) {\n    Object.assign(console, console.__detox_log__);\n    delete console.__detox_log__;\n  }\n}\n\nmodule.exports = {\n  overrideConsoleMethods,\n  restoreConsoleMethods,\n};\n"
  },
  {
    "path": "detox/src/logger/utils/customConsoleLogger.test.js",
    "content": "describe('customConsoleLogger', () => {\n  let overrideConsoleMethods;\n  let restoreConsoleMethods;\n  let fakeConsole, bunyanLogger;\n\n  beforeEach(() => {\n    overrideConsoleMethods = require('./customConsoleLogger').overrideConsoleMethods;\n    restoreConsoleMethods = require('./customConsoleLogger').restoreConsoleMethods;\n\n    fakeConsole = {\n      log: jest.fn(),\n      warn: jest.fn(),\n      trace: jest.fn(),\n      error: jest.fn(),\n      debug: jest.fn(),\n      assert: jest.fn(),\n    };\n\n    bunyanLogger = {\n      debug: jest.fn(),\n      warn: jest.fn(),\n      info: jest.fn(),\n      error: jest.fn(),\n    };\n  });\n\n  describe('- override safety -', () => {\n    it('should override console methods, if it has no internal property __detox_log__', () => {\n      expect(overrideConsoleMethods({ ...fakeConsole }, bunyanLogger)).not.toEqual(fakeConsole);\n    });\n\n    it('should not override console methods, if it has an internal property __detox_log__', () => {\n      fakeConsole.__detox_log__ = {};\n      expect(overrideConsoleMethods({ ...fakeConsole }, bunyanLogger)).toEqual(fakeConsole);\n    });\n\n    it('should set an internal property __detox_log__ after override', () => {\n      expect(overrideConsoleMethods({ ...fakeConsole }, bunyanLogger).__detox_log__).toBeDefined();\n    });\n  });\n\n  describe('- proxying to bunyan -', () => {\n    const expectedOrigin = {\n      cat: 'user',\n      origin: expect.stringMatching(/at src[\\\\/]logger[\\\\/]utils[\\\\/]customConsoleLogger\\.test\\.js:\\d+:\\d+/)\n    };\n\n    const expectedStackDump = {\n      cat: 'user',\n      stack: expect.stringMatching(/at.*src[\\\\/]logger[\\\\/]utils[\\\\/]customConsoleLogger\\.test\\.js:\\d+:\\d+/m)\n    };\n\n    beforeEach(() => {\n      overrideConsoleMethods(fakeConsole, bunyanLogger);\n    });\n\n    it('should connect: console.log -> logger.info', () => {\n      fakeConsole.log('OK %d', 200);\n      expect(bunyanLogger.info).toHaveBeenCalledWith(expectedOrigin, 'OK 200');\n    });\n\n    it('should connect: console.info -> logger.info', () => {\n      fakeConsole.info('OK %d', 200);\n      expect(bunyanLogger.info).toHaveBeenCalledWith(expectedOrigin, 'OK 200');\n    });\n\n    it('should connect: console.warn -> logger.warn', () => {\n      fakeConsole.warn('Warning %d', 301);\n      expect(bunyanLogger.warn).toHaveBeenCalledWith(expectedOrigin, 'Warning 301');\n    });\n\n    it('should connect: console.trace -> logger.info', () => {\n      fakeConsole.trace('TraceMe %d', 100500);\n      expect(bunyanLogger.info).toHaveBeenCalledWith({ ...expectedOrigin, ...expectedStackDump }, 'TraceMe 100500');\n    });\n\n    it('should connect: console.error -> logger.error', () => {\n      fakeConsole.error('MyError %d', 500);\n      expect(bunyanLogger.error).toHaveBeenCalledWith(expectedOrigin, 'MyError 500');\n    });\n\n    it('should connect: console.debug -> logger.debug', () => {\n      fakeConsole.debug('Debug %d', 0);\n      expect(bunyanLogger.debug).toHaveBeenCalledWith(expectedOrigin, 'Debug 0');\n    });\n\n    it('should connect: console.assert -> logger.error', () => {\n      fakeConsole.assert(false, 'Failed condition %s', false);\n      expect(bunyanLogger.error).toHaveBeenCalledWith(expectedOrigin, 'AssertionError:', 'Failed condition false');\n    });\n\n    it('should not connect console.assert to logger.error, if the condition is true', () => {\n      fakeConsole.assert(true, 'Nothing to say');\n      expect(bunyanLogger.error).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('- restoring the override -', () => {\n    it('should not throw if the console is not overridden', () => {\n      expect(() => restoreConsoleMethods(fakeConsole)).not.toThrow();\n    });\n\n    it('should work if the console has been overridden', () => {\n      const originalMethods = Object.values(fakeConsole);\n      overrideConsoleMethods(fakeConsole, bunyanLogger);\n      const overridenMethods = Object.values(fakeConsole);\n      restoreConsoleMethods(fakeConsole);\n      const restoredMethods = Object.values(fakeConsole);\n\n      expect(restoredMethods).toEqual(originalMethods);\n      expect(originalMethods).not.toEqual(overridenMethods);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/logger/utils/getMainCategory.js",
    "content": "function getMainCategory(category) {\n  return category ? String(category).split(',', 1)[0] : 'undefined';\n}\n\nmodule.exports = getMainCategory;\n"
  },
  {
    "path": "detox/src/logger/utils/sanitizeBunyanContext.js",
    "content": "const _ = require('lodash');\n\nconst RESERVED_PROPERTIES = [\n  'hostname',\n  'level',\n  'msg',\n  'name',\n  'pid',\n  'tid',\n  'ph',\n  'time',\n];\n\nfunction hasProperty(p) {\n  return _.has(this, p);\n}\n\nfunction hasReservedProperties(o) {\n  return RESERVED_PROPERTIES.some(hasProperty, o); // eslint-disable-line unicorn/no-array-method-this-argument\n}\n\nfunction escapeCallback(value, key) {\n  return RESERVED_PROPERTIES.includes(key) ? `${key}$` : key;\n}\n\nfunction sanitizeBunyanContext(context) {\n  return context && hasReservedProperties(context) ? _.mapKeys(context, escapeCallback) : context;\n}\n\nmodule.exports = sanitizeBunyanContext;\n"
  },
  {
    "path": "detox/src/logger/utils/streams/BunyanTransformer.js",
    "content": "const fs = require('fs');\nconst { PassThrough } = require('stream');\n\nconst bunyanDebugStream = require('bunyan-debug-stream');\nconst multiSort = require('multi-sort-stream');\nconst pipe = require('multipipe');\nconst stripAnsi = require('strip-ansi');\n\nconst DetoxJSONLParser = require('./DetoxJSONLParser');\nconst { mapTransform, through } = require('./transformers');\n\nclass BunyanTransformer {\n  /**\n   * @param {Detox.Logger} log\n   */\n  constructor(log) {\n    this._jsonlParser = new DetoxJSONLParser(log);\n  }\n\n  /**\n   * @param {string[]} logFilePaths\n   */\n  uniteSessionLogs(logFilePaths) {\n    const intermediate = mapTransform(BunyanTransformer.normalizeBunyanRecord);\n    const reemitError = (err) => intermediate.emit('error', err);\n\n    const jsonlStreams = logFilePaths.map(filePath => {\n      const { readable, writable } = this._jsonlParser.createTransformer();\n      fs.createReadStream(filePath)\n        .on('error', reemitError)\n        .pipe(writable);\n\n      return readable;\n    });\n\n    const multisorted = multiSort(jsonlStreams, BunyanTransformer.compareTimestamps);\n    return pipe(multisorted, intermediate, through());\n  }\n\n  createPlainTransformer(bunyanOptions) {\n    /** @type {*} */\n    const readable = new PassThrough({ encoding: 'utf8', objectMode: false });\n    const writable = bunyanDebugStream.default({\n      ...bunyanOptions,\n\n      colors: false,\n      out: readable,\n    });\n\n    writable.on('error', /* istanbul ignore next */ (err) => readable.emit('error', err));\n    writable.on('finish', () => readable.end());\n\n    return {\n      writable,\n      readable,\n    };\n  }\n\n  static normalizeBunyanRecord(record) {\n    const value = record.value;\n    value.msg = stripAnsi(value.msg);\n    value.time = new Date(value.time);\n\n    return value;\n  }\n\n  static compareTimestamps(a, b) {\n    return +(a.value.time > b.value.time) - +(a.value.time < b.value.time);\n  }\n}\n\nmodule.exports = BunyanTransformer;\n"
  },
  {
    "path": "detox/src/logger/utils/streams/BunyanTransformer.test.js",
    "content": "const fs = require('fs-extra');\n\nconst tempfile = require('../../../utils/tempfile');\n\ndescribe('BunyanTransformer', () => {\n  /** @type {import('./BunyanTransformer')} */\n  let transformer;\n  let DetoxLogger;\n  let logger;\n  let temporaryFiles;\n\n  beforeEach(() => {\n    temporaryFiles = [];\n\n    const BunyanTransformer = require('./BunyanTransformer');\n\n    DetoxLogger = jest.requireMock('../../DetoxLogger');\n    logger = new DetoxLogger();\n    transformer = new BunyanTransformer(logger);\n  });\n\n  afterEach(async () => {\n    await Promise.all(temporaryFiles.map(filepath => fs.remove(filepath)));\n    temporaryFiles = [];\n  });\n\n  it('should merge log files according to the timestamp', async () => {\n    const fileA = saveAsFile(toJSONLString([\n      { time: '2000-01-01T00:00:00.001Z', msg: 'a1' },\n      { time: '2000-01-01T00:00:00.002Z', msg: 'a2' },\n      { time: '2000-01-01T00:00:00.004Z', msg: 'a3' },\n    ]));\n\n    const fileB = saveAsFile(toJSONLString([\n      { time: '2000-01-01T00:00:00.000Z', msg: 'b1' },\n      { time: '2000-01-01T00:00:00.003Z', msg: 'b2' },\n      { time: '2000-01-01T00:00:00.005Z', msg: 'b3' },\n    ]));\n\n    const result = transformer.uniteSessionLogs([fileA, fileB]);\n    await expect(toObjects(result)).resolves.toEqual([\n      { time: new Date('2000-01-01T00:00:00.000Z'), msg: 'b1' },\n      { time: new Date('2000-01-01T00:00:00.001Z'), msg: 'a1' },\n      { time: new Date('2000-01-01T00:00:00.002Z'), msg: 'a2' },\n      { time: new Date('2000-01-01T00:00:00.003Z'), msg: 'b2' },\n      { time: new Date('2000-01-01T00:00:00.004Z'), msg: 'a3' },\n      { time: new Date('2000-01-01T00:00:00.005Z'), msg: 'b3' },\n    ]);\n  });\n\n  it('should handle unfinished JSON streams', async () => {\n    const fileA = saveAsFile(toJSONLString([\n      { time: '2000-01-01T00:00:00.001Z', msg: 'a1' },\n      { time: '2000-01-01T00:00:00.002Z', msg: 'a2' },\n    ]).slice(0, -2));\n\n    const fileB = saveAsFile(toJSONLString([\n      { time: '2000-01-01T00:00:01.001Z', msg: 'b1' },\n      { time: '2000-01-01T00:00:01.002Z', msg: 'b2' },\n    ]));\n\n    const result = transformer.uniteSessionLogs([fileA, fileB]);\n    await expect(toObjects(result)).resolves.toEqual([\n      { time: new Date('2000-01-01T00:00:00.001Z'), msg: 'a1' },\n      { time: new Date('2000-01-01T00:00:01.001Z'), msg: 'b1' },\n      { time: new Date('2000-01-01T00:00:01.002Z'), msg: 'b2' },\n    ]);\n\n    expect(logger.debug).toHaveBeenCalledWith({ err: expect.any(Error) }, 'Failed to parse log line:');\n    expect(logger.debug).toHaveBeenCalledTimes(1);\n  });\n\n  it('should convert bunyan JSON to bunyan debug streams', async () => {\n    const logFile = saveAsFile(toJSONLString([\n      { time: '2000-01-01T00:00:00.001Z', pid: 1, msg: 'Event 1', name: 'app', level: 30 },\n      { time: '2000-01-01T00:00:00.002Z', pid: 1, msg: 'Event 2', name: 'app', level: 20 },\n      { time: '2000-01-01T00:00:00.004Z', pid: 1, msg: 'Event 3', name: 'app', level: 10 },\n    ]));\n    const logStream = transformer.uniteSessionLogs([logFile]);\n    const plainTransformer = transformer.createPlainTransformer({\n      ...DetoxLogger.defaultOptions({ level: 'trace' }),\n      showDate: time => time.toISOString(),\n      showLevel: true,\n    });\n\n    logStream.pipe(plainTransformer.writable);\n    await expect(toString(plainTransformer.readable)).resolves.toEqual([\n      '2000-01-01T00:00:00.001Z app[1] INFO:  Event 1',\n      '2000-01-01T00:00:00.002Z app[1] DEBUG: Event 2',\n      '2000-01-01T00:00:00.004Z app[1] TRACE: Event 3',\n      ''\n    ].join('\\n'));\n  });\n\n  it('should propagate errors from the input streams too', async () => {\n    const logStream = transformer.uniteSessionLogs([tempfile()]);\n    await expect(toString(logStream)).rejects.toThrow(/ENOENT/);\n  });\n\n  //#region Helper functions\n\n  /***\n   * @param {unknown[]} data\n   */\n  function toJSONLString(data) {\n    return data.map(j => JSON.stringify(j)).join('\\n');\n  }\n\n  function saveAsFile(str) {\n    const filename = tempfile();\n    temporaryFiles.push(filename);\n    fs.writeFileSync(filename, str);\n    return filename;\n  }\n\n  /** @async */\n  function toString(stream) {\n    const chunks = [];\n\n    return new Promise((resolve, reject) => {\n      stream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));\n      stream.on('error', (err) => reject(err));\n      stream.on('finish', () => resolve(Buffer.concat(chunks).toString('utf8')));\n    });\n  }\n\n  /** @async */\n  function toObjects(stream) {\n    const chunks = [];\n\n    return new Promise((resolve, reject) => {\n      stream.on('data', (obj) => chunks.push(obj));\n      stream.on('error', (err) => reject(err));\n      stream.on('end', () => resolve(chunks));\n    });\n  }\n\n  //#endregion\n});\n\n\n"
  },
  {
    "path": "detox/src/logger/utils/streams/ChromeTraceTransformer.js",
    "content": "const { AbstractEventBuilder } = require('trace-event-lib');\n\nconst getMainCategory = require('../getMainCategory');\n\nconst JSONLStringer = require('./JSONLStringer');\nconst { flatMapTransform } = require('./transformers');\n\nclass ChromeTraceTransformer {\n  constructor() {\n    /** @type {Map<string, number>} */\n    this._globalThreadMap = null;\n  }\n\n  /**\n   * @param {NodeJS.ReadableStream} eventStream\n   */\n  async scanThreadIDs(eventStream) {\n    const processes = await new Promise((resolve, reject) => {\n      const result = {};\n      eventStream\n        .on('end', () => resolve(result))\n        .on('error', /* istanbul ignore next */ (err) => reject(err))\n        .on('data', (event) => {\n          const { ph, pid, tid, cat } = event;\n          if (ph === 'B' || ph === 'i') {\n            const categories = (result[pid] = result[pid] || {});\n            const mainCategory = String(cat).split(',')[0];\n            const tids = (categories[mainCategory] = categories[mainCategory] || []);\n            if (!tids.includes(tid)) {\n              tids.push(tid);\n            }\n          }\n        });\n    });\n\n    const tidArray = Object.entries(processes).flatMap(([pid, categories]) => {\n      return Object.entries(categories).flatMap(([category, tids]) => {\n        return tids.map(tid => `${pid}:${category}:${tid}`);\n      });\n    });\n\n    this._globalThreadMap = new Map(tidArray.map((hash, index) => [hash, index]));\n  }\n\n  /**\n   * @returns {module:stream.internal.Transform}\n   */\n  createStream() {\n    const transformFn = this._transformBunyanRecord.bind(this, {\n      primaryPid: NaN,\n      knownPids: new Set(),\n      knownTids: new Set(),\n    });\n\n    return flatMapTransform(transformFn);\n  }\n\n  createSerializedStream() {\n    const writable = this.createStream();\n    const readable = JSONLStringer.serializeJSON();\n    writable.pipe(readable);\n    return { writable, readable };\n  }\n\n  /**\n   * @param {{ knownPids: Set<number>; knownTids: Set<number>; primaryPid: number; }} state\n   * @param {*} bunyanLogRecord\n   * @returns {import('trace-event-lib').Event[]}\n   * @private\n   */\n  _transformBunyanRecord(state, bunyanLogRecord) {\n    // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n    const { cat: rawCat, msg: name, ph, pid, tid: _tid, time, name: _name, hostname: _hostname, ...args } = bunyanLogRecord;\n    const ts = new Date(time).getTime() * 1E3;\n    const cat = rawCat || 'undefined';\n    const tid = this._resolveGlobalTID(bunyanLogRecord);\n\n    const builder = new SimpleEventBuilder();\n    if (!state.knownPids.has(pid)) {\n      if (Number.isNaN(state.primaryPid)) {\n        state.primaryPid = pid;\n      }\n\n      builder.metadata({ pid, ts, name: 'process_name', args: { name: pid === state.primaryPid ? 'primary' : 'secondary' } });\n      builder.metadata({ pid, ts, name: 'process_sort_index', args: { sort_index: state.knownPids.size } });\n      state.knownPids.add(pid);\n    }\n\n    if (!state.knownTids.has(tid)) {\n      const mainCategory = getMainCategory(cat);\n      builder.metadata({ pid, tid, ts, name: 'thread_name', args: { name: mainCategory } });\n      builder.metadata({ pid, tid, ts, name: 'thread_sort_index', args: { sort_index: tid } });\n      state.knownTids.add(tid);\n    }\n\n    const event = { ph, name, pid, tid, cat, ts, args };\n    if (ph === 'E') {\n      delete event.name;\n    }\n\n    builder.events.push(event);\n    return builder.events;\n  }\n\n  _resolveGlobalTID(event) {\n    const hash = this._computeThreadHash(event);\n    const tid = this._globalThreadMap ? this._globalThreadMap.get(hash) : event.tid;\n\n    // Impossible condition, but anyway it is better to be safe than sorry.\n    /* istanbul ignore next */\n    return tid === undefined ? ChromeTraceTransformer.ERROR_TID : tid;\n  }\n\n  _computeThreadHash({ pid, tid, cat }) {\n    return `${pid}:${getMainCategory(cat)}:${tid}`;\n  }\n\n  /* istanbul ignore next */\n  static get ERROR_TID() {\n    return 37707;\n  }\n}\n\nclass SimpleEventBuilder extends AbstractEventBuilder {\n  events = [];\n\n  send(event) {\n    this.events.push(event);\n  }\n}\n\nmodule.exports = ChromeTraceTransformer;\n"
  },
  {
    "path": "detox/src/logger/utils/streams/DetoxJSONLParser.js",
    "content": "const JsonlParser = require('stream-json/jsonl/Parser');\n\nconst { through } = require('./transformers');\n\nclass DetoxJSONLParser {\n  constructor(log) {\n    this._log = log;\n  }\n\n  createTransformer() {\n    const log = this._log;\n    const readable = through();\n    const writable = JsonlParser.make({ checkErrors: true })\n      .on('error', (err) => {\n        /* istanbul ignore else */\n        if (err instanceof SyntaxError) {\n          log.debug({ err }, 'Failed to parse log line:');\n          readable.end();\n        } else {\n          readable.emit('error', err);\n        }\n      });\n\n    return {\n      writable,\n      readable: writable.pipe(readable),\n    };\n  }\n}\n\nmodule.exports = DetoxJSONLParser;\n"
  },
  {
    "path": "detox/src/logger/utils/streams/JSONLStringer.js",
    "content": "const { Transform } = require('stream');\n\nclass JSONLStringer extends Transform {\n  constructor({ replacer, header, delimiter, footer }) {\n    super({ writableObjectMode: true, readableObjectMode: false });\n\n    this._replacer = replacer;\n    this._header = header;\n    this._delimiter = delimiter;\n    this._footer = footer;\n  }\n\n  _transform(chunk, _, callback) {\n    if (this._header) {\n      this.push(this._header);\n    }\n\n    this.push(JSON.stringify(chunk, this._replacer));\n    this._transform = this._nextTransform;\n    callback(null);\n  }\n\n  _nextTransform(chunk, _, callback) {\n    this.push(this._delimiter + JSON.stringify(chunk, this._replacer));\n    callback(null);\n  }\n\n  _flush(callback) {\n    if (this._footer) {\n      this.push(this._footer);\n    }\n\n    callback();\n  }\n\n  static serializeJSONL() {\n    return new JSONLStringer({\n      replacer: undefined,\n      header: '',\n      delimiter: '\\n',\n      footer: '',\n    });\n  }\n\n  static serializeJSON() {\n    return new JSONLStringer({\n      replacer: undefined,\n      header: '[\\n\\t',\n      delimiter: ',\\n\\t',\n      footer: '\\n]\\n',\n    });\n  }\n}\n\nmodule.exports = JSONLStringer;\n"
  },
  {
    "path": "detox/src/logger/utils/streams/JSONLStringer.test.js",
    "content": "const JSONLStringer = require('./JSONLStringer');\n\ndescribe('JSONLStringer', () => {\n  it('should serialize to JSONL', (resolve) => {\n    expect.hasAssertions();\n\n    let output = '';\n    const stringer = JSONLStringer.serializeJSONL()\n      .on('data', (chunk) => { output += chunk; })\n      .on('end', () => {\n        expect(output).toEqual('{\"a\":1}\\n{\"b\":2}');\n        resolve();\n      });\n\n    stringer.write({ a: 1 });\n    stringer.write({ b: 2 });\n    stringer.end();\n  });\n\n  it('should serialize to JSON', (resolve) => {\n    expect.hasAssertions();\n\n    let output = '';\n    const stringer = JSONLStringer.serializeJSON()\n      .on('data', (chunk) => { output += chunk; })\n      .on('end', () => {\n        expect(output).toEqual('[\\n\\t{\"a\":1},\\n\\t{\"b\":2}\\n]\\n');\n        resolve();\n      });\n\n    stringer.write({ a: 1 });\n    stringer.write({ b: 2 });\n    stringer.end();\n  });\n});\n"
  },
  {
    "path": "detox/src/logger/utils/streams/index.js",
    "content": "const BunyanTransformer = require('./BunyanTransformer');\nconst ChromeTraceTransformer = require('./ChromeTraceTransformer');\n\nmodule.exports = {\n  BunyanTransformer,\n  ChromeTraceTransformer,\n};\n"
  },
  {
    "path": "detox/src/logger/utils/streams/transformers.js",
    "content": "const { PassThrough, Transform } = require('stream');\n\nfunction through() {\n  return new PassThrough({ objectMode: true });\n}\n\nfunction mapTransform(fn) {\n  return new Transform({\n    objectMode: true,\n    transform(chunk, encoding, callback){\n      this.push(fn(chunk));\n      callback();\n    },\n  });\n}\n\nfunction flatMapTransform(fn) {\n  let index = 0;\n\n  return new Transform({\n    objectMode: true,\n    transform(chunk, encoding, callback){\n      const results = fn(chunk, index++);\n      // eslint-disable-next-line unicorn/no-array-method-this-argument\n      results.forEach(pushThis, this);\n      callback();\n    },\n  });\n}\n\nfunction pushThis(x) {\n  return this.push(x);\n}\n\nmodule.exports = {\n  through,\n  mapTransform,\n  flatMapTransform,\n};\n"
  },
  {
    "path": "detox/src/logger/utils/tracerLegacy.js",
    "content": "const methods = {\n  startSection(logger) {\n    return (msg, args) => {\n      if (args !== undefined) {\n        return logger.trace.begin(args, msg);\n      } else {\n        return logger.trace.begin(msg);\n      }\n    };\n  },\n\n  endSection(logger) {\n    return (_msg, args) => {\n      if (args !== undefined) {\n        return logger.trace.end(args);\n      } else {\n        return logger.trace.end();\n      }\n    };\n  },\n\n  traceCall(logger) {\n    return (name, action, args = {}) => logger.trace.complete(args, name, action);\n  },\n};\n\nfunction installLegacyTracerInterface(logger, target) {\n  target.traceCall = methods.traceCall(logger);\n  target.trace = Object.freeze({\n    startSection: methods.startSection(logger),\n    endSection: methods.endSection(logger),\n  });\n\n  return this;\n}\n\nmodule.exports = { install: installLegacyTracerInterface };\n"
  },
  {
    "path": "detox/src/matchers/factories/__snapshots__/index.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Matchers factories External-module given module with missing matchers class should throw an error 1`] = `\"The custom driver at 'fake/path' does not export the ExpectClass property\"`;\n"
  },
  {
    "path": "detox/src/matchers/factories/index.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\n\nclass MatchersFactory {\n  createMatchers() {}\n}\n\nclass Android extends MatchersFactory {\n  createMatchers({ invocationManager, runtimeDevice, eventEmitter }) {\n    const AndroidExpect = require('../../android/AndroidExpect');\n    return new AndroidExpect({ invocationManager, device: runtimeDevice, emitter: eventEmitter });\n  }\n}\n\nclass Ios extends MatchersFactory {\n  createMatchers({ invocationManager, runtimeDevice, eventEmitter }) {\n    const IosExpect = require('../../ios/expectTwo');\n    const XCUITestRunner = require('../../ios/XCUITestRunner');\n    const xcuitestRunner = new XCUITestRunner({ runtimeDevice });\n\n    return new IosExpect({\n      invocationManager,\n      xcuitestRunner,\n      emitter: eventEmitter\n    });\n  }\n}\n\nclass External extends MatchersFactory {\n  constructor(module, path) {\n    super();\n    External.validateModule(module, path);\n\n    this._module = module;\n  }\n\n  static validateModule(module, path) {\n    if (!module.ExpectClass) {\n      throw new DetoxRuntimeError(`The custom driver at '${path}' does not export the ExpectClass property`);\n    }\n  }\n\n  createMatchers(deps) {\n    return new this._module.ExpectClass(deps);\n  }\n}\n\nmodule.exports = {\n  Android,\n  Ios,\n  External,\n};\n"
  },
  {
    "path": "detox/src/matchers/factories/index.test.js",
    "content": "describe('Matchers factories', () => {\n  let factories;\n  beforeEach(() => {\n    factories = require('./index');\n  });\n\n  describe('External-module', () => {\n    describe('given module with missing matchers class', () => {\n      it('should throw an error', () => {\n        const module = {\n          ExpectClass: undefined,\n        };\n        expect(() => factories.External.validateModule(module, 'fake/path')).toThrowErrorMatchingSnapshot();\n      });\n    });\n\n    describe('given proper module', () => {\n      it('should not throw an error', () => {\n        const module = {\n          ExpectClass: class {},\n        };\n        factories.External.validateModule(module, 'fake/path');\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/matchers/semanticTypes.js",
    "content": "/**\n * Semantic type mappings for cross-platform component matching\n */\n\n// Shared class mappings for aliases\nconst ACTIVITY_INDICATOR_CLASSES = {\n  ios: ['UIActivityIndicatorView'],\n  android: [\n    {\n      include: ['android.widget.ProgressBar', 'androidx.core.widget.ContentLoadingProgressBar'],\n      exclude: ['android.widget.AbsSeekBar']\n    }\n  ]\n};\n\nconst SEMANTIC_TYPE_MAPPINGS = {\n  // Images\n  'image': {\n    ios: ['RCTImageView', 'RCTImageComponentView', 'UIImageView'],\n    android: ['android.widget.ImageView', 'com.facebook.react.views.image.ReactImageView']\n  },\n\n  // Input fields\n  'input-field': {\n    ios: ['RCTTextInputView', 'RCTMultilineTextInputView', 'UITextField', 'UITextView'],\n    android: ['android.widget.EditText', 'com.facebook.react.views.textinput.ReactEditText']\n  },\n\n  // Text elements (includes both old and new arch classes)\n  'text': {\n    ios: ['RCTText', 'RCTParagraphComponentView', 'UILabel'],\n    android: [\n      {\n        include: ['android.widget.TextView', 'com.facebook.react.views.text.ReactTextView'],\n        exclude: ['android.widget.EditText', 'android.widget.Button']\n      }\n    ]\n  },\n\n  // Button elements (includes both old and new arch classes)\n  'button': {\n    ios: ['UIButton', 'RCTTouchableOpacity', 'RCTTouchableHighlight', 'RCTTouchableWithoutFeedback'],\n    android: ['android.widget.Button', 'android.widget.ImageButton']\n  },\n\n  // Scroll containers - The UITableView inherits from scrollview so it could also show up here...\n  'scrollview': {\n    ios: ['RCTScrollView', 'RCTScrollViewComponentView', 'UIScrollView'],\n    android: ['android.widget.ScrollView', 'androidx.core.widget.NestedScrollView', 'com.facebook.react.views.scroll.ReactScrollView']\n  },\n\n  // Lists\n  'list': {\n    ios: ['UITableView', 'UICollectionView', 'RCTScrollView'],\n    android: ['android.widget.ListView', 'androidx.recyclerview.widget.RecyclerView', 'com.facebook.react.views.scroll.ReactScrollView']\n  },\n\n  // Switches/Toggles\n  'switch': {\n    ios: ['UISwitch'],\n    android: ['android.widget.Switch', 'androidx.appcompat.widget.SwitchCompat', 'com.facebook.react.views.switchview.ReactSwitch']\n  },\n\n  // Sliders\n  'slider': {\n    ios: ['UISlider'],\n    android: ['android.widget.SeekBar']\n  },\n\n  // Picker/Selector\n  'picker': {\n    ios: ['UIPickerView'],\n    android: ['android.widget.Spinner', 'androidx.appcompat.widget.AppCompatSpinner']\n  },\n\n  // Activity indicators/Progress\n  'activity-indicator': ACTIVITY_INDICATOR_CLASSES,\n\n  // Progress (alias for activity-indicator)\n  'progress': ACTIVITY_INDICATOR_CLASSES\n};\n\n/**\n * Get platform-specific class names for a semantic type\n * @param {string} semanticType - The semantic type (e.g., 'image', 'input-field')\n * @param {string} platform - The platform ('ios' or 'android')\n * @returns {Array<string|object>} Array of class names or matcher objects for the platform\n */\nfunction getClasses(semanticType, platform) {\n  const mapping = SEMANTIC_TYPE_MAPPINGS[semanticType];\n  if (!mapping) {\n    return [{ className: semanticType, excludes: [] }];\n  }\n\n  const classNames = mapping[platform];\n  if (!classNames) {\n    throw new Error(`Platform ${platform} not supported for semantic type ${semanticType}`);\n  }\n\n  return classNames.map(item => {\n    if (typeof item === 'string') {\n      return { className: item, excludes: [] };\n    } else if (item.include && item.exclude) {\n      if (Array.isArray(item.include)) {\n        return item.include.map(className => ({\n          className,\n          excludes: item.exclude\n        }));\n      } else {\n        return {\n          className: item.include,\n          excludes: item.exclude\n        };\n      }\n    }\n    return { className: item, excludes: [] };\n  }).flat();\n}\n\n/**\n * Get all available semantic types\n * @returns {string[]} Array of available semantic type names\n */\nfunction getTypes() {\n  return Object.keys(SEMANTIC_TYPE_MAPPINGS);\n}\n\nfunction includes(value) {\n  return getTypes().includes(value);\n}\n\nmodule.exports = {\n  SEMANTIC_TYPE_MAPPINGS,\n  getClasses,\n  getTypes,\n  includes,\n};\n"
  },
  {
    "path": "detox/src/matchers/semanticTypes.test.js",
    "content": "const semanticTypes = require('./semanticTypes');\n\ndescribe('semanticTypes', () => {\n  const semanticTypeList = semanticTypes.getTypes();\n  const platforms = ['ios', 'android'];\n\n  describe('getClasses', () => {\n    it('should return fallback for unknown semantic type', () => {\n      const classNames = semanticTypes.getClasses('unknown-type', 'ios');\n      expect(classNames).toEqual([{ className: 'unknown-type', excludes: [] }]);\n    });\n\n    it('should throw error for unsupported platform', () => {\n      expect(() => {\n        semanticTypes.getClasses('image', 'windows');\n      }).toThrow('Platform windows not supported for semantic type image');\n    });\n\n    it('should return same classes for progress and activity-indicator', () => {\n      platforms.forEach(platform => {\n        expect(semanticTypes.getClasses('progress', platform)).toEqual(\n          semanticTypes.getClasses('activity-indicator', platform)\n        );\n      });\n    });\n\n    it('should handle exclusion objects correctly', () => {\n      const classNames = semanticTypes.getClasses('activity-indicator', 'android');\n\n      expect(classNames).toHaveLength(2);\n      expect(classNames[0]).toHaveProperty('className', 'android.widget.ProgressBar');\n      expect(classNames[0]).toHaveProperty('excludes', ['android.widget.AbsSeekBar']);\n      expect(classNames[1]).toHaveProperty('className', 'androidx.core.widget.ContentLoadingProgressBar');\n      expect(classNames[1]).toHaveProperty('excludes', ['android.widget.AbsSeekBar']);\n    });\n\n    it('should handle text exclusions to prevent EditText and Button conflicts', () => {\n      const classNames = semanticTypes.getClasses('text', 'android');\n\n      expect(classNames).toHaveLength(2);\n      expect(classNames[0]).toHaveProperty('className', 'android.widget.TextView');\n      expect(classNames[0]).toHaveProperty('excludes', ['android.widget.EditText', 'android.widget.Button']);\n      expect(classNames[1]).toHaveProperty('className', 'com.facebook.react.views.text.ReactTextView');\n      expect(classNames[1]).toHaveProperty('excludes', ['android.widget.EditText', 'android.widget.Button']);\n    });\n\n    it('should handle single string include with exclusions', () => {\n      semanticTypes.SEMANTIC_TYPE_MAPPINGS['test-single'] = {\n        android: [{\n          include: 'android.widget.TestView',\n          exclude: ['android.widget.ExcludedView']\n        }]\n      };\n\n      const classNames = semanticTypes.getClasses('test-single', 'android');\n\n      expect(classNames).toHaveLength(1);\n      expect(classNames[0]).toHaveProperty('className', 'android.widget.TestView');\n      expect(classNames[0]).toHaveProperty('excludes', ['android.widget.ExcludedView']);\n\n      delete semanticTypes.SEMANTIC_TYPE_MAPPINGS['test-single'];\n    });\n\n    it('should handle unexpected item types gracefully', () => {\n      semanticTypes.SEMANTIC_TYPE_MAPPINGS['test-fallback'] = {\n        android: [{ unexpectedProperty: 'someValue' }]\n      };\n\n      const classNames = semanticTypes.getClasses('test-fallback', 'android');\n\n      expect(classNames).toHaveLength(1);\n      expect(classNames[0]).toHaveProperty('className');\n      expect(classNames[0]).toHaveProperty('excludes', []);\n\n      delete semanticTypes.SEMANTIC_TYPE_MAPPINGS['test-fallback'];\n    });\n  });\n\n  describe('getTypes', () => {\n    it('should return all semantic types from mappings', () => {\n      const types = semanticTypes.getTypes();\n      const mappingKeys = Object.keys(semanticTypes.SEMANTIC_TYPE_MAPPINGS);\n      expect(types).toEqual(mappingKeys);\n    });\n\n    it('should return an array', () => {\n      const types = semanticTypes.getTypes();\n      expect(Array.isArray(types)).toBe(true);\n    });\n\n    it('should not be empty', () => {\n      const types = semanticTypes.getTypes();\n      expect(types.length).toBeGreaterThan(0);\n    });\n  });\n\n  describe('includes', () => {\n    it('should return true for valid semantic types', () => {\n      semanticTypeList.forEach(semanticType => {\n        expect(semanticTypes.includes(semanticType)).toBe(true);\n      });\n    });\n\n    it('should return false for invalid semantic types', () => {\n      expect(semanticTypes.includes('unknown-type')).toBe(false);\n      expect(semanticTypes.includes('')).toBe(false);\n\n      const buttonClasses = semanticTypes.getClasses('button', 'ios');\n      const imageClasses = semanticTypes.getClasses('image', 'android');\n\n      buttonClasses.forEach(item => {\n        expect(semanticTypes.includes(item.className)).toBe(false);\n      });\n\n      imageClasses.forEach(item => {\n        expect(semanticTypes.includes(item.className)).toBe(false);\n      });\n    });\n\n    it('should return false for non-string values', () => {\n      expect(semanticTypes.includes(null)).toBe(false);\n      expect(semanticTypes.includes(undefined)).toBe(false);\n      expect(semanticTypes.includes(123)).toBe(false);\n      expect(semanticTypes.includes({})).toBe(false);\n      expect(semanticTypes.includes([])).toBe(false);\n    });\n  });\n\n  describe('cross-platform validation', () => {\n    it('should ensure all semantic types have valid class names for both platforms', () => {\n      const allSemanticTypes = semanticTypes.getTypes();\n      allSemanticTypes.forEach(semanticType => {\n        const androidClassNames = semanticTypes.getClasses(semanticType, 'android');\n        const iosClassNames = semanticTypes.getClasses(semanticType, 'ios');\n\n        expect(androidClassNames.length).toBeGreaterThan(0);\n        expect(iosClassNames.length).toBeGreaterThan(0);\n\n        [...androidClassNames, ...iosClassNames].forEach(item => {\n          expect(item).toHaveProperty('className');\n          expect(item).toHaveProperty('excludes');\n          expect(typeof item.className).toBe('string');\n          expect(item.className.length).toBeGreaterThan(0);\n          expect(Array.isArray(item.excludes)).toBe(true);\n          item.excludes.forEach(excludeClass => {\n            expect(typeof excludeClass).toBe('string');\n            expect(excludeClass.length).toBeGreaterThan(0);\n          });\n        });\n      });\n    });\n\n    it('should differentiate between semantic types and regular class names', () => {\n      expect(semanticTypes.getTypes().includes('image')).toBe(true);\n      expect(semanticTypes.getTypes().includes('button')).toBe(true);\n      expect(semanticTypes.getTypes().includes('com.example.CustomView')).toBe(false);\n      expect(semanticTypes.getTypes().includes('UIButton')).toBe(false);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/pilot/DetoxPilot.js",
    "content": "const { Pilot } = require('@wix-pilot/core');\nconst { DetoxFrameworkDriver }  = require('@wix-pilot/detox');\n\nconst detox = require('../..');\n\n/** @type {Detox.PilotFacade} */\nclass DetoxPilot {\n  /**\n   * @param {Partial<import('@wix-pilot/core').Config>} [defaults] Arbitrary config defaults for the Pilot.\n   */\n  constructor(defaults = {}) {\n    this._defaults = defaults;\n  }\n\n  init(promptHandler) {\n    this.pilot = new Pilot({\n      ...this._defaults,\n      frameworkDriver: new DetoxFrameworkDriver(detox),\n      promptHandler: promptHandler,\n    });\n  }\n\n  start(){\n    if (!this.isInitialized()) {\n      throw new Error('DetoxPilot is not initialized');\n    }\n    return this.pilot.start();\n  }\n\n  perform(...steps){\n    if (!this.isInitialized()) {\n      throw new Error('DetoxPilot is not initialized');\n    }\n    return this.pilot.perform(...steps);\n  }\n\n  autopilot(goal) {\n    return this.pilot.autopilot(goal);\n  }\n\n  extendAPICatalog(categories, context) {\n    return this.pilot.extendAPICatalog(categories, context);\n  }\n\n  end(shouldSaveInCache){\n    if(!this.isInitialized()){\n      throw new Error('DetoxPilot is not initialized');\n    }\n    return this.pilot.end(shouldSaveInCache);\n  }\n\n  isInitialized(){\n    return !!this.pilot;\n  }\n\n  /**\n   * @param {Partial<import('@wix-pilot/core').Config>} [defaults] Arbitrary config defaults for the Pilot.\n   * @internal\n   */\n  setDefaults(defaults) {\n    Object.assign(this._defaults, defaults);\n  }\n}\n\nmodule.exports = DetoxPilot;\n"
  },
  {
    "path": "detox/src/pilot/DetoxPilot.test.js",
    "content": "const { Pilot } = require('@wix-pilot/core');\nconst { DetoxFrameworkDriver } = require('@wix-pilot/detox');\n\nconst DetoxPilot = require('./DetoxPilot');\n\njest.mock('@wix-pilot/core');\n\njest.mock('@wix-pilot/detox', () => ({\n  DetoxFrameworkDriver: jest.fn(),\n}));\n\ndescribe('DetoxPilot', () => {\n  let detoxPilot;\n  const INTENT = 'test something';\n  const GOAL = 'test goal';\n  const mockPromptHandler = jest.fn();\n\n  beforeEach(() => {\n    detoxPilot = new DetoxPilot();\n    jest.clearAllMocks();\n  });\n\n  describe('init', () => {\n    it('should initialize pilot with correct parameters', () => {\n      detoxPilot.init(mockPromptHandler);\n\n      expect(Pilot).toHaveBeenCalledWith({\n        frameworkDriver: expect.any(DetoxFrameworkDriver),\n        promptHandler: mockPromptHandler,\n      });\n    });\n  });\n\n  describe('start', () => {\n    it('should call pilot.start', async () => {\n      detoxPilot.init(mockPromptHandler);\n      await detoxPilot.start();\n\n      expect(Pilot.prototype.start).toHaveBeenCalled();\n    });\n  });\n\n  describe('perform', () => {\n    it('should call pilot.perform with the given intent', async () => {\n      detoxPilot.init(mockPromptHandler);\n      await detoxPilot.perform(INTENT);\n\n      expect(Pilot.prototype.perform).toHaveBeenCalledWith(INTENT);\n    });\n\n    it('should throw an error if pilot is not initialized', async () => {\n      expect(() => detoxPilot.perform(INTENT)).toThrow('DetoxPilot is not initialized');\n    });\n  });\n\n  describe('autopilot', () => {\n    it('should call pilot.autopilot with the given goal', async () => {\n      detoxPilot.init(mockPromptHandler);\n      await detoxPilot.autopilot(GOAL);\n\n      expect(Pilot.prototype.autopilot).toHaveBeenCalledWith(GOAL);\n    });\n  });\n\n  describe('isInitialized', () => {\n    it('should return true if pilot is initialized', () => {\n      detoxPilot.init(mockPromptHandler);\n\n      expect(detoxPilot.isInitialized()).toBe(true);\n    });\n\n    it('should return false if pilot is not initialized', () => {\n      expect(detoxPilot.isInitialized()).toBe(false);\n    });\n  });\n\n  describe('end', () => {\n    it('should call pilot.end with the given shouldSaveInCache', async () => {\n      detoxPilot.init(mockPromptHandler);\n      await detoxPilot.end(true);\n\n      expect(Pilot.prototype.end).toHaveBeenCalledWith(true);\n    });\n\n    it('should throw an error if pilot is not initialized', async () => {\n      expect(() => detoxPilot.end()).toThrow('DetoxPilot is not initialized');\n    });\n  });\n\n  describe('setDefaults', () => {\n    it('should merge defaults into init configuration', () => {\n      const testDefaults = {\n        testContext: {\n          someProperty: 'test-value'\n        }\n      };\n\n      detoxPilot.setDefaults(testDefaults);\n      detoxPilot.init(mockPromptHandler);\n\n      expect(Pilot).toHaveBeenCalledWith({\n        frameworkDriver: expect.any(DetoxFrameworkDriver),\n        promptHandler: mockPromptHandler,\n        testContext: {\n          someProperty: 'test-value'\n        }\n      });\n    });\n\n    it('should work like merge - multiple setDefaults calls accumulate', () => {\n      const firstDefaults = {\n        testContext: {\n          property1: 'value1'\n        }\n      };\n\n      const secondDefaults = {\n        cacheOptions: {\n          property2: 'value2'\n        }\n      };\n\n      detoxPilot.setDefaults(firstDefaults);\n      detoxPilot.setDefaults(secondDefaults);\n      detoxPilot.init(mockPromptHandler);\n\n      expect(Pilot).toHaveBeenCalledWith({\n        frameworkDriver: expect.any(DetoxFrameworkDriver),\n        promptHandler: mockPromptHandler,\n        testContext: {\n          property1: 'value1'\n        },\n        cacheOptions: {\n          property2: 'value2'\n        }\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/realms/DetoxConstants.js",
    "content": "module.exports = Object.freeze({\n  userNotificationTriggers: {\n    push: 'push',\n    calendar: 'calendar',\n    timeInterval: 'timeInterval',\n    location: 'location'\n  },\n  userActivityTypes: {\n    searchableItem: 'com.apple.corespotlightitem',\n    browsingWeb: 'NSUserActivityTypeBrowsingWeb',\n  },\n  searchableItemActivityIdentifier: 'kCSSearchableItemActivityIdentifier'\n});\n"
  },
  {
    "path": "detox/src/realms/DetoxContext.js",
    "content": "const funpermaproxy = require('funpermaproxy');\n\nconst temporary = require('../artifacts/utils/temporaryPath');\nconst { DetoxRuntimeError } = require('../errors');\nconst { DetoxLogger, DetoxLogFinalizer, installLegacyTracerInterface } = require('../logger');\n\nconst DetoxConstants = require('./DetoxConstants');\nconst symbols = require('./symbols');\n\n//#region Protected symbols\nconst $cleanup = Symbol('cleanup');\nconst $logFinalizer = Symbol('logFinalizer');\nconst $restoreSessionState = Symbol('restoreSessionState');\nconst $sessionState = Symbol('restoreSessionState');\nconst $status = Symbol('status');\nconst $worker = Symbol('worker');\n//#endregion\n\nclass DetoxContext {\n  constructor() {\n    /** @type {DetoxInternals.DetoxStatus} */\n    this[$status] = 'inactive';\n\n    const _init = this[symbols.init].bind(this);\n    this[symbols.init] = async (opts) => {\n      this[$status] = 'init';\n      await _init(opts);\n      this[$status] = 'active';\n    };\n\n    const _cleanup = this[symbols.cleanup].bind(this);\n    this[symbols.cleanup] = async () => {\n      this[$status] = 'cleanup';\n      try {\n        await _cleanup();\n      } finally {\n        this[$status] = 'inactive';\n      }\n    };\n\n    this[symbols.getStatus] = this[symbols.getStatus].bind(this);\n    this[symbols.reportTestResults] = this[symbols.reportTestResults].bind(this);\n    this[symbols.resolveConfig] = this[symbols.resolveConfig].bind(this);\n    this[symbols.installWorker] = this[symbols.installWorker].bind(this);\n    this[symbols.uninstallWorker] = this[symbols.uninstallWorker].bind(this);\n\n    this[$sessionState] = this[$restoreSessionState]();\n\n    /**\n     * @type {import('../logger/').DetoxLogger & Detox.Logger}\n     */\n    this[symbols.logger] = new DetoxLogger({\n      file: temporary.for.jsonl(`${this[$sessionState].id}.${process.pid}`),\n      userConfig: this[$sessionState].detoxConfig\n        ? this[$sessionState].detoxConfig.logger\n        : null,\n    });\n\n    this.log = this[symbols.logger].child({ cat: 'user' });\n    installLegacyTracerInterface(this.log, this);\n\n    this[$logFinalizer] = new DetoxLogFinalizer({\n      session: this[$sessionState],\n      logger: this[symbols.logger],\n    });\n\n    /** @type {import('../DetoxWorker') | null} */\n    this[$worker] = null;\n  }\n\n  //#region Public members\n  device = funpermaproxy(() => this[symbols.worker].device);\n\n  element = funpermaproxy.callable(() => this[symbols.worker].element);\n\n  waitFor = funpermaproxy.callable(() => this[symbols.worker].waitFor);\n\n  expect = funpermaproxy.callable(() => this[symbols.worker].expect);\n\n  by = funpermaproxy(() => this[symbols.worker].by);\n\n  web = funpermaproxy.callable(() => this[symbols.worker].web);\n\n  system = funpermaproxy.callable(() => this[symbols.worker].system);\n\n  pilot = funpermaproxy.callable(() => this[symbols.worker].pilot);\n\n  copilot = funpermaproxy.callable(() => this[symbols.worker].copilot);\n\n  REPL = (context) => {\n    const config = this[symbols.config];\n    const repl = require('../utils/repl');\n    if (config && config.cli && config.cli.repl) {\n      return repl.enterREPL(context);\n    }\n\n    this.log.warn('To use the Detox REPL, you must enable it with either the --repl CLI flag or DETOX_REPL environment variable');\n  };\n\n  get DetoxConstants() {\n    return DetoxConstants;\n  }\n\n  //#endregion\n\n  //#region Internal members\n  [symbols.onRunDescribeStart] = (...args) => this[symbols.worker].onRunDescribeStart(...args);\n  [symbols.onTestStart] = (...args) => this[symbols.worker].onTestStart(...args);\n  [symbols.onHookFailure] = (...args) => this[symbols.worker].onHookFailure(...args);\n  [symbols.onTestFnFailure] = (...args) => this[symbols.worker].onTestFnFailure(...args);\n  [symbols.onTestDone] = (...args) => this[symbols.worker].onTestDone(...args);\n  [symbols.onRunDescribeFinish] = (...args) => this[symbols.worker].onRunDescribeFinish(...args);\n  [symbols.config] = funpermaproxy(() => this[symbols.session].detoxConfig);\n  [symbols.session] = funpermaproxy(() => this[$sessionState]);\n  [symbols.tracing] = Object.freeze({\n    createEventStream: () => this[$logFinalizer].createEventStream(),\n  });\n  /** @abstract */\n  [symbols.reportTestResults](_testResults) {}\n  /** @abstract */\n  [symbols.conductEarlyTeardown](_permanent) {}\n  /**\n   * @abstract\n   * @param {Partial<DetoxInternals.DetoxInitOptions>} _opts\n   * @returns {Promise<DetoxInternals.RuntimeConfig>}\n   */\n  async [symbols.resolveConfig](_opts) { return null; }\n\n  [symbols.getStatus]() {\n    return this[$status];\n  }\n\n  get [symbols.worker]() {\n    if (!this[$worker]) {\n      throw new DetoxRuntimeError({\n        message: `Detox worker instance has not been installed in this context (${this.constructor.name}).`,\n        hint: DetoxRuntimeError.reportIssueIfJest + '\\n' + 'Otherwise, make sure you call detox.installWorker() beforehand.',\n      });\n    }\n\n    return this[$worker];\n  }\n\n  /**\n   * @abstract\n   * @param {Partial<DetoxInternals.DetoxInitOptions>} [_opts]\n   * @returns {Promise<void>}\n   */\n  async [symbols.init](_opts = {}) {}\n\n  /**\n   * @param {Partial<DetoxInternals.DetoxInstallWorkerOptions>} [opts]\n   */\n  async [symbols.installWorker](opts) {\n    if (opts.global) {\n      opts.global['__detox__'] = {\n        clientApi: require('../../index'),\n        internalsApi: require('../../internals'),\n      };\n      this.log.overrideConsole(opts.global);\n    }\n\n    const DetoxWorker = require('../DetoxWorker');\n    DetoxWorker.global = opts.global || global;\n    this[$worker] = new DetoxWorker(this);\n    this[$worker].id = opts.workerId;\n    await this[$worker].init();\n  }\n\n  /** @abstract */\n  async [symbols.allocateDevice](_deviceConfig) {}\n\n  /** @abstract */\n  async [symbols.deallocateDevice](_deviceCookie) {}\n\n  async [symbols.uninstallWorker]() {\n    try {\n      if (this[$worker]) {\n        await this[$worker].cleanup();\n      }\n    } finally {\n      this[$worker] = null;\n    }\n  }\n\n  /**\n   * @abstract\n   */\n  async [symbols.cleanup]() {}\n  //#endregion\n\n  //#region Protected members\n  /**\n   * @abstract\n   * @protected\n   */\n  [$restoreSessionState]() {\n    return null;\n  }\n  //#endregion\n}\n\nmodule.exports = DetoxContext;\nmodule.exports.protected = {\n  $cleanup,\n  $logFinalizer,\n  $restoreSessionState,\n  $status,\n  $sessionState,\n  $worker,\n};\n"
  },
  {
    "path": "detox/src/realms/DetoxInternalsFacade.js",
    "content": "const funpermaproxy = require('funpermaproxy');\n\nconst symbols = require('./symbols');\n\nclass DetoxInternalsFacade {\n  /**\n   * @param context\n   */\n  constructor(context) {\n    this.config = context[symbols.config];\n    this.getStatus = context[symbols.getStatus];\n    this.init = context[symbols.init];\n    this.cleanup = context[symbols.cleanup];\n    this.log = context[symbols.logger];\n    this.installWorker = context[symbols.installWorker];\n    this.uninstallWorker = context[symbols.uninstallWorker];\n    this.onHookFailure = context[symbols.onHookFailure];\n    this.onRunDescribeFinish = context[symbols.onRunDescribeFinish];\n    this.onRunDescribeStart = context[symbols.onRunDescribeStart];\n    this.onTestDone = context[symbols.onTestDone];\n    this.onTestFnFailure = context[symbols.onTestFnFailure];\n    this.onTestStart = context[symbols.onTestStart];\n    this.reportTestResults = context[symbols.reportTestResults];\n    this.resolveConfig = context[symbols.resolveConfig];\n    this.session = context[symbols.session];\n    this.tracing = context[symbols.tracing];\n    this.unsafe_conductEarlyTeardown = context[symbols.conductEarlyTeardown];\n    this.worker = funpermaproxy(() => context[symbols.worker]);\n  }\n}\n\nmodule.exports = DetoxInternalsFacade;\n"
  },
  {
    "path": "detox/src/realms/DetoxPrimaryContext.js",
    "content": "const { URL } = require('url');\n\nconst fs = require('fs-extra');\nconst onSignalExit = require('signal-exit');\n\nconst temporary = require('../artifacts/utils/temporaryPath');\nconst { DetoxRuntimeError } = require('../errors');\nconst SessionState = require('../ipc/SessionState');\nconst { getCurrentCommand } = require('../utils/argparse');\nconst retry = require('../utils/retry');\nconst uuid = require('../utils/uuid');\n\nconst DetoxContext = require('./DetoxContext');\nconst symbols = require('./symbols');\n\n// Protected symbols\nconst { $logFinalizer, $restoreSessionState, $sessionState, $worker } = DetoxContext.protected;\n\n//#region Private symbols\nconst _ipcServer = Symbol('ipcServer');\nconst _wss = Symbol('wss');\nconst _dirty = Symbol('dirty');\nconst _emergencyTeardown = Symbol('emergencyTeardown');\nconst _lifecycleLogger = Symbol('lifecycleLogger');\nconst _sessionFile = Symbol('sessionFile');\nconst _logFinalError = Symbol('logFinalError');\nconst _cookieAllocators = Symbol('cookieAllocators');\nconst _deviceAllocators = Symbol('deviceAllocators');\nconst _createDeviceAllocator = Symbol('createDeviceAllocator');\nconst _createDeviceAllocatorInstance = Symbol('createDeviceAllocatorInstance');\nconst _allocateDeviceOnce = Symbol('allocateDeviceOnce');\n//#endregion\n\nclass DetoxPrimaryContext extends DetoxContext {\n  constructor() {\n    super();\n\n    this[_dirty] = false;\n    this[_wss] = null;\n    this[_cookieAllocators] = {};\n    this[_deviceAllocators] = {};\n\n    /** Path to file where the initial session object is serialized */\n    this[_sessionFile] = '';\n    /**\n     * @type {import('../ipc/IPCServer') | null}\n     */\n    this[_ipcServer] = null;\n    /** @type {Detox.Logger} */\n    this[_lifecycleLogger] = this[symbols.logger].child({ cat: 'lifecycle' });\n  }\n\n  //#region Internal members\n  async [symbols.reportTestResults](testResults) {\n    if (this[_ipcServer]) {\n      this[_ipcServer].onReportTestResults({ testResults });\n    }\n  }\n\n  [symbols.conductEarlyTeardown] = async (permanent = false) => {\n    if (this[_ipcServer]) {\n      await this[_ipcServer].onConductEarlyTeardown({ permanent });\n    }\n  };\n\n  async [symbols.resolveConfig](opts = {}) {\n    const session = this[$sessionState];\n    if (!session.detoxConfig) {\n      const configuration = require('../configuration');\n      session.detoxConfig = await configuration.composeDetoxConfig(opts);\n    }\n\n    return session.detoxConfig;\n  }\n\n  /**\n   * @override\n   * @param {Partial<DetoxInternals.DetoxInitOptions>} [opts]\n   */\n  async [symbols.init](opts = {}) {\n    if (this[_dirty]) {\n      throw new DetoxRuntimeError({\n        message: 'Cannot initialize primary Detox context more than once.',\n        hint: DetoxRuntimeError.reportIssueIfJest,\n      });\n    }\n\n    this[_dirty] = true;\n    onSignalExit(this[_emergencyTeardown]);\n\n    const detoxConfig = await this[symbols.resolveConfig](opts);\n\n    const {\n      logger: loggerConfig,\n      session: sessionConfig\n    } = detoxConfig;\n    await this[symbols.logger].setConfig(loggerConfig);\n\n    this[_lifecycleLogger].trace.begin({\n      cwd: process.cwd(),\n      data: this[$sessionState],\n    }, getCurrentCommand());\n\n    const IPCServer = require('../ipc/IPCServer');\n    this[_ipcServer] = new IPCServer({\n      sessionState: this[$sessionState],\n      logger: this[symbols.logger],\n      callbacks: {\n        onAllocateDevice: this[symbols.allocateDevice].bind(this),\n        onDeallocateDevice: this[symbols.deallocateDevice].bind(this),\n      },\n    });\n\n    await this[_ipcServer].init();\n\n    const DetoxServer = require('../server/DetoxServer');\n    if (sessionConfig.autoStart) {\n      this[_wss] = new DetoxServer({\n        port: sessionConfig.server\n          ? new URL(sessionConfig.server).port\n          : 0,\n        standalone: false,\n      });\n\n      await this[_wss].open();\n    }\n\n    if (!sessionConfig.server && this[_wss]) {\n      // @ts-ignore\n      sessionConfig.server = `ws://localhost:${this[_wss].port}`;\n    }\n\n    this[_sessionFile] = temporary.for.json(this[$sessionState].id);\n    await fs.writeFile(this[_sessionFile], this[$sessionState].stringify());\n    process.env.DETOX_CONFIG_SNAPSHOT_PATH = this[_sessionFile];\n    this[_lifecycleLogger].trace(`Serialized the session state at: ${this[_sessionFile]}`);\n\n    if (opts.workerId !== null) {\n      await this[symbols.installWorker](opts);\n    }\n  }\n\n  /**\n   * @override\n   * @param {Partial<DetoxInternals.DetoxInstallWorkerOptions>} [opts]\n   */\n  async [symbols.installWorker](opts = {}) {\n    const workerId = opts.workerId || 'worker';\n\n    this[$sessionState].workerId = workerId;\n    this[_ipcServer].onRegisterWorker({ workerId });\n\n    await super[symbols.installWorker]({ ...opts, workerId });\n  }\n\n  /** @override */\n  async [symbols.allocateDevice](deviceConfig) {\n    const deviceAllocator = await this[_createDeviceAllocator](deviceConfig);\n\n    const retryOptions = {\n      backoff: 'none',\n      retries: 5,\n      interval: 25000,\n      conditionFn: (e) => deviceAllocator.isRecoverableError(e),\n    };\n\n    return await retry(retryOptions, async () => {\n      return await this[_allocateDeviceOnce](deviceAllocator, deviceConfig);\n    });\n  }\n\n  async [_allocateDeviceOnce](deviceAllocator, deviceConfig) {\n    const deviceCookie = await deviceAllocator.allocate(deviceConfig);\n    this[_cookieAllocators][deviceCookie.id] = deviceAllocator;\n\n    try {\n      return await deviceAllocator.postAllocate(deviceCookie, { deviceConfig });\n    } catch (e) {\n      try {\n        await deviceAllocator.free(deviceCookie, { shutdown: true });\n      } catch (e2) {\n        this[symbols.logger].error({\n          cat: 'device',\n          err: e2\n        }, `Failed to free ${deviceCookie.name || deviceCookie.id} after a failed allocation attempt`);\n      } finally {\n        delete this[_cookieAllocators][deviceCookie.id];\n      }\n\n      throw e;\n    }\n  }\n\n  /** @override */\n  async [symbols.deallocateDevice](cookie) {\n    const deviceAllocator = this[_cookieAllocators][cookie.id];\n    if (!deviceAllocator) {\n      throw new DetoxRuntimeError({\n        message: `Cannot deallocate device ${cookie.id} because it was not allocated by this context.`,\n        hint: `See the actually known allocated devices below:`,\n        debugInfo: Object.keys(this[_cookieAllocators]).map(id => `- ${id}`).join('\\n'),\n      });\n    }\n\n    await deviceAllocator.free(cookie);\n    delete this[_cookieAllocators][cookie.id];\n  }\n\n  /** @override */\n  async [symbols.cleanup]() {\n    try {\n      if (this[$worker]) {\n        await this[symbols.uninstallWorker]();\n      }\n    } finally {\n      for (const key of Object.keys(this[_deviceAllocators])) {\n        const deviceAllocator = this[_deviceAllocators][key];\n        delete this[_deviceAllocators][key];\n        try {\n          await deviceAllocator.cleanup();\n        } catch (err) {\n          this[symbols.logger].error({ cat: 'device', err }, `Failed to cleanup the device allocation driver for ${key}`);\n        }\n      }\n\n      this[_cookieAllocators] = {};\n\n      if (this[_wss]) {\n        await this[_wss].close();\n        this[_wss] = null;\n      }\n\n      if (this[_ipcServer]) {\n        await this[_ipcServer].dispose();\n        this[_ipcServer] = null;\n      }\n\n      if (this[_sessionFile]) {\n        await fs.remove(this[_sessionFile]);\n      }\n\n      if (this[_dirty]) {\n        try {\n          this[_lifecycleLogger].trace.end();\n          await this[symbols.logger].close();\n          await this[$logFinalizer].finalize();\n        } catch (err) {\n          this[_logFinalError](err);\n        }\n      }\n    }\n  }\n\n  [_emergencyTeardown] = (_code, signal) => {\n    if (!signal) {\n      return;\n    }\n\n    for (const key of Object.keys(this[_deviceAllocators])) {\n      const deviceAllocator = this[_deviceAllocators][key];\n      delete this[_deviceAllocators][key];\n      try {\n        deviceAllocator.emergencyCleanup();\n      } catch (err) {\n        this[symbols.logger].error({ cat: 'device', err }, `Failed to clean up the device allocation driver for ${key} in emergency mode`);\n      }\n    }\n\n    this[_cookieAllocators] = {};\n\n    if (this[_wss]) {\n      this[_wss].close();\n    }\n\n    if (this[_ipcServer]) {\n      this[_ipcServer].dispose();\n    }\n\n    if (this[_sessionFile]) {\n      fs.removeSync(this[_sessionFile]);\n    }\n\n    try {\n      this[_lifecycleLogger].trace.end({ abortSignal: signal });\n      this[symbols.logger].close().catch(this[_logFinalError]);\n      this[$logFinalizer].finalizeSync();\n    } catch (err) {\n      this[_logFinalError](err);\n    }\n  };\n\n  /** @param {Detox.DetoxDeviceConfig} deviceConfig */\n  [_createDeviceAllocator] = async (deviceConfig) => {\n    const deviceType = deviceConfig.type;\n    const deviceAllocator = this[_createDeviceAllocatorInstance](deviceConfig);\n\n    try {\n      await deviceAllocator.init();\n    } catch (e) {\n      try {\n        delete this[_deviceAllocators][deviceType];\n        await deviceAllocator.cleanup();\n      } catch (e2) {\n        this[symbols.logger].error({ cat: 'device', err: e2 }, `Failed to cleanup the device allocation driver for ${deviceType} after a failed initialization`);\n      }\n\n      throw e;\n    }\n\n    return this[_deviceAllocators][deviceType];\n  };\n\n  /**\n   * @param {Detox.DetoxDeviceConfig} deviceConfig\n   * @returns { DeviceAllocator }\n   */\n  [_createDeviceAllocatorInstance] = (deviceConfig) => {\n    const deviceType = deviceConfig.type;\n\n    if (!this[_deviceAllocators][deviceType]) {\n      const environmentFactory = require('../environmentFactory');\n      const { deviceAllocatorFactory } = environmentFactory.createFactories(deviceConfig);\n      const { detoxConfig } = this[$sessionState];\n\n      this[_deviceAllocators][deviceType] = deviceAllocatorFactory.createDeviceAllocator({\n        detoxConfig,\n        detoxSession: this[$sessionState]\n      });\n    }\n    return this[_deviceAllocators][deviceType];\n  };\n\n  [_logFinalError] = (err) => {\n    this[_lifecycleLogger].error(err, 'Encountered an error while merging the process logs:');\n  };\n\n  //#endregion\n\n  //#region Protected members\n  /**\n   * @protected\n   * @override\n   * @return {SessionState}\n   */\n  [$restoreSessionState]() {\n    return new SessionState({\n      id: uuid.UUID(),\n      detoxIPCServer: `primary-${process.pid}`,\n    });\n  }\n  //#endregion\n}\n\nmodule.exports = DetoxPrimaryContext;\n"
  },
  {
    "path": "detox/src/realms/DetoxPrimaryContext.test.js",
    "content": "const _ = require('lodash');\n\nconst {\n  backupProcessEnv,\n  latestInstanceOf,\n  lastCallTo,\n} = require('../../__tests__/helpers');\n\ndescribe('DetoxPrimaryContext', () => {\n  //#region Fixtures and constants\n  const UUID_REGEXP_STR = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';\n  const UUID_REGEXP = new RegExp(`^${UUID_REGEXP_STR}$`);\n  const TEMP_FILE_REGEXP = new RegExp(`.*${UUID_REGEXP_STR}.detox.json$`);\n  const WORKER_ID = 19;\n  const DETOX_CONFIG_BASE = Object.freeze({\n    behavior: {\n      init: {\n        keepLockFile: false,\n      }\n    },\n    device: {\n      type: '',\n    },\n    logger: {},\n    session: {\n      autoStart: false,\n    },\n  });\n  const FIRST_ARGUMENT = 0;\n  //#endregion\n\n  let detoxConfigDriver;\n\n  //#region Mocks\n  /** @type {jest.Mocked<import('fs-extra')>} */\n  let fs;\n  /** @type {jest.Mocked<import('signal-exit')>} */\n  let signalExit;\n  /** @type {import('../logger')} */\n  let logger;\n  /** @type {jest.Mocked<import('../configuration')>} */\n  let configuration;\n  /** @type {jest.Mock<import('../ipc/IPCServer')>} */\n  let IPCServer;\n  /** @type {jest.Mocked<import('../environmentFactory')>} */\n  let environmentFactory;\n\n  /** @type {jest.Mocked<import('../devices/allocation/DeviceAllocator').AllocationDriverBase>} */\n  let deviceAllocator;\n  /** @type {jest.Mocked<import('../server/DetoxServer')>} */\n  let DetoxServer;\n  /** @type {jest.Mocked<import('../DetoxWorker')>} */\n  let DetoxWorker;\n  //#endregion\n\n  /** @type {import('./DetoxPrimaryContext')} */\n  let context;\n  /** @type {import('./DetoxInternalsFacade')} */\n  let facade;\n  /** @type {import('./symbols')} */\n  let symbols;\n  /** @type {jest.Mock<import('../utils/retry')>} */\n  let retry;\n\n  const detoxServer = () => latestInstanceOf(DetoxServer);\n  const ipcServer = () => latestInstanceOf(IPCServer);\n  const detoxWorker = () => latestInstanceOf(DetoxWorker);\n  // @ts-ignore\n  const log = () => logger.DetoxLogger.instances[0];\n  const logFinalizer = () => latestInstanceOf(logger.DetoxLogFinalizer);\n  const getSignalHandler = () => lastCallTo(signalExit)[FIRST_ARGUMENT];\n  const facadeInit = () => facade.init({ workerId: null });\n  const facadeInitWithWorker = async () => facade.init({ workerId: WORKER_ID });\n\n  backupProcessEnv();\n\n  beforeEach(_initDetoxConfig);\n  beforeEach(_initExternalMocks);\n  beforeEach(_initInternalMocks);\n  beforeEach(() => {\n    const DetoxPrimaryContext = require('./DetoxPrimaryContext');\n    const DetoxInternalsFacade = require('./DetoxInternalsFacade');\n\n    context = new DetoxPrimaryContext();\n    facade = new DetoxInternalsFacade(context);\n    symbols = require('./symbols');\n  });\n\n  describe('when not initialized', () => {\n    it('should report status as \"inactive\"', () => {\n      expect(facade.getStatus()).toBe('inactive');\n    });\n\n    it('should have a basic session with a random id (GUID)', () => {\n      expect(facade.session.id).toMatch(UUID_REGEXP);\n    });\n\n    it('should have an empty config', () => {\n      expect(facade.config).toEqual({});\n    });\n\n    it('should throw on attempt to get a worker', () => {\n      expect(() => facade.worker.id).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('when initialized', () => {\n    beforeEach(facadeInit);\n\n    it('should create an IPC server with a valid session state', async () => {\n      const expectedIPCServerName = `primary-${process.pid}`;\n\n      expect(IPCServer).toHaveBeenCalledWith(expect.objectContaining({\n        sessionState: expect.objectContaining({\n          id: expect.stringMatching(UUID_REGEXP),\n          detoxIPCServer: expect.stringMatching(expectedIPCServerName)\n        }),\n      }));\n    });\n\n    it('should init the IPC server', async () => {\n      expect(ipcServer().init).toHaveBeenCalled();\n    });\n\n    it('should save the session state onto the context-shared file', async () => {\n      expect(fs.writeFile).toHaveBeenCalledWith(\n        expect.stringMatching(TEMP_FILE_REGEXP),\n        expect.any(String),\n      );\n\n      const [, _sessionState] = lastCallTo(fs.writeFile);\n      const sessionState = JSON.parse(_sessionState);\n      expect(sessionState).toBeDefined();\n      expect(sessionState).toEqual(facade.session);\n    });\n\n    it('should export context-shared file via DETOX_CONFIG_SNAPSHOT_PATH', async () => {\n      expect(process.env.DETOX_CONFIG_SNAPSHOT_PATH).toBeDefined();\n      expect(process.env.DETOX_CONFIG_SNAPSHOT_PATH).toMatch(TEMP_FILE_REGEXP);\n    });\n\n    it('should reject further initializations', async () => {\n      await expect(() => facadeInit()).rejects.toThrowErrorMatchingSnapshot();\n    });\n\n    it('should change status to \"active\"', async () => {\n      expect(facade.getStatus()).toBe('active');\n    });\n\n    describe('when a device is being allocated', () => {\n      let cookie;\n\n      beforeEach(async () => {\n        cookie = await allocateSomeDevice();\n      });\n\n      it('should return a cookie', async () => {\n        expect(cookie).toEqual({ id: 'a-device-id' });\n      });\n\n      it('should call the device allocator', async () => {\n        expect(deviceAllocator.init).toHaveBeenCalled();\n        expect(deviceAllocator.allocate).toHaveBeenCalled();\n        expect(deviceAllocator.postAllocate).toHaveBeenCalled();\n      });\n\n      it('can be deallocated', async () => {\n        await expect(deallocateDevice(cookie)).resolves.toBeUndefined();\n      });\n\n      it('should throw on attempt to deallocate a cookie that does not belong to this context', async () => {\n        await expect(deallocateDevice({ id: 'some-other-device' })).rejects.toThrowErrorMatchingSnapshot();\n      });\n\n      it('cannot be deallocated twice', async () => {\n        await deallocateDevice(cookie);\n        await expect(deallocateDevice(cookie)).rejects.toThrow(/Cannot deallocate device/);\n      });\n\n      describe('and then the context has been cleaned up', () => {\n        beforeEach(async () => {\n          await facade.cleanup();\n        });\n\n        it('should clean up the allocation driver', async () => {\n          expect(deviceAllocator.cleanup).toHaveBeenCalled();\n        });\n\n        it('should not be able to find that cookie anymore', async () => {\n          await expect(deallocateDevice(cookie)).rejects.toThrow(/Cannot deallocate device/);\n        });\n      });\n\n      describe('and then the context has been cleaned up with an allocator cleanup error', () => {\n        let error = new Error('cleanup failed');\n\n        beforeEach(async () => {\n          deviceAllocator.cleanup.mockRejectedValue(error);\n        });\n\n        it('should log the error but not throw', async () => {\n          await expect(facade.cleanup()).resolves.toBeUndefined();\n          expect(log().error).toHaveBeenCalledWith({ cat: 'device', err: error }, `Failed to cleanup the device allocation driver for some.device`);\n        });\n      });\n\n      describe('on emergency context cleanup', () => {\n        beforeEach(async () => {\n          const signalHandler = getSignalHandler();\n          signalHandler(123, 'SIGSMT');\n        });\n\n        it('should call emergencyCleanup in allocation driver', async () => {\n          expect(deviceAllocator.emergencyCleanup).toHaveBeenCalled();\n        });\n      });\n\n      describe('on emergency context cleanup with an allocator cleanup error', () => {\n        let error = new Error('cleanup failed');\n\n        beforeEach(async () => {\n          deviceAllocator.emergencyCleanup.mockImplementation(() => { throw error; });\n        });\n\n        it('should log the error but not throw', async () => {\n          const signalHandler = getSignalHandler();\n          expect(() => signalHandler(123, 'SIGSMT')).not.toThrow();\n          expect(log().error).toHaveBeenCalledWith({ cat: 'device', err: error }, `Failed to clean up the device allocation driver for some.device in emergency mode`);\n        });\n      });\n    });\n\n    describe('when a device is being allocated using a faulty driver', () => {\n      beforeEach(() => {\n        deviceAllocator.init.mockRejectedValue(new Error('init failed'));\n      });\n\n      it('should destroy the allocation driver immediately', async () => {\n        await expect(allocateSomeDevice()).rejects.toThrow(/init failed/);\n        expect(deviceAllocator.cleanup).toHaveBeenCalled();\n      });\n\n      describe('and the driver fails to clean up', () => {\n        beforeEach(() => {\n          deviceAllocator.cleanup.mockRejectedValue(new Error('cleanup failed'));\n        });\n\n        it('should log the error', async () => {\n          await expect(allocateSomeDevice()).rejects.toThrow(/init failed/);\n          expect(log().error).toHaveBeenCalledWith({ cat: 'device', err: new Error('cleanup failed') }, `Failed to cleanup the device allocation driver for some.device after a failed initialization`);\n        });\n      });\n    });\n\n    describe('when a faulty device is being allocated', () => {\n      beforeEach(async () => {\n        deviceAllocator.postAllocate.mockRejectedValue(new Error('postAllocate failed'));\n      });\n\n      it('should free the device after an error', async () => {\n        await expect(allocateSomeDevice()).rejects.toThrow(/postAllocate failed/);\n        expect(deviceAllocator.free).toHaveBeenCalled();\n      });\n\n      describe('and cannot be freed properly', () => {\n        let error = new Error('free failed');\n\n        beforeEach(async () => {\n          deviceAllocator.free.mockRejectedValue(error);\n        });\n\n        it('should throw the original allocation error', async () => {\n          await expect(allocateSomeDevice()).rejects.toThrow(/postAllocate failed/);\n          expect(log().error).toHaveBeenCalledWith({ cat: 'device', err: error }, `Failed to free a-device-id after a failed allocation attempt`);\n        });\n      });\n    });\n\n    describe('and cleaning up', () => {\n      it('should change intermediate status to \"cleanup\"', async () => {\n        expect.assertions(1);\n        ipcServer().dispose.mockImplementation(async () => {\n          expect(facade.getStatus()).toBe('cleanup');\n        });\n        await facade.cleanup();\n      });\n    });\n\n    describe('and cleaned up', () => {\n      beforeEach(async () => facade.cleanup());\n\n      it('should close the ipc server', async () => {\n        expect(ipcServer().dispose).toHaveBeenCalled();\n      });\n\n      it('should delete the context-shared file', async () => {\n        expect(fs.remove).toHaveBeenCalledWith(expect.stringMatching(TEMP_FILE_REGEXP));\n      });\n\n      it('should finalize the logger', async () => {\n        expect(logFinalizer().finalize).toHaveBeenCalled();\n      });\n\n      it('should restore status to \"inactive\"', async () => {\n        expect(facade.getStatus()).toBe('inactive');\n      });\n    });\n\n    describe('given an exit signal', () => {\n      beforeEach(async () => {\n        const signalHandler = getSignalHandler();\n        signalHandler(123, 'SIGSMT');\n      });\n\n      it('should close the ipc server', async () =>\n        expect(ipcServer().dispose).toHaveBeenCalled());\n\n      it('should delete the context-shared file', () =>\n        expect(fs.removeSync).toHaveBeenCalledWith(expect.stringMatching(TEMP_FILE_REGEXP)));\n\n      it('should finalize the logger', async () =>\n        expect(logFinalizer().finalizeSync).toHaveBeenCalled());\n    });\n  });\n\n  describe('when initialized with no options', () => {\n    beforeEach(async () => facade.init());\n\n    it('should also install a worker', async () => {\n      expect(detoxWorker().init).toHaveBeenCalled();\n      expect(facade.session).toEqual(expect.objectContaining({ workerId: 'worker' }));\n    });\n  });\n\n  describe('when initialized with auto-start of Detox server', () => {\n    beforeEach(() => detoxConfigDriver.givenDetoxServerAutostart());\n    beforeEach(facadeInit);\n\n    it('should create the Detox server', async () => {\n      expect(DetoxServer).toHaveBeenCalledWith({\n        port: 0,\n        standalone: false,\n      });\n    });\n\n    it('should start the server', async () => {\n      expect(detoxServer().open).toHaveBeenCalled();\n    });\n\n    describe('and cleaned up', () => {\n      beforeEach(async () => facade.cleanup());\n\n      it('should close the detox server', async () => {\n        expect(detoxServer().close).toHaveBeenCalled();\n      });\n    });\n\n    describe('given a non-conforming exit signal', () => {\n      beforeEach(async () => {\n        const signalHandler = getSignalHandler();\n        signalHandler(123, undefined);\n      });\n\n      it('should do nothing', () => {\n        expect(deviceAllocator.emergencyCleanup).not.toHaveBeenCalled();\n        expect(detoxServer().close).not.toHaveBeenCalled();\n        expect(ipcServer().dispose).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('when initialized with Detox server on a certain port', () => {\n    const port = '666';\n\n    beforeEach(() => detoxConfigDriver.givenDetoxServerAutostart(port));\n    beforeEach(() => detoxConfigDriver.givenDetoxServerPort(port));\n    beforeEach(facadeInit);\n\n    it('should create it', async () => {\n      expect(DetoxServer).toHaveBeenCalledWith({\n        port,\n        standalone: false,\n      });\n    });\n  });\n\n  describe('when initialized without auto-start of Detox server', () => {\n    beforeEach(facadeInit);\n\n    it('should not create a server', async () => {\n      expect(DetoxServer).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('when initialized not successfully', () => {\n    it('should report status as \"init\"', async () => {\n      IPCServer.prototype.init = jest.fn().mockRejectedValue(new Error('init failed'));\n\n      await expect(() => facadeInit()).rejects.toThrow();\n      expect(facade.getStatus()).toBe('init');\n    });\n  });\n\n  describe('when initialized with a worker', () => {\n    beforeEach(() => detoxConfigDriver.givenDetoxServerAutostart());\n    beforeEach(facadeInitWithWorker);\n\n    it('should install a worker if worker ID has been specified', async () => {\n      expect(facade.session).toEqual(expect.objectContaining({ workerId: WORKER_ID }));\n      expect(detoxWorker().init).toHaveBeenCalled();\n    });\n\n    it('should register the worker at the IPC server\\'s', async () => {\n      expect(ipcServer().onRegisterWorker).toHaveBeenCalledWith({ workerId: WORKER_ID });\n    });\n\n    describe('and cleaned up', () => {\n      beforeEach(async () => facade.cleanup());\n\n      it('should uninstall an assigned worker', async () => {\n        expect(detoxWorker().cleanup).toHaveBeenCalled();\n      });\n    });\n\n    describe('and cleaned up with an error', () => {\n      beforeEach(async () => {\n        detoxWorker().cleanup.mockRejectedValue(new Error(''));\n        await expect(() => facade.cleanup()).rejects.toThrow();\n      });\n\n      it('should clean-up nonetheless', async () => {\n        expect(detoxServer().close).toHaveBeenCalled();\n        expect(ipcServer().dispose).toHaveBeenCalled();\n      });\n\n      it('should restore status to \"inactive\"', async () => {\n        expect(facade.getStatus()).toBe('inactive');\n      });\n    });\n  });\n\n  function _initDetoxConfig() {\n    detoxConfigDriver = new DetoxConfigDriver(_.cloneDeep(DETOX_CONFIG_BASE));\n\n    jest.mock('../configuration');\n    configuration = jest.requireMock('../configuration');\n    configuration.composeDetoxConfig.mockResolvedValue(detoxConfigDriver.detoxConfig);\n  }\n\n  function _initExternalMocks() {\n    jest.mock('signal-exit');\n    signalExit = jest.requireMock('signal-exit');\n    jest.mock('fs-extra');\n    fs = jest.requireMock('fs-extra');\n  }\n\n  function _initInternalMocks() {\n    jest.mock('../logger');\n    logger = jest.requireMock('../logger');\n\n    jest.mock('../ipc/IPCServer');\n    IPCServer = jest.requireMock('../ipc/IPCServer');\n\n    deviceAllocator = {\n      init: jest.fn(),\n      allocate: jest.fn().mockResolvedValue({ id: 'a-device-id' }),\n      postAllocate: jest.fn().mockResolvedValue({ id: 'a-device-id' }),\n      free: jest.fn(),\n      cleanup: jest.fn(),\n      emergencyCleanup: jest.fn(),\n      isRecoverableError: jest.fn().mockReturnValue(true)\n    };\n\n    jest.mock('../environmentFactory');\n    environmentFactory = jest.requireMock('../environmentFactory');\n    environmentFactory.createFactories.mockReturnValue({\n      deviceAllocatorFactory: {\n        createDeviceAllocator: () => deviceAllocator,\n      }\n    });\n\n    jest.mock('../server/DetoxServer');\n    DetoxServer = jest.requireMock('../server/DetoxServer');\n\n    jest.mock('../DetoxWorker');\n    DetoxWorker = jest.requireMock('../DetoxWorker');\n\n    jest.mock('../utils/retry');\n    retry = jest.requireMock('../utils/retry');\n    retry.mockImplementation((opts, callback) => callback());\n  }\n\n  async function allocateSomeDevice() {\n    return context[symbols.allocateDevice]({ type: 'some.device' });\n  }\n\n  async function deallocateDevice(cookie) {\n    return context[symbols.deallocateDevice](cookie);\n  }\n\n  class DetoxConfigDriver {\n    constructor(detoxConfig) {\n      this.detoxConfig = detoxConfig;\n    }\n\n    givenKeepLockFile = (value) => (this.detoxConfig.behavior.init.keepLockFile = value);\n    givenIosSimulatorDevice = () => (this.detoxConfig.device.type = 'ios.simulator');\n    givenGenyCloudDevice = () => (this.detoxConfig.device.type = 'android.genycloud');\n    givenDetoxServerAutostart = () => (this.detoxConfig.session.autoStart = true);\n    givenDetoxServerPort = (port) => (this.detoxConfig.session.server = `http://localhost:${port}`);\n  }\n});\n"
  },
  {
    "path": "detox/src/realms/DetoxSecondaryContext.js",
    "content": "const fs = require('fs-extra');\n\nconst { DetoxInternalError } = require('../errors');\nconst SessionState = require('../ipc/SessionState');\n\nconst DetoxContext = require('./DetoxContext');\nconst symbols = require('./symbols');\n\n// Protected symbols\nconst { $restoreSessionState, $sessionState, $worker } = DetoxContext.protected;\n\n//#region Private symbols\nconst _ipcClient = Symbol('ipcClient');\n//#endregion\n\nclass DetoxSecondaryContext extends DetoxContext {\n  constructor() {\n    super();\n\n    /**\n     * @private\n     * @type {import('../ipc/IPCClient')}\n     */\n    this[_ipcClient] = null;\n  }\n\n  //#region Internal members\n  async [symbols.reportTestResults](testResults) {\n    if (this[_ipcClient]) {\n      await this[_ipcClient].reportTestResults(testResults);\n    } else {\n      throw new DetoxInternalError('Detected an attempt to report failed tests using a non-initialized context.');\n    }\n  }\n\n  [symbols.conductEarlyTeardown] = async (permanent = false) => {\n    if (this[_ipcClient]) {\n      await this[_ipcClient].conductEarlyTeardown({ permanent });\n    } else {\n      throw new DetoxInternalError('Detected an attempt to report early teardown using a non-initialized context.');\n    }\n  };\n\n  async [symbols.resolveConfig]() {\n    return this[symbols.config];\n  }\n\n  /** @override */\n  async [symbols.init](opts = {}) {\n    const IPCClient = require('../ipc/IPCClient');\n\n    this[_ipcClient] = new IPCClient({\n      id: `secondary-${process.pid}`,\n      sessionState: this[$sessionState],\n      logger: this[symbols.logger],\n    });\n\n    await this[_ipcClient].init();\n\n    if (opts.workerId !== null) {\n      await this[symbols.installWorker](opts);\n    }\n  }\n\n  /** @override */\n  async [symbols.allocateDevice](deviceConfig) {\n    if (this[_ipcClient]) {\n      const deviceCookie = await this[_ipcClient].allocateDevice(deviceConfig);\n      return deviceCookie;\n    } else {\n      throw new DetoxInternalError('Detected an attempt to allocate a device using a non-initialized context.');\n    }\n  }\n\n  /** @override */\n  async [symbols.deallocateDevice](deviceCookie) {\n    if (this[_ipcClient]) {\n      await this[_ipcClient].deallocateDevice(deviceCookie);\n    } else {\n      throw new DetoxInternalError('Detected an attempt to allocate a device using a non-initialized context.');\n    }\n  }\n\n  /** @override */\n  async [symbols.cleanup]() {\n    try {\n      if (this[$worker]) {\n        await this[symbols.uninstallWorker]();\n      }\n    } finally {\n      if (this[_ipcClient]) {\n        await this[_ipcClient].dispose();\n        this[_ipcClient] = null;\n      }\n    }\n  }\n\n  /** @override */\n  async [symbols.installWorker](opts = {}) {\n    const workerId = opts.workerId || 'worker';\n    await this[_ipcClient].registerWorker(workerId);\n    await super[symbols.installWorker]({ ...opts, workerId });\n  }\n  //#endregion\n\n  //#region Protected members\n  /**\n   * @protected\n   * @override\n   * @return {SessionState}\n   */\n  [$restoreSessionState]() {\n    return SessionState.parse(fs.readFileSync(process.env.DETOX_CONFIG_SNAPSHOT_PATH));\n  }\n  //#endregion\n}\n\nmodule.exports = DetoxSecondaryContext;\n"
  },
  {
    "path": "detox/src/realms/DetoxSecondaryContext.test.js",
    "content": "const { backupProcessEnv, latestInstanceOf } = require('../../__tests__/helpers');\n\ndescribe('DetoxSecondaryContext', () => {\n  const DETOX_CONFIG_SNAPSHOT_PATH = 'mocked/detox.json';\n  const WORKER_ID = 91;\n\n  /** @type {import('./DetoxInternalsFacade')} */\n  let facade;\n\n  /** @type {jest.Mocked<import('fs-extra')>} */\n  let fs;\n\n  /** @type {import('../ipc/SessionState')} */\n  let sessionState;\n\n  /** @type {jest.Mock<import('../ipc/IPCClient')>} */\n  let IPCClient;\n\n  /** @type {jest.Mock<import('../DetoxWorker')>} */\n  let DetoxWorker;\n\n  const detoxWorker = () => latestInstanceOf(DetoxWorker);\n  const ipcClient = () => latestInstanceOf(IPCClient);\n\n  backupProcessEnv();\n\n  beforeEach(() => {\n    Object.assign(process.env, { DETOX_CONFIG_SNAPSHOT_PATH });\n  });\n\n  beforeEach(_initMocks);\n\n  beforeEach(() => {\n    const DetoxSecondaryContext = require('./DetoxSecondaryContext');\n    const DetoxInternalsFacade = require('./DetoxInternalsFacade');\n\n    const context = new DetoxSecondaryContext();\n    facade = new DetoxInternalsFacade(context);\n  });\n\n  describe('when not initialized', () => {\n    it('should be inactive', () => {\n      expect(facade.getStatus()).toBe('inactive');\n    });\n  });\n\n  describe('when initializing', () => {\n    it('should create an IPC client', async () => {\n      const expectedId = `secondary-${process.pid}`;\n\n      await facade.init();\n\n      expect(IPCClient).toHaveBeenCalledWith(expect.objectContaining({\n        id: expectedId,\n        sessionState: expect.objectContaining(sessionState),\n      }));\n    });\n\n    it('should initialize an IPC client', async () => {\n      await facade.init();\n      expect(ipcClient().init).toHaveBeenCalled();\n    });\n\n    it('should initialize a worker', async () => {\n      await facade.init({ workerId: WORKER_ID });\n      expect(detoxWorker().init).toHaveBeenCalled();\n    });\n\n    it('should register the worker at the client\\'s', async () => {\n      await facade.init({ workerId: WORKER_ID });\n      expect(ipcClient().registerWorker).toHaveBeenCalledWith(WORKER_ID);\n    });\n\n    describe('given an initialization failure', () => {\n      it('should report status as \"init\"', async () => {\n        IPCClient.prototype.init = jest.fn().mockRejectedValue(new Error('init error'));\n\n        await expect(() => facade.init()).rejects.toThrow();\n        expect(facade.getStatus()).toBe('init');\n      });\n    });\n  });\n\n  describe('when initialized', () => {\n    it('should change status to \"active\"', async () => {\n      await facade.init();\n      expect(facade.getStatus()).toBe('active');\n    });\n\n    describe('then cleaned up', () => {\n      it('should uninstall an assigned worker', async () => {\n        await facade.init({ workerId: WORKER_ID });\n        await facade.cleanup();\n\n        expect(detoxWorker().cleanup).toHaveBeenCalled();\n      });\n\n      it('should close the ipc client', async () => {\n        await facade.init();\n        await facade.cleanup();\n\n        expect(ipcClient().dispose).toHaveBeenCalled();\n      });\n\n      it('should restore status to \"inactive\"', async () => {\n        await facade.init();\n        await facade.cleanup();\n        expect(facade.getStatus()).toBe('inactive');\n      });\n\n      it('should change intermediate status to \"cleanup\"', async () => {\n        expect.assertions(1);\n        await facade.init();\n\n        ipcClient().dispose.mockImplementation(async () => {\n          expect(facade.getStatus()).toBe('cleanup');\n        });\n\n        await facade.cleanup();\n      });\n\n      describe('given a worker clean-up error', () => {\n        const facadeInitWithWorker = async () => facade.init({ workerId: WORKER_ID });\n        const facadeCleanup = async () => expect(() => facade.cleanup()).rejects.toThrow();\n\n        beforeEach(async () => {\n          await facadeInitWithWorker();\n\n          detoxWorker().cleanup.mockRejectedValue(new Error(''));\n        });\n\n        it('should clean-up nonetheless', async () => {\n          await facadeCleanup();\n          expect(ipcClient().dispose).toHaveBeenCalled();\n        });\n\n        it('should restore status to \"inactive\"', async () => {\n          await facadeCleanup();\n          expect(facade.getStatus()).toBe('inactive');\n        });\n      });\n    });\n  });\n\n  function _initMocks() {\n    jest.mock('fs-extra');\n    fs = jest.requireMock('fs-extra');\n\n    const SessionState = require('../ipc/SessionState');\n    sessionState = new SessionState({ id: 'mocked-session-state' });\n    fs.readFileSync.mockImplementation((filename) => {\n      if (filename === DETOX_CONFIG_SNAPSHOT_PATH) {\n        return sessionState.stringify();\n      }\n\n      return '';\n    });\n\n    jest.mock('../ipc/IPCClient');\n    IPCClient = jest.requireMock('../ipc/IPCClient');\n\n    jest.mock('../DetoxWorker');\n    DetoxWorker = jest.requireMock('../DetoxWorker');\n  }\n});\n"
  },
  {
    "path": "detox/src/realms/__snapshots__/DetoxPrimaryContext.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxPrimaryContext when initialized should reject further initializations 1`] = `\n\"Cannot initialize primary Detox context more than once.\n\nHINT: If you are using Detox with Jest according to the latest guide, please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxPrimaryContext when initialized when a device is being allocated should throw on attempt to deallocate a cookie that does not belong to this context 1`] = `\n\"Cannot deallocate device some-other-device because it was not allocated by this context.\n\nHINT: See the actually known allocated devices below:\n\n- a-device-id\"\n`;\n\nexports[`DetoxPrimaryContext when not initialized should throw on attempt to get a worker 1`] = `\n\"Detox worker instance has not been installed in this context (DetoxPrimaryContext).\n\nHINT: If you are using Detox with Jest according to the latest guide, please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\nOtherwise, make sure you call detox.installWorker() beforehand.\"\n`;\n"
  },
  {
    "path": "detox/src/realms/primary.js",
    "content": "const DetoxPrimaryContext = require('./DetoxPrimaryContext');\n\nmodule.exports = new DetoxPrimaryContext();\n"
  },
  {
    "path": "detox/src/realms/secondary.js",
    "content": "const DetoxSecondaryContext = require('./DetoxSecondaryContext');\n\nmodule.exports = new DetoxSecondaryContext();\n"
  },
  {
    "path": "detox/src/realms/symbols.js",
    "content": "/**\n * @type {{\n *   readonly cleanup: unique symbol;\n *   readonly config: unique symbol;\n *   readonly getStatus: unique symbol;\n *   readonly init: unique symbol;\n *   readonly installWorker: unique symbol;\n *   readonly allocateDevice: unique symbol;\n *   readonly deallocateDevice: unique symbol;\n *   readonly logger: unique symbol;\n *   readonly onHookFailure: unique symbol;\n *   readonly onRunDescribeFinish: unique symbol;\n *   readonly onRunDescribeStart: unique symbol;\n *   readonly onTestDone: unique symbol;\n *   readonly onTestFnFailure: unique symbol;\n *   readonly onTestStart: unique symbol;\n *   readonly conductEarlyTeardown: unique symbol;\n *   readonly reportTestResults: unique symbol;\n *   readonly resolveConfig: unique symbol;\n *   readonly session: unique symbol;\n *   readonly tracing: unique symbol;\n *   readonly uninstallWorker: unique symbol;\n *   readonly worker: unique symbol;\n * }}\n */\nmodule.exports = {\n  //#region Lifecycle\n  onRunDescribeStart: Symbol('run_describe_start'),\n  onTestStart: Symbol('test_start'),\n  onHookFailure: Symbol('hook_failure'),\n  onTestFnFailure: Symbol('test_fn_failure'),\n  onTestDone: Symbol('test_done'),\n  onRunDescribeFinish: Symbol('run_describe_finish'),\n  //#endregion\n\n  //#region IPC\n  reportTestResults: Symbol('reportTestResults'),\n  conductEarlyTeardown: Symbol('conductEarlyTeardown'),\n  allocateDevice: Symbol('allocateDevice'),\n  deallocateDevice: Symbol('deallocateDevice'),\n  //#endregion\n\n  //#region Main\n  cleanup: Symbol('cleanup'),\n  config: Symbol('config'),\n  getStatus: Symbol('getStatus'),\n  init: Symbol('init'),\n  installWorker: Symbol('installWorker'),\n  logger: Symbol('logger'),\n  resolveConfig: Symbol('resolveConfig'),\n  session: Symbol('session'),\n  tracing: Symbol('tracing'),\n  uninstallWorker: Symbol('uninstallWorker'),\n  worker: Symbol('worker'),\n  //#endregion\n};\n"
  },
  {
    "path": "detox/src/server/DetoxConnection.js",
    "content": "const _ = require('lodash');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst logger = require('../utils/logger').child({ cat: 'ws-server,ws' });\n\nconst AnonymousConnectionHandler = require('./handlers/AnonymousConnectionHandler');\n\nclass DetoxConnection {\n  /**\n   * @param {{\n   *   sessionManager: import('./DetoxSessionManager');\n   *   webSocket: import('ws');\n   *   socket: import('net').Socket;\n   * }} config\n   */\n  constructor({ sessionManager, webSocket, socket }) {\n    this._onMessage = this._onMessage.bind(this);\n    this._onError = this._onError.bind(this);\n    this._onClose = this._onClose.bind(this);\n\n    this._log = logger.child({ id: socket.remotePort });\n    this._log.debug.begin(`connection :${socket.localPort}<->:${socket.remotePort}`);\n\n    this._sessionManager = sessionManager;\n    this._webSocket = webSocket;\n    this._webSocket.on('message', this._onMessage);\n    this._webSocket.on('error', this._onError);\n    this._webSocket.on('close', this._onClose);\n\n    // eslint-disable-next-line unicorn/no-this-assignment\n    const self = this;\n    this._handler = new AnonymousConnectionHandler({\n      api: {\n        get log() { return self._log; },\n        appendLogDetails: (details) => { this._log = this._log.child(details); },\n\n        registerSession: (params) => this._sessionManager.registerSession(this, params),\n        setHandler: (handler) => { this._handler = handler; },\n        sendAction: (action) => this.sendAction(action),\n      },\n    });\n  }\n\n  sendAction(action) {\n    const messageAsString = JSON.stringify(action);\n    this._log.trace({ data: action }, 'send');\n    this._webSocket.send(messageAsString + '\\n ');\n  }\n\n  _onMessage(rawData) {\n    const data = _.isString(rawData) ? rawData : rawData.toString('utf8');\n    this._log.trace({ data }, 'get');\n\n    try {\n      let action;\n\n      try {\n        action = _.attempt(() => JSON.parse(data));\n\n        if (_.isError(action)) {\n          throw new DetoxRuntimeError({\n            message: 'The payload received is not a valid JSON.',\n            hint: DetoxRuntimeError.reportIssue,\n            debugInfo: data,\n          });\n        }\n\n        if (!action.type) {\n          throw new DetoxRuntimeError({\n            message: 'Cannot process an action without a type.',\n            hint: DetoxRuntimeError.reportIssue,\n            debugInfo: action,\n          });\n        }\n\n        this._handler.handle(action);\n      } catch (handlerError) {\n        this._handler.onError(handlerError, action);\n      }\n    } catch (error) {\n      this._log.warn({ error }, 'Caught unhandled error:');\n    }\n  }\n\n  _onError(error) {\n    this._log.warn({ error }, 'Caught socket error:');\n  }\n\n  _onClose() {\n    this._sessionManager.unregisterConnection(this._webSocket);\n    this._log.debug.end();\n  }\n}\n\nmodule.exports = DetoxConnection;\n"
  },
  {
    "path": "detox/src/server/DetoxServer.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\nconst WebSocket = require('ws');\n\nconst { DetoxInternalError, DetoxRuntimeError } = require('../errors');\nconst Deferred = require('../utils/Deferred');\nconst log = require('../utils/logger').child({ cat: 'ws-server,ws' });\n\nconst DetoxSessionManager = require('./DetoxSessionManager');\n\nclass DetoxServer {\n  /**\n   * @param {number} options.port\n   * @param {boolean} options.standalone\n   */\n  constructor(options) {\n    this._onConnection = this._onConnection.bind(this);\n    this._onError = this._onError.bind(this);\n\n    this._options = _.defaults(options, {\n      Server: WebSocket.Server,\n    });\n\n    this._sessionManager = new DetoxSessionManager();\n\n    this._wss = null;\n    this._opening = null;\n    this._closing = null;\n  }\n\n  get port() {\n    if (!this._wss) {\n      throw new DetoxInternalError('Cannot get a port of a closed WebSocket server');\n    }\n\n    return this._wss.address().port;\n  }\n\n  async open() {\n    await this._startListening();\n\n    const level = this._options.standalone ? 'info' : 'debug';\n    log[level](`Detox server listening on localhost:${this.port}...`);\n  }\n\n  async close() {\n    try {\n      await this._closeWithTimeout(10000);\n      log.debug('Detox server has been closed gracefully');\n    } catch (err) {\n      log.warn({ err },\n        `Detox server has been closed abruptly! See the error details below:`\n      );\n    }\n  }\n\n  async _startListening() {\n    const opening = this._opening = new Deferred();\n\n    this._wss = new this._options.Server({\n      port: this._options.port,\n      perMessageDeflate: {}\n    }, () => {\n      this._opening.resolve();\n      this._opening = null;\n    });\n\n    this._wss.on('connection', this._onConnection);\n    this._wss.on('error', this._onError);\n\n    return opening.promise;\n  }\n\n  /**\n   * @param {WebSocket} ws\n   * @param {IncomingMessage} req\n   */\n  _onConnection(ws, req) {\n    this._sessionManager.registerConnection(ws, req.socket);\n  }\n\n  /**\n   * @param {Error} err\n   */\n  _onError(err) {\n    if (this._opening) {\n      this._opening.reject(err);\n    } else if (this._closing) {\n      this._closing.reject(err);\n    } else {\n      log.error({ err }, 'Detox server has got an unhandled error:');\n    }\n  }\n\n  _closeWithTimeout(timeoutValue) {\n    if (!this._wss) {\n      return;\n    }\n\n    const closing = this._closing = new Deferred();\n\n    const handle = setTimeout(() => {\n      this._closing.reject(new DetoxRuntimeError({\n        message: `Detox server close callback was not invoked within the ${timeoutValue} ms timeout`,\n      }));\n      this._unlinkServer();\n    }, timeoutValue);\n\n    try {\n      this._wss.close(() => {\n        clearTimeout(handle);\n        this._closing.resolve();\n        this._unlinkServer();\n      });\n    } catch (e) {\n      this._closing.reject(e);\n      this._unlinkServer();\n    }\n\n    return closing.promise;\n  }\n\n  _unlinkServer() {\n    this._wss = null;\n    this._opening = null;\n    this._closing = null;\n  }\n}\n\nmodule.exports = DetoxServer;\n"
  },
  {
    "path": "detox/src/server/DetoxServer.test.js",
    "content": "// @ts-nocheck\nconst net = require('net');\n\ndescribe('DetoxServer', () => {\n  let DetoxServer;\n  let DetoxSessionManager;\n  /** @type {DetoxServer} */\n  let server;\n  let options;\n  let log;\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    jest.mock('./DetoxSessionManager');\n    log = require('../utils/logger');\n    DetoxServer = require('./DetoxServer');\n    DetoxSessionManager = require('./DetoxSessionManager');\n  });\n\n  afterEach(async () => {\n    if (server) {\n      await server.close();\n    }\n  });\n\n  describe('.open() / .close()', () => {\n    beforeEach(async () => {\n      options = { port: 0 };\n    });\n\n    it('should start listening on specified port (on open) and stop (on close)', async () => {\n      let port;\n\n      try {\n        server = new DetoxServer(options);\n        await server.open();\n        port = server.port;\n\n        await expect(isPortBusy(port)).resolves.toBe(true);\n      } finally {\n        await server.close();\n        await expect(isPortBusy(port)).resolves.toBe(false);\n      }\n    });\n\n    it('should allow getting server port if it is running', async () => {\n      try {\n        server = new DetoxServer(options);\n        expect(() => server.port).toThrow(/Cannot get a port/);\n\n        await server.open();\n        expect(server.port).toBeGreaterThan(1023);\n      } finally {\n        await server.close();\n        expect(() => server.port).toThrow(/Cannot get a port/);\n      }\n    });\n\n    it('should INFO log its port when started in standalone mode', async () => {\n      try {\n        options.standalone = true;\n        server = new DetoxServer(options);\n        await server.open();\n\n        const expectedString = expect.stringContaining(`localhost:${server.port}`);\n        expect(log.info).toHaveBeenCalledWith(expectedString);\n        expect(log.debug).not.toHaveBeenCalledWith(expectedString);\n      } finally {\n        await server.close();\n      }\n    });\n\n    it('should DEBUG log its port when started in a non-standalone mode', async () => {\n      try {\n        options.standalone = false;\n        server = new DetoxServer(options);\n        await server.open();\n\n        const expectedString = expect.stringContaining(`localhost:${server.port}`);\n        expect(log.debug).toHaveBeenCalledWith(expectedString);\n        expect(log.info).not.toHaveBeenCalledWith(expectedString);\n      } finally {\n        await server.close();\n      }\n    });\n\n    it('should DEBUG log a message upon closing the server', async () => {\n      server = new DetoxServer(options);\n      await server.open();\n      await server.close();\n\n      const expectedString = expect.stringContaining(`has been closed gracefully`);\n      expect(log.debug).toHaveBeenCalledWith(expectedString);\n    });\n\n    it('should throw upon an unsuccessful server opening', async () => {\n      options = optionsWithMockServer((wss, _o, listening) => {\n        listening.mockImplementation(() => {});\n\n        wss.on.mockImplementation((event, callback) => {\n          if (event === 'error') {\n            setImmediate(() => callback(new TestError()));\n          }\n        });\n      });\n\n      server = new DetoxServer(options);\n      await expect(server.open()).rejects.toThrow('TEST_ERROR');\n    });\n\n    it('should WARN log a message upon unsuccessful server closing (timeout case)', async () => {\n      jest.useFakeTimers('modern');\n\n      options = optionsWithMockServer((wss) => {\n        wss.close.mockImplementation(() => {});\n      });\n\n      server = new DetoxServer(options);\n      await server.open();\n\n      const closePromise = server.close();\n      jest.advanceTimersByTime(10000);\n      await closePromise;\n\n      expect(log.warn.mock.calls[0]).toMatchSnapshot();\n    });\n\n    it('should WARN log a message upon unsuccessful server closing (rejection case)', async () => {\n      options = optionsWithMockServer((wss) => {\n        wss.close.mockImplementation(() => {\n          throw new TestError();\n        });\n      });\n\n      server = new DetoxServer(options);\n      await server.open();\n      await server.close();\n\n      expect(log.warn.mock.calls[0]).toMatchSnapshot();\n    });\n\n    it('should WARN log a message upon unsuccessful server closing (error emit case)', async () => {\n      options = optionsWithMockServer((wss) => {\n        let errorCallback;\n\n        wss.on.mockImplementation((type, callback) => {\n          if (type === 'error') {\n            errorCallback = callback;\n          }\n        });\n\n        wss.close.mockImplementation(() => {\n          errorCallback(new TestError());\n        });\n      });\n\n      server = new DetoxServer(options);\n      await server.open();\n      await server.close();\n\n      expect(log.warn.mock.calls[0]).toMatchSnapshot();\n    });\n  });\n\n  it('should ERROR log messages from wss.Server', async () => {\n    let errorCallback;\n\n    options = optionsWithMockServer((wss) => {\n      wss.on.mockImplementation((type, callback) => {\n        if (type === 'error') {\n          errorCallback = callback;\n        }\n      });\n    });\n\n    server = new DetoxServer(options);\n    await server.open();\n    errorCallback(new TestError());\n\n    expect(log.error.mock.calls[0]).toMatchSnapshot();\n  });\n\n  it('should register an incoming connection in SessionManager', async () => {\n    let connectionCallback;\n\n    options = optionsWithMockServer((wss) => {\n      wss.on.mockImplementation((type, callback) => {\n        if (type === 'connection') {\n          connectionCallback = callback;\n        }\n      });\n    });\n\n    server = new DetoxServer(options);\n    await server.open();\n\n    const fakeWs = {};\n    const fakeRequest = { socket: {} };\n\n    const sessionManager = DetoxSessionManager.mock.instances[0];\n    expect(sessionManager.registerConnection).not.toHaveBeenCalled();\n    connectionCallback(fakeWs, fakeRequest);\n    expect(sessionManager.registerConnection).toHaveBeenCalledWith(fakeWs, fakeRequest.socket);\n  });\n\n  function optionsWithMockServer(callback) {\n    const Server = jest.createMockFromModule('ws').Server;\n    Server.mockImplementation(function(options, listening) {\n      const mockListening = jest.fn().mockImplementation(listening);\n      this.address.mockReturnValue({ port: 65534 });\n      this.close.mockImplementation(callback => callback());\n      const result = callback && callback.call(null, this, options, mockListening);\n      mockListening();\n      return result || this;\n    });\n\n    return { Server };\n  }\n\n  async function isPortBusy(port) {\n    return new Promise((resolve, reject) => {\n      const server = net.createServer();\n\n      server.once('error', function(err) {\n        if (err.code === 'EADDRINUSE') {\n          resolve(true);\n        } else {\n          reject(err);\n        }\n      });\n\n      server.once('listening', function() {\n        server.close();\n        resolve(false);\n      });\n\n      server.listen(port);\n    });\n  }\n\n  class TestError extends Error {\n    constructor() {\n      super('TEST_ERROR');\n      delete this.stack;\n    }\n  }\n});\n"
  },
  {
    "path": "detox/src/server/DetoxSession.js",
    "content": "// @ts-nocheck\nconst DetoxInternalError = require('../errors/DetoxInternalError');\nconst log = require('../utils/logger').child({ cat: 'ws-server,ws-session' });\n\nclass DetoxSession {\n  /**\n   * @param {string} id\n   */\n  constructor(id) {\n    this._id = id;\n    /** @type {DetoxConnection} */\n    this._tester = null;\n    /** @type {DetoxConnection} */\n    this._app = null;\n    /** @type {boolean | null} */\n    this._pendingAppStatus = null;\n    /** @type {boolean | null} */\n    this._pendingTesterStatus = null;\n\n    log.trace(`created session ${id}`);\n  }\n\n  get id() {\n    return this._id;\n  }\n\n  get app() {\n    return this._app;\n  }\n\n  set app(value) {\n    if (value) {\n      this._assertAppIsNotConnected();\n      this._app = value;\n      this._pendingAppStatus = true;\n    } else {\n      this._assertAppIsConnected();\n      this._app = null;\n      this._pendingAppStatus = false;\n    }\n  }\n\n  get tester() {\n    return this._tester;\n  }\n\n  set tester(value) {\n    if (value) {\n      this._assertTesterIsNotConnected();\n      this._tester = value;\n      this._pendingTesterStatus = true;\n    } else {\n      this._assertTesterIsConnected();\n      this._tester = null;\n      this._pendingTesterStatus = false;\n    }\n  }\n\n  get isEmpty() {\n    return !this._tester && !this._app;\n  }\n\n  notify() {\n    if (this._pendingTesterStatus === true) {\n      this._notifyAboutTesterConnect();\n    }\n\n    if (this._pendingTesterStatus === false) {\n      this._notifyAboutTesterDisconnect();\n    }\n\n    if (this._pendingAppStatus === true) {\n      this._notifyAboutAppConnect();\n    }\n\n    if (this._pendingAppStatus === false) {\n      this._notifyAboutAppDisconnect();\n    }\n\n    this._pendingTesterStatus = null;\n    this._pendingAppStatus = null;\n  }\n\n  disconnect(connection) {\n    if (!connection) {\n      return this._invariant(`DetoxSession(${this.id}).prototype.disconnect(connection) expects a non-null argument.`);\n    }\n\n    if (connection === this.tester) {\n      this.tester = null;\n    } else if (connection === this.app) {\n      this.app = null;\n    } else {\n      this._invariant(`cannot disconnect an unknown connection from the session ${this.id}`);\n    }\n  }\n\n  _assertAppIsNotConnected() {\n    if (this._app) {\n      this._invariant(`the app is already connected to the session ${this.id}`);\n    }\n  }\n\n  _assertAppIsConnected() {\n    if (!this._app) {\n      this._invariant(`no app is connected to the session ${this.id}`);\n    }\n  }\n\n  _assertTesterIsNotConnected() {\n    if (this._tester) {\n      this._invariant(`the tester is already connected to the session ${this.id}`);\n    }\n  }\n\n  _assertTesterIsConnected() {\n    if (!this._tester) {\n      this._invariant(`no tester is connected to the session ${this.id}`);\n    }\n  }\n\n  _notifyAboutAppConnect() {\n    log.trace(`app joined session ${this.id}`);\n\n    if (!this._tester) {\n      return;\n    }\n\n    this._tester.sendAction({\n      type: 'appConnected',\n    });\n  }\n\n  _notifyAboutAppDisconnect() {\n    log.trace(`app exited session ${this.id}`);\n\n    if (!this._tester) {\n      return;\n    }\n\n    this._tester.sendAction({\n      type: 'appDisconnected',\n    });\n  }\n\n  _notifyAboutTesterConnect() {\n    log.trace(`tester joined session ${this.id}`);\n  }\n\n  _notifyAboutTesterDisconnect() {\n    log.trace(`tester exited session ${this.id}`);\n\n    if (!this._app) {\n      return;\n    }\n\n    this._app.sendAction({\n      type: 'testerDisconnected',\n      messageId: -1,\n    });\n  }\n\n  _invariant(errorMessage) {\n    log.error(DetoxInternalError.from(errorMessage));\n  }\n}\n\nmodule.exports = DetoxSession;\n"
  },
  {
    "path": "detox/src/server/DetoxSession.test.js",
    "content": "// @ts-nocheck\ndescribe('DetoxSession', () => {\n  /**\n   * @type {typeof require('./DetoxSession')}\n   */\n  let DetoxSession;\n  /**\n   * @type {typeof require('./DetoxConnection')}\n   */\n  let DetoxConnection;\n  /**\n   * @type {DetoxSession}\n   */\n  let session;\n  let logger;\n\n  beforeEach(() => {\n    jest.mock('../utils/logger');\n    logger = require('../utils/logger');\n\n    DetoxConnection = jest.createMockFromModule('./DetoxConnection');\n    DetoxSession = require('./DetoxSession');\n    session = new DetoxSession('aSession');\n  });\n\n  it('should be empty by default', () => {\n    expect(session.isEmpty).toBe(true);\n  });\n\n  describe('when tester joins', () => {\n    beforeEach(() => {\n      session.tester = new DetoxConnection();\n      session.notify();\n    });\n\n    test('.notify() should not send actions', () => {\n      expect(session.tester.sendAction).not.toHaveBeenCalled();\n    });\n\n    it('should not be empty', () => {\n      expect(session.isEmpty).toBe(false);\n    });\n\n    describe('and then app joins', () => {\n      beforeEach(() => {\n        session.app = new DetoxConnection();\n        session.notify();\n      });\n\n      test('.notify() should send an action only to the tester', () => {\n        expect(session.app.sendAction).not.toHaveBeenCalled();\n        expect(session.tester.sendAction).toHaveBeenCalledWith({\n          type: 'appConnected',\n        });\n      });\n\n      test('.notify() should not send actions twice', () => {\n        session.notify();\n        expect(session.app.sendAction).not.toHaveBeenCalled();\n        expect(session.tester.sendAction).toHaveBeenCalledTimes(1);\n      });\n    });\n  });\n\n  describe('when app joins', () => {\n    beforeEach(() => {\n      session.app = new DetoxConnection();\n      session.notify();\n    });\n\n    it('should not be empty', () => {\n      expect(session.isEmpty).toBe(false);\n    });\n\n    test('should not send actions', () => {\n      expect(session.app.sendAction).not.toHaveBeenCalled();\n    });\n\n    describe('and then tester joins', () => {\n      beforeEach(() => {\n        session.tester = new DetoxConnection();\n        session.notify();\n      });\n\n      test('should not send action to anyone', () => {\n        // because app has no logic to process it\n        // and tester already knows it is joining the session\n\n        expect(session.tester.sendAction).not.toHaveBeenCalled();\n        expect(session.app.sendAction).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('when both tester and app joined', () => {\n    beforeEach(() => {\n      session.tester = new DetoxConnection();\n      session.app = new DetoxConnection();\n      session.notify();\n      session.tester.sendAction.mockReset();\n      session.app.sendAction.mockReset();\n    });\n\n    it('.notify() should send action only to the app when the tester disconnects', () => {\n      const { app, tester } = session;\n      session.disconnect(tester);\n      session.notify();\n\n      expect(tester.sendAction).not.toHaveBeenCalled();\n      expect(app.sendAction).toHaveBeenCalledWith({\n        type: 'testerDisconnected',\n        messageId: -1,\n      });\n    });\n\n    it('.notify() should send action only to the tester when the app disconnects', () => {\n      const { app, tester } = session;\n      session.disconnect(app);\n      session.notify();\n\n      expect(app.sendAction).not.toHaveBeenCalled();\n      expect(tester.sendAction).toHaveBeenCalledWith({\n        type: 'appDisconnected'\n      });\n    });\n\n    it('.notify() should not send action to anyone if both disconnect simulatenously', () => {\n      const { app, tester } = session;\n      session.app = null;\n      session.tester = null;\n      session.notify();\n      expect(app.sendAction).not.toHaveBeenCalled();\n      expect(tester.sendAction).not.toHaveBeenCalled();\n      expect(session.isEmpty).toBe(true);\n    });\n\n    it('should be empty if both disconnect', () => {\n      expect(session.isEmpty).toBe(false);\n      session.app = null;\n      expect(session.isEmpty).toBe(false);\n      session.tester = null;\n      expect(session.isEmpty).toBe(true);\n    });\n  });\n\n  describe('edge cases', () => {\n    it('should warn on .disconnect(null)', () => {\n      session.disconnect(null);\n      expect(getWarning()).toMatchSnapshot();\n    });\n\n    it('should warn on .disconnect(<unknown connection>)', () => {\n      session.disconnect(new DetoxConnection());\n      expect(getWarning()).toMatchSnapshot();\n    });\n\n    it('should warn on non-empty app assignment', () => {\n      session.app = new DetoxConnection();\n      session.app = new DetoxConnection();\n      expect(getWarning()).toMatchSnapshot();\n    });\n\n    it('should warn on (already) empty app deassignment', () => {\n      session.app = null;\n      expect(getWarning()).toMatchSnapshot();\n    });\n\n    it('should warn on non-empty tester assignment', () => {\n      session.tester = new DetoxConnection();\n      session.tester = new DetoxConnection();\n      expect(getWarning()).toMatchSnapshot();\n    });\n\n    it('should warn on (already) empty tester deassignment', () => {\n      session.tester = null;\n      expect(getWarning()).toMatchSnapshot();\n    });\n  });\n\n  function getWarning(index = 0) {\n    return logger.error.mock.calls[index][0];\n  }\n});\n"
  },
  {
    "path": "detox/src/server/DetoxSessionManager.js",
    "content": "// @ts-nocheck\nconst DetoxInternalError = require('../errors/DetoxInternalError');\nconst log = require('../utils/logger').child({ cat: 'ws-server,ws' });\n\nconst DetoxConnection = require('./DetoxConnection');\nconst DetoxSession = require('./DetoxSession');\n\nclass DetoxSessionManager {\n  constructor() {\n    /** @type {Map<WebSocket, DetoxConnection>} **/\n    this._connectionsByWs = new Map();\n    /** @type {Map<DetoxConnection, DetoxSession>} **/\n    this._sessionsByConnection = new Map();\n    /** @type {Map<string, DetoxSession>} **/\n    this._sessionsById = new Map();\n  }\n\n  /**\n   * @param {WebSocket} ws\n   * @param {Socket} socket\n   */\n  registerConnection(webSocket, socket) {\n    if (!this._assertWebSocketIsNotUsed(webSocket)) {\n      return;\n    }\n\n    const connection = new DetoxConnection({\n      sessionManager: this,\n      webSocket,\n      socket,\n    });\n\n    this._connectionsByWs.set(webSocket, connection);\n  }\n\n  /**\n   * @param {DetoxConnection} connection\n   * @param {'tester' | 'app'} role\n   * @param {string} sessionId\n   * @returns {DetoxSession}\n   */\n  registerSession(connection, { role, sessionId }) {\n    let session;\n\n    if (this._assertConnectionIsNotInSession(connection)) {\n      session = this._sessionsById.get(sessionId);\n    } else {\n      session = this._sessionsByConnection.get(connection);\n    }\n\n    if (!session) {\n      session = new DetoxSession(sessionId);\n      this._sessionsById.set(sessionId, session);\n    }\n\n    this._sessionsByConnection.set(connection, session);\n    session[role] = connection;\n    return session;\n  }\n\n  /**\n   * @param {DetoxConnection} connection\n   * @returns {DetoxSession|null}\n   */\n  getSession(connection) {\n    const result = this._sessionsByConnection.get(connection) || null;\n    return result;\n  }\n\n  /**\n   * @param {WebSocket} webSocket\n   */\n  unregisterConnection(webSocket) {\n    if (!this._assertWebSocketIsUsed(webSocket)) {\n      return;\n    }\n\n    const connection = this._connectionsByWs.get(webSocket);\n    const session = this._sessionsByConnection.get(connection);\n\n    if (session) {\n      session.disconnect(connection);\n      session.notify();\n\n      this._sessionsByConnection.delete(connection);\n      if (session.isEmpty) {\n        this._sessionsById.delete(session.id);\n      }\n    }\n\n    this._connectionsByWs.delete(webSocket);\n  }\n\n  _assertWebSocketIsNotUsed(webSocket) {\n    if (!this._connectionsByWs.has(webSocket)) {\n      return true;\n    }\n\n    this._invariant('Cannot register the same WebSocket instance twice.');\n  }\n\n  _assertWebSocketIsUsed(webSocket) {\n    if (this._connectionsByWs.has(webSocket)) {\n      return true;\n    }\n\n    this._invariant('Cannot unregister an unknown WebSocket instance.');\n  }\n\n  _assertConnectionIsNotInSession(connection) {\n    if (!this._sessionsByConnection.has(connection)) {\n      return true;\n    }\n\n    this._invariant('Cannot login the same WebSocket instance twice into the same session.');\n  }\n\n  _invariant(errorMessage) {\n    log.error(DetoxInternalError.from(errorMessage));\n  }\n}\n\nmodule.exports = DetoxSessionManager;\n"
  },
  {
    "path": "detox/src/server/__mocks__/FakeWebSocket.js",
    "content": "class FakeWebSocket {\n  constructor({ localPort, remotePort }) {\n    this._localPort = localPort;\n    this._remotePort = remotePort;\n    this._events = {};\n\n    this.send = jest.fn(this.send.bind(this));\n    this.socket = new FakeNetworkSocket(this);\n  }\n\n  on(eventType, callback) {\n    this._events[eventType] = this._events[eventType] || [];\n    this._events[eventType].push(callback);\n  }\n\n  send() {}\n\n  mockMessage(obj) {\n    const arg = !(obj instanceof Buffer || typeof obj === 'string')\n      ? JSON.stringify(obj) : obj;\n\n    this._emit('message', arg);\n  }\n\n  mockError(err) {\n    this._emit('error', err);\n  }\n\n  mockLogin({ role, messageId, sessionId = 'aSession' }) {\n    return this.mockMessage({\n      type: 'login',\n      messageId,\n      params: {\n        role,\n        sessionId,\n      },\n    });\n  }\n\n  mockClose() {\n    this._emit('close');\n  }\n\n  _emit(eventType, ...args) {\n    for (const callback of this._events[eventType]) {\n      callback(...args);\n    }\n  }\n}\n\nclass FakeNetworkSocket {\n  constructor(owner) {\n    this._owner = owner;\n  }\n\n  get localPort() {\n    return this._owner._localPort;\n  }\n\n  get remotePort() {\n    return this._owner._remotePort;\n  }\n}\n\nmodule.exports = FakeWebSocket;\n"
  },
  {
    "path": "detox/src/server/__snapshots__/DetoxServer.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxServer .open() / .close() should WARN log a message upon unsuccessful server closing (error emit case) 1`] = `\n[\n  {\n    \"err\": [Error: TEST_ERROR],\n  },\n  \"Detox server has been closed abruptly! See the error details below:\",\n]\n`;\n\nexports[`DetoxServer .open() / .close() should WARN log a message upon unsuccessful server closing (rejection case) 1`] = `\n[\n  {\n    \"err\": [Error: TEST_ERROR],\n  },\n  \"Detox server has been closed abruptly! See the error details below:\",\n]\n`;\n\nexports[`DetoxServer .open() / .close() should WARN log a message upon unsuccessful server closing (timeout case) 1`] = `\n[\n  {\n    \"err\": [DetoxRuntimeError: Detox server close callback was not invoked within the 10000 ms timeout],\n  },\n  \"Detox server has been closed abruptly! See the error details below:\",\n]\n`;\n\nexports[`DetoxServer should ERROR log messages from wss.Server 1`] = `\n[\n  {\n    \"err\": [Error: TEST_ERROR],\n  },\n  \"Detox server has got an unhandled error:\",\n]\n`;\n"
  },
  {
    "path": "detox/src/server/__snapshots__/DetoxSession.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`DetoxSession edge cases should warn on (already) empty app deassignment 1`] = `\n\"DetoxInternalError: no app is connected to the session aSession\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxSession edge cases should warn on (already) empty tester deassignment 1`] = `\n\"DetoxInternalError: no tester is connected to the session aSession\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxSession edge cases should warn on .disconnect(<unknown connection>) 1`] = `\n\"DetoxInternalError: cannot disconnect an unknown connection from the session aSession\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxSession edge cases should warn on .disconnect(null) 1`] = `\n\"DetoxInternalError: DetoxSession(aSession).prototype.disconnect(connection) expects a non-null argument.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxSession edge cases should warn on non-empty app assignment 1`] = `\n\"DetoxInternalError: the app is already connected to the session aSession\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`DetoxSession edge cases should warn on non-empty tester assignment 1`] = `\n\"DetoxInternalError: the tester is already connected to the session aSession\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n"
  },
  {
    "path": "detox/src/server/__tests__/__snapshots__/server-integration.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Detox server integration \"app\" connects first, and then disconnects 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 8081,\n  },\n  \"connection :8000<->:8081\",\n  \"(begin)\",\n]\n`;\n\nexports[`Detox server integration \"tester\" connects first, and then disconnects 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 8081,\n  },\n  \"connection :8000<->:8081\",\n  \"(begin)\",\n]\n`;\n\nexports[`Detox server integration edge cases .registerSession - calling twice 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n    \"role\": \"app\",\n    \"sessionId\": \"aSession\",\n    \"trackingId\": \"app\",\n  },\n  \"DetoxInternalError: Cannot login the same WebSocket instance twice into the same session.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\",\n]\n`;\n\nexports[`Detox server integration edge cases app dispatches \"ready\" action before login 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  \"The app has dispatched \"ready\" action too early.\",\n]\n`;\n\nexports[`Detox server integration edge cases attempt to register the same connection twice 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  \"DetoxInternalError: Cannot register the same WebSocket instance twice.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\",\n]\n`;\n\nexports[`Detox server integration edge cases attempt to unregister an unknown connection 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n  },\n  \"DetoxInternalError: Cannot unregister an unknown WebSocket instance.\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\",\n]\n`;\n\nexports[`Detox server integration edge cases login - empty .params 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Invalid login action received, it has no .params\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'login'\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login - invalid .role 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Invalid login action received, it has invalid .role\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'login',\n  params: {\n    sessionId: 'Session',\n    role: 'Meteora'\n  }\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login - missing .sessionId 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Invalid login action received, it has no .sessionId\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'login',\n  params: {\n    sessionId: '',\n    role: 'tester'\n  }\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login - non-string .sessionId 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Invalid login action received, it has a non-string .sessionId\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'login',\n  params: {\n    sessionId: {\n      '0': 2\n    },\n    role: 'tester'\n  }\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login twice (as app) 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n    \"role\": \"app\",\n    \"sessionId\": \"aSession\",\n    \"trackingId\": \"app\",\n  },\n  {\n    \"error\": [DetoxInternalError: Cannot log in twice into the same session (aSession) being \"app\" already\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login twice (as tester) + socket send error 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n    \"role\": \"tester\",\n    \"sessionId\": \"aSession\",\n    \"trackingId\": \"tester\",\n  },\n  {\n    \"err\": [Error: TestError],\n  },\n  \"Cannot forward the error details to the tester due to the error:\",\n]\n`;\n\nexports[`Detox server integration edge cases login twice (as tester) + socket send error 2`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n    \"role\": \"tester\",\n    \"sessionId\": \"aSession\",\n    \"trackingId\": \"tester\",\n  },\n  {\n    \"error\": [DetoxInternalError: Cannot log in twice into the same session (aSession) being \"tester\" already\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases on(message) - malformed data 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: The payload received is not a valid JSON.\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases on(message) - no .type 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Cannot process an action without a type.\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  some: 'message'\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases receiving an action before we login 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [DetoxRuntimeError: Action dispatched too early, there is no session to use:\n\nHINT: Please report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\n\n{\n  type: 'reloadReactNative',\n  messageId: -1000\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n\nexports[`Detox server integration edge cases socket error 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 10,\n  },\n  {\n    \"error\": [Error: Test error],\n  },\n  \"Caught socket error:\",\n]\n`;\n\nexports[`Detox server integration tester and app interconnect and then disconnect 1`] = `\n[\n  {\n    \"cat\": \"ws-server,ws-session\",\n    \"id\": 11,\n    \"role\": \"app\",\n    \"sessionId\": \"aSession\",\n    \"trackingId\": \"app\",\n  },\n  {\n    \"error\": [DetoxRuntimeError: Cannot forward the message to the Detox client.\n\n{\n  type: 'currentStatus',\n  messageId: 200,\n  params: {\n    status: 'I am fine'\n  }\n}],\n  },\n  \"Caught unhandled error:\",\n]\n`;\n"
  },
  {
    "path": "detox/src/server/__tests__/server-integration.test.js",
    "content": "// @ts-nocheck\nconst FakeWebSocket = require('../__mocks__/FakeWebSocket');\n\ndescribe('Detox server integration', () => {\n  let logger;\n  /**\n   * @type {typeof import('../DetoxSessionManager')}\n   */\n  let DetoxSessionManager;\n  /**\n   * @type {typeof import('../DetoxSession')}\n   */\n  let DetoxSession;\n  /**\n   * @type {typeof import('../DetoxConnection')}\n   */\n  let DetoxConnection;\n  /**\n   * @type {DetoxSessionManager}\n   */\n  let sessionManager;\n\n  beforeEach(() => {\n    jest.mock('../../utils/logger');\n    logger = require('../../utils/logger');\n    DetoxSessionManager = require('../DetoxSessionManager');\n    DetoxSession = require('../DetoxSession');\n    DetoxConnection = require('../DetoxConnection');\n    sessionManager = new DetoxSessionManager();\n    jest.spyOn(sessionManager, 'registerSession');\n    jest.spyOn(sessionManager, 'unregisterConnection');\n  });\n\n  test.each([\n    ['app'],\n    ['tester']\n  ])('%j connects first, and then disconnects', async (role) => {\n    const webSocket = new FakeWebSocket({ localPort: 8000, remotePort: 8081 });\n    sessionManager.registerConnection(webSocket, webSocket.socket);\n\n    expect(getLoggerMsg('debug', 0)).toMatchSnapshot();\n    expect(sessionManager.getSession(webSocket)).toBe(null);\n\n    webSocket.mockLogin({ messageId: 100500, role });\n\n    expect(sessionManager.registerSession).toHaveBeenCalledWith(expect.any(DetoxConnection), {\n      role,\n      sessionId: 'aSession',\n    });\n\n    const [[detoxConnection]] = sessionManager.registerSession.mock.calls;\n    const detoxSession = sessionManager.getSession(detoxConnection);\n    expect(detoxSession).toBeInstanceOf(DetoxSession);\n\n    expect(webSocket.send).toHaveBeenCalledWith(aMessage({\n      type: 'loginSuccess',\n      messageId: 100500,\n      params: {\n        testerConnected: false,\n        appConnected: false,\n        [role + 'Connected']: true,\n      },\n    }));\n\n    webSocket.mockClose();\n    expect(sessionManager.unregisterConnection).toHaveBeenCalledWith(webSocket);\n    expect(sessionManager.getSession(detoxConnection)).toBe(null);\n  });\n\n  test('tester and app interconnect and then disconnect', async () => {\n    let testerSocket = new FakeWebSocket({ remotePort: 0x7 });\n    let appSocket = new FakeWebSocket({ remotePort: 0xA });\n\n    sessionManager.registerConnection(testerSocket, testerSocket.socket);\n    testerSocket.mockLogin({ role: 'tester' });\n\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage({\n      type: 'loginSuccess',\n      params: {\n        testerConnected: true,\n        appConnected: false,\n      },\n    }));\n\n    sessionManager.registerConnection(appSocket, appSocket.socket);\n    appSocket.mockLogin({ role: 'app' });\n\n    expect(appSocket.send).toHaveBeenCalledWith(aMessage({\n      type: 'loginSuccess',\n      params: {\n        testerConnected: true,\n        appConnected: true,\n      },\n    }));\n\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage({ type: 'appConnected' }));\n\n    // app will disconnect\n    const [[testerConnection], [appConnection]] = sessionManager.registerSession.mock.calls;\n    const detoxSession = sessionManager.getSession(appConnection);\n    expect(detoxSession).toBeInstanceOf(DetoxSession);\n\n    appSocket.mockClose();\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage({ type: 'appDisconnected' }));\n\n    expect(sessionManager.getSession(appConnection)).toBe(null); // because the app is disconnected\n    expect(sessionManager.getSession(testerConnection)).toBe(detoxSession); // because the tester is still connected\n\n    testerSocket.mockMessage({\n      type: 'cleanup',\n      messageId: 100,\n    });\n\n    // assert tester get a stub cleanup message if the app is not connected\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage({\n      type: 'cleanupDone',\n      messageId: 100\n    }));\n\n    testerSocket.mockMessage({\n      type: 'reactNativeReload',\n      messageId: 101,\n    });\n\n    // assert tester get a serverError explaining the app is unreachable\n    expect(testerSocket.send).toHaveBeenCalledWith(expect.stringContaining('\"type\":\"serverError\"'));\n    expect(testerSocket.send).toHaveBeenCalledWith(expect.stringContaining('Detox can\\'t seem to connect to the test app'));\n\n    testerSocket.send.mockReset();\n\n    // app reconnects\n    appSocket = new FakeWebSocket({ remotePort: 0xB });\n    sessionManager.registerConnection(appSocket, appSocket.socket);\n    appSocket.mockLogin({ role: 'app' });\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage({ type: 'appConnected' }));\n\n    // tester sends to app\n    const reloadAction = { type: 'reactNativeReload', messageId: 1000 };\n    testerSocket.mockMessage(reloadAction);\n    expect(appSocket.send).toHaveBeenCalledWith(aMessage(reloadAction));\n\n    // app sends back to tester\n    const readyAction = { type: 'ready', messageId: 1000 };\n    appSocket.mockMessage(readyAction);\n    expect(testerSocket.send).toHaveBeenCalledWith(aMessage(readyAction));\n\n    // tester disconnects\n    testerSocket.mockClose();\n    expect(appSocket.send).toHaveBeenCalledWith(aMessage({ type: 'testerDisconnected', messageId: -1 }));\n    expect(sessionManager.getSession(testerConnection)).toBe(null);\n\n    appSocket.mockMessage({\n      type: 'currentStatus',\n      messageId: 200,\n      params: {\n        status: 'I am fine',\n      }\n    });\n\n    expect(getLoggerMsg('warn', 0)).toMatchSnapshot();\n\n    // app disconnects\n    appSocket.mockClose();\n  });\n\n  describe('edge cases', () => {\n    let webSocket;\n\n    beforeEach(() => {\n      webSocket = new FakeWebSocket({ remotePort: 0xA });\n    });\n\n    test('attempt to register the same connection twice', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      expect(logger.error).not.toHaveBeenCalled();\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      expect(getLoggerMsg('error')).toMatchSnapshot();\n    });\n\n    test('attempt to unregister an unknown connection', () => {\n      sessionManager.unregisterConnection(webSocket);\n      expect(getLoggerMsg('error')).toMatchSnapshot();\n    });\n\n    test('unregistering an anomymous connection', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      sessionManager.unregisterConnection(webSocket);\n      expect(logger.error).not.toHaveBeenCalled();\n      sessionManager.unregisterConnection(webSocket);\n      expect(logger.error).toHaveBeenCalledWith(expect.stringContaining('Cannot unregister'));\n    });\n\n    test('on(message) - malformed data', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage(Buffer.alloc(0));\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('on(message) - no .type', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ some: 'message' });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login - empty .params', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'login' });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login - invalid .role', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'login', params: { sessionId: 'Session', role: 'Meteora' } });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login - missing .sessionId', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'login', params: { sessionId: '', role: 'tester' } });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login - non-string .sessionId', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'login', params: { sessionId: { 0: 2 }, role: 'tester' } });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login twice (as tester)', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockLogin({ role: 'tester' });\n      webSocket.mockLogin({ role: 'tester' });\n      expect(webSocket.send).toHaveBeenCalledWith(expect.stringContaining('\"type\":\"serverError\"'));\n      expect(webSocket.send).toHaveBeenCalledWith(expect.stringContaining('Cannot log in twice'));\n    });\n\n    test('login twice (as tester) + socket send error', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockLogin({ role: 'tester' });\n\n      webSocket.send.mockImplementationOnce(() => {\n        throw Object.assign(new Error('TestError'), { stack: '' });\n      });\n\n      webSocket.mockLogin({ role: 'tester' });\n      expect(webSocket.send).toHaveBeenCalledWith(expect.stringContaining('\"type\":\"serverError\"'));\n\n      expect(getLoggerMsg('error')).toMatchSnapshot();\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('login twice (as app)', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockLogin({ role: 'app' });\n      webSocket.mockLogin({ role: 'app' });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('.registerSession - calling twice', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockLogin({ role: 'app' });\n      const [[detoxConnection]] = sessionManager.registerSession.mock.calls;\n      const priorDetoxSession = sessionManager.getSession(detoxConnection);\n      const newDetoxSession = sessionManager.registerSession(detoxConnection, { role: 'app', sessionId: '10101' });\n\n      expect(priorDetoxSession === newDetoxSession).toBe(true); // assert no new sessions were created\n      expect(getLoggerMsg('error')).toMatchSnapshot();\n    });\n\n    test('receiving an action before we login', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'reloadReactNative', messageId: -1000 });\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n\n    test('app dispatches \"ready\" action before login', async () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n      webSocket.mockMessage({ type: 'ready', messageId: -1000 });\n      expect(getLoggerMsg('debug', 1)).toMatchSnapshot();\n    });\n\n    test('socket error', () => {\n      sessionManager.registerConnection(webSocket, webSocket.socket);\n\n      const err = new Error('Test error');\n      delete err.stack;\n      webSocket.mockError(err);\n\n      expect(getLoggerMsg('warn')).toMatchSnapshot();\n    });\n  });\n\n  function getLoggerMsg(level, callIndex = 0, argIndex) {\n    const call = logger.log.mock.calls.filter(c => c[0] === level).map(c => c.slice(1))[callIndex];\n    if (argIndex === undefined) {\n      return call;\n    } else {\n      return call[argIndex];\n    }\n  }\n\n  function aMessage(obj) {\n    return expect.stringContaining(JSON.stringify(obj));\n  }\n});\n"
  },
  {
    "path": "detox/src/server/handlers/AnonymousConnectionHandler.js",
    "content": "// @ts-nocheck\nconst DetoxInternalError = require('../../errors/DetoxInternalError');\nconst DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\n\nconst AppConnectionHandler = require('./AppConnectionHandler');\nconst TesterConnectionHandler = require('./TesterConnectionHandler');\n\nclass AnonymousConnectionHandler {\n  constructor({ api }) {\n    this._api = api;\n  }\n\n  handle(action) {\n    switch (action.type) {\n      case 'login': return this._handleLoginAction(action);\n      case 'ready': return this._handleEarlyReadyAction(action);\n      default: return this._handleUnknownAction(action);\n    }\n  }\n\n  onError(error, _action) {\n    throw error;\n  }\n\n  _handleLoginAction(action) {\n    if (!action.params) {\n      throw new DetoxRuntimeError({\n        message: `Invalid login action received, it has no .params`,\n        hint: DetoxInternalError.reportIssue,\n        debugInfo: action,\n      });\n    }\n\n    if (action.params.role !== 'app' && action.params.role !== 'tester') {\n      throw new DetoxRuntimeError({\n        message: `Invalid login action received, it has invalid .role`,\n        hint: DetoxInternalError.reportIssue,\n        debugInfo: action,\n        inspectOptions: { depth: 2 },\n      });\n    }\n\n    if (!action.params.sessionId) {\n      throw new DetoxRuntimeError({\n        message: `Invalid login action received, it has no .sessionId`,\n        hint: DetoxInternalError.reportIssue,\n        debugInfo: action,\n        inspectOptions: { depth: 2 },\n      });\n    }\n\n    if (typeof action.params.sessionId !== 'string') {\n      throw new DetoxRuntimeError({\n        message: `Invalid login action received, it has a non-string .sessionId`,\n        hint: DetoxInternalError.reportIssue,\n        debugInfo: action,\n        inspectOptions: { depth: 3 },\n      });\n    }\n\n    const session = this._api.registerSession(action.params);\n    const Handler = action.params.role === 'app' ? AppConnectionHandler : TesterConnectionHandler;\n    this._api.setHandler(new Handler({\n      api: this._api,\n      session,\n    }));\n\n    this._api.sendAction({\n      ...action,\n      type: 'loginSuccess',\n      params: {\n        testerConnected: !!session.tester,\n        appConnected: !!session.app,\n      },\n    });\n\n    session.notify();\n  }\n\n  _handleUnknownAction(action) {\n    throw new DetoxRuntimeError({\n      message: `Action dispatched too early, there is no session to use:`,\n      hint: DetoxInternalError.reportIssue,\n      debugInfo: action,\n    });\n  }\n\n  _handleEarlyReadyAction() {\n    this._api.log.debug('The app has dispatched \"ready\" action too early.');\n  }\n}\n\nmodule.exports = AnonymousConnectionHandler;\n"
  },
  {
    "path": "detox/src/server/handlers/AppConnectionHandler.js",
    "content": "const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\n\nconst RegisteredConnectionHandler = require('./RegisteredConnectionHandler');\n\nclass AppConnectionHandler extends RegisteredConnectionHandler {\n  constructor({ api, session }) {\n    super({ api, session, role: 'app' });\n  }\n\n  handle(action) {\n    /* istanbul ignore next */\n    if (super.handle(action)) {\n      return true;\n    }\n\n    if (this._session.tester) {\n      this._session.tester.sendAction(action);\n      return true;\n    }\n\n    throw new DetoxRuntimeError({\n      message: 'Cannot forward the message to the Detox client.',\n      debugInfo: action,\n      inspectOptions: {\n        depth: 3,\n      },\n    });\n  }\n}\n\nmodule.exports = AppConnectionHandler;\n"
  },
  {
    "path": "detox/src/server/handlers/RegisteredConnectionHandler.js",
    "content": "// @ts-nocheck\nconst { serializeError } = require('serialize-error');\n\nconst DetoxInternalError = require('../../errors/DetoxInternalError');\n\nclass RegisteredConnectionHandler {\n  constructor({ api, role, session }) {\n    this._api = api;\n    this._api.appendLogDetails({\n      trackingId: role,\n      sessionId: session.id,\n      role,\n    });\n\n    this._role = role;\n    /** @type {DetoxSession} */\n    this._session = session;\n  }\n\n  handle(action) {\n    switch (action.type) {\n      case 'login':\n        throw new DetoxInternalError(`Cannot log in twice into the same session (${this._session.id}) being \"${this._role}\" already`);\n      default:\n        return false;\n    }\n  }\n\n  onError(error, action) {\n    if (!this._session.tester) {\n      throw error;\n    }\n\n    try {\n      this._session.tester.sendAction({\n        type: 'serverError',\n        params: {\n          error: serializeError(error),\n        },\n        messageId: action && action.messageId,\n      });\n    } catch (err) {\n      this._api.log.error({ err }, 'Cannot forward the error details to the tester due to the error:');\n      throw error;\n    }\n  }\n}\n\nmodule.exports = RegisteredConnectionHandler;\n"
  },
  {
    "path": "detox/src/server/handlers/TesterConnectionHandler.js",
    "content": "const failedToReachTheApp = require('../../errors/longreads/failedToReachTheApp');\n\nconst RegisteredConnectionHandler = require('./RegisteredConnectionHandler');\n\nclass TesterConnectionHandler extends RegisteredConnectionHandler {\n  constructor({ api, session }) {\n    super({ api, session, role: 'tester' });\n  }\n\n  handle(action) {\n    /* istanbul ignore next */\n    if (super.handle(action)) {\n      return true;\n    }\n\n    if (this._session.app) {\n      this._session.app.sendAction(action);\n      return true;\n    }\n\n    if (action.type === 'cleanup') {\n      // returns \"cleanupDone\" stub\n      // for the case when no app is already running\n      this._api.sendAction({\n        type: 'cleanupDone',\n        messageId: action.messageId\n      });\n\n      return true;\n    }\n\n    throw failedToReachTheApp.maybeAppWasNotLaunched(action);\n  }\n}\n\nmodule.exports = TesterConnectionHandler;\n"
  },
  {
    "path": "detox/src/utils/AsyncEmitter.js",
    "content": "const _ = require('lodash');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nclass AsyncEmitter {\n  constructor({ events, onError }) {\n    this.emit = this.emit.bind(this);\n    this.off = this.off.bind(this);\n    this.on = this.on.bind(this);\n\n    this._listeners = {};\n    for (const eventName of events) {\n      this._listeners[eventName] = [];\n    }\n\n    this._onError = onError;\n  }\n\n  async emit(eventName, eventObj) {\n    const eventListeners = this._listeners[eventName];\n    if (_.isEmpty(eventListeners)) {\n      return;\n    }\n\n    const fire = async (fn) => fn(eventObj);\n    const onError = (error) => this._onError({ error, eventName, eventObj });\n\n    await Promise.all(eventListeners.map(fn => fire(fn).catch(onError)));\n  }\n\n  off(eventName, callback) {\n    if (arguments.length === 0) {\n      this._listeners = {};\n      return;\n    }\n\n    if (this._listeners.hasOwnProperty(eventName)) {\n      _.pull(this._listeners[eventName], callback);\n    } else {\n      throw new DetoxRuntimeError('AsyncEmitter.off() failed to unsubscribe from a non-existent event: ' + eventName);\n    }\n  }\n\n  on(eventName, callback) {\n    if (this._listeners.hasOwnProperty(eventName)) {\n      this._listeners[eventName].push(callback);\n    } else {\n      throw new DetoxRuntimeError('AsyncEmitter.on() failed to subscribe to a non-existent event: ' + eventName);\n    }\n  }\n}\n\nmodule.exports = AsyncEmitter;\n"
  },
  {
    "path": "detox/src/utils/AsyncEmitter.test.js",
    "content": "// @ts-nocheck\nconst AsyncEmitter = require('./AsyncEmitter');\nconst noop = () => {};\nconst sleep = require('./sleep');\n\ndescribe('AsyncEmitter', () => {\n  const REGISTERED_EVENT = 'aRegisteredEvent';\n  const NOT_REGISTERED_EVENT = 'aNotRegisteredEvent';\n  let emitter;\n\n  beforeEach(() => {\n    emitter = new AsyncEmitter({ events: [REGISTERED_EVENT], onError: noop });\n  });\n\n  describe('edge cases', () => {\n    it('should fail to subscribe to non-registered events', () => {\n      expect(() => emitter.on(NOT_REGISTERED_EVENT, () => {})).toThrow(/subscribe to a non-existent/);\n    });\n\n    it('should fail to unsubscribe from non-registered events', () => {\n      expect(() => emitter.off(NOT_REGISTERED_EVENT, () => {})).toThrow(/unsubscribe from a non-existent/);\n    });\n\n    it('should not throw on attempt to remove a non-existent listener', () => {\n      expect(() => emitter.off(REGISTERED_EVENT, () => {})).not.toThrow();\n    });\n\n    it('should not throw on attempt to emit event, when there are no listeners', () => {\n      expect(() => emitter.emit(REGISTERED_EVENT, {})).not.toThrow();\n    });\n  });\n\n  it('should wait for subscribers to finish #1', async () => {\n    const listener = jest.fn().mockImplementation(() => new Promise(noop));\n\n    emitter.on(REGISTERED_EVENT, listener);\n    const emitPromise = emitter.emit(REGISTERED_EVENT, 100500);\n    const timeoutPromise = sleep(0).then(() => 'timeout');\n\n    const race = await Promise.race([emitPromise, timeoutPromise]);\n\n    expect(listener).toHaveBeenCalledWith(100500);\n    expect(race).toBe('timeout');\n  });\n\n  it('should wait for subscribers to finish #2', async () => {\n    const listener1 = jest.fn().mockImplementation(async () => {});\n    const listener2 = jest.fn().mockImplementation(async () => {});\n\n    emitter.on(REGISTERED_EVENT, listener1);\n    emitter.on(REGISTERED_EVENT, listener2);\n\n    await emitter.emit(REGISTERED_EVENT, 42);\n    expect(listener1).toHaveBeenCalledWith(42);\n    expect(listener2).toHaveBeenCalledWith(42);\n  });\n\n  it('should not wait for unregistered listeners', async () => {\n    const listener = jest.fn();\n\n    emitter.on(REGISTERED_EVENT, listener);\n    emitter.off(REGISTERED_EVENT, listener);\n\n    await emitter.emit(REGISTERED_EVENT, {});\n    expect(listener).not.toHaveBeenCalled();\n  });\n\n  it('should pass errors from listeners', async () => {\n    const onError = jest.fn();\n    const testError = new Error();\n\n    emitter = new AsyncEmitter({ events: [REGISTERED_EVENT], onError });\n    emitter.on(REGISTERED_EVENT, () => { throw testError; });\n    await emitter.emit(REGISTERED_EVENT, 42);\n\n    expect(onError).toHaveBeenCalledWith({\n      error: testError,\n      eventName: REGISTERED_EVENT,\n      eventObj: 42,\n    });\n  });\n\n  it('should unregister all listeners with .off()', async () => {\n    const listener = jest.fn();\n\n    emitter = new AsyncEmitter({ events: [REGISTERED_EVENT] });\n    emitter.on(REGISTERED_EVENT, listener);\n    emitter.off();\n    await emitter.emit(REGISTERED_EVENT, 42);\n\n    expect(listener).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/Deferred.js",
    "content": "const noop = () => {};\n\nconst _promise = Symbol('promise');\nconst _status = Symbol('status');\nconst _resolve = Symbol('resolve');\nconst _reject = Symbol('reject');\n\nclass Deferred {\n  constructor() {\n    this[_promise] = new Promise((resolve, reject) => {\n      this[_status] = Deferred.PENDING;\n      this[_resolve] = resolve;\n      this[_reject] = reject;\n    });\n\n    this[_promise].catch(noop); // handle unhandled rejection warnings\n    this.resolve = this.resolve.bind(this);\n    this.reject = this.reject.bind(this);\n  }\n\n  static resolved(value) {\n    const deferred = new Deferred();\n    deferred.resolve(value);\n    return deferred;\n  }\n\n  static rejected(error) {\n    const deferred = new Deferred();\n    deferred.reject(error);\n    return deferred;\n  }\n\n  get status() {\n    return this[_status];\n  }\n\n  get promise() {\n    return this[_promise];\n  }\n\n  isPending() {\n    return this.status === Deferred.PENDING;\n  }\n\n  isResolved() {\n    return this.status === Deferred.RESOLVED;\n  }\n\n  isRejected() {\n    return this.status === Deferred.REJECTED;\n  }\n\n  resolve(value) {\n    if (this[_status] === Deferred.PENDING) {\n      this[_resolve](value);\n      this[_status] = Deferred.RESOLVED;\n    }\n  }\n\n  reject(reason) {\n    if (this[_status] === Deferred.PENDING) {\n      this[_reject](reason);\n      this[_status] = Deferred.REJECTED;\n    }\n  }\n}\n\nDeferred.PENDING = 'pending';\nDeferred.RESOLVED = 'resolved';\nDeferred.REJECTED = 'rejected';\n\nmodule.exports = Deferred;\n"
  },
  {
    "path": "detox/src/utils/Deferred.test.js",
    "content": "const Deferred = require('./Deferred');\n\ndescribe('Deferred', () => {\n  /** @type {Deferred} */\n  let deferred;\n\n  describe('static properties', () => {\n    it('should have \"pending\" status', () =>\n      expect(Deferred.PENDING).toBe('pending'));\n\n    it('should have \"resolved\" status', () =>\n      expect(Deferred.RESOLVED).toBe('resolved'));\n\n    it('should have \"rejected\" status', () =>\n      expect(Deferred.REJECTED).toBe('rejected'));\n  });\n\n  describe('when created', () => {\n    beforeEach(() => {\n      deferred = new Deferred();\n    });\n\n    it('should have pending status', () =>\n      expect(deferred.status).toBe(Deferred.PENDING));\n\n    it('should indicate an isPending=true, other statuses as false', () => {\n      expect(deferred.isPending()).toEqual(true);\n      expect(deferred.isResolved()).toEqual(false);\n      expect(deferred.isRejected()).toEqual(false);\n    });\n\n    it('should have promise', () =>\n      expect(deferred.promise).toBeInstanceOf(Promise));\n\n    it('can be resolved', () =>\n      expect(() => deferred.resolve()).not.toThrow());\n\n    it('can be rejected', () =>\n      expect(() => deferred.reject()).not.toThrow());\n\n    describe('and resolved', () => {\n      beforeEach(() => deferred.resolve(42));\n\n      it('should have a resolved status', () =>\n        expect(deferred.status).toBe(Deferred.RESOLVED));\n\n      it('should indicate an isResolved=true, other statuses as false', () => {\n        expect(deferred.isResolved()).toEqual(true);\n        expect(deferred.isPending()).toEqual(false);\n        expect(deferred.isRejected()).toEqual(false);\n      });\n\n      it('should have a resolved promise', () =>\n        expect(deferred.promise).resolves.toBe(42));\n\n      describe('and then rejected', () => {\n        beforeEach(() => deferred.reject(new Error('RejectionTest')));\n\n        it('should still have that resolved status', () =>\n          expect(deferred.status).toBe(Deferred.RESOLVED));\n\n        it('should still have that resolved promise', () =>\n          expect(deferred.promise).resolves.toBe(42));\n      });\n    });\n\n    describe('and rejected', () => {\n      beforeEach(() => deferred.reject(new Error('RejectionTest')));\n\n      it('should have a rejected status', () =>\n        expect(deferred.status).toBe(Deferred.REJECTED));\n\n      it('should have a rejected promise', () =>\n        expect(deferred.promise).rejects.toThrow('RejectionTest'));\n\n      it('should indicate an isRejected=true, other statuses as false', () => {\n        expect(deferred.isRejected()).toEqual(true);\n        expect(deferred.isResolved()).toEqual(false);\n        expect(deferred.isPending()).toEqual(false);\n      });\n\n      describe('and then resolved', () => {\n        beforeEach(() => deferred.resolve(42));\n\n        it('should still have that rejected status', () =>\n          expect(deferred.status).toBe(Deferred.REJECTED));\n\n        it('should still have that rejected promise', () =>\n          expect(deferred.promise).rejects.toThrow('RejectionTest'));\n      });\n    });\n  });\n\n  describe('when precreated as resolved', () => {\n    it('should be resolved', async () => {\n      deferred = Deferred.resolved('mock resolution');\n\n      expect(deferred.status).toBe(Deferred.RESOLVED);\n      expect(await deferred.promise).toEqual('mock resolution');\n    });\n  });\n\n  describe('when precreated as rejected', () => {\n    it('should be resolved', async () => {\n      deferred = Deferred.rejected(new Error('error mock'));\n\n      expect(deferred.status).toBe(Deferred.REJECTED);\n      await expect(deferred.promise).rejects.toThrow('error mock');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/ExclusiveLockfile.js",
    "content": "const fs = require('fs-extra');\nconst _ = require('lodash');\nconst plockfile = require('proper-lockfile');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nconst retry = require('./retry');\n\nconst DEFAULT_OPTIONS = {\n  retry: { retries: 10000, interval: 5 },\n  read: { encoding: 'utf8' },\n  getInitialState: _.constant(null),\n};\n\nclass ExclusiveLockfile {\n  constructor(lockfile, options) {\n    if (!lockfile) {\n      throw new DetoxRuntimeError('Path to the lockfile should be a non-empty string');\n    }\n\n    this._lockFilePath = lockfile;\n    this._options = _.defaultsDeep(options, DEFAULT_OPTIONS);\n\n    this._isLocked = false;\n    this._invalidate();\n  }\n\n  get options() {\n    return this._options;\n  }\n\n  /***\n   * @async\n   * @param {Function} fn\n   * @returns {Promise<any>}\n   */\n  async exclusively(fn) {\n    await this._lock();\n\n    try {\n      return (await fn());\n    } finally {\n      await this._unlock();\n    }\n  }\n\n  /***\n   * @returns {any}\n   */\n  read() {\n    if (!this._isLocked) {\n      throw new DetoxRuntimeError('Forbidden to read in unlocked mode');\n    }\n\n    if (!this._hasValue) {\n      this._value = this._doRead();\n      this._hasValue = true;\n    }\n\n    return this._value;\n  }\n\n  /***\n   * @param {any} value\n   */\n  write(value) {\n    if (!this._isLocked) {\n      throw new DetoxRuntimeError('Forbidden to write in unlocked mode');\n    }\n\n    this._value = value;\n    this._hasValue = true;\n  }\n\n  /***\n   * @private\n   */\n  _invalidate() {\n    this._hasValue = false;\n    this._value = null;\n  }\n\n  /***\n   * @returns {any}\n   * @private\n   */\n  _doRead() {\n    const contents = fs.readFileSync(this._lockFilePath, this._options.read);\n    // @ts-ignore Node.js can parse buffer as JSON\n    return JSON.parse(contents);\n  }\n\n  /***\n   * @param value\n   * @private\n   */\n  _doWrite(value) {\n    const contents = JSON.stringify(value);\n    fs.writeFileSync(this._lockFilePath, contents);\n  }\n\n  /***\n   * @returns {Promise<void>}\n   * @private\n   */\n  async _lock() {\n    this._ensureFileExists();\n\n    await retry(this._options.retry, () => {\n      const operationResult = plockfile.lockSync(this._lockFilePath);\n\n      this._isLocked = true;\n      this._invalidate();\n\n      return operationResult;\n    });\n  }\n\n  /***\n   * @private\n   */\n  _ensureFileExists() {\n    if (!fs.existsSync(this._lockFilePath)) {\n      fs.ensureFileSync(this._lockFilePath);\n      const initialState = this._options.getInitialState();\n      this._doWrite(initialState);\n    }\n  }\n\n  /***\n   * @returns {Promise<void>}\n   * @private\n   */\n  async _unlock() {\n    if (this._hasValue) {\n      this._doWrite(this._value);\n    }\n\n    plockfile.unlockSync(this._lockFilePath);\n    this._isLocked = false;\n    this._invalidate();\n  }\n}\n\nmodule.exports = ExclusiveLockfile;\n"
  },
  {
    "path": "detox/src/utils/ExclusiveLockfile.test.js",
    "content": "jest.mock('proper-lockfile');\n\nconst fs = require('fs-extra');\nconst plock = require('proper-lockfile');\n\nconst ExclusiveLockFile = require('./ExclusiveLockfile');\nconst tempfile = require('./tempfile');\n\n\ndescribe('ExclusiveLockFile', () => {\n  let filePath;\n\n  beforeEach(() => {\n    filePath = tempfile('.test');\n  });\n\n  afterEach(async () => {\n    await fs.remove(filePath);\n  });\n\n  it('should execute an arbitrary function inside an exclusive lock', async () => {\n    const lockfile = new ExclusiveLockFile(filePath, {\n      getInitialState: () => 42,\n    });\n\n    expect(plock.lockSync).not.toHaveBeenCalled();\n    const result = await lockfile.exclusively(async () => {\n      expect(plock.lockSync).toHaveBeenCalled();\n\n      expect(lockfile.read()).toBe(42);\n      lockfile.write(84);\n      expect(lockfile.read()).toBe(84);\n\n      expect(plock.unlockSync).not.toHaveBeenCalled();\n      return 'result';\n    });\n\n    expect(plock.unlockSync).toHaveBeenCalled();\n    expect(result).toBe('result');\n  });\n\n  it('should unlock after an exception inside the function', async () => {\n    const lockfile = new ExclusiveLockFile(filePath);\n\n    await expect(lockfile.exclusively(async () => {\n      throw new Error('synthetic error');\n    })).rejects.toThrow(/synthetic error/);\n\n    expect(plock.unlockSync).toHaveBeenCalled();\n  });\n\n  it('should forbid reading and writting outside of exclusive access', async () => {\n    const lockfile = new ExclusiveLockFile(filePath);\n\n    expect(() => lockfile.read()).toThrow(/Forbidden.*to read/);\n    expect(() => lockfile.write(0)).toThrow(/Forbidden.*to write/);\n  });\n\n  it('should create a lockfile if it does not exist', async () => {\n    const lockfile = new ExclusiveLockFile(filePath, {\n      getInitialState: () => 1000,\n    });\n\n    expect(fs.existsSync(filePath)).toBe(false);\n    await lockfile.exclusively(() => {});\n    expect(fs.readFileSync(filePath, 'utf8')).toBe('1000');\n  });\n\n  it('should not overwrite a lockfile if it exists', async () => {\n    const lockfile = new ExclusiveLockFile(filePath);\n\n    await lockfile.exclusively(() => lockfile.write('DETOX'));\n    await lockfile.exclusively(() => {});\n\n    expect(fs.readFileSync(filePath, 'utf8')).toBe('\"DETOX\"');\n  });\n\n  describe('constructor', () => {\n    it('should have 1 required arg', () => {\n      expect(() => new ExclusiveLockFile()).toThrow(/non-empty string/);\n    });\n\n    it('should have default options', () => {\n      const lockfile = new ExclusiveLockFile(filePath);\n\n      expect(lockfile.options).toEqual({\n        retry: expect.objectContaining({}),\n        read: { encoding: 'utf8' },\n        getInitialState: expect.any(Function),\n      });\n    });\n\n    it('should have allow customizing options', () => {\n      const getInitialState = () => {};\n      const lockfile = new ExclusiveLockFile(filePath, {\n        getInitialState,\n      });\n\n      expect(lockfile.options).toEqual({\n        retry: expect.objectContaining({}),\n        read: { encoding: 'utf8' },\n        getInitialState,\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/PIDService.js",
    "content": "const { pid } = require('process');\n\nclass PIDService {\n  getPid() {\n    return pid;\n  }\n\n  /**\n   * Checks if the other process id is running in the current operating system\n   * @param {number} otherPID\n   * @returns {boolean}\n   */\n  isAlive(otherPID) {\n    try {\n      process.kill(otherPID, 0);\n      return true;\n    } catch (ex) {\n      if (ex.code === 'ESRCH') {\n        return false;\n      }\n      throw ex;\n    }\n  }\n\n}\n\nmodule.exports = PIDService;\n"
  },
  {
    "path": "detox/src/utils/PIDService.test.js",
    "content": "const cp = require('child_process');\n\nconst PIDService = require('./PIDService');\n\ndescribe('PIDService', () => {\n  let pidService;\n\n  beforeEach(() => {\n    pidService = new PIDService();\n  });\n\n  it('should return the current process id', () => {\n    expect(pidService.getPid()).toBe(process.pid);\n  });\n\n  it('should tell whether the process is alive', () => {\n    expect(pidService.isAlive(process.pid)).toBe(true);\n\n    const { pid: deadPID } = cp.spawnSync('node', ['-e', 'process.exit(0)']);\n    expect(pidService.isAlive(deadPID)).toBe(false);\n  });\n\n  it('should throw errors other than ESRCH', () => {\n    expect(() => pidService.isAlive(NaN)).toThrow();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/Timer.js",
    "content": "const { DetoxRuntimeError, DetoxInternalError } = require('../errors');\n\nconst Deferred = require('./Deferred');\n\nclass Timer {\n  constructor() {\n    /** @private */\n    this._eta = NaN;\n    /** @private */\n    this._timeout = NaN;\n    /** @type {NodeJS.Timer | null} */\n    this._timeoutHandle = null;\n    /** @type {Deferred | null} */\n    this._timeoutDeferred = null;\n  }\n\n  clear() {\n    if (this._timeoutHandle) {\n      clearTimeout(this._timeoutHandle);\n      this._timeoutHandle = null;\n    }\n\n    this._eta = NaN;\n    this._timeout = NaN;\n    this._timeoutDeferred = null;\n  }\n\n  get expired() {\n    return this._timeoutDeferred ? this._timeoutDeferred.isResolved() : false;\n  }\n\n  /**\n   * @param {number} timeout - maximal allowed duration in milliseconds\n   */\n  schedule(timeout) {\n    this.clear();\n\n    this._eta = Date.now() + timeout;\n    this._timeout = timeout;\n    this._timeoutDeferred = new Deferred();\n    this._timeoutHandle = setTimeout(() => {\n      this._timeoutDeferred.resolve();\n    }, this._timeout);\n\n    return this;\n  }\n\n  extend(ms) {\n    if (this.expired) {\n      return this.schedule(ms);\n    }\n\n    clearTimeout(this._timeoutHandle);\n    this._eta += ms;\n    this._timeout += ms;\n    this._timeoutHandle = setTimeout(() => {\n      this._timeoutDeferred.resolve();\n    }, this._eta - Date.now());\n  }\n\n  async run(description, action) {\n    if (!this._timeoutDeferred) {\n      throw new DetoxInternalError('Cannot run a timer action from an uninitialized timer');\n    }\n\n    const error = new DetoxRuntimeError({\n      message: `Exceeded timeout of ${this._timeout}ms while ${description}`,\n      noStack: true,\n    });\n\n    if (this.expired) {\n      throw error;\n    }\n\n    return Promise.race([\n      this._timeoutDeferred.promise.then(() => { throw error; }),\n      Promise.resolve().then(action),\n    ]);\n  }\n\n  static run(timeout, description, action) {\n    const timer = new Timer();\n    timer.schedule(timeout);\n    return timer.run(description, action);\n  }\n}\n\nmodule.exports = Timer;\n"
  },
  {
    "path": "detox/src/utils/Timer.test.js",
    "content": "jest.useFakeTimers();\n\nconst Deferred = require('./Deferred');\nconst Timer = require('./Timer');\n\ndescribe('Timer', () => {\n  it('should not be expired when just created', async () => {\n    await expect(new Timer().expired).toBe(false);\n  });\n\n  it('should throw on attempt to run when uninitialized', async () => {\n    await expect(new Timer().run('', () => {})).rejects.toThrow(/Cannot run a timer action/);\n  });\n\n  it('should run action in time', async () => {\n    const timer = new Timer().schedule(1000);\n    await expect(timer.run('running test', () => 5)).resolves.toBe(5);\n  });\n\n  it('should throw if an action takes longer', async () => {\n    const timer = new Timer().schedule(999);\n\n    jest.advanceTimersByTime(1000);\n    await expect(timer.run('running this test', () => {}))\n      .rejects.toThrow(/Exceeded timeout of 999ms while running this test/);\n  });\n\n  it('should throw if a sequence of actions takes longer', async () => {\n    const timer = new Timer().schedule(999);\n\n    for (let i = 0; i < 10; i++) {\n      await timer.run('running this test', () => {});\n      jest.advanceTimersByTime(100);\n    }\n\n    await expect(timer.run('running this test', () => {}))\n      .rejects.toThrow(/Exceeded timeout of 999ms while running this test/);\n  });\n\n  it('should be clearable', async () => {\n    const deferred = new Deferred();\n    const timer = new Timer().schedule(999);\n    const promise = timer.run('testing', () => deferred.promise);\n    setTimeout(() => deferred.resolve(5), 1500);\n    jest.advanceTimersByTime(100);\n    timer.clear();\n    jest.advanceTimersByTime(1400);\n    await expect(promise).resolves.toBe(5);\n  });\n\n  it('should reset timer while it is running', async () => {\n    const timer = new Timer().schedule(500);\n\n    jest.advanceTimersByTime(499);\n    timer.extend(100);\n\n    jest.advanceTimersByTime(100);\n\n    await expect(timer.run('testing', () => 5)).resolves.toBe(5);\n    jest.advanceTimersByTime(1);\n    await expect(timer.run('testing', () => 5))\n      .rejects.toThrow(/Exceeded timeout of 600ms while testing/);\n  });\n\n  it('should reset timer after timeout', async () => {\n    const timer = new Timer().schedule(500);\n\n    jest.advanceTimersByTime(500);\n    await expect(timer.run('testing', () => 5))\n      .rejects.toThrow(/Exceeded timeout of 500ms while testing/);\n\n    timer.extend(100);\n    await expect(timer.run('testing', () => 5)).resolves.toBe(5);\n\n    jest.advanceTimersByTime(100);\n    await expect(timer.run('testing', () => 5))\n      .rejects.toThrow(/Exceeded timeout of 100ms while testing/);\n  });\n\n  it('should run action in time with static method', async () => {\n    await expect(Timer.run(1000, 'running test', () => 5)).resolves.toBe(5);\n  });\n\n  it('should throw if an action takes longer with static method', async () => {\n    const promise = Timer.run(999, 'running this test', () => new Deferred().promise);\n    jest.advanceTimersByTime(1000);\n    await expect(promise).rejects.toThrow(/Exceeded timeout of 999ms while running this test/);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/__mocks__/logger.js",
    "content": "const DetoxLogger = require('../../logger/__mocks__/DetoxLogger');\nmodule.exports = DetoxLogger.instances[0] || new DetoxLogger();\n"
  },
  {
    "path": "detox/src/utils/__mocks__/trace.js",
    "content": "module.exports = {\n  trace: {\n    startSection: jest.fn(),\n    endSection: jest.fn(),\n    invocationCall: jest.fn().mockImplementation((_1, _2, promise) => promise),\n  },\n  traceCall: jest.fn().mockImplementation((_, fn) => {\n    return typeof fn === 'function' ? fn() : fn;\n  }),\n};\n"
  },
  {
    "path": "detox/src/utils/__snapshots__/assertArgument.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`assertDuration should throw for \"42\" 1`] = `\"duration should be a number, but got 42 (string)\"`;\n\nexports[`assertDuration should throw for false 1`] = `\"duration should be a number, but got false (boolean)\"`;\n\nexports[`assertEnum should create an assertion function for enums 1`] = `\"speed should be one of [fast, slow], but got medium (string)\"`;\n\nexports[`assertNormalized should throw for \"0.5\" 1`] = `\"invalidNumber should be a number, but got 0.5 (string)\"`;\n\nexports[`assertNormalized should throw for -0.5 1`] = `\"invalidNumber should be a number [0.0, 1.0], but got -0.5 (number)\"`;\n\nexports[`assertNormalized should throw for 1.01 1`] = `\"invalidNumber should be a number [0.0, 1.0], but got 1.01 (number)\"`;\n\nexports[`assertNormalized should throw for null 1`] = `\"invalidNumber should be a number [0.0, 1.0], but got Infinity (number)\"`;\n\nexports[`assertNormalized should throw for null 2`] = `\"invalidNumber should be a number, but got null (object)\"`;\n\nexports[`assertNormalized should throw for undefined 1`] = `\"invalidNumber should be a number, but got undefined (undefined)\"`;\n\nexports[`assertNumber should throw for \"42\" 1`] = `\"invalidNumber should be a number, but got 42 (string)\"`;\n\nexports[`assertNumber should throw for false 1`] = `\"invalidNumber should be a number, but got false (boolean)\"`;\n\nexports[`assertPoint should throw for {\"x\":\"0\",\"y\":0} 1`] = `\"point should be an object with x and y properties, but got {\"x\":\"0\",\"y\":0}\"`;\n\nexports[`assertPoint should throw for {\"x\":0,\"y\":\"0\"} 1`] = `\"point should be an object with x and y properties, but got {\"x\":0,\"y\":\"0\"}\"`;\n\nexports[`assertPoint should throw for {\"x\":0} 1`] = `\"point should be an object with x and y properties, but got {\"x\":0}\"`;\n\nexports[`assertPoint should throw for {\"y\":0} 1`] = `\"point should be an object with x and y properties, but got {\"y\":0}\"`;\n\nexports[`assertString should throw for 123 1`] = `\"invalidString should be a string, but got 123 (number)\"`;\n\nexports[`assertString should throw for undefined 1`] = `\"invalidString should be a string, but got undefined (undefined)\"`;\n\nexports[`assertTraceDescription should throw for undefined 1`] = `\n\"traceDescription expected to be defined, but got undefined\nPlease report this issue on our GitHub tracker:\nhttps://github.com/wix/Detox/issues\"\n`;\n\nexports[`assertUndefined should throw for \"str\" 1`] = `\"0 expected to be undefined, but got s (string)\"`;\n\nexports[`assertUndefined should throw for {\"key\":\"val\"} 1`] = `\"key expected to be undefined, but got val (string)\"`;\n\nexports[`assertUndefined should throw for 1 1`] = `\"value expected to be undefined, but got 1 (number)\"`;\n"
  },
  {
    "path": "detox/src/utils/appdatapath.js",
    "content": "const os = require('os');\nconst path = require('path');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nfunction darwin() {\n  return path.join(os.homedir(), 'Library');\n}\n\nfunction linux() {\n  if (process.env.XDG_DATA_HOME) {\n    return path.join(process.env.XDG_DATA_HOME);\n  }\n\n  return path.join(os.homedir(), '.local', 'share');\n}\n\nfunction win32() {\n  if (process.env.LOCALAPPDATA) {\n    return path.join(process.env.LOCALAPPDATA, 'data');\n  }\n\n  return path.join(process.env.USERPROFILE, 'Application Data');\n}\n\nfunction appDataPath() {\n  switch (os.platform()) {\n    case 'darwin':\n      return darwin();\n    case 'linux':\n      return linux();\n    case 'win32':\n      return win32();\n    default:\n      throw new DetoxRuntimeError(`${os.platform()} is not supported`);\n  }\n}\n\nmodule.exports = {\n  appDataPath\n};\n"
  },
  {
    "path": "detox/src/utils/appendFile.js",
    "content": "const fs = require('fs');\n\nasync function appendFile(src, dest) {\n  const writeStream = fs.createWriteStream(dest, { flags: 'a' });\n  const readStream = fs.createReadStream(src);\n\n  const promise = new Promise((resolve, reject) => {\n    readStream.on('error', e => reject(e));\n    writeStream.on('error', /* istanbul ignore next */ e => reject(e));\n    writeStream.on('close', () => resolve());\n  });\n\n  readStream.pipe(writeStream);\n  return promise;\n}\n\nmodule.exports = appendFile;\n"
  },
  {
    "path": "detox/src/utils/appendFile.test.js",
    "content": "const fs = require('fs-extra');\n\nconst appendFile = require('./appendFile');\nconst tempfile = require('./tempfile');\n\n\ndescribe('appendFile', () => {\n  let src, dest;\n\n  beforeEach(() => {\n    src = tempfile();\n    dest = tempfile();\n  });\n\n  afterEach(async () => {\n    await Promise.all([src, dest].map(f => fs.remove(f)));\n  });\n\n  it('should throw error if source file does not exist', async () => {\n    await expect(appendFile(tempfile(), dest)).rejects.toThrow(/ENOENT/);\n  });\n\n  it('should append source file contents to destination file contents', async () => {\n    await fs.writeFile(dest, 'Begin\\n');\n    await fs.writeFile(src, 'End');\n\n    await appendFile(src, dest);\n    expect(await fs.readFile(dest, 'utf8')).toEqual('Begin\\nEnd');\n  });\n\n  it('should create a new file in destination if it does not exist', async () => {\n    await fs.writeFile(src, 'Begin and End');\n\n    await appendFile(src, dest);\n    expect(await fs.readFile(dest, 'utf8')).toEqual('Begin and End');\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/argparse.js",
    "content": "const path = require('path');\n\nconst _ = require('lodash');\n\nconst { escape } = require('./pipeCommands');\n\nfunction getEnvValue(key) {\n  const envKey = _.findKey(process.env, matchesKey(\n    `DETOX_${_.snakeCase(key)}`.toUpperCase()\n  ));\n\n  let value = process.env[envKey];\n  if (value === 'undefined') {\n    value = undefined;\n  }\n\n  return value;\n}\n\nfunction matchesKey(key) {\n  return /* istanbul ignore next */ process.platform === 'win32'\n    ? (value, envKey) => envKey.toUpperCase() === key\n    : (value, envKey) => envKey === key;\n}\n\nconst DEFAULT_JOIN_ARGUMENTS_OPTIONS = {\n  prefix: '--',\n  joiner: ' ',\n};\n\nfunction joinArgs(keyValues, options = DEFAULT_JOIN_ARGUMENTS_OPTIONS) {\n  const { prefix, joiner } = options === DEFAULT_JOIN_ARGUMENTS_OPTIONS\n    ? options\n    : { ...DEFAULT_JOIN_ARGUMENTS_OPTIONS, ...options };\n\n  const argArray = [];\n\n  for (const [key, value] of Object.entries(keyValues)) {\n    if (value == null) {\n      continue;\n    }\n\n    let arg = (!key.startsWith('-') ? prefix : '') + key;\n\n    if (value !== true) {\n      arg += joiner;\n\n      if (_.isString(value) && value.includes(' ')) {\n        arg += `\"${escape.inQuotedString(value)}\"`;\n      } else {\n        arg += value;\n      }\n    }\n\n    argArray.push(arg);\n  }\n\n  return argArray.join(' ');\n}\n\nfunction getCurrentCommand() {\n  const cwd = process.cwd();\n\n  return process.argv.slice(1).map((value, index) => {\n    return index ? value : path.relative(cwd, value);\n  }).join(' ');\n}\n\nmodule.exports = {\n  getEnvValue,\n  joinArgs,\n  getCurrentCommand,\n};\n"
  },
  {
    "path": "detox/src/utils/argparse.test.js",
    "content": "jest.unmock('process');\n\ndescribe('argparse', () => {\n  describe('getEnvValue()', () => {\n    let _env;\n    let argparse;\n\n    beforeEach(() => {\n      _env = process.env;\n\n      process.env = {\n        ..._env,\n        DETOX_FOO_BAR: 'value',\n      };\n\n      argparse = require('./argparse');\n    });\n\n    afterEach(() => {\n      process.env = _env;\n    });\n\n    it(`nonexistent key should return undefined`, () => {\n      expect(argparse.getEnvValue('blah')).not.toBeDefined();\n    });\n\n    it(`existing DETOX_SNAKE_FORMAT key should return its value (kebab-case input)`, () => {\n      expect(argparse.getEnvValue('foo-bar')).toBe('value');\n    });\n\n    it(`existing DETOX_SNAKE_FORMAT key should return its value (camelCase input)`, () => {\n      expect(argparse.getEnvValue('fooBar')).toBe('value');\n    });\n\n    it('should return undefined if process.env contain something with a string of undefined' ,() => {\n      process.env.DETOX_FOO_BAR = 'undefined';\n      expect(argparse.getEnvValue('fooBar')).toBe(undefined);\n    });\n  });\n\n  describe('joinArgs()', () => {\n    let argparse;\n\n    beforeEach(() => {\n      argparse = require('./argparse');\n    });\n\n    it('should convert key-values to args string', () => {\n      expect(argparse.joinArgs({\n        optional: undefined,\n        debug: true,\n        timeout: 3000,\n        logLevel: 'verbose',\n        '-w': 1,\n        'device-name': 'iPhone X'\n      })).toBe('--debug --timeout 3000 --logLevel verbose -w 1 --device-name \"iPhone X\"');\n    });\n\n    it('should accept options', () => {\n      const options = { prefix: '-', joiner: '=' };\n      const argsObject = {\n        'version': 100,\n        '--help': true\n      };\n\n      expect(argparse.joinArgs(argsObject, options)).toBe('-version=100 --help');\n    });\n  });\n\n  describe('getCurrentCommand()', () => {\n    let argparse;\n\n    beforeEach(() => {\n      argparse = require('./argparse');\n    });\n\n    it('should return the current command in relative path format', () => {\n      expect(argparse.getCurrentCommand()).toMatch(/^[^\\\\/]\\S*jest.*$/);\n      expect(argparse.getCurrentCommand()).toContain(process.argv.slice(2).join(' '));\n    });\n\n    it('should return the rest of the command as-is', () => {\n      process.argv.push(__dirname);\n      try {\n        expect(argparse.getCurrentCommand()).toContain(__dirname);\n      } finally {\n        process.argv.pop();\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/assertArgument.js",
    "content": "const _ = require('lodash');\n\nconst { DetoxInternalError, DetoxRuntimeError } = require('../errors');\n\nfunction firstEntry(obj) {\n  return _.entries(obj)[0] || ['value', obj];\n}\n\nfunction assertType(expectedType) {\n  return function assertSpecificType(arg) {\n    const [key, value] = firstEntry(arg);\n\n    if (typeof value !== expectedType) {\n      throw new DetoxRuntimeError(`${key} should be a ${expectedType}, but got ${value} (${typeof value})`);\n    }\n  };\n}\n\nconst assertNumber = assertType('number');\nconst assertString = assertType('string');\n\nfunction assertNormalized(arg) {\n  assertNumber(arg);\n\n  const [key, value] = firstEntry(arg);\n  if (value < 0 || value > 1) {\n    throw new DetoxRuntimeError(`${key} should be a number [0.0, 1.0], but got ${value} (${typeof value})`);\n  }\n}\n\nfunction assertEnum(allowedValues) {\n  return function assertSpecificEnum(arg) {\n    const [key, value] = firstEntry(arg);\n\n    if (allowedValues.indexOf(value) === -1) {\n      throw new DetoxRuntimeError(`${key} should be one of [${allowedValues.join(', ')}], but got ${value} (${typeof value})`);\n    }\n  };\n}\n\nfunction assertDuration(duration) {\n  if (typeof duration === 'number') {\n    return true;\n  }\n\n  throw new DetoxRuntimeError('duration should be a number, but got ' + (duration + (' (' + (typeof duration + ')'))));\n}\n\nfunction assertPoint(point) {\n  if (typeof point === 'object' && typeof point.x === 'number' &&  typeof point.y === 'number') {\n    return true;\n  }\n\n  throw new DetoxRuntimeError(`point should be an object with x and y properties, but got ${JSON.stringify(point)}`);\n}\n\nfunction assertShouldIgnoreStatusBar(shouldIgnoreStatusBar) {\n  if (typeof shouldIgnoreStatusBar === 'boolean') {\n    return true;\n  }\n\n  throw new DetoxRuntimeError('shouldIgnoreStatusBar should be a boolean, but got ' + (shouldIgnoreStatusBar + (' (' + (typeof shouldIgnoreStatusBar + ')'))));\n}\n\nfunction assertUndefined(arg) {\n  if (arg === undefined) {\n    return true;\n  }\n\n  const [key, value] = firstEntry(arg);\n  throw new DetoxRuntimeError(`${key} expected to be undefined, but got ${value} (${typeof value})`);\n}\n\nfunction assertTraceDescription(arg) {\n  if (arg !== undefined) {\n    return true;\n  }\n\n  throw new DetoxInternalError(`traceDescription expected to be defined, but got undefined`);\n}\n\nmodule.exports = {\n  assertEnum,\n  assertNormalized,\n  assertNumber,\n  assertString,\n  assertDuration,\n  assertPoint,\n  assertShouldIgnoreStatusBar,\n  assertUndefined,\n  assertTraceDescription\n};\n"
  },
  {
    "path": "detox/src/utils/assertArgument.test.js",
    "content": "const assertions = require('./assertArgument');\nconst { assertUndefined } = require('./assertArgument');\n\ndescribe('assertEnum', () => {\n  const { assertEnum } = assertions;\n\n  it('should create an assertion function for enums', () => {\n    const assertSpeed = assertEnum(['fast', 'slow']);\n\n    expect(() => assertSpeed({ speed: 'fast' })).not.toThrow();\n    expect(() => assertSpeed({ speed: 'slow' })).not.toThrow();\n    expect(() => assertSpeed({ speed: 'medium' })).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertNormalized', () => {\n  const { assertNormalized } = assertions;\n\n  it.each([\n    0,\n    0.5,\n    1,\n    NaN\n  ])('should pass for %d', (validNumber) => {\n    expect(() => assertNormalized({ validNumber })).not.toThrow();\n  });\n\n  it.each([\n    -0.5,\n    1.01,\n    Infinity,\n    null,\n    undefined,\n    '0.5'\n  ])('should throw for %j', (invalidNumber) => {\n    expect(() => assertNormalized({ invalidNumber })).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertNumber', () => {\n  const { assertNumber } = assertions;\n\n  it.each([\n    42,\n    NaN,\n    Infinity,\n    -Infinity,\n  ])('should pass for %d', (validNumber) => {\n    expect(() => assertNumber({ validNumber })).not.toThrow();\n  });\n\n  it.each([\n    '42',\n    false,\n  ])('should throw for %j', (invalidNumber) => {\n    expect(() => assertNumber({ invalidNumber })).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertString', () => {\n  const { assertString } = assertions;\n\n  it.each([\n    '',\n    '123',\n  ])('should pass for %d', (validString) => {\n    expect(() => assertString({ validString })).not.toThrow();\n  });\n\n  it.each([\n    123,\n    undefined,\n  ])('should throw for %j', (invalidString) => {\n    expect(() => assertString({ invalidString })).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertDuration', () => {\n  const { assertDuration } = assertions;\n\n  it.each([\n    42,\n    NaN,\n    Infinity,\n    -Infinity,\n  ])('should pass for %d', (validNumber) => {\n    expect(() => assertDuration(validNumber)).not.toThrow();\n  });\n\n  it.each([\n    '42',\n    false,\n  ])('should throw for %j', (invalidNumber) => {\n    expect(() => assertDuration(invalidNumber)).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertPoint', () => {\n  const { assertPoint } = assertions;\n\n  it('should pass for valid point', () => {\n    expect(() => assertPoint({ x: 0, y: 0 })).not.toThrow();\n  });\n\n  it.each([\n    { x: 0 },\n    { y: 0 },\n    { x: '0', y: 0 },\n    { x: 0, y: '0' },\n  ])('should throw for %j', (invalidPoint) => {\n    expect(() => assertPoint(invalidPoint)).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertUndefined', () => {\n  it('should pass for undefined', () => {\n    expect(() => assertUndefined(undefined)).not.toThrow();\n  });\n\n  it.each([\n    'str',\n    1,\n    { key: 'val' }\n  ])('should throw for %j', (definedValue) => {\n    expect(() => assertUndefined(definedValue)).toThrowErrorMatchingSnapshot();\n  });\n});\n\ndescribe('assertTraceDescription', () => {\n  const { assertTraceDescription } = assertions;\n\n  it.each([\n    'str',\n    1,\n    { key: 'val' }\n  ])('should return true for defined %j', (definedValue) => {\n    expect(assertTraceDescription(definedValue)).toBe(true);\n  });\n\n  it('should throw for undefined', () => {\n    expect(() => assertTraceDescription(undefined)).toThrowErrorMatchingSnapshot();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/assertIsFunction.js",
    "content": "const isArrowFunction = require('./isArrowFunction');\n\nconst EXAMPLE = `Here are some examples of valid function strings:\n\n1. function(el) { el.click(); }\n2. el => el.click()\n3. (el) => el.click()\n`;\n\n/**\n * Dynamically evaluates a string as a function and throws an error if it's not a function\n * @param {string} str serialized function like 'function() { return 42; }'\n */\nfunction assertIsFunction(str) {\n  let isFunction;\n\n  try {\n    isFunction = isFunctionDeclaration(str) && Function(`return typeof (${str})`)() === 'function';\n  } catch (e) {\n    isFunction = false;\n  }\n\n  if (!isFunction) {\n    throw new TypeError(`Expected a valid function string, but got: ${str}\\n\\n${EXAMPLE}`);\n  }\n\n  return str;\n}\n\nfunction isFunctionDeclaration(rawStr) {\n  const str = rawStr.trimStart();\n  return str.startsWith('async') || str.startsWith('function') || isArrowFunction(str);\n}\n\nmodule.exports = assertIsFunction;\n"
  },
  {
    "path": "detox/src/utils/assertIsFunction.test.js",
    "content": "const assertIsFunction = require('./assertIsFunction');\n\ndescribe('assertIsFunction', function() {\n  test.each([\n    ['function() { return 42; }'],\n    ['function(x) { return x; }'],\n    ['function(x = () => {}) { return x; }'],\n    ['function() { return x => x; }'],\n    ['() => {}'],\n    ['x => x'],\n    ['(x = () => {}) => x'],\n    ['function*() { yield 42; }'],\n  ])(`given a valid function string %s should return it`, (fn) => {\n    expect(assertIsFunction(fn)).toBe(fn);\n  });\n\n  test.each([\n    ['function() { return 42; /* forgot to close the function'],\n    ['x = () => {}'],\n  ])(`given an invalid function string %s should throw`, (fn) => {\n    expect(() => assertIsFunction(fn)).toThrow();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/callsites.js",
    "content": "const path = require('path');\n\nconst { escapeRegExp } = require('lodash');\nconst cwd = process.cwd() + path.sep;\n\n// Taken from https://github.com/sindresorhus/callsites\nfunction getCallSites() {\n  const _prepareStackTrace = Error.prepareStackTrace;\n  Error.prepareStackTrace = (_, stack) => stack;\n  const stack = new Error().stack.slice(1);\n  Error.prepareStackTrace = _prepareStackTrace;\n  return stack;\n}\n\nfunction getStackDump(endFrame = 0) {\n  return new Error().stack\n    .split('\\n')\n    .slice(2 + endFrame) // 2 = 1 for 'Error:' prefix and 1 for this function's frame\n    .join('\\n')\n    .replace(new RegExp(escapeRegExp(cwd), 'g'), '');\n}\n\nfunction getOrigin(callSite) {\n  const callsiteFilename = callSite && callSite.getFileName();\n  const callsiteLine = callSite && callSite.getLineNumber();\n  const callsiteCol = callSite && callSite.getColumnNumber();\n  const filename = callsiteFilename ? path.relative(process.cwd(), callsiteFilename) : '<unknown>';\n  return `at ${filename}:${callsiteLine || '?'}:${callsiteCol || '?'}`;\n}\n\nmodule.exports = {\n  getCallSites,\n  getOrigin,\n  getStackDump,\n};\n"
  },
  {
    "path": "detox/src/utils/callsites.test.js",
    "content": "const path = require('path');\n\ndescribe('callsites', () => {\n  let callsites;\n\n  beforeEach(() => {\n    callsites = require('./callsites');\n  });\n\n  describe('.getCallSites()', () => {\n    it('should return a query-able callsites array', function it() {\n      const callFromWrapperFn = () => callsites.getCallSites();\n      const [callsite0, callsite1] = callFromWrapperFn();\n\n      const expectedFileName = path.normalize('src/utils/callsites.test.js');\n\n      expect(callsite0.getFileName()).toEqual(expect.stringContaining(expectedFileName));\n      expect(callsite0.getFunctionName()).toEqual('callFromWrapperFn');\n      expect(callsite0.isToplevel()).toEqual(true);\n\n      expect(callsite1.getFunctionName()).toEqual('it');\n      expect(callsite1.isToplevel()).toEqual(false);\n    });\n  });\n\n  describe('.getStackDump', () => {\n    const callStackDumpFromWrapperFn = (endFrame) => callsites.getStackDump(endFrame);\n    const callStackDumpFromTwoWrapperFn = (endFrame) => callStackDumpFromWrapperFn(endFrame);\n\n    const expectedTopFrameRegExp = /^ {4}at (?:Object\\.)?callStackDumpFromWrapperFn \\(src[\\\\/]utils[\\\\/]callsites\\.test\\.js:[0-9][0-9]?:[0-9][0-9]?\\)/;\n    const expected2ndLineRegExp = /^ {4}at (?:Object\\.)?callStackDumpFromTwoWrapperFn \\(src[\\\\/]utils[\\\\/]callsites\\.test\\.js:[0-9][0-9]?:[0-9][0-9]?\\)/;\n\n    it('should return a valid, multi-line, stack-dump string', () => {\n      const [,line1,line2] = callStackDumpFromTwoWrapperFn().split('\\n');\n\n      expect(line1).toEqual(expect.stringMatching(expectedTopFrameRegExp));\n      expect(line2).toEqual(expect.stringMatching(expected2ndLineRegExp));\n    });\n\n    it('should slice according to end-frame arg', () => {\n      const [,line1] = callStackDumpFromTwoWrapperFn(1).split('\\n');\n      expect(line1).toEqual(expect.stringMatching(expected2ndLineRegExp));\n    });\n  });\n\n  describe('.getOrigin(callSite)', () => {\n    it('should include log origin', () => {\n      const fakeCallSite = {\n        getFileName: () => 'MOCK_FILE',\n        getLineNumber: () => 200,\n        getColumnNumber: () => 100,\n      };\n\n      const origin = callsites.getOrigin(fakeCallSite);\n      expect(origin).toBe('at MOCK_FILE:200:100');\n    });\n\n    it('should use relative file-name rather than absolute in origin', () => {\n      const fakeCallSite = {\n        getFileName: () => path.join(process.cwd(), 'src/index.js'),\n        getLineNumber: () => 1,\n        getColumnNumber: () => 1,\n      };\n\n      const origin = callsites.getOrigin(fakeCallSite);\n      expect(origin).toBe(`at ${path.normalize('src/index.js')}:1:1`);\n    });\n\n    it('should handle null callsite', () => {\n      const origin = callsites.getOrigin(null);\n      expect(origin).toBe('at <unknown>:?:?');\n    });\n\n    it('should handle null fileName', () => {\n      const origin = callsites.getOrigin({\n        getFileName: () => null,\n        getLineNumber: () => 42,\n        getColumnNumber: () => 42,\n      });\n\n      expect(origin).toBe('at <unknown>:42:42');\n    });\n\n    it('should handle null lineNumber', () => {\n      const origin = callsites.getOrigin({\n        getFileName: () => 'index.js',\n        getLineNumber: () => null,\n        getColumnNumber: () => 42,\n      });\n\n      expect(origin).toBe('at index.js:?:42');\n    });\n\n    it('should handle null columnNumber', () => {\n      const origin = callsites.getOrigin({\n        getFileName: () => 'index.js',\n        getLineNumber: () => 42,\n        getColumnNumber: () => null,\n      });\n\n      expect(origin).toBe('at index.js:42:?');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/childProcess/exec.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\nconst { exec } = require('promisify-child-process');\n\nconst DetoxRuntimeError = require('../../errors/DetoxRuntimeError');\nconst rootLogger = require('../logger').child({ cat: ['child-process', 'child-process-exec'] });\nconst retry = require('../retry');\n\nconst execsCounter = require('./opsCounter');\n\n/**\n * Executes a command with retries and logs\n * @param {*} bin - command to execute\n * @param {*} options - options\n * @returns {Promise<import('promisify-child-process').Output>}\n */\nasync function execWithRetriesAndLogs(bin, options = {}) {\n  const {\n    retries = 9,\n    interval = 1000,\n    backoff,\n    prefix = null,\n    args = null,\n    timeout,\n    statusLogs = {},\n    verbosity = 'normal',\n    maxBuffer,\n  } = options;\n\n  const trackingId = execsCounter.inc();\n  const cmd = _composeCommand(bin, prefix, args);\n  const logger = rootLogger.child({ fn: 'execWithRetriesAndLogs', cmd, trackingId });\n  const logLevelSuccess = (verbosity === 'high' ? 'debug' : 'trace');\n  const logLevelFail = (verbosity === 'low' ? 'debug' : 'error');\n\n  let result;\n  try {\n    logger.debug({ event: 'EXEC_CMD' }, `${cmd}`);\n\n    await retry({ retries, interval, backoff }, async (tryNumber, lastError) => {\n      if (statusLogs.trying) {\n        _logExecTrying(logger, statusLogs.trying, tryNumber, lastError);\n      } else if (statusLogs.retrying) {\n        _logExecRetrying(logger, cmd, tryNumber, lastError);\n      }\n      result = await exec(cmd, _.omitBy({ timeout, maxBuffer }, _.isUndefined));\n    });\n  } catch (err) {\n    const failReason = err.code == null && timeout > 0\n      ? `timeout = ${timeout}ms`\n      : `error = ${err} (code=${err.code})`;\n    _logExecFail(logger, logLevelFail, cmd, err, failReason);\n    throw err;\n  }\n\n  if (result === undefined) {\n    logger.error({ event: 'EXEC_UNDEFINED' }, `command returned undefined`);\n    throw new DetoxRuntimeError(`command ${cmd} returned undefined`);\n  }\n\n  _logExecOutput(logger, logLevelSuccess, result);\n  _logExecSuccess(logger, logLevelSuccess, result, statusLogs.successful);\n\n  if (typeof result.stdout === 'string') {\n    result.stdout = result.stdout.replace(/\\r\\n/g, '\\n');\n  }\n\n  if (typeof result.stderr === 'string') {\n    result.stderr = result.stderr.replace(/\\r\\n/g, '\\n');\n  }\n\n  return result;\n}\n\n/* istanbul ignore next */\nfunction _logExecOutput(logger, level, execResult) {\n  let stdout = execResult.stdout || '';\n  let stderr = execResult.stderr || '';\n\n  if (execResult.platform === 'win32') {\n    stdout = stdout.replace(/\\r\\n/g, '\\n');\n    stderr = stderr.replace(/\\r\\n/g, '\\n');\n  }\n\n  if (stdout) {\n    logger[level]({ event: 'EXEC_SUCCESS', stdout: true }, stdout);\n  }\n\n  if (stderr) {\n    logger[level]({ event: 'EXEC_SUCCESS', stderr: true }, stderr);\n  }\n}\n\nfunction _logExecFail(logger, level, command, err, reason) {\n  logger[level]({ event: 'EXEC_FAIL' }, `\"${command}\" failed with ${reason}, stdout and stderr:\\n`);\n  logger[level]({ event: 'EXEC_FAIL', stdout: true }, err.stdout);\n  logger[level]({ event: 'EXEC_FAIL', stderr: true }, err.stderr);\n}\n\nfunction _logExecSuccess(logger, level, execResult, message) {\n  if (message) {\n    logger.debug({ event: 'EXEC_SUCCESS' }, message);\n  } else if (!execResult.stdout && !execResult.stderr) {\n    logger[level]({ event: 'EXEC_SUCCESS' }, '');\n  }\n}\n\nfunction _logExecTrying(log, message, retryNumber, lastError) {\n  if (lastError && lastError.stderr) {\n    log.trace({ event: 'EXEC_TRY_FAIL' }, lastError.stderr);\n  }\n  log.debug({ event: 'EXEC_TRY', retryNumber }, message);\n}\n\nfunction _logExecRetrying(log, message, tryNumber, lastError) {\n  if (tryNumber > 1) {\n    log.trace({ event: 'EXEC_TRY_FAIL' }, lastError.stderr);\n    log.debug({ event: 'EXEC_RETRY' }, `(Retry #${tryNumber - 1})`, message);\n  }\n}\n\nfunction _composeCommand(bin, prefix, args) {\n  if (!(prefix || args)) {\n    return bin;\n  }\n\n  const _prefix = prefix ? `${prefix} && ` : '';\n  const _args = args ? ` ${args}` : '';\n\n  return `${_prefix}${bin}${_args}`;\n}\n\nasync function execAsync(command) {\n  const result = await exec(command);\n  return _.trim(result.stdout);\n}\nmodule.exports = {\n  execWithRetriesAndLogs,\n  execAsync\n};\n"
  },
  {
    "path": "detox/src/utils/childProcess/exec.test.js",
    "content": "// @ts-nocheck\ndescribe('Exec utils', () => {\n  let logger;\n  let exec;\n  let retry;\n  let cpp;\n  beforeEach(() => {\n    jest.mock('../logger');\n    logger = require('../logger');\n\n    jest.mock('promisify-child-process');\n    cpp = require('promisify-child-process');\n\n    const mockedRetryActual = jest.requireActual('../retry');\n    const mockedRetry = jest.fn().mockReturnValue(undefined);\n    jest.mock('../retry', () =>\n      (opts, func) => (mockedRetry(opts, func) || mockedRetryActual(opts, func)));\n    retry = mockedRetry;\n\n    exec = require('./exec');\n  });\n\n  const execWithRetriesAndLogs = async (command, options) => {\n    try {\n      const result = await exec.execWithRetriesAndLogs(command, options);\n      return result;\n    } catch (e) {\n      // Workaround for Jest's expect(...).rejects.toThrow() not working with thrown plain objects\n      throw new Error(e);\n    }\n  };\n\n  const advanceOpsCounter = (count) => {\n    const opsCounter = require('./opsCounter');\n    for (let i = 0; i < count; i++) opsCounter.inc();\n  };\n\n  it(`exec command with no arguments ends successfully`, async () => {\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin');\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, {});\n  });\n\n  it(`exec command with arguments ends successfully`, async () => {\n    mockCppSuccessful(cpp);\n\n    const options = { args: `--argument 123` };\n    await execWithRetriesAndLogs('bin', options);\n\n    expect(cpp.exec).toHaveBeenCalledWith(`bin --argument 123`, {});\n  });\n\n  it(`exec command with env-vars pass-through (i.e. no custom env-vars specification`, async () => {\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin');\n    const usedOptions = cpp.exec.mock.calls[0][1];\n    expect(usedOptions).not.toHaveProperty('env');\n    expect(cpp.exec).toHaveBeenCalledTimes(1);\n  });\n\n  it(`exec command with arguments and prefix ends successfully`, async () => {\n    mockCppSuccessful(cpp);\n\n    const options = {\n      args: `--argument 123`,\n      prefix: `export MY_PREFIX`\n    };\n    await execWithRetriesAndLogs('bin', options);\n\n    expect(cpp.exec).toHaveBeenCalledWith(`export MY_PREFIX && bin --argument 123`, {});\n  });\n\n  it(`exec command with prefix (no args) ends successfully`, async () => {\n    mockCppSuccessful(cpp);\n\n    const options = { prefix: `export MY_PREFIX` };\n    await execWithRetriesAndLogs('bin', options);\n\n    expect(cpp.exec).toHaveBeenCalledWith(`export MY_PREFIX && bin`, {});\n  });\n\n  it(`exec command log using a custom logger`, async () => {\n    const trackingId = 4;\n    advanceOpsCounter(trackingId);\n\n    jest.spyOn(logger, 'child');\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin');\n    expect(logger.child).toHaveBeenCalledWith({ fn: 'execWithRetriesAndLogs', trackingId, cmd: 'bin' });\n  });\n\n  it(`exec command with arguments and try-based status logs successfully, with status logging`, async () => {\n    cpp.exec\n      .mockRejectedValueOnce(returnErrorWithValue('error result'))\n      .mockResolvedValueOnce(returnSuccessfulWithValue('successful result'));\n\n    const options = {\n      args: `--argument 123`,\n      statusLogs: {\n        trying: 'trying status log',\n        successful: 'successful status log'\n      }\n    };\n    await execWithRetriesAndLogs('bin', options);\n\n    expect(cpp.exec).toHaveBeenCalledWith(`bin --argument 123`, {});\n    expect(logger.debug).toHaveBeenCalledWith({ event: 'EXEC_TRY', retryNumber: 1 }, options.statusLogs.trying);\n    expect(logger.debug).toHaveBeenCalledWith({ event: 'EXEC_TRY', retryNumber: 2 }, options.statusLogs.trying);\n    expect(logger.trace).toHaveBeenCalledWith({ event: 'EXEC_TRY_FAIL' }, 'error result');\n  });\n\n  it(`exec command with arguments and retry-based status logs successfully, with status logging`, async () => {\n    cpp.exec\n      .mockRejectedValueOnce(returnErrorWithValue('error result'))\n      .mockResolvedValueOnce(returnSuccessfulWithValue('successful result'));\n\n    const options = {\n      args: `--argument 123`,\n      statusLogs: {\n        retrying: true\n      }\n    };\n\n    logger.debug.mockClear();\n\n    await execWithRetriesAndLogs('bin', options);\n\n    expect(cpp.exec).toHaveBeenCalledWith(`bin --argument 123`, {});\n    expect(logger.debug).toHaveBeenCalledWith({ event: 'EXEC_RETRY' }, '(Retry #1)', 'bin --argument 123');\n    expect(logger.debug).not.toHaveBeenCalledWith({ event: 'EXEC_RETRY' }, expect.stringContaining('Retry #0'), expect.any(String));\n    expect(logger.trace).toHaveBeenCalledWith({ event: 'EXEC_TRY_FAIL' }, 'error result');\n  });\n\n  it(`exec command should output success and err logs`, async () => {\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin');\n\n    expect(logger.trace).toHaveBeenCalledWith({ event: 'EXEC_SUCCESS', stdout: true }, '\"successful result\"');\n    expect(logger.trace).toHaveBeenCalledWith({ event: 'EXEC_SUCCESS', stderr: true }, 'err');\n  });\n\n  it(`exec command should output a plain success if no output was made`, async () => {\n    const cppResult = {\n      childProcess: {\n        exitCode: 0\n      }\n    };\n    cpp.exec.mockResolvedValueOnce(cppResult);\n\n    await execWithRetriesAndLogs('bin');\n\n    expect(logger.trace).toHaveBeenCalledWith({ event: 'EXEC_SUCCESS' }, '');\n    expect(logger.trace).toHaveBeenCalledTimes(1);\n  });\n\n  it(`exec command should output success with high severity if verbosity set to high`, async () => {\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin', { verbosity: 'high' });\n\n    expect(logger.debug).toHaveBeenCalledWith({ event: 'EXEC_SUCCESS', stdout: true }, '\"successful result\"');\n    expect(logger.debug).toHaveBeenCalledWith({ event: 'EXEC_SUCCESS', stderr: true }, 'err');\n    expect(logger.trace).not.toHaveBeenCalledWith(expect.objectContaining({ event: 'EXEC_SUCCESS' }), expect.anything());\n  });\n\n  it(`exec command with undefined return should throw`, async () => {\n    cpp.exec.mockReturnValueOnce(undefined);\n    await expect(execWithRetriesAndLogs('bin')).rejects.toThrow();\n  });\n\n  it(`exec command and fail with error code`, async () => {\n    mockCppFailure(cpp);\n\n    await expect(execWithRetriesAndLogs('bin', { retries: 0, interval: 1 })).rejects.toThrow();\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, {});\n    expect(logger.error.mock.calls).toHaveLength(3);\n    expect(logger.error).toHaveBeenCalledWith(expect.objectContaining({ event: 'EXEC_FAIL' }), expect.anything());\n  });\n\n  it(`exec command and fail with error code, report only to debug log if verbosity is low`, async () => {\n    mockCppFailure(cpp);\n\n    await expect(execWithRetriesAndLogs('bin', { verbosity: 'low', retries: 0, interval: 1 })).rejects.toThrow();\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, {});\n    expect(logger.error).not.toHaveBeenCalled();\n    expect(logger.debug.mock.calls).toHaveLength(4);\n  });\n\n  it(`exec command and fail with timeout`, async () => {\n    mockCppFailure(cpp);\n\n    await expect(execWithRetriesAndLogs('bin', { timeout: 1, retries: 0, interval: 1 })).rejects.toThrow();\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, { timeout: 1 });\n    expect(logger.error.mock.calls).toHaveLength(3);\n  });\n\n  it(`exec command with a given maxBuffer`, async () => {\n    mockCppSuccessful(cpp);\n\n    await execWithRetriesAndLogs('bin', { maxBuffer: 1000 });\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, { maxBuffer: 1000 });\n  });\n\n  it(`exec command with multiple failures`, async () => {\n    const errorResult = returnErrorWithValue('error result');\n    cpp.exec\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult);\n\n    await expect(execWithRetriesAndLogs('bin', { retries: 5, interval: 1 })).rejects.toThrow();\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, {});\n    expect(cpp.exec).toHaveBeenCalledTimes(6);\n  });\n\n  it(`exec command with multiple failures and then a success`, async () => {\n    const errorResult = returnErrorWithValue('error result');\n    const successfulResult = returnSuccessfulWithValue('successful result');\n\n    cpp.exec\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockRejectedValueOnce(errorResult)\n      .mockResolvedValueOnce(successfulResult);\n\n    await execWithRetriesAndLogs('bin', { retries: 6, interval: 1 });\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`, {});\n    expect(cpp.exec).toHaveBeenCalledTimes(6);\n  });\n\n  it(`exec should pass through custom retry-args to retry`, async () => {\n    const options = {\n      retries: 512,\n      interval: 1024,\n      backoff: 'linear',\n    };\n\n    mockCppSuccessful(cpp);\n    await execWithRetriesAndLogs('bin', options);\n    expect(retry).toHaveBeenCalledWith(options, expect.any(Function));\n  });\n\n  it(`execAsync command with no arguments runs successfully`, async () => {\n    mockCppSuccessful(cpp);\n    await exec.execAsync('bin');\n    expect(cpp.exec).toHaveBeenCalledWith(`bin`);\n  });\n});\n\nconst returnSuccessfulWithValue = (value) => ({\n  stdout: JSON.stringify(value),\n  stderr: 'err',\n  childProcess: {\n    exitCode: 0\n  }\n});\n\nconst returnErrorWithValue = (value) => ({\n  stdout: 'out',\n  stderr: value,\n  childProcess: {\n    exitCode: 1\n  }\n});\n\nfunction mockCppSuccessful(cpp) {\n  const successfulResult = returnSuccessfulWithValue('successful result');\n  cpp.exec.mockResolvedValueOnce(successfulResult);\n  return successfulResult;\n}\n\nfunction mockCppFailure(cpp) {\n  const errorResult = returnErrorWithValue('error result');\n  cpp.exec.mockRejectedValueOnce(errorResult);\n  return errorResult;\n}\n"
  },
  {
    "path": "detox/src/utils/childProcess/index.js",
    "content": "module.exports = {\n  ...require('./exec'),\n  ...require('./spawn'),\n};\n"
  },
  {
    "path": "detox/src/utils/childProcess/opsCounter.js",
    "content": "let _operationsCounter = 0;\n\nmodule.exports = {\n  inc: () => _operationsCounter++,\n};\n"
  },
  {
    "path": "detox/src/utils/childProcess/spawn.js",
    "content": "// @ts-nocheck\nconst _ = require('lodash');\nconst { spawn } = require('promisify-child-process');\n\nconst rootLogger = require('../logger').child({ cat: ['child-process', 'child-process-spawn'] });\nconst { escape } = require('../pipeCommands');\nconst retry = require('../retry');\n\nconst execsCounter = require('./opsCounter');\n\nfunction spawnAndLog(binary, args, options) {\n  const command = _joinCommandAndArgs(binary, args);\n  const trackingId = execsCounter.inc();\n  const logger = rootLogger.child({ fn: 'spawnAndLog', command, trackingId });\n  return _spawnAndLog(logger, binary, args, command, options);\n}\n\nasync function spawnWithRetriesAndLogs(binary, args, options = {}) {\n  const command = _joinCommandAndArgs(binary, args);\n  const trackingId = execsCounter.inc();\n  const logger = rootLogger.child({ fn: 'spawnWithRetriesAndLogs', command, trackingId });\n  const _options = {\n    ...options,\n    capture: _.union(options.capture || [], ['stderr']),\n  };\n  const {\n    retries = 1,\n    interval = 100,\n    backoff = 'none',\n    ...spawnOptions\n  } = _options;\n\n  let result;\n  await retry({ retries, interval, backoff }, async (tryCount, lastError) => {\n    _logSpawnRetrying(logger, tryCount, lastError);\n    result = _spawnAndLog(logger, binary, args, command, spawnOptions, tryCount);\n    await result;\n  });\n  return result;\n}\n\nconst DEFAULT_KILL_SCHEDULE = {\n  SIGINT: 0,\n};\n\nasync function interruptProcess(childProcessPromise, schedule) {\n  const childProcess = childProcessPromise.childProcess;\n  const cpid = childProcess.pid;\n  const spawnargs = childProcess.spawnargs.join(' ');\n  const log = rootLogger.child({ event: 'SPAWN_KILL', cpid });\n\n  const handles = _.mapValues({ ...DEFAULT_KILL_SCHEDULE, ...schedule }, (ms, signal) => {\n    return setTimeout(() => {\n      log.trace({ signal }, `sending ${signal} to: ${spawnargs}`);\n      childProcess.kill(signal);\n    }, ms);\n  });\n\n  try {\n    await childProcessPromise.catch(e => {\n      /* istanbul ignore if */\n      if (e.exitCode != null) {\n        throw e;\n      }\n    });\n  } finally {\n    _.forEach(handles, handle => clearTimeout(handle));\n  }\n}\n\nfunction _spawnAndLog(logger, binary, args, command, options, tryCount) {\n  const { logLevelPatterns, silent, ...spawnOptions } = { stdio: ['ignore', 'pipe', 'pipe'], ...options };\n  const cpPromise = spawn(binary, args, spawnOptions);\n  const childProcess = cpPromise.childProcess = cpPromise;\n  const originalThen = cpPromise.then.bind(cpPromise);\n  const augmentPromise = (fn) => {\n    return typeof fn === 'function'\n      ? (result) => fn(Object.assign(result, {\n        childProcess,\n        exitCode: childProcess.exitCode,\n        pid: childProcess.pid\n      }))\n      : fn;\n  };\n  cpPromise.then = (onFulfilled, onRejected) => originalThen(augmentPromise(onFulfilled), augmentPromise(onRejected));\n  cpPromise.catch = (onRejected) => cpPromise.then(undefined, onRejected);\n\n  const { exitCode, stdout, stderr } = childProcess;\n\n  const _logger = logger.child({ cpid: childProcess.pid });\n  _logSpawnCommand(_logger, command, tryCount);\n\n  if (exitCode != null && exitCode !== 0) {\n    _logger.error({ event: 'SPAWN_ERROR' }, `${command} failed with code = ${exitCode}`);\n  }\n\n  if (!silent) {\n    stdout && stdout.on('data', _spawnStdoutLoggerFn(_logger, logLevelPatterns));\n    stderr && stderr.on('data', _spawnStderrLoggerFn(_logger, logLevelPatterns));\n  }\n\n  /**\n   *\n   * @param {import('promisify-child-process').Output} resultOrErr\n   */\n  function onEnd(resultOrErr) {\n    const signal = resultOrErr.signal || '';\n    const { code } = resultOrErr;\n    const action = signal ? `terminated with ${signal}` : `exited with code #${code}`;\n\n    _logger.debug({ event: 'SPAWN_END', signal, code }, `${command} ${action}`);\n  }\n\n  cpPromise.then(onEnd, onEnd);\n  return cpPromise;\n}\n\nfunction _joinCommandAndArgs(command, args) {\n  let result = command;\n\n  for (const arg of args.map(String)) {\n    result += ' ' + (arg.indexOf(' ') === -1 ? arg : `\"${escape.inQuotedString(arg)}\"`);\n  }\n\n  return result;\n}\n\nconst _spawnStdoutLoggerFn = (log, logLevelPatterns) => (chunk) => {\n  const line = chunk.toString();\n  const loglevel = _inferLogLevel(line, logLevelPatterns) || 'trace';\n  log[loglevel]({ stdout: true, event: 'SPAWN_STDOUT' }, line);\n};\n\nconst _spawnStderrLoggerFn = (log, logLevelPatterns) => (chunk) => {\n  const line = chunk.toString();\n  const loglevel = _inferLogLevel(line, logLevelPatterns) || 'error';\n  log[loglevel]({ stderr: true, event: 'SPAWN_STDERR' }, line);\n};\n\nfunction _inferLogLevel(msg, patterns) {\n  if (_.isEmpty(patterns)) {\n    return;\n  }\n\n  const matchesRegex = (r) => r.test(msg);\n\n  return _.findKey(patterns, (regexps) => {\n    return regexps.some(matchesRegex);\n  });\n}\n\nfunction _logSpawnRetrying(logger, tryCount, lastError) {\n  if (tryCount > 1) {\n    logger.trace({ event: 'SPAWN_TRY_FAIL' }, lastError.stderr);\n  }\n}\n\nfunction _logSpawnCommand(logger, command, tryCount) {\n  const message = (_.isNumber(tryCount) && tryCount > 1 ? `(Retry #${tryCount - 1}) ${command}` : command);\n  logger.debug({ event: 'SPAWN_CMD' }, message);\n}\n\nmodule.exports = {\n  spawnAndLog,\n  spawnWithRetriesAndLogs,\n  interruptProcess,\n};\n"
  },
  {
    "path": "detox/src/utils/childProcess/spawn.test.js",
    "content": "// @ts-nocheck\n\njest.retryTimes(2);\n\ndescribe('Spawn utils', () => {\n  describe('spawning', () => {\n    let retry;\n    let log;\n    let cpp;\n    let spawn;\n    beforeEach(() => {\n      jest.mock('../logger');\n      log = require('../logger');\n\n      jest.mock('promisify-child-process');\n      cpp = require('promisify-child-process');\n\n      jest.mock('../retry');\n      retry = require('../retry');\n      retry.mockImplementation((opts, callback) => callback());\n\n      spawn = require('./spawn');\n\n      mockSpawnResult(0, {\n        pid: 2018,\n        stdout: toStream('hello'),\n        stderr: toStream('world')\n      });\n    });\n\n    const mockSpawnResult = (code, childProcess, reset = true) => {\n      if (reset) {\n        cpp.spawn.mockReset();\n      }\n\n      const cpPromise = Promise.resolve({ code });\n      cpp.spawn.mockReturnValueOnce(Object.assign(cpPromise, childProcess));\n    };\n\n    const advanceOpsCounter = (count) => {\n      const opsCounter = require('./opsCounter');\n      for (let i = 0; i < count; i++) opsCounter.inc();\n    };\n\n    describe.each([\n      ['spawnAndLog'],\n      ['spawnWithRetriesAndLogs']\n    ])('%s function', (func) => {\n      it('should spawn an attached command with ignored input and piped output', async () => {\n        const command = 'command';\n        const flags = ['--some', '--value', Math.random()];\n\n        await spawn[func](command, flags);\n\n        expect(cpp.spawn).toHaveBeenCalledWith(\n          command,\n          flags,\n          expect.objectContaining({\n            stdio: ['ignore', 'pipe', 'pipe']\n          })\n        );\n      });\n\n      it('should log spawn command upon child-process start and finish', async () => {\n        jest.spyOn(log, 'child');\n        await spawn[func]('mockCommand', []);\n\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_CMD' }), 'mockCommand');\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_END' }), 'mockCommand exited with code #0');\n      });\n\n      it('should collect output and log it', async () => {\n        await spawn[func]('mockCommand', []);\n        await nextCycle();\n\n        expect(log.trace).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_STDOUT', stdout: true }), 'hello');\n        expect(log.error).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_STDERR', stderr: true }), 'world');\n      });\n\n      it('should form and use a child-logger', async () => {\n        const trackingId = 7;\n        advanceOpsCounter(trackingId);\n\n        jest.spyOn(log, 'child');\n        await spawn[func]('mockCommand', []);\n\n        expect(log.child).toHaveBeenCalledWith(expect.objectContaining({ trackingId, command: 'mockCommand', fn: func }));\n        expect(log.child).toHaveBeenCalledWith(expect.objectContaining({ cpid: 2018 }));\n      });\n\n      it('should override log levels if configured', async () => {\n        jest.spyOn(log, 'child');\n        await spawn[func]('command', [], {\n          logLevelPatterns: {\n            debug: [/hello/],\n            warn: [/world/]\n          }\n        });\n\n        await nextCycle();\n\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_STDOUT' }), 'hello');\n        expect(log.warn).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_STDERR' }), 'world');\n      });\n\n      it('should not log output if silent: true', async () => {\n        await spawn[func]('mockCommand', [], { silent: true });\n        await nextCycle();\n\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_CMD' }), 'mockCommand');\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_END' }), 'mockCommand exited with code #0');\n        expect(log.trace).not.toHaveBeenCalledWith(\n          expect.objectContaining(expect.objectContaining({ event: 'SPAWN_STDOUT' })),\n          expect.any(String)\n        );\n        expect(log.error).not.toHaveBeenCalledWith(\n          expect.objectContaining(expect.objectContaining({ event: 'SPAWN_STDERR' })),\n          expect.any(String)\n        );\n      });\n\n      it('should log erroneously finished spawns', async () => {\n        mockSpawnResult(-2, {\n          pid: 8102,\n          stdout: toStream(''),\n          stderr: toStream('Some error.')\n        });\n\n        await spawn[func]('mockCommand', []).catch(() => {});\n        await nextCycle();\n\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_CMD' }), 'mockCommand');\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_END' }), 'mockCommand exited with code #-2');\n        expect(log.error).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_STDERR', stderr: true }), 'Some error.');\n      });\n\n      it('should log immediate spawn errors', async () => {\n        mockSpawnResult(undefined, {\n          pid: null,\n          exitCode: -2,\n          stdout: toStream(''),\n          stderr: toStream('Command `command` not found.')\n        });\n\n        await spawn[func]('command', []);\n        await nextCycle();\n\n        expect(log.debug).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_CMD' }), 'command');\n        expect(log.error).toHaveBeenCalledWith(expect.objectContaining({ event: 'SPAWN_ERROR' }), 'command failed with code = -2');\n        expect(log.error).toHaveBeenCalledWith(\n          expect.objectContaining({ event: 'SPAWN_STDERR', stderr: true }),\n          'Command `command` not found.'\n        );\n      });\n    });\n\n    describe('spawnWithRetriesAndLogs', () => {\n      const command = 'mockCommand';\n      const flags = ['--mock', 'flag'];\n\n      const spawnTryError = (stderr) => {\n        const tryError = new Error();\n        tryError.stderr = stderr;\n        return tryError;\n      };\n\n      it('should spawn an attached command with stderr capturing, by default', async () => {\n        await spawn.spawnWithRetriesAndLogs(command, flags);\n        expect(cpp.spawn).toHaveBeenCalledWith(\n          command,\n          flags,\n          expect.objectContaining({\n            capture: ['stderr']\n          })\n        );\n      });\n\n      it('should retry once, by default', async () => {\n        await spawn.spawnWithRetriesAndLogs(command, flags);\n        expect(retry).toHaveBeenCalledWith(expect.objectContaining({ retries: 1, interval: 100 }), expect.any(Function));\n      });\n\n      it('should log retry attempts', async () => {\n        const tryCount = 2;\n        const tryError = spawnTryError('std error dump');\n        retry.mockImplementation((opts, callback) => callback(tryCount, tryError));\n\n        await spawn.spawnWithRetriesAndLogs(command, flags);\n\n        expect(log.trace).toHaveBeenCalledWith({ event: 'SPAWN_TRY_FAIL' }, tryError.stderr);\n        expect(log.debug).toHaveBeenCalledWith({ event: 'SPAWN_CMD' }, expect.stringContaining('(Retry #1)'));\n      });\n\n      it('should not log the 1st try', async () => {\n        const tryCount = 1;\n        const tryError = undefined;\n        retry.mockImplementation((opts, callback) => callback(tryCount, tryError));\n\n        await spawn.spawnWithRetriesAndLogs(command, flags);\n\n        expect(log.trace).not.toHaveBeenCalledWith({ event: 'SPAWN_TRY_FAIL' }, expect.anything());\n      });\n\n      it('should honor retry options', async () => {\n        const retries = 456456;\n        const interval = 123123;\n        const backoff = 'linear';\n        await spawn.spawnWithRetriesAndLogs(command, flags, { retries, interval, backoff });\n        expect(retry).toHaveBeenCalledWith({ retries, interval, backoff }, expect.any(Function));\n      });\n\n      it('should honor output-capturing options, but force stderr', async () => {\n        await spawn.spawnWithRetriesAndLogs(command, flags, { capture: ['stdout'] });\n        expect(cpp.spawn).toHaveBeenCalledWith(\n          command,\n          flags,\n          expect.objectContaining({\n            capture: ['stdout', 'stderr']\n          })\n        );\n      });\n\n      it('should return result of last retry attempt', async () => {\n        mockSpawnResult(1, {\n          pid: 100,\n          exitCode: 1,\n          stderr: toStream('')\n        });\n        mockSpawnResult(0, {\n          pid: 101,\n          exitCode: 0,\n          stdout: toStream('okay great')\n        }, false);\n\n        retry.mockImplementation(async (_opts, callback) => {\n          await callback(1);\n          await callback(2, spawnTryError('mocked stderr'));\n        });\n\n        const result = await spawn.spawnWithRetriesAndLogs(command, flags);\n        expect(result).toEqual(\n          expect.objectContaining({\n            pid: 101,\n            exitCode: 0\n          })\n        );\n        expect(cpp.spawn).toHaveBeenCalledTimes(2);\n      });\n    });\n  });\n\n  describe('interruptProcess', () => {\n    jest.mock('../logger');\n    const { interruptProcess, spawnAndLog } = require('./spawn');\n\n    it('should interrupt a child process promise', async () => {\n      await interruptProcess(spawnAndLog('sleep', ['3']));\n    }, 500);\n\n    it('should throw exception if child process exited with an error', async () => {\n      const script = \"process.on('SIGINT', () => {});\" + 'setTimeout(()=>process.exit(1), 100);';\n\n      await interruptProcess(spawnAndLog('node', ['-e', script]));\n    }, 1000);\n\n    it('should SIGTERM a stuck process after specified time', async () => {\n      const script = \"process.on('SIGINT', () => {});\" + 'setTimeout(()=>process.exit(1), 10000);';\n\n      const theProcess = spawnAndLog('node', ['-e', script]);\n      await interruptProcess(theProcess, {\n        SIGTERM: 500\n      });\n    }, 1000);\n  });\n});\n\nfunction nextCycle() {\n  return new Promise((resolve) => setTimeout(resolve));\n}\n\nfunction toStream(string) {\n  const { Readable } = require('stream');\n  const stream = new Readable();\n  stream._read = () => {};\n  stream.push(string);\n  stream.push(null);\n  return stream;\n}\n"
  },
  {
    "path": "detox/src/utils/constructSafeFilename.js",
    "content": "const sanitize = require('sanitize-filename');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\nconst MAX_FILE_LENGTH = 255;\n\nconst sanitizeOptions = {\n  replacement: '_',\n};\n\n/*\n  Escape filename and trim it to match filesystem limits (usually, not longer than 255 chars)\n */\nfunction constructSafeFilename(prefix = '', trimmable = '', suffix = '') {\n  if (!trimmable) {\n    throw new DetoxRuntimeError({\n      message: 'no trimmable filename was given to constructSafeFilename(prefix, trimmable, suffix)',\n      debugInfo: 'the arguments were: ' + JSON.stringify({\n        prefix,\n        trimmable,\n        suffix,\n      }, null, 2),\n    });\n  }\n\n  const nonTrimmableLength = prefix.length + suffix.length;\n\n  if (nonTrimmableLength >= MAX_FILE_LENGTH) {\n    throw new DetoxRuntimeError({\n      message: `cannot trim filename to match filesystem limits because prefix and/or suffix are exceed ${MAX_FILE_LENGTH} chars limit`,\n      debugInfo: JSON.stringify({\n        prefix,\n        prefixLength: prefix.length,\n        trimmable,\n        trimmableLength: trimmable.length,\n        suffix,\n        suffixLength: suffix.length,\n        nonTrimmableLength,\n      }, null, 2),\n    });\n  }\n\n  const trimmed = trimmable.slice(-MAX_FILE_LENGTH + nonTrimmableLength);\n  const unsafe = prefix + trimmed + suffix;\n  const sanitized = sanitize(unsafe, sanitizeOptions)\n    .replace(/\\$/g, sanitizeOptions.replacement);\n\n  return sanitized;\n}\n\nmodule.exports = constructSafeFilename;\n"
  },
  {
    "path": "detox/src/utils/constructSafeFilename.test.js",
    "content": "const constructSafeFilename = require('./constructSafeFilename');\n\ndescribe('constructSafeFilename', () => {\n  it('should throw if no arguments passed', () => {\n    let prefix, name, suffix;\n\n    expect(() => constructSafeFilename())\n      .toThrow();\n    expect(() => constructSafeFilename(prefix, name, suffix))\n      .toThrow();\n  });\n\n  it('should trim filename to 255 chars', () => {\n    const actual = constructSafeFilename('', '1'.repeat(256), '');\n    const expected = '1'.repeat(255);\n\n    expect(actual).toBe(expected);\n  });\n\n  it('should add non-trimmable prefix to filename', () => {\n    const actual = constructSafeFilename('0'.repeat(55), '1'.repeat(201));\n    const expected = '0'.repeat(55) + '1'.repeat(200);\n\n    expect(actual).toBe(expected);\n  });\n\n  it('should add non-trimmable prefix and suffix to filename', () => {\n    const actual = constructSafeFilename('0'.repeat(55), '1'.repeat(101), '2'.repeat(100));\n    const expected = '0'.repeat(55) + '1'.repeat(100) + '2'.repeat(100);\n\n    expect(actual).toBe(expected);\n  });\n\n  it('should replace $ with _', () => {\n    const actual = constructSafeFilename('', '1$2', '');\n    const expected = '1_2';\n    expect(actual).toBe(expected);\n  });\n\n  it('should throw exception when non-trimmable prefix and suffix occupy too much space', () => {\n    expect(() => constructSafeFilename('0'.repeat(127), '1', '2'.repeat(128))).toThrow();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/dateUtils.js",
    "content": "// This is technically a super-lightweight lib to format date/time (which\n// seems to be an issue in JS...). In case more advanced techniques are ever\n// needed, dateFormat v4.5.1 may come in handy as a drop-in replacement.\n\nfunction shortFormat(date) {\n  const HH = date.getHours().toString().padStart(2, '0');\n  const MM = date.getMinutes().toString().padStart(2, '0');\n  const ss = date.getSeconds().toString().padStart(2, '0');\n  const milli = date.getMilliseconds().toString().padStart(3, '0');\n  return `${HH}:${MM}:${ss}.${milli}`;\n}\n\nfunction removeMilliseconds(isoDate) {\n  return isoDate.replace(/(T\\d\\d:\\d\\d:\\d\\d)(\\.\\d\\d\\d)/, '$1');\n}\n\nmodule.exports = {\n  shortFormat,\n  removeMilliseconds,\n};\n"
  },
  {
    "path": "detox/src/utils/dateUtils.test.js",
    "content": "describe('Date/time utils', () => {\n  let dateUtils;\n  beforeEach(() => {\n    dateUtils = require('./dateUtils');\n  });\n\n  describe('\"short\" formatter', () => {\n    it('should return an HH:MM:SS.l format', () => {\n      const moonLanding = new Date('July 20, 69 20:17:59.123');\n      expect(dateUtils.shortFormat(moonLanding)).toEqual('20:17:59.123');\n    });\n\n    it('should 1-pad all-around', () => {\n      const date = new Date('January 1, 2000 1:2:3.004');\n      expect(dateUtils.shortFormat(date)).toEqual('01:02:03.004');\n    });\n\n    it('should 2- or 3-pad all-around', () => {\n      const date = new Date('January 1, 2000 0:0:0');\n      expect(dateUtils.shortFormat(date)).toEqual('00:00:00.000');\n    });\n  });\n\n  describe('removeMilliseconds', () => {\n    it('should remove milliseconds for zero timezone', () => {\n      const isoDate = '2019-02-06T14:10:05.000Z';\n      expect(dateUtils.removeMilliseconds(isoDate)).toBe('2019-02-06T14:10:05Z');\n    });\n\n    it('should remove milliseconds for specific timezone', () => {\n      const isoDate = '2019-02-06T21:23:45.000-10:00';\n      expect(dateUtils.removeMilliseconds(isoDate)).toBe('2019-02-06T21:23:45-10:00');\n    });\n\n    it('should not affect a correct string', () => {\n      const isoDate = '2019-02-06T14:12:34+00:00';\n      expect(dateUtils.removeMilliseconds(isoDate)).toBe(isoDate);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/debug.js",
    "content": "const _sleep = require('./sleep');\n\nclass Debug {\n  async sleep(ms) {\n    await _sleep(ms);\n  }\n}\n\nmodule.exports = new Debug();\n"
  },
  {
    "path": "detox/src/utils/encoding.js",
    "content": "function encodeBase64(stringUTF8) {\n  return Buffer.from(stringUTF8, 'utf8').toString('base64');\n}\n\nfunction decodeBase64(stringBase64) {\n  return Buffer.from(stringBase64, 'base64').toString('utf8');\n}\n\nmodule.exports = {\n  encodeBase64,\n  decodeBase64,\n};\n"
  },
  {
    "path": "detox/src/utils/encoding.test.js",
    "content": "describe('Base 64 util', () => {\n  const utf8Text = 'Lorem ipsum dolor sit amet,\\nconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';\n  const base64Text = 'TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsCmNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEu';\n\n  let uut;\n  beforeEach(() => {\n    uut = require('./encoding');\n  });\n\n  it('should base-64 encode', () => {\n    expect(uut.encodeBase64(utf8Text)).toEqual(base64Text);\n  });\n\n  it('should decode base-64', () => {\n    expect(uut.decodeBase64(base64Text)).toEqual(utf8Text);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/envUtils.js",
    "content": "const path = require('path');\n\nfunction printEnvironmentVariables(envObject) {\n  return Object.entries(envObject).reduce((cli, [key, value]) => {\n    if (value == null || value === '') {\n      return cli;\n    }\n\n    return `${cli}${key}=${JSON.stringify(value)} `;\n  }, '');\n}\n\nfunction prependNodeModulesBinToPATH(env) {\n  const PATH = Object.keys(env).find(key => `${key.toUpperCase()}` === 'PATH');\n  if (!PATH) {\n    return;\n  }\n\n  const nodeBinariesPath = path.dirname(process.argv[1]) + path.delimiter;\n  if (!env[PATH].startsWith(nodeBinariesPath)) {\n    env[PATH] = nodeBinariesPath + env[PATH];\n  }\n\n  return env[PATH];\n}\n\nmodule.exports = {\n  printEnvironmentVariables,\n  prependNodeModulesBinToPATH,\n};\n"
  },
  {
    "path": "detox/src/utils/envUtils.test.js",
    "content": "const path = require('path');\n\nconst envUtils = require('./envUtils');\n\ndescribe('envUtils', () => {\n  describe('printEnvironmentVariables', () => {\n    it('should print environment variables', () => {\n      const env = { A: 1, B: '2', C: null, D: '' };\n      expect(envUtils.printEnvironmentVariables(env)).toBe('A=1 B=\"2\" ');\n    });\n  });\n\n  describe('prependNodeModulesBinToPATH', () => {\n    it('should not mutate the env object if PATH does not exist', () => {\n      const env = {};\n      envUtils.prependNodeModulesBinToPATH(env);\n      expect(env).toEqual({});\n    });\n\n    it('should prepend node modules bin to PATH and return that value', () => {\n      const env = { pAtH: ['/usr/bin', '/bin'].join(path.delimiter) };\n      const resultingPath = envUtils.prependNodeModulesBinToPATH(env);\n\n      expect(env.pAtH.split(path.delimiter)).toEqual([\n        expect.stringMatching(/.*node_modules.*/),\n        '/usr/bin',\n        '/bin',\n      ]);\n\n      expect(resultingPath).toBe(env.pAtH);\n    });\n\n    it('should not prepend node modules bin to PATH twice', () => {\n      const env = { PATH: '/usr/bin:/bin' };\n\n      envUtils.prependNodeModulesBinToPATH(env);\n      envUtils.prependNodeModulesBinToPATH(env);\n\n      expect(env.PATH.split(':').length).toBe(3);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/environment.js",
    "content": "const crypto = require('crypto');\nconst fs = require('fs');\nconst os = require('os');\nconst path = require('path');\n\nconst ini = require('ini');\nconst _ = require('lodash');\nconst _which = require('which');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nconst appdatapath = require('./appdatapath');\nconst { execAsync } = require('./childProcess');\nconst fsext = require('./fsext');\n\nfunction which(executable, path) {\n  return _which.sync(executable, { path, nothrow: true });\n}\n\nconst DETOX_LIBRARY_ROOT_PATH = path.join(appdatapath.appDataPath(), 'Detox');\nconst MISSING_SDK_ERROR = `$ANDROID_SDK_ROOT is not defined, set the path to the SDK installation directory into $ANDROID_SDK_ROOT,\nGo to https://developer.android.com/studio/command-line/variables.html for more details`;\nconst DETOX_APPS_CACHE_PATH = path.join(DETOX_LIBRARY_ROOT_PATH, 'apps-cache');\nconst DETOX_LOCK_FILE_PATH = path.join(DETOX_LIBRARY_ROOT_PATH, 'global-context.json');\nconst DEVICE_REGISTRY_PATH = path.join(DETOX_LIBRARY_ROOT_PATH, 'device.registry.json');\nconst LAST_FAILED_TESTS_PATH = path.join(DETOX_LIBRARY_ROOT_PATH, 'last-failed.txt');\n\nfunction getAndroidSDKPath() {\n  return process.env.ANDROID_SDK_ROOT || process.env.ANDROID_HOME || '';\n}\n\nfunction getAndroidSDKHome() {\n  return process.env['ANDROID_SDK_HOME'] || os.homedir();\n}\n\nfunction getEmulatorHome() {\n  return process.env['ANDROID_EMULATOR_HOME'] || path.join(getAndroidSDKHome(), '.android');\n}\n\nfunction getAvdHome() {\n  return process.env['ANDROID_AVD_HOME'] || path.join(getEmulatorHome(), 'avd');\n}\n\nfunction getAvdDir(avdName) {\n  const avdIniPath = path.join(getAvdHome(), `${avdName}.ini`);\n  if (!fs.existsSync(avdIniPath)) {\n    throwMissingAvdINIError(avdName, avdIniPath);\n  }\n\n  const avdIni = ini.parse(fs.readFileSync(avdIniPath, 'utf-8'));\n  if (!fs.existsSync(avdIni.path)) {\n    throwMissingAvdError(avdName, avdIni.path, avdIniPath);\n  }\n\n  return avdIni.path;\n}\n\nfunction getAvdManagerPath() {\n  return path.join(getAndroidSDKPath(), 'cmdline-tools', 'latest', 'bin', 'avdmanager');\n}\n\nfunction getAndroidSdkManagerPath() {\n  return path.join(getAndroidSDKPath(), 'cmdline-tools', 'latest', 'bin', 'sdkmanager');\n}\n\nfunction getAndroidEmulatorPath() {\n  const sdkRoot = getAndroidSDKPath();\n  if (!sdkRoot) {\n    return which('emulator') || throwMissingSdkError();\n  }\n\n  const defaultPath = which('emulator', path.join(sdkRoot, 'emulator'));\n  if (defaultPath) {\n    return defaultPath;\n  }\n\n  const legacyPath = which('emulator', path.join(sdkRoot, 'tools'));\n  if (legacyPath) {\n    return legacyPath;\n  }\n\n  throwSdkBinIntegrityError(sdkRoot, 'emulator/emulator');\n}\n\nasync function getAaptPath() {\n  const sdkRoot = getAndroidSDKPath();\n  if (!sdkRoot) {\n    return which('aapt') || throwMissingSdkError();\n  }\n\n  const latestBuildTools = await getLatestBuildToolsPath(sdkRoot);\n  if (!latestBuildTools) {\n    throwSdkIntegrityError('Failed to find the \"aapt\" tool under the Android SDK: No build-tools are installed!');\n  }\n\n  const defaultPath = which('aapt', latestBuildTools);\n  if (defaultPath) {\n    return defaultPath;\n  }\n\n  throwSdkToolPathError(`${latestBuildTools}/aapt`);\n}\n\nasync function getLatestBuildToolsPath(sdkRoot) {\n  if (!sdkRoot) {\n    return '';\n  }\n\n  const buildToolsDir = path.join(sdkRoot, 'build-tools');\n  if (!fs.existsSync(buildToolsDir)) {\n    return '';\n  }\n\n  const buildToolsVersions = await fsext.getDirectories(buildToolsDir);\n  const latestBuildToolsVersion = _.last(buildToolsVersions);\n  if (!latestBuildToolsVersion) {\n    return '';\n  }\n\n  return path.join(buildToolsDir, latestBuildToolsVersion);\n}\n\nfunction getAdbPath() {\n  const sdkRoot = getAndroidSDKPath();\n  if (!sdkRoot) {\n    return which('adb') || throwMissingSdkError();\n  }\n\n  const defaultPath = which('adb', path.join(sdkRoot, 'platform-tools'));\n  if (defaultPath) {\n    return defaultPath;\n  }\n\n  throwSdkBinIntegrityError(sdkRoot, 'platform-tools/adb');\n}\n\nfunction getGmsaasPath() {\n  return which('gmsaas') || throwMissingGmsaasError();\n}\n\nfunction throwMissingSdkError() {\n  throw new DetoxRuntimeError(MISSING_SDK_ERROR);\n}\n\nfunction throwMissingAvdINIError(avdName, avdIniPath) {\n  throw new DetoxRuntimeError(`Failed to find INI file for ${avdName} at path: ${avdIniPath}`);\n}\n\nfunction throwMissingAvdError(avdName, avdPath, avdIniPath) {\n  throw new DetoxRuntimeError(\n    `Failed to find AVD ${avdName} directory at path: ${avdPath}\\n` + `Please verify \"path\" property in the INI file: ${avdIniPath}`\n  );\n}\n\nfunction throwSdkBinIntegrityError(sdkRoot, relativeBinPath) {\n  const executablePath = path.join(sdkRoot, relativeBinPath);\n  throwSdkToolPathError(executablePath);\n}\n\nfunction throwSdkToolPathError(sdkToolPath) {\n  const name = path.basename(sdkToolPath);\n  const dir = path.dirname(sdkToolPath);\n\n  throwSdkIntegrityError(`There was no \"${name}\" executable file in directory: ${dir}`);\n}\n\nfunction throwSdkIntegrityError(errMessage) {\n  throw new DetoxRuntimeError(`${errMessage}\\nCheck the integrity of your Android SDK.`);\n}\n\nfunction throwMissingGmsaasError() {\n  throw new DetoxRuntimeError(\n    `Failed to locate Genymotion's gmsaas executable. Please add it to your $PATH variable!\\nPATH is currently set to: ${process.env.PATH}`\n  );\n}\n\nconst getDetoxVersion = _.once(() => {\n  return require(path.join(__dirname, '../../package.json')).version;\n});\n\nconst getAppleSimUtilsVersion = _.once(async () => {\n  const command = `applesimutils --version`;\n  const output = await execAsync(command);\n  const match = output.match(/(\\d+\\.\\d+\\.\\d+)$/);\n  return match ? match[1] : '0.0.0';\n});\n\nconst getBuildFolderName = _.once(async () => {\n  const detoxVersion = getDetoxVersion();\n  const xcodeVersion = await execAsync('xcodebuild -version');\n\n  return crypto.createHash('sha1').update(`${detoxVersion}\\n${xcodeVersion}\\n`).digest('hex');\n});\n\nconst getFrameworkDirPath = `${DETOX_LIBRARY_ROOT_PATH}/ios/framework`;\n\nconst getFrameworkPath = _.once(async () => {\n  const buildFolder = await getBuildFolderName();\n  return `${getFrameworkDirPath}/${buildFolder}/Detox.framework`;\n});\n\nconst getXCUITestRunnerDirPath = `${DETOX_LIBRARY_ROOT_PATH}/ios/xcuitest-runner`;\n\nconst getXCUITestRunnerPath = _.once(async () => {\n  const buildFolder = await getBuildFolderName();\n  const derivedDataPath = `${getXCUITestRunnerDirPath}/${buildFolder}`;\n  const command = `find ${derivedDataPath} -name \"*.xctestrun\" -print -quit`;\n  const xctestrunPath = await execAsync(command);\n\n  if (!xctestrunPath) {\n    throw new DetoxRuntimeError(`Failed to find .xctestrun file in ${derivedDataPath}`);\n  }\n\n  return xctestrunPath;\n});\n\nfunction getDetoxLibraryRootPath() {\n  return DETOX_LIBRARY_ROOT_PATH;\n}\n\nfunction getDetoxAppsCachePath(udid, bundleId) {\n  if (udid && bundleId) {\n    return path.join(DETOX_APPS_CACHE_PATH, udid, bundleId);\n  } else if (udid) {\n    return path.join(DETOX_APPS_CACHE_PATH, udid);\n  } else {\n    return DETOX_APPS_CACHE_PATH;\n  }\n}\n\nfunction getDetoxLockFilePath() {\n  return DETOX_LOCK_FILE_PATH;\n}\n\nfunction getDeviceRegistryPath() {\n  return DEVICE_REGISTRY_PATH;\n}\n\nfunction getLastFailedTestsPath() {\n  return LAST_FAILED_TESTS_PATH;\n}\n\nfunction getHomeDir() {\n  return os.homedir();\n}\n\nmodule.exports = {\n  getAaptPath,\n  getAdbPath,\n  getAvdHome,\n  getAvdDir,\n  getAvdManagerPath,\n  getAppleSimUtilsVersion,\n  getAndroidSdkManagerPath,\n  getGmsaasPath,\n  getDetoxVersion,\n  getFrameworkDirPath,\n  getFrameworkPath,\n  getXCUITestRunnerDirPath,\n  getXCUITestRunnerPath,\n  getAndroidSDKPath,\n  getAndroidEmulatorPath,\n  getDetoxAppsCachePath,\n  getDetoxLibraryRootPath,\n  getDetoxLockFilePath,\n  getDeviceRegistryPath,\n  getLastFailedTestsPath,\n  getHomeDir\n};\n"
  },
  {
    "path": "detox/src/utils/environment.test.js",
    "content": "const os = require('os');\nconst path = require('path');\n\nconst fs = require('fs-extra');\nconst _ = require('lodash');\n\nconst tempfile = require('./tempfile');\n\ndescribe('Environment', () => {\n  let Environment;\n  let originalProcessEnv = _.cloneDeep(process.env);\n\n  beforeEach(() => {\n    process.env = _.cloneDeep(originalProcessEnv);\n    Environment = require('./environment');\n  });\n\n  afterAll(() => {\n    process.env = originalProcessEnv;\n  });\n\n  describe('(android)', () => {\n    let tempSdkPath;\n\n    async function genExec(relativePath) {\n      const extension = (os.platform() === 'win32') ? '.cmd' : '';\n      const filePath = path.join(tempSdkPath, relativePath) + extension;\n\n      await fs.ensureFile(filePath);\n      await fs.chmod(filePath, 0o755);\n    }\n\n    beforeEach(async () => {\n      tempSdkPath = tempfile();\n      await fs.mkdirp(tempSdkPath);\n    });\n\n    afterEach(async () => {\n      await fs.remove(tempSdkPath);\n    });\n\n    describe('getAvdHome', () => {\n      const testCases = [\n        [path.join(os.homedir(), '.android', 'avd'), null, null, null],\n        [path.join('homedir', '.android', 'avd'), null, null, 'homedir'],\n        [path.join('emu', 'avd'), null, 'emu', 'homedir'],\n        ['AVD', 'AVD', 'emu', 'homedir'],\n      ];\n\n      it.each(testCases)('should return %j ' + [\n        'if $ANDROID_AVD_HOME = %j',\n        'if $ANDROID_EMULATOR_HOME = %j',\n        'if $ANDROID_SDK_HOME = %j',\n      ].join(' and '), (...args) => {\n\n        process.env['ANDROID_AVD_HOME'] = args[1];\n        process.env['ANDROID_EMULATOR_HOME'] = args[2];\n        process.env['ANDROID_SDK_HOME'] = args[3];\n\n        expect(Environment.getAvdHome()).toBe(args[0]);\n      });\n    });\n\n    describe('getAvdDir', () => {\n      let avdHome;\n\n      beforeEach(async () => {\n        avdHome = process.env['ANDROID_AVD_HOME'] = tempfile();\n        await fs.mkdir(avdHome);\n      });\n\n      afterEach(async () => {\n        await fs.remove(avdHome);\n      });\n\n      it('should throw error if ${avdHome}/${avdName}.ini does not exist', () => {\n        expect(() => Environment.getAvdDir('nonExistent')).toThrow(/Failed.*INI.*at path:/);\n      });\n\n      it('should throw error if path specified in INI file does not exist', () => {\n        fs.writeFileSync(path.join(avdHome, 'MyAVD.ini'), `path=randomPath${Math.random()}`);\n        expect(() => Environment.getAvdDir('MyAVD')).toThrow(/Failed to find.*randomPath0\\./);\n      });\n\n      it('should return path specified in INI file if it exists', () => {\n        fs.writeFileSync(path.join(avdHome, 'MyAVD.ini'), `path=${avdHome}`);\n        expect(Environment.getAvdDir('MyAVD')).toBe(avdHome);\n      });\n    });\n\n    describe('getAndroidSDKPath', () => {\n      it(`should return empty string if $ANDROID_SDK_ROOT and $ANDROID_HOME both are not set`, () => {\n        delete process.env.ANDROID_SDK_ROOT;\n        delete process.env.ANDROID_HOME;\n\n        const sdkPath = Environment.getAndroidSDKPath();\n        expect(sdkPath).toBe('');\n      });\n\n      it(`should return $ANDROID_HOME if it is set`, () => {\n        delete process.env.ANDROID_SDK_ROOT;\n        process.env.ANDROID_HOME = path.normalize('path/to/android/home');\n\n        const sdkPath = Environment.getAndroidSDKPath();\n        expect(sdkPath).toBe(process.env.ANDROID_HOME);\n      });\n\n      it(`should return $ANDROID_SDK_ROOT if it is set`, () => {\n        delete process.env.ANDROID_HOME;\n        process.env.ANDROID_SDK_ROOT = path.normalize('path/to/sdk/root');\n\n        const sdkPath = Environment.getAndroidSDKPath();\n        expect(sdkPath).toBe(process.env.ANDROID_SDK_ROOT);\n      });\n\n      it(`should prefer $ANDROID_SDK_ROOT, if both $ANDROID_SDK_ROOT and $ANDROID_HOME are set`, () => {\n        process.env.ANDROID_SDK_ROOT = path.normalize('path/to/sdk/root');\n        process.env.ANDROID_HOME = path.normalize('path/to/android/home');\n\n        const sdkPath = Environment.getAndroidSDKPath();\n        expect(sdkPath).toBe(process.env.ANDROID_SDK_ROOT);\n      });\n    });\n\n    describe('getAvdManagerPath', () => {\n      it('should return path to AVD-manager executable', () => {\n        process.env.ANDROID_SDK_ROOT = path.normalize('mock/path/to/sdk');\n\n        const avdManagerPath = Environment.getAvdManagerPath();\n        expect(avdManagerPath).toBe(path.join(process.env.ANDROID_SDK_ROOT, 'cmdline-tools/latest/bin/avdmanager'));\n      });\n\n      it('should fall back to using ANDROID_HOME instead of ANDROID_SDK_ROOT', () => {\n        delete process.env.ANDROID_SDK_ROOT;\n        process.env.ANDROID_HOME = path.normalize('mock/path/to/sdk');\n\n        const avdManagerPath = Environment.getAvdManagerPath();\n        expect(avdManagerPath).toBe(path.join(process.env.ANDROID_HOME, 'cmdline-tools/latest/bin/avdmanager'));\n      });\n    });\n\n    describe('getAndroidSdkManagerPath', () => {\n      it('should return path to SDK-manager executable', () => {\n        process.env.ANDROID_SDK_ROOT = path.normalize('mock/path/to/sdk');\n\n        const sdkManagerPath = Environment.getAndroidSdkManagerPath();\n        expect(sdkManagerPath).toBe(path.join(process.env.ANDROID_SDK_ROOT, 'cmdline-tools/latest/bin/sdkmanager'));\n      });\n\n      it('should fall back to using ANDROID_HOME instead of ANDROID_SDK_ROOT', () => {\n        delete process.env.ANDROID_SDK_ROOT;\n        process.env.ANDROID_HOME = path.normalize('mock/path/to/sdk');\n\n        const sdkManagerPath = Environment.getAndroidSdkManagerPath();\n        expect(sdkManagerPath).toBe(path.join(process.env.ANDROID_HOME, 'cmdline-tools/latest/bin/sdkmanager'));\n      });\n    });\n\n    describe('getAndroidEmulatorPath', () => {\n      describe('if $ANDROID_SDK_ROOT is set', () => {\n        beforeEach(() => {\n          process.env.ANDROID_SDK_ROOT = tempSdkPath;\n        });\n\n        it('should return emulator if it is in $ANDROID_SDK_ROOT/emulator dir', async () => {\n          await genExec('emulator/emulator');\n          expect(Environment.getAndroidEmulatorPath()).toMatch(/.emulator.emulator/);\n        });\n\n        it('should return emulator if it is in $ANDROID_SDK_ROOT/tools dir', async () => {\n          await genExec('tools/emulator');\n          expect(Environment.getAndroidEmulatorPath()).toMatch(/.tools.emulator/);\n        });\n\n        it('should prefer $ANDROID_SDK_ROOT/emulator over $ANDROID_SDK_ROOT/tools', async () => {\n          await genExec('tools/emulator');\n          await genExec('emulator/emulator');\n\n          expect(Environment.getAndroidEmulatorPath()).toMatch(/.emulator.emulator/);\n        });\n\n        it('should throw error if there are no executables at those locations', async () => {\n          expect(Environment.getAndroidEmulatorPath).toThrow(/There was no.*file in directory:/);\n        });\n      });\n\n      ifAndroidSdkRootAndHomeAreNotSet(() => {\n        itShouldFallBackToPathResolution(() => Environment.getAndroidEmulatorPath(), 'emulator');\n        itShouldThrowErrorIfThereAreNoExecutables(() => Environment.getAndroidEmulatorPath());\n      });\n    });\n\n    describe('getAaptPath', () => {\n      describe('if $ANDROID_SDK_ROOT is set', () => {\n        beforeEach(() => {\n          process.env.ANDROID_SDK_ROOT = tempSdkPath;\n        });\n\n        it('should return aapt from build-tools/<latest>', async () => {\n          await genExec('build-tools/19.0.0/aapt');\n          await genExec('build-tools/20.0.0/aapt');\n\n          expect(await Environment.getAaptPath()).toMatch(/.build-tools.20.0.0.aapt/);\n        });\n\n        it('should throw error if aapt is missing inside (a valid) build-tools/<sdk-version> directory', async () => {\n          const validBuildToolsPath = 'build-tools/20.0.0';\n          const expectedErrPath = path.join(tempSdkPath, validBuildToolsPath);\n\n          await genExec(`${validBuildToolsPath}/not-aapt`);\n          await expect(Environment.getAaptPath()).rejects.toThrow(`There was no \"aapt\" executable file in directory: ${expectedErrPath}`);\n        });\n\n        it('should throw error if there are no inner <sdk-version> directories where aapt could reside', async () => {\n          await genExec('build-tools/dummy');\n          await expect(Environment.getAaptPath()).rejects.toThrow('Failed to find the \"aapt\" tool under the Android SDK: No build-tools are installed!');\n        });\n      });\n\n      ifAndroidSdkRootAndHomeAreNotSet(() => {\n        itShouldFallBackToPathResolution(() => Environment.getAaptPath(), 'aapt');\n        itShouldThrowErrorIfThereAreNoExecutables(() => Environment.getAaptPath());\n      });\n    });\n\n    describe('getAdbPath', () => {\n      describe('if $ANDROID_SDK_ROOT is set', () => {\n        beforeEach(() => {\n          process.env.ANDROID_SDK_ROOT = tempSdkPath;\n        });\n\n        it('should return adb from platform-tools', async () => {\n          await genExec('platform-tools/adb');\n          expect(Environment.getAdbPath()).toMatch(/.platform-tools.adb/);\n        });\n\n        it('should throw error if adb is not found in platform-tools/', async () => {\n          const expectedErrPath = path.join(tempSdkPath, 'platform-tools');\n\n          expect(() => Environment.getAdbPath()).toThrow(`There was no \"adb\" executable file in directory: ${expectedErrPath}`);\n        });\n      });\n\n      ifAndroidSdkRootAndHomeAreNotSet(() => {\n        itShouldFallBackToPathResolution(() => Environment.getAdbPath(), 'adb');\n        itShouldThrowErrorIfThereAreNoExecutables(() => Environment.getAdbPath());\n      });\n    });\n\n    function ifAndroidSdkRootAndHomeAreNotSet(fn) {\n      describe('if $ANDROID_SDK_ROOT and $ANDROID_HOME are not set', () => {\n        beforeEach(() => {\n          delete process.env.ANDROID_SDK_ROOT;\n          delete process.env.ANDROID_HOME;\n        });\n\n        fn();\n      });\n    }\n\n    function itShouldFallBackToPathResolution(getter, executable) {\n        it('should fall back to $PATH resolution', async () => {\n          process.env.PATH = path.join(tempSdkPath, 'somewhere');\n          await genExec(`somewhere/${executable}`);\n          expect(await getter()).toMatch(new RegExp(`somewhere.${executable}`));\n        });\n    }\n\n    function itShouldThrowErrorIfThereAreNoExecutables(getter) {\n      const asyncGetter = async () => getter();\n\n      it('should throw error if there are no executables on $PATH', async () => {\n        delete process.env.PATH;\n        await expect(asyncGetter()).rejects.toThrow(/\\$ANDROID_SDK_ROOT is not defined/);\n      });\n    }\n\n    describe('Genymotion SaaS executable - getGmsaasPath', () => {\n      it('should resolve based on $PATH', async () => {\n        const executable = 'gmsaas';\n        process.env.PATH = path.join(tempSdkPath, 'somewhere');\n        await genExec(`somewhere/${executable}`);\n        expect(Environment.getGmsaasPath()).toMatch(path.join(tempSdkPath, `somewhere/${executable}`));\n      });\n\n      it('should throw error if gmsaas is not in $PATH', async () => {\n        const pathToNowhere = path.join('one', 'mock', 'directory');\n        process.env.PATH = pathToNowhere;\n        await expect(async () => Environment.getGmsaasPath()).rejects.toThrow(`Failed to locate Genymotion's gmsaas executable. Please add it to your $PATH variable!\\nPATH is currently set to: ${pathToNowhere}`);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/errorUtils.js",
    "content": "const { isError } = require('lodash');\nconst { deserializeError, serializeError } = require('serialize-error');\n\nconst CLEAN_AT = /\\n\\s*at [\\s\\S]*/m;\n\nfunction filterErrorStack(error, predicate) {\n  const stackLines = (error.stack || '').split('\\n');\n  const resultLines = [];\n  for (const line of stackLines) {\n    if (line.trimLeft().startsWith('at') && !predicate(line)) {\n      continue;\n    }\n\n    resultLines.push(line);\n  }\n  error.stack = resultLines.join('\\n');\n  return error;\n}\n\nfunction replaceErrorStack(source, target) {\n  const sourceStack = (source.stack || '');\n  const sourceMessage = sourceStack.replace(CLEAN_AT, '');\n  const actualSourceStack = sourceStack.slice(sourceMessage.length);\n\n  const targetMessage = target.message || target.stack.replace(CLEAN_AT, '');\n\n  target.stack = targetMessage + actualSourceStack;\n  return target;\n}\n\nfunction isInternalStackLine(line) {\n  return line.indexOf('/detox/src/') === -1;\n}\n\nfunction createErrorWithUserStack() {\n  return filterErrorStack(new Error(), isInternalStackLine);\n}\n\nfunction asError(error) {\n  return isError(error) ? error : new Error(error);\n}\n\nfunction serializeObjectWithError(obj, errorKey = 'error') {\n  if (obj[errorKey] instanceof Error) {\n    return { ...obj, [errorKey]: serializeError(obj[errorKey]) };\n  }\n\n  return obj;\n}\n\nfunction deserializeObjectWithError(obj, errorKey = 'error') {\n  if (typeof obj[errorKey] === 'object' && !(obj[errorKey] instanceof Error)) {\n    return { ...obj, [errorKey]: deserializeError(obj[errorKey]) };\n  }\n\n  return obj;\n}\n\nmodule.exports = {\n  asError,\n  replaceErrorStack,\n  filterErrorStack,\n  createErrorWithUserStack,\n  serializeObjectWithError,\n  deserializeObjectWithError,\n};\n"
  },
  {
    "path": "detox/src/utils/errorUtils.test.js",
    "content": "const _ = require('lodash');\n\nconst errorUtils = require('./errorUtils');\n\ndescribe('sliceErrorStack(error, fromIndex)', () => {\n  it('should clean up error stack by N first lines containing at:', () => {\n    function innerFunction() { throw new Error('Source Error'); }\n    function outerFunction() { innerFunction(); }\n    function attemptFunction() {\n      try { outerFunction(); } catch (e) { return e; }\n    }\n\n    const slicer = at => (_line) => --at < 0;\n    const error0 = errorUtils.filterErrorStack(attemptFunction(), slicer(1));\n    const error2 = errorUtils.filterErrorStack(attemptFunction(), slicer(2));\n    const error3 = errorUtils.filterErrorStack(attemptFunction(), slicer(3));\n    expect(error0.stack).toMatch(/at innerFunction/);\n    expect(error0.stack).toMatch(/at outerFunction/);\n    expect(error2.stack).not.toMatch(/at innerFunction/);\n    expect(error2.stack).toMatch(/at outerFunction/);\n    expect(error3.stack).not.toMatch(/at innerFunction/);\n    expect(error3.stack).not.toMatch(/at outerFunction/);\n  });\n\n  it('should not fail if an error stack is empty', () => {\n    const err = new Error();\n    delete err.stack;\n\n    errorUtils.filterErrorStack(err, () => true);\n    expect(err.stack).toBe('');\n  });\n});\n\ndescribe('replaceErrorStack(source, target)', () => {\n\n  function sourceFunction() { throw new Error('Source Error message'); }\n  function targetFunction() { throw new Error('Target Error message'); }\n  function targetFunction2() { throw new Error(); }\n\n  it('should return the target error', () => {\n    const source = _.attempt(sourceFunction);\n    const target = _.attempt(targetFunction);\n    expect(errorUtils.replaceErrorStack(source, target)).toBe(target);\n  });\n\n  it('should replace error stack in the target error using the source error', () => {\n    const source = _.attempt(sourceFunction);\n    const target = _.attempt(targetFunction);\n\n    errorUtils.replaceErrorStack(source, target);\n    expect(target.stack).toMatch(/Target Error message/);\n    expect(target.stack).toMatch(/at sourceFunction/);\n    expect(target.stack).not.toMatch(/at targetFunction/);\n  });\n\n  it('should replace error stack in a target error missing a message', () => {\n    const source = _.attempt(sourceFunction);\n    const target = _.attempt(targetFunction2);\n\n    errorUtils.replaceErrorStack(source, target);\n    expect(target.message).toBe('');\n    expect(target.stack).toMatch(/at sourceFunction/);\n    expect(target.stack).not.toMatch(/at targetFunction2/);\n  });\n\n  it('should not trim down stack-frames from a (native) stack-trace reported as the message', () => {\n    const nativeStacktrace = 'Target native error:\\n  at native.stack.Class.method()';\n    const source = _.attempt(sourceFunction);\n    const target = new Error(nativeStacktrace);\n\n    errorUtils.replaceErrorStack(source, target);\n    expect(target.stack).toMatch(nativeStacktrace);\n  });\n\n  it('should not ruin already malformed errors', () => {\n    const err1 = new Error('Source');\n    const err2 = new Error('Target');\n    delete err1.stack;\n    delete err2.stack;\n\n    errorUtils.replaceErrorStack(err1, err2);\n    expect(err2.stack).toBe('Target');\n  });\n});\n\ndescribe('createErrorWithUserStack()', () => {\n  it('should not have /detox/src/ lines in stack', () => {\n    expect(new Error().stack).toMatch(/[\\\\/]detox[\\\\/]src[\\\\/]/m); // sanity assertion\n\n    expect(errorUtils.createErrorWithUserStack().toString()).not.toContain('/detox/src/'); // POSIX\n    expect(errorUtils.createErrorWithUserStack().toString()).not.toContain('\\\\detox\\\\src\\\\'); // WIN32\n  });\n});\n\ndescribe('asError(err)', () => {\n  it('should passthrough Error instances', () => {\n    const err = new Error();\n    expect(errorUtils.asError(err)).toBe(err);\n  });\n\n  it('should wrap non-Error with Error', () => {\n    const err = 'non-Error';\n    expect(errorUtils.asError(err)).toBeInstanceOf(Error);\n    expect(errorUtils.asError(err).message).toBe(err);\n  });\n});\n\ndescribe('serializeObjectWithError(obj, errorKey)', () => {\n  it('should passthrough a non-error object', () => {\n    const obj = { some: 'value' };\n    expect(errorUtils.serializeObjectWithError(obj, 'error')).toBe(obj);\n  });\n\n  it('should serialize an error object', () => {\n    const obj = { some: 'value', error: new Error('error message') };\n\n    const serialized = errorUtils.serializeObjectWithError(obj, 'error');\n    expect(serialized.error).not.toBeInstanceOf(Error);\n\n    const deserialized = errorUtils.deserializeObjectWithError(serialized, 'error');\n    expect(deserialized.error).toBeInstanceOf(Error);\n\n    expect(deserialized.error).toEqual(obj.error);\n    expect(errorUtils.deserializeObjectWithError(obj, 'error')).toBe(obj);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/fsext.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\n\nfunction isDirEmptySync(dirPath) {\n  const files = fs.readdirSync(dirPath);\n  return files.length === 0;\n}\n\nasync function getDirectories (rootPath) {\n  let files = await fs.readdir(rootPath);\n  let dirs = [];\n  for (let file of files) {\n    let pathString = path.resolve(rootPath, file);\n    if ((await fs.stat(pathString)).isDirectory()) {\n      dirs.push(file);\n    }\n  }\n  return dirs.sort();\n}\n\nasync function remove(filePath) {\n  if (await fs.exists(filePath)) {\n    await fs.remove(filePath);\n    return true;\n  }\n\n  return false;\n}\n\nmodule.exports = {\n  copy: fs.copy,\n  ensureDir: fs.ensureDir,\n  exists: fs.exists,\n  getDirectories,\n  isDirEmptySync,\n  readdirSync: fs.readdirSync,\n  remove,\n};\n"
  },
  {
    "path": "detox/src/utils/fsext.test.js",
    "content": "const path = require('path');\n\nconst fs = require('fs-extra');\n\nconst fsext = require('./fsext');\nconst tempfile = require('./tempfile');\n\ntest('copy', () => {\n  expect(fsext.copy).toBe(fs.copy);\n});\n\ntest('ensureDir', () => {\n  expect(fsext.ensureDir).toBe(fs.ensureDir);\n});\n\ntest('exists', () => {\n  expect(fsext.exists).toBe(fs.exists);\n});\n\ntest('isDirEmptySync', async () => {\n  const tempDir = tempfile();\n  try {\n    expect(() => fsext.isDirEmptySync(tempDir)).toThrow(/ENOENT/);\n\n    await fs.ensureDir(tempDir);\n    expect(fsext.isDirEmptySync(tempDir)).toBe(true);\n\n    await fs.ensureFile(path.join(tempDir, '1'));\n    expect(fsext.isDirEmptySync(tempDir)).toBe(false);\n  } finally {\n    await fs.remove(tempDir);\n  }\n});\n\ntest('readdirSync', async () => {\n  expect(fsext.readdirSync).toBe(fs.readdirSync);\n});\n\ntest('remove', async () => {\n  const tempDir = tempfile();\n  await fs.ensureDir(tempDir);\n  expect(await fsext.remove(tempDir)).toBe(true);\n  expect(await fsext.remove(tempDir)).toBe(false);\n});\n"
  },
  {
    "path": "detox/src/utils/getAbsoluteBinaryPath.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst DetoxRuntimeError = require('../errors/DetoxRuntimeError');\n\nfunction getAbsoluteBinaryPath(appPath) {\n  if (path.isAbsolute(appPath)) {\n    return appPath;\n  }\n\n  const absPath = path.join(process.cwd(), appPath);\n  if (fs.existsSync(absPath)) {\n    return absPath;\n  } else {\n    throw new DetoxRuntimeError({\n      message: `Failed to find the app binary at:\\n${absPath}`,\n      hint: `Make sure that:\n1. You built the app before running tests:\n  detox build -c <your-configuration-name>\n2. The app binary can be found at the given path.`,\n    });\n  }\n}\n\nmodule.exports = getAbsoluteBinaryPath;\n"
  },
  {
    "path": "detox/src/utils/getAbsoluteBinaryPath.test.js",
    "content": "const path = require('path');\n\nconst getAbsoluteBinaryPath = require('./getAbsoluteBinaryPath');\n\ndescribe('getAbsoluteBinaryPath', () => {\n  it('should return the given path if it is already absolute', async () => {\n    expect(getAbsoluteBinaryPath('/my/absolute/path')).toEqual('/my/absolute/path');\n  });\n\n  it('should return an absolute path if a relative path is passed in', async () => {\n    expect(getAbsoluteBinaryPath('src/utils/getAbsoluteBinaryPath.js')).toEqual(path.join(process.cwd(), 'src/utils/getAbsoluteBinaryPath.js'));\n  });\n\n  it('should throw exception if resulting absolute path does not exist', async () => {\n    expect(() => getAbsoluteBinaryPath('my/relative/path'))\n      .toThrow();\n  });\n});\n\n"
  },
  {
    "path": "detox/src/utils/invocationTraceDescriptions.js",
    "content": "module.exports = {\n  actionDescription: {\n    adjustSliderToPosition: (newPosition) => `adjust slider to position ${newPosition}`,\n    clearText: () => 'clear input text',\n    getAttributes: () => 'get element attributes',\n    tap: (point) => `tap at ${JSON.stringify(point)}`,\n    longPress: (point, duration) => `long press${duration !== null ? ` for ${duration}ms` : ''}${point !== null ? ` at ${JSON.stringify(point)}` : ''}`,\n    longPressAndDrag: (duration, startX, startY, targetElement, endX, endY, speed, holdDuration) =>\n      `long press and drag from ${startX}, ${startY} to ${endX}, ${endY} with speed ${speed} and hold duration ${holdDuration}`,\n    multiTap: (times) => `tap ${times} times`,\n    performAccessibilityAction: (actionName) => `perform ${actionName} accessibilityAction`,\n    pinch: (scale, speed, angle) => `pinch with scale ${scale}, speed ${speed}, and angle ${angle}`,\n    pinchWithAngle: (direction, speed, angle) => `pinch with direction ${direction}, speed ${speed}, and angle ${angle}`,\n    replaceText: (value) => `replace input text: \"${value}\"`,\n    scroll: (amount, direction, startPositionX, startPositionY) =>\n      `scroll ${amount} pixels ${direction}${startPositionX !== undefined || startPositionY !== undefined ? ` from normalized position (${startPositionX}, ${startPositionY})` : ''}`,\n    scrollTo: (edge, startPositionX, startPositionY) =>\n      `scroll to ${edge} ${startPositionX !== undefined || startPositionY !== undefined ? ` from normalized position (${startPositionX}, ${startPositionY})` : ''}`,\n    scrollToIndex: (index) => `scroll to index #${index}`,\n    setColumnToValue: (column, value) => `set column ${column} to value ${value}`,\n    setDatePickerDate: (dateString, dateFormat) => `set date picker date to ${dateString} using format ${dateFormat}`,\n    swipe: (direction, speed, normalizedSwipeOffset, normalizedStartingPointX, normalizedStartingPointY) =>\n      `swipe ${direction} ${speed} with offset ${normalizedSwipeOffset}\n      ${!isNaN(normalizedStartingPointX) && !isNaN(normalizedStartingPointY) ? ` from normalized position (${normalizedStartingPointX}, ${normalizedStartingPointY})` : ''}`,\n    takeScreenshot: (screenshotName) => `take screenshot${screenshotName !== undefined ? ` with name \"${screenshotName}\"` : ''}`,\n    tapAtPoint: (value) => `tap${value !== undefined ? ` at ${JSON.stringify(value)}` : ''}`,\n    tapBackspaceKey: () => 'tap on backspace key',\n    tapReturnKey: () => 'tap on return key',\n    typeText: (value) => `type input text: \"${value}\"`,\n  },\n  webViewActionDescription: {\n    tap: () => `tap`,\n    typeText: (value, isContentEditable) => `type input text: \"${value}\"${isContentEditable ? ' in content editable' : ''}`,\n    replaceText: (value) => `replace input text: \"${value}\"`,\n    clearText: () => 'clear input text',\n    selectAllText: () => 'select all input text',\n    getText: () => 'get input text',\n    scrollToView: () => 'scroll to view',\n    focus: () => 'focus',\n    moveCursorToEnd: () => 'move cursor to end',\n    runScript: (script) => `run script: \"${script}\"`,\n    runScriptWithArgs: (script, ...args) => `run script: \"${script}\" with args: \"${args}\"`,\n    getCurrentUrl: () => 'get current url',\n    getTitle: () => 'get title',\n    full: (actionDescription) => `perform web view action: ${actionDescription}`\n  },\n  systemActionDescription: {\n    tap: () => `tap`,\n    full: (actionDescription) => `perform system action: ${actionDescription}`\n  },\n  expectDescription: {\n    waitFor: (actionDescription) => `wait for expectation while ${actionDescription}`,\n    waitForWithTimeout: (expectDescription, timeout) => `${expectDescription} with timeout (${timeout} ms)`,\n    withTimeout: (timeout) => `wait until timeout (${timeout} ms)`,\n    toBeFocused: () => 'to be focused',\n    toBeVisible: (percent) => `to be visible${percent !== undefined ? ` ${percent}%` : ''}`,\n    toExist: () => 'to exist',\n    toHaveText: (text) => `to have text: \"${text}\"`,\n    toHaveLabel: (label) => `to have label: \"${label}\"`,\n    toHaveId: (id) => `to have id: \"${id}\"`,\n    toHaveValue: (value) => `to have value: \"${value}\"`,\n    toHaveSliderPosition: (position, tolerance) => `to have slider position: ${position}${tolerance > 0 ? ` with tolerance ${tolerance}` : ''}`,\n    toHaveToggleValue: (value) => `to have toggle value: ${value}`,\n    full: (expectDescription, notCondition) => `expect element ${notCondition ? `not ${expectDescription}` : expectDescription}`\n  }\n};\n"
  },
  {
    "path": "detox/src/utils/isArrowFunction.js",
    "content": "function isArrowFunction(code) {\n  if (!code.includes('=>')) {\n    return false;\n  }\n\n  const syncCode = removeAsync(code.trimStart());\n  return syncCode.startsWith('(') || isSimpleArrowFunction(code);\n}\n\nfunction removeAsync(code) {\n  return code.startsWith('async') ? code.slice(5).trimStart() : code;\n}\n\nfunction isSimpleArrowFunction(code) {\n  const [signature] = code.split('=>', 1);\n\n  return isAlphanumericId(removeAsync(signature.trim()));\n}\n\nfunction isAlphanumericId(code) {\n  return /^[a-zA-Z0-9]+$/.test(code);\n}\n\nmodule.exports = isArrowFunction;\n"
  },
  {
    "path": "detox/src/utils/isArrowFunction.test.js",
    "content": "const isArrowFunction = require('./isArrowFunction');\n\ndescribe('isArrowFunction', () => {\n  test.each([\n    [() => {}, true],\n    [x => x, true],\n    [(x = () => {}) => x, true],\n    [async()=>{}, true],\n    [async x => x, true],\n    [function*() { yield 42; }, false],\n    [function(x = () => {}) { return x; }, false],\n    [function() { return x => x; }, false],\n  ])(`given %s should return %s`, (fn, expected) => {\n    expect(isArrowFunction(fn.toString())).toBe(expected);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/isPromise.js",
    "content": "function isPromise(value) {\n  return Promise.resolve(value) === value;\n}\n\nfunction isPromiseLike(value) {\n  return value ? typeof value.then === 'function' : false;\n}\n\nmodule.exports = {\n  isPromise,\n  isPromiseLike,\n};\n"
  },
  {
    "path": "detox/src/utils/isPromise.test.js",
    "content": "const { isPromise, isPromiseLike } = require('./isPromise');\n\ndescribe('isPromise', () => {\n  it.each([\n    [true, 'a new promise', new Promise(() => {})],\n    [true, 'a resolved promise', Promise.resolve()],\n    [false, 'a function', () => {}],\n    [false, 'a promise-like object', { then: () => {}, catch: () => {}, finally: () => {} }],\n    [false, 'undefined', undefined],\n  ])('should return %j for %s', (expected, _comment, arg) => {\n    expect(isPromise(arg)).toBe(expected);\n  });\n});\n\ndescribe('isPromiseLike', () => {\n  it.each([\n    [true, 'a new promise', new Promise(() => {})],\n    [true, 'a resolved promise', Promise.resolve()],\n    [true, 'a promise-like object', { then: () => {}, catch: () => {}, finally: () => {} }],\n    [false, 'a function', () => {}],\n    [false, 'undefined', undefined],\n  ])('should return %j for %s', (expected, _comment, arg) => {\n    expect(isPromiseLike(arg)).toBe(expected);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/isRegExp.js",
    "content": "function isRegExp(obj) {\n  return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\n\nmodule.exports = {\n  isRegExp,\n};\n"
  },
  {
    "path": "detox/src/utils/isValidWebsocketURL.js",
    "content": "const { URL } = require('url');\n\nfunction isValidWebsocketURL(url) {\n  try {\n    const { protocol } = new URL(url);\n    return protocol === 'ws:' || protocol === 'wss:';\n  } catch (err) {\n    return false;\n  }\n}\n\nmodule.exports = isValidWebsocketURL;\n"
  },
  {
    "path": "detox/src/utils/isValidWebsocketURL.test.js",
    "content": "const isValidWebsocketURL = require('./isValidWebsocketURL');\n\ndescribe('isValidWebsocketURL', () => {\n  it.each([\n    [true, 'ws://localhost'],\n    [true, 'wss://localhost:3428'],\n    [false, 'http://localhost:3428'],\n    [false, '3428'],\n    [false, 3428],\n    [false, null],\n  ])('should return %j for %s', (expected, url) => {\n    expect(isValidWebsocketURL(url)).toBe(expected);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/logger.js",
    "content": "/**\n * @type {import('../logger/DetoxLogger')}\n */\nmodule.exports = require('../../internals').log;\n"
  },
  {
    "path": "detox/src/utils/mapDeviceLongPressArguments.js",
    "content": "const { DetoxRuntimeError } = require('../errors');\n\nconst { assertPoint, assertDuration, assertUndefined, assertShouldIgnoreStatusBar } = require('./assertArgument');\n\nfunction mapDeviceLongPressArguments(optionalAllParams, optionalDurationOrIgnoreStatusBar, optionalIgnoreStatusBar) {\n    let point = null;\n    let duration = null;\n    let shouldIgnoreStatusBar = null;\n\n    try {\n      if (optionalAllParams === undefined) {\n        // Do nothing.\n      } else if (typeof optionalAllParams === 'number') {\n        duration = optionalAllParams;\n        if (typeof optionalDurationOrIgnoreStatusBar === 'boolean') {\n            shouldIgnoreStatusBar = optionalDurationOrIgnoreStatusBar;\n        } else {\n            assertUndefined(optionalDurationOrIgnoreStatusBar);\n        }\n        assertUndefined(optionalIgnoreStatusBar);\n      } else if (typeof optionalAllParams === 'boolean') {\n        shouldIgnoreStatusBar = optionalAllParams;\n        assertUndefined(optionalDurationOrIgnoreStatusBar);\n        assertUndefined(optionalIgnoreStatusBar);\n      } else {\n        assertPoint(optionalAllParams);\n        point = optionalAllParams;\n\n        if (typeof optionalDurationOrIgnoreStatusBar === 'number') {\n          assertDuration(optionalDurationOrIgnoreStatusBar);\n          duration = optionalDurationOrIgnoreStatusBar;\n        } else if (typeof optionalDurationOrIgnoreStatusBar === 'boolean') {\n          assertShouldIgnoreStatusBar(optionalDurationOrIgnoreStatusBar);\n          shouldIgnoreStatusBar = optionalDurationOrIgnoreStatusBar;\n          assertUndefined(optionalIgnoreStatusBar);\n        } else if (optionalDurationOrIgnoreStatusBar !== undefined) {\n            assertDuration(optionalDurationOrIgnoreStatusBar);\n        } else {\n          assertUndefined(optionalDurationOrIgnoreStatusBar);\n          assertUndefined(optionalIgnoreStatusBar);\n        }\n\n        if (optionalIgnoreStatusBar !== undefined) {\n          assertShouldIgnoreStatusBar(optionalIgnoreStatusBar);\n          shouldIgnoreStatusBar = optionalIgnoreStatusBar;\n        }\n      }\n    } catch (e) {\n      throw new DetoxRuntimeError(`longPress accepts either a duration (number) or a point ({x: number, y: number}) as ` +\n        `its first argument, optionally a duration (number) as its second argument, and optionally a ignoreStatusBar (boolean) as its third argument. Error: ${e.message}`);\n    }\n\n    return { point, duration, shouldIgnoreStatusBar };\n  }\n\nmodule.exports = mapDeviceLongPressArguments;\n"
  },
  {
    "path": "detox/src/utils/mapDeviceLongPressArguments.test.js",
    "content": "const mapDeviceLongPressArguments = require('./mapDeviceLongPressArguments');\ndescribe('mapDeviceLongPressArguments', () => {\n  it('should return `{ point: { x: 1, y: 2 }, duration: 3, shouldIgnoreStatusBar: false }` for `{ x: 1, y: 2 }, 3, false`', () => {\n    expect(mapDeviceLongPressArguments({ x: 1, y: 2 }, 3, false)).toEqual({ point: { x: 1, y: 2 }, duration: 3, shouldIgnoreStatusBar: false });\n  });\n\n  it('should return `{ point: { x: 1, y: 2 }, duration: 3, shouldIgnoreStatusBar: null }` for `{ x: 1, y: 2 }, 3`', () => {\n    expect(mapDeviceLongPressArguments({ x: 1, y: 2 }, 3)).toEqual({ point: { x: 1, y: 2 }, duration: 3, shouldIgnoreStatusBar: null });\n  });\n\n  it('should return `{ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: null }` for `{ x: 1, y: 2 }`', () => {\n    expect(mapDeviceLongPressArguments({ x: 1, y: 2 })).toEqual({ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: null });\n  });\n\n  it('should return `{ point: null, duration: 2, shouldIgnoreStatusBar: true }` for `true`', () => {\n    expect(mapDeviceLongPressArguments(2, true)).toEqual({ point: null, duration: 2, shouldIgnoreStatusBar: true });\n  });\n\n  it('should return `{ point: null, duration: 3, shouldIgnoreStatusBar: null }` for `3`', () => {\n    expect(mapDeviceLongPressArguments(3)).toEqual({ point: null, duration: 3, shouldIgnoreStatusBar: null });\n  });\n\n  it('should return `{ point: null, duration: null, shouldIgnoreStatusBar: true }` for `true`', () => {\n    expect(mapDeviceLongPressArguments(true)).toEqual({ point: null, duration: null, shouldIgnoreStatusBar: true });\n  });\n\n  it('should return `{ point: null, duration: null, shouldIgnoreStatusBar: null }` for no arguments', () => {\n    expect(mapDeviceLongPressArguments()).toEqual({ point: null, duration: null, shouldIgnoreStatusBar: null });\n  });\n\n  it('should throw for invalid point', () => {\n    expect(() => mapDeviceLongPressArguments({ x: 1 })).toThrow('point should be an object with x and y properties, but got {\"x\":1}');\n  });\n\n  it('should throw for invalid duration', () => {\n    expect(() => mapDeviceLongPressArguments({ x: 1, y: 2 }, '3')).toThrow('duration should be a number, but got 3 (string)');\n  });\n\n  it('should throw for invalid shouldIgnoreStatusBar', () => {\n    expect(() => mapDeviceLongPressArguments({ x: 1, y: 2 }, 3, 'true')).toThrow('shouldIgnoreStatusBar should be a boolean, but got true (string)');\n  });\n\n  it('should return `{ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: true }` for `{ x: 1, y: 2 }, true`', () => {\n    expect(mapDeviceLongPressArguments({ x: 1, y: 2 }, true))\n    .toEqual({ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: true });\n  });\n\n  it('should return `{ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: false }` for `{ x: 1, y: 2 }, false`', () => {\n    expect(mapDeviceLongPressArguments({ x: 1, y: 2 }, false))\n    .toEqual({ point: { x: 1, y: 2 }, duration: null, shouldIgnoreStatusBar: false });\n  });\n\n  it('should throw when providing point, boolean, and extra argument', () => {\n    expect(() => mapDeviceLongPressArguments({ x: 1, y: 2 }, true, 'extra'))\n    .toThrow();\n  });\n\n  it('should throw when providing duration, boolean, and extra argument', () => {\n    expect(() => mapDeviceLongPressArguments(1000, true, 'extra'))\n    .toThrow();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/mapLongPressArguments.js",
    "content": "const { DetoxRuntimeError } = require('../errors');\n\nconst { assertPoint, assertDuration, assertUndefined } = require('./assertArgument');\n\nfunction mapLongPressArguments(optionalPointOrDuration, optionalDuration) {\n  let point = null;\n  let duration = null;\n\n  try {\n    if (optionalPointOrDuration === undefined) {\n      // Do nothing.\n    } else if (typeof optionalPointOrDuration === 'number') {\n      duration = optionalPointOrDuration;\n      assertUndefined(optionalDuration);\n    } else {\n      assertPoint(optionalPointOrDuration);\n      point = optionalPointOrDuration;\n\n      if (optionalDuration !== undefined) {\n        assertDuration(optionalDuration);\n        duration = optionalDuration;\n      }\n    }\n  } catch (e) {\n    throw new DetoxRuntimeError(`longPress accepts either a duration (number) or a point ({x: number, y: number}) as ` +\n      `its first argument, and optionally a duration (number) as its second argument. Error: ${e.message}`);\n  }\n\n  return { point, duration };\n}\n\nmodule.exports = mapLongPressArguments;\n"
  },
  {
    "path": "detox/src/utils/mapLongPressArguments.test.js",
    "content": "const mapLongPressArguments = require('./mapLongPressArguments');\ndescribe('mapLongPressArguments', () => {\n  it('should return `{ point: { x: 1, y: 2 }, duration: 3 }` for `{ x: 1, y: 2 }, 3`', () => {\n    expect(mapLongPressArguments({ x: 1, y: 2 }, 3)).toEqual({ point: { x: 1, y: 2 }, duration: 3 });\n  });\n\n  it('should return `{ point: { x: 1, y: 2 }, duration: null }` for `{ x: 1, y: 2 }`', () => {\n    expect(mapLongPressArguments({ x: 1, y: 2 })).toEqual({ point: { x: 1, y: 2 }, duration: null });\n  });\n\n  it('should return `{ point: null, duration: 3 }` for `3`', () => {\n    expect(mapLongPressArguments(3)).toEqual({ point: null, duration: 3 });\n  });\n\n  it('should return `{ point: null, duration: null }` for no arguments', () => {\n    expect(mapLongPressArguments()).toEqual({ point: null, duration: null });\n  });\n\n  it('should throw for invalid point', () => {\n    expect(() => mapLongPressArguments({ x: 1 })).toThrow('point should be an object with x and y properties, but got {\"x\":1}');\n  });\n\n  it('should throw for invalid duration', () => {\n    expect(() => mapLongPressArguments({ x: 1, y: 2 }, '3')).toThrow('duration should be a number, but got 3 (string)');\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/pathUtils.js",
    "content": "const path = require('path');\n\nfunction toSimplePath(filePath, cwd = process.cwd()) {\n  const relativePath = path.relative(cwd, filePath);\n  const isOutsideCwd = relativePath.split(path.sep, 1)[0] === '..';\n  return isOutsideCwd ? filePath : relativePath;\n}\n\nmodule.exports = {\n  toSimplePath,\n};\n"
  },
  {
    "path": "detox/src/utils/pathUtils.test.js",
    "content": "const path = require('path');\n\nconst pathUtils = require('./pathUtils');\n\ndescribe('pathUtils', () => {\n  describe('toSimplePath', () => {\n    test('when given a path inside the current working directory, should return a relative path', () => {\n      const relativePath = path.join('example', 'test.js');\n      const absolutePath = path.join(process.cwd(), relativePath);\n      expect(pathUtils.toSimplePath(absolutePath)).toBe(relativePath);\n    });\n\n    test('when given a path outside the current working directory, should return it as-is', () => {\n      const relativePath = path.join('example', 'test.js');\n      const absolutePath = path.join(process.cwd(), relativePath);\n      const otherCwd = path.join(process.cwd(), 'example2');\n\n      expect(pathUtils.toSimplePath(absolutePath, otherCwd)).toBe(absolutePath);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/pipeCommands.js",
    "content": "const {\n  escapeInDoubleQuotedRegexp,\n  escapeInDoubleQuotedString,\n  isRunningInCMDEXE,\n} = require('./shellUtils');\n\nfunction win32Implementation() {\n  const searchRegexpWin32 = (pattern) => `findstr /R /C:\"${escapeInDoubleQuotedString(pattern)}\"`;\n  const searchFragmentWin32 = (fragment) => `findstr /C:\"${escapeInDoubleQuotedString(fragment)}\"`;\n\n  return {\n    escape: {\n      inQuotedString: escapeInDoubleQuotedString,\n      inQuotedRegexp: escapeInDoubleQuotedRegexp,\n    },\n    search: {\n      regexp: searchRegexpWin32,\n      fragment: searchFragmentWin32,\n    },\n  };\n}\n\nfunction nixImplementation() {\n  const searchRegexpNix = (pattern) => `grep \"${escapeInDoubleQuotedString(pattern)}\"`;\n  const searchFragmentNix = (fragment) => `grep -e \"${escapeInDoubleQuotedString(fragment)}\"`;\n\n  return {\n    escape: {\n      inQuotedString: escapeInDoubleQuotedString,\n      inQuotedRegexp: escapeInDoubleQuotedRegexp,\n    },\n    search: {\n      regexp: searchRegexpNix,\n      fragment: searchFragmentNix,\n    },\n  };\n}\n\nmodule.exports = isRunningInCMDEXE()\n  ? win32Implementation()\n  : nixImplementation();\n"
  },
  {
    "path": "detox/src/utils/pressAnyKey.js",
    "content": "function isCtrlC(chunk) {\n  const [chr1] = Array.from(chunk);\n  return chr1 === 3;\n}\n\nasync function pressAnyKey() {\n  return new Promise((resolve) => {\n    process.stdin.resume();\n    process.stdin.setRawMode(true);\n    process.stdin.once('data', onData);\n\n    function onData(chunk) {\n      process.stdin.removeListener('data', onData);\n      process.stdin.setRawMode(false);\n      process.stdin.pause();\n      process.nextTick(resolve);\n\n      if (isCtrlC(chunk)) {\n        process.kill(process.pid, 'SIGINT');\n      }\n    }\n  });\n}\n\nmodule.exports = pressAnyKey;\n"
  },
  {
    "path": "detox/src/utils/repl.js",
    "content": "const repl = require('node:repl');\n\nconst log = require('../utils/logger').child({ cat: 'repl' });\n\nasync function enterREPL(context = {}) {\n  log.info('Entering Detox REPL...\\nType .help to see available commands');\n\n  const replServer = repl.start({\n    prompt: 'detox> ',\n    useColors: true,\n    useGlobal: true,\n    preview: true,\n    breakEvalOnSigint: true,\n  });\n\n  // Add Detox globals\n  const detox = require('../../index');\n  Object.assign(replServer.context, detox);\n\n  // Add user-provided context\n  if (typeof context === 'object') {\n    Object.assign(replServer.context, context);\n  }\n\n  // Define .dumpxml command\n  replServer.defineCommand('dumpxml', {\n    help: 'Print view hierarchy XML',\n    async action() {\n      this.clearBufferedCommand();\n      try {\n        const xml = await detox.device.generateViewHierarchyXml();\n        if (xml) {\n          log.info(xml);\n        }\n      } catch (error) {\n        log.error('Failed to generate view hierarchy.\\n%s', error);\n      }\n      this.displayPrompt();\n    }\n  });\n\n  // Define .ai command for natural language interaction\n  replServer.defineCommand('pilot', {\n    help: 'Execute natural language command (e.g. .pilot Tap on login button)',\n    async action(input) {\n      this.clearBufferedCommand();\n      try {\n        if (!input || !input.trim()) {\n          log.warn('Please provide a valid command. Example: .pilot Tap on login button');\n        } else {\n          await detox.pilot.perform(input);\n        }\n      } catch (error) {\n        log.error('Failed to execute Detox Pilot command.\\n%s', error);\n      }\n      this.displayPrompt();\n    }\n  });\n\n  return new Promise((resolve) => replServer.on('exit', resolve));\n}\n\nmodule.exports = {\n  enterREPL,\n};\n"
  },
  {
    "path": "detox/src/utils/resolveModuleFromPath.js",
    "content": "function resolveModuleFromPath(modulePath) {\n  const resolvedModulePath = require.resolve(modulePath, { paths: [process.cwd()] });\n  return require(resolvedModulePath);\n}\n\nmodule.exports = resolveModuleFromPath;\n"
  },
  {
    "path": "detox/src/utils/resolveModuleFromPath.test.js",
    "content": "const path = require('path');\n\nconst resolveModuleFromPath = require('./resolveModuleFromPath');\n\nconst RELATIVE_PATH_TO_PACKAGE_JSON = '../../package.json';\n\ndescribe('resolveModuleFromPath', () => {\n  let packageJson;\n\n  beforeEach(() => {\n    packageJson = require(RELATIVE_PATH_TO_PACKAGE_JSON);\n  });\n\n  it('should resolve absolute paths', async () => {\n    const absolutePath = require.resolve(RELATIVE_PATH_TO_PACKAGE_JSON);\n    expect(path.isAbsolute(absolutePath)).toBe(true); // an assertion to be on the safe side\n    expect(resolveModuleFromPath(absolutePath)).toBe(packageJson);\n  });\n\n  it('should resolve relative paths', async () => {\n    expect(resolveModuleFromPath(`./package.json`)).toBe(packageJson);\n  });\n\n  it('should resolve node modules', async () => {\n    expect(resolveModuleFromPath('lodash/map')).toBe(require('lodash/map'));\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/retry.js",
    "content": "const sleep = require('./sleep');\n\nconst DEFAULT_INITIAL_SLEEP = 0;\nconst DEFAULT_RETRIES = 9;\nconst DEFAULT_INTERVAL = 500;\nconst DEFAULT_CONDITION_FN = () => true;\nconst DEFAULT_BACKOFF_MODE = 'linear';\nconst backoffModes = {\n  'linear': () => ({ interval, totalTries }) => totalTries * interval,\n  'none': () => ({ interval }) => interval,\n};\n\nasync function retry(optionsOrFunc, func) {\n  let options = optionsOrFunc;\n  if (typeof optionsOrFunc === 'function') {\n    func = optionsOrFunc;\n    options = {};\n  }\n\n  const {\n    retries = DEFAULT_RETRIES,\n    interval = DEFAULT_INTERVAL,\n    backoff = DEFAULT_BACKOFF_MODE,\n    conditionFn = DEFAULT_CONDITION_FN,\n    initialSleep = DEFAULT_INITIAL_SLEEP,\n    shouldUnref,\n  } = options;\n\n  const backoffFn = backoffModes[backoff]();\n  const sleepOptions = shouldUnref ? { shouldUnref } : undefined;\n\n  if (initialSleep) {\n    await sleep(initialSleep, sleepOptions);\n  }\n\n  // eslint-disable-next-line no-constant-condition\n  for (let totalTries = 1, lastError = null; true; totalTries++) {\n    try {\n      return await func(totalTries, lastError);\n    } catch (e) {\n      lastError = e;\n\n      if (!conditionFn(e) || (totalTries > retries)) {\n        throw e;\n      }\n      await sleep(backoffFn({ interval, totalTries }), sleepOptions);\n    }\n  }\n}\n\nmodule.exports = retry;\n"
  },
  {
    "path": "detox/src/utils/retry.test.js",
    "content": "describe('retry', () => {\n  let sleep;\n  let retry;\n\n  const mockFailingUserFn = () => jest.fn().mockReturnValue(Promise.reject(new Error('a thing')));\n  const mockFailingOnceUserFn = () => jest.fn()\n    .mockRejectedValueOnce(new Error('once'))\n    .mockReturnValueOnce();\n  const mockFailingTwiceUserFn = () => jest.fn()\n    .mockRejectedValueOnce(new Error('once'))\n    .mockRejectedValueOnce(new Error('twice'))\n    .mockReturnValueOnce();\n\n  beforeEach(() => {\n    jest.mock('./sleep', () => jest.fn().mockReturnValue(Promise.resolve()));\n    sleep = require('./sleep');\n\n    retry = require('./retry');\n  });\n\n  it('should retry once over a function that fails once', async () => {\n    const mockFn = mockFailingOnceUserFn();\n\n    await expect(retry({ retries: 999, interval: 0 }, mockFn)).resolves.not.toThrow();\n\n    expect(mockFn).toHaveBeenCalledTimes(2);\n  });\n\n  it('should sleep before calling a function if initialSleep is set', async () => {\n    const mockFn = jest.fn();\n\n    await expect(retry({ initialSleep: 1234, retries: 999, interval: 0 }, mockFn)).resolves.not.toThrow();\n\n    expect(mockFn).toHaveBeenCalledTimes(1);\n    expect(sleep).toHaveBeenCalledTimes(1);\n    expect(sleep).toHaveBeenCalledWith(1234, undefined);\n  });\n\n  it('should call sleep() with { shouldUnref: true } if set', async () => {\n    const mockFn = mockFailingTwiceUserFn();\n\n    await expect(retry({ initialSleep: 1000, retries: 2, interval: 0, shouldUnref: true, }, mockFn)).resolves.not.toThrow();\n\n    expect(mockFn).toHaveBeenCalledTimes(3);\n    expect(sleep).toHaveBeenCalledTimes(3);\n    expect(sleep).toHaveBeenCalledWith(1000, { shouldUnref: true });\n    expect(sleep).toHaveBeenCalledWith(0, { shouldUnref: true });\n  });\n\n  it('should retry multiple times', async () => {\n    const mockFn = mockFailingTwiceUserFn();\n    await retry({ retries: 999, interval: 0 }, mockFn);\n    expect(mockFn).toHaveBeenCalledTimes(3);\n  });\n\n  it('should provide error info in each failure', async () => {\n    const mockFn = mockFailingTwiceUserFn();\n    await retry({ retries: 999, interval: 0 }, mockFn);\n    expect(mockFn).toHaveBeenCalledWith(1, null);\n    expect(mockFn).toHaveBeenCalledWith(2, new Error('once'));\n    expect(mockFn).toHaveBeenCalledWith(3, new Error('twice'));\n  });\n\n  it('should adhere to retries parameter', async () => {\n    const mockFn = mockFailingUserFn();\n    await expect(retry({ retries: 2, interval: 1 }, mockFn)).rejects.toThrow();\n  });\n\n  it('should adhere to interval parameter, and sleep for increasingly long intervals (i.e. the default backoff mode)', async () => {\n    const mockFn = mockFailingUserFn();\n    const baseInterval = 111;\n\n    await expect(retry({ retries: 2, interval: baseInterval }, mockFn)).rejects.toThrow();\n\n    expect(sleep).toHaveBeenCalledTimes(2);\n    expect(sleep).toHaveBeenCalledWith(baseInterval, undefined);\n    expect(sleep).toHaveBeenCalledWith(baseInterval * 2, undefined);\n  });\n\n  it('should allow for a constant sleep interval instead of an increasing one by setting backoff=\"none\"', async () => {\n    const mockFn = mockFailingUserFn();\n    const baseInterval = 111;\n    const options = {\n      retries: 2,\n      interval: baseInterval,\n      backoff: 'none',\n    };\n\n    await expect(retry(options, mockFn)).rejects.toThrow();\n\n    expect(sleep).toHaveBeenCalledTimes(2);\n    expect(sleep).toHaveBeenNthCalledWith(1, baseInterval, undefined);\n    expect(sleep).toHaveBeenNthCalledWith(2, baseInterval, undefined);\n  });\n\n  it('should allow for the default linear backoff when set explicitly as \"linear\"', async () => {\n    const mockFn = mockFailingUserFn();\n    const baseInterval = 111;\n    const options = {\n      retries: 2,\n      interval: baseInterval,\n      backoff: 'linear',\n    };\n\n    await expect(retry(options, mockFn)).rejects.toThrow();\n\n    expect(sleep).toHaveBeenCalledTimes(2);\n    expect(sleep).toHaveBeenCalledWith(baseInterval, undefined);\n    expect(sleep).toHaveBeenCalledWith(baseInterval * 2, undefined);\n  });\n\n  it('should adhere to a custom condition', async () => {\n    const mockFn = mockFailingUserFn();\n    const conditionFn = jest.fn()\n                            .mockReturnValueOnce(true)\n                            .mockReturnValueOnce(false);\n\n    await expect(retry({ retries: 999, interval: 1, conditionFn }, mockFn)).rejects.toThrow();\n\n    expect(mockFn).toHaveBeenCalledTimes(2);\n  });\n\n  it('should work with default retries+interval values', async () => {\n    const mockFn = mockFailingUserFn();\n    const defaultRetries = 9;\n    const defaultInterval = 500;\n\n    await expect(retry(mockFn)).rejects.toThrow();\n\n    expect(mockFn).toHaveBeenCalledTimes(defaultRetries + 1);\n    expect(sleep).toHaveBeenCalledWith(defaultInterval, undefined);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/rn-consts/rn-consts.js",
    "content": "const DEFAULT_RN_VERSION = '99.9999.9999';\n\nconst rnVersion = (function parseRNVersion() {\n  let raw;\n  try {\n    const packageJson = require('react-native/package.json');\n    raw = packageJson.version;\n  } catch {\n    // Default version for RN\n    raw = DEFAULT_RN_VERSION;\n  }\n  const [major, minor, patch] = raw.split('.');\n  return {\n    major,\n    minor,\n    patch,\n    raw\n  };\n})();\n\nconst isRNNewArch = process.env.RCT_NEW_ARCH_ENABLED === '1';\n\nmodule.exports = {\n  rnVersion,\n  isRNNewArch\n};\n"
  },
  {
    "path": "detox/src/utils/safeAsync.js",
    "content": "async function safeAsync(fnOrValue) {\n  if (typeof fnOrValue === 'function') {\n    const fn = fnOrValue;\n    return (await fn());\n  } else {\n    return fnOrValue;\n  }\n}\n\nmodule.exports = safeAsync;\n\n"
  },
  {
    "path": "detox/src/utils/safeAsync.test.js",
    "content": "const safeAsync = require('./safeAsync');\n\ndescribe('safeAsync', () => {\n  it(`should wrap value into a promise`, async() => {\n    await expect(safeAsync(5)).resolves.toEqual(5);\n  });\n\n  it(`should call sync function and return its result as a promise`, async() => {\n    await expect(safeAsync(() => 5)).resolves.toEqual(5);\n  });\n\n  it(`should call async function into a promise`, async() => {\n    await expect(safeAsync(async () => 5)).resolves.toEqual(5);\n  });\n\n  it(`should handle sync function errors in the async way`, async() => {\n    await expect(safeAsync( () => { throw 'error'; })).rejects.toEqual('error');\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/setUniqueProperty.js",
    "content": "function setUniqueProperty(obj, key, value) {\n  let index = 0;\n  const suffixed = () => index > 0 ? `${key}${index + 1}` : key;\n\n  while (obj.hasOwnProperty(suffixed())) {\n    index++;\n  }\n\n  obj[suffixed()] = value;\n  return obj;\n}\n\nmodule.exports = setUniqueProperty;\n"
  },
  {
    "path": "detox/src/utils/setUniqueProperty.test.js",
    "content": "const setUniqueProperty = require('./setUniqueProperty');\n\ndescribe('setUniqueProperty(obj, key, value', () => {\n  it('should set obj[key] = value', () => {\n    expect(setUniqueProperty({}, 'a', 1)).toEqual({ a: 1 });\n  });\n\n  it('should set obj[key + 2] = value if obj[key] exists', () => {\n    expect(setUniqueProperty({ a: 1 }, 'a', 2)).toEqual({ a: 1, a2: 2 });\n  });\n\n  it('should set obj[key + 3] = value if obj[key] and obj[key + 2] exist', () => {\n    expect(setUniqueProperty({ a: 1, a2: 2 }, 'a', 3)).toEqual({ a: 1, a2: 2, a3: 3 });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/shellQuote.js",
    "content": "const _ = require('lodash');\nconst shellQuote = require('shell-quote');\n\nconst { autoEscape } = require('../../src/utils/shellUtils');\n\nfunction quote(argv) {\n  return argv.map(arg => autoEscape(arg)).join(' ');\n}\n\nfunction parse(str) {\n  return _.chain('')\n    .thru(() => shellQuote.parse(str, process.env))\n    .map(arg => {\n      if (_.isObject(arg)) {\n        if (arg.op === 'glob') {\n          return arg.pattern;\n        }\n\n        return null;\n      }\n\n      return arg;\n    })\n    .compact()\n    .value();\n}\n\nmodule.exports = {\n  parse,\n  quote,\n};\n"
  },
  {
    "path": "detox/src/utils/shellQuote.test.js",
    "content": "const { parse, quote } = require('./shellQuote');\n\ndescribe('shellQuote', () => {\n  describe('.quote(argv)', () => {\n    it('should not escape safe characters', () => {\n      expect(quote(['-w', '3'])).toBe('-w 3');\n    });\n\n    it('should escape unsafe characters', () => {\n      const pattern = /^http:\\/\\/192.168.1.253:19001\\/onchange$/;\n      const expectedEscaping = process.platform === 'win32'\n        ? `\"(\\\\\"${pattern.source}\\\\\")\"`\n        : `'(\"${pattern.source}\")'`;\n\n      expect(quote(['--detoxURLBlacklistRegex', `(\"${pattern.source}\")`])).toBe(`--detoxURLBlacklistRegex ${expectedEscaping}`);\n    });\n  });\n\n  describe('.parse(str)', () => {\n    it('should parse command line calls', () => {\n      expect(parse('-w 3')).toEqual(['-w', '3']);\n    });\n\n    it('should parse command line calls with globs', () => {\n      expect(parse('--include **/*.test.js')).toEqual(['--include', '**/*.test.js']);\n    });\n\n    it('should not be able to parse operators', () => {\n      expect(parse('dog || cat')).toEqual(['dog', 'cat']);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/shellUtils.js",
    "content": "const SPACE = ' ';\nconst BACK_SLASH = '\\\\';\nconst FORWARD_SLASH = '/';\nconst SINGLE_QUOTE = \"'\";\nconst DOUBLE_QUOTE = '\"';\n\nfunction escapeSpacesCMD(str) {\n  return str.includes(' ') ? `\"${str}\"` : str;\n}\n\nconst BACK_SLASH_SPACE = BACK_SLASH + SPACE;\nfunction escapeSpacesShell(str) {\n  return str.replace(/ /g, BACK_SLASH_SPACE);\n}\n\nconst ESCAPED_DOUBLE_QUOTE = BACK_SLASH + DOUBLE_QUOTE;\nfunction escapeInDoubleQuotedString(fragment) {\n  return fragment.replace(/\"/g, ESCAPED_DOUBLE_QUOTE);\n}\n\nconst ESCAPED_SINGLE_QUOTE = SINGLE_QUOTE + DOUBLE_QUOTE + SINGLE_QUOTE + DOUBLE_QUOTE + SINGLE_QUOTE;\nfunction escapeWithSingleQuotedString(fragment) {\n  return SINGLE_QUOTE + fragment.replace(/'/g, ESCAPED_SINGLE_QUOTE) + SINGLE_QUOTE;\n}\n\nfunction escapeWithDoubleQuotedString(fragment) {\n  return DOUBLE_QUOTE + escapeInDoubleQuotedString(fragment) + DOUBLE_QUOTE;\n}\n\nconst SPECIAL_CHARS = /([\\^$[\\]*.\\\\])/g;\nfunction escapeInDoubleQuotedRegexp(fragment) {\n  return fragment.replace(SPECIAL_CHARS, '\\\\$1');\n}\n\nfunction isRunningInCMDEXE() {\n  return /* istanbul ignore next */ process.platform === 'win32' &&\n         /* istanbul ignore next */ !process.env['SHELL'];\n}\n\nconst UNSAFE_SHELL = /[\\s!\"#$&'()*;<=>^?`{,}|~[\\\\\\]]/m;\nconst UNSAFE_CMD = /[\\s!\"#$&'()*;<=>^?`{,}|~[\\]]/m;\n\n/* @see https://unix.stackexchange.com/a/357932 */\nfunction hasUnsafeShellChars(str) {\n  return UNSAFE_SHELL.test(str);\n}\n\nfunction autoEscapeShell(str) {\n  if (!hasUnsafeShellChars(str)) {\n    return str;\n  }\n\n  return escapeWithSingleQuotedString(str);\n}\n\nfunction hasUnsafeCMDChars(str) {\n  return UNSAFE_CMD.test(str);\n}\n\nfunction autoEscapeCmd(str) {\n  if (!hasUnsafeCMDChars(str)) {\n    return str;\n  }\n\n  return escapeWithDoubleQuotedString(str);\n}\n\nfunction useForwardSlashesCMD(str) {\n  return str.split(BACK_SLASH).join(FORWARD_SLASH);\n}\n\nfunction useForwardSlashesShell(str) {\n  return str; // already POSIX, so no-op\n}\n\nconst hasUnsafeChars = isRunningInCMDEXE()\n  /* istanbul ignore next */ ? hasUnsafeCMDChars\n  /* istanbul ignore next */ : hasUnsafeShellChars;\n\nconst autoEscape = isRunningInCMDEXE()\n  /* istanbul ignore next */ ? autoEscapeCmd\n  /* istanbul ignore next */ : autoEscapeShell;\n\nconst escapeSpaces = isRunningInCMDEXE()\n  /* istanbul ignore next */ ? escapeSpacesCMD\n  /* istanbul ignore next */ : escapeSpacesShell;\n\nconst usePosixSlashes = isRunningInCMDEXE()\n  /* istanbul ignore next */ ? useForwardSlashesCMD\n  /* istanbul ignore next */ : useForwardSlashesShell;\n\nmodule.exports = {\n  escapeInDoubleQuotedString,\n  escapeInDoubleQuotedRegexp,\n  escapeWithSingleQuotedString,\n  escapeWithDoubleQuotedString,\n  isRunningInCMDEXE,\n  escapeSpaces: Object.assign(escapeSpaces, {\n    cmd: escapeSpacesCMD,\n    shell: escapeSpacesShell,\n  }),\n  hasUnsafeChars: Object.assign(hasUnsafeChars, {\n    cmd: hasUnsafeCMDChars,\n    shell: hasUnsafeShellChars,\n  }),\n  autoEscape: Object.assign(autoEscape, {\n    cmd: autoEscapeCmd,\n    shell: autoEscapeShell,\n  }),\n  useForwardSlashes: Object.assign(usePosixSlashes, {\n    cmd: useForwardSlashesCMD,\n    shell: useForwardSlashesShell,\n  }),\n};\n"
  },
  {
    "path": "detox/src/utils/shellUtils.test.js",
    "content": "const {\n  autoEscape,\n  escapeInDoubleQuotedRegexp,\n  escapeInDoubleQuotedString,\n  escapeWithDoubleQuotedString,\n  escapeWithSingleQuotedString,\n  hasUnsafeChars,\n  isRunningInCMDEXE,\n  useForwardSlashes,\n} = require('./shellUtils');\n\ndescribe('shellUtils', function() {\n  describe('escapeInDoubleQuotedString', () => {\n    test.each([\n      ['test string', 'test string'],\n      ['\"test string\"', `\\\\\"test string\\\\\"`],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(escapeInDoubleQuotedString(input)).toBe(expected);\n    });\n  });\n\n  describe('escapeInDoubleQuotedRegexp', () => {\n    test.each([\n      ['test string', 'test string'],\n      ['^tes\\\\t[ ]*.string$', '\\\\^tes\\\\\\\\t\\\\[ \\\\]\\\\*\\\\.string\\\\$'],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(escapeInDoubleQuotedRegexp(input)).toBe(expected);\n    });\n  });\n\n  describe('escapeWithSingleQuotedString', () => {\n    test.each([\n      ['test string', `'test string'`],\n      [\"d'Artagnan\", `'d'\"'\"'Artagnan'`],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(escapeWithSingleQuotedString(input)).toBe(expected);\n    });\n  });\n\n  describe('escapeWithDoubleQuotedString', () => {\n    test.each([\n      ['test string', '\"test string\"'],\n      ['\"test string\"', `\"\\\\\"test string\\\\\"\"`],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(escapeWithDoubleQuotedString(input)).toBe(expected);\n    });\n  });\n\n  describe('isRunningInCMDEXE', () => {\n    test('should return a boolean value', () => {\n      expect(typeof isRunningInCMDEXE()).toBe('boolean');\n    });\n  });\n\n  describe('hasUnsafeChars', () => {\n    const CASES = [\n    /* cmd    shell  input comment */\n      /* pin-pointer tests */\n      [false, false, '',   'just an empty string'],\n      [true,  true,  ' ',  'a whitespace character'],\n      [true,  true,  '\\t', 'a whitespace character'],\n      [true,  true,  '\\n', 'a newline character'],\n      [true,  true,  '!',  'a history expansion'],\n      [true,  true,  '\"',  'shell syntax'],\n      [true,  true,  '#',  'a comment start'],\n      [true,  true,  '$',  'shell syntax'],\n      [true,  true,  '&',  'shell syntax'],\n      [true,  true,  `'`,  'shell syntax'],\n      [true,  true,  '(',  'globs and wildcards'],\n      [true,  true,  ')',  'globs and wildcards'],\n      [true,  true,  '*',  'a sh wildcard'],\n      [true,  true,  ';',  'shell syntax'],\n      [true,  true,  '<',  'shell syntax'],\n      [true,  true,  '=',  'zsh syntax'],\n      [true,  true,  '>',  'shell syntax'],\n      [true,  true,  '?',  'a sh wildcard'],\n      [true,  true,  '[',  'a sh wildcard'],\n      [false, true,  '\\\\', 'shell syntax'],\n      [true,  true,  ']',  'a sh wildcard'],\n      [true,  true,  '^',  'a history expansion, zsh wildcard'],\n      [true,  true,  '`',  'shell syntax'],\n      [true,  true,  '{',  'a brace expansion start'],\n      [true,  true,  ',',  'unsafe inside a brace expansion'],\n      [true,  true,  '}',  'a brace expansion end'],\n      [true,  true,  '|',  'shell syntax'],\n      [true,  true,  '~',  'a home directory expansion'],\n      [false, false, '-', 'almost safe, except when a filename begins with dash, it needs extra handling'],\n      [false, false, '.', 'almost safe, except that dot files are excluded from * globs by default.'],\n      [false, false, ':', 'almost safe, expect when it can indicate a remote file (hostname:filename)'],\n      /* integration tests */\n      [false, false, '123-abc-абв.test.js',  'just a mere test filename'],\n      [true, true, 'some tests/my test.js',  'a filename with spaces'],\n    ];\n\n    describe('.cmd', () => {\n      const CMD_CASES = CASES.map(([expected, _shell, input, comment]) => [expected, input, comment]);\n\n      test.each(CMD_CASES)('should return %j for %j because it is %s', (expected, str, __) => {\n        expect(hasUnsafeChars.cmd(str)).toBe(expected);\n      });\n    });\n\n    describe('.shell', () => {\n      const SHELL_CASES = CASES.map(([_cmd, expected, input, comment]) => [expected, input, comment]);\n\n      test.each(SHELL_CASES)('should return %j for %j because it is %s', (expected, str, __) => {\n        expect(hasUnsafeChars.shell(str)).toBe(expected);\n      });\n    });\n  });\n\n  describe('autoEscape.cmd', () => {\n    test.each([\n      ['test', 'test'],\n      ['test string', '\"test string\"'],\n      ['test \"this\" string', '\"test \\\\\"this\\\\\" string\"'],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(autoEscape.cmd(input)).toBe(expected);\n    });\n  });\n\n  describe('autoEscape.shell', () => {\n    test.each([\n      ['test', 'test'],\n      ['test string', \"'test string'\"],\n      [\"test 'this' string\", `'test '\"'\"'this'\"'\"' string'`],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(autoEscape.shell(input)).toBe(expected);\n    });\n  });\n\n  describe('useForwardSlashes.cmd', () => {\n    test.each([\n      ['test', 'test'],\n      ['test/suite', 'test/suite'],\n      ['test\\\\suite', 'test/suite'],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(useForwardSlashes.cmd(input)).toBe(expected);\n    });\n  });\n\n  describe('useForwardSlashes.shell', () => {\n    test.each([\n      ['test', 'test'],\n      ['test/suite', 'test/suite'],\n      ['test\\\\suite', 'test\\\\suite'],\n    ])('should transform [ %s ] to [ %s ]', (input, expected) => {\n      expect(useForwardSlashes.shell(input)).toBe(expected);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/sleep.js",
    "content": "async function sleep(ms, { shouldUnref = false } = {}) {\n  return new Promise(resolve => {\n    const handle = setTimeout(resolve, ms);\n    if (shouldUnref) {\n      handle.unref();\n    }\n  });\n}\n\nmodule.exports = sleep;\n"
  },
  {
    "path": "detox/src/utils/sleep.test.js",
    "content": "describe('sleep', () => {\n  let sleep;\n  let setTimeoutMock;\n\n  beforeEach(() => {\n    setTimeoutMock = jest.spyOn(global, 'setTimeout')\n      // @ts-ignore\n      .mockImplementation((callback) => {\n        callback();\n        return ({ unref: jest.fn() });\n      });\n\n    sleep = require('./sleep');\n  });\n\n  it('should not call .unref() by default', async () => {\n    await sleep(0);\n    expect(setTimeoutMock.mock.results[0].value.unref).not.toHaveBeenCalled();\n  });\n\n  it('should call .unref() when given options = { shouldUnref: true }', async () => {\n    await sleep(0, { shouldUnref: true });\n    expect(setTimeoutMock.mock.results[0].value.unref).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/string.js",
    "content": "const _ = require('lodash');\n\nfunction capitalizeFirstLetter(string) {\n  if (_.isEmpty(string)) {\n    return '';\n  }\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction lowerCamelCaseJoin(array) {\n  if (_.isEmpty(array)) {\n    return '';\n  }\n  const [first, ...rest] = array;\n  let retVal = first;\n  _.forEach(rest, (str) => {\n    retVal += capitalizeFirstLetter(str);\n  });\n  return retVal;\n}\nmodule.exports = {\n  capitalizeFirstLetter,\n  lowerCamelCaseJoin\n};\n"
  },
  {
    "path": "detox/src/utils/string.test.js",
    "content": "describe('string', () => {\n  let string;\n\n  beforeEach(() => {\n    string = require('./string');\n  });\n\n  describe('lowerCamelCaseJoin', () => {\n    it(`should capitalize first letter of each array item after the first`, () => {\n      expect(string.lowerCamelCaseJoin(['foo', 'bar'])).toBe('fooBar');\n    });\n    it(`should gracefully handle an empty array`, () => {\n      expect(string.lowerCamelCaseJoin([])).toBe('');\n    });\n    it(`should gracefully handle empty input`, () => {\n      expect(string.lowerCamelCaseJoin()).toBe('');\n    });\n  });\n\n  describe('capitalizeFirstLetter', () => {\n    it(`should capitalize first letter`, () => {\n      expect(string.capitalizeFirstLetter('blah')).toBe('Blah');\n    });\n    it(`should gracefully handle an empty string`, () => {\n      expect(string.capitalizeFirstLetter('')).toBe('');\n    });\n    it(`should gracefully handle empty input`, () => {\n      expect(string.capitalizeFirstLetter()).toBe('');\n    });\n  });\n\n});\n"
  },
  {
    "path": "detox/src/utils/tempfile.js",
    "content": "const tmp = require('tmp');\n\ntmp.setGracefulCleanup();\n\n/**\n * Creates a temporary file path. If extension is provided, it will be appended to the path.\n * @param {string} [extension] - Optional file extension to append to the temporary file path\n * @returns {string} Path to a temporary file\n */\nmodule.exports = function(extension) {\n  const _extension = (extension && extension.startsWith('.'))\n    ? extension\n    : (extension && `.${extension}`);\n\n  return tmp.tmpNameSync({\n    template: `detox-${process.pid}-XXXXXX${_extension || ''}`,\n  });\n};\n"
  },
  {
    "path": "detox/src/utils/tempfile.test.js",
    "content": "describe('tempfile', () => {\n  let tmp;\n  let tempfile;\n\n  describe('in full integration with tmp module', () => {\n    beforeEach(() => {\n      jest.restoreAllMocks();\n      tempfile = require('./tempfile');\n    });\n\n    it('should work with the real tmp module', () => {\n      const tmpdir = require('node:os').tmpdir();\n      const path = require('node:path');\n\n      const expectedFile = path.join(tmpdir, `detox-${process.pid}-[a-zA-Z0-9]+.log`).replace(/\\\\/g, '\\\\\\\\');\n      const expectedResult = new RegExp(`^(?:/private)?${expectedFile}$`);\n\n      const result = tempfile('.log');\n      expect(result).toMatch(expectedResult);\n    });\n  });\n\n  describe('with mocked tmp module', () => {\n    beforeEach(() => {\n      jest.mock('tmp');\n      tmp = require('tmp');\n      tempfile = require('./tempfile');\n    });\n\n    const expectTmpCalled = ({ withExtension = '' } = {}) => {\n      const template = `detox-${process.pid}-XXXXXX${withExtension}`;\n      expect(tmp.tmpNameSync).toHaveBeenCalledWith({ template });\n    };\n\n    it(`should enable tmp's graceful cleanup`, () => {\n      expect(tmp.setGracefulCleanup).toHaveBeenCalled();\n    });\n\n    it('should return the value from tmp.tmpNameSync', () => {\n      const mockPath = '/tmp/detox-123-abc123';\n      tmp.tmpNameSync.mockReturnValueOnce(mockPath);\n\n      const result = tempfile();\n      expect(result).toEqual(mockPath);\n    });\n\n    it('should create a temporary file path without extension', () => {\n      tempfile();\n      expectTmpCalled();\n    });\n\n    it('should create a temporary file path with extension', () => {\n      tempfile('txt');\n      expectTmpCalled({ withExtension: '.txt' });\n    });\n\n    it('should handle extension with leading dot', () => {\n      tempfile('.txt');\n      expectTmpCalled({ withExtension: '.txt' });\n    });\n\n    it('should handle empty extension', () => {\n      tempfile('');\n      expectTmpCalled();\n    });\n\n    it('should handle undefined extension', () => {\n      tempfile();\n      expectTmpCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/trace.test.js",
    "content": "jest.mock('../logger/DetoxLogger');\n\ndescribe('Trace util', () => {\n  let trace;\n  let traceCall;\n  // @ts-ignore\n  const logger = () => require('../logger/DetoxLogger').instances[0];\n\n  beforeEach(() => {\n    ({ trace, traceCall } = require('../..'));\n  });\n\n  it('startSection -> logger.trace.begin(...)', () => {\n    const event = {\n      msg: 'event-name',\n      args: { arg1: 'val1' },\n    };\n\n    trace.startSection(event.msg, event.args);\n    expect(logger().trace.begin).toHaveBeenCalledWith(\n      event.args,\n      event.msg\n    );\n\n    trace.startSection(event.msg);\n    expect(logger().trace.begin).toHaveBeenCalledWith(\n      event.msg\n    );\n  });\n\n  it('endSection -> logger.trace.end(...)', () => {\n    const section = {\n      msg: 'section-name',\n      args: { arg1: 'val1' },\n    };\n\n    trace.endSection(section.msg, section.args);\n    expect(logger().trace.end).toHaveBeenCalledWith(section.args);\n\n    trace.endSection(section.msg);\n    expect(logger().trace.end).toHaveBeenCalledWith();\n  });\n\n  it('should trace a successful function', async () => {\n    const functionCall = () => 42;\n\n    expect(traceCall('42-call', functionCall)).toBe(42);\n    expect(logger().trace.complete).toHaveBeenCalledWith({}, '42-call', functionCall);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/traceInvocationCall.js",
    "content": "function _getCallStackTrace() {\n  return new Error().stack\n    .split('\\n')\n    .slice(1) // Ignore Error message\n    .map(line => line\n      .replace(/^\\s*at\\s+/, '')\n      .replace(process.cwd(), '')\n    )\n    .filter(line => !line.includes('/detox/src')) // Ignore detox internal calls\n    .join('\\n');\n}\n\nfunction invocationCall(logger, sectionName, invocation, action) {\n  return logger.trace.complete({\n    cat: 'ws-client,ws-client-invocation',\n    data: invocation,\n    stack: _getCallStackTrace(),\n  }, sectionName, action);\n}\n\nmodule.exports = invocationCall;\n"
  },
  {
    "path": "detox/src/utils/traceInvocationCall.test.js",
    "content": "jest.mock('../logger/DetoxLogger');\n\ndescribe('invocation call', () => {\n  let logger;\n  let traceInvocationCall;\n\n  beforeEach(() => {\n    logger = require('./logger');\n    traceInvocationCall = require('./traceInvocationCall').bind(null, logger);\n  });\n\n  it('should trace it', async () => {\n    const sectionName = 'section-name';\n    const args = {\n      cat: 'ws-client,ws-client-invocation',\n      data: {\n        foo: 'bar'\n      },\n      stack: expect.any(String)\n    };\n\n    const promise = Promise.resolve(42);\n    const result = await traceInvocationCall(sectionName, { ...args.data }, promise);\n    expect(result).toBe(42);\n    expect(logger.trace.complete).toHaveBeenCalledWith(args, sectionName, promise);\n  });\n});\n"
  },
  {
    "path": "detox/src/utils/traceMethods.js",
    "content": "function traceMethods(logger, obj, methodNames) {\n  for (const name of methodNames) {\n    const originalMethod = obj[name];\n\n    obj[name] = function tracedMethod(...args) {\n      return logger.trace.complete(\n        { args },\n        name,\n        originalMethod.apply.bind(originalMethod, obj, args)\n      );\n    };\n  }\n}\n\nmodule.exports = traceMethods;\n"
  },
  {
    "path": "detox/src/utils/uuid.js",
    "content": "function UUID() {\n  function s4() {\n    return Math.floor((1 + Math.random()) * 0x10000)\n               .toString(16)\n               .substring(1);\n  }\n\n  return s4() + s4() + '-' + s4() + '-' + s4() + '-'\n         + s4() + '-' + s4() + s4() + s4();\n}\n\nmodule.exports = {\n  UUID\n};\n"
  },
  {
    "path": "detox/src/utils/wrapWithStackTraceCutter.js",
    "content": "const DetoxError = require('../errors/DetoxError');\nconst { asError, createErrorWithUserStack, replaceErrorStack } = require('../utils/errorUtils');\n\nfunction wrapWithStackTraceCutter(obj, methodNames) {\n  for (const methodName of methodNames) {\n    const originalMethod = obj[methodName];\n\n    obj[methodName] = async function stackTraceWrapper() {\n      const errorWithUserStack = createErrorWithUserStack();\n\n      try {\n        return await originalMethod.apply(obj, arguments);\n      } catch (err) {\n        if (err instanceof DetoxError) {\n          throw replaceErrorStack(errorWithUserStack, asError(err));\n        } else {\n          throw err;\n        }\n      }\n    };\n  }\n}\n\nmodule.exports = wrapWithStackTraceCutter;\n"
  },
  {
    "path": "detox/src/utils/wrapWithStackTraceCutter.test.js",
    "content": "// @ts-nocheck\nconst errors = require('../errors');\n\nconst wrapWithStackTraceCutter = require('./wrapWithStackTraceCutter');\n\ndescribe('wrapWithStackTraceCutter', () => {\n  it.each([\n    ['DetoxError'],\n    ['DetoxConfigError'],\n    ['DetoxInternalError'],\n    ['DetoxRuntimeError'],\n  ])('should post-process known errors (e.g., %s)', async (errName) => {\n    const ErrorClass = errors[errName];\n    const obj = createThrowingObject(ErrorClass);\n\n    /** @type {Error} */\n    const anError = await obj.willThrow().catch(e => e);\n    expect(anError).toBeInstanceOf(ErrorClass);\n    expect(anError.stack).toMatch(/test error/);\n    expect(anError.stack).toMatch(/^\\s*at \\S+ \\(\\S+\\)$/m);\n    expect(anError.stack).not.toBe(obj.originalErrorStack);\n    expect(anError.stack).not.toContain('detox/src');\n  });\n\n  it.each([\n    [Error],\n  ])('should not post-process non-Detox errors (e.g., %s)', async (ErrorClass) => {\n    const obj = createThrowingObject(ErrorClass);\n\n    /** @type {Error} */\n    const anError = await obj.willThrow().catch(e => e);\n    expect(anError).toBeInstanceOf(ErrorClass);\n    expect(anError.stack).toBe(obj.originalErrorStack);\n    expect(anError.stack).toMatch(/detox[\\\\/]src/m);\n  });\n\n  it('should not much affect the original logic of wrapped methods', async () => {\n    const obj = createThrowingObject(Error);\n    await expect(obj.returns42()).resolves.toBe(42);\n  });\n\n  function createThrowingObject(ErrorClass) {\n    const originalError = new ErrorClass('test error');\n    const willThrow = () => { throw originalError; };\n    const returns42 = () => 42;\n    const result = { originalErrorStack: originalError.stack, willThrow, returns42 };\n    wrapWithStackTraceCutter(result, ['willThrow', 'returns42']);\n\n    return result;\n  }\n});\n"
  },
  {
    "path": "detox/test/.buckconfig",
    "content": "\n[android]\n  target = Google Inc.:Google APIs:23\n\n[maven_repositories]\n  central = https://repo1.maven.org/maven2\n"
  },
  {
    "path": "detox/test/.eslintignore",
    "content": "allure-report\nartifacts\ncoverage\nios\nandroid\ne2e-unhappy/early-syntax-error.test.js\n"
  },
  {
    "path": "detox/test/.eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  extends: [\n    '@react-native',\n  ],\n  plugins: [\n    'unicorn',\n  ],\n  rules: {\n    'unicorn/expiring-todo-comments': ['warn',\n      {\n        allowWarningComments: false,\n      }\n    ],\n\n    // disabled due to styling conflicts between eslint and prettier\n    'prettier/prettier': 0,\n\n    '@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],\n\n    // TODO: enable these rules gradually\n    'comma-dangle': 0,\n    'curly': 0,\n    'eol-last': 0,\n    'eqeqeq': 0,\n    'jsx-quotes': 0,\n    'keyword-spacing': 0,\n    'no-sequences': 0,\n    'no-trailing-spaces': 0,\n    'no-useless-escape': 0,\n    'quotes': 0,\n    'react-native/no-inline-styles': 0,\n    'react/no-did-mount-set-state': 0,\n    'react/self-closing-comp': 0,\n    'semi': 0,\n    'semi-spacing': 0,\n    'space-infix-ops': 0,\n  },\n  overrides: [\n    {\n      files: ['*.js', '*.ts'],\n      parser: '@typescript-eslint/parser',\n      plugins: ['@typescript-eslint/eslint-plugin'],\n      rules: {\n        'no-unused-vars': 'off',\n        'no-undef': 'off',\n        'jest/no-disabled-tests': 'warn',\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": "detox/test/.gitignore",
    "content": "*junit.xml\nintegration_artifacts/\n\ncache/\n\n# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nexample.xcworkspace\n\n# Android/IJ\n#\n.idea\n.gradle\nlocal.properties\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n\n# keystore\n*.keystore\n!debug.keystore\n\n# BUCK\nbuck-out/\n\\.buckd/\nandroid/app/libs\nandroid/keystores/debug.keystore\n\n# Temporary files created by Metro to check the health of the file watcher\n.metro-health-check*\n/ios/ReactNativeVersionExtracted.h\n"
  },
  {
    "path": "detox/test/.nycrc",
    "content": "{\n  \"cwd\": \"../..\",\n  \"reporter\": \"lcov\",\n  \"reportDir\": \"detox/test/coverage\",\n  \"include\": [\n    \"detox/**\"\n  ],\n  \"exclude\": [\n    \"detox/test/**\",\n    \"**/__test/**\",\n    \"**/__mocks__/**\",\n    \"**/*.mock.js\",\n    \"**/*.test.js\"\n  ]\n}\n"
  },
  {
    "path": "detox/test/android/app/BUCK",
    "content": "# To learn about Buck see [Docs](https://buckbuild.com/).\n# To run your application with Buck:\n# - install Buck\n# - `npm start` - to start the packager\n# - `cd android`\n# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US`\n# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n# - `buck install -r android/app` - compile, install and run application\n#\n\nlib_deps = []\n\nfor jarfile in glob(['libs/*.jar']):\n  name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]\n  lib_deps.append(':' + name)\n  prebuilt_jar(\n    name = name,\n    binary_jar = jarfile,\n  )\n\nfor aarfile in glob(['libs/*.aar']):\n  name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]\n  lib_deps.append(':' + name)\n  android_prebuilt_aar(\n    name = name,\n    aar = aarfile,\n  )\n\nandroid_library(\n  name = 'all-libs',\n  exported_deps = lib_deps\n)\n\nandroid_library(\n  name = 'app-code',\n  srcs = glob([\n    'src/main/java/**/*.java',\n  ]),\n  deps = [\n    ':all-libs',\n    ':build_config',\n    ':res',\n  ],\n)\n\nandroid_build_config(\n  name = 'build_config',\n  package = 'com.example',\n)\n\nandroid_resource(\n  name = 'res',\n  res = 'src/main/res',\n  package = 'com.example',\n)\n\nandroid_binary(\n  name = 'app',\n  package_type = 'debug',\n  manifest = 'src/main/AndroidManifest.xml',\n  keystore = '//android/keystores:debug',\n  deps = [\n    ':app-code',\n  ],\n)\n"
  },
  {
    "path": "detox/test/android/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'com.facebook.react'\napply plugin: 'kotlin-android'\napply from: '../../../android/rninfo.gradle'\n\nreact {\n    if (rnInfo.isRN75OrHigher) {\n        autolinkLibrariesWithApp()\n    }\n}\n\nandroid {\n    namespace 'com.example'\n\n    buildToolsVersion = rootProject.ext.buildToolsVersion\n    compileSdk = rootProject.ext.compileSdkVersion\n\n    if (rnInfo.isRN72OrHigher) {\n        compileOptions {\n            sourceCompatibility JavaVersion.VERSION_17\n            targetCompatibility JavaVersion.VERSION_17\n        }\n\n        kotlinOptions {\n            jvmTarget = '17'\n        }\n    } else {\n        compileOptions {\n            sourceCompatibility JavaVersion.VERSION_11\n            targetCompatibility JavaVersion.VERSION_11\n        }\n\n        kotlinOptions {\n            jvmTarget = '11'\n        }\n    }\n\n    defaultConfig {\n        applicationId 'com.wix.detox.test'\n        minSdkVersion rootProject.ext.minSdkVersion\n        targetSdkVersion rootProject.ext.targetSdkVersion\n        versionCode 1\n        versionName '1.0'\n        ndk {\n            abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'\n        }\n        testBuildType System.getProperty('testBuildType', 'debug')\n        testInstrumentationRunner 'com.example.DetoxTestAppJUnitRunner'\n\n        /*\n        testInstrumentationRunnerArguments = [\n                'detoxServer': 'ws://localhost:8099',\n                'detoxSessionId': 'test'\n        ]\n        */\n\n        missingDimensionStrategy 'detox', 'full'\n    }\n    splits {\n        abi {\n            reset()\n            enable false\n            universalApk false  // If true, also generate a universal APK\n            include 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'\n        }\n    }\n    signingConfigs {\n        release {\n            storeFile file(\"keystore.jks\")\n            storePassword \"12345678\"\n            keyAlias \"key0\"\n            keyPassword \"12345678\"\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', \"${project(':detox').projectDir}/proguard-rules-app.pro\"\n            signingConfig signingConfigs.release\n        }\n    }\n    packagingOptions {\n        pickFirst '**/libc++_shared.so'\n\n        exclude 'META-INF/DEPENDENCIES'\n        exclude 'META-INF/NOTICE'\n        exclude 'META-INF/LICENSE'\n        exclude 'META-INF/LICENSE.txt'\n        exclude 'META-INF/NOTICE.txt'\n    }\n\n    buildFeatures {\n        buildConfig = true\n    }\n}\n\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n\ndependencies {\n    // The version of react-native is set by the React Native Gradle Plugin\n    implementation('com.facebook.react:react-android')\n\n    implementation \"androidx.appcompat:appcompat:${rootProject.ext.appCompatVersion}\"\n    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'\n\n    androidTestImplementation(project(path: ':detox'))\n    androidTestImplementation 'com.github.wix-incubator:detox-butler:1.0.4'\n}\n\n// Apply Hermes as our JS engine\ndependencies {\n    implementation('com.facebook.react:hermes-android')\n}\n\n// Run this once to be able to run the application with BUCK\n// puts all compile dependencies into folder libs for BUCK to use\ntask copyDownloadableDepsToLibs(type: Copy) {\n  from configurations.implementation\n  into 'libs'\n}\n\nif (!ext.rnInfo.isRN75OrHigher) {\n    // For versions below 0.75, we need to apply the old plugin\n    apply from: file(\"../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle\"); applyNativeModulesAppBuildGradle(project)\n}\n"
  },
  {
    "path": "detox/test/android/app/proguard-rules.pro",
    "content": "#\n# Most needed rules come from React Native's proguard-rules.pro (either .aar or source) -- hence\n# the lean configuration file.\n###\n\n-dontobfuscate\n\n-dontnote android.net.**\n-dontnote org.apache.**\n\n# An addition to RN's 'keep' and 'dontwarn' configs -- need to also 'dontnote' some stuff.\n\n-dontnote com.facebook.**\n-dontnote sun.misc.Unsafe\n-dontnote okhttp3.**\n-dontnote okio.**\n\n# Do not strip any method/class that is annotated with @DoNotStrip\n# This should really come from React Native itself. See here: https://github.com/react-native-community/upgrade-support/issues/31\n-keep @com.facebook.jni.annotations.DoNotStrip class *\n-keep class * {\n    @com.facebook.proguard.annotations.DoNotStrip *;\n    @com.facebook.common.internal.DoNotStrip *;\n    @com.facebook.jni.annotations.DoNotStrip *;\n}\n-keepclassmembers class * {\n    @com.facebook.jni.annotations.DoNotStrip *;\n}\n"
  },
  {
    "path": "detox/test/android/app/src/androidTest/java/com/example/DetoxTest.java",
    "content": "package com.example;\n\nimport android.os.Bundle;\n\nimport com.wix.detox.Detox;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.platform.app.InstrumentationRegistry;\nimport androidx.test.rule.ActivityTestRule;\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class DetoxTest {\n\n    /**\n     * A selector arg that when set 'true', will launch the {@link SingleInstanceActivity} rather than the default {@link MainActivity}.\n     * Important so as to allow for some testing of Detox in this particular mode, which has been proven to introduce caveats.\n     * </br>Here for internal usage; Not external-API related.\n     */\n    private static final String USE_SINGLE_INSTANCE_ACTIVITY_ARG = \"detoxAndroidSingleInstanceActivity\";\n\n    /** Similar concept to that of {@link #USE_SINGLE_INSTANCE_ACTIVITY_ARG}. */\n    private static final String USE_CRASHING_ACTIVITY_ARG = \"detoxAndroidCrashingActivity\";\n\n    @Rule\n    public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);\n\n    @Rule\n    public ActivityTestRule<SingleInstanceActivity> mSingleInstanceActivityRule = new ActivityTestRule<>(SingleInstanceActivity.class, false, false);\n\n    @Rule\n    public ActivityTestRule<CrashingActivity> mCrashingActivityTestRule = new ActivityTestRule<>(CrashingActivity.class, false, false);\n\n    @Test\n    public void runDetoxTests() {\n        TestButlerProbe.assertReadyIfInstalled();\n\n        final ActivityTestRule<?> rule = resolveTestRule();\n        Detox.runTests(rule);\n    }\n\n    private ActivityTestRule<?> resolveTestRule() {\n        final Bundle arguments = InstrumentationRegistry.getArguments();\n        final boolean useSingleTaskActivity = Boolean.parseBoolean(arguments.getString(USE_SINGLE_INSTANCE_ACTIVITY_ARG, \"false\"));\n        final boolean useCrashingActivity = Boolean.parseBoolean(arguments.getString(USE_CRASHING_ACTIVITY_ARG, \"false\"));\n        final ActivityTestRule<?> rule =\n                useSingleTaskActivity\n                        ? mSingleInstanceActivityRule\n                        : useCrashingActivity\n                            ? mCrashingActivityTestRule\n                            : mActivityRule;\n        return rule;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/androidTest/java/com/example/DetoxTestAppJUnitRunner.java",
    "content": "package com.example;\n\nimport android.os.Bundle;\n\nimport androidx.test.runner.AndroidJUnitRunner;\n\nimport com.wix.detoxbutler.DetoxButler;\n\npublic class DetoxTestAppJUnitRunner extends AndroidJUnitRunner {\n    @Override\n    public void onStart() {\n        DetoxButler.setup(getTargetContext());\n        super.onStart();\n    }\n\n    @Override\n    public void finish(int resultCode, Bundle results) {\n        DetoxButler.teardown(getTargetContext());\n        super.finish(resultCode, results);\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/androidTest/java/com/example/TestButlerProbe.java",
    "content": "package com.example;\n\nimport android.util.Log;\n\nimport androidx.test.platform.app.InstrumentationRegistry;\n\nimport com.wix.detoxbutler.DetoxButler;\n\nclass TestButlerProbe {\n\n    private static final String LOG_TAG = TestButlerProbe.class.getSimpleName();\n\n    private TestButlerProbe() {\n    }\n\n    static void assertReadyIfInstalled() {\n        Log.i(LOG_TAG, \"Detox butler service verification started...\");\n\n        if (!isDetoxButlerServiceInstalled()) {\n            Log.w(LOG_TAG, \"Detox butler not installed on device - skipping verification\");\n            return;\n        }\n\n        assertDetoxButlerServiceReady();\n        Log.i(LOG_TAG, \"Detox butler service is up and running!\");\n    }\n\n    static private boolean isDetoxButlerServiceInstalled() {\n        return DetoxButler.isDetoxButlerServiceInstalled(InstrumentationRegistry.getInstrumentation().getContext());\n    }\n\n    static private void assertDetoxButlerServiceReady() {\n        boolean isEnabled;\n        try {\n            isEnabled = DetoxButler.tryToWaitForDetoxButlerServiceToBeEnabled(15);\n        } catch (Exception e) {\n            throw new RuntimeException(\"Detox butler service is NOT ready!\", e);\n        }\n\n        if (!isEnabled) {\n            throw new RuntimeException(\"Detox butler service is NOT ready!\");\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/AndroidManifest.xml",
    "content": "<manifest\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\"\n    >\n\n    <queries>\n        <package android:name=\"com.wix.detoxbutler\"/>\n    </queries>\n\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>\n\n    <application\n      android:name=\".MainApplication\"\n      android:allowBackup=\"false\"\n      android:label=\"@string/app_name\"\n      android:icon=\"@mipmap/ic_launcher\"\n      android:theme=\"@style/AppTheme\"\n      android:usesCleartextTraffic=\"true\"\n    >\n\n      <!--\n       The main, default activity; Note: always keep launchMode 'standard'\n       -->\n      <activity\n        android:name=\".MainActivity\"\n        android:label=\"@string/app_name\"\n        android:launchMode=\"standard\"\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize\"\n        android:windowSoftInputMode=\"adjustResize\"\n        android:exported=\"true\">\n        <intent-filter>\n            <action android:name=\"android.intent.action.MAIN\" />\n            <category android:name=\"android.intent.category.LAUNCHER\" />\n            <category android:name=\"android.intent.category.DEFAULT\" />\n        </intent-filter>\n        <intent-filter>\n            <action android:name=\"android.intent.action.VIEW\" />\n            <category android:name=\"android.intent.category.DEFAULT\" />\n            <category android:name=\"android.intent.category.BROWSABLE\" />\n            <data android:scheme=\"detoxtesturlscheme\"/>\n        </intent-filter>\n      </activity>\n\n      <!--\n       MainActivity flavor that only runs in a 'singleInstance' launch mode.\n       Executed instead of the main by the test app given a \"androidSingleTaskActivity\" arg to instrumentation.\n       -->\n      <activity\n        android:name=\".SingleInstanceActivity\"\n        android:label=\"@string/app_name_single_instance\"\n        android:launchMode=\"singleInstance\"\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\"\n        android:windowSoftInputMode=\"adjustResize\"\n        android:exported=\"true\">\n        <intent-filter>\n            <action android:name=\"android.intent.action.VIEW\" />\n            <category android:name=\"android.intent.category.DEFAULT\" />\n            <data android:scheme=\"detoxtesturlscheme.singleinstance\"/>\n        </intent-filter>\n      </activity>\n\n      <!--\n       MainActivity flavor that crashes on onResume(), thus keeping Detox from starting.\n       Used by specific Detox E2E tests, inspecting this behavior.\n       -->\n      <activity\n        android:name=\".CrashingActivity\"\n        android:label=\"@string/app_name_single_instance\"\n        />\n      <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n\n    </application>\n</manifest>\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/AnimationViewManager.java",
    "content": "package com.example;\n\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport android.animation.ValueAnimator;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\n\nimport com.example.utils.AnimatorListenerStub;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\npublic class AnimationViewManager extends SimpleViewManager<View> {\n\n    @Override\n    public String getName() {\n        return \"DetoxNativeAnimatingView\";\n    }\n\n    @Override\n    protected View createViewInstance(ThemedReactContext reactContext) {\n        final ViewGroup rootView = (ViewGroup) LayoutInflater.from(reactContext).inflate(R.layout.animation_test, null, false);\n        final ProgressBar progressBar = rootView.findViewById(R.id.animationTest_progressBar);\n        final TextView statusText = rootView.findViewById(R.id.animationTest_statusText);\n\n        final ValueAnimator animator = ObjectAnimator.ofInt(0, 100);\n        animator.setDuration(5000);\n        animator.addUpdateListener(animation -> {\n            Integer value = (Integer) animation.getAnimatedValue();\n            progressBar.setProgress(value);\n        });\n        animator.addListener(new AnimatorListenerStub() {\n            @Override\n            public void onAnimationEnd(Animator animation) {\n                statusText.setVisibility(View.VISIBLE);\n            }\n        });\n\n        final Button button = rootView.findViewById(R.id.animationTest_button);\n        button.setOnClickListener(view -> {\n            button.setEnabled(false);\n            animator.start();\n        });\n\n        return rootView;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/CrashingActivity.java",
    "content": "package com.example;\n\npublic class CrashingActivity extends MainActivity {\n    @Override\n    protected void onResume() {\n        super.onResume();\n        throw new IllegalStateException(\"This is an intentional crash!\");\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/DetoxRNHost.kt",
    "content": "package com.example\n\nimport android.app.Application\nimport com.facebook.react.PackageList\nimport com.facebook.react.ReactPackage\nimport com.facebook.react.defaults.DefaultReactNativeHost\n\ninternal class DetoxRNHost(application: Application) : DefaultReactNativeHost(application) {\n\n    override fun getUseDeveloperSupport(): Boolean {\n        return BuildConfig.DEBUG\n    }\n\n    override val isNewArchEnabled: Boolean\n        get() = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n\n    override val isHermesEnabled: Boolean\n        get() = BuildConfig.IS_HERMES_ENABLED\n\n    override fun getPackages(): List<ReactPackage> = PackageList(this).packages.apply {\n        add(NativeModulePackage())\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/DoubleTapsTextViewManager.java",
    "content": "package com.example;\n\nimport android.graphics.Color;\nimport android.view.GestureDetector;\nimport android.view.Gravity;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewGroup.LayoutParams;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\n\nimport com.example.utils.DoubleTapListenerStub;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\npublic class DoubleTapsTextViewManager extends SimpleViewManager<ViewGroup> {\n    private static class ViewState {\n        int taps = 0;\n    }\n\n    @Override\n    public String getName() {\n        return \"DetoxDoubleTapsTextView\";\n    }\n\n    @Override\n    protected ViewGroup createViewInstance(ThemedReactContext reactContext) {\n        final ViewState viewState = new ViewState();\n\n        final FrameLayout layout = new FrameLayout(reactContext);\n        layout.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\n        final TextView textView = new TextView(reactContext);\n        textView.setTag(\"doubleTappableText\");\n        textView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER));\n        textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);\n        textView.setGravity(Gravity.CENTER);\n        textView.setText(\"Double-Taps: \"+viewState.taps);\n        textView.setTextColor(Color.BLUE);\n\n        final GestureDetector gestureDetector = new GestureDetector(reactContext, new GestureDetector.SimpleOnGestureListener());\n        gestureDetector.setOnDoubleTapListener(new DoubleTapListenerStub() {\n            @Override\n            public boolean onDoubleTap(MotionEvent e) {\n                viewState.taps++;\n                textView.setText(\"Double-Taps: \"+viewState.taps);\n                return true;\n            }\n        });\n        textView.setOnTouchListener((v, event) -> gestureDetector.onTouchEvent(event));\n        textView.setOnClickListener(v -> {});\n\n        layout.addView(textView);\n        return layout;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/MainActivity.kt",
    "content": "package com.example\n\nimport android.content.Intent\nimport android.os.Build\nimport android.os.Bundle\nimport android.view.WindowInsets\nimport androidx.activity.enableEdgeToEdge\nimport androidx.core.view.WindowCompat\nimport androidx.core.view.WindowInsetsCompat\nimport com.facebook.react.ReactActivity\nimport com.facebook.react.ReactActivityDelegate\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\nimport com.facebook.react.defaults.DefaultReactActivityDelegate\n\nopen class MainActivity : ReactActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        setupEdgeToEdgeDisplay()\n        super.onCreate(savedInstanceState)\n\n    }\n\n    /**\n     * Sets up edge-to-edge display for the activity.\n     * Adds padding to the root view to accommodate system bars.\n     */\n    private fun setupEdgeToEdgeDisplay() {\n        // Enable edge-to-edge for Android 11 (API 30) and above\n        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) return\n\n        enableEdgeToEdge()\n\n        // Handle insets\n        window.decorView.setOnApplyWindowInsetsListener { view, windowInsets ->\n            val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())\n\n            // Apply padding to the root view\n            view.setPadding(\n                view.paddingLeft,\n                insets.top,\n                view.paddingRight,\n                insets.bottom\n            )\n\n            WindowInsets.CONSUMED\n        }\n    }\n\n    override fun onNewIntent(intent: Intent) {\n        super.onNewIntent(intent)\n        setIntent(intent)\n    }\n\n    /**\n     * Returns the name of the main component registered from JavaScript.\n     * This is used to schedule rendering of the component.\n     */\n    override fun getMainComponentName() = \"example\"\n\n    /**\n     * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n     * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n     */\n    override fun createReactActivityDelegate(): ReactActivityDelegate =\n        DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/MainApplication.kt",
    "content": "package com.example\n\nimport android.app.Application\nimport android.webkit.WebView\nimport com.example.utils.DetoxSoLoader\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.ReactHost\nimport com.facebook.react.ReactNativeHost\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\nimport com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n\nclass MainApplication : Application(), ReactApplication {\n    override val reactNativeHost: ReactNativeHost = DetoxRNHost(this)\n\n    override val reactHost: ReactHost\n        get() = getDefaultReactHost(applicationContext, reactNativeHost)\n\n    override fun onCreate() {\n        super.onCreate()\n        DetoxSoLoader.init(this)\n\n        WebView.setWebContentsDebuggingEnabled(true)\n        if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n            // If you opted-in for the New Architecture, we load the native entry point for this app.\n            load()\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/NativeModule.java",
    "content": "package com.example;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.util.Log;\nimport android.view.Gravity;\nimport android.widget.LinearLayout;\nimport android.widget.LinearLayout.LayoutParams;\nimport android.widget.TextView;\n\nimport com.example.utils.ReactNativeExtensionReflected;\nimport com.example.utils.ViewSpies;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\n\npublic class NativeModule extends ReactContextBaseJavaModule {\n\n    private static final String NAME = \"NativeModule\";\n\n    private ReactApplicationContext reactContext;\n\n    NativeModule(ReactApplicationContext reactContext) {\n        super(reactContext);\n        this.reactContext = reactContext;\n    }\n\n    @Override\n    public String getName() {\n        return NAME;\n    }\n\n    @ReactMethod\n    public void echoWithoutResponse(String string) {\n        Log.d(NAME, string);\n    }\n\n    @ReactMethod\n    public void echoWithResponse(String string) {\n        Log.d(NAME, string);\n    }\n\n    @ReactMethod\n    public void nativeSetTimeout(int delay, final Callback callback) {\n//        HashMap paramsMap = ((ReadableNativeMap) params).toHashMap();\n        Handler handler = new Handler(Looper.getMainLooper());\n        handler.postDelayed(callback::invoke, delay);\n    }\n\n    @ReactMethod\n    public void switchToNativeRoot() {\n        reactContext.getCurrentActivity().runOnUiThread(() -> {\n            Activity currentActivity = getCurrentActivity();\n\n            LinearLayout layout = new LinearLayout(currentActivity);\n            layout.setGravity(Gravity.CENTER);\n            LayoutParams llp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\n            TextView tv = new TextView(currentActivity);\n            tv.setText(\"this is a new native root\");\n            LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n            tv.setLayoutParams(lp);\n\n            layout.addView(tv);\n            currentActivity.setContentView(layout, llp);\n        });\n    }\n\n    @ReactMethod\n    public void switchToMultipleReactRoots() {\n        reactContext.getCurrentActivity().runOnUiThread(() -> {}); // TODO?\n    }\n\n    @ReactMethod\n    public void parseNotificationData(String innerKey, Promise promise) {\n        Bundle data = getIntentExtras(innerKey);\n        data.remove(\"launchArgs\");\n        promise.resolve(Arguments.fromBundle(data));\n    }\n\n    @ReactMethod\n    public void spyLongTaps(String testID) {\n        new ViewSpies.LongTapCrasher(testID).attach();\n    }\n\n    @ReactMethod\n    public void chokeMainThread() {\n        reactContext.getCurrentActivity().runOnUiThread(() -> {\n            try {\n                Thread.sleep(10500);\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n                throw new RuntimeException(e);\n            }\n        });\n    }\n\n    @ReactMethod\n    public void crashMainThread() {\n        reactContext.getCurrentActivity().runOnUiThread(() -> {\n            throw new RuntimeException(\"Simulated crash (native)\");\n        });\n    }\n\n    @ReactMethod\n    public void toggleNonStorageSynchronization(Boolean enable) {\n        ReactNativeExtensionReflected rnExtension = ReactNativeExtensionReflected.getInstance();\n        rnExtension.toggleUISynchronization(enable);\n        rnExtension.toggleTimersSynchronization(enable);\n        rnExtension.toggleNetworkSynchronization(enable);\n    }\n\n    private Bundle getIntentExtras(String bundleKey) {\n        final Activity currentActivity = getCurrentActivity();\n        if (currentActivity == null) {\n            return new Bundle();\n        }\n\n        final Intent intent = currentActivity.getIntent();\n        final Bundle extras = (bundleKey == null ? intent.getExtras() : intent.getBundleExtra(bundleKey));\n        if (extras == null) {\n            return new Bundle();\n        }\n\n        return extras;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/NativeModulePackage.java",
    "content": "package com.example;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class NativeModulePackage implements ReactPackage {\n\n    @Override\n    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {\n        return Arrays.asList(\n                new com.example.NativeModule(reactContext)\n        );\n    }\n\n    @Override\n    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n        return Arrays.asList(\n                new AnimationViewManager(),\n                new DoubleTapsTextViewManager(),\n                new SluggishTextTextViewManager()\n        );\n    }\n\n    public List<Class<? extends JavaScriptModule>> createJSModules() {\n        return Collections.emptyList();\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/SingleInstanceActivity.java",
    "content": "package com.example;\n\n/**\n * A flavor of the {@link MainActivity} the is set in the manifest to run at a 'single-instance' launchMode,\n * rather than at the default launch mode.\n */\npublic class SingleInstanceActivity extends MainActivity {\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/SluggishTextTextViewManager.java",
    "content": "package com.example;\n\nimport android.graphics.Color;\nimport android.util.Log;\nimport android.view.Gravity;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewConfiguration;\nimport android.view.ViewGroup;\nimport android.view.ViewGroup.LayoutParams;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\n\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\npublic class SluggishTextTextViewManager extends SimpleViewManager<ViewGroup> {\n    @Override\n    public String getName() {\n        return \"DetoxSluggishTapsTextView\";\n    }\n\n    @Override\n    protected ViewGroup createViewInstance(ThemedReactContext reactContext) {\n        final FrameLayout layout = new FrameLayout(reactContext);\n        layout.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\n        final TextView textView = new TextView(reactContext);\n        textView.setTag(\"sluggishTappableText\");\n        textView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER));\n        textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);\n        textView.setGravity(Gravity.CENTER);\n        textView.setText(\"Slow-Tap\");\n        textView.setTextColor(Color.BLUE);\n\n        textView.setOnTouchListener((v, event) -> {\n            if (event.getAction() == MotionEvent.ACTION_DOWN) {\n                try {\n                    Thread.sleep(ViewConfiguration.getLongPressTimeout());\n                } catch (InterruptedException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n            return false;\n        });\n        textView.setOnClickListener(v -> {});\n\n        layout.addView(textView);\n        return layout;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/utils/AnimatorListenerStub.java",
    "content": "package com.example.utils;\n\nimport android.animation.Animator;\n\npublic class AnimatorListenerStub implements Animator.AnimatorListener {\n    @Override\n    public void onAnimationStart(Animator animation) {\n    }\n\n    @Override\n    public void onAnimationEnd(Animator animation) {\n    }\n\n    @Override\n    public void onAnimationCancel(Animator animation) {\n    }\n\n    @Override\n    public void onAnimationRepeat(Animator animation) {\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/utils/DetoxSoLoader.kt",
    "content": "package com.example.utils\n\nimport android.content.Context\nimport com.facebook.react.modules.systeminfo.ReactNativeVersion\nimport com.facebook.soloader.SoLoader\n\nprivate const val OpenSourceMergedSoMappingClassName = \"com.facebook.react.soloader.OpenSourceMergedSoMapping\"\nprivate const val ExternalSoMappingClassName =\"com.facebook.soloader.ExternalSoMapping\"\n\nobject DetoxSoLoader {\n    fun init(appContext: Context) {\n        if (ReactNativeVersion.VERSION.run { get(\"minor\") as Int } >= 76) {\n            val mergedSoMappingClass = Class.forName(OpenSourceMergedSoMappingClassName)\n            val externalSoMapping = Class.forName(ExternalSoMappingClassName)\n            val initMethod = SoLoader::class.java.getMethod(\"init\", Context::class.java, externalSoMapping)\n            initMethod.invoke(null, appContext, mergedSoMappingClass.getDeclaredField(\"INSTANCE\").get(null))\n        } else {\n            SoLoader.init(appContext, false)\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/utils/DoubleTapListenerStub.java",
    "content": "package com.example.utils;\n\nimport android.view.GestureDetector;\nimport android.view.MotionEvent;\n\npublic class DoubleTapListenerStub implements GestureDetector.OnDoubleTapListener {\n    @Override\n    public boolean onSingleTapConfirmed(MotionEvent e) {\n        return false;\n    }\n\n    @Override\n    public boolean onDoubleTap(MotionEvent e) {\n        return false;\n    }\n\n    @Override\n    public boolean onDoubleTapEvent(MotionEvent e) {\n        return false;\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/utils/ReactNativeExtensionReflected.java",
    "content": "package com.example.utils;\n\nimport java.lang.reflect.Method;\n\npublic class ReactNativeExtensionReflected {\n    private final Method toggleUISynchronization;\n    private final Method toggleTimersSynchronization;\n    private final Method toggleNetworkSynchronization;\n\n    static private ReactNativeExtensionReflected INSTANCE = null;\n    static public ReactNativeExtensionReflected getInstance() {\n        if (INSTANCE == null) {\n            INSTANCE = new ReactNativeExtensionReflected();\n        }\n        return INSTANCE;\n    }\n\n    private ReactNativeExtensionReflected() {\n        try {\n            Class<?> clazz = Class.forName(\"com.wix.detox.reactnative.ReactNativeExtension\");\n            toggleUISynchronization = clazz.getDeclaredMethod(\"toggleUISynchronization\", boolean.class);\n            toggleTimersSynchronization = clazz.getDeclaredMethod(\"toggleTimersSynchronization\", boolean.class);\n            toggleNetworkSynchronization = clazz.getDeclaredMethod(\"toggleNetworkSynchronization\", boolean.class);\n        } catch (Exception e) {\n            throw new IllegalStateException(e);\n        }\n    }\n\n    public void toggleUISynchronization(boolean enable) {\n        invokeToggleMethod(toggleUISynchronization, enable);\n    }\n\n    public void toggleTimersSynchronization(boolean enable) {\n        invokeToggleMethod(toggleTimersSynchronization, enable);\n    }\n\n    public void toggleNetworkSynchronization(boolean enable) {\n        invokeToggleMethod(toggleNetworkSynchronization, enable);\n    }\n\n    private void invokeToggleMethod(Method method, boolean enable) {\n        try {\n            method.invoke(null, enable);\n        } catch (Exception e) {\n            throw new IllegalStateException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/java/com/example/utils/ViewSpies.java",
    "content": "package com.example.utils;\n\nimport android.view.View;\n\nimport com.facebook.react.uimanager.util.ReactFindViewUtil;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\npublic interface ViewSpies {\n\n    /**\n     * Implementation note: For this purpose, a simpler RN API exists in the same class -\n     * {@link ReactFindViewUtil#addViewListener(ReactFindViewUtil.OnViewFoundListener)}.\n     * However, it is found to be a bit buggy since it removes all listeners immediately\n     * after being called (i.e. while iterating) with no thread-sync mechanisms to protect it.\n     * If real life (CI), we've genuinely seen that it throws ConcurrentModificationException exceptions,\n     * on occasions (and why wouldn't it? - our demo app's ActionsScreen has multiple views subscribing and\n     * called concurrently; could it be that not always everything is run in the main thread?).\n     * Therefore, we use here {@link ReactFindViewUtil#addViewsListener(ReactFindViewUtil.OnMultipleViewsFoundListener, Set)},\n     * which is too generic but nevertheless allows us to better control when we are to be removed.\n     */\n    abstract class BaseViewSpy implements ReactFindViewUtil.OnMultipleViewsFoundListener {\n        private final String testID;\n\n        private BaseViewSpy(String testID) {\n            this.testID = testID;\n        }\n\n        public void attach() {\n            final Set<String> nativeIds = new HashSet<>();\n            nativeIds.add(testID);\n\n            ReactFindViewUtil.addViewsListener(this, nativeIds);\n        }\n\n        String getTestID() {\n            return testID;\n        }\n\n        abstract void handleViewFound(View view);\n\n        @Override\n        public void onViewFound(View view, String nativeId) {\n            handleViewFound(view);\n            view.post(() -> ReactFindViewUtil.removeViewsListener(this));\n        }\n    }\n\n    class LongTapCrasher extends BaseViewSpy {\n        public LongTapCrasher(String testID) {\n            super(testID);\n        }\n\n        @Override\n        protected void handleViewFound(View view) {\n            view.setOnLongClickListener(v -> {\n                throw new IllegalStateException(\"Validation failed: component \\\"\" + getTestID() + \"\\\" was long-tapped!!!\");\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/android/app/src/main/res/layout/animation_test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    >\n\n    <Button\n        android:id=\"@+id/animationTest_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Start\"\n        android:tag=\"startButton\"\n        android:layout_marginBottom=\"16dp\"\n        />\n\n    <ProgressBar\n        android:id=\"@+id/animationTest_progressBar\"\n        style=\"?android:attr/progressBarStyleHorizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"32dp\"\n        android:layout_marginHorizontal=\"16dp\"\n        android:indeterminate=\"false\"\n        android:max=\"100\"\n        android:layout_marginBottom=\"16dp\"\n        />\n\n    <TextView\n        android:id=\"@+id/animationTest_statusText\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Animation Complete\"\n        android:visibility=\"invisible\"\n        />\n\n</LinearLayout>\n"
  },
  {
    "path": "detox/test/android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Detox Test</string>\n    <string name=\"app_name_single_instance\">Detox Test (SingleInstance)</string>\n    <string name=\"app_name_crashing\">Detox Test (Crashing)</string>\n</resources>\n"
  },
  {
    "path": "detox/test/android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "detox/test/android/build.gradle",
    "content": "buildscript {\n    apply from: '../../android/rninfo.gradle'\n\n    ext {\n        isOfficialDetoxApp = true\n        if (ext.rnInfo.isRN80OrHigher) {\n            kotlinVersion = '2.1.20'\n        } else {\n            kotlinVersion = '2.0.20'\n        }\n        buildToolsVersion = '36.0.0'\n        compileSdkVersion = 36\n        targetSdkVersion = 36\n        minSdkVersion = 26\n        appCompatVersion = '1.7.1'\n    }\n    ext.detoxKotlinVersion = ext.kotlinVersion\n\n    repositories {\n        google()\n        mavenCentral()\n        mavenLocal()\n    }\n\n    dependencies {\n        classpath \"com.android.tools.build:gradle\"\n        classpath 'com.facebook.react:react-native-gradle-plugin'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // Needed by Spek (https://spekframework.org/setup-android)\n        // Here in order to enable unit-tests run from Android Studio when working on the test app.\n        classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        mavenLocal()\n    }\n}\n\nsubprojects {\n    afterEvaluate { p ->\n        if (p.hasProperty('android')) {\n            android {\n                buildToolsVersion rootProject.ext.buildToolsVersion\n            }\n        }\n    }\n}\n\nif (ext.rnInfo.isRN73OrHigher) {\n    apply plugin: \"com.facebook.react.rootproject\"\n}\n"
  },
  {
    "path": "detox/test/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.14.3-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "detox/test/android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m\norg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n\n# Use this property to enable or disable the Hermes JS engine.\n# If set to false, you will be using JSC instead.\nhermesEnabled=true\n\nreactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64\nnewArchEnabled=true\nedgeToEdgeEnabled=false\n"
  },
  {
    "path": "detox/test/android/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd \"${APP_HOME:-./}\" > /dev/null && pwd -P ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    if ! command -v java >/dev/null 2>&1\n    then\n        die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "detox/test/android/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 0 goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "detox/test/android/keystores/BUCK",
    "content": "keystore(\n    name = \"debug\",\n    properties = \"debug.keystore.properties\",\n    store = \"debug.keystore\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "detox/test/android/keystores/debug.keystore.properties",
    "content": "key.store=debug.keystore\nkey.alias=androiddebugkey\nkey.store.password=android\nkey.alias.password=android\n"
  },
  {
    "path": "detox/test/android/settings.gradle",
    "content": "// RN75+_BLOCK_START\npluginManagement { includeBuild(\"../node_modules/@react-native/gradle-plugin\") }\nplugins { id(\"com.facebook.react.settings\") }\nextensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }\n// RN75+_BLOCK_END\n\napply from: file(\"../../android/rninfo.gradle\")\nprintln \"[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})\"\n\nif (!ext.rnInfo.isRN75OrHigher) {\n    // For versions below 0.75, we need to apply the old plugin\n    apply from: file(\"../node_modules/@react-native-community/cli-platform-android/native_modules.gradle\"); applyNativeModulesSettingsGradle(settings)\n}\n\nrootProject.name = 'DetoxTest'\ninclude ':app'\n\nif (ext.rnInfo.isRN72OrHigher) {\n    includeBuild('../node_modules/@react-native/gradle-plugin')\n} else {\n    includeBuild('../node_modules/react-native-gradle-plugin')\n}\n\ninclude ':detox'\nproject(':detox').projectDir = new File(rootProject.projectDir, '../../android/detox')\n"
  },
  {
    "path": "detox/test/e2e/01.sanity.test.js",
    "content": "/**\n * Sanity suite\n * ------------\n *\n * Tests in this suite ensure that the most basic functionality of Detox is\n * working as expected: app launches, element matching, assertions, etc.\n *\n * @severity critical\n * @tag sanity\n */\ndescribe('Sanity', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await detox.traceCall('Navigate to sanity', element(by.text('Sanity')).tap());\n  });\n\n  it('should have welcome screen', async () => {\n    await expect(element(by.text('Welcome'))).toBeVisible();\n    await expect(element(by.text('Say Hello'))).toBeVisible();\n    await expect(element(by.text('Say World'))).toBeVisible();\n  });\n\n  it('should show hello screen after tap', async () => {\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('should show world screen after tap', async () => {\n    await element(by.text('Say World')).tap();\n    await expect(element(by.text('World!!!'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/02.matchers.test.js",
    "content": "const { expectToThrow } = require('./utils/custom-expects');\nconst { isRNNewArch } = require('../../src/utils/rn-consts/rn-consts');\n\ndescribe('Matchers', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Matchers')).tap();\n  });\n\n  it('should match elements by text', async () => {\n    await element(by.label('Label')).tap();\n    await expect(element(by.text(\"Label Working!!!\"))).toBeVisible();\n  });\n\n  it('should match elements by regex text', async () => {\n    await element(by.label('Label')).tap();\n    await expect(element(by.text(/^[a-z]* working!+$/i))).toBeVisible();\n  });\n\n  it('should match elements by (accessibility) label', async () => {\n    await element(by.label('Label')).tap();\n    await expect(element(by.label('Label Working!!!'))).toBeVisible();\n  });\n\n  it('should match elements by regex (accessibility) label', async () => {\n    await element(by.label('Label')).tap();\n    await expect(element(by.label(/^[a-z]* working!+$/i))).toBeVisible();\n  });\n\n  it('should match elements by (accessibility) id', async () => {\n    await element(by.id('UniqueId345')).tap();\n    await expect(element(by.text('ID Working!!!'))).toBeVisible();\n  });\n\n  it('should match elements by regex (accessibility) id', async () => {\n    await element(by.id(/UniqueId\\d{3}/)).tap();\n    await expect(element(by.text('ID Working!!!'))).toBeVisible();\n  });\n\n  it('should match elements by index', async () => {\n    await element(by.text('Index')).atIndex(0).tap();\n    await expect(element(by.text('First button pressed!!!'))).toBeVisible();\n  });\n\n  it('should give a clear error when index-matching fails (i.e. index out of bounds)', async () => {\n    const expectedMessage = device.getPlatform() === 'android'\n      ? 'View at index #3, of those matching MATCHER'\n      : 'Index 3 beyond bounds [0 .. 2] for “MATCHER';\n\n    await expectToThrow(\n      () => element(by.text('Index')).atIndex(3).tap(),\n      expectedMessage,\n    );\n  });\n\n  it('should be able to swipe elements matched by index', async () => {\n    await element(by.text('Index')).atIndex(0).swipe('down', 'fast', 0.7); //No need to do here anything, just let it not crash.\n  });\n\n  it('should match elements by type (native class)', async () => {\n    const iOSClass = isRNNewArch ? 'RCTImageComponentView' : 'RCTImageView';\n    const byType = device.getPlatform() === 'ios' ? by.type(iOSClass) : by.type('android.widget.ImageView');\n\n    await expect(element(byType)).toBeVisible();\n    await element(byType).tap();\n    await expect(element(byType)).not.toBeVisible();\n  });\n\n  // https://developer.apple.com/documentation/uikit/accessibility/uiaccessibility/accessibility_traits\n  // Accessibility Inspector in the simulator can help investigate traits\n  it(':ios: should match elements by accessibility traits', async () => {\n    await element(by.traits(['button'])).tap();\n    await expect(element(by.text('Traits Working!!!'))).toBeVisible();\n  });\n\n  it('should match elements with ancenstor (parent)', async () => {\n    await expect(element(by.id('Grandson883').withAncestor(by.id('Son883')))).toExist();\n    await expect(element(by.id('Son883').withAncestor(by.id('Grandson883')))).not.toExist();\n    await expect(element(by.id('Grandson883').withAncestor(by.id('Father883')))).toExist();\n    await expect(element(by.id('Father883').withAncestor(by.id('Grandson883')))).not.toExist();\n    await expect(element(by.id('Grandson883').withAncestor(by.id('Grandfather883')))).toExist();\n    await expect(element(by.id('Grandfather883').withAncestor(by.id('Grandson883')))).not.toExist();\n  });\n\n  it('should match elements with descendant (child)', async () => {\n    await expect(element(by.id('Son883').withDescendant(by.id('Grandson883')))).toExist();\n    await expect(element(by.id('Grandson883').withDescendant(by.id('Son883')))).not.toExist();\n    await expect(element(by.id('Father883').withDescendant(by.id('Grandson883')))).toExist();\n    await expect(element(by.id('Grandson883').withDescendant(by.id('Father883')))).not.toExist();\n    await expect(element(by.id('Grandfather883').withDescendant(by.id('Grandson883')))).toExist();\n    await expect(element(by.id('Grandson883').withDescendant(by.id('Grandfather883')))).not.toExist();\n  });\n\n  it('should match elements by using two matchers together with and', async () => {\n    await expect(element(by.id('UniqueId345').and(by.text('ID')))).toExist();\n    await expect(element(by.id('UniqueId345').and(by.text('RandomJunk')))).not.toExist();\n    await expect(element(by.id('UniqueId345').and(by.label('RandomJunk')))).not.toExist();\n    if (device.getPlatform() === 'ios') {\n      await expect(element(by.id('UniqueId345').and(by.traits(['button'])))).not.toExist();\n    }\n  });\n\n  it(':ios: should choose from multiple elements matching the same matcher using index', async () => {\n    await expect(element(by.text('Product')).atIndex(2)).toHaveId('ProductId002');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/03.actions-scroll.test.js",
    "content": "describe('Actions - Scroll', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Actions')).tap();\n  });\n\n  it('should scroll for a small amount in direction', async () => {\n    await expect(element(by.text('Text1'))).toBeVisible();\n    await expect(element(by.text('Text4'))).not.toBeVisible();\n    await expect(element(by.id('ScrollView161'))).toBeVisible();\n    await element(by.id('ScrollView161')).scroll(100, 'down');\n    await expect(element(by.text('Text1'))).not.toBeVisible();\n    await expect(element(by.text('Text4'))).toBeVisible();\n    await element(by.id('ScrollView161')).scroll(100, 'up');\n    await expect(element(by.text('Text1'))).toBeVisible();\n    await expect(element(by.text('Text4'))).not.toBeVisible();\n  });\n\n  it('should scroll for a large amount in direction', async () => {\n    await expect(element(by.text('Text12'))).not.toBeVisible();\n    await element(by.id('ScrollView161')).scroll(1000, 'down');\n    await expect(element(by.text('Text12'))).toBeVisible();\n  });\n\n  it('should scroll for a large amount in horizontal direction', async () => {\n    await expect(element(by.text('HText7'))).not.toBeVisible();\n    await element(by.id('ScrollViewH')).scroll(220, 'right');\n    await expect(element(by.text('HText7'))).toBeVisible();\n  });\n\n  it('should scroll to edge', async () => {\n    await expect(element(by.text('Text12'))).not.toBeVisible();\n    await element(by.id('ScrollView161')).scrollTo('bottom');\n    await expect(element(by.text('Text12'))).toBeVisible();\n    await element(by.id('ScrollView161')).scrollTo('top');\n    await expect(element(by.text('Text1'))).toBeVisible();\n  });\n\n  it('should scroll horizontally to edge', async () => {\n    await expect(element(by.text('HText8'))).not.toBeVisible();\n    await element(by.id('ScrollViewH')).scrollTo('right');\n    await expect(element(by.text('HText8'))).toBeVisible();\n    await element(by.id('ScrollViewH')).scrollTo('left');\n    await expect(element(by.text('HText1'))).toBeVisible();\n  });\n\n  it('should scroll to edge from a custom start-position ratio', async () => {\n    await expect(element(by.text('Text12'))).not.toBeVisible();\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollView161')).scrollTo('bottom', 0.2, 0.4);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('Text12'))).toBeVisible();\n\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollView161')).scrollTo('top', 0.8, 0.6);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('Text1'))).toBeVisible();\n  });\n\n  it('should scroll to edge horizontally from a custom start-position ratio', async () => {\n    await expect(element(by.text('HText8'))).not.toBeVisible();\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollViewH')).scrollTo('right', 0.8, 0.6);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('HText8'))).toBeVisible();\n\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollViewH')).scrollTo('left',0.2, 0.4);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('HText1'))).toBeVisible();\n  });\n\n  it('should scroll from a custom start-position ratio', async () => {\n    await expect(element(by.text('Text12'))).not.toBeVisible();\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollView161')).scroll(550, 'down', 0.8, 0.6);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('Text12'))).toBeVisible();\n\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollView161')).scroll(550, 'up', 0.2, 0.4);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('Text12'))).not.toBeVisible();\n  });\n\n  it('should scroll horizontally from a custom start-position ratio', async () => {\n    await expect(element(by.text('HText6'))).not.toBeVisible();\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollViewH')).scroll(220, 'right', 0.8, 0.6);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('HText6'))).toBeVisible();\n\n    await element(by.id('toggleScrollOverlays')).tap();\n    await element(by.id('ScrollViewH')).scroll(220, 'left', 0.2, 0.4);\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('HText6'))).not.toBeVisible();\n  });\n\n  it(':android: should be able to scrollToIndex on horizontal scrollviews', async () => {\n    // should ignore out of bounds children\n    await element(by.id('ScrollViewH')).scrollToIndex(3000);\n    await element(by.id('ScrollViewH')).scrollToIndex(-1);\n    await expect(element(by.text('HText1'))).toBeVisible();\n\n    await expect(element(by.text('HText8'))).not.toBeVisible();\n    await element(by.id('ScrollViewH')).scrollToIndex(7);\n    await expect(element(by.text('HText8'))).toBeVisible();\n    await expect(element(by.text('HText1'))).not.toBeVisible();\n\n    await element(by.id('ScrollViewH')).scrollToIndex(0);\n    await expect(element(by.text('HText1'))).toBeVisible();\n    await expect(element(by.text('HText8'))).not.toBeVisible();\n  });\n\n  it('should not scroll horizontally when scroll view is covered', async () => {\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('HText1'))).toBeVisible(1);\n\n    try {\n      await element(by.id('ScrollViewH')).scroll(200, 'right');\n    } catch {}\n\n    await expect(element(by.text('HText1'))).toBeVisible(1);\n  });\n\n  it('should not scroll vertically when scroll view is covered', async () => {\n    await element(by.id('toggleScrollOverlays')).tap();\n    await expect(element(by.text('Text1'))).toBeVisible(1);\n\n    try {\n      await element(by.id('ScrollView161')).scroll(200, 'down');\n    } catch {}\n\n    await expect(element(by.text('Text1'))).toBeVisible(1);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/03.actions.test.js",
    "content": "const { isRNNewArch } = require('../../src/utils/rn-consts/rn-consts');\nconst driver = require('./drivers/actions-driver').actionsScreenDriver;\n\ndescribe('Actions', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Actions')).tap();\n  });\n\n  it('should tap on an element', async () => {\n    await element(by.text('Tap Me')).tap();\n    await expect(element(by.text('Tap Working!!!'))).toBeVisible();\n  });\n\n  it('should long press on an element', async () => {\n    await element(by.text('Tap Me')).longPress();\n    await expect(element(by.text('Long Press Working!!!'))).toBeVisible();\n  });\n\n  it('should long press with duration on an element', async () => {\n    await element(by.text('Long Press Me 1.5s')).longPress(1500);\n    await expect(element(by.text('Long Press With Duration Working!!!'))).toBeVisible();\n  });\n\n  it('should long press with point', async () => {\n    await element(by.text('Long Press on Top Left')).longPress({ x: 5, y: 5 });\n    await expect(element(by.text('Long Press on Top Left Working!!!'))).toBeVisible();\n  });\n\n  it('should not succeed in long pressing with point outside the target area', async () => {\n    await element(by.text('Long Press on Top Left')).longPress({ x: 15, y: 15 });\n    await expect(element(by.text('Long Press on Top Left Working!!!'))).not.toBeVisible();\n  });\n\n  it(':android: should tap on an element at point', async () => {\n    await driver.tapsElement.tapAtPoint();\n    await driver.tapsElement.assertTappedOnce();\n  });\n\n  it.each([\n    'activate',\n    'magicTap',\n    'escape',\n    'increment',\n    'decrement',\n    'longpress',\n    'custom',\n  ])('should perform %s accessibilityAction', async (actionName) => {\n    await element(by.id('View7991')).performAccessibilityAction(actionName);\n    await expect(\n      element(by.text(`Accessibility Action ${actionName} Working!!!`)),\n    ).toBeVisible();\n  });\n\n  describe('multi-tapping', () => {\n    it('should multi tap on an element', async () => {\n      await driver.tapsElement.multiTap();\n      await driver.tapsElement.assertMultiTapped();\n    });\n\n    it(':android: should properly double-tap on an element', async () => {\n      await driver.doubleTapsElement.doubleTap();\n      await driver.doubleTapsElement.assertTapsCount(1);\n\n      await driver.doubleTapsElement.doubleTap();\n      await driver.doubleTapsElement.assertTapsCount(2);\n\n      await driver.doubleTapsElement.doubleTap();\n      await driver.doubleTapsElement.assertTapsCount(3);\n    });\n\n    it(':android: should fail to apply 2 distinct taps on a double-tap element', async () => {\n      await driver.doubleTapsElement.tapTwice();\n      await driver.doubleTapsElement.assertNoTaps();\n\n      await driver.doubleTapsElement.tapTwice();\n      await driver.doubleTapsElement.assertNoTaps();\n\n      await driver.doubleTapsElement.tapTwice();\n      await driver.doubleTapsElement.assertNoTaps();\n    });\n\n    it(':android: should fail to register a tap following a multi-tap as a double-tap', async () => {\n      await driver.doubleTapsElement.multiTapOnce();\n      await driver.doubleTapsElement.tapOnce();\n      await driver.doubleTapsElement.assertNoTaps();\n    });\n\n    it(':android: should fail to apply 2 distinct taps on a double-tap element at explicit point', async () => {\n      await driver.doubleTapsElement.tapAtPointTwice();\n      await driver.doubleTapsElement.assertNoTaps();\n    });\n  });\n\n  it.skip(':android: should throw if tap handling is too slow', async () => {\n    try {\n      await driver.sluggishTapElement.tap();\n    } catch (e) {\n      console.log('Got an expected error', e);\n      if (!e.toString().includes('Tap handled too slowly, and turned into a long-tap!')) {\n        throw new Error('Error content isn\\'t as expected!');\n      }\n      return;\n    }\n\n    throw new Error('Expected an error');\n  });\n\n  it('should type in an element', async () => {\n    const typedText = device.getPlatform() === 'ios' ? 'Type Working 123 אֱבּג абв!!!' : \"Type Working!!!\";\n    await element(by.id('UniqueId937')).typeText(typedText);\n    await expect(element(by.text(typedText))).toBeVisible();\n  });\n\n  it(':ios: should type in a wrapped element', async () => {\n    const typedText = device.getPlatform() === 'ios' ? 'Type Working 123 אֱבּג абв!!!' : \"Type Working!!!\";\n    await element(by.id('UniqueId937_wrapper')).typeText(typedText);\n    await expect(element(by.text(typedText))).toBeVisible();\n  });\n\n  it(':ios: should fail typing in a view without text element', async () => {\n    const typedText = 'Won\\'t be typed at all';\n    let failed = false;\n    try {\n      await element(by.id('NoTextInputInside')).typeText(typedText);\n    } catch (ex) {\n      failed = true;\n    }\n\n    if (failed === false) {\n      throw new Error('Test should have thrown an error, but did not');\n    }\n  });\n\n  it('should press the backspace key on an element', async () => {\n    const typedText = 'test';\n    await element(by.id('UniqueId937')).typeText(typedText + 'x');\n    await element(by.id('UniqueId937')).tapBackspaceKey();\n    await expect(element(by.text(typedText))).toBeVisible();\n  });\n\n  it('should press the return key on an element', async () => {\n    await element(by.id('UniqueId937')).tapReturnKey();\n    await expect(element(by.text('Return Working!!!'))).toBeVisible();\n  });\n\n  it('should clear text in an element', async () => {\n    if (device.getPlatform() === 'ios') {\n      //Add a complex string on iOS to ensure clear works as expected.\n      const typedText = 'Clear this אֱבּג';\n      await element(by.id('UniqueId005')).replaceText(typedText);\n    }\n    await element(by.id('UniqueId005')).clearText();\n    await expect(element(by.text('Clear Working!!!'))).toBeVisible();\n  });\n\n  it('should replace text in an element', async () => {\n    await element(by.id('UniqueId006')).replaceText('replaced_text');\n    await expect(element(by.text('Replace Working!!!'))).toBeVisible();\n  });\n\n\n  it('should swipe down until pull to reload is triggered', async () => {\n    await element(by.id('ScrollView799')).swipe('down', 'fast');\n    await expect(element(by.text('PullToReload Working!!!'))).toBeVisible();\n  });\n\n  it('should swipe vertically', async () => {\n    await expect(element(by.text('Text1'))).toBeVisible();\n    await element(by.id('ScrollView161')).swipe('up');\n\n    if (device.getPlatform() === 'ios') {\n      // This won't work in Android, see related issue: https://github.com/facebook/react-native/issues/23870\n      await expect(element(by.text('Text1'))).not.toBeVisible();\n    }\n\n    await element(by.id('ScrollView161')).swipe('down');\n    await expect(element(by.text('Text1'))).toBeVisible();\n  });\n\n  it('should swipe horizontally', async () => {\n    await expect(element(by.text('HText1'))).toBeVisible();\n\n    await element(by.id('ScrollViewH')).swipe('left');\n    await expect(element(by.text('HText1'))).not.toBeVisible();\n\n    await element(by.id('ScrollViewH')).swipe('right');\n    await expect(element(by.text('HText1'))).toBeVisible();\n  });\n\n  it('should swipe vertically by offset from specified positions', async () => {\n    await element(by.id('toggleScrollOverlays')).tap();\n\n    await element(by.id('ScrollView161')).swipe('up', 'slow', NaN, 0.9, 0.95);\n    if (device.getPlatform() === 'ios') {\n      // This won't work in Android, see related issue: https://github.com/facebook/react-native/issues/23870\n      await expect(element(by.text('Text1'))).not.toBeVisible(1);\n    }\n\n    await element(by.id('ScrollView161')).swipe('down', 'fast', NaN, 0.1, 0.05);\n    await expect(element(by.text('Text1'))).toBeVisible(1);\n  });\n\n  it('should swipe horizontally by offset from specified positions ', async () => {\n    await element(by.id('toggleScrollOverlays')).tap();\n\n    await element(by.id('ScrollViewH')).swipe('left', 'slow', 0.28, 0.85, 0.75);\n    await expect(element(by.text('HText1'))).not.toBeVisible(1);\n\n    await element(by.id('ScrollViewH')).swipe('right', 'fast', 0.28, 0.15, 0.25);\n    await expect(element(by.text('HText1'))).toBeVisible(1);\n  });\n\n  it('should not wait for long timeout (>1.5s)', async () => {\n    await element(by.id('WhyDoAllTheTestIDsHaveTheseStrangeNames')).tap();\n    await expect(element(by.id('WhyDoAllTheTestIDsHaveTheseStrangeNames'))).toBeVisible();\n  });\n\n  it(':ios: should zoom in and out the pinchable scrollview', async () => {\n    await element(by.id('PinchableScrollView')).pinch(1.5);\n    await expect(element(by.id('UniqueId007'))).not.toBeVisible();\n    await element(by.id('PinchableScrollView')).pinch(0.75, 'slow');\n    await expect(element(by.id('UniqueId007'))).toBeVisible();\n  });\n\n  it('should adjust slider and assert its value', async () => {\n    const reactSliderId = 'sliderWithASimpleID';\n    await expect(element(by.id(reactSliderId))).toHaveSliderPosition(0.25);\n    await element(by.id(reactSliderId)).adjustSliderToPosition(0.75);\n    await expect(element(by.id(reactSliderId))).not.toHaveSliderPosition(0.74);\n    await expect(element(by.id(reactSliderId))).toHaveSliderPosition(0.74, 0.1);\n\n    // On iOS + legacy arch the accessibilityValue is set to the slider value, but not on android\n    if (device.getPlatform() === 'ios' && !isRNNewArch) {\n      await expect(element(by.id(reactSliderId))).toHaveValue('75%');\n    }\n  });\n\n  it('should expect text fields to be focused after tap but not before', async () => {\n    const textField1 = element(by.id('UniqueId005'));\n    const textField2 = element(by.id('UniqueId006'));\n\n    await expect(textField1).toBeNotFocused();\n    await expect(textField2).toBeNotFocused();\n    await expect(textField1).not.toBeFocused();\n    await expect(textField2).not.toBeFocused();\n\n    await textField1.tap();\n    await expect(textField1).toBeFocused();\n    await expect(textField2).toBeNotFocused();\n    await expect(textField2).not.toBeFocused();\n\n    await textField2.tap();\n    await expect(textField1).toBeNotFocused();\n    await expect(textField1).not.toBeFocused();\n    await expect(textField2).toBeFocused();\n  });\n\n  describe('pending interactions', () => {\n    const multipleInteractionsWarning = 'Detox has detected multiple interactions taking place simultaneously. ' +\n      'Have you forgotten to apply an await over one of the Detox actions in your test code?';\n\n    it('should throw an exception when attempting to send an interaction while another is pending', async () => {\n      element(by.id('UniqueId937')).typeText('one ')\n        .catch(e => {\n          if (!e.toString().includes(multipleInteractionsWarning)) {\n            throw new Error('Test should have thrown a multiple interactions error, but did not');\n          }\n        });\n      await element(by.id('UniqueId937')).typeText(' two')\n        .catch(e => {\n          if (!e.toString().includes(multipleInteractionsWarning)) {\n            throw new Error('Test should have thrown a multiple interactions error, but did not');\n          }\n        });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/03.actions.visibility-workaround.test.js",
    "content": "const {scrollViewDriver} = require('./drivers/fs-scroll-driver');\n\n/**\n * A mini suite providing an alternative to tests failing due to issues found in RN 58+ on Android (see\n * https://github.com/facebook/react-native/issues/23870).\n * It basically runs similar 'action' use cases -- all of which involve visibility and scrolling, but in a\n * setup where they <i>can</i> pass, so as to assert that the core Detox functionality is valid nevertheless.\n */\ndescribe(':android: Visibility-bug workaround actions', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('FS Scroll Actions')).tap();\n  });\n\n  it('should scroll for a small amount in direction', async () => {\n    await expect(scrollViewDriver.element()).toBeVisible();\n    await expect(scrollViewDriver.firstItem()).toBeVisible();\n    await expect(scrollViewDriver.lastItem()).not.toBeVisible();\n\n    await scrollViewDriver.scrollBy(60);\n    await expect(scrollViewDriver.firstItem()).not.toBeVisible();\n    await expect(scrollViewDriver.secondItem()).toBeVisible();\n\n    await scrollViewDriver.scrollBy(-60);\n    await expect(scrollViewDriver.firstItem()).toBeVisible();\n    await expect(scrollViewDriver.lastItem()).not.toBeVisible();\n  });\n\n  it('should scroll for a large amount in direction', async () => {\n    await expect(scrollViewDriver.element()).toBeVisible();\n    await expect(scrollViewDriver.firstItem()).toBeVisible();\n    await expect(scrollViewDriver.lastItem()).not.toBeVisible();\n\n    await scrollViewDriver.scrollBy(3000);\n\n    await expect(scrollViewDriver.firstItem()).not.toBeVisible();\n    await expect(scrollViewDriver.lastItem()).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/03.integ-actions.test.js",
    "content": "const {scrollViewDriver} = require('./drivers/fs-scroll-driver');\nconst {scrollingTextInputsDriver, scrollingTextsDriver} = require('./drivers/integ-actions-drivers');\n\ndescribe(':android: Integrative actions', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  /**\n   * This use case refers to this issue: https://github.com/wix/Detox/issues/1485\n   * Note: we have to run this on a full-screen list because of the known RN visibility-bug.\n   */\n  it('Should be able to tap a specific item after scroll-searching for it', async () => {\n    await element(by.text('FS Scroll Actions')).tap();\n\n    const expectedAlertText = `Alert(Item #${scrollViewDriver.secondPageItemIndex()})`;\n\n    await waitFor(scrollViewDriver.secondPageItem()).toBeVisible().whileElement(scrollViewDriver.byId()).scroll(100, 'down');\n    await scrollViewDriver.secondPageItem().tap();\n    await expect(element(by.text(expectedAlertText))).toBeVisible();\n    await element(by.text('OK')).tap();\n  });\n\n  /**\n   * This use case refers to this issue: https://github.com/wix/Detox/issues/1495\n   */\n  it('should scroll various distances accurately, and tap scroll targets', async () => {\n    const iterations = 10;\n    const textHeightDP = 40;\n    const baseMarginDP = 10;\n\n    await element(by.text('Integrative Actions')).tap();\n    for (let i = 1; i <= iterations; i++) {\n      await scrollingTextsDriver.tapOnText(i);\n      await scrollingTextsDriver.assertTextTappedOnce(i);\n      if (i < iterations) {\n        await scrollingTextsDriver.scrollDown(textHeightDP + (baseMarginDP * i));\n      }\n    }\n  });\n\n  /**\n   * This use case is a nearly identical reproduction of https://github.com/wix/Detox/issues/1495\n   */\n  it('should scroll various distances accurately, and type text into text fields', async () => {\n    const iterations = 10;\n    const inputHeightDP = 40;\n    const baseMarginDP = 10;\n\n    await element(by.text('Integrative Actions')).tap();\n\n    for (let i = 1; i <= iterations; i++) {\n      await scrollingTextInputsDriver.typeInField(i);\n      await scrollingTextInputsDriver.assertFieldText(i);\n      if (i < iterations) {\n        await scrollingTextInputsDriver.scrollDown(inputHeightDP + (baseMarginDP * i));\n      }\n    }\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/04.assertions.test.js",
    "content": "\nconst { rnVersion } = require('../../src/utils/rn-consts/rn-consts');\n\nconst driver = {\n  navToScreen: async () => {\n    await device.reloadReactNative();\n    await element(by.text('Assertions')).tap();\n  },\n  get textElement() { return element(by.id('main-text')) },\n  get subtextElement() { return element(by.id('subtext-root')) },\n  get invisibleTextElement() { return element(by.id('offscreen-text')) },\n  get toggleElement() { return element(by.id('toggle')) },\n}\n\ndescribe('Assertions', () => {\n  beforeEach(async () => {\n    await driver.navToScreen();\n  });\n\n  it('should assert an element is visible', async () => {\n    await expect(driver.textElement).toBeVisible();\n  });\n\n  it('should assert an element is not visible', async () => {\n    await expect(driver.invisibleTextElement).not.toBeVisible();\n  });\n\n  it('should assert an element exists', async () => {\n    await expect(driver.invisibleTextElement).toExist();\n  });\n\n  it('should assert an element does not exist', async () => {\n    await expect(element(by.id('RandomJunk959'))).not.toExist();\n  });\n\n  it('should assert an element has text', async () => {\n    await expect(driver.textElement).toHaveText('I contain some text');\n  });\n\n  it('should assert an element has (accessibility) label', async () => {\n    await expect(driver.textElement).toHaveLabel('I contain some text');\n  });\n\n  it('should assert a sub-element has a computed (accessibility) label', async () => {\n    if (rnVersion.minor >= 81) {\n      await expect(driver.subtextElement).toHaveLabel('This is some, subtext');\n    } else {\n      await expect(driver.subtextElement).toHaveLabel('This is some subtext');\n    }\n  });\n\n  it('should assert an element has (accessibility) id', async () => {\n    await expect(element(by.text('I contain some text'))).toHaveId('main-text');\n  });\n\n  it.skip(':ios: should assert an element has (accessibility) value', async () => {\n    await expect(driver.toggleElement).toHaveValue('0');\n    await driver.toggleElement.tap();\n    await expect(driver.toggleElement).toHaveValue('1');\n  });\n\n  it('assert toggle-switch widget', async () => {\n    await expect(driver.toggleElement).toHaveToggleValue(false);\n    await driver.toggleElement.tap();\n    await expect(driver.toggleElement).toHaveToggleValue(true);\n    await expect(driver.toggleElement).not.toHaveToggleValue(false);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/05.waitfor.misc.test.js",
    "content": "const { scrollViewDriver } = require('./drivers/fs-scroll-driver');\nconst { expectToThrow } = require('./utils/custom-expects');\n\n/**\n * Another mini-suite providing an alternative to https://github.com/facebook/react-native/issues/23870.\n * See actions visibility workaround for more.\n */\ndescribe(':android: Visibility-bug workaround for waitfor() api', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('FS Scroll Actions')).tap();\n  });\n\n  it('should find element by scrolling until it is visible', async () => {\n    await expect(scrollViewDriver.lastItem()).not.toBeVisible();\n    await waitFor(scrollViewDriver.lastItem()).toBeVisible().whileElement(scrollViewDriver.byId()).scroll(200, 'down');\n    await expect(scrollViewDriver.lastItem()).toBeVisible();\n  });\n\n  it('should abort scrolling if element was not found', async () => {\n    await expect(scrollViewDriver.fakeItem()).not.toBeVisible();\n    await expectToThrow(() => waitFor(scrollViewDriver.fakeItem()).toBeVisible().whileElement(scrollViewDriver.byId()).scroll(1000, 'down'));\n    await expect(scrollViewDriver.fakeItem()).not.toBeVisible();\n    await expect(scrollViewDriver.lastItem()).toBeVisible();\n  });\n});\n\n/**\n * Another mini-suite providing an alternative to https://github.com/facebook/react-native/issues/23870.\n * See actions visibility workaround for more.\n */\ndescribe('waitFor() + atIndex()', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Matchers')).tap();\n  });\n\n  /**\n   * This use case refers to this issue: https://github.com/wix/Detox/issues/2844\n   * We are making sure that .atIndex() works together with waitFor()\n   */\n  it('should be able to discern elements by index', async () => {\n    await waitFor(element(by.text('Index')).atIndex(1))\n      .toBeVisible()\n      .whileElement(by.id('ScrollView161'))\n      .scroll(50, 'down');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/05.waitfor.test.js",
    "content": "const {expectToThrow} = require('./utils/custom-expects');\n\nconst expectToFinishBeforeTimeout = async (block, timeout) => {\n  const startTime = new Date().getTime();\n  await block();\n  const endTime = new Date().getTime();\n\n  const expiredAfter = endTime - startTime;\n  if (expiredAfter > timeout) {\n    throw new Error(`Action not expired even after a timeout, took ${expiredAfter}ms`);\n  }\n}\n\ndescribe('WaitFor', () => {\n  const goButton = element(by.id('goButton'));\n  const timeout = 5000;\n\n  beforeEach(async() => {\n    await device.reloadReactNative();\n    await element(by.text('WaitFor')).tap();\n  });\n\n  it('should wait until an element is exists / removed in layout', async () => {\n    let testElement = element(by.id('changeExistenceByToggle'));\n    await expect(testElement).not.toExist();\n\n    await goButton.tap();\n\n    await expectToFinishBeforeTimeout(async () => {\n      await waitFor(testElement).toExist().withTimeout(timeout);\n    }, timeout);\n\n    await goButton.tap();\n\n    await expectToFinishBeforeTimeout(async () => {\n      await waitFor(testElement).not.toExist().withTimeout(timeout);\n    }, timeout);\n  });\n\n  it('should wait until an element is focused / unfocused', async () => {\n    let testElement = element(by.id('changeFocusByToggle'));\n    await expect(testElement).not.toBeFocused();\n\n    await goButton.tap();\n\n    await expectToFinishBeforeTimeout(async () => {\n      await waitFor(testElement).toBeFocused().withTimeout(timeout);\n    }, timeout);\n\n    await goButton.tap();\n\n    await expectToFinishBeforeTimeout(async () => {\n      await waitFor(testElement).not.toBeFocused().withTimeout(timeout);\n    }, timeout);\n  });\n\n  it('should find element by scrolling until it is visible', async () => {\n    await expect(element(by.text('Text5'))).not.toBeVisible();\n\n    await goButton.tap();\n    await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView')).scroll(50, 'down');\n    await expect(element(by.text('Text5'))).toBeVisible();\n  });\n\n  it('should fail test after waiting for element to exist but it doesn\\'t at the end', async () => {\n    await expect(element(by.id('neverAppearingText'))).not.toExist();\n    await expectToThrow(() => waitFor(element(by.id('neverAppearingText'))).toExist().withTimeout(500));\n  });\n\n  it('should abort scrolling if element was not found', async () => {\n    await goButton.tap();\n    await expectToThrow(() => waitFor(element(by.text('Text1000'))).toBeVisible().whileElement(by.id('ScrollView')).scroll(50, 'down'));\n    await expect(element(by.text('Text1000'))).not.toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/06.device-orientation.test.js",
    "content": "describe('Device Orientation', () => {\n  beforeEach(async() => {\n    await device.reloadReactNative();\n    await element(by.text('Orientation')).tap();\n    await expect(element(by.id('currentOrientation'))).toExist();\n  });\n\n  it('OrientationLandscape', async () => {\n    await device.setOrientation('landscape');\n\n    await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');\n  });\n\n  it('OrientationPortrait', async() => {\n    // As default is portrait we need to set it otherwise\n    await device.setOrientation('landscape');\n    await device.setOrientation('portrait');\n\n    await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/06.device-tap.test.js",
    "content": "describe('Device tap', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Device Tap')).tap();\n  });\n\n  it('tap on screen without specifying coordinates', async () => {\n    await device.tap();\n    await expect(element(by.text('Screen Tapped'))).toBeVisible();\n    await expect(element(by.text('Button Tapped'))).not.toBeVisible();\n  });\n\n  it('tap on button by coordinates ignoring status bar', async () => {\n    const point = {x: 210, y: 200}\n    await device.tap(point, true);\n    await expect(element(by.text('Button Tapped'))).toBeVisible();\n  });\n\n  it(':android: tap on screen by coordinates including status bar', async () => {\n    const point = {x: 210, y: 200}\n    await device.tap(point, false);\n    await expect(element(by.text('Screen Tapped'))).toBeVisible();\n    await expect(element(by.text('Button Tapped'))).not.toBeVisible();\n  });\n\n  it('long press on screen by coordinates ignoring status bar', async () => {\n    const point = {x: 150, y: 300}\n    await device.longPress(point, true);\n    await expect(element(by.text('Screen Long Pressed'))).toBeVisible();\n  });\n\n  it(':android: long press on screen by coordinates including status bar', async () => {\n    const point = {x: 150, y: 300}\n    await device.longPress(point, false);\n    await expect(element(by.text('Screen Long Pressed'))).toBeVisible();\n  });\n\n  it('long press on button by coordinates with duration ignoring status bar', async () => {\n    const point = {x: 170, y: 160}\n    await device.longPress(point, 2000, true);\n    await expect(element(by.text('Screen Long Custom Duration Pressed'))).toBeVisible();\n  });\n\n  it(':android: long press on screen by coordinates with duration including status bar', async () => {\n    const point = {x: 170, y: 160}\n    await device.longPress(point, 2000, false);\n    await expect(element(by.text('Screen Long Pressed'))).toBeVisible();\n    await expect(element(by.text('Screen Long Custom Duration Pressed'))).not.toBeVisible();\n  });\n\n  it('long press on screen with duration without specifying coordinates', async () => {\n    await device.longPress(2000);\n    await expect(element(by.text('Screen Long Pressed'))).toBeVisible();\n    await expect(element(by.text('Screen Long Custom Duration Pressed'))).not.toBeVisible();\n  });\n\n  it('long press on screen without specifying coordinates and duration', async () => {\n    await device.longPress();\n    await expect(element(by.text('Screen Long Pressed'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/06.device.test.js",
    "content": "describe('Device', () => {\n  it('reloadReactNative - should tap successfully', async () => {\n    await device.reloadReactNative();\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('relaunchApp - should tap successfully', async () => {\n    await device.relaunchApp();\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('relaunchApp({delete: true}) - should tap successfully', async () => {\n    await device.relaunchApp({delete: true});\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('uninstall() + install() + relaunch() - should tap successfully', async () => {\n    await device.uninstallApp();\n    await device.installApp();\n    await device.relaunchApp();\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('resetAppState() + relaunch() - should tap successfully', async () => {\n    await device.resetAppState();\n    await device.relaunchApp();\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it('launch({ resetAppState: true }) - should keep permissions', async () => {\n    await device.launchApp({ resetAppState: true, permissions: { location: 'always' } });\n    await element(by.text('Location')).tap();\n    await element(by.id('get_location_button')).tap();\n    await waitFor(element(by.id(/location_(latitude|error)/))).toBeVisible().withTimeout(5000);\n  });\n\n  it.failing('uninstall() + resetAppState() - should fail', async () => {\n    try {\n      await device.uninstallApp();\n      await device.resetAppState();\n    } finally {\n      await device.installApp();\n    }\n  });\n\n  it('launchApp({newInstance: true}) + sendToHome() + launchApp() - should bring up previous instance', async () => {\n    await device.launchApp({newInstance: true });\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await device.sendToHome();\n    await device.launchApp();\n\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  // // Passing on iOS, not implemented on Android\n  it(':ios: launchApp in a different language', async () => {\n    let languageAndLocale = {\n      language: \"es-MX\",\n      locale: \"en_MX\"\n    };\n\n    await device.launchApp({newInstance: true, languageAndLocale});\n    await element(by.text('Language')).tap();\n    await expect(element(by.text(`Current locale: ${languageAndLocale.locale}`))).toBeVisible();\n    await expect(element(by.text(`Current language: ${languageAndLocale.language}`))).toBeVisible();\n\n    languageAndLocale = {\n      language: \"en-US\",\n      locale: \"en_US\"\n    };\n\n    await device.launchApp({newInstance: true, languageAndLocale});\n    \n    await element(by.text('Language')).tap();\n    await expect(element(by.text(`Current locale: ${languageAndLocale.locale}`))).toBeVisible();\n    await expect(element(by.text(`Current language: ${languageAndLocale.language}`))).toBeVisible();\n  });\n\n  it('resetContentAndSettings() + install() + relaunch() - should tap successfully', async () => {\n    await device.resetContentAndSettings();\n    await device.installApp();\n    await device.launchApp({ newInstance: true });\n    await element(by.text('Sanity')).tap();\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n\n  it(':ios: shake() should shake screen', async () => {\n    await device.reloadReactNative();\n    await element(by.text('Shake')).tap();\n    await device.shake();\n    await expect(element(by.text('Shaken, not stirred'))).toExist();\n  });\n\n  it(':android: device back button - should show popup back pressed when back button is pressed', async () => {\n    await device.reloadReactNative();\n    await element(by.text('Actions')).tap();\n    await device.pressBack();\n    await expect(element(by.text('Back pressed !'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/06.device.view-hierarchy.test.js",
    "content": "const {expectViewHierarchySnapshotToMatch} = require(\"./utils/snapshot\");\n\nconst jestExpect = require('expect').default;\n\ndescribe('generate view hierarchy', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('generateViewHierarchyXml() - should generate a valid view hierarchy XML without injected test-ids', async () => {\n    await element(by.text('Sanity')).tap();\n    const hierarchy = await device.generateViewHierarchyXml();\n    await expectViewHierarchySnapshotToMatch(hierarchy, `view-hierarchy-without-test-id-injection`);\n  });\n\n  it('generateViewHierarchyXml(true) - should generate a valid view hierarchy XML with injected test-ids', async () => {\n    await element(by.text('Sanity')).tap();\n    const hierarchy = await device.generateViewHierarchyXml(true);\n    await expectViewHierarchySnapshotToMatch(hierarchy, `view-hierarchy-with-test-id-injection`);\n  });\n\n  it('generateViewHierarchyXml() - should generate xml for web view', async () => {\n    await element(by.text('WebView')).tap();\n    const hierarchy = await device.generateViewHierarchyXml();\n    await expectViewHierarchySnapshotToMatch(hierarchy, `view-hierarchy-web-view`);\n  });\n\n  it('generateViewHierarchyXml() - should generate consistent consecutive view hierarchies', async () => {\n    await element(by.text('WebView')).tap();\n\n    const hierarchy1 = await device.generateViewHierarchyXml();\n    const hierarchy2 = await device.generateViewHierarchyXml();\n\n    jestExpect(hierarchy1).toEqual(hierarchy2);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/07.stress-tests.test.js",
    "content": "describe('StressTests', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Stress')).tap();\n  });\n\n  it('should handle busy render', async () => {\n    await element(by.text('VirtualizedList Stress')).tap();\n    await expect(element(by.id('stressContainer'))).toBeVisible();\n  });\n\n  it('should handle tap during busy bridge (one way)', async () => {\n    await element(by.text('Bridge OneWay Stress')).tap();\n    await element(by.text('Next')).tap();\n    await expect(element(by.text('BridgeOneWay'))).toBeVisible();\n  });\n\n  it('should handle tap during busy bridge (two way)', async () => {\n    await element(by.text('Bridge TwoWay Stress')).tap();\n    await element(by.text('Next')).tap();\n    await expect(element(by.text('BridgeTwoWay'))).toBeVisible();\n  });\n\n  it('should handle tap during busy bridge (setState)', async () => {\n    await element(by.text('Bridge setState Stress')).tap();\n    await element(by.text('Next')).tap();\n    await expect(element(by.text('BridgeSetState'))).toBeVisible();\n  });\n\n  it('should handle tap during busy JS event loop', async () => {\n    await element(by.text('EventLoop Stress')).tap();\n    await element(by.text('Next')).tap();\n    await expect(element(by.text('EventLoop'))).toBeVisible();\n  });\n\n  it('should handle consecutive taps', async () => {\n    const TAP_COUNT = 20;\n    for (let i = 1; i <= TAP_COUNT; i++) {\n      await element(by.text('Consecutive Stress ' + i)).tap();\n    }\n  });\n\n  it(':android: should handle tap during storage stress', async () => {\n    try {\n      await element(by.text('Storage Stress')).tap();\n      await expect(element(by.text('StorageStress'))).toBeVisible();\n    } finally {\n      await device.reloadReactNative();\n    }\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/08.stress-root.test.js",
    "content": "describe('StressRoot', () => {\n  beforeEach(async () => {\n    await device.relaunchApp();\n    await element(by.text('Switch Root')).tap();\n  });\n\n  afterAll(async () => {\n    await device.relaunchApp();\n  });\n\n  it('should switch root view controller from RN to native', async () => {\n    await element(by.text('Switch to a new native root')).tap();\n    await expect(element(by.text('this is a new native root'))).toBeVisible();\n  });\n\n  it(':ios: should switch root view controller from RN to RN on @legacy', async () => {\n    await element(by.text('Switch to multiple react roots')).tap();\n    await expect(element(by.text('Choose a test'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/09.stress-timeouts.test.js",
    "content": "describe('StressTimeouts', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Timeouts')).tap();\n  });\n\n  it('should handle a short timeout', async () => {\n    await element(by.id('TimeoutShort')).tap();\n    await expect(element(by.text('Short Timeout Working!!!'))).toBeVisible();\n  });\n\n  it('should handle zero timeout', async () => {\n    await element(by.id('TimeoutZero')).tap();\n    await expect(element(by.text('Zero Timeout Working!!!'))).toBeVisible();\n  });\n\n  it('should ignore a short timeout', async () => {\n    await element(by.id('TimeoutIgnoreShort')).tap();\n    await expect(element(by.text('Short Timeout Ignored!!!'))).toBeVisible();\n  });\n\n  it('should ignore a long timeout', async () => {\n    await element(by.id('TimeoutIgnoreLong')).tap();\n    await expect(element(by.text('Long Timeout Ignored!!!'))).toBeVisible();\n  });\n\n  it('should handle setImmediate', async () => {\n    await element(by.id('Immediate')).tap();\n    await expect(element(by.text('Immediate Working!!!'))).toBeVisible();\n  });\n\n  it('should ignore setInterval', async () => {\n    await element(by.id('IntervalIgnore')).tap();\n    await expect(element(by.text('Interval Ignored!!!'))).toBeVisible();\n  });\n\n  it('should skip over setInterval', async () => {\n    await element(by.id('SkipOverInterval')).tap();\n    await expect(element(by.text('Interval Skipped-Over!!!'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/10.async-and-callbacks.test.js",
    "content": "describe('Async and Callbacks', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Sanity')).tap();\n  });\n\n  it('should handle done() callback', (done) => {\n    expect(element(by.text('Welcome'))).toBeVisible().then(() => {\n      setTimeout(() => {\n        done();\n      }, 1000);\n    });\n  });\n\n  it('should handle async await', async () => {\n    await timeout(1);\n    await expect(element(by.text('Welcome'))).toBeVisible();\n  });\n});\n\nfunction timeout(ms) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"
  },
  {
    "path": "detox/test/e2e/11.user-notifications.test.js",
    "content": "//Leo: I've disabled calendar events as they are exactly the same as push in the code. You may enable them for Android if needed, but set as \":android:\".\n\nconst {\n  userNotificationPushTrigger,\n  userNotificationCalendarTrigger,\n} = require('./utils/notifications');\n\ndescribe(':ios: User Notifications', () => {\n  it('Init from push notification', async () => {\n    await device.launchApp({newInstance: true, userNotification: userNotificationPushTrigger});\n    await expect(element(by.text('From push'))).toExist();\n  });\n\n  xit('Init from calendar notification', async () => {\n    await device.launchApp({newInstance: true, userNotification: userNotificationCalendarTrigger});\n    await expect(element(by.text('From calendar'))).toExist();\n  });\n\n  it('Background push notification', async () => {\n    await device.launchApp({newInstance: true});\n    await device.sendToHome();\n    await device.launchApp({newInstance: false, userNotification: userNotificationPushTrigger});\n    await expect(element(by.text('From push'))).toExist();\n  });\n\n  xit('Background calendar notification', async () => {\n    await device.launchApp({newInstance: true});\n    await device.sendToHome();\n    await device.launchApp({newInstance: false, userNotification: userNotificationCalendarTrigger});\n    await expect(element(by.text('From calendar'))).toExist();\n  });\n\n  it('Foreground push notifications', async () => {\n    await device.launchApp({newInstance: true});\n    await device.sendUserNotification(userNotificationPushTrigger);\n    await expect(element(by.text('From push'))).toExist();\n  });\n\n  xit('Foreground calendar notifications', async () => {\n    await device.launchApp({newInstance: true});\n    await device.sendUserNotification(userNotificationCalendarTrigger);\n    await expect(element(by.text('From calendar'))).toExist();\n  });\n});\n\ndescribe(':android: User Notifications', () => {\n  const googleProjectId = 284440699462;\n  const userNotification = {\n    payload: {\n      from: googleProjectId,\n      userData: 'userDataValue',\n      userDataArray: ['rock', 'paper', 'scissors'],\n      sub: {\n        objects: 'are supported as well'\n      },\n      'google.sent_time': 1592133826891,\n      'google.ttl': 2419200,\n      'google.original_priority': 'high',\n      'collapse_key': 'com.wix.detox.test',\n    },\n  };\n\n  async function assertNotificationDataField(key, expectedValue) {\n    await expect(element(by.id(`notificationData-${key}.name`))).toBeVisible();\n    await expect(element(by.id(`notificationData-${key}.value`))).toHaveText(expectedValue);\n  }\n\n  async function assertNotificationDataExtensively() {\n    await assertNotificationDataField('from', googleProjectId.toString());\n    await assertNotificationDataField('userData', userNotification.payload.userData);\n    await assertNotificationDataField('userDataArray', JSON.stringify(userNotification.payload.userDataArray));\n    await assertNotificationDataField('sub', JSON.stringify(userNotification.payload.sub));\n  }\n\n  async function assertNotificationData() {\n    await assertNotificationDataField('userData', userNotification.payload.userData);\n  }\n\n  it('should launch app with data', async () => {\n    await device.launchApp({ newInstance: true, userNotification });\n    await element(by.text('Launch-Notification')).tap();\n    await assertNotificationDataExtensively();\n  });\n\n  it('should resume app with data', async () => {\n    await device.launchApp({ newInstance: true });\n    console.log('Sending app to background...');\n    await device.sendToHome();\n    console.log('Resuming app with user notification');\n    await device.launchApp({ newInstance: false, userNotification });\n    await element(by.text('Launch-Notification')).tap();\n    await assertNotificationData();\n  });\n\n  it('should apply notification using sendUserNotification() when app is running', async () => {\n    await device.launchApp({newInstance: true});\n    await device.sendUserNotification(userNotification);\n    await element(by.text('Launch-Notification')).tap();\n    await assertNotificationData();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/12.animations.test.js",
    "content": "describe('React-Native Animations', () => {\n  const _delay = ms => new Promise(res => setTimeout(res, ms));\n\n  async function _startTest(driver, options = {}) {\n    let driverControlSegment = element(by.text(driver));\n    await driverControlSegment.tap();\n\n    if (options.loops !== undefined) {\n      let loopSwitch = element(by.id('UniqueId_AnimationsScreen_enableLoop'));\n      await loopSwitch.tap();\n      if (device.getPlatform() === 'ios') {\n        await expect(loopSwitch).toHaveToggleValue('1');\n      }\n      await element(by.id('UniqueId_AnimationsScreen_numberOfIterations')).replaceText(String(options.loops));\n    }\n\n    if (options.duration !== undefined) {\n      await element(by.id('UniqueId_AnimationsScreen_duration')).replaceText(String(options.duration));\n    }\n\n    if (options.delay !== undefined) {\n      await element(by.id('UniqueId_AnimationsScreen_delay')).replaceText(String(options.delay));\n    }\n\n    await element(by.id('UniqueId_AnimationsScreen_startButton')).tap();\n  }\n\n  describe.each(['JS', 'Native'])('(driver: %s)', (driver) => {\n    beforeEach(async () => {\n      await device.reloadReactNative();\n      await element(by.text('RN Animations')).tap();\n    });\n\n    it(`should find element`, async () => {\n      await _startTest(driver);\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toBeVisible();\n    });\n\n    it(`should detect loops with final number of iterations`, async () => {\n      await _startTest(driver, { loops: 4 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toBeVisible();\n    });\n\n    it.skip(`should not wait for infinite animations`, async () => {\n      await _startTest(driver, { loops: -1 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toBeVisible();\n    });\n\n    it(`should not wait during delays longer than 1.5s`, async () => {\n      await _startTest(driver, { delay: 1600 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).not.toExist();\n    });\n\n    it(`should wait during delays shorter than 1.5s`, async () => {\n      await _startTest(driver, { delay: 500 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toExist();\n    });\n\n    it(`should not wait for an animation to complete while the synchronization is disabled`, async () => {\n      await device.disableSynchronization();\n      await _delay(800);\n      await _startTest(driver, { duration: 5000 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).not.toExist();\n\n      await device.enableSynchronization();\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toExist();\n    });\n  });\n\n  describe('detoxEnableSynchronization', () => {\n    it('should launch without synchronization for detoxEnableSynchronization 0', async () => {\n      await launchAppWithSynchronization(false);\n      await _delay(800);\n      await element(by.text('RN Animations')).tap();\n      await _delay(800);\n      await _startTest('JS', { duration: 2000 });\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).not.toExist();\n      await _delay(2200);\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toExist();\n\n      await launchAppWithSynchronization(true);\n    });\n\n    it('should launch with synchronization for detoxEnableSynchronization 1', async () => {\n      await launchAppWithSynchronization(true);\n      await element(by.text('RN Animations')).tap();\n      await _startTest('JS');\n      await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toBeVisible();\n    });\n  });\n\n  describe(':android: Native animations', () => {\n    it('should expect a native android-animator animation to be short-circuited / fully-completed', async () => {\n      await device.reloadReactNative();\n      await element(by.text('Native Animation')).tap();\n\n      await element(by.id('startButton')).tap();\n      await expect(element(by.text('Animation Complete'))).toBeVisible();\n    });\n  });\n});\n\nconst launchAppWithSynchronization = async (synchronizationState) => {\nreturn await device.launchApp({\n    newInstance: true,\n    launchArgs: {\n      detoxEnableSynchronization: synchronizationState ? 1 : 0\n    }\n  });\n}\n\n"
  },
  {
    "path": "detox/test/e2e/13.permissions.test.js",
    "content": "const { RESULTS } = require('react-native-permissions');\nconst { isIOS18OrHigher } = require('./utils/deviceInfo');\n\nconst BASIC_PERMISSIONS_TO_CHECK = [\n  'userTracking',\n  'calendar',\n  'camera',\n  'contacts',\n  'microphone',\n  'reminders',\n  'siri',\n  'speech',\n  'medialibrary'\n];\n\nconst LOCATION_ALWAYS = 'location_always';\nconst LOCATION_WHEN_IN_USE = 'location_when_in_use';\n\nconst PHOTO_LIBRARY = 'photo_library';\nconst PHOTO_LIBRARY_ADD_ONLY = 'photo_library_add_only';\n\ndescribe(':ios: Permissions', () => {\n  BASIC_PERMISSIONS_TO_CHECK.forEach((name) => {\n    describe(name, () => {\n      const authorizationStatus = element(by.id(name));\n\n      it('should find element with test-id: ' + name, async () => {\n        await device.launchApp({delete: true});\n        await element(by.text('Permissions')).tap();\n\n        await expect(authorizationStatus).toBeVisible();\n      });\n\n      it('should show default permissions when undefined', async () => {\n        await device.launchApp({delete: true});\n        await element(by.text('Permissions')).tap();\n\n        await expect(authorizationStatus).toHaveText(RESULTS.DENIED);\n      });\n\n      it('should show default permissions when defined to `unset`', async () => {\n        const permissions = {[name]: 'unset'};\n\n        await device.launchApp({permissions, delete: true});\n        await element(by.text('Permissions')).tap();\n\n        await expect(authorizationStatus).toHaveText(RESULTS.DENIED);\n      });\n\n      it('should grant permission', async () => {\n        const permissions = {[name]: 'YES'};\n\n        await device.launchApp({permissions, delete: true});\n        await element(by.text('Permissions')).tap();\n\n        await expect(authorizationStatus).toHaveText('granted');\n      });\n\n      it('should block permissions', async () => {\n        const permissions = {[name]: 'NO'};\n\n        await device.launchApp({permissions, delete: true});\n        await element(by.text('Permissions')).tap();\n\n        await expect(authorizationStatus).toHaveText(RESULTS.BLOCKED);\n      });\n    });\n  });\n\n  describe(\"location\", () => {\n    const locationAlways = element(by.id(LOCATION_ALWAYS));\n    const locationInuse = element(by.id(LOCATION_WHEN_IN_USE));\n\n    it('should find status elements', async () => {\n      await device.launchApp({delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toBeVisible();\n      await expect(locationInuse).toBeVisible();\n    });\n\n    it('should show default permissions when undefined', async () => {\n      await device.launchApp({delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toHaveText(RESULTS.DENIED);\n      await expect(locationInuse).toHaveText(RESULTS.DENIED);\n    });\n\n    it('should show default permissions when defined to `unset`', async () => {\n      const permissions = {location: 'unset'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toHaveText(RESULTS.DENIED);\n      await expect(locationInuse).toHaveText(RESULTS.DENIED);\n    });\n\n    it('should grant permission `inuse`', async () => {\n      const permissions = {location: 'inuse'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toHaveText(RESULTS.BLOCKED);\n      await expect(locationInuse).toHaveText(RESULTS.GRANTED);\n    });\n\n    it('should grant permission `always`', async () => {\n      const permissions = {location: 'always'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toHaveText(RESULTS.GRANTED);\n      await expect(locationInuse).toHaveText(RESULTS.GRANTED);\n    });\n\n    it('should block permissions', async () => {\n      const permissions = {location: 'never'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(locationAlways).toHaveText(RESULTS.BLOCKED);\n      await expect(locationInuse).toHaveText(RESULTS.BLOCKED);\n    });\n  });\n\n  describe(\"faceid\", () => {\n    const faceid = element(by.id('faceid'));\n\n    it('should find status elements', async () => {\n      await device.launchApp({ delete: true });\n      await element(by.text('Permissions')).tap();\n\n      await expect(faceid).toBeVisible();\n    });\n\n    it('should get unavailable status when biometrics are not enrolled', async () => {\n      await device.setBiometricEnrollment(false);\n\n      await device.launchApp({ delete: true });\n      await element(by.text('Permissions')).tap();\n\n      await expect(faceid).toHaveText(RESULTS.UNAVAILABLE);\n    });\n\n    describe(\"when biometrics are enrolled\", () => {\n      beforeEach(async () => {\n        await device.setBiometricEnrollment(true);\n      });\n\n      it('should show default permissions when undefined', async () => {\n        await device.launchApp({ delete: true });\n        await element(by.text('Permissions')).tap();\n\n        await expect(faceid).toHaveText(RESULTS.DENIED);\n      });\n\n      it('should show default permissions when defined to `unset`', async () => {\n        const permissions = { faceid: 'unset' };\n\n        await device.launchApp({ permissions, delete: true });\n        await element(by.text('Permissions')).tap();\n\n        await expect(faceid).toHaveText(RESULTS.DENIED);\n      });\n\n      // todo: Skipped due to an error coming from react-native-permissions. Fix or implement a custom check.\n      it.skip('should grant permission', async () => {\n        const permissions = { faceid: 'YES' };\n\n        await device.launchApp({ permissions, delete: true });\n        await element(by.text('Permissions')).tap();\n\n        await expect(faceid).toHaveText('granted');\n      });\n\n      it('should block permissions', async () => {\n        const permissions = { faceid: 'NO' };\n\n        await device.launchApp({ permissions, delete: true });\n        await element(by.text('Permissions')).tap();\n\n        // iOS 18+ changed behavior: FaceID permissions set to NO now return DENIED instead of BLOCKED\n        await expect(faceid).toHaveText(isIOS18OrHigher() ? RESULTS.DENIED : RESULTS.BLOCKED);\n      });\n    });\n  });\n\n  describe(\"photos\", () => {\n    const photoLibrary = element(by.id(PHOTO_LIBRARY));\n    const photoLibraryAddOnly = element(by.id(PHOTO_LIBRARY_ADD_ONLY));\n\n    it('should find status elements', async () => {\n      await device.launchApp({delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toBeVisible();\n      await expect(photoLibraryAddOnly).toBeVisible();\n    });\n\n    it('should show default permissions when undefined', async () => {\n      await device.launchApp({delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toHaveText(RESULTS.DENIED);\n      await expect(photoLibraryAddOnly).toHaveText(RESULTS.DENIED);\n    });\n\n    it('should show default permissions when defined to `unset`', async () => {\n      const permissions = {photos: 'unset'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toHaveText(RESULTS.DENIED);\n      await expect(photoLibraryAddOnly).toHaveText(RESULTS.DENIED);\n    });\n\n    it('should grant permission `limited`', async () => {\n      const permissions = {photos: 'limited'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toHaveText(RESULTS.DENIED);\n      await expect(photoLibraryAddOnly).toHaveText(RESULTS.GRANTED);\n    });\n\n    it('should grant permission', async () => {\n      const permissions = {photos: 'YES'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toHaveText(RESULTS.GRANTED);\n      await expect(photoLibraryAddOnly).toHaveText(RESULTS.GRANTED);\n    });\n\n    it('should block permissions', async () => {\n      const permissions = {photos: 'NO'};\n\n      await device.launchApp({permissions, delete: true});\n      await element(by.text('Permissions')).tap();\n\n      await expect(photoLibrary).toHaveText(RESULTS.BLOCKED);\n      await expect(photoLibraryAddOnly).toHaveText(RESULTS.DENIED);\n    });\n  });\n\n  it('should grant or block multiple permissions', async () => {\n    const permissions = {\n      photos: 'YES',\n      camera: 'YES',\n      location: 'never'\n    };\n\n    await device.launchApp({permissions, delete: true});\n    await element(by.text('Permissions')).tap();\n\n    await expect(element(by.id('photo_library'))).toHaveText(RESULTS.GRANTED);\n    await expect(element(by.id('camera'))).toHaveText(RESULTS.GRANTED);\n    await expect(element(by.id(LOCATION_ALWAYS))).toHaveText(RESULTS.BLOCKED);\n  });\n});\n\n"
  },
  {
    "path": "detox/test/e2e/14.network.test.js",
    "content": "const MockServer = require('../mock-server/mock-server');\n\ndescribe('Network Synchronization', () => {\n  const mockServer = new MockServer();\n\n  beforeAll(async () => {\n    mockServer.init();\n    await device.reverseTcpPort(mockServer.port);\n  });\n\n  afterAll(async () => {\n    await mockServer.close();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Network')).tap();\n  });\n\n  it('Sync with short network requests - 100ms', async () => {\n    await driver.shortRequest.sendButton.tap();\n    await driver.shortRequest.expectReplied();\n  });\n  \n  it('should sync with long network requests - 3000ms', async () => {\n    await driver.longRequest.sendButton.tap();\n    await driver.longRequest.expectReplied();\n  });\n\n  it('disableSynchronization() should disable sync', async () => {\n    await device.disableSynchronization();\n    await waitFor(driver.longRequest.sendButton).toBeVisible().withTimeout(4000);\n\n    await driver.longRequest.sendButton.tap();\n    await driver.longRequest.expectRepliedAsync();\n\n    await device.enableSynchronization();\n  });\n\n  describe('URL black-list (endpoints to ignore in network synchronization)', () => {\n\n    afterEach(() => device.launchApp({ delete: true }));\n\n    it('setURLBlacklist() should disable synchronization for given endpoint', async () => {\n      await device.setURLBlacklist(['.*localhost.*']);\n\n      await driver.longRequest.sendButton.tap();\n      await driver.longRequest.expectRepliedAsync();\n    });\n\n    it('launchArgs with detoxURLBlacklistRegex should set the \"black\" (synchronization-ignore) list', async () => {\n      const blackListRegexp = '^http://localhost:\\\\d{4}?\\/[a-z]+\\/\\\\d{4}?$';\n\n      await device.launchApp({\n        newInstance: true,\n        launchArgs: { detoxURLBlacklistRegex: `\\\\(\"http://meaningless\\.first\\.url\",\"${blackListRegexp}\"\\\\)` },\n      });\n      await element(by.text('Network')).tap();\n\n      await driver.longRequest.sendButton.tap();\n      await driver.longRequest.expectRepliedAsync();\n    });\n  });\n});\n\nconst driver = {\n  shortRequest: {\n    get sendButton() { return element(by.id('ShortNetworkRequest')) },\n    get repliedText() { return element(by.text('Short Network Request Working!!!')) },\n    expectReplied: () => expect(driver.shortRequest.repliedText).toBeVisible(),\n  },\n\n  longRequest: {\n    get sendButton() { return element(by.id('LongNetworkRequest')) },\n    get repliedText() { return element(by.text('Long Network Request Working!!!')) },\n    expectReplied: () => expect(driver.longRequest.repliedText).toBeVisible(),\n    expectRepliedAsync: async () => {\n      await expect(driver.longRequest.repliedText).not.toBeVisible();\n      await waitFor(driver.longRequest.repliedText).toBeVisible().withTimeout(4000);\n    },\n  },\n};\n"
  },
  {
    "path": "detox/test/e2e/15.urls-and-launchArgs.test.js",
    "content": "const { urlDriver } = require('./drivers/url-driver');\nconst { launchArgsDriver } = require('./drivers/launch-args-driver');\n\ndescribe(':android: Launch arguments while handing launch URLs', () => {\n  it('should pass user args in normally', async () => {\n    const userArgs = {\n      how: 'about some',\n      pie: '3.14',\n    };\n    const detoxLaunchArgs = urlDriver.withDetoxArgs.andUserArgs(userArgs);\n\n    await device.launchApp({ newInstance: true, ...detoxLaunchArgs });\n    await urlDriver.navToUrlScreen();\n    await urlDriver.assertUrl(detoxLaunchArgs.url);\n\n    await device.reloadReactNative();\n    await launchArgsDriver.navToLaunchArgsScreen();\n    await launchArgsDriver.assertLaunchArgs(userArgs);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/15.urls.test.js",
    "content": "const { urlDriver } = require('./drivers/url-driver');\n\ndescribe('Open URLs', () => {\n  afterAll(async () => {\n    await device.launchApp({\n      newInstance: true,\n      url: undefined,\n      launchArgs: undefined,\n    });\n  });\n\n  describe.each([\n    ['(default)', urlDriver.withDetoxArgs.default()],\n    [':android: (single activity)', urlDriver.withDetoxArgs.forSingleInstanceActivityLaunch()],\n  ])('%s', (_platform, {url, launchArgs}) => {\n    it(`device.launchApp() with a URL and a fresh app should launch app and trigger handling open url handling in app`, async () => {\n      await device.launchApp({newInstance: true, url, launchArgs});\n      await urlDriver.navToUrlScreen();\n      await urlDriver.assertUrl(url);\n    });\n\n    it(`device.openURL() should trigger open url handling in app when app is in foreground`, async () => {\n      await device.launchApp({newInstance: true, launchArgs});\n      await urlDriver.navToUrlScreen();\n      await urlDriver.assertNoUrl(url);\n      await device.openURL({url});\n      await urlDriver.assertUrl(url);\n    });\n\n    it(`device.launchApp() with a URL should trigger url handling when app is in background`, async () => {\n      await device.launchApp({newInstance: true, launchArgs});\n      await urlDriver.navToUrlScreen();\n      await urlDriver.assertNoUrl(url);\n      await device.sendToHome();\n      await device.launchApp({newInstance: false, url});\n      await urlDriver.assertUrl(url);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/16.location.test.js",
    "content": "const LOCATION_SCREEN_BUTTON_TEXT = 'Location';\nconst LOCATION_LATITUDE_TEST_ID = 'location_latitude';\nconst LOCATION_LONGITUDE_TEST_ID = 'location_longitude';\nconst LOCATION_ERROR_TEST_ID = 'location_error';\nconst GET_LOCATION_BUTTON_TEST_ID = 'get_location_button';\n\nconst DUMMY_COORDINATE_1 = -80.125;\nconst DUMMY_COORDINATE_2 = 66.5;\n\ndescribe('set location', () => {\n  const enterLocationScreen = async (location) => {\n    await device.launchApp({\n      delete: true,\n      ...(location !== undefined && { permissions: { location: location } }),\n    });\n\n    await element(by.text(LOCATION_SCREEN_BUTTON_TEXT)).tap();\n  }\n\n  const updateLocationInfo = async () => {\n    await element(by.id(GET_LOCATION_BUTTON_TEST_ID)).tap();\n  }\n\n  const expectLocationToAppear = async (latitude, longitude) => {\n    await waitFor(element(by.id(LOCATION_LATITUDE_TEST_ID))).toHaveText(`Latitude: ${latitude}`).withTimeout(5000);\n    await expect(element(by.id(LOCATION_LONGITUDE_TEST_ID))).toHaveText(`Longitude: ${longitude}`);\n  }\n\n  const expectErrorToAppear = async () => {\n    await waitFor(element(by.id(LOCATION_ERROR_TEST_ID))).toBeVisible().withTimeout(3000);\n    await expect(element(by.id(LOCATION_LATITUDE_TEST_ID))).not.toBeVisible();\n    await expect(element(by.id(LOCATION_LONGITUDE_TEST_ID))).not.toBeVisible();\n  }\n\n  describe(':android: permission granted in the app manifest', () => {\n    it('should set location', async () => {\n      await enterLocationScreen();\n\n      await device.setLocation(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n      await updateLocationInfo();\n\n      await expectLocationToAppear(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n    });\n\n    it('should set location multiple times', async () => {\n      await enterLocationScreen();\n\n      await device.setLocation(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n      await device.setLocation(DUMMY_COORDINATE_2, DUMMY_COORDINATE_1);\n      await updateLocationInfo();\n\n      await expectLocationToAppear(DUMMY_COORDINATE_2, DUMMY_COORDINATE_1);\n    });\n  });\n\n  describe(':ios: permission set on launch config', () => {\n    it('should show error when permission defined as `never`', async () => {\n      await enterLocationScreen('never');\n      await updateLocationInfo();\n      await expectErrorToAppear();\n    });\n\n    it('should set location when permission defined as `inuse`', async () => {\n      await enterLocationScreen('inuse');\n\n      await device.setLocation(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n      await updateLocationInfo();\n\n      await expectLocationToAppear(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n    });\n\n    it('should set location when permission defined as `always`', async () => {\n      await enterLocationScreen('always');\n\n      await device.setLocation(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n      await updateLocationInfo();\n\n      await expectLocationToAppear(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n    });\n\n    it('should set location multiple times', async () => {\n      await enterLocationScreen('always');\n\n      await device.setLocation(DUMMY_COORDINATE_1, DUMMY_COORDINATE_2);\n      await device.setLocation(DUMMY_COORDINATE_2, DUMMY_COORDINATE_1);\n      await updateLocationInfo();\n\n      await expectLocationToAppear(DUMMY_COORDINATE_2, DUMMY_COORDINATE_1);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/17.datePicker.test.js",
    "content": "const jestExpect = require('expect').default;\n\ndescribe('DatePicker', () => {\n  describe.each([\n    ['ios', 'compact', 0],\n    ['ios', 'inline', 1],\n    ['ios', 'spinner', 2],\n    ['android', 'calendar', 0],\n    ['android', 'spinner', 1],\n  ])(`:%s: %s mode`, (platform, mode, toggleTimes) => {\n    beforeEach(async () => {\n      if (platform === 'ios') {\n        await device.reloadReactNative();\n      } else {\n        // Android: Native date selector doesn't disappear if we just reloadReactNative() after an error\n        await device.launchApp({newInstance: true});\n      }\n\n      await element(by.text('DatePicker')).tap();\n    });\n\n    beforeEach(async () => {\n      for (let i = 0; i < toggleTimes; i++) {\n        await element(by.id('toggleDatePicker')).tap();\n      }\n    });\n\n    async function setDate(dateString, dateFormat) {\n      if (platform === 'ios') {\n        await element(by.id('datePicker')).setDatePickerDate(dateString, dateFormat);\n      } else {\n        await element(by.id('openDatePicker')).tap();\n\n        // rn-datepicker does not support testId's on android, so by.type is the only way to match the datepicker view ATM\n        // @see https://github.com/react-native-datetimepicker/datetimepicker#view-props-optional-ios-only\n        await element(by.type('android.widget.DatePicker')).setDatePickerDate(dateString, dateFormat);\n        await element(by.text('OK')).tap();\n      }\n    }\n\n    test.each([\n      ['2019-02-06T05:10:00-08:00', 'Feb 6th, 2019', '1:10 PM'],\n      ['2019-02-06T05:10:00.435-08:00', 'Feb 6th, 2019', '1:10 PM'],\n      // This case is important because Date.toISOString() doesn't output a TZ (assumes UTC 0)\n      ['2023-01-11T10:41:26.912Z', 'Jan 11th, 2023', '10:41 AM'],\n    ])('ISO 8601 format: %s', async (dateString, expectedUtcDate, expectedUtcTime) => {\n      await setDate(dateString, 'ISO8601');\n      await expect(element(by.id('utcDateLabel'))).toHaveText(`Date (UTC): ${expectedUtcDate}`);\n      if (platform === 'ios') {\n        await expect(element(by.id('utcTimeLabel'))).toHaveText(`Time (UTC): ${expectedUtcTime}`);\n      }\n    });\n\n    test.each([\n      ['yyyy/MM/dd HH:mm', '2019/02/06 13:10', 'Feb 6th, 2019', '1:10 PM'],\n    ])('custom format: %s', async (dateFormat, dateString, expectedLocalDate, expectedLocalTime) => {\n      await setDate(dateString, dateFormat);\n      await expect(element(by.id('localDateLabel'))).toHaveText(`Date (Local): ${expectedLocalDate}`);\n      if (platform === 'ios') {\n        await expect(element(by.id('localTimeLabel'))).toHaveText(`Time (Local): ${expectedLocalTime}`);\n      }\n    });\n\n    // Spinner-specific tests\n    if (platform !== 'ios' || mode !== 'spinner') return;\n\n    it('setColumnToValue should not work for a spinner date picker', async () => {\n      const invalidAction = element(by.id('datePicker')).setColumnToValue(1, \"6\");\n      await jestExpect(invalidAction).rejects.toThrow(/is not an instance of.*UIPickerView/);\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/17.picker.test.js",
    "content": "describe(\":ios: Picker\", () => {\n    beforeEach(async () => {\n      await device.reloadReactNative();\n      await element(by.text(\"Picker\")).tap();\n    });\n\n    it(\"picker should select value correctly\", async () => {\n      await element(by.id(\"pickerView\")).setColumnToValue(0, \"c\");\n      await expect(element(by.id(\"valueLabel\"))).toHaveText(\"com.wix.detox.c\");\n    });\n});\n"
  },
  {
    "path": "detox/test/e2e/18.user-activities.test.js",
    "content": "const { urlDriver } = require('./drivers/url-driver');\nconst DetoxConstants = require('detox').DetoxConstants;\n\ndescribe(':ios: User Activity', () => {\n  it('Init from browsing web', async () => {\n    // await device.__debug_sleep(10000);\n    await device.launchApp({newInstance: true, userActivity: userActivityBrowsingWeb});\n    await urlDriver.navToUrlScreen();\n    await urlDriver.assertUrl('https://my.deeplink.dtx');\n  });\n\n  it('Background searchable item', async () => {\n    await device.launchApp({newInstance: true});\n    await urlDriver.navToUrlScreen();\n    await device.sendToHome();\n    await device.launchApp({newInstance: false, userActivity: userActivitySearchableItem});\n    await urlDriver.assertUrl('com.test.itemId');\n  });\n\n  it('Foreground browsing web', async () => {\n    await device.launchApp({newInstance: true});\n    await urlDriver.navToUrlScreen();\n    await device.sendUserActivity(userActivityBrowsingWeb);\n    await urlDriver.assertUrl('https://my.deeplink.dtx');\n  });\n});\n\nconst userActivityBrowsingWeb = {\n  \"activityType\": DetoxConstants.userActivityTypes.browsingWeb,\n  \"webpageURL\": \"https://my.deeplink.dtx\",\n  \"referrerURL\": \"https://google.com/\"\n};\n\nconst userActivitySearchableItem = {\n  \"activityType\": DetoxConstants.userActivityTypes.searchableItem,\n  \"userInfo\": {}\n};\nuserActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = \"com.test.itemId\"\n"
  },
  {
    "path": "detox/test/e2e/19.app-responsiveness.test.js",
    "content": "const LogInterceptor = require('./utils/log-interceptor');\n\ndescribe(':android: App responsiveness', () => {\n  it('should log ANR warning when app nonresponsive', async () => {\n    const logInterceptor = new LogInterceptor();\n\n    try {\n      logInterceptor.startStderr();\n      await element(by.text('ANR')).tap();\n    } finally {\n      logInterceptor.stopAll();\n    }\n\n    if (!logInterceptor.strerrData.includes('Application Not Responding')) {\n      console.error('APP_NONRESPONSIVE warning-log was expected, but got:\\n'+logInterceptor.strerrData);\n      throw new Error('APP_NONRESPONSIVE not found in intercepted log');\n    }\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/19.crash-handling.test.js",
    "content": "const jestExpect = require('expect').default;\n\nconst { expectToThrow } = require('./utils/custom-expects');\n\nconst relaunchAppWithArgs = (launchArgs) => {\n  console.log('Relaunching app with launch-arguments...', launchArgs);\n  return device.launchApp({\n    newInstance: true,\n    launchArgs,\n  })\n};\n\ndescribe('Crash Handling', () => {\n  afterAll(async () => {\n    await relaunchAppWithArgs(undefined);\n  });\n\n  it('Should throw error upon internal app crash', async () => {\n    await device.reloadReactNative();\n    await expectToThrow(() => element(by.text('Crash')).tap(), 'The app has crashed');\n  });\n\n  it('Should throw the same crash error even in the next test if the app was not relaunched', async () => {\n    await expectToThrow(() => element(by.text('Crash')).tap(), 'The app has crashed');\n  });\n\n  it('Should recover from app crash', async () => {\n    await device.launchApp({ newInstance: false });\n    await waitFor(element(by.text('Sanity'))).toBeVisible();\n  });\n\n  /**\n   * @issue 4377\n   * @tag flaky\n   */\n  it('Should print generic connectivity error when the app was terminated intentionally', async () => {\n    await device.terminateApp();\n    await new Promise((resolve) => setTimeout(resolve, 2000)); // see the issue for details\n    await expectToThrow(() => element(by.text('Crash')).tap(), 'Detox can\\'t seem to connect to the test app(s)!');\n  });\n\n  it('@legacy Should throw a detailed error upon early app crash', async () => {\n    const error = await expectToThrow(\n      () => relaunchAppWithArgs({ simulateEarlyCrash: true }),\n      'The app has crashed');\n\n    // It's important that the native-error message (containing the native stack-trace) would also\n    // be included in the error's stack property, in order for Jest (specifically) to properly output all\n    // of that into the shell, as we expect it to.\n    jestExpect(error.stack).toContain('Simulating early crash');\n\n    if (device.getPlatform() === 'android') {\n      jestExpect(error.stack).toContain('\\tat java.lang.Thread.run');\n    } else {\n      jestExpect(error.stack).toContain('JS Exception');\n    }\n  });\n\n  it(':android: should throw error upon invoke crash', async () => {\n    await device.launchApp({ newInstance: true });\n    await expectToThrow(() => element(by.text('UI Crash')).tap(), 'Test Failed: Simulated crash (native)');\n  });\n\n  it(':android: Should throw a detailed error upon app bootstrap crash', async () => {\n    const error = await expectToThrow(\n      () => relaunchAppWithArgs({ detoxAndroidCrashingActivity: true }),\n      'The app has crashed, see the details below:');\n\n    // It's important that the native-error message (containing the native stack-trace) would also\n    // be included in the error's stack property, in order for Jest (specifically) to properly output all\n    // of that into the shell, as we expect it to.\n    jestExpect(error.stack).toContain('java.lang.RuntimeException: Unable to resume activity');\n\n    // In particular, we want the original cause to be bundled in.\n    jestExpect(error.stack).toContain('Caused by: java.lang.IllegalStateException: This is an intentional crash!');\n  }, 60000);\n});\n"
  },
  {
    "path": "detox/test/e2e/20.background-foreground.transitions.test.js",
    "content": "describe(\":ios: Background-Foreground Transitions\", () => {\n\tit(\"Backgrounding and foregrounding an app should wait for transition to finish\", async () => {\n\t\tawait device.launchApp({newInstance: true, launchArgs: { demoShowActiveNotification: true }});\n\t\tawait device.sendToHome();\n\t\tawait expect(element(by.text(\"Background\"))).toExist();\n\t\tawait device.launchApp({newInstance: false, launchArgs: { demoShowActiveNotification: true }});\n\t\tawait expect(element(by.text(\"Active\"))).toExist();\n\t});\n});\n\n"
  },
  {
    "path": "detox/test/e2e/21.artifacts.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst jestExpect = require('expect').default;\nconst { PNG } = require('pngjs');\n\nconst {\n  assertArtifactExists,\n  assertDirExists,\n  waitUntilArtifactsManagerIsIdle\n} = require('./utils/artifactUtils');\n\ndescribe('Artifacts', () => {\n  describe('screenshots', () => {\n    beforeAll(async () => {\n      await device.sendToHome();\n      await device.takeScreenshot('Artifacts/before all').then(printPNGDimensions);\n      await device.launchApp({ newInstance: true });\n    });\n\n    beforeEach(async () => {\n      // implicitly taking screenshot - beforeEach.png\n      await device.reloadReactNative();\n      await device.takeScreenshot('in main menu').then(printPNGDimensions);\n\n      await element(by.text('Actions')).tap();\n      await device.takeScreenshot('Actions').then(printPNGDimensions);\n    });\n\n    it('should take screenshots inside test', async () => {\n      await element(by.id('UniqueId819')).tap();\n      await device.takeScreenshot('taps - 1').then(printPNGDimensions);\n\n      await element(by.id('UniqueId819')).tap();\n      await device.takeScreenshot('taps - 2').then(printPNGDimensions);\n    });\n\n    afterEach(async () => {\n      await element(by.text('Tap Me')).tap();\n      await device.takeScreenshot('tap working').then(printPNGDimensions);\n\n      await device.reloadReactNative();\n      // implicitly taking screenshot - afterEach.png\n    });\n\n    afterAll(async () => {\n      await device.sendToHome();\n      await device.takeScreenshot('Artifacts/after all').then(printPNGDimensions);\n      await device.launchApp();\n    });\n\n    afterAll(async () => {\n      await waitUntilArtifactsManagerIsIdle();\n\n      assertArtifactExists('Artifacts_before all.png');\n      assertArtifactExists('✓ Artifacts screenshots should take screenshots inside test/taps - 1.png');\n      assertArtifactExists('✓ Artifacts screenshots should take screenshots inside test/taps - 2.png');\n    });\n\n    function printPNGDimensions(pathToScreenshot) {\n      const buffer = fs.readFileSync(pathToScreenshot);\n      const filename = path.basename(pathToScreenshot);\n      const { width, height } = PNG.sync.read(buffer);\n\n      console.log(`Took a screenshot: ${filename} (${width}x${height})`);\n    }\n  });\n\n  describe(':ios: View Hierarchy', () => {\n    beforeAll(async () => {\n      await device.launchApp({ newInstance: true });\n      await device.captureViewHierarchy('before tests').then(assertDirExists);\n    });\n\n    it('should capture anonymous view hierarchies upon manual request', async () => {\n      await device.captureViewHierarchy().then(assertDirExists);\n      await device.captureViewHierarchy().then(assertDirExists);\n    });\n\n    it('should capture named view hierarchies upon manual request', async () => {\n      await device.captureViewHierarchy('named capture').then(assertDirExists);\n      await device.captureViewHierarchy('named capture').then(assertDirExists);\n    });\n\n    it('should capture hierarchy upon multiple invocation failures', async () => {\n      for (let i = 0; i < 2; i++) {\n        await jestExpect(element(by.id('nonExistentId')).tap()).rejects.toThrow();\n      }\n    });\n\n    afterAll(async () => {\n      await waitUntilArtifactsManagerIsIdle();\n      assertArtifactExists('before tests.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture anonymous view hierarchies upon manual request/capture.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture anonymous view hierarchies upon manual request/capture.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture named view hierarchies upon manual request/named capture.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture named view hierarchies upon manual request/named capture2.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture hierarchy upon multiple invocation failures/ui.viewhierarchy');\n      assertArtifactExists('✓ Artifacts _ios_ View Hierarchy should capture hierarchy upon multiple invocation failures/ui2.viewhierarchy');\n    });\n\n    describe('edge uninstall case', () => {\n      it('should capture hierarchy regardless', async () => {\n        await jestExpect(element(by.id('nonExistentId')).tap()).rejects.toThrow();\n        await device.uninstallApp();\n      });\n\n      afterAll(async () => {\n        await waitUntilArtifactsManagerIsIdle();\n        assertArtifactExists('✓ Artifacts _ios_ View Hierarchy edge uninstall case should capture hierarchy regardless/ui3.viewhierarchy');\n      });\n\n      afterAll(async () => {\n        await device.installApp();\n      });\n    });\n  });\n\n  describe('device log creation', () => {\n    beforeAll(async () => {\n      await device.launchApp();\n    });\n\n    it('should create device log for calling terminate', async () => {\n      await device.terminateApp();\n    });\n\n    it('should create device log for non-running app', async () => {});\n\n    it('should create device log for calling launch app', async () => {\n      await device.launchApp();\n    });\n\n    afterAll(async () => {\n      await waitUntilArtifactsManagerIsIdle();\n      assertArtifactExists('✓ Artifacts device log creation should create device log for non-running app/device.log');\n      assertArtifactExists('✓ Artifacts device log creation should create device log for calling terminate/device.log');\n      assertArtifactExists('✓ Artifacts device log creation should create device log for calling launch app/device.log');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/22.launch-args.test.js",
    "content": "const { launchArgsDriver: driver } = require('./drivers/launch-args-driver');\n\n// Note: Android-only as, according to Leo, on iOS there's no added value here compared to\n// existing tests that check deep-link URLs. Combined with the fact that we do not yet\n// support complex args on iOS -- no point in testing it out.\ndescribe(':android: Launch arguments', () => {\n  const defaultArgs = Object.freeze({\n    app: 'le',\n    goo: 'gle?',\n    micro: 'soft'\n  });\n\n  beforeEach(async () => {\n    await device.selectApp('exampleWithArgs');\n    driver.assertPreconfiguredValues(device.appLaunchArgs.get(), defaultArgs);\n  });\n\n  it('should preserve a shared arg in spite of app reselection', async () => {\n    const override = { ama: 'zed' };\n\n    try {\n      driver.assertPreconfiguredValues(device.appLaunchArgs.get(), defaultArgs);\n      driver.assertPreconfiguredValues(device.appLaunchArgs.shared.get(), {});\n      device.appLaunchArgs.shared.modify(override);\n\n      driver.assertPreconfiguredValues(device.appLaunchArgs.get(), { ...defaultArgs, ...override });\n      driver.assertPreconfiguredValues(device.appLaunchArgs.shared.get(), override);\n\n      await device.selectApp('example');\n      driver.assertPreconfiguredValues(device.appLaunchArgs.get(), override);\n      driver.assertPreconfiguredValues(device.appLaunchArgs.shared.get(), override);\n\n      await device.launchApp({ newInstance: true });\n      await driver.navToLaunchArgsScreen();\n      await driver.assertLaunchArgs(override);\n    } finally {\n      device.appLaunchArgs.shared.reset();\n    }\n  });\n\n  it('should handle primitive args when used on-site', async () => {\n    const launchArgs = {\n      hello: 'world',\n      seekthe: true,\n      heisthe: 1,\n    };\n\n    await device.launchApp({ newInstance: true, launchArgs });\n    await driver.navToLaunchArgsScreen();\n    await driver.assertLaunchArgs(launchArgs);\n  });\n\n  it('should handle complex args when used on-site', async () => {\n    const launchArgs = {\n      complex: {\n        bull: ['s', 'h', 1, 't'],\n        and: {\n          then: 'so, me',\n        }\n      },\n      complexlist: ['arguments', 'https://haxorhost:1337'],\n    };\n\n    await device.launchApp({ newInstance: true, launchArgs });\n    await driver.navToLaunchArgsScreen();\n    await driver.assertLaunchArgs({\n      complex: JSON.stringify(launchArgs.complex),\n      complexlist: JSON.stringify(launchArgs.complexlist),\n    });\n  });\n\n  it('should allow for arguments modification', async () => {\n    device.appLaunchArgs.modify({\n      app: undefined, // delete\n      goo: 'gle!', // modify\n      ama: 'zon', // add\n    });\n\n    await device.launchApp({ newInstance: true });\n    await driver.navToLaunchArgsScreen();\n    await driver.assertLaunchArgs({\n      'goo': 'gle!',\n      'ama': 'zon',\n      'micro': 'soft',\n    }, ['app']);\n  });\n\n  it('should allow for on-site arguments to take precedence', async () => {\n    const launchArgs = {\n      anArg: 'aValue!',\n    };\n\n    device.appLaunchArgs.reset();\n    device.appLaunchArgs.modify({\n      anArg: 'aValue?',\n    });\n\n    await device.launchApp({ newInstance: true, launchArgs });\n    await driver.navToLaunchArgsScreen();\n    await driver.assertLaunchArgs({ anArg: 'aValue!' });\n  });\n\n  // Ref: https://developer.android.com/studio/test/command-line#AMOptionsSyntax\n  it('should not pass android instrumentation args through', async () => {\n    const launchArgs = {\n      hello: 'world',\n      debug: false,\n      log: false,\n      size: 'large',\n    };\n\n    await device.launchApp({ newInstance: true, launchArgs });\n    await driver.navToLaunchArgsScreen();\n    await driver.assertLaunchArgs({ hello: 'world' }, ['debug', 'log', 'size']);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/23.flows.test.js",
    "content": "describe('Flows', () => {\n  describe('- app termination -', () => {\n    it('should exit without timeouts if app was terminated inside test', async () => {\n      await device.launchApp({newInstance: true});\n      await device.terminateApp();\n    });\n\n    it('should be able to start the next test with the terminated app', async () => {\n      await device.launchApp({newInstance: true});\n    });\n  });\n\n  describe('- beforeAll hooks -', () => {\n    it.skip('trigger false test_start glitch', () => {});\n\n    describe('inner suite', () => {\n      beforeAll(async () => {\n        await device.launchApp({\n          newInstance: true,\n          delete: true,\n          permissions: {notifications: 'YES', camera: 'YES', photos: 'YES'}\n        });\n      });\n\n      it('should tap on \"Sanity\"', async () => {\n        await element(by.text('Sanity')).tap();\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/24.uidevice.test.js",
    "content": "const { forEachSeries } = require('p-iteration');\n\ndescribe(':android: UIDevice', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it(`device.getUiDevice() + getDisplayHeight() + getDisplayWidth() + click()`, async () => {\n    await element(by.text('Device')).tap();\n    const uiDevice = device.getUiDevice();\n    const height = await uiDevice.getDisplayHeight();\n    const width = await uiDevice.getDisplayWidth();\n    await uiDevice.click(width / 2, height / 2);\n    await expect(element(by.text('Tap works'))).toBeVisible();\n  });\n\n  it(`should type in an element using pressKeyCode()`, async () => {\n    const text = \"a1b2c3\";\n    const textAsCodes = [29, 8, 30, 9, 31, 10];\n    const uiDevice = device.getUiDevice();\n\n    await element(by.text('Actions')).tap();\n    await element(by.id('UniqueId937')).tap();\n    await forEachSeries(textAsCodes, (keyCode) => uiDevice.pressKeyCode(keyCode));\n    await expect(element(by.text(text))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/26.element-screenshots.test.js",
    "content": "const {expectElementSnapshotToMatch} = require('./utils/snapshot');\n\ndescribe('Element screenshots', () => {\n  let androidSdk;\n  let fancyElement;\n\n  beforeAll(async () => {\n    if (device.getPlatform() === 'android') {\n      const adbName = device.id;\n      const { adb } = device.deviceDriver;\n\n      androidSdk = await adb.apiLevel(adbName);\n      if (!androidSdk) {\n        console.warn('Could not determine Android SDK version - test results may be futile.');\n      }\n    }\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Element-Screenshots')).tap();\n    fancyElement = element(by.id('fancyElement'));\n  });\n\n  it('should take a screenshot of a vertically-clipped element', async () => {\n    await expectElementSnapshotToMatch(fancyElement, 'elementScreenshot.vert', undefined, androidSdk);\n  });\n\n  it('should take a screenshot of a horizontally-clipped element', async () => {\n    await element(by.id('switchOrientation')).tap();\n    await expectElementSnapshotToMatch(fancyElement, 'elementScreenshot.horiz', 0.995, androidSdk);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/27.retries.test.js",
    "content": "jest.retryTimes(3);\n\nconst { session } = require('detox/internals');\nconst jestExpect = require('expect').default;\n\nconst {\n  assertArtifactExists,\n  waitUntilArtifactsManagerIsIdle,\n} = require('./utils/artifactUtils');\n\ndescribe('jest.retryTimes() support', () => {\n  let counter = 3;\n\n  beforeAll(async () => {\n    // This test won't work if you retry it via -R, --retries.\n    // Here we also assert that the session object is accessible from the sandbox.\n    jestExpect(session.testSessionIndex).toBe(0);\n\n    await device.launchApp({ newInstance: true });\n  });\n\n  it('should fail twice and pass once', async () => {\n    const matcher = --counter > 0\n      ? by.text('Not existing')\n      : by.text('Sanity');\n\n    await element(matcher).tap();\n  });\n\n  afterAll(async () => {\n    await waitUntilArtifactsManagerIsIdle();\n\n    assertArtifactExists('✗ jest.retryTimes() support should fail twice and pass once');\n    assertArtifactExists('✗ jest.retryTimes() support should fail twice and pass once (2)');\n    assertArtifactExists('✓ jest.retryTimes() support should fail twice and pass once (3)');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/27.semantic-types.test.js",
    "content": "const jestExpect = require('expect').default;\n\ndescribe('Semantic Types', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Semantic Types')).tap();\n  });\n\n  it('should match image elements by semantic type using by.type()', async () => {\n    await expect(element(by.type('image')).atIndex(0)).toBeVisible();\n  });\n\n  it('should match text elements by semantic type using by.type()', async () => {\n    await expect(element(by.type('text')).atIndex(0)).toBeVisible();\n    await expect(element(by.type('text').and(by.text('Text Element')))).toBeVisible();\n  });\n\n  it('should match input field elements by semantic type using by.type()', async () => {\n    await expect(element(by.type('input-field')).atIndex(0)).toBeVisible();\n    await element(by.type('input-field')).atIndex(0).typeText('Test');\n    await expect(element(by.type('input-field')).atIndex(0)).toHaveText('Test');\n  });\n\n  it('should support progress alias for activity-indicator', async () => {\n    await expect(element(by.type('progress'))).toExist();\n    await expect(element(by.type('activity-indicator'))).toExist();\n\n    const progressAttrs = await element(by.type('progress')).getAttributes();\n    const activityIndicatorAttrs = await element(by.type('activity-indicator')).getAttributes();\n    jestExpect(progressAttrs.identifier).toEqual(activityIndicatorAttrs.identifier);\n  });\n\n  it('should match scrollview elements by semantic type', async () => {\n    await expect(element(by.type('scrollview')).atIndex(0)).toExist();\n  });\n\n  it('should match list elements by semantic type', async () => {\n    await expect(element(by.type('list')).atIndex(0)).toExist();\n  });\n\n  it('should match switch elements by semantic type', async () => {\n    await expect(element(by.type('switch'))).toExist();\n  });\n\n  it('should match slider elements by semantic type', async () => {\n    await expect(element(by.type('slider'))).toExist();\n  });\n\n  it('should match picker elements by semantic type', async () => {\n    await expect(element(by.type('picker'))).toExist();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/28.drag-and-drop.test.js",
    "content": "const jestExpect = require('@jest/globals').expect;\n\ndescribe('Drag And Drop', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Drag And Drop')).tap();\n  });\n\n  function expectWithEpsilon(actual, expected, epsilon) {\n    jestExpect(actual).toBeGreaterThanOrEqual(expected - epsilon);\n    jestExpect(actual).toBeLessThanOrEqual(expected + epsilon);\n  }\n\n  async function performLongPressAndDrag(normalizedPositionX, normalizedPositionY, normalizedTargetPositionX, normalizedTargetPositionY) {\n\n    const dragAndDropTargetElement = element(by.id('DragAndDropTarget'));\n    const draggableElement = element(by.id('draggable'));\n\n    await draggableElement.longPressAndDrag(\n      1000,\n      normalizedPositionX,\n      normalizedPositionY,\n      dragAndDropTargetElement,\n      normalizedTargetPositionX,\n      normalizedTargetPositionY,\n      'fast',\n      0);\n\n    const targetElementAttributes = await dragAndDropTargetElement.getAttributes();\n    const draggableElementAttributes = await draggableElement.getAttributes();\n\n    const expectedTargetX = Math.ceil(targetElementAttributes.frame.x +\n      targetElementAttributes.frame.width * normalizedTargetPositionX -\n      draggableElementAttributes.frame.width * normalizedPositionX);\n    const expectedTargetY = Math.ceil(targetElementAttributes.frame.y +\n      targetElementAttributes.frame.height * normalizedTargetPositionY -\n      draggableElementAttributes.frame.height * normalizedPositionY);\n    const actualX = draggableElementAttributes.frame.x;\n    const actualY = draggableElementAttributes.frame.y;\n\n    expectWithEpsilon(actualX, expectedTargetX, 1);\n    expectWithEpsilon(actualY, expectedTargetY, 1);\n  }\n\n  it('should drag pan from left to left of the title', async () => {\n    await performLongPressAndDrag(0, 0, 0, 0);\n  });\n\n  it('should drag pan from left to right of the title', async () => {\n    await performLongPressAndDrag(0, 0, 1, 0);\n  });\n\n  it('should drag pan from right to left of the title', async () => {\n    await performLongPressAndDrag(1, 0, 0, 0);\n  });\n\n  it('should drag pan from right to right of the title', async () => {\n    await performLongPressAndDrag(1, 0, 1, 0);\n  });\n\n  it('should drag pan from center to center of the title', async () => {\n    await performLongPressAndDrag(0.5, 0.5, 0.5, 0.5);\n  });\n\n  it('should drag pan from center to left of the title', async () => {\n    await performLongPressAndDrag(0.5, 0.5, 0, 0);\n  });\n\n  it('should drag pan from left to center of the title', async () => {\n    await performLongPressAndDrag(0, 0, 0.5, 0.5);\n  });\n\n});\n"
  },
  {
    "path": "detox/test/e2e/29.webview.test.js",
    "content": "const {expectElementSnapshotToMatch} = require(\"./utils/snapshot\");\nconst {waitForCondition} = require(\"./utils/waitForCondition\");\nconst {expectToThrow} = require('./utils/custom-expects');\n\nconst jestExpect = require('expect').default;\n\nconst MockServer = require('../mock-server/mock-server');\n\ndescribe('WebView', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('WebView')).tap();\n  });\n\n  describe('single web-view scenario', () => {\n    const expectWebViewToMatchSnapshot = async (snapshotName) => {\n      const webViewElement = element(by.id('webViewFormWithScrolling'));\n      await expectElementSnapshotToMatch(webViewElement, snapshotName, 0.993);\n    };\n\n    describe('matchers', () => {\n      describe(':ios:', () => {\n        it('should not find element by invalid index', async () => {\n          await expect(web.element(by.web.tag('p')).atIndex(100)).not.toExist();\n        });\n\n        it('should find element by hrefContains', async () => {\n          await expect(web.element(by.web.hrefContains('w3schools'))).toExist();\n        });\n\n        it('should find element by href', async () => {\n          await expect(web.element(by.web.href('https://www.w3schools.com'))).toExist();\n        });\n\n        it('should raise an error when element does not exists but expect to exist', async () => {\n          await expectToThrow(async () => {\n            await expect(web.element(by.web.id('nonExistentElement'))).toExist();\n          });\n        });\n\n        it('should raise an error when does element not exists at index', async () => {\n          await expectToThrow(async () => {\n            await expect(web.element(by.web.tag('p')).atIndex(100)).toExist();\n          });\n        });\n\n        it('should find element by label', async () => {\n          await expect(web.element(by.web.label('first-webview'))).toExist();\n        });\n      });\n\n      it('should find element by id', async () => {\n        await expect(web.element(by.web.id('pageHeadline'))).toExist();\n      });\n\n      it('should find element by tag', async () => {\n        await expect(web.element(by.web.tag('body'))).toExist();\n      });\n\n      it('should find element by index', async () => {\n        await expect(web.element(by.web.tag('p')).atIndex(0)).toExist();\n      });\n\n      it('should find element by class name', async () => {\n        await expect(web.element(by.web.className('specialParagraph'))).toExist();\n      });\n\n      it('should find element by css selector', async () => {\n        await expect(web.element(by.web.cssSelector('.specialParagraph'))).toExist();\n      });\n\n      it('should find element by xpath', async () => {\n        await expect(web.element(by.web.xpath('//p[@class=\"specialParagraph\"]'))).toExist();\n      });\n\n      it('should find element by name', async () => {\n        await expect(web.element(by.web.name('fname'))).toExist();\n      });\n\n      it('should assert that an element is not visible', async () => {\n        await expect(web.element(by.web.id('nonExistentElement'))).not.toExist();\n      });\n    });\n\n    describe('actions', () => {\n      describe('input', () => {\n        const inputElement = web.element(by.web.id('fname'));\n\n        describe(':ios:', () => {\n          it('should type text in input regardless of content-editable parameter on ios', async () => {\n            await inputElement.typeText('Test', false);\n            await inputElement.typeText('er', true);\n\n            await expect(inputElement).toHaveText('Tester');\n          });\n\n          it('should type text in input', async () => {\n            await inputElement.typeText('Test');\n            await inputElement.typeText('er');\n\n            await expect(inputElement).toHaveText('Tester');\n          });\n\n          it('should type text in input with `email` type', async () => {\n            await inputElement.runScript((el) => { el.type = 'email'; });\n\n            await inputElement.typeText('Tester');\n\n            await expect(inputElement).toHaveText('Tester');\n          });\n\n          it.skip('should keep cursor position on end while typing', async () => {\n            await inputElement.typeText('Test');\n            await expectWebViewToMatchSnapshot('typing-keep-cursor-position-webview-input-1');\n\n            await inputElement.typeText('er');\n            await expectWebViewToMatchSnapshot('typing-keep-cursor-position-webview-input-2');\n          });\n\n          it('should not type more text than `maxlength` limit', async () => {\n            const text = '0123456789 ABCDEF';\n            await inputElement.typeText(text);\n\n            const maxlength = 10;\n            const expectedText = text.substring(0, maxlength);\n            await expect(inputElement).toHaveText(expectedText);\n          });\n\n          it('should clear text in input', async () => {\n            await inputElement.typeText('Test');\n            await inputElement.clearText();\n\n            await expect(inputElement).toHaveText('');\n          });\n\n          it('should replace text in input', async () => {\n            await inputElement.typeText('Temp');\n            await inputElement.replaceText('Tester');\n\n            await expect(inputElement).toHaveText('Tester');\n          });\n\n          it('should tap on submit button and update result', async () => {\n            await inputElement.typeText('Tester');\n            await web.element(by.web.id('submit')).tap();\n\n            await expect(inputElement).toHaveText('Tester');\n          });\n        });\n\n        it('should select all text in input', async () => {\n          await inputElement.typeText('Tester');\n          await inputElement.selectAllText();\n\n          await expectWebViewToMatchSnapshot('select-all-text-in-webview');\n        });\n\n        it('should focus on input', async () => {\n          await inputElement.focus();\n\n          await expectWebViewToMatchSnapshot('focus-on-input-webview');\n        });\n\n        it('should move cursor to end', async () => {\n          await inputElement.typeText('Tester');\n          await inputElement.moveCursorToEnd();\n\n          await expectWebViewToMatchSnapshot('move-cursor-to-end-webview');\n        });\n      });\n\n      describe('content-editable', () => {\n        const contentEditableElement = web.element(by.web.id('contentEditable'));\n\n        describe(':ios:', () => {\n          it('should type text in content-editable regardless of content-editable parameter on ios', async () => {\n            await contentEditableElement.typeText('Tes', false);\n            await contentEditableElement.typeText('te', true);\n            await contentEditableElement.typeText('r');\n\n            await expect(contentEditableElement).toHaveText('Name: Tester');\n          });\n\n          it('should clear text in content-editable', async () => {\n            await contentEditableElement.clearText();\n\n            await expect(contentEditableElement).toHaveText('');\n          });\n\n          it('should replace text in content-editable', async () => {\n            await contentEditableElement.replaceText('Tester');\n\n            await expect(contentEditableElement).toHaveText('Tester');\n          });\n\n          it('should type text in content-editable', async () => {\n            await contentEditableElement.typeText('Test', true);\n            await contentEditableElement.typeText('er', true);\n\n            await expect(contentEditableElement).toHaveText('Name: Tester');\n          });\n\n          it.skip('should keep cursor position on end while typing', async () => {\n            await contentEditableElement.typeText('Test', true);\n            await expectWebViewToMatchSnapshot('typing-keep-cursor-position-webview-content-editable-1');\n\n            await contentEditableElement.typeText('er', true);\n            await expectWebViewToMatchSnapshot('typing-keep-cursor-position-webview-content-editable-2');\n          });\n        });\n\n        it('should select all text in content-editable', async () => {\n          await contentEditableElement.selectAllText();\n\n          await expectWebViewToMatchSnapshot('select-all-text-in-content-editable-webview');\n        });\n\n        it('should focus on content-editable', async () => {\n          await contentEditableElement.focus();\n\n          await expectWebViewToMatchSnapshot('focus-on-content-editable-webview');\n        });\n\n        it('should move cursor to end', async () => {\n          await contentEditableElement.moveCursorToEnd();\n\n          await expectWebViewToMatchSnapshot('move-cursor-to-end-content-editable-webview');\n        });\n      });\n\n      it('should scroll to view', async () => {\n        await web.element(by.web.id('bottomParagraph')).scrollToView();\n\n        await expectWebViewToMatchSnapshot('scroll-to-view-webview');\n      });\n\n      it('should run script', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n        await headline.runScript('(el) => { el.textContent = \"Changed\"; }');\n\n        await expect(headline).toHaveText('Changed');\n      });\n\n      it('should run script with non-string function as parameter', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n        await headline.runScript((el) => { el.textContent = \"Changed\"; });\n\n        await expect(headline).toHaveText('Changed');\n      });\n\n      it('should run script with arguments', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n        await headline.runScript('(el, text) => { el.textContent = text; }', ['Changed']);\n\n        await expect(headline).toHaveText('Changed');\n      });\n\n      it('should run script with arguments with non-string function as parameter', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n        await headline.runScript((el, text) => { el.textContent = text; }, ['Changed']);\n\n        await expect(headline).toHaveText('Changed');\n      });\n\n      it('should return value from run script', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n        const textContent = await headline.runScript('(el) => { return el.textContent; }');\n\n        await jestExpect(textContent).toBe('First Webview');\n      });\n\n      it('should raise error when script fails', async () => {\n        const headline = web.element(by.web.id('pageHeadline'));\n\n        await expectToThrow(async () => {\n          await headline.runScript('(el) => { el.textContent = \"Changed\"; throw new Error(\"Error\"); }');\n        });\n      });\n    });\n\n    describe('getters', () => {\n      it(':ios: should get the web page url', async () => {\n        await web.element(by.web.id('w3link')).tap();\n\n        await waitForCondition(\n          () => web.element(by.web.tag('body')).getCurrentUrl(),\n          (result) => result === 'https://www.w3schools.com/',\n          5000\n        );\n      });\n\n      it('should get the web page title', async () => {\n        const title = await web.element(by.web.tag('body')).getTitle();\n        await jestExpect(title).toBe('First Webview');\n      });\n\n      it('should get text from element', async () => {\n        const source = await web.element(by.web.id('pageHeadline')).getText();\n        await jestExpect(source).toBe('First Webview');\n      });\n    });\n  });\n\n  describe('multiple web-views scenario',() => {\n    /** @type {Detox.WebViewElement} */\n    let webview;\n\n    beforeEach(async () => {\n      await element(by.id('toggle2ndWebviewButton')).tap();\n\n      webview = web(by.id('webView'));\n    });\n\n    it('should have a title', async () => {\n      const title = await webview.element(by.web.tag('body')).getTitle();\n      await jestExpect(title).toBe('Dummy Webview');\n    });\n\n    it('should have a paragraph', async () => {\n      await expect(webview.element(by.web.id('message'))).toExist();\n      await expect(webview.element(by.web.id('message'))).toHaveText('This is a dummy webview.');\n    });\n\n    it('should throw on multiple matches', async () => {\n      await element(by.id('toggle3rdWebviewButton')).tap();\n\n      await expectToThrow(async () => {\n        await expect(web(by.id('webView')).element(by.web.id('message'))).toExist();\n      });\n\n      await device.launchApp();\n    });\n\n    describe('at-index support', () => {\n      beforeEach(async () => {\n        await element(by.id('toggle3rdWebviewButton')).tap();\n      });\n\n      describe(':ios:', () => {\n        it('should find web-view by index', async () => {\n          await expect(web(by.id('webView')).atIndex(0).element(by.web.id('message'))).toExist();\n          await expect(web(by.id('webView')).atIndex(1).element(by.web.id('message'))).toExist();\n        });\n\n        it('should throw on index out of bounds', async () => {\n          await expectToThrow(async () => {\n            await expect(web(by.id('webView')).atIndex(2).element(by.web.id('message'))).toExist();\n          });\n        });\n      });\n\n      // Not implemented yet\n      it(':android: should throw on usage of atIndex', async () => {\n        await expectToThrow(async () => {\n          await expect(web(by.id('webView')).atIndex(0).element(by.web.id('message'))).toExist();\n        });\n      });\n    });\n  });\n});\n\ndescribe(':ios: WebView CORS (inner frame)', () => {\n  /** @type {Detox.WebViewElement} */\n  let webview;\n  let webviewElement;\n\n  const mockServer = new MockServer();\n\n  beforeAll(async () => {\n    mockServer.init();\n\n    if (device.getPlatform() === 'android') {\n      // Android needs to reverse the port in order to access the mock server\n      await device.reverseTcpPort(mockServer.port);\n    }\n  });\n\n  afterAll(async () => {\n    await mockServer.close();\n  });\n\n  const launchAndNavigateToInnerFrame = async (shouldDisableWebKitSecurity) => {\n    await device.launchApp({\n      newInstance: true,\n      launchArgs: {\n          detoxDisableWebKitSecurity:\n          shouldDisableWebKitSecurity !== undefined ? (shouldDisableWebKitSecurity ? 'true' : 'false') : undefined,\n      },\n    });\n\n    await element(by.text('WebView')).tap();\n    await element(by.id('toggle3rdWebviewButton')).tap();\n\n    webview = web(by.id('webView'));\n    webviewElement = element(by.id('webView'));\n  };\n\n  describe('detoxDisableWebKitSecurity', () => {\n    it('should find element in cross-origin frame when `detoxDisableWebKitSecurity` is `true`', async () => {\n      await launchAndNavigateToInnerFrame(true);\n\n      await expect(webview.element(by.web.tag('h1'))).toExist();\n      await expect(webview.element(by.web.tag('h1'))).toHaveText('Hello World!');\n    });\n\n    it('should not find element in cross-origin frame when `detoxDisableWebKitSecurity` is `false`', async () => {\n      await launchAndNavigateToInnerFrame(false);\n\n      await expect(webview.element(by.web.tag('h1'))).not.toExist();\n    });\n\n    it('should not find element in cross-origin frame when `detoxDisableWebKitSecurity` is not set', async () => {\n      await launchAndNavigateToInnerFrame();\n\n      await expect(webview.element(by.web.tag('h1'))).not.toExist();\n    });\n  });\n\n  describe('asSecured()', () => {\n    beforeEach(async () => {\n      await launchAndNavigateToInnerFrame();\n    });\n\n    it('should not find non-existing element in cross-origin frame with `asSecured()`', async () => {\n      await expect(web.element(by.web.label('Hello Worldd!')).asSecured()).not.toExist();\n      await expect(web.element(by.web.label('Non-existing element')).atIndex(3).asSecured()).not.toExist();\n    });\n\n    it('should find elements in cross-origin frame by type with `asSecured()`', async () => {\n      await expect(web.element(by.web.type('textField')).atIndex(1).asSecured()).toExist();\n    });\n\n    it('should find elements in cross-origin frame by label with `asSecured()`', async () => {\n      await expect(web.element(by.web.label('Hello World!')).asSecured()).toExist();\n    });\n\n    it('should type text in cross-origin frame with `asSecured()`', async () => {\n      await web.element(by.web.type('textField')).atIndex(1).asSecured().typeText('Test');\n      await expectElementSnapshotToMatch(webviewElement, 'cross-origin-frame.type-text-in', 0.97);\n\n      await web.element(by.web.type('textField')).asSecured().atIndex(1).replaceText('Test 2');\n      await expectElementSnapshotToMatch(webviewElement, 'cross-origin-frame.replace-text', 0.97);\n\n      await web.element(by.web.type('textField')).asSecured().atIndex(1).clearText();\n      await expectElementSnapshotToMatch(webviewElement, 'cross-origin-frame.clear-text', 0.97);\n    });\n\n    it('should tap on cross-origin frame element with `asSecured()`', async () => {\n      await web.element(by.web.type('textField')).asSecured().atIndex(1).typeText('Test');\n      await web.element(by.web.label('Submit')).asSecured().tap();\n\n      await expectElementSnapshotToMatch(webviewElement, 'tap-on-cross-origin-frame-element');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/30.custom-keyboard.test.js",
    "content": "describe(':ios: Custom Keyboard', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Custom Keyboard')).tap();\n  });\n\n  afterEach(async () => {\n    await element(by.id('closeButton')).tap();\n  });\n\n  it('should interact with keyboard when field is first responder', async () => {\n    await element(by.id('textWithCustomInput')).tap();\n    await element(by.id('keyboardHelloButton')).tap();\n    await expect(element(by.id('textWithCustomInput'))).toHaveText('World!');\n  });\n\n  it('should obscure elements at bottom of screen when visible', async () => {\n    await expect(element(by.text('Obscured by keyboard'))).toBeVisible();\n    await element(by.id('textWithCustomInput')).tap();\n    await expect(element(by.text('Obscured by keyboard'))).not.toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/32.visibility-debug-artifacts.test.js",
    "content": "const { expectToThrow } = require('./utils/custom-expects');\nconst { isRNNewArch } = require('../../src/utils/rn-consts/rn-consts');\n\nconst {\n  assertArtifactExists,\n  waitUntilArtifactsManagerIsIdle,\n} = require('./utils/artifactUtils');\n\ndescribe(':ios: Visibility Debug Artifacts', () => {\n  beforeEach(async() => {\n    await device.reloadReactNative();\n    await element(by.text('Visibility Debug Artifacts')).tap();\n  });\n\n  it('should not be able to tap an overlayed button', async () => {\n    await expectToThrow(\n      () => element(by.text('Button 1')).tap(),\n      `View is not hittable at its visible point. Error: View is not visible around point.`,\n    );\n  });\n\n  afterAll(async () => {\n    await waitUntilArtifactsManagerIsIdle();\n\n    const className = isRNNewArch ? \"RCTParagraphComponentView\" : \"RCTTextView\";\n    assertArtifactExists(`✓ _ios_ Visibility Debug Artifacts should not be able to tap an overlayed button/DETOX_VISIBILITY_${className}__0x*__SCREEN.png`);\n    assertArtifactExists(`✓ _ios_ Visibility Debug Artifacts should not be able to tap an overlayed button/DETOX_VISIBILITY_${className}__0x*__TEST.png`);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/33.attributes.test.js",
    "content": "const { device, element, by } = require('detox');\nconst { rnVersion } = require('../../src/utils/rn-consts/rn-consts');\nconst expect = require('expect').default;\n\ndescribe('Attributes', () => {\n  /** @type {Detox.IndexableNativeElement} */\n  let currentElement;\n  /** @type {Detox.IosElementAttributes | Detox.AndroidElementAttributes} */\n  let attributes;\n  /** @type {Detox.IosElementAttributes[] | Detox.AndroidElementAttributes[]} */\n  let attributesArray;\n\n  /**\n   * @param {Detox.NativeMatcher} matcher\n   */\n  async function useMatcher(matcher) {\n    currentElement = element(matcher);\n    const result = await currentElement.getAttributes();\n\n    if ('elements' in result) {\n      attributesArray = result.elements;\n    } else {\n      attributes = result;\n    }\n  }\n\n  beforeAll(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Attributes')).tap();\n  });\n\n  describe('of a view', () => {\n    beforeAll(() => useMatcher(by.id('viewId')));\n\n    it('should have the corresponding shape', () =>\n      expect(attributes).toMatchObject({\n        identifier: 'viewId',\n        enabled: true,\n        visible: true,\n      }));\n\n    it(':ios: should have the corresponding shape', () =>\n      expect(attributes).toMatchObject({\n        ...shapes.IosElementAttribute(),\n        hittable: true,\n      }));\n\n    it(':android: should have the corresponding shape', () => {\n      expect(attributes).toMatchObject({\n        visibility: 'visible',\n        width: expect.any(Number),\n        height: expect.any(Number),\n        elevation: 0,\n        alpha: 1,\n        focused: false,\n      });\n    });\n  });\n\n  describe('of a text', () => {\n    const EXPECTED_TEXT = 'TextView';\n\n    beforeAll(() => useMatcher(by.id('textViewId')));\n\n    it('should have the corresponding shape', () => {\n      expect(attributes).toMatchObject({\n        text: EXPECTED_TEXT,\n        label: EXPECTED_TEXT,\n      });\n    });\n\n    it(':ios: should not have any extra properties', () => {\n      expect(attributes).not.toMatchObject({\n        placeholder: expect.anything(),\n        value: expect.anything(),\n        date: expect.anything(),\n        normalizedSliderPosition: expect.anything(),\n        contentOffset: expect.anything(),\n        contentInset: expect.anything(),\n        adjustedContentInset: expect.anything(),\n      });\n    });\n\n    it(':android: should have the corresponding shape', () => {\n      expect(attributes).toMatchObject({\n        textSize: expect.any(Number),\n        length: EXPECTED_TEXT.length,\n      });\n    });\n  });\n\n  describe('of a text group', () => {\n    let EXPECTED_TEXT = 'InnerText1 InnerText2';\n    if (rnVersion.minor >= 81) {\n      EXPECTED_TEXT = 'InnerText1, InnerText2';\n    }\n\n    beforeAll(() => useMatcher(by.id('textGroupRoot')));\n\n    it('should have a label based on text concatenation', () => {\n\n      expect(attributes).toMatchObject({ label: EXPECTED_TEXT });\n    });\n  });\n\n  describe('of a text input', () => {\n    describe('(blurred)', () => {\n      beforeAll(() => useMatcher(by.id('blurredTextInputId')));\n\n      it('should have the corresponding attributes', () => {\n        expect(attributes).toMatchObject({\n          text: 'blurred',\n          placeholder: 'palace-holder',\n        });\n      });\n\n      it(':android: should not be .focused', () => {\n        expect(attributes).toMatchObject({\n          focused: false\n        });\n      });\n    });\n\n    describe('(focused)', () => {\n      beforeAll(() => useMatcher(by.id('focusedTextInputId')));\n\n      it('should have the corresponding attributes', () => {\n        expect(attributes).toMatchObject({\n          text: 'focused',\n          placeholder: 'palace-holder',\n        });\n      });\n\n      it(':android: should have the corresponding attributes', () => {\n        expect(attributes).toMatchObject({\n          focused: true\n        });\n      });\n    });\n  });\n\n  describe('of a checkbox', () => {\n    beforeAll(() => useMatcher(by.id('checkboxId')));\n\n    it(':ios: should have a string .value', async () => {\n      expect(await currentElement.getAttributes()).toMatchObject({\n        value: expect.stringContaining('off'),\n      });\n    });\n\n    // Checkbox is not working with the new arch yet\n    it.skip(':android: should have a boolean .value', async () => {\n      expect(await currentElement.getAttributes()).toMatchObject({\n        value: false\n      });\n\n      await currentElement.tap();\n\n      expect(await currentElement.getAttributes()).toMatchObject({\n        value: true\n      });\n    });\n  });\n\n  describe('of a legacy slider (@rn71)', () => {\n    beforeAll(() => useMatcher(by.id('legacySliderId')));\n\n    it(':ios: should have a string percent .value, and .normalizedSliderPosition', () => {\n      expect(attributes).toMatchObject({ value: '50%', normalizedSliderPosition: 0.5 });\n    });\n\n    it(':android: should have a number .value', () => {\n      expect(attributes).toMatchObject({ value: 0.5 });\n    });\n  });\n\n  describe('of a slider', () => {\n    beforeAll(() => useMatcher(by.id('sliderId')));\n\n    it(':ios: should have a string percent .value, and .normalizedSliderPosition', () => {\n      expect(attributes).toMatchObject({ value: '50%', normalizedSliderPosition: 0.5 });\n    });\n\n    it(':android: should have a number .value', () => {\n      expect(attributes).toMatchObject({ value: 0.5 });\n    });\n  });\n\n  describe('of a date picker', () => {\n    beforeAll(() => useMatcher(by.id('attrDatePicker')));\n\n    it(':ios: should have Date .value', () => {\n      expect(attributes).toMatchObject({\n        date: expect.stringMatching(/^2022-01-01T00:00:00([+-]\\d{2}:\\d{2}|Z)$/),\n      });\n    });\n  });\n\n  describe('of a legacy scroll view', () => {\n    it(':ios: @legacy should have offsets and insets', async () => {\n      await useMatcher(by.type('RCTCustomScrollView').withAncestor(by.id('attrScrollView')));\n\n      expect(attributes).toMatchObject({\n        contentOffset: shapes.Point2D(),\n        contentInset: shapes.IosElementAttributesInsets(),\n        adjustedContentInset: shapes.IosElementAttributesInsets(),\n      });\n    });\n  });\n\n  describe('of a new arch scroll view', () => {\n    it(':ios: @new-arch should have offsets and insets', async () => {\n      await useMatcher(by.id('attrScrollView'));\n\n      expect(attributes).toMatchObject({\n        contentOffset: shapes.Point2D(),\n        contentInset: shapes.IosElementAttributesInsets(),\n        adjustedContentInset: shapes.IosElementAttributesInsets(),\n      });\n    });\n  });\n\n  describe('of multiple views', () => {\n    it(':ios: @legacy should return an object with .elements array', async () => {\n      await useMatcher(by.type('RCTView').withAncestor(by.id('attrScrollView')));\n\n      const viewShape = {\n        identifier: expect.any(String),\n        enabled: true,\n        visible: true,\n        activationPoint: shapes.Point2D(),\n        normalizedActivationPoint: shapes.Point2D(),\n        hittable: true,\n        frame: shapes.IosElementAttributeFrame(),\n        elementFrame: shapes.IosElementAttributeFrame(),\n        elementBounds: shapes.IosElementAttributeFrame(),\n        safeAreaInsets: shapes.IosElementAttributesInsets(),\n        elementSafeBounds: shapes.IosElementAttributeFrame(),\n        layer: expect.stringMatching(/^<CALayer: 0x[\\da-f]+>$/),\n      };\n\n      const innerViews = attributesArray.filter(a => a.identifier);\n      expect(innerViews.length).toBe(2);\n      expect(innerViews[0]).toMatchObject({ ...viewShape });\n      expect(innerViews[1]).toMatchObject({ ...viewShape });\n    });\n\n    it(':ios: @new-arch should return an object with .elements array', async () => {\n      await useMatcher(by.type('RCTViewComponentView'));\n\n      const innerViews = attributesArray.filter(a => a.identifier);\n      expect(innerViews.length).toBeGreaterThan(1);\n    });\n\n    it(':android: should return an object with .elements array', async () => {\n      await useMatcher(by.type('com.facebook.react.views.view.ReactViewGroup').withAncestor(by.id('attrScrollView')));\n\n      expect(attributesArray.length).toBe(3);\n\n      const baseAttributes = {\n        visibility: 'visible',\n        visible: true,\n        alpha: 1,\n        elevation: 0,\n        focused: false,\n        enabled: true,\n      };\n\n      expect(attributesArray[0]).toMatchObject({\n        ...{\n          height: 412,\n          width: 1074,\n        },\n        ...baseAttributes\n      });\n\n      expect(attributesArray[1]).toMatchObject({\n        ...{\n          height: 206,\n          width: 275,\n          identifier: 'innerView1'\n        },\n        ...baseAttributes\n      });\n\n      expect(attributesArray[2]).toMatchObject({\n        ...{\n          height: 206,\n          width: 275,\n          identifier: 'innerView2'\n        },\n        ...baseAttributes\n      });\n    });\n  });\n});\n\nconst shapes = {\n  Point2D: () => ({\n    x: expect.any(Number),\n    y: expect.any(Number),\n  }),\n  IosElementAttribute: () => ({\n    activationPoint: shapes.Point2D(),\n    normalizedActivationPoint: shapes.Point2D(),\n    hittable: expect.any(Boolean),\n    frame: shapes.IosElementAttributeFrame(),\n    elementFrame: shapes.IosElementAttributeFrame(),\n    elementBounds: shapes.IosElementAttributeFrame(),\n    safeAreaInsets: shapes.IosElementAttributesInsets(),\n    elementSafeBounds: shapes.IosElementAttributeFrame(),\n    layer: expect.stringMatching(/^<CALayer: 0x[\\da-f]+>$/),\n  }),\n  IosElementAttributeFrame: () => ({\n    y: expect.any(Number),\n    x: expect.any(Number),\n    width: expect.any(Number),\n    height: expect.any(Number),\n  }),\n  IosElementAttributesInsets: () => ({\n    right: expect.any(Number),\n    top: expect.any(Number),\n    left: expect.any(Number),\n    bottom: expect.any(Number),\n  }),\n};\n"
  },
  {
    "path": "detox/test/e2e/34.visibility.test.js",
    "content": "const { scrollViewDriver } = require('./drivers/fs-scroll-driver');\n\n\ndescribe('visibility expectation', () => {\n  let halfVisibleElement;\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Visibility Expectation')).tap();\n    halfVisibleElement = await element(by.id('halfVisible'));\n  });\n\n  it(`should be truthy when at least 50% visibility is required`, async () => {\n    await expect(halfVisibleElement).toBeVisible(50);\n  });\n\n  it(`should be falsy when at least 51% visibility is required`, async () => {\n    await expect(halfVisibleElement).not.toBeVisible(51);\n  });\n\n  describe(`after element location has changed`, () => {\n    beforeEach(async () => {\n      await element(by.id('moveHalfVisible')).tap();\n    });\n\n    it(`should be truthy when at least 25% visibility is required`, async () => {\n      await waitFor(halfVisibleElement).toBeVisible(25).withTimeout(2000);\n    });\n\n    it(`should be falsy when at least 26% visibility is required`, async () => {\n      await waitFor(halfVisibleElement).not.toBeVisible(26).withTimeout(2000);\n    });\n  });\n});\n\ndescribe('visibility expectation in ScrollView', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('FS Scroll Actions')).tap();\n  });\n\n  it(`should be truthy when at least 50% visibility is required`, async () => {\n    const item = scrollViewDriver.listItem(16);\n    await waitFor(item).toBeVisible(50).whileElement(scrollViewDriver.byId()).scroll(10, 'down');\n\n    // We are not sure how much percentage of the item is visible because of the scrolling speed. It shouldn't be visible after scrolling for 100%.\n    await expect(item).not.toBeVisible(80);\n  });\n\n  it(`should be truthy when at least 100% visibility is required`, async () => {\n    const item = scrollViewDriver.listItem(16);\n    await waitFor(item).toBeVisible(100).whileElement(scrollViewDriver.byId()).scroll(10, 'down');\n  });\n\n  it(`:ios: should not detect scroll view cell until default visibility threshold (75%) is met`, async () => {\n    const item = scrollViewDriver.listItem(16);\n    await waitFor(item).toBeVisible().whileElement(scrollViewDriver.byId()).scroll(10, 'down');\n    await expect(item).toBeVisible(75);\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/35.overlay.test.js",
    "content": "const { expectToThrow } = require('./utils/custom-expects');\n\ndescribe(':ios: Overlay', () => {\n  let showAlertButton;\n  let showOverlayWindowButton;\n  let showOverlayViewButton;\n  let verticalScrollView;\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await device.launchApp({newInstance: true});\n\n    await element(by.text('Overlay')).tap();\n\n    showOverlayWindowButton = await element(by.id('ShowOverlayWindowButton'));\n    await expect(showOverlayWindowButton).toBeVisible();\n\n    showOverlayViewButton = await element(by.id('ShowOverlayViewButton'));\n    await expect(showOverlayViewButton).toBeVisible();\n\n    showAlertButton = await element(by.id('ShowDismissibleAlertButton'));\n    await expect(showAlertButton).toBeVisible();\n\n    verticalScrollView = await element(by.id('VerticalScrollView'));\n  });\n\n  describe('default behaviour', () => {\n    it('should be able to scroll elements', async () => {\n      await verticalScrollView.scrollTo('bottom');\n      await expect(showOverlayWindowButton).not.toBeVisible();\n    });\n  });\n\n  describe('alert window', () => {\n    let dismissAlertButton;\n\n    beforeEach(async () => {\n      await showAlertButton.tap();\n      dismissAlertButton = await element(by.text('Dismiss'));\n    });\n\n    describe('when shown', () => {\n      it('should not be able to tap on elements', async () => {\n        await expectToThrow(() => showOverlayWindowButton.tap());\n      });\n\n      it('should not be able to scroll elements', async () => {\n        await expectToThrow(() => verticalScrollView.scrollTo('bottom'));\n      });\n    });\n\n    describe('after dismiss', () => {\n      beforeEach(async () => {\n        await dismissAlertButton.tap();\n      });\n\n      it('should be able to tap on elements', async () => {\n        await showOverlayWindowButton.tap();\n      });\n\n      it('should be able to scroll elements', async () => {\n        await verticalScrollView.scrollTo('bottom');\n        await expect(showOverlayWindowButton).not.toBeVisible();\n      });\n    });\n  });\n\n  describe('overlay window', () => {\n    describe('when shown', () => {\n      beforeEach(async () => {\n        await showOverlayWindowButton.tap();\n      });\n\n      it('should not be able to tap on elements', async () => {\n        await expectToThrow(() => showOverlayWindowButton.tap());\n      });\n\n      it('should not be able to scroll elements', async () => {\n        await expectToThrow(() => verticalScrollView.scrollTo('bottom'));\n      });\n    });\n  });\n\n  describe('overlay view', () => {\n    describe('when shown', () => {\n      beforeEach(async () => {\n        await showOverlayViewButton.tap();\n      });\n\n      it('should be hittable', async () => {\n        const overlayView = await element(by.id('OverlayView'));\n        await overlayView.tap();\n      });\n\n      it('should not be able to tap on elements', async () => {\n        await expectToThrow(() => showOverlayViewButton.tap());\n      });\n\n      it('should not be able to scroll elements', async () => {\n        await expectToThrow(() => showOverlayViewButton.scrollTo('bottom'));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/36.system.test.js",
    "content": "const {expectToThrow} = require('./utils/custom-expects');\n\ndescribe('System Dialogs', () => {\n  describe(':ios: supported', () => {\n    beforeAll(async () => {\n      await device.reloadReactNative();\n    });\n\n    describe('request permission dialog', () => {\n      beforeEach(async () => {\n        await device.launchApp({\n          delete: true,\n          newInstance: true,\n        });\n\n        await element(by.text('System Dialogs')).tap();\n      });\n\n      const permissionStatus = element(by.id('permissionStatus'));\n      const requestPermissionButton = element(by.id('requestPermissionButton'));\n\n      it('should start with `denied` permission status', async () => {\n        await expect(permissionStatus).toHaveText('denied');\n      });\n\n      it('should tap on permission request alert button by label (\"Allow\")', async () => {\n        await requestPermissionButton.tap();\n\n        const allowButton = system.element(by.system.label('Allow'));\n\n        await expect(allowButton).toExist();\n        await allowButton.tap();\n\n        await expect(permissionStatus).toHaveText('granted');\n      });\n\n      it('should tap on permission request alert button by type and index (\"Deny\")', async () => {\n        await requestPermissionButton.tap();\n\n        const denyButton = system.element(by.system.type('button')).atIndex(0);\n\n        await expect(denyButton).toExist();\n        await denyButton.tap();\n\n        await expect(permissionStatus).toHaveText('blocked');\n      });\n    });\n\n    it('should not find elements that does not exist', async () => {\n      await expect(system.element(by.system.label('NonExistent'))).not.toExist();\n    });\n\n    it('should raise when trying to match system element that does not exist', async () => {\n      await expectToThrow(async () => {\n        await expect(system.element(by.system.label('NonExistent'))).toExist();\n      }, 'Expectation failed, element with matcher `label == \"NonExistent\"` does not exist');\n    });\n\n    it('should raise when trying to tap on system element that does not exist', async () => {\n      await expectToThrow(async () => {\n        await system.element(by.system.label('NonExistent')).tap();\n      }, 'Action failed, element with matcher `label == \"NonExistent\"` does not exist');\n    });\n  });\n\n  describe(':android: not supported on Android', () => {\n    it('should throw on expectation call', async () => {\n      await expectToThrow(async () => {\n        await expect(system.element(by.system.label('Allow'))).toExist();\n      }, 'System interactions are not supported on Android, use UiDevice APIs directly instead');\n    });\n\n    it('should throw on action call', async () => {\n      await expectToThrow(async () => {\n        await system.element(by.system.type('button')).atIndex(0).tap();\n      }, 'System interactions are not supported on Android, use UiDevice APIs directly instead');\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/37.dialogs.test.js",
    "content": "describe('alerts', () => {\n\n  beforeAll(async () => {\n    await device.launchApp({\n      delete: true,\n      newInstance: true,\n    });\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Alerts')).tap();\n  });\n\n  it('should click on ok and cancel buttons', async () => {\n    await expect(element(by.id('AlertScreen.Text'))).toHaveText('Not Pressed');\n    await element(by.id('AlertScreen.Button')).tap();\n    await expect(element(by.text('Alert Title'))).toBeVisible();\n    await expect(element(by.text('My Alert Msg'))).toBeVisible();\n    await element(by.text('OK')).tap();\n    await expect(element(by.id('AlertScreen.Text'))).toHaveText('OK Pressed');\n    await element(by.id('AlertScreen.Button')).tap();\n    await element(by.text('Cancel')).tap();\n    await expect(element(by.id('AlertScreen.Text'))).toHaveText('Cancel Pressed');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/38.config-systemui.test.js",
    "content": "const {expectDeviceSnapshotToMatch} = require('./utils/snapshot');\n\ndescribe(':android: System UI configuration', () => {\n  it('should match home screen snapshot with system UI configuration', async () => {\n    await device.sendToHome();\n    await expectDeviceSnapshotToMatch('detox-config.systemui-basic');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\">\n                <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle2ndWebviewButton\">\n                  <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 2ND WEBVIEW\" />\n                </ReactViewGroup>\n                <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle3rdWebviewButton\">\n                  <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 3RD WEBVIEW\" />\n                </ReactViewGroup>\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n                <RNCWebViewWrapper class=\"com.reactnativecommunity.webview.RNCWebViewWrapper\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"webViewFormWithScrolling\">\n                  <RNCWebView class=\"com.reactnativecommunity.webview.RNCWebView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\"><![CDATA[\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\n    <body>\n        <h1 id=\\\"pageHeadline\\\" aria-label=\\\"first-webview\\\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\\\"fname\\\">Your name:</label><br />\n            <input type=\\\"text\\\" id=\\\"fname\\\" name=\\\"fname\\\" maxlength=\\\"10\\\" /><br />\n            <input type=\\\"submit\\\" id=\\\"submit\\\" value=\\\"Submit\\\" onclick=\\\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\\\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\\\"resultFname\\\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\\\"contentEditable\\\" class=\\\"contentEditable\\\" contenteditable=\\\"true\\\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\\\"w3link\\\" href=\\\"https://www.w3schools.com\\\">link</a>.</p>\n        <p id=\\\"bottomParagraph\\\" class=\\\"specialParagraph\\\">This is a bottom paragraph with class.</p>\n\n\n</body></html>\"]]>\n                  </RNCWebView>\n                </RNCWebViewWrapper>\n              </ReactViewGroup>\n            </ReactRootView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n  </DecorView>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.73.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle2ndWebviewButton\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n             <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n            </RCTView>\n           </RCTView>\n          </RCTView>\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle3rdWebviewButton\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n             <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n            </RCTView>\n           </RCTView>\n          </RCTView>\n         </RCTView>\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RNCWebViewImpl alpha=\"1.0\" class=\"RNCWebViewImpl\" focused=\"false\" height=\"<number>\" id=\"webViewFormWithScrolling\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n             <RNCWKWebView alpha=\"1.0\" class=\"RNCWKWebView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n             \t<![CDATA[<html xmlns=\"http://www.w3.org/1999/xhtml\">\n    <body>\n        <h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\"fname\">Your name:</label><br />\n            <input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"<number>\" /><br />\n            <input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\"resultFname\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\"contentEditable\" class=\"contentEditable\" contenteditable=\"true\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>\n        <p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>\n\n\n</body></html>]]>\n             </RNCWKWebView>\n            </RNCWebViewImpl>\n           </RCTView>\n          </RCTView>\n         </RCTView>\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.75.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\">\n                <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle2ndWebviewButton\">\n                  <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 2ND WEBVIEW\" />\n                </ReactViewGroup>\n                <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle3rdWebviewButton\">\n                  <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 3RD WEBVIEW\" />\n                </ReactViewGroup>\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n                <RNCWebViewWrapper class=\"com.reactnativecommunity.webview.RNCWebViewWrapper\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"webViewFormWithScrolling\">\n                  <RNCWebView class=\"com.reactnativecommunity.webview.RNCWebView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\"><![CDATA[\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\n    <body>\n        <h1 id=\\\"pageHeadline\\\" aria-label=\\\"first-webview\\\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\\\"fname\\\">Your name:</label><br />\n            <input type=\\\"text\\\" id=\\\"fname\\\" name=\\\"fname\\\" maxlength=\\\"10\\\" /><br />\n            <input type=\\\"submit\\\" id=\\\"submit\\\" value=\\\"Submit\\\" onclick=\\\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\\\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\\\"resultFname\\\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\\\"contentEditable\\\" class=\\\"contentEditable\\\" contenteditable=\\\"true\\\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\\\"w3link\\\" href=\\\"https://www.w3schools.com\\\">link</a>.</p>\n        <p id=\\\"bottomParagraph\\\" class=\\\"specialParagraph\\\">This is a bottom paragraph with class.</p>\n    \n\n</body></html>\"]]>\n                  </RNCWebView>\n                </RNCWebViewWrapper>\n              </ReactViewGroup>\n            </ReactRootView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n  </DecorView>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.75.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle2ndWebviewButton\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n           </RCTView>\n          </RCTView>\n         </RCTView>\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle3rdWebviewButton\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n           </RCTView>\n          </RCTView>\n         </RCTView>\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RNCWebViewImpl alpha=\"1.0\" class=\"RNCWebViewImpl\" focused=\"false\" height=\"<number>\" id=\"webViewFormWithScrolling\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RNCWKWebView alpha=\"1.0\" class=\"RNCWKWebView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            \t<![CDATA[<html xmlns=\"http://www.w3.org/1999/xhtml\">\n    <body>\n        <h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\"fname\">Your name:</label><br />\n            <input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"<number>\" /><br />\n            <input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\"resultFname\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\"contentEditable\" class=\"contentEditable\" contenteditable=\"true\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>\n        <p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>\n\n\n</body></html>]]>\n            </RNCWKWebView>\n           </RNCWebViewImpl>\n          </RCTView>\n         </RCTView>\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.76.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\n            <ReactSurfaceView class=\"com.facebook.react.runtime.ReactSurfaceView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle2ndWebviewButton\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 2ND WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 2ND WEBVIEW\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" id=\"toggle3rdWebviewButton\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"SHOW 3RD WEBVIEW\" x=\"<number>\" y=\"<number>\" text=\"SHOW 3RD WEBVIEW\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n                <RNCWebViewWrapper class=\"com.reactnativecommunity.webview.RNCWebViewWrapper\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"webViewFormWithScrolling\">\n                  <RNCWebView class=\"com.reactnativecommunity.webview.RNCWebView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\"><![CDATA[\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\n    <body>\n        <h1 id=\\\"pageHeadline\\\" aria-label=\\\"first-webview\\\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\\\"fname\\\">Your name:</label><br />\n            <input type=\\\"text\\\" id=\\\"fname\\\" name=\\\"fname\\\" maxlength=\\\"10\\\" /><br />\n            <input type=\\\"submit\\\" id=\\\"submit\\\" value=\\\"Submit\\\" onclick=\\\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\\\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\\\"resultFname\\\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\\\"contentEditable\\\" class=\\\"contentEditable\\\" contenteditable=\\\"true\\\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\\\"w3link\\\" href=\\\"https://www.w3schools.com\\\">link</a>.</p>\n        <p id=\\\"bottomParagraph\\\" class=\\\"specialParagraph\\\">This is a bottom paragraph with class.</p>\n\n\n</body></html>\"]]>\n                  </RNCWebView>\n                </RNCWebViewWrapper>\n              </ReactViewGroup>\n            </ReactSurfaceView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n  </DecorView>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.76.ios.new-arch.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTSurfaceHostingProxyRootView alpha=\"1.0\" class=\"RCTSurfaceHostingProxyRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <UIStackView alpha=\"1.0\" class=\"UIStackView\" focused=\"false\" height=\"<number>\" id=\"overlayStackView\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n     <RCTSurfaceView alpha=\"1.0\" class=\"RCTSurfaceView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTRootComponentView alpha=\"1.0\" class=\"RCTRootComponentView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" id=\"toggle2ndWebviewButton\" label=\"Show 2nd webview\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" id=\"toggle3rdWebviewButton\" label=\"Show 3rd webview\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RNCWebView alpha=\"1.0\" class=\"RNCWebView\" focused=\"false\" height=\"<number>\" id=\"webViewFormWithScrolling\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RNCWebViewImpl alpha=\"1.0\" class=\"RNCWebViewImpl\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RNCWKWebView alpha=\"1.0\" class=\"RNCWKWebView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          \t<![CDATA[<html xmlns=\"http://www.w3.org/1999/xhtml\">\n    <body>\n        <h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\"fname\">Your name:</label><br />\n            <input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"<number>\" /><br />\n            <input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\"resultFname\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\"contentEditable\" class=\"contentEditable\" contenteditable=\"true\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>\n        <p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>\n    \n\n</body></html>]]>\n          </RNCWKWebView>\n         </RNCWebViewImpl>\n        </RNCWebView>\n       </RCTViewComponentView>\n      </RCTRootComponentView>\n     </RCTSurfaceView>\n    </RCTSurfaceHostingProxyRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-web-view.76.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle2ndWebviewButton\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 2nd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n           </RCTView>\n          </RCTView>\n         </RCTView>\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"toggle3rdWebviewButton\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Show 3rd webview\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n           </RCTView>\n          </RCTView>\n         </RCTView>\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n           <RNCWebViewImpl alpha=\"1.0\" class=\"RNCWebViewImpl\" focused=\"false\" height=\"<number>\" id=\"webViewFormWithScrolling\" label=\"Vertical scroll bar, 4 pages Horizontal scroll bar, 1 page\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            <RNCWKWebView alpha=\"1.0\" class=\"RNCWKWebView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n            \t<![CDATA[<html xmlns=\"http://www.w3.org/1999/xhtml\">\n    <body>\n        <h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\"fname\">Your name:</label><br />\n            <input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"<number>\" /><br />\n            <input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\" />\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\"resultFname\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\"contentEditable\" class=\"contentEditable\" contenteditable=\"true\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>\n        <p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>\n    \n\n</body></html>]]>\n            </RNCWKWebView>\n           </RNCWebViewImpl>\n          </RCTView>\n         </RCTView>\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.73.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\r\n<ViewHierarchy density=\"2.75\">\r\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\r\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\r\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\r\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\r\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\r\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\r\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\r\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\r\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" id=\"detox_temp_0_1_0_1_0_0\" />\r\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_1\">\r\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" id=\"detox_temp_0_1_0_1_0_1_0\" />\r\n              </ReactViewGroup>\r\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_2\">\r\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" id=\"detox_temp_0_1_0_1_0_2_0\" />\r\n              </ReactViewGroup>\r\n            </ReactRootView>\r\n          </ContentFrameLayout>\r\n        </FitWindowsLinearLayout>\r\n      </FrameLayout>\r\n    </LinearLayout>\r\n  </DecorView>\r\n</ViewHierarchy>\r\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.73.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0_0\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0_1\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0_1_0\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         </RCTView>\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0_2\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0_2_0\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         </RCTView>\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" id=\"detox_temp_0_1_0_1_0_0\" />\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_1\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" id=\"detox_temp_0_1_0_1_0_1_0\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_2\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" id=\"detox_temp_0_1_0_1_0_2_0\" />\n              </ReactViewGroup>\n            </ReactRootView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_1\" />\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_2\" />\n  </DecorView>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_1\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_1_0\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_2\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_2_0\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.76.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_0\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_0\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1\">\n            <ReactSurfaceView class=\"com.facebook.react.runtime.ReactSurfaceView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0\">\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" id=\"detox_temp_0_1_0_1_0_0\" />\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_1\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" id=\"detox_temp_0_1_0_1_0_1_0\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" id=\"detox_temp_0_1_0_1_0_2\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" id=\"detox_temp_0_1_0_1_0_2_0\" />\n              </ReactViewGroup>\n            </ReactSurfaceView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n  </DecorView>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.76.ios.new-arch.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTSurfaceHostingProxyRootView alpha=\"1.0\" class=\"RCTSurfaceHostingProxyRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <UIStackView alpha=\"1.0\" class=\"UIStackView\" focused=\"false\" height=\"<number>\" id=\"overlayStackView\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n     <RCTSurfaceView alpha=\"1.0\" class=\"RCTSurfaceView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTRootComponentView alpha=\"1.0\" class=\"RCTRootComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0\" label=\"Welcome Say Hello Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_0\" label=\"Welcome\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n       </RCTParagraphComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_1\" label=\"Say Hello\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_1_0\" label=\"Say Hello\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_1_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_2\" label=\"Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_2_0\" label=\"Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_1_0_2_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n      </RCTRootComponentView>\n     </RCTSurfaceView>\n    </RCTSurfaceHostingProxyRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-with-test-id-injection.76.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" id=\"detox_temp_\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_0\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_1\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_1_0\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_2\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" id=\"detox_temp_0_0_0_0_0_0_2_0\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.73.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\r\n<ViewHierarchy density=\"2.75\">\r\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\r\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\r\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\r\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\r\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\r\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\r\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\r\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\">\r\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" />\r\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\">\r\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" />\r\n              </ReactViewGroup>\r\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\">\r\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" />\r\n              </ReactViewGroup>\r\n            </ReactRootView>\r\n          </ContentFrameLayout>\r\n        </FitWindowsLinearLayout>\r\n      </FrameLayout>\r\n    </LinearLayout>\r\n  </DecorView>\r\n</ViewHierarchy>\r\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.73.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         </RCTView>\n         <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n          <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n         </RCTView>\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n            <ReactRootView class=\"com.facebook.react.ReactRootView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\">\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" />\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" />\n              </ReactViewGroup>\n            </ReactRootView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n    <View class=\"android.view.View\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n  </DecorView>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.76.android.txt",
    "content": "<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>\n<ViewHierarchy density=\"2.75\">\n  <DecorView class=\"com.android.internal.policy.DecorView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n    <LinearLayout class=\"android.widget.LinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n      <ViewStub class=\"android.view.ViewStub\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n      <FrameLayout class=\"android.widget.FrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n        <FitWindowsLinearLayout class=\"androidx.appcompat.widget.FitWindowsLinearLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n          <ViewStubCompat class=\"androidx.appcompat.widget.ViewStubCompat\" width=\"<number>\" height=\"<number>\" visibility=\"gone\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\" />\n          <ContentFrameLayout class=\"androidx.appcompat.widget.ContentFrameLayout\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" x=\"<number>\" y=\"<number>\">\n            <ReactSurfaceView class=\"com.facebook.react.runtime.ReactSurfaceView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome Say Hello Say World\" x=\"<number>\" y=\"<number>\">\n              <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Welcome\" x=\"<number>\" y=\"<number>\" text=\"Welcome\" />\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say Hello\" x=\"<number>\" y=\"<number>\" text=\"Say Hello\" />\n              </ReactViewGroup>\n              <ReactViewGroup class=\"com.facebook.react.views.view.ReactViewGroup\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\">\n                <ReactTextView class=\"com.facebook.react.views.text.ReactTextView\" width=\"<number>\" height=\"<number>\" visibility=\"visible\" alpha=\"1.0\" focused=\"false\" label=\"Say World\" x=\"<number>\" y=\"<number>\" text=\"Say World\" />\n              </ReactViewGroup>\n            </ReactSurfaceView>\n          </ContentFrameLayout>\n        </FitWindowsLinearLayout>\n      </FrameLayout>\n    </LinearLayout>\n  </DecorView>\n</ViewHierarchy>\n"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.76.ios.new-arch.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTSurfaceHostingProxyRootView alpha=\"1.0\" class=\"RCTSurfaceHostingProxyRootView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <UIStackView alpha=\"1.0\" class=\"UIStackView\" focused=\"false\" height=\"<number>\" id=\"overlayStackView\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n     <RCTSurfaceView alpha=\"1.0\" class=\"RCTSurfaceView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTRootComponentView alpha=\"1.0\" class=\"RCTRootComponentView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" label=\"Welcome\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n       </RCTParagraphComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n       <RCTViewComponentView alpha=\"1.0\" class=\"RCTViewComponentView\" focused=\"false\" height=\"<number>\" label=\"Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTParagraphComponentView alpha=\"1.0\" class=\"RCTParagraphComponentView\" focused=\"false\" height=\"<number>\" label=\"Say World\" tag=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTParagraphTextView alpha=\"1.0\" class=\"RCTParagraphTextView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTParagraphComponentView>\n       </RCTViewComponentView>\n      </RCTRootComponentView>\n     </RCTSurfaceView>\n    </RCTSurfaceHostingProxyRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/assets/view-hierarchy-without-test-id-injection.76.ios.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ViewHierarchy>\n <UIWindow alpha=\"1.0\" class=\"UIWindow\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\">\n  <UITransitionView alpha=\"1.0\" class=\"UITransitionView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n   <UIDropShadowView alpha=\"1.0\" class=\"UIDropShadowView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n    <RCTRootView alpha=\"1.0\" class=\"RCTRootView\" focused=\"false\" height=\"<number>\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n     <RCTRootContentView alpha=\"1.0\" class=\"RCTRootContentView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n      <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n       <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Welcome Say Hello Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n        <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Welcome\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say Hello\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n        <RCTView alpha=\"1.0\" class=\"RCTView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\">\n         <RCTTextView alpha=\"1.0\" class=\"RCTTextView\" focused=\"false\" height=\"<number>\" label=\"Say World\" visibility=\"visible\" width=\"<number>\" x=\"<number>\" y=\"<number>\" />\n        </RCTView>\n       </RCTView>\n      </RCTView>\n     </RCTRootContentView>\n    </RCTRootView>\n   </UIDropShadowView>\n  </UITransitionView>\n </UIWindow>\n</ViewHierarchy>"
  },
  {
    "path": "detox/test/e2e/customPathBuilder.js",
    "content": "module.exports = ({ rootDir }) => {\n  const path = require('path');\n  const sanitize = require('sanitize-filename');\n\n  return {\n    buildPathForTestArtifact(artifactName, _testSummary) {\n      return path.join(rootDir, sanitize(artifactName));\n    }\n  };\n};\n"
  },
  {
    "path": "detox/test/e2e/detox.config-android.js",
    "content": "const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);\n\nfunction androidBaseAppConfig(buildType /* 'debug' | 'release' */) {\n  const buildTypeUC = capitalizeFirstLetter(buildType);\n\n  return {\n    type: 'android.apk',\n    binaryPath: `android/app/build/outputs/apk/${buildType}/app-${buildType}.apk`,\n    build: `cd android && ./gradlew assemble${buildTypeUC} assemble${buildTypeUC}AndroidTest -DtestBuildType=${buildType} && cd ..`,\n  };\n}\n\nmodule.exports = {\n  androidBaseAppConfig,\n};\n"
  },
  {
    "path": "detox/test/e2e/detox.config.js",
    "content": "const { androidBaseAppConfig } = require('./detox.config-android');\n\nconst launchArgs = {\n  app: 'le',\n  goo: 'gle?',\n  micro: 'soft',\n};\n\n/** @type {Detox.DetoxConfig} */\nconst config = {\n  extends: 'detox-allure2-adapter/preset-detox',\n  testRunner: {\n    args: {\n      $0: process.env.CI ? 'nyc jest' : 'jest',\n      config: 'e2e/jest.config.js',\n      forceExit: process.env.CI ? true : undefined,\n      _: ['e2e/'],\n    },\n    detached: !!process.env.CI,\n    retries: process.env.CI ? 1 : undefined,\n    jest: {\n      setupTimeout: +`${process.env.DETOX_JEST_SETUP_TIMEOUT || 300000}`,\n      reportSpecs: process.env.CI ? true : undefined,\n    },\n  },\n\n  behavior: {\n    init: {\n      exposeGlobals: true\n    },\n    cleanup: {\n      shutdownDevice: false\n    }\n  },\n\n  __session: {\n    server: 'ws://localhost:8099',\n    sessionId: 'test'\n  },\n\n  artifacts: {\n    pathBuilder: process.env.DETOX_CUSTOM_PATH_BUILDER,\n    plugins: {\n      log: 'all',\n      screenshot: {\n        keepOnlyFailedTestsArtifacts: false,\n      },\n    },\n  },\n\n  apps: {\n    'ios.debug': {\n      type: 'ios.app',\n      name: 'example',\n      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/example.app',\n      build: 'set -o pipefail && xcodebuild -workspace ios/example.xcworkspace -scheme example-ci -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -quiet',\n      start: 'react-native start',\n      bundleId: 'com.wix.detox-example',\n    },\n\n    'ios.release': {\n      type: 'ios.app',\n      name: 'example',\n      binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/example.app',\n      build: 'set -o pipefail && export CODE_SIGNING_REQUIRED=NO && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/example.xcworkspace -scheme example-ci -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet',\n    },\n\n    'android.debug': {\n      ...androidBaseAppConfig('debug'),\n      name: 'example',\n      start: 'react-native start',\n      reversePorts: [8081],\n    },\n\n    'android.debug.withArgs': {\n      ...androidBaseAppConfig('debug'),\n      name: 'exampleWithArgs',\n      build: ':',\n      reversePorts: [8081],\n      launchArgs,\n    },\n\n    'android.release': {\n      ...androidBaseAppConfig('release'),\n      name: 'example',\n    },\n\n    'android.release.withArgs': {\n      ...androidBaseAppConfig('release'),\n      name: 'exampleWithArgs',\n      build: ':',\n      launchArgs,\n    },\n  },\n\n  devices: {\n    'ios.simulator': {\n      type: 'ios.simulator',\n      headless: Boolean(process.env.CI),\n      device: {\n        type: 'iPhone 17 Pro',\n        os: '26.1'\n      },\n    },\n\n    'android.emulator': {\n      type: 'android.emulator',\n      headless: Boolean(process.env.CI),\n      device: {\n        avdName: 'Pixel_3a_API_36'\n      },\n      utilBinaryPaths: [\"e2e/util-binary/detoxbutler-1.1.0-aosp-release.apk\"],\n      systemUI: {\n        extends: 'genymotion',\n        pointerLocationBar: 'show',\n        touches: 'show',\n        navigationMode: '3-button',\n        statusBar: {\n          clock: '1948',\n        },\n      },\n    },\n\n    'android.attached': {\n      type: 'android.attached',\n      device: {\n        adbName: '.*'\n      },\n    },\n\n    'android.genycloud.uuid': {\n      type: 'android.genycloud',\n      device: {\n        recipeUUID: '9baf12f9-a645-4ffa-a688-0e92584d6194',\n      },\n      utilBinaryPaths: [\"e2e/util-binary/detoxbutler-1.1.0-genymotion-release.apk\"]\n    },\n\n    'android.genycloud.name': {\n      type: 'android.genycloud',\n      device: {\n        recipeName: 'Detox_Pixel_3a_API_34',\n      },\n      utilBinaryPaths: [\"e2e/util-binary/detoxbutler-1.1.0-genymotion-release.apk\"]\n    },\n\n    'android.genycloud.name-arm64': {\n      type: 'android.genycloud',\n      device: {\n        recipeName: 'Detox_Pixel_3a_API_35',\n      },\n      utilBinaryPaths: [\"e2e/util-binary/detoxbutler-1.1.0-genymotion-release.apk\"]\n    },\n  },\n\n  configurations: {\n    'ios.sim.debug': {\n      device: 'ios.simulator',\n      app: 'ios.debug',\n    },\n    'ios.sim.release': {\n      device: 'ios.simulator',\n      app: 'ios.release',\n      session: {\n        debugSynchronization: 3000,\n      },\n    },\n    'ios.manual': {\n      device: 'ios.simulator',\n      app: 'ios.debug',\n      artifacts: false,\n      behavior: {\n        launchApp: 'manual'\n      },\n      session: {\n        autoStart: true,\n        server: 'ws://localhost:8099',\n        sessionId: 'com.wix.detox-example'\n      }\n    },\n    'android.manual': {\n      device: 'android.emulator',\n      apps: ['android.debug', 'android.debug.withArgs'],\n      artifacts: false,\n      behavior: {\n        launchApp: 'manual'\n      },\n      session: {\n        autoStart: true,\n        server: 'ws://localhost:8099',\n        sessionId: 'test'\n      }\n    },\n    'android.emu.debug': {\n      device: 'android.emulator',\n      apps: ['android.debug', 'android.debug.withArgs'],\n    },\n    'android.emu.release': {\n      device: 'android.emulator',\n      apps: ['android.release', 'android.release.withArgs'],\n    },\n    'android.genycloud.debug': {\n      device: 'android.genycloud.uuid',\n      apps: ['android.debug'],\n    },\n    'android.genycloud.release': {\n      device: 'android.genycloud.uuid',\n      apps: ['android.release', 'android.release.withArgs'],\n    },\n    'android.genycloud.release2': {\n      device: 'android.genycloud.uuid',\n      apps: ['android.release', 'android.release.withArgs'],\n    },\n    'android.genycloud.release-arm64': {\n      device: 'android.genycloud.name-arm64',\n      apps: ['android.release', 'android.release.withArgs'],\n    },\n    'stub': {\n      device: {\n        type: './integration/stub',\n        integ: 'stub'\n      },\n      app: {\n        name: 'example'\n      }\n    }\n  }\n};\n\nmodule.exports = config;\n"
  },
  {
    "path": "detox/test/e2e/drivers/actions-driver.js",
    "content": "const rootId = 'View7990';\n\nconst driver = {\n  tapsElement: {\n    testId: 'UniqueId819',\n    get coordinates() {\n      return {\n        x: (device.getPlatform() === 'ios' ? 180 : 100),\n        y: 120,\n      };\n    },\n    multiTap: () => element(by.id(driver.tapsElement.testId)).multiTap(3),\n    tapAtPoint: () => element(by.id(rootId)).tapAtPoint(driver.tapsElement.coordinates),\n    assertTapsCount: (count) => expect(element(by.id(driver.tapsElement.testId))).toHaveText(`Taps: ${count}`),\n    assertTappedOnce: () => driver.tapsElement.assertTapsCount(1),\n    assertMultiTapped: () => driver.tapsElement.assertTapsCount(3),\n  },\n\n  doubleTapsElement: {\n    testId: 'doubleTappableText',\n    coordinates: { x: 180, y: 100 },\n    tapOnce: () => element(by.id(driver.doubleTapsElement.testId)).tap(),\n    tapTwice: async () => {\n      await driver.doubleTapsElement.tapOnce();\n      await driver.doubleTapsElement.tapOnce();\n    },\n    multiTapOnce: () => element(by.id(driver.doubleTapsElement.testId)).multiTap(1),\n    doubleTap: () => element(by.id(driver.doubleTapsElement.testId)).multiTap(2),\n    tapAtPointOnce: () => element(by.id(rootId)).tapAtPoint(driver.doubleTapsElement.coordinates),\n    tapAtPointTwice: async () => {\n      await driver.doubleTapsElement.tapAtPointOnce();\n      await driver.doubleTapsElement.tapAtPointOnce();\n    },\n    assertTapsCount: (count) => expect(element(by.id(driver.doubleTapsElement.testId))).toHaveText(`Double-Taps: ${count}`),\n    assertNoTaps: () => driver.doubleTapsElement.assertTapsCount(0),\n  },\n\n  sluggishTapElement: {\n    testId: 'sluggishTappableText',\n    tap: () => element(by.id(driver.sluggishTapElement.testId)).tap()\n  }\n};\n\nmodule.exports = {\n  actionsScreenDriver: driver,\n};\n"
  },
  {
    "path": "detox/test/e2e/drivers/fs-scroll-driver.js",
    "content": "const scrollViewDriver = {\n  byId: () => by.id('FSScrollActions.scrollView'),\n  element: () => element(scrollViewDriver.byId()),\n  listItem: (index) => element(by.text(`Text${index}`)),\n  firstItem: () => scrollViewDriver.listItem(1),\n  secondItem: () => scrollViewDriver.listItem(2),\n  secondPageItemIndex: () => 16,\n  secondPageItem: () => scrollViewDriver.listItem(scrollViewDriver.secondPageItemIndex()),\n  lastItem: () => scrollViewDriver.listItem(20),\n  fakeItem: () => scrollViewDriver.listItem(1000),\n  scrollBy: (amount) => scrollViewDriver.element().scroll(Math.abs(amount), (amount > 0 ? 'down' : 'up')),\n};\n\nmodule.exports = {\n  scrollViewDriver\n};\n"
  },
  {
    "path": "detox/test/e2e/drivers/integ-actions-drivers.js",
    "content": "// This isn't ideal, but native scrolling is never entirely accurate, compared the exact amount we pass in in DP.\n// This is an approximation based on experiments (over the current native impl.), AND IS IN NO WAY A MAGIC NUMBER (!!!),\n// especially since the inaccuracy is not linear as we assume here.\nconst SCROLL_ADJ_FACTOR = 1.04;\n\nconst scrollingTextsDriver = {\n  scrollView: () => element(by.id('integActions.textsScrollView')),\n  scrollDown: async (amount) => {\n    await scrollingTextsDriver.scrollView().scroll(amount * SCROLL_ADJ_FACTOR, 'down'); // Adjustment is experiments-based, not a magic number!\n  },\n  tapOnText: async (id) => {\n    const elementId = scrollingTextsDriver._elementId(id);\n    await element(by.id(elementId)).tap();\n  },\n  assertTextTappedOnce: async (id) => {\n    const elementId = scrollingTextsDriver._elementId(id);\n    const expectedText = `${elementId}: 1`;\n    await expect(element(by.id(elementId))).toHaveText(expectedText);\n  },\n  _elementId: (fieldId) => `tappableText-${fieldId}`,\n};\n\nconst scrollingTextInputsDriver = {\n  scrollView: () => element(by.id('integActions.inputsScrollView')),\n  scrollDown: async (amount) => {\n    await scrollingTextInputsDriver.scrollView().scroll(amount * SCROLL_ADJ_FACTOR, 'down');\n  },\n  typeInField: async (fieldId) => {\n    const elementId = scrollingTextInputsDriver._elementId(fieldId);\n    const typedText = elementId;\n    await element(by.id(elementId)).typeText(typedText);\n  },\n  assertFieldText: async (fieldId) => {\n    const elementId = scrollingTextInputsDriver._elementId(fieldId);\n    const expectedText = elementId;\n    await expect(element(by.id(elementId))).toHaveText(expectedText);\n  },\n  _elementId: (fieldId) => `textInput-${fieldId}`,\n};\n\nmodule.exports = {\n  scrollingTextInputsDriver,\n  scrollingTextsDriver,\n};\n"
  },
  {
    "path": "detox/test/e2e/drivers/launch-args-driver.js",
    "content": "const _ = require(\"lodash\");\nconst driver = {\n  navToLaunchArgsScreen: () => element(by.text('Launch Args')).tap(),\n\n  assertPreconfiguredValues: (initArgs, expectedInitArgs) => {\n    if (!_.isEqual(initArgs, expectedInitArgs)) {\n      throw new Error(\n        `Precondition failure: Preconfigured launch arguments (in detox.config.js) do not match the expected value.\\n` +\n        `Expected: ${JSON.stringify(expectedInitArgs)}\\n` +\n        `Received: ${JSON.stringify(initArgs)}`\n      );\n    }\n  },\n\n  assertLaunchArgs: async (expected, notExpected) => {\n    if (expected) {\n      for (const [key, value] of Object.entries(expected)) {\n        await expect(element(by.id(`launchArg-${key}.name`))).toBeVisible();\n        await expect(element(by.id(`launchArg-${key}.value`))).toHaveText(`${value}`);\n      }\n    }\n\n    if (notExpected) {\n      for (const key of notExpected) {\n        await expect(element(by.id(`launchArg-${key}.name`))).not.toBeVisible();\n      }\n    }\n  }\n}\n\nmodule.exports = {\n  launchArgsDriver: driver,\n};\n"
  },
  {
    "path": "detox/test/e2e/drivers/url-driver.js",
    "content": "const driver = {\n  withDetoxArgs: {\n    default: () => ({\n      url: 'detoxtesturlscheme://such-string?arg1=first&arg2=second',\n      launchArgs: undefined,\n    }),\n\n    andUserArgs: (launchArgs) => ({\n      url: 'detoxtesturlscheme',\n      launchArgs,\n    }),\n\n    forSingleInstanceActivityLaunch: () => ({\n      url: 'detoxtesturlscheme.singleinstance://such-string',\n      launchArgs: { detoxAndroidSingleInstanceActivity: true },\n    }),\n  },\n\n  navToUrlScreen: () => element(by.text('Init URL')).tap(),\n  assertUrl: (url) => expect(element(by.text(url))).toBeVisible(),\n  assertNoUrl: (url) => expect(element(by.text(url))).not.toBeVisible(),\n};\n\nmodule.exports = {\n  urlDriver: driver,\n};\n"
  },
  {
    "path": "detox/test/e2e/jest.config.js",
    "content": "const path = require('path');\nconst _ = require('lodash');\nconst { resolveConfig } = require('detox/internals');\n\nconst maxWorkersMap = {\n  'android.emulator': 3,\n  'android.genycloud': 5,\n  'android.genycloud-arm64': 2,\n  'ios.simulator': 2,\n};\n\nmodule.exports = async () => {\n  const config = await resolveConfig();\n\n  /** @type {import('jest-allure2-reporter').ReporterOptions} */\n  const jestAllure2ReporterOptions = {\n    extends: require.resolve('detox-allure2-adapter/preset-allure'),\n    overwrite: !process.env.CI,\n    testCase: {\n      labels: {\n        package: ({ filePath }) => `${filePath.slice(1, -1).join('.')}.${_.kebabCase(filePath.at(-1))}`,\n        testMethod: ({ testCase }) => testCase.fullName,\n        tag: ['e2e', ...config.configurationName.split('.')],\n      },\n      links: {\n        issue: 'https://github.com/wix/Detox/issues/{{name}}',\n      },\n    },\n    environment: async ({ $ }) => ({\n      'version.node': process.version,\n      'version.jest': await $.manifest('jest', 'version'),\n      'version.jest-metadata': await $.manifest('jest-metadata', 'version'),\n      'version.allure-reporter': require('jest-allure2-reporter/package.json').version,\n      'version.detox-allure2-adapter': require('detox-allure2-adapter/package.json').version,\n      ..._(process.env)\n        .pickBy((_1, key) => key.match(/detox/i))\n        .mapKeys((_1, key) => 'env.' + key)\n        .value()\n    }),\n  };\n\n  const reporters = [\n    '<rootDir>/runners/jest/reporter',\n    ['jest-allure2-reporter', jestAllure2ReporterOptions],\n  ];\n\n  if (process.env.DISABLE_JUNIT_REPORTER !== '1') {\n    reporters.push('<rootDir>/test/node_modules/jest-junit');\n  }\n\n  let deviceType = config.device.type;\n  if (config.configurationName.endsWith('arm64')) {\n    deviceType += '-arm64';\n  }\n\n  return {\n    'rootDir': path.join(__dirname, '../..'),\n    'testEnvironment': './test/e2e/testEnvironment.js',\n    'testEnvironmentOptions': {\n      'eventListeners': [\n        'jest-metadata/environment-listener',\n        'jest-allure2-reporter/environment-listener',\n        [require.resolve('detox-allure2-adapter'), {\n          deviceLogs: true,\n          deviceScreenshots: true,\n          deviceVideos: false,\n        }],\n        require.resolve('./utils/rnSkipper'),\n      ]\n    },\n    'testRunner': './test/node_modules/jest-circus/build/runner',\n    'testMatch': [\n      '<rootDir>/test/e2e/**/*.test.{js,ts}',\n      '<rootDir>/test/e2e-unhappy/**/*.test.{js,ts}',\n    ],\n    'setupFilesAfterEnv': ['./test/e2e/setup.js'],\n    'globalSetup': '<rootDir>/runners/jest/globalSetup',\n    'globalTeardown': '<rootDir>/runners/jest/globalTeardown',\n    'testTimeout': 120000,\n    'reporters': reporters,\n    'verbose': true,\n    'bail': false,\n    'maxWorkers': process.env.CI ? maxWorkersMap[deviceType] || 1 : 1,\n    'collectCoverageFrom': [\n      'src/**/*.js',\n      '!**/__test/**',\n      '!**/__mocks__/**',\n      '!**/*.mock.js',\n      '!**/*.test.js'\n    ]\n  };\n};\n"
  },
  {
    "path": "detox/test/e2e/pilot/01.pilot.sanity.test.js",
    "content": "const { copilot } = require('detox');\n\ndescribe.forPilot('Pilot Sanity', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native state',\n      'Navigate to the Sanity screen'\n    );\n  });\n\n  it('should have welcome screen', async () => {\n    await pilot.perform(\n      'Welcome text is displayed',\n      'Say Hello button is visible to the user',\n      'Can see a Say World button'\n    );\n  });\n\n  it('should show hello screen after tap', async () => {\n    await pilot.autopilot('tap on the Say Hello button in the sanity screen and expect to see \"Hello!!!\" text displayed');\n  });\n\n  it('should show world screen after tap with Copilot (deprecated API)', async () => {\n    await global.copilot.autopilot('tap on the Say World button in the sanity screen and expect to see \"World!!!\" text displayed');\n  });\n\n  it('should access copilot via destructuring', async () => {\n    await copilot.autopilot('tap on the Say World button in the sanity screen and expect to see \"World!!!\" text displayed');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/02.pilot.actions.test.js",
    "content": "const jestExpect = require('expect').default;\n\ndescribe.forPilot('Pilot Actions', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native environment',\n      'Go to the Actions screen'\n    );\n  });\n\n  it('should tap on an element', async () => {\n    await pilot.perform(\n      'Press the \"Tap Me\" button',\n      'The text \"Tap Working!!!\" is shown on the screen'\n    );\n  });\n\n  it('should long press on an element', async () => {\n    await pilot.perform(\n      'Perform a long press on the \"Tap Me\" button',\n      'The message \"Long Press Working!!!\" is displayed'\n    );\n  });\n\n  it('should long press with duration on an element', async () => {\n    await pilot.perform(\n      'Hold the \"Long Press Me 1.5s\" button for 1.5 seconds',\n      'Can see \"Long Press With Duration Working!!!\" on the screen'\n    );\n  });\n\n  it('should long press with point', async () => {\n    await pilot.perform(\n      'Long press the top-most left-most corner of the \"Long Press on Top Left\" button',\n      'The text \"Long Press on Top Left Working!!!\" appears'\n    );\n  });\n\n  it('should not succeed in long pressing with point outside the target area', async () => {\n    await jestExpect(async () =>\n      await pilot.perform('Attempt a long press on the \"Long Press on Top Left\" button outside its bounds')\n    ).rejects.toThrow();\n  });\n\n  it('should type in an element', async () => {\n    await pilot.perform(\n      'Enter \"Type Working!!!\" into the text input field',\n      'The typed text is visible on the screen'\n    );\n  });\n\n  it('should press the backspace key on an element', async () => {\n    await pilot.perform(\n      'Input \"test\" in the text field',\n      'Hit the backspace key in the text input',\n      'The typed text is shown in the input field'\n    );\n  });\n\n  it('should press the return key on an element', async () => {\n    await pilot.perform(\n      'Tap the return key on the keyboard for the text input',\n      'The message \"Return Working!!!\" is visible to the user'\n    );\n  });\n\n  it('should clear text in an element', async () => {\n    await pilot.perform(\n      'Remove all text from the text input that already has text in it',\n      'The text \"Clear Working!!!\" appears on the screen'\n    );\n  });\n\n  it('should replace text in an element', async () => {\n    await pilot.perform(\n      'Substitute the existing text with \"replaced_text\" in the test_id=\"UniqueId006\" field',\n      'The message \"Replace Working!!!\" is shown'\n    );\n  });\n\n  it('should swipe down until pull to reload is triggered', async () => {\n    await pilot.perform(\n      'Swipe fast the scrollable area ScrollView799 downwards to activate the pull-to-reload',\n      'The text \"PullToReload Working!!!\" becomes visible'\n    );\n  });\n\n  it('should swipe vertically', async () => {\n    await pilot.perform(\n      'The element with text \"Text1\" can be seen',\n      'Swipe the view \"ScrollView161\" upwards',\n      'The Text1 element is no longer in view',\n      'Swipe the element back up until the \"Text1\" element is visible',\n    );\n  });\n\n  it('should swipe horizontally', async () => {\n    await pilot.perform(\n      'The \"HText1\" element is present',\n      // To avoid confusion: left swipe scrolls right\n      'Left-swipe the horizontal scrollable area \"ScrollViewH\"',\n      '\"HText1\" is not in the visible area',\n      'Swipe the horizontal scroll back to the left',\n      'The \"HText1\" element has come back into view'\n    );\n  });\n\n  it('should adjust slider and assert its value', async () => {\n    await pilot.perform(\n      'The slider is set to 25%',\n      'Move the slider to the 75% position',\n      'The slider value is approximately 75%, give or take 10%'\n    );\n  });\n\n  it('should expect text fields to be focused after tap but not before', async () => {\n    await pilot.perform(\n      'The text field UniqueId005 (call it \"the first\") does not have focus',\n      'Text input UniqueId006 (call it \"the second\") is not currently focused',\n      'Tap to focus on the first text field',\n      'First text field now has the focus',\n      'The second text input remains unfocused',\n      'Touch the second text field to give it focus',\n      'The first text input has lost focus',\n      '2nd text field is now the active input'\n    );\n  });\n\n  it('should assert on invalid intent', async () => {\n    await jestExpect(async () =>\n      await pilot.perform('Tap the \"FOOBAR\" button')\n    ).rejects.toThrow();\n  });\n\n  it('should assert on ambiguous intent', async () => {\n    await jestExpect(async () =>\n      await pilot.perform('Do magic to the element')\n    ).rejects.toThrow();\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/03.pilot.shape-match.test.js",
    "content": "describe.forPilot('Shape Match Game Screen', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Reset react native state',\n      'Enter the \"Shape Matching\" game screen'\n    );\n  });\n\n  it('should play the Shape Matching game', async () => {\n    await pilot.perform(\n      'Game has started with score 0',\n\n      'Drag the blue square into the middle of its hole',\n      'Match the red circle into its hole',\n      'Red circle and blue square are now in the middle of their holes, ' +\n        'and the score is 2',\n\n      'Restart the game',\n      'The score has reset',\n\n      'Drag one of the shapes with a very small offset out of its place',\n      'The score is still 0',\n\n      'Drag shapes into their holes until the score is 3',\n      'All shapes are in their holes and score is now 3',\n    );\n  }, 500000);\n\n  it('should play the Shape Matcher game with Autopilot', async () => {\n    await pilot.autopilot('Play the shape matching game until score 2, use only the top row shapes');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/04.webview.test.js",
    "content": "describe.forPilot('WebView Interactions', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native state',\n      'Navigate to the WebView screen'\n    );\n  });\n\n  describe('Single WebView Tests', () => {\n    it('should interact with elements in a single WebView', async () => {\n      await pilot.perform(\n        'Find an element with ID \"pageHeadline\" in the WebView',\n        'Verify that the text of this element is \"First Webview\"',\n        'Locate an input field with ID \"fname\"',\n        'Type \"Tester\" into this input field',\n        'Confirm that the input field now contains the text \"Tester\"',\n        'Find and click a submit button',\n        'Check that the input field still contains \"Tester\"'\n      );\n    });\n\n    it('should scroll and interact with elements', async () => {\n      await pilot.perform(\n        'Scroll to \"bottomParagraph\" in the WebView',\n        'Verify that the text of this element is \"This is a bottom paragraph with class.\"',\n      );\n    });\n  });\n\n  describe('Multiple WebViews Tests', () => {\n    beforeEach(async () => {\n      await pilot.perform(\n        'Enable the second WebView'\n      );\n    });\n\n    it('should interact with elements in multiple WebViews', async () => {\n      await pilot.perform(\n        'In the second WebView, verify the headline has the message \"This is a dummy webview.\"',\n        'Hide the second WebView',\n        'Show the 3rd WebView',\n        'There should be an iframe in the third WebView with the title \"This is an iframe\" or something similar'\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/05.system.test.js",
    "content": "const {expectToThrow} = require(\"../utils/custom-expects\");\n\ndescribe.forPilot(':ios: iOS Permission Dialogs', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Remove the app and start a fresh instance',\n      'Navigate to the System Dialogs screen'\n    );\n  });\n\n  it('should handle permission request dialogs', async () => {\n    await pilot.perform(\n      'Check that the initial permission status is \"denied\"',\n      'Tap the button to request permission',\n      'A system dialog appears asking for permission',\n      'Tap the \"Allow\" button on the system dialog',\n      'Verify that the permission status now says \"granted\"'\n    );\n  });\n\n  it('should handle permission request dialogs with different button types', async () => {\n    await pilot.perform(\n      'Tap on request permission',\n      'Deny the permission request',\n      'Verify that the permission status now says \"blocked\"'\n    );\n  });\n\n  it('should handle non-existent system elements', async () => {\n    await expectToThrow(async () => {\n      await pilot.perform('Interact with the system element with the text \"Press Me\"',);\n    });\n  });\n});\n\n"
  },
  {
    "path": "detox/test/e2e/pilot/06.waitfor.test.js",
    "content": "const {expectToThrow} = require(\"../utils/custom-expects\");\n\ndescribe.forPilot('WaitFor Functionality', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native environment',\n      'Navigate to the WaitFor screen'\n    );\n  });\n\n  it('should wait for elements to appear and disappear', async () => {\n    await pilot.perform(\n      'Verify that an element with ID \"changeExistenceByToggle\" is not present',\n      'Tap the \"Go\" button',\n      'Wait for the element to appear',\n      'Confirm that the element is now visible',\n      'Tap the \"Go\" button again',\n      'Wait for the element to disappear',\n      'Verify that the element is no longer present'\n    );\n  });\n\n  it('should wait for elements to become focused and unfocused', async () => {\n    await pilot.perform(\n      'Check that an element with ID \"changeFocusByToggle\" is not focused',\n      'Tap the \"Go\" button',\n      'Wait for the element to become focused',\n      'Verify that the element is now focused',\n      'Tap the \"Go\" button again',\n      'Wait for the element to lose focus',\n      'Confirm that the element is no longer focused'\n    );\n  });\n\n  it('should find elements by scrolling', async () => {\n    await pilot.perform(\n      'Verify that an element with text \"Text5\" is not visible',\n      'Tap the \"Go\" button',\n      'Scroll down in the ScrollView until \"Text5\" becomes visible',\n      'Confirm that \"Text5\" is now visible on the screen'\n    );\n  });\n\n  it('should handle timeouts for non-appearing elements', async () => {\n    await expectToThrow(async () => {\n      await pilot.perform(\n        'Try to wait for an element with ID \"neverAppearingText\" to appear, with timeout of 2 seconds'\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/07.pilot.assertions.test.js",
    "content": "const jestExpect = require('expect').default;\n\ndescribe.forPilot('Assertions', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native state',\n      'Navigate to the Assertions screen'\n    );\n  });\n\n  describe('Assertion Tests', () => {\n    it('should assert an element is visible (by text)', async () => {\n      await pilot.perform(\n        'Verify there is an element with the text \"i contain some text\"'\n      );\n    });\n\n    it('should not assert an element is not visible (by text)', async () => {\n      await jestExpect(async () =>\n        await pilot.perform('Verify there is element with the text \"I am full of text\" in the screen')\n      ).rejects.toThrow();\n    });\n\n    it('should assert an element is visible (by id)', async () => {\n      await pilot.perform(\n        'Verify there is an element with ID \"subtext-root\"'\n      );\n    });\n\n    it('should not assert an element that does not exist (by id)', async () => {\n      await jestExpect(async () =>\n        await pilot.perform('Find an element with ID \"RandomJunk959\" in the screen')\n      ).rejects.toThrow();\n    });\n\n    it('should assert an element has (accessibility) label', async () => {\n      await pilot.perform(\n        'Verify there is an element with the accessibility label \"I contain some text\"'\n      );\n    });\n\n    it('should not assert an element that does not exist (by label)', async () => {\n      await jestExpect(async () =>\n        await pilot.perform('Find an element with label \"I exist in the screen\" in the screen')\n      ).rejects.toThrow();\n    });\n\n    it('assert toggle exist by element type', async () => {\n      await pilot.perform(\n        'Verify that the toggle type element is exist in the screen'\n      );\n    });\n\n    // Note: This test is skipped because currently we don't know what are the exact expectations.\n    // Should we expect the pilot to understand the similarity between toggle and checkbox or not?\n    // Currently, if it is not skipped, it passes.\n    it.skip('shouldn`t assert an element that does not exist (by type)', async () => {\n      await jestExpect(async () =>\n        await pilot.perform('Find a Check-box type element in the screen')\n      ).rejects.toThrow();\n    });\n\n    it('shouldn`t assert an element that does not exist (by type, text-field)', async () => {\n      await jestExpect(async () =>\n        await pilot.perform('Find a text-field element in the screen')\n      ).rejects.toThrow();\n    });\n\n    it('assert toggle-switch widget false', async () => {\n      await pilot.perform(\n        'Verify that the toggle has false value'\n      );\n    });\n\n    it('assert toggle-switch widget true ', async () => {\n      await pilot.perform(\n        'Tap the toggle',\n        'Verify that the toggle has true value'\n      );\n    });\n\n    it('assert details in image', async () => {\n      await pilot.perform(\n        'Verify there is an image element in the screen',\n        'Verify there is a banana in the image element',\n        'Verify there isn`t an apple in the image element',\n        'Verify there are grapes in the image element'\n      );\n    });\n\n    it('assert element`s color', async () => {\n      await pilot.perform(\n        'Verify there is a green text element'\n      );\n    });\n\n    // Note: The test failed: \"color information is not available in the view hierarchy\"\n    // Same test with green instead of blue - passed.\n    it.skip('assert element`s color with text contains another color', async () => {\n      await pilot.perform(\n        'Verify there is a blue color text element'\n      );\n    });\n\n    describe('order assertions', () => {\n      it('assert elements are in specific order', async () => {\n        await pilot.perform(\n          'Verify there is an element with the text \"subtext\"',\n          'Verify that under the text element with the text \"subtext\" there is an image element',\n          'Verify that under the image element there is a green text element',\n          'Verify that under the green text element there is a toggle element'\n        );\n      });\n\n      it('raise error when elements are not in specific order', async () => {\n        await jestExpect(async () =>\n          await pilot.perform('Verify the toggle element is above the text element')\n        ).rejects.toThrow();\n\n        await jestExpect(async () =>\n          await pilot.perform('Verify that under the image element in the screen there is text element with the text \"subtext\"')\n        ).rejects.toThrow();\n      });\n\n      // Note: The `not directly` tests are skipped because they are flaky, and not always working as expected.\n      it.skip('assert elements are in specific order - not directly', async () => {\n        await pilot.perform(\n          'Verify there is a toggle element under the text element \"I contain some text\"',\n          'Verify the image element is under the smiling face emoji element'\n        );\n      });\n\n      it.skip('raise error when elements are not in specific order - not directly', async () => {\n        await jestExpect(async () =>\n          await pilot.perform('Verify the the image element is above smiling face emoji element')\n        ).rejects.toThrow();\n\n        await jestExpect(async () =>\n          await pilot.perform('Verify there is the text element \"I contain some text\" under the toggle element')\n        ).rejects.toThrow();\n      });\n\n      it('assert element`s position', async () => {\n        await pilot.perform(\n          'Verify there is a smiling emoji in the top left corner of the screen',\n          'Verify there is a party emoji in the bottom right corner of the screen'\n        );\n      });\n\n      it('raise error when elements are not positioned right', async () => {\n        await jestExpect(async () =>\n          await pilot.perform('Verify there is a smiling face emoji in the center of the screen')\n        ).rejects.toThrow();\n\n        await jestExpect(async () =>\n          await pilot.perform('Verify there is a party emoji in the center of the screen')\n        ).rejects.toThrow();\n\n        await jestExpect(async () =>\n          await pilot.perform('Verify there is a smiling face emoji in the bottom right corner of the screen')\n        ).rejects.toThrow();\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/08.pilot.location.test.js",
    "content": "const DUMMY_COORDINATE1_LONGITUDE = '66.5';\nconst DUMMY_COORDINATE1_LATITUDE = '-80.125';\nconst DUMMY_COORDINATE2_LONGITUDE = '-80.125';\nconst DUMMY_COORDINATE2_LATITUDE = '66.5';\n\ndescribe.forPilot('Location', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native state',\n    );\n  });\n\n  describe('Location Tests', () => {\n    it('should show error when permission defined as `never`', async () => {\n      await pilot.perform(\n        'Launch the app with location permission denied',\n        'Navigate to the Location screen',\n        'Verify there is an element with the text \"Get location\"',\n        'Tap the get location element',\n        'Verify there is an element with the text \"User denied access to location services.\"'\n      );\n    });\n\n    it('should show location when permission is `always`', async () => {\n      await pilot.perform(\n        'Launch the app with location permission always',\n        'Navigate to the Location screen',\n        'Verify there is an element with the text \"Get location\"',\n        'Tap the get location element',\n        `Set the device location (${DUMMY_COORDINATE1_LATITUDE}, ${DUMMY_COORDINATE1_LONGITUDE})`,\n        `Verify that \"Latitude: ${DUMMY_COORDINATE1_LATITUDE}\" is displayed`,\n        `Verify that \"Longitude: ${DUMMY_COORDINATE1_LONGITUDE}\" is displayed`\n      );\n    });\n\n    it('should show location when permission is `inuse`', async () => {\n      await pilot.perform(\n        'Launch the app with location permission just once',\n        'Navigate to the Location screen',\n        'Verify there is an element with the text \"Get location\"',\n        'Tap the get location element',\n        `Set the device location to (${DUMMY_COORDINATE1_LATITUDE}, ${DUMMY_COORDINATE1_LONGITUDE})`,\n        `Verify that \"Latitude: ${DUMMY_COORDINATE1_LATITUDE}\" is displayed`,\n        `Verify that \"Longitude: ${DUMMY_COORDINATE1_LONGITUDE}\" is displayed`\n      );\n    });\n\n    it('should set location multiple times', async () => {\n      await pilot.perform(\n        'Launch the app with location permission just once',\n        'Navigate to the Location screen',\n        'Verify there is an element with the text \"Get location\"',\n        'Tap the get location element',\n        `Set the device location to (lat: ${DUMMY_COORDINATE1_LATITUDE}, long: ${DUMMY_COORDINATE1_LONGITUDE})`,\n        `Set the device location to (lat: ${DUMMY_COORDINATE2_LATITUDE}, long: ${DUMMY_COORDINATE2_LONGITUDE})`,\n        `Verify that \"Latitude: ${DUMMY_COORDINATE2_LATITUDE}\" is displayed`,\n        `Verify that \"Longitude: ${DUMMY_COORDINATE1_LONGITUDE}\" is displayed`\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/09.pilot.datepicker.test.js",
    "content": "const { default: jestExpect } = require('expect');\n\ndescribe.forPilot('DatePicker', () => {\n  beforeEach(async () => {\n    await pilot.perform(\n      'Restart the React Native state',\n      'Navigate to the DatePicker screen'\n    );\n  });\n\n  describe('DatePicker Tests', () => {\n\n    // Note: when writing \"Date (UTC):\" instead of \"Date (UTC): \" pilot failed the test\n    it('correct date and time', async () => {\n      await pilot.perform(\n        'Verify there is element with the text \"Date (UTC): \"',\n        'Verify the element value of current date UTC July 1st 2023',\n        'Verify there is element with the text \"Time (UTC): \"',\n        'Verify there is element with the text \"Time Local: \"',\n        'Verify \"Time Local: \" value is 7:30 pm'\n      );\n    });\n\n    it('compact date picker', async () => {\n      await pilot.perform(\n        'Verify there is an element with the text \"Compact Date Picker\"',\n        'Verify there is an element with today`s date at the bottom of the screen',\n        'Set the date picker to September 9th, 2023'\n      );\n    });\n\n    it('inline date picker', async () => {\n      await pilot.perform(\n        'Verify there is an element with the text \"Compact Date Picker\"',\n        'Tap the element with the text \"Compact Date Picker\"',\n        'Verify there is an element with the text \"Inline Date Picker\"',\n        'Verify there is an element with today`s date at the bottom of the screen',\n        'Set the date picker to September 9th, 2023'\n      );\n    });\n\n    it('switch to spinner date picker', async () => {\n      await pilot.perform(\n        'Verify there is an element with the text \"Compact Date Picker\"',\n        'Tap the element with the text \"Compact Date Picker\"',\n        'Verify there is an element with the text \"Inline Date Picker\"',\n        'Tap the element with the text \"Inline Date Picker\"',\n        'Verify that there is slider element at the bottom of the screen',\n        'Set the date picker to September 9th, 2023'\n      );\n\n      await jestExpect(async () =>\n        await pilot.perform('Set the date picker`s first column to 10th, so the date will be September 10th, 2023')\n      ).rejects.toThrow();\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/10.pilot.visibility.test.js",
    "content": "const { default: jestExpect } = require('expect');\n\ndescribe.forPilot('Visibility', () => {\n  describe('Visibility Expectation', () => {\n    beforeEach(async () => {\n      await pilot.perform(\n        'Restart the React Native state',\n        'Navigate to the Visibility Expectation screen'\n      );\n    });\n\n    describe('before move element', () => {\n      it('should be truthy when at least 50% visibility is required', async () => {\n        await pilot.perform(\n          'Verify there is a text element with the text \"Element should be half-visible\"',\n          'Verify the purple rectangle below the text that is exactly 50% visible',\n        );\n      });\n\n      it('should be falsy when at least 51% visibility is required', async () => {\n        await jestExpect(async () =>\n          await pilot.perform('Verify the purple rectangle is 51% visible')\n        ).rejects.toThrow();\n      });\n    });\n\n    describe('after move element', () => {\n      beforeEach(async () => {\n        await pilot.perform('Tap the button with the text \"Move That Element\"');\n      });\n\n      it('should be truthy when at least 25% visibility is required', async () => {\n        await pilot.perform(\n          'Verify the purple rectangle is exactly 25% visible',\n        );\n      });\n\n      it('should be falsy when at least 26% visibility is required', async () => {\n        await jestExpect(async () =>\n          await pilot.perform('Verify the purple rectangle is exactly 26% visible')\n        ).rejects.toThrow();\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/01.pilot.sanity.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No element validation needed for device-level operations\",\n      \"creationTime\": 1748231750807\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the Sanity screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_2')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_2'))).toExist();\",\n      \"creationTime\": 1748231759181\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Welcome text is displayed\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Sanity screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_2')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toHaveLabel('Welcome');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748231767568\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Say Hello button is visible to the user\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Sanity screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_2')).tap();\\\"},{\\\"step\\\":\\\"Welcome text is displayed\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\\\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toHaveLabel('Welcome');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_1'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_1'))).toExist();\",\n      \"creationTime\": 1748231774788\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Can see a Say World button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Sanity screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_2')).tap();\\\"},{\\\"step\\\":\\\"Welcome text is displayed\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\\\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toHaveLabel('Welcome');\\\"},{\\\"step\\\":\\\"Say Hello button is visible to the user\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_1'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_2'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_2'))).toExist();\",\n      \"creationTime\": 1748231781697\n    }\n  ],\n  \"{\\\"goal\\\":\\\"tap on the Say Hello button in the sanity screen and expect to see \\\\\\\"Hello!!!\\\\\\\" text displayed\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Welcome Screen with Say Hello and Say World Buttons\",\n        \"plan\": {\n          \"action\": \"Tap on the \\\"Say Hello\\\" button\",\n          \"thoughts\": \"I can see a welcome screen with the title \\\"Welcome\\\" at the top. Below it are two clickable elements: ***\\\"Say Hello\\\"*** and \\\"Say World\\\". The goal is to *tap on the Say Hello button* and expect to see \\\"Hello!!!\\\" text displayed. Looking at the view hierarchy, I can identify the \\\"Say Hello\\\" element as an RCTViewComponentView with label \\\"Say Hello\\\" (tag=\\\"246\\\"). This appears to be a clickable button that I need to tap to progress toward the goal. The element is clearly visible and accessible on the screen.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": false\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801fffffffffffffffffffffffffc3ffc3ffffffffffffffffffffffffff81f\",\n        \"ViewHierarchyHash\": \"59a75485d57c68cab9fd92f7a6d6f953\"\n      },\n      \"creationTime\": 1748231792634\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap on the \\\\\\\"Say Hello\\\\\\\" button\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.label('Say Hello')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.label('Say Hello'))).toExist();\",\n      \"creationTime\": 1748231799631\n    }\n  ],\n  \"{\\\"goal\\\":\\\"tap on the Say Hello button in the sanity screen and expect to see \\\\\\\"Hello!!!\\\\\\\" text displayed\\\",\\\"previousSteps\\\":[{\\\"screenDescription\\\":\\\"Welcome Screen with Say Hello and Say World Buttons\\\",\\\"step\\\":\\\"Tap on the \\\\\\\"Say Hello\\\\\\\" button\\\",\\\"review\\\":{}}]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Hello Message Display Screen\",\n        \"plan\": {\n          \"action\": \"success\",\n          \"thoughts\": \"Looking at the current screen, I can see that the \\\"Hello!!!\\\" text is already displayed in the center of the screen. According to the view hierarchy, there's an RCTParagraphComponentView with the label \\\"Hello!!!\\\" that is visible at coordinates (176, 461) with dimensions 76x30. The previous step shows that the user already tapped on the \\\"Say Hello\\\" button, and now the expected \\\"Hello!!!\\\" text is being displayed as intended. The goal was to *tap on the Say Hello button* and **expect to see \\\"Hello!!!\\\" text displayed** - both parts of this goal have been completed successfully. The text is clearly visible in the snapshot image and confirmed in the view hierarchy.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": true,\n        \"summary\": \"The goal has been ***successfully achieved***. The user tapped on the *\\\"Say Hello\\\" button* in the previous step, and now the **\\\"Hello!!!\\\" text is displayed** on the screen as expected. The text appears centered on the screen and is clearly visible, confirming that the button interaction worked correctly and produced the expected result.\"\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801fffffffffffffffffffffffffffffc3ffffffffffffffffffffffffff81f\",\n        \"ViewHierarchyHash\": \"a07d2dd55417732edb990c6963cfcda2\"\n      },\n      \"creationTime\": 1748231812984\n    }\n  ],\n  \"{\\\"goal\\\":\\\"tap on the Say World button in the sanity screen and expect to see \\\\\\\"World!!!\\\\\\\" text displayed\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Welcome Screen with Navigation Options\",\n        \"plan\": {\n          \"action\": \"Tap on the \\\"Say World\\\" button\",\n          \"thoughts\": \"I can see a welcome screen with the title \\\"Welcome\\\" at the top and two clickable options below it: *\\\"Say Hello\\\"* and *\\\"Say World\\\"*. The goal is to **tap on the Say World button** and expect to see \\\"World!!!\\\" text displayed. Looking at the view hierarchy, I can identify the \\\"Say World\\\" button as an RCTViewComponentView with label \\\"Say World\\\" (tag=\\\"252\\\"). This appears to be a tappable element based on its structure and the visual representation in the snapshot. The ***next action is clearly to tap on this \\\"Say World\\\" button*** to progress toward the goal.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": false\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801fffffffffffffffffffffffffc3ffc3ffffffffffffffffffffffffff81f\",\n        \"ViewHierarchyHash\": \"59a75485d57c68cab9fd92f7a6d6f953\"\n      },\n      \"creationTime\": 1748231823682\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap on the \\\\\\\"Say World\\\\\\\" button\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_2')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_2'))).toExist();\",\n      \"creationTime\": 1748231830426\n    }\n  ],\n  \"{\\\"goal\\\":\\\"tap on the Say World button in the sanity screen and expect to see \\\\\\\"World!!!\\\\\\\" text displayed\\\",\\\"previousSteps\\\":[{\\\"screenDescription\\\":\\\"Welcome Screen with Navigation Options\\\",\\\"step\\\":\\\"Tap on the \\\\\\\"Say World\\\\\\\" button\\\",\\\"review\\\":{}}]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"World Text Display Screen\",\n        \"plan\": {\n          \"action\": \"success\",\n          \"thoughts\": \"Looking at the current screen, I can see that the ***\\\"World!!!\\\" text is already displayed*** in the center of the screen. The view hierarchy shows an `RCTParagraphComponentView` with the label \\\"World!!!\\\" that is visible on the screen. According to the goal, the user was supposed to \\\"tap on the Say World button in the sanity screen and expect to see 'World!!!' text displayed\\\". \\n\\nFrom the previous steps, I can see that **Step 1 was to tap on the \\\"Say World\\\" button**, and now the screen is showing the expected result - the *\\\"World!!!\\\" text is clearly visible*. The goal has been **completely achieved** as the user successfully tapped the button and the expected text is now displayed on the screen.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": true,\n        \"summary\": \"The goal has been ***successfully completed***. The user successfully *tapped on the \\\"Say World\\\" button* from the previous screen, and the expected **\\\"World!!!\\\" text is now displayed** prominently in the center of the screen. The navigation and button interaction worked as expected, demonstrating that the sanity test functionality is working properly.\"\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801fffffffffffffffffffffffffffffc3ffffffffffffffffffffffffff81f\",\n        \"ViewHierarchyHash\": \"6b49c8d8e2f84197a26e169aa9b49470\"\n      },\n      \"creationTime\": 1748231841197\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/02.pilot.actions.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native environment\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No specific elements need validation for reloading React Native\",\n      \"creationTime\": 1748231878777\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Go to the Actions screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_4'))).toExist();\",\n      \"creationTime\": 1748231888408\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Press the \\\\\\\"Tap Me\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('View7991')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('View7991'))).toExist();\",\n      \"creationTime\": 1748231897588\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The text \\\\\\\"Tap Working!!!\\\\\\\" is shown on the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Press the \\\\\\\"Tap Me\\\\\\\" button\\\",\\\"code\\\":\\\"await element(by.id('View7991')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748231905505\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Perform a long press on the \\\\\\\"Tap Me\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('View7991')).longPress();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('View7991'))).toExist();\",\n      \"creationTime\": 1748231914709\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The message \\\\\\\"Long Press Working!!!\\\\\\\" is displayed\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Perform a long press on the \\\\\\\"Tap Me\\\\\\\" button\\\",\\\"code\\\":\\\"await element(by.id('View7991')).longPress();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748231924547\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Long press the top-most left-most corner of the \\\\\\\"Long Press on Top Left\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: 0, y: 0});\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_2'))).toExist();\",\n      \"creationTime\": 1748231962774\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The text \\\\\\\"Long Press on Top Left Working!!!\\\\\\\" appears\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Long press the top-most left-most corner of the \\\\\\\"Long Press on Top Left\\\\\\\" button\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: 0, y: 0});\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toHaveText('Long Press on Top Left Working!!!');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748231973592\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Attempt a long press on the \\\\\\\"Long Press on Top Left\\\\\\\" button outside its bounds\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// The \\\"Long Press on Top Left\\\" button is at x=0, y=153, width=430, height=27\\n// To press outside its bounds, I'll use coordinates outside this rectangle\\n// Using point (-10, 153) which is to the left of the button's bounds\\nawait element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: -10, y: 0});\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_2'))).toExist();\",\n      \"creationTime\": 1748231986548\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Attempt a long press on the \\\\\\\"Long Press on Top Left\\\\\\\" button outside its bounds\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Attempt a long press on the \\\\\\\"Long Press on Top Left\\\\\\\" button outside its bounds\\\",\\\"code\\\":\\\"// The \\\\\\\"Long Press on Top Left\\\\\\\" button is at x=0, y=153, width=430, height=27\\\\n// To press outside its bounds, I'll use coordinates outside this rectangle\\\\n// Using point (-10, 153) which is to the left of the button's bounds\\\\nawait element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: -10, y: 0});\\\",\\\"error\\\":\\\"Test Failed: View is not hittable at its visible point. Error: View is not visible around point.\\\\n- view point: {-10, 0}\\\\n- visible bounds: {{0, 0}, {430, 27}}\\\\n- view bounds: {{0, 153}, {430, 27}}\\\\n---\\\\nError: Error Domain=DetoxErrorDomain Code=0 \\\\\\\"View “<RCTViewComponentView: 0x105956b60>” is not visible: View does not pass visibility percent threshold (100)\\\\\\\" UserInfo={NSLocalizedDescription=View “<RCTViewComponentView: 0x105956b60>” is not visible: View does not pass visibility percent threshold (100)}\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// The \\\"Long Press on Top Left\\\" button is at x=0, y=153, width=430, height=27\\n// To press outside its bounds but still be hittable, I'll use coordinates above the button\\n// Using point (0, -10) which is above the button's bounds but within the element's coordinate system\\nawait element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: 0, y: -10});\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_2'))).toExist();\",\n      \"creationTime\": 1748232000137\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Enter \\\\\\\"Type Working!!!\\\\\\\" into the text input field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId937')).typeText('Type Working!!!');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232013705\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The typed text is visible on the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Enter \\\\\\\"Type Working!!!\\\\\\\" into the text input field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).typeText('Type Working!!!');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Verify that the typed text \\\"Type Working!!!\\\" is visible in the text input field\\nawait expect(element(by.id('UniqueId937'))).toHaveValue('Type Working!!!');\\nawait expect(element(by.id('UniqueId937'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232024951\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Input \\\\\\\"test\\\\\\\" in the text field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId937')).typeText('test');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232037621\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Hit the backspace key in the text input\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Input \\\\\\\"test\\\\\\\" in the text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).typeText('test');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId937')).tapBackspaceKey();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232048656\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The typed text is shown in the input field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Input \\\\\\\"test\\\\\\\" in the text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).typeText('test');\\\"},{\\\"step\\\":\\\"Hit the backspace key in the text input\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tapBackspaceKey();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion: The input field correctly displays the typed text \\\"tes\\\"\\n// This can be verified from the snapshot image which shows \\\"tes\\\" in the input field\\nawait expect(element(by.id('UniqueId937'))).toHaveValue('tes');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232059510\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the return key on the keyboard for the text input\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Cannot tap return key - no keyboard is currently visible. A text input must be focused first to display the keyboard.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232074871\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the return key on the keyboard for the text input\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Tap the return key on the keyboard for the text input\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"Cannot tap return key - no keyboard is currently visible. A text input must be focused first to display the keyboard.\\\\\\\");\\\",\\\"error\\\":\\\"Cannot tap return key - no keyboard is currently visible. A text input must be focused first to display the keyboard.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// First focus on a text input to bring up the keyboard\\nawait element(by.id('UniqueId937')).tap();\\n\\n// Then tap the return key on the keyboard\\nawait element(by.id('UniqueId937')).tapReturnKey();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232086440\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The message \\\\\\\"Return Working!!!\\\\\\\" is visible to the user\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Tap the return key on the keyboard for the text input\\\",\\\"code\\\":\\\"// First focus on a text input to bring up the keyboard\\\\nawait element(by.id('UniqueId937')).tap();\\\\n\\\\n// Then tap the return key on the keyboard\\\\nawait element(by.id('UniqueId937')).tapReturnKey();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed - the message \\\"Return Working!!!\\\" is clearly visible in the center of the screen as shown in the snapshot image\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"// No cache validation needed as this is a visual assertion check\",\n      \"creationTime\": 1748232097813\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Remove all text from the text input that already has text in it\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId005')).clearText();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId005'))).toExist();\",\n      \"creationTime\": 1748232106719\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The text \\\\\\\"Clear Working!!!\\\\\\\" appears on the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Remove all text from the text input that already has text in it\\\",\\\"code\\\":\\\"await element(by.id('UniqueId005')).clearText();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toHaveText('Clear Working!!!');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748232120279\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Substitute the existing text with \\\\\\\"replaced_text\\\\\\\" in the test_id=\\\\\\\"UniqueId006\\\\\\\" field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId006')).replaceText('replaced_text');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId006'))).toExist();\",\n      \"creationTime\": 1748232130186\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The message \\\\\\\"Replace Working!!!\\\\\\\" is shown\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Substitute the existing text with \\\\\\\"replaced_text\\\\\\\" in the test_id=\\\\\\\"UniqueId006\\\\\\\" field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId006')).replaceText('replaced_text');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.label('Replace Working!!!'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.label('Replace Working!!!'))).toExist();\",\n      \"creationTime\": 1748232139745\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Swipe fast the scrollable area ScrollView799 downwards to activate the pull-to-reload\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('ScrollView799')).swipe('down', 'fast');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('ScrollView799'))).toExist();\",\n      \"creationTime\": 1748232150034\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The text \\\\\\\"PullToReload Working!!!\\\\\\\" becomes visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Swipe fast the scrollable area ScrollView799 downwards to activate the pull-to-reload\\\",\\\"code\\\":\\\"await element(by.id('ScrollView799')).swipe('down', 'fast');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0'))).toExist();\",\n      \"creationTime\": 1748232161249\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The element with text \\\\\\\"Text1\\\\\\\" can be seen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toExist();\",\n      \"creationTime\": 1748232172562\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Swipe the view \\\\\\\"ScrollView161\\\\\\\" upwards\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The element with text \\\\\\\"Text1\\\\\\\" can be seen\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('ScrollView161')).swipe('up');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('ScrollView161'))).toExist();\",\n      \"creationTime\": 1748232179527\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The Text1 element is no longer in view\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The element with text \\\\\\\"Text1\\\\\\\" can be seen\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Swipe the view \\\\\\\"ScrollView161\\\\\\\" upwards\\\",\\\"code\\\":\\\"await element(by.id('ScrollView161')).swipe('up');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).not.toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toExist();\",\n      \"creationTime\": 1748232190221\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Swipe the element back up until the \\\\\\\"Text1\\\\\\\" element is visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The element with text \\\\\\\"Text1\\\\\\\" can be seen\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Swipe the view \\\\\\\"ScrollView161\\\\\\\" upwards\\\",\\\"code\\\":\\\"await element(by.id('ScrollView161')).swipe('up');\\\"},{\\\"step\\\":\\\"The Text1 element is no longer in view\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).not.toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await waitFor(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0')))\\n  .toBeVisible()\\n  .whileElement(by.id('ScrollView161'))\\n  .scroll(50, 'up');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('ScrollView161'))).toExist();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_0_12_0_0_0_0'))).toExist();\",\n      \"creationTime\": 1748232200222\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The slider is set to 25%\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed - the slider is already set to 25% as shown in the snapshot image and confirmed by the value=\\\"25%\\\" in the view hierarchy\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('sliderWithASimpleID'))).toExist();\",\n      \"creationTime\": 1748232269332\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Move the slider to the 75% position\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The slider is set to 25%\\\",\\\"code\\\":\\\"// Visual assertion passed - the slider is already set to 25% as shown in the snapshot image and confirmed by the value=\\\\\\\"25%\\\\\\\" in the view hierarchy\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('sliderWithASimpleID')).adjustSliderToPosition(0.75);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('sliderWithASimpleID'))).toExist();\",\n      \"creationTime\": 1748232276527\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The slider value is approximately 75%, give or take 10%\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The slider is set to 25%\\\",\\\"code\\\":\\\"// Visual assertion passed - the slider is already set to 25% as shown in the snapshot image and confirmed by the value=\\\\\\\"25%\\\\\\\" in the view hierarchy\\\"},{\\\"step\\\":\\\"Move the slider to the 75% position\\\",\\\"code\\\":\\\"await element(by.id('sliderWithASimpleID')).adjustSliderToPosition(0.75);\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed - the slider value is exactly 75% as shown in the view hierarchy (value=\\\"75%\\\"), which falls within the acceptable range of 65%-85% (75% ± 10%)\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('sliderWithASimpleID'))).toExist();\",\n      \"creationTime\": 1748232286545\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\"false\\\") and visual confirmation from the snapshot showing no focus indicators.\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId005'))).toExist();\",\n      \"creationTime\": 1748232302813\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\"false\\\") and visual confirmation from the snapshot showing no focus indicators.\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId006'))).toExist();\",\n      \"creationTime\": 1748232312444\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap to focus on the first text field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId937')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232320288\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"First text field now has the focus\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Tap to focus on the first text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed: The first text field (UniqueId937) is confirmed to have focus based on the view hierarchy showing visible cursor elements (_UITextCursorView), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\nawait expect(element(by.id('UniqueId937'))).toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232330679\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The second text input remains unfocused\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Tap to focus on the first text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tap();\\\"},{\\\"step\\\":\\\"First text field now has the focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The first text field (UniqueId937) is confirmed to have focus based on the view hierarchy showing visible cursor elements (_UITextCursorView), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\\\nawait expect(element(by.id('UniqueId937'))).toBeFocused();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed: The second text input (UniqueId005) is confirmed to remain unfocused based on the view hierarchy (focused=\\\"false\\\") and visual confirmation from the snapshot showing no focus indicators such as cursor or active keyboard for this element.\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId005'))).toExist();\",\n      \"creationTime\": 1748232341425\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Touch the second text field to give it focus\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Tap to focus on the first text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tap();\\\"},{\\\"step\\\":\\\"First text field now has the focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The first text field (UniqueId937) is confirmed to have focus based on the view hierarchy showing visible cursor elements (_UITextCursorView), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\\\nawait expect(element(by.id('UniqueId937'))).toBeFocused();\\\"},{\\\"step\\\":\\\"The second text input remains unfocused\\\",\\\"code\\\":\\\"// Visual assertion passed: The second text input (UniqueId005) is confirmed to remain unfocused based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators such as cursor or active keyboard for this element.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('UniqueId006')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId006'))).toExist();\",\n      \"creationTime\": 1748232351971\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"The first text input has lost focus\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Tap to focus on the first text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tap();\\\"},{\\\"step\\\":\\\"First text field now has the focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The first text field (UniqueId937) is confirmed to have focus based on the view hierarchy showing visible cursor elements (_UITextCursorView), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\\\nawait expect(element(by.id('UniqueId937'))).toBeFocused();\\\"},{\\\"step\\\":\\\"The second text input remains unfocused\\\",\\\"code\\\":\\\"// Visual assertion passed: The second text input (UniqueId005) is confirmed to remain unfocused based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators such as cursor or active keyboard for this element.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Touch the second text field to give it focus\\\",\\\"code\\\":\\\"await element(by.id('UniqueId006')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('UniqueId937'))).not.toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId937'))).toExist();\",\n      \"creationTime\": 1748232363277\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"2nd text field is now the active input\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"The text field UniqueId005 (call it \\\\\\\"the first\\\\\\\") does not have focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId005 is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Text input UniqueId006 (call it \\\\\\\"the second\\\\\\\") is not currently focused\\\",\\\"code\\\":\\\"// Visual assertion passed: The text field UniqueId006 (the second) is confirmed to not have focus based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators.\\\\nawait expect(element(by.id('UniqueId006'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Tap to focus on the first text field\\\",\\\"code\\\":\\\"await element(by.id('UniqueId937')).tap();\\\"},{\\\"step\\\":\\\"First text field now has the focus\\\",\\\"code\\\":\\\"// Visual assertion passed: The first text field (UniqueId937) is confirmed to have focus based on the view hierarchy showing visible cursor elements (_UITextCursorView), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\\\nawait expect(element(by.id('UniqueId937'))).toBeFocused();\\\"},{\\\"step\\\":\\\"The second text input remains unfocused\\\",\\\"code\\\":\\\"// Visual assertion passed: The second text input (UniqueId005) is confirmed to remain unfocused based on the view hierarchy (focused=\\\\\\\"false\\\\\\\") and visual confirmation from the snapshot showing no focus indicators such as cursor or active keyboard for this element.\\\\nawait expect(element(by.id('UniqueId005'))).not.toBeFocused();\\\"},{\\\"step\\\":\\\"Touch the second text field to give it focus\\\",\\\"code\\\":\\\"await element(by.id('UniqueId006')).tap();\\\"},{\\\"step\\\":\\\"The first text input has lost focus\\\",\\\"code\\\":\\\"await expect(element(by.id('UniqueId937'))).not.toBeFocused();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Visual assertion passed: The second text field (UniqueId006) is confirmed to be the active input based on the view hierarchy showing a visible cursor (_UITextCursorView with visibility=\\\"visible\\\"), active UIFieldEditor, and the keyboard being displayed, which are all indicators of an active focused text input.\\nawait expect(element(by.id('UniqueId006'))).toBeFocused();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('UniqueId006'))).toExist();\",\n      \"creationTime\": 1748232372479\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the \\\\\\\"FOOBAR\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Unable to find the 'FOOBAR' button element in the view hierarchy - no element with 'FOOBAR' text or identifier exists.\\\");\"\n      },\n      \"creationTime\": 1748232381161\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the \\\\\\\"FOOBAR\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Tap the \\\\\\\"FOOBAR\\\\\\\" button\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"Unable to find the 'FOOBAR' button element in the view hierarchy - no element with 'FOOBAR' text or identifier exists.\\\\\\\");\\\",\\\"error\\\":\\\"Unable to find the 'FOOBAR' button element in the view hierarchy - no element with 'FOOBAR' text or identifier exists.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Unable to find the 'FOOBAR' button element in the view hierarchy - no element with 'FOOBAR' text or identifier exists.\\\");\"\n      },\n      \"validationMatcher\": \"// No validation matcher needed as the element does not exist\",\n      \"creationTime\": 1748232390638\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Do magic to the element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The intent 'Do magic to the element' is too ambiguous - please specify which element and what action to perform.\\\");\"\n      },\n      \"creationTime\": 1748232400589\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Do magic to the element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Do magic to the element\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"The intent 'Do magic to the element' is too ambiguous - please specify which element and what action to perform.\\\\\\\");\\\",\\\"error\\\":\\\"The intent 'Do magic to the element' is too ambiguous - please specify which element and what action to perform.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The intent 'Do magic to the element' is too ambiguous - please specify which element and what specific action to perform (e.g., 'tap the login button', 'scroll the list view', 'adjust the slider').\\\");\"\n      },\n      \"creationTime\": 1748232422107\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Attempt a long press on the \\\\\\\"Long Press on Top Left\\\\\\\" button outside its bounds\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Go to the Actions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_4')).tap();\\\"},{\\\"step\\\":\\\"Attempt a long press on the \\\\\\\"Long Press on Top Left\\\\\\\" button outside its bounds\\\",\\\"code\\\":\\\"// The \\\\\\\"Long Press on Top Left\\\\\\\" button is at x=0, y=153, width=430, height=27\\\\n// To press outside its bounds, I'll use coordinates outside this rectangle\\\\n// Using point (-10, 153) which is to the left of the button's bounds\\\\nawait element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: -10, y: 0});\\\",\\\"error\\\":\\\"Test Failed: View is not hittable at its visible point. Error: View is not visible around point.\\\\n- view point: {-10, 0}\\\\n- visible bounds: {{0, 0}, {430, 27}}\\\\n- view bounds: {{0, 153}, {430, 27}}\\\\n---\\\\nError: Error Domain=DetoxErrorDomain Code=0 \\\\\\\"View “<RCTViewComponentView: 0x106725750>” is not visible: View does not pass visibility percent threshold (100)\\\\\\\" UserInfo={NSLocalizedDescription=View “<RCTViewComponentView: 0x106725750>” is not visible: View does not pass visibility percent threshold (100)}\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// The \\\"Long Press on Top Left\\\" button bounds are width=430, height=27\\n// To press outside its bounds, I'll use coordinates beyond the button's dimensions\\n// Using point (440, 30) which is outside the button's width and height bounds\\nawait element(by.id('detox_temp_0_0_0_1_0_0_2')).longPress({x: 440, y: 30});\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_2'))).toExist();\",\n      \"creationTime\": 1748234504573\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/03.pilot.shape-match.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Reset react native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No cache validation needed for device.reloadReactNative() as it's a device-level API\",\n      \"creationTime\": 1748232929614\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Enter the \\\\\\\"Shape Matching\\\\\\\" game screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Reset react native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_34')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_34'))).toExist();\",\n      \"creationTime\": 1748232937377\n    }\n  ],\n  \"{\\\"goal\\\":\\\"Play the shape matching game until score 2, use only the top row shapes\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Shape Matcher Game Screen\",\n        \"plan\": {\n          \"action\": \"Drag the red circle from the top row to the gray circle placeholder above\",\n          \"thoughts\": \"I can see a shape matching game with a score of 0. The goal is to *play the game until reaching score 2* using **only the top row shapes**. Looking at the screen, there are three gray placeholder shapes at the top (circle, square, triangle) which appear to be the target holes for matching. Below that are six colored shapes arranged in two rows: the top row has a *red circle*, *blue square*, and *yellow triangle*, while the bottom row has a *blue circle*, *yellow triangle*, and *red square*. Since the goal specifies to **use only the top row shapes**, I need to start by dragging one of the top row shapes (red circle, blue square, or yellow triangle) to its corresponding gray placeholder above. The most logical first move would be to drag the ***red circle from the top row*** to the gray circle placeholder at the top.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": false\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801f00ffc3fffffffffc02fc007e407ffff8433cc218421ffffffff00000000\",\n        \"ViewHierarchyHash\": \"8ef9fe7661aae8fb24bebd819f8aa36a\"\n      },\n      \"creationTime\": 1748232947819\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Drag the red circle from the top row to the gray circle placeholder above\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('shape-0')).longPressAndDrag(\\n  1000, \\n  0.5, \\n  0.5, \\n  element(by.id('shape-hole-0')), \\n  0.5, \\n  0.5, \\n  'fast', \\n  500\\n);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('shape-0'))).toExist();\\nawait expect(element(by.id('shape-hole-0'))).toExist();\",\n      \"creationTime\": 1748232956671\n    }\n  ],\n  \"{\\\"goal\\\":\\\"Play the shape matching game until score 2, use only the top row shapes\\\",\\\"previousSteps\\\":[{\\\"screenDescription\\\":\\\"Shape Matcher Game Screen\\\",\\\"step\\\":\\\"Drag the red circle from the top row to the gray circle placeholder above\\\",\\\"review\\\":{}}]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Shape Matcher Game Screen\",\n        \"plan\": {\n          \"action\": \"Drag the gray square from the top row to its matching square-shaped hole\",\n          \"thoughts\": \"Looking at the current state, I can see the score is 1 and the goal is to reach score 2 using only top row shapes. From the previous step, it appears a red circle was successfully matched. Now I need to analyze what shapes are available and what needs to be matched next.\\n\\nFrom the view hierarchy, I can see there are multiple shape elements (shape-0 through shape-5) and shape holes (shape-hole-0 through shape-hole-2). The constraint is to *use only top row shapes*, which based on the layout should be the shapes positioned higher on the screen.\\n\\nLooking at the snapshot image, I can see:\\n- **Top row** has a red circle (already placed), a gray square, and a gray triangle\\n- **Middle row** has a blue square and an orange triangle  \\n- **Bottom row** has a blue circle, orange triangle, and red square\\n\\nSince I need to use only top row shapes and the goal is to reach score 2, I need to make one more match. The available top row shapes that haven't been used are the ***gray square and gray triangle***. I need to find their corresponding holes to drag them to.\\n\\nFrom the image, it appears there are empty holes that need to be filled. I should drag one of the remaining top row shapes (the gray square or gray triangle) to its matching hole.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": false\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801f00ffc3fffffffffc02fc007e407fe7ffc21cc218421ffffffff00000000\",\n        \"ViewHierarchyHash\": \"f4bc0dc0bdb8c2ae6d344c368585383b\"\n      },\n      \"creationTime\": 1748232972051\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Drag the gray square from the top row to its matching square-shaped hole\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Drag the red circle from the top row to the gray circle placeholder above\\\",\\\"code\\\":\\\"await element(by.id('shape-0')).longPressAndDrag(\\\\n  1000, \\\\n  0.5, \\\\n  0.5, \\\\n  element(by.id('shape-hole-0')), \\\\n  0.5, \\\\n  0.5, \\\\n  'fast', \\\\n  500\\\\n);\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('shape-1')).longPressAndDrag(\\n  1000, \\n  0.5, \\n  0.5, \\n  element(by.id('shape-hole-1')), \\n  0.5, \\n  0.5, \\n  'fast', \\n  500\\n);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('shape-1'))).toExist();\\nawait expect(element(by.id('shape-hole-1'))).toExist();\",\n      \"creationTime\": 1748232980351\n    }\n  ],\n  \"{\\\"goal\\\":\\\"Play the shape matching game until score 2, use only the top row shapes\\\",\\\"previousSteps\\\":[{\\\"screenDescription\\\":\\\"Shape Matcher Game Screen\\\",\\\"step\\\":\\\"Drag the red circle from the top row to the gray circle placeholder above\\\",\\\"review\\\":{}},{\\\"screenDescription\\\":\\\"Shape Matcher Game Screen\\\",\\\"step\\\":\\\"Drag the gray square from the top row to its matching square-shaped hole\\\",\\\"review\\\":{}}]}\": [\n    {\n      \"value\": {\n        \"screenDescription\": \"Shape Matcher Game Screen - Score 2 Achieved\",\n        \"plan\": {\n          \"action\": \"success\",\n          \"thoughts\": \"Looking at the current state, I can see that the score displays ***\\\"Score: 2\\\"*** at the top of the screen. The goal was to \\\"Play the shape matching game until score 2, use only the top row shapes.\\\" \\n\\nFrom the previous steps, I can see that:\\n- Step 1: The user dragged the red circle from the top row to match it\\n- Step 2: The user dragged the gray square from the top row to match it\\n\\nThe score has now reached **2 points**, which means the user has successfully completed two matches using only the top row shapes as required. The game board shows that there are still shapes available (I can see various colored shapes including a blue circle, orange triangles, and a red square in different positions), but the *specific goal criteria have been met* - the score of 2 has been achieved using only top row shapes.\\n\\nSince the target score of **2 has been reached** and the constraint of using only top row shapes was followed, the goal is now complete.\"\n        },\n        \"review\": {},\n        \"goalAchieved\": true,\n        \"summary\": \"The goal has been ***successfully achieved***. The user played the shape matching game and reached a **score of 2** by making two successful matches using only shapes from the top row as required. The first match involved *dragging the red circle* to its corresponding placeholder, and the second match involved *dragging the gray square* to its matching hole. The game provided clear visual feedback and score tracking throughout the process.\"\n      },\n      \"snapshotHashes\": {\n        \"BlockHash\": \"c801f00ffc3fffffffffc02fc007e407fff3ffe186618421ffffffff00000000\",\n        \"ViewHierarchyHash\": \"09059e0cdbb81da4d87416044c36a5bd\"\n      },\n      \"creationTime\": 1748232996318\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/04.webview.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No UI elements need validation for device-level React Native restart operation\",\n      \"creationTime\": 1748233902804\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the WebView screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_27'))).toExist();\",\n      \"creationTime\": 1748233910303\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('pageHeadline'))).toExist();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('webViewFormWithScrolling'))).toBeVisible();\",\n      \"creationTime\": 1748233920139\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\"\n      },\n      \"validationMatcher\": \"await expect(web.element(by.web.id('pageHeadline'))).toExist();\",\n      \"creationTime\": 1748233927939\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Locate an input field with ID \\\\\\\"fname\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"},{\\\"step\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('fname'))).toExist();\"\n      },\n      \"validationMatcher\": \"await expect(web.element(by.web.id('fname'))).toExist();\",\n      \"creationTime\": 1748233934027\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Type \\\\\\\"Tester\\\\\\\" into this input field\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"},{\\\"step\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\\\"},{\\\"step\\\":\\\"Locate an input field with ID \\\\\\\"fname\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toExist();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await web.element(by.web.id('fname')).typeText('Tester');\"\n      },\n      \"validationMatcher\": \"await expect(web.element(by.web.id('fname'))).toExist();\",\n      \"creationTime\": 1748233941686\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Confirm that the input field now contains the text \\\\\\\"Tester\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"},{\\\"step\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\\\"},{\\\"step\\\":\\\"Locate an input field with ID \\\\\\\"fname\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toExist();\\\"},{\\\"step\\\":\\\"Type \\\\\\\"Tester\\\\\\\" into this input field\\\",\\\"code\\\":\\\"await web.element(by.web.id('fname')).typeText('Tester');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('fname'))).toHaveText('Tester');\"\n      },\n      \"validationMatcher\": \"await expect(web.element(by.web.id('fname'))).toExist();\",\n      \"creationTime\": 1748233952555\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find and click a submit button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"},{\\\"step\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\\\"},{\\\"step\\\":\\\"Locate an input field with ID \\\\\\\"fname\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toExist();\\\"},{\\\"step\\\":\\\"Type \\\\\\\"Tester\\\\\\\" into this input field\\\",\\\"code\\\":\\\"await web.element(by.web.id('fname')).typeText('Tester');\\\"},{\\\"step\\\":\\\"Confirm that the input field now contains the text \\\\\\\"Tester\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toHaveText('Tester');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await web.element(by.web.id('submit')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(web.element(by.web.id('submit'))).toExist();\",\n      \"creationTime\": 1748233960331\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Check that the input field still contains \\\\\\\"Tester\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"pageHeadline\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toExist();\\\"},{\\\"step\\\":\\\"Verify that the text of this element is \\\\\\\"First Webview\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('pageHeadline'))).toHaveText('First Webview');\\\"},{\\\"step\\\":\\\"Locate an input field with ID \\\\\\\"fname\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toExist();\\\"},{\\\"step\\\":\\\"Type \\\\\\\"Tester\\\\\\\" into this input field\\\",\\\"code\\\":\\\"await web.element(by.web.id('fname')).typeText('Tester');\\\"},{\\\"step\\\":\\\"Confirm that the input field now contains the text \\\\\\\"Tester\\\\\\\"\\\",\\\"code\\\":\\\"await expect(web.element(by.web.id('fname'))).toHaveText('Tester');\\\"},{\\\"step\\\":\\\"Find and click a submit button\\\",\\\"code\\\":\\\"await web.element(by.web.id('submit')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('fname'))).toHaveText('Tester');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('webViewFormWithScrolling'))).toExist();\\nawait expect(web.element(by.web.id('fname'))).toExist();\",\n      \"creationTime\": 1748233970422\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Scroll to \\\\\\\"bottomParagraph\\\\\\\" in the WebView\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await web.element(by.web.id('bottomParagraph')).scrollToView();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('webViewFormWithScrolling'))).toExist();\",\n      \"creationTime\": 1748233981084\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that the text of this element is \\\\\\\"This is a bottom paragraph with class.\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WebView screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_27')).tap();\\\"},{\\\"step\\\":\\\"Scroll to \\\\\\\"bottomParagraph\\\\\\\" in the WebView\\\",\\\"code\\\":\\\"await web.element(by.web.id('bottomParagraph')).scrollToView();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(web.element(by.web.id('bottomParagraph'))).toHaveText('This is a bottom paragraph with class.');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('webViewFormWithScrolling'))).toBeVisible();\\nawait expect(web.element(by.web.id('bottomParagraph'))).toExist();\",\n      \"creationTime\": 1748233992971\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/06.waitfor.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native environment\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No specific elements need validation for restarting React Native environment\",\n      \"creationTime\": 1748233115453\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the WaitFor screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_10')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_10'))).toExist();\",\n      \"creationTime\": 1748233125004\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that an element with text \\\\\\\"Text5\\\\\\\" is not visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WaitFor screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_10')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.text('Text5'))).not.toBeVisible();\"\n      },\n      \"validationMatcher\": \"// Verify the Text5 element exists in the view hierarchy\\nawait expect(element(by.text('Text5'))).toExist();\",\n      \"creationTime\": 1748233134645\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the \\\\\\\"Go\\\\\\\" button\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WaitFor screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_10')).tap();\\\"},{\\\"step\\\":\\\"Verify that an element with text \\\\\\\"Text5\\\\\\\" is not visible\\\",\\\"code\\\":\\\"await expect(element(by.text('Text5'))).not.toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('goButton')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('goButton'))).toExist();\",\n      \"creationTime\": 1748233142317\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Scroll down in the ScrollView until \\\\\\\"Text5\\\\\\\" becomes visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WaitFor screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_10')).tap();\\\"},{\\\"step\\\":\\\"Verify that an element with text \\\\\\\"Text5\\\\\\\" is not visible\\\",\\\"code\\\":\\\"await expect(element(by.text('Text5'))).not.toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the \\\\\\\"Go\\\\\\\" button\\\",\\\"code\\\":\\\"await element(by.id('goButton')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await waitFor(element(by.text('Text5')))\\n  .toBeVisible()\\n  .whileElement(by.id('ScrollView'))\\n  .scroll(50, 'down');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('ScrollView'))).toExist();\\nawait expect(element(by.text('Text5'))).toExist();\",\n      \"creationTime\": 1748233151327\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Confirm that \\\\\\\"Text5\\\\\\\" is now visible on the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native environment\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the WaitFor screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_10')).tap();\\\"},{\\\"step\\\":\\\"Verify that an element with text \\\\\\\"Text5\\\\\\\" is not visible\\\",\\\"code\\\":\\\"await expect(element(by.text('Text5'))).not.toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the \\\\\\\"Go\\\\\\\" button\\\",\\\"code\\\":\\\"await element(by.id('goButton')).tap();\\\"},{\\\"step\\\":\\\"Scroll down in the ScrollView until \\\\\\\"Text5\\\\\\\" becomes visible\\\",\\\"code\\\":\\\"await waitFor(element(by.text('Text5')))\\\\n  .toBeVisible()\\\\n  .whileElement(by.id('ScrollView'))\\\\n  .scroll(50, 'down');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.text('Text5'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.text('Text5'))).toExist();\",\n      \"creationTime\": 1748233165911\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/07.pilot.assertions.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No element validation needed for device-level React Native restart operation\",\n      \"creationTime\": 1748232446091\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the Assertions screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_9'))).toExist();\",\n      \"creationTime\": 1748232453510\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"i contain some text\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('main-text'))).toHaveText('I contain some text');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('main-text'))).toExist();\",\n      \"creationTime\": 1748232460976\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is element with the text \\\\\\\"I am full of text\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error('Element with text \\\"I am full of text\\\" does not exist on the screen');\"\n      },\n      \"validationMatcher\": \"// No cache validation needed as we're verifying non-existence\",\n      \"creationTime\": 1748232473653\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is element with the text \\\\\\\"I am full of text\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"I am full of text\\\\\\\" in the screen\\\",\\\"code\\\":\\\"throw new Error('Element with text \\\\\\\"I am full of text\\\\\\\" does not exist on the screen');\\\",\\\"error\\\":\\\"Element with text \\\\\\\"I am full of text\\\\\\\" does not exist on the screen\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error('Element with text \\\"I am full of text\\\" does not exist on the screen');\"\n      },\n      \"validationMatcher\": \"// No validation matcher needed as we're checking for non-existence\",\n      \"creationTime\": 1748232487046\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with ID \\\\\\\"subtext-root\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('subtext-root'))).toExist();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('subtext-root'))).toExist();\",\n      \"creationTime\": 1748232498146\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find an element with ID \\\\\\\"RandomJunk959\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Element with ID 'RandomJunk959' does not exist in the current screen.\\\");\"\n      },\n      \"validationMatcher\": \"// No validation matcher needed as the element doesn't exist\",\n      \"creationTime\": 1748232508685\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find an element with ID \\\\\\\"RandomJunk959\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Find an element with ID \\\\\\\"RandomJunk959\\\\\\\" in the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"Element with ID 'RandomJunk959' does not exist in the current screen.\\\\\\\");\\\",\\\"error\\\":\\\"Element with ID 'RandomJunk959' does not exist in the current screen.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Element with ID 'RandomJunk959' does not exist in the current screen.\\\");\"\n      },\n      \"validationMatcher\": \"// No cache validation needed as the element does not exist\",\n      \"creationTime\": 1748232518481\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the accessibility label \\\\\\\"I contain some text\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('main-text'))).toHaveLabel('I contain some text');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('main-text'))).toExist();\",\n      \"creationTime\": 1748232530059\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find an element with label \\\\\\\"I exist in the screen\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Unable to find an element with label 'I exist in the screen' - no such element exists in the current view hierarchy.\\\");\"\n      },\n      \"validationMatcher\": \"// No validation matcher needed as the element doesn't exist\",\n      \"creationTime\": 1748232540978\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find an element with label \\\\\\\"I exist in the screen\\\\\\\" in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Find an element with label \\\\\\\"I exist in the screen\\\\\\\" in the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"Unable to find an element with label 'I exist in the screen' - no such element exists in the current view hierarchy.\\\\\\\");\\\",\\\"error\\\":\\\"Unable to find an element with label 'I exist in the screen' - no such element exists in the current view hierarchy.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Unable to find an element with label 'I exist in the screen' - no such element exists in the current view hierarchy.\\\");\"\n      },\n      \"validationMatcher\": \"// No validation matcher needed as the element does not exist\",\n      \"creationTime\": 1748232549746\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that the toggle type element is exist in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggle'))).toExist();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\",\n      \"creationTime\": 1748232560066\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find a text-field element in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"No text-field element found in the current screen. The screen contains text labels, an image, a toggle switch, and emojis, but no input fields.\\\");\"\n      },\n      \"creationTime\": 1748232571404\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Find a text-field element in the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Find a text-field element in the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"No text-field element found in the current screen. The screen contains text labels, an image, a toggle switch, and emojis, but no input fields.\\\\\\\");\\\",\\\"error\\\":\\\"No text-field element found in the current screen. The screen contains text labels, an image, a toggle switch, and emojis, but no input fields.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"No text-field element found in the current screen. The screen contains text labels, an image, a toggle switch, and emojis, but no input fields are present.\\\");\"\n      },\n      \"creationTime\": 1748232580331\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that the toggle has false value\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggle'))).toHaveToggleValue(false);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\",\n      \"creationTime\": 1748232590428\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the toggle\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('toggle')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\",\n      \"creationTime\": 1748232600360\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that the toggle has true value\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Tap the toggle\\\",\\\"code\\\":\\\"await element(by.id('toggle')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggle'))).toHaveToggleValue(true);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\",\n      \"creationTime\": 1748232608406\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a green text element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"const attributes = await element(by.id('color-text1')).getAttributes();\\nconst hasGreenColor = attributes.text === 'Some more text here';\\n\\nif (!hasGreenColor) {\\n  throw new Error(\\\"No green text element found - expected 'Some more text here' element to be green\\\");\\n}\\n\\n// Verify the element exists and is visible\\nawait expect(element(by.id('color-text1'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('color-text1'))).toExist();\",\n      \"creationTime\": 1748232662159\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toExist();\",\n      \"creationTime\": 1748232673791\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that under the text element with the text \\\\\\\"subtext\\\\\\\" there is an image element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Get the position of the subtext element\\nconst subtextAttributes = await element(by.id('detox_temp_0_0_0_1_0_1_1')).getAttributes();\\nconst subtextY = subtextAttributes.frame.y + subtextAttributes.frame.height;\\n\\n// Get the position of the image element\\nconst imageAttributes = await element(by.id('example-image')).getAttributes();\\nconst imageY = imageAttributes.frame.y;\\n\\n// Verify that the image is positioned below the subtext element\\nif (imageY <= subtextY) {\\n  throw new Error(`Image element is not positioned under the subtext element. Image Y: ${imageY}, Subtext bottom Y: ${subtextY}`);\\n}\\n\\n// Verify that both elements exist and are visible\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\nawait expect(element(by.id('example-image'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toExist();\\nawait expect(element(by.id('example-image'))).toExist();\",\n      \"creationTime\": 1748232685968\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that under the image element there is a green text element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\\"},{\\\"step\\\":\\\"Verify that under the text element with the text \\\\\\\"subtext\\\\\\\" there is an image element\\\",\\\"code\\\":\\\"// Get the position of the subtext element\\\\nconst subtextAttributes = await element(by.id('detox_temp_0_0_0_1_0_1_1')).getAttributes();\\\\nconst subtextY = subtextAttributes.frame.y + subtextAttributes.frame.height;\\\\n\\\\n// Get the position of the image element\\\\nconst imageAttributes = await element(by.id('example-image')).getAttributes();\\\\nconst imageY = imageAttributes.frame.y;\\\\n\\\\n// Verify that the image is positioned below the subtext element\\\\nif (imageY <= subtextY) {\\\\n  throw new Error(`Image element is not positioned under the subtext element. Image Y: ${imageY}, Subtext bottom Y: ${subtextY}`);\\\\n}\\\\n\\\\n// Verify that both elements exist and are visible\\\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\\\nawait expect(element(by.id('example-image'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Get the position of the image element\\nconst imageAttributes = await element(by.id('example-image')).getAttributes();\\nconst imageBottom = imageAttributes.frame.y + imageAttributes.frame.height;\\n\\n// Get the position of the green text element\\nconst greenTextAttributes = await element(by.id('color-text1')).getAttributes();\\nconst greenTextY = greenTextAttributes.frame.y;\\n\\n// Verify that the green text element is positioned below the image element\\nif (greenTextY <= imageBottom) {\\n  throw new Error(`Green text element is not positioned under the image element. Green text Y: ${greenTextY}, Image bottom Y: ${imageBottom}`);\\n}\\n\\n// Verify that both elements exist and are visible\\nawait expect(element(by.id('example-image'))).toBeVisible();\\nawait expect(element(by.id('color-text1'))).toBeVisible();\\nawait expect(element(by.id('color-text1'))).toHaveText('Some more text here');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('example-image'))).toExist();\\nawait expect(element(by.id('color-text1'))).toExist();\",\n      \"creationTime\": 1748232697851\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that under the green text element there is a toggle element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\\"},{\\\"step\\\":\\\"Verify that under the text element with the text \\\\\\\"subtext\\\\\\\" there is an image element\\\",\\\"code\\\":\\\"// Get the position of the subtext element\\\\nconst subtextAttributes = await element(by.id('detox_temp_0_0_0_1_0_1_1')).getAttributes();\\\\nconst subtextY = subtextAttributes.frame.y + subtextAttributes.frame.height;\\\\n\\\\n// Get the position of the image element\\\\nconst imageAttributes = await element(by.id('example-image')).getAttributes();\\\\nconst imageY = imageAttributes.frame.y;\\\\n\\\\n// Verify that the image is positioned below the subtext element\\\\nif (imageY <= subtextY) {\\\\n  throw new Error(`Image element is not positioned under the subtext element. Image Y: ${imageY}, Subtext bottom Y: ${subtextY}`);\\\\n}\\\\n\\\\n// Verify that both elements exist and are visible\\\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toHaveText('subtext');\\\\nawait expect(element(by.id('example-image'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Verify that under the image element there is a green text element\\\",\\\"code\\\":\\\"// Get the position of the image element\\\\nconst imageAttributes = await element(by.id('example-image')).getAttributes();\\\\nconst imageBottom = imageAttributes.frame.y + imageAttributes.frame.height;\\\\n\\\\n// Get the position of the green text element\\\\nconst greenTextAttributes = await element(by.id('color-text1')).getAttributes();\\\\nconst greenTextY = greenTextAttributes.frame.y;\\\\n\\\\n// Verify that the green text element is positioned below the image element\\\\nif (greenTextY <= imageBottom) {\\\\n  throw new Error(`Green text element is not positioned under the image element. Green text Y: ${greenTextY}, Image bottom Y: ${imageBottom}`);\\\\n}\\\\n\\\\n// Verify that both elements exist and are visible\\\\nawait expect(element(by.id('example-image'))).toBeVisible();\\\\nawait expect(element(by.id('color-text1'))).toBeVisible();\\\\nawait expect(element(by.id('color-text1'))).toHaveText('Some more text here');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Get the position of the green text element\\nconst greenTextAttributes = await element(by.id('color-text1')).getAttributes();\\nconst greenTextBottom = greenTextAttributes.frame.y + greenTextAttributes.frame.height;\\n\\n// Get the position of the toggle element\\nconst toggleAttributes = await element(by.id('toggle')).getAttributes();\\nconst toggleY = toggleAttributes.frame.y;\\n\\n// Verify that the toggle element is positioned below the green text element\\nif (toggleY <= greenTextBottom) {\\n  throw new Error(`Toggle element is not positioned under the green text element. Toggle Y: ${toggleY}, Green text bottom Y: ${greenTextBottom}`);\\n}\\n\\n// Verify that both elements exist and are visible\\nawait expect(element(by.id('color-text1'))).toBeVisible();\\nawait expect(element(by.id('toggle'))).toBeVisible();\\nawait expect(element(by.id('color-text1'))).toHaveText('Some more text here');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('color-text1'))).toExist();\\nawait expect(element(by.id('toggle'))).toExist();\",\n      \"creationTime\": 1748232708435\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the toggle element is above the text element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Visual assertion failed: The toggle element (y=598) is positioned below the text element 'I am pink' (y=561), not above it as expected.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\\nawait expect(element(by.id('color-text2'))).toExist();\",\n      \"creationTime\": 1748232719093\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the toggle element is above the text element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify the toggle element is above the text element\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"Visual assertion failed: The toggle element (y=598) is positioned below the text element 'I am pink' (y=561), not above it as expected.\\\\\\\");\\\",\\\"error\\\":\\\"Visual assertion failed: The toggle element (y=598) is positioned below the text element 'I am pink' (y=561), not above it as expected.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"Visual assertion failed: The toggle element is positioned below the text element 'I am pink', not above it. Toggle y-position: 598, Text y-position: 561\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggle'))).toExist();\\nawait expect(element(by.id('color-text2'))).toExist();\",\n      \"creationTime\": 1748232728192\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that under the image element in the screen there is text element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The text element containing 'subtext' is positioned above the image element, not below it as required.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('example-image'))).toExist();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_1_1'))).toExist();\",\n      \"creationTime\": 1748232744767\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify that under the image element in the screen there is text element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify that under the image element in the screen there is text element with the text \\\\\\\"subtext\\\\\\\"\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"The text element containing 'subtext' is positioned above the image element, not below it as required.\\\\\\\");\\\",\\\"error\\\":\\\"The text element containing 'subtext' is positioned above the image element, not below it as required.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The text element containing 'subtext' is positioned above the image element (y=377), not below it as required. The image element is positioned at y=414.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('example-image'))).toExist();\\nawait expect(element(by.id('subtext-root'))).toExist();\",\n      \"creationTime\": 1748232754998\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a smiling emoji in the top left corner of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('smile-emoji'))).toBeVisible();\\nawait expect(element(by.id('smile-emoji'))).toHaveText('😊');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('smile-emoji'))).toExist();\",\n      \"creationTime\": 1748232764624\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a party emoji in the bottom right corner of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is a smiling emoji in the top left corner of the screen\\\",\\\"code\\\":\\\"await expect(element(by.id('smile-emoji'))).toBeVisible();\\\\nawait expect(element(by.id('smile-emoji'))).toHaveText('😊');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('celebration-emoji'))).toBeVisible();\\nawait expect(element(by.id('celebration-emoji'))).toHaveText('🎉');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('celebration-emoji'))).toExist();\",\n      \"creationTime\": 1748232772902\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a smiling face emoji in the center of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The smiling face emoji (😊) exists but is positioned in the top-left corner of the screen (x=20, y=20), not in the center as expected.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('smile-emoji'))).toExist();\",\n      \"creationTime\": 1748232784576\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a smiling face emoji in the center of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is a smiling face emoji in the center of the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"The smiling face emoji (😊) exists but is positioned in the top-left corner of the screen (x=20, y=20), not in the center as expected.\\\\\\\");\\\",\\\"error\\\":\\\"The smiling face emoji (😊) exists but is positioned in the top-left corner of the screen (x=20, y=20), not in the center as expected.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The smiling face emoji (😊) exists but is positioned at the top-left corner of the screen (x=20, y=20), not in the center as expected. For a 430x932 screen, the center would be around (215, 466).\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('smile-emoji'))).toExist();\",\n      \"creationTime\": 1748232793709\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a party emoji in the center of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The party emoji (🎉) exists but is not in the center of the screen - it is located in the bottom-right corner at coordinates (365, 864) while the screen center is approximately (215, 466).\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('celebration-emoji'))).toExist();\",\n      \"creationTime\": 1748232802604\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a party emoji in the center of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is a party emoji in the center of the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"The party emoji (🎉) exists but is not in the center of the screen - it is located in the bottom-right corner at coordinates (365, 864) while the screen center is approximately (215, 466).\\\\\\\");\\\",\\\"error\\\":\\\"The party emoji (🎉) exists but is not in the center of the screen - it is located in the bottom-right corner at coordinates (365, 864) while the screen center is approximately (215, 466).\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The party emoji (🎉) exists but is not in the center of the screen. It is located at coordinates (365, 864) in the bottom-right corner, while the screen center is at approximately (215, 466).\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('celebration-emoji'))).toExist();\",\n      \"creationTime\": 1748232809883\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a smiling face emoji in the bottom right corner of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The smiling face emoji is located in the top left corner (coordinates 20, 20), not in the bottom right corner as expected. The bottom right corner contains a celebration emoji (🎉) instead.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('smile-emoji'))).toExist();\\nawait expect(element(by.id('celebration-emoji'))).toExist();\",\n      \"creationTime\": 1748232819170\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a smiling face emoji in the bottom right corner of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Assertions screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_9')).tap();\\\"},{\\\"step\\\":\\\"Verify there is a smiling face emoji in the bottom right corner of the screen\\\",\\\"code\\\":\\\"throw new Error(\\\\\\\"The smiling face emoji is located in the top left corner (coordinates 20, 20), not in the bottom right corner as expected. The bottom right corner contains a celebration emoji (🎉) instead.\\\\\\\");\\\",\\\"error\\\":\\\"The smiling face emoji is located in the top left corner (coordinates 20, 20), not in the bottom right corner as expected. The bottom right corner contains a celebration emoji (🎉) instead.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The smiling face emoji (😊) is located in the top left corner at coordinates (20, 20), not in the bottom right corner. The bottom right corner at coordinates (365, 864) contains a celebration emoji (🎉) instead.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('smile-emoji'))).toExist();\\nawait expect(element(by.id('celebration-emoji'))).toExist();\",\n      \"creationTime\": 1748232829151\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/08.pilot.location.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No UI elements need validation for this device-level operation\",\n      \"creationTime\": 1748233484771\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Launch the app with location permission denied\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.launchApp({ \\n  newInstance: true, \\n  permissions: { location: 'never' } \\n});\"\n      },\n      \"validationMatcher\": \"// No cache validation needed as this is a device launch operation that doesn't interact with specific UI elements\",\n      \"creationTime\": 1748233491833\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the Location screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Launch the app with location permission denied\\\",\\\"code\\\":\\\"await device.launchApp({ \\\\n  newInstance: true, \\\\n  permissions: { location: 'never' } \\\\n});\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_24')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_24'))).toExist();\",\n      \"creationTime\": 1748233502961\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Get location\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Launch the app with location permission denied\\\",\\\"code\\\":\\\"await device.launchApp({ \\\\n  newInstance: true, \\\\n  permissions: { location: 'never' } \\\\n});\\\"},{\\\"step\\\":\\\"Navigate to the Location screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_24')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('get_location_button'))).toHaveText('Get location');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('get_location_button'))).toExist();\",\n      \"creationTime\": 1748233513782\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Get location\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Launch the app with location permission denied\\\",\\\"code\\\":\\\"await device.launchApp({ \\\\n  newInstance: true, \\\\n  permissions: { location: 'never' } \\\\n});\\\"},{\\\"step\\\":\\\"Navigate to the Location screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_24')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Get location\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('get_location_button'))).toHaveText('Get location');\\\",\\\"error\\\":\\\"Test Failed: Failed expectation: TOHAVETEXT(text == “Get location”) WITH MATCHER(id == “get_location_button”)\\\\n\\\\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('get_location_button'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('get_location_button'))).toExist();\",\n      \"creationTime\": 1748233523242\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the get location element\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Launch the app with location permission denied\\\",\\\"code\\\":\\\"await device.launchApp({ \\\\n  newInstance: true, \\\\n  permissions: { location: 'never' } \\\\n});\\\"},{\\\"step\\\":\\\"Navigate to the Location screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_24')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Get location\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('get_location_button'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('get_location_button')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('get_location_button'))).toExist();\",\n      \"creationTime\": 1748233529592\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"User denied access to location services.\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Launch the app with location permission denied\\\",\\\"code\\\":\\\"await device.launchApp({ \\\\n  newInstance: true, \\\\n  permissions: { location: 'never' } \\\\n});\\\"},{\\\"step\\\":\\\"Navigate to the Location screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_24')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Get location\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('get_location_button'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the get location element\\\",\\\"code\\\":\\\"await element(by.id('get_location_button')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('location_error'))).toHaveText('User denied access to location services.');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('location_error'))).toExist();\",\n      \"creationTime\": 1748233536873\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/09.pilot.datepicker.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No UI elements to validate - this is a device-level operation\",\n      \"creationTime\": 1748233220381\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the DatePicker screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_25'))).toExist();\",\n      \"creationTime\": 1748233237355\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is element with the text \\\\\\\"Date (UTC): \\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('utcDateLabel'))).toExist();\",\n      \"creationTime\": 1748233254589\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the element value of current date UTC July 1st 2023\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Date (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('utcDateLabel'))).toExist();\",\n      \"creationTime\": 1748233262072\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is element with the text \\\\\\\"Time (UTC): \\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Date (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"},{\\\"step\\\":\\\"Verify the element value of current date UTC July 1st 2023\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('utcTimeLabel'))).toHaveText('Time (UTC): 4:30 PM');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('utcTimeLabel'))).toExist();\",\n      \"creationTime\": 1748233270449\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is element with the text \\\\\\\"Time Local: \\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Date (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"},{\\\"step\\\":\\\"Verify the element value of current date UTC July 1st 2023\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Time (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcTimeLabel'))).toHaveText('Time (UTC): 4:30 PM');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('localTimeLabel'))).toHaveText('Time (Local): 7:30 PM');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('localTimeLabel'))).toExist();\",\n      \"creationTime\": 1748233278987\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify \\\\\\\"Time Local: \\\\\\\" value is 7:30 pm\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Date (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"},{\\\"step\\\":\\\"Verify the element value of current date UTC July 1st 2023\\\",\\\"code\\\":\\\"await expect(element(by.id('utcDateLabel'))).toHaveText('Date (UTC): Jul 1st, 2023');\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Time (UTC): \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('utcTimeLabel'))).toHaveText('Time (UTC): 4:30 PM');\\\"},{\\\"step\\\":\\\"Verify there is element with the text \\\\\\\"Time Local: \\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('localTimeLabel'))).toHaveText('Time (Local): 7:30 PM');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('localTimeLabel'))).toHaveText('Time (Local): 7:30 PM');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('localTimeLabel'))).toExist();\",\n      \"creationTime\": 1748233285932\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggleDatePicker'))).toHaveText('Compact Date Picker');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggleDatePicker'))).toExist();\",\n      \"creationTime\": 1748233334925\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toHaveText('Compact Date Picker');\\\",\\\"error\\\":\\\"Test Failed: Failed expectation: TOHAVETEXT(text == “Compact Date Picker”) WITH MATCHER(id == “toggleDatePicker”)\\\\n\\\\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggleDatePicker'))).toExist();\",\n      \"creationTime\": 1748233344115\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('toggleDatePicker')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\",\n      \"creationTime\": 1748233350321\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Inline Date Picker\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('toggleDatePicker')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\nawait expect(element(by.id('toggleDatePicker'))).toHaveText('Inline Date Picker');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggleDatePicker'))).toExist();\",\n      \"creationTime\": 1748233360164\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with the text \\\\\\\"Inline Date Picker\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('toggleDatePicker')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Inline Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\\nawait expect(element(by.id('toggleDatePicker'))).toHaveText('Inline Date Picker');\\\",\\\"error\\\":\\\"Test Failed: Failed expectation: TOHAVETEXT(text == “Inline Date Picker”) WITH MATCHER(id == “toggleDatePicker”)\\\\n\\\\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\nawait expect(element(by.id('toggleDatePicker'))).toHaveLabel('Inline Date Picker');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('toggleDatePicker'))).toExist();\",\n      \"creationTime\": 1748233368480\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is an element with today`s date at the bottom of the screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('toggleDatePicker')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Inline Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\\nawait expect(element(by.id('toggleDatePicker'))).toHaveLabel('Inline Date Picker');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Verify there is an element with today's date (1) at the bottom of the screen\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_2_6'))).toBeVisible();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_2_6'))).toExist();\",\n      \"creationTime\": 1748233380506\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Set the date picker to September 9th, 2023\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the DatePicker screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_25')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\"},{\\\"step\\\":\\\"Tap the element with the text \\\\\\\"Compact Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('toggleDatePicker')).tap();\\\"},{\\\"step\\\":\\\"Verify there is an element with the text \\\\\\\"Inline Date Picker\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('toggleDatePicker'))).toBeVisible();\\\\nawait expect(element(by.id('toggleDatePicker'))).toHaveLabel('Inline Date Picker');\\\"},{\\\"step\\\":\\\"Verify there is an element with today`s date at the bottom of the screen\\\",\\\"code\\\":\\\"// Verify there is an element with today's date (1) at the bottom of the screen\\\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_2_6'))).toBeVisible();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"// Navigate from July 2023 to September 2023 (2 months forward)\\nawait element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_0_1')).tap(); // Next Month button - August\\nawait element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_0_1')).tap(); // Next Month button - September\\n\\n// Set the date to September 9th, 2023\\nawait element(by.id('datePicker')).setDatePickerDate('2023-09-09', 'yyyy-MM-dd');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('datePicker'))).toBeVisible();\\nawait expect(element(by.id('detox_temp_0_0_0_1_0_5_0_0_0_0_0_1'))).toBeVisible(); // Next Month button\",\n      \"creationTime\": 1748233391983\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/pilot/__pilot_cache__/10.pilot.visibility.test.json",
    "content": "{\n  \"{\\\"currentStep\\\":\\\"Restart the React Native state\\\",\\\"previousSteps\\\":[]}\": [\n    {\n      \"value\": {\n        \"code\": \"await device.reloadReactNative();\"\n      },\n      \"validationMatcher\": \"// No specific element validation needed for device.reloadReactNative() as it's a device-level operation\",\n      \"creationTime\": 1748233796423\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_5'))).toExist();\",\n      \"creationTime\": 1748233803578\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify there is a text element with the text \\\\\\\"Element should be half-visible\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_1'))).toHaveText('Element should be only half-visible.');\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('detox_temp_0_0_0_1_0_0_1'))).toExist();\",\n      \"creationTime\": 1748233811504\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the purple rectangle below the text that is exactly 50% visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"},{\\\"step\\\":\\\"Verify there is a text element with the text \\\\\\\"Element should be half-visible\\\\\\\"\\\",\\\"code\\\":\\\"await expect(element(by.id('detox_temp_0_0_0_1_0_0_1'))).toHaveText('Element should be only half-visible.');\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('halfVisible'))).toBeVisible(50);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('halfVisible'))).toExist();\",\n      \"creationTime\": 1748233819705\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Tap the button with the text \\\\\\\"Move That Element\\\\\\\"\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await element(by.id('moveHalfVisible')).tap();\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('moveHalfVisible'))).toExist();\",\n      \"creationTime\": 1748233850526\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the purple rectangle is exactly 25% visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"},{\\\"step\\\":\\\"Tap the button with the text \\\\\\\"Move That Element\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('moveHalfVisible')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('halfVisible'))).toBeVisible(25);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('halfVisible'))).toExist();\",\n      \"creationTime\": 1748233859363\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the purple rectangle is exactly 26% visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"},{\\\"step\\\":\\\"Tap the button with the text \\\\\\\"Move That Element\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('moveHalfVisible')).tap();\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"await expect(element(by.id('halfVisible'))).toBeVisible(26);\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('halfVisible'))).toExist();\",\n      \"creationTime\": 1748233871216\n    }\n  ],\n  \"{\\\"currentStep\\\":\\\"Verify the purple rectangle is exactly 26% visible\\\",\\\"previousSteps\\\":[{\\\"step\\\":\\\"Restart the React Native state\\\",\\\"code\\\":\\\"await device.reloadReactNative();\\\"},{\\\"step\\\":\\\"Navigate to the Visibility Expectation screen\\\",\\\"code\\\":\\\"await element(by.id('detox_temp_0_0_0_1_0_5')).tap();\\\"},{\\\"step\\\":\\\"Tap the button with the text \\\\\\\"Move That Element\\\\\\\"\\\",\\\"code\\\":\\\"await element(by.id('moveHalfVisible')).tap();\\\"},{\\\"step\\\":\\\"Verify the purple rectangle is exactly 26% visible\\\",\\\"code\\\":\\\"await expect(element(by.id('halfVisible'))).toBeVisible(26);\\\",\\\"error\\\":\\\"Test Failed: Failed expectation: TOBEVISIBLE WITH MATCHER(id == “halfVisible”), View “<RCTViewComponentView: 0x10384ade0>” is not visible: View is obscured by its window bounds and does not pass visibility percent threshold (26)\\\\n\\\\nHINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\\\"}]}\": [\n    {\n      \"value\": {\n        \"code\": \"throw new Error(\\\"The purple rectangle is not 26% visible. Based on its position (x=322, width=428 on a screen width of 430), the element extends far beyond the screen bounds and is significantly less than 26% visible.\\\");\"\n      },\n      \"validationMatcher\": \"await expect(element(by.id('halfVisible'))).toExist();\",\n      \"creationTime\": 1748233881883\n    }\n  ]\n}"
  },
  {
    "path": "detox/test/e2e/setup.js",
    "content": "const { device } = require('detox');\nrequire('./utils/custom-describes');\n\nbeforeAll(async () => {\n  await device.selectApp('example');\n  await device.launchApp();\n});\n"
  },
  {
    "path": "detox/test/e2e/testEnvironment.js",
    "content": "const { DetoxCircusEnvironment } = require('detox/runners/jest');\nconst { worker } = require('detox/internals')\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  async setup() {\n    await super.setup();\n\n    this.global.__waitUntilArtifactsManagerIsIdle__ = () => {\n      return worker._artifactsManager._idlePromise;\n    };\n  }\n}\n\nprocess.on('unhandledRejection', (reason, p) => {\n  console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);\n});\n\nmodule.exports = CustomDetoxEnvironment;\n"
  },
  {
    "path": "detox/test/e2e/utils/WixPromptHandler.js",
    "content": "const axios = require('axios');\nconst fs = require('fs').promises;\n\n/**\n * @type {Detox.PromptHandler}\n */\nclass WixPromptHandler {\n  async uploadImage(imagePath) {\n    const image = await fs.readFile(imagePath);\n\n    try {\n      const response = await axios.post('https://bo.wix.com/mobile-infra-ai-services/v1/image-upload', {\n        image,\n      });\n\n      const imageUrl = response.data.url;\n      if (!imageUrl) {\n        throw new Error('Cannot find uploaded URL, got response:', response.data);\n      }\n\n      return imageUrl;\n    } catch (error) {\n      console.error('Error while uploading image:', error);\n      throw error;\n    }\n  }\n\n  async runPrompt(prompt, image) {\n    if (!image) {\n      throw new Error('Image is required');\n    }\n\n    const imageUrl = await this.uploadImage(image);\n\n    try {\n      const response = await axios.post('https://bo.wix.com/mobile-infra-ai-services/v2/prompt', {\n        prompt,\n        model: 'SONNET_4_0',\n        ownershipTag: 'Detox OSS',\n        project: 'Detox OSS',\n        images: [imageUrl]\n      });\n\n      const generatedText = response.data.generatedTexts[0];\n      if (!generatedText) {\n        throw new Error('Failed to generate text, got response:', response.data);\n      }\n\n      return generatedText;\n    } catch (error) {\n      console.error('Error running prompt:', error);\n      throw error;\n    }\n  }\n\n  isSnapshotImageSupported() {\n    return true;\n  }\n}\n\nmodule.exports = WixPromptHandler;\n"
  },
  {
    "path": "detox/test/e2e/utils/artifactUtils.js",
    "content": "const _ = require('lodash');\nconst fs = require('fs');\nconst path = require('path');\nconst glob = require('glob');\n\nfunction getLatestArtifactsDir() {\n  if (!fs.existsSync('artifacts')) {\n    return null;\n  }\n\n  const sessionDirNames = fs.readdirSync('artifacts');\n  const sessionDirs = sessionDirNames.map(name => path.join('artifacts', name));\n  const stats = _.zipObject(sessionDirs, sessionDirs.map(dir => fs.statSync(dir)));\n\n  return _(sessionDirs)\n    .filter(dir => stats[dir].isDirectory())\n    .maxBy((dir) => stats[dir].mtime);\n}\n\nfunction assertDirExists(dirPath) {\n  if (!fs.statSync(dirPath).isDirectory()) {\n    throw new Error('Expected to find a directory at path: ' + dirPath);\n  }\n}\n\nfunction assertArtifactExists(pattern) {\n  const artifactsRootDir = getLatestArtifactsDir();\n  const matchingArtifacts = glob.sync(pattern, { cwd: artifactsRootDir });\n  if (matchingArtifacts.length === 0) {\n    throw new Error('Assertion failed.\\nFailed to find artifacts matching: ' + path.join(artifactsRootDir, pattern));\n  }\n}\n\nasync function waitUntilArtifactsManagerIsIdle() {\n  if (typeof __waitUntilArtifactsManagerIsIdle__ !== 'undefined') {\n    await __waitUntilArtifactsManagerIsIdle__();\n  } else {\n    console.warn('!!! waitUntilArtifactsManagerIsIdle NOT FOUND !!!');\n  }\n}\n\nmodule.exports = {\n  getLatestArtifactsDir,\n  assertArtifactExists,\n  assertDirExists,\n  waitUntilArtifactsManagerIsIdle,\n};\n"
  },
  {
    "path": "detox/test/e2e/utils/custom-describes.js",
    "content": "const axios = require('axios');\nconst WixPromptHandler = require(\"./WixPromptHandler\");\nconst { isRNNewArch } = require('../../../src/utils/rn-consts/rn-consts');\n\ndescribe.skipIfCI = (title, fn) => {\n  const isCI = process.env.CI === 'true';\n  return isCI ? describe.skip(title, fn) : describe(title, fn);\n};\n\ndescribe.skipIfNewArchOnIOS = (title, fn) => {\n  if (isRNNewArch && device.getPlatform() === 'ios') {\n    console.warn('Skipping tests for new architecture, as there are issues related to the new architecture.');\n    return describe.skip(title, fn);\n  }\n  return describe(title, fn);\n};\n\ndescribe.forPilot = (description, fn) => {\n  return describe.skipIfCI(':ios: Pilot', () => {\n    describe(description, () => {\n      beforeAll(async () => {\n        if (!await _checkVpnStatus()) {\n          console.warn('Cannot access the LLM service without Wix BO environment. Relying on cached responses only.');\n        }\n        try {\n          await pilot.init(new WixPromptHandler());\n        } catch (error) {\n          if (error.message.includes('Pilot has already been initialized')) {\n            // Ignore already initialized error\n          } else {\n            throw error;\n          }\n        }\n      });\n\n      fn();\n    });\n  });\n};\n\nconst _checkVpnStatus = async () => {\n  try {\n    const response = await axios.get('https://bo.wix.com/_serverless/expert-toolkit/checkVpn');\n    return response.data.enabled === true;\n  } catch (error) {\n    console.error('Error checking VPN status:', error.message);\n    return false;\n  }\n};\n"
  },
  {
    "path": "detox/test/e2e/utils/custom-expects.js",
    "content": "async function expectToThrow(testBlock, withMessage) {\n\n  try {\n    await testBlock();\n  } catch (e) {\n    if (withMessage && !e.message.includes(withMessage)) {\n      throw new Error(`Caught an expected error but message was different:\\nExpected: ${withMessage}\\nReceived: ${e.message}`)\n    }\n\n    const [firstLine] = e.message.split('\\n', 1);\n    console.log('Caught an expected error:', firstLine);\n    return e;\n  }\n\n  throw new Error('Expected an error but nothing was thrown');\n}\n\nmodule.exports = {\n  expectToThrow,\n};\n"
  },
  {
    "path": "detox/test/e2e/utils/deviceInfo.js",
    "content": "/**\n * Utility to get device OS version information\n */\n\nlet cachedIOSVersion = null;\n\n/**\n * Gets the iOS major version number\n * @returns {Promise<number|null>} The iOS major version (e.g., 17, 18, 26) or null if not iOS\n */\nasync function getIOSMajorVersion() {\n  if (cachedIOSVersion !== null) {\n    return cachedIOSVersion;\n  }\n\n  try {\n    const { device: deviceHandle } = require('detox');\n    if (deviceHandle && deviceHandle.getPlatform && deviceHandle.getPlatform() !== 'ios') {\n      cachedIOSVersion = null;\n      return null;\n    }\n\n    if (deviceHandle && deviceHandle._device && deviceHandle._device.deviceConfig) {\n      const osVersion = deviceHandle._device.deviceConfig.device?.os;\n      if (osVersion) {\n        const majorVersion = parseInt(osVersion.split('.')[0], 10);\n        cachedIOSVersion = majorVersion;\n        return majorVersion;\n      }\n    }\n  } catch (e) {\n    console.warn('Could not determine iOS version, assuming iOS 18+');\n  }\n\n  cachedIOSVersion = 18;\n  return cachedIOSVersion;\n}\n\n/**\n * Checks if iOS version is 18 or higher\n * @returns {Promise<boolean>}\n */\nasync function isIOS18OrHigher() {\n  const majorVersion = await getIOSMajorVersion();\n  if (majorVersion === null) {\n    return false;\n  }\n  return majorVersion >= 18;\n}\n\nmodule.exports = {\n  getIOSMajorVersion,\n  isIOS18OrHigher,\n};\n\n\n"
  },
  {
    "path": "detox/test/e2e/utils/log-interceptor.js",
    "content": "class LogInterceptor {\n  constructor() {\n    this._stderrWrite = null;\n    this._stderrData = [];\n  }\n\n  startStderr() {\n    this._stderrWrite = process.stderr.write.bind(process.stderr);\n    process.stderr.write = (...args) => {\n      const [data] = args;\n      this._stderrData.push(data);\n\n      this._stderrWrite(...args);\n    };\n  }\n\n  get strerrData() {\n    return this._stderrData.join('');\n  }\n\n  stopAll() {\n    if (this._stderrWrite) {\n      process.stderr.write = this._stderrWrite;\n      this._stderrWrite = null;\n    }\n  }\n}\n\nmodule.exports = LogInterceptor;\n"
  },
  {
    "path": "detox/test/e2e/utils/notifications.js",
    "content": "const userNotificationPushTrigger = {\n  \"trigger\": {\n    \"type\": \"push\"\n  },\n  \"title\": \"From push\",\n  \"subtitle\": \"Subtitle\",\n  \"body\": \"Body\",\n  \"badge\": 1,\n  \"payload\": {\n    \"key1\": \"value1\",\n    \"key2\": \"value2\"\n  },\n  \"category\": \"com.example.category\",\n  \"content-available\": 0,\n  \"action-identifier\": \"default\"\n};\n\nconst userNotificationCalendarTrigger = {\n  \"trigger\": {\n    \"type\": \"calendar\",\n    \"date-components\": {\n      \"era\": 1,\n      \"year\": 2017,\n      \"month\": 1,\n      \"day\": 1,\n      \"hour\": 0,\n      \"minute\": 0,\n      \"second\": 0,\n      \"weekday\": 0,\n      \"weekdayOrdinal\": 0,\n      \"quarter\": 1,\n      \"weekOfMonth\": 1,\n      \"weekOfYear\": 1,\n      \"leapMonth\": false\n    },\n    \"repeats\": true\n  },\n  \"title\": \"From calendar\",\n  \"subtitle\": \"Subtitle\",\n  \"body\": \"From calendar\",\n  \"badge\": 1,\n  \"payload\": {\n    \"key1\": \"value1\",\n    \"key2\": \"value2\"\n  },\n  \"category\": \"com.example.category\",\n  \"user-text\": \"Hi there!\",\n  \"content-available\": 0,\n  \"action-identifier\": \"default\"\n};\n\nmodule.exports = {\n  userNotificationPushTrigger,\n  userNotificationCalendarTrigger,\n};\n"
  },
  {
    "path": "detox/test/e2e/utils/rnSkipper.js",
    "content": "const { isRNNewArch, rnVersion } = require('../../../src/utils/rn-consts/rn-consts');\n\n/** @type {import('jest-environment-emit').EnvironmentListenerFn} */\nconst listener = ({ testEvents }) => {\n  const shouldSkip = (name) => {\n    if (isRNNewArch && name.includes('@legacy')) {\n      return true;\n    }\n\n    if (!isRNNewArch && name.includes('@new-arch')) {\n      return true;\n    }\n\n    const match = name.match(/@rn(\\d+)/i);\n    return match && match[1] !== rnVersion.minor;\n  };\n\n  testEvents\n  .on('start_describe_definition', ({ event: { blockName }, state: { currentDescribeBlock }}) => {\n    if (shouldSkip(blockName)) {\n      currentDescribeBlock.mode = 'skip';\n    }\n  })\n  .on('add_test', ({ event: { testName }, state: { currentDescribeBlock }}) => {\n    if (shouldSkip(testName)) {\n      const lastTestIndex = currentDescribeBlock.children.length - 1;\n      currentDescribeBlock.children[lastTestIndex].mode = 'skip';\n    }\n  });\n};\n\nmodule.exports = listener;\n"
  },
  {
    "path": "detox/test/e2e/utils/sleep.js",
    "content": "module.exports = (ms) =>\n  new Promise((resolve) => setTimeout(resolve, ms));\n"
  },
  {
    "path": "detox/test/e2e/utils/snapshot.js",
    "content": "const fs = require('fs-extra');\nconst { ssim } = require('ssim.js');\nconst { PNG } = require('pngjs');\nconst { isRNNewArch, rnVersion } = require('../../../src/utils/rn-consts/rn-consts');\n\nconst rnMinorVer = rnVersion.minor;\nconst jestExpect = require('expect').default;\n\n// Threshold for SSIM comparison, if two images have SSIM score below this threshold, they are considered different.\nconst SSIM_SCORE_THRESHOLD = 0.997;\n\nasync function expectElementSnapshotToMatch(elementOrDevice, snapshotName, ssimThreshold = SSIM_SCORE_THRESHOLD, androidSdk) {\n  const bitmapPath = await elementOrDevice.takeScreenshot(snapshotName);\n  const isNewArchString = isRNNewArch ? '.new-arch' : '';\n  const androidSdkString = androidSdk ? `-sdk${androidSdk}` : '';\n  const expectedBitmapPath = `./e2e/assets/${snapshotName}.${device.getPlatform()}${androidSdkString}${isNewArchString}.png`;\n\n  if (await fs.pathExists(expectedBitmapPath) === false || process.env.UPDATE_SNAPSHOTS === 'true') {\n    await fs.copy(bitmapPath, expectedBitmapPath, { overwrite: true });\n  } else {\n    await expectSSIMToBeClose(bitmapPath, expectedBitmapPath, ssimThreshold);\n  }\n}\n\nasync function expectDeviceSnapshotToMatch(snapshotName, ssimThreshold = SSIM_SCORE_THRESHOLD, androidSdk) {\n  // Set status bar to consistent state for snapshot. Currently, doesn't work on iOS 17.\n  await device.setStatusBar({ time: '2024-03-08T09:41:00-07:00' });\n\n  await expectElementSnapshotToMatch(device, snapshotName, ssimThreshold, androidSdk);\n}\n\nasync function expectSSIMToBeClose(bitmapPath, expectedBitmapPath, ssimThreshold) {\n  const image = loadImage(bitmapPath);\n  const expectedImage = loadImage(expectedBitmapPath);\n\n  const { mssim, performance } = ssim(image, expectedImage);\n\n  if (mssim < ssimThreshold) {\n    throw new Error(\n      `Expected bitmaps at '${bitmapPath}' and '${expectedBitmapPath}' to have an SSIM score ` +\n      `of at least ${SSIM_SCORE_THRESHOLD}, but got ${mssim}. This means the snapshots are different ` +\n      `(comparison took ${performance}ms)`\n    );\n  }\n}\n\nfunction loadImage(path) {\n  const imageBuffer = fs.readFileSync(path);\n  const image = PNG.sync.read(imageBuffer);\n  return convertToSSIMFormat(image);\n}\n\nfunction convertToSSIMFormat(image) {\n  return {\n    data: new Uint8Array(image.data),\n    width: image.width,\n    height: image.height\n  };\n}\n\n// Allow numeric values to be inconsistent, as they are not consistent between environments.\nasync function expectViewHierarchySnapshotToMatch(viewHierarchy, snapshotName) {\n  // Find all occurrences of number attributes and replace with `=\"<number>\"`\n  const viewHierarchyWithNumberReplaced = viewHierarchy.replace(/[=]\"\\d+\"/g, '=\"<number>\"');\n  await expectSnapshotToMatch(viewHierarchyWithNumberReplaced, snapshotName);\n}\n\nasync function expectSnapshotToMatch(value, snapshotName, ignoreWhiteSpace = true) {\n  const isNewArchString = isRNNewArch ? '.new-arch' : '';\n  const snapshotPath = `./e2e/assets/${snapshotName}.${rnMinorVer}.${device.getPlatform()}${isNewArchString}.txt`;\n\n  function removeWhiteSpaces(str) {\n    return str.replace(/\\s/g, '');\n  }\n\n  if (await fs.pathExists(snapshotPath) === false || process.env.UPDATE_SNAPSHOTS === 'true') {\n    await fs.writeFile(snapshotPath, value, 'utf8');\n  } else {\n    const expectedValue = await fs.readFile(snapshotPath, 'utf8');\n    if (ignoreWhiteSpace) {\n      jestExpect(removeWhiteSpaces(value)).toEqual(removeWhiteSpaces(expectedValue));\n    } else {\n      jestExpect(value).toEqual(expectedValue);\n    }\n  }\n}\n\nmodule.exports = {\n  expectViewHierarchySnapshotToMatch,\n  expectSnapshotToMatch,\n  expectElementSnapshotToMatch,\n  expectDeviceSnapshotToMatch\n};\n"
  },
  {
    "path": "detox/test/e2e/utils/waitForCondition.js",
    "content": "const jestExpect = require('expect').default;\n\n\nasync function waitForCondition (func, condition, timeout = 5000) {\n  let isFulfilled = false;\n\n  const start = Date.now();\n  while (Date.now() - start < timeout) {\n    if (condition(await func())) {\n      isFulfilled = true;\n      break;\n    }\n\n    await new Promise(resolve => setTimeout(resolve, 100));\n  }\n\n  jestExpect(isFulfilled).toBe(true);\n}\n\nmodule.exports = {\n  waitForCondition\n};\n"
  },
  {
    "path": "detox/test/e2e-unhappy/early-syntax-error.test.js",
    "content": ")describe('Early syntax error', () => {\n  it('should not result into Detox hanging up', async () => {\n    // ... there could be your test ...\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e-unhappy/env-setup-timeout.test.js",
    "content": "it('should fail with timeout', () => {\n  throw new Error('You should not see this error! The environment setup should have failed with timeout');\n});\n"
  },
  {
    "path": "detox/test/e2e-unhappy/failing-device-method.test.js",
    "content": "describe('Failing device method', () => {\n  it('should fail with a correct stack trace', async () => {\n    await device.selectApp('non-existing');\n  });\n});\n"
  },
  {
    "path": "detox/test/e2e-unhappy/failing-matcher.test.js",
    "content": "describe('Error stack mangling', () => {\n  it('should fail with a correct stack trace', async () => {\n    await element(by.text('supercalifragilisticexpialidocious')).tap();\n  });\n});\n"
  },
  {
    "path": "detox/test/index.android.js",
    "content": "import {\n  AppRegistry,\n} from 'react-native';\n\nimport example from './src/app';\n\nimport registerEarlyCrashIfNeeded from './registerEarlyCrashIfNeeded';\n\nclass exampleAndroid extends example {\n  async componentDidMount() {\n    await super.componentDidMount();\n    registerEarlyCrashIfNeeded();\n  }\n}\n\nAppRegistry.registerComponent('example', () => exampleAndroid);\n"
  },
  {
    "path": "detox/test/index.ios.js",
    "content": "import { LogBox, AppRegistry } from 'react-native';\n\nimport example from './src/app';\n\nimport registerEarlyCrashIfNeeded from './registerEarlyCrashIfNeeded';\n\nclass exampleIos extends example {}\n\nregisterEarlyCrashIfNeeded();\n\nLogBox.ignoreAllLogs();\nAppRegistry.registerComponent('example', () => exampleIos);\n"
  },
  {
    "path": "detox/test/integration/__snapshots__/timeline-artifact.test.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Timeline integration test Flaky test should deterministically produce a timeline artifact 1`] = `\n[\n  {\n    \"args\": {\n      \"cwd\": \"$CWD\",\n      \"data\": {},\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"detox test -c stub --config integration/e2e/config.js -a integration_artifacts/ -R 1 flaky\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 0,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Serialized the session state at: $TMPDIR/$SESSION_ID.detox.json\",\n    \"ph\": \"i\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 1,\n  },\n  {\n    \"args\": {\n      \"env\": {},\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"name\": \"jest --config integration/e2e/config.js flaky\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 2,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"integration/e2e/flaky.test.js\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 3,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"set up environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 4,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 5,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"flaky.test.js is assigned to Stub #StubDevice#1\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 6,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"run the tests\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 7,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Flaky\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 8,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Flaky should have welcome screen\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"should have welcome screen\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 9,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Flaky: should have welcome screen\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 10,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"() => {\n    if (config.resetModules) {\n      runtime.resetModules();\n    }\n    if (config.clearMocks) {\n      runtime.clearAllMocks();\n    }\n    if (config.resetMocks) {\n      runtime.resetAllMocks();\n      if (config.fakeTimers.enableGlobally && config.fakeTimers.legacyFakeTimers) {\n        // during setup, this cannot be null (and it's fine to explode if it is)\n        environment.fakeTimers.useFakeTimers();\n      }\n    }\n    if (config.restoreMocks) {\n      runtime.restoreAllMocks();\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 11,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 12,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    await log.trace.complete('Navigate to sanity', navigateToSanity);\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 13,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Navigate to sanity\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 2,\n    \"ts\": 14,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Reloading app\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 2,\n    \"ts\": 15,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Tap on Sanity\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 2,\n    \"ts\": 16,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"I am on Sanity screen\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 2,\n    \"ts\": 17,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 2,\n    \"ts\": 18,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 19,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    try {\n      detox.trace.startSection('Asserting various texts');\n      await detox.traceCall('by.text()', async () => {\n        await expect(element(by.text('Welcome'))).toBeVisible();\n        await expect(element(by.text('Say Hello'))).toBeVisible();\n        await expect(element(by.text('Say World'))).toBeVisible();\n      });\n    } finally {\n      detox.trace.endSection('Asserting various texts');\n    }\n    if (session.testSessionIndex === 0) {\n      throw new Error(\\`I'm only here to make things interesting!\\`);\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"test_fn\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 20,\n  },\n  {\n    \"args\": {\n      \"error\": \"Error: I'm only here to make things interesting!\",\n      \"level\": 10,\n      \"success\": false,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 21,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"failed\",\n      \"timedOut\": false,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 22,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Flaky: should have welcome screen [FAIL]\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 23,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 24,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 25,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"tear down environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 26,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 27,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 28,\n  },\n  {\n    \"args\": {\n      \"code\": 1,\n      \"level\": 50,\n      \"signal\": null,\n      \"success\": false,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 29,\n  },\n  {\n    \"args\": {\n      \"level\": 50,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"name\": \"There were failing tests in the following files:\n  1. integration/e2e/flaky.test.js\n\nDetox CLI is going to restart the test runner with those files...\n\",\n    \"ph\": \"i\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 30,\n  },\n  {\n    \"args\": {\n      \"env\": {},\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"name\": \"jest --config integration/e2e/config.js $CWD/integration/e2e/flaky.test.js\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 31,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"integration/e2e/flaky.test.js\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 32,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"set up environment\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 33,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 34,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"flaky.test.js is assigned to Stub #StubDevice#2\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 35,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"run the tests\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 36,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Flaky\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 37,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Flaky should have welcome screen\",\n      \"invocations\": 2,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"should have welcome screen\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 38,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Flaky: should have welcome screen\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 39,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"() => {\n    if (config.resetModules) {\n      runtime.resetModules();\n    }\n    if (config.clearMocks) {\n      runtime.clearAllMocks();\n    }\n    if (config.resetMocks) {\n      runtime.resetAllMocks();\n      if (config.fakeTimers.enableGlobally && config.fakeTimers.legacyFakeTimers) {\n        // during setup, this cannot be null (and it's fine to explode if it is)\n        environment.fakeTimers.useFakeTimers();\n      }\n    }\n    if (config.restoreMocks) {\n      runtime.restoreAllMocks();\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 40,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 41,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    await log.trace.complete('Navigate to sanity', navigateToSanity);\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 42,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Navigate to sanity\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 4,\n    \"ts\": 43,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Reloading app\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 4,\n    \"ts\": 44,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"Tap on Sanity\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 4,\n    \"ts\": 45,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"name\": \"I am on Sanity screen\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 4,\n    \"ts\": 46,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"user,lifecycle\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 4,\n    \"ts\": 47,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 48,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    try {\n      detox.trace.startSection('Asserting various texts');\n      await detox.traceCall('by.text()', async () => {\n        await expect(element(by.text('Welcome'))).toBeVisible();\n        await expect(element(by.text('Say Hello'))).toBeVisible();\n        await expect(element(by.text('Say World'))).toBeVisible();\n      });\n    } finally {\n      detox.trace.endSection('Asserting various texts');\n    }\n    if (session.testSessionIndex === 0) {\n      throw new Error(\\`I'm only here to make things interesting!\\`);\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"test_fn\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 49,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 50,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"passed\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 51,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Flaky: should have welcome screen [OK]\",\n    \"ph\": \"i\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 52,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 53,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 54,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"tear down environment\",\n    \"ph\": \"B\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 55,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 56,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 2,\n    \"tid\": 3,\n    \"ts\": 57,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 58,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 59,\n  },\n]\n`;\n\nexports[`Timeline integration test Focused test should deterministically produce a timeline artifact 1`] = `\n[\n  {\n    \"args\": {\n      \"cwd\": \"$CWD\",\n      \"data\": {},\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"detox test -c stub --config integration/e2e/config.js -a integration_artifacts/ -R 1 focused\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 0,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Serialized the session state at: $TMPDIR/$SESSION_ID.detox.json\",\n    \"ph\": \"i\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 1,\n  },\n  {\n    \"args\": {\n      \"env\": {},\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"name\": \"jest --config integration/e2e/config.js focused\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 2,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"integration/e2e/focused.test.js\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 3,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"set up environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 4,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 5,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"focused.test.js is assigned to Stub #StubDevice#1\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 6,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"run the tests\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 7,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Focused\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 8,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Focused Only test\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Only test\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 9,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Focused: Only test\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 10,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"() => {\n    if (config.resetModules) {\n      runtime.resetModules();\n    }\n    if (config.clearMocks) {\n      runtime.clearAllMocks();\n    }\n    if (config.resetMocks) {\n      runtime.resetAllMocks();\n      if (config.fakeTimers.enableGlobally && config.fakeTimers.legacyFakeTimers) {\n        // during setup, this cannot be null (and it's fine to explode if it is)\n        environment.fakeTimers.useFakeTimers();\n      }\n    }\n    if (config.restoreMocks) {\n      runtime.restoreAllMocks();\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 11,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 12,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    // Checking that skipped tests are also traced\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"test_fn\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 13,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 14,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"passed\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 15,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Focused: Only test [OK]\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 16,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Focused Skipped test\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Skipped test\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 17,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Focused: Skipped test\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 18,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"skip\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 19,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Focused: Skipped test [SKIPPED]\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 20,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    // Reproducing when hook_start is called after test_start\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"afterAll\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 21,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 22,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 23,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 24,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"tear down environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 25,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 26,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 27,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 28,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 29,\n  },\n]\n`;\n\nexports[`Timeline integration test Skipped test should deterministically produce a timeline artifact 1`] = `\n[\n  {\n    \"args\": {\n      \"cwd\": \"$CWD\",\n      \"data\": {},\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"detox test -c stub --config integration/e2e/config.js -a integration_artifacts/ -R 1 skipped\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 0,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Serialized the session state at: $TMPDIR/$SESSION_ID.detox.json\",\n    \"ph\": \"i\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 1,\n  },\n  {\n    \"args\": {\n      \"env\": {},\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"name\": \"jest --config integration/e2e/config.js skipped\",\n    \"ph\": \"B\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 2,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"integration/e2e/passing-skipped.test.js\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 3,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"set up environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 4,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 5,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"passing-skipped.test.js is assigned to Stub #StubDevice#1\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 6,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"run the tests\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 7,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Suite with skipped tests\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 8,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Suite with skipped tests Skipped test\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Skipped test\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 9,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Suite with skipped tests: Skipped test\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 10,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"skip\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 11,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Suite with skipped tests: Skipped test [SKIPPED]\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 12,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Suite with skipped tests Regular test\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Regular test\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 13,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Suite with skipped tests: Regular test\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 14,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"() => {\n    if (config.resetModules) {\n      runtime.resetModules();\n    }\n    if (config.clearMocks) {\n      runtime.clearAllMocks();\n    }\n    if (config.resetMocks) {\n      runtime.resetAllMocks();\n      if (config.fakeTimers.enableGlobally && config.fakeTimers.legacyFakeTimers) {\n        // during setup, this cannot be null (and it's fine to explode if it is)\n        environment.fakeTimers.useFakeTimers();\n      }\n    }\n    if (config.restoreMocks) {\n      runtime.restoreAllMocks();\n    }\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"beforeEach\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 15,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 16,\n  },\n  {\n    \"args\": {\n      \"functionCode\": \"async () => {\n    // should be traced as usual\n  }\",\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"test_fn\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 17,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 18,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"passed\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 19,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Suite with skipped tests: Regular test [OK]\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 20,\n  },\n  {\n    \"args\": {\n      \"context\": \"test\",\n      \"fullName\": \"Suite with skipped tests Check that todo tests are also traced\",\n      \"invocations\": 1,\n      \"level\": 10,\n      \"status\": \"running\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"Check that todo tests are also traced\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 21,\n  },\n  {\n    \"args\": {\n      \"level\": 30,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"name\": \"Suite with skipped tests: Check that todo tests are also traced\",\n    \"ph\": \"i\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 22,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"status\": \"todo\",\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 23,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 24,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 25,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"name\": \"tear down environment\",\n    \"ph\": \"B\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 26,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 27,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,jest-environment\",\n    \"ph\": \"E\",\n    \"pid\": 1,\n    \"tid\": 1,\n    \"ts\": 28,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"success\": true,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle,cli\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 29,\n  },\n  {\n    \"args\": {\n      \"level\": 10,\n      \"v\": 0,\n    },\n    \"cat\": \"lifecycle\",\n    \"ph\": \"E\",\n    \"pid\": 0,\n    \"tid\": 0,\n    \"ts\": 30,\n  },\n]\n`;\n"
  },
  {
    "path": "detox/test/integration/bail-test.test.js",
    "content": "const _ = require('lodash');\nconst execa = require('execa');\n\ndescribe('jest --bail tests', () => {\n  test.each([\n    `detox test -c stub --config integration/e2e/config.js --bail --maxWorkers 2 --retries 1 flaky passing-simple`,\n    `cross-env DETOX_CONFIGURATION=stub jest --config integration/e2e/config.js --bail --runInBand passing-simple`,\n  ])('should pass: %s', async (cmd) => {\n    console.log(`Running: ${cmd}`);\n    const handle = execa.commandSync(cmd, { stdio: 'inherit', shell: true });\n    expect(handle.exitCode).toBe(0);\n  });\n\n  test.each([\n    `detox test -c stub --config integration/e2e/config.js --bail --runInBand --retries 0 flaky passing-simple`,\n    `cross-env DETOX_CONFIGURATION=stub jest --config integration/e2e/config.js --maxWorkers 4 flaky passing`,\n  ])('should fail: %s', async (cmd) => {\n    console.log(`Running: ${cmd}`);\n    const handle = _.attempt(() => execa.commandSync(cmd, { stdio: 'inherit', shell: true }));\n    expect(handle.exitCode).not.toBe(0);\n  });\n});\n"
  },
  {
    "path": "detox/test/integration/e2e/config.js",
    "content": "module.exports = {\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  reporters: [\n    'detox/runners/jest/reporter',\n    '<rootDir>/custom-reporter.js',\n  ],\n  testMatch: ['<rootDir>/*.test.js'],\n  testTimeout: 120000,\n  verbose: true,\n};\n"
  },
  {
    "path": "detox/test/integration/e2e/custom-reporter.js",
    "content": "const { tracing } = require('detox/internals');\n\nclass CustomReporter {\n  async onRunComplete() {\n    let counts = {};\n    await new Promise((resolve, reject) => {\n      tracing.createEventStream()\n        .on('error', reject)\n        .on('end', resolve)\n        .on('data', function (e) {\n          counts[e.ph] = (counts[e.ph] || 0) + 1;\n        });\n    });\n\n    const totalCount = Object.values(counts).reduce((a, b) => a + b, 0);\n    console.log(`Collected ${totalCount} trace events during the test run:\\n`, JSON.stringify(counts));\n  }\n}\n\nmodule.exports = CustomReporter;\n"
  },
  {
    "path": "detox/test/integration/e2e/flaky.test.js",
    "content": "const { session } = require('detox/internals');\nconst log = detox.log.child({ cat: 'lifecycle' });\n\ndescribe('Flaky', () => {\n  beforeEach(async () => {\n    await log.trace.complete('Navigate to sanity', navigateToSanity);\n  });\n\n  it('should have welcome screen', async () => {\n    try {\n      detox.trace.startSection('Asserting various texts');\n      await detox.traceCall('by.text()', async () => {\n        await expect(element(by.text('Welcome'))).toBeVisible();\n        await expect(element(by.text('Say Hello'))).toBeVisible();\n        await expect(element(by.text('Say World'))).toBeVisible();\n      });\n    } finally {\n      detox.trace.endSection('Asserting various texts');\n    }\n\n    if (session.testSessionIndex === 0) {\n      throw new Error(`I'm only here to make things interesting!`);\n    }\n  });\n\n  async function navigateToSanity() {\n    log.trace('Reloading app');\n    await device.reloadReactNative();\n    log.trace('Tap on Sanity');\n    await element(by.text('Sanity')).tap();\n    log.trace('I am on Sanity screen');\n  }\n});\n"
  },
  {
    "path": "detox/test/integration/e2e/focused.test.js",
    "content": "describe('Focused', () => {\n  afterAll(async () => {\n    // Reproducing when hook_start is called after test_start\n  });\n\n  // eslint-disable-next-line jest/no-focused-tests\n  it.only('Only test', async () => {\n    // Checking that skipped tests are also traced\n  });\n\n  it('Skipped test', async () => {\n    // Causes issue in the previous implementation\n  });\n});\n"
  },
  {
    "path": "detox/test/integration/e2e/passing-sandbox.test.js",
    "content": "const { config, session } = require('detox/internals');\nconst { default: expect } = require('expect');\n\ndescribe('Sandbox', () => {\n  test('detox/internals should be accessible from the sandbox', () => {\n    expect(session.testSessionIndex).toBe(0);\n    expect(config.configurationName).toBe('stub');\n  });\n});\n"
  },
  {
    "path": "detox/test/integration/e2e/passing-simple.test.js",
    "content": "describe('Stub2', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n    await element(by.text('Sanity')).tap();\n  });\n\n  it('should have welcome screen', async () => {\n    await expect(element(by.text('Welcome'))).toBeVisible();\n    await expect(element(by.text('Say Hello'))).toBeVisible();\n    await expect(element(by.text('Say World'))).toBeVisible();\n  });\n\n  it('should show hello screen after tap', async () => {\n    await element(by.text('Say Hello')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "detox/test/integration/e2e/passing-skipped.test.js",
    "content": "describe('Suite with skipped tests', () => {\n  // eslint-disable-next-line jest/no-disabled-tests\n  it.skip('Skipped test', async () => {\n    // Checking that skipped tests are also traced\n  });\n\n  it('Regular test', async () => {\n    // should be traced as usual\n  });\n\n  it.todo('Check that todo tests are also traced');\n});\n"
  },
  {
    "path": "detox/test/integration/initialization-test.test.js",
    "content": "const execa = require('execa');\n\ndescribe('Initialization (context) tests', () => {\n  test.each([\n    `cross-env DETOX_CONFIGURATION=stub node integration/utils/simplistic-runner.js`,\n\n    `detox test -c stub --config integration/e2e/config.js --runInBand --retries 1 flaky passing-simple`,\n    `cross-env DETOX_CONFIGURATION=stub jest --config integration/e2e/config.js --runInBand passing-simple`,\n\n    `detox test -c stub --config integration/e2e/config.js --maxWorkers 2 --retries 1 flaky passing-simple`,\n    `cross-env DETOX_CONFIGURATION=stub jest --config integration/e2e/config.js --maxWorkers 2 passing-simple`,\n  ])('should run: %s', async (cmd) => {\n    const handle = execa.commandSync(cmd, { stdio: 'inherit', shell: true });\n    expect(handle.exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "detox/test/integration/jest.config.js",
    "content": "process.env.CI = ''; // disable CI-specific behavior for integration tests\n\nmodule.exports = {\n  \"maxWorkers\": 1,\n  \"testMatch\": [\"<rootDir>/*.test.js\"],\n  \"testTimeout\": 120000,\n  \"verbose\": true,\n  \"bail\": false,\n};\n"
  },
  {
    "path": "detox/test/integration/stub/StubArtifactPluginsProvider.js",
    "content": "class StubArtifactPluginsProvider {\n  declareArtifactPlugins() {\n    return {};\n  }\n}\n\nmodule.exports = StubArtifactPluginsProvider;\n"
  },
  {
    "path": "detox/test/integration/stub/StubDeviceAllocationDriver.js",
    "content": "const { sleepSomeTime, sleepALittle } = require('./stubSleeps');\n\nclass StubDeviceAllocationDriver {\n  counter = 0;\n\n  async allocate() {\n    const deviceId = `StubDevice#${++this.counter}`;\n\n    await sleepSomeTime();\n    return { id: deviceId };\n  }\n\n  async free(cookie, { shutdown }) {\n    await sleepALittle();\n\n    if (shutdown) {\n      await sleepSomeTime();\n    }\n  }\n}\n\nmodule.exports = StubDeviceAllocationDriver;\n"
  },
  {
    "path": "detox/test/integration/stub/StubEnvValidator.js",
    "content": "class StubEnvValidator {\n  validate() {}\n}\n\nmodule.exports = StubEnvValidator;\n"
  },
  {
    "path": "detox/test/integration/stub/StubExpect.js",
    "content": "const temporaryPath = require('detox/src/artifacts/utils/temporaryPath');\nconst sleep = require('detox/src/utils/sleep');\n\nclass StubMatcher {\n  constructor() {\n    [\n      'withAncestor',\n      'withDescendant',\n      'and',\n      'or',\n    ].forEach((method) => {\n      this[method] = () => this;\n    });\n    this.not = this;\n  }\n}\n\nclass StubInteraction {\n  constructor({ delay = 10 } = {}) {\n    this._delay = delay;\n  }\n\n  async execute() {\n    await sleep(this._delay);\n  }\n}\n\nclass StubActionInteraction extends StubInteraction {\n  constructor() {\n    super({ delay: 100 });\n  }\n}\n\nclass StubMatcherAssertionInteraction extends StubInteraction {\n}\n\nclass StubWaitForInteraction extends StubInteraction {\n  constructor() {\n    super({ delay: 100 });\n    this.withTimeout = () => this.execute();\n    this.whileElement = () => ({\n      scroll: () => this.execute(),\n    });\n  }\n}\n\nclass StubElement {\n  constructor() {\n    const stubInteraction = new StubActionInteraction();\n    const interactionExecFn = () => stubInteraction.execute();\n\n    [\n      'tap',\n      'tapAtPoint',\n      'longPress',\n      'multiTap',\n      'tapBackspaceKey',\n      'tapReturnKey',\n      'typeText',\n      'replaceText',\n      'clearText',\n      'scroll',\n      'scrollTo',\n      'swipe',\n    ].forEach((method) => {\n        this[method] = interactionExecFn;\n    });\n    this.atIndex = () => this;\n    this.takeScreenshot = () => Promise.resolve(temporaryPath.for.png());\n  }\n}\n\nclass StubElementExpect {\n  constructor() {\n    const stubInteraction = new StubMatcherAssertionInteraction();\n    const interactionExecFn = () => stubInteraction.execute();\n\n    [\n      'toBeNotVisible',\n      'toBeVisible',\n      'toExist',\n      'toHaveId',\n      'toHaveLabel',\n      'toHaveText',\n      'toHaveToggleValue',\n      'toHaveValue',\n      'toNotExist',\n      'toNotHaveId',\n      'toNotHaveLabel',\n      'toNotHaveText',\n      'toNotHaveValue',\n    ].forEach((method) => {\n      this[method] = interactionExecFn;\n    });\n    this.not = this;\n  }\n}\n\nclass StubWaitForElement {\n  constructor() {\n    const stubInteraction = new StubWaitForInteraction();\n    const interactionExecFn = () => stubInteraction.execute();\n\n    [\n      'toBeNotVisible',\n      'toBeVisible',\n      'toExist',\n      'toHaveId',\n      'toHaveLabel',\n      'toHaveText',\n      'toHaveValue',\n      'toNotExist',\n      'toNotHaveId',\n      'toNotHaveLabel',\n      'toNotHaveText',\n      'toNotHaveValue',\n    ].forEach((method) => {\n      this[method] = interactionExecFn;\n    });\n    this.not = this;\n  }\n}\n\nclass StubExpect {\n  constructor() {\n    const stubMatcher = new StubMatcher();\n    this.by = {\n      accessibilityLabel: () => stubMatcher,\n      label: () => stubMatcher,\n      id: () => stubMatcher,\n      type: () => stubMatcher,\n      traits: () => stubMatcher,\n      value: () => stubMatcher,\n      text: () => stubMatcher,\n    };\n\n    this.element = () => new StubElement();\n    this.expect = () => new StubElementExpect();\n    this.waitFor = () => new StubWaitForElement();\n  }\n}\n\nmodule.exports = StubExpect;\n"
  },
  {
    "path": "detox/test/integration/stub/StubRuntimeDriver.js",
    "content": "const temporaryPath = require('detox/src/artifacts/utils/temporaryPath');\nconst DeviceDriverBase = require('detox/src/devices/runtime/drivers/DeviceDriverBase');\nconst tempfile = require('../../../src/utils/tempfile');\n\nconst {\n  sleepSomeTime,\n  sleepVeryLittle,\n  sleepALittle,\n  sleepALot,\n} = require('./stubSleeps');\n\nclass StubRuntimeDriver extends DeviceDriverBase {\n  /**\n   * @param deps { Object }\n   * @param deviceCookie { StubCookie }\n   */\n  constructor(deps, deviceCookie) {\n    super(deps);\n    this._deviceId = deviceCookie.id;\n  }\n\n  getExternalId() {\n    return this._deviceId;\n  }\n\n  getDeviceName() {\n    return `Stub #${this._deviceId}`;\n  }\n\n  getPlatform() {\n    return 'stub';\n  }\n\n  async installApp() {\n    await sleepALot();\n  }\n\n  async uninstallApp() {\n    await sleepALot();\n  }\n\n  async installUtilBinaries() {\n    await sleepALot();\n  }\n\n  async launchApp() {\n    return process.pid;\n  }\n\n  async deliverPayload(_params) {\n    await sleepVeryLittle();\n  }\n\n  async waitUntilReady() {\n    await sleepSomeTime();\n  }\n\n  async reloadReactNative() {\n    await sleepALittle();\n  }\n\n  createPayloadFile() {\n    return tempfile('fake_payload');\n  }\n\n  async waitForActive() {\n    await sleepALittle();\n  }\n\n  async waitForBackground() {\n    await sleepALittle();\n  }\n\n  async takeScreenshot() {\n    await sleepALittle();\n    return temporaryPath.for.png();\n  }\n\n  async sendToHome() {\n    await sleepVeryLittle();\n  }\n\n  async pressBack() {\n    await sleepSomeTime();\n  }\n\n  async terminate() {\n    await sleepSomeTime();\n  }\n\n  async resetContentAndSettings() {\n    await sleepALittle();\n  }\n}\n\nmodule.exports = StubRuntimeDriver;\n"
  },
  {
    "path": "detox/test/integration/stub/index.js",
    "content": "module.exports = {\n  EnvironmentValidatorClass: require('./StubEnvValidator'),\n  ArtifactPluginsProviderClass: require('./StubArtifactPluginsProvider'),\n  DeviceAllocationDriverClass: require('./StubDeviceAllocationDriver'),\n  RuntimeDriverClass: require('./StubRuntimeDriver'),\n  ExpectClass: require('./StubExpect'),\n};\n"
  },
  {
    "path": "detox/test/integration/stub/stubSleeps.js",
    "content": "const sleep = require('detox/src/utils/sleep');\n\nmodule.exports = {\n  sleepVeryLittle: () => sleep(10),\n  sleepALittle: () => sleep(100),\n  sleepSomeTime: () => sleep(1000),\n  sleepALot: () => sleep(2000),\n};\n"
  },
  {
    "path": "detox/test/integration/timeline-artifact.test.js",
    "content": "const path = require('path');\n\nconst _ = require('lodash');\nconst tempfile = require('../../src/utils/tempfile');\nconst fs = require('fs-extra');\nconst { promisify } = require('util');\nconst { execCommand } = require('./utils/exec');\n\nconst TMPDIR = path.dirname(tempfile());\nconst readFile = promisify(fs.readFile);\nconst remove = promisify(fs.remove);\n\ndescribe('Timeline integration test', () => {\n  const artifactsDirectory = 'integration_artifacts/'\n  const timelineArtifactFilename = 'detox.trace.json';\n  const timelineArtifactPath = path.join(artifactsDirectory, timelineArtifactFilename);\n  const clearAllArtifacts = () => remove(artifactsDirectory);\n  const readTac = async () => {\n    tac = JSON.parse(await readFile(timelineArtifactPath, 'utf8'));\n  };\n\n  let tac;\n\n  describe('Flaky test', () => {\n    beforeAll(clearAllArtifacts);\n    beforeAll(() => execCommand(`detox test -c stub --config integration/e2e/config.js -a ${artifactsDirectory} -R 1 flaky`));\n    beforeAll(readTac);\n\n    it('should deterministically produce a timeline artifact', verifyTimelineSnapshot);\n\n    it('should have balanced begin/end events', assertBalancedEvents);\n\n    it('should have a credible list of categories', async () => {\n      const cats = _.chain(tac)\n        .flatMap(e => e.cat ? `${e.cat}`.split(',', 1) : [])\n        .uniq()\n        .sort()\n        .value();\n\n      expect(cats).toEqual([\n        'artifacts-manager',\n        'device',\n        'ipc',\n        'lifecycle',\n        'user',\n        'ws-client',\n        'ws-server',\n      ]);\n    });\n\n    it('should have a credible process and thread ids', async () => {\n      const unique = _.mapValues({\n        pid: tac.map(e => e.pid),\n        tid: tac.map(e => e.tid),\n        pid_tid: tac.map(e => `${e.pid}:${e.tid}`),\n      }, v => _.uniq(v).sort());\n\n      expect(unique.pid.length).toBe(3);\n      expect(unique.tid.length).toBeLessThan(unique.pid_tid.length);\n      expect(unique.pid_tid.length).toBeGreaterThan(10);\n    });\n  });\n\n  describe('Skipped test', () => {\n    beforeAll(clearAllArtifacts);\n    beforeAll(() => execCommand(`detox test -c stub --config integration/e2e/config.js -a ${artifactsDirectory} -R 1 skipped`));\n    beforeAll(readTac);\n\n    it('should deterministically produce a timeline artifact', verifyTimelineSnapshot);\n\n    it('should have balanced begin/end events', assertBalancedEvents);\n  });\n\n  describe('Focused test', () => {\n    beforeAll(clearAllArtifacts);\n    beforeAll(() => execCommand(`detox test -c stub --config integration/e2e/config.js -a ${artifactsDirectory} -R 1 focused`));\n    beforeAll(readTac);\n\n    it('should deterministically produce a timeline artifact', verifyTimelineSnapshot);\n\n    it('should have balanced begin/end events', assertBalancedEvents);\n  });\n\n  function verifyTimelineSnapshot() {\n    const sanitizeContext = { pid: new Map(), tid: new Map(), sessionId: '', cwd: '' };\n    expect(tac.filter(isLifecycleEvent).map(sanitizeEvent.bind(sanitizeContext))).toMatchSnapshot();\n  }\n\n  function assertBalancedEvents() {\n    for (const lane of _(tac).groupBy('tid').values()) {\n      const beginCount = _.filter(lane, { ph: 'B' }).length;\n      const endCount = _.filter(lane, { ph: 'E' }).length;\n      if (beginCount !== endCount) {\n        const { tid, cat } = lane[0];\n        expect(`imbalanced begin (${beginCount}) vs end (${endCount}) events in thread ${tid} (category: ${cat})`).toBeNull();\n      }\n    }\n  }\n});\n\nfunction isLifecycleEvent(e) {\n  return `${e.cat}`.split(',').includes('lifecycle');\n}\n\n/** @this {{ pid: Map; tid: Map; sessionId: string; cwd: string; }} */\nfunction sanitizeEvent(e, ts) {\n  const r = { ...e };\n  r.args = { ...r.args };\n\n  if (ts === 0) {\n    this.sessionId = r.args.data.id;\n    this.cwd = r.args.cwd;\n    r.name = r.name.replace(/^[^ ]*/, 'detox');\n  }\n\n  r.pid = (this.pid.has(e.pid) ? this.pid : this.pid.set(e.pid, this.pid.size)).get(e.pid);\n  r.tid = (this.tid.has(e.tid) ? this.tid : this.tid.set(e.tid, this.tid.size)).get(e.tid);\n  r.ts = ts;\n\n  if (r.name) {\n    r.name = r.name\n      .replace(TMPDIR, '$TMPDIR')\n      .replace(this.sessionId, '$SESSION_ID')\n      .replace(this.cwd, '$CWD')\n      .replace(this.cwd.replace(/\\\\/g, '/'), '$CWD')\n      .replace(/\\\\/g, '/')\n      .replace(/DETOX_[A-Z_]+=\\S*\\s*/g, '');\n  }\n\n  if (r.args.cwd) {\n    r.args.cwd = '$CWD';\n  }\n\n  if (typeof r.args.error === 'string') {\n    r.args.error = r.args.error.split('\\n')[0];\n  }\n\n  if (r.args.data) {\n    r.args.data = {};\n  }\n\n  if (r.args.env) {\n    r.args.env = {};\n  }\n\n  return r;\n}\n"
  },
  {
    "path": "detox/test/integration/utils/exec.js",
    "content": "const { exec } = require('child_process');\n\nconst execCommand = async (cmd) => {\n  const cp = exec(cmd);\n  cp.stdout.pipe(process.stdout);\n  cp.stderr.pipe(process.stderr);\n  return new Promise((resolve) => {\n    cp.on('close', resolve);\n  });\n}\n\nmodule.exports = {\n  execCommand,\n};\n"
  },
  {
    "path": "detox/test/integration/utils/printConsole.mjs",
    "content": "import detox from 'detox/internals.js';\n\nfunction printVariousMessages() {\n  process.stdout.write('=== START OF THE TEST ===\\n\\n')\n  console.assert('foo' === 'bar', 'foo is not bar');\n  console.error('console.error', 10, { a: 1 });\n  console.warn('console.warn', 20, { b: 2 });\n  console.log('console.log', 30, { c: 3 });\n  console.info('console.info', 30, { d: 4 });\n  console.debug('console.debug', 40, { e: 5 });\n  console.trace('console.trace', 50, { f: 6 });\n\n  console.log('formatDecimal(%d)', 42);\n\n  const metadata = { error: new Error('Sample error') };\n  console.log(metadata, 'An error was caught.');\n  console.log('An error was caught:', metadata);\n  process.stdout.write('\\n=== END OF THE TEST ===\\n\\n')\n}\n\nasync function testPlain() {\n  printVariousMessages();\n}\n\nasync function testWithDetox(loglevel) {\n  try {\n    await detox.init({\n      workerId: null,\n      override: {\n        selectedConfiguration: 'stub',\n        logger: {\n          level: loglevel,\n          overrideConsole: true,\n        },\n      },\n    });\n    printVariousMessages();\n  } finally {\n    await detox.cleanup();\n  }\n}\n\nasync function main(argv) {\n  switch (argv[2]) {\n    case 'trace': return await testWithDetox('trace');\n    case 'debug': return await testWithDetox('debug');\n    case 'info': return await testWithDetox('info');\n    default: return await testPlain();\n  }\n}\n\nawait main(process.argv);\n"
  },
  {
    "path": "detox/test/integration/utils/simplistic-runner.js",
    "content": "const detox = require('detox/internals');\nconst log = detox.log.child({ cat: ['lifecycle'] });\n\nasync function main() {\n  try {\n    await detox.init();\n    await test1();\n    await test2();\n  } finally {\n    await detox.cleanup();\n  }\n}\n\nasync function test1() {\n  log.info('Test 1');\n  await device.launchApp();\n}\n\nasync function test2() {\n  log.info('Test 2');\n  await device.terminateApp();\n}\n\nmain().catch((e) => {\n  console.error(e);\n  process.exit(1);\n});\n"
  },
  {
    "path": "detox/test/ios/.xcode.env",
    "content": "# This `.xcode.env` file is versioned and is used to source the environment\n# used when running script phases inside Xcode.\n# To customize your local environment, you can create an `.xcode.env.local`\n# file that is not versioned.\n\n# NODE_BINARY variable contains the PATH to the node executable.\n#\n# Customize the NODE_BINARY variable here.\n# For example, to use nvm with brew, add the following line\n# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\nexport NODE_BINARY=$(command -v node)\n"
  },
  {
    "path": "detox/test/ios/AppDelegate Extensions/AppDelegate+OverlayView.swift",
    "content": "//\n//  AppDelegate+OverlayView.swift (example)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport UIKit\nimport React\n\n@objc extension AppDelegate {\n    private var overlayStackView: UIStackView? {\n        return window.rootViewController?.view.subviews\n            .compactMap { $0 as? UIStackView }\n            .first { $0.accessibilityIdentifier == \"overlayStackView\" }\n    }\n\n    private func getTargetView(from rootView: UIView) -> UIView {\n        if let contentView = rootView.value(forKey: \"contentView\") as? UIView {\n            return contentView\n        }\n        return rootView\n    }\n\n    private func createOverlayStackView(in view: UIView) -> UIStackView {\n        let stackView = UIStackView()\n        stackView.axis = .vertical\n        stackView.distribution = .fillEqually\n        stackView.spacing = 8\n        stackView.translatesAutoresizingMaskIntoConstraints = false\n        stackView.accessibilityIdentifier = \"overlayStackView\"\n\n        stackView.layoutMargins = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)\n        stackView.isLayoutMarginsRelativeArrangement = true\n\n        view.addSubview(stackView)\n\n        NSLayoutConstraint.activate([\n            stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor),\n            stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor),\n            stackView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),\n        ])\n\n        return stackView\n    }\n\n    @objc public func showOverlayMessageWithMessage(_ message: String) {\n        DispatchQueue.main.async {\n            guard let rootView = self.window.rootViewController?.view else { return }\n\n            let targetView = self.getTargetView(from: rootView)\n            let stackView = self.overlayStackView ?? self.createOverlayStackView(in: targetView)\n\n            stackView.layer.zPosition = 999\n\n            if let existingMessageView = self.findExistingMessageView(withMessage: message, in: stackView) {\n                existingMessageView.resetTimer()\n            } else {\n                let messageView = OverlayMessageView(message: message)\n                stackView.addArrangedSubview(messageView)\n\n                // Optional: Remove older messages if we have too many\n                if stackView.arrangedSubviews.count > 3 {\n                    stackView.arrangedSubviews.first?.removeFromSuperview()\n                }\n            }\n\n            targetView.bringSubviewToFront(stackView)\n        }\n    }\n\n    private func findExistingMessageView(withMessage message: String, in stackView: UIStackView) -> OverlayMessageView? {\n        return stackView.arrangedSubviews.compactMap { $0 as? OverlayMessageView }\n            .first { $0.message == message }\n    }\n}\n"
  },
  {
    "path": "detox/test/ios/AppDelegate.h",
    "content": "#import <UIKit/UIKit.h>\n#import \"ReactNativeVersionExtracted.h\"\n\n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR < 79\n#if __has_include(<React-RCTAppDelegate/RCTAppDelegate.h>)\n#import <React-RCTAppDelegate/RCTAppDelegate.h>\n#elif __has_include(<React_RCTAppDelegate/RCTAppDelegate.h>)\n#import <React_RCTAppDelegate/RCTAppDelegate.h>\n#endif\n#else\n#import <React/RCTBridge.h>\n#import <React-RCTAppDelegate/RCTReactNativeFactory.h>\n#endif\n\n@class ReactNativeDelegate;\n\nNS_ASSUME_NONNULL_BEGIN\n\nNS_SWIFT_NAME(AppDelegate)\n\n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR < 79\n@interface AppDelegate : RCTAppDelegate\n#else\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n#endif\n\n@property (nonatomic, strong) id screenManager;\n\n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR >= 79\n@property (nonatomic, strong) UIWindow *window;\n@property (nonatomic, strong) ReactNativeDelegate *reactNativeDelegate;\n@property (nonatomic, strong) RCTReactNativeFactory *reactNativeFactory;\n#endif\n\n- (void)showOverlayMessageWithMessage:(NSString *)message;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/test/ios/AppDelegate.m",
    "content": "#import \"AppDelegate.h\"\n\n#import <CoreSpotlight/CoreSpotlight.h>\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTLinkingManager.h>\n#import <UserNotifications/UserNotifications.h>\n#import \"example-Swift.h\"\n#if __has_include(<ReactAppDependencyProvider/RCTAppDependencyProvider.h>)\n#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>\n#endif\n\n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR >= 79\n#import <React-RCTAppDelegate/RCTDefaultReactNativeFactoryDelegate.h>\n\n@interface ReactNativeDelegate : RCTDefaultReactNativeFactoryDelegate\n@end\n\n@implementation ReactNativeDelegate\n- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {\n    return [self bundleURL];\n}\n\n- (NSURL *) bundleURL {\n#if DEBUG\n    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n#else\n    return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n#endif\n}\n@end\n#endif\n\n@interface AppDelegate () <UNUserNotificationCenterDelegate> {\n    BOOL demoShowActiveNotification;\n}\n@end\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n    demoShowActiveNotification = [[NSUserDefaults standardUserDefaults] boolForKey:@\"demoShowActiveNotification\"];\n    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@\"demoShowActiveNotification\"];\n    \n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR >= 79\n    self.reactNativeDelegate = [ReactNativeDelegate new];\n    self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self.reactNativeDelegate];\n    self.reactNativeDelegate.dependencyProvider = [RCTAppDependencyProvider new];\n\n    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n    [self.reactNativeFactory startReactNativeWithModuleName:@\"example\"\n                                                   inWindow:self.window\n                                             launchOptions:launchOptions];    \n#else\n    self.moduleName = @\"example\";\n    #if __has_include(<ReactAppDependencyProvider/RCTAppDependencyProvider.h>)\n    // Only in RN 77 and higher\n    self.dependencyProvider = [RCTAppDependencyProvider new];\n    #endif\n    self.initialProps = @{};\n\n    BOOL result = [super application:application didFinishLaunchingWithOptions:launchOptions];\n#endif\n    \n    // Your custom setup\n    [self setupNotifications];\n    [self setupScreenManager];\n    [self setupApplicationStateObservers];\n    [UIViewController swizzleMotionEnded];\n\n    return YES;\n}\n\n#if REACT_NATIVE_VERSION_MAJOR == 0 && REACT_NATIVE_VERSION_MINOR < 79\n- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n{\n    return [self bundleURL];\n}\n\n- (NSURL *)bundleURL\n{\n#if DEBUG\n    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n#else\n    return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n#endif\n}\n#endif\n\n#pragma mark - Setup Methods\n\n- (void)setupNotifications {\n    UNUserNotificationCenter.currentNotificationCenter.delegate = self;\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(handleChangeScreen:)\n                                                 name:@\"ChangeScreen\"\n                                               object:nil];\n}\n\n- (void)setupScreenManager {\n    self.screenManager = [[NativeScreenManager alloc] initWithWindow:self.window];\n}\n\n- (void)setupApplicationStateObservers {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(applicationDidBecomeActive:)\n                                                 name:UIApplicationDidBecomeActiveNotification\n                                               object:nil];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(applicationWillResignActive:)\n                                                 name:UIApplicationWillResignActiveNotification\n                                               object:nil];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(applicationDidEnterBackground:)\n                                                 name:UIApplicationDidEnterBackgroundNotification\n                                               object:nil];\n}\n\n#pragma mark - Notification Handlers\n\n- (void)handleChangeScreen:(NSNotification *)notification {\n    [self.screenManager handle:notification];\n}\n\n- (void)applicationDidBecomeActive:(NSNotification *)notification {\n    if (demoShowActiveNotification) {\n        [self showOverlayMessageWithMessage:@\"Active\"];\n    }\n}\n\n- (void)applicationWillResignActive:(NSNotification *)notification {\n    [self showOverlayMessageWithMessage:@\"Inactive\"];\n}\n\n- (void)applicationDidEnterBackground:(NSNotification *)notification {\n    [self showOverlayMessageWithMessage:@\"Background\"];\n}\n\n#pragma mark - UNUserNotificationCenterDelegate\n\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center\n       willPresentNotification:(UNNotification *)notification\n         withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {\n    [self showOverlayMessageWithMessage:notification.request.content.title];\n\n    completionHandler(UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner |\n                      UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound);\n}\n\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center\ndidReceiveNotificationResponse:(UNNotificationResponse *)response\n         withCompletionHandler:(void(^)(void))completionHandler {\n    [self showOverlayMessageWithMessage:response.notification.request.content.title];\n\n    completionHandler();\n}\n\n#pragma mark - Deep Linking\n\n- (BOOL)application:(UIApplication *)app\n            openURL:(NSURL *)url\n            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {\n    return [RCTLinkingManager application:app openURL:url options:options];\n}\n\n- (BOOL)application:(UIApplication *)application\ncontinueUserActivity:(NSUserActivity *)userActivity\n restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {\n    if ([userActivity.activityType isEqualToString:CSSearchableItemActionType]) {\n        NSString *identifier = userActivity.userInfo[CSSearchableItemActivityIdentifier];\n        NSURL *url = identifier ? [NSURL URLWithString:identifier] : nil;\n\n        if (url) {\n            return [RCTLinkingManager application:application openURL:url options:@{\n                UIApplicationOpenURLOptionsSourceApplicationKey: @\"\",\n                UIApplicationOpenURLOptionsAnnotationKey: @{}\n            }];\n        }\n        return NO;\n    }\n\n    return [RCTLinkingManager application:application continueUserActivity:userActivity\n                       restorationHandler:restorationHandler];\n}\n\n#pragma mark - Overlay Message\n\n- (void)showOverlayMessageWithMessage:(NSString *)message {\n    // The Swift extension handles this method\n}\n\n@end\n"
  },
  {
    "path": "detox/test/ios/Podfile",
    "content": "if ENV['RCT_NEW_ARCH_ENABLED'] == '1'\n  puts 'React Native new arch enabled (RCT_NEW_ARCH_ENABLED = 1)'\nend\n\ndef node_require(script)\n  # Resolve script with node to allow for hoisting\n  require Pod::Executable.execute_command('node', ['-p',\n    \"require.resolve(\n      '#{script}',\n      {paths: [process.argv[1]]},\n    )\", __dir__]).strip\nend\n\nnode_require('react-native/scripts/react_native_pods.rb')\nnode_require('react-native-permissions/scripts/setup.rb')\n\nplatform :ios, min_ios_version_supported\n\ninstall! 'cocoapods', :deterministic_uuids => false\n\n# Comment unwanted permissions\nsetup_permissions([\n  'AppTrackingTransparency',\n  'Bluetooth',\n  'Calendars',\n  'Camera',\n  'Contacts',\n  'FaceID',\n  'LocationAccuracy',\n  'LocationAlways',\n  'LocationWhenInUse',\n  'MediaLibrary',\n  'Microphone',\n  'Motion',\n  'Notifications',\n  'PhotoLibrary',\n  'PhotoLibraryAddOnly',\n  'Reminders',\n  'Siri',\n  'SpeechRecognition',\n  'StoreKit',\n])\n\ndef shared_pods\n    config = use_native_modules!\n\n    use_react_native!(\n      :path => config[:reactNativePath],\n      :app_path => \"#{Pod::Config.instance.installation_root}/..\"\n    )\n\n    # Shared pods\n    pod 'react-native-slider', :path => '../node_modules/@react-native-community/slider'\nend\n\ntarget 'example' do\n  shared_pods\nend\n\ntarget 'example-ci' do\n  shared_pods\nend\n\npost_install do |installer|\n  config = use_native_modules!\n  react_native_post_install(\n    installer,\n    config[:reactNativePath],\n    :mac_catalyst_enabled => false\n  )\n\n  extract_react_native_version_constants\nend\n\n\ndef extract_react_native_version_constants\n  require 'json'\n  \n  Pod::UI.notice \"POST INSTALL\"\n  puts \"Extracting React Native version from package.json...\"\n  \n  package_json_path = \"../package.json\"\n  \n  begin\n    package_content = File.read(package_json_path)\n    package_data = JSON.parse(package_content)\n    \n    rn_version = nil\n    if package_data['dependencies'] && package_data['dependencies']['react-native']\n      rn_version = package_data['dependencies']['react-native']\n    elsif package_data['devDependencies'] && package_data['devDependencies']['react-native']\n      rn_version = package_data['devDependencies']['react-native']\n    end\n    \n    unless rn_version\n      Pod::UI.warn \"Warning: react-native not found in package.json dependencies\"\n      return\n    end\n    \n    Pod::UI.notice \"React Native version from package.json: #{rn_version}\"\n    \n    generate_rn_version_header(rn_version, package_json_path)\nend\nend\n\n\ndef generate_rn_version_header(rn_version, source_path = nil)\n  puts \" Generating React Native version header...\"\n  \n  clean_version = rn_version.gsub(/^[\\^~>=<]+/, '')\n  version_parts = clean_version.split('.')\n  \n  major = version_parts[0]&.to_i || 0\n  minor = version_parts[1]&.to_i || 0  \n  patch = version_parts[2]&.to_i || 0\n  \n  output_header = \"ReactNativeVersionExtracted.h\"\n  \n  header_content = <<~HEADER\n    //\n    // ReactNativeVersionExtracted.h\n    // React Native version constants extracted from package.json\n    // Generated on: #{Time.now}\n    // Source: #{File.expand_path(source_path)}\n    // Original version string: #{rn_version}\n    //\n    \n    #ifndef ReactNativeVersionExtracted_h\n    #define ReactNativeVersionExtracted_h\n    \n    #define REACT_NATIVE_VERSION_MAJOR #{major}\n    #define REACT_NATIVE_VERSION_MINOR #{minor}\n    #define REACT_NATIVE_VERSION_PATCH #{patch}\n    \n    #endif /* ReactNativeVersionExtracted_h */\n  HEADER\n  \n  begin\n    File.write(output_header, header_content)\n    \n    Pod::UI.notice \"Successfully generated #{output_header}\"\n    puts \" Version constants:\"\n    puts \"   #define REACT_NATIVE_VERSION_MAJOR #{major}\"\n    puts \"   #define REACT_NATIVE_VERSION_MINOR #{minor}\"\n    puts \"   #define REACT_NATIVE_VERSION_PATCH #{patch}\"\n    \n    return { major: major, minor: minor, patch: patch }\n    \n  rescue => e\n    Pod::UI.error \"❌ Error writing version header: #{e.message}\"\n    return nil\n  end\nend\n"
  },
  {
    "path": "detox/test/ios/ReactModules/NativeModule.h",
    "content": "//\n//  NativeModule.h (example)\n//  Created by Asaf Korem (Wix.com) on 2025.\n//\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTEventEmitter.h>\n#import <UIKit/UIKit.h>\n\n@interface NativeModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, strong) UIWindow *overlayWindow;\n@property (nonatomic, strong) UIView *overlayView;\n@property (nonatomic, assign) NSInteger callCounter;\n\n@end\n"
  },
  {
    "path": "detox/test/ios/ReactModules/NativeModule.m",
    "content": "//\n//  NativeModule.m (example)\n//  Created by Asaf Korem (Wix.com) on 2025.\n//\n\n#import \"NativeModule.h\"\n#import <React/RCTRootView.h>\n#import <React/RCTBridge.h>\n\n@implementation NativeModule\n\nRCT_EXPORT_MODULE();\n\n- (instancetype)init {\n    if (self = [super init]) {\n        self.callCounter = 0;\n    }\n    return self;\n}\n\n+ (BOOL)requiresMainQueueSetup {\n    return YES;\n}\n\n// MARK: - Locale Methods\nRCT_EXPORT_METHOD(getUserLocale:(RCTPromiseResolveBlock)resolve\n                  rejecter:(RCTPromiseRejectBlock)reject) {\n    NSLocale *currentLocale = [NSLocale currentLocale];\n    NSString *localeIdentifier = [currentLocale localeIdentifier];\n    resolve(localeIdentifier);\n}\n\nRCT_EXPORT_METHOD(getUserLanguage:(RCTPromiseResolveBlock)resolve\n                  rejecter:(RCTPromiseRejectBlock)reject) {\n    NSString *languageCode = [[NSLocale preferredLanguages] firstObject];\n    if (languageCode) {\n        resolve(languageCode);\n    } else {\n        NSError *error = [NSError errorWithDomain:@\"NativeModule\"\n                                             code:1\n                                         userInfo:@{NSLocalizedDescriptionKey: @\"Could not determine user language\"}];\n        reject(@\"no_language\", @\"Could not determine user language\", error);\n    }\n}\n\n// MARK: - Echo Methods\nRCT_EXPORT_METHOD(echoWithoutResponse:(NSString *)str) {\n    self.callCounter++;\n}\n\nRCT_EXPORT_METHOD(echoWithResponse:(NSString *)str \n                  resolver:(RCTPromiseResolveBlock)resolve \n                  rejecter:(RCTPromiseRejectBlock)reject) {\n    self.callCounter++;\n    resolve(str);\n}\n\n// MARK: - Timing Methods\nRCT_EXPORT_METHOD(nativeSetTimeout:(NSTimeInterval)delay \n                  block:(RCTResponseSenderBlock)block) {\n    dispatch_time_t dispatchTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC));\n    dispatch_after(dispatchTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n        dispatch_async(dispatch_get_main_queue(), ^{\n            block(@[]);\n        });\n    });\n}\n\n// MARK: - Navigation Methods\nRCT_EXPORT_METHOD(switchToNativeRoot) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        UIViewController *newRoot = [self createNativeRootViewController];\n        [self updateRootViewController:newRoot];\n    });\n}\n\nRCT_EXPORT_METHOD(switchToMultipleReactRoots) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        UITabBarController *tabController = [self createTabBarControllerWithBridge];\n        [self updateRootViewController:tabController];\n    });\n}\n\n// MARK: - Notification Methods\nRCT_EXPORT_METHOD(sendNotification:(NSString *)notification \n                  name:(NSString *)name) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        [[NSNotificationCenter defaultCenter] postNotificationName:notification\n                                                          object:nil\n                                                        userInfo:@{@\"name\": name}];\n    });\n}\n\n// MARK: - Overlay Methods\nRCT_EXPORT_METHOD(presentOverlayWindow) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        [self setupAndShowOverlayWindow];\n    });\n}\n\nRCT_EXPORT_METHOD(presentOverlayView) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        [self setupAndShowOverlayView];\n    });\n}\n\n// MARK: - Private Helper Methods\n- (UIViewController *)createNativeRootViewController {\n    UIViewController *newRoot = [[UIViewController alloc] init];\n    newRoot.view.backgroundColor = [UIColor whiteColor];\n    \n    UILabel *label = [[UILabel alloc] init];\n    label.text = @\"this is a new native root\";\n    [label sizeToFit];\n    label.center = newRoot.view.center;\n    [newRoot.view addSubview:label];\n    \n    return newRoot;\n}\n\n- (UITabBarController *)createTabBarControllerWithBridge {\n    RCTBridge *bridge = [self getCurrentBridge];\n    if (!bridge) {\n        return nil;\n    }\n    \n    NSMutableArray *viewControllers = [NSMutableArray array];\n    for (NSInteger i = 1; i <= 4; i++) {\n        UIViewController *vc = [self createReactRootViewControllerWithBridge:bridge \n                                                                     title:[NSString stringWithFormat:@\"%ld\", (long)i]];\n        [viewControllers addObject:vc];\n    }\n    \n    UITabBarController *tabController = [[UITabBarController alloc] init];\n    tabController.viewControllers = viewControllers;\n    return tabController;\n}\n\n- (UIViewController *)createReactRootViewControllerWithBridge:(RCTBridge *)bridge title:(NSString *)title {\n    UIViewController *viewController = [[UIViewController alloc] init];\n    viewController.view = [[RCTRootView alloc] initWithBridge:bridge\n                                                  moduleName:@\"example\"\n                                           initialProperties:nil];\n    viewController.tabBarItem.title = title;\n    return viewController;\n}\n\n- (RCTBridge *)getCurrentBridge {\n    id appDelegate = [[UIApplication sharedApplication] delegate];\n    if ([appDelegate respondsToSelector:@selector(window)]) {\n        UIWindow *window = [appDelegate window];\n        RCTRootView *rootView = (RCTRootView *)window.rootViewController.view;\n        if ([rootView isKindOfClass:[RCTRootView class]]) {\n            return rootView.bridge;\n        }\n    }\n    return nil;\n}\n\n- (void)updateRootViewController:(UIViewController *)viewController {\n    id appDelegate = [[UIApplication sharedApplication] delegate];\n    if ([appDelegate respondsToSelector:@selector(window)]) {\n        UIWindow *window = [appDelegate window];\n        window.rootViewController = viewController;\n        [window makeKeyAndVisible];\n    }\n}\n\n- (void)setupAndShowOverlayWindow {\n    CGRect screenBounds = [[UIScreen mainScreen] bounds];\n    self.overlayWindow = [[UIWindow alloc] initWithFrame:screenBounds];\n    self.overlayWindow.accessibilityIdentifier = @\"OverlayWindow\";\n    self.overlayWindow.windowLevel = UIWindowLevelStatusBar;\n    self.overlayWindow.hidden = NO;\n    [self.overlayWindow makeKeyAndVisible];\n}\n\n- (void)setupAndShowOverlayView {\n    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];\n    if (!keyWindow) return;\n    \n    CGRect screenBounds = [[UIScreen mainScreen] bounds];\n    self.overlayView = [[UIView alloc] initWithFrame:screenBounds];\n    self.overlayView.userInteractionEnabled = YES;\n    self.overlayView.accessibilityIdentifier = @\"OverlayView\";\n    [keyWindow addSubview:self.overlayView];\n}\n\n@end\n"
  },
  {
    "path": "detox/test/ios/ReactModules/ShakeEventEmitter.h",
    "content": "//\n//  ShakeEventEmitter.h (example)\n//  Created by Asaf Korem (Wix.com) on 2025.\n//\n\n#import <React/RCTEventEmitter.h>\n\n@interface ShakeEventEmitter : RCTEventEmitter\n\n+ (instancetype)sharedInstance;\n- (void)handleShake;\n\n@end\n"
  },
  {
    "path": "detox/test/ios/ReactModules/ShakeEventEmitter.m",
    "content": "//\n//  ShakeEventEmitter.m (example)\n//  Created by Asaf Korem (Wix.com) on 2025.\n//\n\n\n#import \"ShakeEventEmitter.h\"\n\n@implementation ShakeEventEmitter {\n    BOOL hasListeners;\n}\n\nstatic ShakeEventEmitter *sharedInstance = nil;\n\nRCT_EXPORT_MODULE();\n\n+ (instancetype)sharedInstance {\n    return sharedInstance;\n}\n\n- (instancetype)init {\n    if (self = [super init]) {\n        sharedInstance = self;\n    }\n    return self;\n}\n\n+ (BOOL)requiresMainQueueSetup {\n    return YES;\n}\n\n- (NSArray<NSString *> *)supportedEvents {\n    return @[@\"ShakeEvent\"];\n}\n\n- (void)startObserving {\n    hasListeners = YES;\n}\n\n- (void)stopObserving {\n    hasListeners = NO;\n}\n\n- (void)handleShake {\n    if (hasListeners) {\n        [self sendEventWithName:@\"ShakeEvent\" body:nil];\n    }\n}\n\n@end\n"
  },
  {
    "path": "detox/test/ios/UI/CustomKeyboardDelegate.swift",
    "content": "//\n//  CustomKeyboardDelegate.swift (example)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\n\nimport UIKit\n\nprotocol CustomKeyboardDelegate: AnyObject {\n    func customKeyboardTappedButton(_ sender: CustomKeyboardView)\n}\n\nclass CustomKeyboardView: UIView {\n    weak var delegate: CustomKeyboardDelegate?\n    \n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        loadView()\n    }\n    \n    required init?(coder: NSCoder) {\n        super.init(coder: coder)\n        loadView()\n    }\n    \n    func loadView() {\n        let kbButton = UIButton(type: .custom)\n        kbButton.translatesAutoresizingMaskIntoConstraints = false\n        kbButton.setTitle(\"Hello\", for: .normal)\n        kbButton.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)\n        kbButton.accessibilityIdentifier = \"keyboardHelloButton\"\n        \n        addSubview(kbButton)\n        \n        NSLayoutConstraint.activate([\n            kbButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 44),\n            kbButton.heightAnchor.constraint(equalToConstant: 44),\n            kbButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 20),\n            kbButton.topAnchor.constraint(equalTo: topAnchor, constant: 20)\n        ])\n    }\n    \n    @objc private func buttonTapped(_ sender: Any) {\n        delegate?.customKeyboardTappedButton(self)\n    }\n}\n\nclass CustomKeyboardViewController: UIViewController {\n    private var textField: UITextField!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        view.backgroundColor = .systemBackground\n        \n        let closeButton = UIButton(type: .system)\n        closeButton.setImage(UIImage(systemName: \"xmark.circle.fill\"), for: .normal)\n        closeButton.translatesAutoresizingMaskIntoConstraints = false\n        closeButton.accessibilityIdentifier = \"closeButton\"\n        closeButton.addTarget(self, action: #selector(close), for: .primaryActionTriggered)\n        \n        let inputView = CustomKeyboardView()\n        inputView.translatesAutoresizingMaskIntoConstraints = false\n        inputView.delegate = self\n        inputView.backgroundColor = .lightGray\n        \n        let text = UITextField()\n        text.translatesAutoresizingMaskIntoConstraints = false\n        text.inputView = inputView\n        text.borderStyle = .roundedRect\n        text.accessibilityIdentifier = \"textWithCustomInput\"\n        \n        let obscuredLabel = UILabel()\n        obscuredLabel.translatesAutoresizingMaskIntoConstraints = false\n        obscuredLabel.text = \"Obscured by keyboard\"\n        \n        textField = text\n        \n        view.addSubview(closeButton)\n        view.addSubview(text)\n        view.addSubview(obscuredLabel)\n        \n        NSLayoutConstraint.activate([\n            text.heightAnchor.constraint(equalToConstant: 50),\n            text.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20),\n            view.safeAreaLayoutGuide.trailingAnchor.constraint(equalTo: text.trailingAnchor, constant: 20),\n            text.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 50),\n            \n            inputView.widthAnchor.constraint(equalToConstant: view.frame.size.width),\n            \n            view.layoutMarginsGuide.trailingAnchor.constraint(equalTo: closeButton.trailingAnchor),\n            view.layoutMarginsGuide.topAnchor.constraint(equalTo: closeButton.topAnchor),\n            \n            obscuredLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20),\n            view.safeAreaLayoutGuide.trailingAnchor.constraint(greaterThanOrEqualTo: obscuredLabel.trailingAnchor, constant: 20),\n            view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: obscuredLabel.bottomAnchor, constant: 50)\n        ])\n    }\n    \n    @objc private func close() {\n        presentingViewController?.dismiss(animated: true)\n    }\n}\n\n// MARK: - CustomKeyboardDelegate\nextension CustomKeyboardViewController: CustomKeyboardDelegate {\n    func customKeyboardTappedButton(_ sender: CustomKeyboardView) {\n        textField.text = \"World!\"\n    }\n}\n"
  },
  {
    "path": "detox/test/ios/UI/NativeScreenManager.h",
    "content": "#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface NativeScreenManager : NSObject\n\n- (instancetype)initWithWindow:(nullable UIWindow *)window;\n- (void)handle:(NSNotification *)notification;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "detox/test/ios/UI/NativeScreenManager.swift",
    "content": "//\n//  NativeScreenManager.swift (example)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport UIKit\n\n@objc enum NativeScreen: Int {\n    case customKeyboard = 0\n\n    var viewController: UIViewController {\n        switch self {\n            case .customKeyboard:\n                let vc = CustomKeyboardViewController()\n                vc.modalPresentationStyle = .fullScreen\n                return vc\n        }\n    }\n}\n\n@objc protocol NativeScreenManaging {\n    func handle(_ notification: Notification)\n}\n\n@objc(NativeScreenManager)\nclass NativeScreenManager: NSObject, NativeScreenManaging {\n    weak var window: UIWindow?\n\n    @objc init(window: UIWindow?) {\n        self.window = window\n        super.init()\n    }\n\n    // Internal Swift method that uses the enum\n    func present(_ screen: NativeScreen, from: UIViewController?, animated: Bool) {\n        let presentingVC = from ?? window?.rootViewController\n        let viewController = screen.viewController\n        presentingVC?.present(viewController, animated: animated)\n    }\n\n    @objc func handle(_ notification: Notification) {\n        guard let name = notification.userInfo?[\"name\"] as? String else { return }\n\n        switch name {\n            case \"customKeyboard\":\n                present(.customKeyboard, from: nil, animated: true)\n            default:\n                print(\"Unknown screen: \\(name)\")\n        }\n    }\n}\n"
  },
  {
    "path": "detox/test/ios/UI/OverlayMessageView.swift",
    "content": "//\n//  OverlayMessageView.swift (example)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport UIKit\n\n@objc class OverlayMessageView: UIView {\n    private var timer: Timer?\n    private(set) var message: String\n    \n    private func getDisplayDuration() -> TimeInterval {\n        if #available(iOS 18, *) {\n            return 3.5\n        } else {\n            return 2.0\n        }\n    }\n\n    private let messageLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.numberOfLines = 2\n        label.textAlignment = .center\n        label.textColor = .white\n        label.font = UIFont.boldSystemFont(ofSize: 16)\n        return label\n    }()\n\n    private let closeButton: UIButton = {\n        let button = UIButton(type: .system)\n        button.translatesAutoresizingMaskIntoConstraints = false\n        button.setTitle(\"×\", for: .normal)\n        button.titleLabel?.font = UIFont.systemFont(ofSize: 24)\n        button.setTitleColor(.white, for: .normal)\n        return button\n    }()\n\n    init(message: String) {\n        self.message = message\n        super.init(frame: .zero)\n        setup(with: message)\n    }\n\n    required init?(coder: NSCoder) {\n        fatalError(\"init(coder:) has not been implemented\")\n    }\n\n    private func setup(with message: String) {\n        translatesAutoresizingMaskIntoConstraints = false\n        backgroundColor = UIColor.black.withAlphaComponent(0.7)\n\n        messageLabel.text = message\n\n        addSubview(messageLabel)\n        addSubview(closeButton)\n\n        NSLayoutConstraint.activate([\n            heightAnchor.constraint(equalToConstant: 60),\n\n            messageLabel.centerYAnchor.constraint(equalTo: centerYAnchor),\n            messageLabel.centerXAnchor.constraint(equalTo: centerXAnchor),\n            messageLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: 40),\n            messageLabel.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -40),\n\n            closeButton.topAnchor.constraint(equalTo: topAnchor, constant: 5),\n            closeButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -10),\n            closeButton.widthAnchor.constraint(equalToConstant: 30),\n            closeButton.heightAnchor.constraint(equalToConstant: 30)\n        ])\n\n        closeButton.addTarget(self, action: #selector(didTapClose), for: .touchUpInside)\n        startTimer()\n    }\n\n    func resetTimer() {\n        timer?.invalidate()\n        startTimer()\n    }\n\n    private func startTimer() {\n        timer = Timer.scheduledTimer(withTimeInterval: getDisplayDuration(), repeats: false) { [weak self] _ in\n            self?.removeFromSuperview()\n        }\n    }\n\n    @objc private func didTapClose() {\n        timer?.invalidate()\n        removeFromSuperview()\n    }\n\n    deinit {\n        timer?.invalidate()\n    }\n}\n"
  },
  {
    "path": "detox/test/ios/UI/UIViewController+Shake.swift",
    "content": "//\n//  UIViewController+Shake.swift (example)\n//  Created by Asaf Korem (Wix.com) on 2024.\n//\n\nimport UIKit\nimport React\n\nextension UIViewController {\n\n    @objc static func swizzleMotionEnded() {\n        guard let originalMethod = class_getInstanceMethod(UIViewController.self, #selector(motionEnded(_:with:))),\n              let swizzledMethod = class_getInstanceMethod(UIViewController.self, #selector(swizzled_motionEnded(_:with:))\n              ) else { return }\n\n        method_exchangeImplementations(originalMethod, swizzledMethod)\n    }\n\n    @objc private func swizzled_motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {\n        if motion == .motionShake {\n            handleGlobalShakeGesture()\n        }\n\n        if self.responds(to: #selector(swizzled_motionEnded(_:with:))) {\n            self.swizzled_motionEnded(motion, with: event)\n        }\n    }\n\n\n    private func handleGlobalShakeGesture() {\n        guard let shakeModule = ShakeEventEmitter.sharedInstance() else {\n            return\n        }\n\n        shakeModule.handleShake()\n    }\n}\n"
  },
  {
    "path": "detox/test/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "detox/test/ios/example/Images.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}\n"
  },
  {
    "path": "detox/test/ios/example/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLName</key>\n\t\t\t<string>detoxtesturlscheme.test.app</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n\t\t\t\t<string>detoxtesturlscheme</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<false/>\n\t\t<key>NSAllowsLocalNetworking</key>\n\t\t<true/>\n\t</dict>\n\t<key>NSAppleMusicUsageDescription</key>\n\t<string></string>\n\t<key>NSBluetoothAlwaysUsageDescription</key>\n\t<string></string>\n\t<key>NSBluetoothPeripheralUsageDescription</key>\n\t<string></string>\n\t<key>NSCalendarsUsageDescription</key>\n\t<string></string>\n\t<key>NSCameraUsageDescription</key>\n\t<string></string>\n\t<key>NSContactsUsageDescription</key>\n\t<string></string>\n\t<key>NSFaceIDUsageDescription</key>\n\t<string></string>\n\t<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>NSLocationTemporaryUsageDescriptionDictionary</key>\n\t<dict/>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>NSMicrophoneUsageDescription</key>\n\t<string></string>\n\t<key>NSMotionUsageDescription</key>\n\t<string></string>\n\t<key>NSPhotoLibraryAddUsageDescription</key>\n\t<string></string>\n\t<key>NSPhotoLibraryUsageDescription</key>\n\t<string></string>\n\t<key>NSRemindersUsageDescription</key>\n\t<string></string>\n\t<key>NSSiriUsageDescription</key>\n\t<string></string>\n\t<key>NSSpeechRecognitionUsageDescription</key>\n\t<string></string>\n\t<key>NSUserTrackingUsageDescription</key>\n\t<string></string>\n\t<key>RCTNewArchEnabled</key>\n\t<true/>\n\t<key>UIBackgroundModes</key>\n\t<array>\n\t\t<string>fetch</string>\n\t\t<string>remote-notification</string>\n\t</array>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>arm64</string>\n\t</array>\n\t<key>UIRequiresFullScreen</key>\n\t<true/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<true/>\n\t<key>WKBackgroundModes</key>\n\t<array>\n\t\t<string>remote-notification</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "detox/test/ios/example/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <device id=\"retina4_7\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"example\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"GJd-Yh-RWb\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"202\" width=\"375\" height=\"43\"/>\n                                <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Powered by React Native\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"MN2-I3-ftu\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"626\" width=\"375\" height=\"21\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                        </subviews>\n                        <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\" cocoaTouchSystemColor=\"whiteColor\"/>\n                        <constraints>\n                            <constraint firstItem=\"Bcu-3y-fUS\" firstAttribute=\"bottom\" secondItem=\"MN2-I3-ftu\" secondAttribute=\"bottom\" constant=\"20\" id=\"OZV-Vh-mqD\"/>\n                            <constraint firstItem=\"Bcu-3y-fUS\" firstAttribute=\"centerX\" secondItem=\"GJd-Yh-RWb\" secondAttribute=\"centerX\" id=\"Q3B-4B-g5h\"/>\n                            <constraint firstItem=\"MN2-I3-ftu\" firstAttribute=\"centerX\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"centerX\" id=\"akx-eg-2ui\"/>\n                            <constraint firstItem=\"MN2-I3-ftu\" firstAttribute=\"leading\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"leading\" id=\"i1E-0Y-4RG\"/>\n                            <constraint firstItem=\"GJd-Yh-RWb\" firstAttribute=\"centerY\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"moa-c2-u7t\"/>\n                            <constraint firstItem=\"GJd-Yh-RWb\" firstAttribute=\"leading\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"leading\" symbolic=\"YES\" id=\"x7j-FC-K8j\"/>\n                        </constraints>\n                        <viewLayoutGuide key=\"safeArea\" id=\"Bcu-3y-fUS\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"52.173913043478265\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "detox/test/ios/example/PrivacyInfo.xcprivacy",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>NSPrivacyAccessedAPITypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>C617.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryUserDefaults</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>CA92.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategorySystemBootTime</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>35F9.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>NSPrivacyCollectedDataTypes</key>\n\t<array/>\n\t<key>NSPrivacyTracking</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "detox/test/ios/example/example.entitlements",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>com.apple.developer.siri</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "detox/test/ios/example-Bridging-Header.h",
    "content": "#ifndef example_Bridging_Header_h\n#define example_Bridging_Header_h\n\n#import \"AppDelegate.h\"\n#import \"ShakeEventEmitter.h\"\n\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTRootView.h>\n#import <React/RCTBridge.h>\n#import <React/RCTEventEmitter.h>\n\n#endif\n"
  },
  {
    "path": "detox/test/ios/example-ci-Bridging-Header.h",
    "content": "#ifndef example_Bridging_Header_h\n#define example_Bridging_Header_h\n\n#import \"AppDelegate.h\"\n#import \"ShakeEventEmitter.h\"\n\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTRootView.h>\n#import <React/RCTBridge.h>\n#import <React/RCTEventEmitter.h>\n\n#endif\n"
  },
  {
    "path": "detox/test/ios/example.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 54;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t47FE4358FB7C4D1F5D932EE8 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5A73DF1B9BAB9270F49500C /* libPods-example.a */; };\n\t\t60493BE52D10E7E4002853A0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };\n\t\t60493BE62D10E7E4002853A0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t60493BE72D10E7E4002853A0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };\n\t\t6051227B2D356C3B00781AE2 /* NativeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 6051227A2D356C3B00781AE2 /* NativeModule.m */; };\n\t\t6051227C2D356C3B00781AE2 /* NativeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 6051227A2D356C3B00781AE2 /* NativeModule.m */; };\n\t\t6051227F2D356C5900781AE2 /* ShakeEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6051227E2D356C5900781AE2 /* ShakeEventEmitter.m */; };\n\t\t605122802D356C5900781AE2 /* ShakeEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6051227E2D356C5900781AE2 /* ShakeEventEmitter.m */; };\n\t\t608868AB2D1AA19B0070D199 /* NativeScreenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868AA2D1AA19B0070D199 /* NativeScreenManager.swift */; };\n\t\t608868AC2D1AA19B0070D199 /* NativeScreenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868AA2D1AA19B0070D199 /* NativeScreenManager.swift */; };\n\t\t608868B22D1AA1FB0070D199 /* CustomKeyboardDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868B02D1AA1FB0070D199 /* CustomKeyboardDelegate.swift */; };\n\t\t608868B32D1AA1FB0070D199 /* CustomKeyboardDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868B02D1AA1FB0070D199 /* CustomKeyboardDelegate.swift */; };\n\t\t608868D22D1D696E0070D199 /* OverlayMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868D12D1D696E0070D199 /* OverlayMessageView.swift */; };\n\t\t608868D32D1D696E0070D199 /* OverlayMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608868D12D1D696E0070D199 /* OverlayMessageView.swift */; };\n\t\t60A403A92D21EAE3004344C3 /* UIViewController+Shake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60A403A82D21EADE004344C3 /* UIViewController+Shake.swift */; };\n\t\t60A403AA2D21EAE3004344C3 /* UIViewController+Shake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60A403A82D21EADE004344C3 /* UIViewController+Shake.swift */; };\n\t\t60FDFD722D2E9EC400804B82 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD6E2D2E9EC400804B82 /* AppDelegate.m */; };\n\t\t60FDFD762D2E9ED500804B82 /* AppDelegate+OverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD752D2E9ED500804B82 /* AppDelegate+OverlayView.swift */; };\n\t\t60FDFD772D2E9ED500804B82 /* AppDelegate+OverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD752D2E9ED500804B82 /* AppDelegate+OverlayView.swift */; };\n\t\t60FDFD932D2EAF5300804B82 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD922D2EAF5300804B82 /* main.m */; };\n\t\t60FDFD942D2EAF5300804B82 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD922D2EAF5300804B82 /* main.m */; };\n\t\t7D2B472D2E8958A0002EA9EF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDFD6E2D2E9EC400804B82 /* AppDelegate.m */; };\n\t\t81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };\n\t\t90CCD0BA1322566EB1285DC2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };\n\t\t96E5C284421F3B8DEE84764F /* libPods-example-ci.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB365D90AFEA3B194709EC80 /* libPods-example-ci.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\tE2E2A4AE2E23A72600AD7167 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 609DDB772D10C20700028574 /* Detox.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 394767971DBF985400D72256;\n\t\t\tremoteInfo = Detox;\n\t\t};\n\t\tE2E2A4B02E23A72600AD7167 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 609DDB772D10C20700028574 /* Detox.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3928EFA51E47404900C19B6E;\n\t\t\tremoteInfo = DetoxUserNotificationTests;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = \"<group>\"; };\n\t\t1BBEBC97F247F27090C66840 /* Pods-example-ci.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example-ci.debug.xcconfig\"; path = \"Target Support Files/Pods-example-ci/Pods-example-ci.debug.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t47C61A9DAD738CBCE1A14367 /* Pods-example-ci.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example-ci.release.xcconfig\"; path = \"Target Support Files/Pods-example-ci/Pods-example-ci.release.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t60493BD72D10D967002853A0 /* example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = example.entitlements; path = example/example.entitlements; sourceTree = \"<group>\"; };\n\t\t60493BEE2D10E7E4002853A0 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t605122792D356BDE00781AE2 /* NativeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeModule.h; sourceTree = \"<group>\"; };\n\t\t6051227A2D356C3B00781AE2 /* NativeModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NativeModule.m; sourceTree = \"<group>\"; };\n\t\t6051227D2D356C4800781AE2 /* ShakeEventEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShakeEventEmitter.h; sourceTree = \"<group>\"; };\n\t\t6051227E2D356C5900781AE2 /* ShakeEventEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShakeEventEmitter.m; sourceTree = \"<group>\"; };\n\t\t6088689B2D1A9F070070D199 /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"example-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n\t\t6088689C2D1A9F070070D199 /* example-ci-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"example-ci-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n\t\t608868AA2D1AA19B0070D199 /* NativeScreenManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeScreenManager.swift; sourceTree = \"<group>\"; };\n\t\t608868B02D1AA1FB0070D199 /* CustomKeyboardDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomKeyboardDelegate.swift; sourceTree = \"<group>\"; };\n\t\t608868D12D1D696E0070D199 /* OverlayMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverlayMessageView.swift; sourceTree = \"<group>\"; };\n\t\t609DDB772D10C20700028574 /* Detox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = Detox.xcodeproj; path = ../../ios/Detox.xcodeproj; sourceTree = \"<group>\"; };\n\t\t60A403A82D21EADE004344C3 /* UIViewController+Shake.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"UIViewController+Shake.swift\"; sourceTree = \"<group>\"; };\n\t\t60FDFD6D2D2E9EC400804B82 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t60FDFD6E2D2E9EC400804B82 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t60FDFD752D2E9ED500804B82 /* AppDelegate+OverlayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"AppDelegate+OverlayView.swift\"; sourceTree = \"<group>\"; };\n\t\t60FDFD922D2EAF5300804B82 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\tAB365D90AFEA3B194709EC80 /* libPods-example-ci.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-example-ci.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tBB1A20253B7141FDBC1B751E /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example.release.xcconfig\"; path = \"Target Support Files/Pods-example/Pods-example.release.xcconfig\"; sourceTree = \"<group>\"; };\n\t\tED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n\t\tF5A73DF1B9BAB9270F49500C /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-example.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tF6D93D2E5764E463F14D41F3 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example.debug.xcconfig\"; path = \"Target Support Files/Pods-example/Pods-example.debug.xcconfig\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t47FE4358FB7C4D1F5D932EE8 /* libPods-example.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t60493BE12D10E7E4002853A0 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t96E5C284421F3B8DEE84764F /* libPods-example-ci.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t13B07FAE1A68108700A75B9A /* example */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t60FDFD6D2D2E9EC400804B82 /* AppDelegate.h */,\n\t\t\t\t60FDFD6E2D2E9EC400804B82 /* AppDelegate.m */,\n\t\t\t\t60E207952D21B0B400E6DBD2 /* AppDelegate Extensions */,\n\t\t\t\t60493BD72D10D967002853A0 /* example.entitlements */,\n\t\t\t\t6088689B2D1A9F070070D199 /* example-Bridging-Header.h */,\n\t\t\t\t6088689C2D1A9F070070D199 /* example-ci-Bridging-Header.h */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,\n\t\t\t\t60FDFD922D2EAF5300804B82 /* main.m */,\n\t\t\t\t13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,\n\t\t\t\t6088689F2D1A9F070070D199 /* ReactModules */,\n\t\t\t\t608868B12D1AA1FB0070D199 /* UI */,\n\t\t\t);\n\t\t\tname = example;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2D16E6871FA4F8E400B85C8A /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tED297162215061F000B7C4FE /* JavaScriptCore.framework */,\n\t\t\t\tF5A73DF1B9BAB9270F49500C /* libPods-example.a */,\n\t\t\t\tAB365D90AFEA3B194709EC80 /* libPods-example-ci.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t6088689F2D1A9F070070D199 /* ReactModules */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t6051227E2D356C5900781AE2 /* ShakeEventEmitter.m */,\n\t\t\t\t6051227D2D356C4800781AE2 /* ShakeEventEmitter.h */,\n\t\t\t\t6051227A2D356C3B00781AE2 /* NativeModule.m */,\n\t\t\t\t605122792D356BDE00781AE2 /* NativeModule.h */,\n\t\t\t);\n\t\t\tpath = ReactModules;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t608868B12D1AA1FB0070D199 /* UI */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t60A403A82D21EADE004344C3 /* UIViewController+Shake.swift */,\n\t\t\t\t608868B02D1AA1FB0070D199 /* CustomKeyboardDelegate.swift */,\n\t\t\t\t608868AA2D1AA19B0070D199 /* NativeScreenManager.swift */,\n\t\t\t\t608868D12D1D696E0070D199 /* OverlayMessageView.swift */,\n\t\t\t);\n\t\t\tpath = UI;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t60E207952D21B0B400E6DBD2 /* AppDelegate Extensions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t60FDFD752D2E9ED500804B82 /* AppDelegate+OverlayView.swift */,\n\t\t\t);\n\t\t\tpath = \"AppDelegate Extensions\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t609DDB772D10C20700028574 /* Detox.xcodeproj */,\n\t\t\t\t13B07FAE1A68108700A75B9A /* example */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t2D16E6871FA4F8E400B85C8A /* Frameworks */,\n\t\t\t\tBBD78D7AC51CEA395F1C20DB /* Pods */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* example.app */,\n\t\t\t\t60493BEE2D10E7E4002853A0 /* example.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tBBD78D7AC51CEA395F1C20DB /* Pods */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF6D93D2E5764E463F14D41F3 /* Pods-example.debug.xcconfig */,\n\t\t\t\tBB1A20253B7141FDBC1B751E /* Pods-example.release.xcconfig */,\n\t\t\t\t1BBEBC97F247F27090C66840 /* Pods-example-ci.debug.xcconfig */,\n\t\t\t\t47C61A9DAD738CBCE1A14367 /* Pods-example-ci.release.xcconfig */,\n\t\t\t);\n\t\t\tpath = Pods;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tE2E2A4A92E23A72600AD7167 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tE2E2A4AF2E23A72600AD7167 /* Detox.framework */,\n\t\t\t\tE2E2A4B12E23A72600AD7167 /* DetoxUserNotificationTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t13B07F861A680F5B00A75B9A /* example */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t7A351F49BD7394FC21A82738 /* [CP] Check Pods Manifest.lock */,\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t\t5B8FF07127E329881946B90C /* [CP] Embed Pods Frameworks */,\n\t\t\t\t8927574FA1ABFAE8785A1C92 /* [CP] Copy Pods Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = example;\n\t\t\tproductName = example;\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* example.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t60493BDB2D10E7E4002853A0 /* example-ci */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 60493BEB2D10E7E4002853A0 /* Build configuration list for PBXNativeTarget \"example-ci\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tBA23AFAE1E5347D0B029460C /* [CP] Check Pods Manifest.lock */,\n\t\t\t\t60493BDD2D10E7E4002853A0 /* Sources */,\n\t\t\t\t60493BE12D10E7E4002853A0 /* Frameworks */,\n\t\t\t\t60493BE42D10E7E4002853A0 /* Resources */,\n\t\t\t\t60493BE82D10E7E4002853A0 /* Bundle React Native code and images */,\n\t\t\t\t02C07B1C09AB0C84C0BF4024 /* [CP] Embed Pods Frameworks */,\n\t\t\t\tB993800DB3036DC55F1207F8 /* [CP] Copy Pods Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"example-ci\";\n\t\t\tproductName = example;\n\t\t\tproductReference = 60493BEE2D10E7E4002853A0 /* example.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 1210;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t13B07F861A680F5B00A75B9A = {\n\t\t\t\t\t\tLastSwiftMigration = 1600;\n\t\t\t\t\t};\n\t\t\t\t\t60493BDB2D10E7E4002853A0 = {\n\t\t\t\t\t\tLastSwiftMigration = 1600;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */;\n\t\t\tcompatibilityVersion = \"Xcode 12.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = E2E2A4A92E23A72600AD7167 /* Products */;\n\t\t\t\t\tProjectRef = 609DDB772D10C20700028574 /* Detox.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* example */,\n\t\t\t\t60493BDB2D10E7E4002853A0 /* example-ci */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\tE2E2A4AF2E23A72600AD7167 /* Detox.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = Detox.framework;\n\t\t\tremoteRef = E2E2A4AE2E23A72600AD7167 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tE2E2A4B12E23A72600AD7167 /* DetoxUserNotificationTests.xctest */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.cfbundle;\n\t\t\tpath = DetoxUserNotificationTests.xctest;\n\t\t\tremoteRef = E2E2A4B02E23A72600AD7167 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t90CCD0BA1322566EB1285DC2 /* PrivacyInfo.xcprivacy in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t60493BE42D10E7E4002853A0 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t60493BE52D10E7E4002853A0 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t60493BE62D10E7E4002853A0 /* Images.xcassets in Resources */,\n\t\t\t\t60493BE72D10E7E4002853A0 /* PrivacyInfo.xcprivacy in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"$(SRCROOT)/.xcode.env.local\",\n\t\t\t\t\"$(SRCROOT)/.xcode.env\",\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"set -e\\n\\nWITH_ENVIRONMENT=\\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\\"\\nREACT_NATIVE_XCODE=\\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\\"\\n\\n/bin/sh -c \\\"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\\\"\\n\";\n\t\t};\n\t\t02C07B1C09AB0C84C0BF4024 /* [CP] Embed Pods Frameworks */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-frameworks-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Embed Pods Frameworks\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-frameworks-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-frameworks.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t5B8FF07127E329881946B90C /* [CP] Embed Pods Frameworks */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Embed Pods Frameworks\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t60493BE82D10E7E4002853A0 /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"$(SRCROOT)/.xcode.env.local\",\n\t\t\t\t\"$(SRCROOT)/.xcode.env\",\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"set -e\\n\\nWITH_ENVIRONMENT=\\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\\"\\nREACT_NATIVE_XCODE=\\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\\"\\n\\n/bin/sh -c \\\"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\\\"\\n\";\n\t\t};\n\t\t7A351F49BD7394FC21A82738 /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t8927574FA1ABFAE8785A1C92 /* [CP] Copy Pods Resources */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Copy Pods Resources\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\tB993800DB3036DC55F1207F8 /* [CP] Copy Pods Resources */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-resources-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Copy Pods Resources\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-resources-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example-ci/Pods-example-ci-resources.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\tBA23AFAE1E5347D0B029460C /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-example-ci-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t60FDFD942D2EAF5300804B82 /* main.m in Sources */,\n\t\t\t\t60A403AA2D21EAE3004344C3 /* UIViewController+Shake.swift in Sources */,\n\t\t\t\t7D2B472D2E8958A0002EA9EF /* AppDelegate.m in Sources */,\n\t\t\t\t6051227F2D356C5900781AE2 /* ShakeEventEmitter.m in Sources */,\n\t\t\t\t608868AB2D1AA19B0070D199 /* NativeScreenManager.swift in Sources */,\n\t\t\t\t608868D32D1D696E0070D199 /* OverlayMessageView.swift in Sources */,\n\t\t\t\t60FDFD762D2E9ED500804B82 /* AppDelegate+OverlayView.swift in Sources */,\n\t\t\t\t6051227C2D356C3B00781AE2 /* NativeModule.m in Sources */,\n\t\t\t\t608868B22D1AA1FB0070D199 /* CustomKeyboardDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t60493BDD2D10E7E4002853A0 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t60FDFD932D2EAF5300804B82 /* main.m in Sources */,\n\t\t\t\t60A403A92D21EAE3004344C3 /* UIViewController+Shake.swift in Sources */,\n\t\t\t\t605122802D356C5900781AE2 /* ShakeEventEmitter.m in Sources */,\n\t\t\t\t608868AC2D1AA19B0070D199 /* NativeScreenManager.swift in Sources */,\n\t\t\t\t608868D22D1D696E0070D199 /* OverlayMessageView.swift in Sources */,\n\t\t\t\t60FDFD722D2E9EC400804B82 /* AppDelegate.m in Sources */,\n\t\t\t\t60FDFD772D2E9ED500804B82 /* AppDelegate+OverlayView.swift in Sources */,\n\t\t\t\t6051227B2D356C3B00781AE2 /* NativeModule.m in Sources */,\n\t\t\t\t608868B32D1AA1FB0070D199 /* CustomKeyboardDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = F6D93D2E5764E463F14D41F3 /* Pods-example.debug.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = example/example.entitlements;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.wix.detox-example\";\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"example-Bridging-Header.h\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = BB1A20253B7141FDBC1B751E /* Pods-example.release.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = example/example.entitlements;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.wix.detox-example\";\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"example-Bridging-Header.h\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t60493BEC2D10E7E4002853A0 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 1BBEBC97F247F27090C66840 /* Pods-example-ci.debug.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = example/example.entitlements;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.wix.detox-example\";\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"example-ci-Bridging-Header.h\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t60493BED2D10E7E4002853A0 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 47C61A9DAD738CBCE1A14367 /* Pods-example-ci.release.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = example/example.entitlements;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.wix.detox-example\";\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"example-ci-Bridging-Header.h\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t/usr/lib/swift,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/lib/swift\\\"\",\n\t\t\t\t\t\"\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(inherited)\\\"\",\n\t\t\t\t);\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_CFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = (\n\t\t\t\t\t\"$(OTHER_CFLAGS)\",\n\t\t\t\t\t\"-DFOLLY_NO_CONFIG\",\n\t\t\t\t\t\"-DFOLLY_MOBILE=1\",\n\t\t\t\t\t\"-DFOLLY_USE_LIBCPP=1\",\n\t\t\t\t\t\"-DFOLLY_CFG_NO_COROUTINES=1\",\n\t\t\t\t\t\"-DFOLLY_HAVE_CLOCK_GETTIME=1\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\" \",\n\t\t\t\t);\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = \"$(inherited) DEBUG\";\n\t\t\t\tUSE_HERMES = true;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t/usr/lib/swift,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/lib/swift\\\"\",\n\t\t\t\t\t\"\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(inherited)\\\"\",\n\t\t\t\t);\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_CFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = (\n\t\t\t\t\t\"$(OTHER_CFLAGS)\",\n\t\t\t\t\t\"-DFOLLY_NO_CONFIG\",\n\t\t\t\t\t\"-DFOLLY_MOBILE=1\",\n\t\t\t\t\t\"-DFOLLY_USE_LIBCPP=1\",\n\t\t\t\t\t\"-DFOLLY_CFG_NO_COROUTINES=1\",\n\t\t\t\t\t\"-DFOLLY_HAVE_CLOCK_GETTIME=1\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\" \",\n\t\t\t\t);\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tUSE_HERMES = true;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t60493BEB2D10E7E4002853A0 /* Build configuration list for PBXNativeTarget \"example-ci\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t60493BEC2D10E7E4002853A0 /* Debug */,\n\t\t\t\t60493BED2D10E7E4002853A0 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "detox/test/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1210\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"example.app\"\n               BlueprintName = \"example\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <CommandLineArguments>\n         <CommandLineArgument\n            argument = \"-detoxURLOverride test://ttt\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxDebugVisibility YES\"\n            isEnabled = \"YES\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxSourceAppOverride com.apple.mobilesafari\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxUserNotificationDataURL /Users/lnatan/Desktop/Code/Detox/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxWaitForDebugger 9000\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-recordingPath /Users/lnatan/Desktop/from_detox.dtxrec\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxPrintBusyIdleResources YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxUserActivityDataURL /Users/lnatan/Desktop/user-activity.json\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-enableAppDelegateVerboseLogging YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-recordingPath /Users/lnatan/Desktop/test\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-samplingInterval 0.1\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxURLBlacklistRegex &apos;(&quot;.*localhost.*&quot;, &quot;http://192.168.1.253:19001/onchange&quot;,&quot;https://e.crashlytics.com/spi/v2/events&quot;)&apos;\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxEnableSynchronization NO\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-DTXEnableVerboseSyncSystem YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-DTXEnableVerboseSyncResources YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxEnableSyncDebug YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxDisableTouchIndicators YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n         <CommandLineArgument\n            argument = \"-detoxDisableAnimationSpeedup YES\"\n            isEnabled = \"NO\">\n         </CommandLineArgument>\n      </CommandLineArguments>\n      <EnvironmentVariables>\n         <EnvironmentVariable\n            key = \"detoxServer\"\n            value = \"ws://localhost:8099\"\n            isEnabled = \"NO\">\n         </EnvironmentVariable>\n         <EnvironmentVariable\n            key = \"detoxSessionId\"\n            value = \"com.wix.detox-example\"\n            isEnabled = \"NO\">\n         </EnvironmentVariable>\n         <EnvironmentVariable\n            key = \"detoxDisableHierarchyDump\"\n            value = \"YES\"\n            isEnabled = \"NO\">\n         </EnvironmentVariable>\n      </EnvironmentVariables>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "detox/test/ios/main.m",
    "content": "#import <UIKit/UIKit.h>\n\n#import \"AppDelegate.h\"\n\nint main(int argc, char *argv[])\n{\n    @autoreleasepool {\n        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n    }\n}\n"
  },
  {
    "path": "detox/test/metro.config.js",
    "content": "const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');\n\n/**\n * Metro configuration\n * https://facebook.github.io/metro/docs/configuration\n *\n * @type {import('@react-native/metro-config').MetroConfig}\n */\nconst config = {\n  resolver: {\n    blockList: [/detox\\/node_modules\\/react-native\\/.*/],\n  },\n};\n\nmodule.exports = mergeConfig(getDefaultConfig(__dirname), config);\n"
  },
  {
    "path": "detox/test/mock-server/mock-server.js",
    "content": "const express = require('express');\nconst bodyParser = require('body-parser');\n\nclass Mockserver {\n  constructor() {\n    this.app = express();\n    this.server = null;\n    this.port = process.env.PORT || 9001;\n  }\n\n  init() {\n    this.app.use(bodyParser.urlencoded({extended: true}));\n    this.app.use(bodyParser.json());\n\n    const router = express.Router();\n\n    router.get('/', (_, res) => {\n      res.json({message: 'hello world!'});\n    });\n\n    router.get('/hello-world.html', (_, res) => {\n      res.send(`\n        <!DOCTYPE html>\n        <html lang=\"en\">\n        <head>\n            <meta charset=\"UTF-8\">\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n            <title>Hello World</title>\n        </head>\n        <body>\n            <header>\n                <h1>Hello World!</h1>\n            </header>\n            <main>\n                <form>\n                    <label for=\"input-box\" id=\"input-label\">Your input:</label><br>\n                    <input type=\"text\" id=\"input-box\" aria-labelledby=\"input-label\" aria-required=\"true\"><br>\n                    <input type=\"submit\" value=\"Send\">\n                </form>\n            </main>\n        </body>\n        </html>\n    `);\n    });\n\n    router.route('/delay/:delay')\n          .get((req, res) => {\n            console.log('Mock server', `GET delayed response, will reply in ${req.params.delay}ms`);\n            setTimeout(() => {\n              console.log('Mock server', `GET delayed response, responding now`);\n              res.json({message: `Response was delayed by ${req.params.delay}ms`});\n            }, req.params.delay);\n          });\n\n    this.app.use('/', router);\n\n    this.server = this.app.listen(this.port);\n    console.log('Mock server', `Listening on port ${this.port}`);\n  }\n\n  close() {\n    return new Promise((resolve, reject) => {\n      this.server.close(err => err ? reject(err) : resolve());\n    });\n  }\n}\n\nmodule.exports = Mockserver;\n"
  },
  {
    "path": "detox/test/package.json",
    "content": "{\n  \"name\": \"detox-test\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"engines\": {\n    \"node\": \">=18\"\n  },\n  \"scripts\": {\n    \"lint\": \"eslint .\",\n    \"test:types\": \"tsc -p types/tsconfig.json\",\n    \"test\": \"yarn lint && yarn test:types\",\n    \"postinstall\": \"node scripts/postinstall.js\",\n    \"start\": \"react-native start\",\n    \"packager\": \"react-native start\",\n    \"detox-server\": \"detox run-server\",\n    \"e2e:ios\": \"detox test -c ios.sim.release\",\n    \"e2e:android\": \"detox test -c android.emu.release\",\n    \"e2e:android:genycloud\": \"detox test -c android.genycloud.release\",\n    \"e2e:android:genycloud-arm64\": \"detox test -c android.genycloud.release-arm64\",\n    \"e2e:android-debug\": \"detox test -c android.emu.debug\",\n    \"e2e-unhappy:ios\": \"scripts/ci_unhappy.sh ios\",\n    \"e2e-unhappy:android\": \"scripts/ci_unhappy.sh android\",\n    \"integration\": \"jest --clearCache && jest --config integration/jest.config.js\",\n    \"integration:console\": \"node integration/utils/printConsole.mjs info\",\n    \"integration-update-snapshots\": \"yarn integration -u\",\n    \"build:ios\": \"detox build -c ios.sim.release\",\n    \"build:ios-debug\": \"detox build -c ios.sim.debug\",\n    \"build:android\": \"detox build -c android.emu.release\",\n    \"build:android-debug\": \"detox build -c android.emu.debug\",\n    \"clean:android\": \"pushd android && rm -fr ../android/detox/build/ && ./gradlew clean && popd\",\n    \"verify-artifacts:ios\": \"jest ./scripts/verify_artifacts_are_not_missing.ios.test.js --testEnvironment node\",\n    \"verify-artifacts:android\": \"jest ./scripts/verify_artifacts_are_not_missing.android.test.js --testEnvironment node\"\n  },\n  \"dependencies\": {\n    \"@react-native-async-storage/async-storage\": \"^2.2.0\",\n    \"@react-native-community/checkbox\": \"^0.5.15\",\n    \"@react-native-community/datetimepicker\": \"8.4.5\",\n    \"@react-native-community/geolocation\": \"^3.4.0\",\n    \"@react-native-community/slider\": \"^5.0.1\",\n    \"@react-native-picker/picker\": \"^2.11.2\",\n    \"@react-native-segmented-control/segmented-control\": \"^2.5.6\",\n    \"moment\": \"^2.30.1\",\n    \"react\": \"19.2.0\",\n    \"react-native\": \"0.83.0\",\n    \"react-native-launch-arguments\": \"^4.0.2\",\n    \"react-native-permissions\": \"^5.2.1\",\n    \"react-native-webview\": \"^13.13.1\",\n    \"ssim.js\": \"^3.5.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.3\",\n    \"@babel/runtime\": \"^7.25.0\",\n    \"@react-native-community/cli\": \"20.0.2\",\n    \"@react-native-community/cli-platform-android\": \"20.0.2\",\n    \"@react-native-community/cli-platform-ios\": \"20.0.2\",\n    \"@react-native/babel-preset\": \"0.83.0\",\n    \"@react-native/eslint-config\": \"0.83.0\",\n    \"@react-native/metro-config\": \"0.83.0\",\n    \"@react-native/typescript-config\": \"0.83.0\",\n    \"@rnx-kit/align-deps\": \"^3.0.6\",\n    \"@tsconfig/react-native\": \"^3.0.0\",\n    \"@types/jest\": \"^29.5.11\",\n    \"@types/node\": \"^16.18.68\",\n    \"@types/react\": \"^19.2.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^6.16.0\",\n    \"@typescript-eslint/parser\": \"^6.16.0\",\n    \"axios\": \"^1.7.7\",\n    \"cross-env\": \"^7.0.3\",\n    \"detox\": \"workspace:*\",\n    \"detox-allure2-adapter\": \"1.0.0-alpha.34\",\n    \"eslint\": \"^8.56.0\",\n    \"eslint-plugin-jest\": \"^28.11.0\",\n    \"eslint-plugin-unicorn\": \"^50.0.1\",\n    \"execa\": \"^5.1.1\",\n    \"express\": \"^4.15.3\",\n    \"glob\": \"^7.2.0\",\n    \"jest\": \"^30.0.3\",\n    \"jest-junit\": \"^10.0.0\",\n    \"lodash\": \"^4.14.1\",\n    \"nyc\": \"^15.1.0\",\n    \"p-iteration\": \"^1.1.8\",\n    \"pngjs\": \"^3.4.0\",\n    \"typescript\": \"^5.8.3\"\n  },\n  \"jest-junit\": {\n    \"suiteName\": \"Detox E2E tests\",\n    \"outputName\": \"e2e-junit.xml\",\n    \"ancestorSeparator\": \" > \",\n    \"classNameTemplate\": \"E2E Results.{classname}\",\n    \"titleTemplate\": \"{classname} > {title}\"\n  },\n  \"detox\": {\n    \"extends\": \"./e2e/detox.config\"\n  }\n}\n"
  },
  {
    "path": "detox/test/registerEarlyCrashIfNeeded.js",
    "content": "import { LaunchArguments } from 'react-native-launch-arguments';\n\nexport default function registerEarlyCrashIfNeeded() {\n  if (LaunchArguments.value().simulateEarlyCrash) {\n    console.warn('simulateEarlyCrash=true detected: Will crash in a few seconds from now (all-the-while keeping the app busy)...');\n    _setupBusyFutureCrash();\n  }\n}\n\n/**\n * What we're aiming at here is to have the app crash while Detox is waiting for it to become *ready* (i.e. idle)\n * for the first time, because this is a soft-spot, as we know. If we crash immediately, it might be too soon (i.e. before 'isReady'\n * is sent & received). We therefore wait a few seconds, and only then crash, provided that in a 99% chance we'll be past\n * the isReady request. We also want to keep things busy (i.e. make sure a 'ready' isn't responded), so we use short *timeouts*\n * rather than setInterval() and >1500ms intervals.\n */\nfunction _setupBusyFutureCrash() {\n  const INTERVAL = 1000;\n  const ITERATIONS = 8;\n\n  let count = 0;\n\n  const handler = () => {\n    count++;\n\n    if (count === ITERATIONS) {\n      console.warn('simulateEarlyCrash=true', 'Simulating a crash now!');\n      throw new Error('Simulating early crash');\n    }\n    setTimeout(handler, INTERVAL);\n  };\n  setTimeout(handler, INTERVAL);\n}\n"
  },
  {
    "path": "detox/test/repeat_suite.sh",
    "content": "#!/bin/bash\n\necho \"Building Detox.framework\"\ndetox clean-framework-cache && detox build-framework-cache &> /dev/null\necho \"Building suite\"\ndetox build -c ios.sim.release &> /dev/null\necho \"Running tests\"\nwhile [ 1 -lt 4 ]\ndo\n\tSTART_DATE=$(date +'%Y-%m-%d %H:%M:%S')\n\tsleep 1s\n\tdetox test -c ios.sim.release\n\tRV=${?}\n\tsleep 1s\n\tEND_DATE=$(date +'%Y-%m-%d %H:%M:%S')\n\txcrun simctl spawn booted log show --style syslog --predicate 'subsystem contains \"com.wix.Detox\"' --start \"${START_DATE}\" --end \"${END_DATE}\" > device.log\n\t\n\tif [ \"$RV\" -ne \"0\" ] ; then\n\t\techo \"FAILED!\"\n\t\texit -1\n\tfi\ndone"
  },
  {
    "path": "detox/test/rn-cli.config.js",
    "content": "/*\n * This has been replaced by 'metro.config.js'. It's only here to enable running with RN<60.x\n */\n\nlet metroBundler;\ntry {\n  metroBundler = require('metro');\n} catch (ex) {\n  metroBundler = require('metro-bundler');\n}\n\nmodule.exports = {\n  getBlacklistRE: function() {\n    return metroBundler.createBlacklist([/detox\\/node_modules\\/react-native\\/.*/]);\n  }\n};\n"
  },
  {
    "path": "detox/test/scripts/__snapshots__/verify_artifacts_are_not_missing.android.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[` 1`] = `\nArray [\n  \"\",\n  \".\",\n  \"./✓ Actions should clear text in an element\",\n  \"./✓ Actions should clear text in an element/afterEach.png\",\n  \"./✓ Actions should clear text in an element/beforeEach.png\",\n  \"./✓ Actions should clear text in an element/test.log\",\n  \"./✓ Actions should long press on an element\",\n  \"./✓ Actions should long press on an element/afterEach.png\",\n  \"./✓ Actions should long press on an element/beforeEach.png\",\n  \"./✓ Actions should long press on an element/test.log\",\n  \"./✓ Actions should multi tap on an element\",\n  \"./✓ Actions should multi tap on an element/afterEach.png\",\n  \"./✓ Actions should multi tap on an element/beforeEach.png\",\n  \"./✓ Actions should multi tap on an element/test.log\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/afterEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/beforeEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/test.log\",\n  \"./✓ Actions should replace text in an element\",\n  \"./✓ Actions should replace text in an element/afterEach.png\",\n  \"./✓ Actions should replace text in an element/beforeEach.png\",\n  \"./✓ Actions should replace text in an element/test.log\",\n  \"./✓ Actions should scroll for a large amount in direction\",\n  \"./✓ Actions should scroll for a large amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/test.log\",\n  \"./✓ Actions should scroll for a small amount in direction\",\n  \"./✓ Actions should scroll for a small amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/test.log\",\n  \"./✓ Actions should scroll to edge\",\n  \"./✓ Actions should scroll to edge/afterEach.png\",\n  \"./✓ Actions should scroll to edge/beforeEach.png\",\n  \"./✓ Actions should scroll to edge/test.log\",\n  \"./✓ Actions should tap on an element\",\n  \"./✓ Actions should tap on an element at point\",\n  \"./✓ Actions should tap on an element at point/afterEach.png\",\n  \"./✓ Actions should tap on an element at point/beforeEach.png\",\n  \"./✓ Actions should tap on an element at point/test.log\",\n  \"./✓ Actions should tap on an element/afterEach.png\",\n  \"./✓ Actions should tap on an element/beforeEach.png\",\n  \"./✓ Actions should tap on an element/test.log\",\n  \"./✓ Actions should type in an element\",\n  \"./✓ Actions should type in an element/afterEach.png\",\n  \"./✓ Actions should type in an element/beforeEach.png\",\n  \"./✓ Actions should type in an element/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/test.log\",\n  \"./✓ Animations should find element (driver_ JS)\",\n  \"./✓ Animations should find element (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/test.log\",\n  \"./✓ Animations should find element (driver_ Native)\",\n  \"./✓ Animations should find element (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Assertions should assert an element does not exist\",\n  \"./✓ Assertions should assert an element does not exist/afterEach.png\",\n  \"./✓ Assertions should assert an element does not exist/beforeEach.png\",\n  \"./✓ Assertions should assert an element does not exist/test.log\",\n  \"./✓ Assertions should assert an element exists\",\n  \"./✓ Assertions should assert an element exists/afterEach.png\",\n  \"./✓ Assertions should assert an element exists/beforeEach.png\",\n  \"./✓ Assertions should assert an element exists/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) id\",\n  \"./✓ Assertions should assert an element has (accessibility) id/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) label\",\n  \"./✓ Assertions should assert an element has (accessibility) label/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/test.log\",\n  \"./✓ Assertions should assert an element has text\",\n  \"./✓ Assertions should assert an element has text/afterEach.png\",\n  \"./✓ Assertions should assert an element has text/beforeEach.png\",\n  \"./✓ Assertions should assert an element has text/test.log\",\n  \"./✓ Assertions should assert an element is not visible\",\n  \"./✓ Assertions should assert an element is not visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is not visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is not visible/test.log\",\n  \"./✓ Assertions should assert an element is visible\",\n  \"./✓ Assertions should assert an element is visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is visible/test.log\",\n  \"./✓ Async and Callbacks should handle async await\",\n  \"./✓ Async and Callbacks should handle async await/afterEach.png\",\n  \"./✓ Async and Callbacks should handle async await/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle async await/test.log\",\n  \"./✓ Async and Callbacks should handle done() callback\",\n  \"./✓ Async and Callbacks should handle done() callback/afterEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/test.log\",\n  \"./✓ Device Orientation OrientationLandscape\",\n  \"./✓ Device Orientation OrientationLandscape/afterEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/beforeEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/test.log\",\n  \"./✓ Device Orientation OrientationPortrait\",\n  \"./✓ Device Orientation OrientationPortrait/afterEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/beforeEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/test.log\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/afterEach.png\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/beforeEach.png\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/test.log\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/afterEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/beforeEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/test.log\",\n  \"./✓ Device relaunchApp - should tap successfully\",\n  \"./✓ Device relaunchApp - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/test.log\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/test.log\",\n  \"./✓ Device reloadReactNative - should tap successfully\",\n  \"./✓ Device reloadReactNative - should tap successfully/afterEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/beforeEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/test.log\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) id\",\n  \"./✓ Matchers should match elements by (accesibility) id/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) label\",\n  \"./✓ Matchers should match elements by (accesibility) label/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/test.log\",\n  \"./✓ Matchers should match elements by index\",\n  \"./✓ Matchers should match elements by index/afterEach.png\",\n  \"./✓ Matchers should match elements by index/beforeEach.png\",\n  \"./✓ Matchers should match elements by index/test.log\",\n  \"./✓ Matchers should match elements by type (native class)\",\n  \"./✓ Matchers should match elements by type (native class)/afterEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/beforeEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/test.log\",\n  \"./✓ Matchers should match elements by using two matchers together with and\",\n  \"./✓ Matchers should match elements by using two matchers together with and/afterEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/beforeEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/test.log\",\n  \"./✓ Matchers should match elements with ancenstor (parent)\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/afterEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/beforeEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/test.log\",\n  \"./✓ Matchers should match elements with descendant (child)\",\n  \"./✓ Matchers should match elements with descendant (child)/afterEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/beforeEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/test.log\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/test.log\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/test.log\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/afterEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/beforeEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/test.log\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/afterEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/beforeEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/test.log\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/test.log\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/test.log\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/afterEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/beforeEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/test.log\",\n  \"./✓ Sanity should have welcome screen\",\n  \"./✓ Sanity should have welcome screen/afterEach.png\",\n  \"./✓ Sanity should have welcome screen/beforeEach.png\",\n  \"./✓ Sanity should have welcome screen/test.log\",\n  \"./✓ Sanity should show hello screen after tap\",\n  \"./✓ Sanity should show hello screen after tap/afterEach.png\",\n  \"./✓ Sanity should show hello screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show hello screen after tap/test.log\",\n  \"./✓ Sanity should show world screen after tap\",\n  \"./✓ Sanity should show world screen after tap/afterEach.png\",\n  \"./✓ Sanity should show world screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show world screen after tap/test.log\",\n  \"./✓ StressRoot should switch root view controller from RN to native\",\n  \"./✓ StressRoot should switch root view controller from RN to native/afterEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/beforeEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/test.log\",\n  \"./✓ StressTests should handle consecutive taps\",\n  \"./✓ StressTests should handle consecutive taps/afterEach.png\",\n  \"./✓ StressTests should handle consecutive taps/beforeEach.png\",\n  \"./✓ StressTests should handle consecutive taps/test.log\",\n  \"./✓ StressTests should handle tap during busy JS event loop\",\n  \"./✓ StressTests should handle tap during busy JS event loop/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/test.log\",\n  \"./✓ StressTimeouts should handle setImmediate\",\n  \"./✓ StressTimeouts should handle setImmediate/afterEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/beforeEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/test.log\",\n  \"./✓ StressTimeouts should handle zero timeout\",\n  \"./✓ StressTimeouts should handle zero timeout/afterEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a long timeout\",\n  \"./✓ StressTimeouts should ignore a long timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a short timeout\",\n  \"./✓ StressTimeouts should ignore a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/test.log\",\n  \"./✓ StressTimeouts should ignore setInterval\",\n  \"./✓ StressTimeouts should ignore setInterval/afterEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/test.log\",\n  \"./✓ WaitFor should find element by scrolling until it is visible\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/afterEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/beforeEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/test.log\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/test.log\",\n  \"./✓ WaitFor should wait until an element is removed\",\n  \"./✓ WaitFor should wait until an element is removed/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/test.log\",\n  \"1.detox.json.log\",\n  \"1.detox.log\",\n  \"1.startup.log\",\n]\n`;\n\nexports[`artifacts health check should have all the Android artifacts in ./artifacts folder 1`] = `\nArray [\n  \"\",\n  \".\",\n  \"./✓ Actions should clear text in an element\",\n  \"./✓ Actions should clear text in an element/afterEach.png\",\n  \"./✓ Actions should clear text in an element/beforeEach.png\",\n  \"./✓ Actions should clear text in an element/test.log\",\n  \"./✓ Actions should long press on an element\",\n  \"./✓ Actions should long press on an element/afterEach.png\",\n  \"./✓ Actions should long press on an element/beforeEach.png\",\n  \"./✓ Actions should long press on an element/test.log\",\n  \"./✓ Actions should multi tap on an element\",\n  \"./✓ Actions should multi tap on an element/afterEach.png\",\n  \"./✓ Actions should multi tap on an element/beforeEach.png\",\n  \"./✓ Actions should multi tap on an element/test.log\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/afterEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/beforeEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/test.log\",\n  \"./✓ Actions should replace text in an element\",\n  \"./✓ Actions should replace text in an element/afterEach.png\",\n  \"./✓ Actions should replace text in an element/beforeEach.png\",\n  \"./✓ Actions should replace text in an element/test.log\",\n  \"./✓ Actions should scroll for a large amount in direction\",\n  \"./✓ Actions should scroll for a large amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/test.log\",\n  \"./✓ Actions should scroll for a small amount in direction\",\n  \"./✓ Actions should scroll for a small amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/test.log\",\n  \"./✓ Actions should scroll to edge\",\n  \"./✓ Actions should scroll to edge/afterEach.png\",\n  \"./✓ Actions should scroll to edge/beforeEach.png\",\n  \"./✓ Actions should scroll to edge/test.log\",\n  \"./✓ Actions should tap on an element\",\n  \"./✓ Actions should tap on an element at point\",\n  \"./✓ Actions should tap on an element at point/afterEach.png\",\n  \"./✓ Actions should tap on an element at point/beforeEach.png\",\n  \"./✓ Actions should tap on an element at point/test.log\",\n  \"./✓ Actions should tap on an element/afterEach.png\",\n  \"./✓ Actions should tap on an element/beforeEach.png\",\n  \"./✓ Actions should tap on an element/test.log\",\n  \"./✓ Actions should type in an element\",\n  \"./✓ Actions should type in an element/afterEach.png\",\n  \"./✓ Actions should type in an element/beforeEach.png\",\n  \"./✓ Actions should type in an element/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/test.log\",\n  \"./✓ Animations should find element (driver_ JS)\",\n  \"./✓ Animations should find element (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/test.log\",\n  \"./✓ Animations should find element (driver_ Native)\",\n  \"./✓ Animations should find element (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Assertions should assert an element does not exist\",\n  \"./✓ Assertions should assert an element does not exist/afterEach.png\",\n  \"./✓ Assertions should assert an element does not exist/beforeEach.png\",\n  \"./✓ Assertions should assert an element does not exist/test.log\",\n  \"./✓ Assertions should assert an element exists\",\n  \"./✓ Assertions should assert an element exists/afterEach.png\",\n  \"./✓ Assertions should assert an element exists/beforeEach.png\",\n  \"./✓ Assertions should assert an element exists/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) id\",\n  \"./✓ Assertions should assert an element has (accessibility) id/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) label\",\n  \"./✓ Assertions should assert an element has (accessibility) label/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/test.log\",\n  \"./✓ Assertions should assert an element has text\",\n  \"./✓ Assertions should assert an element has text/afterEach.png\",\n  \"./✓ Assertions should assert an element has text/beforeEach.png\",\n  \"./✓ Assertions should assert an element has text/test.log\",\n  \"./✓ Assertions should assert an element is not visible\",\n  \"./✓ Assertions should assert an element is not visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is not visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is not visible/test.log\",\n  \"./✓ Assertions should assert an element is visible\",\n  \"./✓ Assertions should assert an element is visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is visible/test.log\",\n  \"./✓ Async and Callbacks should handle async await\",\n  \"./✓ Async and Callbacks should handle async await/afterEach.png\",\n  \"./✓ Async and Callbacks should handle async await/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle async await/test.log\",\n  \"./✓ Async and Callbacks should handle done() callback\",\n  \"./✓ Async and Callbacks should handle done() callback/afterEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/test.log\",\n  \"./✓ Device Orientation OrientationLandscape\",\n  \"./✓ Device Orientation OrientationLandscape/afterEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/beforeEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/test.log\",\n  \"./✓ Device Orientation OrientationPortrait\",\n  \"./✓ Device Orientation OrientationPortrait/afterEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/beforeEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/test.log\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/afterEach.png\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/beforeEach.png\",\n  \"./✓ Device _android_ device back button _android_ should show popup back pressed when back button is pressed/test.log\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/afterEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/beforeEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/test.log\",\n  \"./✓ Device relaunchApp - should tap successfully\",\n  \"./✓ Device relaunchApp - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/test.log\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/test.log\",\n  \"./✓ Device reloadReactNative - should tap successfully\",\n  \"./✓ Device reloadReactNative - should tap successfully/afterEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/beforeEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/test.log\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) id\",\n  \"./✓ Matchers should match elements by (accesibility) id/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) label\",\n  \"./✓ Matchers should match elements by (accesibility) label/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/test.log\",\n  \"./✓ Matchers should match elements by index\",\n  \"./✓ Matchers should match elements by index/afterEach.png\",\n  \"./✓ Matchers should match elements by index/beforeEach.png\",\n  \"./✓ Matchers should match elements by index/test.log\",\n  \"./✓ Matchers should match elements by type (native class)\",\n  \"./✓ Matchers should match elements by type (native class)/afterEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/beforeEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/test.log\",\n  \"./✓ Matchers should match elements by using two matchers together with and\",\n  \"./✓ Matchers should match elements by using two matchers together with and/afterEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/beforeEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/test.log\",\n  \"./✓ Matchers should match elements with ancenstor (parent)\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/afterEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/beforeEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/test.log\",\n  \"./✓ Matchers should match elements with descendant (child)\",\n  \"./✓ Matchers should match elements with descendant (child)/afterEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/beforeEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/test.log\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/test.log\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/test.log\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/afterEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/beforeEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/test.log\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/afterEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/beforeEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/test.log\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/test.log\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/test.log\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/afterEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/beforeEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/test.log\",\n  \"./✓ Sanity should have welcome screen\",\n  \"./✓ Sanity should have welcome screen/afterEach.png\",\n  \"./✓ Sanity should have welcome screen/beforeEach.png\",\n  \"./✓ Sanity should have welcome screen/test.log\",\n  \"./✓ Sanity should show hello screen after tap\",\n  \"./✓ Sanity should show hello screen after tap/afterEach.png\",\n  \"./✓ Sanity should show hello screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show hello screen after tap/test.log\",\n  \"./✓ Sanity should show world screen after tap\",\n  \"./✓ Sanity should show world screen after tap/afterEach.png\",\n  \"./✓ Sanity should show world screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show world screen after tap/test.log\",\n  \"./✓ StressRoot should switch root view controller from RN to native\",\n  \"./✓ StressRoot should switch root view controller from RN to native/afterEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/beforeEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/test.log\",\n  \"./✓ StressTests should handle consecutive taps\",\n  \"./✓ StressTests should handle consecutive taps/afterEach.png\",\n  \"./✓ StressTests should handle consecutive taps/beforeEach.png\",\n  \"./✓ StressTests should handle consecutive taps/test.log\",\n  \"./✓ StressTests should handle tap during busy JS event loop\",\n  \"./✓ StressTests should handle tap during busy JS event loop/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/test.log\",\n  \"./✓ StressTimeouts should handle setImmediate\",\n  \"./✓ StressTimeouts should handle setImmediate/afterEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/beforeEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/test.log\",\n  \"./✓ StressTimeouts should handle zero timeout\",\n  \"./✓ StressTimeouts should handle zero timeout/afterEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a long timeout\",\n  \"./✓ StressTimeouts should ignore a long timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a short timeout\",\n  \"./✓ StressTimeouts should ignore a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/test.log\",\n  \"./✓ StressTimeouts should ignore setInterval\",\n  \"./✓ StressTimeouts should ignore setInterval/afterEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/test.log\",\n  \"./✓ WaitFor should find element by scrolling until it is visible\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/afterEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/beforeEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/test.log\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/test.log\",\n  \"./✓ WaitFor should wait until an element is removed\",\n  \"./✓ WaitFor should wait until an element is removed/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/test.log\",\n  \"1.detox.json.log\",\n  \"1.detox.log\",\n  \"1.startup.log\",\n]\n`;\n"
  },
  {
    "path": "detox/test/scripts/__snapshots__/verify_artifacts_are_not_missing.ios.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[` 1`] = `\nArray [\n  \"\",\n  \".\",\n  \"./✓ Actions _ios_ should long press with duration on an element\",\n  \"./✓ Actions _ios_ should long press with duration on an element/afterEach.png\",\n  \"./✓ Actions _ios_ should long press with duration on an element/beforeEach.png\",\n  \"./✓ Actions _ios_ should long press with duration on an element/test.log\",\n  \"./✓ Actions should clear text in an element\",\n  \"./✓ Actions should clear text in an element/afterEach.png\",\n  \"./✓ Actions should clear text in an element/beforeEach.png\",\n  \"./✓ Actions should clear text in an element/test.log\",\n  \"./✓ Actions should long press on an element\",\n  \"./✓ Actions should long press on an element/afterEach.png\",\n  \"./✓ Actions should long press on an element/beforeEach.png\",\n  \"./✓ Actions should long press on an element/test.log\",\n  \"./✓ Actions should multi tap on an element\",\n  \"./✓ Actions should multi tap on an element/afterEach.png\",\n  \"./✓ Actions should multi tap on an element/beforeEach.png\",\n  \"./✓ Actions should multi tap on an element/test.log\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/afterEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/beforeEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/test.log\",\n  \"./✓ Actions should replace text in an element\",\n  \"./✓ Actions should replace text in an element/afterEach.png\",\n  \"./✓ Actions should replace text in an element/beforeEach.png\",\n  \"./✓ Actions should replace text in an element/test.log\",\n  \"./✓ Actions should scroll for a large amount in direction\",\n  \"./✓ Actions should scroll for a large amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/test.log\",\n  \"./✓ Actions should scroll for a small amount in direction\",\n  \"./✓ Actions should scroll for a small amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/test.log\",\n  \"./✓ Actions should scroll to edge\",\n  \"./✓ Actions should scroll to edge/afterEach.png\",\n  \"./✓ Actions should scroll to edge/beforeEach.png\",\n  \"./✓ Actions should scroll to edge/test.log\",\n  \"./✓ Actions should tap on an element\",\n  \"./✓ Actions should tap on an element at point\",\n  \"./✓ Actions should tap on an element at point/afterEach.png\",\n  \"./✓ Actions should tap on an element at point/beforeEach.png\",\n  \"./✓ Actions should tap on an element at point/test.log\",\n  \"./✓ Actions should tap on an element/afterEach.png\",\n  \"./✓ Actions should tap on an element/beforeEach.png\",\n  \"./✓ Actions should tap on an element/test.log\",\n  \"./✓ Actions should type in an element\",\n  \"./✓ Actions should type in an element/afterEach.png\",\n  \"./✓ Actions should type in an element/beforeEach.png\",\n  \"./✓ Actions should type in an element/test.log\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/test.log\",\n  \"./✓ Animations should find element (driver_ JS)\",\n  \"./✓ Animations should find element (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/test.log\",\n  \"./✓ Animations should find element (driver_ Native)\",\n  \"./✓ Animations should find element (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/afterEach.png\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/beforeEach.png\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/test.log\",\n  \"./✓ Assertions should assert an element does not exist\",\n  \"./✓ Assertions should assert an element does not exist/afterEach.png\",\n  \"./✓ Assertions should assert an element does not exist/beforeEach.png\",\n  \"./✓ Assertions should assert an element does not exist/test.log\",\n  \"./✓ Assertions should assert an element exists\",\n  \"./✓ Assertions should assert an element exists/afterEach.png\",\n  \"./✓ Assertions should assert an element exists/beforeEach.png\",\n  \"./✓ Assertions should assert an element exists/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) id\",\n  \"./✓ Assertions should assert an element has (accessibility) id/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) label\",\n  \"./✓ Assertions should assert an element has (accessibility) label/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/test.log\",\n  \"./✓ Assertions should assert an element has text\",\n  \"./✓ Assertions should assert an element has text/afterEach.png\",\n  \"./✓ Assertions should assert an element has text/beforeEach.png\",\n  \"./✓ Assertions should assert an element has text/test.log\",\n  \"./✓ Assertions should assert an element is not visible\",\n  \"./✓ Assertions should assert an element is not visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is not visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is not visible/test.log\",\n  \"./✓ Assertions should assert an element is visible\",\n  \"./✓ Assertions should assert an element is visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is visible/test.log\",\n  \"./✓ Async and Callbacks should handle async await\",\n  \"./✓ Async and Callbacks should handle async await/afterEach.png\",\n  \"./✓ Async and Callbacks should handle async await/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle async await/test.log\",\n  \"./✓ Async and Callbacks should handle done() callback\",\n  \"./✓ Async and Callbacks should handle done() callback/afterEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/test.log\",\n  \"./✓ Device Orientation OrientationLandscape\",\n  \"./✓ Device Orientation OrientationLandscape/afterEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/beforeEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/test.log\",\n  \"./✓ Device Orientation OrientationPortrait\",\n  \"./✓ Device Orientation OrientationPortrait/afterEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/beforeEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/test.log\",\n  \"./✓ Device _ios_ shake() should shake screen\",\n  \"./✓ Device _ios_ shake() should shake screen/afterEach.png\",\n  \"./✓ Device _ios_ shake() should shake screen/beforeEach.png\",\n  \"./✓ Device _ios_ shake() should shake screen/test.log\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/afterEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/beforeEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/test.log\",\n  \"./✓ Device relaunchApp - should tap successfully\",\n  \"./✓ Device relaunchApp - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/test.log\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/test.log\",\n  \"./✓ Device reloadReactNative - should tap successfully\",\n  \"./✓ Device reloadReactNative - should tap successfully/afterEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/beforeEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/test.log\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/afterEach.png\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/beforeEach.png\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) id\",\n  \"./✓ Matchers should match elements by (accesibility) id/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) label\",\n  \"./✓ Matchers should match elements by (accesibility) label/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/test.log\",\n  \"./✓ Matchers should match elements by index\",\n  \"./✓ Matchers should match elements by index/afterEach.png\",\n  \"./✓ Matchers should match elements by index/beforeEach.png\",\n  \"./✓ Matchers should match elements by index/test.log\",\n  \"./✓ Matchers should match elements by type (native class)\",\n  \"./✓ Matchers should match elements by type (native class)/afterEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/beforeEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/test.log\",\n  \"./✓ Matchers should match elements by using two matchers together with and\",\n  \"./✓ Matchers should match elements by using two matchers together with and/afterEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/beforeEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/test.log\",\n  \"./✓ Matchers should match elements with ancenstor (parent)\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/afterEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/beforeEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/test.log\",\n  \"./✓ Matchers should match elements with descendant (child)\",\n  \"./✓ Matchers should match elements with descendant (child)/afterEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/beforeEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/test.log\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/test.log\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/test.log\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/afterEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/beforeEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/test.log\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/afterEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/beforeEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/test.log\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/test.log\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/test.log\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/afterEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/beforeEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/test.log\",\n  \"./✓ Sanity should have welcome screen\",\n  \"./✓ Sanity should have welcome screen/afterEach.png\",\n  \"./✓ Sanity should have welcome screen/beforeEach.png\",\n  \"./✓ Sanity should have welcome screen/test.log\",\n  \"./✓ Sanity should show hello screen after tap\",\n  \"./✓ Sanity should show hello screen after tap/afterEach.png\",\n  \"./✓ Sanity should show hello screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show hello screen after tap/test.log\",\n  \"./✓ Sanity should show world screen after tap\",\n  \"./✓ Sanity should show world screen after tap/afterEach.png\",\n  \"./✓ Sanity should show world screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show world screen after tap/test.log\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/afterEach.png\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/beforeEach.png\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/test.log\",\n  \"./✓ StressRoot should switch root view controller from RN to native\",\n  \"./✓ StressRoot should switch root view controller from RN to native/afterEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/beforeEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/test.log\",\n  \"./✓ StressTests should handle consecutive taps\",\n  \"./✓ StressTests should handle consecutive taps/afterEach.png\",\n  \"./✓ StressTests should handle consecutive taps/beforeEach.png\",\n  \"./✓ StressTests should handle consecutive taps/test.log\",\n  \"./✓ StressTests should handle tap during busy JS event loop\",\n  \"./✓ StressTests should handle tap during busy JS event loop/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/test.log\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/test.log\",\n  \"./✓ StressTimeouts should handle setImmediate\",\n  \"./✓ StressTimeouts should handle setImmediate/afterEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/beforeEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/test.log\",\n  \"./✓ StressTimeouts should handle zero timeout\",\n  \"./✓ StressTimeouts should handle zero timeout/afterEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a long timeout\",\n  \"./✓ StressTimeouts should ignore a long timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a short timeout\",\n  \"./✓ StressTimeouts should ignore a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/test.log\",\n  \"./✓ StressTimeouts should ignore setInterval\",\n  \"./✓ StressTimeouts should ignore setInterval/afterEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/test.log\",\n  \"./✓ WaitFor should find element by scrolling until it is visible\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/afterEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/beforeEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/test.log\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/test.log\",\n  \"./✓ WaitFor should wait until an element is removed\",\n  \"./✓ WaitFor should wait until an element is removed/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/test.log\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/afterEach.png\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/beforeEach.png\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/test.log\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/afterEach.png\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/beforeEach.png\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/test.log\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/afterEach.png\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/beforeEach.png\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/test.log\",\n  \"./✓ _ios_ Permissions Permissions denied\",\n  \"./✓ _ios_ Permissions Permissions denied/afterEach.png\",\n  \"./✓ _ios_ Permissions Permissions denied/beforeEach.png\",\n  \"./✓ _ios_ Permissions Permissions denied/test.log\",\n  \"./✓ _ios_ Permissions Permissions is granted\",\n  \"./✓ _ios_ Permissions Permissions is granted/afterEach.png\",\n  \"./✓ _ios_ Permissions Permissions is granted/beforeEach.png\",\n  \"./✓ _ios_ Permissions Permissions is granted/test.log\",\n  \"./✓ _ios_ User Activity Background searchable item\",\n  \"./✓ _ios_ User Activity Background searchable item/afterEach.png\",\n  \"./✓ _ios_ User Activity Background searchable item/beforeEach.png\",\n  \"./✓ _ios_ User Activity Background searchable item/test.log\",\n  \"./✓ _ios_ User Activity Foreground browsing web\",\n  \"./✓ _ios_ User Activity Foreground browsing web/afterEach.png\",\n  \"./✓ _ios_ User Activity Foreground browsing web/beforeEach.png\",\n  \"./✓ _ios_ User Activity Foreground browsing web/test.log\",\n  \"./✓ _ios_ User Activity Init from browsing web\",\n  \"./✓ _ios_ User Activity Init from browsing web/afterEach.png\",\n  \"./✓ _ios_ User Activity Init from browsing web/beforeEach.png\",\n  \"./✓ _ios_ User Activity Init from browsing web/test.log\",\n  \"./✓ _ios_ User Notifications Background calendar notification\",\n  \"./✓ _ios_ User Notifications Background calendar notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Background calendar notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Background calendar notification/test.log\",\n  \"./✓ _ios_ User Notifications Background push notification\",\n  \"./✓ _ios_ User Notifications Background push notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Background push notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Background push notification/test.log\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/afterEach.png\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/test.log\",\n  \"./✓ _ios_ User Notifications Foreground push notifications\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/afterEach.png\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/test.log\",\n  \"./✓ _ios_ User Notifications Init from push notification\",\n  \"./✓ _ios_ User Notifications Init from push notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Init from push notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Init from push notification/test.log\",\n  \"./✓ _ios_ location Location should be unavabilable\",\n  \"./✓ _ios_ location Location should be unavabilable/afterEach.png\",\n  \"./✓ _ios_ location Location should be unavabilable/beforeEach.png\",\n  \"./✓ _ios_ location Location should be unavabilable/test.log\",\n  \"./✓ _ios_ location Should receive location (20,20)\",\n  \"./✓ _ios_ location Should receive location (20,20)/afterEach.png\",\n  \"./✓ _ios_ location Should receive location (20,20)/beforeEach.png\",\n  \"./✓ _ios_ location Should receive location (20,20)/test.log\",\n  \"1.detox.json.log\",\n  \"1.detox.log\",\n  \"1.startup.log\",\n]\n`;\n\nexports[`artifacts health check should have all the iOS artifacts in ./artifacts folder 1`] = `\nArray [\n  \"\",\n  \".\",\n  \"./✓ Actions _ios_ should long press with duration on an element\",\n  \"./✓ Actions _ios_ should long press with duration on an element/afterEach.png\",\n  \"./✓ Actions _ios_ should long press with duration on an element/beforeEach.png\",\n  \"./✓ Actions _ios_ should long press with duration on an element/test.log\",\n  \"./✓ Actions should clear text in an element\",\n  \"./✓ Actions should clear text in an element/afterEach.png\",\n  \"./✓ Actions should clear text in an element/beforeEach.png\",\n  \"./✓ Actions should clear text in an element/test.log\",\n  \"./✓ Actions should long press on an element\",\n  \"./✓ Actions should long press on an element/afterEach.png\",\n  \"./✓ Actions should long press on an element/beforeEach.png\",\n  \"./✓ Actions should long press on an element/test.log\",\n  \"./✓ Actions should multi tap on an element\",\n  \"./✓ Actions should multi tap on an element/afterEach.png\",\n  \"./✓ Actions should multi tap on an element/beforeEach.png\",\n  \"./✓ Actions should multi tap on an element/test.log\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/afterEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/beforeEach.png\",\n  \"./✓ Actions should not wait for long timeout (_1.5s)/test.log\",\n  \"./✓ Actions should replace text in an element\",\n  \"./✓ Actions should replace text in an element/afterEach.png\",\n  \"./✓ Actions should replace text in an element/beforeEach.png\",\n  \"./✓ Actions should replace text in an element/test.log\",\n  \"./✓ Actions should scroll for a large amount in direction\",\n  \"./✓ Actions should scroll for a large amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a large amount in direction/test.log\",\n  \"./✓ Actions should scroll for a small amount in direction\",\n  \"./✓ Actions should scroll for a small amount in direction/afterEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/beforeEach.png\",\n  \"./✓ Actions should scroll for a small amount in direction/test.log\",\n  \"./✓ Actions should scroll to edge\",\n  \"./✓ Actions should scroll to edge/afterEach.png\",\n  \"./✓ Actions should scroll to edge/beforeEach.png\",\n  \"./✓ Actions should scroll to edge/test.log\",\n  \"./✓ Actions should tap on an element\",\n  \"./✓ Actions should tap on an element at point\",\n  \"./✓ Actions should tap on an element at point/afterEach.png\",\n  \"./✓ Actions should tap on an element at point/beforeEach.png\",\n  \"./✓ Actions should tap on an element at point/test.log\",\n  \"./✓ Actions should tap on an element/afterEach.png\",\n  \"./✓ Actions should tap on an element/beforeEach.png\",\n  \"./✓ Actions should tap on an element/test.log\",\n  \"./✓ Actions should type in an element\",\n  \"./✓ Actions should type in an element/afterEach.png\",\n  \"./✓ Actions should type in an element/beforeEach.png\",\n  \"./✓ Actions should type in an element/test.log\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations _ios_ should wait during delays shorter than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ JS)/test.log\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should detect loops with final number of iterations (driver_ Native)/test.log\",\n  \"./✓ Animations should find element (driver_ JS)\",\n  \"./✓ Animations should find element (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ JS)/test.log\",\n  \"./✓ Animations should find element (driver_ Native)\",\n  \"./✓ Animations should find element (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should find element (driver_ Native)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ JS)/test.log\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/afterEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/beforeEach.png\",\n  \"./✓ Animations should not wait during delays longer than 1.5s (driver_ Native)/test.log\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/afterEach.png\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/beforeEach.png\",\n  \"./✓ Assertions _ios_ should assert an element has (accessibility) value/test.log\",\n  \"./✓ Assertions should assert an element does not exist\",\n  \"./✓ Assertions should assert an element does not exist/afterEach.png\",\n  \"./✓ Assertions should assert an element does not exist/beforeEach.png\",\n  \"./✓ Assertions should assert an element does not exist/test.log\",\n  \"./✓ Assertions should assert an element exists\",\n  \"./✓ Assertions should assert an element exists/afterEach.png\",\n  \"./✓ Assertions should assert an element exists/beforeEach.png\",\n  \"./✓ Assertions should assert an element exists/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) id\",\n  \"./✓ Assertions should assert an element has (accessibility) id/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) id/test.log\",\n  \"./✓ Assertions should assert an element has (accessibility) label\",\n  \"./✓ Assertions should assert an element has (accessibility) label/afterEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/beforeEach.png\",\n  \"./✓ Assertions should assert an element has (accessibility) label/test.log\",\n  \"./✓ Assertions should assert an element has text\",\n  \"./✓ Assertions should assert an element has text/afterEach.png\",\n  \"./✓ Assertions should assert an element has text/beforeEach.png\",\n  \"./✓ Assertions should assert an element has text/test.log\",\n  \"./✓ Assertions should assert an element is not visible\",\n  \"./✓ Assertions should assert an element is not visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is not visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is not visible/test.log\",\n  \"./✓ Assertions should assert an element is visible\",\n  \"./✓ Assertions should assert an element is visible/afterEach.png\",\n  \"./✓ Assertions should assert an element is visible/beforeEach.png\",\n  \"./✓ Assertions should assert an element is visible/test.log\",\n  \"./✓ Async and Callbacks should handle async await\",\n  \"./✓ Async and Callbacks should handle async await/afterEach.png\",\n  \"./✓ Async and Callbacks should handle async await/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle async await/test.log\",\n  \"./✓ Async and Callbacks should handle done() callback\",\n  \"./✓ Async and Callbacks should handle done() callback/afterEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/beforeEach.png\",\n  \"./✓ Async and Callbacks should handle done() callback/test.log\",\n  \"./✓ Device Orientation OrientationLandscape\",\n  \"./✓ Device Orientation OrientationLandscape/afterEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/beforeEach.png\",\n  \"./✓ Device Orientation OrientationLandscape/test.log\",\n  \"./✓ Device Orientation OrientationPortrait\",\n  \"./✓ Device Orientation OrientationPortrait/afterEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/beforeEach.png\",\n  \"./✓ Device Orientation OrientationPortrait/test.log\",\n  \"./✓ Device _ios_ shake() should shake screen\",\n  \"./✓ Device _ios_ shake() should shake screen/afterEach.png\",\n  \"./✓ Device _ios_ shake() should shake screen/beforeEach.png\",\n  \"./✓ Device _ios_ shake() should shake screen/test.log\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/afterEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/beforeEach.png\",\n  \"./✓ Device launchApp({newInstance_ true}) + sendToHome() + launchApp() - should bring up previous instance/test.log\",\n  \"./✓ Device relaunchApp - should tap successfully\",\n  \"./✓ Device relaunchApp - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp - should tap successfully/test.log\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/afterEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/beforeEach.png\",\n  \"./✓ Device relaunchApp({delete_ true}) - should tap successfully/test.log\",\n  \"./✓ Device reloadReactNative - should tap successfully\",\n  \"./✓ Device reloadReactNative - should tap successfully/afterEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/beforeEach.png\",\n  \"./✓ Device reloadReactNative - should tap successfully/test.log\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device resetContentAndSettings() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/afterEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/beforeEach.png\",\n  \"./✓ Device uninstall() + install() + relaunch() - should tap successfully/test.log\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/afterEach.png\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/beforeEach.png\",\n  \"./✓ Matchers _ios_ should match elements by accesibility trait/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) id\",\n  \"./✓ Matchers should match elements by (accesibility) id/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) id/test.log\",\n  \"./✓ Matchers should match elements by (accesibility) label\",\n  \"./✓ Matchers should match elements by (accesibility) label/afterEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/beforeEach.png\",\n  \"./✓ Matchers should match elements by (accesibility) label/test.log\",\n  \"./✓ Matchers should match elements by index\",\n  \"./✓ Matchers should match elements by index/afterEach.png\",\n  \"./✓ Matchers should match elements by index/beforeEach.png\",\n  \"./✓ Matchers should match elements by index/test.log\",\n  \"./✓ Matchers should match elements by type (native class)\",\n  \"./✓ Matchers should match elements by type (native class)/afterEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/beforeEach.png\",\n  \"./✓ Matchers should match elements by type (native class)/test.log\",\n  \"./✓ Matchers should match elements by using two matchers together with and\",\n  \"./✓ Matchers should match elements by using two matchers together with and/afterEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/beforeEach.png\",\n  \"./✓ Matchers should match elements by using two matchers together with and/test.log\",\n  \"./✓ Matchers should match elements with ancenstor (parent)\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/afterEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/beforeEach.png\",\n  \"./✓ Matchers should match elements with ancenstor (parent)/test.log\",\n  \"./✓ Matchers should match elements with descendant (child)\",\n  \"./✓ Matchers should match elements with descendant (child)/afterEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/beforeEach.png\",\n  \"./✓ Matchers should match elements with descendant (child)/test.log\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with long network requests - 3000ms/test.log\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/afterEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/beforeEach.png\",\n  \"./✓ Network Synchronization Sync with short network requests - 100ms/test.log\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/afterEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/beforeEach.png\",\n  \"./✓ Network Synchronization disableSynchronization() should disable sync/test.log\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/afterEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/beforeEach.png\",\n  \"./✓ Network Synchronization setURLBlacklist() should disable synchronization for given endpoint/test.log\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({url_ url}) should trigger open url handling in app when app is in background/test.log\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/afterEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/beforeEach.png\",\n  \"./✓ Open URLs device.launchApp({{newInstance_ true, url_ url}) should launch app and trigger handling open url handling in app/test.log\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/afterEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/beforeEach.png\",\n  \"./✓ Open URLs device.openURL({url_ url}) should trigger open url handling in app when app is in foreground/test.log\",\n  \"./✓ Sanity should have welcome screen\",\n  \"./✓ Sanity should have welcome screen/afterEach.png\",\n  \"./✓ Sanity should have welcome screen/beforeEach.png\",\n  \"./✓ Sanity should have welcome screen/test.log\",\n  \"./✓ Sanity should show hello screen after tap\",\n  \"./✓ Sanity should show hello screen after tap/afterEach.png\",\n  \"./✓ Sanity should show hello screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show hello screen after tap/test.log\",\n  \"./✓ Sanity should show world screen after tap\",\n  \"./✓ Sanity should show world screen after tap/afterEach.png\",\n  \"./✓ Sanity should show world screen after tap/beforeEach.png\",\n  \"./✓ Sanity should show world screen after tap/test.log\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/afterEach.png\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/beforeEach.png\",\n  \"./✓ StressRoot _ios_ should switch root view controller from RN to RN/test.log\",\n  \"./✓ StressRoot should switch root view controller from RN to native\",\n  \"./✓ StressRoot should switch root view controller from RN to native/afterEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/beforeEach.png\",\n  \"./✓ StressRoot should switch root view controller from RN to native/test.log\",\n  \"./✓ StressTests should handle consecutive taps\",\n  \"./✓ StressTests should handle consecutive taps/afterEach.png\",\n  \"./✓ StressTests should handle consecutive taps/beforeEach.png\",\n  \"./✓ StressTests should handle consecutive taps/test.log\",\n  \"./✓ StressTests should handle tap during busy JS event loop\",\n  \"./✓ StressTests should handle tap during busy JS event loop/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy JS event loop/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (one way)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (setState)/test.log\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/afterEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/beforeEach.png\",\n  \"./✓ StressTests should handle tap during busy bridge (two way)/test.log\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts _ios_ should handle a short timeout/test.log\",\n  \"./✓ StressTimeouts should handle setImmediate\",\n  \"./✓ StressTimeouts should handle setImmediate/afterEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/beforeEach.png\",\n  \"./✓ StressTimeouts should handle setImmediate/test.log\",\n  \"./✓ StressTimeouts should handle zero timeout\",\n  \"./✓ StressTimeouts should handle zero timeout/afterEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should handle zero timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a long timeout\",\n  \"./✓ StressTimeouts should ignore a long timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a long timeout/test.log\",\n  \"./✓ StressTimeouts should ignore a short timeout\",\n  \"./✓ StressTimeouts should ignore a short timeout/afterEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore a short timeout/test.log\",\n  \"./✓ StressTimeouts should ignore setInterval\",\n  \"./✓ StressTimeouts should ignore setInterval/afterEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/beforeEach.png\",\n  \"./✓ StressTimeouts should ignore setInterval/test.log\",\n  \"./✓ WaitFor should find element by scrolling until it is visible\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/afterEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/beforeEach.png\",\n  \"./✓ WaitFor should find element by scrolling until it is visible/test.log\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is created and exists in layout/test.log\",\n  \"./✓ WaitFor should wait until an element is removed\",\n  \"./✓ WaitFor should wait until an element is removed/afterEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/beforeEach.png\",\n  \"./✓ WaitFor should wait until an element is removed/test.log\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/afterEach.png\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/beforeEach.png\",\n  \"./✓ _ios_ Crash Handling Should recover from app crash/test.log\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/afterEach.png\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/beforeEach.png\",\n  \"./✓ _ios_ Crash Handling Should throw error upon app crash/test.log\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/afterEach.png\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/beforeEach.png\",\n  \"./✓ _ios_ DatePicker datePicker should trigger change handler correctly/test.log\",\n  \"./✓ _ios_ Permissions Permissions denied\",\n  \"./✓ _ios_ Permissions Permissions denied/afterEach.png\",\n  \"./✓ _ios_ Permissions Permissions denied/beforeEach.png\",\n  \"./✓ _ios_ Permissions Permissions denied/test.log\",\n  \"./✓ _ios_ Permissions Permissions is granted\",\n  \"./✓ _ios_ Permissions Permissions is granted/afterEach.png\",\n  \"./✓ _ios_ Permissions Permissions is granted/beforeEach.png\",\n  \"./✓ _ios_ Permissions Permissions is granted/test.log\",\n  \"./✓ _ios_ User Activity Background searchable item\",\n  \"./✓ _ios_ User Activity Background searchable item/afterEach.png\",\n  \"./✓ _ios_ User Activity Background searchable item/beforeEach.png\",\n  \"./✓ _ios_ User Activity Background searchable item/test.log\",\n  \"./✓ _ios_ User Activity Foreground browsing web\",\n  \"./✓ _ios_ User Activity Foreground browsing web/afterEach.png\",\n  \"./✓ _ios_ User Activity Foreground browsing web/beforeEach.png\",\n  \"./✓ _ios_ User Activity Foreground browsing web/test.log\",\n  \"./✓ _ios_ User Activity Init from browsing web\",\n  \"./✓ _ios_ User Activity Init from browsing web/afterEach.png\",\n  \"./✓ _ios_ User Activity Init from browsing web/beforeEach.png\",\n  \"./✓ _ios_ User Activity Init from browsing web/test.log\",\n  \"./✓ _ios_ User Notifications Background calendar notification\",\n  \"./✓ _ios_ User Notifications Background calendar notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Background calendar notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Background calendar notification/test.log\",\n  \"./✓ _ios_ User Notifications Background push notification\",\n  \"./✓ _ios_ User Notifications Background push notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Background push notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Background push notification/test.log\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/afterEach.png\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Foreground calendar notifications/test.log\",\n  \"./✓ _ios_ User Notifications Foreground push notifications\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/afterEach.png\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Foreground push notifications/test.log\",\n  \"./✓ _ios_ User Notifications Init from push notification\",\n  \"./✓ _ios_ User Notifications Init from push notification/afterEach.png\",\n  \"./✓ _ios_ User Notifications Init from push notification/beforeEach.png\",\n  \"./✓ _ios_ User Notifications Init from push notification/test.log\",\n  \"./✓ _ios_ location Location should be unavabilable\",\n  \"./✓ _ios_ location Location should be unavabilable/afterEach.png\",\n  \"./✓ _ios_ location Location should be unavabilable/beforeEach.png\",\n  \"./✓ _ios_ location Location should be unavabilable/test.log\",\n  \"./✓ _ios_ location Should receive location (20,20)\",\n  \"./✓ _ios_ location Should receive location (20,20)/afterEach.png\",\n  \"./✓ _ios_ location Should receive location (20,20)/beforeEach.png\",\n  \"./✓ _ios_ location Should receive location (20,20)/test.log\",\n  \"1.detox.json.log\",\n  \"1.detox.log\",\n  \"1.startup.log\",\n]\n`;\n"
  },
  {
    "path": "detox/test/scripts/assert_timeout.js",
    "content": "// eslint-disable no-process-exit\nconst cp = require('child_process');\n\nconst [,, command, ...args] = process.argv;\n\nconst testProcess = cp.spawn(command, args, { stdio: 'inherit' });\n\nlet handle = setTimeout(() => {\n  handle = null;\n  testProcess.kill('SIGTERM');\n}, 60000);\n\ntestProcess.on('exit', (code) => {\n  if (code === 0 || !handle) {\n    console.error('Assertion failed! Detox should have exited with its own timeout error, but it did not.');\n    process.exit(1);\n  } else {\n    console.log('Assertion passed. Detox on its own has torn down an E2E test after a timeout.');\n    process.exit(0);\n  }\n});\n"
  },
  {
    "path": "detox/test/scripts/ci_unhappy.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nexport DISABLE_JUNIT_REPORTER=1\nexport DETOX_RETRIES=0\n\nplatform=$1\n\ncopy_coverage_to() {\n    if [ -n \"$CI\" ]; then\n      cp coverage/lcov.info \"$1\"\n    fi\n}\n\necho \"Running e2e test for timeout handling...\"\nexport DETOX_LOGLEVEL=trace\nexport DETOX_JEST_SETUP_TIMEOUT=1000\nnode scripts/assert_timeout.js npm run \"e2e:$platform\" -- e2e-unhappy/env-setup-timeout.test.js\ncopy_coverage_to \"../../coverage/e2e-$platform-timeout-ci.lcov\"\nunset DETOX_JEST_SETUP_TIMEOUT\nunset DETOX_LOGLEVEL\n\necho \"Running early syntax error test...\"\nnode scripts/assert_timeout.js npm run \"e2e:$platform\" -- e2e-unhappy/early-syntax-error.test.js\ncopy_coverage_to \"../../coverage/e2e-early-syntax-error-$platform-ci.lcov\"\n\necho \"Running e2e stack trace mangling test...\"\nrunnerOutput=\"$(npm run \"e2e:$platform\" -- -H e2e-unhappy/failing-matcher.test.js 2>&1 | tee /dev/stdout)\"\n\nif grep -q \"await.*element.*supercalifragilisticexpialidocious\" <<< \"$runnerOutput\" ;\nthen\n    echo \"Stack trace mangling for Client.js passed OK.\"\n    copy_coverage_to \"../../coverage/e2e-$platform-error-stack-client-js.lcov\"\nelse\n    echo \"Stack trace mangling for Client.js test has failed\"\n    echo \"$runnerOutput\"\n    exit 1\nfi\n\necho \"Running e2e stack trace mangling test (Device.js.js)...\"\nrunnerOutput=\"$(npm run \"e2e:$platform\" -- e2e-unhappy/failing-device-method.test.js 2>&1 | tee /dev/stdout)\"\n\nif grep -q \"await.*device.*selectApp\" <<< \"$runnerOutput\" ;\nthen\n    echo \"Stack trace mangling for Device.js has passed OK.\"\n    copy_coverage_to \"../../coverage/e2e-$platform-error-stack-device-js.lcov\"\nelse\n    echo \"Stack trace mangling for Device.js test has failed\"\n    echo \"$runnerOutput\"\n    exit 1\nfi\n"
  },
  {
    "path": "detox/test/scripts/postinstall.js",
    "content": "const fs = require('fs-extra');\nconst cp = require('child_process');\nconst { patchGradleByRNVersion } = require('../../scripts/updateGradle');\n\nconst patchBoostPodspec = () => {\n  const log = message => console.log(`[POST-INSTALL] ${message}`);\n  const boostPodspecPath = `${process.cwd()}/node_modules/react-native/third-party-podspecs/boost.podspec`;\n  const originalUrl = 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2';\n  const patchedUrl = 'https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2';\n\n  if (!fs.existsSync(boostPodspecPath)) {\n    log('boost.podspec does not exist, skipping patch...');\n    return;\n  }\n\n  let boostPodspec = fs.readFileSync(boostPodspecPath, 'utf8');\n\n  if (!boostPodspec.includes(originalUrl)) {\n    log('boost.podspec is already patched or the URL is different, skipping patch...');\n    return;\n  }\n\n  log('Applying boost.podspec patch...');\n  boostPodspec = boostPodspec.replace(originalUrl, patchedUrl);\n  fs.writeFileSync(boostPodspecPath, boostPodspec, 'utf8');\n};\n\nfunction podInstallIfRequired() {\n  if (process.platform === 'darwin' && !process.env.DETOX_DISABLE_POD_INSTALL) {\n    console.log('[POST-INSTALL] Running pod install...');\n    patchBoostPodspec();\n\n    cp.execSync('pod install', {\n      cwd: `${process.cwd()}/ios`,\n      stdio: 'inherit'\n    });\n  }\n}\n\nconsole.log('[POST-INSTALL] Running Detox\\'s test-app post-install script...');\npodInstallIfRequired();\npatchGradleByRNVersion()\nconsole.log('[POST-INSTALL] Completed!');\n"
  },
  {
    "path": "detox/test/scripts/test_android.sh",
    "content": "#!/bin/bash -e\n\n# DEPRECATED\necho \"DEPRECATED, Run: detox build -c android.emu.debug && detox test -c android.emu.debug\""
  },
  {
    "path": "detox/test/scripts/verify_artifacts_are_not_missing.android.test.js",
    "content": "const verify = require('./verify_artifacts_are_not_missing');\n\ndescribe('artifacts health check', () => {\n  it('should have all the Android artifacts in ./artifacts folder', verify('android.emu.release'));\n});\n"
  },
  {
    "path": "detox/test/scripts/verify_artifacts_are_not_missing.ios.test.js",
    "content": "const verify = require('./verify_artifacts_are_not_missing');\n\ndescribe('artifacts health check', () => {\n  it('should have all the iOS artifacts in ./artifacts folder', verify('ios.sim.release'));\n});\n"
  },
  {
    "path": "detox/test/scripts/verify_artifacts_are_not_missing.js",
    "content": "const _ = require('lodash');\nconst cp = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = function verify(configuration) {\n  let startupLogs = 0;\n  let textLogs = 0;\n  let jsonLogs = 0;\n\n  const subdir = _.last(_.filter(fs.readdirSync('artifacts'), (str) => str.includes(configuration)));\n  const artifacts = cp.execSync(`find .`, {\n    cwd: path.join('artifacts', subdir),\n    encoding: 'utf8'\n  }).split('\\n').map((filename) => {\n    if (filename.endsWith('.startup.log')) {\n      return `${++startupLogs}.startup.log`;\n    }\n\n    if (filename.match(/detox_pid_\\d+.log$/)) {\n      return `${++textLogs}.detox.log`;\n    }\n\n    if (filename.match(/detox_pid_\\d+.json.log$/)) {\n      return `${++jsonLogs}.detox.json.log`;\n    }\n\n    return filename;\n  }).sort();\n\n  expect(artifacts).toMatchSnapshot();\n};\n"
  },
  {
    "path": "detox/test/src/Screens/AbstractArgsListScreen.js",
    "content": "import _ from 'lodash';\nimport React, { Component } from 'react';\nimport {\n  Text,\n  View,\n} from 'react-native';\n\nexport default class AbstractArgsListScreen extends Component {\n\n  constructor(props, contextName) {\n    super(props);\n    this.contextName = contextName;\n\n    this.state = {\n      argsList: undefined,\n    }\n  }\n\n  async componentDidMount() {\n    const argsList = await this.readArguments();\n    this.setState({\n      argsList,\n    })\n  }\n\n  readArguments() {\n    return Promise.reject('Not implemented');\n  }\n\n  getTitle() {\n    return Promise.reject('Not implemented');\n  }\n\n  render() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        {this.renderTitle()}\n\n        {this.state.argsList && this.renderArgsList()}\n\n        <Text style={{paddingTop: 20, fontWeight: 'bold'}}>Arguments count: </Text>\n        {this.state.argsList && <Text testID=\"argsCount\">{Object.keys(this.state.argsList || {}).length}</Text>}\n      </View>\n    );\n  }\n\n  renderTitle() {\n    const title = this.getTitle();\n    return <Text style={{fontSize: 25, marginBottom: 30}}>{title}</Text>\n  }\n\n  renderArgsList() {\n    return _.reduce(this.state.argsList, (result, argValue, argName) => {\n      const _argValue = (_.isArray(argValue) || _.isObject(argValue) ? JSON.stringify(argValue) : argValue.toString());\n      const itemId = `${this.contextName}-${argName}`;\n      const nameId = itemId + '.name';\n      const valueId = itemId + '.value';\n      result.push(\n        <Text key={nameId} testID={nameId} style={{fontWeight: 'bold'}}>{argName}:</Text>,\n        <Text key={valueId} testID={valueId} style={{paddingBottom: 4}}>{_argValue}</Text>,\n      );\n      return result;\n    }, []);\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/ActionsScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  BackHandler,\n  View,\n  TouchableOpacity,\n  ScrollView,\n  RefreshControl,\n  Platform,\n  Dimensions,\n  StyleSheet,\n  SafeAreaView,\n  requireNativeComponent,\n} from 'react-native';\nimport TextInput from '../Views/TextInput';\nimport Slider from '@react-native-community/slider';\n\nlet LegacySlider;\ntry {\n  LegacySlider = require('react-native').Slider;\n} catch (e) {\n  // Ignore\n}\n\nconst DoubleTapsText = requireNativeComponent('DetoxDoubleTapsTextView');\nconst SluggishTapsText = requireNativeComponent('DetoxSluggishTapsTextView');\n\nconst { width } = Dimensions.get('window');\n\n// Calc horizontal item size to have exactly 5 items visible\nconst hItemWidth = (width / 5) - 20;\n\nconst styles = StyleSheet.create({\n  item: { height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10 },\n  horizItem: { width: hItemWidth, backgroundColor: '#e8e8f8', margin: 10, textAlign: 'center', textAlignVertical: 'center' },\n});\n\nconst isIos = Platform.OS === 'ios';\nconst isAndroid = Platform.OS === 'android';\n\nexport default class ActionsScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined,\n      typeText: '',\n      clearText: 'some stuff here..',\n      numTaps: 0,\n      isRefreshing: false,\n      backPressed: false,\n      showScrollOverlays: false,\n    };\n  }\n\n  componentDidMount() {\n    BackHandler.addEventListener('hardwareBackPress', this.backHandler.bind(this));\n  }\n\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    if (this.state.backPressed) return this.renderPopupBackPressedDetected();\n\n    return (\n      <SafeAreaView  testID='View7990' style={{ flex: 1 ,justifyContent: 'flex-start' }}>\n\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'Tap Working')}\n          onLongPress={this.onButtonPress.bind(this, 'Long Press Working')}\n          testID=\"View7991\"\n          accessibilityActions={[\n            { name: 'activate', label: 'activate' },\n            { name: 'increment', label: 'increment' },\n            { name: 'decrement', label: 'decrement' },\n            { name: 'magicTap', label: 'magicTap' },\n            { name: 'escape', label: 'escape' },\n            { name: 'longpress', label: 'longpress' },\n            { name: 'custom', label: 'custom' }\n          ]}\n          onAccessibilityAction={({ nativeEvent: { actionName }}) => this.onButtonPress(`Accessibility Action ${actionName} Working`)}\n        >\n          <Text style={{ color: 'blue', marginTop: isIos? 40 : 0, marginBottom: 10, textAlign: 'center' }}>Tap Me</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity\n          delayLongPress={1200}\n          onLongPress={this.onButtonPress.bind(this, 'Long Press With Duration Working')}\n        >\n          <Text style={{ color: 'blue', marginBottom: 10, textAlign: 'center' }}>Long Press Me 1.5s</Text>\n        </TouchableOpacity>\n\n        <View\n          onStartShouldSetResponder={(event) => {\n            const nativeEvent = event.nativeEvent;\n            return nativeEvent.locationX < 10 && nativeEvent.locationY < 10;\n          }}\n          onResponderRelease={() => this.onButtonPress('Long Press on Top Left Working')}\n        >\n          <Text style={{ color: 'blue', marginBottom: 10, textAlign: 'center' }}>Long Press on Top Left</Text>\n        </View>\n\n        <TouchableOpacity onPress={this.onLongTimeout.bind(this)}\n        >\n          <Text testID='WhyDoAllTheTestIDsHaveTheseStrangeNames' style={{ color: 'blue', marginBottom: 10, textAlign: 'center' }}>Tap Me For Long Timeout</Text>\n        </TouchableOpacity>\n\n        <View style={{flexDirection: 'row', justifyContent: 'center', marginBottom: 10}}>\n          <TouchableOpacity onPress={this.onMultiTapPress.bind(this)}>\n            <Text style={{ color: 'blue', textAlign: 'center' }}\n              testID='UniqueId819'>Taps: {this.state.numTaps}</Text>\n          </TouchableOpacity>\n\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && <View style={{ width: 110 }}>\n            <DoubleTapsText style={{ flex: 1 }}/>\n          </View>}\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && <View style={{ width: 75 }}>\n            <SluggishTapsText style={{ flex: 1 }}/>\n          </View>}\n        </View>\n\n        <View testID='UniqueId937_wrapper' accessible={true}>\n          <TextInput style={{ height: 40, borderColor: 'gray', borderWidth: 1, marginBottom: 10, marginHorizontal: 20, padding: 5 }}\n            onChangeText={this.onChangeTypeText.bind(this)}\n            value={this.state.typeText}\n            testID='UniqueId937'\n            onSubmitEditing={this.onReturn.bind(this)}\n            />\n        </View>\n\n        {isIos && <TouchableOpacity style={{ height: 40, borderColor: 'gray', borderWidth: 1, marginBottom: 10, marginHorizontal: 20, padding: 5 }} testID='NoTextInputInside' />}\n\n        <TextInput style={{ height: 40, borderColor: 'gray', borderWidth: 1, marginBottom: 10, marginHorizontal: 20, padding: 5 }}\n          onChangeText={this.onChangeClearText.bind(this)}\n          value={this.state.clearText}\n          testID='UniqueId005'\n          multiline\n        />\n\n        <TextInput style={{ height: 40, borderColor: 'gray', borderWidth: 1, marginBottom: 10, marginHorizontal: 20, padding: 5 }}\n          onChangeText={this.onReplaceText.bind(this)}\n          value={this.state.replaceText}\n          testID='UniqueId006'\n        />\n\n        <View style={{ height: 20, borderColor: '#c0c0c0', borderWidth: 1, flexDirection: 'row', justifyContent: 'space-evenly', alignItems: 'center' }}>\n          <TouchableOpacity onPress={this.onToggleScrollViewVisibility.bind(this)}>\n            <Text testID='toggleScrollOverlays' style={{ color: 'blue' }}>Toggle scroll overlays</Text>\n          </TouchableOpacity>\n        </View>\n\n        <View style={{ height: 100, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff' }}>\n          <ScrollView testID='ScrollView161'>\n            <Text style={styles.item}>Text1</Text>\n            <Text style={styles.item}>Text2</Text>\n            <Text style={styles.item}>Text3</Text>\n            <Text style={styles.item}>Text4</Text>\n            <Text style={styles.item}>Text5</Text>\n            <Text style={styles.item}>Text6</Text>\n            <Text style={styles.item}>Text7</Text>\n            <Text style={styles.item}>Text8</Text>\n            <Text style={styles.item}>Text9</Text>\n            <Text style={styles.item}>Text10</Text>\n            <Text style={styles.item}>Text11</Text>\n            <Text style={styles.item}>Text12</Text>\n          </ScrollView>\n          { this.state.showScrollOverlays ? <View style={{ height: 55, width: width * 0.75, backgroundColor: 'deepskyblue', position: 'absolute', bottom: 0 }} /> : null }\n          { this.state.showScrollOverlays ? <View style={{ height: 55, width: width * 0.75, backgroundColor: 'goldenrod', position: 'absolute', right: 0 }} /> : null }\n        </View>\n\n        <View style={{ height: 50, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff' }}>\n          <ScrollView testID='ScrollViewH' horizontal>\n            <Text style={styles.horizItem}>HText1</Text>\n            <Text style={styles.horizItem}>HText2</Text>\n            <Text style={styles.horizItem}>HText3</Text>\n            <Text style={styles.horizItem}>HText4</Text>\n            <Text style={styles.horizItem}>HText5</Text>\n            <Text style={styles.horizItem}>HText6</Text>\n            <Text style={styles.horizItem}>HText7</Text>\n            <Text style={styles.horizItem}>HText8</Text>\n          </ScrollView>\n          { this.state.showScrollOverlays ? <View style={{ height: 28, width: width * 0.75, backgroundColor: 'goldenrod', position: 'absolute', bottom: 0 }} /> : null }\n          { this.state.showScrollOverlays ? <View style={{ height: 28, width: width * 0.75, backgroundColor: 'deepskyblue', position: 'absolute', right: 0 }} /> : null }\n        </View>\n\n        <View style={{ height: 100, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff', marginBottom: 15 }}>\n          <ScrollView testID='ScrollView799' refreshControl={\n            <RefreshControl refreshing={this.state.isRefreshing} onRefresh={this.onRefresh.bind(this)} title=\"Loading...\" />\n          }>\n            <Text style={styles.item}>Pull down to see RefreshControl indicator</Text>\n          </ScrollView>\n        </View>\n\n        {\n          LegacySlider &&\n          <View style={{ height: 40, borderColor: '#c0c0c0', marginHorizontal: 20 }}>\n            <LegacySlider testID='legacySliderWithASimpleID' maximumValue={1000.0} minimumValue={0.0} value={250.0} />\n          </View>\n        }\n\n        <View style={{ height: 40, borderColor: '#c0c0c0', marginHorizontal: 20 }}>\n          <Slider testID='sliderWithASimpleID' maximumValue={1000.0} minimumValue={0.0} value={250.0}/>\n        </View>\n\n        <View>\n          <ScrollView testID='PinchableScrollView' minimumZoomScale={1} maximumZoomScale={10}>\n            <View>\n              <View testID='UniqueId007' style={{ height: 30, width: 30, backgroundColor:'red' }} />\n            </View>\n          </ScrollView>\n        </View>\n      </SafeAreaView>\n    );\n  }\n\n  renderInlineSeparator() {\n    return <Text style={{width: 10}}> | </Text>;\n  }\n\n  renderAfterButton() {\n    return (\n      <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>\n        <Text style={{ fontSize: 25 }}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n\n  renderPopupBackPressedDetected() {\n    return (\n      <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>\n        <Text style={{ fontSize: 25 }}>\n          Back pressed !\n        </Text>\n      </View>\n    );\n  }\n\n  onButtonPress(greeting) {\n    this.setState({\n      greeting: greeting\n    });\n  }\n\n  onReturn() {\n    this.setState({\n      greeting: \"Return Working\"\n    });\n  }\n\n  onLongTimeout() {\n    setTimeout(() => {\n      this.setState({\n        greeting: \"After Long Timeout\"\n      });\n    }, 4000);\n  }\n\n  onMultiTapPress() {\n    this.setState({\n      numTaps: this.state.numTaps + 1\n    });\n  }\n\n  onChangeTypeText(text) {\n    if (text === 'passcode') {\n      this.setState({\n        greeting: 'Type Working'\n      });\n    } else {\n      this.setState({\n        typeText: text\n      });\n    }\n  }\n\n  onReplaceText(text) {\n    if (text === 'replaced_text') {\n      this.setState({\n        greeting: 'Replace Working'\n      });\n    } else {\n      this.setState({\n        replaceText: text\n      });\n    }\n  }\n\n  onChangeClearText(text) {\n    if (text === '') {\n      this.setState({\n        greeting: 'Clear Working'\n      });\n    } else {\n      this.setState({\n        clearText: text\n      });\n    }\n  }\n\n  onRefresh() {\n    this.setState({\n      isRefreshing: true\n    });\n    setTimeout(() => {\n      this.setState({\n        greeting: 'PullToReload Working'\n      });\n    }, 500);\n  }\n\n  onToggleScrollViewVisibility() {\n    this.setState({\n      showScrollOverlays: !this.state.showScrollOverlays,\n    })\n  }\n\n  backHandler() {\n    this.setState({\n      backPressed: true\n    });\n    return true;\n  }\n\n}\n"
  },
  {
    "path": "detox/test/src/Screens/AlertScreen.tsx",
    "content": "import React, { Component, useState } from 'react';\nimport { Alert, Button, SafeAreaView, Text, View } from 'react-native';\n\n\nconst AlertComponent = () => {\n    const [textState, setTextState] = useState('Not Pressed');\n\n    return (\n        <SafeAreaView style={{ flex: 1 }}>\n            <View style={{ flex: 1, alignContent: 'center' }}>\n                <Text style={{ padding: 16 }} testID='AlertScreen.Text'>{textState}</Text>\n\n                <Button title={'Show Alert'} testID='AlertScreen.Button' onPress={() => {\n                    Alert.alert(\n                        'Alert Title',\n                        'My Alert Msg',\n                        [{\n                            text: 'Cancel',\n                            onPress: () => setTextState('Cancel Pressed')\n                        }, {\n                            text: 'OK',\n                            onPress: () => setTextState('OK Pressed')\n                        }\n                        ]);\n                }} />\n            </View>\n        </SafeAreaView>\n    );\n};\n\nexport default class AlertScreen extends Component {\n    render() {\n        return (\n            <AlertComponent />\n        );\n    }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/AnimationsScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  Animated,\n  Button,\n  Platform,\n  Switch,\n  TextInput\n} from 'react-native';\nimport SegmentedControl from '../Views/SegmentedControl.js';\n\nclass AnimationsComponent extends Component {\n  constructor(props) {\n    super(props);\n\n    this._fadeInValue = new Animated.Value(0);\n    this.state = {\n      showAfterAnimationText: false\n    };\n  }\n\n  componentDidMount() {\n    const fadeInAnimation = Animated.timing(this._fadeInValue, {\n      toValue: 1,\n      duration: this.props.duration,\n      delay: this.props.delay,\n      useNativeDriver: this.props.useNativeDriver\n    });\n    const fadeOutAnimation = Animated.timing(this._fadeInValue, {\n      toValue: 0.5,\n      duration: 0,\n      useNativeDriver: this.props.useNativeDriver\n    });\n\n    let animation;\n    if (this.props.loops === undefined) {\n      animation = fadeInAnimation;\n    } else {\n      animation = Animated.loop(\n        Animated.sequence([fadeInAnimation, fadeOutAnimation]),\n        {\n          iterations: this.props.loops\n        }\n      );\n    }\n\n    animation.start(() => this.setState({ showAfterAnimationText: true }));\n  }\n\n  render() {\n    return (\n      <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>\n        <Animated.Text accessible={true} testID='UniqueId_AnimationsScreen_animatedText' style={{\n          opacity: this._fadeInValue,\n          backgroundColor: 'green'\n        }}\n        >\n          Fading in text\n        </Animated.Text>\n        {this.renderAfterAnimTextIfNeeded()}\n      </View>\n    );\n  }\n\n  renderAfterAnimTextIfNeeded() {\n    if (this.state.showAfterAnimationText) {\n      return (\n        <View accessible={true} testID='UniqueId_AnimationsScreen_afterAnimationText'>\n          <Text style={{ marginTop: 20 }}>\n            After-animation-text\n          </Text>\n        </View>\n      );\n    }\n    return undefined;\n  }\n}\n\n\nexport default class AnimationsScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      useNativeDriver: undefined,\n      enableLoop: false,\n      numberOfIterations: -1,\n      duration: 400,\n      delay: 0,\n      testStarted: false\n    };\n  }\n\n  render() {\n    if (this.state.testStarted) {\n      return (\n        <AnimationsComponent\n          useNativeDriver={this.state.useNativeDriver}\n          loops={this.state.enableLoop ? this.state.numberOfIterations : undefined}\n          duration={this.state.duration}\n          delay={this.state.delay}\n        />\n      );\n    }\n\n    let numOfIterationsColor = this.state.enableLoop ? 'black' : 'grey';\n    return (\n      <View style={{ flex: 1, paddingTop: 20, paddingLeft: 20, paddingRight: 20, justifyContent: 'center', alignItems: 'stretch' }}>\n        <Button\n          style={{paddingTop: 20}}\n          title=\"Start\"\n          testID=\"UniqueId_AnimationsScreen_startButton\"\n          disabled={this.state.useNativeDriver === undefined}\n          onPress={() => this.setState({ testStarted: true })}\n        />\n        <View style={{paddingTop: 20}}>\n          <Text>Driver:</Text>\n          <SegmentedControl\n            acessible={true}\n            testID=\"UniqueId_AnimationsScreen_useNativeDriver\"\n            values={['JS', 'Native']}\n            selectedIndex={-1}\n            onValueChange={(value) => this.setState({ useNativeDriver: value === 'Native' })}\n          />\n        </View>\n        <View style={{paddingTop: 20}}>\n          <Text>Loop:</Text>\n          <Switch\n            accessible={true}\n            testID=\"UniqueId_AnimationsScreen_enableLoop\"\n            value={this.state.enableLoop}\n            onValueChange={(value) => this.setState({enableLoop: value})}\n          />\n          <Text style={{color: numOfIterationsColor}}>Number of iterations:</Text>\n          <TextInput style={{color: numOfIterationsColor, height: Platform.OS == 'android' ? 40 : 20}}\n            testID=\"UniqueId_AnimationsScreen_numberOfIterations\"\n            editable={this.state.enableLoop}\n            onChangeText={(value) => this.setState({numberOfIterations: Number(value)})}\n            placeholder={String(this.state.numberOfIterations)}\n          />\n        </View>\n        <View style={{paddingTop: 20}}>\n          <Text>Duration:</Text>\n          <TextInput style={{height: Platform.OS == 'android' ? 40 : 20}}\n            testID=\"UniqueId_AnimationsScreen_duration\"\n            onChangeText={(value) => this.setState({duration: Number(value)})}\n            placeholder={String(this.state.duration)}\n          />\n        </View>\n        <View style={{paddingTop: 20}}>\n          <Text>Delay:</Text>\n          <TextInput style={{height: Platform.OS == 'android' ? 40 : 20}}\n            testID=\"UniqueId_AnimationsScreen_delay\"\n            onChangeText={(value) => this.setState({delay: Number(value)})}\n            placeholder={String(this.state.delay)}\n          />\n        </View>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/AssertionsScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  Switch,\n  Image,\n} from 'react-native';\n\nexport default class AssertionsScreen extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      switchValue: false\n    }\n  }\n\n  render() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text testID='main-text' style={{marginBottom: 20}} accessibilityLabel={'I contain some text'}>I contain some text</Text>\n        <View testID='subtext-root' style={{marginBottom: 20}} accessible={true}>\n          <Text accessibilityLabel={'This is some'}>This is some</Text>\n          <Text accessibilityLabel={'subtext'}>subtext</Text>\n        </View>\n        <Image testID='example-image' source={{ uri: 'https://cdn.vectorstock.com/i/1000v/68/78/different-of-fruits-realistic-vector-21566878.jpg' }}\n               style={{width: 100, height: 90, marginBottom: 20,}} accessibilityLabel=\"Example Image\" />\n        <Text testID='color-text1' style={{color: 'green', marginBottom: 20}}>\n          Some more text here\n        </Text>\n        <Text testID='color-text2' style={{color: 'blue', marginBottom: 20}}>\n          I am pink\n        </Text>\n        <Text testID='offscreen-text' style={{marginBottom: 20, position: 'absolute', left: -200}}>I am not visible</Text>\n        <TestSwitchWidget testID='toggle'/>\n        <Text style={{position: 'absolute', top: 20, left: 20, fontSize: 40,}} testID='smile-emoji'>😊</Text>\n        <Text style={{ position: 'absolute', bottom: 20, right: 20, fontSize: 40,}} testID='celebration-emoji'>🎉</Text>\n      </View>\n    );\n  }\n}\n\nclass TestSwitchWidget extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      value: false\n    }\n    this.onChange = () => this.setState({ value: !this.state.value });\n  }\n\n  render() {\n    return <Switch testID={this.props.testID} onChange={this.onChange} value={this.state.value}/>\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/AttributesScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Platform,\n  Text,\n  View,\n  TextInput,\n  ScrollView\n} from 'react-native';\nimport CheckBox from '@react-native-community/checkbox';\nimport Slider from '@react-native-community/slider';\nimport {default as DatePicker} from '@react-native-community/datetimepicker';\nlet LegacySlider;\ntry {\n  LegacySlider = require('react-native').Slider;\n} catch (e) {\n  // Ignore\n}\n\nexport default class AttributesScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      checkBoxValue: false\n    };\n  }\n\n  render() {\n    const datePicker = Platform.OS === 'ios' ?\n      (<DatePicker key='datePicker' testID='attrDatePicker' style={{ width: '100%', height: 200 }}\n                   value={new Date(2022, 0, 1)} />)\n      : undefined;\n\n    return (\n      <View style={{ flex: 1, justifyContent: 'center' }}>\n        {datePicker}\n        <View testID={'viewId'} width={100} height={100} />\n        <View style={{ height: 100, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff' }}>\n          <ScrollView testID='attrScrollView'>\n            <View testID={'innerView1'} width={100} height={75} style={{ backgroundColor: '#8cc' }} />\n            <View testID={'innerView2'} width={100} height={75} style={{ backgroundColor: '#c8c' }} />\n          </ScrollView>\n        </View>\n        <Text testID={'textViewId'} accessibilityLabel={'TextView'}>TextView</Text>\n        <View testID={'textGroupRoot'} marginLeft={20} accessible={true}>\n          <Text accessibilityLabel={'InnerText1'}>Some inner text</Text>\n          <Text accessibilityLabel={'InnerText2'}>Some more inner text</Text>\n        </View>\n        <CheckBox\n          disabled={false}\n          testID={'checkboxId'}\n          value={this.state.checkBoxValue}\n          onValueChange={(value) => this.setState({\n            checkBoxValue: value\n          })}\n        />\n        <TextInput\n          testID={'focusedTextInputId'} value={'focused'} placeholder={'palace-holder'}\n          style={{\n            height: 40,\n            borderColor: 'gray',\n            borderWidth: 1,\n            marginBottom: 10,\n            marginHorizontal: 20,\n            padding: 5\n          }}\n          autoFocus={true}\n        />\n        <TextInput\n          testID={'blurredTextInputId'} value={'blurred'} placeholder={'palace-holder'}\n          style={{\n            height: 40,\n            borderColor: 'gray',\n            borderWidth: 1,\n            marginBottom: 10,\n            marginHorizontal: 20,\n            padding: 5\n          }}\n          autoFocus={false}\n        />\n        {LegacySlider && <LegacySlider testID={'legacySliderId'} value={0.5} />}\n        <Slider testID={'sliderId'} value={0.5} />\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/DatePickerScreen.js",
    "content": "import upperFirst from 'lodash/upperFirst';\nimport moment from 'moment';\nimport React, { Component } from 'react';\nimport { Text, View, StyleSheet, Button, Platform } from 'react-native';\nimport { default as DatePicker } from \"@react-native-community/datetimepicker\";\n\nconst shouldHideDatePicker = Platform.OS === 'android';\nconst INITIAL_CHOSEN_DATE = new Date('2023-07-01T19:30:00')\n\nexport default class DatePickerScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      chosenDate: INITIAL_CHOSEN_DATE,\n      datePickerVisible: !shouldHideDatePicker,\n      datePickerDisplay: DatePickerScreen.MODES[0],\n    };\n  }\n\n  _toggleDatePicker = () => {\n    const currentIndex = DatePickerScreen.MODES.indexOf(this.state.datePickerDisplay);\n    this.setState({\n      datePickerDisplay: DatePickerScreen.MODES[(currentIndex + 1) % DatePickerScreen.MODES.length],\n    });\n  }\n\n  _openDatePicker = () => {\n    this.setState({ datePickerVisible: true });\n  }\n\n  setDate = (e, newDate) => {\n    this.setState({\n      chosenDate: newDate,\n      datePickerVisible: !shouldHideDatePicker,\n    });\n  };\n\n  getTimeLocal() {\n    return moment(this.state.chosenDate).format(\"h:mm A\");\n  }\n\n  getDateLocal() {\n    return moment(this.state.chosenDate).format(\"MMM Do, YYYY\");\n  }\n\n  getTimeUTC() {\n    return moment(this.state.chosenDate).utc().format(\"h:mm A\");\n  }\n\n  getDateUTC() {\n    return moment(this.state.chosenDate).utc().format(\"MMM Do, YYYY\");\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.dateText} testID=\"utcDateLabel\">\n          {\"Date (UTC): \" + this.getDateUTC()}\n        </Text>\n        <Text style={styles.dateText} testID='utcTimeLabel'>\n          {\"Time (UTC): \" + this.getTimeUTC()}\n        </Text>\n        <Text style={styles.dateText} testID=\"localDateLabel\">\n          {\"Date (Local): \" + this.getDateLocal()}\n        </Text>\n        <Text style={styles.dateText} testID='localTimeLabel'>\n          {\"Time (Local): \" + this.getTimeLocal()}\n        </Text>\n        <View style={styles.container}>\n          <Button\n            title={`${upperFirst(this.state.datePickerDisplay)} Date Picker`}\n            testID='toggleDatePicker'\n            onPress={this._toggleDatePicker}\n          />\n        </View>\n        {shouldHideDatePicker && (\n          <View style={styles.container}>\n            <Button\n              title=\"Open Date Picker\"\n              testID='openDatePicker'\n              onPress={this._openDatePicker}\n            />\n          </View>\n        )}\n        {this.state.datePickerVisible && (\n          <DatePicker\n            testID=\"datePicker\"\n            mode='date'\n            // @ts-ignore\n            display={this.state.datePickerDisplay}\n            value={this.state.chosenDate}\n            onChange={this.setDate} />\n          )}\n      </View>\n    );\n  }\n\n  static MODES = Platform.OS === 'ios'\n    ? ['compact', 'inline', 'spinner']\n    : ['calendar', 'spinner'];\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    paddingTop: 100,\n    paddingBottom: 50,\n    flexDirection: 'column',\n    alignItems: 'center',\n    justifyContent: 'flex-start',\n  },\n  dateText: {\n    textAlign:'center'\n  }\n});\n"
  },
  {
    "path": "detox/test/src/Screens/DeviceScreen.js",
    "content": "import React, { Component } from 'react';\nimport { View, TouchableOpacity, StyleSheet, Text } from 'react-native';\n\nexport default class DeviceScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state ={\n      buttonText: 'Tap Me'\n    };\n    this.onButtonPressed = this.onButtonPressed.bind(this);\n  }\n\n  onButtonPressed() {\n    this.setState({\n      buttonText: 'Tap works'\n    })\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <TouchableOpacity onPress={this.onButtonPressed} style={styles.button}>\n          <Text style={styles.text}>{this.state.buttonText}</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: \"center\",\n    alignItems: \"center\"\n  },\n  button: {\n    padding: 10,\n    backgroundColor: '#aaaaaa',\n    height: 200,\n    width: \"40%\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n  },\n  text: {\n    color: 'blue',\n    textAlign: 'center'\n  }\n});\n"
  },
  {
    "path": "detox/test/src/Screens/DeviceTapScreen.tsx",
    "content": "import React, { useCallback, useState } from 'react';\nimport { Button, Text, TouchableOpacity, View } from 'react-native';\n\nconst DeviceTapScreen = () => {\n  const [shouldShowScreenText, setShouldShowScreenText] = useState(false);\n  const [shouldShowButtonText, setShouldShowButtonText] = useState(false);\n  const [shouldShowLongText, setShouldShowLongText] = useState(false);\n  const [shouldShowLongCustomText, setShouldShowLongCustomText] = useState(false);\n\n  const onPressLongCustom = useCallback(() => {\n    setShouldShowLongCustomText(true);\n  }, [setShouldShowLongCustomText]);\n\n  const onPressScreen = useCallback(() => {\n    setShouldShowScreenText(true);\n  }, [setShouldShowScreenText]);\n\n  const onPressButton = useCallback(() => {\n    setShouldShowButtonText(true);\n  }, [setShouldShowButtonText]);\n\n  const onPressLong = useCallback(() => {\n    setShouldShowLongText(true);\n  }, [setShouldShowLongText]);\n\n  return (<>\n    <TouchableOpacity onLongPress={onPressLong} onPress={onPressScreen} style={{ flex: 1 }}>\n      <View style={{ left: 190, top: 190, position: 'absolute' }}>\n        <Button onPress={onPressButton} title=\"TAP ME\" />\n      </View>\n      <TouchableOpacity delayLongPress={900} onLongPress={onPressLongCustom} style={{ left: 150, top: 150, position: 'absolute' }}>\n        <Text>{'TAP LONG TIME'}</Text>\n      </TouchableOpacity>\n      {shouldShowLongCustomText && <Text>{'Screen Long Custom Duration Pressed'}</Text>}\n      {shouldShowLongText && <Text>{'Screen Long Pressed'}</Text>}\n      {shouldShowScreenText && <Text>{'Screen Tapped'}</Text>}\n      {shouldShowButtonText && <Text>{'Button Tapped'}</Text>}\n    </TouchableOpacity>\n  </>\n  );\n};\n\nexport default DeviceTapScreen;\n"
  },
  {
    "path": "detox/test/src/Screens/DragNDropScreen.tsx",
    "content": "import React, { Component, useRef } from 'react';\nimport { Animated, PanResponder, SafeAreaView, View } from 'react-native';\n\n\nconst DragNDropComponent = () => {\n    const pan = useRef(new Animated.ValueXY()).current;\n\n    const panResponder = useRef(\n        PanResponder.create({\n            onMoveShouldSetPanResponder: () => true,\n            onPanResponderMove: Animated.event([null, { dx: pan.x, dy: pan.y }], { useNativeDriver: false }),\n            onPanResponderRelease: () => {\n                pan.extractOffset();\n            }\n        })\n    ).current;\n\n\n    return (\n        <Animated.View\n            style={{\n                transform: [{ translateX: pan.x }, { translateY: pan.y }]\n            }}\n            {...panResponder.panHandlers}>\n            <View testID=\"draggable\" style={{ height: 30, width: 30, backgroundColor: 'blue', borderRadius: 16 }} />\n        </Animated.View>\n    );\n};\n\nexport default class DragNDropScreen extends Component {\n    render() {\n        return (\n            <SafeAreaView style={{flex: 1}}>\n                <View style={{\n                    flex: 1,\n                    marginTop: 32,\n                    paddingHorizontal: 24\n                }}>\n                    <View testID=\"DragAndDropTarget\" style={{ width: 100, height: 100, alignSelf: 'center', backgroundColor: 'yellow' }} />\n\n                    <View style={{ flex: 1, justifyContent: 'flex-end'}}>\n                        <DragNDropComponent />\n                    </View>\n                </View>\n            </SafeAreaView>\n        );\n    }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/ElementScreenshotScreen.js",
    "content": "import React, { Component } from 'react';\nimport { View, Dimensions, TouchableHighlight } from 'react-native';\n\nconst screenWidth = Dimensions.get('window').width;\nconst screenHeight = Dimensions.get('window').height;\n\nclass ArtisticRectangle extends Component {\n  static defaultProps = {\n    borderSizeV: 12,\n    borderSizeH: 12,\n  }\n\n  render() {\n    const paddingHorizontal = this.props.borderSizeH;\n    const paddingVertical = this.props.borderSizeV;\n    return (\n      <View testID={this.props.testID} accessible={true}>\n        <View style={{paddingHorizontal, paddingVertical, backgroundColor: 'cyan'}}>\n          <View style={{paddingHorizontal, paddingVertical, backgroundColor: 'magenta'}}>\n            <View style={{paddingHorizontal, paddingVertical, backgroundColor: 'yellow'}}>\n              <View style={{paddingHorizontal, paddingVertical, backgroundColor: 'black'}} />\n            </View>\n          </View>\n        </View>\n      </View>\n    );\n  }\n}\n\nexport default class ElementScreenshotScreen extends Component {\n  static orientations = {\n    'vertical': {\n      borderSizeH: 12,\n      borderSizeV: screenHeight * 0.9 / 8,\n    },\n    'horizontal': {\n      borderSizeH: screenWidth * 0.9 / 8,\n      borderSizeV: 12,\n    }\n  };\n\n  constructor(props) {\n    super(props);\n    this.switchOrientation = this.switchOrientation.bind(this);\n\n    this.state = {\n      orientation: 'vertical',\n    };\n  }\n\n  render() {\n    const { borderSizeH, borderSizeV } = ElementScreenshotScreen.orientations[this.state.orientation];\n\n    return (\n      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>\n        <TouchableHighlight testID='switchOrientation' onPress={this.switchOrientation}>\n          <ArtisticRectangle testID='fancyElement' borderSizeH={borderSizeH} borderSizeV={borderSizeV} />\n        </TouchableHighlight>\n      </View>\n    );\n  }\n\n  switchOrientation() {\n    this.setState({\n      orientation: this.state.orientation === 'vertical' ? 'horizontal' : 'vertical',\n    });\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/IntegActionsScreen.js",
    "content": "import React, { Component } from 'react';\nimport { ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native';\n\nclass SelfCountingText extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      taps: 0,\n    };\n    this.onTap = this.onTap.bind(this);\n  }\n\n  render() {\n    return (\n      <TouchableOpacity {...this.props} testID={''} onPress={this.onTap}>\n        <Text testID={this.props.testID} style={{ textAlign: 'center', textAlignVertical: 'center' }}>{this.props.name}: {this.state.taps}</Text>\n      </TouchableOpacity>\n    )\n  }\n\n  onTap() {\n    this.setState({\n      taps: this.state.taps + 1,\n    });\n  }\n}\n\nexport default class IntegActionsScreen extends Component {\n\n  render() {\n    return (\n      <View testID='integActions.root' style={{ flex: 1, paddingTop: 40, justifyContent: 'center' }}>\n\n        <View style={{ height: 40, backgroundColor: 'lightblue' }}>\n          <ScrollView testID='integActions.textsScrollView'>\n            {\n              this.renderAllTappableTexts(10)\n            }\n          </ScrollView>\n        </View>\n\n        <View style={{ height: 40, backgroundColor: 'lightblue', marginTop: 40 }}>\n          <ScrollView testID='integActions.inputsScrollView'>\n            {\n              this.renderAllTextInputs(10)\n            }\n          </ScrollView>\n        </View>\n\n      </View>\n    );\n  }\n\n  renderAllTappableTexts(length) {\n    return Array.from({length}, (_, index) => {\n      const marginBottom = 10 * (index + 1);\n      return this.renderTappableText(index + 1, marginBottom)\n    })\n  }\n\n  renderTappableText(index, marginBottom) {\n    const key = `tappableText-${index}`;\n    return <SelfCountingText\n      key={key}\n      testID={key}\n      name={key}\n      style={{ height: 40, marginBottom }}\n    />\n  }\n\n  renderAllTextInputs(length) {\n    return Array.from({length}, (_, index) => {\n      const marginBottom = 10 * (index + 1);\n      return this.renderTextInput(index + 1, marginBottom)\n    })\n  }\n\n  renderTextInput(index, marginBottom) {\n    const key = `textInput-${index}`;\n    return <TextInput\n      key={key}\n      testID={key}\n      placeholder={key}\n      style={{ height: 40, backgroundColor: 'white', marginBottom, marginHorizontal: 20, padding: 5 }}\n    />\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/LanguageScreen.js",
    "content": "import React, { Component } from 'react';\nimport { Text, View, NativeModules, Platform } from 'react-native';\n\nexport default class LanguageScreen extends Component {\n  state = {\n    locale: '',\n    language: ''\n  };\n\n  async componentDidMount() {\n    try {\n      const locale = await Platform.select({\n        ios: async () => await NativeModules.NativeModule.getUserLocale(),\n        android: () => Promise.resolve('Unavailable')\n      })();\n\n      const language = await Platform.select({\n        ios: async () => await NativeModules.NativeModule.getUserLanguage(),\n        android: () => Promise.resolve('Unavailable')\n      })();\n\n      this.setState({ locale, language });\n    } catch (error) {\n      console.error('Error fetching locale/language:', error);\n    }\n  }\n\n  render() {\n    const { locale, language } = this.state;\n\n    return (\n      <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>\n        <Text style={{ fontSize: 25, marginBottom: 30 }}>\n          Current locale: {locale || 'Loading...'}\n        </Text>\n        <Text style={{ fontSize: 25, marginBottom: 30 }}>\n          Current language: {language || 'Loading...'}\n        </Text>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/LaunchArgsScreen.js",
    "content": "import {LaunchArguments} from 'react-native-launch-arguments';\nimport AbstractArgsListScreen from './AbstractArgsListScreen';\n\nexport default class LaunchArgsScreen extends AbstractArgsListScreen {\n  constructor(props) {\n    super(props, 'launchArg');\n  }\n\n  async readArguments() {\n    return LaunchArguments.value();\n  }\n\n  getTitle() {\n    return 'Launch Arguments';\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/LaunchNotificationScreen.js",
    "content": "import {\n  NativeModules,\n} from 'react-native';\nimport AbstractArgsListScreen from './AbstractArgsListScreen';\n\nconst { NativeModule } = NativeModules;\n\nexport default class LaunchNotificationScreen extends AbstractArgsListScreen {\n  constructor(props) {\n    super(props, 'notificationData');\n  }\n\n  async readArguments() {\n    return await NativeModule.parseNotificationData(null);\n  }\n\n  getTitle() {\n    return 'Launch-notification Data';\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/LaunchUrlScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Linking,\n  Text,\n  View,\n} from 'react-native';\n\nexport default class LaunchUrlScreen extends Component {\n\n constructor(props) {\n   super(props);\n\n   Linking.addEventListener('url', (params) => this._handleOpenURL(params));\n\n   this.state = {\n     url: undefined,\n   }\n }\n\n  async componentDidMount() {\n    const url = await Linking.getInitialURL();\n    this.setState({\n      url,\n    });\n  }\n\n  renderText(text) {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {text}\n        </Text>\n      </View>\n    );\n  }\n\n  render() {\n    return this.renderText(this.state.url);\n  }\n\n  _handleOpenURL(params) {\n    console.log('App@handleOpenURL:', params);\n    this.setState({url: params.url});\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/LocationScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  Button\n} from 'react-native';\nimport Geolocation from '@react-native-community/geolocation';\n\nfunction Frame({ children }) {\n  return (\n    <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>\n      {children}\n    </View>\n  );\n}\n\nfunction Label({ testID, children }) {\n  return (\n    <Text testID={testID} style={{ marginBottom: 20 }}>\n      {children}\n    </Text>\n  );\n}\n\nexport default class LocationScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      locationRequested: false,\n      coordinates: null,\n      error: '',\n    }\n  }\n\n  onLocationReceived = (position) => {\n    this.setState({\n      coordinates: position.coords,\n      error: '',\n    });\n  };\n\n  onLocationError = (error) => {\n    this.setState({\n      coordinates: null,\n      error: error.message,\n    });\n  };\n\n  requestLocation = async () => {\n    const options = {\n      enableHighAccuracy: true,\n      timeout: 5000,\n      maximumAge: 0,\n    };\n\n    this.setState({ locationRequested: true }, () =>\n      Geolocation.watchPosition(this.onLocationReceived, this.onLocationError, options));\n  }\n\n  render() {\n    if (!this.state.locationRequested) {\n      return (\n        <Frame>\n          <Button testID=\"get_location_button\" title=\"Get location\" onPress={this.requestLocation} />\n        </Frame>\n      );\n    }\n\n    if (this.state.coordinates) {\n      return (\n        <Frame>\n          <Label testID=\"location_latitude\">Latitude: {this.state.coordinates.latitude}</Label>\n          <Label testID=\"location_longitude\">Longitude: {this.state.coordinates.longitude}</Label>\n        </Frame>\n      );\n    }\n\n    if (this.state.error) {\n      return (\n        <Frame>\n          <Label testID=\"location_error\">{this.state.error}</Label>\n        </Frame>\n      );\n    }\n\n    return (\n      <Frame>\n        <Label testID=\"location_loading\">Locating...</Label>\n      </Frame>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/MatchersScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  Image,\n  TouchableOpacity\n} from 'react-native';\n\nexport default class MatchersScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined,\n    };\n  }\n\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'Label Working')}>\n          <Text style={{color: 'blue', marginBottom: 20}} accessibilityLabel={'Label'}>Label</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'ID Working')}>\n          <Text testID='UniqueId345' style={{color: 'blue', marginBottom: 20}}>ID</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'Traits Working')} accessible={true} accessibilityRole={'button'}>\n          <Text style={{color: 'blue', marginBottom: 10}}>Traits</Text>\n        </TouchableOpacity>\n\n        {!this.state.hideStar ?\n          <TouchableOpacity onPress={this.onStarPress.bind(this)}>\n            <Image source={require('../assets/star.png')} style={{width: 50, height: 50, marginBottom: 10}} />\n          </TouchableOpacity> : null\n        }\n\n        <View testID='Grandfather883' style={{padding: 8, backgroundColor: 'red', marginBottom: 10}} accessible={true}>\n          <View testID='Father883' style={{padding: 8, backgroundColor: 'green'}} accessible={true}>\n            <View testID='Son883' style={{padding: 8, backgroundColor: 'blue'}} accessible={true}>\n              <View testID='Grandson883' style={{padding: 8, backgroundColor: 'purple'}} accessible={true} />\n            </View>\n          </View>\n        </View>\n\n        <View style={{flexDirection: 'row', marginBottom: 20}}>\n          <Text testID='ProductId000' style={{margin: 10}}>Product</Text>\n          <Text testID='ProductId001' style={{margin: 10}}>Product</Text>\n          <Text testID='ProductId002' style={{margin: 10}}>Product</Text>\n          <Text testID='ProductId003' style={{margin: 10}}>Product</Text>\n        </View>\n\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'First button pressed')}>\n          <Text style={{color: 'brown', marginBottom: 20}}>Index</Text>\n        </TouchableOpacity>\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'Second button pressed')}>\n          <Text style={{color: 'brown', marginBottom: 20}}>Index</Text>\n        </TouchableOpacity>\n        <TouchableOpacity onPress={this.onButtonPress.bind(this, 'Third button pressed')}>\n          <Text style={{color: 'brown', marginBottom: 20}}>Index</Text>\n        </TouchableOpacity>\n\n      </View>\n    );\n  }\n\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n\n  onButtonPress(greeting) {\n    this.setState({\n      greeting: greeting\n    });\n  }\n\n  onStarPress() {\n    this.setState({\n      hideStar: true\n    });\n  }\n\n}\n"
  },
  {
    "path": "detox/test/src/Screens/NativeAnimationsScreen.js",
    "content": "import React, { Component } from 'react';\nimport { requireNativeComponent, View } from 'react-native';\n\nconst NativeAnimatingView = requireNativeComponent('DetoxNativeAnimatingView');\n\nexport default class NativeAnimationsScreen extends Component {\n  render() {\n    return (\n      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'stretch' }}>\n        <NativeAnimatingView style={{flex: 1}}/>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/NetworkScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity,\n} from 'react-native';\n\nexport default class NetworkScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined,\n    };\n  }\n\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n\n        <TouchableOpacity onPress={this.onNetworkButtonPress.bind(this, 'Short Network Request Working', 100)}>\n          <Text testID='ShortNetworkRequest' style={{color: 'blue', marginBottom: 20}}>Short Network Request</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onNetworkButtonPress.bind(this, 'Long Network Request Working', 3000)}>\n          <Text testID='LongNetworkRequest' style={{color: 'blue', marginBottom: 20}}>Long Network Request</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n\n  async onNetworkButtonPress(greeting, delayMs) {\n    try {\n      const response = await fetch(`http://localhost:9001/delay/${delayMs}`);\n      const responseJson = await response.json();\n      console.log(responseJson.message);\n\n      this.setState({\n        greeting: greeting\n      });\n    } catch(error) {\n      console.error(error);\n    }\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/Orientation.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n} from 'react-native';\n\nexport default class Orientation extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      horizontal: false\n    };\n    console.log('Orientation react component constructed (console.log test)');\n  }\n\n  detectHorizontal({nativeEvent: {layout: {width, height}}}) {\n    this.setState({\n      horizontal: width > height\n    });\n  }\n\n  render() {\n    return (\n      <View onLayout={this.detectHorizontal.bind(this)} style={{flex: 1, paddingTop: 20, justifyContent: 'flex-start', alignItems: 'center'}}>\n        <Text testID=\"currentOrientation\" style={{fontSize: 25, marginTop: 50}}>\n          {this.state.horizontal ? 'Landscape' : 'Portrait'}\n        </Text>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/OverlayScreen.js",
    "content": "import React, { Component } from 'react';\nimport { View, ScrollView, TouchableOpacity, StyleSheet, Text, NativeModules, Dimensions, Alert } from 'react-native';\n\nconst { NativeModule } = NativeModules;\n\nexport default class OverlayScreen extends Component {\n  render() {\n    return (\n      <ScrollView style={styles.container} testID='VerticalScrollView'>\n        <TouchableOpacity\n          onPress={() => {\n            Alert.alert('Dismiss Alert?', 'Are you sure you want to dismiss the alert?', [\n              {\n                text: 'Dismiss',\n                style: 'cancel',\n              }\n            ])\n          }}\n          style={styles.button}\n          testID='ShowDismissibleAlertButton'\n        >\n          <Text style={styles.text}>\n            Show Alert\n          </Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={() => NativeModule.presentOverlayWindow()} style={styles.button} testID='ShowOverlayWindowButton'>\n          <Text style={styles.text}>Show Overlay Window</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={() => NativeModule.presentOverlayView()} style={styles.button} testID='ShowOverlayViewButton'>\n          <Text style={styles.text}>Show Overlay View</Text>\n        </TouchableOpacity>\n\n        <View style={styles.item}><Text style={styles.itemText}>Text1</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text2</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text3</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text4</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text5</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text6</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text7</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text8</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text9</Text></View>\n        <View style={styles.item}><Text style={styles.itemText}>Text10</Text></View>\n      </ScrollView>\n    );\n  }\n}\n\nconst { height } = Dimensions.get('window');\nconst itemHeight = height / 10 + 50;\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1\n  },\n  button: {\n    backgroundColor: '#ffd9d9',\n    height: itemHeight,\n    justifyContent: \"center\",\n    alignItems: \"center\",\n    margin: 10\n  },\n  text: {\n    fontSize: 18,\n    color: '#000000',\n    textAlign: 'center'\n  },\n  item: {\n    height: itemHeight,\n    backgroundColor: '#d9d9ff',\n    justifyContent: \"center\",\n    alignItems: \"center\",\n    margin: 10\n  },\n  itemText: {\n    fontSize: 18,\n    color: '#525252',\n    textAlign: 'center'\n  }\n});\n"
  },
  {
    "path": "detox/test/src/Screens/Permissions.js",
    "content": "import React, {Component} from 'react';\nimport {\n  View,\n  Text,\n} from 'react-native';\n\nimport {checkMultiple, request, PERMISSIONS, RESULTS} from 'react-native-permissions';\n\nconst PERMISSIONS_TO_CHECK = [\n  { name: 'userTracking', key: PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY },\n  { name: 'calendar', key: PERMISSIONS.IOS.CALENDARS },\n  { name: 'camera', key: PERMISSIONS.IOS.CAMERA },\n  { name: 'contacts', key: PERMISSIONS.IOS.CONTACTS },\n  { name: 'faceid', key: PERMISSIONS.IOS.FACE_ID },\n  { name: 'location_always', key: PERMISSIONS.IOS.LOCATION_ALWAYS },\n  { name: 'location_when_in_use', key: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE },\n  { name: 'medialibrary', key: PERMISSIONS.IOS.MEDIA_LIBRARY },\n  { name: 'microphone', key: PERMISSIONS.IOS.MICROPHONE },\n  { name: 'motion', key: PERMISSIONS.IOS.MOTION },\n  { name: 'photo_library', key: PERMISSIONS.IOS.PHOTO_LIBRARY },\n  { name: 'photo_library_add_only', key: PERMISSIONS.IOS.PHOTO_LIBRARY_ADD_ONLY },\n  { name: 'reminders', key: PERMISSIONS.IOS.REMINDERS },\n  { name: 'siri', key: PERMISSIONS.IOS.SIRI },\n  { name: 'speech', key: PERMISSIONS.IOS.SPEECH_RECOGNITION },\n];\n\nexport default class Permissions extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      statuses: {},\n    };\n  }\n\n  async getStatuses() {\n    const toCheck = PERMISSIONS_TO_CHECK.map((permission) => permission.key);\n    const statuses = await checkMultiple(toCheck);\n\n    this.setState({\n      statuses: statuses,\n    });\n  }\n\n  async requestPermission(permissionKey) {\n    const status = await request(permissionKey);\n\n    this.setState({\n      statuses: {\n        ...this.state.statuses,\n        [permissionKey]: status,\n      },\n    });\n  }\n\n  render() {\n    // Table of permissions (name and value)\n    return (\n      <View onLayout={this.getStatuses.bind(this)}\n            style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <View style={{flexDirection: 'row'}}>\n          <Text style={{fontSize: 20, marginBottom: 20}}>Permissions</Text>\n        </View>\n        {PERMISSIONS_TO_CHECK.map(({name, key}) => {\n          const status = this.state.statuses[key];\n          const statusColor = status === RESULTS.GRANTED ? 'green' : status === RESULTS.BLOCKED ? 'red' : 'black';\n\n          return (\n            <View style={{flexDirection: 'row'}} key={name}>\n              <Text style={{marginBottom: 10, fontSize: 14, marginRight: 20}}>{name}</Text>\n              <Text style={{marginBottom: 10, fontSize: 14, marginRight: 20, color: statusColor}} testID={name}>\n                {status}\n              </Text>\n              <Text\n                style={{marginBottom: 10, fontSize: 14, color: 'blue', textDecorationLine: 'underline'}}\n                onPress={() => this.requestPermission(key)}>\n                ask\n              </Text>\n            </View>\n          );\n        })}\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/PickerViewScreen.js",
    "content": "import React, { Component } from \"react\";\nimport { Text, View, StyleSheet } from \"react-native\";\nimport { Picker } from \"@react-native-picker/picker\";\n\nexport default class PickerViewScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      chosenValue: \"com.wix.detox.a\"\n    };\n\n    this.setValue = this.setValue.bind(this);\n  }\n\n  setValue(newValue) {\n    this.setState({\n      chosenValue: newValue\n    });\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.dateText} testID=\"valueLabel\">\n          {this.state.chosenValue}\n        </Text>\n        <Picker\n          testID=\"pickerView\"\n          selectedValue={this.state.chosenValue}\n          style={{width:\"100%\", height:200}}\n          onValueChange={this.setValue}>\n\n          <Picker.Item label=\"a\" value=\"com.wix.detox.a\" />\n          <Picker.Item label=\"b\" value=\"com.wix.detox.b\" />\n          <Picker.Item label=\"c\" value=\"com.wix.detox.c\" />\n          <Picker.Item label=\"d\" value=\"com.wix.detox.d\" />\n        </Picker>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    paddingTop: 20,\n    justifyContent: \"center\",\n    alignItems: \"center\"\n  },\n  datePicker: {\n    width:\"100%\",\n    height:200\n  },\n  dateText: {\n    textAlign:\"center\"\n  }\n});\n"
  },
  {
    "path": "detox/test/src/Screens/SanityScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity\n} from 'react-native';\n\nexport default class SanityScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined,\n    };\n    console.log('SanityScreen react component constructed (console.log test)');\n  }\n\n  renderTestButton(label, onPress) {\n    return (\n      <TouchableOpacity onPress={onPress}>\n        <Text style={{color: 'blue', marginBottom: 20}}>{label}</Text>\n      </TouchableOpacity>\n    )\n  }\n\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25, marginBottom: 30}}>\n          Welcome\n        </Text>\n        {this.renderTestButton('Say Hello', this.onButtonPress.bind(this, 'Hello'))}\n        {this.renderTestButton('Say World', this.onButtonPress.bind(this, 'World'))}\n      </View>\n    );\n  }\n\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n\n  onButtonPress(greeting) {\n    console.log('SanityScreen onButtonPress \"' + greeting + '\" (console.log test)');\n    this.setState({\n      greeting: greeting\n    });\n  }\n\n}\n"
  },
  {
    "path": "detox/test/src/Screens/ScrollActionsScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  ScrollView,\n  TouchableOpacity,\n  Alert, SafeAreaView\n} from 'react-native';\n\nexport default class ScrollActionsScreen extends Component {\n\n  constructor(props) {\n    super(props);\n\n    this.onPress = this.onPress.bind(this);\n    this.onLongPress = this.onLongPress.bind(this);\n  }\n\n\n  render() {\n    return (\n      <SafeAreaView style={{ flex: 1 }}>\n        <View style={{\n          flex: 1,\n          justifyContent: 'flex-start',\n          borderColor: '#c0c0c0',\n          borderWidth: 1,\n          backgroundColor: '#f8f8ff'\n        }} testID='root'>\n          <ScrollView testID='FSScrollActions.scrollView'>\n            {\n              Array.from({ length: 20 }, (_, index) => this.renderItem(index + 1))\n            }\n          </ScrollView>\n          <View style={{ height: 100, backgroundColor: 'yellow' }}>\n            <Text>Bottom Sheet</Text>\n          </View>\n        </View>\n      </SafeAreaView>\n    );\n  }\n\n  renderItem(id) {\n    const key = `listItem.${id}`;\n    return (\n      <TouchableOpacity\n        key={key}\n        testID={key}\n        onPress={() => this.onPress(id)}\n        onLongPress={() => this.onLongPress(id)}\n      >\n        <Text style={{ height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10 }}>{`Text${id}`}</Text>\n      </TouchableOpacity>\n    );\n  }\n\n  onPress(id) {\n    Alert.alert('Alert', `Alert(Item #${id})`);\n  }\n\n  onLongPress(id) {\n    // DO NOT REMOVE THIS!\n    // While there are no tests that actually trigger this, it's important nonetheless -- for *negative* testing of bugs\n    // such as this one: https://github.com/wix/Detox/issues/1406 (i.e. long-press invoked unwillingly)\n    Alert.alert('Alert', `Alert-LongPress(Item #${id})`);\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/SemanticTypesScreen.js",
    "content": "import React from 'react';\nimport {\n  View,\n  Text,\n  Image,\n  ScrollView,\n  FlatList,\n  Switch,\n  ActivityIndicator,\n  TextInput,\n} from 'react-native';\nimport Slider from '@react-native-community/slider';\nimport { Picker } from '@react-native-picker/picker';\n\nexport default function SemanticTypesScreen() {\n  return (\n    <ScrollView testID=\"semanticTypesScreen\" style={{ flex: 1, padding: 20, paddingTop: 60 }}>\n      <Text style={{ fontSize: 18, marginBottom: 10 }}>Semantic Types Test</Text>\n      \n      {/* Image */}\n      <Image \n        testID=\"semanticImage\"\n        source={require('../assets/star.png')} \n        style={{ width: 50, height: 50, marginBottom: 10 }} \n      />\n      \n      {/* Text */}\n      <Text testID=\"semanticText\" style={{ marginBottom: 10 }}>Text Element</Text>\n      \n      {/* Input Field */}\n      <TextInput \n        testID=\"semanticInput\"\n        placeholder=\"Input field\"\n        style={{ borderWidth: 1, padding: 10, marginBottom: 10 }}\n      />\n      \n      {/* Activity Indicator / Progress */}\n      <ActivityIndicator \n        testID=\"semanticProgress\"\n        size=\"large\" \n        color=\"#0000ff\" \n        style={{ marginBottom: 10 }} \n      />\n      \n      {/* Switch */}\n      <Switch testID=\"semanticSwitch\" style={{ marginBottom: 10 }} />\n      \n      {/* Slider */}\n      <Slider \n        testID=\"semanticSlider\"\n        style={{ width: 200, marginBottom: 10 }} \n        minimumValue={0} \n        maximumValue={1} \n      />\n      \n      {/* Picker */}\n      <Picker testID=\"semanticPicker\" style={{ width: 200, height: 50, marginBottom: 10 }}>\n        <Picker.Item label=\"Option 1\" value=\"1\" />\n        <Picker.Item label=\"Option 2\" value=\"2\" />\n      </Picker>\n      \n      {/* ScrollView (nested) */}\n      <View style={{ height: 60, marginBottom: 10 }}>\n        <ScrollView testID=\"semanticScrollView\" style={{ backgroundColor: '#eee' }}>\n          <Text>Scrollable content 1</Text>\n          <Text>Scrollable content 2</Text>\n        </ScrollView>\n      </View>\n      \n      {/* List (FlatList) */}\n      <FlatList\n        testID=\"semanticList\"\n        data={[{key: '1', title: 'Item 1'}, {key: '2', title: 'Item 2'}]}\n        renderItem={({item}) => <Text>{item.title}</Text>}\n        style={{ height: 60, backgroundColor: '#ddd' }}\n      />\n    </ScrollView>\n  );\n}\n\n"
  },
  {
    "path": "detox/test/src/Screens/ShakeScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  NativeEventEmitter,\n  NativeModules\n} from 'react-native';\nconst { ShakeEventEmitter } = NativeModules;\n\nconst shakeEventEmitter = new NativeEventEmitter(ShakeEventEmitter);\n\nexport default class ShakeScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: \"Shake it, baby\"\n    };\n    this.subscription = undefined;\n    this.subscription = shakeEventEmitter.addListener('ShakeEvent', () => {\n      console.log(\"Shake!!!\");\n      this.setState({ greeting: \"Shaken, not stirred\" });\n    });\n  }\n\n  render() {\n    return (\n      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n        <Text testID='BondJamesBond' style={{ fontSize: 25 }}>\n          {this.state.greeting}\n        </Text>\n      </View>\n    );\n  }\n\n  componentWillUnmount() {\n    console.log(\"Unsubscribing\");\n    this.subscription.remove();\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/ShapeMatchGameScreen.tsx",
    "content": "import React, { useState, useRef } from 'react';\nimport {\n    View,\n    Text,\n    StyleSheet,\n    Animated,\n    PanResponder,\n    Dimensions,\n    TouchableOpacity,\n    SafeAreaView,\n} from 'react-native';\n\nconst { width, height } = Dimensions.get('window');\n\ntype Shape = 'circle' | 'square' | 'triangle';\ntype Color = '#ff0000' | '#0033FF' | '#ff4d00';\n\ninterface ShapeProps {\n    shape: Shape;\n    color: Color;\n    matched: boolean;\n}\n\nconst ShapeMatchGameScreen: React.FC = () => {\n    const [score, setScore] = useState(0);\n    const [errorMessage, setErrorMessage] = useState('');\n    const [shapes, setShapes] = useState<ShapeProps[]>([\n        { shape: 'circle', color: '#ff0000', matched: false },\n        { shape: 'square', color: '#0033FF', matched: false },\n        { shape: 'triangle', color: '#ff4d00', matched: false },\n        { shape: 'circle', color: '#0033FF', matched: false },\n        { shape: 'triangle', color: '#ff0000', matched: false },\n        { shape: 'square', color: '#ff0000', matched: false },\n    ]);\n\n    const panRefs = useRef(shapes.map(() => new Animated.ValueXY())).current;\n\n    const startPositions = [\n        { x: 50, y: height - 550 },\n        { x: width / 2 - 30, y: height - 550 },\n        { x: width - 110, y: height - 550 },\n        { x: 50, y: height - 450 },\n        { x: width / 2 - 30, y: height - 450 },\n        { x: width - 110, y: height - 450 },\n    ];\n\n    const createPanResponder = (index: number) => {\n        return PanResponder.create({\n            onMoveShouldSetPanResponder: () => !shapes[index].matched,\n            onPanResponderMove: (_, gesture) => {\n                if (!shapes[index].matched) {\n                    Animated.event([null, { dx: panRefs[index].x, dy: panRefs[index].y }], { useNativeDriver: false })(_, gesture);\n                }\n            },\n            onPanResponderRelease: (_, gesture) => handleRelease(index, gesture),\n            onPanResponderGrant: () => {\n                if (!shapes[index].matched) {\n                    panRefs[index].setOffset({\n                        x: panRefs[index].x._value,\n                        y: panRefs[index].y._value\n                    });\n                    panRefs[index].setValue({ x: 0, y: 0 });\n                }\n            }\n        });\n    };\n\n    const handleRelease = (index: number, gesture: { moveX: number; moveY: number }) => {\n        const shape = shapes[index];\n        const hole = getMatchingHole(shape);\n        if (isInHole(gesture, hole)) {\n            setScore(prevScore => prevScore + 1);\n            setShapes(prevShapes => prevShapes.map((s, i) => i === index ? {...s, matched: true} : s));\n        } else {\n            Animated.spring(panRefs[index], {\n                toValue: { x: 0, y: 0 },\n                useNativeDriver: false\n            }).start();\n        }\n    };\n\n    const getMatchingHole = (shape: ShapeProps) => {\n        const holeSize = 80;\n        const holeSpacing = 100;\n        const startY = height * 0.2;\n        const index = shapes.findIndex(s => s.shape === shape.shape && s.color === shape.color);\n        return {\n            x: width / 2 - (shapes.length / 2 * holeSpacing) / 2 + (index % 3) * holeSpacing,\n            y: startY + Math.floor(index / 3) * holeSpacing,\n            width: holeSize,\n            height: holeSize,\n        };\n    };\n\n    const isInHole = (gesture: { moveX: number; moveY: number }, hole: { x: number; y: number; width: number; height: number }) => {\n        const errorMargin = 20;\n        return (\n            gesture.moveX > hole.x - errorMargin &&\n            gesture.moveX < hole.x + hole.width + errorMargin &&\n            gesture.moveY - 120 > hole.y - errorMargin &&\n            gesture.moveY - 120 < hole.y + hole.height + errorMargin);\n    };\n\n    const renderShape = (shape: ShapeProps, index: number) => {\n        const panResponder = createPanResponder(index);\n        return (\n            <Animated.View\n                testID={`shape-${index}`}\n                key={index}\n                style={[\n                    styles.shape,\n                    { backgroundColor: shape.color },\n                    shape.shape === 'circle' && styles.circle,\n                    shape.shape === 'square' && styles.square,\n                    shape.shape === 'triangle' && styles.triangle,\n                    {\n                        position: 'absolute',\n                        left: startPositions[index].x,\n                        top: startPositions[index].y,\n                        transform: [\n                            { translateX: panRefs[index].x },\n                            { translateY: panRefs[index].y },\n                        ],\n                    },\n                ]}\n                {...panResponder.panHandlers}\n            />\n        );\n    };\n\n    const renderHole = (shape: ShapeProps, index: number) => {\n        const hole = getMatchingHole(shape);\n        return (\n            <View\n                testID={`shape-hole-${index}`}\n                key={index}\n                style={[\n                    styles.hole,\n                    { left: hole.x, top: hole.y },\n                    shape.shape === 'circle' && styles.circleHole,\n                    shape.shape === 'square' && styles.squareHole,\n                    shape.shape === 'triangle' && styles.triangleHole,\n                ]}\n            />\n        );\n    };\n\n    const resetGame = () => {\n        setScore(0);\n        setErrorMessage('');\n        setShapes([\n            { shape: 'circle', color: '#ff0000', matched: false },\n            { shape: 'square', color: '#0033FFFF', matched: false },\n            { shape: 'triangle', color: '#FF4D00FF', matched: false },\n            { shape: 'circle', color: '#0033FF', matched: false },\n            { shape: 'triangle', color: '#ff0000', matched: false },\n            { shape: 'square', color: '#ff0000', matched: false },\n        ]);\n        panRefs.forEach(ref => ref.setValue({ x: 0, y: 0 }));\n    };\n\n    return (\n        <SafeAreaView style={styles.container}>\n            <View style={styles.header}>\n                <Text style={styles.title}>Shape Matcher</Text>\n                <Text style={styles.score}>Score: {score}</Text>\n            </View>\n            <View style={styles.gameArea}>\n                {shapes.slice(0, 3).map(renderHole)}\n                {shapes.map(renderShape)}\n            </View>\n            {errorMessage ? (\n                <View style={styles.errorContainer}>\n                    <Text style={styles.errorMessage}>{errorMessage}</Text>\n                </View>\n            ) : null}\n            <TouchableOpacity style={styles.resetButton} onPress={resetGame}>\n                <Text style={styles.resetButtonText}>Reset Game</Text>\n            </TouchableOpacity>\n        </SafeAreaView>\n    );\n};\n\nconst styles = StyleSheet.create({\n    container: {\n        flex: 1,\n        backgroundColor: '#F7F7F7',\n    },\n    header: {\n        alignItems: 'center',\n        paddingTop: 20,\n        paddingBottom: 10,\n        borderBottomWidth: 1,\n        borderBottomColor: '#E0E0E0',\n    },\n    title: {\n        fontSize: 24,\n        fontWeight: 'bold',\n        color: '#333',\n    },\n    score: {\n        fontSize: 18,\n        color: '#666',\n        marginTop: 5,\n    },\n    gameArea: {\n        flex: 1,\n        justifyContent: 'center',\n        alignItems: 'center',\n    },\n    shape: {\n        width: 60,\n        height: 60,\n        justifyContent: 'center',\n        alignItems: 'center',\n        shadowColor: \"#000\",\n        shadowOffset: {\n            width: 0,\n            height: 2,\n        },\n        shadowOpacity: 0.25,\n        shadowRadius: 3.84,\n        elevation: 5,\n    },\n    circle: {\n        borderRadius: 30,\n    },\n    square: {},\n    triangle: {\n        width: 0,\n        height: 0,\n        backgroundColor: 'transparent',\n        borderStyle: 'solid',\n        borderColor: '#ffae00',\n        borderLeftWidth: 30,\n        borderRightWidth: 30,\n        borderBottomWidth: 60,\n        borderLeftColor: 'transparent',\n        borderRightColor: 'transparent',\n    },\n    hole: {\n        width: 80,\n        height: 80,\n        backgroundColor: '#CCC',\n        position: 'absolute',\n    },\n    circleHole: {\n        borderRadius: 40,\n    },\n    squareHole: {},\n    triangleHole: {\n        width: 0,\n        height: 0,\n        backgroundColor: 'transparent',\n        borderStyle: 'solid',\n        borderLeftWidth: 40,\n        borderRightWidth: 40,\n        borderBottomWidth: 80,\n        borderLeftColor: 'transparent',\n        borderRightColor: 'transparent',\n        borderBottomColor: '#CCC',\n    },\n    resetButton: {\n        backgroundColor: '#0033FF',\n        padding: 15,\n        alignItems: 'center',\n        marginHorizontal: 20,\n        marginBottom: 20,\n        borderRadius: 8,\n    },\n    resetButtonText: {\n        color: 'white',\n        fontSize: 16,\n        fontWeight: 'bold',\n    },\n    errorContainer: {\n        backgroundColor: 'rgba(255, 0, 0, 0.7)',\n        padding: 10,\n        position: 'absolute',\n        bottom: 100,\n        left: 20,\n        right: 20,\n        borderRadius: 5,\n        alignItems: 'center',\n    },\n    errorMessage: {\n        color: 'white',\n        fontSize: 16,\n        fontWeight: 'bold',\n    },\n});\n\nexport default ShapeMatchGameScreen;\n"
  },
  {
    "path": "detox/test/src/Screens/StressScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity,\n  NativeModules\n} from 'react-native';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport getStringByLength from '../helpers/buffers';\nimport * as storageHelper from '../helpers/storage';\n\nconst { NativeModule } = NativeModules;\n\nconst BRIDGE_ONEWAY_CALLS = 400;\nconst BRIDGE_ONEWAY_STR_CHUNK_LEN = 1000;\nconst BRIDGE_TWOWAY_CALLS = 400;\nconst BRIDGE_TWOWAY_STR_CHUNK_LEN = 1000;\nconst BRIDGE_SETSTATE_STR_CHUNK_LEN = 1000;\nconst EVENT_LOOP_COUNT = 5000;\nconst EVENT_LOOP_STR_CHUNK_LEN = 1000;\n\nexport default class StressScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      phase1: undefined,\n      phase2: undefined,\n      extraData: undefined,\n      counter: 1\n    };\n  }\n\n  renderTestButton(label, onPress) {\n    return (\n      <TouchableOpacity onPress={onPress}>\n        <Text style={{color: 'blue', marginBottom: 20}}>{label}</Text>\n      </TouchableOpacity>\n    )\n  }\n\n  render() {\n    if (this.state.phase2) return this.renderPhase2();\n    if (this.state.phase1) return this.renderPhase1();\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        {this.renderTestButton('Bridge OneWay Stress', this.bridgeOneWayStressButtonPressed.bind(this))}\n        {this.renderTestButton('Bridge TwoWay Stress', this.bridgeTwoWayStressButtonPressed.bind(this))}\n        {this.renderTestButton('Bridge setState Stress', this.bridgeSetStateStressButtonPressed.bind(this))}\n        {this.renderTestButton('EventLoop Stress', this.eventLoopStressButtonPressed.bind(this))}\n        {this.renderTestButton(`Consecutive Stress ${this.state.counter}`, this.consecutiveStressButtonPressed.bind(this))}\n        {this.renderTestButton('Storage Stress', this.storageStressButtonPressed.bind(this))}\n        {this.renderTestButton('VirtualizedList Stress', this.virtualizedListStressPressed.bind(this))}\n      </View>\n    );\n  }\n\n  renderPhase2() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25, marginBottom: 20}}>\n          {this.state.phase2}\n        </Text>\n        {\n          !this.state.extraData ? false :\n          <Text style={{fontSize: 10, width: 100, height: 20}}>\n            Extra Data: {this.state.extraData}\n          </Text>\n        }\n      </View>\n    );\n  }\n\n  renderPhase1() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <TouchableOpacity onPress={this.onButtonPress.bind(this)}>\n          <Text style={{color: 'blue', marginBottom: 20}}>Next</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n\n  onButtonPress() {\n    this.setState({\n      phase2: this.state.phase1\n    });\n  }\n\n  bridgeOneWayStressButtonPressed() {\n    this.setState({\n      phase1: 'BridgeOneWay'\n    });\n    setTimeout(() => {\n      const str = getStringByLength(BRIDGE_ONEWAY_STR_CHUNK_LEN);\n      for (let i = 0 ; i < BRIDGE_ONEWAY_CALLS ; i++) {\n        NativeModule.echoWithoutResponse(str);\n      }\n    }, 1);\n  }\n\n  bridgeTwoWayStressButtonPressed() {\n    this.setState({\n      phase1: 'BridgeTwoWay'\n    });\n    setTimeout(() => {\n      const str = getStringByLength(BRIDGE_TWOWAY_STR_CHUNK_LEN);\n      for (let i = 0 ; i < BRIDGE_TWOWAY_CALLS ; i++) {\n        NativeModule.echoWithResponse(str);\n      }\n    }, 1);\n  }\n\n  bridgeSetStateStressButtonPressed() {\n    this.setState({\n      phase1: 'BridgeSetState'\n    });\n    setTimeout(() => {\n      const str = getStringByLength(BRIDGE_SETSTATE_STR_CHUNK_LEN);\n      this.setState({\n        extraData: str\n      });\n    }, 1);\n  }\n\n  eventLoopStressButtonPressed() {\n    this.setState({\n      phase1: 'EventLoop'\n    });\n    for (let i = 0 ; i < EVENT_LOOP_COUNT ; i++) {\n      setTimeout(() => {\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        let str = getStringByLength(EVENT_LOOP_STR_CHUNK_LEN);\n      }, 1);\n    }\n  }\n\n  consecutiveStressButtonPressed() {\n    this.setState({\n      counter: this.state.counter + 1\n    });\n  }\n\n  async storageStressButtonPressed() {\n    try {\n      await AsyncStorage.clear();\n      await storageHelper.runStressTest();\n    } finally {\n      await AsyncStorage.clear();\n    }\n\n    this.setState({\n      phase2: 'StorageStress'\n    });\n  }\n\n  async virtualizedListStressPressed() {\n    this.props.setScreen('VirtualizedListStressScreen');\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/SwitchRootScreen.js",
    "content": "import React, {Component} from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity,\n  NativeModules\n} from 'react-native';\n\nconst {NativeModule} = NativeModules;\n\nexport default class SwitchRootScreen extends Component {\n  render() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <TouchableOpacity onPress={() => NativeModule.switchToNativeRoot()}>\n          <Text style={{color: 'blue', marginBottom: 20}}>{`Switch to a new native root`}</Text>\n        </TouchableOpacity>\n        <TouchableOpacity onPress={() => NativeModule.switchToMultipleReactRoots()}>\n          <Text style={{color: 'blue', marginBottom: 20}}>{`Switch to multiple react roots`}</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/SystemDialogsScreen.js",
    "content": "import React, {Component} from 'react';\nimport {\n  View,\n  Text, Button,\n} from 'react-native';\n\nimport {request, PERMISSIONS, RESULTS, check} from 'react-native-permissions';\n\nexport default class SystemDialogsScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      userTrackingStatus: RESULTS.UNAVAILABLE,\n    };\n  }\n\n  async updateStatus() {\n    const status = await check(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);\n\n    this.setState({\n      userTrackingStatus: status,\n    });\n  }\n\n  async requestPermission() {\n    const status = await request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);\n\n    this.setState({\n      userTrackingStatus: status,\n    });\n  }\n\n  render() {\n    const status = this.state.userTrackingStatus;\n\n    return (\n      <View onLayout={this.updateStatus.bind(this)}\n            style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n          <Text style={{marginBottom: 10, fontSize: 20}}>User Tracking Status</Text>\n          <Text style={{marginBottom: 10}} testID={'permissionStatus'}>{status}</Text>\n          <Button title={'Request Permission'} testID={'requestPermissionButton'} onPress={this.requestPermission.bind(this)}/>\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/TimeoutsScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity\n} from 'react-native';\n\nexport default class TimeoutsScreen extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined,\n    };\n  }\n\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n\n        <TouchableOpacity onPress={this.onTimeoutButtonPress.bind(this, 'Short Timeout Working', 600)}>\n          <Text testID='TimeoutShort' style={{color: 'blue', marginBottom: 20}}>Short Timeout</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onTimeoutButtonPress.bind(this, 'Zero Timeout Working', 0)}>\n          <Text testID='TimeoutZero' style={{color: 'blue', marginBottom: 20}}>Zero Timeout</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onTimeoutIgnoreButtonPress.bind(this, 'Short Timeout Ignored', 600)}>\n          <Text testID='TimeoutIgnoreShort' style={{color: 'blue', marginBottom: 20}}>Short Timeout Ignore</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onTimeoutIgnoreButtonPress.bind(this, 'Long Timeout Ignored', 100000)}>\n          <Text testID='TimeoutIgnoreLong' style={{color: 'blue', marginBottom: 20}}>Long Timeout Ignore</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onImmediateButtonPress.bind(this, 'Immediate Working')}>\n          <Text testID='Immediate' style={{color: 'blue', marginBottom: 20}}>Immediate</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onIntervalIgnoreButtonPress.bind(this, 'Interval Ignored', 1000)}>\n          <Text testID='IntervalIgnore' style={{color: 'blue', marginBottom: 20}}>Interval Ignore</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity onPress={this.onIntervalSkipOver.bind(this, 'Interval Skipped-Over')}>\n          <Text testID='SkipOverInterval' style={{color: 'blue', marginBottom: 20}}>Interval Skip-Over</Text>\n        </TouchableOpacity>\n\n      </View>\n    );\n  }\n\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n\n  onTimeoutButtonPress(greeting, timeout) {\n    setTimeout(() => this.setState({greeting}), timeout);\n  }\n\n  onTimeoutIgnoreButtonPress(greeting, timeout) {\n    setTimeout(() => console.log('this will happen soon'), timeout);\n    this.setState({greeting});\n  }\n\n  onImmediateButtonPress(greeting) {\n    setImmediate(() => this.setState({greeting}));\n  }\n\n  onIntervalIgnoreButtonPress(greeting, interval) {\n    setInterval(() => console.log('this is recurring'), interval);\n    this.setState({greeting});\n  }\n\n  onIntervalSkipOver(greeting) {\n    const busyPeriodTimeoutHandler = () => this.setState({greeting});\n    const idledTimeoutHandler = (timeMs) => console.log(`Non-busy keeping timer of ${timeMs}ms has expired`);\n\n    const interval = 88;\n    const busyKeepingTime = 600;\n    const idledTimeBase = 1500 + 1;\n    const foreverTimer = 2500;\n    let intervalId;\n\n    intervalId = setInterval(() => console.log(`this should show every ${interval}ms`), interval);\n    setTimeout(() => idledTimeoutHandler(idledTimeBase), idledTimeBase);\n    setTimeout(() => busyPeriodTimeoutHandler(), busyKeepingTime);\n    setTimeout(() => idledTimeoutHandler(idledTimeBase + 10), idledTimeBase + 10);\n    setTimeout(() => idledTimeoutHandler(idledTimeBase + 100), idledTimeBase + 100);\n    setTimeout(() => {\n      console.log('\"Forever\" timer expired - though it shouldn\\'t have!');\n      clearInterval(intervalId);\n      this.setState({greeting: '???'});\n    }, foreverTimer);\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/VirtualizedListStressScreen.js",
    "content": "import _ from 'lodash';\nimport React, {Component} from 'react';\nimport {\n  StyleSheet,\n  Text,\n  View,\n  ScrollView,\n} from 'react-native';\n\nfunction Block() {\n  const subBlocks = _.times(30, (i) => (\n    <SubBlock key={i}>{i + 1}</SubBlock>\n  ));\n\n  return (\n    <View style={styles.block}>\n      {subBlocks}\n    </View>\n  );\n}\n\nfunction SubBlock({ children }) {\n  return (\n    <View style={styles.subBlock}>\n      <Text style={styles.text}>\n        {children}\n      </Text>\n    </View>\n  );\n}\n\nexport default class VirtualizedListStressScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      ready: false\n    };\n  }\n\n  componentDidMount() {\n    this.setState({\n      ready: true\n    })\n  }\n\n  render() {\n    if (!this.state.ready) {\n      return <View testID={'stub'} />;\n    }\n\n    const blocks = _.times(30, (i) => (<Block key={`block_${i}`} />));\n\n    return (\n      <ScrollView testID={'stressContainer'}\n                  contentContainerStyle={styles.container}\n                  windowSize={4}\n                  maxToRenderPerBatch={4}>\n        {blocks}\n      </ScrollView>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    borderColor: 'red',\n    borderWidth: 1,\n    borderStyle: 'solid',\n    paddingTop: 40,\n  },\n  block: {\n    display: 'flex',\n    flex: 1,\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    backgroundColor: 'silver',\n    marginVertical: 10,\n    padding: 10,\n  },\n  subBlock: {\n    display: 'flex',\n    alignContent: 'center',\n    justifyContent: 'center',\n    backgroundColor: 'white',\n    margin: 10,\n    padding: 10,\n  },\n  text: {\n    textAlign: 'center',\n    fontSize: 20,\n  },\n})\n"
  },
  {
    "path": "detox/test/src/Screens/VisibilityExpectationScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Button,\n  Text,\n  View,\n  StyleSheet,\n  SafeAreaView,\n} from 'react-native';\n\nexport default class VisibilityExpectationScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      shouldMoveElement: false\n    };\n  }\n\n  render() {\n    const shouldMoveElement = this.state.shouldMoveElement;\n\n    return (\n      <SafeAreaView testID='VisibilityExpectationScreen' style={styles.screen}>\n        <Text style={styles.header}>Half Visible Element</Text>\n        <Text style={styles.text}>Element should be only half-visible.</Text>\n        <View style={[styles.fullWidth, shouldMoveElement ? styles.quarterVisible : styles.halfVisible]} testID='halfVisible' />\n        <Text style={styles.header}>Move Element Button</Text>\n        <Text style={styles.text}>Element should be 1/4 visible after button is pressed.</Text>\n        <Button title={\"Move That Element\"} testID={\"moveHalfVisible\"} onPress={() => { this.setState({shouldMoveElement: true}) }} />\n      </SafeAreaView>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  screen: {\n    flex: 1,\n    justifyContent: 'flex-start',\n    borderColor: 'red',\n    borderWidth: 1,\n  },\n  header: {\n    fontSize: 18,\n    paddingLeft: 18,\n    marginTop: 18,\n    marginBottom: 0,\n  },\n  text: {\n    fontSize: 12,\n    paddingLeft: 18,\n    marginVertical: 12,\n  },\n  halfVisible: {\n    left: '50%',\n  },\n  quarterVisible: {\n    left: '75%',\n  },\n  fullWidth: {\n    alignSelf: 'stretch',\n    backgroundColor: 'purple',\n    height: 30,\n    minWidth: 30,\n  }\n});\n"
  },
  {
    "path": "detox/test/src/Screens/VisibilityScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  ScrollView,\n  StyleSheet,\n  SafeAreaView\n} from 'react-native';\n\nexport default class VisibilityScreen extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {};\n  }\n\n  render() {\n    return (\n      <SafeAreaView testID='VisibilityScreen' style={styles.screen}>\n        <ScrollView contentContainerStyle={styles.screenScroll} testID='screenScroll'>\n          <Text style={styles.header}>Button 2 overlaying Button 1</Text>\n          <Text style={styles.text}>An attempt to tap Button 1 should fail and produce artifacts.</Text>\n          <View style={styles.buttonOverlayContainer}>\n            <Text style={styles.absoluteButton}>Button 1</Text>\n            <Text style={styles.absoluteButton}>Button 2</Text>\n          </View>\n        </ScrollView>\n      </SafeAreaView>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  screen: {\n    flex: 1,\n    justifyContent: 'flex-start'\n  },\n  header: {\n    fontSize: 18,\n    paddingLeft: 18,\n    marginTop: 18,\n    marginBottom: 0,\n  },\n  text: {\n    fontSize: 12,\n    paddingLeft: 18,\n    marginVertical: 12,\n  },\n  buttonOverlayContainer: {\n    flexDirection: 'row',\n    paddingVertical: 6,\n    justifyContent: 'center',\n  },\n  absoluteButton: {\n    position: 'absolute',\n    paddingHorizontal: 10,\n    backgroundColor: '#ccc',\n    textAlign: 'center',\n    lineHeight: 30,\n    height: 30,\n  },\n});\n"
  },
  {
    "path": "detox/test/src/Screens/WaitForScreen.js",
    "content": "import React, {Component} from 'react';\nimport {\n  Text,\n  View,\n  ScrollView,\n  Animated,\n  TouchableOpacity,\n  TextInput\n} from 'react-native';\n\nexport default class WaitForScreen extends Component {\n  constructor(props) {\n    super(props);\n    this.textInputRef = React.createRef();\n    this.state = {\n      toggle: false,\n      becomeVisibleLeft: new Animated.Value(-500)\n    };\n  }\n\n  componentDidUpdate(prevProps, prevState, _) {\n    if (prevState.toggle === this.state.toggle) {\n      return;\n    }\n\n    if (this.state.toggle) {\n      this.textInputRef.current.focus();\n    } else {\n      this.textInputRef.current.blur();\n    }\n  }\n\n  render() {\n    return (\n      <View style={{flex: 1, paddingTop: 40, justifyContent: 'flex-start'}}>\n\n        <View style={{height: 100, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff', marginBottom: 20}}>\n          <ScrollView testID='ScrollView'>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text1</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text2</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text3</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text4</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text5</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text6</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text7</Text>\n            <Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text8</Text>\n          </ScrollView>\n        </View>\n\n        {!this.state.toggle ? false :\n          <Text testID='changeExistenceByToggle' style={{marginBottom: 20, textAlign: 'center', color: 'red'}}>\n            I am being exist / removed 2 sec after click\n          </Text>\n        }\n\n        <TextInput\n          testID='changeFocusByToggle'\n          style={{marginBottom: 20}}\n          value='I am focused / unfocused 2 sec after click'\n          ref={this.textInputRef}\n        />\n\n        <TouchableOpacity onPress={this.onGoButtonPress.bind(this)}>\n          <Text testID='goButton' style={{color: 'blue', textAlign: 'center'}}>Go</Text>\n        </TouchableOpacity>\n\n      </View>\n    );\n  }\n\n  onGoButtonPress() {\n    setTimeout(() => {\n      let previousState = this.state.toggle;\n\n      this.setState({\n        toggle: !previousState\n      });\n    }, 2000);\n  }\n}\n"
  },
  {
    "path": "detox/test/src/Screens/WebViewScreen.js",
    "content": "import React from 'react';\nimport {Button, View} from 'react-native';\nimport { WebView } from 'react-native-webview';\n\nexport default function WebViewScreen() {\n    const [is2ndWebViewVisible, setIs2ndWebViewVisible] = React.useState(false);\n    const [is3rdWebViewVisible, setIs3rdWebViewVisible] = React.useState(false);\n\n    return (\n        <View style={{flex: 1, flexDirection: 'column'}}>\n            <View style={{\n                flex: 2,\n                flexDirection: 'row',\n                justifyContent: 'space-around',\n                alignItems: 'center',\n                backgroundColor: '#edf6ff'\n            }}>\n                <View style={{flex: 1}}>\n                    <Button\n                        testID={'toggle2ndWebviewButton'}\n                        title={is2ndWebViewVisible ? 'Hide 2nd webview' : 'Show 2nd webview'}\n                        onPress={() => setIs2ndWebViewVisible(!is2ndWebViewVisible)}\n                    />\n                </View>\n                <View style={{flex: 1}}>\n                    <Button\n                        testID={'toggle3rdWebviewButton'}\n                        title={is3rdWebViewVisible ? 'Hide 3rd webview' : 'Show 3rd webview'}\n                        onPress={() => setIs3rdWebViewVisible(!is3rdWebViewVisible)}\n                    />\n                </View>\n            </View>\n            <View style={{flex: 7, flexDirection: 'column'}}>\n                <View style={{flex: 5}}>\n                    <WebView\n                      testID={'webViewFormWithScrolling'}\n                      source={{html: webViewFormWithScrolling}}\n                    />\n                </View>\n                {is2ndWebViewVisible && (\n                    <View style={{flex: 5}}>\n                        <WebView\n                          testID={'webView'}\n                          source={{html: dummyWebView}}\n                          scrollEnabled={false}\n                        />\n                    </View>\n                )}\n                {is3rdWebViewVisible && (\n                    <View style={{flex: 7}}>\n                        <WebView\n                          testID={'webView'}\n                          originWhitelist={['*']}\n                          source={{html: iframeWebView}}\n                          scrollEnabled={false}\n                          allowUniversalAccessFromFileURLs={true}\n                        />\n                    </View>\n                )}\n            </View>\n        </View>\n    );\n}\n\nconst webViewFormWithScrolling = `\n<!DOCTYPE html>\n<html>\n    <head>\n        <title>First Webview</title>\n        <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n        <style>\n            body {\n              font-family: Arial, sans-serif;\n              font-size: 16px;\n              margin: 0;\n              padding: 0;\n            }\n\n            form {\n              margin: 20px;\n            }\n\n            input[type=text], input[type=email] {\n              width: 100%;\n              padding: 12px 20px;\n              margin: 8px 0;\n              box-sizing: border-box;\n            }\n\n            input[type=submit] {\n              background-color: #4CAF50;\n              color: white;\n              padding: 14px 20px;\n              margin: 8px 0;\n              border: none;\n              cursor: pointer;\n              width: 100%;\n            }\n\n            input[type=submit]:hover {\n              background-color: #45a049;\n            }\n\n            p, h1, h2 {\n              margin: 20px;\n            }\n\n            .specialParagraph {\n              margin-top: 1000px;\n              color: blue;\n              font-size: 20px;\n            }\n\n            .contentEditable {\n              margin: 20px;\n              padding: 10px;\n              border: 1px solid grey;\n            }\n        </style>\n    </head>\n    <body>\n        <h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>\n        <h2>Form</h2>\n        <form>\n            <label for=\"fname\">Your name:</label><br>\n            <input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"10\"><br>\n            <input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\">\n        </form>\n\n        <h2>Form Results</h2>\n        <p>Your first name is: <span id=\"resultFname\">No input yet</span></p>\n\n        <h2>Content Editable</h2>\n        <div id=\"contentEditable\" class='contentEditable' contenteditable=\"true\">Name: </div>\n\n        <h2>Text and link</h2>\n        <p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>\n        <p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>\n    </body>\n</html>\n`;\n\nconst dummyWebView = `\n<!DOCTYPE html>\n<html>\n    <head>\n        <title>Dummy Webview</title>\n        <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n        <style>\n            body {\n              background-color: #b9e0ff;\n              font-family: Arial, sans-serif;\n              font-size: 16px;\n              margin: 0;\n              padding: 20px;\n              display: flex;\n              justify-content: center;\n              align-items: center;\n              height: 100%;\n            }\n        </style>\n    </head>\n    <body>\n        <p id=\"message\">This is a dummy webview.</p>\n    </body>\n</html>\n`;\n\nconst iframeWebView = `\n<!DOCTYPE html>\n<html>\n    <head>\n        <title>Inline Frame Webview</title>\n        <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n        <style>\n            body {\n              background-color: #b9e0ff;\n              font-family: Arial, sans-serif;\n              font-size: 16px;\n              padding: 20px;\n              text-align: center;\n            }\n\n            iframe {\n              border: 1px solid #000;\n              background-color: #fff;\n            }\n        </style>\n    </head>\n    <body>\n        <p id=\"message\">This is a webview with an inline frame inside.</p>\n        <iframe\n            id=\"iframe\"\n            src=\"http://localhost:9001/hello-world.html\"\n            width=\"95%\"\n            height=\"150\">\n        </iframe>\n    </body>\n</html>\n`;\n"
  },
  {
    "path": "detox/test/src/Screens/index.js",
    "content": "import SanityScreen from './SanityScreen';\nimport MatchersScreen from './MatchersScreen';\nimport ActionsScreen from './ActionsScreen';\nimport IntegActionsScreen from './IntegActionsScreen';\nimport ScrollActionsScreen from './ScrollActionsScreen';\nimport AssertionsScreen from './AssertionsScreen';\nimport WaitForScreen from './WaitForScreen';\nimport StressScreen from './StressScreen';\nimport SwitchRootScreen from './SwitchRootScreen';\nimport TimeoutsScreen from './TimeoutsScreen';\nimport Orientation from './Orientation';\nimport Permissions from './Permissions';\nimport NetworkScreen from './NetworkScreen';\nimport RNAnimationsScreen from './AnimationsScreen';\nimport NativeAnimationsScreen from './NativeAnimationsScreen';\nimport LocationScreen from './LocationScreen';\nimport ShakeScreen from './ShakeScreen';\nimport DatePickerScreen from './DatePickerScreen';\nimport LanguageScreen from './LanguageScreen';\nimport LaunchUrlScreen from './LaunchUrlScreen';\nimport LaunchArgsScreen from './LaunchArgsScreen';\nimport LaunchNotificationScreen from './LaunchNotificationScreen';\nimport PickerViewScreen from './PickerViewScreen';\nimport DeviceScreen from './DeviceScreen';\nimport DeviceTapScreen from './DeviceTapScreen';\nimport OverlayScreen from './OverlayScreen';\nimport ElementScreenshotScreen from './ElementScreenshotScreen';\nimport VirtualizedListStressScreen from './VirtualizedListStressScreen';\nimport WebViewScreen from './WebViewScreen';\nimport VisibilityExpectationScreen from './VisibilityExpectationScreen';\nimport VisibilityScreen from './VisibilityScreen';\nimport AttributesScreen from './AttributesScreen';\nimport DragNDropScreen  from './DragNDropScreen';\nimport ShapeMatchGameScreen from \"./ShapeMatchGameScreen\";\nimport SystemDialogsScreen from \"./SystemDialogsScreen\";\nimport AlertScreen from \"./AlertScreen\";\nimport SemanticTypesScreen from \"./SemanticTypesScreen\";\n\nexport {\n  SanityScreen,\n  ShapeMatchGameScreen,\n  MatchersScreen,\n  ActionsScreen,\n  IntegActionsScreen,\n  ScrollActionsScreen,\n  AssertionsScreen,\n  WaitForScreen,\n  StressScreen,\n  SwitchRootScreen,\n  TimeoutsScreen,\n  Orientation,\n  Permissions,\n  NetworkScreen,\n  RNAnimationsScreen,\n  NativeAnimationsScreen,\n  LocationScreen,\n  ShakeScreen,\n  DatePickerScreen,\n  PickerViewScreen,\n  LanguageScreen,\n  LaunchUrlScreen,\n  LaunchArgsScreen,\n  LaunchNotificationScreen,\n  DeviceScreen,\n  DeviceTapScreen,\n  OverlayScreen,\n  ElementScreenshotScreen,\n  WebViewScreen,\n  VirtualizedListStressScreen,\n  VisibilityExpectationScreen,\n  VisibilityScreen,\n  AttributesScreen,\n  DragNDropScreen,\n  SystemDialogsScreen,\n  AlertScreen,\n  SemanticTypesScreen,\n};\n"
  },
  {
    "path": "detox/test/src/Views/BadgeButton.js",
    "content": "import React, {useCallback, useState} from 'react';\nimport {Image, StyleSheet, Text, View, TouchableOpacity} from 'react-native';\n\nconst BadgeButton = ({ testID, icon, text }) => {\n    const [visible, setVisible] = useState(true);\n\n    const toggleVisible = useCallback(() => {\n        setVisible(!visible);\n    }, [visible]);\n\n    return (\n        <View style={styles.button}>\n            <TouchableOpacity testID={testID} style={styles.button} onPress={toggleVisible}>\n                <Image style={styles.image} source={icon} />\n            </TouchableOpacity>\n            {visible && <View key=\"badge\" testID={testID + '.badge'} pointerEvents=\"none\" style={styles.badge}>\n                <Text style={styles.text}>{text}</Text>\n            </View>}\n        </View>\n    );\n};\n\nconst styles = StyleSheet.create({\n    container: {\n        justifyContent: 'center',\n        alignItems: 'center',\n    },\n    button: {\n\n    },\n    image: {\n        height: 24,\n        width: 24,\n    },\n    badge: {\n        position: 'absolute',\n        right: -2,\n        top: -2,\n        backgroundColor: 'purple',\n        height: 16,\n        width: 16,\n        borderRadius: 8,\n    },\n    text: {\n        fontSize: 12,\n        lineHeight: 16,\n        color: 'white',\n        textAlign: 'center',\n    },\n});\n\nexport default BadgeButton;\n"
  },
  {
    "path": "detox/test/src/Views/ScrollBarGradient.js",
    "content": "import React, {useMemo} from 'react';\nimport {Image, StyleSheet, View} from 'react-native';\n\nconst GRADIENT_IMAGE = require('../assets/gradientOverlay.png');\nconst GRADIENT_COLOR = '#fff';\n\nconst ScrollBarGradient = ({\n  left,\n  width = 76,\n  margins = 0,\n}) => {\n  const styles = useMemo(() => {\n    return StyleSheet.create({\n      view: {\n        opacity: 1,\n        position: 'absolute',\n        width: width,\n        height: '100%',\n        left: left ? margins : undefined,\n        right: !left ? margins : undefined,\n      },\n      image: {\n        width,\n        height: '100%',\n        tintColor: GRADIENT_COLOR,\n        transform: left ? [{scaleX: -1}] : undefined,\n      },\n    });\n  }, [left, margins, width]);\n\n  return (\n    <View pointerEvents=\"none\" style={styles.view}>\n      <Image\n        source={GRADIENT_IMAGE}\n        style={styles.image}\n        resizeMode={'stretch'}\n      />\n    </View>\n  );\n};\n\nScrollBarGradient.displayName = 'IGNORE';\n\nexport default ScrollBarGradient;\n"
  },
  {
    "path": "detox/test/src/Views/SegmentedControl.js",
    "content": "import React, {Component} from 'react';\nimport {\n    View,\n    Text,\n    TouchableOpacity,\n    Platform,\n    StyleSheet,\n} from 'react-native';\nimport SegmentedControlIOS from '@react-native-segmented-control/segmented-control';\n\nconst accentColor = '#007AFF';\nconst styles = StyleSheet.create({\n  container: { flexDirection: 'row', borderWidth: 1, borderColor: accentColor, borderRadius: 5, height: 32 },\n  segmentContainer: { flex: 1 },\n  segmentBase: { flex: 1, alignItems: 'center', justifyContent: 'center' },\n});\n\nclass SegmentedControlAndroid extends Component {\n  static selectedColor = '#007AFF';\n    constructor(props) {\n      super(props);\n      this.state = {\n        values: this.props.values || [],\n        selectedIndex: this.props.selectedIndex || 0,\n        style: this.props.style,\n        onValueChange: this.props.onValueChange\n      };\n      this.renderSegment = this.renderSegment.bind(this);\n    }\n\n    onPress(selectedIndex) {\n      if (typeof this.state.onValueChange === 'function') {\n        this.state.selectedIndex = selectedIndex;\n        return this.state.onValueChange(this.props.values[selectedIndex]);\n      }\n    }\n\n    render() {\n        return (\n            <View testID={this.props.testID} style={[styles .container, this.state.style ]}>\n                { this.state.values.map(this.renderSegment) }\n            </View>\n        );\n    }\n\n    renderSegment(text, index, values) {\n      return (\n        <TouchableOpacity key={index} onPress={()=>this.onPress(index)} style={ styles.segmentContainer }>\n          <View style={[ styles.segmentBase, {\n            backgroundColor: this.state.selectedIndex === index ? accentColor : 'transparent',\n            borderRightWidth: index < values.length - 1 ? 1 : 0, borderRightColor: accentColor }]\n          }>\n            <Text style={{fontSize: 13, color: this.state.selectedIndex === index ? 'white' : accentColor}}>\n              {text}\n            </Text>\n          </View>\n        </TouchableOpacity>\n      );\n    }\n}\n\nlet SegmentedControl = Platform.OS === 'ios' ? SegmentedControlIOS : SegmentedControlAndroid;\nexport default SegmentedControl;\n"
  },
  {
    "path": "detox/test/src/Views/TextInput.js",
    "content": "import React, {Component} from 'react';\nimport { TextInput, NativeModules, Platform } from 'react-native';\n\nconst { NativeModule } = NativeModules;\n\nclass AndroidTextInput extends Component {\n  constructor(props) {\n    super(props);\n    NativeModule.spyLongTaps(props.testID);\n  }\n\n  render() {\n    return <TextInput {...this.props} nativeID={this.props.testID} />\n  }\n}\n\nif (Platform.OS === 'android') {\n  module.exports = AndroidTextInput;\n} else {\n  module.exports = TextInput;\n}\n"
  },
  {
    "path": "detox/test/src/app.js",
    "content": "import React, {Component} from 'react';\nimport {\n  Text,\n  View,\n  TouchableOpacity,\n  Platform,\n  NativeModules,\n} from 'react-native';\nimport * as Screens from './Screens';\n\nconst isAndroid = Platform.OS === 'android';\nconst isIos = Platform.OS === 'ios';\n\nconst { NativeModule } = NativeModules;\n\nexport default class example extends Component {\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      screen: undefined,\n      screenProps: {},\n      notification: undefined,\n    };\n\n    this.setScreen = this.setScreen.bind(this);\n  }\n\n  async componentDidMount() {}\n\n  renderButton(title, onPressCallback) {\n    return (\n      <TouchableOpacity onPress={() => {\n        onPressCallback();\n      }}>\n        <Text style={{color: 'blue', marginBottom: 8}}>{title}</Text>\n      </TouchableOpacity>\n    );\n  }\n\n  renderScreenNotifyingButton_iOS(title, notificationName) {\n    if (notificationName == null) {\n      throw new Error('Got no notification name for ' + title);\n    }\n\n    return this.renderButton(title, () => {\n      NativeModule.sendNotification('ChangeScreen', notificationName);\n    });\n  }\n\n  renderScreenButton(title, component) {\n    if (component == null) {\n      throw new Error('Got no component for ' + title);\n    }\n\n    return this.renderButton(title, () => {\n      this.setState({screen: component});\n    });\n  }\n\n  renderInlineSeparator() {\n    return <Text style={{width: 30, color: 'gray', textAlign: 'center'}}> | </Text>;\n  }\n\n  renderMainMenu() {\n    return (\n      <View style={{flex: 1, paddingTop: 30, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 18, marginBottom: 10}}>\n          Choose a test\n        </Text>\n        {this.renderScreenButton('Language', Screens.LanguageScreen)}\n        {this.renderScreenButton('Sanity', Screens.SanityScreen)}\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderScreenButton('Matchers', Screens.MatchersScreen)}\n          {this.renderInlineSeparator()}\n          {this.renderScreenButton('Semantic Types', Screens.SemanticTypesScreen)}\n        </View>\n        {this.renderScreenButton('Actions', Screens.ActionsScreen)}\n        {this.renderScreenButton('Visibility Expectation', Screens.VisibilityExpectationScreen)}\n        {isIos && this.renderScreenButton('Visibility Debug Artifacts', Screens.VisibilityScreen)}\n        {this.renderScreenButton('Integrative Actions', Screens.IntegActionsScreen)}\n        {this.renderScreenButton('FS Scroll Actions', Screens.ScrollActionsScreen)}\n        {this.renderScreenButton('Assertions', Screens.AssertionsScreen)}\n        {this.renderScreenButton('WaitFor', Screens.WaitForScreen)}\n        {this.renderScreenButton('Stress', Screens.StressScreen)}\n        {this.renderScreenButton('Switch Root', Screens.SwitchRootScreen)}\n        {this.renderScreenButton('Timeouts', Screens.TimeoutsScreen)}\n        {this.renderScreenButton('Orientation', Screens.Orientation)}\n\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderScreenButton('Permissions', Screens.Permissions)}\n          {this.renderInlineSeparator()}\n          {this.renderScreenButton('Alerts', Screens.AlertScreen)}\n        </View>\n\n        {this.renderScreenButton('Network', Screens.NetworkScreen)}\n        {this.renderAnimationScreenButtons()}\n\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderScreenButton('Device', Screens.DeviceScreen)}\n          {this.renderInlineSeparator()}\n          {this.renderScreenButton('Device Tap', Screens.DeviceTapScreen)}\n        </View>\n\n        {isIos && this.renderScreenButton('Overlay', Screens.OverlayScreen)}\n        {this.renderScreenButton('Location', Screens.LocationScreen)}\n        {this.renderScreenButton('DatePicker', Screens.DatePickerScreen)}\n        {isIos && this.renderScreenButton('Picker', Screens.PickerViewScreen)}\n        {this.renderScreenButton('WebView', Screens.WebViewScreen)}\n        {this.renderScreenButton('Attributes', Screens.AttributesScreen)}\n        {isIos && this.renderScreenButton('System Dialogs', Screens.SystemDialogsScreen)}\n\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderButton('Crash', () => {\n            // Note: this crashes the native-modules thread (and thus an *uncaught* exception, on Android).\n            throw new Error('Simulated Crash');\n          })}\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && this.renderButton('UI Crash', () => {\n            // Killing main-thread while handling a tap will evidently cause\n            // the tap-action itself to fail and thus for an error to be responded\n            NativeModule.crashMainThread();\n          })}\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && this.renderButton('ANR', () => {\n            NativeModule.chokeMainThread();\n          })}\n        </View>\n\n\n        {isIos && this.renderScreenButton('Shake', Screens.ShakeScreen)}\n\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderScreenButton('Drag And Drop', Screens.DragNDropScreen)}\n          {this.renderInlineSeparator()}\n          {this.renderScreenButton('Shape Match', Screens.ShapeMatchGameScreen)}\n        </View>\n\n        {isIos && this.renderScreenNotifyingButton_iOS('Custom Keyboard', 'customKeyboard')}\n\n        {this.renderScreenButton('Element-Screenshots', Screens.ElementScreenshotScreen)}\n\n        <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n          {this.renderScreenButton('Init URL', Screens.LaunchUrlScreen)}\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && this.renderScreenButton('Launch Args', Screens.LaunchArgsScreen)}\n          {isAndroid && this.renderInlineSeparator()}\n          {isAndroid && this.renderScreenButton('Launch-Notification', Screens.LaunchNotificationScreen)}\n        </View>\n      </View>\n    );\n  }\n\n  renderInnerScreen() {\n    const Screen = this.state.screen;\n    return <Screen setScreen={this.setScreen}/>;\n  }\n\n  render() {\n    if (this.state.screen) {\n      console.log('App@render: JS rendering screen');\n      return this.renderInnerScreen();\n    }\n\n    console.log('App@render: JS rendering main screen');\n    return this.renderMainMenu();\n}\n\n  setScreen(name) {\n    this.setState({\n      screen: Screens[name],\n    });\n  }\n\n  _onNotification(notification) {\n    console.log('App@onNotification:', notification);\n    this.setState({notification: notification.getAlert()});\n  }\n\n  renderAnimationScreenButtons() {\n    return (\n      <View style={{flexDirection: 'row', justifyContent: 'center'}}>\n        {this.renderScreenButton('RN Animations', Screens.RNAnimationsScreen)}\n        {isAndroid && this.renderInlineSeparator()}\n        {isAndroid && this.renderScreenButton('Native Animation', Screens.NativeAnimationsScreen)}\n      </View>\n    );\n  }\n}\n"
  },
  {
    "path": "detox/test/src/helpers/buffers.js",
    "content": "const buffers = [\n  'zW7QIW8i7XOSOHKKxHhGu43goBFBQyJNK2ICmMoYpl8u79lpwNDPrEsYQP8vHVSUJcN5zUcRCvCEcoSkyfzquV1PlzZ3FRK9OsIQ',\n  'bwb7KDA5be0YZhaftWpigIqZplqTjugm2CaRHQK8RF8wm6lIVGVJLF74nvTBB2igN4SR4fb5Hxxs3mEFQObbK8BVXxZKOtWMCyca',\n  '302kOpuiSul48Gy1oLH4e8mIVpFNS1PhxVBFgbtMvE9CRf7pcuOAbqqpp4MCC5Oybs6HvzuOpwAtgeWoLIqY5flFytGTc90mQyIX',\n  'Ykmbp3OjGoT1JifBNIbXTG9KyiOr3fZgucYzjYpYUMfQJQpES6E34Rw4O1O7JeBOXBnZi7CWn4SPTqXOBTsa1zPzZC8bA9HUKSCR',\n  'feDRiENrtR0tMXf24O5r0FW3iEy0GEtDJqzqRoIJf3g22qs5fJLvlyKhqs4O1whEF7qbkmgbDejKcZKzjpp8FlUh5y1Hm471l8vI',\n  'Xt0U9M2pXM9x1ERcXzeNx5v4Q1AaZBrEovhPyuU90Etv5qfUvNSxknTG7NzCFU2C6kRkhx5v0bl5R5vn26MR91jxM8CshtRUGjw5',\n  'OMtVLHbYQG0rjtrXgcheHv1yeYglRzueOzujIAIAMy4VrumWSYSiWQJCqbv98BK95nViUwv88WoyIC1Enwz1DcXtV6SlMBA64UR3',\n  '6U8cTGeCvseq3ferrKkiYRWsGNh9qjkvnaK9xDcvU6OtSZA3Bw4rIvDVysEaxU8S6tZDDY29zXeggz9h3ihj206cyknDBfA655Q2',\n  'zyhMsPEupxg0VTgfBzybZ9MEcTyn0EoXqG24UEzOrmVFhuLS1SqHJRz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ClU33R22oMK2RtVp',\n  'k5NXNhUIp9iwPJfEw53rsPeyvXKO0NRlYLovg4MC4QnG8Uo9yTubsp8Ga8y33ffaYWQ90UCz8lCw11jTTUzqQSOQMX00MnV7y0P4'\n];\n\nexport default function getStringByLength(chunks) {\n  let res = '';\n  for (let i = 0; i < chunks ; i++) {\n    res += buffers[i % buffers.length];\n  }\n  return res;\n}\n"
  },
  {
    "path": "detox/test/src/helpers/storage.js",
    "content": "import AsyncStorage from '@react-native-async-storage/async-storage';\n\nconst SET_AND_GET_ITERATIONS = 50;\nconst GLOBAL_ITERATIONS = 4;\n\nexport async function runStressTest() {\n  for (let globalCount = 1, keyCount = 10;\n        globalCount <= GLOBAL_ITERATIONS;\n        globalCount++, keyCount += 10) {\n    console.log(`Storage@Stress Global iteration #${globalCount}`);\n    await AsyncStorage.clear();\n\n    for (let iterCount = 0; iterCount < SET_AND_GET_ITERATIONS; iterCount++) {\n      await _setAndGetGeneratedData(keyCount);\n    }\n  }\n}\n\nasync function _setAndGetGeneratedData(keyCount) {\n  await _storeGeneratedData(keyCount);\n  await _getAllData();\n}\n\nasync function _storeGeneratedData(keyCount) {\n  for (let index = 0; index < keyCount; index++) {\n    const key = `@key${index}`;\n    const value = {\n      index,\n      text: `Greetings from your SSD! I'm the stored-value of ${key} :-)`,\n    };\n    await AsyncStorage.setItem(key, JSON.stringify(value));\n  }\n}\n\nasync function _getAllData() {\n  const keys = await AsyncStorage.getAllKeys();\n  await AsyncStorage.multiGet(keys)\n}\n"
  },
  {
    "path": "detox/test/src/types.d.ts",
    "content": "declare module '*.png';\n"
  },
  {
    "path": "detox/test/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"lib\": [\"es2018\"],\n    \"target\": \"ES2018\",\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"jsx\": \"react-native\",\n    \"moduleResolution\": \"node\",\n    \"resolveJsonModule\": true,\n    \"esModuleInterop\": true,\n    \"noEmit\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"node\", \"jest\", \"detox\"]\n  },\n  \"rootDir\": \".\",\n  \"include\": [\n    \"**/*.js\",\n    \"**/*.ts\"\n  ],\n  \"exclude\": [\n    \"coverage\",\n    \"e2e/**/*.js\",\n    \"e2e-unhappy/**/*.js\",\n    \"integration/**/*.js\",\n    \"types/*.ts\"\n  ]\n}\n"
  },
  {
    "path": "detox/test/types/.eslintrc.js",
    "content": "module.exports = {\n  overrides: [\n    {\n      files: ['*.ts'],\n      parserOptions: {\n        project: ['./types/tsconfig.json']\n      },\n      rules: {\n        'no-undef': 'off',\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": "detox/test/types/detox-global-tests.ts",
    "content": "declare var describe: (test: string, callback: () => void) => void;\ndeclare var beforeAll: (callback: () => void) => void;\ndeclare var beforeEach: (callback: () => void) => void;\ndeclare var afterAll: (callback: () => void) => void;\ndeclare var test: (test: string, callback: () => void) => void;\n\nfunction assertType<T>(value: T) { return value; }\n\ndescribe(\"Test\", () => {\n    beforeAll(async () => {\n        device.appLaunchArgs.shared.modify({ ourMockServerPort: 9999 });\n        await device.selectApp('app1');\n        device.appLaunchArgs.shared.get(); // { ourMockServerPort: 9999 }\n        await device.selectApp('app2');\n        device.appLaunchArgs.modify({ appMockServerPort: 4001 });\n        device.appLaunchArgs.get(); // { appMockServerPort: 4001, ourMockServerPort: 9999 }\n    });\n\n    beforeAll(async () => {\n        await device.launchApp({ resetAppState: true });\n        await device.reloadReactNative();\n\n        await device.setStatusBar({ time: \"12:34\" });\n        await device.setStatusBar({\n            time: \"12:34\",\n            dataNetwork: \"wifi\",\n            wifiMode: \"failed\",\n            wifiBars: \"2\",\n            cellularMode: \"searching\",\n            cellularBars: \"3\",\n            operatorName: \"A1\",\n            batteryState: \"charging\",\n            batteryLevel: \"50\",\n        });\n\n        const artifactsPaths: string[] = [\n            await device.takeScreenshot(\"test screenshot\"),\n            await device.captureViewHierarchy(),\n            await device.captureViewHierarchy('a'),\n        ];\n\n        artifactsPaths.splice(0);\n    });\n\n    afterAll(async () => {\n        device.appLaunchArgs.reset();\n        device.appLaunchArgs.shared.reset();\n    });\n\n    afterAll(async () => {\n        await element(by.id(\"element\")).clearText();\n    });\n\n    test(\"Test\", async () => {\n        await element(by.id(\"element\")).replaceText(\"text\");\n        await element(by.id(\"element\")).tap();\n        await element(by.id(\"element\")).tap({ x: 20, y: 30 });\n        await element(by.id(\"element\")).longPress();\n        await element(by.id(\"element\")).longPress(1000);\n        await element(by.id(\"element\")).scroll(50, \"down\");\n        await element(by.id(\"scrollView\")).scrollTo(\"bottom\");\n        await expect(element(by.id(\"element\")).atIndex(0)).toNotExist();\n        await element(by.id(\"scrollView\")).swipe(\"down\", \"fast\", 0.2, 0.5, 0.5);\n        await element(by.type(\"UIPickerView\")).setColumnToValue(1, \"6\");\n\n        await expect(\n            element(by.id(\"element\").withAncestor(by.id(\"parent_element\")))\n        ).toNotExist();\n        await expect(\n            element(by.id(\"element\").withDescendant(by.id(\"child_element\")))\n        ).toNotExist();\n\n        // eslint-disable-next-line jest/valid-expect\n        const expectElement = expect(element(by.id('TextField_Id1')));\n\n        await expectElement.toBeVisible();\n        await expectElement.not.toBeVisible();\n        await expectElement.toBeNotVisible();\n\n        await expectElement.toBeFocused();\n        await expectElement.not.toBeFocused();\n        await expectElement.toBeNotFocused();\n\n        const waitForElement = waitFor(element(by.id(\"element\")));\n        await waitForElement.toBeVisible().withTimeout(2000);\n\n        await device.pressBack();\n        await device.reverseTcpPort(32167);\n        await device.unreverseTcpPort(32167);\n\n        await waitFor(element(by.text(\"Text5\")))\n            .toBeVisible()\n            .whileElement(by.id(\"ScrollView630\"))\n            .scroll(50, \"down\");\n\n        await waitFor(element(by.text(\"Text5\")))\n          .toBeVisible()\n          .whileElement(by.id(\"ScrollView630\"))\n          .scroll(50, \"down\", 0.5, 0.5);\n\n        // @ts-expect-error\n        await waitFor(element(by.text(\"Text5\"))).toBeVisible().whileElement(by.id(\"ScrollView630\")).tap();\n\n        await web.element(by.web.id(\"btnSave\")).tap();\n        await web.element(by.web.id(\"btnSave\")).runScript('(el) => el.click()');\n        const scriptResult = await web.element(by.web.id(\"btnSave\")).runScript(function (el: any, text: string) {\n          el.textContent = text;\n          return text.length;\n        }, ['new button text']);\n        assertType<number>(scriptResult);\n        await web.element(by.web.className(\"scroll-end\")).atIndex(0).scrollToView();\n\n        const webview = web(by.id(\"webview\"));\n        await expect(webview.element(by.web.cssSelector(\".button\"))).toExist();\n        await expect(webview.element(by.web.cssSelector(\".button\")).atIndex(1)).toExist();\n    });\n\n    describe('getAttributes', async () => {\n        let commonAttributes: Detox.IosElementAttributes | Detox.AndroidElementAttributes;\n        let iosAttributes: Omit<Detox.IosElementAttributes, keyof Detox.AndroidElementAttributes>;\n        let androidAttributes: Omit<Detox.AndroidElementAttributes, keyof Detox.IosElementAttributes>;\n\n        beforeEach(async () => {\n            const attributes = await element(by.id(\"element\")).getAttributes();\n\n            if ('elements' in attributes) {\n                if ('activationPoint' in attributes.elements[0]) {\n                    commonAttributes = iosAttributes = attributes.elements[0] as Detox.IosElementAttributes;\n                } else {\n                    commonAttributes = androidAttributes = attributes.elements[0] as Detox.AndroidElementAttributes;\n                }\n            } else if ('activationPoint' in attributes) {\n                commonAttributes = iosAttributes = attributes as Detox.IosElementAttributes;\n            } else {\n                commonAttributes = androidAttributes = attributes as Detox.AndroidElementAttributes;\n            }\n        });\n\n        test('common attributes', () => {\n            assertType<boolean>(commonAttributes.enabled);\n            assertType<string>(commonAttributes.identifier);\n            assertType<boolean>(commonAttributes.visible);\n            assertType<string | undefined>(commonAttributes.text);\n            assertType<string | undefined>(commonAttributes.label);\n            assertType<string | undefined>(commonAttributes.placeholder);\n            assertType<unknown>(commonAttributes.value);\n            assertType<number>(commonAttributes.frame.x);\n            assertType<number>(commonAttributes.frame.y);\n            assertType<number>(commonAttributes.frame.width);\n            assertType<number>(commonAttributes.frame.height);\n        });\n\n        test('iOS-specific attributes', () => {\n            assertType<number>(iosAttributes.activationPoint.x);\n            assertType<number>(iosAttributes.activationPoint.y);\n            assertType<number>(iosAttributes.normalizedActivationPoint.x);\n            assertType<number>(iosAttributes.normalizedActivationPoint.y);\n            assertType<boolean>(iosAttributes.hittable);\n            assertType<number>(iosAttributes.elementFrame.x);\n            assertType<number>(iosAttributes.elementFrame.y);\n            assertType<number>(iosAttributes.elementFrame.width);\n            assertType<number>(iosAttributes.elementFrame.height);\n            assertType<number>(iosAttributes.elementBounds.x);\n            assertType<number>(iosAttributes.elementBounds.y);\n            assertType<number>(iosAttributes.elementBounds.width);\n            assertType<number>(iosAttributes.elementBounds.height);\n            assertType<number>(iosAttributes.safeAreaInsets.top);\n            assertType<number>(iosAttributes.safeAreaInsets.left);\n            assertType<number>(iosAttributes.safeAreaInsets.right);\n            assertType<number>(iosAttributes.safeAreaInsets.bottom);\n            assertType<number>(iosAttributes.elementSafeBounds.x);\n            assertType<number>(iosAttributes.elementSafeBounds.y);\n            assertType<number>(iosAttributes.elementSafeBounds.width);\n            assertType<number>(iosAttributes.elementSafeBounds.height);\n            assertType<string | undefined>(iosAttributes.date);\n            assertType<number | undefined>(iosAttributes.normalizedSliderPosition);\n            if (iosAttributes.contentOffset) {\n                assertType<number>(iosAttributes.contentOffset.x);\n                assertType<number>(iosAttributes.contentOffset.y);\n            }\n            if (iosAttributes.contentInset) {\n                assertType<number>(iosAttributes.contentInset.bottom);\n                assertType<number>(iosAttributes.contentInset.left);\n                assertType<number>(iosAttributes.contentInset.right);\n                assertType<number>(iosAttributes.contentInset.top);\n            }\n            if (iosAttributes.adjustedContentInset) {\n                assertType<number>(iosAttributes.adjustedContentInset.bottom);\n                assertType<number>(iosAttributes.adjustedContentInset.left);\n                assertType<number>(iosAttributes.adjustedContentInset.right);\n                assertType<number>(iosAttributes.adjustedContentInset.top);\n            }\n            assertType<string>(iosAttributes.layer);\n        });\n\n        test('Android-specific attributes', () => {\n            assertType<'visible' | 'invisible' | 'gone'>(androidAttributes.visibility);\n            assertType<number>(androidAttributes.width);\n            assertType<number>(androidAttributes.height);\n            assertType<number>(androidAttributes.elevation);\n            assertType<number>(androidAttributes.alpha);\n            assertType<boolean>(androidAttributes.focused);\n            assertType<number | undefined>(androidAttributes.textSize);\n            assertType<number | undefined>(androidAttributes.length);\n        });\n    });\n});\n"
  },
  {
    "path": "detox/test/types/detox-integration-tests.ts",
    "content": "import type { Circus } from '@jest/types';\nimport { pilot } from 'detox';\nimport {\n  DetoxCircusEnvironment,\n  DetoxCircusListener,\n  DetoxCircusListenerConstructorOpts,\n  globalSetup,\n  globalTeardown\n} from 'detox/runners/jest';\n\nclass NoneListener implements DetoxCircusListener {}\n\nclass OmniListener implements DetoxCircusListener {\n  constructor(opts: DetoxCircusListenerConstructorOpts) {\n    console.log('Current test path is:', opts.env.testPath);\n  }\n\n  start_describe_definition(event: Circus.Event & { name: 'start_describe_definition' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.blockName);\n  }\n\n  finish_describe_definition(event: Circus.Event & { name: 'finish_describe_definition' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.blockName);\n  }\n\n  add_hook(event: Circus.Event & { name: 'add_hook' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.hookType);\n  }\n\n  add_test(event: Circus.Event & { name: 'add_test' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.testName);\n  }\n\n  error(event: Circus.Event & { name: 'error' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.error);\n  }\n\n  async setup(event: Circus.Event & { name: 'setup' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.runtimeGlobals);\n  }\n\n  async include_test_location_in_result(event: Circus.Event & { name: 'include_test_location_in_result' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.name);\n  }\n\n  async hook_start(event: Circus.Event & { name: 'hook_start' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.hook.type);\n  }\n\n  async hook_success(event: Circus.Event & { name: 'hook_success' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.hook.type);\n  }\n\n  async hook_failure(event: Circus.Event & { name: 'hook_failure' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.hook.type, event.error);\n  }\n\n  async test_fn_start(event: Circus.Event & { name: 'test_fn_start' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_fn_success(event: Circus.Event & { name: 'test_fn_success' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_fn_failure(event: Circus.Event & { name: 'test_fn_failure' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name, event.error);\n  }\n\n  async test_retry(event: Circus.Event & { name: 'test_retry' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_start(event: Circus.Event & { name: 'test_start' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_skip(event: Circus.Event & { name: 'test_skip' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_todo(event: Circus.Event & { name: 'test_todo' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async test_done(event: Circus.Event & { name: 'test_done' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.test.name);\n  }\n\n  async run_describe_start(event: Circus.Event & { name: 'run_describe_start' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.describeBlock.name);\n  }\n\n  async run_describe_finish(event: Circus.Event & { name: 'run_describe_finish' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.describeBlock.name);\n  }\n\n  async run_start(event: Circus.Event & { name: 'run_start' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.name);\n  }\n\n  async run_finish(event: Circus.Event & { name: 'run_finish' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.name);\n  }\n\n  async teardown(event: Circus.Event & { name: 'teardown' }, state: Circus.State) {\n    if (state.unhandledErrors.length > 0) return;\n    console.log(event.name);\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nclass CustomEnvironment extends DetoxCircusEnvironment {\n  constructor(config: any, context: any) {\n    super(config, context);\n\n    this.setupTimeout = 20000;\n    this.teardownTimeout = 10000;\n    this.registerListeners({\n      NoneListener,\n      OmniListener,\n    });\n  }\n\n  async initDetox() {\n    const instance: DetoxInternals.Worker = await super.initDetox();\n\n    // Test 1: setDefaults should work with partial config\n    pilot.setDefaults({\n      testContext: {\n        getCurrentTestFilePath: () => '/default/path.js',\n      }\n    });\n\n    // Test 2: Simple approach with promptHandler\n    pilot.init({\n      async runPrompt(_prompt: string, _image?: string): Promise<string> {\n        return 'mock response';\n      },\n\n      isSnapshotImageSupported(): boolean {\n        return true;\n      },\n    });\n\n    // Test 3: Verify the methods are available after init\n    await pilot.perform('tap on login button');\n    await pilot.autopilot('log into the app');\n    pilot.extendAPICatalog([]);\n\n    return instance;\n  }\n\n  handleTestEvent(event: Circus.Event, state: Circus.State): void | Promise<void> {\n    if (event.name === 'test_done') {\n      console.log(event.test.name);\n    }\n\n    return super.handleTestEvent(event, state);\n  }\n}\n\nasync function main() {\n  try {\n    await globalSetup();\n  } finally {\n    await globalTeardown();\n  }\n}\n\nmain().catch(() => {});\n"
  },
  {
    "path": "detox/test/types/detox-internals-tests.ts",
    "content": "import { Event } from 'trace-event-lib';\n\ndeclare function random<T>(): T\ndeclare function assert<T>(x: T): void;\n\nimport {\n  cleanup,\n  config,\n  init,\n  installWorker,\n  log,\n  onHookFailure,\n  onRunDescribeFinish,\n  onRunDescribeStart,\n  onTestDone,\n  onTestFnFailure,\n  onTestStart,\n  reportTestResults,\n  resolveConfig,\n  session,\n  tracing,\n  uninstallWorker,\n  worker,\n} from 'detox/internals';\n\nasync function internalsTest() {\n  const globalOptions: DetoxInternals.DetoxInitOptions = {\n    cwd: __dirname,\n    argv: {\n      configuration: 'android.debug',\n    },\n    testRunnerArgv: {\n      bail: true\n    },\n    override: {\n      artifacts: {},\n      devices: {},\n    },\n    global,\n    workerId: Math.random() > 0.5 ? null : 'worker-1',\n  };\n\n  await resolveConfig();\n  await resolveConfig({});\n  await resolveConfig(globalOptions);\n\n  await init();\n  await init({});\n  await init(globalOptions);\n\n  await installWorker();\n  await installWorker({});\n  await installWorker({\n    global,\n    workerId: 'worker-1',\n  });\n\n  assert<DetoxInternals.Worker>(worker);\n\n  await uninstallWorker();\n  await cleanup();\n}\n\nasync function logTest() {\n  switch (log.level) {\n    case 'fatal':\n    case 'error':\n    case 'warn':\n    case 'info':\n    case 'debug':\n    case 'trace':\n      break;\n  }\n\n  log.trace('msg');\n  log.trace({ event: 'EVENT' }, 'msg');\n\n  log.trace.begin('Outer section');\n  log.debug.begin({ arg: 'value' }, 'Inner section');\n\n  log.info.complete('Sync section', () => 'sync').toUpperCase();\n  log.warn.complete('Async section', async () => 42).then(() => 84);\n  log.error.complete('Promise section', Promise.resolve(42)).finally(() => {});\n  log.fatal.complete('Value section', 42).toFixed(1);\n\n  log.warn.end({ extra: 'data' });\n  log.info.end();\n\n  log.debug('msg');\n  log.debug({ event: 'EVENT' }, 'msg');\n  log.info('msg');\n  log.info({ event: 'EVENT' }, 'msg');\n  log.warn('msg');\n  log.warn({ event: 'EVENT' }, 'msg');\n  log.error('msg');\n  log.error({ event: 'EVENT' }, 'msg');\n  log.fatal('msg');\n  log.fatal({ event: 'EVENT' }, 'msg');\n\n  log.child().info('msg');\n  log.child({ anything: 'value' }).trace('msg');\n\n  const serverLogger = log.child({ cat: 'server', id: 4333 });\n  serverLogger.info.begin({}, 'Starting server...');\n  await serverLogger.trace.complete('something', async () => {\n    // ... do something ...\n  });\n\n  serverLogger.trace.end();\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction tracingTest() {\n  return new Promise((resolve, reject) => {\n    tracing.createEventStream()\n      .on('data', function (e: Event) {\n        console.log(e.ph, e.name);\n      })\n      .on('error', reject)\n      .on('end', resolve)\n  });\n}\n\nfunction configTest() {\n  assert<number>(session.workersCount);\n  assert<string>(config.configurationName);\n  assert<Record<string, Detox.DetoxAppConfig>>(config.apps);\n  assert<Detox.DetoxArtifactsConfig>(config.artifacts);\n  assert<Detox.DetoxBehaviorConfig>(config.behavior);\n  assert<DetoxInternals.CLIConfig>(config.cli);\n  assert<Detox.DetoxDeviceConfig>(config.device);\n  assert<Detox.DetoxLoggerConfig>(config.logger);\n  assert<Detox.DetoxSessionConfig>(config.session);\n  assert<Detox.DetoxTestRunnerConfig>(config.testRunner);\n}\n\nasync function lifecycleTest() {\n  await onRunDescribeStart({\n    name: 'Test suite',\n  });\n\n  await onTestStart({\n    title: 'Some test',\n    fullName: 'Test suite > Some test',\n    status: 'running',\n    invocations: 1,\n  });\n\n  await onTestFnFailure({\n    error: new Error('Test fn failure'),\n  });\n\n  await onTestDone({\n    title: 'Some test',\n    fullName: 'Test suite > Some test',\n    status: Math.random() < 0.5 ? 'failed' : 'passed',\n    invocations: 2,\n    timedOut: false,\n  });\n\n  await onHookFailure({\n    error: new Error('Hook failure'),\n    hook: random<'beforeAll' | 'beforeEach' | 'afterEach' | 'afterAll'>(),\n  });\n\n  await onRunDescribeFinish({\n    name: 'Test suite',\n  });\n\n  await reportTestResults([\n    {\n      testFilePath: 'test1',\n      success: true,\n    },\n    {\n      testFilePath: 'test2',\n      success: false,\n    },\n    {\n      testFilePath: 'test1',\n      success: false,\n      testExecError: new Error('Generic test suite failure'),\n      isPermanentFailure: true,\n    },\n  ]);\n}\n\nPromise.all([\n  internalsTest() ,\n  lifecycleTest(),\n  logTest(),\n  Promise.resolve().then(configTest),\n]).catch(() => {});\n"
  },
  {
    "path": "detox/test/types/detox-module-tests.ts",
    "content": "declare var describe: (test: string, callback: () => void) => void;\ndeclare var beforeAll: (callback: () => void) => void;\ndeclare var afterAll: (callback: () => void) => void;\ndeclare var test: (name: string, callback: () => void) => void;\n\nimport { by, device, element, expect, waitFor, log, trace, traceCall } from 'detox';\n\ndescribe('Test', () => {\n  beforeAll(async () => {\n    await device.reloadReactNative();\n    await device.launchApp({\n      newInstance: false,\n      permissions: {\n        location: 'always',\n        notifications: 'YES',\n        calendar: 'NO',\n        camera: 'YES',\n        contacts: 'NO',\n        health: 'YES',\n        homekit: 'NO',\n        medialibrary: 'YES',\n        microphone: 'NO',\n        motion: 'YES',\n        photos: 'NO',\n        reminders: 'YES',\n        siri: 'NO',\n        speech: 'YES',\n        faceid: 'NO',\n        userTracking: 'YES',\n      },\n      url: 'detoxtesturlscheme://such-string',\n      userNotification: {},\n      userActivity: {},\n      delete: false,\n      launchArgs: {\n        someArg: 42,\n      },\n      languageAndLocale: {\n        language: 'en',\n        locale: 'en-CA',\n      },\n    });\n\n    await device.relaunchApp();\n    await device.relaunchApp({\n      launchArgs: {\n        someArg: 42,\n      },\n    });\n  });\n\n  afterAll(async () => {\n    await element(by.id('element')).clearText();\n  });\n\n  test('Test', async () => {\n    await element(by.id('element')).replaceText('text');\n    await element(by.id('element')).tap();\n    await element(by.id('element')).scroll(50, 'down');\n    await element(by.id('element')).scroll(50, 'down', 0.5, 0.5);\n    await element(by.id('scrollView')).scrollTo('bottom');\n    await expect(element(by.id('element')).atIndex(0)).toNotExist();\n    await element(by.id('scrollView')).swipe('down', 'fast', 0.2, 0.5, 0.5);\n    await element(by.type('UIPickerView')).setColumnToValue(1, '6');\n\n    await expect(element(by.id('element').withAncestor(by.id('parent_element')))).toNotExist();\n    await expect(element(by.id('element').withDescendant(by.id('child_element')))).toNotExist();\n\n    await waitFor(element(by.id('element')))\n      .toBeVisible()\n      .withTimeout(2000);\n    await device.pressBack();\n    await waitFor(element(by.text('Text5')))\n      .toBeVisible()\n      .whileElement(by.id('ScrollView630'))\n      .scroll(50, 'down');\n\n    await expect(element(by.id('element'))).not.toBeVisible();\n    await expect(element(by.id('element'))).not.toExist();\n  });\n\n  test('Trace', async () => {\n    trace.startSection('Long method');\n    trace.endSection('Long method');\n\n    await traceCall('Another long method', async () => {\n      // do something\n    });\n\n    switch (log.level) {\n      case 'fatal':\n      case 'error':\n      case 'warn':\n      case 'info':\n      case 'debug':\n      case 'trace':\n        break;\n    }\n\n    log.trace('msg');\n    log.trace({ event: 'EVENT' }, 'msg');\n\n    log.trace.begin('Outer section');\n    log.debug.begin({ arg: 'value' }, 'Inner section');\n\n    log.info.complete('Sync section', () => 'sync').toUpperCase();\n    log.warn.complete('Async section', async () => 42).then(() => 84);\n    log.error.complete('Promise section', Promise.resolve(42)).finally(() => {});\n    log.fatal.complete('Value section', 42).toFixed(1);\n\n    log.warn.end({ extra: 'data' });\n    log.info.end();\n\n    log.debug('msg');\n    log.debug({ event: 'EVENT' }, 'msg');\n    log.info('msg');\n    log.info({ event: 'EVENT' }, 'msg');\n    log.warn('msg');\n    log.warn({ event: 'EVENT' }, 'msg');\n    log.error('msg');\n    log.error({ event: 'EVENT' }, 'msg');\n    log.fatal('msg');\n    log.fatal({ event: 'EVENT' }, 'msg');\n\n    log.child().info('msg');\n    log.child({ anything: 'value' }).trace('msg');\n\n    const serverLogger = log.child({ cat: 'server', id: 4333 });\n    serverLogger.info.begin({}, 'Starting server...');\n    await serverLogger.trace.complete('something', async () => {\n      // ... do something ...\n    });\n\n    serverLogger.trace.end();\n  })\n});\n"
  },
  {
    "path": "detox/test/types/tsconfig.json",
    "content": "{\n  \"extends\": \"..\",\n  \"include\": [\"*.ts\"],\n  \"exclude\": [],\n  \"compilerOptions\": {\n    \"types\": [\"node\", \"detox\"],\n    \"skipLibCheck\": false,\n    \"strict\": true,\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"strictNullChecks\": true,\n    \"strictFunctionTypes\": true\n  }\n}\n"
  },
  {
    "path": "detox/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"node16\",\n    \"lib\": [\"es2022\"],\n    \"target\": \"ES2022\",\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"moduleResolution\": \"node16\",\n    \"resolveJsonModule\": true,\n    \"esModuleInterop\": true,\n    \"noEmit\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"node\", \"jest\"]\n  },\n  \"rootDir\": \".\",\n  \"include\": [\n    \"detox.d.ts\",\n    \"globals.d.ts\",\n    \"index.d.ts\",\n    \"**/*.js\",\n    \"**/*.ts\"\n  ],\n  \"exclude\": [\n    \"android\",\n    \"allure-report\",\n    \"allure-results\",\n    \"coverage\",\n    \"ios\",\n    \"test\"\n  ]\n}\n"
  },
  {
    "path": "detox/wallaby.js",
    "content": "/*eslint-disable*/\n'use strict';\n\nmodule.exports = function(wallaby) {\n  return {\n    env: {\n      type: 'node',\n      runner: 'node'\n    },\n\n    testFramework: 'jest',\n\n    files: [\n      'package.json',\n      'src/**/*.js',\n      'src/**/*.mock.*',\n      '!src/**/*.test.js',\n      '__tests__/setupJest.js',\n      'runners/**/*.js'\n    ],\n\n    tests: [\n      'src/**/*.test.js',\n    ]\n  };\n};\n"
  },
  {
    "path": "detox-cli/cli.js",
    "content": "#!/usr/bin/env node\nconst cp = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\nconst chalk = require('chalk');\n\n/**\n * @param {string} msg\n */\nfunction log(msg) {\n  console.error(chalk.red(msg));\n}\n\nfunction main([_$0, _detox, ...cliArgs]) {\n  const [command] = cliArgs;\n\n  if (command === 'recorder' && process.platform === 'darwin') {\n    return spawnRecorder(cliArgs);\n  } else {\n    return spawnDetoxBinary(cliArgs);\n  }\n}\n\nfunction spawnDetoxBinary(cliArgs) {\n  const isWin32 = process.platform === 'win32';\n  const nodeBinariesPath = path.join(process.cwd(), 'node_modules/.bin');\n  const binaryPath = path.join(nodeBinariesPath, `detox${isWin32 ? '.cmd' : ''}`);\n\n  if (!fs.existsSync(binaryPath)) {\n    log(`Failed to find Detox executable at path: ${binaryPath}`);\n    log(`\\nPossible solutions:`);\n    log(`1. Make sure your current working directory is correct.`);\n    log(`2. Run \"npm install\" to ensure your \"node_modules\" directory is up-to-date.`);\n    log(`3. Run \"npm install detox --save-dev\" for the fresh Detox installation in your project.\\n`);\n\n    return 1;\n  }\n\n  const PATH = isWin32 ? findPathKey() : 'PATH';\n  const spawnOptions = {\n    stdio: 'inherit',\n    env: {\n      ...process.env,\n      [PATH]: [nodeBinariesPath, process.env.PATH].join(path.delimiter),\n    }\n  };\n\n  const result = isWin32\n    // { shell: true } option seems to break quoting on windows? Otherwise this would be much simpler.\n    ? cp.spawnSync('cmd', ['/c', binaryPath, ...cliArgs], spawnOptions)\n    : cp.spawnSync(binaryPath, cliArgs, spawnOptions);\n\n  return result.status;\n}\n\nfunction spawnRecorder([_recorder, ...recorderArgs]) {\n  const detoxRecorderPath = path.join(process.cwd(), 'node_modules/detox-recorder');\n  const detoxRecorderCLIPath = path.join(detoxRecorderPath, 'DetoxRecorderCLI');\n\n  if (!fs.existsSync(detoxRecorderCLIPath)) {\n    log(`Detox Recorder is not installed in this directory: ${detoxRecorderPath}`);\n    return 1;\n  }\n\n  const result = cp.spawnSync(detoxRecorderCLIPath, recorderArgs, { stdio: 'inherit' });\n  return result.status;\n}\n\nfunction findPathKey() {\n  return Object.keys(process.env).find(isCaseInsensitivePath);\n}\n\nfunction isCaseInsensitivePath(key) {\n  return key.toLowerCase() === 'path';\n}\n\nprocess.exit(main(process.argv));\n"
  },
  {
    "path": "detox-cli/package.json",
    "content": "{\n  \"name\": \"detox-cli\",\n  \"version\": \"20.47.0\",\n  \"description\": \"Optional wrapper for Detox CLI, meant to be installed globally\",\n  \"main\": \"cli.js\",\n  \"scripts\": {\n    \"test\": \":\"\n  },\n  \"bin\": {\n    \"detox\": \"./cli.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/wix/detox.git\"\n  },\n  \"keywords\": [\n    \"detox\",\n    \"cli\"\n  ],\n  \"author\": \"Yaroslav Serhieiev <yaroslavs@wix.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/wix/Detox/issues\"\n  },\n  \"dependencies\": {\n    \"chalk\": \"^4.0.0\"\n  },\n  \"homepage\": \"https://github.com/wix/Detox\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  }\n}\n"
  },
  {
    "path": "docs/api/actions.md",
    "content": "# Actions\n\nDetox uses [matchers](matchers.md) to find UI elements in your app and actions to simulate user interaction with those elements.\n\nUse [expectations](expect.md) to verify element states.\n\n## Methods\n\n- [`.tap()`](#tappoint)\n- [`.multiTap()`](#multitaptimes)\n- [`.longPress()`](#longpresspoint-duration)\n- [`.longPressAndDrag()`](#longpressanddragduration-normalizedpositionx-normalizedpositiony-targetelement-normalizedtargetpositionx-normalizedtargetpositiony-speed-holdduration)\n- [`.swipe()`](#swipedirection-speed-normalizedoffset-normalizedstartingpointx-normalizedstartingpointy)\n- [`.pinch()`](#pinchscale-speed-angle--ios-only) **iOS only**\n- [`.scrollToIndex()`](#scrolltoindexindex--android-only) **Android only**\n- [`.scroll()`](#scrolloffset-direction-startpositionx-startpositiony)\n  - [`whileElement()`](#whileelementelement)\n- [`.scrollTo()`](#scrolltoedge)\n- [`.typeText()`](#typetexttext)\n- [`.replaceText()`](#replacetexttext)\n- [`.clearText()`](#cleartext)\n- [`.tapReturnKey()`](#tapreturnkey)\n- [`.tapBackspaceKey()`](#tapbackspacekey)\n- [`.setColumnToValue()`](#setcolumntovaluecolumn-value--ios-only) **iOS only**\n- [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat)\n- [`.adjustSliderToPosition()`](#adjustslidertopositionnormalizedposition)\n- [`.getAttributes()`](#getattributes)\n- [`.takeScreenshot(name)`](#takescreenshotname)\n- [`.performAccessibilityAction()`](#performaccessibilityactionactionname)\n\n### `tap(point)`\n\nSimulates a tap on the element at the specified point, or at element’s activation point if no point is specified.\n\n`point`—a point in the element’s coordinate space (optional, valid input: object with x and y numerical values, default is `null`)\n\n**Note:** Special care should be applied when specifying a point with this method. Elements may have different dimensions when displayed on different device screen sizes, different text sizes, etc.\n\n```js\nawait element(by.id('tappable')).tap();\nawait element(by.id('tappable')).tap({x:5, y:10});\n```\n\n### `multiTap(times)`\n\nSimulates multiple taps on the element at its activation point. All taps are applied as a part of the same gesture and there is no synchronization attempt between taps.\n\n`times`—the number of taps to simulate (number, 1 and above)\n\n```js\nawait element(by.id('tappable')).multiTap(3);\n```\n\n### `longPress(point, duration)`\n\nSimulates a long press on the element at its activation point or at the specified point.\n\n`point` — a point in the element’s coordinate space (optional, object with `x` and `y` numerical values, default is `null`).\n`duration` — press during time, in milliseconds. Optional (defaults to the standard long-press duration for the platform).\n\n```js\nawait element(by.id('tappable')).longPress();\nawait element(by.id('tappable')).longPress({x:5, y:10});\nawait element(by.id('tappable')).longPress(1500);\nawait element(by.id('tappable')).longPress({x:5, y:10}, 1500);\n```\n\n:::note Important\n\nCustom durations should be used cautiously, as they can affect test consistency and user experience expectations.\nThey are typically necessary when testing components that behave differently from the platform's defaults or when simulating unique user interactions.\n\n:::\n\n### `longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration)`\n\nSimulates a long press on the element and then drag it to a position of another element.\n\n- `duration` —the duration to press for, in ms (required) <br/>\n- `normalizedPositionX` — X coordinate of the starting point, relative to the element width (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `normalizedPositionY` — Y coordinate of the starting point, relative to the element height (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `targetElement`— the target element to drag to (required) <br/>\n- `normalizedTargetPositionX` — X coordinate of the ending point, relative to the target element width (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `normalizedTargetPositionY` — Y coordinate of the ending point, relative to the target element height (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `speed` — the speed of the drag (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n- `holdDuration` — the duration before releasing at the end, in ms (optional, default is 1000)\n\n```js\nawait element(by.id('elementToDrag')).longPressAndDrag(2000, NaN, NaN, element(by.id('targetElement')), NaN, NaN);\nawait element(by.id('cellId_1')).longPressAndDrag(2000, 0.9, NaN, element(by.id('cellId_6')), 0.9, NaN, 'slow', 0);\n```\n\n### `swipe(direction[, speed, normalizedOffset, normalizedStartingPointX, normalizedStartingPointY])`\n\nSimulates a swipe on the element with the provided options.\n\n- `direction` — the direction of the swipe (required, valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n- `speed` — the speed of the swipe (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n- `normalizedOffset` — swipe amount relative to the screen width/height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n- `normalizedStartingPointX` — X coordinate of the swipe starting point, relative to the element width (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n- `normalizedStartingPointY` — Y coordinate of the swipe starting point, relative to the element height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically)\n\n```js\nawait element(by.id('scrollView')).swipe('down');\nawait element(by.id('scrollView')).swipe('down', 'slow'); // set swipe speed\nawait element(by.id('scrollView')).swipe('down', 'fast', 0.75); // set swipe amount\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, 0.8); // set starting point X\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, NaN, 0.25); // set starting point Y\n```\n\n### `pinch(scale, speed, angle)`  iOS only\n\nSimulates a pinch on the element with the provided options.\n\n`scale`—the scale of the pinch gesture; use a scale between 0 and 1 to zoom out, and a scale greater than 1 to zoom in; the system makes a best effort to accommodate the requested scale, taking into account the element’s dimensions (valid input: (0.0, inf]) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinch(1.1); //Zooms in a little bit\nawait element(by.id('PinchableScrollView')).pinch(2.0); //Zooms in a lot\nawait element(by.id('PinchableScrollView')).pinch(0.001); //Zooms out a lot\n```\n\n### `scrollToIndex(index)`  Android only\n\nScrolls until it reaches the element with the provided index. This works for `ReactScrollView` and `ReactHorizontalScrollView`.\n\n`index`—the index of the target element <br/>\n\n```js\nawait element(by.id('scrollView')).scrollToIndex(0);\n```\n\n### `scroll(offset, direction[, startPositionX, startPositionY])`\n\nSimulates a scroll on the element with the provided options.\n\n`offset`—the offset to scroll, in points <br/>\n`direction`—the scroll’s direction (valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n`startPositionX`—the normalized x percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`) <br/>\n`startPositionY`—the normalized y percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`)\n\n```js\nawait element(by.id('scrollView')).scroll(100, 'up');\nawait element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85);\n```\n\n### `whileElement(element)`\n\nContinuously scrolls the scroll element until the specified expectation is resolved. If the edge of the scroll element is reached while the expectation is not resolved, the operation is failed.\n\n```js\nawait waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down');\n```\n\n### `scrollTo(edge[, startPositionX, startPositionY])`\n\nSimulates a scroll to the specified edge.\n\n`edge`—the edge to scroll to (valid input: `\"left\"`/`\"right\"`/`\"top\"`/`\"bottom\"`) <br/>\n`startPositionX`—the normalized x percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`) <br/>\n`startPositionY`—the normalized y percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`)\n\n```js\nawait element(by.id('scrollView')).scrollTo('bottom');\nawait element(by.id('scrollView')).scrollTo('top', NaN, 0.2);\n```\n\n### `typeText(text)`\n\nSimulates typing of the specified text into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be typed into, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before typing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to type (valid input: string)\n\n```js\nawait element(by.id('textField')).typeText('passcode');\n```\n\n### `replaceText(text)`\n\nReplaces the element’s text with the specified text, without using the system’s builtin keyboard or typing behavior. **Note**, that using this method is faster than using [`.typeText()`](#typetexttext), but may not trigger all text input callbacks, causing an undefined state in your app.\n\nOn iOS, any element’s text can be replaced, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before replacing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to replace with (valid input: string)\n\n```js\nawait element(by.id('textField')).replaceText('passcode again');\n```\n\n### `clearText()`\n\nSimulates clearing the text of the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element’s text can be cleared, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before clearing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).clearText();\n```\n\n### `tapReturnKey()`\n\nSimulates tapping on the return key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent return key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the return key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapReturnKey();\n```\n\n### `tapBackspaceKey()`\n\nSimulates tapping of the backspace key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent backspace key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the backspace key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapBackspaceKey();\n```\n\n### `setColumnToValue(column, value)`  iOS only\n\nSets the element’s specified column to the specified value, using the system’s picker view APIs.\n\nValues accepted by this method are strings only, and the system will do its best to match complex picker view cells to the string.\n\nThis function does not support date pickers. Use [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat) instead.\n\n`column`—the element’s column to set (valid input: number, 0 and above) <br/>\n`value`—the string value to set (valid input: string)\n\n```js\nawait element(by.id('pickerView')).setColumnToValue(1, \"6\");\nawait element(by.id('pickerView')).setColumnToValue(2, \"Hello World\");\n```\n\n> **Note:** When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles. See [here](device.md#9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only) for more information.\n\n### `setDatePickerDate(dateString, dateFormat)`\n\nSets the date-picker’s date to the specified date and time.\n\n`dateString`—The date to set. Should match the format provided by `dateFormat`.<br/>\n`dateFormat`—The format of `dateString`. Should be either [`'ISO8601'`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString), or an explicit date representation format, as supported by [`NSDateFormatter`] on iOS / [`DateTimeFormatter`] on Android (e.g. `'yyyy/MM/dd'`).\n\n> _The recommended `dateFormat` is `ISO8601`._\n\nExamples:\n\n```js\nconst datePicker = element(by.id('datePicker'));\n\n// ISO8601:\nawait datePicker.setDatePickerDate('2019-02-06T05:10:00-08:00', 'ISO8601');\nawait datePicker.setDatePickerDate(new Date().toISOString(), 'ISO8601'); // toISOString returns an ISO8601 format with no timezone (UTC-0)\n\n// Explicit format:\nawait datePicker.setDatePickerDate('2019/02/06', \"yyyy/MM/dd\");\n```\n\n:::info\n\nAs far as element-matching is concerned, on Android, older versions of the popular [`@react-native-community/datetimepicker`] package don’t allow for the specification of your own [`testID`] prop for the date-picker component. Therefore, you'd have to either upgrade your package  to a newer version containing [PR datetimepicker#705] inside, or use Detox's [`by.type`] matcher as a workaround. For example:\n\n```js\nconst datePicker = device.getPlatform() === 'android'\n  ? element(by.type('android.widget.DatePicker'))\n  : element(by.id('datePicker'));\n```\n\n:::\n\n### `adjustSliderToPosition(normalizedPosition)`\n\nManipulates the UI to change the displayed value of the slider element to a new value, based on a normalized position.\n\n`normalizedPosition`—The normalized position to adjust the slider element. (valid input: \\[0, 1], 0 corresponds to the minimum value of the slider, and 1 corresponds to the maximum value)\n\n```js\nawait element(by.id('slider')).adjustSliderToPosition(0.75);\n```\n\n### `getAttributes()`\n\nReturns an object, representing various attributes of the element.\n\nRetrieved attributes are:\n\n- `text`: The text value of any textual element.\n- `label`: The label of the element. Matches `accessibilityLabel` for iOS, and `contentDescription` for android. Refer to the [`.toHaveLabel()` API](./expect.md#tohavelabellabel) in order to learn about caveats associated with this attribute in React Native apps.\n- `placeholder`: The placeholder text value of the element. Matches `hint` on android.\n- `enabled`: Whether the element is enabled for user interaction.\n- `identifier`: The identifier of the element. Matches `accessibilityIdentifier` on iOS, and the main view tag, on Android - both commonly **holding the component’s test ID in React Native apps**.\n- `visible`: Whether the element is visible. On iOS, visibility is calculated for the [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint). On Android, the attribute directly holds the value returned by [View.getLocalVisibleRect()](https://developer.android.com/reference/kotlin/android/view/View#getglobalvisiblerect)).\n- `value`: The value of the element, where applicable. For example: the position of a slider, or whether a checkbox has been marked. Matches `accessibilityValue`, on iOS.\n- `frame`: The frame of the element, in screen coordinate space.\n\n#### iOS-Only\n\n- `activationPoint`: The [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint) of the element, in element coordinate space.\n- `normalizedActivationPoint`: The activation point of the element, in normalized percentage (\\[0.0, 1.0]).\n- `hittable`: Whether the element is hittable at the activation point.\n- `elementFrame`: The frame of the element, in container coordinate space.\n- `elementBounds`: The bounds of the element, in element coordinate space.\n- `safeAreaInsets`: The safe area insets of the element, in element coordinate space.\n- `elementSafeBounds`: The safe area bounds of the element, in element coordinate space.\n- `date`: The date of the element (in case the element is a date picker).\n- `normalizedSliderPosition`: The normalized slider position (in case the element is a slider).\n- `contentOffset`: The content offset (in case the element is a scroll view).\n- `contentInset`: The content inset (in case the element is a scroll view).\n- `adjustedContentInset`: The adjusted content inset (in case the element is a scroll view).\n\n#### Android-Only\n\n- `visibility`: The OS visibility type associated with the element: `visible`, `invisible` or `gone`.\n- `width`: Width of the element, in pixels (deprecated).\n- `height`: Height of the element, in pixels (deprecated).\n- `elevation`: Elevation of the element.\n- `alpha`: Alpha value for the element.\n- `focused`: Whether the element is the one currently in focus.\n- `textSize`: The text size for the text element.\n- `length`: The length of the text element (character count).\n\nIf the value for a given attribute is null or cannot be otherwise computed, the key will not be present, but empty strings may be found in the object.\n\nIf the query matches multiple elements, the attributes of all matched elements is returned as an array of objects under the `elements` key.\n\n```js\n// import jestExpect from 'expect';\nconst jestExpect = require('expect').default;\n\n// ...\nconst attributes = await element(by.text('Tap Me')).getAttributes();\njestExpect(attributes.text).toBe('Tap Me');\n\nconst multipleMatchedElements = await element(by.text('Multiple')).getAttributes();\njestExpect(multipleMatchedElements.elements.length).toBe(5);\njestExpect(multipleMatchedElements.elements[0].identifier).toBe('FirstElement');\n```\n\n### `takeScreenshot(name)`\n\nTakes a screenshot of the matched element. For full details on taking screenshots with Detox, refer to the [screenshots guide](../guide/taking-screenshots.md).\n\n`name`—the name of the screenshot\n\n### `performAccessibilityAction(actionName)`\n\nTriggers an [accessibility action](https://reactnative.dev/docs/accessibility#accessibility-actions).\n\n`actionName`—the name of the accessibility action <br/>\n\n```js\nawait element(by.id('scrollView')).performAccessibilityAction(\"activate\");\n```\n\n## Deprecated Methods\n\n- [`.tapAtPoint()`](#tapatpointpoint)\n- [`.pinchWithAngle()`](#pinchwithangledirection-speed-angle--ios-only) **iOS only**\n\n### `tapAtPoint(point)`\n\n**Deprecated:** Use [`.tap()`](#tappoint) instead.\n\nSimulates a tap at on the element at the specified point.\n\n`point`—a point in the element’s coordinate space\n\n```js\nawait element(by.id('tappable')).tapAtPoint({x:5, y:10});\n```\n\n### `pinchWithAngle(direction, speed, angle)`  iOS only\n\n**Deprecated:** Use [`.pinch()`](#pinchscale-speed-angle--ios-only) instead.\n\nSimulates a pinch on the element with the provided options.\n\n`direction`—the direction of the pinch gesture (valid input: `\"inward\"`/`\"outward\"`) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinchWithAngle('outward', 'slow', 0);\n```\n\n[`testID`]: ../guide/test-id.md\n\n[`by.type`]: ../api/matchers.md#bytypeclassname\n\n[`Date.prototype.toISOString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n\n[`NSDateFormatter`]: https://developer.apple.com/documentation/foundation/dateformatter\n\n[`DateTimeFormatter`]: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html\n\n[`@react-native-community/datetimepicker`]: https://www.npmjs.com/package/@react-native-community/datetimepicker\n\n[PR datetimepicker#705]: https://github.com/react-native-datetimepicker/datetimepicker/pull/705\n"
  },
  {
    "path": "docs/api/device.md",
    "content": "# Device\n\nThe `device` object is globally available in every test file, unless you use `exposeGlobals: false` in the behavior config,\nand even then you can import it from Detox package:\n\n```js\nconst { device } = require('detox');\n```\n\nIt enables control over the current attached device.\n\n## Public Properties\n\n### `device.id`\n\nHolds the environment-unique ID of the device - namely, the `adb` ID on Android (e.g. `emulator-5554`) and the Mac-global simulator UDID on iOS, as used by `simctl` (e.g. `AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE`).\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n### `device.name`\n\nHolds a descriptive name of the device. Example: `emulator-5554 (Pixel_API_26)`\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n### `device.appLaunchArgs`\n\nAccess the launch-arguments predefined by the user in preliminary, static scopes such as the Detox [configuration file](../config/apps.mdx)\nand [command-line arguments](../cli/test.md). This access allows, through dedicated methods, for both value-querying and modification:\n\n```js\n// Modify some of the predefined arguments:\ndevice.appLaunchArgs.modify({\n  mockServerPort: 1234,\n});\n// Retrieve the arguments:\ndevice.appLaunchArgs.get(); // ==> { mockServerPort: 1234 }\n// Reset (i.e. remove all arguments):\ndevice.appLaunchArgs.reset();\n```\n\nIn multi-app environments, you might want to persist your values between `device.selectApp(name)` calls:\n\n```js\ndevice.appLaunchArgs.modify({ transientArg: 'value' });\ndevice.appLaunchArgs.shared.modify({\n  permanentMockServerPort: 1234,\n};\n\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234, transientArg: 'value' }\ndevice.appLaunchArgs.shared.get(); // ==> { permanentMockServerPort: 1234 }\n\nawait device.selectApp('anotherApp');\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.reset();\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.shared.reset();\ndevice.appLaunchArgs.get(); // ==> {}\n```\n\nThis is the most flexible way of editing the launch arguments. Refer to the [launch arguments guide](../guide/launch-args.md) for complete details.\n\n## Methods\n\n### `device.selectApp(name)`\n\nUse **only for advanced multi-app configs** when you need to switch between your apps\nwithin the same test scenario. Refer to the [configuration doc](../config/apps.mdx)\nto discover how to define multiple apps with different `name`s.\n\n```js\nawait device.selectApp('myAppName');\n```\n\nAs a side effect (due to the current architectural limitation) running `device.selectApp` terminates the previous\napp that had been running before.\n\n### `device.launchApp(params)`\n\nLaunch the app defined in the current [`configuration`](../config/overview.mdx).\n\n`params`—object, containing one of more of the following keys and values:\n\n#### 1. `newInstance`—Launching a New Instance of the App\n\nTerminate the app and launch it again.\n\nIf set to `false`, the device will try to resume the app (e.g. bring from foreground to background). If the app isn’t running, **it will launch a new instance** nonetheless. **Default is `false`.**\n\n```js\nawait device.launchApp({newInstance: true});\n```\n\n#### 2. `permissions`—Set Runtime Permissions (iOS Only)\n\nGrants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied.\n\n```js\nawait device.launchApp({permissions: {calendar: 'YES'}});\n```\n\nDetox uses [AppleSimUtils](https://github.com/wix/AppleSimulatorUtils) and [`xcrun simctl`](https://nshipster.com/simctl/) to implement this functionality for iOS simulators.\nPlease make sure you have the most recent version of both tools installed, since we rely on their latest versions.\n\n##### Supported Permissions\n\n| Permission    | Values                         | Notes                                                        |\n| ------------- | ------------------------------ | ------------------------------------------------------------ |\n| location      | always / inuse / never / unset | inuse - provides location access only when the app is in use |\n| contacts      | YES / NO / unset / limited     | limited - grants limited access to contacts                  |\n| photos        | YES / NO / unset / limited     | limited - grants limited access to photos                    |\n| calendar      | YES / NO / unset               |                                                              |\n| camera        | YES / NO / unset               |                                                              |\n| medialibrary  | YES / NO / unset               |                                                              |\n| microphone    | YES / NO / unset               |                                                              |\n| motion        | YES / NO / unset               |                                                              |\n| reminders     | YES / NO / unset               |                                                              |\n| siri          | YES / NO / unset               |                                                              |\n| notifications | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| health        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| homekit       | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| speech        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| faceid        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| userTracking  | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n\nCheck Detox's [own test suite](https://github.com/wix/Detox/blob/master/detox/test/e2e/13.permissions.test.js) for usage examples.\n\n#### 3. `url`—Launching with URL\n\nLaunches the app with the specified URL to test your app’s deep link handling mechanism.\n\n```js\nawait device.launchApp({url});\nawait device.launchApp({url, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({url, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](../guide/mocking-open-with-url.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 4. `userNotification`—Launching with User Notifications\n\nLaunches with the specified user notification.\n\n```js\nawait device.launchApp({userNotification});\nawait device.launchApp({userNotification, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({userNotification, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](../guide/mocking-user-notifications.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 5. `userActivity`—Launch with User Activity (iOS Only)\n\nLaunches the app with the specified user activity.\n\n```js\nawait device.launchApp({userActivity: activity});\nawait device.launchApp({userActivity: activity, newInstance: true}); //Launch a new instance of the app\nawait device.launchApp({userActivity: activity, newInstance: false}); //Reuse existing instance\n```\n\nRead more in [here](../guide/mocking-user-activity.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 6. `resetAppState`—Reset App State Before Launching\n\nResets the app's state and launches without necessarily performing a full uninstall/reinstall cycle.\n\n- Android: clears app data using `pm clear`, which is typically faster than reinstalling.\n- iOS: uninstalls and reinstalls the app to restore a clean state.\n\n```js\nawait device.launchApp({resetAppState: true});\n```\n\n#### 7. `delete`—Delete and Reinstall Application Before Launching\n\nUninstalls the app and then reinstalls it before launching. Slower than `resetAppState`,\nbut guarantees a completely fresh install of the app and all its data.\n\n```js\nawait device.launchApp({delete: true});\n```\n\n#### 8. `launchArgs`—Additional Process Launch Arguments\n\nLaunches the app on the device with on-site, user-specified launch arguments:\n\n```js\nawait device.launchApp({\n  launchArgs: {\n    arg1: 1,\n    arg2: \"2\",\n  }\n});\n```\n\nThis is the most explicit and straightforward way of setting launch arguments. Refer to the [launch arguments guide](../guide/launch-args.md) for a complete overview on app launch arguments.\n\n#### 9. `disableTouchIndicators`—Disable Touch Indicators (iOS Only)\n\nDisables touch indicators on iOS. Default is `false`.\n\n```js\nawait device.launchApp({disableTouchIndicators: true});\n```\n\n#### 10. `languageAndLocale`—Launch with a Specific Language and/or Local (iOS Only)\n\nLaunch the app with a specific system language\n\nInformation about accepted values can be found [here](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html).\n\n```js\nawait device.launchApp({\n  languageAndLocale: {\n    language: \"es-MX\",\n    locale: \"es-MX\"\n  }\n});\n```\n\nWith this API, you can run sets of E2E tests per language. For example:\n\n```js\ndescribe.each([\n  ['es-MX'], ['fr-FR'], ['pt-BR'],\n])(`Test suite (locale: %s)`, (locale) => {\n  beforeAll(async () => {\n    await device.launchApp({\n      newInstance: true,\n      languageAndLocale: {\n        language: locale,\n        locale\n      }\n    });\n  });\n\n  test('some description', async () => {\n    // …\n  });\n});\n```\n\n#### 11. `detoxEnableSynchronization`—Initialize Detox with synchronization enabled or disabled at app launch\n\nLaunches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using `device.enableSynchronization()`.\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxEnableSynchronization: 0 }\n});\n```\n\n#### 12. `detoxURLBlacklistRegex`—Initialize the URL Blacklist at app launch\n\nLaunches the app with a URL blacklist to disable network synchronization on certain endpoints.\nUseful if the app makes frequent network calls to blacklisted endpoints upon startup.\n\n> Note that due to the complexity of reg-exps and interoperability concerns, the implementation is fairly sensitive to the format of the string of urls.\n> Please do your best to follow the example below:\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxURLBlacklistRegex: '\\\\(\"^http://192\\.168\\.1\\.253:\\\\d{4}/.*\",\"https://e\\.crashlytics\\.com/spi/v2/events\"\\\\)' },\n});\n```\n\n#### 13. `detoxDisableWebKitSecurity`—Disable WebKit Security (iOS Only)\n\nDisables WebKit security on iOS. Default is `false`.\n\nThis is useful for testing web views with iframes that loads CORS-protected content.\n\n:::caution Important\n\nSome pages may not load correctly when WebKit security is disabled (for example, PCI DSS-compliant pages).\nDisabling WebKit security may cause errors when loading pages that have strict security policies.\n\n:::\n\n```js\nawait device.launchApp({\n  launchArgs: { detoxDisableWebKitSecurity: true }\n});\n```\n\n### `device.terminateApp()`\n\nBy default, `terminateApp()` with no params will terminate the app file defined in the current [`configuration`](../config/overview.mdx).\n\nTo terminate another app, specify its bundle id\n\n```js\nawait device.terminateApp('other.bundle.id');\n```\n\n### `device.sendToHome()`\n\nSend application to background by bringing `com.apple.springboard` to the foreground.\nCombining `sendToHome()` with `launchApp({newInstance: false})` will simulate app coming back from background.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n```js\nawait device.sendToHome();\nawait device.launchApp({newInstance: false});\n// app returned from background, do stuff\n```\n\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n### `device.reloadReactNative()`\n\nIf this is a React Native app, reload the React Native JS bundle. This action is much faster than `device.launchApp()`, and can be used if you just need to reset your React Native logic.\n\n<i>**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle.</i>\n\n### `device.installApp()`\n\nBy default, `installApp()` with no params will install the app file defined in the current [`configuration`](../config/overview.mdx).\n\nTo install another app, specify its path\n\n```js\nawait device.installApp('path/to/other/app');\n```\n\n### `device.uninstallApp()`\n\nBy default, `uninstallApp()` with no params will uninstall the app defined in the current [`configuration`](../config/overview.mdx).\n\nTo uninstall another app, specify its bundle id\n\n```js\nawait device.uninstallApp('other.bundle.id');\n```\n\n**Note:** For app state reset operations, consider using [`device.resetAppState()`](#deviceresetappstatebundleids) which is more efficient than uninstall/install cycles.\n\n### `device.openURL({url, sourceApp[optional]})`\n\nMock opening the app from URL. `sourceApp` is an optional **iOS-only** parameter to specify source application bundle id.\n\nRead more in [Mocking Open with URL](../guide/mocking-open-with-url.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js)\n\n### `device.sendUserNotification(params)`\n\nMock handling of a user notification previously received in the system, while the app is already running.\n\nRead more in [Mocking User Notifications](../guide/mocking-user-notifications.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js)\n\n### `device.sendUserActivity(params)` **iOS Only**\n\nMock handling of received user activity when app is in foreground.\nRead more in [Mocking User Activity](../guide/mocking-user-activity.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js)\n\n### `device.setOrientation(orientation)`\n\nTakes `\"portrait\"` or `\"landscape\"` and rotates the device to the given orientation.\n\n**Note:** Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed.\n\nCheck out Detox’s [own test suite.](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js)\n\n### `device.setLocation(lat, lon)`\n\nSets the simulator/emulator location to the given latitude and longitude.\n\n> On iOS `setLocation` depends on `xcrun simctl`, and we recommend using its latest version.\n>\n> On Android `setLocation` will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.\n\n```js\nawait device.setLocation(32.0853, 34.7818);\n```\n\n### `device.disableSynchronization()`\n\nTemporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.\n\nThis API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly _busy_ (e.g. due to an endlessly repeating on-screen animation).\nHowever, using it inherently suggests that you are likely to resort to applying `sleep()`’s in your test code - testing that area, **which is not recommended and can never be 100% stable.** Therefore, as a rule of thumb, test code running \"inside\" a sync-disabled mode must be reduced to the bare minimum.\n\nNote: Synchronization is enabled by default, and it gets **re-enabled on every launch of a new instance of the app.**\n\n```js\nawait device.disableSynchronization();\n```\n\n### `device.enableSynchronization()`\n\nRe-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to `device.disableSynchronization()`.\n\n:warning: Note: Making this call would resume synchronization **instantly**, having its returned promise only resolve when the app becomes idle again. In other words, this **must only be called after you navigate back to \"the safe zone\", where the app should be able to eventually become idle again**, or it would remain suspended \"forever\" (i.e. until a safeguard time-out expires).\n\n```js\nawait device.enableSynchronization();\n```\n\n### `device.setURLBlacklist([urls])`\n\nExclude synchronization with respect to network activity (i.e. don’t wait for network to go idle before moving forward in the test execution) according to **specific** endpoints, denoted as URL reg-exp’s. To disable endpoints at initialization, pass in the black-list as an [app-launch argument](../guide/launch-args.md) named `detoxURLBlacklistRegex` (as explained [here](#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch)).\n\n```js\nawait device.setURLBlacklist(['.*127.0.0.1.*', '.*my.ignored.endpoint.*']);\n```\n\n### `device.resetAppState([...bundleIds])`\n\nResets the app state by clearing app data and restoring it to a clean state.\n\nOn Android, this command clears the app's data using the `pm clear` command, effectively resetting the app to its initial installed state without uninstalling it. **After clearing, Detox automatically restores all runtime permissions** (requires Android 15+). On older Android versions, you'll see a warning suggesting to update to Android 15+.\n\nOn iOS, Detox uses a fallback that uninstalls and installs your app again to achieve a clean state.\n\n```js\n// Reset current app state\nawait device.resetAppState();\n\n// Reset specific app state\nawait device.resetAppState('com.example.app');\n\n// Reset multiple apps\nawait device.resetAppState('com.app1', 'com.app2');\n```\n\n### `device.resetContentAndSettings()` **iOS Only**\n\nResets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing\npreviously set permissions.\n\n```js\nawait device.resetContentAndSettings();\n```\n\n### `device.getPlatform()`\n\nReturns the current device, `ios` or `android`.\n\n```js\nif (device.getPlatform() === 'ios') {\n  await expect(loopSwitch).toHaveValue('1');\n}\n```\n\n### `device.tap(point, shouldIgnoreStatusBar)`\n\nPerform a tap at arbitrary coordinates on the device's screen.\n\n#### tap parameters\n\n- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>\n- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>\n\n#### tap examples\n\n```js\n\nawait device.tap();\nawait device.tap({ x: 100, y: 150 }, false);\nawait device.tap({ x: 100, y: 150 });\nawait device.tap(false);\n\n```\n\n### `device.longPress(point, duration, shouldIgnoreStatusBar)`\n\nPerform a long press at arbitrary coordinates on the device's screen. Custom press duration if needed.\n\n#### longPress parameters\n\n- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>\n- `duration` — Custom press duration time, in milliseconds. (default values: Android: Standard long-press duration.  IOS: 1000 milliseconds, platforms: Android & IOS) <br/>\n- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>\n\n#### longPress examples\n\n```js\n\nawait device.longPress();\nawait device.longPress({ x: 100, y: 150 }, 2000, false);\nawait device.longPress({ x: 100, y: 150 }, 2000);\nawait device.longPress(2000, false);\nawait device.longPress({ x: 100, y: 150 }, false);\nawait device.longPress({ x: 100, y: 150 });\nawait device.longPress(2000);\nawait device.longPress(false);\n\n```\n\n### `device.takeScreenshot([name])`\n\nTakes a screenshot of the device. For full details on taking screenshots with Detox, refer to the [screen-shots guide](../guide/taking-screenshots.md).\n\n### `device.captureViewHierarchy([name])`\n\n**iOS Only.** Saves a view hierarchy snapshot (`*.viewhierarchy`) of the\ncurrently opened application to a temporary folder and schedules putting it to\nthe artifacts' folder upon the completion of the current test. The file can be\nopened later in Xcode 12.0 and above.\nSee [Xcode 12 Release notes: #57933113](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:~:text=57933113)\nfor more details.\n\nThe `name` parameter is optional — by default, it equals to `capture`.\n\n```js\ntest('Capture view hierarchy', async () => {\n  const temporaryArtifactPath = await device.captureViewHierarchy('myElements');\n\n  // The temporary path will remain valid until the test completion.\n  // Afterwards, the artifact will be moved, e.g.:\n  // * on success, to: <artifacts-location>/✓ Capture view hierarchy/myElements.viewhierarchy\n  // * on failure, to: <artifacts-location>/✗ Capture view hierarchy/myElements.viewhierarchy\n});\n```\n\n### `device.generateViewHierarchyXml([shouldInjectTestIds])`\n\nGenerates a view hierarchy XML of the currently opened application. The XML is returned as a string.\n\nThe `shouldInjectTestIds` parameter is optional and defaults to `false`. When set to `true`, Detox will attempt to inject `testID` attributes into the XML for each element if undefined.\n\n```js\nconst viewHierarchyXml = await device.generateViewHierarchyXml();\n```\n\n### `device.shake()` **iOS Only**\n\nSimulate shake\n\n### `device.setBiometricEnrollment(bool)` **iOS Only**\n\nToggles device enrollment in biometric authentication (Touch ID or Face ID).\n\n```js\nawait device.setBiometricEnrollment(true);\n// or\nawait device.setBiometricEnrollment(false);\n```\n\n### `device.matchFace()` **iOS Only**\n\nSimulates the success of a face match via Face ID\n\n### `device.unmatchFace()` **iOS Only**\n\nSimulates the failure of face match via Face ID\n\n### `device.matchFinger()` **iOS Only**\n\nSimulates the success of a finger match via Touch ID\n\n### `device.unmatchFinger()` **iOS Only**\n\nSimulates the failure of a finger match via Touch ID\n\n### `device.clearKeychain()` **iOS Only**\n\nClears the device keychain\n\n### `device.setStatusBar()` **iOS Only**\n\nOverride simulator’s status bar. Available options:\n\n```js\nawait device.setStatusBar({\n  time: \"12:34\",\n  // Set the date or time to a fixed value.\n  // If the string is a valid ISO date string it will also set the date on relevant devices.\n  dataNetwork: \"wifi\",\n  // If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.\n  wifiMode: \"failed\",\n  // If specified must be one of 'searching', 'failed', or 'active'.\n  wifiBars: \"2\",\n  // If specified must be 0-3.\n  cellularMode: \"searching\",\n  // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n  cellularBars: \"3\",\n  // If specified must be 0-4.\n  operatorName: \"A1\",\n  // Set the cellular operator/carrier name. Use '' for the empty string.\n  batteryState: \"charging\",\n  // If specified must be one of 'charging', 'charged', or 'discharging'.\n  batteryLevel: \"50\",\n  // If specified must be 0-100.\n});\n```\n\n### `device.resetStatusBar()` **iOS Only**\n\nResets any override in simulator’s status bar.\n\n### `device.reverseTcpPort()` **Android Only**\n\nReverse a TCP port from the device (guest) back to the host-computer, as typically done with the `adb reverse` command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer.\n\n### `device.unreverseTcpPort()` **Android Only**\n\nClear a _reversed_ TCP-port (e.g. previously set using `device.reverseTcpPort()`).\n\n### `device.pressBack()` **Android Only**\n\nSimulate press back button.\n\n```js\nawait device.pressBack();\n```\n\n### `device.getUiDevice()` **Android Only**\n\nExposes [`UiAutomator`’s `UiDevice` API](https://developer.android.com/reference/androidx/test/uiautomator/UiDevice).\n**This is not a part of the official Detox API**, it may break and change whenever an update to `UiDevice` or `UiAutomator` Gradle dependencies (`androidx.test.uiautomator:uiautomator`) is introduced.\n\n[`UiDevice`'s autogenerated code](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js)\n"
  },
  {
    "path": "docs/api/expect.md",
    "content": "# Expect\n\nDetox uses [matchers](matchers.md) to match UI elements in your app and expectations to verify those elements are in the expected state.\n\nUse [actions](actions.md) to simulate use interaction with elements.\n\n## Methods\n\n- [`.toBeVisible()`](#tobevisible)\n- [`.toExist()`](#toexist)\n- [`.toBeFocused()`](#tobefocused)\n- [`.toHaveText()`](#tohavetexttext)\n- [`.toHaveLabel()`](#tohavelabellabel)\n- [`.toHaveId()`](#tohaveidid)\n- [`.toHaveValue()`](#tohavevaluevalue)\n- [`.toHaveSliderPosition()`](#tohavesliderpositionnormalizedposition-tolerance)\n- [`.toHaveToggleValue()`](#tohavetogglevaluevalue)\n- [`.not`](#not)\n- [`.withTimeout()`](#withtimeouttimeout)\n\n### `toBeVisible()`\n\nExpects the view to be at least N% visible on the screen.\nAccepts an optional parameter of percent threshold of element visibility, integer ranging from 1 to 100, that determines whether the element is visible or not. If no number is provided then defaults to 75%.\n\nNegating this expectation with a `not` expression expects the view’s visible area to be lower than N%.\n\nOn iOS, visibility is defined by having the view, or one of its subviews, be topmost at the view’s activation point on screen.\n\n```js\nawait expect(element(by.id('subtitle'))).toBeVisible();\nawait expect(element(by.id('mainTitle'))).toBeVisible(35);\n```\n\n### `toExist()`\n\nExpects the element to exist within the app’s current UI hierarchy.\n\n```js\nawait expect(element(by.id('okButton'))).toExist();\n```\n\n### `toBeFocused()`\n\nExpects the element to be the focused element.\n\n```js\nawait expect(element(by.id('emailInput'))).toBeFocused();\n```\n\n### `toHaveText(text)`\n\nExpects the element to have the specified text.\n\n```js\nawait expect(element(by.id('mainTitle'))).toHaveText('Welcome back!');\n```\n\n### `toHaveLabel(label)`\n\nExpects the element to have the specified label as its accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n:::note\nNote that in React Native apps, the `accessibilityLabel` is computed in a non-standard way, which happens to [differ between iOS and Android](https://github.com/facebook/react-native/issues/32826). Detox [bridges over that gap](https://github.com/wix/Detox/issues/3977) by artificially aligning Android to iOS.\nEffectively, that means that in React Native apps, performing accessibility-label based matching for elements **with no explicit label** suggests that the matching will be performed against a concatenation of labels from the child-elements, if applicable. For example:\n\n```js\n<View testID='title-root'>\n  <Text accessibilityLabel={'title'}>Goodbye!</Text>\n  <Text accessibilityLabel={'subtitle'}>Thanks for all the fish.</Text>\n</View>\n```\n\nIn this case, where `title-root` has no accessibility label of its own, matching the label of `title-root` will be performed against the text: `title subtitle`.\n\nAlso note that in iOS, `accessibilityLabel` for primitive elements such as text, automatically receives the text itself - even if the accessibilityLabel prop isn't explicitly specified.\n:::\n\n```js\nawait expect(element(by.id('submitButton'))).toHaveLabel('Submit');\n```\n\n### `toHaveId(id)`\n\nExpects the element to have the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nawait expect(element(by.text('Submit'))).toHaveId('submitButton');\n```\n\n### `toHaveValue(value)`\n\nExpects the element to have the specified accessibility value. In React Native, this corresponds to the value in the [`accessibilityValue`](https://reactnative.dev/docs/view.html#accessibilityvalue) prop.\n\n```js\nawait expect(element(by.id('temperatureDial'))).toHaveValue('25');\n```\n\n### `toHaveSliderPosition(normalizedPosition, tolerance)`\n\nExpects the slider element to have the specified normalized position (\\[0, 1]), within the provided tolerance (optional).\n\n```js\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.75);\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.3113, 0.00001);\n```\n\n### `toHaveToggleValue(value)`\n\nExpects a toggle-able element (e.g. a Switch or a Check-Box) to be on/checked or off/unchecked. As a reference, in react-native, this is the [equivalent switch component](https://reactnative.dev/docs/switch).\n\n```js\nawait expect(element(by.id('switch'))).toHaveToggleValue(true);\nawait expect(element(by.id('checkbox'))).toHaveToggleValue(false);\n```\n\n### `withTimeout(timeout)`\n\nWaits until the expectation is resolved for the specified amount of time. If timeout is reached before resolution, the expectation is failed.\n\n`timeout`—the timeout to wait, in ms\n\n```js\nawait waitFor(element(by.id('bigButton'))).toBeVisible().withTimeout(2000);\n```\n\n## Properties\n\n### `not`\n\nNegates the expectation, e.g.:\n\n```js\nawait expect(element(by.id('tinyButton'))).not.toBeVisible();\nawait expect(element(by.id('tinyButton'))).not.toExist();\nawait expect(element(by.id('tinyButton'))).not.toBeFocused();\nawait expect(element(by.id('tinyButton'))).not.toHaveText('');\nawait expect(element(by.id('tinyButton'))).not.toHaveValue('');\n```\n"
  },
  {
    "path": "docs/api/internals.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport LifecycleManyWorkersCLI from './partials/_lifecycle-cli-many-workers.md';\nimport LifecycleManyWorkersJest from './partials/_lifecycle-jest-many-workers.md';\nimport LifecycleSingleWorkerCLI from './partials/_lifecycle-cli-single-worker.md';\nimport LifecycleSingleWorkerJest from './partials/_lifecycle-jest-single-worker.md';\n\n# Internals API\n\n:::caution\n\nThis section might be more volatile than the other ones, yet we'll do our best to adhere to Semantic Release standards even here.\n\n:::\n\nDetox Internals might be useful for developing advanced enterprise presets or when you are planning to integrate with a third-party test runner like [Mocha], [Ava], [Vitest] or other ones.\n\n## Lifecycle\n\nThe purpose of **Internals API** is mostly to align the lifecycles of Detox and a test runner underneath.\nAlthough it is generic enough, there is no denying that its design has been influenced by our official integration with Jest test runner.\nThat's why it might be better to start the overview from Jest lifecycle first, and then move on to Detox lifecycle and how they fit together.\n\n### Jest lifecycle\n\n![UML sequence diagram](../img/uml/jest-diagram.svg)\n\n1. Jest's main process starts from resolving and evaluating its config file, e.g. `jest.config.js`:\n  ```js\n  module.exports = async function () {\n    return {\n      globalSetup: '/path/to/globalSetup.js',\n      globalTeardown: '/path/to/globalTeardown.js',\n      reporters: ['/path/to/reporter.js'],\n      /* ... jest config ... */\n    };\n  };\n  ```\n1. If a [`globalSetup`][globalSetup] handler is defined, it is resolved and executed in the main process:\n  ```js\n  module.exports = async function () {\n    // ... global setup code ...\n  };\n  ```\n1. The next come [`reporters`][reporters], one of the longest-living entities in the test session. After instantiating reporters, Jest calls their `onRunStart` method:\n  ```js\n  class Reporter {\n    async onRunStart(aggregatedResults, options) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n1. If Jest is not running in band (see [`-i, --runInBand`][runInBand]), and if it has _N_ [workers][maxWorkers] (_N > 1_), then it spawns _N_ child processes that keep taking test files one after another, running their tests inside and reporting back to the reporters:\n  ```js\n  class Reporter {\n    async onTestFileResult(test, testResult, aggregatedResult) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n  Otherwise, Jest runs all the tests in the main process without spawning any other processes, but the reporting flow itself remains the same, as can be seen in the diagram:\n\n  ![UML sequence diagram](../img/uml/jest-diagram-runInBand.svg)\n1. After all the tests have been executed, Jest calls `onRunComplete` in the reporters, and this is the final phase for any reporter:\n  ```js\n  class Reporter {\n    async onRunComplete(testContexts, results) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n1. The last user-controlled hook is the global teardown. If a [`globalTeardown`][globalTeardown] handler is defined, it is resolved and executed in the main process:\n  ```js\n  module.exports = async function () {\n    // ... global teardown code ...\n  };\n  ```\n\n### Detox lifecycle\n\nTheoretically, Detox CLI could be totally agnostic about the test runner under the hood, but that would deprive us of some convenience.\nFor instance, there is a [retry mechanism][testRunner.retries], built into Detox CLI, which can schedule extra runs for failed test files.\nThis requirement obliges Detox context to live longer than any test runner, and requires from the test runner to be able to report back to Detox CLI, whereas the resulting child process hierarchy can be broad and multi-tiered, e.g.:\n\n```plain text\n└── detox test ...\n    └── jest ... --maxWorkers N\n        ├── jest-worker (1)\n        ├── ...\n        └── jest-worker (N)\n```\n\nEven if we run Jest directly, without Detox CLI, there's still a one-to-many relationship between its processes:\n\n```plain text\n└── jest ... --maxWorkers N\n    ├── jest-worker (1)\n    ├── ...\n    └── jest-worker (N)\n```\n\nSo, if we want to be on the safe side, every process should be able to communicate with the root process, where we have the primary context of Detox, and vice versa.\nRetrying failed tests is just one of numerous needs, and there are more:\n\n* the primary context (and workers themselves, at times) needs to know how many workers are there;\n* the workers should request from the primary context to allocate a device and return it back when they are done;\n* any secondary context should be able to tell whether this is a first time it is running, or it is an _N_-th attempt already;\n\nThis list can be continued and might expand even more with time, but the point is that Detox contexts will get instantiated as many times as child processes are created during the test session, and it should be something trivial to synchronize the primary and the secondary contexts to ensure a seamless experience.\n\nIt is worth mentioning that Jest's main process is ill-suited for taking a device and running the tests, as its purpose is to orchestrate the entire test session and not run the tests themselves.\nThis means that not all secondary contexts of Detox are \"born equal\" – most of them will be allocating a device for running tests, but at least one will be merely communicating with the primary context.\n\nThis is exactly the reason why we call [`init()`][init] in every child process, but sometimes it is not just a simple call, but an [`init({ workerId: null })`][init] override to avoid creating a worker.\nHowever, the fact of initializing without a worker does not mean we can't call [`installWorker()`][installWorker] later. For example, if it turns out that Jest is running in a single process, then instead of creating two Detox contexts within the same process, we're going to reuse the existing one and just supplement it with the worker itself.\n\nThere's one more implicit thing that happens at the very beginning of [`init([options])`][init] method, and that is the config resolution. It is also available as a separate method, [`resolveConfig([options])`][resolveConfig] based on the following considerations.\nWhen you use a test runner directly, without Detox CLI (e.g. `jest …` instead of `detox test …`), then the test runner config gets resolved earlier than Detox config itself. That creates a dangerous scenario for dynamically generated configs:\n\n```js title=\"jest.config.js\"\nconst { config } = require('detox/internals');\n\nmodule.exports = async () => {\n  if (config.device.type === 'ios.simulator') {\n    return { /* iOS-specific preset */ };\n  } else {\n    return { /* Android-specific preset */ };\n  }\n};\n```\n\nThe problem in this case is that we are accessing an unresolved (yet) config. Of course, one could assume that it is possible to overcome with a plain [`init()`][init] call like this:\n\n```js title=\"bad-idea.config.js\"\nconst { init, config } = require('detox/internals');\n\nmodule.exports = async () => {\n  await init();\n\n  if (config.device.type === 'ios.simulator') {\n    // ... use config now ...\n  }\n};\n```\n\nThis solution will work, but it is rather a bad one, since Jest config resolution is an asymmetrical step compared to `globalSetup` and `globalTeardown`. While solving one problem, it creates another one. Consider running this:\n\n```sh\njest --config bad-idea.config.js --showConfig\n```\n\nFor reference, when Jest runs with a [`--showConfig`][showConfig] option, all it does is _to resolve the config and to print it_. Hence, neither [`globalSetup`][globalSetup] nor [`globalTeardown`][globalTeardown] will be called, and the test runner will hang up since there's no one to call the [`cleanup()`][cleanup] method which stops the [IPC server] used for the communication between the primary and the secondary contexts.\n\nStill, we have to be able to access the config early, and that is exactly why [`init()`][init] method is a composite of [`resolveConfig()`][resolveConfig], the _actual_ init, and [`installWorker()`][installWorker]. We could describe what it does on the high level with the following pseudocode:\n\n```js\nasync function init(options = {}) {\n  config = config || await resolveConfig();\n\n  await logger.init(config);\n  await ipcServer.init(config);\n  // ... init more things  ...\n\n  if (options.workerId != null) {\n    await installWorker();\n  }\n}\n```\n\nIn other words, it will resolve config only if it has not been resolved before, and install a worker unless it has been forbidden explicitly.\nAnd even that we can [`installWorker()`][installWorker] later if we ever need it.\n\nNow, when many details are clarified, we can review the actual sequence diagrams step by step. There are four scenarios depending on the initiator (Detox CLI or the test runner itself) and on child process hierarchy (a single process or parent-children).\n\nA few words about the diagram and its conventions:\n* The `ClassName.0`, `ClassName.1`, …, `ClassName.N` suffixes mean the index of the instance of the class created.\n* `DetoxCircusEnvironment.N` is our custom [`testEnvironment`][testEnvironment] created one or multiple times in every Jest worker. Make sure to read about Jest [test environments][testEnvironment] and look at the example section there for better understanding.\n\n<Tabs>\n  <TabItem value=\"detox test … --maxWorkers N\">\n    <LifecycleManyWorkersCLI />\n  </TabItem>\n  <TabItem value=\"jest … --maxWorkers N\">\n    <LifecycleManyWorkersJest />\n  </TabItem>\n  <TabItem value=\"detox test … --runInBand\">\n    <LifecycleSingleWorkerCLI />\n  </TabItem>\n  <TabItem value=\"jest … --runInBand\">\n    <LifecycleSingleWorkerJest />\n  </TabItem>\n</Tabs>\n\n## Methods\n\n:::info\n\nFeel free to browse through [the typings file][typings] provided by Detox.\n\n:::\n\n### `resolveConfig([options])` \\[Promise<RuntimeConfig\\>]\n\nUse sparingly for cases when you need to read Detox config before [`init()`][init] is called.\n\nIf you use Detox with Jest, our default integration, the only place where you might need it is your `jest.config.js`, e.g.:\n\n```js title=\"jest.config.js\"\nconst { resolveConfig } = require('detox/internals');\n\nmodule.exports = async () => {\n  /** @type {DetoxInternals.RuntimeConfig} */\n  const config = await resolveConfig();\n\n  return { /* Jest config */ };\n};\n```\n\nFor example, you could use that to evaluate the [`maxWorkers`][maxWorkers] count depending on the device type,\nbut please mind, though, that Detox allows to override test runner options via its own config, e.g.:\n\n```js title=\"detox.config.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  apps: { /* ... */ },\n  devices: { /* ... */ },\n  configurations: {\n    'ios.sim.release': {\n      app: 'ios.release',\n      device: 'iphone',\n      testRunner: {\n        args: {\n// highlight-next-line\n          maxWorkers: process.env.CI === 'true' ? 3 : undefined,\n        },\n      },\n    },\n    'android.emu.release': {\n      app: 'android.release',\n      device: 'nexus',\n      testRunner: {\n        args: {\n// highlight-next-line\n          maxWorkers: process.env.CI === 'true' ? 2 : undefined,\n        },\n      },\n    },\n  },\n};\n```\n\nThis trick shown above allows to forward extra CLI arguments to `jest` conditionally, e.g. when running in CI mode:\n\n```bash\nCI=true detox test -c ios.sim.release\n# jest --config e2e/jest.config.js --maxWorkers 3\n```\n\n### `getStatus()` \\[enum]\n\nReturns one of statuses depending on what’s going with the current Detox context:\n\n* `inactive` – before [`init()`][init] and after [`cleanup()`][cleanup] is called.\n* `init` – while [`init()`][init] is executing.\n* `active` – after [`init()`][init] and before [`cleanup()`][cleanup] is called.\n* `cleanup` – while [`cleanup`][cleanup] is executing.\n\n### `init([options])` \\[Promise]\n\nThis is the phase where:\n\n* a primary Detox context resolves its configuration, starts the logger, IPC server, and more;\n* a secondary Detox context connects to IPC server and registers itself;\n* if `workerId` is not null, [installs the worker][installWorker];\n\nAccepts an optional parameter, `options` object with the following properties, _all optional_ as well:\n\n* `cwd` (string) – current working directory, used to [resolve Detox config][detox config resolution].\n* `argv` (key-value map) – **Internal!**. CLI arguments parsed by Detox CLI.\n* `testRunnerArgv` (key-value map) – CLI arguments to be forwarded to the test runner.\n* `override` (Partial<Detox.DetoxConfig\\>) – ad-hoc adjustments to deep merge with the file-based config.\n* `global` – reference to a custom [global][node globals] scope, usually needed when your test runner [uses sandboxing][node vm].\nThis prevents creating issues when a Detox context cannot be accessed from within the sandboxed environment.\n* `workerId` – (string \\| null) a unique ID, e.g. `worker-1`, `worker-2`. Giving `null` disables installing the worker.\n\n### `installWorker([options])` \\[Promise]\n\nThis is the phase where Detox loads its expectation library and boots a device. You don't need to call it separately\nunless you use [`init({ workerId: null })`][init] override.\n\nAccepts an optional parameter, `options` object with the following properties, _all optional_ as well:\n\n* `global` – reference to a custom [global][node globals] scope, usually needed when your test runner [uses sandboxing][node vm].\nThis prevents creating issues when a Detox context cannot be accessed from within the sandboxed environment.\n* `workerId` – (string \\| null) a unique ID, e.g. `worker-1`, `worker-2`. Giving `null` disables installing the worker.\n\n### `uninstallWorker()` \\[Promise]\n\nDeallocates the device. Most Client API ([`device`][Device API], [`by`][Matchers API], [`element`][Actions API], [`expect`][Expect API]) will stop working, except for [the logger][Logger API].\n\n### `cleanup()` \\[Promise]\n\nThis method should be called when the main or child process is about to exit. Under the hood, it:\n\n* [uninstalls the worker][uninstallWorker] if there is a worker installed;\n* a secondary Detox context disconnects from the [IPC server];\n* a primary Detox context stops the IPC server and collects the log artifacts.\n\n## Optional lifecycle\n\n### `reportTestResults(array)` \\[Promise]\n\n:::note\n\nThis method has an effect only when the tests are run via [Detox CLI][detox test].\n\n:::\n\nReports to the primary context about failed tests that could have been re-run if [`-R, --retries`][CLI options] mechanism is enabled.\n\nIt takes one argument, an array of test file reports. Each report is an object with the following properties:\n\n- `testFilePath` (string) — global or relative path to the failed test file;\n- `success` (boolean) — whether the test passed or not;\n- `testExecError` (optional error) — top-level error, use it only if the entire test file failed, e.g. due to a syntax error or environment setup failure;\n- `isPermanentFailure` (optional boolean) — if the test failed, it should tell whether the failure is permanent. Permanent failure means that the test file should not be re-run. For instance, we use it to [prevent double retries][testRunner.retryAfterCircusRetries]: with Detox CLI and with [`jest.retryTimes()`][retryTimes].\n\n### `onRunDescribeStart(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner started executing a test suite, e.g. a `beforeAll` hook or a first test:\n\n```js\nawait onRunDescribeStart({\n  name: 'Suite name'\n});\n```\n\n### `onTestStart(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner started executing a specific test. Use `invocations` when a test is being re-run after a failure:\n\n```js\nawait onTestStart({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 1,\n  status: 'running',\n});\n```\n\n### `onHookFailure(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports about an error in the midst of `beforeAll`, `beforeEach`, `afterEach`, `afterAll` or any other hook. We use it, for example, to generate [screenshot artifacts][artifacts docs] like `beforeAllFailure.png`.\n\n```js\nawait onHookFailure({\n  error: new Error('Some assertion failed'),\n  hook: 'beforeEach',\n});\n```\n\n### `onTestFnFailure(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports about an error in the midst of a test function. We use it, for example, to generate [screenshot artifacts][artifacts docs] like `testFnFailure.png`.\n\n```js\nawait onTestFnFailure({ error: new Error('Some assertion failed') });\n```\n\n### `onTestDone(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports the final status of the test, `passed` or `failed`, e.g.:\n\n```js\nawait onTestDone({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 1,\n  status: 'failed',\n  timedOut: false,\n});\n```\n\nBesides collecting [log, screenshot and video artifacts][artifacts docs], this hook resets the pending network requests –\nthese are usually some actions to which the app did not respond during the test. Setting `timedOut: true` tells Detox to dump those pending requests, if there are any.\n\nIf your test runner supports re-running internally the failed tests, and, for example, your test passes on the second attempt, you would call the method with something like this:\n\n```js\nawait onTestDone({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 2,\n  status: 'passed',\n});\n```\n\n### `onRunDescribeFinish(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner has finished executing a test suite, e.g. all the `afterAll` hooks have been executed or the last test has finished running:\n\n```js\nawait onRunDescribeFinish({ name: 'Suite name' });\n```\n\n## Properties\n\n### `config` \\[RuntimeConfig]\n\nOpen [the typings file][typings] and search for `RuntimeConfig`.\n\nFor the most part, this config is identical to what we describe in [Config docs], except that it is non-optional.\nIn other words, even if you never customized your [Session config], you'll still be able to access some default\nvalues safely, without null checks.\n\n```js\nconst { config } = require('detox/internals');\ntypeof config.session.autoStart // \"boolean\"\n```\n\n### `session` \\[SessionState]\n\nThe session state contains the following read-only properties:\n\n* `id` (string) – randomly generated ID for the entire Detox test session, including retries.\n* `testResults` (DetoxTestFileReport[]) – results of the prior test file executions, used by Detox CLI retry mechanism.\n* `testSessionIndex` (number) – the retry index of the test session: `0..<retriesCount>`.\n* `workersCount` (number) – count of Detox contexts with a worker installed.\nIf we oversimplify it, it reflects the count of allocated devices in the current test session.\n\nThe session state, including the resolved config, is serialized by the primary context, so that the secondary Detox contexts can read it synchronously from a file at the earliest point possible.\nAfter the secondary contexts connect to the IPC server hosted by the primary context, they register themselves and get the up-to-date session state.\nThe IPC server broadcasts the updates to all the connected contexts on every action like [`installWorker()`][installWorker] or [`reportTestResults()`][reportTestResults].\n\n### `log` \\[Logger]\n\nSee [Logger API] for all the details.\n\nThe only difference from the Client API here is that you don't have a predefined `user` category, i.e.:\n\n```js\nconst { log: logClient } = require('detox');\nconst { log: logInternal } = require('detox/internals');\n\n// oversimplified, it looks like:\nlogClient == logInternal.child({ cat: 'user' })\n```\n\nFor example, we leverage this for adding more `lifecycle` events in our integration with Jest:\n\n```js title=\"detox/runners/jest/testEnvironment/index.js\"\nclass DetoxCircusEnvironment extends NodeEnvironment {\n  constructor(config, context) {\n    super(/* ... */);\n    log.trace.begin({ cat: 'lifecycle' }, context.testPath);\n    // ...\n  }\n}\n```\n\n### `tracing`\n\nAn advanced API useful for creating reports based on logged Detox events.\n\n#### `tracing.createEventStream()`\n\nCreates a readable stream of the currently recorded events in\n[Chrome Trace Event format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU).\n\n```js\nconst { tracing } = require('detox/internals');\n\nasync function processDetoxEvents() {\n  await new Promise((resolve, reject) => {\n    tracing\n      .createEventStream()\n      .on('end', resolve)\n      .on('error', reject)\n      .on('data', (event) => {\n        if (event.ph === 'B') { /* duration event (begin) */ }\n        if (event.ph === 'E') { /* duration event (end) */ }\n        if (event.ph === 'i') { /* instant event */ }\n      });\n  });\n}\n```\n\nPlease mind that you'll be getting a snapshot of events aggregated from all the sibling and child processes, and it never will be complete until the very end of the test session.\n\nSee also: [`DurationBeginEvent`], [`DurationEndEvent`], [`InstantEvent`].\n\n### `worker` \\[object]\n\nNot documented on purpose. Provides direct access to the object which holds the device driver, websocket client, matchers, expectations, etc.\n\n[Mocha]: https://mochajs.org\n[Ava]: https://github.com/avajs/ava\n[Vitest]: https://vitest.dev\n[`DurationBeginEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/DurationBeginEvent.html\n[`DurationEndEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/DurationEndEvent.html\n[`InstantEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/InstantEvent.html\n[globalSetup]: https://jestjs.io/docs/configuration#globalsetup-string\n[globalTeardown]: https://jestjs.io/docs/configuration#globalteardown-string\n[maxWorkers]: https://jestjs.io/docs/configuration#maxworkers-number--string\n[reporters]: https://jestjs.io/docs/configuration#reporters-arraymodulename--modulename-options\n[runInBand]: https://jestjs.io/docs/cli#--runinband\n[showConfig]: https://jestjs.io/docs/cli#--showconfig\n[testEnvironment]: https://jestjs.io/docs/configuration#testenvironment-string\n[resolveConfig]: #resolveconfigoptions-promise\n[getStatus]: #getstatus-enum\n[init]: #initoptions-promise\n[installWorker]: #installworkeroptions-promise\n[uninstallworker]: #uninstallworker-promise\n[reportTestResults]: #reporttestresultsarray-promise\n[cleanup]: #cleanup-promise\n[detox config resolution]: ../config/overview.mdx#path-conventions\n[detox test]: ../cli/test.md\n[CLI options]: ../cli/test.md#options\n[config docs]: ../config/overview.mdx\n[artifacts docs]: ../config/artifacts.mdx\n[Session config]: ../config/session.mdx\n[testRunner.retries]: ../config/testRunner.mdx#testrunnerretries-number\n[testRunner.retryAfterCircusRetries]: ../config/testRunner.mdx#testrunnerjestretryaftercircusretries-boolean\n[IPC server]: https://www.npmjs.com/package/node-ipc\n[Device API]: device.md\n[Matchers API]: matchers.md\n[Actions API]: actions.md\n[Expect API]: expect.md\n[Logger API]: logger.mdx\n[typings]: https://github.com/wix/Detox/blob/master/detox/internals.d.ts\n[node globals]: https://nodejs.org/api/globals.html\n[node vm]: https://nodejs.org/api/vm.html\n[retryTimes]: https://jestjs.io/docs/jest-object#jestretrytimesnumretries-options\n"
  },
  {
    "path": "docs/api/logger.mdx",
    "content": "# Logger\n\nDetox Logger API allows you to save your custom messages and events alongside the built-in ones.\nIn addition to being formatted and printed to the console, they can be preserved as log artifacts if you enable them via [`--record-logs`] CLI option or [`artifacts.plugins.log.enabled`] in the config:\n\n- `<artifacts-location>/detox.log` – plain text log;\n- `<artifacts-location>/detox.trace.json` – [Trace Event format] file, viewable via [Perfetto] or `chrome://tracing`.\n\n![](../img/log-example.png)\n\nBelow we’ll be listing all the public properties and methods of the logger.\n\n## Properties\n\n### `log.level` \\[enum]\n\n**Read-only.** Returns the current [log level](../config/logger.mdx#loggerlevel-enum), one of values:\n`fatal`, `error`, `warn`, `info`, `debug`, `trace`.\n\n## Methods\n\n### `log.*([event,] ...msg)`\n\nLogs an instant message with an optional [event metadata].\nThere are six methods for producing log messages varying by log level:\n\n* `log.fatal([event,] ...msg)`\n* `log.error([event,] ...msg)`\n* `log.warn([event,] ...msg)`\n* `log.info([event,] ...msg)`\n* `log.debug([event,] ...msg)`\n* `log.trace([event,] ...msg)`\n\nExample:\n\n```js\nconst { log } = require('detox');\n\nlog.info('Some message');\n// detox[2020] i Some message\n\nlog.error({ err: new Error('Test') }, 'An error message');\n// detox[2020] i An error message\n//   err: Test\n```\n\n### `log.*.begin([event,] msg)`\n\nLogs a beginning of a _duration event_ with an optional [event metadata].\nDuration events are displayed as continuous colorful segments on the timeline and can be stacked if you\ncall the method multiple times, e.g.:\n\n```js\nlog.info.begin({ data: { email } }, 'Login Flow');\n// detox[2020] B Login Flow\n//   data: { email: 'tester@example.com' }\nlog.info.begin('Nested sub-flow');\n// detox[2020] B Nested sub-flow\n```\n\nMake sure you always end your events so that they don't get marked as unfinished, like shown on the screenshot below:\n\n![](../img/timeline-artifact-unfinished.png)\n\n### `log.*.end([event, msg])`\n\nLogs an end of a duration event with an optional [event metadata] and a message. If the message is omitted,\nthe logger prints the corresponding message from the duration begin event:\n\n```js\nlog.info.end();\n// detox[2020] E Nested sub-flow\nlog.info.end({ success: true }, 'Login Flow (custom end message)');\n// detox[2020] E Login Flow (custom end message)\n```\n\n### `log.*.complete([event,] msg, functionOrPromise)`\n\nA convenience method to wrap functions and promises with [`log.*.begin`] and [`log.*.end`], e.g.:\n\n```js\nawait log.info.complete('Login Flow', async () => {\n  // …\n});\n// detox[2020] B Login Flow\n// detox[2020] E Login Flow\n```\n\nAs a bonus, this wrapper also adds `{ success: true }` or `{ success: false, error }` metadata to\nthe end event.\n\nEffectively, `begin` and `end` can even be called in two complete different places - such as `beforeEach` and `afterEach`, but that is discouraged.\n\nIn fact, `log.*.complete()` is the recommended way of tracing things, e.g.:\n\n## Event metadata\n\nAll the log methods accept an optional first argument which can contain some custom\nmetadata: numbers, strings and booleans:\n\n```js\ndetox.log.info({ /* metadata */ }, message);\ndetox.log.trace.begin({ /* metadata */ }, message);\ndetox.log.trace.end({ /* metadata */ });\n```\n\nAside from custom user properties, there are a few meaningful properties that affect the timeline representation.\n\n### `id` \\[string \\| number]\n\nUse arbitrary IDs when you have a risk of overlapping concurrent events, e.g.:\n\n```js\nawait Promise.all([\n  await detox.log.complete({ id: 1 }, 'Do this', async () => { /* … */ }),\n  await detox.log.complete({ id: 2 }, 'Do that', async () => { /* … */ }),\n]);\n```\n\nUsing IDs will prevent situations like this, where the nested event outlasts its parent:\n\n```plain text\nB               E\n|-- event 1 ----|\n   B                E\n   |-- event 2 -----|\n```\n\nIn the example above, the actual sequence of calls will be:\n\n```js\nlog.info.begin('event 1');\nlog.info.begin('event 2');\nlog.info.end(); // from event 1\nlog.info.end(); // from event 2\n```\n\nTherefore, it will be interpreted erroneously on the timeline, as if the second event has ended before the first one:\n\n```plain text\nB                   E\n|-- event 1 --------|\n   B            E\n   |-- event 2 -|\n```\n\nWhen you begin an event with a specific `id` while there's already some other duration event, the logger allocates another \"lane\" for that event by assigning a distinct `tid` (thread ID) to it:\n\n![](../img/timeline-tid.png)\n\n### `cat` \\[string \\| string\\[]]\n\nEvent category. Helpful for filtering specific events.\n\nPass either a string of comma-separated values or a string array, e.g.:\n\n```js\nlog.info({ cat: 'login,login-email' }, 'Starting e-mail login flow...');\n// is identical to:\nlog.info({ cat: ['login', 'login-email'] }, 'Starting e-mail login flow...');\n```\n\n### `cname` \\[string]\n\nCustom event color. See the available color names [here](https://github.com/catapult-project/catapult/blob/main/tracing/tracing/base/color_scheme.html).\n\n### `*` \\[string \\| number \\| boolean]\n\nYour custom properties, e.g.:\n\n```js\ndetox.log.info({ login: 'test@example.com' }, 'Entering credentials...');\n```\n\nCustom properties are not printed to the terminal logs, but there are a few reserved names which have\nan extra formatting due to our default [`logger.options.stringifiers`] — these are: `args`, `data`, `error`, `stack`, `origin`.\n\nAlso, there are a few reserved properties which cannot be logged:\n- `pid` — process ID,\n- `tid` — thread ID,\n- `ts` — timestamp,\n- `ph` — phase: _begin_ (B), _end_ (E), _instant_ (i) event.\n\n## Artifacts\n\nThe logger subsystem produces two artifacts when [`--record-logs`] CLI option is enabled or [`artifacts.plugins.log.enabled`] config is set to true.\n\n### `detox.log`\n\nThis file contains all the log messages you could see in the terminal window, except that there are messages of all the log levels, from `fatal` to `trace`.\n\n### `detox.trace.json`\n\nJSON file, which, if loaded into [Perfetto] or `chrome://tracing` (internal address in Google Chrome browser), would look something like this:\n\n![Timeline artifact example](../img/timeline-artifact.png)\n\nThe tracing view provides a visual, hierarchical representation of the various processes that took place during the execution of the testing session, over the execution’s _time-line_. These processes appear as hierarchical _sections_ – sometimes visually ordered in a parent-child way, depending on their formation time and context.\n\n[`log.*.begin`]: #logbeginevent-msg\n[`log.*.end`]: #logendevent-msg\n[`logger.options.stringifiers`]: ../config/logger.mdx#loggeroptions-bunyandebugstreamoptions\n[`--record-logs`]: ../cli/test.md\n[`artifacts.plugins.log.enabled`]: ../config/artifacts.mdx#example\n[Trace Event format]: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview\n[Perfetto]: https://ui.perfetto.dev\n[Event metadata]: #event-metadata\n"
  },
  {
    "path": "docs/api/matchers.md",
    "content": "# Matchers\n\nDetox uses [matchers](matchers.md) to match UI elements in your app.\n\nUse [actions](actions.md) to simulate use interaction with elements and [expectations](expect.md) to verify element states.\n\n**Note:** For best results, it is recommended to match elements by unique identifiers. Matching by text or labels can introduce test flakiness when your app’s text change or when changing your app’s localization.\n\n## Methods\n\n- [`by.id()`](#byidid)\n- [`by.label()`](#bylabellabel)\n- [`by.text()`](#bytexttext)\n- [`by.type()`](#bytypeclassname)\n- [`by.traits()`](#bytraitstraits-ios-only) **iOS Only**\n- [`withAncestor()`](#withancestormatcher)\n- [`withDescendant()`](#withdescendantmatcher)\n- [`and()`](#andmatcher)\n- [`atIndex()`](#atindexindex)\n\n### `by.id(id)`\n\nMatch elements with the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nelement(by.id('tap_me'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.id(/^tap_[a-z]+$/));\n```\n\n### `by.label(label)`\n\nMatch elements with the specified accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n```js\nelement(by.label('Welcome'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.label(/[a-z]+/i));\n```\n\n### `by.text(text)`\n\nMatch elements with the specified text.\n\n```js\nelement(by.text('Tap Me'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.text(/^Tap .*$/));\n```\n\n### `by.type(className)`\n\nMatches elements whose class is, or inherits from, the specified class name. On Android, provide the class canonical name.\n\n**Note:** iOS and Android class names differ.\n\n```js\nelement(by.type('RCTImageView')); //iOS class name\nelement(by.type('android.widget.ImageView')); //Android class canonical name\n```\n\n### `by.traits([traits])` **iOS Only**\n\nMatches elements by their [accessibility traits](https://developer.apple.com/documentation/uikit/uiaccessibilityelement/1619584-accessibilitytraits).\n\nCurrently supported values:\n\n`\"none\"`\n`\"button\"`\n`\"link\"`\n`\"header\"`\n`\"searchField\"`\n`\"image\"`\n`\"selected\"`\n`\"playsSound\"`\n`\"keyboardKey\"`\n`\"staticText\"`\n`\"summaryElement\"`\n`\"notEnabled\"`\n`\"updatesFrequently\"`\n`\"startsMediaSession\"`\n`\"adjustable\"`\n`\"allowsDirectInteraction\"`\n`\"causesPageTurn\"`\n`\"tabBar\"`\n\n```js\nelement(by.traits(['button']));\n```\n\n### `withAncestor(matcher)`\n\nMatches elements with an ancestor that matches the specified matcher.\n\n```js\nelement(by.id('child').withAncestor(by.id('parent')));\n```\n\n### `withDescendant(matcher)`\n\nMatches elements with at least one descendant that matches the specified matcher.\n\n```js\nelement(by.id('parent').withDescendant(by.id('child')));\n```\n\n### `and(matcher)`\n\nMatches elements by combining several matchers together.\n\n```js\nelement(by.id('uniqueId').and(by.text('some text')));\n```\n\n### `atIndex(index)`\n\nIf a matcher resolves into multiple matched UI elements, you may specify which element to use by its index.\n\nOn iOS, matched elements are sorted by their x and y axes.\n\n**Note:** Due to different underlying implementations of Detox on iOS and Android, as well as other differences in the OS implementations, as well as RN implementation differences on each OS, indices may not match between iOS and Android. Relying on indices may also introduce flakiness in your tests as your app’s user interface is updated. It is recommended to use unique identifier matchers for your elements.\n\n```js\nelement(by.text('Product')).atIndex(2);\n```\n\n## Regex matching\n\nFor supported matchers ([`id`](#byidid), [`label`](#bylabellabel), [`text`](#bytexttext)), you can also utilize regex (Regular Expressions) alongside certain flags. Here's a table with the supported flags:\n\n| Flag | Name          | Modification                                                                                                                                             |\n| ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `i`  | Ignore Casing | Makes the expression search case-insensitively.                                                                                                          |\n| `s`  | Dot All       | Makes the wild character `.` match newlines as well.                                                                                                     |\n| `m`  | Multiline     | Makes the boundary characters (`^` and `$`) match the beginning and ending of every single line instead of the beginning and ending of the whole string. |\n\n:::caution Note\n\nRegular expression flags such as `g` (global) and `y` (sticky) that are not supported, as well as `u` (unicode) which is always implied, are ignored when parsing input.\n\nPay attention that as of writing this note, Android supports lookbehind assertions in its regular expression implementation, while iOS does not. It's advisable to check the official platform-specific documentation for limitations.\n\n:::\n\nThe following sample code snippet matches text starting with \"Tap\" followed by any number of alphabetic characters, case-insensitively:\n\n```js\nelement(by.text(/Tap [A-Za-z]+/i));\n```\n"
  },
  {
    "path": "docs/api/partials/_lifecycle-cli-many-workers.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-cli-many-workers.svg)\n"
  },
  {
    "path": "docs/api/partials/_lifecycle-cli-single-worker.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-cli-single-worker.svg)\n"
  },
  {
    "path": "docs/api/partials/_lifecycle-jest-many-workers.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-jest-many-workers.svg)\n"
  },
  {
    "path": "docs/api/partials/_lifecycle-jest-single-worker.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-jest-single-worker.svg)\n"
  },
  {
    "path": "docs/api/pilot.md",
    "content": "# Wix Pilot\n\nWix Pilot is an AI-powered plugin that allows you to write tests using natural language commands, powered by large language models (LLMs). It simplifies the process of writing end-to-end tests by translating human-readable instructions into actions and assertions.\n\n:::caution Work in Progress\n\nWix Pilot is in active development, and APIs are subject to change in future releases.\n\n:::\n\n:::note Migration Notice\n\nWith the introduction of **Wix Pilot**, the `copilot` API is now deprecated.\n\n- **Wix Pilot** is a standalone plugin that enables natural language-based testing and can work across different testing frameworks.\n- **Detox Pilot** is a built-in facade within Detox that leverages Wix Pilot for Detox-specific testing.\n\nFrom now on, use the `pilot` API. The `copilot` API will remain temporarily supported for backward compatibility but will be removed in future releases.\n\n:::\n\n## Overview\n\nDetox Pilot exposes a simple API that integrates seamlessly with your Detox tests. It requires minimal setup and allows you to perform complex testing operations by simply describing them in natural language.\n\nFor a more detailed guide on integrating Wix Pilot in your tests, refer to the \\[Detox Pilot Guide].\n\n## Methods\n\n- [`pilot.init()`](#pilotinitprompthandler)\n- [`pilot.perform()`](#pilotperformsteps)\n- [`pilot.autopilot()`](#pilotautopilotgoal)\n\n## `pilot.init(promptHandler)`\n\nInitializes Pilot with the given prompt handler. Must be called before any other Pilot methods.\n\n**Parameters:**\n\n- `promptHandler` (PromptHandler): An object implementing the [`PromptHandler`](#prompthandler-interface) interface.\n\n**Example:**\n\n```javascript\nconst { pilot } = require('detox');\nconst OpenAIPromptHandler = require('./OpenAIPromptHandler');\n\nbeforeAll(() => {\n  const promptHandler = new OpenAIPromptHandler('YOUR_OPENAI_API_KEY');\n  pilot.init(promptHandler);\n});\n```\n\n## `pilot.perform(...steps)`\n\nPerforms a testing operation or series of operations based on the given steps.\n\n**Parameters:**\n\n- `steps` (string\\[]): One or more natural language instructions specifying the actions or assertions to perform.\n\n**Returns:**\n\n- A promise that resolves when all steps have been executed.\n\n**Example:**\n\n```javascript\nawait pilot.perform(\n  'Start the application',\n  'Tap on the \"Login\" button',\n  'Enter \"user@example.com\" into the email field',\n  'Enter \"password123\" into the password field',\n  'Press the \"Submit\" button',\n  'The welcome message \"Hello, User!\" should be displayed'\n);\n```\n\n## `pilot.autopilot(goal)`\n\nAutomatically generates a series of steps to achieve the given goal.\n\n**Parameters:**\n\n- `goal` (string): A natural language description of the desired outcome.\n\n**Example:**\n\n```javascript\nawait pilot.autoPilot('Log in and navigate to the profile page');\n```\n\n## `PromptHandler` Interface\n\nThe `PromptHandler` interface defines how Pilot communicates with the LLM service.\n\n```typescript\ninterface PromptHandler {\n  /**\n   * Sends a prompt to the LLM service and returns the response.\n   * @param prompt The prompt to send.\n   * @param image Optional path to an image capturing the current UI state.\n   * @returns A promise resolving to the LLM's response.\n   */\n  runPrompt(prompt: string, image?: string): Promise<string>;\n\n  /**\n   * Indicates whether the LLM service supports snapshot images.\n   * @returns A boolean value.\n   */\n  isSnapshotImageSupported(): boolean;\n}\n```\n\nYou can refer to the [Pilot Guide] for an example of implementing a `PromptHandler` for OpenAI's service.\n\n[Detox Pilot Guide]: ../pilot/testing-with-pilot\n"
  },
  {
    "path": "docs/api/system.md",
    "content": "# System\n\nSystem APIs allows you to interact with dialogs in the system-level (e.g. permissions, alerts, etc.).\n\n:::caution Experimental\n\nSystem APIs are currently in an experimental phase.\nThis means that the API is not yet final and **may change over minor releases.**\n\n:::\n\n:::note\n\n**System APIs are only available on iOS**. Android support is coming soon.\n\nAt the moment, System APIs are limited to system dialogs (e.g. permissions, alerts, etc.).\nWe plan to expand the System APIs to include more system-level interactions in the future,\nsuch as OS browser (Safari / Chrome), interactions with push notifications, photo library, etc.\n\n:::\n\n## Matchers\n\nSystem matchers are used to find elements within the system:\n\n- [`by.system.label(label)`]\n- [`by.system.type(type)`]\n\n### `by.system.label(label)`\n\nMatch elements with the specified label.\n\n```js\nsystem.element(by.system.label('Dismiss'));\n```\n\n### `by.system.type(type)`\n\nMatch elements with the specified type.\n\nThe type value can be any of [`XCUIElement.ElementType`][iOS element-type] values, such as `'button'` or `'textField'`.\n\n```js\nsystem.element(by.system.type('button'));\n```\n\n## Actions\n\nSystem actions are used to interact with elements within the system:\n\n- [`tap()`]\n\n### `tap()`\n\nTap on the element.\n\n```js\nsystem.element(by.system.label('Allow')).tap();\n```\n\n## Expectations\n\nSystem expectations are used to assert the state of elements within the system:\n\n- [`toExist()`]\n- [`not`]\n\n### `toExist()`\n\nAsserts that the element exists.\n\n```js\nawait expect(system.element(by.system.label('Allow'))).toExist();\n```\n\n### `not`\n\nNegates the expectation.\n\n```js\nawait expect(system.element(by.system.label('Allow'))).not.toExist();\n```\n\n[`by.system.label(label)`]: #bysystemlabellabel\n[`by.system.type(type)`]: #bysystemtypetype\n[`tap()`]: #tap\n[`toExist()`]: #toexist\n[`not`]: #not\n[iOS element-type]: https://developer.apple.com/documentation/xctest/xcuielement/elementtype\n"
  },
  {
    "path": "docs/api/webviews.md",
    "content": "# Web Views\n\nWeb views are native components that render content not natively supported by the platform, like web pages or PDF documents.\nHowever, elements within web views are not native components, making direct interaction through Detox challenging.\nTo address this, Detox offers a suite of matchers, actions, and expectations designed for interacting with content inside web views.\n\n## Locating Elements in Web Views\n\n### `web.element(matcher)`\n\nIn cases where there's only one web view present on the screen, you may use the `web.element()` function, paired with [web view matchers], to reference elements within the web view.\nUpon obtaining the element reference, you can utilize web view actions and expectations on the webView element.\n\n```js\nconst innerElement = web.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\nIn the example above, we locate an inner element by its `id` HTML attribute and verify its text content.\n\n### `web(nativeMatcher).element(matcher)`\n\nIf you have multiple web views on the screen, you must locate a specific web view first by using a [native matcher][native matchers], e.g.:\n\n```js\nconst myWebView = web(by.id('webview_identifier'));\n```\n\nFollowing that, you can locate the element within the identified web view:\n\n```js\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\n### `web(nativeMatcher).atIndex(index).element(matcher)` (iOS only)\n\n:::note\n\nThis matcher is available for iOS only. See [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\nIf you have multiple web views on the screen and you want to interact with a specific web view, you can use the `atIndex()` method to choose the web view at the specified index.\n\n```js\nconst myWebView = web(by.id('webview_identifier')).atIndex(1);\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\nIn the example above, we use `atIndex()` to select the second web view on the screen (that has the specified accessibility identifier) and then locate an HTML element inside that web view.\n\n## Matchers\n\nWeb view matchers are used to find elements within a web view:\n\n- [`by.web.id()`]\n- [`by.web.className()`]\n- [`by.web.cssSelector()`]\n- [`by.web.name()`]\n- [`by.web.xpath()`]\n- [`by.web.href()`]\n- [`by.web.hrefContains()`]\n- [`by.web.tag()`]\n- [`by.web.value()`] (iOS only)\n- [`by.web.label()`] (iOS only, supports [`asSecured()`])\n- [`by.web.type()`] (iOS only, [`asSecured()`] only)\n- [`atIndex()`]\n\n### `by.web.id(id)`\n\nMatch elements with the specified accessibility identifier.\n\n```js\nweb.element(by.web.id('identifier'));\n```\n\n### `by.web.className(className)`\n\nMatch elements with the specified CSS class name.\n\n```js\nweb.element(by.web.className('className'));\n```\n\n### `by.web.cssSelector(cssSelector)`\n\nMatch elements with the specified CSS selector.\n\n```js\nweb.element(by.web.cssSelector('#cssSelector'));\n```\n\n### `by.web.name(name)`\n\nMatch form input elements with the specified [`name` attribute][name].\n\n```js\nweb.element(by.web.name('name'));\n```\n\n### `by.web.xpath(xpath)`\n\nMatch elements with the specified XPath.\n\n```js\nweb.element(by.web.xpath('//*[@id=\"testingh1-1\"]'));\n```\n\n### `by.web.href(href)`\n\nMatch elements with the specified `href`.\n\n```js\nweb.element(by.web.href('https://wix.com'));\n```\n\n:::note\n\nYou might face issues with this matcher on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `by.web.hrefContains(href)`\n\nMatch elements that contain the specified `href`.\n\n```js\nweb.element(by.web.hrefContains('wix'));\n```\n\n:::note\n\nYou might face issues with this matcher on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `by.web.tag(tag)`\n\nMatch elements with the specified tag.\n\n```js\nweb.element(by.web.tag('h1'));\n```\n\n### `by.web.value(value)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment.\n\n:::\n\nMatch elements with the specified value.\n\n```js\nweb.element(by.web.value('value'));\n```\n\n### `by.web.label(label)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment and supports [`asSecured()`].\n\n:::\n\nMatch elements with the specified label.\n\n```js\nweb.element(by.web.label('label'));\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nweb.element(by.web.label('label')).asSecured();\n```\n\n### `by.web.type(accessibilityType)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment and supported with [`asSecured()`] only.\n\n:::\n\nMatch elements with the specified type.\n\n```js\nweb.element(by.web.type('textField')).asSecured();\n```\n\nThe type value can be any of XCUIElement.ElementType values, such as 'button' or 'textField'. See [XCUIElement.ElementType](https://developer.apple.com/documentation/xctest/xcuielement/elementtype).\n\n### `atIndex(index)`\n\nChoose the element at the specified index.\n\n```js\nweb.element(by.web.tag('h1')).atIndex(1);\n```\n\nUse it sparingly for those rare cases when you cannot make your matcher less ambiguous, so it returns one element only.\n\n## Actions\n\nWeb view actions are used to interact with elements within a web view:\n\n- [`tap()`] (supports [`asSecured()`])\n- [`typeText()`] (supports [`asSecured()`])\n- [`replaceText()`] (supports [`asSecured()`])\n- [`clearText()`] (supports [`asSecured()`])\n- [`selectAllText()`]\n- [`getText()`]\n- [`scrollToView()`]\n- [`focus()`]\n- [`moveCursorToEnd()`]\n- [`runScript()`]\n- [`getCurrentUrl()`]\n- [`getTitle()`]\n\n### `tap()`\n\nTap the element.\n\n```js\nawait web.element(by.web.id('identifier')).tap();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.label('Submit')).asSecured().tap();\n```\n\n### `typeText(text[, isContentEditable])`\n\nType the specified text into the element.\n\n`isContentEditable` is an optional parameter that indicates whether the element should be a [content-editable] (`contenteditable`) element, and defaults to `false`.\n\n```js\nawait web.element(by.web.id('identifier')).typeText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:  \n\n```js\nawait web.element(by.web.type('textField')).asSecured().typeText('Hello World!');\n```\n\n:::note\n\nThe `isContentEditable` parameter is currently necessary for content-editable elements only on Android.\n\nOn iOS, Detox automatically detects content-editable elements regardless of this parameter.\n\n:::\n\n### `replaceText(text)`\n\nReplace the text of the element with the specified text.\n\n```js\nawait web.element(by.web.id('identifier')).replaceText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.type('textField')).asSecured().replaceText('Hello World!');\n```\n\n:::note\n\nThis action is currently not supported for content-editable elements on Android.\n\nOn iOS, Detox automatically detects content-editable elements and replaces their text.\n\n:::\n\n### `clearText()`\n\nClear the text of the element.\n\n```js\nawait web.element(by.web.id('identifier')).clearText();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.type('textField')).asSecured().clearText();\n```\n\n:::note\n\nThis action is currently not supported for content-editable elements on Android.\n\nOn iOS, Detox automatically detects content-editable elements and clears their text.\n\n:::\n\n### `selectAllText()`\n\nSelect all the text of the element.\n\n```js\nawait web.element(by.web.id('identifier')).selectAllText();\n```\n\n:::note\n\nThis action is currently supported for content-editable elements only on Android.\n\nOn iOS, Detox can select all the text of any element that supports it (for example, an input element).\n\n:::\n\n### `getText()`\n\nGet the text of the element.\n\n```js\nconst text = await web.element(by.web.id('identifier')).getText();\n```\n\n### `scrollToView()`\n\nScroll to the element until its top is at the top of the viewport.\n\n```js\nawait web.element(by.web.id('identifier')).scrollToView();\n```\n\n### `focus()`\n\nFocus on the element.\n\n```js\nawait web.element(by.web.id('identifier')).focus();\n```\n\n### `moveCursorToEnd()`\n\nMove the input cursor to the end of the element's content.\n\n```js\nawait web.element(by.web.id('identifier')).moveCursorToEnd();\n```\n\n:::note\n\nThis action is currently supported for content-editable elements only on Android.\n\nOn iOS, Detox can move the cursor to the end of any element that supports it (for example, an input element).\n\n:::\n\n### `runScript(script[, args])`\n\nRun the specified script on the element.\nThe script should be a string that contains a valid JavaScript function.\nIt will be called with that element as the first argument:\n\n```js\nconst webElement = web.element(by.web.id('identifier'));\nawait webElement.runScript('(el) => el.click()');\n```\n\nFor convenience, you can pass a function instead of a string, but please note that this will not work if the function uses any variables from the outer scope:\n\nThe script can accept additional arguments and return a value. Make sure the values are primitive types or serializable objects, as they will be converted to JSON and back:\n\n```js\nconst text = await webElement.runScript(function get(element, property) {\n  return element[property];\n}, ['textContent']);\n```\n\n### `getCurrentUrl()`\n\nGet the current URL of the web view.\n\n```js\nconst url = await web.element(by.web.id('identifier')).getCurrentUrl();\n```\n\n:::note\n\nAlthough this action returns the URL of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.\n\nYou might face issues with this action on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `getTitle()`\n\nGet the title of the web view.\n\n:::note\n\nAlthough this action returns the title of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.\n\n:::\n\n```js\nconst title = await web.element(by.web.id('identifier')).getTitle();\n```\n\n## Expectations\n\nWeb view expectations are used to assert the state of elements within a web view:\n\n- [`toHaveText()`]\n- [`toExist()`] (supports [`asSecured()`])\n- [`not`] (supports [`asSecured()`])\n\n### `toHaveText(text)`\n\nAssert that the element has the specified text.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n```\n\n### `toExist()`\n\nAssert that the element exists.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).toExist();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait expect(web.element(by.web.label('Hello World!')).asSecured()).toExist();\n```\n\n:::note\n\nYou might face issues with this expectation on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `not`\n\nNegate the expectation.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).not.toHaveText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait expect(web.element(by.web.label('Hello World!')).asSecured().atIndex(1)).not.toExist();\n```\n\n## `asSecured()`\n\n:::note experimental\n\nThis API is available only on **iOS** and is currently in the experimental phase. It is subject to changes in the near future.\n\n:::\n\nThe `asSecured()` API is designed for interacting with web pages that use secured protocols, such as PCI DSS for payment pages. Use it when the regular API fails to interact with such pages. Detox uses system-level interactions with the webview in these scenarios. This approach is less performant and has fewer APIs.\n\nExample:\n\n```js\nawait web.element(by.web.label('Submit')).asSecured().tap();\n```\n\n### Why use `asSecured()`?\n\nUse `asSecured()` for web pages with secured protocols when regular Detox interactions fail. For CORS issues, consider passing the [`detoxDisableWebKitSecurity`] launch argument to enable less strict security limitations for interacting with secured web views.\n\n[native matchers]: matchers.md\n\n[`by.id()`]: matchers.md#byidid\n\n[web view matchers]: webviews.md#matchers\n\n[web view actions]: webviews.md#actions\n\n[web view expectations]: webviews.md#expectations\n\n[`by.web.id()`]: webviews.md#bywebidid\n\n[`by.web.className()`]: webviews.md#bywebclassnameclassname\n\n[`by.web.cssSelector()`]: webviews.md#bywebcssselectorcssselector\n\n[`by.web.name()`]: webviews.md#bywebnamename\n\n[`by.web.xpath()`]: webviews.md#bywebxpathxpath\n\n[`by.web.href()`]: webviews.md#bywebhrefhref\n\n[`by.web.hrefContains()`]: webviews.md#bywebhrefcontainshref\n\n[`by.web.tag()`]: webviews.md#bywebtagtag\n\n[`by.web.value()`]: webviews.md#bywebvaluevalue\n\n[`by.web.label()`]: webviews.md#byweblabellabel\n\n[`by.web.type()`]: webviews.md#bywebtypeaccessibilitytype\n\n[`atIndex()`]: webviews.md#atindexindex\n\n[`tap()`]: webviews.md#tap\n\n[`typeText()`]: webviews.md#typetexttext-iscontenteditable\n\n[content-editable]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable\n\n[`replaceText()`]: webviews.md#replacetexttext\n\n[`clearText()`]: webviews.md#cleartext\n\n[`selectAllText()`]: webviews.md#selectalltext\n\n[`getText()`]: webviews.md#gettext\n\n[`scrollToView()`]: webviews.md#scrolltoview\n\n[`focus()`]: webviews.md#focus\n\n[`moveCursorToEnd()`]: webviews.md#movecursortoend\n\n[name]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#name\n\n[`runScript()`]: webviews.md#runscriptscript-args\n\n[`getCurrentUrl()`]: webviews.md#getcurrenturl\n\n[`getTitle()`]: webviews.md#gettitle\n\n[`toHaveText()`]: webviews.md#tohavetexttext\n\n[`toExist()`]: webviews.md#toexist\n\n[`not`]: webviews.md#not\n\n[`asSecured()`]: webviews.md#assecured\n\n[`detoxDisableWebKitSecurity`]: device.md#12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only\n"
  },
  {
    "path": "docs/architecture/artifacts.md",
    "content": "# Artifacts System\n\nThe artifacts subsystem collects test artifacts like screenshots, videos, logs, and performance data during test execution.\n\n## Architecture Overview\n\n```text\n┌─────────────────────────────────────────────────────────────┐\n│                     Artifacts Subsystem                     │\n│                                                             │\n│  ┌───────────────────────────────────────────────────────┐  │\n│  │                   ArtifactsManager                    │  │\n│  │                                                       │  │\n│  │  - Registers plugins                                  │  │\n│  │  - Subscribes to device events                        │  │\n│  │  - Orchestrates lifecycle callbacks                   │  │\n│  │  - Manages idle callback queue                        │  │\n│  └────────────────────────┬──────────────────────────────┘  │\n│                           │                                 │\n│           ┌───────────────┼───────────────┐                 │\n│           │               │               │                 │\n│     ┌─────▼─────┐   ┌─────▼─────┐   ┌─────▼─────┐           │\n│     │Screenshot │   │   Video   │   │    Log    │           │\n│     │  Plugin   │   │  Plugin   │   │  Plugin   │           │\n│     └───────────┘   └───────────┘   └───────────┘           │\n│                                                             │\n│     ┌───────────┐   ┌───────────┐                           │\n│     │Instruments│   │UIHierarchy│                           │\n│     │  Plugin   │   │  (iOS)    │                           │\n│     └───────────┘   └───────────┘                           │\n│                                                             │\n│  ┌───────────────────────────────────────────────────────┐  │\n│  │                  ArtifactPathBuilder                  │  │\n│  │  Generates paths: artifacts/{config}/{test}/artifact  │  │\n│  └───────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Directory Structure\n\n```text\nsrc/artifacts/\n├── ArtifactsManager.js           # Main orchestrator\n├── providers/\n│   └── index.js                  # Exports: AndroidArtifactPluginsProvider,\n│                                 #          IosArtifactPluginsProvider,\n│                                 #          IosSimulatorArtifactPluginsProvider\n├── templates/\n│   ├── artifact/\n│   │   ├── Artifact.js           # Base artifact class\n│   │   └── FileArtifact.js       # File-based artifact\n│   └── plugin/\n│       ├── ArtifactPlugin.js     # Base plugin class\n│       ├── StartupAndTestRecorderPlugin.js\n│       ├── TwoSnapshotsPerTestPlugin.js\n│       └── WholeTestRecorderPlugin.js\n├── screenshot/\n│   ├── ScreenshotArtifactPlugin.js\n│   ├── SimulatorScreenshotPlugin.js    # iOS\n│   └── ADBScreencapPlugin.js           # Android\n├── video/\n│   ├── VideoArtifactPlugin.js\n│   ├── SimulatorRecordVideoPlugin.js   # iOS\n│   └── ADBScreenrecorderPlugin.js      # Android\n├── log/\n│   ├── LogArtifactPlugin.js\n│   ├── ios/\n│   │   └── SimulatorLogPlugin.js\n│   └── android/\n│       └── ADBLogcatPlugin.js\n├── instruments/\n│   ├── InstrumentsArtifactPlugin.js\n│   ├── ios/\n│   │   └── SimulatorInstrumentsPlugin.js\n│   └── android/\n│       └── AndroidInstrumentsPlugin.js\n├── uiHierarchy/\n│   └── IosUIHierarchyPlugin.js         # iOS only\n└── utils/\n    ├── ArtifactPathBuilder.js\n    └── temporaryPath.js\n```\n\n## ArtifactsManager\n\n### Initialization\n\n```javascript\nclass ArtifactsManager extends EventEmitter {\n  constructor({ rootDir, pathBuilder, plugins }) {\n    this._pluginConfigs = plugins;\n    this._artifactPlugins = {};\n    this._pathBuilder = new ArtifactPathBuilder({ rootDir });\n    this._idlePromise = Promise.resolve();\n  }\n\n  registerArtifactPlugins(artifactPluginFactoriesMap) {\n    for (const [key, factory] of Object.entries(artifactPluginFactoriesMap)) {\n      const config = this._pluginConfigs[key];\n      this._artifactPlugins[key] = this._instantiateArtifactPlugin(factory, config);\n    }\n  }\n}\n```\n\n### Plugin Instantiation\n\nEach plugin receives an API object for interacting with the manager:\n\n```javascript\n_instantiateArtifactPlugin(pluginFactory, pluginUserConfig) {\n  const artifactsApi = {\n    plugin: null,\n    userConfig: { ...pluginUserConfig },\n\n    preparePathForArtifact: async (artifactName, testSummary) => {\n      const artifactPath = this._pathBuilder.buildPathForTestArtifact(artifactName, testSummary);\n      const artifactDir = path.dirname(artifactPath);\n      await fs.ensureDir(artifactDir);\n      return artifactPath;\n    },\n\n    trackArtifact: (artifact) => this.emit('trackArtifact', artifact),\n    untrackArtifact: (artifact) => this.emit('untrackArtifact', artifact),\n\n    requestIdleCallback: (callback) => {\n      // Queue for execution during idle time\n      this._idleCallbackRequests.push({ caller: artifactsApi.plugin, callback });\n      return this._idlePromise;\n    },\n  };\n\n  const plugin = pluginFactory(artifactsApi);\n  artifactsApi.plugin = plugin;\n  return plugin;\n}\n```\n\n### Device Event Subscription\n\n```javascript\nsubscribeToDeviceEvents(deviceEmitter) {\n  deviceEmitter.on('bootDevice', this.onBootDevice.bind(this));\n  deviceEmitter.on('beforeShutdownDevice', this.onBeforeShutdownDevice.bind(this));\n  deviceEmitter.on('shutdownDevice', this.onShutdownDevice.bind(this));\n  deviceEmitter.on('beforeLaunchApp', this.onBeforeLaunchApp.bind(this));\n  deviceEmitter.on('launchApp', this.onLaunchApp.bind(this));\n  deviceEmitter.on('appReady', this.onAppReady.bind(this));\n  deviceEmitter.on('beforeUninstallApp', this.onBeforeUninstallApp.bind(this));\n  deviceEmitter.on('beforeTerminateApp', this.onBeforeTerminateApp.bind(this));\n  deviceEmitter.on('terminateApp', this.onTerminateApp.bind(this));\n  deviceEmitter.on('createExternalArtifact', this.onCreateExternalArtifact.bind(this));\n}\n```\n\n### Lifecycle Events\n\n```javascript\n// Test lifecycle\nasync onRunDescribeStart(suite) {\n  await this._callPlugins('ascending', 'onRunDescribeStart', suite);\n}\n\nasync onTestStart(testSummary) {\n  await this._callPlugins('ascending', 'onTestStart', testSummary);\n}\n\nasync onTestDone(testSummary) {\n  await this._callPlugins('descending', 'onTestDone', testSummary);\n}\n\nasync onRunDescribeFinish(suite) {\n  await this._callPlugins('descending', 'onRunDescribeFinish', suite);\n}\n\n// Failure hooks\nasync onHookFailure(testSummary) {\n  await this._callPlugins('plain', 'onHookFailure', testSummary);\n}\n\nasync onTestFnFailure(testSummary) {\n  await this._callPlugins('plain', 'onTestFnFailure', testSummary);\n}\n```\n\n### Plugin Execution Strategy\n\nPlugins can be called in different orders based on priority:\n\n```javascript\nasync _callPlugins(strategy, methodName, ...args) {\n  for (const pluginGroup of this._groupPlugins(strategy)) {\n    await Promise.all(pluginGroup.map(async (plugin) => {\n      try {\n        await plugin[methodName](...args);\n      } catch (e) {\n        this._unhandledPluginExceptionHandler(e, { plugin, methodName });\n      }\n    }));\n  }\n}\n\n_groupPlugins(strategy) {\n  if (strategy === 'plain') {\n    return [_.values(this._artifactPlugins)];\n  }\n\n  const byPriority = _.chain(this._artifactPlugins)\n    .values()\n    .groupBy('priority')\n    .entries()\n    .sortBy(([priority]) => Number(priority))\n    .map(1)\n    .value();\n\n  return strategy === 'descending' ? byPriority.reverse() : byPriority;\n}\n```\n\n## Plugin Types\n\n### Base Plugin (`src/artifacts/templates/plugin/ArtifactPlugin.js`)\n\n```javascript\nclass ArtifactPlugin {\n  constructor({ api }) {\n    this.api = api;\n    this.enabled = api.userConfig.enabled !== false;\n    this.keepOnlyFailedTestsArtifacts = api.userConfig.keepOnlyFailedTestsArtifacts;\n  }\n\n  // Lifecycle hooks (override in subclasses)\n  async onBootDevice(deviceInfo) {}\n  async onBeforeLaunchApp(appLaunchInfo) {}\n  async onLaunchApp(appLaunchInfo) {}\n  async onTestStart(testSummary) {}\n  async onTestDone(testSummary) {}\n  async onBeforeCleanup() {}\n}\n```\n\n### Screenshot Plugin\n\nCaptures screenshots on test failure or on-demand:\n\n```javascript\nclass ScreenshotArtifactPlugin extends TwoSnapshotsPerTestPlugin {\n  async preparePathForSnapshot(testSummary, name) {\n    return this.api.preparePathForArtifact(`${name}.png`, testSummary);\n  }\n\n  async takeSnapshot(name) {\n    // Delegate to device driver\n    return this.driver.takeScreenshot(name);\n  }\n}\n```\n\nConfiguration:\n\n```javascript\n{\n  artifacts: {\n    plugins: {\n      screenshot: {\n        enabled: true,\n        shouldTakeAutomaticSnapshots: true,\n        keepOnlyFailedTestsArtifacts: true,\n      }\n    }\n  }\n}\n```\n\n### Video Plugin\n\nRecords test execution:\n\n```javascript\nclass VideoArtifactPlugin extends WholeTestRecorderPlugin {\n  async onTestStart(testSummary) {\n    await this.startRecording();\n  }\n\n  async onTestDone(testSummary) {\n    await this.stopRecording();\n\n    if (testSummary.status === 'passed' && this.keepOnlyFailedTestsArtifacts) {\n      await this.discardRecording();\n    } else {\n      await this.saveRecording(testSummary);\n    }\n  }\n}\n```\n\n### Log Plugin\n\nAggregates device and app logs:\n\n```javascript\nclass LogArtifactPlugin extends StartupAndTestRecorderPlugin {\n  async onLaunchApp(appLaunchInfo) {\n    await this.startCapturingLogs(appLaunchInfo);\n  }\n\n  async onTestDone(testSummary) {\n    const logs = await this.stopCapturingLogs();\n    await this.saveLogs(logs, testSummary);\n  }\n}\n```\n\n### Instruments Plugin (iOS)\n\nRecords performance profiles:\n\n```javascript\nclass InstrumentsArtifactPlugin extends ArtifactPlugin {\n  async startRecording({ recordingPath, samplingInterval }) {\n    await this.client.startInstrumentsRecording({ recordingPath, samplingInterval });\n  }\n\n  async stopRecording() {\n    await this.client.stopInstrumentsRecording();\n  }\n}\n```\n\n### UI Hierarchy Plugin (iOS)\n\nCaptures view hierarchy for debugging (iOS only via `IosUIHierarchyPlugin`):\n\n```javascript\nclass IosUIHierarchyPlugin extends ArtifactPlugin {\n  async onTestFnFailure(testSummary) {\n    const hierarchy = await this.client.captureViewHierarchy();\n    await this.saveHierarchy(hierarchy, testSummary);\n  }\n}\n```\n\n## Platform-Specific Implementations\n\nEach artifact type has platform-specific implementations:\n\n| Artifact | iOS (Simulator) | Android |\n|----------|-----------------|---------|\n| Screenshot | `SimulatorScreenshotPlugin` | `ADBScreencapPlugin` |\n| Video | `SimulatorRecordVideoPlugin` | `ADBScreenrecorderPlugin` |\n| Log | `SimulatorLogPlugin` | `ADBLogcatPlugin` |\n| Instruments | `SimulatorInstrumentsPlugin` | `AndroidInstrumentsPlugin` |\n| UI Hierarchy | `IosUIHierarchyPlugin` | Not available |\n\nThe appropriate plugin is selected by the provider based on the device type:\n\n- `IosSimulatorArtifactPluginsProvider` for iOS simulators\n- `AndroidArtifactPluginsProvider` for Android devices\n\n## Artifact Templates\n\n### Two Snapshots Per Test\n\nTakes snapshots at test start and end:\n\n```javascript\nclass TwoSnapshotsPerTestPlugin extends ArtifactPlugin {\n  async onTestStart(testSummary) {\n    if (this.shouldTakeAutomaticSnapshots) {\n      await this.takeSnapshot('testStart');\n    }\n  }\n\n  async onTestDone(testSummary) {\n    if (this.shouldTakeAutomaticSnapshots) {\n      await this.takeSnapshot('testDone');\n    }\n  }\n}\n```\n\n### Whole Test Recorder\n\nRecords throughout entire test:\n\n```javascript\nclass WholeTestRecorderPlugin extends ArtifactPlugin {\n  async onTestStart(testSummary) {\n    await this.startRecording(testSummary);\n  }\n\n  async onTestDone(testSummary) {\n    await this.stopRecording();\n    await this.saveOrDiscard(testSummary);\n  }\n}\n```\n\n## Path Building\n\n### ArtifactPathBuilder\n\nGenerates consistent artifact paths:\n\n```javascript\nclass ArtifactPathBuilder {\n  constructor({ rootDir }) {\n    this._rootDir = rootDir;\n  }\n\n  buildPathForTestArtifact(artifactName, testSummary) {\n    // Path format: rootDir/{statusSign}{fullName}({invocations})/{artifactName}\n    // Example: artifacts/✓ Login should work/screenshot.png\n    // Example: artifacts/✗ Login should work (2)/screenshot.png  (on retry)\n    const testDir = this._constructDirectoryNameForCurrentRunningTest(testSummary);\n    return path.join(this._rootDir, testDir, artifactName);\n  }\n\n  _constructDirectoryNameForCurrentRunningTest(testSummary) {\n    const prefix = this._buildTestDirectoryPrefix(testSummary);\n    const suffix = testSummary.invocations > 1 ? ` (${testSummary.invocations})` : '';\n    return constructSafeFilename(prefix, testSummary.fullName, suffix);\n  }\n\n  _buildTestDirectoryPrefix(testSummary) {\n    return testSummary.status === 'passed' ? '✓ ' : '✗ ';\n  }\n}\n```\n\nCustom path builders can be provided:\n\n```javascript\n// detox.config.js\nmodule.exports = {\n  artifacts: {\n    rootDir: 'e2e-artifacts',\n    pathBuilder: './my-path-builder.js',\n  }\n};\n```\n\n## Configuration\n\n```javascript\nmodule.exports = {\n  artifacts: {\n    rootDir: 'artifacts',\n    pathBuilder: undefined, // or custom path builder\n    plugins: {\n      screenshot: {\n        enabled: true,\n        shouldTakeAutomaticSnapshots: true,\n        keepOnlyFailedTestsArtifacts: true,\n      },\n      video: {\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: true,\n      },\n      log: {\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: false,\n      },\n      instruments: {\n        enabled: false,\n      },\n      uiHierarchy: {  // iOS only\n        enabled: true,\n        keepOnlyFailedTestsArtifacts: true,\n      },\n    },\n  },\n};\n```\n\n## Lifecycle Flow\n\n```text\nTest Suite Starts\n        │\n        ▼\nonRunDescribeStart(suite)\n        │\n        ▼\n┌────────────────────────────────┐\n│       For each test:           │\n│                                │\n│  onTestStart(testSummary)      │\n│          │                     │\n│          ▼                     │\n│  [Test executes]               │\n│          │                     │\n│     ┌────┴────┐                │\n│     │ Failure │                │\n│     └────┬────┘                │\n│          │                     │\n│  onHookFailure() or            │\n│  onTestFnFailure()             │\n│          │                     │\n│          ▼                     │\n│  onTestDone(testSummary)       │\n│          │                     │\n│  [Save or discard artifacts]   │\n│                                │\n└────────────────────────────────┘\n        │\n        ▼\nonRunDescribeFinish(suite)\n        │\n        ▼\nonBeforeCleanup()\n        │\n        ▼\n[Final artifact processing]\n```\n\n## Idle Callbacks\n\nPlugins can defer non-critical work:\n\n```javascript\n// In plugin\nasync onTestDone(testSummary) {\n  // Critical work first\n  await this.stopRecording();\n\n  // Defer compression to idle time\n  this.api.requestIdleCallback(async () => {\n    await this.compressVideo();\n    await this.uploadToCloud();\n  });\n}\n```\n\n## External Artifacts\n\nPlugins can create artifacts from external sources:\n\n```javascript\n// During test\ndevice.createExternalArtifact({\n  pluginId: 'screenshot',\n  artifactName: 'custom-screenshot',\n  artifactPath: '/tmp/screenshot.png',\n});\n\n// In ArtifactsManager\nasync onCreateExternalArtifact({ pluginId, artifactName, artifactPath }) {\n  await this._callSinglePlugin(pluginId, 'onCreateExternalArtifact', {\n    artifact: new FileArtifact({ temporaryPath: artifactPath }),\n    name: artifactName,\n  });\n}\n```\n\n## See Also\n\n- [ARCHITECTURE.md](../../ARCHITECTURE.md) - Main architecture overview\n- [docs/config/artifacts.mdx](../config/artifacts.mdx) - Artifacts configuration\n- [docs/guide/taking-screenshots.md](../guide/taking-screenshots.md) - Screenshot guide\n"
  },
  {
    "path": "docs/architecture/client-server.md",
    "content": "# Client-Server Communication\n\nDetox uses a WebSocket-based client-server architecture for communication between the test process (Node.js) and the mobile app.\n\n## Architecture Overview\n\n```text\n┌──────────────────┐        ┌──────────────────┐        ┌──────────────────┐\n│   Test Process   │        │   DetoxServer    │        │    Mobile App    │\n│    (Node.js)     │        │   (localhost)    │        │   (iOS/Android)  │\n│                  │        │                  │        │                  │\n│  ┌────────────┐  │   WS   │  ┌────────────┐  │   WS   │  ┌────────────┐  │\n│  │   Client   │◄─┼───────►│  │  Session   │◄─┼───────►│  │   Native   │  │\n│  │            │  │        │  │  Manager   │  │        │  │   Client   │  │\n│  └────────────┘  │        │  └────────────┘  │        │  └────────────┘  │\n└──────────────────┘        └──────────────────┘        └──────────────────┘\n```\n\n## Why a Mediator Server?\n\nThe server acts as a mediator rather than having direct client-to-app communication:\n\n1. **Resilience** - Either side can disconnect (app restart, simulator boot) without losing the other's state\n2. **Session management** - Multiple test workers can share device sessions\n3. **Debugging** - Server can log all messages for troubleshooting\n4. **Flexibility** - Server can run on a different machine for CI/CD\n\n## Components\n\n### Client (`src/client/Client.js`)\n\nThe test-side WebSocket client that:\n\n- Connects to the Detox server\n- Sends actions to the mobile app\n- Handles responses and events\n- Manages synchronization state\n\n**Key methods:**\n\n```javascript\n// Connect to server and login to session\nawait client.connect();\n\n// Send an invocation (tap, type, scroll, etc.)\nawait client.execute(invocation);\n\n// Wait for app to be ready (synchronized)\nawait client.waitUntilReady();\n\n// Send action and wait for response\nawait client.sendAction(new actions.Invoke(invocation));\n```\n\n**Event handling:**\n\n```javascript\nclient.setEventCallback('appConnected', this._onAppConnected);\nclient.setEventCallback('ready', this._onAppReady);\nclient.setEventCallback('AppNonresponsiveDetected', this._onAppUnresponsive);\nclient.setEventCallback('AppWillTerminateWithError', this._onBeforeAppCrash);\nclient.setEventCallback('appDisconnected', this._onAppDisconnected);\nclient.setEventCallback('serverError', this._onUnhandledServerError);\n```\n\n### AsyncWebSocket (`src/client/AsyncWebSocket.js`)\n\nPromise-based wrapper around the WebSocket API:\n\n```javascript\nclass AsyncWebSocket {\n  async open() { /* ... */ }\n  async close() { /* ... */ }\n  async send(action, options) { /* ... */ }\n\n  // Track in-flight requests for timeout handling\n  inFlightPromises = {};\n}\n```\n\n### DetoxServer (`src/server/DetoxServer.js`)\n\nWebSocket server that mediates all communication:\n\n```javascript\nclass DetoxServer {\n  constructor({ port, standalone }) {\n    this._sessionManager = new DetoxSessionManager();\n    this._wss = new WebSocket.Server({ port });\n  }\n\n  async open() {\n    // Start listening\n  }\n\n  _onConnection(ws, req) {\n    this._sessionManager.registerConnection(ws, req.socket);\n  }\n}\n```\n\n### DetoxSession (`src/server/DetoxSession.js`)\n\nPer-session state management:\n\n```javascript\nclass DetoxSession {\n  constructor(id) {\n    this.id = id;\n    this.tester = null;  // Test process connection\n    this.app = null;     // Mobile app connection\n  }\n\n  // Route messages between tester and app\n  // Handle connection/disconnection events\n}\n```\n\n### DetoxSessionManager (`src/server/DetoxSessionManager.js`)\n\nManages multiple concurrent sessions:\n\n```javascript\nclass DetoxSessionManager {\n  constructor() {\n    this._sessions = new Map();\n  }\n\n  registerConnection(ws, socket) {\n    // Identify session from login message\n    // Create or join existing session\n  }\n\n  getSession(sessionId) {\n    return this._sessions.get(sessionId);\n  }\n}\n```\n\n## Message Protocol\n\nAll messages are JSON objects with a standard structure.\n\n**Platform differences:** iOS and Android implement the protocol quite differently:\n\n- **Android** is reflection-centric — the `generation/` project maps Java classes to JS invocation objects (see `src/android/espressoapi/`), allowing the test side to call Android APIs via reflection-based dispatch\n- **iOS** has a more handcrafted and formalized protocol, with explicit message types handled on the native side\n\n**Note:** Invocation targets vary by operation type:\n\n- High-level operations use `com.wix.detox.Detox` as the entry point\n- Action-specific invocations may use `com.wix.detox.espresso.DetoxAction` (Android) or platform-specific targets\n\n### Request (Test → App)\n\n```json\n{\n  \"type\": \"invoke\",\n  \"messageId\": 1,\n  \"params\": {\n    \"target\": {\n      \"type\": \"Class\",\n      \"value\": \"com.wix.detox.espresso.DetoxAction\"\n    },\n    \"method\": \"perform\",\n    \"args\": [\n      { \"matcher\": \"...\" },\n      { \"action\": \"...\" }\n    ]\n  }\n}\n```\n\n### Response (App → Test)\n\n```json\n{\n  \"type\": \"invokeResult\",\n  \"messageId\": 1,\n  \"params\": {\n    \"result\": \"success\"\n  }\n}\n```\n\n### Event (App → Test)\n\nEvents typically use fixed negative `messageId` values (e.g., `-1000`, `-0xc1ea`) rather than the incrementing positive IDs used for request-response pairs.\n\n```json\n{\n  \"type\": \"ready\",\n  \"messageId\": -1000\n}\n```\n\n```json\n{\n  \"type\": \"AppWillTerminateWithError\",\n  \"params\": {\n    \"errorDetails\": \"...\"\n  }\n}\n```\n\n## Actions (`src/client/actions/actions.js`)\n\nPredefined action classes for common operations:\n\n| Action | Purpose |\n|--------|---------|\n| `Login` | Authenticate with session ID |\n| `Ready` | Query if app is ready |\n| `Invoke` | Execute a command on the app |\n| `Cleanup` | Signal test completion |\n| `ReloadReactNative` | Reload the RN bundle |\n| `CurrentStatus` | Get app synchronization status |\n| `Shake` | Trigger device shake |\n| `SetOrientation` | Change device orientation |\n| `SetSyncSettings` | Configure synchronization settings |\n| `DeliverPayload` | Send push notification, deep link |\n| `CaptureViewHierarchy` | Dump UI hierarchy |\n| `GenerateViewHierarchyXml` | Generate UI hierarchy as XML (iOS and Android) |\n| `SetInstrumentsRecordingState` | Control iOS performance profiling |\n| `WaitForBackground` | Wait for app to background |\n| `WaitForActive` | Wait for app to foreground |\n\n## Connection Lifecycle\n\n```text\n1. Test starts\n   │\n   ├── Client.connect()\n   │     └── WebSocket connects to server\n   │\n   ├── Client.sendAction(Login)\n   │     └── Server creates/joins session\n   │\n   └── Server waits for app connection\n\n2. App launches (with server URL in launch args)\n   │\n   ├── Native client connects to server\n   │     └── Server associates with session\n   │\n   └── Server notifies test: 'appConnected'\n\n3. App becomes ready\n   │\n   └── Native client sends 'ready' event\n\n4. Test executes\n   │\n   ├── Client.execute(invocation)\n   │     ├── Server routes to app\n   │     ├── App executes\n   │     └── App responds via server\n   │\n   └── Client receives result\n\n5. Test completes\n   │\n   ├── Client.cleanup()\n   │     └── Sends Cleanup action\n   │\n   └── Client.close()\n```\n\n## Synchronization\n\nThe client monitors app readiness through deferred promises (simplified):\n\n```javascript\n// Track connection state\nthis._whenAppIsConnected = new Deferred();\nthis._whenAppIsReady = new Deferred();\n\n// Wait for synchronization (simplified - actual implementation has additional checks)\nasync waitUntilReady() {\n  await this._whenAppIsConnected.promise;\n  await this.sendAction(new actions.Ready());\n  this._whenAppIsReady.resolve();\n}\n```\n\n## Slow Invocation Detection\n\nWhen `debugSynchronization` is enabled, the client periodically queries app status during long operations:\n\n```javascript\n_scheduleSlowInvocationQuery() {\n  this._slowInvocationStatusHandle = setTimeout(async () => {\n    const status = await this.currentStatus();\n    log.info({ event: 'APP_STATUS' }, status);\n    // Reschedule if still waiting\n  }, this._slowInvocationTimeout);\n}\n```\n\n## Error Handling\n\n### App Crash Detection\n\n```javascript\n_onBeforeAppCrash({ params }) {\n  this._pendingAppCrash = new DetoxRuntimeError({\n    message: 'The app has crashed',\n    debugInfo: params.errorDetails,\n  });\n\n  // Reject pending promises\n  // Schedule app termination\n}\n```\n\n### Disconnect Handling\n\n```javascript\n_onAppDisconnected() {\n  if (this._pendingAppCrash) {\n    this._whenAppDisconnected.reject(this._pendingAppCrash);\n    this._asyncWebSocket.rejectAll(this._pendingAppCrash);\n  }\n}\n```\n\n## User Stack Traces\n\nThe client preserves user test stack traces for better error messages:\n\n```javascript\nasync _doSendAction(action, options) {\n  const errorWithUserStack = createErrorWithUserStack();\n\n  try {\n    const response = await this._asyncWebSocket.send(action, options);\n    return await action.handle(response);\n  } catch (err) {\n    throw replaceErrorStack(errorWithUserStack, asError(err));\n  }\n}\n```\n\n## See Also\n\n- [ARCHITECTURE.md](../../ARCHITECTURE.md) - Main architecture overview\n- [docs/architecture/devices.md](devices.md) - Device management\n- [docs/config/session.mdx](../config/session.mdx) - Session configuration\n"
  },
  {
    "path": "docs/architecture/devices.md",
    "content": "# Device Management\n\nThe device subsystem handles allocation, lifecycle, and interaction with iOS simulators, Android emulators, and cloud devices.\n\n## Architecture Overview\n\n```text\n┌────────────────────────────────────────────────────────────┐\n│                      Device Subsystem                      │\n│                                                            │\n│  ┌─────────────────┐  ┌─────────────────┐  ┌────────────┐  │\n│  │ DeviceAllocator │─►│  RuntimeDevice  │─►│   Driver   │  │\n│  │                 │  │                 │  │            │  │\n│  │ - allocate()    │  │ - launchApp()   │  │ - boot()   │  │\n│  │ - free()        │  │ - terminateApp()│  │ - install()│  │\n│  │                 │  │ - reloadRN()    │  │ - execute()│  │\n│  └────────┬────────┘  └────────┬────────┘  └────────────┘  │\n│           │                    │                           │\n│  ┌────────▼────────┐  ┌────────▼────────┐                  │\n│  │ DeviceRegistry  │  │  DeviceCookie   │                  │\n│  │  (Lock files)   │  │ (Serialization) │                  │\n│  └─────────────────┘  └─────────────────┘                  │\n└────────────────────────────────────────────────────────────┘\n```\n\n## Directory Structure\n\n```text\nsrc/devices/\n├── allocation/\n│   ├── DeviceAllocator.js      # Main allocation coordinator\n│   ├── DeviceList.js           # Available devices tracking\n│   ├── DeviceRegistry.js       # Lock-based device registry\n│   ├── drivers/\n│   │   ├── ios/\n│   │   │   └── SimulatorAllocDriver.js\n│   │   └── android/\n│   │       ├── emulator/\n│   │       │   └── EmulatorAllocDriver.js\n│   │       ├── attached/\n│   │       │   └── AttachedAndroidAllocDriver.js\n│   │       └── genycloud/\n│   │           └── GenyAllocDriver.js\n│   └── factories/\n│       ├── ios.js\n│       ├── android.js\n│       └── external.js\n├── runtime/\n│   ├── RuntimeDevice.js        # Main device abstraction\n│   └── drivers/\n│       ├── DeviceDriverBase.js\n│       ├── ios/\n│       │   ├── IosDriver.js\n│       │   └── SimulatorDriver.js\n│       └── android/\n│           ├── AndroidDriver.js\n│           ├── emulator/\n│           │   └── EmulatorDriver.js\n│           ├── attached/\n│           │   └── AttachedAndroidDriver.js\n│           └── genycloud/\n│               └── GenyCloudDriver.js\n├── common/\n│   └── drivers/\n│       ├── ios/tools/\n│       │   └── AppleSimUtils.js\n│       └── android/\n│           ├── exec/\n│           │   ├── ADB.js\n│           │   └── AAPT.js\n│           └── tools/\n│               ├── Instrumentation.js\n│               └── AppInstallHelper.js\n├── cookies/\n│   └── index.js                # Device state serialization\n└── validation/\n    └── ...                     # Environment validators\n```\n\n## Device Types\n\n| Type | Config Value | Platform | Description |\n|------|--------------|----------|-------------|\n| iOS Simulator | `ios.simulator` | iOS | Xcode simulators |\n| Android Emulator | `android.emulator` | Android | AVD emulators |\n| Android Attached | `android.attached` | Android | USB-connected devices |\n| Genycloud | `android.genycloud` | Android | Genymotion cloud instances |\n\n## Allocation System\n\n### DeviceAllocator (`src/devices/allocation/DeviceAllocator.js`)\n\nCoordinates device allocation with concurrency control:\n\n```javascript\nclass DeviceAllocator {\n  constructor(allocationDriver, deviceRegistry) {\n    this._driver = allocationDriver;\n    this._registry = deviceRegistry;\n  }\n\n  async allocate(deviceConfig) {\n    // Find or create a device matching the config\n    // Register ownership in the registry\n    // Return a device cookie\n  }\n\n  async postAllocate(deviceCookie, configs) {\n    // Platform-specific device setup after allocation\n    // e.g., boot simulator, disable animations, unlock screen\n    // Returns an enriched device cookie\n  }\n\n  async free(deviceCookie) {\n    // Release the device\n    // Remove from registry\n  }\n}\n```\n\n### DeviceRegistry (`src/devices/allocation/DeviceRegistry.js`)\n\nUses lock files for cross-process device ownership:\n\n```javascript\nclass DeviceRegistry {\n  constructor({ lockfilePath }) {\n    this._lockfile = new ExclusiveLockfile(lockfilePath);\n  }\n\n  async allocateDevice(deviceQuery) {\n    return this._lockfile.exclusively(async () => {\n      // Find available device\n      // Mark as allocated\n      // Return device handle\n    });\n  }\n}\n```\n\n### Allocation Drivers\n\nEach device type has a specialized allocation driver:\n\n**SimulatorAllocDriver** (`src/devices/allocation/drivers/ios/SimulatorAllocDriver.js`):\n\n- Queries available simulators via `xcrun simctl`\n- Creates simulators if needed\n- Handles simulator lifecycle\n\n**EmulatorAllocDriver** (`src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js`):\n\n- Validates AVD existence\n- Launches emulators with appropriate flags\n- Assigns unique ports\n\n**GenyAllocDriver** (`src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js`):\n\n- Communicates with Genymotion cloud API\n- Provisions cloud instances\n- Handles instance lifecycle\n\n## Runtime Device\n\n### RuntimeDevice (`src/devices/runtime/RuntimeDevice.js`)\n\nThe main device abstraction exposed to tests:\n\n```javascript\nclass RuntimeDevice {\n  constructor(deviceCookie, deps, configs) {\n    this._driver = createDriver(deviceCookie, deps);\n    this._appsConfig = configs.appsConfig;\n  }\n\n  // App management\n  async launchApp(params) { /* ... */ }\n  async terminateApp(bundleId) { /* ... */ }\n  async installApp() { /* ... */ }\n  async uninstallApp() { /* ... */ }\n\n  // React Native specific\n  async reloadReactNative() { /* ... */ }\n\n  // Device control\n  async sendToHome() { /* ... */ }\n  async shake() { /* ... */ }\n  async setLocation(lat, lon) { /* ... */ }\n  async setURLBlacklist(urls) { /* ... */ }\n\n  // State\n  get id() { return this._driver.deviceId; }\n  get name() { return this._driver.deviceName; }\n}\n```\n\n### Driver Hierarchy\n\n```text\nDeviceDriverBase\n├── IosDriver\n│   └── SimulatorDriver\n└── AndroidDriver\n    ├── EmulatorDriver\n    ├── AttachedAndroidDriver\n    └── GenyCloudDriver\n```\n\n**DeviceDriverBase** (`src/devices/runtime/drivers/DeviceDriverBase.js`):\n\n- Abstract base class\n- Defines common interface\n- Provides utility methods\n\n**Platform Drivers**:\n\n- Implement platform-specific operations\n- Handle app installation/launch\n- Manage device state\n\n## Platform-Specific Tools\n\n### iOS Tools\n\n**AppleSimUtils** (`src/devices/common/drivers/ios/tools/AppleSimUtils.js`):\n\n```javascript\nclass AppleSimUtils {\n  async boot(deviceId) { /* xcrun simctl boot */ }\n  async shutdown(deviceId) { /* xcrun simctl shutdown */ }\n  async install(deviceId, path) { /* xcrun simctl install */ }\n  async launch(deviceId, bundleId, args) { /* xcrun simctl launch */ }\n  async setPermissions(deviceId, bundleId, permissions) { /* ... */ }\n}\n```\n\n### Android Tools\n\n**ADB** (`src/devices/common/drivers/android/exec/ADB.js`):\n\n```javascript\nclass ADB {\n  async devices() { /* adb devices */ }\n  async install(deviceId, apkPath) { /* adb install */ }\n  async shell(deviceId, command) { /* adb shell */ }\n  async forward(deviceId, local, remote) { /* adb forward */ }\n}\n```\n\n**Instrumentation** (`src/devices/common/drivers/android/tools/Instrumentation.js`):\n\n```javascript\nclass Instrumentation {\n  async launch(deviceId, bundleId, testRunner, args) {\n    // am instrument -w -r ...\n  }\n}\n```\n\n## Device Lifecycle\n\n### Allocation Flow\n\n```text\n1. Test starts\n   │\n   ▼\n2. DeviceAllocator.allocate(deviceConfig)\n   │\n   ├── Query available devices\n   │   └── SimulatorQuery / FreeDeviceFinder\n   │\n   ├── Acquire lock\n   │   └── DeviceRegistry.allocateDevice()\n   │\n   └── Return DeviceCookie\n\n3. DeviceAllocator.postAllocate(cookie, configs)\n   │\n   ├── Platform-specific device setup\n   │   ├── iOS: Boot simulator, clean app cache\n   │   └── Android: Wait for boot, disable animations,\n   │       unlock screen, configure System UI\n   │\n   └── Return enriched DeviceCookie\n\n4. RuntimeDevice created with cookie\n   │\n   ▼\n5. Tests execute\n   │\n   ▼\n6. DeviceAllocator.free(cookie)\n   │\n   ├── Shutdown (if configured)\n   │\n   └── Release lock\n```\n\n### App Launch Flow\n\n```text\n1. device.launchApp(params)\n   │\n   ├── Terminate if running\n   │\n   ├── Build launch args\n   │   ├── Detox server URL\n   │   ├── Session ID\n   │   └── User-provided args\n   │\n   ├── Platform-specific launch\n   │   ├── iOS: xcrun simctl launch\n   │   └── Android: am instrument\n   │\n   └── Wait for app connection\n       └── client.waitUntilReady()\n```\n\n## Device Cookie\n\nDevice cookies serialize device state for passing between processes:\n\n```javascript\n// src/devices/cookies/index.js\nconst DeviceCookie = {\n  serialize(device) {\n    return {\n      id: device.id,\n      type: device.type,\n      // Platform-specific data\n    };\n  },\n\n  deserialize(cookie) {\n    // Reconstruct device handle\n  }\n};\n```\n\n## Environment Validation\n\nValidators ensure the environment is properly configured:\n\n```javascript\n// iOS validator\nclass IosSimulatorEnvValidator {\n  async validate() {\n    // Check Xcode installation\n    // Verify xcrun availability\n    // Validate simulator runtime\n  }\n}\n\n// Android validator\nclass AndroidEmulatorEnvValidator {\n  async validate() {\n    // Check ANDROID_HOME\n    // Verify ADB installation\n    // Validate emulator availability\n  }\n}\n```\n\n## Event Emission\n\nRuntimeDevice emits lifecycle events for artifact collection:\n\n```javascript\nclass RuntimeDevice {\n  async launchApp(params) {\n    await this._eventEmitter.emit('beforeLaunchApp', launchInfo);\n\n    // ... launch logic ...\n\n    await this._eventEmitter.emit('launchApp', launchInfo);\n    await this._eventEmitter.emit('appReady', appInfo);\n  }\n\n  async uninstallApp() {\n    await this._eventEmitter.emit('beforeUninstallApp', appInfo);\n    // ... uninstall logic ...\n  }\n\n  async terminateApp() {\n    await this._eventEmitter.emit('beforeTerminateApp', appInfo);\n    // ... terminate logic ...\n    await this._eventEmitter.emit('terminateApp', appInfo);\n  }\n}\n```\n\n## Configuration\n\nDevice configuration in `.detoxrc.js`:\n\n```javascript\nmodule.exports = {\n  devices: {\n    simulator: {\n      type: 'ios.simulator',\n      device: {\n        type: 'iPhone 15 Pro',\n      },\n    },\n    emulator: {\n      type: 'android.emulator',\n      device: {\n        avdName: 'Pixel_4_API_30',\n      },\n    },\n    genycloud: {\n      type: 'android.genycloud',\n      device: {\n        recipeUUID: '...',\n      },\n    },\n  },\n};\n```\n\n## See Also\n\n- [ARCHITECTURE.md](../../ARCHITECTURE.md) - Main architecture overview\n- [docs/config/devices.mdx](../config/devices.mdx) - Device configuration reference\n- [docs/guide/android-dev-env.md](../guide/android-dev-env.md) - Android setup guide\n"
  },
  {
    "path": "docs/articles/design-principles.md",
    "content": "# Design Principles\n\nTraditionally, end-to-end tests on mobile are riddled with inherent issues, making the testing process difficult and lowering ROI for developers. We believe that the only way to solve these issues at the core is by changing some of the basic principles of our approach.\n\n- **Detox does not rely on [WebDriver](https://www.selenium.dev/documentation/webdriver)** — Detox is built from the ground up to integrate with native layers of your mobile app directly. We try to avoid generic cross-platform interfaces that are often the lowest common denominator. We want to optimize per platform\n\n- **Detox does gray box, not black box** — Theoretically, it sounds better to test exactly what you ship as a black box. In practice, switching to gray box allows the test framework to monitor the app from the inside and delivers critical wins like fighting flakiness at the core\n\n- **Detox synchronizes with your app’s activity** — By being aware of what your app is doing and synchronizing with it, Detox times its actions, by default, to run only when your app is idle, meaning it has determined that your app has finished its work, such as animations, network requests, React Native load, etc. You can further read on this [here](../troubleshooting/synchronization.md)\n\n- **Built from the ground up for mobile apps, has first-class React Native support** — Detox is built from the ground up for native mobile and has a first-class support for React Native apps\n\n- **Expectations run on the app, not the tester process** — Traditionally, test frameworks evaluate expectations in the test script, running on Node.js. Detox evaluates expectations directly in the tested app, running on device; this enables operations that were impossible before due to performance reasons\n"
  },
  {
    "path": "docs/articles/how-detox-works.md",
    "content": "# How Detox Works\n\nDetox is an end-to-end testing framework. This means it runs your app on an actual device, or a device simulator/emulator and interacts with it just like a real user would. This type of testing can give a lot of confidence in your app and help automate an otherwise tedious manual QA process.\n\nWhen a Detox test executes, you actually have two different parts running side by side:\n\n1. **The mobile app itself**, running on a device or a device simulator/emulator. A regular native-build of your app is installed and executed on the device, orchestrated by native Detox code that is built separately and installed alongside the app itself.\n\n2. **The test suite**, running on Node.js, over a test runner like Jest. The tests are normally written in JavaScript, and utilize the JavaScript part of Detox.\n\nThe two parts are run in separate processes on your machine. It is also possible to run the two parts on different machines. Communication between the two parts takes place over the network using a web socket.\n\nIn practice, to make the communication more resilient, both parts are implemented as clients and communicate through a Detox server that acts as mediator. Having that server allows for some advantages like allowing one side to disconnect (during a simulator boot for example or app restart) without disconnecting the other side and losing its state.\n\n## Automatic App-State Synchronization\n\nOne of Detox's key features is the automatic synchronization of test execution with the app's state. For example, consider the following super-common moment in a test scenario:\n\n1. Node.js runs test code that effectively tells Detox to tap on the *login* button. Detox sends this tap command to the app.\n2. The app receives the command, the button is pressed, and the login process begins. A secure user session is obtained from the server, and the app navigates to the home screen. The home screen fetches yet even more data from the servers and renders elements with loading animations.\n3. **Detox - being a gray-box testing framework, monitors these changes in the app's state and waits for them to complete. This ensures that the test and the app's current state remain in-sync.**\n4. Detox proceeds to the next action in the test code only after the app is stable (!)\n\nLet’s deep-dive into step #2: So much UI work happens with numerous network requests performed in the background… What is the order of execution of those requests, and how long should you wait until all of them are replied to? How long should you wait until the UI is ready? For the network, it depends on which request completes first, which in turn depends on network congestion and how busy the server is. As for the UI, it depends on the specific test device / machine specs and how busy its processor is.\n\nIn the traditional black-box (rather than gray-box) testing approach, you normally deal with being blind to the app’s state by adding various `sleep()` / `waitFor()` commands throughout the test in an attempt to force order into the chaos. In step #3, **Detox eliminates the need for that malpractice, and so introduces stability into the otherwise inherently-flaky test world.**\n\n### Operations Detox synchronizes with automatically\n\n- **Network requests** - Detox monitors in-flight requests over the network (waiting for them to be responded).\n\n- **Main thread (native)** - Detox monitors pending native operations on the app's main thread (main dispatch queue and main `NSOperationQueue`).\n\n- **Layout of UI** - Detox monitors UI layout operations. There’s also special support for React Native layout which includes the Shadow Queue where [yoga](https://github.com/facebook/yoga) runs.\n\n- **Timers** - Detox monitors timers (explicit asynchronous delays). There’s special support for JavaScript's `setTimeout`, which is monitored.\n\n- **Animations** - Detox monitors active animations and transitions. There’s special support for React Native animations with the Animated library, and even the popular [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated).\n\n- **React Native JavaScript thread** - Detox monitors pending operations on the JavaScript thread in RN apps.\n\n- **React Native native-modules thread** - Detox monitors pending RN native-module actions executed on its dedicated thread.\n\n- **React Native bridge** - In non-bridge-less apps (i.e. before RN's new-architecture), Detox monitors the React Native bridge and asynchronous messages delivered through it.\n\n:::info\n\nIn this synchronization process, [`session.debugSynchronization`](../config/session.mdx#sessiondebugsynchronization-number) plays a significant role. This setting, enabled by default, keeps an eye on tasks that are keeping the app busy and logs the details if these actions take longer than the specified value to complete.\n\n:::\n\n## Architecture\n\nDetox comprises the following components:\n\n- [**Tester**](https://github.com/wix/Detox/tree/master/detox/src): The testing component, running in a Node.js process on the host computer, executing the test logic. The tester is also responsible for device management and artifact collection.\n- **Detox native client ([iOS](https://github.com/wix/Detox/tree/master/detox/ios) & [Android](https://github.com/wix/Detox/tree/master/detox/android)):** A component that gets seamlessly integrated into the tested app on the tested device, right as Detox starts executing. It synchronizes with the app, matches user queries, executes user commands (e.g. taps, scrolls) and validates expectations.\n- **[Detox mediator server](https://github.com/wix/Detox/tree/master/detox/src/server)**: A small web socket server, running in a Node.js process on the host computer, used to connect between the tester and the client. Normally, the tester starts a server on a randomized session id and an available port, and sends the session and port to the client app as a launch argument.\n"
  },
  {
    "path": "docs/articles/third-party-drivers.md",
    "content": "# Third-Party Drivers\n\nDetox comes with built-in support for running on Android and iOS by choosing a driver type in your Detox configurations.\nFor example, the following configuration uses the \"ios.simulator\" driver.\n\n```json\n{\n  \"ios.sim\": {\n    \"type\": \"ios.simulator\",\n    \"device\": \"...\",\n    \"app\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"bin/YourApp.app\"\n    }\n  }\n}\n```\n\nWhile Detox technically supports Android devices and iOS simulators out of the box, devices running other platforms such as [Web](https://github.com/necolas/react-native-web) or [Windows](https://github.com/microsoft/react-native-windows) can be targeted.\n\nIf your app targets a third-party platform, you may switch to use a [third-party driver](#how-to-use-a-third-party-driver) to run your tests on said platform. If one doesn’t already exist, you can [write your own](#Writing-a-new-third-party-driver).\n\n## How to Use a Third-party Driver\n\nCheck to see if a [third-party driver](#existing-third-party-drivers) already exists for the platform you wish to target. Mostly likely, the driver will have setup instructions.\n\nOverall the setup for any third party driver is fairly simple.\n\n1. Add the driver to your `package.json` with:\n\n   ```bash npm2yarn\n   npm install --save-dev detox-driver-package\n   ```\n\n1. Add a new Detox configuration to your existing configurations with the `type` set to driver’s package name.\n\n   ```diff\n   +  \"thirdparty.driver.config\": {\n   +    \"type\": \"detox-driver-package\",\n   +    \"app\": {\n   +      \"binaryPath\": \"bin/YourApp.app\",\n   +    }\n   +  }\n   ```\n\n1. Run Detox while specifying the name of your new configuration:\n\n   ```bash\n   detox test --configuration thirdparty.driver.config\n   ```\n\n## Writing a New Third-party Driver\n\n### Anatomy of the Drivers\n\nThe architecture of a driver is split into a few different pieces; Understanding the [overall architecture of Detox](how-detox-works.md#Architecture) will help with this section.\n\n_Components running in the context of the test logic execution on the Node.js process on the host computer:_\n\n1. **The Device Drivers layer:** The layer contains a collection of drivers, implementing - mostly, though not exclusively, the platform-specific details for the Detox [`device` object](../api/device.md) that is exposed in the Detox tests.\n   The implementation is responsible for managing devices your tests will run on, in terms of device allocation, app installation user interactions (e.g. taps) execution and so on.\n1. **Matchers:** code powering the `expect`, `element`, `waitFor` and `by` globals in your tests.\n   In essence, it translates and sends test-logic commands (such as taps and assertions) over the network to the device on which your tests are running. In turn, the device natively performs these commands.\n\n_The component running on the device being tested, injected into the test app:_\n\n1. **Native Client:** The driver client communicates with the server over\n   websocket where it receives information from the serialized matchers, and expectations, and also sends responses\n   back of whether each step of your test succeeds or fails. Typically, a device client will use an underlying library specific\n   to the platform at hand to implement the expectations.\n\n### Implementation Details\n\nIn order to introduce a third-party Driver, there is a set of core classes you must implement - each responsible for a different Detox concern:\n\n- Allocation: The process of launching / selecting a device over which the tests would run.\n- Pre-validation: The checkup of the execution-environment (e.g. verifying the Android SDK is installed).\n- Artifact handlers registration: The process where platform-based artifacts generation handlers are registered (e.g. handlers for taking screenshots, which are different between the Android and iOS platforms).\n- Runtime: The _de facto_ execution of test logic.\n- Matchers: The matching of visible elements and visibility assertion.\n\nTo understand the exact contract of these classes, refer to [`examples/demo-plugin/driver.js`](https://github.com/wix/Detox/blob/master/examples/demo-plugin/driver.js) for a dummy implementation, or to [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer) for an actual implementation of such as driver.\n\nVery roughly speaking, this is the expected skeletal implementation:\n\n```js\nconst DeviceDriverBase = require('detox/src/devices/runtime/drivers/DeviceDriverBase');\n\nclass Cookie {\n  constructor(id) {\n    this.id = id; // hold any info necessary in order to identify the associated device\n  }\n}\n\nclass MyNewAllocationDriver {\n  constructor(deps) {\n    this.emitter = deps.eventEmitter;\n  }\n\n  async allocate(deviceConfig) {\n    // ...\n    return new Cookie(id); // This is where a cookie is formed once for the entire process\n  }\n\n  async postAllocate(cookie) {\n    // Optional method to handle operations after the device is allocated\n    // like waiting until the boot animation is finished, configuring the device, etc.\n  }\n\n  async free(cookie, options) {\n    // ...\n  }\n}\n\nclass MyNewEnvValidator {\n  validate() {\n    // ...\n  }\n}\n\nclass MyNewArtifactsProvider {\n  declareArtifactPlugins() {\n    // ...\n  }\n}\n\nclass MyNewRuntimeDriver extends DeviceDriverBase {\n  constructor(deps, cookie) {\n    // ...\n  }\n\n  // ...\n}\n\nclass MyExpect {\n  // ...\n}\n\n\nmodule.exports = MyNewDriver;\n```\n\n## Existing Third-party Drivers\n\n- [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer)\n"
  },
  {
    "path": "docs/cli/build-framework-cache.md",
    "content": "# detox build-framework-cache\n\n```bash\ndetox build-framework-cache\n```\n\n**MacOS only.**\nBuilds cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively build components. By default, both components are built.\n\n## Options\n\n- `--detox` - Builds **only** the Detox injected framework. Default is false (build both).\n- `--xcuitest` - Builds **only** the XCUITest runner. Default is false (build both).\n\nDetox stores a cached version of its framework and XCUITest-runner in `~/Library/Detox/ios/*` in unique folders, where the folder name\nis a hash of Xcode and Detox version combination. This cache is used to speed up the build process and avoid unnecessary recompilations.\n\nHere is an example of the cache structure:\n\n```plain text\n├── ios\n│  ├── framework\n│  │   ├── 197a0586bd006583562a5916c969d158133a8c50\n│  │   ├── …\n│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f\n│  ├── xcuitest-runner\n|  │   ├── 197a0586bd006583562a5916c969d158133a8c50\n│  │   ├── …\n│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f\n│…\n```\n"
  },
  {
    "path": "docs/cli/build.md",
    "content": "# detox build\n\n`detox build [options]`\n\nRuns the [`build` command](../config/apps.mdx#properties) of the app (or apps)\nfrom the specified [configuration](../config/overview.mdx#config-structure).\n\n| Option                                | Description                                                                                                                                   |\n| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| -c, --configuration `<device config>` | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it |\n| -C, --config-path `<configPath>`      | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                         |\n| -i, --if-missing                      | Execute the build command only if the app binary is missing.                                                                                  |\n| -s, --silent                          | Do not fail with error if an app config has no build command.                                                                                 |\n| --help                                | Show help                                                                                                                                     |\n\n## Examples\n\nIf you have only one configuration, you can simply use:\n\n```bash\ndetox build\n```\n\nTo choose a specific configuration:\n\n```bash\ndetox build --configuration yourConfiguration\n```\n\nTo skip building an app if it already is built:\n\n```bash\ndetox build --configuration yourConfiguration --if-missing\n```\n"
  },
  {
    "path": "docs/cli/clean-framework-cache.md",
    "content": "# detox clean-framework-cache\n\n```bash\ndetox clean-framework-cache\n```\n\n**MacOS only.**\nCleans cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively remove components. By default, both components are cleaned.\n\n## Options\n\n- `--detox` - Cleans **only** the Detox injected framework. Default is false (clean both).\n- `--xcuitest` - Cleans **only** the XCUITest runner. Default is false (clean both).\n\nSee also: [`detox build-framework-cache`](build-framework-cache.md)\n"
  },
  {
    "path": "docs/cli/init.md",
    "content": "# detox init\n\n```bash\ndetox init\n```\n\nCreates a few template files in the current project directory to [get you started with Detox](../introduction/project-setup.mdx):\n\n- `.detoxrc.js` – [Detox config](../config/overview.mdx);\n- `e2e/jest.config.js` – [Jest config](../config/testRunner.mdx#jest-config);\n- `e2e/starter.test.js` – a simple test suite.\n"
  },
  {
    "path": "docs/cli/overview.md",
    "content": "# detox\n\nDetox CLI lets you operate Detox from command line.\n\n## Installation\n\nInstall `detox-cli` globally via [npm](http://npmjs.org/detox-cli):\n\n```bash\nnpm install detox-cli --global\n```\n\n## Usage\n\n```bash\ndetox <command> [options]\n```\n\n## Commands\n\n| Command                   | Description                                                                                                                                                                       |\n| ------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [init]                    | Create initial E2E tests folder for Detox.                                                                                                                                        |\n| [build]                   | Run the command defined in 'build' property of the specified configuration.                                                                                                       |\n| [test]                    | Initiating your test suite.                                                                                                                                                       |\n| [recorder]                | Starts a [Detox Recorder](https://github.com/wix/DetoxRecorder) recording.                                                                                                        |\n| [build-framework-cache]   | **MacOS only.** Builds or rebuilds a cached Detox framework and/or XCUITest-runner in ~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions.    |\n| [clean-framework-cache]   | **MacOS only.** Deletes all compiled framework and XCUITest-runner binaries from \\~/Library/Detox, they will be rebuilt on 'npm install' or when running 'build-framework-cache'. |\n| [rebuild-framework-cache] | **MacOS only.** Cleans and builds a cached Detox framework and XCUITest-runner in \\~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions.       |\n| [reset-lock-file]         | Resets Detox lock file completely - all devices are marked as available after that.                                                                                               |\n| [run-server]              | Starts a standalone Detox server.                                                                                                                                                 |\n\n## Options\n\n| Options   | Description         |\n| --------- | ------------------- |\n| --version | Show version number |\n| --help    | Show help           |\n\n[init]: init.md\n\n[build]: build.md\n\n[test]: test.md\n\n[recorder]: recorder.md\n\n[build-framework-cache]: build-framework-cache.md\n\n[clean-framework-cache]: clean-framework-cache.md\n\n[rebuild-framework-cache]: rebuild-framework-cache.md\n\n[reset-lock-file]: reset-lock-file.md\n\n[run-server]: run-server.md\n"
  },
  {
    "path": "docs/cli/rebuild-framework-cache.md",
    "content": "# detox rebuild-framework-cache\n\n```bash\ndetox rebuild-framework-cache\n```\n\n**MacOS only.**\nRebuilds cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively rebuild components. By default, both components are rebuilt.\n\n## Options\n\n- `--detox` - Rebuilds **only** the Detox injected framework. Default is false (rebuild both).\n- `--xcuitest` - Rebuilds **only** the XCUITest runner. Default is false (rebuild both).\n\nSee also: [`detox build-framework-cache`](build-framework-cache.md)\n"
  },
  {
    "path": "docs/cli/recorder.md",
    "content": "# detox recorder\n\n:::danger Warning\n\nDetox Recorder tool is deprecated due to shortage of human resources in Detox team.\n\n:::\n\nIf you have installed [Detox Recorder](https://github.com/wix/DetoxRecorder) in your project,\nyou can use this command to start a new recording.\n"
  },
  {
    "path": "docs/cli/reset-lock-file.md",
    "content": "# detox reset-lock-file\n\n```bash\ndetox reset-lock-file\n```\n\nResets Detox lock file. The lock file contains information about busy and free devices, and this way we can ensure no device can be used simultaneously by multiple Detox test sessions.\n\nBy default, [`detox test`](test.md) command cleans the lock file on start,\nbut it targets only the devices assigned to dead and non-existent processes.\nThis command, on contrary, cleans the lock file completely.\n"
  },
  {
    "path": "docs/cli/run-server.md",
    "content": "# detox run-server\n\n:::note\n\nThis tool is useful mostly for contributing to the native codebase of Detox, not for the outside use.\n\n:::\n\nStarts a standalone Detox server.\n\n```bash\ndetox run-server [options]\n```\n\n| Option                  | Description                                         |\n| ----------------------- | --------------------------------------------------- |\n| -p, --port \\[port]      | Port number (default: 8099)                         |\n| -l, --loglevel \\[value] | Log level: fatal, error, warn, info, verbose, trace |\n| --no-color              | Disable colorful logs                               |\n| --help                  | Show help                                           |\n"
  },
  {
    "path": "docs/cli/start.md",
    "content": "# detox start\n\n`detox start [options]`\n\nRuns the [`start` command](../config/apps.mdx#properties) of the app (or apps)\nfrom the specified [configuration](../config/overview.mdx#config-structure).\n\n| Option                                | Description                                                                                                                                                                              |\n| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| -C, --config-path `<configPath>`      | Specify Detox config file path. If not supplied, Detox searches for .detoxrc\\[.js] or \"detox\" section in package.json.                                                                   |\n| -c, --configuration `<device config>` | Select a local configuration from your defined configurations to extract the app \"start\" scripts from it. If not supplied, and there’s only one configuration, Detox will default to it. |\n| -f, --force                           | Ignore errors from the \"start\" scripts and continue.                                                                                                                                     |\n| --help                                | Show help                                                                                                                                                                                |\n\n## Examples\n\nIf you have only one configuration, you can simply use:\n\n```bash\ndetox start\n```\n\nTo choose a specific configuration:\n\n```bash\n# long alias:\ndetox start --configuration yourConfiguration\n# short alias:\ndetox start -c yourConfiguration\n```\n\nTo forward extra arguments to the \"start\" script, e.g.:\n\n```bash\ndetox start -c yourConfiguration -- --port 8082\n```\n\nTo ignore errors from the \"start\" scripts and continue:\n\n```bash\ndetox start -c yourConfiguration --force\n```\n"
  },
  {
    "path": "docs/cli/test.md",
    "content": "# detox test\n\n```bash\ndetox test [options] <...testFilePaths>\n```\n\nFor the most part, `detox test` is a convenience method which converts CLI arguments to environment variables and\nruns a third-party test runner one or multiple times (if `--retries` configured). All unknown flags are just\nforwarded as-is to the test runner underneath, e.g.:\n\n```plain text\ndetox test -c ios.debug --showConfig\n```\n\ngets translated to:\n\n```plain text\nDETOX_CONFIGURATION=ios.debug jest --showConfig\n```\n\nYou can freely take the CLI command it prints and run it independently, without the help of Detox CLI.\n\nIf there is a name conflict for some option (both the test runner and `detox test` have a CLI argument with the same\nname), you can pass it explicitly after the reserved `--` sequence:\n\n```plain text\ndetox test -c ios.debug -- --help\n↓\nDETOX_CONFIGURATION=ios.debug jest --help\n```\n\n## Options\n\n| Option                                        | Description                                                                                                                                                                                                                                                                                             |\n| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| -C, --config-path `<configPath>`              | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                                                                                                                                                                                   |\n| -c, --configuration `<device config>`         | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it                                                                                                                                                           |\n| -n, --device-name \\[name]                     | Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.                                                                                                                                                                             |\n| -l, --loglevel \\[value]                       | Log level: fatal, error, warn, info, verbose, trace                                                                                                                                                                                                                                                     |\n| -d, --debug-synchronization `<value>`         | Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.                                                                                            |\n| -a, --artifacts-location `<path>`             | Artifacts (logs, screenshots, etc) root directory.[^1]                                                                                                                                                                                                                                                  |\n| --record-logs \\[failing/all/none]             | Save logs during each test to artifacts directory. Pass \"failing\" to save logs of failing tests only. The default value is **none**.                                                                                                                                                                    |\n| --take-screenshots \\[manual/failing/all/none] | Save screenshots before and after each test to artifacts directory. Pass \"failing\" to save screenshots of failing tests only. The default value is **manual**.                                                                                                                                          |\n| --record-videos \\[failing/all/none]           | Save screen recordings of each test to artifacts directory. Pass \"failing\" to save recordings of failing tests only. The default value is **none**.                                                                                                                                                     |\n| --record-performance \\[all/none]              | \\[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory. The default value is **none**.                                                                                                                                                                           |\n| --capture-view-hierarchy \\[enabled/disabled]  | \\[iOS Only] Capture `*.uihierarchy` snapshots on view action errors and `device.captureViewHierarchy()` calls. The default value is **disabled**.                                                                                                                                                       |\n| -R, --retries                                 | Re-spawn the test runner for individual failing suite files until they pass, or `<N>` times at most.                                                                                                                                                                                                    |\n| -r, --reuse                                   | Reuse existing installed app (do not delete + reinstall) for a faster run.                                                                                                                                                                                                                              |\n| -u, --cleanup                                 | Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue                                                                                                                                                                                          |\n| --jest-report-specs                           | \\[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.                                                                                                                                                                                    |\n| -H, --headless                                | Launch device in headless mode. Useful when running on CI.                                                                                                                                                                                                                                              |\n| --device-boot-args                            | A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox.<br />**Note: the value must be specified after an equal sign (`=`) and inside quotes.** Usage example:<br />`--device-boot-args=\"-http-proxy http://1.1.1.1:8000 -no-snapshot-load\"` |\n| --app-launch-args                             | Custom arguments to pass (through) onto the app every time it is launched. The same **note** applies here, as for **--device-boot-args**.<br />See [launch arguments guide](../guide/launch-args.md) for complete info.                                                                                 |\n| --start                                       | Control execution of \"start\" commands in the app configs. By default, they run right before the test runner. Pass `--start=force` to ignore the errors coming from the \"start\" commands, and run the test runner anyway. Pass `--no-start` to skip the \"start\" commands altogether.                     |\n| --no-color                                    | Disable colors in log output                                                                                                                                                                                                                                                                            |\n| --use-custom-logger                           | Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test runner’s implementation (e.g. Jest).<br />_Default: true_                                                                                                              |\n| --gpu                                         | \\[Android Only] Launch Emulator with the specific -gpu \\[gpu mode] parameter.                                                                                                                                                                                                                           |\n| --force-adb-install                           | \\[Android Only] Due to problems with the `adb install` command on Android, Detox resorts to a different scheme for installing APKs. Setting true will disable that and force usage of `adb install`, instead.<br/>This flag is temporary until the Detox way proves stable.<br/>_Default: false_        |\n| --inspect-brk                                 | Uses [node’s --inspect-brk](https://nodejs.org/en/docs/guides/debugging-getting-started/#enable-inspector) flag to let users debug the test runner <br />_Default: false_                                                                                                                               |\n| --repl                                        | Launch REPL (Read-Eval-Print Loop) mode for interactive debugging. Use `--repl=auto` to enter REPL mode automatically on test failures. <br />_Default: false_                                                                                                                               |\n| --help                                        | Show help                                                                                                                                                                                                               |                                                                                |\n\n## `DETOX_ARGV_OVERRIDE`\n\nIf you happen to be troubleshooting Detox tests inside a complex script, or a failing CI build\n(e.g., on TeamCity or Jenkins), there is an escape-hatch feature for running Detox with\nsome extra CLI args just by setting the `DETOX_ARGV_OVERRIDE` environment variable before\nrerunning it again.\n\n```plain text\n> export DETOX_ARGV_OVERRIDE=\"--forceExit -w 1 --testNamePattern='that hanging test' e2e/sanity/login.test.js\"\n> bash scripts/ci.e2e.sh\n  # ... some output ...\n  > detox test -c ios.sim.release -l verbose --maxWorkers 3\n    # ...\n    configuration=ios.sim.release ... jest --maxWorkers 1 --forceExit --testNamePattern='that hanging test' e2e/sanity/login.test.js\n```\n\nConsider the example above, where `DETOX_ARGV_OVERRIDE` forces Detox to run Jest in a single worker\nmode with a forceful exit (after 1 second) only for a selected test in a specific file.\n\nAs you might see, the idea of `DETOX_ARGV_OVERRIDE` is quite similar to [NODE\\_OPTIONS](https://nodejs.org/api/cli.html#cli_node_options_options)\nexcept for the fact you use it not for regular flows, but for forced ad-hoc patching of a failing Detox configuration to\nsave your time.\n\nPlease avoid using it in your regular flows – instead, use Detox configuration files (`.detoxrc.js`)\nas your primary choice.\n\n[^1]: If `--artifacts-location` path does not end with a slash (`/`) or a backslash, then detox CLI will append to the\n    path a subdirectory with configuration name and timestamp (e.g. `artifacts/android.emu.release.2018-06-12 05:52:43Z`).\n    In other words, the path with a slash at the end assumes you do not want a subdirectory inside.\n    For more details, please check the [Enabling artifacts](../config/artifacts.mdx#artifacts).\n    The default value is **artifacts** (plus a subdirectory).\n"
  },
  {
    "path": "docs/config/apps.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport Location from './partials/_location-dictionaries.mdx';\n\n# Apps\n\nThe format of Detox config allows you to define inside it multiple app configs in a key-value manner, i.e.:\n\n## Location\n\n<Location sectionName=\"apps\" propertyName=\"app\" />\n\n## Examples\n\n<Tabs groupId=\"mobileOS\">\n  <TabItem value=\"ios.app\" label=\"ios.app\" default>\n\n```json\n{\n  \"type\": \"ios.app\",\n  \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/example.app\",\n  \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build\"\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.apk\" label=\"android.apk\">\n\n```json\n{\n  \"type\": \"android.apk\",\n  \"binaryPath\": \"path/to/myApp.apk\",\n  \"build\": \"cd android && ./gradlew …\"\n}\n```\n\n  </TabItem>\n</Tabs>\n\n## Properties\n\nAn app config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                                                                                                     |\n| -------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `type`               | Mandatory property to discern app types: `ios.app`, `android.apk`.                                                                                                                                                                                                                          |\n| `name`               | Use only when working with multiple apps within the same configuration. See an example below.                                                                                                                                                                                               |\n| `binaryPath`         | Relative path to the ipa/app/apk due to be tested (make sure you build the app in a project relative path)                                                                                                                                                                                  |\n| `build`              | **\\[optional]** Build command, which can be called using [`detox build`] CLI as a convenience.                                                                                                                                                                                              |\n| `start`              | **\\[optional]** Start command, which will be called before [`detox test`] CLI starts, or explicitly via [`detox start`] command.                                                                                                                                                            |\n| `testBinaryPath`     | (optional, Android only): relative path to the test app (apk)                                                                                                                                                                                                                               |\n| `launchArgs`         | **\\[optional]** An object specifying arguments (key-values pairs) to pass through into the app, upon launching on the device. For more info, refer to the dedicated [launch-arguments guide](../guide/launch-args.md).                                                                      |\n| `reversePorts`       | **(optional, Android only)** An array of TCP ports to reverse, so that the network requests to `localhost:{port}` on Android device are going to be forwarded to the host machine.                                                                                                          |\n\n## Multiple apps\n\nTo work with multiple apps within the same configuration you should be giving each app its name, e.g.:\n\n```js\n{\n  \"apps\": {\n    \"driver.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"driver\",\n      \"binaryPath\": \"path/to/driver.app\"\n    },\n    \"passenger.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"passenger\",\n      \"binaryPath\": \"path/to/passenger.app\"\n    }\n  },\n  \"configurations\": {\n    \"ios.release\": {\n      \"device\": \"simulator\",\n      \"apps\": [\"driver\", \"passenger\"],\n      \"build\": \"scripts/build-both-apps.sh\",\n      \"start\": \"scripts/start-both-apps.sh\"\n    }\n  }\n}\n```\n\nAfter that, you can change the current app in your tests via [device API](../api/device.md):\n\n```js\nawait device.selectApp('driver');\nawait device.launchApp();\n// ... run tests ...\nawait device.selectApp('passenger');\nawait device.launchApp();\n// ... run tests ...\n```\n\nAs shown in the example above, you can override app build and start commands with a single, configuration-scoped one.\nThis may be useful when you have smart scripts for building and starting multiple apps at once.\n\n[`detox build`]: ../cli/build.md\n[`detox start`]: ../cli/start.md\n[`detox test`]: ../cli/test.md\n"
  },
  {
    "path": "docs/config/artifacts.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Artifacts\n\n:::info\n\nThis article is incomplete. We're looking forward to improve this article as soon as we have an opportunity to do so.\n\n:::\n\nDetox can store artifacts such as transient screenshots and device logs.\n\n## Location\n\n<Location sectionName=\"artifacts\" />\n\n## Example\n\nYou can control artifacts collection via Detox configuration:\n\n```js\n{\n  \"artifacts\": {\n    \"rootDir\": \".artifacts\",\n    \"pathBuilder\": \"./config/pathbuilder.js\",\n    \"plugins\": {\n      \"instruments\": {\"enabled\": false},\n      \"log\": {\"enabled\": true},\n      \"uiHierarchy\": \"enabled\",\n      \"screenshot\": {\n        \"shouldTakeAutomaticSnapshots\": true,\n        \"keepOnlyFailedTestsArtifacts\": true,\n        \"takeWhen\": {\n          \"testStart\": false,\n          \"testDone\": true\n        }\n      },\n      \"video\": {\n        \"android\": {\n          \"bitRate\": 4000000\n        },\n        \"simulator\": {\n          \"codec\": \"hevc\"\n        }\n      }\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      // ...\n      \"artifacts\": {\n        \"rootDir\": \".artifacts/ios\",\n        \"plugins\": {\n          \"instruments\": \"all\"\n        }\n      }\n    }\n  }\n}\n```\n\nAs can be seen from the example above, in a specific configuration you may override individual properties from the default artifacts\nconfiguration. For instance, in the example above you can see that specifically in `ios.sim.release` we turn on `instruments` plugin.\n\nCLI arguments (e.g., `--artifacts-location`, `--record-logs`) still have the highest priority and override their counterparts from JSON.\n\nAlso, that example demonstrates that you can use strings (identical to the ones from CLI) in parallel to the object configurations for plugins.\nBelow you can see mappings between the string presets and the corresponding objects:\n\n| preset  | object                                                       |\n| ------- | ------------------------------------------------------------ |\n| none    | `{ \"enabled\": false }`                                       |\n| all     | `{ \"enabled\": true }`                                        |\n| failing | `{ \"enabled\": true, \"keepOnlyFailedTestsArtifacts\": true }`  |\n| manual  | `{ \"enabled\": true, \"shouldTakeAutomaticSnapshots\": false }` |\n\nThere is also a shortcut to disable artifacts for a specific configuration:\n\n```js\n{\n  \"configurations\": {\n    \"ios.no-artifacts\": {\n      // ...\n      \"artifacts\": false\n    }\n  }\n}\n```\n\nArtifacts are various recordings during tests including, but not limited to, device logs, device screenshots and screen recordings (videos).\n\n## Enabling Artifacts\n\nArtifacts are disabled by default. To enable them, specify via **launch arguments** or a **configuration** object what artifacts you want to record.\n\n### Launch Arguments\n\n- To record `.log` files, add `--record-logs all` (or `--record-logs failing`, if you want to keep logs only for failing tests).\n- To record `.mp4` test run videos, add `--record-videos all` (or `--record-videos failing`, if you want to keep video recordings only for failing tests).\n- To record `.dtxrec` (Detox Instruments recordings) for each test, add `--record-performance all`. To open those recordings, you’ll need [Detox Instruments](https://github.com/wix/DetoxInstruments). **NOTE:** only iOS is supported.\n- To capture `.uihierarchy` snapshots (**iOS only, Xcode 12.0+**) on view action failures, add `--capture-view-hierarchy enabled`.\n- To take `.png` screenshots before and after each test, add `--take-screenshots all` (or `--take-screenshots failing`, if you want to keep only screenshots of failing tests).\\\n  Alternatively, you might leverage the [device.takeScreenshot()](../api/device.md#devicetakescreenshotname) API for manual control.\n\n#### Artifacts root directory\n\n- To change artifacts root directory location (by default it is `./artifacts`), add `--artifacts-location <path>`.\\\n  **NOTE:** There is a slightly obscure convention. If you want to create automatically a subdirectory with timestamp and configuration name (to avoid file overwrites upon consequent reruns), specify a path to directory that does not end with a slash. Otherwise, if you want to put artifacts straight to the specified directory (in a case where you make a single run only, e.g. on CI), add a slash (or a backslash) to the end.\n\n```bash\ndetox test --artifacts-location /tmp/detox_artifacts  # will also append /android.emu.release.2018-06-14 08:54:11Z\ndetox test --artifacts-location /tmp/detox_artifacts/ # won’t append anything, hereby treating it as a root\n```\n\n### Configuration Object\n\nDetox artifacts can be configured in a more advanced way with the `artifacts` configuration in `package.json` (or `.detoxrc`):\n\n```json\n{\n  \"artifacts\": {},\n  \"configurations\": {\n    \"some.device\": {\n      \"artifacts\": {},\n    },\n  },\n}\n```\n\n**NOTE:** As you can see, there is a global and a local (per-configuration) configuration of the artifacts.\nDetox merges those configurations, and the per-device artifacts configuration has a higher priority over the general one.\n\nThe `artifacts` object has the following properties:\n\n| Property    | Example values                  | Default value | Description                                                                                                                                                          |\n| ----------- | ------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| rootDir     | `\".artifacts/\"`                 | `./artifacts` | A directory, where all the recorded artifacts will be placed in. Please note that there is a trailing slash convention [described above](#artifacts-root-directory). |\n| pathBuilder | `\"./e2e/config/pathbuilder.js\"` | `undefined`   | Path to a module that exports a custom `PathBuilder` [ᵃ](#path-builder)                                                                                              |\n| plugins     | `{ ... }`                       | ... see below | ... see below                                                                                                                                                        |\n\n#### Path builder\n\n**ᵃ** `PathBuilder` should be either an _object_ with a method `buildPathForTestArtifact` or a _class_ — see the corresponding interfaces below:\n\n```typescript\ninterface PathBuilder {\n    buildPathForTestArtifact(artifactPath: string, testSummary?: TestSummary): string;\n}\n\ninterface PathBuilderClass {\n    new(opts: { rootDir: string; }): PathBuilder;\n}\n```\n\nAs one can see, if a custom implementation of `PathBuilder` exports a class instead of an object, then the class constructor can also get and save `rootDir` location:\n\n```js\nclass MyPathBuilder {\n  constructor({ rootDir }) {\n    this._rootDir = rootDir;\n  }\n\n  buildPathForTestArtifact(artifactName, testSummary) {\n    /* ... use this._rootDir ... */\n  }\n}\n\nmodule.exports = MyPathBuilder;\n```\n\nIts main method, `buildPathForTestArtifact` should return a full path to the custom artifact location, when called with a suggested artifact name (e.g., `testDone.png`, `device.log`) and the current `TestSummary`, where `TestSummary` is:\n\n```typescript\ninterface TestSummary {\n    /**\n     * Name of the current test, e.g., for:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"should have a menu\".\n     */\n    title: string;\n    /**\n     * Full name of the current test, usually preceded by a suite name, e.g.:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"that screen should have a menu\".\n     */\n    fullName: string;\n    /**\n     * Status of the current test. Free-form strings are not allowed.\n     */\n    status: 'running' | 'passed' | 'failed';\n    /**\n     * Clarifies the reason for why the test has failed.\n     * Expected to coincide only with status: 'failed'.\n     */\n    timedOut?: boolean;\n    /**\n     * If the test runner is capable of retrying failed tests, then\n     * this property indicates for which time this test is running.\n     * When the property is undefined, its value is considered to be 1.\n     * */\n    invocations?: number;\n}\n```\n\nFor more technical details, search for `ArtifactPathBuilder.js` in Detox source code.\n\nThe further subsections describe the `plugins` object structure.\n\n#### Screenshot Plugin\n\nBelow is a default screenshot plugin object configuration, which is loaded implicitly and corresponds to the `manual` preset:\n\n```json\n{\n  \"plugins\": {\n    \"screenshot\": {\n      \"enabled\": true,\n      \"shouldTakeAutomaticSnapshots\": false,\n      \"keepOnlyFailedTestsArtifacts\": false,\n      \"takeWhen\": {\n        \"testStart\": true,\n        \"testDone\": true,\n        \"appNotReady\": true,\n      },\n    }\n  }\n}\n```\n\nThe other string presets override the following properties compared to the default configuration:\n\n- `none` => `{ enabled: false }`.\n- `failing` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: true }`.\n- `all` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: false }`\n\nThe individual property behavior is the following:\n\n- If `enabled` is _false_, then the screenshots will never be saved to the artifacts' folder.\n- If `shouldTakeAutomaticSnapshots` is _false_, then no one of the events described in `takeWhen` object is going to trigger a screenshot.\n- If `keepOnlyFailedTestsArtifacts` is _true_, then only screenshots from a failed test will be saved to the artifacts folder.\n- If `takeWhen` is _undefined_, it is going to have the default value described above (all props are true).\n- If `takeWhen` is set to be an empty object `{}`, that is equivalent to:\n\n```json\n{\n  \"testStart\": false,\n  \"testDone\": false,\n  \"appNotReady\": true,\n}\n```\n\nHence, for example, if you wish to enable only `testDone` screenshots and leave taking `appNotReady` screenshots as-is, you have to pass:\n\n```json\n{\n  \"artifacts\": {\n    \"plugins\": {\n      \"screenshot\": {\n        \"takeWhen\": { \"testDone\": true }\n      }\n    }\n  }\n}\n```\n\n#### Video Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### Log Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### Instruments Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### UI hierarchy Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n## Artifacts Structure\n\n1. **Artifacts root folder** is created per detox test run. If, for instance,`--artifacts-location /tmp` is used with `--configuration ios.sim.release` configuration on 14th June 2018 at 11:02:11 GMT+02, then the folder `/tmp/ios.sim.release.2018-06-14 09:02:11Z` is created.\n\n1. **Test folder** is created per test inside the root folder. The folder name consists of the test number, and the test’s full name provided to `detox.afterEach(testSummary)` as explained above and in [detox object](../api/logger.mdx) documentation. For instance, for the above example, the following folders will be created inside `/tmp/ios.sim.release.2018-06-14 09:02:11Z`:\n\n   ```plain text\n   ✗ Assertions should assert an element has (accessibility)\n   ✓ Network Synchronization Sync with short network requests - 100ms\n   ```\n\n1. **Artifacts files** are created inside the test folders. The files suffixes stand for the files types (currently there are .err.log and .out.log), and the files prefixes are the launch numbers of the application per test (if the app was executed more than once per test, you will have several artifacts of each type - one per launch). For instance, a test folder may contain the following artifacts files:\n\n   ```plain text\n   test.log\n   test.mp4\n   test.dtxrec/\n   beforeEach.png\n   afterEach.png\n   ```\n\n### Example of the structure\n\n```plain text\nartifacts/android.emu.release.2018-06-12 06:36:18Z/startup.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/beforeEach.png\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.mp4\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/afterEach.png\n```\n"
  },
  {
    "path": "docs/config/behavior.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Behavior\n\nIf you need to tweak the flow of `detox.init()` or `detox.cleanup()` steps,\nyou have a few options to change. These are the default behavior values:\n\n## Location\n\n<Location sectionName=\"behavior\" />\n\n## Default values\n\n```json\n{\n  \"behavior\": {\n    \"init\": {\n      \"reinstallApp\": true,\n      \"exposeGlobals\": true,\n    },\n    \"launchApp\": \"auto\",\n    \"cleanup\": {\n      \"shutdownDevice\": false\n    }\n  }\n}\n```\n\n## Properties\n\n### `behavior.init.reinstallApp` \\[boolean]\n\nDefault: `true`.\n\nWhen _true_, Detox will uninstall and install the app upon the initialization.\n\nSetting it to _false_ forces the tests to use the previously installed app on the device,\nprovided you have installed it beforehand [explicitly](../api/device.md#deviceinstallapp) or manually.\n\n### `behavior.init.exposeGlobals` \\[boolean]\n\nDefault: `true`.\n\nWhen _true_, it forces Detox to expose `device`, `expect`, `element`, `by` and `waitFor`\nas global variables.\n\nWhen _false_, you should import them explicitly instead:\n\n```js\nconst { by, device, expect, element } = require('detox');\n```\n\nor, in TypeScript:\n\n```js\nimport { by, device, expect, element } from 'detox';\n```\n\n### `behavior.launchApp` \\[enum]\n\nDefault: `auto`.\n\nPossible values: `auto`, `manual`.\n\nWhen set to `manual`, Detox won't be launching your app automatically. Instead, it will\nbe waiting until you launch it manually from IDE and press any key to resume the test\nexecution. This is useful when you want to [debug the native codebase](../introduction/debugging.mdx) when running Detox tests.\n\nAlso, setting it to `manual` resets `behavior.reinstallApp` to _false_.\n\n### `behavior.cleanup.shutdownDevice` \\[boolean]\n\nDefault: `false`.\n\nWhen set to _true_, Detox will shut down the device after the tests finish.\n"
  },
  {
    "path": "docs/config/devices.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport Location from './partials/_location-dictionaries.mdx';\n\n# Devices\n\nThe format of Detox config allows you to define inside it multiple device configs in a key-value manner, i.e.:\n\n## Location\n\n<Location sectionName=\"devices\" propertyName=\"device\" />\n\n## Examples\n\n<Tabs groupId=\"deviceType\">\n  <TabItem value=\"ios.simulator\" default>\n\n```json\n{\n  \"type\": \"ios.simulator\",\n  \"device\": {\n    // one of these or a combination of them\n    \"id\": \"D53474CF-7DD1-4673-8517-E75DAD6C34D6\",\n    \"type\": \"iPhone 11 Pro\",\n    \"name\": \"MySim\",\n    \"os\": \"iOS 13.0\"\n  },\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.emulator\">\n\n```json\n{\n  \"type\": \"android.emulator\",\n  \"device\": {\n    \"avdName\": \"Pixel_2_API_29\"\n  },\n  \"utilBinaryPaths\": [\n    \"optional-property-with/path/to/test-butler-or-anything-else.apk\"\n  ],\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.attached\">\n\n```json\n{\n  \"type\": \"android.attached\",\n  \"device\": {\n    \"adbName\": \"YOGAA1BBB412\"\n  }\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.genycloud\">\n\n```json\n{\n  \"type\": \"android.genycloud\",\n  \"device\": {\n    // one of these:\n    \"recipeUUID\": \"11111111-2222-3333-4444-555555555555\"\n    \"recipeName\": \"MyRecipeName\",\n  }\n}\n```\n\n  </TabItem>\n</Tabs>\n\n## Properties\n\nA device config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`               | _**Required.** String Literal_. Mandatory property to discern device types: `ios.simulator`, `android.emulator`, `android.attached`, `android.genycloud` etc.                                                                                                                                                                                                                                                                                                                                       |\n| `device`             | _**Required.** Object._ Device query, e.g. `{ \"byType\": \"iPhone 11 Pro\" }` for iOS simulator, `{ \"avdName\": \"Pixel_2_API_29\" }` for Android emulator or `{ \"adbName\": \"<pattern>\" }` for attached Android device with name matching the regex.                                                                                                                                                                                                                                                      |\n| `bootArgs`           | _Optional. String. Supported by `ios.simulator` and `android.emulator` only._ <br/> Supply an extra _String_ of arguments to `xcrun simctl boot ...` or `emulator -verbose ... @AVD_Name`.                                                                                                                                                                                                                                                                                                          |\n| `forceAdbInstall`    | _Optional. Boolean. Supported for Android devices only._ <br/> A _Boolean_ value, `false` by default. When set to `true`, it tells `device.installApp()` to use `adb install`. Otherwise, it would use the combination of `adb push <app.apk>` and `adb shell pm install`.                                                                                                                                                                                                                          |\n| `utilBinaryPaths`    | _Optional. Array of strings. Supported for Android devices only._ <br/> An array of relative paths of _utility_ app (APK) binary-files to preinstall on the tested devices - once before the test execution begins.<br/>**Note**: these are not affected by various install-lifecycle events, such as launching an app with `device.launchApp({delete: true})`, which reinstalls the app. A good example of why this might come in handy is [Test Butler](https://github.com/linkedin/test-butler). |\n| `gpuMode`            | _Optional. String Literal (<code>auto \\| host \\| swiftshader\\_indirect \\| angle\\_indirect \\| guest</code>). Supported by `android.emulator` only._ <br/> A fixed **string** , which tells [in which GPU mode](https://developer.android.com/studio/run/emulator-acceleration#command-gpu) the emulator should be booted.                                                                                                                                                                            |\n| `headless`           | _Optional. Boolean._ `false` by default. When set to `true`, it tells Detox to boot an Android emulator with `-no-window` option, or to not open the iOS Simulator app when running with Android or iOS respectively.                                                                                                                                                                                                                                                                               |\n| `readonly`           | _Optional. Boolean. Supported by `android.emulator` only._ <br/>  `false` by default. When set to `true`, it forces Detox to boot even a single emulator with `-read-only` option.<br/>**Note**: when used with multiple workers, this setting has no effect — emulators will be booted always with `-read-only`.                                                                                                                                                                                   |\n| `systemUI`           | _Optional. String or Object. Supported by Android devices only._ <br/> Configures the Android System UI for consistent screenshots and test stability. Can be set to `\"minimal\"` or `\"genymotion\"` (preset configurations) or an object with granular control. When using an object, you can set `extends: \"minimal\"` or `extends: \"genymotion\"` to start from a preset and override specific properties. All properties accept `null` to explicitly reset to default behavior. <br/><br/>**Object properties:**<br/>- `keyboard`: `'hide'` \\| `'show'` \\| `null` - Controls keyboard visibility. Note: For `'hide'` to work in Google emulators, set `hw.keyboard=yes` in AVD configuration.<br/>- `touches`: `'hide'` \\| `'show'` \\| `null` - Controls touch indicator visibility.<br/>- `pointerLocationBar`: `'hide'` \\| `'show'` \\| `null` - Controls pointer location bar visibility.<br/>- `navigationMode`: `'3-button'` \\| `'gesture'` \\| `null` - Sets navigation bar mode.<br/>- `statusBar`: Object with the following properties:<br/>  - `notifications`: `'show'` \\| `'hide'` \\| `null` - Controls notification icons visibility.<br/>  - `wifiSignal`: `'strong'` \\| `'weak'` \\| `'none'` \\| `null` - Sets WiFi signal strength indicator.<br/>  - `cellSignal`: `'strong'` \\| `'weak'` \\| `'none'` \\| `null` - Sets cellular signal strength indicator. Note: Some Android versions fail to set the network type (3g, lte, etc.).<br/>  - `batteryLevel`: `'full'` \\| `'half'` \\| `'low'` \\| `null` - Sets battery level indicator.<br/>  - `charging`: `true` \\| `false` \\| `null` - Controls charging indicator.<br/>  - `clock`: `string` \\| `null` - Sets the clock time in \"hhmm\" format (e.g., `\"1337\"` for 13:37). |\n"
  },
  {
    "path": "docs/config/logger.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Logger\n\nThe `logger` section controls how the printed logs are going to look like in your terminal window.\n\n![](../img/log-example.png)\n\n## Location\n\n<Location sectionName=\"logger\" />\n\n## Properties\n\n## `logger.level` \\[enum\\]\n\nDefault: `info`.\n\nPossible values in the descending severity order: `fatal`, `error`, `warn`, `info`, `debug`, `trace`.\n\n* Use `info` by default.\n* Use `error` or `warn` when you want to make the output as silent as possible.\n* Use `debug` to control what generally is happening under the hood.\n* Use `trace` when troubleshooting specific issues.\n\nPlease note that the log level has no effect on the [generated log files](artifacts.mdx) and their content – it filters only the messages printed to your terminal.\n\n:::info\n\nThe verbosity of the logs can be influenced by the [`session.debugSynchronization`](session.mdx#sessiondebugsynchronization-number) setting in your Detox configuration. Enabled by default, this setting helps track the reasons preventing your current actions from completing by identifying what the app is still busy with. It produces logs like this:\n\n```\n15:13:07.309 detox[17005] i The app is busy with the following tasks:\n• There are 10 work items pending on the dispatch queue: \"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)\".\n...\n```\n\nIf you want to disable or decrease how often session logs are saved, change the `session.debugSynchronization` value to `0` (to turn off logs) or increase it to `60000` (to lower the frequency of logs). For a deeper understanding of this setting's purpose, refer to the [How Detox Works](../articles/how-detox-works.md#how-detox-automatically-synchronizes-with-your-app) article.\n\n:::\n\n---\n\n## `logger.overrideConsole` \\[boolean\\]\n\nDefault: `true`.\n\nWhen enabled, hijacks all the console methods (console.log, console.warn, etc) so that the messages\nprinted via them are formatted and saved as Detox logs.\n\n## `logger.options` [BunyanDebugStreamOptions]\n\nDefault: varies according to the `logger.level`.\n\nSince Detox is using [bunyan-debug-stream](https://github.com/jwalton/bunyan-debug-stream) for printing logs,\nwe decided just to expose all its options for sake of simplicity of customization:\n\n```typescript\nexport interface BunyanDebugStreamOptions {\n    colors?: { [key: number]: string | string[] } | false | null;\n    forceColor?: boolean;\n    basepath?: string;\n    basepathReplacement?: string;\n    showProcess?: boolean;\n    showDate?: boolean | ((time: Date, entry: any) => string);\n    showPrefixes?: boolean | ((prefixes: string[]) => string);\n    processName?: string;\n    maxExceptionLines?: number | 'auto';\n    stringifiers?: { [key: string]: Stringifier | null };\n    prefixers?: { [key: string]: Stringifier | null };\n    indent?: string;\n    showLoggerName?: boolean;\n    showPid?: boolean;\n    showLevel?: boolean;\n    showMetadata?: boolean;\n}\n```\n\nThere's one caveat inside `logger.options`, however – all the custom functions **must not** use closures! That's\nbecause they get `eval()`-ed every time the test runner spawns a new child worker process. In other words:\n\n```js\nconst dontDoThis = date => date.toISOString();\n\nmodule.exports = {\n  logger: {\n    level: 'debug',\n    options: {\n      // showDate: (date) => dontDoThis(date),\n// highlight-next-line\n      showDate: (date) => date.toISOString(), /* do this instead */\n    },\n  },\n  // ...\n};\n```\n"
  },
  {
    "path": "docs/config/overview.mdx",
    "content": "# Overview\n\n:::info\n\nIf you prefer to read TypeScript files instead of docs, feel free to browse through\n[the typings file](https://github.com/wix/Detox/blob/master/detox/index.d.ts) provided by Detox.\n\n:::\n\nRunning automated tests on your mobile application implies firstly that\nyou have a mobile device and an application. Unlike unit tests, where\npassing tests don’t require extra checks, the end-to-end tests are better\nto be executed multiple times – on various devices and app flavors (e.g.\n_debug_ and _release_).\n\nThis is why Detox is inclined towards static configuration files describing\npermutations of _apps_, _devices_ and a lot more, actually. If you come to\nthink of it, even a simple React Native application is likely to have four\ncombinations:\n\n1. iOS simulator running a _debug_ build;\n1. iOS simulator running a _release_ build;\n1. Android emulator running a _debug_ build;\n1. Android emulator running a _release_ build;\n\nImagine you want to check your app both on phones and tablets, and now you\nhave eight combinations already! Add multiple OS versions into the test\ncoverage matrix equation, and the configuration grows by a factor of N.\n\n## Config structure\n\nIn view of the arguments above, our recommendation to keep Detox configs\nneat and tidy is to keep them inside three key-value dictionaries:\n`devices`, `apps` and `configurations`. See the schematic code below:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n// highlight-next-line\n  devices: {\n    device1: { /* ... */  },\n    device2: { /* ... */  },\n  },\n// highlight-next-line\n  apps: {\n    app1: { /* ... */  },\n    app2: { /* ... */  },\n  },\n// highlight-next-line\n  configurations: {\n    'device1+app1': {\n      device: 'device1',\n      app: 'app1',\n    },\n    /* ... */\n  },\n};\n```\n\nConfiguration names serve as an entry point, when you want to run Detox tests:\n\n```bash\ndetox test -c 'device1+app1'\n```\n\nWhen Detox starts, it picks the specified configuration and resolves its aliases to the device and\nthe application. However, the config file is not limited only to devices and applications – there\nare more sections:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n// highlight-start\n  artifacts: { /* ... */ },\n  behavior: { /* ... */ },\n  logger: { /* ... */ },\n  session: { /* ... */ },\n  testRunner: { /* ... */ },\n// highlight-end\n  devices: { /* ... */ },\n  apps: { /* ... */ },\n  configurations: { /* ... */ },\n};\n```\n\nWhen the config gets finally resolved, it looks more like a flat structure, as shown on the diagram:\n\n![Detox config with its global dictionaries for apps, devices and configurations, and also its other config sections, when resolved, it becomes a flat object with all imaginable properties: device, apps, test runner, logger, artifacts, behavior, session, etc.](../img/internals/config-resolution.png)\n\nAside from mandatory `device` and `app` properties, each configuration can have\noverrides to the global config sections such as `testRunner`, `artifacts`,\n`behavior` and others, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  logger: {\n// highlight-next-line\n    level: process.env.CI ? 'debug' : 'info',\n  },\n  /* ... */\n  configurations: {\n    'ios.sim.debug': {\n      device: 'iphone',\n      app: 'ios.debug',\n// highlight-start\n      testRunner: {\n        args: {\n          runInBand: true,\n        },\n      },\n// highlight-end\n      // ...\n// highlight-start\n      logger: {\n        level: 'trace' // override\n      },\n// highlight-end\n    },\n  },\n};\n```\n\nFor more clarity, this relationship might be illustrated with a diagram:\n\n![Detox configurations refer to devices and apps dictionaries, and may also contain overrides to the other global config sections: test runner, artifacts, behavior, logger and session.](../img/internals/config-dictionaries.png)\n\nIt should be noted that the aliasing of devices and apps is optional in fact.\nInstead of using keys, you can inline both device and app configs into your\nconfiguration, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  configurations: {\n    'ios.sim.debug': {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 13 Pro',\n        },\n      },\n      app: {\n        type: 'ios.app',\n        binaryPath: '/path/to/your.app',\n      },\n    },\n  },\n};\n```\n\nBesides, there is [basic support](apps.mdx) for tests with multiple applications, if you switch\nto `apps` array (aliased or inlined) instead of `app`, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  apps: { /* ... */ },\n  devices: { /* ... */ },\n  configurations: {\n    'multi.ios.debug': {\n      device: 'iphone',\n      apps: ['passenger.ios.debug', 'driver.ios.debug'],\n    },\n  },\n};\n```\n\n## Path conventions\n\nDetox supports standalone configuration files and the respective named section inside `package.json`.\nIt starts scanning from the current working directory, and runs over the following options, in this order:\n\n1. `.detoxrc.js`\n1. `.detoxrc.json`\n1. `.detoxrc` (JSON)\n1. `detox.config.js`\n1. `detox.config.json`\n1. `package.json`\n\nIf you decide to have `detox` section in your `package.json`, it should be defined as a top-level\nproperty:\n\n```json\n{\n  \"name\": \"your-project\",\n  \"version\": \"X.Y.Z\",\n  \"scripts\": {},\n// highlight-start\n  \"detox\": {\n    \"devices\": {},\n    \"apps\": {},\n    \"configurations\": {},\n  }\n// highlight-end\n}\n```\n\n## Extending\n\nAll Detox config files are extensible by definition.\nThat helps if you ever need to share certain settings across multiple mobile projects, e.g.:\n\n```json\n{\n// highlight-next-line\n  \"extends\": \"@my-org/detox-preset\",\n  \"configurations\": {\n    // …\n  },\n}\n```\n\nPlease note that `extends` has to be a valid Node module path. Relative module paths will be resolved relatively\nto the Detox config file which contains that specific `extends` property, e.g.:\n\n```js title=\"~/Projects/my-project/e2e/detox.config.js\"\nmodule.exports = { extends: \"../base.detox.config.js\" };\n// the path resolves to: ~/Projects/my-project/base.detox.config.js\n\nmodule.exports = { extends: \"./ci.detox.config.js\" };\n// the path resolves to: ~/Projects/my-project/e2e/ci.detox.config.js\n```\n\nThe extension chain can have an arbitrary length. All the configs are going to be _deep-merged_ in the logical\norder: grandparent ← parent ← child.\n\n## Default configuration\n\nAs you might have noticed, you always have to pass `-c <configuration name>` argument when running Detox tests:\n\n```bash\ndetox test -c ios.sim.debug\n```\n\nTechnically this is not true. You can omit the configuration name if:\n\n- there is only one configuration in `configurations` dictionary;\n- you set some configuration as a default choice via `selectedConfiguration` property:\n\n  ```js\n  /* @type {Detox.DetoxConfig} */\n  module.exports = {\n  // highlight-next-line\n    selectedConfiguration: 'device1+app1',\n    devices: {\n      device1: { /* ... */  },\n      device2: { /* ... */  },\n    },\n    apps: {\n      app1: { /* ... */  },\n      app2: { /* ... */  },\n    },\n    configurations: {\n  // highlight-next-line\n      'device1+app1': {\n        device: 'device1',\n        app: 'app1',\n      },\n      /* ... */\n    },\n  };\n  ```\n\nThe next articles will be describing each configuration section in detail.\n"
  },
  {
    "path": "docs/config/partials/_location-dictionaries.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<p>\n  You can define the {props.propertyName} config in two\n  ways: <i>aliased</i> and <i>inlined</i> (per a configuration):\n</p>\n\n<CodeBlock title=\".detoxrc.js\" language=\"javascript\">\n  {[\n    '/** @type {Detox.DetoxConfig} */',\n    'module.exports = {',\n    `  ${props.sectionName}: {`,\n    '// highlight-start',\n    `    ${props.propertyName}Key: {`,\n    `      /* … ${props.propertyName} config … */`,\n    '    }',\n    '// highlight-end',\n    '  },',\n    '  /* … */',\n    '  configurations: {',\n    `    'example.aliased': {`,\n    '      /* … */',\n    '// highlight-next-line',\n    `      ${props.propertyName}: '${props.propertyName}Key', // (1)`,\n    '    },',\n    `    'example.inlined': {`,\n    '      /* … */',\n    '// highlight-start',\n    `      ${props.propertyName}: { // (2)`,\n    `        /* … ${props.propertyName} config … */`,\n    '      },',\n    '// highlight-end',\n    '    },',\n    '  },',\n    '};',\n  ].join('\\n')}\n</CodeBlock>\n"
  },
  {
    "path": "docs/config/partials/_location.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<p>\n  You can define the <code>{props.sectionName}</code> config section in two\n  ways: <i>globally</i> and <i>locally</i> (per a configuration):\n</p>\n\n<CodeBlock title=\".detoxrc.js\" language=\"javascript\">\n  {[\n    '/** @type {Detox.DetoxConfig} */',\n    'module.exports = {',\n    '// highlight-start',\n    `  ${props.sectionName}: {`,\n    '    /* global section */',\n    '  },',\n    '// highlight-end',\n    '  devices: { /* … */ },',\n    '  apps: { /* … */ },',\n    '  configurations: {',\n    `    'ios.sim.debug': {`,\n    `      device: 'iphone',`,\n    `      app: 'ios.debug',`,\n    '// highlight-start',\n    `      ${props.sectionName}: {`,\n    '        /* local (per-configuration) section */',\n    '      },',\n    '// highlight-end',\n    '    },',\n    '  },',\n    '};',\n  ].join('\\n')}\n</CodeBlock>\n"
  },
  {
    "path": "docs/config/session.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Session\n\n:::info Note\n\nIt is not recommended to customize this section unless [you are debugging native code](../introduction/debugging.mdx)\nor contributing to the native iOS/Android code of Detox.\n\n:::\n\nThe `session` section tells Detox how to set up its web socket server and client. They are used to forward the JSON-serialized expectations and element interactions to the native implementation of Detox side-loaded with the app.\n\n## Location\n\n<Location sectionName=\"session\" />\n\n## Properties\n\nThere is one important thing to note when you’ll be defining a session config, e.g.:\n\n### `session.server` \\[string]\n\nDefault: `ws://localhost:{randomPort}`.\n\n```json\n{\n  \"session\": {\n// highlight-next-line\n    \"server\": \"ws://localhost:8099\"\n  }\n}\n```\n\nWhen you define a URL for `server`, it automatically sets [`session.autoStart`](#sessionautostart-boolean) to _false_ (mainly due to backward compatibility reasons), so make sure to override it back if you didn’t intend that.\n\n### `session.sessionId` \\[string]\n\nDefault: a random UUID, e.g. `7731871e-2f07-46bb-acbc-cb0eb6a0ace7`.\n\nSince the Detox server is a single entity, but there can be multiple test workers running multiple devices and apps,\nit needs to understand which connection belongs to which app.\n\nDetox forwards `sessionId` to the app as a launch argument, so the app immediately knows where to connect to.\n\n:::caution\n\nDefining an explicit `sessionId` means you cannot use **multiple workers**,\nsince the specified session will become busy for any test worker next to the first one to occupy it.\n\n```json\n{\n  \"session\": {\n    \"server\": \"ws://localhost:8099\",\n// highlight-next-line\n    \"sessionId\": \"YourProjectSessionId\"\n  }\n}\n```\n\n:::\n\n### `session.autoStart` \\[boolean]\n\nDefault: `true` for undefined `session.server`, and `false` for defined.\n\nControls whether Detox web socket server will be starting automatically.\nIf `false`, it is assumed that you will be running it independently via [`detox run-server`](../cli/run-server.md) CLI command.\n\n```diff\n   \"session\": {\n+    \"autoStart\": true,\n     \"server\": \"ws://localhost:8099\",\n     \"sessionId\": \"YourProjectSessionId\"\n```\n\n### `session.debugSynchronization` \\[number]\n\n**Enabled by default**, with the value of `10_000`ms.\n\nTells Detox how long (in milliseconds) to wait for the app to become idle until it starts querying it for more details in order to print out automated-synchronization debugging logs.\n\n```json\n{\n  \"session\": {\n    \"debugSynchronization\": 5000\n  }\n}\n```\n\nDetox will be printing the list of busy idling resources every time an action takes more than the specified period, e.g.:\n\n```plain text\n09:41:00.941 detox[1337] i The app is busy with the following tasks:\n• There are 10 work items pending on the dispatch queue: \"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)\".\n• UI elements are busy:\n  - Layers pending animations: 96.\n  - Layers needs layout: 173.\n  - View needs layout: 74.\n  - View needs display: 98.\n  - Layers needs display: 90.\n• Run loop \"Main Run Loop\" is awake.\n```\n\n<sup>(These are logs generated by Detox for iOS; Detox for Android generates different yet equivalent ones)</sup>\n\nTo disable this behavior (i.e. querying the app periodically), set the value to `0`.\n\nSeeing logs like these usually indicates certain issues in your application, as explained in the [Troubleshooting Guide](../troubleshooting/synchronization.md).\n\nFor extended, more detailed information on iOS, refer to the `DetoxSync` project's [Status Documentation](https://github.com/wix-incubator/DetoxSync/blob/master/StatusDocumentation.md).\n\n### `session.ignoreUnexpectedMessages` \\[boolean]\n\nDefault: `false`.\n\nControls whether Detox should throw an error or log a warning when receiving unexpected WebSocket messages that don't match any registered handler or in-flight promise.\n\nWhen set to `true`, unexpected messages will be logged as warnings instead of throwing a `DetoxRuntimeError`. This is particularly useful for applications with complex view hierarchies, such as React Native apps with WebViews, where legitimate messages might be received in unexpected contexts (e.g., messages from WebViews after switching back to native context).\n\n```json\n{\n  \"session\": {\n    \"ignoreUnexpectedMessages\": true\n  }\n}\n```\n\n:::tip\n\nThis option can also be controlled via the environment variable `DETOX_IGNORE_UNEXPECTED_WS_MESSAGES=true`.\n\n::: "
  },
  {
    "path": "docs/config/testRunner.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Test runner\n\nWhile Detox was created to test mobile applications, effectively it is **not a test runner** – instead, it **runs on top** of a test runner. There are many third-party solutions for running tests, so we're happy to not reinvent the wheel and to devote our time to the mobile domain itself.\n\nSince we focus on React Native and yet require some test runner under the hood, the most logical choice was to provide an official integration with Jest, which is the default test runner for such projects. This is why all our guides presume you have Jest under the hood, and the structure generated via  `detox init` is no exception.\n\nThe integration with a test runner is a matter of the configuration, not the implementation – Detox source code has no hard-coded logic for Jest save for a few minor places[^1]. Furthermore, we're looking forward to new third-party integrations with popular test runners as the [Internals API](../api/internals.mdx) keeps improving.\n\n[^1]: Detox has a few hard-coded default values for Jest: [`testRunner.args.$0`] and [`testRunner.inspectBrk`] hook. Also `detox test` CLI is aware of Jest boolean arguments (e.g. `-i, --runInBand`, `--bail`, etc.), and it can auto-fix ambiguous commands like `detox test --runInBand e2e/starter.test.js --bail`.\nWe're looking forward to make the code even more agnostic, but currently these caveats are worth mentioning for the developers of third-party test runner integrations.\n\n## Location\n\n<Location sectionName=\"testRunner\" />\n\n## Properties\n\n### `testRunner.args` \\[object]\n\nThis section is responsible for building the test runner command that is going to be spawned when you run:\n\n```bash\ndetox test\n# $0 --key1 value1 … ---keyN valueN ...positionalArguments\n```\n\nFor example, this configuration of a test runner:\n\n```json\n{\n  \"testRunner\": {\n    \"args\": {\n      \"$0\": \"nyc jest\",\n      \"bail\": true,\n      \"config\": \"e2e/jest.config.js\",\n      \"_\": [\"e2e/sanity-tests\"]\n    }\n  }\n}\n```\n\nwould eventually spawn:\n\n```bash\nnyc jest --bail --config e2e/jest.config.js e2e/sanity-tests\n```\n\nNow, when you have an idea of what it does, let's overview the properties one by one.\n\n### `testRunner.args.$0` \\[string]\n\nDefault: `jest`.\n\nDefines the beginning of the test runner command, usually just the name of the executable. The path to the executable is resolved according to your `PATH` environment variable.\n\nAlthough not recommended, you can specify composite commands like `node -r ./preload.js node_modules/.bin/my-runner`.\n\n### `testRunner.args[…]` \\[string | number | boolean]\n\nYou can define arbitrary arguments in the key-value format, e.g.:\n\n```json\n{\n  \"args\": {\n    \"$0\": \"jest\",\n// highlight-start\n    \"color\": false,\n    \"bail\": true,\n    \"testTimeout\": 60000,\n    \"config\": \"e2e/jest.ci.config.js\"\n// highlight-end\n  }\n}\n```\n\nFor example, the config above would generate a command like this:\n\n```bash\njest --no-color --bail --testTimeout 60000 --config e2e/jest.ci.config.js\n```\n\nAs you can see, `false` boolean values produce keys prefixed with `--no-`.\n\n### `testRunner.args._` \\[string\\[]]\n\nDefault: `[]`.\n\nThis property defines an array of **default** positional arguments to pass to the test runner. Consider an example:\n\n```json\n{\n  \"args\": {\n    \"$0\": \"jest\",\n// highlight-next-line\n    \"_\": [\"e2e/sanity-tests\"]\n  }\n}\n```\n\nIf you run tests without extra positional arguments, you’ll get `_` contents appended:\n\n```bash\ndetox test -c ios.sim.debug\n# jest … e2e/sanity-tests\n```\n\nIf you run tests with custom positional arguments, the `_` contents get replaced:\n\n```bash\ndetox test e2e/regression-tests\n# jest … e2e/regression-tests\n```\n\nIf you use the retry mechanism of `detox test`, be prepared that the failed test file paths will override `_` in all the subsequent re-runs.\n\n### `testRunner.retries` \\[number]\n\nDefault: `0`.\n\nTells `detox test` to keep re-running the test runner with failed test files until they pass, or the number of repeated attempts exceeds the specified value:\n\n```bash\ndetox test\nDETOX_CONFIGURATION=\"…\" jest --config e2e/jest.config.js e2e/sanity-tests\n# …\n# There were failing tests in the following files:\n#   1. /path/to/your/test.js\n#\n# Detox CLI is going to restart the test runner with those files...\nDETOX_CONFIGURATION=\"…\" jest --config e2e/jest.config.js /path/to/your/test.js\n# …\n```\n\nSee also [`-R, --retries`](../cli/test.md#options) in Detox CLI.\n\n### `testRunner.bail` \\[boolean]\n\nDefault: `false`.\n\nWhen true, tells `detox test` to cancel next retrying if it gets at least one report about a [permanent test suite failure](../api/internals.mdx#reporting-test-results).\nHas no effect, if [`testRunner.retries`] is undefined or set to zero.\n\n### `testRunner.noRetryArgs` \\[string[]]\n\nDefault: `['shard']`.\n\nSpecifies an array of command-line argument names that should be removed when retrying failed tests. This is useful for arguments that don't make sense or might cause issues during retry runs.\n\nFor example, with the default configuration, when tests fail and are retried, the `shard` argument will be removed from the test runner command:\n\n```bash\n# First run with sharding\njest --shard=1/3 e2e/tests\n# Retry run without sharding, only running failed tests\njest path/to/failed/test.js\n```\n\nYou can customize this array to include any arguments that should be excluded during retries:\n\n```json\n{\n  \"testRunner\": {\n    \"noRetryArgs\": [\"shard\", \"maxWorkers\", \"customArg\"]\n  }\n}\n```\n\n### `testRunner.detached` \\[boolean]\n\nDefault: `false`.\n\nWhen true, tells `detox test` to spawn the test runner in a detached mode.\n\nThis is useful in CI environments, where you want to intercept SIGINT and SIGTERM signals to gracefully shut down the test runner and the device.\n\nInstead of passing the kill signal to the child process (the test runner), Detox will send an emergency shutdown request to all the workers, and then it will wait for them to finish.\n\n### `testRunner.forwardEnv` \\[boolean]\n\nDefault: `false`.\n\nWhen enabled, tells `detox test` to pass command-line arguments as environment variables to the test runner, e.g.:\n\n```bash\ndetox test -c ios.sim.debug --record-logs all\nDETOX_CONFIGURATION=ios.sim.debug DETOX_RECORD_LOGS=all jest …\n```\n\nNevertheless, even if it is disabled, Detox will keep printing hints how to call your test runner without Detox CLI, so that you can copy and paste the command into your IDE when you want to debug something.\n\n### `testRunner.inspectBrk` \\[function]\n\n:::caution\n\nThis property is intended primarily for developing integrations with third-party test runners.\n\n:::\n\nDefault: _a Jest-specific callback that sets `$0`, `--runInBand` and cleans `-w, --maxWorkers`_.\n\nThe provided function is called when [`detox test`](../cli/test.md) is called with `--inspect-brk`.\nYour implementation should prepare [`testRunner.args`] for [debugging with Node.js inspector](../introduction/debugging.mdx), e.g. for Jest that would be:\n\n```js title=\".detoxrc.js\"\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    /** @param {Detox.DetoxTestRunnerConfig} config */\n    inspectBrk: (config) => {\n      config.args.$0 = os.platform() === 'win32'\n        ? `node --inspect-brk ./node_modules/jest/bin/jest.js`\n        : `node --inspect-brk ./node_modules/.bin/jest`;\n      config.args.runInBand = true;\n      delete config.args.w;\n      delete config.args.workers;\n    },\n  },\n};\n```\n\n### `testRunner.jest` \\[object]\n\nThis is an add-on section used by our Jest integration code (but not Detox core itself).\nIn other words, if you’re implementing (or using) a custom integration with some other test runner, feel free to define a section for yourself (e.g. `testRunner.mocha`)\n\n#### `testRunner.jest.setupTimeout` \\[number]\n\nDefault: `120000` (2 minutes).\n\nAs a part of the [environment setup](https://jestjs.io/docs/configuration/#testenvironment-string)), Detox boots the device and installs the apps.\nIf that takes longer than the specified value, the entire test suite will be considered as failed, e.g.:\n\n```plain text\n FAIL  e2e/starter.test.js\n  ● Test suite failed to run\n\n    Exceeded timeout of 120000ms while setting up Detox environment\n```\n\n#### `testRunner.jest.teardownTimeout` \\[number]\n\nDefault: `30000` (30 seconds).\n\nIf the [environment teardown](https://jestjs.io/docs/configuration/#testenvironment-string)) takes longer than the specified value, Detox will throw a timeout error.\n\n#### `testRunner.jest.reportSpecs` \\[boolean | undefined]\n\nDefault: `undefined` (auto).\n\nBy default, Jest prints the test names and their status (_passed_ or _failed_) at the very end of the test session. This might be fine for sub-second unit tests, but it is uncomfortable to wait a couple of minutes until you actually see anything.\n\nWhen enabled, it makes Detox to print messages like these each time the new test starts and ends:\n\n```plain text\n18:03:36.258 detox[40125] i Sanity: should have welcome screen\n18:03:37.495 detox[40125] i Sanity: should have welcome screen [OK]\n18:03:37.496 detox[40125] i Sanity: should show hello screen after tap\n18:03:38.928 detox[40125] i Sanity: should show hello screen after tap [OK]\n18:03:38.929 detox[40125] i Sanity: should show world screen after tap\n18:03:40.351 detox[40125] i Sanity: should show world screen after tap [OK]\n```\n\nBy default, it is enabled automatically in test sessions with a single worker. And vice versa, if multiple tests are executed concurrently, Detox turns it off to avoid confusion in the log. Use boolean values, `true` or `false`, to turn off the automatic choice.\n\n#### `testRunner.jest.reportWorkerAssign` \\[boolean]\n\nDefault: `true`.\n\nLike already mentioned, in the init phase, Detox boots the device and installs the apps. This flag tells Detox to print messages like these every time the device gets assigned to a specific suite:\n\n```plain text\n18:03:29.869 detox[40125] i starter.test.js is assigned to 4EC84833-C7EA-4CA3-A6E9-5C30A29EA596 (iPhone 12 Pro Max)\n```\n\n#### `testRunner.jest.retryAfterCircusRetries` \\[boolean]\n\nDefault: `false`.\n\nJest provides an API to re-run individual failed tests: [`jest.retryTimes(count)`](https://jestjs.io/docs/29.0/jest-object#jestretrytimesnumretries-options).\nWhen Detox detects the use of this API, it suppresses its own CLI retry mechanism controlled via `detox test … --retries <N>` or `testRunner.retries`. The motivation is simple – activating the both mechanisms is apt to increase your test duration dramatically, if your tests are flaky.\n\nIf you wish nevertheless to use both the mechanisms simultaneously, set it to `true`.\n\n## Jest config\n\nJest config generated by `detox init` is helpful for understanding how Detox integrates with Jest:\n\n```js title=\"e2e/jest.config.js\"\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n  rootDir: '..',\n  testMatch: ['<rootDir>/e2e/**/*.test.js'],\n  testTimeout: 120000,\n  maxWorkers: 1,\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  reporters: ['detox/runners/jest/reporter'],\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  verbose: true,\n};\n```\n\nAll the listed properties vary from mandatory to strongly recommended, and below we'll be explaining why (and, more importantly, how to customize them correctly). If you need to add extra properties, please consult the [Configuring Jest](https://jestjs.io/docs/configuration) article on its official website.\n\n1. `rootDir` and `testMatch` enforce the convention that your tests have `.test.js` extension and reside somewhere in `e2e` folder together with the Jest config:\n\n   ```plain text\n   ├── …\n   ├── e2e\n   //highlight-start\n   │   ├── feature1.test.js\n   │   ├── feature2\n   │   │   ├── subfeature1.test.js\n   │   │   └── subfeature2.test.js\n   //highlight-end\n   │   ├── …\n   │   └── jest.config.js\n   ├── …\n   ├── .detoxrc.js\n   └── package.json\n   ```\n\n1. `testTimeout: 120000` overrides the default value (5 seconds), which is usually too short to complete a single end-to-end test. Two minutes should be safe enough, but you’re welcome to increase or decrease depending on your needs.\n\n1. `maxWorkers: 1` prevents potential over-allocation of mobile devices according to the default Jest strategy. By default, Jest picks `cpusCount — 1` which is too much (e.g. 6-core laptop would spawn 11 devices). Note that casually you can override it via forwarding command-line argument [`--maxWorkers <N>`](https://jestjs.io/docs/cli#--maxworkersnumstring):\n\n   ```bash\n   detox test … --maxWorkers 2\n   # … jest … --maxWorkers 2\n   ```\n\n   Change it only if you want to change **the default value**. For instance, you could use different number of workers depending on the environment, e.g.:\n\n   ```js\n   /** @type {import('@jest/types').Config.InitialOptions} */\n   module.exports = {\n     // …\n   // highlight-next-line\n     maxWorkers: process.env.CI ? 2 : 1,\n   };\n   ```\n\n1. `globalSetup` file is essential as it integrates with Detox Internals API. If you need to set up something in addition, you should wrap it like this:\n\n   ```js\n   module.exports = async () => {\n      await require('detox/runners/jest').globalSetup();\n      await yourGlobalSetupFunction();\n   };\n   ```\n\n1. `globalTeardown` file is essential as it integrates with Detox Internals API. If you need to tear down something in addition, you should wrap it like this:\n\n   ```js\n   module.exports = async () => {\n     try {\n       await yourGlobalTeardownFunction();\n     } finally {\n       await require('detox/runners/jest').globalTeardown();\n     }\n   };\n   ```\n\n1. `reporters` array should always include a reporter from Detox. We reserve right to add anytime some integration code there. Although currently it is rather empty, not having it puts you under risk every time you upgrade Detox versions.\n\n1. `testEnvironment` is the most important part of the integration. If you need to add something on top of it, please inherit like shown below:\n\n   ```js title=\"e2e/testEnvironment.js\"\n   const { DetoxCircusEnvironment } = require('detox/runners/jest');\n\n   class CustomDetoxEnvironment extends DetoxCircusEnvironment {\n     constructor(config, context) {\n       super(config, context);\n       // custom code\n     }\n\n     async setup(config, context) {\n       await super.setup(config, context);\n       // custom code\n     }\n\n     async handleTestEvent(event, state) {\n       await super.handleTestEvent(event, state);\n       // custom code\n     }\n\n     async teardown(config, context) {\n       try {\n         // custom code\n       } finally {\n         await super.teardown(config, context);\n       }\n     }\n   }\n\n   module.exports = CustomDetoxEnvironment;\n   ```\n\n1. `verbose: true` [disables batching](https://github.com/facebook/jest/issues/8208) of Jest logs and ensures you see the logs in real time.\n\n## Globals\n\nUnless `behavior.init.exposeGlobals` is set to `false`, Detox exposes its primitives (`expect`, `device`, ...) globally, and it will override Jest’s global `expect` object.\nIf you need to use it nevertheless, import it explicitly:\n\n```js\nimport jestExpect from 'expect';\n```\n\n## Mocking\n\nDon’t use `jest.mock()` or any other similar mocking mechanism. Follow our [Mocking guide](../guide/mocking.md) instead.\n\n## Parallel Test Execution\n\nDetox relies on test runners to execute tests in parallel.\n\nIf you’re using Jest under the hood, the easiest way is to specify `-w, --maxWorkers`, e.g.:\n\n```bash\ndetox test … --maxWorkers 2\n```\n\nIn the other cases, consult your test runner documentation.\n\n## Forwarding CLI arguments\n\nIf Detox does not recognize CLI arguments you pass, it forwards them as-is to the underlying test runner, e.g.:\n\n```bash\ndetox test -c ios.sim.debug --key1 value1 --key2\n# DETOX_CONFIGURATION=ios.sim.debug jest --key1 value1 --key2\n#\n# ● Unrecognized CLI Parameters:\n#\n#   Following options were not recognized:\n#   [\"key1\", \"key2\"]\n#\n#   CLI Options Documentation:\n#   https://jestjs.io/docs/cli\n```\n\nTherefore, if test runner rejects such arguments, it is your responsibility to fix that.\n\nSince there might be argument clashes between Detox and a test runner, you can use `--` (double dash) to forward the arguments as-is, e.g.:\n\n```bash\ndetox test -c ios.sim.debug -- --help\n# DETOX_CONFIGURATION=ios.sim.debug jest --help\n# Usage: jest [--config=<pathToConfigFile>] [TestPathPattern]\n#\n# Options:\n# …\n```\n\n[`testRunner.args`]: #testrunnerargs-object\n[`testRunner.args.$0`]: #testrunnerargs0-string\n[`testRunner.inspectBrk`]: #testrunnerinspectbrk-function\n[`testRunner.retries`]: #testrunnerretries-number\n[`testRunner.noRetryArgs`]: #testrunnernoretryargs-string\n"
  },
  {
    "path": "docs/contributing/code/building-and-testing.md",
    "content": "# Building and Testing\n\nOur JavaScript code is thoroughly verified with comprehensive unit tests, complemented by integration tests.\nAdditionally, our native code undergoes rigorous testing through both unit and integration tests.\nTo ensure complete functionality, we conduct end-to-end tests on a fully-featured React Native application, designed to encompass all our public APIs (refer to our [test app] for details).\n\n:::note Important\n\nBefore submitting a pull request, please ensure at a minimum that your code adheres to our linting standards and that all unit tests run successfully without any errors.\n\n:::\n\nThe following sections describe how to build and test our code, with a general instruction.\nHowever, we recommend you to refer to our `package.json` files for a complete list of available scripts:\n\n- Detox Framework: [`detox/package.json`]\n- Detox Test App: [`detox/test/package.json`]\n\n## Unit Tests (JavaScript)\n\nWe use [Jest] for running our unit tests.\n\nUnder the `detox/` directory, run the following command to run the unit tests with coverage:\n\n```bash\ncd detox\nnpm run unit\n```\n\nThe unit tests reside alongside the JavaScript code. Typically, they can also be easily run directly from within an IDE such as [WebStorm](https://www.jetbrains.com/webstorm/) or [vscode](https://code.visualstudio.com/), even in debug (i.e step-by-step execution) mode.\n\n## Unit Tests - Android Native\n\nWe also have unit tests for our native code (Android only). They reside alongside Detox's native Android code, under a dedicated subdirectory called `testFull`. You can run them using the following commands:\n\n```bash\ncd detox\nnpm run unit:android-release\n```\n\nThe native unit tests can also be run in [Android Studio](https://developer.android.com/studio) (i.e. the IDE for Android apps development). Most tests can be run seamlessly using Android Studio's build-in support for unit-tests, but some require a plugin called [Spek](https://plugins.jetbrains.com/plugin/10915-spek-framework), which can be installed from within Android Studio itself - under the Plugins marketplace.\n\n## iOS: Rebuilding the Native Code\n\n### Detox Framework\n\nAfter changing the native code of Detox iOS, you need to rebuild the Detox framework. This is done when running:\n\n```bash\ndetox build-framework-cache\n```\n\nNote that it is only required when you change the native code of Detox, or one of its dependencies (e.g. [DetoxSync]).\nIf you are only changing the JavaScript code, you don't need to rebuild the framework.\n\n## Building the Detox Test App\n\nThe Detox self-test app is a full-feature React Native app for testing Detox end-to-end.\n\nBefore running the tests, you must first build the Detox test app. To do so, under `detox/test`, use the `build` command of the Detox CLI.\nList of available configurations can be found under [`detox/test/e2e/detox.config.js`].\n\nFor example, to build the Detox test app for iOS in release mode, run:\n\n```bash\ncd detox/test\ndetox build --configuration ios.sim.release\n```\n\n### End-to-End Tests\n\nTo run the end-to-end tests (after building the app), use the `test` command of the Detox CLI.\n\nFor example, to run the end-to-end tests for iOS in release mode, run:\n\n```bash\ncd detox/test\ndetox test --configuration ios.sim.release\n```\n\n:::note\n\nMind that on iOS, Detox expects a specific simulator device with a specific name and os version to be available in your Xcode environment.\nThe required details are specified in the [detox.config.js](https://github.com/wix/Detox/blob/master/detox/test/e2e/detox.config.js) under `ios.simulator` device configuration (see `type` and `os`). Be sure to [install such a device](https://developer.apple.com/documentation/safari-developer-tools/adding-additional-simulators), beforehand.\n\n:::\n\nTo run in Android release mode, run:\n\n```bash\ncd detox/test\ndetox test --configuration android.emu.release\n```\n\n:::note\n\nMind that on Android, Detox expects a specific AVD with a specific name to be available on your computer.\nThe required details are specified in the [detox.config.js](https://github.com/wix/Detox/blob/master/detox/test/e2e/detox.config.js) under `android.emulator` device configuration (see `avdName`).\nBe sure to [install such an AVD](https://developer.android.com/studio/run/managing-avds#createavd), beforehand.\n\n:::\n\n## Integration Tests\n\nBesides unit tests and end-to-end tests, we have some middle ground integration tests, which typically run Detox in a custom headless-like mode (i.e. stubs replace devices). Those tests typically execute Detox from a command line in that mode, and then do some post-processing of the results. We use [Jest] for running our integration tests.\n\nThe integration reside under a dedicated directory alongside Detox's the self-test app's code.\n\nRun the following command to run the integration tests:\n\n```bash\ncd detox/test\nnpm run integration\n```\n\n### Linting\n\nWe use [ESLint] for linting our JavaScript code.\n\nYou can run the linter locally using the following command (under `detox/test`):\n\n```bash\nnpm run lint\n```\n\nWe also test our types using the following command:\n\n```bash\nnpm run test:types\n```\n\n## Running the CI Scripts Locally\n\nOn our CI, we test our changes on both iOS and Android, and we lint-check our code.\nYou can run the same scripts we run on our CI locally, to ensure your changes are passing the tests (under the project's root directory):\n\n```bash\nnpm run ci:ios\nnpm run ci:android\n```\n\nRefer to the scripts `scripts/ci.ios.sh` and `scripts/ci.android.sh` to see how we run the tests on our CI.\n\n[test app]: https://github.com/wix/Detox/tree/master/detox/test\n[DetoxSync]: https://github.com/wix/DetoxSync\n[`detox/test/e2e/detox.config.js`]: https://github.com/wix/Detox/blob/6e87dc13826341dba21ed0a732e5b57efa08e7b5/detox/test/e2e/detox.config.js#L137\n[ESLint]: https://eslint.org/\n[Jest]: https://jestjs.io/\n[`detox/package.json`]: https://github.com/wix/Detox/blob/master/detox/package.json\n[`detox/test/package.json`]: https://github.com/wix/Detox/blob/master/detox/test/package.json\n"
  },
  {
    "path": "docs/contributing/code/example-projects.md",
    "content": "# Example Projects\n\nExplore various example projects hosted in this monorepo to understand real-world usage and testing with Detox.\n\n- `examples/demo-react-native-jest`: Demonstrates Detox usage in a React Native app project.\n- `examples/demo-native-ios`: Illustrates Detox usage in a native (non-React Native) iOS app.\n- `examples/demo-native-android` <span style={{color: 'red'}}>(broken)</span>: Illustrates Detox usage in a native (non-React Native) Android app.\n- `examples/demo-pure-native-android`: Illustrates the subsidiary [Detox-Native](https://github.com/wix/Detox/blob/master/detox/detox-native/README.md) project.\n\nTo run end-to-end tests associated with these projects, refer to the [project-specific](https://github.com/wix/Detox/tree/master/examples) READMEs.\n"
  },
  {
    "path": "docs/contributing/code/overview.md",
    "content": "---\nsidebar_label: Overview\n---\n\n# Code Changes Overview\n\nWelcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions.\n\nOur collaborative workflow is simple:\n\n1. **Identify an Issue:** If not exists already, create an issue for new features or bug reports, outlining your proposal or the identified problem.\n2. **Propose a Solution:** Open a pull request with a proposed solution to the issue. On complex issues, it's recommended to discuss your approach with the community and maintainers before submitting a PR.\n3. **Engage in Review:** A collaborator will review your pull request. Reviews from other contributors are also encouraged.\n4. **Merge and Release:** After the review, a collaborator will merge your contribution, typically releasing it in the next version of the project.\n\nWe use [GitHub] for managing pull requests, conducting code reviews, and tracking issues.\n\nThe code review process is central to our collaboration. Every contribution must go through a review before merging to maintain the quality of our codebase. As a contributor, being willing to discuss your work, respond to feedback, and work with the community is key to improving the project and creating a positive environment for all contributors.\n\n## Repository Structure\n\nOur GitHub repository is a monorepo, which means it contains multiple Detox-related projects and packages.\n\nThe main package is the Detox framework, which is the core of the project.\nIt contains the native code for iOS and Android, as well as the JavaScript code.\nThe other projects are the Detox CLI, the Detox test app, example apps, and the Detox documentation website.\n\nHere's a high-level overview of the repository structure:\n\n- 📁 **detox-cli** - The CLI for Detox (e.g., `detox init`, `detox test`, read more about our [CLI docs])\n- 📁 **detox** - The Detox framework\n  - 📁 **android** - The Android native code, alongside native unit tests\n  - 📁 **ios** - The iOS native code, including its native submodules (e.g., DetoxSync)\n  - 📁 **test** - The Detox self-test app: A full-feature React Native app for end-to-end testing Detox itself\n    - 📁 **src** - The app's JavaScript code\n    - 📁 **e2e** - The Detox self-tests\n    - 📁 **integration** - Detox integration self-tests\n  - 📁 **local-cli** - Local CLI commands for Detox development (e.g., `detox rebuild-framework-cache`, which rebuilds the iOS framework)\n  - 📁 **runners** - The Detox runners, which are used to run the tests\n  - 📁 **scripts** - Scripts for building the framework for publishing\n  - 📁 **src** - The JavaScript source code of Detox. The include bundled JavaScript unit tests\n- 📁 **website** - The documentation website of Detox (read more about our [documentation site docs])\n- 📁 **docs** - The documentation of Detox, written in Markdown and published on the website\n- 📁 **examples** - Example apps for Detox (for more information, check the [list of example projects])\n- 📁 **scripts** - Scripts for building and testing Detox\n\n[GitHub]: https://github.com/wix/Detox\n[documentation site docs]: ../documentation.md\n[list of example projects]: ./example-projects.md\n[CLI docs]: ../../cli/overview.md\n"
  },
  {
    "path": "docs/contributing/code/reviewing-pull-requests.md",
    "content": "# Review a Pull Request\n\nReviewing a PR is an important part of the contribution process. It ensures the quality of the codebase and provides an opportunity for the community to collaborate and learn from each other.\n\n:::note\n\nReviewers should refer to the [Submitting Pull Requests] page to understand the guidelines the contributor followed when creating the PR. This will provide context and ensure a thorough review process.\n\n:::\n\n## Understand the Changes\n\n- Ensure alignment with the project’s coding standards and overall architecture.\n- Read the provided description and any linked issues for context.\n\n## Provide Constructive Feedback\n\nCommunity members can provide valuable feedback on PRs, especially if they have experience with the feature or area of the codebase.\n\n- Be respectful and courteous.\n- Offer code snippet suggestions if something could be done better.\n- Request changes if necessary and provide clear, constructive feedback.\n\n## Review the Code\n\nExperienced developers are encouraged to review PRs and provide feedback. This is a great way to learn more about the project and collaborate with the community.\n\nYou can review the code by following these requirements:\n\n- Alignment with coding standards and architectural guidelines.\n- Adequate test coverage (unit, integration, and e2e).\n- Ensure the documentation reflects the changes in the PR, if necessary. Refer to the [Documentation Changes] page for guidelines.\n- Meaningful and semantically correct commit messages.\n\n## Merging Pull Requests\n\nEvery PR requires approval from a maintainer before it can be merged.\n\nHowever, we encourage the community to review and provide feedback on PRs. Helping with the review process not only improves the quality of the code changes, but also helps the maintainers by reducing the workload.\n\n[Documentation Changes]: ../documentation.md\n[Submitting Pull Requests]: ./submitting-pull-requests.md\n"
  },
  {
    "path": "docs/contributing/code/setting-up-the-dev-environment.md",
    "content": "# Setting up the Development Environment\n\nThis document guides you through setting up your development environment to start contributing to our codebase.\n\n:::important Prerequisites\n\nPlease complete our [Introductory environment setup](introduction/environment-setup.md) guide before proceeding. This ensures you have the necessary tools and dependencies installed in order to _run_ Detox tests, which is a fundamental step before being able to contribute to the project itself.\n\n:::\n\n## Node.js\n\nWe recommend using [`nvm`](https://github.com/nvm-sh/nvm) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) to manage your Node.js versions. However, you can find our required Node.js version in the [`.nvmrc`](https://github.com/wix/Detox/blob/master/.nvmrc) file and install it using your preferred method or from the [official download page](https://nodejs.org/en/download/).\n\nCurrently, we require `lts/iron` (Node.js 20.x) for our development environment.\n\n:::tip\n\nThe exhaustive list of LTS codenames (e.g. `lts/iron`) can be found at [CODENAMES.md](https://github.com/nodejs/Release/blob/main/CODENAMES.md) in the Node.js repository.\n\n:::\n\n## Setting Up The Monorepo\n\nOur repository is a monorepo managed with Yarn workspaces. [Read more about our repository structure](../code/overview.md#repository-structure).\n\nTo set up the monorepo locally, follow these steps:\n\n### 1. Enable Corepack\n\nCorepack is Node.js's built-in package manager manager. Enable it to use the correct Yarn version:\n\n```bash\ncorepack enable\n```\n\n### 2. Clone the Repository\n\n```bash\ngit clone git@github.com:wix/Detox.git\ncd Detox\ngit submodule update --init --recursive\n```\n\n### 3. Install Dependencies\n\n```bash\nyarn install\n```\n\n:::note For Wix Internal Contributors\n\nSet the internal registry before installing:\n\n```bash\nexport YARN_NPM_REGISTRY_SERVER=\"<company's private npm registry>\"\nyarn install\n```\n\nYou can add this export to your shell profile (`~/.zshrc` or `~/.bashrc`) to make it permanent.\n\n:::\n\n## Installing Common Dependencies\n\n### React-Native CLI\n\n[react-native-cli] is a command line interface for React Native.\n\n```bash\nnpm install react-native-cli --global\n```\n\n### Watchman\n\n[Watchman] is a tool by Facebook for watching changes in the filesystem.\n\n```bash\nbrew install watchman\n```\n\n### xcpretty\n\n[xcpretty] is a fast and flexible formatter for xcodebuild.\n\n```bash\ngem install xcpretty\n```\n\n## Switching React Native Versions\n\nTo test against different React Native versions:\n\n```bash\nREACT_NATIVE_VERSION=0.77.0 ./scripts/change_all_react_native_versions.sh\n```\n\nThis updates the relevant `package.json` files and regenerates the lock file.\n\n## Common Commands\n\n| Command | Description |\n|---------|-------------|\n| `yarn install` | Install all dependencies |\n| `yarn workspaces foreach -A run build` | Build all packages |\n| `yarn workspace detox test` | Run detox tests |\n| `yarn workspace detox lint` | Run linting |\n\n[react-native-cli]: https://www.npmjs.com/package/react-native-cli\n[Watchman]: https://facebook.github.io/watchman/\n[xcpretty]: https://github.com/xcpretty/xcpretty\n"
  },
  {
    "path": "docs/contributing/code/submitting-pull-requests.md",
    "content": "# Submitting Pull Requests\n\n:::note\n\nBefore creating a PR, it's recommended to consult with the Detox collaborators. Request a design review or assistance with planning the tests to ensure alignment with project goals.\n\nContact us on our [Discord Server] or open an [issue on GitHub].\n\n:::\n\n## Fork the Repository\n\n- Fork the repository to your own GitHub account.\n- Create a new branch from the `master` branch for your work.\n\n## Test Your Changes\n\nBeing a testing framework, Detox is a highly self-tested project. Be sure to add/fix test coverage over your work, by running the various test flavors associated with your changes. You can review them, [here](./building-and-testing).\n\n## Modify Documentation\n\nIf your changes affect the public API, update the documentation accordingly to reflect your changes.\nRefer to the [Documentation Changes] page for guidelines.\n\n## Commit Message Guidelines\n\nWrite descriptive, meaningful commit messages that follow the **Conventional Commits** format, specifying the type of change, the scope, and a concise description. For example:\n\n```plaintext\nfix(ios): resolve crash on scrolling in iOS 17.0\nfeat(android): add new API for setting the device locale\ntest: update unit tests for new utility function\n```\n\nMore details on good commit messages can be found [here](https://www.conventionalcommits.org/en/v1.0.0/).\n\n## Open the Pull Request\n\n- Fill in the provided PR template fields on GitHub.\n- Provide a clear description of your changes and any necessary context.\n\n[Documentation Changes]: ../documentation.md\n[Discord Server]: https://discord.gg/CkD5QKheF5\n[issue on GitHub]: https://github.com/wix/Detox/issues/new/choose\n"
  },
  {
    "path": "docs/contributing/code-of-conduct.md",
    "content": "# Code of Conduct\n\n:::note Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant],\nversion 2.1, available at\n[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].\n\nCommunity Impact Guidelines were inspired by\n[Mozilla's code of conduct enforcement ladder][Mozilla CoC].\n\nFor answers to common questions about this code of conduct, see the FAQ at\n[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at\n[https://www.contributor-covenant.org/translations][translations].\n\n:::\n\nOur community is dedicated to providing a safe and inclusive environment for all contributors.\nTo ensure this, we have adopted the **[Contributor Covenant]** code of conduct.\nThis widely recognized and respected code of conduct sets clear guidelines for behavior, and it's easy for everyone to understand and follow.\n\nBy participating in the Detox community, you agree to abide by the terms of this code of conduct.\nWe take violations of this code of conduct seriously, and we will not tolerate any form of harassment or discrimination.\n\nIf you have any questions or concerns, please reach out to the project maintainers.\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our\ncommunity a harassment-free experience for everyone, regardless of age, body\nsize, visible or invisible disability, ethnicity, sex characteristics, gender\nidentity and expression, level of experience, education, socio-economic status,\nnationality, personal appearance, race, caste, color, religion, or sexual\nidentity and orientation.\n\nWe pledge to act and interact in ways that contribute to an open, welcoming,\ndiverse, inclusive, and healthy community.\n\n## Our Standards\n\nExamples of behavior that contributes to a positive environment for our\ncommunity include:\n\n- Demonstrating empathy and kindness toward other people\n- Being respectful of differing opinions, viewpoints, and experiences\n- Giving and gracefully accepting constructive feedback\n- Accepting responsibility and apologizing to those affected by our mistakes,\n  and learning from the experience\n- Focusing on what is best not just for us as individuals, but for the overall\n  community\n\nExamples of unacceptable behavior include:\n\n- The use of sexualized language or imagery, and sexual attention or advances of\n  any kind\n- Trolling, insulting or derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or email address,\n  without their explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Enforcement Responsibilities\n\nCommunity leaders are responsible for clarifying and enforcing our standards of\nacceptable behavior and will take appropriate and fair corrective action in\nresponse to any behavior that they deem inappropriate, threatening, offensive,\nor harmful.\n\nCommunity leaders have the right and responsibility to remove, edit, or reject\ncomments, commits, code, wiki edits, issues, and other contributions that are\nnot aligned to this Code of Conduct, and will communicate reasons for moderation\ndecisions when appropriate.\n\n## Scope\n\nThis Code of Conduct applies within all community spaces, and also applies when\nan individual is officially representing the community in public spaces.\nExamples of representing our community include using an official e-mail address,\nposting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported to the community leaders responsible for enforcement at [our Discord server].\nAll complaints will be reviewed and investigated promptly and fairly.\n\nAll community leaders are obligated to respect the privacy and security of the\nreporter of any incident.\n\n## Enforcement Guidelines\n\nCommunity leaders will follow these Community Impact Guidelines in determining\nthe consequences for any action they deem in violation of this Code of Conduct:\n\n### Correction\n\n**Community Impact**: Use of inappropriate language or other behavior deemed\nunprofessional or unwelcome in the community.\n\n**Consequence**: A private, written warning from community leaders, providing\nclarity around the nature of the violation and an explanation of why the\nbehavior was inappropriate. A public apology may be requested.\n\n### Warning\n\n**Community Impact**: A violation through a single incident or series of\nactions.\n\n**Consequence**: A warning with consequences for continued behavior. No\ninteraction with the people involved, including unsolicited interaction with\nthose enforcing the Code of Conduct, for a specified period of time. This\nincludes avoiding interactions in community spaces as well as external channels\nlike social media. Violating these terms may lead to a temporary or permanent\nban.\n\n### Temporary Ban\n\n**Community Impact**: A serious violation of community standards, including\nsustained inappropriate behavior.\n\n**Consequence**: A temporary ban from any sort of interaction or public\ncommunication with the community for a specified period of time. No public or\nprivate interaction with the people involved, including unsolicited interaction\nwith those enforcing the Code of Conduct, is allowed during this period.\nViolating these terms may lead to a permanent ban.\n\n### Permanent Ban\n\n**Community Impact**: Demonstrating a pattern of violation of community\nstandards, including sustained inappropriate behavior, harassment of an\nindividual, or aggression toward or disparagement of classes of individuals.\n\n**Consequence**: A permanent ban from any sort of public interaction within the\ncommunity.\n\n[Contributor Covenant]: https://www.contributor-covenant.org\n[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html\n[Mozilla CoC]: https://github.com/mozilla/diversity\n[FAQ]: https://www.contributor-covenant.org/faq\n[translations]: https://www.contributor-covenant.org/translations\n[our Discord server]: https://discord.gg/CkD5QKheF5\n"
  },
  {
    "path": "docs/contributing/documentation.md",
    "content": "# Documentation Site\n\nContributions towards enhancing our documentation are highly valued in the Detox community.\nClear, concise, and comprehensive documentation enables users to understand and utilize the project more effectively.\n\nWe appreciate all contributions, from correcting typos to creating new documentation pages.\n\n## Getting Started\n\nOur [documentation website](https://wix.github.io/Detox) is developed using [Docusaurus](https://docusaurus.io/). To set up a local version of the website for editing, follow these steps:\n\n```bash npm2yarn\ncd website\nnpm install\nnpm start\n```\n\n## Making Updates\n\nTo modify an existing page, find the associated markdown file in the `docs/` directory and make the required changes. To introduce a new page, create a markdown file in `docs/` and link to it in `website/sidebars.json`.\n\n## Deploying Changes\n\nAutomatic updates to the website occur with each commit to the `master` branch, with these changes reflected under the `Next` version. The process of tagging and locking documentation to a specific version is automated and coincides with each Detox release.\n\nIf there's a need to update the documentation of a particular version, modify the associated files and code located under `website/versioned_docs/version-<version>/` and `website/versioned_sidebars/version-<version>-sidebars.json`.\n\n## Modifying Old Versions\n\nTo update an older version with the latest changes:\n\n1. Remove the desired version from `versions.json`.\n1. Execute `npm run docusaurus docs:version <version>`.\n\n## Reviewing Style Modifications\n\nIf you're making changes to the stylesheets, use this [demo page](../demo.mdx) to visually inspect the impact of your changes and avoid unintentional visual regressions.\n"
  },
  {
    "path": "docs/contributing/feature-requests.md",
    "content": "# Feedback and Suggestions\n\nOpen dialogue and feedback, particularly feature requests, play an invaluable role in open-source communities like Detox. They provide insights into user preferences and requirements, aiding in the refinement and enhancement of the project.\n\nDetox project provides various platforms for feedback: [GitHub Issues], [Twitter], and [Discord].\n\nKeep in mind that feedback is varied, including feature suggestions, improvements, identification of missing functionality, and support requests. Each type of feedback has a preferred method of submission.\n\n## Giving Feedback\n\nFollow these tips to deliver clear, actionable feedback:\n\n- **Constructive Criticism:** Frame your feedback in a positive light, understanding the perspective of the project maintainers.\n- **Comprehensive Details:** Include as much relevant information as possible to help maintainers understand the context and use case.\n- **Clarity and Respect:** Make your feedback specific, clear, and respectful, ensuring it is actionable for the maintainers.\n- **Guidelines:** Adhere to the below suggestions for each type of feedback.\n\n## Suggesting Features\n\nWhen suggesting a new feature, remember to provide thorough information, such as examples, screenshots, and code snippets, to communicate your idea effectively.\n\nJust as in general feedback, make sure your feature request is:\n\n- **Specific:** Clearly describe the feature you wish to see implemented.\n- **Detailed:** Offer as much context as possible, including use cases, examples, and why this addition would benefit the community.\n- **Respectful:** Remember, the project maintainers or contributors are not obligated to implement your request. Be polite and respectful in your request.\n\nBy making your feedback as clear and detailed as possible, you'll greatly assist the maintainers in understanding and potentially implementing your suggestion.\n\n[GitHub Issues]: https://github.com/wix/Detox/issues\n[Twitter]: https://twitter.com/detoxe2e\n[Discord]: https://discord.gg/CkD5QKheF5\n"
  },
  {
    "path": "docs/contributing/questions/answering-questions.md",
    "content": "# Answering Questions\n\nContributing answers is an invaluable part of supporting the Detox community. By sharing your knowledge and experience, you help others learn and grow, and you also contribute to enhancing Detox for the entire community.\n\n## Different Ways to Answer\n\nAnswering a question is not limited to providing a solution in the comments.\nSometimes, you may not have a solution, but you can still contribute by:\n\n- **Guide towards a solution**: If unsure about an answer, provide guidance on where to look, including relevant documentation or resources.\n- **Request more information**: Ask for more detail if required to better address the question. For example, you may ask for code snippets, screenshots, or reproducible examples.\n- **Refer to existing answers**: Link an already answered question if applicable.\n\n## Guidelines for Writing Clear Answers\n\nWhen answering questions, follow these guidelines to ensure your answers are clear and actionable:\n\n- **Be specific**: Try to pinpoint what exact information you need to effectively answer the question. General requests such as \"Please share more details\" are not very helpful.\n- **Maintain respect**: Ensure your communication is always polite and contextual. When asking for more information, it's better to explain why it's needed so that the person asking understands the relevance.\n- **Completeness**: Make sure to provide a detailed answer that includes all relevant information, such as code snippets, screenshots, and examples. This practice helps others understand your answer and apply it to their use case.\n\n:::tip In a Nutshell\n\nWhen you're answering a question, remember to be specific, clear, and respectful. By providing detailed and well-thought out response, you will play an important role in contributing to and enhancing the knowledge of our community.\n\n:::\n"
  },
  {
    "path": "docs/contributing/questions/asking-questions.md",
    "content": "# Asking Questions\n\nPosting queries on public forums increases visibility and chances of getting an answer, and it also helps others with similar issues. However, it's essential to ask questions the right way to get the right answers.\n\nIn case you were able to resolve your issue, consider sharing your solution with the community. By doing so, you contribute to enhancing Detox for the entire community.\n\n## Before Asking\n\nIn case you're facing an issue, consider the following steps before posting a question:\n\n- **Suspect a bug?** Refer to our [Reporting Bugs] guide to determine if you've encountered a Detox bug and how to report it.\n- **Search** for existing answers that may have addressed your question already. [Below](#where-to-ask), we've listed the right platforms to ask (and search) questions.\n- Review our **documentation** thoroughly for any related information. Use <a href=\"#\" onClick={() => document.querySelector('.DocSearch-Button').click()}>the search bar</a> in the top right corner to streamline your search.\n\nIf an existing answer doesn't fully address your question, feel free to ask a follow-up in the same thread if comment-enabled or create a new question, linking back to the original one if possible.\n\n## Where to Ask\n\nIf you can't find an answer to your question, you can ask it in the following ways:\n\n- **Discord**: Join our dedicated [Discord server][Discord] to seek community assistance.\n- **Stack Overflow**: Tag your question with [\"Detox\" on Stack Overflow] to reach the right audience.\n- **GitHub**: Raise an issue on our [Detox repository].\n\n:::tip Pro Tip\n\nWhen posting a question, ensure to include all relevant information, such as code snippets, screenshots, and examples. This practice helps others understand your query and provide comprehensive answers.\n\n:::\n\n[Reporting Bugs]: ../reporting-bugs.md\n[Discord]: https://discord.gg/CkD5QKheF5\n[Detox repository]: https://github.com/wix/Detox/issues\n[\"Detox\" on Stack Overflow]: https://stackoverflow.com/questions/tagged/detox\n"
  },
  {
    "path": "docs/contributing/reporting-bugs.md",
    "content": "# Reporting Bugs\n\nEncountering a bug? Your detailed report is key for us to identify and rectify the issue.\n\nBefore reporting a bug, please review the following guidelines.\n\n## Search for Existing Issues\n\nBefore creating a new issue, search for [existing issues] to see if the bug has already been reported.\nIf you find an existing issue, add a comment to it with any additional information you have.\n\n## Create a Bug Report\n\nIf you can’t find an existing issue, create a new one. When creating a bug report, follow these guidelines:\n\n1. **Follow the Template:** While [creating a bug report on GitHub], adhere to the provided template for creating a clear and concise report.\n2. **Reproduction Steps:** Providing a reproduction example is essential.\n3. **Artifacts:** Include screenshots, logs, visibility artifacts, and any other relevant information. Be ready to provide more information upon request.\n4. **Detailed Description:** Avoid creating issues with brief descriptions or general error messages. Providing a thorough description and context is vital.\n\n:::tip Tip\n\nCreating a minimal code reproduction is crucial as it helps other contributors and maintainers understand and investigate the issue better.\n**Issues without a reproduction are less likely to be addressed**.\n\n:::\n\n[existing issues]: https://github.com/wix/Detox/issues\n[creating a bug report on GitHub]: https://github.com/wix/Detox/issues/new/choose\n"
  },
  {
    "path": "docs/contributing.md",
    "content": "# Contributing to Detox\n\nDetox, an open-source project, greatly values community involvement. Whether you're a mobile developer, QA specialist, or an open source enthusiast, your contribution could significantly enhance the reliability, user experience, and development process of mobile applications.\n\n## Our Code of Conduct\n\nTo ensure an inclusive, safe environment for all contributors, we adhere to the [Contributor Covenant code of conduct]. This well-recognized code provides clear guidelines for respectful behavior.\n\n## Ways to Contribute\n\nAll contributions, regardless of size, can help shape Detox. We welcome:\n\n- **[Questions]**: Your inquiries can help identify gaps in our documentation and benefit all users.\n- **[Answers]**: Assisting other Detox users by providing guidance or responses to their questions.\n- **[Bug Reports]**: Help us identify and resolve Detox issues.\n- **[Feature Suggestions]**: Your ideas for new features can help us improve Detox according to user needs.\n- **[Code Contributions]**: Directly contribute by fixing bugs, adding features, or improving our codebase.\n- **[Code Reviews]**: Help maintain the quality of our codebase by reviewing others' contributions.\n- **[Documentation Enhancements]**: Improve Detox documentation from user guides to API references.\n- **Content Creation**: Share your knowledge of Detox through blog posts, tutorials, videos, and more. We're always excited to share your content on our [Twitter account] and [Discord server].\n\nYour active participation helps build a vibrant community dedicated to improving mobile development.\n\n## Engaging in the Community\n\nJoin our [Discord server] to discuss Detox, ask questions, and provide help. Follow our [Twitter account] for updates on the project.\n\nBecoming an active community member is a great way to start contributing to Detox. It provides familiarity with the project, helps identify opportunities to contribute, and allows guidance from other contributors. The more you engage, the more recognition your contributions receive and the greater impact you can make on the project's direction.\n\n## Appreciation and Recognition\n\nAll our contributors deserve recognition. We express our gratitude by featuring them in our [Release Notes].\n\n### Core Contributors Program\n\nWe plan to launch a \"Core Contributor\" program for individuals who have significantly contributed to Detox and shown deep understanding of the project while being active in the community. Core contributors will be invited to a private Discord channel for exclusive discussions and will receive a distinguished role on our Discord server.\n\n[Contributor Covenant code of conduct]: contributing/code-of-conduct.md\n[Questions]: contributing/questions/asking-questions.md\n[Answers]: contributing/questions/answering-questions.md\n[Bug Reports]: contributing/reporting-bugs.md\n[Feature Suggestions]: contributing/feature-requests.md\n[Code Contributions]: contributing/code/overview.md\n[Code Reviews]: contributing/code/reviewing-pull-requests.md\n[Documentation Enhancements]: contributing/documentation.md\n[Discord server]: https://discord.gg/CkD5QKheF5\n[Twitter account]: https://twitter.com/detoxe2e\n[Release Notes]: https://github.com/wix/Detox/releases\n"
  },
  {
    "path": "docs/demo.mdx",
    "content": "---\ntitle: Internal Demo Page for Styling\n---\n\nimport CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<head>\n  <meta name=\"robots\" content=\"noindex, nofollow\" />\n</head>\n\n:::note\n\nThis page is for internal use only. If you are a contributor to the Detox project, you can use this page to test your changes to the website documentation pages\nstyling. If you are not a contributor, you can ignore this page. Follow this link to the [Detox Home Page](/).\n\n:::\n\n## Headings section\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### Third level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n#### Fourth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n#### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n##### Fifth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n##### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n###### Sixth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### `example.​heading.​with.​a.​very.​very.​and.​really.​very.​long.​line.​which.​should.​be.​wrapped` \\[string \\| number\\]\n\n- Lorem ipsum dolor sit amet, consectetur elit, sed do eiusmod tempor `incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam`, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.)\n\n###### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n## Paragraphs section\n\nDummy double-spaced paragraph example, consectetur adipiscing elit. Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue, eget bibendum nibh tellus a mi.<br/>Integer blandit, enim quis malesuada fringilla, elit augue pellentesque justo, eget euismod elit sapien id magna. Sed molestie ultrices metus, a congue erat.\n\nThis is a regular text, an _italic text_, a **bold text**, a ***both italic and bold text***, a ~~strikethrough text~~, an `inline code text`, a [simple link](#), and a [`link with inline code`](#).\n\n```plain text\nHere is an example of a code block with plain text.\n// highlight-next-line\nAnd this is a highlighted line.\n```\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue, eget bibendum nibh tellus a mi. Integer blandit, enim quis malesuada fringilla, elit augue pellentesque justo, eget euismod elit sapien id magna. Sed molestie ultrices metus, a congue erat.\n\n![This is a placeholder image.](img/demo/placeholder.png)\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit:\n  - `dummy.config.js` – dummy config file;\n  - `dummy.test.js` – dummy test file;\n- Donec in dui eget metus aliquet facilisis ac eget tortor.\n- Donec scelerisque ex lacinia, commodo eros eget, pretium leo.\n\n## Table section\n\nA simple table:\n\n| Dummy Params | Details of Dummy Text Data                                                                                                                                                                                                          |\n| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`       | **Required.** String Literal. Dummy property to discern device types: dummy.simulator, dummy.emulator, dummy.attached, dummy.genydummy etc.                                                                                         |\n| device       | **Required.** Object. Device query, e.g. `{ \"byType\": \"dummy_phone\" }` for dummy simulator, `{ \"avdName\": \"dummy_avd\" }` for dummy emulator or `{ \"adbName\": \"<pattern>\" }` for attached dummy device with name matching the regex. |\n| `bootArgs`   | _Optional. String. Supported by dummy.simulator and dummy.emulator only_ <br/> Supply an extra String of arguments to dummy_simctl boot ... or emulator -verbose ... @AVD_Name.                                                     |\n\nA workaround for displaying images side by side:\n\n| ![Left image](img/demo/left-image.png) | ![Right image](img/demo/right-image.png) |\n| ---------------------------------------------------------------------- | ------------------------------------------------------------------------ |\n\n## Admonitions section\n\n:::caution\n\nRhoncus magna eget, pellentesque auguerhoncus magna eget, pellentesque augue **Android** due to DUMMY issues:\n\n- [rhoncus magna eget, pellentesque auguerhoncus magna eget](#)\n- [Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue](#)\n- [pellentesque auguerhoncus magna eget](#)\n\n:::\n\n:::danger DANGER\n\nThis is a DANGER admonition SAMPLE with a custom background color, and a border color.\n\n:::\n\n:::info\n\nIf your app Dummy uses [DUMMYPods] (all modern React DUMMY projects do since `0.999.0`), make sure\nto run `DUMMY pod install` in your `ios/` folder before building.\n\nIf your DUMMY project doesn't use the DUMMY pods, then you won't have any `YourDUMMYApp.xdummyworkkspace` in your iOS DUMMY Project.\nYou should DUMMY search instead for something like `YourDUmmyApp.dummy` there, and see your DUMMY build command accordingly:\n\n```diff title=\"apps.diff\"\n   apps: {\n     'dummy.debug': {\n       type: 'dummy.app',\n-      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n+      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n-      build: 'dummy_command -workspace dummy/YOUR_APP.dummyworkspace -scheme YOUR_APP -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n+      build: 'dummy_command -workspace dummy/example.dummyworkspace -scheme example -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n```\n\n:::\n\n:::note NOTE\n\nThis is a NOTE admonition SAMPLE with a custom background color, and a border color.\n\n:::\n\n:::tip\n\nLorem ipsum `dolor sit amet`, (Sed porttitor purus ac risus bibendum), PELLENTESQUES back to\n[Fusce tempor nisl euismod](#) rhoncus magna eget, pellentesque auguerhoncus magna eget,\npellentesque augue **Fusce tempor nisl euismod**, rhoncus pellentesques magna tempus augue mollis.\n\nDonec in nulla `AUCTOR_SED_MALESUADA` (or `AMALESUADA_MASSA`) eros posuere\nCurabitur elementum mi massa, non molestie ipsum velit vel:\n\n<Tabs groupId=\"whateverId\">\n  <TabItem value=\"tab1\" label=\"Tab 1\">\n    <CodeBlock language=\"bash\">$ANDACISUS_SED_EGET/rhoncus/tempus -augue-mollis</CodeBlock>\n  </TabItem>\n  <TabItem value=\"tab2\" label=\"Tab 2\">\n    <CodeBlock language=\"bash\">$ANDACISUS_SED_EGET/rhoncus/tempus -augue-mollis</CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::\n\n## Syntax highlighting section\n\n### npm\n\n```bash npm2yarn\nnpm install \"dummy_package\" --save\n```\n\n### Shell\n\n```shell\n// highlight-start\n# Check the exit status of the last command\nif [ $? -eq 0 ]; then\n    echo \"dummy_command succeeded\"\n// highlight-end\nelse\n    echo \"dummy_command failed\"\nfi\n```\n\n### JSX\n\n```jsx title=\"src/DummyExample.jsx\"\nimport { DummyButton } from 'dummy-react-library';\n\n// A dummy component\nfunction DummyExample() {\n// highlight-next-line\n  const [dummyState, setDummyState] = React.useState(false);\n\n  return (\n    <DummyContainer>\n      <DummyButton onClick={() => setDummyState(!dummyState)}>\n        Click me\n      </DummyButton>\n    </DummyContainer>\n  );\n}\n```\n\n### Java\n\n```java\npackage com.dummy;\n\n@Test\npublic class DummyClass {\n    // A dummy comment\n    public static void main(String[] args) {\n        int dummyVariable = 5;\n// highlight-start\n        for (int i = 0; i < 10; i++) {\n            dummyVariable += i;\n            System.out.println(\"The dummy value is \" + dummyVariable);\n        }\n// highlight-end\n    }\n}\n```\n\n### diff\n\n```diff\n   apps: {\n     'dummy.debug': {\n// highlight-start\n       type: 'dummy.app',\n-      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n+      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n// highlight-end\n-      build: 'dummy_command -workspace dummy/YOUR_APP.dummyworkspace -scheme YOUR_APP -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n+      build: 'dummy_command -workspace dummy/example.dummyworkspace -scheme example -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n```\n\n### JSON\n\n```json\n{\n  \"items\": {\n    \"object1\": {\n      \"property1\": \"dummy_type\",\n      \"property2\": \"dummy_device\",\n// highlight-next-line\n      \"property3\": [\"dummy_path/to/dummy_file.dummy\"]\n    }\n  }\n}\n```\n\n### YAML\n\n```yaml\nactions:\n  - dummy install example\n    - push_dummytext: \"*\"\n\n  - dummy install example --save global\n  # Lorem ipsum dolor sit amet, consectetur SampleCo is using ($DUMMY/lorem-text)\n```\n\nThanks for checking with this visual regression suite!\n"
  },
  {
    "path": "docs/guide/android-dev-env.md",
    "content": "---\ntitle: Setting Up an Android Development & Testing Environment\n---\n\nThis guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) – be it on a personal, _local_ computer, or a powerful CI machine.\n\nNote that running automated UI tests is _not the same_ as developing Android apps. Hence, you may find yourself not 100% aligned with the recommendations here, and should consider being so.\n\n## Java Setup\n\nThis is the most basic step in the process, as without a proper Java SDK installed, nothing Android-ish works – at least not from command-line, which is mandatory for executing `Detox`.\n\n_The bottom line is that **Android needs Java installed**. If you want to run with React Native 73 and Android 14 then it needs to be at least Java 17, otherwise you should have Java 11._\n\nTo check for your real java-executable’s version, in a command-line console, run:\n\n```bash\njava -version\n```\n\nWhat needs to be verified is that `java` is in-path and that the output contains something like this:\n\n```bash\njava version \"17.x.x\"\n...\n```\n\n> Note: Do not be confused by the Java version potentially used by your browsers, etc. For `Detox`, what the command-line sees is what matters.\n\n---\n\nIf `java -version` yields an error, it is likely that `java` is either not in your path or not even installed at all. To try to understand which of the two is true, use [this guide](https://www.java.com/en/download/help/path.xml).\n\nIf otherwise the version is simply wrong, try these course of actions:\n\n- On MacOS, in particular, Java comes from both the OS _and_ possibly other installers such as `homebrew`. That can really get things tangled up. To mitigate:\n  - Use one of the options suggested in this [Stack Overflow post](https://stackoverflow.com/questions/52524112/how-do-i-install-java-on-mac-osx-allowing-version-switching/52524114#52524114).\n  - Install OpenJDK 17 on top of the existing versions ([how to check?](https://medium.com/notes-for-geeks/java-home-and-java-home-on-macos-f246cab643bd)): <https://java.tutorials24x7.com/blog/how-to-install-openjdk-17-on-mac>. Consider employing the `JAVA_HOME` variable to get things to work right. _Note: This is more suitable if your environment is fairly clean, and does not contain versions from 3rd-party installers (e.g. `homebrew`)._\n- Use these refs, which might be useful:\n  - <https://java.com/en/download/faq/java_mac.xml#version>\n  - <https://www.java.com/en/download/help/version_manual.xml>\n\n## Android SDK\n\nIf you have Android Studio installed - as most of us do, then the SDK should be available for you somewhere on your machine<sup>\\*</sup>. However, for CI agents – possibly running with no GUI, or if you simply don’t want the somewhat bloated piece of software on your computer, it is possible to simply download the SDK and tool-set, purely. Both cases are covered in Google’s [Android guide about Android Studio](https://developer.android.com/studio/). For the pure-tools option, refer to the `Command line tools only` section at the bottom.\n\nFor more help on setting the SDK up, [this guide might be helpful](https://www.androidcentral.com/installing-android-sdk-windows-mac-and-linux-tutorial).\n\nWhatever option you choose, and whichever platform you’re running on (Mac, Linux, Windows), we strongly recommend that eventually you would have 2 additional things set up:\n\n- The path to the SDK’s root directory is set into the `ANDROID_SDK_ROOT` [environment variable](https://developer.android.com/studio/command-line/variables).\n- The path to the SDK’s root directory is bundled into the global [`PATH`](https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them) on your computer.\n\n_<sup>\\* Inspect the content of your `ANDROID_SDK_ROOT` and `ANDROID_HOME` environment variables.</sup>_\n\n## Android (AOSP) Emulators\n\nMobile-apps’ automation needs an Android device to run on. If you haven’t already done so, you should [set up an Emulator](https://developer.android.com/studio/run/emulator). But, wait - don’t go and install the default one: read through, first.\n\nWe’ve long proven that for automation - which requires a stable and deterministic environment, Google’s emulators running with Google APIs simply don’t deliver what’s needed. Be it the preinstalled Google play-services - which tend to take up a lot of CPU, or even Google’s `gboard` Keyboard - which is full-featured but overly bloated: These encourage flakiness in tests, which we are desperate to avoid in automation.\n\nFortunately, the Android team at Google offers a pretty decent alternative: **AOSP emulators** (Android Open-Source Project). While possibly lacking some of the extended Google services, and a bit less fancy overall, **we strongly recommend** to strictly use this flavor of emulators for running automation/Detox tests. They can be installed alongside regular emulators.\n\n_Here’s a visual comparison between the two - an SDK 28 (Android 9) AOSP emulator (left) vs. an emulator with Google APIs installed (right):_\n\n![AOSP vs Google-API](../img/android/aosp-vs-googleapi.png)\n\n### Here’s how to install them using the command line\n\nWhile it’s possible to do this using Android Studio, we’ll focus on the command line, as it is also good for _headless_ CI machines.\n\n1. Locate your 'Android home' folder - typically set in the `ANDROID_HOME` environment variable, or in its predecessor - `ANDROID_SDK_ROOT`. If `ANDROID_HOME` isn’t set, either set it yourself or run the following commands after `cd`-ing into the home folder.\n\n1. Preliminary: Upgrade your `emulator` executable to the latest version.\n   _Note: It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n   ```sh\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install emulator\n   ```\n\n   :::note\n\n   In previous Android Studio versions, the SDK-Manager path was located at `$ANDROID_HOME/tools/bin/sdkmanager`.\n   We highly recommend working with the latest version, however, in case you are working with an old version, and this command fails, try this path instead.\n\n   The command might also fail if the command-line tools aren’t installed. To install the tools using Android Studio, click `Tools > SDK Manager` and select the `SDK Tools` tab. Ensure that `Android SDK Command-line Tools (latest)` is checked and applied.\n\n   :::\n\n1. Install an emulator image without Google APIs:\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \"system-images;android-28;default;x86_64\"\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses\n   ```\n\n   > - With `;android-28;`, we assumed SDK 28 here, but other APIs are supported just the same.\n   > - The `;default;` part replaces `;google_apis;`, which is the default, and is what matters here.\n   > - If you are running on a M1 you must install an arm64 architecture i.e. `system-images;android-28;default;arm64-v8a`\n   > - To get a list of available images, run `$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list`\n\n1. Create an emulator (i.e. AVD - Android Virtual Device):\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_28_AOSP -d pixel --package \"system-images;android-28;default;x86_64\"\n   ```\n\n   > - `Pixel_API_28_AOSP` is just a suggestion for a name. Any name can work here, even `Pixel_API_28` - but you might have to delete an existing non-AOSP emulator, first. In any case, the name used in Detox configuration (typically in `package.json`) should be identical to this one.\n   > - `-d pixel` will install an emulator with the specs of a Pixel-1 device. Other specs can be used. Running `$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list devices` will list all available device specs.\n   > - `--package` is the most important argument: be sure to use the same value as you did in part 2, above, with `;default;`.\n   >\n   > Run `avdmanager create --help` for the full list of options.\n\n1. Launch the emulator:\n\nThis isn’t mandatory, of course, but it’s always good to launch the emulator at least once before running automated tests. The section below will discuss optimizing emulators bootstrapping.\n\nAt this point, you should be able to launch the emulator from Android Studio, but that can also be done from a command line console, as explained in the [cheatsheet below](#locating-the-avds-home-directory).\n\n> See [this guide](https://developer.android.com/studio/run/emulator-commandline) for full details on the `emulator` executable.\n\n### Installing from Android Studio\n\nWe won’t go into all the details but once the proper image is installed using the `sdkmanager`, the option becomes available in the AVD creation dialog (see `Target` column of the Virtual Device Configuration screen below):\n\n![SDK manager in AS](../img/android/aosp-image-as.png)\n\n![Install AOSP in AS](../img/android/install-aosp-as.png)\n\nAlso, be sure to upgrade your emulator executable to the latest version: If it isn’t up-to-date, you will get an \"Update Available\" message under the _status_ column, instead of \"Installed\":\n\n![Upgrade emulator in AS](../img/android/upgrade-emulator-as.png)\n\n**Note:** _It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n## Emulator Quick-Boot\n\nIf the system allows saving a state (for example, in personal computers or a CI system that can start from prebaked images you can configure), we highly and strongly recommend setting up quick-boot snapshots for any emulator that is used for testing automation.\n\nQuick-boot saves significant time otherwise wasted when emulators cold-boot from scratch. The concept becomes more prominent in environments capable of parallel-executing tests in multiple, concurrently running emulators (as when [Detox is run with multiple Jest workers](../config/testRunner.mdx)).\n\nThis is something that we actually recommend applying in the emulator itself rather than using command-line, but we’ll include both options.\n\nIn any case, the general principle we’re going to instruct is as follows:\n\n1. Enable auto-save for an installed / running emulator.\n1. Launch it, and, when stable, terminate – a snapshot is saved as a result.\n1. Disable auto-save, so that future, test-tainted snapshots won’t be saved.\n\n### Setting up a quick-boot snapshot from the Emulator\n\nStart by launching a freshly baked emulator. Wait for it to go stable.\n\nWhen running, go to settings (3 dots in the sidebar) > `Snapshots` > `Settings` tab. If not already set, select `Yes` in the `auto-save` option. This should prompt for a restart – choose `Yes`. The emulator should restart **and save a snapshot.**\n\n![Emulator auto-save menu](../img/android/snapshot-autosave.png)\n\nDo this again after the emulator is back up, but set `No` in the `auto-save` option. Allow it to restart yet again: it will immediately boot into the state saved as a snapshot earlier.\n\nYou can also try these as alternative sources for this:\n\n- [Snapshots in Google Developers page](https://developer.android.com/studio/run/emulator#snapshots) for full details on snapshots.\n- [Highly detailed blog post](https://devblogs.microsoft.com/xamarin/android-emulator-quick-boot/)\n\n### Setting up a quick-boot snapshot from command-line\n\nThis is a bit more difficult, but is also applicable even for UI-less machines.\n\n1. [Locate the AVD’s `config.ini`](#locating-the-avds-home-directory)\n1. Using your favorite text editor, either change or add these key-value sets:\n\n   ```ini\n   fastboot.chosenSnapshotFile=\n   fastboot.forceChosenSnapshotBoot=no\n   fastboot.forceColdBoot=no\n   fastboot.forceFastBoot=yes\n   ```\n\n> Empirically, `forceFastBoot=yes` and `forceColdBoot=no` should be enough.\n\n1. Under the AVD’s home directory, either create or edit yet another `ini` file called `quickbootChoice.ini` with the following content:\n\n   ```ini\n   saveOnExit = true\n   ```\n\n1. Now that everything is in place, [launch your emulator](#booting-an-emulator-via-command-line) once (in verbose mode) and wait for it to fully load. Then, shut it down, and make sure the [state has been saved](#verifying-the-emulators-quick-boot-snapshot-has-been-saved).\n\n1. Last but not least, go back to `quickbootChoice.ini` and now switch to:\n\n   ```ini\n   saveOnExit = false\n   ```\n\n### Test Butler Support (Optional)\n\nIf, when setting up your work environment, you’ve selected Google emulators with an AOSP image as the test target - as recommended,\n**we strongly encourage** you would also integrate [Test Butler](https://github.com/linkedin/test-butler): in the very least - in order to suppress crash and ANR dialogs.\nThey are a soft spot in UI testing on Android, all around, as - when displayed,they make the UI entirely inaccessible (and thus cause tests to fail in bulks).\n\nSetting Test Butler up for working with Detox is a bit different than explained in their guides. The process, as a whole, is twofold:\n\n1. Preinstalling the test-butler-app APK onto the test device.\n1. Integrating the test-butler-lib into your own test APK, and initializing it in a custom test runner (as explained).\n\nThe library part can be easily achieved as explained there (i.e. by using Gradle’s `androidTestImplementation`). Same goes for initialization. As for the APK, the suggested usage of Gradle’s `androidTestUtil` is scarce when running with Detox (i.e. non-native instrumentation tests). Here’s what to do instead.\n\n> _For a complete and thorough coverage of the Test Butler integration with Detox, consider going over our [blogpost on CI execution](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f) on medium_.\n\n#### Solution 1: Prebaked Images\n\nIf you have control over the emulators’ snapshots, simply download (see test-butler’s guide) and install the test-butler APK once (e.g. use `adb install -r -t path/to/test-butler-app.apk`), and save an updated version of the snapshot. This is the best solution.\n\n> Note: you will have to reiterate this if you upgrade to a newer version of Test-Butler, in the future.\n\n#### Solution 2: Dynamic Installation\n\nAssuming you have the APK available in the system, you can dynamically have Detox automatically install it in all of the running target-emulators by utilizing `utilBinaryPaths` in your Detox configuration. Example:\n\n```json\n{\n  \"devices\": {\n    \"emulator.oss\": {\n      \"type\": \"android.emulator\",\n      \"device\": \"...\",\n      \"utilBinaryPaths\": [\"relative/path/to/test-butler-app-2.2.1.apk\"]\n    }\n  }\n}\n```\n\n> Refer to our [configuration guide](../config/apps.mdx) for further details on `utilBinaryPaths`.\n\nAs per _making_ the APK available - for that, we have no really good solution, for the time being (but it’s in the works). A few options might be:\n\na. In a custom script, have it predownloaded from Maven directly, as suggested in the Test Butler guide. For example (on a Mac / Linux):\n\n```bash\ncurl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk\n```\n\n> Should you decide to go this path, we recommend you add `./temp/test-butler-app.apk` to the relevant `.gitignore`.\n\nb. (Discouraged) Add it to your source control (e.g. git), as part of the repository.\n\n### Disclaimer\n\nAfter upgrading the emulator’s binary to a newer version, it usually considers all existing snapshots invalid.\n\nThis can be addressed by deleting and recreating the snapshots as explained, or by recreating the AVD’s altogether.\n\n## Cheatsheet\n\n### Locating the AVD’s home directory\n\nEach AVD generated by the Android tools gets its own directory where associated content is stored:\n\n- **Configuration file (i.e. `config.ini`)**\n- Snapshot images\n- SD-card content\n\nto name a few.\n\nOn Mac machines, the AVD directory typically maps to:\n\n```bash\n$HOME/.android/avd/<AVD Name>.avd/\n```\n\n_(for example: `/Users/root/.android/avd/Pixel_API_28_AOSP.avd/`)_\n\nThe path should be similar on Linux machines, even though `$HOME` isn’t `/Users/root` but typically `/home/root` _(for example: `/home/root/.android/avd/Pixel_API_28_AOSP.avd/`)._\n\n### Booting an emulator via command-line\n\n> - The following examples apply for both Mac and Linux, and should be similar on Windows.\n> - They assume the emulator’s name is `Pixel_API_28_AOSP`. If it isn’t, adjust the names accordingly:\n\n#### Shortcut for booting a verbose, visible emulator in a GUI supporting system\n\n```bash\n$ANDROID_HOME/emulator/emulator -verbose @Pixel_API_28_AOSP &\n```\n\n**Shortcut for booting a verbose, _headless_ emulator in a UI-less Linux system**\n\n```bash\n$ANDROID_HOME/emulator/emulator -verbose -no-window -no-audio -gpu swiftshader_indirect @Pixel_API_28_AOSP &\n```\n\n### Verifying the emulator’s quick-boot snapshot has been saved\n\nIf you’ve run your emulator in verbose mode from a shell, it’s easy to verify the state has been saved by following the logs. In particular, when shutting the emulator down, this log asserts the state has been saved:\n\n```plain text\nemulator: Saving state on exit with session uptime 9423 ms\n```\n\n> as a reference, when the state is _not_ saved, the typical output is:\n>\n> ```plain text\n> emulator: WARNING: Not saving state: RAM not mapped as shared\n> ```\n>\n> It can be a result of an improper configuration, or an emulator launch where the `-read-only` argument was provided.\n"
  },
  {
    "path": "docs/guide/cucumber-js-integration.md",
    "content": "# Cucumber.js Integration\n\n:::note Community resource\n\nThis is an article generously contributed [by the community][initial PR].\nFeel free to [contribute to it][Contributing] by submitting a pull request\nif you find any errors or have suggestions for improvements.\nIf you have any questions, please get in touch with the author directly.\n\n:::\n\n[Cucumber] is a tool for running automated tests written in plain language.\nIt can be integrated with Detox to run end-to-end tests for mobile applications\nif you manage [Detox Internals API] from [Cucumber.js hooks].\n\nIn your `init.js` or `init.ts` file, please import `detox/internals` on top of the file:\n\n```js\nimport detox from 'detox/internals'\n```\n\nAlso import the hooks we'll be using just a bit later:\n\n```js\nimport { Before, BeforeAll, AfterAll, After,  ITestCaseHookParameter } from '@cucumber/cucumber'\n```\n\nDefine the earliest [Cucumber.js] hook, `BeforeAll`, where you’ll [initialize][`detox.init()`] Detox and launch the app:\n\n```js\nBeforeAll({ timeout: 120 * 1000 }, async () => {\n    await detox.init()\n    await device.launchApp()\n})\n```\n\nYou must also tell Detox explicitly when [Cucumber.js] starts a test via calling [`detox.onTestStart()`] inside `Before` hook.\nOtherwise, Detox won't be able to _start recording_ logs, screenshots, videos, and other artifacts:\n\n```js\nBefore(async (message: ITestCaseHookParameter) => {\n    const { pickle } = message\n    await detox.onTestStart({\n        title: pickle.uri,\n        fullName: pickle.name,\n        status: 'running',\n    })\n})\n```\n\nThe symmetrical step is to inform Detox that the current test is over via calling [`detox.onTestDone()`] inside `After` hook.\nOtherwise, Detox won't be able to _save_ logs, screenshots, videos, and other artifacts:\n\n```js\nAfter(async (message: ITestCaseHookParameter) => {\n    const { pickle, result } = message\n    await detox.onTestDone({\n        title: pickle.uri,\n        fullName: pickle.name,\n        status: result ? 'passed' : 'failed',\n    })\n})\n```\n\nAfter the tests are over, you should call [`detox.cleanup()`] inside `AfterAll` hook so that Detox can clean up all the resources it has allocated:\n\n```js\nAfterAll(async () => {\n    await detox.cleanup();\n})\n```\n\nFor more information on [Cucumber.js] please check out this [documentation][Cucumber.js].\n\n[Cucumber]: https://cucumber.io/\n\n[Cucumber.js]: https://github.com/cucumber/cucumber-js#documentation\n\n[Cucumber.js hooks]: https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md\n\n[Initial PR]: https://github.com/wix/Detox/pull/3858\n\n[Detox Internals API]: ../api/internals.mdx\n\n[`detox.init()`]: ../api/internals.mdx#initoptions-promise\n\n[`detox.cleanup()`]: ../api/internals.mdx#cleanup-promise\n\n[`detox.onTestStart()`]: ../api/internals.mdx#onteststartevent-promise\n\n[`detox.onTestDone()`]: ../api/internals.mdx#ontestdoneevent-promise\n\n[Contributing]: ../contributing.md\n"
  },
  {
    "path": "docs/guide/detox-repl.md",
    "content": "# Debugging with Detox REPL\n\n:::caution Important\n\nREPL mode is currently only supported when using **Jest** as the test runner.\n\n:::\n\nDetox provides an interactive Read-Eval-Print Loop (REPL) that allows you to debug tests in real time. It’s particularly useful when exploring app state, running Detox commands manually, or diagnosing failing tests.\n\n## How to activate REPL\n\nREPL is only available when you pass one of the following CLI flags to [`detox test`](../cli/test.md) command:\n\n- `--repl=auto`\n\n  This mode enables **automatic entry into REPL** whenever a test or lifecycle hook fails — in addition to supporting manual `detox.REPL()` calls.\n\n- `--repl`\n\n  Use this mode when you want **manual control**. You must explicitly call `await detox.REPL()` inside your test or lifecycle hooks (e.g. `beforeEach`, `afterEach`, etc.). Detox will pause execution and open an interactive REPL prompt at that point.\n\n  ```ts\n  it('should debug manually', async () => {\n    await device.launchApp();\n    await element(by.id('login')).tap();\n\n    // Pause here for live debugging\n    await detox.REPL();\n\n    // Resume test after exiting REPL\n  });\n  ```\n\n:::tip Technical Note\n\nWhen you pass `--repl` CLI argument, you disable advanced terminal features which are normally interfering with interactive input. This step is essential for the REPL to function correctly — without it, interactive commands will be ignored, and you'll see a warning message instead.\n\n:::\n\n## Adding Custom Scope\n\nYou can expose additional helpers or variables inside the REPL context:\n\n```ts\nawait detox.REPL({\n  utils,\n  testUser,\n  delay: (ms) => new Promise(res => setTimeout(res, ms)),\n});\n```\n\nWhen you enter the REPL, you will be able to access given variables directly, e.g.:\n\n```text\ndetox> await utils.login(testUser)\ndetox> await delay(1000)\n```\n\n## Using REPL\n\nOnce inside, you can:\n\n- Run Detox commands, e.g.: `await element(by.id('foo')).tap()`\n- Use `.dumpxml` to inspect view hierarchy\n- Use `.pilot` to run natural language commands (requires [Detox Pilot](../pilot/testing-with-pilot.md))\n- Use Node.js REPL commands like `.exit`, `.help`, `.editor`, `.save`, etc.\n\n```text\n.detox> .help\n.break     Sometimes you get stuck, this gets you out\n.clear     Alias for .break\n.dumpxml   Print view hierarchy XML\n.editor    Enter editor mode\n.exit      Exit the REPL\n.help      Print this help message\n.load      Load JS from a file into the REPL session\n.pilot     Execute natural language command (e.g. .pilot Tap on login button)\n.save      Save all evaluated commands in this REPL session to a file\n```\n\nTo exit the REPL, either type `.exit` or press `Ctrl+C` twice.\n\n## See also\n\n- [Detox Pilot](../pilot/testing-with-pilot.md)\n- [Node.js REPL API](https://nodejs.org/api/repl.html)\n"
  },
  {
    "path": "docs/guide/developing-while-writing-tests.md",
    "content": "# Developing Your App While Writing Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\n> If your app requires active development, such as adding testID fields for tests, this is a good workflow. It allows you to work both on your app and your tests at the same time.\n\nThe main idea behind this workflow is to run your app in debug with Detox on a simulator. Once the app is up and running, it will still be connected to the React Native packager. This means that you’ll be able to do JavaScript code modifications in your app codebase and press CMD+R to reload the bundle inside the Detox simulator.\n\n### Step 1: Build Your App in Debug\n\nDetox is going to need the executable for your app. This means we need to build it first.\nSince we want a build that’s connected to the live React Native packager (to update bundle changes),\nwe’re going to need a _debug_ build:\n\n```bash\ndetox build -c ios.sim.debug # or android.emu.debug\n```\n\nCheck out [Introduction > Building with Detox](../introduction/project-setup.mdx) for more details.\n\n### Step 2: Make Sure Your React-Native Packager is Running\n\nIf you can’t see a React Native packager instance running in a terminal, you can run it manually by typing:\n\n```bash\nnpx react-native start\n```\n\nThe packager instance will reload the JavaScript bundle of your app when you press CMD+R in the simulator window.\nThis will allow you to make modifications in your app codebase.\n\n### Step 3: Run Detox Tests\n\nType the following inside your project root:\n\n```bash\ndetox test -c ios.sim.debug # or android.emu.debug\n```\n\nThis will use Detox to find the app executable we’ve built in step 1, install it on the device and run Detox tests against it.\n\n### Step 4: Make Changes to Your App’s Codebase as Usual\n\nYou can keep working on the JavaScript codebase of your app as usual.\nAs long as you keep the simulator from step 3 running, you’ll be able to press CMD+R inside and reload your app with the new changes.\n\n### Step 5: Re-run Detox Tests Without Re-installing the App\n\nYou can make changes to your Detox tests as well. When you want to re-run your tests on the device,\nwe recommend adding `--reuse` flag to save your time when running the tests.\n\n```bash\ndetox test -c ios.sim.debug --reuse # or android.emu.debug\n```\n\nBy default, Detox re-installs the app before picking every next test suite which is redundant in this situation\nsince your app code changes are delivered via network with React Native packager, and the app binary itself does\nnot change.\n\nYou should not use this option if you made native code changes or if your app relies on local (\"disk\") storage.\n"
  },
  {
    "path": "docs/guide/genymotion-saas.mdx",
    "content": "# Using Genymotion SaaS\n\nAs the number of your end-to-end tests grows, the overall test session duration might easily surpass an hour or two.\nA good idea first would be to parallelize the test execution using your test runner (e.g. for Jest that\nwould be forwarding `--maxWorkers <N>`), but this approach has its limitations. Indeed, an average build agent would handle\nrunning a few virtual devices at once, but running a dozen devices at once would make it slow and unreliable.\n\nIn other words, if you're experiencing scaling issues or struggling with managing local Android emulators,\na good idea would be to migrate to SaaS platforms, where you can start and stop devices on demand at any scale.\nAt the moment, Detox can offer you a first-class integration with\n[Genymotion SaaS], the platform that offers cloud-based Android Virtual Devices.\n\n## Prerequisites\n\nYou need to register an account in [Genymotion SaaS], so that you have valid credentials to use with their CLI tool,\n[`gmsaas`]. If you already have an account there, make sure there are available device minutes. Don't worry about\nthe new accounts – they come with **2** concurrent devices and free **60** minutes out of the box.\n\n![](../img/genymotion/register.png)\n\nNext, you should get `gmsaas` CLI tool [installed and configured][Genymotion SaaS tutorial],\nso that you're able to see your e-mail after running this:\n\n```bash\ngmsaas auth whoami\n# your_email@example.com\n```\n\nIf you encounter errors instead, please revisit the [Genymotion SaaS tutorial] and check out their [Known Issues]\nsection if your problem persists.\n\n## Configuring\n\nTo run tests on a device, you need to define its properties first: OS version, screen dimensions, etc.\nThis entire set of device specs is called a **recipe**. Genymotion SaaS offers you a predefined list of recipes\nto pick from, but you can create custom recipes as well. Refer to the [Basic Steps] tutorial on their website for\nmore details.\n\n![](../img/genymotion/recipe.png)\n\nEach recipe item in the list can be expanded for extra details, and that's where you can find its respective _UUID_.\nCopy that UUID and use it to create a new device and a new configuration in your Detox config:\n\n```diff title=\".detoxrc.js\"\n module.exports = {\n   devices: {\n     simulator: { /* ... */ },\n     emulator: { /* ... */ },\n+    genycloud: {\n+      type: 'android.genycloud',\n+      device: {\n+        recipeUUID: '<paste your chosen recipe UUID>'\n+      },\n+    },\n   },\n   apps: {\n     'ios.debug': { /* ... */ },\n     'ios.release': { /* ... */ },\n     'android.debug': { /* ... */ },\n     'android.release': { /* ... */ },\n   },\n   configurations: {\n     'ios.debug': { /* ... */ },\n     'ios.release': { /* ... */ },\n     'android.debug': { /* ... */ },\n     'android.release': { /* ... */ },\n+    'android.genycloud.release': {\n+      device: 'genycloud',\n+      app: 'android.release',\n+    },\n   },\n };\n```\n\nAlthough the _recipe UUIDs_ are guaranteed to be unique and never change unlike the _recipe names_, you still can use\nthe latter if you like – just switch from `recipeUUID` to `recipeName` property like this:\n\n```diff\n     genycloud: {\n       type: 'android.genycloud',\n       device: {\n-        recipeUUID: '<delete your recipeUUID property>'\n+        recipeName: '<paste the recipe name>'\n       },\n     },\n   },\n```\n\n:::info\n\nIn the example above we assume you'll be running a _release configuration_ of your app since this is what\nusually happens on CI.\n\nRunning _debug builds_ is trickier to set up (and might be less stable), but if you have to do it,\nfollow the instructions. You'll be setting up tunneling between your local machine (where React Native packager is\nrunning on port 8081) and the remote device in the cloud.\n\nFirst, patch your `MainApplication.java` (or your main activity class) to override `debug_http_host`, e.g.:\n\n```diff\n package com.example;\n\n import android.app.Application;\n+import android.content.SharedPreferences;\n+import android.os.Bundle;\n+import android.preference.PreferenceManager;\n\n import com.facebook.react.ReactApplication;\n import com.facebook.react.ReactNativeHost;\n@@ -37,6 +40,9 @@ public class MainApplication extends Application implements ReactApplication {\n     public void onCreate() {\n         super.onCreate();\n         SoLoader.init(this, /* native exopackage */ false);\n+        SharedPreferences preferences =\n+            PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n+        preferences.edit().putString(\"debug_http_host\", \"localhost:8081\").apply();\n     }\n\n }\n```\n\nNow, as your React Native app will be forced to use `localhost:8081` to download the bundle, you'll need to make sure\nthat there is a tunnel between your local machine and the remote device – add 8081 to `reversePorts` in your app config,\ne.g.:\n\n```diff\n  'android.debug': {\n    type: 'android.apk',\n    binaryPath: 'android/app/build/outputs/apk/fromBin/debug/app-fromBin-debug.apk',\n    build: 'cd android && ./gradlew assembleFromBinDebug assembleFromBinDebugAndroidTest -DtestBuildType=debug && cd ..',\n+   reversePorts: [8081],\n  },\n```\n\nClean your Android build intermediates and build your app again:\n\n```bash\ncd android\n./gradlew clean # remove ./ on Windows\ncd ..\ndetox build -c android.emu.debug\n```\n\nIf your application is trivial enough, these adjustments should be already enough to run _debug builds_ remotely.\n\n:::\n\n## Running\n\nAssuming you have created a new `android.genycloud.release` configuration, run:\n\n```bash\ndetox test -c android.genycloud.release\n```\n\nSoon enough you'll be seeing an output like this:\n\n```\nAllocating Genymotion-Cloud instance Detox.62dfc57b-3201-c861-29bb-8f31f60a8d39.w1 for testing.\nTo access it via a browser, go to: https://cloud.geny.io/instance/8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\nUse the link to see what's happening on your device in real time:\n\n![](../img/genymotion/live.png)\n\nAfter that, try running tests with 2 workers to make sure that your tests don't have issues with\nconcurrency. The latter might happen if different test files are fighting over the same resource\n(e.g. deleting an account while another test is using it, and so on):\n\n```bash\ndetox test -c android.genycloud.release --maxWorkers 2\n# DETOX_CONFIGURATION=\"android.genycloud.release\" jest --config e2e/jest.config.js --maxWorkers 2\n# …\n```\n\n:::info\n\nFree Genymotion SaaS accounts are limited to **2** concurrently running devices.\nIf you need more devices or more minutes for testing, you can reach Genymotion's team\nat <sales@genymobile.com>.\n\n:::\n\n## Caveats\n\n### Termination\n\nIf you have to terminate your tests execution via `Ctrl+C` or another forcible way, pay attention to\nthe warnings printed, e.g.:\n\n```plain text\ndetox[22314] i WARNING! Detected a Genymotion SaaS instance leakage, for the following instances:\ndetox[22314] i Instance Detox.1e0ee8a4-6949-90c7-6680-5c3a9010d1e5.w1 (8fc62d21-3de0-4ed8-bf18-e69b90246dc5)\n    Kill it by visiting https://cloud.geny.io/instance/8fc62d21-3de0-4ed8-bf18-e69b90246dc5, or by running:\n    gmsaas instances stop 8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\nLeaving the device unattended would mean spending extra money :grimacing: :dollar:, so make sure to follow the\ninstructions and stop your instances, e.g.:\n\n```bash\ngmsaas instances stop 8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\n:::tip\n\nYou can set up a safeguard for the [maximum run duration](https://docs.genymotion.com/saas/05_Administration_interface/#maximum-run-duration)\non the [Administration > Settings](https://cloud.geny.io/administration/settings) panel. This can minimize the costs\neven if you accidentally leave the device powered on.\n\n:::\n\nWe plan to improve this behavior and secure emergency teardown someday, but beforehand the next issue\nshould be resolved (see it below). Besides, `Ctrl+C`'ing proves to be useful when you want to leave the device active\nat some point of your test scenario and interact with it manually.\n\n### `behavior.shutdownDevice` cannot be disabled\n\nDetox CLI has [`-u, --cleanup` argument], and the behavior config has the respective [`shutdownDevice` property], but **none of them can be effectively disabled** on Genymotion SaaS devices.\nDetox _always shuts them down_ in the end of the test session, unless you abruptly terminate its execution (see the previous caveat).\n\nIn other words, you can't leave Genymotion SaaS devices up and running after your test session ends. On the ond hand,\nthat reduces your chances to forget a running device. On the other hand, that doesn't allow you to keep a pool of\nimmediately ready devices – a kind of strategy that could be more efficient for busier CI pipelines. There are plans\nto improve this in the future, but currently you have to bare with this caveat.\n\n[Genymotion SaaS]: https://cloud.geny.io/\n[`gmsaas`]: https://docs.genymotion.com/gmsaas\n[Genymotion SaaS tutorial]: https://docs.genymotion.com/gmsaas/01_Get_Started\n[Known Issues]: https://docs.genymotion.com/gmsaas/04_Issues/\n[Basic Steps]: https://docs.genymotion.com/saas/04_Basic_Steps/\n[`-u, --cleanup` argument]: ../cli/test.md\n[`shutdownDevice` property]: ../config/behavior.mdx\n"
  },
  {
    "path": "docs/guide/launch-args.md",
    "content": "# Using Launch Arguments\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nIn Detox, the app under test is launched via an explicit call to [`device.launchApp()`](../api/device.md). Through various means, Detox enables specifying a set of user-defined arguments (key-value pairs) to be passed on to the app when launched, so as to make them available inside the launched app itself at runtime (both on the native side, and - if applicable, on the JavaScript side).\n\n### Motivation\n\n> If this is clear to you first hand, you can skip right to the section about arguments setup.\n\nIn particular, the common use case of using launch argument (although not distinctly), is for [mocking](mocking.md) external entities such as servers - replacing them with equivalent _mock servers_, sporting equivalent (yet fake) API-endpoints that run alongside the testing host (i.e. the one running Detox). These mock servers can typically be configured during the test, to return deterministic responses to network requests coming from the app.\n\nTypically, the process of setting up such servers - especially in a parallel test-execution environment, involves three major steps (within the context of a test set-up):\n\n1. Allocating a port for a mock server, dynamically.\n1. Bringing up a mock server instance bound to that port (e.g. at `localhost:1234`).\n1. Launching the app with a predefined argument that holds the port, for example `mockServerPort=1234`.\n   (It is assumed here that there’s designated mocked code inside the app that can read `mockServerPort` and rewire all connections to `localhost:1234` instead of to the real production server).\n\nIn this context, launch argument are useful for implementing step [#3](https://github.com/wix/Detox/issues/3).\n\n### Arguments Setup\n\nUser-defined launch arguments specification is very flexible, and can be defined on 4 levels:\n\n| Level                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                  |\n| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| 1. Static Configuration                   | As a part of a static [Detox configuration](../config/overview.mdx), using the `launchArgs` property.<br />This is can sufficient, for example, if you only require one mock server instance, and can use the same static port throughout the entire testing execution session.                                                                                                                              |\n| 2. Static via CLI                         | As arguments specified explicitly in the [command-line](../cli/test.md) execution of `detox test`, using `--app-launch-args`.                                                                                                                                                                                                                                                                                |\n| 3.`device.appLaunchArgs`                  | Dynamically, using the [`device.appLaunchArgs`](../api/device.md#deviceapplaunchargs) API, which initially holds the static configuration, and then allows for the modification of it before applied through `device.launchApp()`.<br/>Mostly required in complex test environments, where the servers and ports are dynamic, and are determined via distinct software components (e.g. separate test kits). |\n| 4. `device.launchApp()` with `launchArgs` | Dynamically and explicitly, using on-site arguments specified in calls to [`device.launchApp()`](../api/device.md#devicelaunchappparams) through the `launchArgs` parameter.<br />Ideal for fairly simple test environments, where the ports are dynamic but are in complete control of the user.                                                                                                            |\n\n**Important: Arguments specified in each level take precedence over equivalent underlying levels**.\n\nExamples:\n\n1. In an environment where `mockServerPort` is statically pre-set to `1001` in Detox configuration, and then set to `1003` using `device.appLaunchArgs` inside a test, the app would eventually be launched with `1003` as its value, in calls to `device.launchApp()` in that test.\n1. (Scenario continues) In subsequent calls to `device.launchApp()` with this parameter: `device.launchApp({ launchArgs: {mockServerPort: 1004} })`, the app will be (re-)launched with `1004` as the value for `mockServerPort`.\n\n### In-App Arguments Access\n\nOur official recommendation for getting the arguments inside the app is by integrating the [react-native-launch-arguments](https://github.com/iamolegga/react-native-launch-arguments) project, which provides that seamlessly. For those who are interested, here are the underlying details:\n\n- On iOS, the specified launch arguments are passed as the process launch arguments and available through normal means, such as accessing `[[NSProcessInfo processInfo] arguments]`.\n- On Android, the launch arguments are set as bundle-extra’s into the activity’s intent. They are therefore accessible on the native side via the current activity as: `currentActivity.getIntent().getBundleExtra(\"launchArgs\")`.\n"
  },
  {
    "path": "docs/guide/migration.md",
    "content": "# Migration Guide\n\n<!-- markdownlint-configure-file { \"ol-prefix\": 0 } -->\n\nWe are improving Detox API as we go along, sometimes these changes require us to break the API in order for it to make more sense. These migration guides refer to breaking changes. If a newer version has no entries in this document, it means it does not require special migration steps. Refer to the release notes of the latter builds to learn about their improvements and changes.\n\n## 20.0\n\n### No [Mocha] support\n\nIf you were using Mocha, now you have two options:\n\n- switch to [Jest] using [`detox init`] boilerplate as a reference and [`testRunner` config];\n- wait until a third-party integration with Mocha appears.\n\n### Jest 27.2.5 and higher\n\nYou have to upgrade your Jest version to at least 27.2.5 or higher. The recommended choice is 28.x or 29.x.\n\n### All-in-one configs\n\nIf you see an error like this:\n\n```plain text\nDetoxConfigError: Configuration \"legacy\" uses a deprecated all-in-one schema,\nwhich is not supported by Detox.\n```\n\nYou have to extract device and app configs from your configuration, as shown in the example below:\n\n<table>\n<tr>\n  <th>Legacy schema</th>\n  <th>Modern schema</th>\n</tr>\n<tr>\n  <td>\n\n```json\n{\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"type\": \"ios.simulator\",\n      \"device\": \"iPhone 12\",\n      \"binaryPath\": \"/some/path/ios.app\",\n      \"build\": \"...\"\n    },\n    \"android.emu.debug\": {\n      \"type\": \"android.emulator\",\n      \"device\": \"Pixel_30_API\",\n      \"binaryPath\": \"/some/path/android.apk\",\n      \"build\": \"...\",\n      \"launchArgs\": {}\n    }\n  }\n}\n```\n\n  </td>\n  <td>\n\n```json\n{\n  \"apps\": {\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"/some/path/ios.app\",\n      \"build\": \"...\"\n    },\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"/some/path/android.apk\",\n      \"build\": \"...\",\n      \"launchArgs\": {}\n    }\n  },\n  \"devices\": {\n    \"ios.simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": { \"type\": \"iPhone 12\" }\n    },\n    \"android.emulator\": {\n      \"type\": \"android.apk\",\n      \"device\": { \"avdName\": \"Pixel_30_API\" }\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"device\": \"ios.simulator\",\n      \"app\": \"ios.debug\"\n    },\n    \"android.emu.debug\": {\n      \"device\": \"android.emulator\",\n      \"app\": \"android.debug\"\n    }\n  }\n}\n```\n\n  </td>\n</tr>\n</table>\n\nFor more details refer to the [`Config > Devices`](../config/devices.mdx) and [`Config > Apps`](../config/apps.mdx) sections.\n\n### `testRunner` config section\n\nThree top-level string properties (`testRunner`, `runnerConfig`, `specs`) have been unified into a complex\n`testRunner` section which strives to be as agnostic as possible:\n\n```diff title=\".detoxrc.js\"\n-  testRunner: 'jest',\n-  runnerConfig: 'e2e/jest.config.js',\n-  specs: 'e2e',\n-  skipLegacyWorkersInjection: true,\n+  testRunner: {\n+    $0: 'jest',\n+    args: {\n+      config: 'e2e/jest.config.js',\n+      _: ['e2e']\n+    },\n+  },\n```\n\nAlso, `skipLegacyWorkersInjection` migration option no longer has meaning, so you can remove it safely.\n\nIf you didn’t have `runnerConfig` previously, use `e2e/config.json` (because that was an implicit default\nin Detox 19 and earlier):\n\n```diff\n  testRunner: {\n    $0: 'jest',\n    args: {\n+     config: 'e2e/config.json',\n    },\n },\n```\n\n### Custom Jest environment\n\nYou no longer need to have an autogenerated environment file if you haven’t been customizing it,\nand if it looks like below:\n\n```js title=\"e2e/environment.js\"\nconst {\n  DetoxCircusEnvironment,\n  SpecReporter,\n  WorkerAssignReporter,\n} = require('detox/runners/jest-circus');\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  constructor(config, context) {\n    super(config, context);\n\n    // Can be safely removed, if you are content with the default value (=300000ms)\n    this.initTimeout = 300000;\n\n    // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.\n    // This is strictly optional.\n    this.registerListeners({\n      SpecReporter,\n      WorkerAssignReporter,\n    });\n  }\n}\n\nmodule.exports = CustomDetoxEnvironment;\n```\n\nIf you want, for example:\n\n- to reduce the init timeout to 120 seconds,\n- remove `SpecReporter` output,\n- remove `WorkerAssignReporter` output,\n\nthen you can express this intent via config:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    $0: 'jest',\n    args: {\n      config: 'e2e/jest.config.js',\n      _: ['e2e']\n    },\n// highlight-start\n    jest: {\n      setupTimeout: 120000,\n      reportSpecs: false,\n      reportWorkerAssign: false,\n    },\n// highlight-end\n  },\n  // …\n};\n```\n\nIf you have some customizations beyond that, make sure to remove the boilerplate code:\n\n```js title=\"e2e/environment.js\"\n// highlight-next-line\nconst { DetoxCircusEnvironment } = require('detox/runners/jest');\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  constructor(config, context) {\n    super(config, context);\n\n    // leave your custom code\n  }\n}\n\nmodule.exports = CustomDetoxEnvironment;\n```\n\nPay attention that the import has been changed to `detox/runners/jest` (previously it was `detox/runners/jest-circus`),\nand the reporters (`SpecReporter`, `WorkerAssignReporter`) are no longer exported. You can continue using\n`this.initTimeout` if you rename it there to `this.setupTimeout`, but you can also delegate that to Detox config like shown earlier.\n\n### New Jest config\n\nLet's examine **the old configs** first to see what needs to be removed or changed:\n\n```js showLineNumbers title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: 1,\n  testEnvironment: './environment',\n  testRunner: 'jest-circus/runner',\n  testTimeout: 120000,\n  testRegex: '\\\\.e2e\\\\.js$',\n  reporters: ['detox/runners/jest/streamlineReporter'],\n  verbose: true\n};\n```\n\nSee comments line by line:\n\n1\\. As a recommendation, switch to CommonJS (`module.exports = {}`) instead of JSON, if you haven’t done that already.\n\n2\\. If you don’t have `maxWorkers: 1` configured, please add it.\n\n3\\. If you removed your test environment in the previous step, remove the `testEnvironment` property.\n\n4\\. Remove `testRunner` since it is already `jest-circus` by default in Jest 27.x and higher.\n\n5\\. You need a long `testTimeout` value, because usually end-to-end tests cannot complete in 5 seconds, which is\nJest's default timeout value. We suggest 120 seconds by default, but you can fine-tine it.\n\n6\\. We recommend to use `rootDir` and `testMatch` instead of `testRegex`, like this (assuming your Jest config is\nin `e2e` folder of your project, together with the Detox test files):\n\n```diff\n-  testRegex: '',\n+  rootDir: '..',\n+  testMatch: ['<rootDir>/e2e/**/*.test.js'],\n```\n\n7\\. Remove that `streamlineReporter`. You’ll be adding a new reporter in a second.\n\n8\\. You need to set `verbose: true` to disable log batching. In other words, Jest will be printing\nlogs with a significant delay, which is just inconvenient and annoying when you need\nto know what exactly is happening right now.\n\nNow, let's take a look at **the new config** and the required additions:\n\n```js showLineNumbers title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: 1,\n  testTimeout: 120000,\n  verbose: true,\n// highlight-start\n  reporters: ['detox/runners/jest/reporter'],\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n// highlight-end\n};\n```\n\nLet's focus on lines 5-8:\n\n5. Add the new Detox reporter as the first one to your existing `reporters: [...]` array or create that property\n   like we show. It is a reserved reporter for Detox core logic, so it does not affect your logs or any other output –\n   just make sure you have it.\n\n5. Register `globalSetup` shipped with Detox. If you have your own `globalSetup`, then call both in a wrapper function:\n\n   ```js\n   module.exports = async () => {\n      await require('detox/runners/jest/index').globalSetup();\n      await yourGlobalSetupFunction();\n   };\n   ```\n\n5. Register `globalTeardown` shipped with Detox. If you have your own `globalTeardown`, then you should wrap it\n   with `try-finally` and call the teardown of Detox too:\n\n   ```js\n   module.exports = async () => {\n     try {\n       await yourGlobalTeardownFunction();\n     } finally {\n       await require('detox/runners/jest/index').globalTeardown();\n     }\n   };\n   ```\n\n5. If you already have removed your custom test environment, please switch to the default test environment shipped\n   with Detox like shown in the example. Otherwise, stay with your custom test environment but make sure to migrate it\n   as was described earlier.\n\n### Stop using timeline artifacts\n\nIf you have been using `--record-timeline all` CLI option or had timeline artifact configured in your config,\n\n```diff\n {\n   artifacts: {\n     plugins: {\n       logs: 'all',\n       screenshot: 'failing',\n-      timeline: 'all',\n     }\n   }\n }\n```\n\nplease remove it from your configs and scripts. Timeline artifacts have been merged with log artifacts, so if\nyou need to have `detox.trace.json` – just don’t turn off your logs, and you’ll get it.\n\n### Updating command-line scripts\n\nCheck your Detox scripts whether they had command-line arguments such as:\n\n```bash\ndetox test … -o path/to/jest.config …\ndetox test … --runner-config path/to/jest.config …\ndetox test … --workers 3 …\n```\n\nDetox became agnostic about third-party test runner arguments, and now you need to forward those arguments directly\nto your test runner (i.e. Jest):\n\n```bash\ndetox test … --config path/to/jest.config …\ndetox test … --maxWorkers 3 …\n```\n\nYou’ll be able to tell that you’ve run into a situation like this if you see error messages like:\n\n```plain text\n● Unrecognized CLI Parameter:\n\n  Unrecognized option \"workers\".\n\n  CLI Options Documentation:\n  https://jestjs.io/docs/cli\n```\n\nBesides, verify you don’t have a deprecated `--device-launch-args` parameter in your scripts.\nIt has been superseded by `--device-boot-args`:\n\n```bash\ndetox test ... --device-boot-args=\"arg1 arg2\"\n```\n\n### Revisit environment variables\n\nIf you’re relying somewhere in your code on things like `process.env.DETOX_CONFIGURATION` or any other that starts from `DETOX_`, as a matter of a workaround, you can turn on `testRunner.forwardEnv` in your Detox config:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    args: {\n      $0: 'jest',\n    },\n    // highlight-next-line\n    forwardEnv: true,\n  },\n  devices: { /* ... */ },\n  apps: { /* ... */ },\n  configurations: { /* ... */ },\n};\n```\n\nThat should solve temporarily the issue with missing environment variables, but this is\nnot the best solution overall. The better fix for that would be switch to using Detox\nInternals API.\n\nFor example, you were determining the number of workers depending on your configuration:\n\n```js title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: process.env.CI\n    ? (`${process.env.DETOX_CONFIGURATION}`.startsWith('ios.') ? 3 : 2)\n    : 1,\n    globalSetup: '...',\n    globalTeardown: '...',\n    // ... and so on ...\n};\n```\n\nThat would translate to a cleaner code in Detox 20:\n\n```js title=\"e2e/jest.config.js\"\nconst { resolveConfig } = require('detox/internals');\n\nmodule.exports = async () => {\n  const { device } = await resolveConfig();\n\n  return {\n    maxWorkers: process.env.CI ? (device.type === 'ios.simulator' ? 3 : 2) : 1,\n    globalSetup: '...',\n    globalTeardown: '...',\n    // ... and so on ...\n  };\n};\n```\n\n### Miscellaneous\n\nDetox 20 drops `ios.none` driver due to the low demand and legacy code issues.\nIf you have been using it, please follow the new [Debugging > Native application code](../introduction/debugging.mdx#native-application-code) tutorial which explains how to use `launchApp: 'manual'` as a replacement for `ios.none`.\n\nIf you have been using `{ permanent: true }` option for `device.appLaunch.args.modify` API, please note that it has been removed in PR [#3360](https://github.com/wix/Detox/pull/3360), in favor of `appLaunchArgs.shared`:\n\n```js\n// device.appLaunchArgs.modify({ /* ... */ }, { permanent: true });\ndevice.appLaunchArgs.shared.modify({ /* ... */ });\n```\n\n---\n\nThe hard part is over now, congratulations on finishing the migration!\nStay tuned for the upcoming minor releases leveraging the recent architectural changes in Detox.\n\n## 19.2\n\nThe release has a **developer experience** improvement – _Detect pending in-flight requests_ ([#3003](https://github.com/wix/Detox/issues/3003), [**@jonathanmos**](https://github.com/jonathanmos)).\nThe feature adds extra logic that prevents forgotten `await` statements on asynchronous Detox APIs. That’s why you might see a new error like this:\n\n```plain text\nFAILED\nDetoxRuntimeError: The pending request \\#246 (\"invoke\") has been rejected due to the following error:\n\nDetox has detected multiple interactions taking place simultaneously. Have you forgotten to apply an await over one of the Detox actions in your test code?\n```\n\nThat should help you find forgotten `await`s in your code that are a potential reason for flakiness in E2E tests.\nYou’ll need to find those places and apply trivial fixes like shown below:\n\n```diff\n   await screenDriver.performSomeAction();\n-  expect(screenDriver.get.myElement()).toBeNotVisible();\n+  await expect(screenDriver.get.myElement()).toBeNotVisible();\n```\n\n## 19.0\n\n**Version 19 is not really a breaking change!**\n\nWe decided to bump Detox into a major version release, nonetheless, because it is breaking for projects that sport [custom Detox drivers](../articles/third-party-drivers.md), such as [`detox-puppeteer`](https://github.com/ouihealth/detox-puppeteer).\n\nIf you are a maintainer of such a project, and you wish to upgrade your Detox dependency to 19 (kudos! :clap:),  follow this step-by-step migration guide; You can refer to [this pull-request](https://github.com/ouihealth/detox-puppeteer/pull/13), which does that for the  `detox-puppeteer` project.\n\n### Migrating Custom Drivers\n\nThe core of the change is that Detox' drivers framework is **no longer a single monolith**, responsible for everything platform-specific. Rather, it’s been broken down to these subresponsibilies:\n\n- Allocation: The process of launching / selecting a device over which the tests would run in the current execution.\n- Validation: Execution environment checkups.\n- Artifacts: Platform-based selection of build-artifacts implementation (e.g. screenshots).\n- Runtime\n\n> You can find a visual explanation, [here](https://github.com/wix/Detox/files/7338121/pre-multiapps-rfc.pdf).\n\nIn addition, the runtime driver is no longer state-less – basically, allowing implementation to hold any state that is required in identifying and managing the associated device.\n\n#### How to migrate\n\nEverything here will be based on the changes made in the [`detox-puppeteer` example](https://github.com/ouihealth/detox-puppeteer) - names included (please don’t use them as-is in your own implementation!).\n\n**Allocation:**\n\n- Create a new class, called `PuppeteerDeviceAllocation` (change name to something that would make sense in your project).\n- Move everything currently in `PuppeteerDriver.acquireFreeDevice()` and `.shutdown()` onto `PuppeteerDeviceAllocation.allocate()` and `.free()`, respectively.\n- Create a POJO class called `PuppeteerAllocCookie`. This class should hold anything that would later be required in order to specify the specifically associated device (example: `UDID` for iOS simulators, `adb` names for Android devices).\n- Make `.allocate()` return an instance of your cookie class. Puppeteer example: [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R841).\n- **Delete `PuppeteerDriver.acquireFreeDevice()` and `PuppeteerDriver.shutdown()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R830).\n\nAdd the new allocation class to the `module.exports` list, under the name: `DeviceAllocationDriverClass`.\n\n**Validation:**\n\n- If you have any validations implemented in `PuppeteerDriver.prepare()`, create a class called `PuppeteerEnvironmentValidator`.\n- Move anything inside `PuppeteerDriver.prepare()` to `PuppeteerEnvironmentValidator.validate()`.\n- **Delete `PupeteerDriver.prepare()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R798).\n\nAdd the new (optional) class to the `module.exports` list, under the name: `EnvironmentValidatorClass`.\n\n**Artifacts:**\n\n- Move your implementation of `PuppeteerDriver.declareArtifactPlugins()` to the same method in a new class, called `PuppeteerArtifactPluginsProvider.declareArtifactPlugins()` (change name to something that would make sense in your project).\n\n> There are no changes in method signature in this case.\n\nAdd the new class to the `module.exports` list, under the name: `ArtifactPluginsProviderClass`.\n\n**Runtime:**\n\n- Optionally rename your class from `PuppeteerDriver` to `PuppeteerRuntimeDriver`.\n- In the methods remaining in the class accepting the `deviceId` arg: **remove the `deviceId` arg entirely**. This might break your implementation - don’t worry, continue reading.\n- If applicable, change the signature of the class' c'tor to accept the cookie as its 2nd argument (instance previously allocated in `PuppeteerAllocationDriver.allocate()`). Save data from the cookie as part of the driver’s state, in order to unbreak your implementation, following the previous step.\n- Add two methods: `getExternalId()` and `getDeviceName()`. Implement them such that they would comply with the `device.id` and `device.name` [API contracts](../api/device.md), respectively.\n\nExport the runtime driver class in the `module.exports` list as `RuntimeDriverClass`, **instead of `DriverClass`.**\n\n#### Troubleshooting\n\nFor issue related to these migrations, approach us by [submitting an issue on GitHub](https://github.com/wix/Detox/issues/new/choose). Please apply the `Detox19` label.\n\n## 18.6.0\n\nDetox has normalized the configuration format, so that along with the combined `configurations` object you now can define your `devices` and `apps` separately.\nPlease refer to the [configuration doc](../config/overview.mdx) to obtain more details.\nThis change is backward-compatible, although the new format is now the recommended option.\n\n## 18.0\n\nDetox now uses a custom synchronization system on iOS, [developed in-house](https://github.com/wix/DetoxSync); this is the second step in phasing out our Earl Grey usage. We have tested this system extensively internally, and are confident that it should work as expected. There are no known limitations with the new system.\n\nIf you are seeing issues with the new sync system, please open an issue.\n\n**Breaking:**\n\n- **iOS.** Detox now requires iOS 13.0 and above iOS simulator runtimes, and iOS 12.x and below are no longer supported. This does not require that you drop support for iOS 12.x in your apps, just that tests will no longer work on iOS 12 and below. Please make sure your tests are running on iOS 13 or above\n- **JS.** :warning: Detox no longer launches the app automatically (even if asked to do so in configuration) — you have to launch your app explicitly:\n\n```diff\n+  beforeAll(async () => {\n+    await device.launchApp();\n+  });\n```\n\n- **JS (jest-circus).** The `DetoxCircusEnvironment` provided from `detox/runners/jest-circus` package now requires two arguments in its constructor, so you have to update your descendant class signature:\n\n```diff\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n-  constructor(config) {\n-    super(config);\n+  constructor(config, context) {\n+    super(config, context);\n```\n\n- **JS (iOS).** `device.launchApp({ launchArgs: { ... })` argument escaping has been improved. If you use complex launch args such as regular expressions, make sure you remove manual escaping from now on to avoid erroneous double escaping, e.g.:\n\n```diff\n await device.launchApp({\n   launchArgs: {\n-    detoxURLBlacklistRegex: '(\\\\\".*example.com/some-url/.*\\\\\")' }`,\n+    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")' }`,\n   },\n });\n```\n\n- **JS (internal).** There is a breaking change for people writing custom Detox integrations. Environment variable naming schema has changed – now Detox uses prefix to distinguish its own environment variables (usually passed from `detox test` CLI), e.g.: `recordLogs=all` becomes `DETOX_RECORD_LOGS=all`, `loglevel=trace` becomes `DETOX_LOGLEVEL=trace`, and so on.\n\n## 17.5.2\n\nFixes the issue from **17.4.7** (see below) - now the migration guide for **17.4.7** can be safely ignored.\n\n## 17.4.7\n\nThis release was not meant to be breaking in any sense, but unfortunately there are two minor caveats that leaked in.\n\n### `jest-cli`\n\nFrom now on, Detox explicitly depends on `jest-cli` package (marked as a peer dependency), that’s why if you see an error like the one below:\n\n```plain text\nCannot find module 'jest-cli/build/cli/args'\n```\n\n~~You should add `jest-cli` to your `package.json`’s `devDependencies` and rerun `npm install`, e.g.:~~\n\n**UPD**: since `detox@17.5.2` you can ignore this advice. The problem should go away **without** these edits:\n\n```diff\n \"devDependencies\": {\n   \"jest\": \"26.x.x\",\n+  \"jest-cli\": \"26.x.x\",\n```\n\n### `detox-cli`\n\nIf you were using `detox-cli` global package, make sure to upgrade it before proceeding to `detox@17.4.7`.\n\n```bash\nnpm install detox-cli --global\n```\n\nIf you have an older version of `detox-cli`, then you might see the following error on an attempt to run  `detox test <...args>`:\n\n```plain text\n'jest' is not recognized as an internal or external command,\noperable program or batch file.\ndetox[43764] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern \"^((?!:android:).)*$\" --maxWorkers 1 e2e\n```\n\n## 17.3.0\n\nIn the context of introducing the element screenshots feature ([#2012](https://github.com/wix/Detox/issues/2012)), we decided to slightly change the contract between Detox and externally-implemented _drivers_. These should be modified according to the follow diff-snippet:\n\n```diff\nclass Expect {\n-  constructor(invocationManager) {\n+  constructor({ invocationManager }) {\n     this._invocationManager = invocationManager;\n  }\n}\n\nclass PluginDriver {\n  constructor() {\n-    this.matchers = new Expect(new invocationManager());\n  }\n}\n\n-module.exports = PluginDriver;\n+module.exports = {\n+  DriverClass: PluginDriver,\n+  ExpectClass: Expect,\n+}\n```\n\n## 17.0.0\n\nDetox for iOS now uses an entirely new, custom-built matcher, action and expectation infrastructure. This is the first step in our roadmap of removing Earl Grey as a dependency.\n\nWhile the new system has been designed to be as compatible as possible with the existing system, some changes we made to existing APIs that may or may not require your attention.\n\n### New API\n\n- `pinch()`—new API for pinching elements, replacing the deprecated `pinchWithAngle()` (iOS)\n- `getAttributes()`—new API for obtaining element properties (iOS)\n- `not`—new API for inverting expectation logic (iOS, Android)\n\n### Modified API (**Potentially Breaking Changes**)\n\nThe following APIs have changed and require attention\n\n- `by.text()`—matching elements by text actually uses the element’s text value instead of using the accessibility label (iOS)\n- `by.traits()`—the supported trait values have changed (iOS)\n- `atIndex()`—matched elements are now sorted by x and y axes to allow for stability between tests; indices will most likely change after upgrading to this version of Detox (iOS)\n- `tap()`—this method now accepts an optional point to tap (iOS, Android)\n- `setColumnToValue()`—this method no longer supports date pickers; use `setDatePickerDate()` to change picker dates (iOS)\n- `setDatePickerDate()`—in addition to normal date formats, a new special case is introduced for ISO 8601 formatted date strings: `\"ISO8601\"` (iOS)\n\n### Deprecated API\n\nThe following APIs have been deprecated, but is still available\n\n- `tapAtPoint()`—the API has been consolidated with `tap(point)` (iOS, Android)\n- `pinchWithAngle()`—this API has been replaced with `pinch()` (iOS)\n- `toBeNotVisible()`—deprecated in favor of `not.toBeVisible()` (iOS, Android)\n- `toNotExist()`—deprecated in favor of `not.toExist()` (iOS, Android)\n\nMake sure to read the API reference for [matchers](../api/matchers.md), [actions](../api/actions.md) and [expectations](../api/expect.md).\n\nIf you see unexpected results, make sure to open an issue.\n\n## 16.0.0\n\nDetox now comes as a prebuilt framework on iOS, thus lowering npm install times and saving some build issues that happen due to unexpected Xcode setups.\n\nTo support this, Detox needs Swift 5 support, so the iOS requirements have changed slightly:\n\n- **Xcode**: 10.2 or higher\n  - **iOS Simulator Runtime**: iOS 12.2 or higher\n\nThis does not require that your app require iOS 12.2, only that you build and run your app on Xcode 10.2 or above, and use an iOS 12.2 or above simulator.\n\n[Mocha]: https://mochajs.org\n\n[Jest]: https://jestjs.io\n\n[`detox init`]: ../cli/init.md\n\n[`testRunner` config]: ../config/testRunner.mdx\n"
  },
  {
    "path": "docs/guide/mocking-open-with-url.md",
    "content": "# Mocking Open With URL (Deep Links)\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nYou can mock opening the app from URL to test your app’s deep link handling mechanism.\n\n### Mocking App Launch With a URL\n\n```js\nawait device.launchApp({newInstance: true, url, sourceApp: bundleId}); // sourceApp is an optional iOS-only argument\n```\n\n#### Example\n\n```js\ndescribe('launch app from URL', () => {\n    it('should handle URL successfully', async () => {\n      await device.launchApp({\n        newInstance: true,\n        url: 'scheme://some.url',\n        sourceApp: 'com.apple.mobilesafari'\n      });\n      await expect(element(by.text('a label'))).toBeVisible();\n    });\n  });\n```\n\n### Mocking Opening With a URL On a Launched App\n\n> iOS-only\n\n```js\nawait device.openURL({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});\n```\n"
  },
  {
    "path": "docs/guide/mocking-user-activity.md",
    "content": "# Mocking User Activity\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nDetox supports mocking user activity for iOS apps.\n\nThe user activity API is used to mock an external user activity state. The app normally uses this state to continue the activity inside the app. This API is also used for associated domains, Spotlight search handling and Siri intents.\n\n### Mocking App Launch with a User Activity\n\nUsing `launchApp()` with custom params will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({userActivity: activity});\n```\n\n**Example:**\n\n```js\ndescribe('Background user activity', () => {\n  it('Launch with user activity', async () => {\n    await device.launchApp({userActivity: activity})\n    await expect(element(by.text('From user activity'))).toBeVisible();\n  });\n});\n```\n\n### Sending User Activity to a Running App\n\nUse the `sendUserActivity()` method.\n\n```js\nawait device.sendUserActivity(activity)\n```\n\n**Example:**\n\n```js\n\ndescribe('Foreground user activity', () => {\n\nbeforeEach(async () => {\n  await device.launchApp({newInstance: true});\n});\n\nit('User activity from inside the app', async () => {\n  await device.sendUserActivity(activity);\n  await expect(element(by.text('From user activity'))).toBeVisible();\n });\n});\n```\n\n### User Activity JSON Format\n\nUser activities are passed as JSON objects to Detox, which then parses them and creates native objects representing the passed information.\n\nThe JSON object passed to Detox needs to provide some required data, but can also provide additional, optional data.\n\n<!--- Use http://www.tablesgenerator.com/markdown_tables to edit these tables. --->\n\n| Key            | Required | Value Type | Description                                                                                                                         |\n| -------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| `activityType` | Yes      | String     | The activity type. Either a custom user string or a predefined constant as provided by Detox. See the Activity Types section below. |\n| `webpageURL`   | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed to.                                   |\n| `referrerURL`  | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed from.                                 |\n| `userInfo`     | No       | Object     | An additional key-value pair storage, used for general purpose data passing to the app.                                             |\n\n#### Activity Types\n\nActivities can be both developer-generated user activity state, such as actions from another system—another iOS device, macOS, Safari, etc., and system-generated user activities, such as user browsed an associated domain, Spotlight search tapped, Siri intent activity, etc.,  where the app should handle such an activity.\n\nDetox supports mocking both types.\n\nFor developer-generated user activities, use a custom `activityType` that is expected by the application.\n\nFor system-generated user activities, use set the `activityType` to a predefined constant in Detox, like so:\n\n```js\nconst DetoxConstants = require('detox/index').DetoxConstants;\n\nconst userActivityBrowsingWeb = {\n  \"activityType\": DetoxConstants.userActivityTypes.browsingWeb,\n  \"webpageURL\": \"https://my.deeplink.dtx\",\n  \"referrerURL\": \"https://google.com/\"\n};\n```\n\nCurrently supported system-generated activity types:\n\n- DetoxConstants.userActivityTypes.browsingWeb - Used for associated domains (deep links)\n- DetoxConstants.userActivityTypes.searchableItem - Used for Spotlight search results\n\n#### Spotlight Search Results\n\nIn addition to `DetoxConstants.userActivityTypes.searchableItem`, Detox also provides an additional constant, used to provide the item identifier, which was selected in Spotlight. The app uses this identifier to display the item on screen.\n\nAn example on a Spotlight search user activity:\n\n```js\nconst DetoxConstants = require('detox').DetoxConstants;\n\nlet userActivitySearchableItem = {\n  \"activityType\": DetoxConstants.userActivityTypes.searchableItem,\n  \"userInfo\": {\"customKey\": \"value\"}\n};\nuserActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = \"com.test.itemId\"\n```\n"
  },
  {
    "path": "docs/guide/mocking-user-notifications.md",
    "content": "# Mocking User Notifications\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nDetox supports mocking user notifications.\n\n> **Note:** The mocking mechanism will not mimic the UI of a user notification. Instead, it will only simulate a user interaction with the notification - namely, the \"opening\" of it (equivalent to a user’s tap/swipe on it in the notification center).\n\n### Mocking App Launch With a Notification\n\n`launchApp()` with custom parameters (i.e. `userNotification`) will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({newInstance: true, userNotification: notification});\n```\n\n#### Example\n\n```js\ndescribe('Launch with push notification', () => {\n  it('should handle the notification', async () => {\n    await device.launchApp({\n      newInstance: true,\n      userNotification: userNotificationPushTrigger,\n    });\n    await expect(element(by.text('From push'))).toBeVisible();\n  });\n});\n```\n\n### Mocking Notification Reception on a Running App\n\nUse the `sendUserNotification()` method to send notification to **running** app. Notifications can be sent to an active or a background app.\n\n> Note: while the name `sendUserNotification()` is not very idiomatic on Android, as notification data is not \"sent\" to apps (rather, it is bundled into an Activity/Service launch Intent as Intent-extras), this unified API is used, for the time being, for both platforms equivalently. With [plans of a more extensive support](https://github.com/wix/Detox/issues/2141) for Android, we estimate it would be deprecated when the time comes.\n\n```js\nawait device.sendUserNotification(notification);\n```\n\n**Example:**\n\n```js\ndescribe('Foreground user notifications', () => {\n  it('should handle the local notification from inside the app', async () => {\n    await device.launchApp();\n    await device.sendUserNotification(localNotification);\n    await expect(element(by.text('from local notification'))).toBeVisible();\n   });\n});\n```\n\n### Notification JSON Format\n\nUser notifications are passed as JSON objects to Detox. The JSON object needs to provide some required data, but can also provide an additional, optional payload.\n\n**Mind the major difference here between the two platforms.** While on iOS many types of data fields are applicable, Android is very loosely defined - with support for just free-form user data in the `payload` field.\n\n| Key                 | Required                  | Value Type | Platform      | Description                                                                                                                                                                              |\n| ------------------- | ------------------------- | ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `trigger`           | Yes                       | Object     | iOS           | The conditions that trigger the delivery of the notification. See the [Triggers section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#triggers) below. |\n| `title`             | No                        | String     | iOS           | A short description of the reason for the alert.                                                                                                                                         |\n| `subtitle`          | No                        | String     | iOS           | A secondary description of the reason for the alert.                                                                                                                                     |\n| `body`              | No                        | String     | iOS           | The body of the notification.                                                                                                                                                            |\n| `badge`             | No                        | Integer    | iOS           | The number to display as the app’s icon badge.                                                                                                                                           |\n| `payload`           | iOS: No<br />Android: Yes | Object     | iOS & Android | An object of custom information associated with the notification.<br />Android: see [full description below](#payload)                                                                   |\n| `category`          | No                        | String     | iOS           | The identifier of the app-defined category object.                                                                                                                                       |\n| `content-available` | No                        | Integer    | iOS           | Include this key with a value of 1 to configure a silent notification.                                                                                                                   |\n| `user-text`         | No                        | String     | iOS           | The text response provided by the user.                                                                                                                                                  |\n| `action-identifier` | No                        | String     | iOS           | The identifier for the action that the user selected.                                                                                                                                    |\n\n#### Triggers (iOS-only)\n\nTriggers are objects representing the trigger.\n\n| Key               | Required                            | Value Type | Description                                                                                                 |\n| ----------------- | ----------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |\n| `type`            | Yes                                 | String     | The conditions that trigger the delivery of the notification. See the Trigger Types section below.          |\n| `repeats`         | No                                  | Boolean    | Indicates whether the event repeats. Only used for `calendar`, `timeInterval` and `location` trigger types. |\n| `timeInterval`    | Yes for `timeInterval` trigger type | Number     | The time interval used to create the trigger.                                                               |\n| `date-components` | Yes for `calendar` trigger type     | Object     | The date components used to construct this object. See the Date Components section below.                   |\n| `region`          | Yes for `location` trigger type     | Object     | The region used to determine when the notification is sent. See the Region section below.                   |\n\n##### Trigger Types\n\nThere are four types of triggers supported by Detox at this time:\n\n- `push`\n- `calendar`\n- `timeInterval`\n- `location`\n\nFor convenience, these trigger types are provided as constants in `DetoxConstants`:\n\n```js\nconst DetoxConstants = require('detox/index').DetoxConstants;\n\nconst userNotification = {\n  \"trigger\": {\n    \"type\": DetoxConstants.userNotificationTriggers.push\n  },\n  // ...\n}\n```\n\n#### Date Components (iOS-only)\n\n| Key              | Required | Value Type | Description                                           |\n| ---------------- | -------- | ---------- | ----------------------------------------------------- |\n| `era`            | No       | Integer    | The number of era units for the receiver.             |\n| `year`           | No       | Integer    | The number of year units for the receiver.            |\n| `month`          | No       | Integer    | The number of month units for the receiver.           |\n| `day`            | No       | Integer    | The number of day units for the receiver.             |\n| `hour`           | No       | Integer    | The number of hour units for the receiver.            |\n| `minute`         | No       | Integer    | The number of minute units for the receiver.          |\n| `second`         | No       | Integer    | The number of second units for the receiver.          |\n| `weekday`        | No       | Integer    | The number of the weekday unit for the receiver.      |\n| `weekdayOrdinal` | No       | Integer    | The ordinal number of weekday units for the receiver. |\n| `quarter`        | No       | Integer    | The number of quarters for the receiver.              |\n| `weekOfMonth`    | No       | Integer    | The week number of the month for the receiver.        |\n| `leapMonth`      | No       | Boolean    | Indicates whether the month is a leap month.          |\n\n#### Region (iOS-only)\n\n| Key             | Required | Value Type | Description                                                                                                                                                             |\n| --------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `center`        | Yes      | Object     | The center point of the geographic area. See the [Coordinate section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#coordinate) below. |\n| `radius`        | Yes      | Number     | The radius (measured in meters) that defines the geographic area’s outer boundary.                                                                                      |\n| `notifyOnEntry` | No       | Boolean    | Indicates that notifications are generated upon entry into the region.                                                                                                  |\n| `notifyOnExit`  | No       | Boolean    | Indicates that notifications are generated upon exit from the region.                                                                                                   |\n\n#### Coordinate (iOS-only)\n\n| Key         | Required | Value Type | Description                                                                                                                                                                       |\n| ----------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `latitude`  | Yes      | Number     | The latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator.                                        |\n| `longitude` | Yes      | Number     | The longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian. |\n\n#### Payload\n\nOn Android, the content will be available via the activity’s [`getIntent()`](https://developer.android.com/reference/android/app/Activity#getIntent\\(\\)) API, inside the intent’s _extra_ bundle. Under some limitations, that includes data-cascading so as to provide comprehensive support for JavaScript’s advanced object-hierarchy capabilities as much as possible. As an example, consider this payload:\n\n```js\nconst userNotification = {\n  payload: {\n    userData: 'userDataValue',\n    userDataNum: 111.2,\n    userDataFlag: true,\n    userDataArray: ['rock', 'paper', 'scissors'],\n    userDataObj: {\n      cascadedKey: 'cascadedValue'\n    },\n  },\n};\n```\n\nThe outcome on the native side will be such that all of these conditions evaluate to _true_:\n\n```java\nactivity.getIntent().getStringExtra(\"userData\") == \"userDataValue\";\nactivity.getIntent().getDoubleExtra(\"userDataNum\") == 111.2;\nactivity.getIntent().getBooleanExtra(\"userDataFlag\") == true;\nactivity.getIntent().getStringArrayExtra(\"userDataArray\")[0] == \"rock\";\nactivity.getIntent().getBundleExtra(\"userDataObj\").getString(\"cascadedKey\") == \"cascadedValue\";\n```\n\n##### Handling at Runtime\n\nNote that on Android, data delivered through an intent at runtime, is typically received in your activity’s [`onNewIntent`](https://developer.android.com/reference/android/app/Activity#onNewIntent\\(android.content.Intent\\)) callback. Be sure to consider what should be done in order to handle this type of a use case in your app: Namely, that `setIntent()` should be called in order for the data to be later available in your app through `getIntent()`, as explained earlier.\n\n> **This isn’t related to Detox in particular**, and is set here simply to help you consider all the use cases in your app so that tests coverage would be optimal.\n\n#### Examples\n\n1. [Calendar Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json)\n1. [Location Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json)\n1. [Time Interval Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json)\n1. [Push Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json)\n"
  },
  {
    "path": "docs/guide/mocking.md",
    "content": "# Mocking\n\n:::info\n\nThis article previously focused on the older React Native versions (`<0.59`), so if you need to access it, [follow this Git history link](https://github.com/wix/Detox/blob/01ad250fe4168502a57339b8bcab0ec5a5c89e4b/docs/Guide.Mocking.md).\n\n:::\n\nMocking is an integral part of testing.\nYou may want to use mocks to alter specific behavior of your app during tests, e.g., to:\n\n- change server endpoints to point to a mock/staging server instead of the regular production server;\n- stub a feature the simulator doesn’t support;\n- prepare mock environment data such as GPS position, Contacts/Photos found on the device, etc.\n\nThis guide assumes you are testing a React Native app with Detox.\n\nPlease note that you **cannot** apply mocking techniques familiar from the prior Jest experience, even though Detox runs on top of Jest, e.g.:\n\n```js\njest.mock('./src/myModule'); // NO, THIS WON'T WORK\n```\n\nAll the mocking must be conducted with the help of [Metro bundler](https://facebook.github.io/metro), which powers React Native under the hood.\nThanks to Metro bundler, there are two modes your React Native application can run in:\n\n1. **Debug mode**. Running `npx react-native start` spawns the _Metro bundler_ on port 8081 (by default). It serves JavaScript files of your app over HTTP, expecting that the native code will request it right upon the launch on the mobile device. Thus, the native app keeps re-downloading and executing the new code every time you change the code locally.\n\n1. **Release mode**. In contrast to the debug mode, _Metro bundler_ does not need to run as a server on the side. It bundles your JavaScript code once into the native app binary file. Hence, every edit to the source code requires rebuilding the entire app binary and reinstalling it on the device before you can see the effect.\n\nThere are two ways to configure the _Metro bundler_ to use your mocks: quick (**debug mode** only) and universal.\nLet's start with the quicker way.\n\n## Quick flow\n\n1. Pick a module that you are going to mock, e.g.:\n\n   ```js file=src/config.js\n   // src/config.js\n\n   export const SERVER_URL = 'https://production.mycompany.name/api';\n   export const FETCH_TIMEOUT = 60000;\n   ```\n\n1. Create a mock module alongside, with an arbitrary extension (e.g. `.mock.js`):\n\n   ```js file=src/config.js\n   // src/config.mock.js\n\n   export * from './config.js';\n\n   // override the url from the original file:\n   export const SERVER_URL = 'http://localhost:3000/api';\n   ```\n\n1. Stop your _Metro bundler_ if it has been already running, and run it again with the corresponding file extension override, e.g.:\n\n   ```bash\n   npx react-native start --sourceExts mock.js,js,json,ts,tsx\n   ```\n\n   This command is already enough to start your application in an altered mode, and you can start running your tests. Now, if some module imports `./src/config`, you tell _Metro bundler_ to prefer `./src/config.mock.js` over the plain `./src/config.js`, which means the consumer gets the mocked implementation.\n\n> CAVEAT: whichever file extension you might take for the mock files – make sure you don’t accidentally \"pick up\" unforeseen file overrides from `node_modules/**/*.your-extension.js`!\n> _Metro bundler_ does not limit itself to your project files only – applying those `--sourceExts` also affects the resolution of the `node_modules` content!\n\n## Configuring Metro bundler\n\nWhile the mentioned way is good enough for the **debug mode**, it falls short for the **release builds**. The problem is that the `--sourceExts` argument is supported only by `react-native start` command. Hence, you’d need a CLI-independent way to configure your Metro bundler, and that is patching your project's `metro.config.js`:\n\n```diff title=\"metro.config.js\"\n /**\n  * Metro configuration for React Native\n  * https://github.com/facebook/react-native\n  *\n  * @format\n  */\n+const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;\n\n module.exports = {\n+  resolver: {\n+    sourceExts: process.env.MY_APP_MODE === 'mocked'\n+        ? ['mock.js', ...defaultSourceExts]\n+        : defaultSourceExts,\n+  },\n   transformer: {\n     getTransformOptions: async () => ({\n       transform: {\n         experimentalImportSupport: false,\n         inlineRequires: true,\n       },\n     }),\n   },\n };\n```\n\nThis way, we are enforcing a custom convention that if the Metro bundler finds the `MY_APP_MODE=mocked` environment variable, it should apply our `sourceExts` override instead of the default values.\n\nTherefore, to start the Metro bundler in the mocked mode, you would run something like:\n\n```bash\nMY_APP_MODE=mocked npx react-native start\n```\n\nThis principle stays the same for the **release mode**, although the build commands might differ depending on the platform and a specific script:\n\n```bash\nexport MY_APP_MODE=mocked\n# from now on, even an implicit run of Metro bundler will use our override\n\n# via React Native CLI\nnpx react-native run-ios --configuration Release\nnpx react-native run-android --variant=release\n\n# via native tools\nxcodebuild -workspace ... -configuration release -scheme ...\n./gradlew assembleRelease\n```\n\nPlease note that preparing React Native apps for the release mode requires groundwork for both [iOS](https://reactnative.dev/docs/publishing-to-app-store) and [Android](https://reactnative.dev/docs/signed-apk-android), which is out of scope of this current article.\n\nAs you might have noticed, this tutorial has no direct connection to Detox itself, which is a correct observation.\nThe suggested mocking techniques are a part of the React Native world itself, so please consult the further resources:\n\n- <https://facebook.github.io/metro/>\n- <https://github.com/react-native-community/cli/blob/master/docs/commands.md>\n\nHappy Detoxing!\n"
  },
  {
    "path": "docs/guide/parallel-test-execution.md",
    "content": "# Parallel Test Execution\n\nDetox comes out of the box with multi-worker support thanks to ([Jest's feature](http://jestjs.io/docs/en/cli#maxworkers-num),  etc.).\n\nBy default `detox test` will run the test runner with one worker. Worker count can be controlled by forwarding `--maxWorkers <N>` to Jest via [`detox test`](../cli/test.md).\n\n## Device Creation\n\nWhile running with multiple workers, Detox might not have an available simulator for every worker.\nIf no simulator is available for that worker, the worker will create one with the name `{name}-Detox`.\n\n## Lock File\n\nSince any attached device can potentially be used simultaneously by multiple workers, Detox needs to maintain a lock file to make sure that doesn't happen.\nTherefore, Detox maintains `device.registry.json`, a file with exclusive access based on `proper-lockfile`, controlled by Detox, that registers all simulators and emulators\ncurrently in use by Detox instances.\n\nThe lock file location is determined by the OS, and [defined here](https://github.com/wix/detox/blob/master/detox/src/utils/appdatapath.js).\n\n- **MacOS**: `~/Library/Detox/device.registry.json`\n- **Linux**: `~/.local/share/Detox/device.registry.json`\n- **Windows**: `%LOCALAPPDATA%/data/Detox/device.registry.json` or `%USERPROFILE%/Application Data/Detox/device.registry.json`\n"
  },
  {
    "path": "docs/guide/proguard-configuration.md",
    "content": "# ProGuard configuration\n\n:::tip\n\nYou can skip this guide if you are working solely with debug builds (`android.emu.debug`, etc.),\nbut as soon as you move to the **release builds**, where the native code gets minified and obfuscated,\nyou are going to have problems with Detox if you leave your ProGuard rules not configured.\n\n:::\n\nSince Detox relies on [Android Reflection API] to integrate with React Native on Android, you should keep [ProGuard minification] under tight control.\nOtherwise, you’ll be seeing Detox crashing or hanging up infinitely upon an attempt to run tests with your app built in **release mode**.\n\nTo fix that, you’d need to return to your app build script:\n\n```diff title=\"app/build.gradle\"\n     buildTypes {\n     …\n// highlight-next-line\n         release { /* (1) */\n             minifyEnabled true\n\n// highlight-next-line\n   /* (2) */ proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n// highlight-next-line\n+  /* (3) */ proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n         }\n     }\n```\n\n1. `release` build type is typically the one to have ProGuard enabled.\n1. ProGuard files present by default in React Native projects. Check out [Android docs][ProGuard minification] to get to know more.\n1. Detox-specific [exclude list](https://github.com/wix/Detox/blob/master/detox/android/detox/proguard-rules.pro) for ProGuard.\n\n:::info\n\nIn order for Detox to be able to work properly, in `proguard-rules-app.pro`, it effectively declares rules that retain most of React-Native’s code (i.e. keep it unminified, unobfuscated) in your **production** APK.\n\n:::\n\n## Obfuscation\n\nExempting source files from the obfuscation means that their contents might be restored by unauthorized people,\nbut this should not be an issue for you, because React Native is an open-source project per se.\n\nIf it nevertheless bothers you, there are workarounds such as defining multiple build flavors: one for running\nend-to-end tests with Detox, and the other one for publishing to the marketplaces:\n\n```gradle title=\"app/build.gradle\"\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n\n            signingConfig signingConfigs.release\n        }\n// highlight-start\n        releaseE2E {\n            initWith release\n            setMatchingFallbacks('release')\n\n            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n        }\n    }\n// highlight-end\n```\n\nAs can be seen above, we use `initWith` and `setMatchingFallbacks` to extend the new `releaseE2E` build type from\nthe existing one, and then we add an override to it, i.e. `proguardFile`.\n\nFollowing the example, you would then have to adjust your `build` and `binaryPath` properties accordingly:\n\n```diff\n{\n  apps: {\n     'android.release': {\n       type: 'android.apk',\n-      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n+      binaryPath: 'android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk',\n-      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release'\n+      build: 'cd android && ./gradlew assembleReleaseE2E assembleAndroidTest -DtestBuildType=release'\n     },`\n```\n\n:::note\n\nIf your app already contains flavors – that makes things a bit trickier, but the approach can generally be adjusted to support that as well.\n\n:::\n\n**Last but not least:** If you’re having issue with Detox' ProGuard rules, please report them [here](https://github.com/wix/Detox/issues/new/choose).\n\nA special thanks to [@GEllickson-Hover](https://github.com/GEllickson-Hover) for reporting issues related to obfuscation in [#2431](https://github.com/wix/Detox/issues/2431).\n\n[Android Reflection API]: https://developer.android.com/reference/java/lang/reflect/package-summary\n\n[ProGuard minification]: https://developer.android.com/studio/build/shrink-code\n"
  },
  {
    "path": "docs/guide/taking-screenshots.md",
    "content": "# Taking Screenshots\n\nDetox supports taking in-test screenshots of the device, making the result immediately available in the form of an image file.\n\nScreenshots can be taken in two levels:\n\n- **Device-level:** taking a screenshot of the entire screen.\n- **Element-level:** taking a screenshot of a specific element (and the view-hierarchy associated with it), currently appearing on the screen.\n\nIn both cases, the concept is mainly useful for verifying the proper visual structure and layout of elements appearing on the device’s screen, in the form of a snapshot-test. Namely, by following these conceptual steps:\n\n1. Taking a screenshot, once, and manually verifying it, visually.\n1. Storing it as an E2E test asset (i.e. the _snapshot_).\n1. Using it as the point-of-reference for comparison against screenshots taken in consequent tests, from that point on.\n\n```js\nconst fs = require('fs');\n\ndescribe('Members area', () => {\n  const snapshottedImagePath = './e2e/assets/snapshotted-image.png';\n\n  it('should greet the member with an announcement', async () => {\n    const imagePath = (take screenshot from the device); // Discussed below\n    expectBitmapsToBeEqual(imagePath, snapshottedImagePath);\n  });\n});\n\nfunction expectBitmapsToBeEqual(imagePath, expectedImagePath) {\n  const bitmapBuffer = fs.readFileSync(imagePath);\n  const expectedBitmapBuffer = fs.readFileSync(expectedImagePath);\n  if (!bitmapBuffer.equals(expectedBitmapBuffer)) {\n    throw new Error(`Expected image at ${imagePath} to be equal to image at ${expectedImagePath}, but it was different!`);\n  }\n}\n```\n\n**Important:** The recommended, more practical way of doing this, is by utilizing more advanced 3rd-party image snapshotting & comparison tools such as [Applitools](https://applitools.com).\n\n## Device-level Screenshots\n\nTaking a screenshot of the entire screen can be done using a device-level API:\n\n```js\nconst imagePath = await device.takeScreenshot('opened general section');\n```\n\nThe API immediately returns the path of a temporary, readable image file where the screenshot is stored, all-the-while scheduling the transferring of it to the [artifacts folder](../config/artifacts.mdx#enabling-artifacts) upon completion of the currently running test.\n\n**Returns:**\n\nThe path of a temporary file containing the resulted `.png` image.\n\nImportant: The returned path is guaranteed to be valid only during the test execution. Later on, the screenshot will be moved to the artifacts' folder, and will not be available.\n\n**Parameters:**\n\n`name (optional)` - Name of the final image-file to store as the artifact. For example, setting `name` to `opened general section` would result in an artifact file named `opened general section.png`. In case the name isn’t provided, Detox would self-generate a random, distinct name, instead (though not a very descriptive one).\n\n### Artifacts Management\n\nMeans of creation of the final image as an artifact is tightly connected to the `--take-screenshots` argument to Detox CLI:\n\n- If `--take-screenshots none` is set, the screenshot will be taken, but it won’t be saved to `<artifacts-location>` after the test ends.\n- If `--take-screenshots failing` is set, and the test passes, the screenshot won’t be saved to `<artifacts-location>` after the test ends.\n- In the other modes (`manual` and `all`), if the test passes, the screenshot will be put to `<artifacts-location>/✓ Members area should greet the member with an announcement/opened general section.png`.\n- In the other modes (`manual` and `all`), if the test fails, the screenshot will be put to `<artifacts-location>/✗ Members area should greet the member with an announcement/opened general section.png`.\n\n### Caveats\n\nThis API well-captures all elements, although alongside surrounding \"visual noise\" such as the navigation bar, as can be seen in the image below:\n\n![device-screenshot](../img/device-screenshot.png)\n\nAs the image includes, for example, the current time (in the top-left corner), running the test in any _different_ time would unnecessarily result in an utter comparison failure, making the test downright useless. Fortunately, this can be resolved, by putting the device into \"demo mode\" (i.e. freezing the irrelevant, volatile elements) . For example (credits - [Miki](https://github.com/M-i-k-e-l)):\n\n```js\nasync function setDemoMode() {\n  if (device.getPlatform() === 'ios') {\n    execSync(\n      'xcrun simctl status_bar \"iPhone 11\" override --time \"12:00\" --batteryState charged --batteryLevel 100 --wifiBars 3 --cellularMode active --cellularBars 4'\n    );\n  } else {\n    // enter demo mode\n    execSync('adb shell settings put global sysui_demo_allowed 1');\n    // display time 12:00\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200');\n    // Display full mobile data with 4g type and no wifi\n    execSync(\n      'adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype 4g -e wifi false'\n    );\n    // Hide notifications\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false');\n    // Show full battery but not in charging state\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100');\n  }\n}\n```\n\n> Note: This script implicitly assumes only one device is used, as device ID isn’t specified anywhere (e.g. with `adb -s <id>`).\n\n## Element-level Screenshots\n\nTaking a screenshot of a specific element can be simply done using an API similar to other element-interaction Detox APIs:\n\n```js\nconst imagePath = await element(by.id('announcementsRoot')).takeScreenshot('welcome announcement');\n```\n\n> The API works in the exact same way as `device.takeScreenshot()` does in terms of return value, arguments, and artifacts management.\n\nIn this example, the image-file specified by `imagePath` will hold the visual content of a native view whose test ID is `announcementsRoot`, alongside all of the views in the view-hierarchy formed by it as the root-view. Visually, this can be, for example:\n\n![Announcements view](../img/element-screenshot-view.png)\n\nMeaning, assuming `announcementsRoot` has been specified over some ancestor view which has both the `Announcement` title _and_ the card as its direct or indirect children, the result would include both. That, in turns, also includes the card’s children, such as the avatar, welcome text, etc.\n\n### Caveats of this approach\n\nFocusing on specific elements, this approach is key to more stable comparisons, and hence more stable tests, over time. However, inspecting less content evidently means protecting against less bugs. For example, In a screen where the element in question is partly obstructed by other elements drawn on the screen, the image created by `takeScreenshot()` will successfully hold all of it’s content, nonetheless.\n\nConsider this situation in one of the app’s screens, where the upcoming schedule overlaps the top-hand announcement card:\n\n![overlap](../img/element-screenshot-overlap.png)\n\nTaking an element-screenshot of the announcement part alone, would yield a proper result, leaving this bug overlooked:\n\n![announcement element](../img/element-screenshot-view.png)\n\nOnly by taking the element-screenshot of a common ancestor, will this bug be surfaced. However, in turn, that can affect stability, as the result is now sensitive to more details such as padding and background color.\n\n**As a bottom line, this API is mostly suited for testing UI components rather than complete screens.**\n"
  },
  {
    "path": "docs/guide/test-id.md",
    "content": "# Adding test ID's to your components\n\n:::info Note\n\nThis guide was written primarily for React Native apps, but it can be generalized for testing any app, including native apps.\n\n:::\n\nWhile [view-element matching](../api/matchers.md) can be done in numerous ways, it is always the best idea to match based on something unique and decoupled, as it ensures that the test code is clear, stable and sustainable over time.\n\nWe recommend assigning unique test ID's to the elements you're aiming to interact with in your tests, and preferring matching based on those rather than on anything else. Test ID's are the least likely to change over time (compared with raw text, for example), and are locale-agnostic. Furthermore, utilizing unique test ID's across the app not only simplifies the identification and interaction with specific elements but also enhances code navigability, making it easier to locate elements when traversing the codebase.\n\nIn React Native applications, `View` components have a dedicated [test ID property](https://reactnative.dev/docs/view#testid) that can be utilized:\n\n```jsx\n<View>\n  <TouchableOpacity testID=\"Onboarding.Next_button\">\n    <Text>Next</Text>\n  </TouchableOpacity>\n</View>\n```\n\nFor native apps, test ID's can be assigned by setting a value for the following properties:\n\n- **iOS:** [`accessibilityIdentifier`](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier)\n- **Android:** Default [viewTag](https://developer.android.com/reference/android/view/View#tags)\n\n## Pass testID to your native components\n\nPassing a `testID` to your custom component props has no effect until you forward it down to a native component like `<View />` or `<TouchableOpacity />`\nthat implements rendering it as an accessibility identifier in the native component hierarchy:\n\n![Pass testID to native component](../img/test-id/passTestID.png)\n\nFor example, you have `<YourCustomComponent />` and you pass a `testID` to it:\n\n```jsx title=\"YourScreen.jsx\"\nfunction YourScreen() {\n  return (\n    <YourCustomComponent testID=\"YourCustomComponent\" />\n  );\n}\n```\n\nMake sure that your implementation passes `testID` to some React Native component that supports it:\n\n```jsx title=\"YourCustomComponent.jsx\"\nfunction YourCustomComponent(props) {\n  return (\n// highlight-next-line\n    <View testID={props.testID}>\n      <Text>Some text</Text>\n    </View>\n  );\n}\n```\n\n### Child elements\n\nIf your component has several useful child elements, it is even a better idea to assign them some derived test IDs, e.g.:\n\n```jsx title=\"YourCustomComponent.jsx\"\nfunction YourCustomComponent(props) {\n  return (\n// highlight-next-line\n    <View testID={props.testID}>\n      <Text testID={`${props.testID}.label`}>Some text</Text>\n    </View>\n  );\n}\n```\n\nThat way, you could refer to specific elements in Detox tests via the most basic and least ambiguous `by.id` matchers, e.g.:\n\n```js\nexpect(element(by.id('YourCustomComponent'))).toBeVisible();\nexpect(element(by.id('YourCustomComponent.label'))).toHaveText('Some text');\n```\n\n### Repetitive components\n\nIt is highly not recommended to use non-unique `testID`, e.g. when your components get rendered in any sort of repeater or virtualized list:\n\n```jsx title=\"YourScreen.jsx\"\nconst ITEMS = [\n  { title: 'First Item' },\n  { title: 'Second Item' },\n  { title: 'Third Item' },\n];\n\nfunction YourScreen() {\n  const renderItem = ({ item }) => (\n// highlight-next-line\n    <YourCustomComponent testID={'listItem'} label={item.title} />\n  );\n\n  return (\n      <FlatList\n        data={ITEMS}\n        renderItem={renderItem}\n      />\n  );\n}\n```\n\nThis would be a violation of accessibility guidelines and unnecessary complication for your test matchers.\nYou’d also have to use extra matchers and `.atIndex` clarification:\n\n```js\nexpect(element(by.id('listItem')).atIndex(2)).toHaveText('Third Item');\n```\n\nInstead, you could generate a unique `testID` for every list item with the `index` property:\n\n```jsx\n  const renderItem = ({ item, index }) => (\n    <YourCustomComponent testID={`listItem.${index + 1}`} label={item.title} />\n  );\n```\n\nThat way, your assertion would become simpler and more deterministic:\n\n```js\nexpect(element(by.id('listItem.3'))).toHaveText('Third Item');\n```\n\n![testID for repetitive components](../img/test-id/repetitiveComponentTestID.png)\n\n## Finding your test ID\n\n:::note\n\nIncorrect or absent `testID` is a common cause for test failure.\nIf your test can't find your `testID` and you can't see it either using tools described below, that usually means you haven't passed it down to this component.\nMake sure you keep forwarding it down until it reaches a native component.\n\n:::\n\nTo make sure your `testID` is indeed rendered in your app, you can use such tools as MacOS' built-in [accessibility inspector](https://developer.apple.com/documentation/accessibility/inspecting-the-accessibility-of-screens) for iOS, and [Detox Layout-inspector](https://github.com/wix-incubator/detox-inspector) (setup required) for Android.\n\n## Test ID naming - Best practices\n\nTest ID's work best when they are unique, simple and concise. Here are our recommendations regarding what rules to follow in terms of naming.\n\n### Use a consistent naming system\n\nDecide upon a system by which test ID's are named, and stick with it.\n\n1. Use a consistent naming convention. An `ITEM_NAME_ALL_CAPS` convention and an `ItemNameUpperCamelCase` are both ok, but **don't use them either intermittently nor in conjunction:**\n\n   - `SITE_LIST_ROOT` & `SITE_LIST_ITEM_1` - :white\\_check\\_mark:\n   - `SITE_LIST_ROOT` & `SiteList_Item1` - :x:\n   - `SITE_LIST_Item1` - :x:\n1. Consistently apply notations for special items. For example:\n   - A `_ROOT` postfix for screen-root or list-root items (e.g. `SITE_LIST_ROOT`)\n   - A `_BTN` for buttons / touchable CTA elements\n1. Apply consistent prefixes as categories in order to introduce a top-level context to the test ID, distinguishing it from similar ones in various places in the app. The name of the associated screen can be useful in that sense. For example: `EDIT_PROFILE_SCREEN.DONE_BTN` is better than just `DONE_BTN` for a button that is inside a user profile editing screen. Also, things such as `NAV_TABS.`, `TOP_TABS.` and `SIDE_MENU.` can be used as good context providers.\n1. As explained in the section on passing test ID's to _child_ elements, drill down to the details of elements via a _chain of contexts_. Given the parent element-group of an element (for example, a card in a feed), use its own test ID as a prefix for the sub-items (e.g. an options \"meatballs\" / \"kebab\" CTA or an _edit_ button). For example:\n   - `SITE_LIST_ITEM1` ⇒\n     - `SITE_LIST_ITEM1.OPTIONS`\n     - `SITE_LIST_ITEM1.EDIT_BTN`\n     - `SITE_LIST_ITEM1.TITLE`\n1. In a large-scale, multi-module environment, apply a consistent module identifier as the module's test ID's prefix. For example:\n   - `AUTH.LOGIN_SCREEN.EDIT_PASSWORD` - the `AUTH.` prefix suggests that were are under the context of a module handling Authentication matters.\n\n:::tip\n\nDon't hesitate to articulate a well defined conventions manifest that all teams should adhere to.\n\n:::\n\n### Use simple names\n\nStick to simple alpha-numeric characters, and simple separators. When it comes to test ID's, there's usually no reason to use special characters or emojis.\n\nIn addition, use test ID that clearly describe the associated element, but are also concise. For example:\n\n- `SITE_LIST_ROOT` - :white\\_check\\_mark:\n- `MAIN_SITE_LIST_WRAPPER_ELEMENT` - :x:\n- `SITE_LIST@ITEM$1` - :x:\n\n### Dissociate test ID names\n\nMake sure the names you give test ID's are completely decoupled and dissociated from everything else in the system. In particular -\n\n:::warning Attention\n\nBy all means, **never utilize the element's text / label in the naming of a test ID!**\nNamely, a test ID should never use `text` or `label` props passed to a React Native component.\n\n:::\n\nThere are at least 2 reasons why this is a very important rule:\n\n1. Alternation of test ID's can lead to broken tests (test-ID based matchers become obsolete), and on-screen text can change frequently.\n1. In apps supporting multiple languages, the on-screen text is likely to be different in each language. You want the same test code to be compatible with any language set into the test device, and you therefore need it have as little awareness to it as possible. Using test ID's is the best means to keep it that way.\n\n### Examples\n\nBased on the `ALL_CAPS` convention, here is an example of a screen which test ID's illustrate the principles of this discussion:\n\n![Test ID: Naming example](../img/test-id/naming-example.png)\n"
  },
  {
    "path": "docs/guide/testing-webviews.md",
    "content": "# Testing WebViews\n\nIn this tutorial, we'll go over how you can test a WebView in React Native applications using Detox. We will cover how to engage with web elements in both single and multi WebView scenarios, apply matchers, and execute actions.\n\nWebViews are crucial parts in a lot of mobile applications, rendering content like web pages or PDF documents within the native environment. However, because the content inside WebViews is web content and not native, it isn't straightforward to interact with using Detox. But fear not, Detox has got you covered with its suite of Web View methods.\n\n:::note\n\nThis guide provides an overview of testing web views within React Native apps with Detox. For complete API details, refer to our [WebView API documentation][api].\n\n:::\n\n## Step 0: Setting Up Detox\n\nThe first thing you'll need is to have your Detox environment properly set up. If you need a hand with that, you can follow the set-up guide [here][setup].\n\n## Step 1: Locating the WebView\n\nDetox provides two approaches for locating the host web view and its inner elements, depending on the number of WebViews on the screen.\n\n### Single WebView Scenario\n\nThe case of a single WebView on the screen is the most common scenario, and it's the simplest to handle.\n\nDetox will automatically locate the web view for you, so you don't need to do anything special to find it.\nIn this case, you can use the [`web.element()`][webelementmatcher] function with web element matchers to reference elements inside it, see [next step][finding-inner-elements] in this guide for further details.\n\n### Multiple Web Views Scenario\n\nIn scenarios where there are multiple WebViews displayed on the screen, you will have to identify a particular WebView first.\nUse a [native matcher][native-matcher] to do this, same as you would for native elements.\n\n```javascript\nconst myWebView = web(by.id('webview_identifier'));\n```\n\nAfter locating the web view, you can then use the `myWebView.element()` method with web view matchers to locate elements within it. See [next step][finding-inner-elements] in this guide for further details.\n\n#### Using `atIndex`\n\nIt is also possible to locate the web view by applying at-index to the web view matcher in case there are multiple matching web views for the same matcher.\n\n```javascript\nconst myWebView = web(by.id('webview_identifier').atIndex(1));\n```\n\n:::note\n\n`atIndex()` API for WebView matching is currently supported for iOS only. Check our [API documentation][at-index-api] for updates.\n\n:::\n\n## Step 2: Finding Inner Elements\n\nElement matchers are used to find elements within a web view. The [Detox WebView APIs][matchers-apis] provide various matchers for locating elements within a web view (e.g. `by.web.id(id)`, `by.web.className(className)`, `by.web.tag(tag)`, `atIndex(index)` etc.).\n\nHere are examples of using some of the matchers:\n\n```javascript\n// Match by ID attribute\nconst elementByID = web.element(by.web.id('identifier'));\n\n// Match by CSS class name attribute\nconst elementByClassName = web.element(by.web.className('className'));\n\n// Match by CSS selector\nconst elementByCSSSelector = web.element(by.web.cssSelector('#cssSelector'));\n\n// Match with index in case of multiple matching elements\nconst elementAtIndex = web.element(by.web.id('identifier').atIndex(1));\n```\n\n### Bypass CORS Restrictions (iOS Only)\n\nWhen testing web views, you may encounter Cross-Origin Resource Sharing (CORS) restrictions that prevent you from interacting with elements inside the web view.\n\nAt the moment, Detox is able to bypass CORS restrictions and other browser security features only on iOS, allowing you to interact with inner elements in cases of CORS restrictions (in most cases).\n\nTo bypass CORS restrictions on iOS, you can pass the [`detoxDisableWebKitSecurity`] launch argument. This argument will disable the WebKit security features, allowing Detox to interact with the WebView in a \"Sandbox\" environment.\n\n```javascript\nawait device.launchApp({ launchArgs: { detoxDisableWebKitSecurity: true } });\n```\n\n## Step 3: Perform Actions\n\nActions allow you to interact with elements within a web view. The [Detox WebView APIs][actions-apis] provide various actions that can be invoked on inner elements.\n\nFor example, here's a simple example for filling a login form and press on login button:\n\n```javascript\n\n// Fill username and password\nawait web.element(by.web.id('username')).typeText('John Doe');\nawait web.element(by.web.id('password')).typeText('123456789');\n\n// Press the login button\nawait web.element(by.web.id('login')).tap();\n\n```\n\n### Perform Custom Actions (`runScript`)\n\nYou can also execute custom JavaScript code on the web view using the `runScript` action (see [API docs][run-script-api]).\nThis is useful for scenarios where you need to interact with the web view in a way that isn't covered by the built-in actions, for fetching data, or for triggering custom events.\n\nFor example, you can use `runScript` to get the font size of a text element:\n\n```javascript\n// Define the matcher for the inner text element\nconst textElement = web(by.id('webview_identifier')).element(by.web.id('text_element'));\n\n// Get the font size of a text element\nconst fontSize = await textElement.runScript(function get(element) {\n  return element.style.fontSize;\n});\n\n// Use jestExpect to assert the font size\njestExpect(fontSize).toBe('16px');\n```\n\n:::note\n\nUsing jest-expectations in Detox tests is possible by importing `expect` API from `jest` package and using it with a separate `jestExpect` variable (as shown in the example below).\nThis is due to the fact that Detox uses its own `expect` API, which is not compatible with jest-expectations.\n\n```javascript\nconst jestExpect = require('expect').default;\n```\n\n:::\n\n## Step 4: Assert on Expected Behaviour\n\nExpectations are assertions on the state of elements within a WebView.\n\nFor instance, to verify an element has specific text:\n\n```javascript\nawait expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n```\n\nOr to assert an element does not exist:\n\n```javascript\nawait expect(web.element(by.web.id('invalid_identifier'))).not.toExist();\n```\n\n## Full Example\n\nHere's a full example of a test that interacts with a WebView:\n\n```javascript\nit('should login successfully', async () => {\n    // Assert the welcome message is not visible before login\n    await expect(web.element(by.web.id('welcome_message'))).not.toExist();\n\n    // Fill username and password\n    await web.element(by.web.id('username')).typeText('John Doe');\n    await web.element(by.web.id('password')).typeText('123456789');\n\n    // Press the login button\n    await web.element(by.web.id('login')).tap();\n\n    // Assert the login was successful\n    await expect(web.element(by.web.id('welcome_message'))).toHaveText('Welcome, John Doe!');\n});\n```\n\n[setup]: ../introduction/environment-setup.md\n[api]: ../api/webviews.md\n[native-matcher]: ../api/matchers.md\n[content-editable]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable\n[webelementmatcher]: ../api/webviews.md#webelementmatcher\n[matchers-apis]: ../api/webviews.md#matchers\n[actions-apis]: ../api/webviews.md#actions\n[run-script-api]: ../api/webviews.md#runscriptscript-args\n[finding-inner-elements]: #step-2-finding-inner-elements\n[at-index-api]: ../api/webviews.md#webnativematcheratindexindexelementmatcher\n[`detoxDisableWebKitSecurity`]: ../api/device.md#12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only\n"
  },
  {
    "path": "docs/guide/typescript.md",
    "content": "# Using TypeScript\n\n:::info\n\nThis guide assumes you are using Detox's default test runner integration with Jest.\nIf you have a custom integration, you need to consult your test runner's documentation\non how to use TypeScript with it.\n\n:::\n\nIt is very common among JavaScript developers to use TypeScript in their projects,\nso a question arises: **how to use Detox with TypeScript?** Since Detox by default\nbases on Jest, the question can be rephrased as: [how to use Jest with TypeScript?](https://jestjs.io/docs/getting-started#using-typescript).\n\nNevertheless, since many people ask about it, we decided to provide a guide on how to use Detox with TypeScript.\n\n## Prerequisites\n\n- A working Detox setup with Jest as your test runner.\n- TypeScript installed in your project.\n\nSince React Native 0.71, the default React Native project template comes with TypeScript support out of the box. However, if you have no TypeScript project, now's the time:\n\n```bash npm2yarn\nnpm install --save-dev typescript\ntsc --init\n```\n\nThe latter command will generate a default `tsconfig.json` file, so that you can modify it to suit your needs.\n\n:::tip\n\nIf you get an error like:\n\n```plain text\ncommand not found: tsc\n```\n\nYou can try to:\n\n1. `export PATH=$PATH:./node_modules/.bin` if you are using `bash` or `zsh`.\n1. `set PATH=%PATH%;./node_modules/.bin` if you are using Windows Command Prompt.\n1. run `npx tsc --init` instead of `tsc --init`.\n1. or any other solution to run an executable from `node_modules/.bin` directory.\n\n:::\n\nMake sure your TypeScript compiles without errors before proceeding:\n\n```bash\ntsc # or tsc --noEmit if you don't want to generate output files\n```\n\n## Setting up Jest with TypeScript\n\nJest requires a few extra packages to work seamlessly with TypeScript, so let's install them:\n\n```bash npm2yarn\nnpm install --save-dev ts-jest @types/jest @types/node\n```\n\nYour Jest config file at `e2e/jest.config.js` (or wherever you keep your Jest configuration) also needs a couple of tweaks:\n\n```javascript\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n// highlight-next-line\n  preset: 'ts-jest', // (1)\n  rootDir: '..',\n// highlight-next-line\n  testMatch: ['<rootDir>/e2e/**/*.test.ts'], // (2)\n  testTimeout: 120000,\n  maxWorkers: 1,\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  reporters: ['detox/runners/jest/reporter'],\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  verbose: true,\n};\n```\n\n1. The `preset` option tells Jest to use `ts-jest` to compile TypeScript files. This is the most important part of the setup.\n1. Make sure you update your `testMatch` to include TypeScript files. Otherwise, you are likely to get an error like this:\n\n   ```plain text\n   No tests found, exiting with code 1\n   Run with `--passWithNoTests` to exit with code 0\n   In /path/to/your/project\n     60 files checked.\n     testMatch: /path/to/your/project/e2e/**/*.test.js - 0 matches\n     testPathIgnorePatterns: /node_modules/ - 60 matches\n     testRegex:  - 0 matches\n   Pattern:  - 0 matches\n   ```\n\n## Writing Detox Tests in TypeScript\n\nWith the setup ready, you can now write Detox tests in TypeScript.\nChange file extensions from `.js` to `.ts` where appropriate, and you’re good to go.\n\n```typescript\n// highlight-next-line\nimport { expect } from 'detox';\n\ndescribe('Login Screen', () => {\n it('should login with correct credentials', async () => {\n   const email: string = 'test@example.com';\n   const password: string = 'password123';\n\n   await element(by.id('emailInput')).typeText(email);\n   await element(by.id('passwordInput')).typeText(password);\n   await element(by.id('loginButton')).tap();\n\n   expect(await element(by.id('welcomeMessage'))).toBeVisible();\n });\n});\n```\n\n:::info\n\nPay attention at the highlighted line above, where we import `expect` from Detox. Unfortunately, there is [an unresolved clash](https://github.com/wix/Detox/issues/2610) between Jest's `expect` and Detox's `expect` when using TypeScript. This will be fixed in the future, but for now, you need to import Detox's `expect` explicitly in case you see errors like this:\n\n```plain text\nerror TS2339: Property 'toBeVisible' does not exist on type 'JestMatchers<IndexableNativeElement>'.\n```\n\n:::\n\n## Conclusion\n\nUsing Detox with TypeScript largely boils down to setting up Jest to understand TypeScript. With the power of static typing, your Detox tests can now become more robust, easier to understand, and less error-prone. Happy testing!\n"
  },
  {
    "path": "docs/guide/uninstalling.md",
    "content": "# Uninstalling Detox\n\nInstalling and using Detox implies certain side effects: cloned devices, cache files, state files, temporary files, etc.\n\nThis checklist might come in handy whenever you have to make a clean uninstallation after using Detox.\n\n## Detox Framework Cache\n\nEvery install of Detox also triggers a `postinstall` script in its `package.json`, which builds (or unpacks) `Detox.framework` into `~/Library/Detox`.\n\nYou can either delete the folder manually:\n\n```bash\nrm -rf ~/Library/Detox\n```\n\nor run:\n\n```bash\ndetox clean-framework-cache\n```\n\n## Test Session State\n\nOn every test run, Detox rewrites a few temporary files in `DETOX_LIBRARY_ROOT_PATH`, i.e.:\n\n1. `device.registry.json`, to tell apart the busy and the available devices for use with multiple workers.\n2. `global-context.json.lock`, to detect multiple concurrent instances of Detox.\n\nThe location of `DETOX_LIBRARY_ROOT_PATH` may vary depending on the operating system:\n\n- macOS:\n  - `~/Library/Detox`.\n- Linux:\n  - `$XDG_DATA_HOME/Detox`, if `$XDG_DATA_HOME` is defined;\n  - `~/.local/share/Detox`, otherwise.\n- Windows:\n  - `%LOCALAPPDATA%\\data\\Detox`, if `%LOCALAPPDATA%` is defined;\n  - `%USERPROFILE%\\Application Data\\Detox`, otherwise.\n\n## Cloned Simulators (macOS)\n\nTo support the \"multiple workers\" feature on iOS, Detox clones simulator instances when there aren’t enough available ones.\nThe autogenerated simulators have names with `-Detox` suffix appended, so you can easily spot them with:\n\n```bash\nxcrun simctl list | grep \"-Detox\"\n```\n\nTo delete a simulator, you can use:\n\n```bash\nxcrun simctl delete <uuid>\n```\n\n## Remnants of Artifacts\n\nForced exits may result in leaving some temporary files behind.\n\n### iOS\n\nTo ensure there are no temporary artifact files (logs, screenshots, etc.), you can run:\n\n```bash\nrm -rf $TMPDIR/*.detox.*\n```\n\nIf you wish to clean up your iOS simulators from the installed apps and other customizations, just run the erase procedure for the relevant ones:\n\n```bash\nxcrun simctl erase <uuid>\n```\n\n### Android\n\nThe advice for iOS applies to the Android virtual devices as well. To wipe user files on a specific AVD, run:\n\n```bash\nemulator -avd <your_AVD> -wipe-data\n```\n\nIf you have to clean temporary Detox files from an individual booted device, look out for files like `11159175_0.log` in `/sdcard` folder.\nYou can try deleting them using a simple wildcard like below or use your own:\n\n```bash\nadb -s <emulator-port> shell rm -rf /sdcard/*_*.*\n```\n\n## Detox CLI\n\nIf you have installed the official CLI wrapper for Detox, then make sure to uninstall it as well:\n\n```bash\nnpm uninstall detox-cli --global\n```\n"
  },
  {
    "path": "docs/introduction/debugging.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\nimport DebuggerAttachWebstorm from './partials/_debugging-attach-webstorm.mdx';\nimport DebuggerAttachChrome from './partials/_debugging-attach-chrome.mdx';\nimport DebuggerAttachVscode from './partials/_debugging-attach-vscode.mdx';\nimport CompilingIOS from './partials/_debugging-native-code-compliing-ios.mdx';\nimport CompilingAndroid from './partials/_debugging-native-code-compliing-android.mdx';\nimport ConfigIOS from './partials/_debugging-native-code-config-ios.mdx';\nimport ConfigAndroid from './partials/_debugging-native-code-config-android.mdx';\nimport RunIos from './partials/_debugging-native-code-run-ios.mdx';\nimport RunAndroid from './partials/_debugging-native-code-run-android.mdx';\nimport TroubleshootingAndroid from './partials/_debugging-native-code-troubleshooting-android.mdx';\n\n# How to Debug\n\nIn the Detox world, you can debug either Detox itself (i.e. run it step by step), and the tested app. This guide covers both options.\n\n## Running Detox Tests Step-by-Step\n\nDetox tests can be run step-by-step either using an IDE or by using Chrome debugger.\n\n:::tip New in Detox\n\nDetox now supports an interactive **REPL** (Read-Eval-Print Loop) mode for debugging. You can explore app state, issue commands, or pause test execution — all in real time.\n\nEnable it via `--repl` CLI argument and add `await detox.REPL()` in test code.\n\n→ [**See full guide**](../guide/detox-repl.md)\n:::\n\nStart by running Detox using the Detox CLI alongside the inspection argument (`--inspect-brk`) and the file in which the test resides. For example:\n\n```bash\ndetox test --inspect-brk -c android.emu.debug e2e/starter.test.js\n```\n\nYou will see Detox starts and these logs:\n\n```plain text\nDebugger listening on ws://127.0.0.1:9229/3dedd03b-8896-4ab8-a0a8-1b647abb9c98\nFor help, see: https://nodejs.org/en/docs/inspector\n```\n\nNow you can attach to Detox and tap-in into its execution process.\n\n:::info\n\nTo learn more about debugging with `--inspect-brk`, refer to [Debugging — Getting Started](https://nodejs.org/en/docs/guides/debugging-getting-started/) on the official Node.js website.\n\n:::\n\n<Tabs groupId=\"debuggerAttach\">\n  <TabItem value=\"Webstorm\" label=\"Webstorm\" default>\n    <DebuggerAttachWebstorm />\n  </TabItem>\n  <TabItem value=\"vs-code\" label=\"vs-code\">\n    <DebuggerAttachVscode />\n  </TabItem>\n  <TabItem value=\"Chrome\" label=\"Chrome\">\n    <DebuggerAttachChrome />\n  </TabItem>\n</Tabs>\n\n\n\n## Debugging JavaScript application code\n\nUse debug configurations of your app that rely on React Native Packager running on port 8081 (or another):\n\n* `ios.sim.debug`\n* `android.emu.debug`\n\nFor the rest of details, please refer to [React Native – Debugging](https://reactnative.dev/docs/debugging).\n\n## Debugging Native application code\n\n### Setting Detox up as a compiling dependency\n\n:::info Note\n\nThis step is optional. It is intended for investigating weird crashes or when contributing to Detox itself.\n\n:::\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\" default>\n    <CompilingIOS />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <CompilingAndroid />\n  </TabItem>\n</Tabs>\n\n### Add a \"manual\" configuration to your Detox config\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\" default>\n    <ConfigIOS />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <ConfigAndroid />\n  </TabItem>\n</Tabs>\n\nWhile the `behavior` section is a **mandatory** thing to include, there are a few more optional\nparameters to disable various side effects and make life easier when debugging:\n\n```diff\n {\n   …\n   \"configurations\": {\n     \"<your configuration>\": {\n       …\n       \"behavior\": {\n         \"launchApp\": \"manual\"\n       },\n+      \"session\": {\n+        \"autoStart\": true,\n+        \"debugSynchronization\": 0,\n+        \"server\": \"ws://localhost:8099\",\n+        \"sessionId\": \"test\"\n+      },\n+      \"testRunner\": {\n+        \"args\": {\n+          \"testTimeout\": 999999\n+        }\n+      }\n+      \"artifacts\": false\n     },\n   }\n }\n```\n\n- Using a preconfigured `session` with an auto-starting server removes the legwork of copying and\npasting values to the instrumentation runner launch arguments dialog every time before any launch\nfrom the IDE. Otherwise, by default when the `session` object omitted, `server` and `sessionId`\nare randomly generated for every new test session.\n\n- The `debugSynchronization: 0` override matters only if you have a global `session` config\nwith `debugSynchronization` set to a positive integer value. Otherwise, it is not needed. The point\nis to disable regular app polling requests during debugging, since that only can hinder the debugging.\n\n- If you are using Jest as a test runner, you might want to prolong the test timeout via forwarding\n`--testTimeout 999999` to it.\n\n- Setting `artifacts: false` override also matters only if you have a global `artifacts` config.\nThe motivation is to disable irrelevant taxing activities on the device such as capturing logs\nscreenshots, videos and so on. If your investigation addresses a specific artifact plugin glitch\non the native side, then just disable all the non-relevant plugins. See\n[Configuration > Artifacts](../config/artifacts.mdx) document for the reference.\n\n### Run a specific test\n\nUsually, you would want to focus on a specific test suite to save time, e.g.:\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <CodeBlock language=\"sh\">\n      detox test -c ios.manual e2e/someSuite.test.js\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <CodeBlock language=\"sh\">\n      detox test -c android.manual e2e/someSuite.test.js\n    </CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::caution\n\nDon't use multiple workers, e.g. `-w, --maxWorkers` for Jest, if you set `session.sessionId` to a constant value.\n\n:::\n\nAfterwards, you should see your test suite starting as usual until it reaches the app launch, where\nDetox stops instead and prompts you to launch the app from the IDE:\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <RunIos />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <RunAndroid />\n  </TabItem>\n</Tabs>\n\n### Troubleshooting\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <>There are no known issues at the moment. Check out <b>Android</b> tab if you need some.</>\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <TroubleshootingAndroid />\n  </TabItem>\n</Tabs>\n"
  },
  {
    "path": "docs/introduction/environment-setup.md",
    "content": "# Environment Setup\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport IntroRN from './partials/_getting-started-rn.md';\nimport IntroExpo from './partials/_getting-started-expo.md';\nimport IntroOther from './partials/_getting-started-other.mdx';\n\nThe _Introduction section_ walks you through setting up Detox in your project, one step at a time.\n\nYou will find that some steps are longer than the others: some are a couple of paragraphs, while the others look like a dedicated multistep guide.\nBear with us - it is all necessary, and once set up, it is easy to move forward with writing tests at a high pace.\n\nPlease select type of your mobile application before you start the tutorial:\n\n<Tabs groupId=\"appType\">\n    <TabItem value=\"start-rn\" label=\"React Native\" default>\n        <IntroRN />\n    </TabItem>\n    <TabItem value=\"start-expo\" label=\"Expo\">\n        <IntroExpo />\n    </TabItem>\n    <TabItem value=\"start-other\" label=\"Other\">\n        <IntroOther />\n    </TabItem>\n</Tabs>\n\n## React Native CLI Quickstart\n\nYour first step would be to complete the\n[📚 React Native CLI Quickstart Guide](https://reactnative.dev/docs/next/environment-setup) for iOS/Android/both (depending\non your use case).\n\n:::info Note\n\nMind that for Android, we have an equivalent [environment setup guide](../guide/android-dev-env.md), which is a bit different,\nbut more comprehensive. Use your judgement and take what's most suitable for your environment from both guides. For\nexample, there is more than one way to install the right Java Development Kit.\n\n:::\n\n![RN Env](../img/rn-env.png)\n\n<p>\n    Open the link above and switch there to <b>React Native CLI Quickstart</b> tab to see\n    the interactive tutorial for <b>Development OS</b> and <b>Target OS</b> of your choice.\n</p>\n\n<p>\n    Follow all\n    the steps <span style={{color: 'red'}}>(yes, even if you have a native app!)</span> and\n    make sure you can create and run React Native apps on virtual testing devices.\n</p>\n\n![RN Env Done](../img/rn-env-done.png)\n\n## Detox Prerequisites\n\nTo complete the environment setup, you still have 2 steps ahead: installing `detox-cli` and `applesimutils`.\n\n### 1. Command Line Tools (`detox-cli`)\n\n`detox-cli` is merely a script that passes commands through to\na local Detox executable located at `node_modules/.bin/detox`,\nmaking it easier to operate Detox from the command line, e.g. `detox test -c ios.sim.debug`.\n\nIt should be installed globally, enabling usage of the command line tools outside your npm scripts:\n\n```bash\nnpm install detox-cli --global\n```\n\nOn the other hand, if you are fine with running Detox commands with `npx detox ...`, you may skip installing `detox-cli`.\n\n### 2. [MacOS Only] `applesimutils`\n\nThis tool is **required** by Detox to work with iOS simulators. The recommended way to install\n[`applesimutils`](https://github.com/wix/AppleSimulatorUtils) is via [Homebrew](https://brew.sh):\n\n```bash\nbrew tap wix/brew\nbrew install applesimutils\n```\n\n:::info Note\n\nMake sure to periodically update your version of `applesimutils` to the latest version.\n\n:::\n\nNow, when your environment is ready, let's move to the next section, [Project Setup](project-setup.mdx).\n"
  },
  {
    "path": "docs/introduction/getting-started.mdx",
    "content": "# Getting Started\n\n## Before You Start\n\n### Overview of Detox\n\nDetox is an open-source end-to-end (E2E) testing framework for React Native mobile applications.\nOur main goal is to enable the testing of any end-to-end flow in the app, with maximum velocity and zero flakiness.\nDetox tests your mobile app while it's running on a real device or simulator, simulating a real user's interactions.\n\n![Detox overview](../img/Detox.gif)\n\n### What Does a Detox Test Look Like?\n\nThis is a test for a login screen, it runs on a device or simulator like an actual user:\n\n```js\ndescribe('Login flow', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should login successfully', async () => {\n    await element(by.id('email')).typeText('john@example.com');\n    await element(by.id('password')).typeText('123456');\n\n    const loginButton = element(by.text('Login'));\n    await loginButton.tap();\n\n    await expect(loginButton).not.toExist();\n    await expect(element(by.label('Welcome'))).toBeVisible();\n  });\n});\n```\n\n### Gray box testing\n\nOne of the most challenging aspects of automated testing on mobile is end-to-end testing.\nUI testing frameworks are often not fully-deterministic, since they are built with a \"black box\" approach, where the test runner has no access to the internals of the app under test, and is unaware of asynchronous operations that take place in the app (such as network requests, animations, etc.).\nThis makes it difficult to write reliable E2E tests, and often leads to flaky tests that are hard to debug and maintain.\n\nTo address this issue, Detox adopts a \"gray box\" testing approach, by having access to the internals of the app under test.\nThis allows for more control and predictability in the testing process. For more information, you can read [how Detox works].\n\n## Start with Detox\n\n### Follow the Setup Guides\n\nThe following guides in this Introduction section will help you get started with Detox, one step at a time, from setting up your environment to writing and running your first test.\n\n### Join the Community 🤝\n\nAs an open-source project, Detox encourages and welcomes contributions from the community.\nWhether you're a developer, tester, or just someone who is passionate about making mobile development better, there's a place for you in the Detox community.\nBy contributing to Detox, you'll be helping to improve the reliability and user experience of mobile apps, and you'll be part of a team that is dedicated to making mobile development faster and more efficient.\nWe welcome all types of contributions, from code and documentation, to bug reports, questions and feature requests.\n\nSo, if you're interested to be part of the community, we encourage you to get involved by reading our [contributing guidelines], and join our [Discord server].\nWe also have a [Twitter account] where we share updates about the project.\n\n\n[how Detox works]: ../articles/how-detox-works.md\n[contributing guidelines]: contributing.md\n[Discord server]: https://discord.gg/CkD5QKheF5\n[Twitter account]: https://twitter.com/detoxe2e\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-attach-chrome.mdx",
    "content": "Edit your test file. Mark the test you wish to debug as `it.only`, and then add a `debugger` statement\ninside your test to mark a starting point, e.g.:\n\n```diff title=\"e2e/starter.test.js\"\n describe('Example', () => {\n   beforeAll(async () => {\n     await device.launchApp();\n   });\n   \n-   it('should debug nicely :-)', async () => {\n+   it.only('should debug nicely :-)', async () => {\n     await element(by.text('Filter')).tap();\n+     debugger;\n\n   });\n```\n\nOpen `Google Chrome` and go to `chrome://inspect` tab, where you'll see `./node_modules/.bin/jest` as a remote\ntarget waiting until you click `inspect` to attach to it.\n\n![](../../img/inspect-brk.png)\n\nHappy debugging!"
  },
  {
    "path": "docs/introduction/partials/_debugging-attach-vscode.mdx",
    "content": "Coming soon!"
  },
  {
    "path": "docs/introduction/partials/_debugging-attach-webstorm.mdx",
    "content": "Open your app project (where there tests are, among other things) on Webstorm.\n\n#### Set up a breakpoint\n\nOpen the file where the test you wish to run is. Mark it as `it.only`, and set up a breakpoint in a line that suites your needs (note: This can actually be inside a helper function or a test-driver's function):\n\n![Webstorm breakpoint](../../img/webstorm/breakpoint.png)\n\n#### Create & Run a debug configuration\n\nGo to Webstorm's [`Edit Configurations`](https://www.jetbrains.com/help/webstorm/run-debug-configuration.html).\n\nTap the `+` button and select the Node.js option:\n\n![Webstorm edit configurations](../../img/webstorm/new-configuration.png)\n\nCreate a new debugging configuration using the default arguments (port 9229, etc.):\n\n![Webstorm node debugging configuration](../../img/webstorm/node-debug-configuration.png)\n\nAttach to Detox by \"debugging\" the new configuration (start it using the beetle button).\n\n![Webstorm start debug configuration](../../img/webstorm/run-debug-configuration.png)\n\nLet Detox run until stopped at the break-point:\n\n![Webstorm stopped at breakpoint](../../img/webstorm/stopped-at-breakpoint.png)\n\nRun step-by-step using Webstorm's debugging actions (step-over, step-into, etc.)\n\nHappy debugging!\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-compliing-android.mdx",
    "content": "1. Add in your Android project settings:\n\n    ```diff title=\"android/settings.gradle\"\n    +include ':detox'\n    +project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')\n    ```\n\n1. In your _root_ build script register `google()` as a repository lookup point in all projects:\n\n    ```diff title=\"android/build.gradle\"\n     allprojects {\n         repositories {\n             // ...\n    +        google()\n         }\n     }\n    ```\n\n    If `allprojects` section doesn't exist, then add it.\n\n1. In your app’s build script, add to `dependencies` section:\n\n    ```diff title=\"android/app/build.gradle\"\n     dependencies {\n         // ...\n    -    androidTestImplementation('com.wix:detox:+')\n    +    androidTestImplementation(project(path: \":detox\"))\n     }\n    ```\n\n1. Stay in that file, just scroll down and add to the `defaultConfig` subsection:\n\n    ```diff title=\"android/app/build.gradle\"\n     android {\n       // ...\n\n       defaultConfig {\n           // ...\n    +      testBuildType System.getProperty('testBuildType', 'debug')  // This will later be used to control the test apk build type\n    +      testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n    +      missingDimensionStrategy 'detox', 'full'\n       }\n     }\n    ```\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-compliing-ios.mdx",
    "content": "1. Go to `node_modules/detox` and extract `Detox-ios-src.tbz`\n\n    ![extracted detox-ios-src directory](../../img/xcode/extracted-ios-src.png)\n\n1. Drag `Detox-ios-src/Detox.xcodeproj` into your Xcode project\n\n    ![Detox inside Xcode project](../../img/xcode/drag-src-to-project.png)\n\n1. Go to your project settings → **General** and add **Detox.framework** to **Frameworks, Libraries, and Embedded Content** (make sure **Embed & Sign** is selected under **Embed**)\n\n    ![embed Detox](../../img/xcode/embed-detox-project.png)\n\n:::caution\n\nApps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove **Detox.framework** from your project.\n\n:::\n\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-config-android.mdx",
    "content": "```json\n{\n  \"devices\": {\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"<e.g., Pixel_API_28>\"\n      }\n    }\n  },\n  \"apps\": {\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"<path to your app binary built before>\"\n    }\n  },\n  \"configurations\": {\n// highlight-start\n    \"android.manual\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.debug\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      }\n    }\n// highlight-end\n  }\n}\n```\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-config-ios.mdx",
    "content": "```json\n{\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        \"type\": \"<e.g., iPhone 12 Pro>\"\n      }\n    }\n  },\n  \"apps\": {\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"<path to your app binary built before>\"\n    }\n  },\n  \"configurations\": {\n// highlight-start\n    \"ios.manual\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.debug\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      }\n    }\n// highlight-end\n  }\n}\n```\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-run-android.mdx",
    "content": "```plain text\n18:26:07.024 detox[45214] i Waiting for you to manually launch your app in Android Studio.\n\nInstrumentation class: com.wix.detox.test.test/com.example.DetoxTestAppJUnitRunner\nInstrumentation arguments:\n------------------------------------\nKey            | Value\n------------------------------------\ndetoxServer    | ws://localhost:8099\ndetoxSessionId | test\n------------------------------------\n\nPress any key to continue...\n```\n\nNow it is time to switch back to Android Studio. You’ll need to run your instrumentation runner with the said arguments,\nthis is why you should create a debug configuration of `Android Instrumented Tests` type similar to the one below:\n\n![Android Debug Configuration - Android Instrumented Tests](../../img/android-studio-debug-configuration.png)\n\nMake sure to put breakpoints at the points of interest before you start the app.\n\nAfter the app is launched, go back to the Terminal where Detox is running and press any key.\nAs a result, you are expected to see a confirmation from Detox, e.g.:\n\n```plain text\nFound the app (com.wix.detox-example) with process ID = 16854. Proceeding...\n```\n\nNow the entire test will run as usual until it sends an action to the app, which gets trapped\nin your breakpoint.\n\n![Breakpoint is active](../../img/android-happy-debugging.png)\n\nHappy debugging!\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-run-ios.mdx",
    "content": "```plain text\n18:26:07.024 detox[45214] i Waiting for you to manually launch your app in Xcode.\nMake sure to pass the launch arguments listed below:\n  -detoxServer ws://localhost:8099\n  -detoxSessionId com.wix.detox-example\n\nPress any key to continue...\n```\n\nYou’ll need to run your app with the said arguments from Xcode:\n\n![Xcode - Edit Schema - Arguments tab](../../img/xcode/edit-schema-arguments.png)\n\nBefore you launch the app, make sure to [put breakpoints](https://developer.apple.com/documentation/xcode/setting-breakpoints-to-pause-your-running-app) at the points of interest, e.g.:\n\n![put a breakpoint in the native code](../../img/xcode/putting-a-breakpoint.png)\n\nLaunch the app with the debugger attached:\n\n![launching the app](../../img/xcode/launch-app-with-debugger.png)\n\nThe moment you see the app is idle, go back to the Terminal where Detox is running\nand press any key. If you wish to terminate the process for some reason, use Ctrl+C.\nIn a couple of seconds you are expected to see a confirmation from Detox, e.g.:\n\n```plain text\nFound the app (com.wix.detox-example) with process ID = 16854. Proceeding...\n```\n\nNow the entire test will run as usual until it sends an action to the app, which gets trapped\nin your breakpoint.\n\nHappy debugging!\n\n"
  },
  {
    "path": "docs/introduction/partials/_debugging-native-code-troubleshooting-android.mdx",
    "content": "Here are some known issues you can solve on your own:\n\n1. **DetoxWSClient: Retrying... At connectToServer**\n\n    ```plain text\n    I/DetoxWSClient: At connectToServer\n    D/DetoxWSClient: Retrying...\n    ```\n\n    If you see the repeatedly printed messages like above in Android application logs, it's likely\n    that your port is not reversed. Assuming you're following the tutorial and `detoxServer` address\n    is `ws://localhost:8099` (if not – check what Detox prints you), reverse the port on your device\n    using ADB:\n\n    ```bash\n    adb reverse tcp:8099 tcp:8099\n    ```\n\n1. **Waited for the new RN-context for too long!**\n\n    ```plain text\n    Waited for the new RN-context for too long! (60 seconds)\n    If you think that’s not long enough, consider applying a custom Detox runtime-config in DetoxTest.runTests().\n    ```\n\n    If you see an error like above, you can patch Detox code to disable the timeout here:\n\n    ```diff title=\"detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt\"\n     package com.wix.detox.config\n\n     class DetoxConfig {\n         @JvmField var idlePolicyConfig: DetoxIdlePolicyConfig = DetoxIdlePolicyConfig()\n    -    @JvmField var rnContextLoadTimeoutSec = 60\n    +    @JvmField var rnContextLoadTimeoutSec = Int.MAX_VALUE\n\n         fun apply() {\n             idlePolicyConfig.apply()\n    ```\n"
  },
  {
    "path": "docs/introduction/partials/_getting-started-expo.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n:::caution Note\n\nExpo integration with Detox is entirely a community-driven effort.\nThere is no special support for Expo projects in Detox, and we do not maintain any Expo-specific code or documentation.\n\n:::\n\nThere is a tutorial on how to set up Detox with Expo projects, which you can find on Expo official documentation site: [Running E2E tests on EAS Build]. It is a great starting point for projects that are using Expo.\n\nFor support on how to use Detox with Expo, you should contact the Expo team or the Expo community.\n\nIf you are experiencing a bug, which you believe is a Detox issue, please [open an issue] on our GitHub repository.\n\n[open an issue]: https://github.com/wix/Detox/issues\n\n[Running E2E tests on EAS Build]: https://docs.expo.dev/build-reference/e2e-tests/\n"
  },
  {
    "path": "docs/introduction/partials/_getting-started-other.mdx",
    "content": ":::caution Note\n\nAt the moment, Detox does not support non-React Native apps on **Android** due to the blocking issues:\n\n* [Restore support for pure-native/hybrid Projects](https://github.com/wix/Detox/issues/2543)\n* [cannot be cast to com.facebook.react.ReactApplication](https://github.com/wix/Detox/issues/1220)\n* [native android app Process crashes](https://github.com/wix/Detox/issues/1093)\n\n:::\n\nHowever, native iOS apps are expected to work fine with Detox, and if that's your case, this introduction will help you in equal measure.\n\n"
  },
  {
    "path": "docs/introduction/partials/_getting-started-rn.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\nDetox was built from the ground up to support \"classic\" React Native projects.\n\n:::info Note\n\nWhile Detox should work out of the box with any React Native version of the latest minor releases,\nthe _official_ versions compatibility is provided according to the following:\n\n- **RN `v0.77.x` - `v0.82.x`:** Fully compatible with React Native's [\"New Architecture\"](https://reactnative.dev/docs/the-new-architecture/landing-page).\n  Newer RN versions might work with Detox, but they've not been thoroughly tested by the Detox team yet.\n\nAlthough we do not officially support older React Native versions, we do our best to keep Detox compatible with them.\n\nAlso, in case of a problem with an unsupported version of React Native, please [submit an issue](https://github.com/wix/Detox/issues/new/choose) or write us in our [Discord server](https://discord.gg/CkD5QKheF5) and we will do our best to help out.\n\n:::\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-apps-android.mdx",
    "content": "<!-- markdownlint-configure-file { \"no-trailing-punctuation\": 0 } -->\n\nimport FlavorizedCodeBlock from '@site/src/components/FlavorizedCodeBlock';\n\nCheck the **build** and **binaryPath** attributes for the `android.debug` and `android.release` Detox configs:\n\n```js title=\".detoxrc.js\"\nmodule.exports = {\n  apps: {\n    'android.debug': {\n      type: 'android.apk',\n      // highlight-start\n      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk'\n      // highlight-end\n    },\n    'android.release': {\n      type: 'android.apk',\n      // highlight-start\n      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',\n      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk'\n      // highlight-end\n    },\n    // ...\n  },\n  // ...\n};\n```\n\nIf you have a typical React Native project, these values should already be sufficient and correct.\n\n#### testBinaryPath\n\nIn Android automation testing, there are in fact 2 app binaries involved:\n1. The _app_ APK, containing your app's code.\n2. The _test_ APK, containing _test_ code. That includes Detox's native code, Espresso and more.\n\nIn some projects, it might make sense for the test APK to be generated over a separate flow, through which is may end up\nbeing put it some custom,\n[non-default path](https://stackoverflow.com/questions/43670463/where-is-the-test-apk-located-in-android-project).\nOne such example is an optimization where the test APK is prebuilt once and used across multiple app variations. This is\na place where the `testBinaryPath` attribute can come to the rescue; It can be applied in order to set the custom path\nto the test APK explicitly:\n\n```js title=\".detoxrc.js\"\nmodule.exports = {\n  apps: {\n    'android.debug': {\n      type: 'android.apk',\n      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',\n      // highlight-start\n      testBinaryPath: 'custom/path/to/app-debug-androidTest.apk'\n      // highlight-end\n    },\n    'android.release': {\n      type: 'android.apk',\n      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',\n      // highlight-start\n      testBinaryPath: 'custom/path/to/app-release-androidTest.apk'\n      // highlight-end\n    },\n    // ...\n  },\n  // ...\n};\n```\n\n:::info Note\n\nIn the common case, the `testBinaryPath` attributes is not explicitly required, simply because Detox knows\nhow to locate it in one of the default paths automatically.\n\n:::\n\n#### Product flavors\n\nOn even more advanced use cases, apps may have additional, custom [`productFlavors`](https://developer.android.com/studio/build/build-variants#product-flavors)\n(for example, `driver` and `passenger` flavors of a taxi application). In this case, you should rewrite your apps config,\nfor both **debug** and **release** configurations, according to those flavors, e.g.:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  header={'   apps: {\\n'}\n  flavors={['Driver', 'Passenger']}\n>\n  {(flavor) => `\\\n     '${flavor.toLowerCase()}.android.debug': {\n       type: 'android.apk',\n-      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',\n+      binaryPath: 'android/app/build/outputs/apk/${flavor.toLowerCase()}/debug/app-${flavor.toLowerCase()}-debug.apk',\n-      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n+      build: 'cd android && ./gradlew assemble${flavor}Debug assemble${flavor}DebugAndroidTest -DtestBuildType=debug',\n     },`}\n</FlavorizedCodeBlock>\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-apps-ios.mdx",
    "content": "<!-- markdownlint-configure-file { \"no-trailing-punctuation\": 0 } -->\n\nimport FlavorizedCodeBlock from '@site/src/components/FlavorizedCodeBlock';\n\nOpen your Detox config and replace `YOUR_APP` placeholder with the actual app name, e.g.:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  title={'.detoxrc.js'}\n  header={'   apps: {\\n'}\n  flavors={['Debug', 'Release']}\n>\n  {(conf) => `\\\n     'ios.${conf.toLowerCase()}': {\n       type: 'ios.app',\n-      binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/YOUR_APP.app',\n+      binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/example.app',\n-      build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n+      build: 'xcodebuild -workspace ios/example.xcworkspace -scheme example -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n     },`}\n</FlavorizedCodeBlock>\n\n:::info\n\nIf your app uses [CocoaPods] (all modern React Native projects do since `0.60.0`), make sure\nto run `pod install` in your `ios/` folder before building with Detox.\n\nIf your project doesn't use the pods, then you won't have any `YourApp.xcworkspace` in your iOS project directory.\nYou should search instead for something like `YourApp.xcodeproj` there, and adjust your build command accordingly:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  header={'   apps: {\\n'}\n  flavors={['Debug', 'Release']}\n>\n  {(conf) => `\\\n     'ios.${conf.toLowerCase()}': {\n       type: 'ios.app',\n       binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/example.app',\n-      build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n+      build: 'xcodebuild -project ios/example.xcodeproj -scheme example -sdk -configuration ${conf} iphonesimulator -derivedDataPath ios/build'\n     },`}\n</FlavorizedCodeBlock>\n\n:::\n\n[cocoapods]: https://cocoapods.org/\n\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-bootstrap-other.mdx",
    "content": "Create a `package.json` in your project's root by running this command:\n\n```bash\nnpm init -y\n```\n\nRemember to add the `node_modules` folder to your `.gitignore` file.\nNow you are ready to install the Detox itself. Run:\n\n```bash npm2yarn\nnpm install detox --save-dev\n```\n\nThe next step is to **install a test runner**. Out of the box, Detox offers you a first-class integration\nwith [Jest](https://jestjs.io), a popular and proven choice in the JavaScript community:\n\n```bash npm2yarn\nnpm install jest --save-dev\n```\n\nIf you are not familiar with Jest, we recommend you to read the [Jest: Getting Started](https://jestjs.io/docs/en/getting-started) guide.\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-bootstrap-rn.mdx",
    "content": "Out of the box, Detox offers you a first-class integration with [Jest](https://jestjs.io), the most popular testing framework for React Native. That's why your first step will be to install or update Jest in your project.\n\nGo to your project's root folder, i.e., where `package.json` is found, and run:\n\n```bash npm2yarn\nnpm install \"jest@^29\" --save-dev\n```\n\n:::note Info\n\nThe command above will install the **latest supported Jest version**. The `@^29` override is recommended in the first place to prevent you from getting an outdated Jest version unknowingly, under the influence of package lock files. For example, in React Native boilerplate projects, the `package-lock.json` is apt to restrict `npm install jest` to installing an older, unsupported version `26.x`.\n\n:::\n\nNow it's time to install Detox itself:\n\n```bash npm2yarn\nnpm install detox --save-dev\n```\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-build.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<>\n  {props.debug && <div>\n\nSince this is a debug configuration, you need to have React Native packager running in parallel before you start\nDetox tests:\n\n```bash\nnpm start\n\n> react-native start\n\n#                        #######\n#                   ################\n#                #########     #########\n#            #########             ##########\n#        #########        ######        #########\n#       ##########################################\n#      #####      #####################       #####\n#      #####          ##############          #####\n#      #####    ###       ######       ###    #####\n#      #####    #######            #######    #####\n#      #####    ###########    ###########    #####\n#      #####    ##########################    #####\n#      #####    ##########################    #####\n#      #####      ######################     ######\n#       ######        #############        #######\n#         #########        ####       #########\n#              #########          #########\n#                  ######### #########\n#                       #########\n#\n#\n#                    Welcome to Metro!\n#              Fast - Scalable - Integrated\n```\n\n  </div>}\n</>\n\nNow you can run your first test:\n\n<CodeBlock language=\"sh\">\n  detox test --configuration {props.configurationName}\n</CodeBlock>\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-devices-android.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nTo check if a specific Android virtual device (e.g. `Pixel_3a_API_30_x86`) is installed locally, run:\n\n```bash\nemulator -list-avds\n```\n\nYou should see an output like:\n\n```plain text\n// highlight-next-line\nPixel_3a_API_30_x86\nPixel_API_30\n```\n\n:::tip\n\nIf you see `zsh: command not found` (or a similar message), please go back to\n[Setting up the environment](../getting-started.mdx#setting-up-the-environment) section\nwhere we were redirecting you to the official **React Native CLI Quickstart**, and make sure you\nhave completed it.\n\nProvided you have `ANDROID_SDK_ROOT` (or `ANDROID_HOME`) environment variables\ndefined, using an explicit path to `emulator` should help:\n\n<Tabs groupId=\"desktopOS\">\n    <TabItem value=\"darwin\" label=\"MacOS\">\n        <CodeBlock language=\"bash\">\n            $ANDROID_SDK_ROOT/emulator/emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n    <TabItem value=\"linux\" label=\"Linux\">\n        <CodeBlock language=\"bash\">\n            $ANDROID_SDK_ROOT/emulator/emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n    <TabItem value=\"win32\" label=\"Windows\">\n        <CodeBlock language=\"plain text\">\n            %ANDROID_HOME%\\emulator\\emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n</Tabs>\n\n:::\n\nIf you don't see that AVD name, you might use another one from the list – just replace it in Detox config, e.g.:\n\n```diff\n   emulator: {\n     type: 'android.emulator',\n     device: {\n-      avdName: 'Pixel_3a_API_30_x86',\n+      avdName: 'Pixel_API_30',\n     },\n   },\n```\n\nIf the output is completely blank, then you need to open Android Studio and [create a new virtual device (AVD)](https://developer.android.com/studio/run/managing-avds#createavd)\nfirst. Experienced users might do that via [`avdmanager`](https://developer.android.com/studio/command-line/avdmanager), if Android Studio is not installed (e.g. on CI).\n\n:::info\n\nIf you wish to use an attached Android device (via USB or wireless network), make sure it is available:\n\n```bash\nadb devices\n```\n\nIf the device is properly connected, you should get an output like this:\n\n```plain text\nList of devices attached\n2F6315NVPH      device\n```\n\nAssuming the device is available (troubleshooting _adb_ issues is out of scope of this tutorial), you just\nneed to use `android.att.*` Detox configurations instead of `android.emu.*` where required.\n\n:warning: If you have multiple devices connected, replace that loose regular expression (`adbName: '.*'`)\nin your Detox config with a specific device name.\n\n:::\n"
  },
  {
    "path": "docs/introduction/partials/_project-setup-devices-ios.mdx",
    "content": "To check if a specific device type (e.g. `iPhone 15`) is installed locally, run:\n\n```bash\nxcrun simctl list devicetypes\n```\n\nIf it is available, you'll see it among the other device types in the output:\n\n```plain text\n== Device Types ==\niPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)\niPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)\n…\niPhone SE (2nd generation) (com.apple.CoreSimulator.SimDeviceType.iPhone-SE--2nd-generation-)\niPhone 12 mini (com.apple.CoreSimulator.SimDeviceType.iPhone-12-mini)\n// highlight-next-line\niPhone 15 (com.apple.CoreSimulator.SimDeviceType.iPhone-15)\niPhone 15 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro)\n…\n```\n\nIf there is no such device type, you can replace it with another from the list:\n\n```diff\n   simulator: {\n     type: 'ios.simulator',\n     device: {\n-      type: 'iPhone 12',\n+      type: 'iPhone 13 Pro',\n     },\n   },\n```\n\n:::tip\n\nIf the device type list is empty or you need a specific iOS version,\ngo to `Xcode > Preferences > Components` and install a proper Simulator version from the list:\n\n![](../../img/xcode/install-simulator-runtime.png)\n\n:::\n"
  },
  {
    "path": "docs/introduction/preparing-for-ci.md",
    "content": "# Preparing for CI\n\n:::danger Disclaimer\n\nThis guide is outdated.\n\n:::\n\nWhen your test suite is finally ready, it should be set up to run automatically on your CI server on every git push. This will alert you if new changes to the app break existing functionality.\n\nRunning Detox on CI is not that different from running it locally. There are two main differences:\n\n- You should test a release build rather than a debug build\n- Tell Detox to shut down the simulator when test is over\n\n## Step 1: Prepare a Release Configuration for Your App\n\nWe will need to create a release app configuration for Detox – follow [the previous tutorial](project-setup.mdx)\nif you haven’t completed it already.\n\n## Step 2: Add `build` and `test` Commands to Your CI Script\n\nAssuming your CI is executing some sort of shell script, add the following commands that should run inside the project root:\n\n```bash\ndetox build --configuration ios.sim.release\ndetox test --configuration ios.sim.release\n```\n\n:::tip\n\nMake sure to shut down the simulator when your tests are over.\n\n:::\n\n## Running Android Tests on CI\n\nSetting up a CI environment capable of running Android tests isn’t as trivial.\n\nFortunately, we’ve written all about it in a [blogpost on medium!](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f)\n\nAlso, check out the guide on how to [prepare Android emulators for CI](../guide/android-dev-env.md).\n\n## Appendix\n\n### • Running Detox on [Travis CI](https://travis-ci.org/)\n\nDetox’s own build is running on Travis, check out Detox’s [`.travis.yml`](https://github.com/wix/Detox/tree/master/.travis.yml) file to see how it’s done.\n\nThis is a simple example configuration to get you started with Detox on Travis:\n\n```yaml\nlanguage: objective-c\nosx_image: xcode8.3\n\nbranches:\n  only:\n  - master\n\nenv:\n  global:\n  - NODE_VERSION=stable\n\ninstall:\n- brew tap wix/brew\n- brew install applesimutils\n- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash\n- export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"\n- nvm install $NODE_VERSION\n- nvm use $NODE_VERSION\n- nvm alias default $NODE_VERSION\n\n- npm install react-native-cli --global\n- npm install detox-cli --global\n\nscript:\n- detox build --configuration ios.sim.release\n- detox test --configuration ios.sim.release --cleanup\n\n```\n\n### • Running Detox on [Bitrise](https://www.bitrise.io/)\n\nBitrise is a popular CI service for automating React Native apps. If you are looking to get started with Bitrise, check out [this](https://blog.bitrise.io/post/how-to-set-up-a-react-native-app-on-bitrise) guide.\n\nYou can run Detox on Bitrise by creating a new workflow. Below is an example of the Bitrise `.yml` file for a workflow called `tests`.\n\nAdditionally, you can use a [webhook](https://devcenter.bitrise.io/en/apps/webhooks/adding-incoming-webhooks.html) on Bitrise to post the build status directly into your Slack channel.\n\n```yaml\n---\nformat_version: 1.1.0\ndefault_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git\ntrigger_map:\n- push_branch: \"*\"\n  workflow: tests\nworkflows:\n  _tests_setup:\n    steps:\n    - activate-ssh-key: {}\n    - git-clone:\n        inputs:\n        - clone_depth: ''\n        title: Git Clone Repo\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            npm cache verify\n\n            npm install\n        title: Install NPM Packages\n    before_run:\n    after_run:\n  _detox_tests:\n    before_run: []\n    after_run: []\n    steps:\n    - npm:\n        inputs:\n        - command: install -g detox-cli\n        title: Install Detox CLI\n    - npm:\n        inputs:\n        - command: install -g react-native-cli\n        title: Install React Native CLI\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            brew tap wix/brew\n            brew install applesimutils\n        title: Install Detox Utils\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox build --configuration ios.sim.release\n        title: Detox - Build Release App\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox test --configuration ios.sim.release --cleanup\n        title: Detox - Run E2E Tests\n  tests:\n    before_run:\n    - _tests_setup\n    - _detox_tests\n    after_run: []\n```\n\n### • Running Detox on [GitLab CI](https://docs.gitlab.com/ee/ci/README.html) - Android Only\n\nGitLab is also a popular git management service which also include a built-in CI system. They provide free runner up to 2000 minutes for private projects, however, the runners provided by them cannot be used to run Detox due to the lack of KVM support (in order to run Android Emulators). You can, instead, [create your own runner](https://docs.gitlab.com/ee/ci/runners/README.html) with KVM support. Some example of cloud providers offering this are: [Digital Ocean](https://www.digitalocean.com/products/droplets/), AWS (with [C5 instance types](https://aws.amazon.com/ec2/instance-types/c5/)), [Google Cloud](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances) and [Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/nested-virtualization)\n\nOne example of such job can be:\n\n```yaml\ndetox_e2e:\n  stage: test\n  image: reactnativecommunity/react-native-android\n  variables:\n  before_script:\n    - npm install envinfo detox-cli --global && envinfo\n    # Increase file watcher limit, see more here: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details\n    - echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p\n    - mkdir -p /root/.android && touch /root/.android/repositories.cfg\n    # The Dockerimage provides two paths for sdkmanager and avdmanager, which the defaults are from $ANDROID_HOME/cmdline-tools\n    # That is not compatible with the one that Detox is using ($ANDROID_HOME/tools/bin)\n    - echo yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --channel=0 --verbose \"system-images;android-27;default;x86_64\" \"emulator\"\n    # Nexus 6P, API 27, XXXHDPI\n    - echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager --verbose create avd --force --name \"Nexus6P\" --package \"system-images;android-27;default;x86_64\" --sdcard 200M --device 11\n    - adb start-server\n  script:\n    - npx detox build -c android.emu.release.ci\n    - npx detox test -c android.emu.release.ci --headless\n```\n"
  },
  {
    "path": "docs/introduction/project-setup.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport PrepareBootstrapRN from './partials/_project-setup-bootstrap-rn.mdx';\nimport PrepareBootstrapOther from './partials/_project-setup-bootstrap-other.mdx';\nimport PrepareAppConfigsIos from './partials/_project-setup-apps-ios.mdx';\nimport PrepareAppConfigsAndroid from './partials/_project-setup-apps-android.mdx';\nimport PrepareDeviceConfigsIos from './partials/_project-setup-devices-ios.mdx';\nimport PrepareDeviceConfigsAndroid from './partials/_project-setup-devices-android.mdx';\n\n# Project Setup\n\n:::info\n\nThis article mainly covers standard React Native projects.\nIf some steps don't look applicable to your project, please adapt them accordingly, relying on the common sense –\nlook for other file locations, use custom build commands and so on.\n\nIf you're using **Expo**, please refer to the [setup guide] from their documentation website instead.\nThe setup for Expo projects is different and is not covered in this article.\n\n:::\n\n## Step 1: Bootstrap\n\n<Tabs groupId=\"appType\">\n  <TabItem value=\"start-rn\" label=\"React Native\" default>\n    <PrepareBootstrapRN />\n  </TabItem>\n  <TabItem value=\"start-other\" label=\"Native iOS\">\n    <PrepareBootstrapOther />\n  </TabItem>\n</Tabs>\n\nNow, when all the dependencies are installed, initialize Detox in your project:\n\n```bash\ndetox init\n```\n\nNormally you should see an output like:\n\n```plain text\nCreated a file at path: .detoxrc.js\nCreated a file at path: e2e/jest.config.js\nCreated a file at path: e2e/starter.test.js\n```\n\n:::tip\nIf you see a message like `command not found: detox`, make sure you have [installed Detox command line tools](#1-command-line-tools-detox-cli).\n:::\nAfter Detox generated these files in your project's root, you still have some work to do with them:\n\n* `.detoxrc.js` – Detox config file;\n* `e2e/jest.config.js` – Jest configuration;\n* `e2e/starter.test.js` – dummy first test.\n\n## Step 2: App configs\n\nIn this step you need to provide Detox with the right **commands to build** your app for iOS and Android,\nand also the right **paths to the app binaries** so that Detox can install your app on the device before\nactually starting the tests.\n\n<Tabs groupId=\"mobileOs\">\n    <TabItem value=\"iOS\" label=\"iOS\" default>\n        <PrepareAppConfigsIos />\n    </TabItem>\n    <TabItem value=\"Android\" label=\"Android\">\n        <PrepareAppConfigsAndroid />\n    </TabItem>\n</Tabs>\n\n## Step 3: Device configs\n\nBy default, Detox config suggests default device types for iOS and Android:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  // ...\n  devices: {\n    simulator: {\n      type: 'ios.simulator',\n      device: {\n        // highlight-next-line\n        type: 'iPhone 12',\n      },\n    },\n    attached: {\n      type: 'android.attached',\n      device: {\n        // highlight-next-line\n        adbName: '.*', // any attached device\n      },\n    },\n    emulator: {\n      type: 'android.emulator',\n      device: {\n        // highlight-next-line\n        avdName: 'Pixel_3a_API_30_x86',\n      },\n    },\n  },\n};\n```\n\n:::info\n\nIf you plan to use cloud devices instead, check out the [Genymotion SaaS guide](../guide/genymotion-saas.mdx), which will help you to set up remote Android devices.\nThis tutorial, however, focuses on devices running locally.\n\n:::\n\nHere's how you can check they are correct and change them if you need something else:\n\n<Tabs groupId=\"mobileOs\">\n    <TabItem value=\"iOS\" label=\"iOS\">\n        <PrepareDeviceConfigsIos />\n    </TabItem>\n    <TabItem value=\"Android\" label=\"Android\" default>\n        <PrepareDeviceConfigsAndroid />\n    </TabItem>\n</Tabs>\n\n## Step 4: Additional Android configuration\n\n:::tip\n\nIf you want to try out your tests right away on iOS,\nyou can skip to [Step 5: Build the app](#step-5-build-the-app)\nand revisit it when you're ready to move forward with Android.\n\n:::\n\nAssuming you have a regular React Native project, these are the files you normally would need to\npatch or create if they are missing:\n\n* **Build scripts:**\n    * `android/build.gradle`\n    * `android/app/build.gradle`\n* **Native test code:**\n    * `android/app/src/androidTest/java/com/<your.package>/DetoxTest.java`\n* **Manifests:**\n    * `android/app/src/main/AndroidManifest.xml`\n    * `android/app/src/main/res/xml/network_security_config.xml`\n\n### 4.1. Patching build scripts\n\nOpen your main build script and apply the suggested changes:\n\n:::note\nNew Android projects won't have an `allprojects {}` section, so you will need to add it yourself.\n:::\n\n```diff title=\"android/build.gradle\"\n buildscript {\n   ext {\n     buildToolsVersion = \"31.0.0\"\n// highlight-next-line\n     minSdkVersion = 21 // (1)\n     compileSdkVersion = 30\n     targetSdkVersion = 30\n// highlight-next-line\n+    kotlinVersion = 'X.Y.Z' // (2)\n   }\n …\n   dependencies {\n     classpath(\"com.android.tools.build:gradle:7.1.1\")\n     classpath(\"com.facebook.react:react-native-gradle-plugin\")\n     classpath(\"de.undercouch:gradle-download-task:5.0.1\")\n// highlight-next-line\n+    classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\") // (3)\n …\n\n allprojects {\n   repositories {\n     …\n     google()\n// highlight-start\n+    maven { // (4)\n+      url(\"$rootDir/../node_modules/detox/Detox-android\")\n+    }\n// highlight-end\n     maven { url 'https://www.jitpack.io' }\n   }\n }\n```\n\nHere is the explanation of those changes, numbered 1-4:\n\n1. Make sure your `minSdkVersion` is at least 18 or higher.\n1. We recommend you to define a global `kotlinVersion` constant you would use in the next step.\nReplace `X.Y.Z` with the actual version number.\nTo get one, open **Android Studio**, go to `Preferences > Languages & Frameworks > Kotlin` and\nlook at `Current Kotlin plugin version` field. For example, `211-1.5.30-release-408-AS7442.40`\nmeans you have version `1.5.30`.\n    ![](../img/android/get-kotlin-version.png)\n1. The line adds [Kotlin Gradle plugin](https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin)\nto the build script. If your project is not entirely new, there's a chance you might have it already, so make sure\nyou aren't adding it twice. :wink:\n1. Last, we add Detox as a precompiled native dependency, `.aar`. If you need to have Detox as a\n_compiling dependency_ instead, consult the respective section in [Debugging](debugging.mdx#native-application-code) guide.\n\nNow let's move on to the next build script and prepare it:\n\n```diff title=\"android/app/build.gradle\"\n …\n\n android {\n   …\n   defaultConfig {\n     …\n     versionCode 1\n     versionName \"1.0\"\n+    testBuildType System.getProperty('testBuildType', 'debug')\n+    testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n   …\n   buildTypes {\n     release {\n       minifyEnabled true\n       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n+      proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n\n       signingConfig signingConfigs.release\n     }\n   }\n   …\n\n dependencies {\n+  androidTestImplementation('com.wix:detox:+')\n+  implementation 'androidx.appcompat:appcompat:1.1.0'\n   implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n```\n\n:::info ProGuard notice\n\nDetox relies on\n[Android Reflection API](https://developer.android.com/reference/java/lang/reflect/package-summary)\nto integrate with React Native on Android, that's why you have to exempt some of its native code from\n[ProGuard minification](https://developer.android.com/studio/build/shrink-code).\nOtherwise, you'll see Detox crashing or hanging up infinitely upon an attempt to\nrun tests with your app built in **release mode**.\n\n:::\n\n### 4.2. Adding an auxiliary Android test\n\nDetox requires that your project has a single dummy native Android test with some special content,\nwhich will be picked up by `testRunner` that you just added in the previous step, so let's create it now.\n\nCopy the snippet below to create a file under the following path (where `<your.package>` is your actual\npackage name):\n\n```java title=\"android/app/src/androidTest/java/com/<your.package>/DetoxTest.java\" showLineNumbers\n// highlight-next-line\npackage com.<your.package>; // (1)\n\nimport com.wix.detox.Detox;\nimport com.wix.detox.config.DetoxConfig;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.rule.ActivityTestRule;\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class DetoxTest {\n    @Rule // (2)\n// highlight-next-line\n    public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);\n\n    @Test\n    public void runDetoxTests() {\n        DetoxConfig detoxConfig = new DetoxConfig();\n        detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;\n        detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;\n        detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);\n\n        Detox.runTests(mActivityRule, detoxConfig);\n    }\n}\n```\n\nYou can see there are two lines (1 and 18) that require extra care:\n\n1. Replace with your package name. To look it up, you could copy and paste the first line from `android/app/src/main/java/com/<your.package>/MainActivity.java`.\n1. Usually not the case, but you might have a custom activity name instead of a default `MainActivity`. To check whether it is so or not, open your `android/app/src/main/AndroidManifest.xml`,\nand check what your main activity is called:\n\n```plain text\n…\n  <activity\n// highlight-next-line\n    android:name=\".MainActivity\"\n    android:label=\"@string/app_name\"\n    android:launchMode=\"standard\"\n```\n\n### 4.3. Enabling unencrypted traffic for Detox\n\n:::info\n\nFor Detox to work, its native code running on Android device has to be able to connect to the Node.js host running tests.\nIt sends an unencrypted HTTP traffic via virtual `localhost` interface, that's why you need to create a new file which\nadds a couple of exceptions to the security rules.\n\nIf properly configured, this approach in no way compromises the security settings of your app.\nFor more details, refer to [Android’s security-config guide](https://developer.android.com/training/articles/security-config)\nand the [dedicated article](https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html)\nin the Android developers blog.\n\n:::\n\nCreate a new network security config file for Android (or patch it if you have one):\n\n```xml title=\"android/app/src/main/res/xml/network_security_config.xml\"\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n    <domain-config cleartextTrafficPermitted=\"true\">\n        <domain includeSubdomains=\"true\">10.0.2.2</domain>\n        <domain includeSubdomains=\"true\">localhost</domain>\n    </domain-config>\n</network-security-config>\n```\n\nIf you had no network security config before, it means you also have to register it after creation:\n\n```diff title=\"android/app/src/main/AndroidManifest.xml\"\n <manifest>\n   <application\n   …\n+    android:networkSecurityConfig=\"@xml/network_security_config\">\n   </application>\n </manifest>\n```\n\n:trophy: Pat yourself on the back! The hardest part is over, now your Android app is ready to be used with Detox.\n\n## Step 5: Build the app\n\n<Tabs groupId=\"configurationName\">\n  <TabItem value=\"ios.sim.debug\" label=\"iOS (Debug)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration ios.sim.debug\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"ios.sim.release\" label=\"iOS (Release)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration ios.sim.release\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"android.emu.debug\" label=\"Android (Debug)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration android.emu.debug\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"android.emu.release\" label=\"Android (Release)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration android.emu.release\n    </CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::tip\n\nIf the build is failing, try out our [Troubleshooting](../troubleshooting/building-the-app.md) section.\n\nNote that Detox CLI just executes the build command you specified in your Detox config (`.detoxrc.js`)\nfor a specific configuration. In the other words, it has no extra logic – it just takes the command and runs it,\nnothing more and nothing less.\n\n:::\n\nOnce your build is ready to use, please proceed to the next article.\n\n[setup guide]: https://docs.expo.dev/build-reference/e2e-tests\n"
  },
  {
    "path": "docs/introduction/your-first-test.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport RunningYourTest from './partials/_project-setup-build.mdx';\n\n# Your First Test\n\nThe previous articles have addressed the environment and project setup, and now it is time for writing\nand running the tests.\n\nIf you are eager to check first whether your build configuration was correct, you can skip writing a test for now and try [running tests](#running-tests) instead, to identify potential [late issues](../troubleshooting/running-tests.md#no-simulators-found-ios) caused by incorrect project configuration.\n\n## Writing a test\n\nThis subsection shows how to write a test which can:\n\n* _launch_ the application,\n* _tap_ on a button,\n* and _assert_ that some text appears as a result.\n\nAlso, it will familiarize you with commonly used Detox [actions], [assertions] and [matchers] along the way.\n\n### 1. Create a test suite\n\n:::info Note\n\nYou can also duplicate and modify a `e2e/starter.test.js` file that was generated automatically by `detox init` command.\n\n:::\n\nCreate a new test file under your `e2e` folder and add a similar test suite skeleton:\n\n```js title=\"e2e/yourTestName.test.js\"\ndescribe('Example', () => {\n  beforeAll(async () => {});\n\n  beforeEach(async () => {});\n\n  it('should test something', async () => {});\n});\n```\n\n### 2. Launch the application\n\nWhen your test starts, the application is not running yet. You need to call [`device.launchApp()`](../api/device.md#devicelaunchappparams) at least once, e.g. in the `beforeAll` hook:\n\n```js\ndescribe('Example', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  // …\n});\n```\n\nIf your app supports deep links, you can configure it to [start from a specific screen](../guide/mocking-open-with-url.md).\n\n:::tip\n\nIt is a good idea to start every test from a fresh state, since the preceding ones might leave your application\nin an unpredictable state if they fail.\n\nOne way to do it is to launch the app as a new instance in `beforeEach` hook instead:\n\n```js\nbeforeEach(async () => {\n  await device.launchApp({ newInstance: true });\n});\n```\n\nThe other way is to _reload React Native_ without restarting the app. Like any live reloading, it is apt to cause glitches for more complex apps,\nbut for simpler apps it proves to be a quicker way to reset the state between the tests:\n\n```js\nbeforeEach(async () => {\n  await device.reloadReactNative();\n});\n```\n\nSo, pick your favorite one wisely, on the basis of _speed_ vs _stability_ considerations.\n\n:::\n\n### 3. Match an element\n\nThe next step is to [match][matchers] an element you want to interact with.\n\nDetox provides many options to match an element [`by.id()`], [`by.label()`], [`by.text()`] and [more][matchers].\nThe most common way to match elements is either by _id_ or _text_:\n\n```js\nelement(by.id('YourTestID')); // recommended\nelement(by.text('Element text'));\n```\n\n:::info Best practice\n\nTry to use [`by.id()`](../api/matchers.md#byidid) matcher wherever possible.\n[Explore our guide](../guide/test-id.md) to learn how to work with `testID` props.\n\n:::\n\n### 4. Perform an action\n\nDetox provides many actions on elements such as [`tap()`], [`swipe()`], [`scroll()`] and [other interactions][actions#more].\n\nLet's tap on an element for the sake of the example:\n\n```jsx\ndescribe('Example', () => {\n  // …\n\n  it('should tap on a button', async () => {\n    await element(by.id('ButtonID')).tap();\n  });\n});\n```\n\n:::info Note\n\nYou don't need to wait or \"sleep\" after interacting with an element, because Detox already does it for you.\nIt synchronises with your application and waits after each action for all the foreground activities to finish before performing any further step.\n\nWhile convenient, this feature goes sideways at times, for example, when your app has looping animations causing Detox to wait forever.\nThis is why you sometimes have to tweak your app specifically for Detox tests, and [there is a special guide](../troubleshooting/synchronization.md) for that.\n\n:::\n\n### 5. Make an assertion\n\nAn essential step of any test is _making an assertion_.\n\nDetox provides its own `expect` object, so that you can expect from any element [`toExist()`], [`toBeVisible()`], [`toHaveText()`] and [more various things][assertions#more].\nAll the assertions can be inverted with [`not` property](../api/expect.md#not).\n\nLet's assert that our text is shown on a screen using [`toBeVisible()`] function:\n\n```jsx\ndescribe('Example', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should tap on button by id and expect some text to be visible', async () => {\n    await element(by.id('ButtonID')).tap();\n    await expect(element(by.text('The button has been pressed'))).toBeVisible();\n  });\n});\n```\n\nNote that instead of matching by text you can assert a specific text on an element with [`toHaveText()`], e.g.:\n\n```jsx\nawait expect(element(by.id('TextAfterButtonPressed'))).toHaveText('Button pressed');\n```\n\n## Running tests\n\n<Tabs groupId=\"configurationName\">\n  <TabItem value=\"ios.sim.debug\" label=\"iOS (Debug)\">\n    <RunningYourTest configurationName={'ios.sim.debug'} debug />\n  </TabItem>\n  <TabItem value=\"ios.sim.release\" label=\"iOS (Release)\">\n    <RunningYourTest configurationName={'ios.sim.release'} />\n  </TabItem>\n  <TabItem value=\"android.emu.debug\" label=\"Android (Debug)\">\n    <RunningYourTest configurationName={'android.emu.debug'} debug />\n  </TabItem>\n  <TabItem value=\"android.emu.release\" label=\"Android (Release)\">\n    <RunningYourTest configurationName={'android.emu.release'} />\n  </TabItem>\n</Tabs>\n\nIf you haven't changed the generated `e2e/starter.test.js`, you are likely to see errors like this:\n\n```\n FAIL  e2e/starter.test.js (25.916 s)\n  Example\n    ✕ should have welcome screen (662 ms)\n    ✕ should show hello screen after tap (236 ms)\n    ✕ should show world screen after tap (236 ms)\n\n  ● Example › should have welcome screen\n\n    Test Failed: No elements found for “MATCHER(id == “welcome”)”\n\n    HINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\n\n       9 |\n      10 |   it('should have welcome screen', async () => {\n    > 11 |     await expect(element(by.id('welcome'))).toBeVisible();\n         |                                             ^\n      12 |   });\n      13 |\n      14 |   it('should show hello screen after tap', async () => {\n\n      at Object.toBeVisible (e2e/starter.test.js:11:45)\n\n  …\n```\n\nIf you have created your own test, and it is failing, examine the error message, check out our [Troubleshooting](../troubleshooting/running-tests.md)\nand [Debugging](debugging.mdx) guides..\n\n[matchers]: ../api/matchers.md\n[`by.id()`]: ../api/matchers.md#byidid\n[`by.label()`]: ../api/matchers.md#bylabellabel\n[`by.text()`]: ../api/matchers.md#bytexttext\n[actions]: ../api/actions.md\n[`tap()`]: ../api/actions.md#tappoint\n[`swipe()`]: ../api/actions.md#swipedirection-speed-normalizedoffset-normalizedstartingpointx-normalizedstartingpointy\n[`scroll()`]: ../api/actions.md#scrolloffset-direction-startpositionx-startpositiony\n[actions#more]: ../api/actions.md#methods\n[assertions]: ../api/expect.md\n[`toExist()`]: ../api/expect.md#toexist\n[`toBeVisible()`]: ../api/expect.md#tobevisible\n[`toHaveText()`]: ../api/expect.md#tohavetexttext\n[assertions#more]: ../api/expect.md#methods\n"
  },
  {
    "path": "docs/pilot/best-practices.md",
    "content": "# Pilot Best Practices\n\nPilot allows you to write tests using natural language commands. Each step corresponds to a specific action or assertion within your app. In case you're wondering how to make the most out of this feature, here are some best practices to follow when writing your Pilot intents.\n\n---\n\n## Best Practices for `perform`\n\nThe `perform()` function executes a series of steps based on natural language commands. Proper structuring of these steps is crucial for accurate and reliable test execution.\n\n### Step-by-Step Instructions\n\n- **Write Sequential Steps**: Describe your test steps in a clear and sequential manner.\n- **Example**:\n\n```javascript\nit('should navigate and add a product to the cart', async () => {\n  await pilot.perform(\n    'Navigate to the \"Products\" page',\n    'Tap on the \"Add to Cart\" button for the first product',\n    'Verify that the \"Added to Cart\" pop-up is displayed'\n  );\n});\n```\n\n### Define Specific and Clear Steps\n\n- **Provide Clear Instructions**: The clearer your instructions, the better Pilot can interpret them.\n- **Example**:\n  - **Good**: `'Tap on the \"Login\" button'`\n  - **Better**: `'Tap on the \"Login\" button located at the top right corner'`\n\n### One Action per Step\n\n- **Avoid Combining Multiple Actions**: Keep each step focused on a single action or assertion.\n- **Example**:\n\n  - **Avoid**: `'Tap on the \"Login\" button and enter credentials'`\n  - **Prefer**:\n\n  ```javascript\n  'Tap on the \"Login\" button',\n  'Enter \"user@example.com\" into the \"Email\" field'\n  ```\n\n### Use Exact Labels\n\n- **Refer to UI Elements Precisely**: Use the exact text or identifiers as they appear in the app.\n- **Example**:\n  - **Good**: `'Enter \"password123\" into the \"Password\" field'`\n  - **Avoid**: `'Enter password into its field'`\n\n### Keep Assertions Simple\n\n- **Focus on Specific Outcomes**: Make assertions straightforward and specific.\n- **Example**:\n  - **Good**: `'Verify that the \"Welcome\" message is displayed'`\n  - **Avoid**: `'Check if the welcome message appears correctly on the screen'`\n\n### Leverage Visual Context\n\n- **Utilize Visual Descriptions**: If your LLM supports image snapshots, include visual context in your intents.\n- **Example**: `'Ensure the profile picture is visible at the top of the screen'`\n\n### Avoid Ambiguity\n\n- **Specify Elements Precisely**: If multiple elements could match, provide additional details.\n- **Example**:\n  - **Ambiguous**: `'Tap on the \"Submit\" button'`\n  - **Specific**: `'Tap on the \"Submit\" button in the registration form'`\n\n## Best Practices for `autopilot(goal)`\n\nThe `autopilot()` function automatically generates a series of steps to achieve the given goal. To optimize the output, follow these guidelines:\n\n### Define Specific and Clear Goals\n\n- **Be Clear and Concise**: Describe the goal with enough detail for Pilot to understand the desired outcome.\n- **Example**:\n\n```javascript\nawait pilot.autopilot('Complete the checkout process and verify the order confirmation');\n```\n\n### Provide Context\n\n- **Specify the Context of the Flow**: Indicate which part of the app you're focusing on.\n- **Example**: 'Verify the login flow from the homepage'\n\n## General Recommendations\n\n- **Flexibility**: While it's best to provide clear instructions, Pilot is designed to interpret a variety of phrasing. Different approaches can work, and you are encouraged to experiment.\n- **Feedback Loop**: Observe how Pilot interprets your instructions and adjust accordingly.\n- **Model Selection**: Choose an LLM model that best suits your application's complexity and language requirements. We recommend advanced models like **Sonnet 3.5** or **GPT-4o** for better performance.\n"
  },
  {
    "path": "docs/pilot/testing-with-pilot.md",
    "content": "# Natural Language Testing with Pilot\n\nIn this tutorial, we'll explore how to use **Pilot** to write end-to-end tests using natural language commands. Pilot leverages large language models (LLMs) to translate human-readable instructions or goal into Detox actions and assertions, making test writing more intuitive and accessible.\n\n:::note\n\nPilot now has a new [documentation site](https://wix-pilot.com/).<br/>\nThere, you can find a [technical overview](https://wix-pilot.com/docs/guides/technical-overview), learn how to [implement a driver for your preferred testing framework](https://wix-pilot.com/docs/guides/implementing-custom-testing-framework-driver), and stay up to date with the latest features and updates.\n\n:::\n\n:::caution Work in Progress\n\n**Note**: Pilot is in active development. APIs are subject to change in future releases.<br/>\nFor complete API details, refer to our [Pilot API documentation](../api/pilot).\n\n:::\n\n## Introduction\n\nPilot simplifies the process of writing tests by allowing you to describe test steps in natural language.\nIt interprets these instructions or goal and translates them into Detox commands. This guide will help you integrate Pilot into your testing workflow and provide best practices for writing effective intents.\n\n![Demo](../img/copilot/copilot-demo.gif)\n\n## Implementing a `PromptHandler`\n\nThe `PromptHandler` is a crucial component that interfaces with your LLM service.\nBelow is an example of how to implement a `PromptHandler` using OpenAI's GPT-4 API.\n\nYou can adapt this code to work with other LLMs or services as needed. You may also find pre-built `PromptHandler` implementations for popular LLMs in the [Pilot repository on GitHub](https://github.com/wix-incubator/pilot).\n\n:::note Open for Contributions\n\nIf you have implemented a `PromptHandler` for a specific LLM or service, consider contributing it to the [Wix Pilot GitHub Repository](https://github.com/wix-incubator/pilot) to help the community.\n\n:::\n\n### Example of a `PromptHandler` for OpenAI's GPT-4\n\n```javascript\nimport OpenAI from 'openai';\n\nconst path = require('path');\n\nclass OpenAIPromptHandler {\n  constructor(apiKey) {\n    const configuration = new OpenAI({ apiKey });\n    this.openai = new OpenAI(configuration);\n  }\n\n  async runPrompt(prompt, imagePath) {\n    const messages = [\n      { role: 'system', content: 'You are a test automation assistant.' },\n      { role: 'user', content: prompt },\n    ];\n\n    // If an image is provided, \"upload\" it and include the URL in the prompt\n    if (imagePath && this.isSnapshotImageSupported()) {\n      try {\n        const imageUrl = await this.uploadImage(imagePath);\n        messages.push({\n          role: 'user',\n          content: `Here is an image for reference: ${imageUrl}`,\n        });\n      } catch (error) {\n        console.error('Error uploading image:', error);\n        throw new Error('Failed to upload image');\n      }\n    }\n\n    const response = await this.openai.chat.completions.create({\n      model: 'gpt-4',\n      messages,\n    });\n\n    return response.data.choices[0].message.content;\n  }\n\n  async uploadImage(imagePath) {\n    // Uploads the image and returns the URL\n  }\n\n  isSnapshotImageSupported() {\n    return true; // Set to true to handle image uploads\n  }\n}\n\nmodule.exports = OpenAIPromptHandler;\n```\n\n**Explanation**:\n\n- **`runPrompt`**: Sends the prompt to the LLM and returns the response.\n- **`isSnapshotImageSupported`**: Indicates whether the LLM can handle snapshot images. If set to `true`, the handler will include image URLs in the prompt and will include them when instructing Pilot.\n\n## Initializing Pilot\n\nInitialize Pilot with your `PromptHandler` before running any tests.\nThis is typically done in the `beforeAll` hook or a setup file.\n\n**Example**:\n\n```javascript\nconst {pilot} = require('detox/index');\nconst OpenAIPromptHandler = require('./OpenAIPromptHandler');\n\nbeforeAll(() => {\n  const promptHandler = new OpenAIPromptHandler('YOUR_OPENAI_API_KEY');\n  pilot.init(promptHandler);\n});\n```\n\n## Writing Tests with Pilot\n\nWith Pilot initialized, you can now write tests using the `pilot.perform` method by sending a list of specific instructions, or the `pilot.autopilot` method to define the goal and generate actions automatically.\n\n### Writing Step-by-Step Tests with `pilot.perform`\n\nPilot allows you to write tests by providing a sequence of natural language instructions, using `perform` method. Each instruction corresponds to a single action or assertion.\n\n```javascript\nit('should verify element sizes and button states', async () => {\n  await pilot.perform(\n    'Launch the app with notification permissions enabled',\n    'Navigate to the \"Settings\" page',\n    'Verify that the \"Save\" button is disabled',\n    'Locate the profile picture element',\n    'Verify that the profile picture size is 100 x 100 pixels and that the image is available and rendered',\n    'Tap on the \"Edit Profile\" button',\n    'Verify that the \"Save\" button is now enabled',\n    'Verify that the \"Username\" field text is bold'\n  );\n});\n```\n\nIn the example above, Pilot can perform checks that go beyond traditional UI testing, such as verifying element sizes, button states (enabled/disabled), or text styles (e.g., bold). This is thanks to the combination of Detox code-generation and multimodal LLMs that can analyze the snapshots.\n\n- **Step-by-Step Instructions**: Each step is a separate string, representing a single action or assertion.\n- **Sequential Execution**: Steps are executed in order, allowing you to describe complex interactions intuitively.\n\n#### Hybrid Tests with Pilot and Detox APIs\n\nYou can also combine Pilot commands with traditional Detox APIs for more control.\n\n```javascript\nit('should add an item to the cart', async () => {\n  await pilot.perform(\n    'Launch the app',\n    'Navigate to the \"Products\" page',\n    'Tap on the \"Add to Cart\" button for the first product'\n  );\n\n  const cartBadge = element(by.id('cart-badge'));\n  await expect(cartBadge).toHaveText('1');\n\n  await pilot.perform(\n    'Navigate to the \"Cart\" page',\n    'Verify that the product is listed in the cart'\n  );\n});\n```\n\n### Locating Elements with Pilot\n\nYou can also use Pilot to retrieve values, locate elements, or perform advanced checks such as verifying element sizes or button states.\n\n```javascript\nit('should display the correct page title', async () => {\n  const pageTitleElement = await pilot.perform(\n    'Launch the app',\n    'Navigate to the \"Profile\" page',\n    'Locate the page title element'\n  );\n\n  await expect(pageTitleElement).toHaveText('Profile');\n});\n```\n\n## Goal-Oriented Tests with `pilot.autoPilot`\n\nWith the `pilot.autopilot` method, you can define the desired goal of your test, and Pilot will automatically generate the necessary actions and assertions to achieve that goal. This method focuses on the outcome, allowing you to create tests without having to specify each step manually.\n\n## Contributing to Pilot\n\nContributions are welcome!\nVisit the [Pilot GitHub Repository](https://github.com/wix-incubator/pilot) to open issues or pull requests if they are relevant to the core-library functionality or open a it under [Detox repository](https://github.com/wix/Detox) if it is related to Detox-Pilot integration or if you are not sure where the issue should be opened.\n"
  },
  {
    "path": "docs/troubleshooting/artifacts.md",
    "content": "# Artifacts\n\n## Video Recording Issues on CI\n\nFor iOS, you might be getting errors on CI similar to this:\n\n```plain text\nError: Error Domain=NSPOSIXErrorDomain Code=22 \"Invalid argument\" UserInfo={NSLocalizedDescription=Video recording requires hardware Metal capability.}.\n```\n\nUnfortunately, this error is beyond our reach. To fix it, you have to enable hardware acceleration on your build machine, or just disable video recording on CI if it is not possible to turn on the acceleration.\n\nThere might be a similar issue on Android when the screen recording process exits with an error on CI. While the solution might be identical to the one above, also you might try to experiment with other emulator devices and Android OS versions to see if it helps.\n\n## Detox Instruments is Installed in a Custom Location\n\nIf you have to use [Detox Instruments](https://github.com/wix/DetoxInstruments) installed in a custom location, you can point Detox to it with the `DETOX_INSTRUMENTS_PATH` environment variable, as shown below:\n\n```bash\nDETOX_INSTRUMENTS_PATH=\"/path/to/Detox Instruments.app\" detox test ...\n```\n\n> **Note:** If **Detox Instruments** had been [integrated into your project](https://github.com/wix/DetoxInstruments/blob/master/Documentation/XcodeIntegrationGuide.md), then the integrated [Detox Profiler framework](https://github.com/wix/DetoxInstruments/tree/master/Profiler) will be used when profiling with Detox.\n\n## `Ctrl+C` Does Not Clean Up Temporary Files\n\nThis is a known issue. :man\\_shrugging:\nAfter you press `Ctrl+C` and stop the tests, some of temporary files won’t get erased (e.g. `/sdcard/83541_0.mp4` on Android emulator, or `/private/var/folders/lm/thz8hdxs4v3fppjh0fjc2twhfl_3x2/T/f12a4fcb-0d1f-4d98-866c-e7cea4942ade.png` on your Mac).\nIt cannot be solved on behalf of Detox itself, because the problem has to do with how Jest runner terminates its puppet processes.\nThe issue is on our radar, but the ETA for the fix stays unknown.\nIf you feel able to contribute the fix to [Jest](https://github.com/facebook/jest), you are very welcome.\n"
  },
  {
    "path": "docs/troubleshooting/building-the-app.md",
    "content": "# Dealing With Problems With Building the App & Detox\n\nThis page is about issues related to building the app, typically triggered when running `detox build` (and not `detox test`, for example).\n\n## Android\n\n### Problem: AAPT - resource linking failure\n\nFor build errors involving AAPT resource linking failure, such as this one:\n\n```plain text\nExecution failed for task ':app:processReleaseAndroidTestResources'.\n> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction\n   > Android resource linking failed\n     ERROR:: AAPT: error: resource style/Widget.AppCompat.TextView ...\n```\n\nEnsure that the following line appears in your app build script in the `dependencies` section:\n\n```gradle title=\"android/app/build.gradle\"\ndependencies {\n    // ...\n    implementation 'androidx.appcompat:appcompat:1.1.0' // (check what the latest version is!)\n}\n```\n\n### Problem: minSdkVersion mismatch\n\nFor Gradle errors involving `minSdkVersion` mismatches resembling this one:\n\n```text\nuses-sdk:minSdkVersion 18 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.3] /Users/janedoe/.gradle/caches/transforms-3/6a9cd4eeeb285f80b9e6f413ecd78d0d/transformed/jetified-react-native-0.64.3/AndroidManifest.xml as the library might be using APIs not available in 18\n        Suggestion: use a compatible library with a minSdk of at most 18,\n                or increase this project's minSdk version to at least 21,\n                or use tools:overrideLibrary=\"com.facebook.react\" to force usage (may lead to runtime failures)\n```\n\nTry applying the solution suggested in [this Stack-overflow](https://stackoverflow.com/questions/21032271/how-to-inject-android-configuration-to-each-subproject-with-gradle) post, namely adding this to your root-project's `build.gradle` file (replace `21` those matching your app's `build.gradle`):\n\n```gradle title=\"android/build.gradle\"\nallprojects {\n    afterEvaluate {\n        if (it.hasProperty('android')){\n            android {\n                defaultConfig {\n                    minSdkVersion 21 // Replace '21' with whatever suites your case\n                }\n            }\n        }\n    }\n}\n```\n\n### Problem: Kotlin `stdlib` version conflicts\n\nThe problems and resolutions here are different depending on whether you’re using Detox as a precompiled dependency artifact (i.e. an `.aar`) - which is by far the common case, or compiling it yourself.\n\n#### Resolving for a precompiled dependency (`.aar`)\n\nOf all [Kotlin implementation flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies), Detox assumes the most recent one, namely `kotlin-stdlib-jdk8`. If your Android build fails due to conflicts with implementations coming from other dependencies or even your own app, consider adding an exclusion to either the \"other\" dependencies or detox itself, for example:\n\n```diff\ndependencies {\n-    androidTestImplementation('com.wix:detox:+')\n+    androidTestImplementation('com.wix:detox:+') {\n+        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'\n+    }\n}\n```\n\nDetox should work with `kotlin-stdlib-jdk7`, as well.\n\nA typical error output formed by `Gradle` in this case is as provided, for example, in [#1380](https://github.com/wix/Detox/issues/1380):\n\n```plain text\nCould not determine the dependencies of task ':detox:compileDebugAidl'.\n> Could not resolve all task dependencies for configuration ':detox:debugCompileClasspath'.\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.30'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n```\n\n(i.e. the project indirectly depends on different versions of `kotlin-stdlib`, such as `1.3.0`, `1.3.30`, `1.2.60`)\n\n#### Resolving for a compiling subproject\n\nDetox requires the Kotlin standard-library as its own dependency. Due to the [many flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies) by which Kotlin has been released, multiple dependencies often create a conflict.\n\nFor that, Detox allows for the exact specification of the standard library to use using two Gradle globals: `detoxKotlinVersion` and `detoxKotlinStdlib`. You can define both in your root build script file:\n\n```gradle title=\"android/build.gradle\"\nbuildscript {\n    // ...\n    ext.detoxKotlinVersion = '1.3.0' // Detox' default is 1.2.0\n    ext.detoxKotlinStdlib = 'kotlin-stdlib-jdk7' // Detox' default is kotlin-stdlib-jdk8\n}\n```\n\n### Problem: `Duplicate files copied in ...`\n\nIf you get an error like this:\n\n```plain text\nExecution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.\n> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE\n```\n\nYou need to add this to the `android` section of your app build script:\n\n```gradle title=\"android/app/build.gradle\"\npackagingOptions {\n    exclude 'META-INF/LICENSE'\n}\n```\n\n### Running Detox in a Rosetta environment\n\nWhen working with dependencies that require running your iOS app in a Rosetta simulator, you may encounter issues with the `detox build` command. These issues often relate to SwiftEmitModule or SwiftCompile errors. To resolve this, follow these steps:\n\n1. Modify your build command in the Detox configuration:\n\n```json\n\"build\": \"xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build\"\n```\n\n1. Run the following command in your terminal to ensure Xcode is properly selected:\n\n```bash\nsudo xcode-select --switch /Applications/Xcode.app\n```\n\n1. Launch the iOS simulator in Rosetta mode:\n\n```bash\narch -x86_64 /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator\n```\n\nAfter following these steps, the `detox build` command should run without errors in your Rosetta environment.\n\n:::note\n\nThis approach configures Detox specifically to build and run with Rosetta without affecting your app's regular builds. To run your app with Rosetta in Xcode, enable Rosetta simulator destinations via Xcode.\n\n:::\n"
  },
  {
    "path": "docs/troubleshooting/element-matching.md",
    "content": "# Dealing with Element Matching Issues\n\nThe preferred element-matching technique in Detox tests is by using **test ID's**.\n\nIn React Native, the `testID` prop is only supported on **built-in native components**. If you’ve created a **custom composite component**, you’ll need to manually pass the `testID` down to a native child component. The most common approach is to propagate it to one of the rendered children that are **native** components (such as `View`, `Text`, or `TouchableOpacity`):\n\n```jsx\nexport class MyCompositeComponent extends Component {\n  render() {\n    return (\n      <TouchableOpacity testID={this.props.testID}>\n        <View>\n          <Text>Something something</Text>\n        </View>\n      </TouchableOpacity>\n    );\n  }\n}\n```\n\nNow, when adding a `testID` to your composite component, it will be correctly applied:\n\n```jsx\nrender() {\n  return <MyCompositeComponent testID='MyUniqueId123' />;\n}\n```\n\n:::tip\n\nFor more info about this technique and test ID's in general, read our [guide about test ID's](../guide/test-id.md).\n\n:::\n\n## Debug View Hierarchy\n\nWhen element matching fails, inspecting the **native view hierarchy** can help diagnose the issue. This allows you to see how elements are structured in the app and determine whether a test ID is missing or the matcher needs to be improved.\n\nOn iOS, you can use `xcode` to visualize the native view hierarchy:\n\n1. Start a debuggable app (not a release build) in your simulator\n1. Open `xcode`\n1. Attach `xcode` to your app’s process\n   ![attach to process](../img/attach-to-process.jpg)\n1. Press the `Debug View Hierarchy` button\n   ![debug view hierarchy](../img/debug-view-hierarchy.jpg)\n1. This will open the hierarchy viewer, and will show a breakdown of your app’s native view hierarchy. Here you can browse through the views\n1. React Native testIDs are manifested as _accessibility identifiers_ in the native view hierarchy\n\nLet’s see an example. We will find the following view in the native hierarchy:\n\n```jsx\n<TouchableOpacity onPress={this.onButtonPress.bind(this, 'ID Working')}>\n  <Text testID='UniqueId345' style={{color: 'blue', marginBottom: 20}}>ID</Text>\n</TouchableOpacity>\n```\n\nThis is the hierarchy viewer, pointing to the native view just mentioned:\n\n![hierarchy viewer](../img/hierarchy-viewer.jpg)\n\nThere are other techniques for doing this besides using `xcode`, and also on Android -- coming soon!\n"
  },
  {
    "path": "docs/troubleshooting/flakiness.md",
    "content": "# Dealing With Flakiness in Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\n> What is a flaky test?\n\nA flaky test is a test that passes most of the time, and sometimes without any apparent reason and without any changes to your app - it fails. This can even happen only on certain machines. For example, on your own machine it always passes, but on a different slower machine, like the CI, it fails.\n\n### 1. We Feel Your Pain\n\nFlakiness is the greatest challenge in E2E. The good news is that Detox was designed with this mission in mind: dealing with flakiness head on.\n\nAssume you have a suite of 100 tests and each test is flaky in 0.5% of executions (failing without an actual bug in your app). The total flakiness of your entire suite is about 40% (the exact formula is `1 - (1 - 0.005)^100`). This means that there’s 40% chance your suite will fail without an actual bug! This makes your entire suite useless.\n\n### 2. Sources of Flakiness\n\nIt’s important to identify the various sources of flakiness in Detox tests.\n\n- Control of the device / simulator - in order to run your tests, Detox must communicate with a simulator and instruct it to install the app, restart it, etc. Simulators don’t always behave and controlling them might occasionally fail. Detox’s underlying simulator control is [`AppleSimulatorUtils`](https://github.com/wix/AppleSimulatorUtils), it is a tool that supports both basic and advanced simulator and device interaction options, it uses some core simulator features which are not always stable and may need time to \"warm up\" (booting, shutting down, etc.). Detox is set to have a few retries on any of these actions before failing. It will also print all the `exec` commands when using `verbose` log level, and with `trace` level it will print everything.\n\n- Asynchronous operations inside your app - every time an E2E test runs, operations might take place in a different order inside your app. This makes E2E tests nondeterministic. Consider an HTTP request made to a server, this request may take a variable time to complete due to external concerns like network congestion and server load. Detox takes this into account by monitoring all asynchronous operations that take place in your app from the inside. Detox knows which network requests are currently in-flight. Detox knows how busy the React Native bridge is. Tests are automatically synchronized to the app and only move forward when the app is idle.\n\n### 3. Get More Data About the Problem\n\nIn order to identify the source of flakiness you’re suffering from you need more data. If you catch a failing test that should be passing, you need to record as much information as possible in order to investigate.\n\n- Enable `trace` mode in Detox. This will output a lot of information about what happening during the test:\n  1. `exec` commands\n  1. All communication going over the websocket, both from tester and app\n\nTo enable `trace` mode run your tests in trace log mode:\n\n```bash\ndetox test --loglevel trace\n```\n"
  },
  {
    "path": "docs/troubleshooting/running-tests.md",
    "content": "# Dealing With Problems With Running Tests\n\n<!-- markdownlint-disable MD024 -->\n\nThis page is about issues related to executing your Detox tests, typically triggered when running `detox test` (and not `detox build`, for example).\n\n## No simulators/emulators found\n\n### iOS\n\nIn order to run tests on a simulator, you need to have simulator images installed on your machine. This process is performed by `xcode` itself. You can list all available simulators using `simctl` by typing `xcrun simctl list` in terminal.\n\nIf you’re missing a simulator, you need to [manually install it](https://developer.apple.com/documentation/safari-developer-tools/adding-additional-simulators). Note that `xcode` is required.\n\nOnce the desired simulator is installed and returned by `xcrun simctl list`, double check its name in the list and make sure this name is found in the `detox` configuration entry in `package.json`. The reference for the configuration options is available [here](../config/devices.mdx).\n\n### Android\n\nComing soon...\n\n## Detox starts but my test doesn't actually run\n\n### Issue\n\n- A while after running Detox, things seem to hang and you get a message about a failure to connect to the running app, in Detox's logs:\n\n```plain text\nDetox can’t seem to connect to the test app(s)!\n```\n\n### Course of action\n\nThis can be a result of various reasons. It is generally up to you to debug and find the root cause. In any case, below are the common ones.\n\n#### If you don't see your app running on the device\n\n- You might have forgotten to run `device.launchApp()` in the beginning of your test.\n- The app might have crashed before Detox has had a chance to connect to it. To get the crash details, you can run Detox tests with `--record-logs all` CLI option and then inspect the device logs in the artifacts' folder.\n- **On Android**, there might be a problem with the native test code in the `DetoxTest.java` file. Revisit the [associated section](../introduction/project-setup.mdx#step-4-additional-android-configuration) in the setup guide.\n- **On Android**, your `Network Security Config` may not be recognized. Revisit the [associated section](../introduction/project-setup.mdx#43-enabling-unencrypted-traffic-for-detox) in the setup guide.\n\n**If you _do_ see your app running on the device**\n\n- **On Android with SDK≥28**, the app’s connection to the Detox test server is blocked due to clear-traffic blockage (as reported in issue [#1450](https://github.com/wix/Detox/issues/1450)).\n  The main step for getting this fixed is to revisit the [associated section](../introduction/project-setup.mdx#step-4-additional-android-configuration) in the setup guide, which discusses network-security. Alternatively, the `android:usesCleartextTraffic=\"true\"` attribute can be configured in the `<application>` tag of the app’s `AndroidManifest.xml`, but **that is highly discouraged**.\n- If you’ve applied the above suggestion but the app fails to connect to the Detox test server, nonetheless: Refer to the device’s logs, which should contain messages about failed connection attempts (get them using the `--record-logs all` argument)\n- The app could be running without Detox native code injected. In this case, first, make sure you’re not trying to run in manual launch mode (where this behavior is valid). If so, examine the logs from the device (get them using the `--record-logs all` argument). If you see a crash related to Detox’s native code, you are welcome to report it on our GitHub tracker.\n- Try reading our [Debugging tutorial](../introduction/debugging.mdx).\n\n## The test runs but the app looks stuck / test times-out\n\n### Issue\n\n- **The test runs and at some point the app gets stuck on the same screen / state until the end of the test** - for example, displaying a loader animation. This can be observed directly if Detox is run locally, or otherwise post-factum by checking Detox's [video recording artifact](https://wix.github.io/Detox/docs/config/artifacts/#enabling-artifacts):\n  \n  ![App loader example](../img/app-loader.jpeg)\n  \n- Detox logs might also show synchronization warnings, repeatedly. For example:\n\n  ```plain text\n  19:07:20.140 detox[1907] i The app is busy with the following tasks:\n  • UI elements are busy:\n    - View animations pending: 2.\n    - Layers pending animations: 7.\n    - Layers needs layout: 147.\n    - View needs layout: 98.\n    - View needs display: 67.\n    - Layers needs display: 82.\n  • 1 enqueued native timers:\n    - Timer #1:\n      + Fire date: none.\n      + Time until fire: 0.000.\n      + Repeat interval: 0.\n      + Is recurring: YES.\n  • 1 network requests with URLs:\n    - URL #1: https://example.org/something?id=1337\n  ```\n\n- The test failure reason might be associated with time-outs, or you see time-outs in the _device_ (not Detox) log (available as a Detox [test artifact](https://wix.github.io/Detox/docs/config/artifacts/#enabling-artifacts)).\n\n### Course of action\n\nThis might be related somehow to your test code, but **could definitely stem from a an app bug.** Take an in-depth look at the [synchronization troubleshooting guide](./synchronization.md).\n\n## Detox can't find or interact with an element even though it's on the screen\n\n### Issue\n\nEither one of the following 2 scenarios:\n\n1. The test runs, the app starts on the device and is maybe even being successfully navigated-through by the test, onto an inner screen; The app/screen opens properly and you know for sure that your element matcher is spot-on - **yet Detox says the element cannot be found (this can even happen intermittently, in a flaky test).**\n2. The test runs, the app starts and displays a transient UI element for a limited amount of time and is then removed automatically. For example: A _Toast_ element. Another example: A temporary \"Success\" cheering-effect that fades out to the screen below:\n\n   ![Transient UI element](../img/transient-ui-element.png)\n\n### Course of action\n\nFor the 1st option, you'd have to go deeper by exploring the possibility of disabling auto-synchronization as explained in the [synchronization troubleshooting guide](./synchronization.md#last-resort-Switching-to-manual-synchronization).\n\nAs for the 2nd option -\n\n1. If possible, start by revisiting your matching technique, as explained in the dedicated [matching troubleshooting guide](./element-matching.md).\n2. If that doesn't solve it, consider switching to using `waitFor()` (see below).\n3. If all fails, consider [disabling synchronization](./synchronization.md#last-resort-Switching-to-manual-synchronization) altogether.\n\n#### Switching to the polling-based `waitFor()` API's\n\nyou'd have to resort to Detox's fail-safe `waitFor()` family of API's, which poll your matching criteria within a specified time frame defined by you as a timeout. To take the screen above as an example, you'd have to change your test from:\n\n```js\nawait element(by.id('join-button')).tap();\nawait expect(element(by.text('Success!'))).toBeVisible();\n```\n\nto something like:\n\n```js\nawait element(by.id('join-button')).tap();\nawait waitFor(element(by.text('Success!'))).toBeVisible().withTimeout(2_000);\n```\n\n## Detox says an element is not visible enough\n\n**On iOS**, you may run in a situation, when one of the interactions (tap, scroll, etc.) on an element fails with an error like:\n\n```plain text\nTest Failed: View \"<RCTScrollView: 0x7f8d32296d70>\" is not visible: view does not pass visibility threshold (0% visible of 75% required)\n```\n\n1. Try retrieving `ui.viewhierarchy` artifact — sometimes examining the hierarchy visually can give you insights.\n   Add a line `\"uiHierarchy\": \"enabled\"` to your artifacts' configuration in `.detoxrc.js`, like in an example here: [Artifacts Configuration](../config/artifacts.mdx). After a rerun, you should find\n   a `ui.viewhierarchy` in a folder of your failing test. Please mind that you need Xcode 12 at least to open `*.viewhierarchy` files.\n\n1. Besides, you can rerun your iOS app tests with `--take-screenshots failing`. What will happen is, for each view that fails visibility, two images will be saved at `artifacts/<configuration-timestamp-dir>/<test name>/DETOX_VISIBILITY_<viewType>__<viewID>__SCREEN.png` (and `.../DETOX_VISIBILITY_<viewType>__<viewID>__TEST.png` folder aside) with autogenerated names, e.g. `DETOX_VISIBILITY_RCTTextView__0x7fab7660f3e0__TEST.png`:\n\n|                                                            in `DETOX_*_SCREEN.png`                                                           |                                                              in `DETOX_*_TEST.png`                                                             |\n| :------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: |\n| <img alt=\"visible\" src=\"https://user-images.githubusercontent.com/2270433/94178906-68872380-fea4-11ea-845c-c55c25b68c0e.png\" height=\"480\" /> | <img alt=\"internals\" src=\"https://user-images.githubusercontent.com/2270433/94178919-6c1aaa80-fea4-11ea-8db6-64f1f4b21361.png\" height=\"480\" /> |\n\nThe first is supposed to show what is seen on screen. The second shows the internal buffer that Detox tests for visibility; if the pixels aren’t transparent enough and less than 75% of tested region is not transparent, the view is not considered visible.\n\nIf you are developing a React Native app, then the following applies. If, for instance, you see that tapping fails due to a view with `pointerEvents=\"none\"` obscuring your target — well, the only solutions are: either to make the obscurer a descendant of your target (instead of being a sibling), or to tap on the parent container.\n\nIf you see that your issue cannot be solved via testID replacement or a simple hierarchy rearrangement, then there’s a chance this is a bug in Detox. Make sure to provide your `ui.viewhierarchy` artifact, the generated `DETOX_VISIBILITY_*` pictures and a comprehensive description of the issue backed up with sound arguments.\n\n## Explore More Options\n\n### Compare to a Working Setup\n\nIf you feel lost, try starting from a working example for sanity.\n\nThere are multiple working examples included in this repo, such as [demo-react-native](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\n\nFirst, install, build and make sure the tests are indeed passing. If they are, try comparing this setup with what you have.\n\n### Take a Look at Past Issues\n\nBefore opening a new issue, search the [list of issues](https://github.com/wix/detox/issues?utf8=%E2%9C%93\\&q=is%3Aissue) on GitHub. There’s a good chance somebody faced the same problem you are having.\n\n### How to Open a New Issue\n\nBefore opening a new issue, please follow the entire troubleshooting guide and go over past issues.\n\nGeneral usage questions should be opened on Stack Overflow, where the core Detox team is active and responds to questions:\n<https://stackoverflow.com/questions/tagged/detox>\n\nIf you believe you are seeing a Detox issue, select the correct template from the options, and make sure to fill all requested information in the template. Omitting important information will likely result in a closed issue.\n"
  },
  {
    "path": "docs/troubleshooting/synchronization.md",
    "content": "# Dealing With Synchronization Issues in Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nTraditionally, one of the most difficult aspects of E2E testing is synchronizing the test scenario with the app.\n\nComplex operations inside the app (like accessing servers or performing animations) often take a variable amount of time to complete; In each step, we can’t move on to the next one until they’ve completed (i.e. when the app goes idle), which in turn surfaces a challenge in continuously trying to understand when the right time to do so is.\n\nFortunately, Detox - which comes with a gray-box approach, cleverly performs the synchronization automatically, as explained [here](../articles/how-detox-works.md#how-detox-automatically-synchronizes-with-your-app).\n\n## Mitigating Synchronization Issues\n\nWhile Detox's auto-synchronization mechanism is powerful and efficient, it does come with at least one caveat: **It imposes strictness over the app's behavior.** By default, Detox will fail your tests (i.e. due to a wait-for-idle **time-out**), if, for example, following an app launch or a navigation to a new screen, timers or animations continue to run endlessly. While this could be considered an advantage (e.g. finding an animation or timer management leakage!), these type of issues may not:\n\n1. Be specifically related to the main coverage goal of your test.\n2. Be directly visible to or considered a significant bug by the end user.\n\nTherefore, it may be something some would want to be able to limit or completely opt-out of. With this in mind, let's review the possible ways of mitigation, aimed at either finding and fixing a bug, or allowing for it to be overlooked.\n\n### Step 1: Understanding what's blocking your app\n\nDetox's synchronization debugging mechanism generates output to Detox's log which provides useful synchronization debugging information. We recommend that you'd start by pinpointing what the busy resources are - those that are keeping your app from going idle, based on those logs. Turn the debugging mechanism toggle on if you need to (although, it is on by default), rerun your test(s) and follow Detox's logs.\n\n:::info\n\nRead about Detox's _synchronization debugging mechanism_ in order to understand how to debug your app for unnecessarily busy resources. It can be specified either via the [Detox configuration file](../config/session.mdx#sessiondebugsynchronization-number) or more directly, as a [CLI argument](../cli/test.md#options):\n\n```js\ndetox test --debug-synchronization 5000\n```\n\n:::\n\n#### (Optional) Lower-level debugging (iOS only)\n\nIf the synchronization debugging mechanism does not provide all of the necessary information, on iOS you can add the following launch argument to your app (using `launchArgs` in your `launchApp()` call) to enable a very verbose logging of the idling resource system to the system log:\n\n```plain text\n-DTXEnableVerboseSyncSystem YES -DTXEnableVerboseSyncResources YES\n```\n\nYou can then obtain this log by running the following command:\n\n```bash\nxcrun simctl spawn booted log stream --level debug --style compact --predicate \"category=='SyncManager'\"\n```\n\nFor example, change your `device.launchApp()` call like:\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { 'DTXEnableVerboseSyncSystem': 'YES', 'DTXEnableVerboseSyncResources': 'YES' },\n});\n```\n\n### Step 2: Applying the Most Suitable Solution\n\nFirst and foremost, as explained, an app's inability to go idle might be an indication of that some resources are _unnecessarily_ busy. Therefore, whether it's a network request that's been left unacknowledged, or an endless loader -\n\n**The best solution is to fix the problem! :construction_worker:**\n\n#### Dealing with endless animation bugs (e.g. loaders)\n\nSometimes the resource that's holding the app back from turning idle is a mere animation of a single loader - running endlessly on the screen:\n\n![App loader example](../img/app-loader.jpeg)\n\nThe synchronization logs telling you that, would usually look roughly like this:\n\n```plain text\n09:04:20.170 detox[90417] i The app is busy with the following tasks:\n• UI elements are busy:\n  - View animations pending: 2.\n  - Layers pending animations: 7.\n  - Layers needs layout: 147.\n  - View needs layout: 98.\n  - View needs display: 67.\n  - Layers needs display: 82.\n• 1 enqueued native timers:\n  - Timer #1:\n    + Fire date: none.\n    + Time until fire: 0.000.\n    + Repeat interval: 0.\n    + Is recurring: YES.\n```\n\n<sup>(these are logs generated by Detox iOS; Detox-Android generates different yet equivalent ones)</sup>\n\n**Below are a few actual-bug scenarios where this can take place - all of which are easy to inspect, identify and fix.**\n\n##### i. A server is being non-responsive\n\nYour app is waiting indefinitely to load all of the necessary data from the a non-responsive server / a bad network, and therefore cannot switch to rendering the expected UI. When this is the deal, additional synchronization logs also repeatedly show some in-flight network calls:\n\n```plain text\n09:04:20.170 detox[90417] i The app is busy with the following tasks:\n• 1 network requests with URLs:\n  - URL #1: https://nonresponsive-server.org/something?id=1337\n  - URL #2: https://unreachable-server.org/hello\n```\n\n_This can be solved by finding out why the server is being non-responsive or unreachable, for example - by tracking network calls into the logs, or inspecting requests on the server-ends._\n\n##### ii. A returned server error is not conveyed by the UI\n\nSometimes the servers _do_ respond, **but with an error**. Often times, we fail to adjust our app code to display the necessary UI (e.g. replacing the loader with a friendly message). Rather, the loader just remains running indefinitely. Unlike in the previous case, you will not see synchronization-debug logs surfacing those unacknowledged network calls.\n\n_Scan through the **app/device** logs (not Detox log!) from the bottom up and find traces of errors. The app/device logs can be automatically recorded by Detox as a test-run artifact._\n\n##### iii. An app error is ignored\n\nLast but not least, this behavior can be the result of an app bug around handling **valid data returned from the server**, such as an error while parsing the data.\n\n_Look up the error - which usually comes with a stack-trace and is therefore very prominent, in the test summary in the (also Detox) logs. If it's not in the summary itself, you'd have to resort to searching those in the app/device logs. The app/device logs can be automatically recorded by Detox as a test-run artifact._\n\n#### Dealing with looping animations\n\nAnimations are ultimately a way of making our apps friendlier and nicer to use. Sometimes a good user experience comes specifically from animations that are forever-looping on purpose (for example. animated `.gif`s).\n\nDetox currently has no API's for \"black listing\" animations - namely, excluding them from the synchronization process (i.e. as it does with network calls). Therefore, you might want to consider removing the looping animation in your tests by rebuilding the app with such animating elements replaced by [mocks](../guide/mocking.md).\n\n#### Dealing with **hidden** animations\n\nNot all synchronization issues around animations are trivial:\n\n- The animation can be associated with an element that is rendered off-screen, such as an item in a long news feed that's been rendered beyond the screen's bound, or a loader in a screen associated with a bottom tab that hasn't been navigated-to since the beginning of the test.\n- The animation can also be associated with elements which have been silently leaked (bug) under other UI elements. They are fully functional yet not visible to the user. For example: A compact loader accidentally showing under the app bar (android)/navigation bar (iOS).\n\nThese types of animations can be difficult to track down, and sometimes fix.\n\n**We are aiming to provide more advanced Detox-complementary tools that would help identify such animations more easily (follow Github issue [#4734](https://github.com/wix/Detox/issues/4734)). Until we do, here are some things you can do, roughly, in order:**\n\n1. _(Most recommended) Start Detox in [debug mode](../introduction/debugging.mdx), and then run the blocked test step-by-step - either from the beginning of it, or starting a breakpoint you've set over where you think the synchronization issue starts. Step over the Detox commands until Detox gets blocked and signals for synchronization issues (i.e. in the logs). Then, explore the app yourself (!), physically looking for animations (e.g. by scrolling lists, navigating through tabs, and so on.\n   You might actually be able to see the animation in your own eyes, or witness Detox getting unblocked as your interactions release an otherwise endless loader._\n   _Do this iteratively until the exact animating UI element can be pinpointed._\n\n2. _Run the test and [generate a view-hierarchy](../api/device.md#devicecaptureviewhierarchyname) at the right timing, then inspect your app's layout in xcode's powerful view-hierarchy inspector_. Look for off-screen or obscured elements.\n\n3. _Run your app (without Detox) on Android in debug mode using Android Studio, and use its fancy [Layout Inspector](https://developer.android.com/studio/debug/layout-inspector) tool in order to inspect your app._\n\n4. _Perform a \"binary search\" over the screen's content: Remove big blocks of content from it intermittently, rerunning the failing test each time, until synchronization stops blocking you. Then, slowly bring back repeatedly smaller and smaller sub-elements of the UI to see which one retriggers synchronization blockage. Eventually, you could pinpoint the exact culprit._\n\n#### Dealing with network synchronization issues\n\nSometimes Detox synchronization gets block, waiting for networks call that are in fact associated with URL's that happen to be \"noise\", meaning - specifically related to some kind of long polling background tasks, or web-socket connections. Such network calls should NOT be considered blocking in a user-flow test.\n\n_This can be solved by [black-listing the URL's in Detox](../api/device.md#deviceseturlblacklisturls), which would exclude it from Detox's synchronization over the network:_\n\n```js\n// Black-list (exclude) URL's in mid test-run:\nawait device.setURLBlacklist(['.*127.0.0.1.*']);\n\n// Black-list URL's from as early as app launch:\nawait device.launchApp({\n  launchArgs: {\n    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")',\n  },\n});\n\n// Reset black-list\nawait device.setURLBlacklist([]);\n```\n\n#### Dealing with endless timers\n\nBy default, Detox is designed to ignore JavaScript's `setInterval()` and will only wait for `setTimeout()`'s **of up to 1.5 seconds**.\n\n*If you have an endless polling loop with short intervals implemented with `setTimeout`, switch the implementation to `setInterval`. If possible, avoid aggressive polling in your app altogether, the poor single JavaScript thread we have doesn’t like it.*\n\n#### Last resort: Switching to manual synchronization\n\nDisabling automatic synchronization makes sense in two cases:\n\n1. You have a synchronization problem (as explained above) but you can't find the source of the problem, or simply decide not to fix it (temporarily...)\n2. You have a screen with a transient element, such as a toast or a cheering UI element, that is displayed temporarily and disappears automatically:\n\n   ![Transient UI element](../img/transient-ui-element.png)\n\nDetox always has the fail-safe solution of turning off automatic-synchronization altogether and waiting manually for elements.\n\nThis isn’t the recommended approach as you'd be giving up Detox's synchronization super-powers and resort to manually defining timeouts, but hey, life is about trade-offs. You can do this with the main [synchronization switching API's](../api/device.md#devicedisablesynchronization):\n\n```js\n// Disabling in mid test-run:\nawait device.disableSynchronization();\n```\n\n```js\n// Launching the app with sync disabled from the start:\nawait device.launchApp({\n  launchArgs: {\n    detoxEnableSynchronization: 0\n  },\n});\n```\n\n```js\n// To turn synchronization back on (this command will block on synchronization):\nawait device.enableSynchronization();\n```\n\nMind that when this technique is applied, it effectively means that have to start using Detox API's differently (i.e. resort to using [`waitFor().withTimeout()`](../api/expect.md#withtimeouttimeout)) API's and possibly even migrate test code.\n\nFor example, instead of:\n\n```js\nawait element(by.id('write-message-btn')).tap(); // Navigate to message writing screen\nawait element(by.id('message-input')).typeText('Hello!'); // Type in a message\nawait element(by.id('submit-btn')).tap(); // Submit!\n```\n\nYour test code will have to look more like this:\n\n```js\nawait device.disableSynchronization();\n\nawait element(by.id('write-message-btn')).tap();\n\n// Wait up to 4 seconds for the screen to fully load\nawait waitFor(element(by.id('message-input'))).toBeVisible().withTimeout(4000);\n\nawait element(by.id('message-input')).typeText('Hello!');\nawait element(by.id('submit-btn')).tap();\n```\n\n##### Hybrid manual/automatic synchronization\n\nAs of writing this, fine-tuned control over the various synchronized OS-systems that Detox monitors is not supported. Follow issue [#1513](https://github.com/wix/Detox/issues/1513) to keep track of that.\n"
  },
  {
    "path": "docs/uml/sequence/boot-cli-many-workers.uml",
    "content": "@startuml\n\nactor User\nboundary \"Detox CLI\" as CLI\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxSecondaryContext.0\" as Sec0\nboundary \"Jest (worker N)\" as JestN\nparticipant \"DetoxSecondaryContext.N\" as SecN\nparticipant \"DetoxCircusEnvironment.N\" as Env\n\nUser -> CLI: detox test\nactivate CLI\nCLI -> Pri: require('detox')\nactivate Pri\nCLI -> Pri: init()\nloop while exitCode != 0 and retries > 0\n  CLI -> Jest0: child_process.spawn('jest')\n  activate Jest0\n  Jest0 -> Sec0: require('detox')\n  activate Sec0\n  Jest0 -> Sec0: resolveConfig()\n  Jest0 -> Sec0: init()\n  Jest0 -> JestN: child_process.fork()\n  activate JestN\n  loop every test file\n    JestN -> Env: new()\n    activate Env\n    JestN -> Env: setup()\n    Env -> SecN: require('detox')\n    activate SecN\n    Env -> SecN: init()\n    Env -> SecN: installWorker()\n    SecN --> Pri: register worker\n    JestN -> Env: run test file\n    JestN -> Env: teardown()\n    Env -> SecN: uninstallWorker()\n    deactivate Env\n    Jest0 --> Pri: reportTestResults()\n  end loop\n  deactivate SecN\n  deactivate JestN\n  Jest0 -> Sec0: cleanup()\n  deactivate Sec0\n  deactivate Jest0\nend loop\nCLI -> Pri: cleanup()\ndeactivate Pri\ndeactivate CLI\n\n@enduml\n"
  },
  {
    "path": "docs/uml/sequence/boot-cli-single-worker.uml",
    "content": "@startuml\n\nactor User\nboundary \"Detox CLI\" as CLI\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxSecondaryContext\" as Sec\nparticipant \"DetoxCircusEnvironment\" as Env\n\nUser -> CLI: detox test\nactivate CLI\nCLI -> Pri: require('detox')\nactivate Pri\nCLI -> Pri: init()\nloop while exitCode != 0 and retries > 0\n  CLI -> Jest0: child_process.spawn('jest')\n  activate Jest0\n  Jest0 -> Sec: require('detox')\n  activate Sec\n  Jest0 -> Sec: resolveConfig()\n  Jest0 -> Sec: init()\n  loop every test file\n    Jest0 -> Env: new()\n    activate Env\n    Jest0 -> Env: setup()\n    Env -> Sec: installWorker()\n    Sec --> Pri: register worker\n    Jest0 -> Env: run test file\n    Jest0 -> Env: teardown()\n    Env -> Sec: uninstallWorker()\n    deactivate Env\n    Jest0 --> Pri: reportTestResults()\n  end loop\n  Jest0 -> Sec: cleanup()\n  deactivate Sec\n  deactivate Jest0\nend loop\nCLI -> Pri: cleanup()\ndeactivate Pri\ndeactivate CLI\n\n@enduml\n"
  },
  {
    "path": "docs/uml/sequence/boot-jest-many-workers.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (worker N)\" as JestN\nparticipant \"DetoxSecondaryContext.N\" as Sec\nparticipant \"DetoxCircusEnvironment.N\" as Env\n\nUser -> Jest0: jest --maxWorkers N\nactivate Jest0\nJest0 -> Pri: require('detox')\nactivate Pri\nJest0 -> Pri: resolveConfig()\nJest0 -> Pri: init()\nJest0 -> JestN: child_process.fork()\nactivate JestN\nloop every test file\n  JestN -> Env: new()\n  activate Env\n  JestN -> Env: setup()\n  Env -> Sec: require('detox')\n  activate Sec\n  Env -> Sec: init()\n  Env -> Sec: installWorker()\n  Sec --> Pri: register worker\n  JestN -> Env: run test file\n  JestN -> Env: teardown()\n  Env -> Sec: uninstallWorker()\n  deactivate Env\n  Jest0 --> Pri: reportTestResults()\nend loop\ndeactivate Sec\ndeactivate JestN\nJest0 -> Pri: cleanup()\ndeactivate Pri\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "docs/uml/sequence/boot-jest-single-worker.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxPrimaryContext\" as Pri\nparticipant \"DetoxCircusEnvironment\" as Env\n\nUser -> Jest0 : jest --runInBand\nactivate Jest0\nJest0 -> Pri: require('detox')\nactivate Pri\nJest0 -> Pri: resolveConfig()\nJest0 -> Pri: init()\nloop every test file\n  Jest0 -> Env: new()\n  activate Env\n  Jest0 -> Env: setup()\n  Env -> Pri: installWorker()\n  Jest0 -> Env: run test file\n  Jest0 -> Env: teardown()\n  Env -> Pri: uninstallWorker()\n  deactivate Env\n  Jest0 --> Pri: reportTestResults()\nend loop\nJest0 -> Pri: cleanup()\ndeactivate Pri\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "docs/uml/sequence/jest-diagram-runInBand.uml",
    "content": "@startuml\n\ntitle \"jest --runInBand\"\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"jest.config.js\" as jestConfig\nparticipant \"globalSetup\" as globalSetup\nparticipant \"reporters\" as jestReporter\nparticipant \"globalTeardown.js\" as globalTeardown\n\nUser -> Jest0 : jest ...\nactivate Jest0\nJest0 -> jestConfig: import\nactivate jestConfig\njestConfig -> Jest0: await\ndeactivate jestConfig\nJest0 -> globalSetup: import\nactivate globalSetup\nglobalSetup -> Jest0: await\ndeactivate globalSetup\nJest0 -> jestReporter: import\nactivate jestReporter\nJest0 -> jestReporter: onRunStart()\nloop every test file\n  Jest0 -> Jest0: runTests()\n  Jest0 -> jestReporter: onTestFileResult()\nend loop\nJest0 -> jestReporter: onRunComplete()\ndeactivate jestReporter\nJest0 -> globalTeardown: import\nactivate globalTeardown\nglobalTeardown -> Jest0: await\ndeactivate globalTeardown\n\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "docs/uml/sequence/jest-diagram.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"jest.config.js\" as jestConfig\nparticipant \"globalSetup\" as globalSetup\nparticipant \"reporters\" as jestReporter\nparticipant \"globalTeardown.js\" as globalTeardown\nboundary \"Jest (worker N)\" as JestN\n\nUser -> Jest0 : jest ...\nactivate Jest0\nJest0 -> jestConfig: import\nactivate jestConfig\njestConfig -> Jest0: await\ndeactivate jestConfig\nJest0 -> globalSetup: import\nactivate globalSetup\nglobalSetup -> Jest0: await\ndeactivate globalSetup\nJest0 -> jestReporter: import\nactivate jestReporter\nJest0 -> jestReporter: onRunStart()\nJest0 -> JestN: child_process.fork()\nactivate JestN\nloop every test file\n  Jest0 -> JestN: runTests()\n  JestN -> jestReporter: onTestFileResult()\nend loop\ndeactivate JestN\nJest0 -> jestReporter: onRunComplete()\ndeactivate jestReporter\nJest0 -> globalTeardown: import\nactivate globalTeardown\nglobalTeardown -> Jest0: await\ndeactivate globalTeardown\n\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  SwiftExample\n//\n//  Created by Leo Natan (Wix) on 30/07/2017.\n//  Copyright © 2017 Leo Natan (Wix). All rights reserved.\n//\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n\tvar window: UIWindow?\n\n\tfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {\n\t\t// Override point for customization after application launch.\n\t\treturn true\n\t}\n\n\tfunc applicationWillResignActive(_ application: UIApplication) {\n\t\t// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n\t\t// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.\n\t}\n\n\tfunc applicationDidEnterBackground(_ application: UIApplication) {\n\t\t// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n\t\t// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n\t}\n\n\tfunc applicationWillEnterForeground(_ application: UIApplication) {\n\t\t// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.\n\t}\n\n\tfunc applicationDidBecomeActive(_ application: UIApplication) {\n\t\t// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n\t}\n\n\tfunc applicationWillTerminate(_ application: UIApplication) {\n\t\t// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n\t}\n\n\n}\n\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"83.5x83.5\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"19529\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <device id=\"retina4_7\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"19519\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"CvM-TG-8Pa\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"W6U-NP-Zhk\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <viewLayoutGuide key=\"safeArea\" id=\"2Ln-re-bR8\"/>\n                        <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"19529\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"BYZ-38-t0r\">\n    <device id=\"retina4_7\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"19519\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"tne-QT-ifu\">\n            <objects>\n                <viewController id=\"BYZ-38-t0r\" customClass=\"ViewController\" customModule=\"SwiftExample\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"yMg-FV-pMC\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"mCB-KU-pLF\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <viewLayoutGuide key=\"safeArea\" id=\"vEN-g2-oSq\"/>\n                        <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"34\" y=\"111\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample/ViewController.swift",
    "content": "//\n//  ViewController.swift\n//  SwiftExample\n//\n//  Created by Leo Natan (Wix) on 30/07/2017.\n//  Copyright © 2017 Leo Natan (Wix). All rights reserved.\n//\n\nimport UIKit\n\nclass ViewController: UIViewController {\n\n\toverride func viewDidLoad() {\n\t\tsuper.viewDidLoad()\n\t\t// Do any additional setup after loading the view, typically from a nib.\n\t}\n\n\toverride func didReceiveMemoryWarning() {\n\t\tsuper.didReceiveMemoryWarning()\n\t\t// Dispose of any resources that can be recreated.\n\t}\n\n\n}\n\n"
  },
  {
    "path": "examples/SwiftExample/SwiftExample.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 48;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t391679021F2D912E00066398 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391679011F2D912E00066398 /* AppDelegate.swift */; };\n\t\t391679041F2D912E00066398 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391679031F2D912E00066398 /* ViewController.swift */; };\n\t\t391679071F2D912E00066398 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 391679051F2D912E00066398 /* Main.storyboard */; };\n\t\t391679091F2D912E00066398 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 391679081F2D912E00066398 /* Assets.xcassets */; };\n\t\t3916790C1F2D912E00066398 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3916790A1F2D912E00066398 /* LaunchScreen.storyboard */; };\n\t\t391679151F2D914700066398 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391679031F2D912E00066398 /* ViewController.swift */; };\n\t\t391679161F2D914700066398 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391679011F2D912E00066398 /* AppDelegate.swift */; };\n\t\t391679191F2D914700066398 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3916790A1F2D912E00066398 /* LaunchScreen.storyboard */; };\n\t\t3916791A1F2D914700066398 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 391679081F2D912E00066398 /* Assets.xcassets */; };\n\t\t3916791B1F2D914700066398 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 391679051F2D912E00066398 /* Main.storyboard */; };\n\t\t399522251F2D94DE00550710 /* Detox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 399522221F2D94CB00550710 /* Detox.framework */; };\n\t\t399522261F2D94DE00550710 /* Detox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 399522221F2D94CB00550710 /* Detox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t399522211F2D94CB00550710 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 399522191F2D94CB00550710 /* Detox.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 394767971DBF985400D72256;\n\t\t\tremoteInfo = Detox;\n\t\t};\n\t\t399522231F2D94CB00550710 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 399522191F2D94CB00550710 /* Detox.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3928EFA51E47404900C19B6E;\n\t\t\tremoteInfo = DetoxUserNotificationTests;\n\t\t};\n\t\t399522271F2D94DE00550710 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 399522191F2D94CB00550710 /* Detox.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 394767961DBF985400D72256;\n\t\t\tremoteInfo = Detox;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t399522291F2D94DF00550710 /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t\t399522261F2D94DE00550710 /* Detox.framework in Embed Frameworks */,\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t391678FE1F2D912E00066398 /* SwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t391679011F2D912E00066398 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t391679031F2D912E00066398 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = \"<group>\"; };\n\t\t391679061F2D912E00066398 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t391679081F2D912E00066398 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t3916790B1F2D912E00066398 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t3916790D1F2D912E00066398 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t3916791F1F2D914700066398 /* SwiftExampleWithLocalDetox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExampleWithLocalDetox.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t399522191F2D94CB00550710 /* Detox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = Detox.xcodeproj; path = ../../detox/ios/Detox.xcodeproj; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t391678FB1F2D912E00066398 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t391679171F2D914700066398 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t399522251F2D94DE00550710 /* Detox.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t391678F51F2D912E00066398 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t399522191F2D94CB00550710 /* Detox.xcodeproj */,\n\t\t\t\t391679001F2D912E00066398 /* SwiftExample */,\n\t\t\t\t391678FF1F2D912E00066398 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t391678FF1F2D912E00066398 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t391678FE1F2D912E00066398 /* SwiftExample.app */,\n\t\t\t\t3916791F1F2D914700066398 /* SwiftExampleWithLocalDetox.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t391679001F2D912E00066398 /* SwiftExample */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t391679011F2D912E00066398 /* AppDelegate.swift */,\n\t\t\t\t391679031F2D912E00066398 /* ViewController.swift */,\n\t\t\t\t391679051F2D912E00066398 /* Main.storyboard */,\n\t\t\t\t391679081F2D912E00066398 /* Assets.xcassets */,\n\t\t\t\t3916790A1F2D912E00066398 /* LaunchScreen.storyboard */,\n\t\t\t\t3916790D1F2D912E00066398 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = SwiftExample;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3995221A1F2D94CB00550710 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t399522221F2D94CB00550710 /* Detox.framework */,\n\t\t\t\t399522241F2D94CB00550710 /* DetoxUserNotificationTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t391678FD1F2D912E00066398 /* SwiftExample */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 391679101F2D912E00066398 /* Build configuration list for PBXNativeTarget \"SwiftExample\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t391678FA1F2D912E00066398 /* Sources */,\n\t\t\t\t391678FB1F2D912E00066398 /* Frameworks */,\n\t\t\t\t391678FC1F2D912E00066398 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = SwiftExample;\n\t\t\tproductName = SwiftExample;\n\t\t\tproductReference = 391678FE1F2D912E00066398 /* SwiftExample.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t391679131F2D914700066398 /* SwiftExampleWithLocalDetox */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3916791C1F2D914700066398 /* Build configuration list for PBXNativeTarget \"SwiftExampleWithLocalDetox\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t391679141F2D914700066398 /* Sources */,\n\t\t\t\t391679171F2D914700066398 /* Frameworks */,\n\t\t\t\t391679181F2D914700066398 /* Resources */,\n\t\t\t\t399522291F2D94DF00550710 /* Embed Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t399522281F2D94DE00550710 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = SwiftExampleWithLocalDetox;\n\t\t\tproductName = SwiftExample;\n\t\t\tproductReference = 3916791F1F2D914700066398 /* SwiftExampleWithLocalDetox.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t391678F61F2D912E00066398 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 0900;\n\t\t\t\tLastUpgradeCheck = 0900;\n\t\t\t\tORGANIZATIONNAME = \"Leo Natan (Wix)\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t391678FD1F2D912E00066398 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 9.0;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 391678F91F2D912E00066398 /* Build configuration list for PBXProject \"SwiftExample\" */;\n\t\t\tcompatibilityVersion = \"Xcode 8.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 391678F51F2D912E00066398;\n\t\t\tproductRefGroup = 391678FF1F2D912E00066398 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 3995221A1F2D94CB00550710 /* Products */;\n\t\t\t\t\tProjectRef = 399522191F2D94CB00550710 /* Detox.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t391678FD1F2D912E00066398 /* SwiftExample */,\n\t\t\t\t391679131F2D914700066398 /* SwiftExampleWithLocalDetox */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t399522221F2D94CB00550710 /* Detox.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = Detox.framework;\n\t\t\tremoteRef = 399522211F2D94CB00550710 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t399522241F2D94CB00550710 /* DetoxUserNotificationTests.xctest */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.cfbundle;\n\t\t\tpath = DetoxUserNotificationTests.xctest;\n\t\t\tremoteRef = 399522231F2D94CB00550710 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t391678FC1F2D912E00066398 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3916790C1F2D912E00066398 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t391679091F2D912E00066398 /* Assets.xcassets in Resources */,\n\t\t\t\t391679071F2D912E00066398 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t391679181F2D914700066398 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t391679191F2D914700066398 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t3916791A1F2D914700066398 /* Assets.xcassets in Resources */,\n\t\t\t\t3916791B1F2D914700066398 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t391678FA1F2D912E00066398 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t391679041F2D912E00066398 /* ViewController.swift in Sources */,\n\t\t\t\t391679021F2D912E00066398 /* AppDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t391679141F2D914700066398 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t391679151F2D914700066398 /* ViewController.swift in Sources */,\n\t\t\t\t391679161F2D914700066398 /* AppDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t399522281F2D94DE00550710 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = Detox;\n\t\t\ttargetProxy = 399522271F2D94DE00550710 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t391679051F2D912E00066398 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t391679061F2D912E00066398 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3916790A1F2D912E00066398 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t3916790B1F2D912E00066398 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t3916790E1F2D912E00066398 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 10.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3916790F1F2D912E00066398 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 10.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Owholemodule\";\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t391679111F2D912E00066398 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = SwiftExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.SwiftExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t391679121F2D912E00066398 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = SwiftExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.SwiftExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3916791D1F2D914700066398 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = SwiftExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.SwiftExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3916791E1F2D914700066398 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = SwiftExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.SwiftExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t391678F91F2D912E00066398 /* Build configuration list for PBXProject \"SwiftExample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3916790E1F2D912E00066398 /* Debug */,\n\t\t\t\t3916790F1F2D912E00066398 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t391679101F2D912E00066398 /* Build configuration list for PBXNativeTarget \"SwiftExample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t391679111F2D912E00066398 /* Debug */,\n\t\t\t\t391679121F2D912E00066398 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3916791C1F2D914700066398 /* Build configuration list for PBXNativeTarget \"SwiftExampleWithLocalDetox\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3916791D1F2D914700066398 /* Debug */,\n\t\t\t\t3916791E1F2D914700066398 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 391678F61F2D912E00066398 /* Project object */;\n}\n"
  },
  {
    "path": "examples/demo-native-android/README.md",
    "content": "# Native Android Demo Project\n\nThis example project is broken and unmaintained indefinitely.\n"
  },
  {
    "path": "examples/demo-native-android/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.3\"\n    defaultConfig {\n        applicationId \"com.detox.example.detoxexample\"\n        minSdkVersion 16\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    packagingOptions {\n        exclude 'META-INF/DEPENDENCIES.txt'\n        exclude 'META-INF/LICENSE.txt'\n        exclude 'META-INF/NOTICE.txt'\n        exclude 'META-INF/NOTICE'\n        exclude 'META-INF/LICENSE'\n        exclude 'META-INF/DEPENDENCIES'\n        exclude 'META-INF/notice.txt'\n        exclude 'META-INF/license.txt'\n        exclude 'META-INF/dependencies.txt'\n        exclude 'META-INF/LGPL2.1'\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:23.4.0'\n    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support.test:runner:0.5'\n    compile project(':detox')\n    compile project(':invoke')\n    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n}\n"
  },
  {
    "path": "examples/demo-native-android/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/rotemm/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "examples/demo-native-android/app/src/androidTest/java/com/detox/example/detoxexample/ExampleInstrumentedTest.java",
    "content": "package com.detox.example.detoxexample;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.detox.example.detoxexample\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "examples/demo-native-android/app/src/androidTest/java/com/detox/example/detoxexample/MainActivityTest.java",
    "content": "package com.detox.example.detoxexample;\n\n\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\nimport android.test.suitebuilder.annotation.LargeTest;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.action.ViewActions.click;\nimport static android.support.test.espresso.assertion.ViewAssertions.matches;\nimport static android.support.test.espresso.matcher.ViewMatchers.withId;\nimport static android.support.test.espresso.matcher.ViewMatchers.withText;\n\n@LargeTest\n@RunWith(AndroidJUnit4.class)\npublic class MainActivityTest {\n\n    @Rule\n    public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);\n\n    @Test\n    public void helloButtonSaysHello() {\n        clickAndCheck(R.id.helloButton, \"Hello!!!\");\n    }\n\n    @Test\n    public void worldButtonSaysWorld() {\n        clickAndCheck(R.id.worldButton, \"World!!!\");\n    }\n\n    private void clickAndCheck(int buttonId, String text) {\n        onView(withId(buttonId)).perform(click());\n        onView(withId(R.id.textView)).check(matches(withText(text)));\n    }\n}\n"
  },
  {
    "path": "examples/demo-native-android/app/src/androidTest/java/com/detox/example/detoxexample/MainActivityTest2.java",
    "content": "package com.detox.example.detoxexample;\n\n\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\nimport android.test.suitebuilder.annotation.LargeTest;\n\nimport com.wix.detox.DetoxManager;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n@LargeTest\n@RunWith(AndroidJUnit4.class)\npublic class MainActivityTest2 {\n\n    @Rule\n    public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);\n\n    @Test\n    public void mainActivityTest2() {\n        DetoxManager manager = new DetoxManager();\n    }\n\n}\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.detox.example.detoxexample\"\n          xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "examples/demo-native-android/app/src/main/java/com/detox/example/detoxexample/MainActivity.java",
    "content": "package com.detox.example.detoxexample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.TextView;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private TextView mTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_test);\n        Button helloButton = (Button) findViewById(R.id.helloButton);\n        Button worldButton = (Button) findViewById(R.id.worldButton);\n        mTextView = (TextView) findViewById(R.id.textView);\n\n        setOnClickListener(helloButton, getString(R.string.hello));\n        setOnClickListener(worldButton, getString(R.string.world));\n    }\n\n    private void setOnClickListener(final Button button, final String text) {\n        button.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                mTextView.setText(text);\n            }\n        });\n    }\n}"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/layout/activity_test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.constraint.ConstraintLayout\n    android:id=\"@+id/activity_test\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.detox.example.detoxexample.MainActivity\">\n\n    <TextView\n        android:text=\"@string/welcome\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/textView\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"18sp\"\n        app:layout_constraintCenterY_toCenterY=\"@id/activity_test\"\n        app:layout_constraintCenterX_toCenterX=\"@id/activity_test\"\n        app:layout_constraintLeft_toLeftOf=\"@+id/activity_test\"\n        app:layout_constraintTop_toTopOf=\"@+id/activity_test\"\n        app:layout_constraintRight_toRightOf=\"@+id/activity_test\"\n        app:layout_constraintBottom_toBottomOf=\"@+id/activity_test\"\n        app:layout_constraintVertical_bias=\"0.39\"/>\n\n    <Button\n        android:text=\"@string/say_hello\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/helloButton\"\n        app:layout_constraintCenterX_toCenterX=\"@+id/textView\"\n        app:layout_constraintLeft_toLeftOf=\"@+id/textView\"\n        app:layout_constraintTop_toBottomOf=\"@+id/textView\"\n        android:layout_marginTop=\"24dp\"\n        app:layout_constraintRight_toRightOf=\"@+id/textView\"/>\n\n    <Button\n        android:text=\"@string/say_world\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/worldButton\"\n        app:layout_constraintCenterX_toCenterX=\"@+id/textView\"\n        app:layout_constraintLeft_toLeftOf=\"@+id/textView\"\n        app:layout_constraintTop_toBottomOf=\"@+id/helloButton\"\n        android:layout_marginTop=\"24dp\"\n        app:layout_constraintRight_toRightOf=\"@+id/textView\"/>\n\n</android.support.constraint.ConstraintLayout>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Detox Example</string>\n    <string name=\"welcome\">Welcome</string>\n    <string name=\"say_hello\">Say Hello</string>\n    <string name=\"say_world\">Say World</string>\n    <string name=\"hello\">Hello!!!</string>\n    <string name=\"world\">World!!!</string>\n</resources>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "examples/demo-native-android/app/src/test/java/com/detox/example/detoxexample/ExampleUnitTest.java",
    "content": "package com.detox.example.detoxexample;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "examples/demo-native-android/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.4.1'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "examples/demo-native-android/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sun Sep 15 23:01:02 IDT 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-all.zip\n"
  },
  {
    "path": "examples/demo-native-android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\nandroid.enableR8=false\n"
  },
  {
    "path": "examples/demo-native-android/gradlew",
    "content": "#!/usr/bin/env bash\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "examples/demo-native-android/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "examples/demo-native-android/package.json",
    "content": "{\n  \"name\": \"detox-demo-native-android\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"packager\": \"react-native start\",\n    \"detox-server\": \"detox run-server\"\n  },\n  \"devDependencies\": {\n    \"detox\": \"workspace:*\"\n  },\n  \"detox\": {}\n}\n"
  },
  {
    "path": "examples/demo-native-android/settings.gradle",
    "content": "include ':app'\n\ninclude ':detox'\nproject(':detox').projectDir = new File(rootProject.projectDir, '../detox/android/detox/')\n\ninclude ':invoke'\nproject(':invoke').projectDir = new File(rootProject.projectDir, '../detox/node_modules/react-native-invoke/android/invoke')\n"
  },
  {
    "path": "examples/demo-native-ios/.gitignore",
    "content": "####\n# Webstrom\n\n.idea\nnode_modules/\nnpm-debug.log\n.log\n\n# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/AppDelegate.h",
    "content": "//\n//  AppDelegate.h\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) UIWindow *window;\n\n\n@end\n\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/AppDelegate.m",
    "content": "//\n//  AppDelegate.m\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import \"AppDelegate.h\"\n\n@interface AppDelegate ()\n\n@end\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n    return YES;\n}\n\n@end\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"8150\" systemVersion=\"15A204g\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"8122\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <animations/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/GreetingViewController.h",
    "content": "//\n//  GreetingViewController.h\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface GreetingViewController : UIViewController\n\n@property NSString *greeting;\n@property (weak, nonatomic) IBOutlet UILabel *greetingLabel;\n\n@end\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/GreetingViewController.m",
    "content": "//\n//  GreetingViewController.m\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import \"GreetingViewController.h\"\n\n@implementation GreetingViewController\n\n-(void)viewWillAppear:(BOOL)animated {\n    if (self.greeting != nil) {\n        self.greetingLabel.text = self.greeting;\n    }\n}\n\n@end\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"10116\" systemVersion=\"15F34\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" initialViewController=\"2XP-G2-4XH\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"10085\"/>\n        <capability name=\"Constraints to layout margins\" minToolsVersion=\"6.0\"/>\n    </dependencies>\n    <scenes>\n        <!--Native Example-->\n        <scene sceneID=\"GPi-en-VeY\">\n            <objects>\n                <navigationController title=\"Native Example\" id=\"2XP-G2-4XH\" sceneMemberID=\"viewController\">\n                    <navigationBar key=\"navigationBar\" contentMode=\"scaleToFill\" id=\"4rk-y3-lg5\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"44\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </navigationBar>\n                    <connections>\n                        <segue destination=\"nDg-vi-mtZ\" kind=\"relationship\" relationship=\"rootViewController\" id=\"B2Y-Sh-cSt\"/>\n                    </connections>\n                </navigationController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dbW-uA-mFb\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"161\" y=\"617\"/>\n        </scene>\n        <!--Native Example-->\n        <scene sceneID=\"33n-VQ-hws\">\n            <objects>\n                <viewController id=\"nDg-vi-mtZ\" customClass=\"ViewController\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"W5Q-u5-Be6\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"L8k-fn-6SM\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"o5Q-je-cVN\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" misplaced=\"YES\" text=\"Welcome\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"rGT-re-uYz\">\n                                <rect key=\"frame\" x=\"125\" y=\"273\" width=\"71\" height=\"21\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" misplaced=\"YES\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"308-Gd-UE9\">\n                                <rect key=\"frame\" x=\"126\" y=\"372\" width=\"70\" height=\"30\"/>\n                                <accessibility key=\"accessibilityConfiguration\">\n                                    <bool key=\"isElement\" value=\"NO\"/>\n                                </accessibility>\n                                <state key=\"normal\" title=\"Say World\"/>\n                                <connections>\n                                    <segue destination=\"Tci-mD-G01\" kind=\"push\" identifier=\"worldSegue\" id=\"K8n-t2-OIO\"/>\n                                </connections>\n                            </button>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" misplaced=\"YES\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"dU6-iU-98h\">\n                                <rect key=\"frame\" x=\"128\" y=\"334\" width=\"64\" height=\"30\"/>\n                                <accessibility key=\"accessibilityConfiguration\">\n                                    <bool key=\"isElement\" value=\"NO\"/>\n                                </accessibility>\n                                <state key=\"normal\" title=\"Say Hello\"/>\n                                <connections>\n                                    <segue destination=\"Tci-mD-G01\" kind=\"push\" identifier=\"helloSegue\" id=\"pF8-Qm-Gqs\"/>\n                                </connections>\n                            </button>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstItem=\"dU6-iU-98h\" firstAttribute=\"top\" secondItem=\"rGT-re-uYz\" secondAttribute=\"bottom\" constant=\"40\" id=\"7Zt-6R-WJ2\"/>\n                            <constraint firstAttribute=\"trailingMargin\" secondItem=\"308-Gd-UE9\" secondAttribute=\"trailing\" constant=\"106\" id=\"7s2-Zv-12w\"/>\n                            <constraint firstItem=\"rGT-re-uYz\" firstAttribute=\"top\" secondItem=\"W5Q-u5-Be6\" secondAttribute=\"bottom\" constant=\"209\" id=\"Bt1-g1-bmY\"/>\n                            <constraint firstAttribute=\"trailingMargin\" secondItem=\"dU6-iU-98h\" secondAttribute=\"trailing\" constant=\"109\" id=\"D6n-by-xoX\"/>\n                            <constraint firstItem=\"308-Gd-UE9\" firstAttribute=\"leading\" secondItem=\"o5Q-je-cVN\" secondAttribute=\"leadingMargin\" constant=\"107\" id=\"I5f-2c-aLP\"/>\n                            <constraint firstItem=\"308-Gd-UE9\" firstAttribute=\"top\" secondItem=\"dU6-iU-98h\" secondAttribute=\"bottom\" constant=\"8\" id=\"iGN-gF-HUe\"/>\n                            <constraint firstItem=\"rGT-re-uYz\" firstAttribute=\"leading\" secondItem=\"o5Q-je-cVN\" secondAttribute=\"leadingMargin\" constant=\"102\" id=\"ogE-kk-wgy\"/>\n                            <constraint firstAttribute=\"trailingMargin\" secondItem=\"rGT-re-uYz\" secondAttribute=\"trailing\" constant=\"102\" id=\"pI4-Ks-FMi\"/>\n                            <constraint firstItem=\"dU6-iU-98h\" firstAttribute=\"leading\" secondItem=\"o5Q-je-cVN\" secondAttribute=\"leadingMargin\" constant=\"109\" id=\"zFh-Sm-xlx\"/>\n                        </constraints>\n                    </view>\n                    <navigationItem key=\"navigationItem\" title=\"Native Example\" id=\"JzI-d5-Ov9\"/>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"7Jj-7U-brS\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"524\" y=\"617\"/>\n        </scene>\n        <!--Greeting View Controller-->\n        <scene sceneID=\"H9z-O3-A5L\">\n            <objects>\n                <viewController id=\"Tci-mD-G01\" customClass=\"GreetingViewController\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"yvE-4V-jBr\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"g0T-s9-WRT\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"7cl-Uy-705\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" misplaced=\"YES\" text=\"\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"eVI-1a-9ug\">\n                                <rect key=\"frame\" x=\"101\" y=\"269\" width=\"119\" height=\"30\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstItem=\"eVI-1a-9ug\" firstAttribute=\"top\" secondItem=\"yvE-4V-jBr\" secondAttribute=\"bottom\" constant=\"205\" id=\"NFa-zF-r22\"/>\n                            <constraint firstAttribute=\"trailingMargin\" secondItem=\"eVI-1a-9ug\" secondAttribute=\"trailing\" constant=\"80\" id=\"OQu-tt-HM3\"/>\n                            <constraint firstItem=\"g0T-s9-WRT\" firstAttribute=\"top\" secondItem=\"eVI-1a-9ug\" secondAttribute=\"bottom\" constant=\"269\" id=\"VxZ-CF-aO6\"/>\n                            <constraint firstItem=\"eVI-1a-9ug\" firstAttribute=\"leading\" secondItem=\"7cl-Uy-705\" secondAttribute=\"leadingMargin\" constant=\"81\" id=\"btf-Iw-WFN\"/>\n                        </constraints>\n                    </view>\n                    <navigationItem key=\"navigationItem\" id=\"ma1-ye-9Oi\"/>\n                    <connections>\n                        <outlet property=\"greetingLabel\" destination=\"eVI-1a-9ug\" id=\"vuO-wZ-by2\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"AWL-3r-eRq\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"886\" y=\"617\"/>\n        </scene>\n    </scenes>\n    <inferredMetricsTieBreakers>\n        <segue reference=\"K8n-t2-OIO\"/>\n    </inferredMetricsTieBreakers>\n</document>\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/ViewController.h",
    "content": "//\n//  ViewController.h\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface ViewController : UIViewController\n\n@end\n\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/ViewController.m",
    "content": "//\n//  ViewController.m\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import \"ViewController.h\"\n#import \"GreetingViewController.h\"\n\n@interface ViewController () {\n}\n        \n@end\n@implementation ViewController\n\n    - (void)viewDidLoad {\n        [super viewDidLoad];\n    }\n\n    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {\n        GreetingViewController *vc = segue.destinationViewController;\n        if ([segue.identifier  isEqual: @\"helloSegue\"]) {\n            vc.greeting = @\"Hello!!!\";\n        }\n        else if ([segue.identifier  isEqual: @\"worldSegue\"]) {\n            vc.greeting = @\"World!!!\";\n        }\n    }\n\n    - (void)didReceiveMemoryWarning {\n        [super didReceiveMemoryWarning];\n    }\n\n@end\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample/main.m",
    "content": "//\n//  main.m\n//  NativeExample\n//\n//  Created by Etgar Shmueli on 31/07/2016.\n//  Copyright © 2016 Etgar Shmueli. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n#import \"AppDelegate.h\"\n\nint main(int argc, char * argv[]) {\n    @autoreleasepool {\n        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n    }\n}\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t4BD3FEB61D4E1F5E005AEE71 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD3FEB51D4E1F5E005AEE71 /* main.m */; };\n\t\t4BD3FEB91D4E1F5E005AEE71 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD3FEB81D4E1F5E005AEE71 /* AppDelegate.m */; };\n\t\t4BD3FEBC1D4E1F5E005AEE71 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD3FEBB1D4E1F5E005AEE71 /* ViewController.m */; };\n\t\t4BD3FEC11D4E1F5E005AEE71 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BD3FEC01D4E1F5E005AEE71 /* Assets.xcassets */; };\n\t\t4BD3FEC41D4E1F5E005AEE71 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BD3FEC21D4E1F5E005AEE71 /* LaunchScreen.storyboard */; };\n\t\t4BD3FECC1D4E1FBA005AEE71 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BD3FECB1D4E1FBA005AEE71 /* Main.storyboard */; };\n\t\t4BD3FED01D4E2000005AEE71 /* GreetingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD3FECF1D4E2000005AEE71 /* GreetingViewController.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t4BD3FED81D4E275D005AEE71 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 4BD3FED31D4E275D005AEE71 /* Detox.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = CCE6D4371D11A76500F81E39;\n\t\t\tremoteInfo = Detox;\n\t\t};\n\t\t4BD3FEDA1D4E276C005AEE71 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 4BD3FED31D4E275D005AEE71 /* Detox.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = CCE6D4361D11A76500F81E39;\n\t\t\tremoteInfo = Detox;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t4BD3FEB11D4E1F5E005AEE71 /* NativeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NativeExample.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t4BD3FEB51D4E1F5E005AEE71 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t4BD3FEB71D4E1F5E005AEE71 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t4BD3FEB81D4E1F5E005AEE71 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t4BD3FEBA1D4E1F5E005AEE71 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = \"<group>\"; };\n\t\t4BD3FEBB1D4E1F5E005AEE71 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = \"<group>\"; };\n\t\t4BD3FEC01D4E1F5E005AEE71 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t4BD3FEC31D4E1F5E005AEE71 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t4BD3FEC51D4E1F5E005AEE71 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t4BD3FECB1D4E1FBA005AEE71 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = \"<group>\"; };\n\t\t4BD3FECE1D4E2000005AEE71 /* GreetingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GreetingViewController.h; sourceTree = \"<group>\"; };\n\t\t4BD3FECF1D4E2000005AEE71 /* GreetingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GreetingViewController.m; sourceTree = \"<group>\"; };\n\t\t4BD3FED31D4E275D005AEE71 /* Detox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = Detox.xcodeproj; path = ../node_modules/detox/ios/Detox.xcodeproj; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t4BD3FEAE1D4E1F5E005AEE71 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t4BD3FEA81D4E1F5E005AEE71 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FEB31D4E1F5E005AEE71 /* NativeExample */,\n\t\t\t\tCC330DC01D528918008292A2 /* Frameworks */,\n\t\t\t\t4BD3FEB21D4E1F5E005AEE71 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4BD3FEB21D4E1F5E005AEE71 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FEB11D4E1F5E005AEE71 /* NativeExample.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4BD3FEB31D4E1F5E005AEE71 /* NativeExample */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FECD1D4E1FDB005AEE71 /* VC */,\n\t\t\t\t4BD3FECB1D4E1FBA005AEE71 /* Main.storyboard */,\n\t\t\t\t4BD3FEB71D4E1F5E005AEE71 /* AppDelegate.h */,\n\t\t\t\t4BD3FEB81D4E1F5E005AEE71 /* AppDelegate.m */,\n\t\t\t\t4BD3FEBA1D4E1F5E005AEE71 /* ViewController.h */,\n\t\t\t\t4BD3FEBB1D4E1F5E005AEE71 /* ViewController.m */,\n\t\t\t\t4BD3FEC01D4E1F5E005AEE71 /* Assets.xcassets */,\n\t\t\t\t4BD3FEC21D4E1F5E005AEE71 /* LaunchScreen.storyboard */,\n\t\t\t\t4BD3FEC51D4E1F5E005AEE71 /* Info.plist */,\n\t\t\t\t4BD3FEB41D4E1F5E005AEE71 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = NativeExample;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4BD3FEB41D4E1F5E005AEE71 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FEB51D4E1F5E005AEE71 /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4BD3FECD1D4E1FDB005AEE71 /* VC */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FECE1D4E2000005AEE71 /* GreetingViewController.h */,\n\t\t\t\t4BD3FECF1D4E2000005AEE71 /* GreetingViewController.m */,\n\t\t\t);\n\t\t\tname = VC;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4BD3FED41D4E275D005AEE71 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FED91D4E275D005AEE71 /* Detox.framework */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tCC330DC01D528918008292A2 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FED31D4E275D005AEE71 /* Detox.xcodeproj */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t4BD3FEB01D4E1F5E005AEE71 /* NativeExample */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 4BD3FEC81D4E1F5E005AEE71 /* Build configuration list for PBXNativeTarget \"NativeExample\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t4BD3FEAD1D4E1F5E005AEE71 /* Sources */,\n\t\t\t\t4BD3FEAF1D4E1F5E005AEE71 /* Resources */,\n\t\t\t\t4BD3FEAE1D4E1F5E005AEE71 /* Frameworks */,\n\t\t\t\tA961A165846150F99DD9FEDC /* Copy Detox Framework */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t4BD3FEDB1D4E276C005AEE71 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = NativeExample;\n\t\t\tproductName = NativeExample;\n\t\t\tproductReference = 4BD3FEB11D4E1F5E005AEE71 /* NativeExample.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t4BD3FEA91D4E1F5E005AEE71 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = \"Etgar Shmueli\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t4BD3FEB01D4E1F5E005AEE71 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 4BD3FEAC1D4E1F5E005AEE71 /* Build configuration list for PBXProject \"NativeExample\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 4BD3FEA81D4E1F5E005AEE71;\n\t\t\tproductRefGroup = 4BD3FEB21D4E1F5E005AEE71 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 4BD3FED41D4E275D005AEE71 /* Products */;\n\t\t\t\t\tProjectRef = 4BD3FED31D4E275D005AEE71 /* Detox.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t4BD3FEB01D4E1F5E005AEE71 /* NativeExample */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t4BD3FED91D4E275D005AEE71 /* Detox.framework */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = wrapper.framework;\n\t\t\tpath = Detox.framework;\n\t\t\tremoteRef = 4BD3FED81D4E275D005AEE71 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t4BD3FEAF1D4E1F5E005AEE71 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t4BD3FECC1D4E1FBA005AEE71 /* Main.storyboard in Resources */,\n\t\t\t\t4BD3FEC41D4E1F5E005AEE71 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t4BD3FEC11D4E1F5E005AEE71 /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\tA961A165846150F99DD9FEDC /* Copy Detox Framework */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Copy Detox Framework\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/bash;\n\t\t\tshellScript = \"if [ -n \\\"$DEPLOY_DETOX_FRAMEWORK\\\" ]; then\\nmkdir -p \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\ncp -r \\\"${PROJECT_DIR}\\\"/node_modules/detox/Detox.framework \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\nfi\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t4BD3FEAD1D4E1F5E005AEE71 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t4BD3FEBC1D4E1F5E005AEE71 /* ViewController.m in Sources */,\n\t\t\t\t4BD3FEB91D4E1F5E005AEE71 /* AppDelegate.m in Sources */,\n\t\t\t\t4BD3FEB61D4E1F5E005AEE71 /* main.m in Sources */,\n\t\t\t\t4BD3FED01D4E2000005AEE71 /* GreetingViewController.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t4BD3FEDB1D4E276C005AEE71 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = Detox;\n\t\t\ttargetProxy = 4BD3FEDA1D4E276C005AEE71 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t4BD3FEC21D4E1F5E005AEE71 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t4BD3FEC31D4E1F5E005AEE71 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t4BD3FEC61D4E1F5E005AEE71 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.3;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t4BD3FEC71D4E1F5E005AEE71 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.3;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t4BD3FEC91D4E1F5E005AEE71 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../node_modules/detox/ios/**\";\n\t\t\t\tINFOPLIST_FILE = NativeExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.native.ios;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t4BD3FECA1D4E1F5E005AEE71 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../node_modules/detox/ios/**\";\n\t\t\t\tINFOPLIST_FILE = NativeExample/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.native.ios;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t4BD3FEAC1D4E1F5E005AEE71 /* Build configuration list for PBXProject \"NativeExample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t4BD3FEC61D4E1F5E005AEE71 /* Debug */,\n\t\t\t\t4BD3FEC71D4E1F5E005AEE71 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t4BD3FEC81D4E1F5E005AEE71 /* Build configuration list for PBXNativeTarget \"NativeExample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t4BD3FEC91D4E1F5E005AEE71 /* Debug */,\n\t\t\t\t4BD3FECA1D4E1F5E005AEE71 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 4BD3FEA91D4E1F5E005AEE71 /* Project object */;\n}\n"
  },
  {
    "path": "examples/demo-native-ios/NativeExample.xcodeproj/xcshareddata/xcschemes/NativeExample.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"4BD3FEB01D4E1F5E005AEE71\"\n               BuildableName = \"NativeExample.app\"\n               BlueprintName = \"NativeExample\"\n               ReferencedContainer = \"container:NativeExample.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"4BD3FEB01D4E1F5E005AEE71\"\n            BuildableName = \"NativeExample.app\"\n            BlueprintName = \"NativeExample\"\n            ReferencedContainer = \"container:NativeExample.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"4BD3FEB01D4E1F5E005AEE71\"\n            BuildableName = \"NativeExample.app\"\n            BlueprintName = \"NativeExample\"\n            ReferencedContainer = \"container:NativeExample.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"4BD3FEB01D4E1F5E005AEE71\"\n            BuildableName = \"NativeExample.app\"\n            BlueprintName = \"NativeExample\"\n            ReferencedContainer = \"container:NativeExample.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "examples/demo-native-ios/README.md",
    "content": "# Pure Native iOS Demo Project\n\n## Environment\n\n**IMPORTANT:** Get your environment properly set up, as explained in our [contribution guide](https://wix.github.io/docs/contributing).\n\n## Step 1: Build the Demo Project\n\n- Build the demo project\n\n  ```sh\n  detox build --configuration ios.sim.release\n  ```\n\n## Step 2: Run the E2E Tests\n\n- Run tests on the demo project\n\n  ```sh\n  detox test --configuration ios.sim.release\n  ```\n\nThis action will open a new simulator and run the tests on it.\n"
  },
  {
    "path": "examples/demo-native-ios/package.json",
    "content": "{\n  \"name\": \"detox-demo-native-ios\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"detox\": \"workspace:*\"\n  },\n  \"detox\": {\n    \"specs\": \"\",\n    \"apps\": {\n      \"ios.debug\": {\n        \"type\": \"ios.app\",\n        \"binaryPath\": \"build/Build/Products/Debug-iphonesimulator/NativeExample.app\",\n        \"build\": \"xcodebuild -project NativeExample.xcodeproj -UseNewBuildSystem=NO -scheme NativeExample -configuration Debug -sdk iphonesimulator -derivedDataPath build\"\n      },\n      \"ios.release\": {\n        \"type\": \"ios.app\",\n        \"binaryPath\": \"build/Build/Products/Release-iphonesimulator/NativeExample.app\",\n        \"build\": \"xcodebuild -project NativeExample.xcodeproj -UseNewBuildSystem=NO -scheme NativeExample -configuration Release -sdk iphonesimulator -derivedDataPath build\"\n      }\n    },\n    \"devices\": {\n      \"simulator\": {\n        \"type\": \"ios.simulator\",\n        \"device\": {\n          \"type\": \"iPhone 15 Pro Max\",\n          \"os\": \"17.0.1\"\n        }\n      }\n    },\n    \"configurations\": {\n      \"ios.sim.debug\": {\n        \"device\": \"simulator\",\n        \"app\": \"ios.release\"\n      },\n      \"ios.sim.release\": {\n        \"device\": \"simulator\",\n        \"app\": \"ios.debug\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "examples/demo-plugin/driver.js",
    "content": "const DeviceDriverBase = require('detox/src/devices/runtime/drivers/DeviceDriverBase');\nconst Client = require('detox/src/client/Client');\n\n//\n// The following is needed in order to make the various expect() API's work (e.g. element(), waitFor()).\n\nclass PluginExpect {\n  constructor({ invocationManager }) {\n    this._invocationManager = invocationManager;\n\n    this.by = {\n      accessibilityLabel: (value) => {},\n      label: (value) => {},\n      id: (value) => value,\n      type: (value) => {},\n      traits: (value) => {},\n      value: (value) => {},\n      text: (value) => {},\n    };\n\n    this.element = this.element.bind(this);\n    this.expect = this.expect.bind(this);\n    this.waitFor = this.waitFor.bind(this);\n  }\n\n  expect(element) {\n    return {\n      toBeVisible: () => {\n        if (!element) {\n          throw new Error(\"Expectation failed\");\n        }\n      }\n    }\n  }\n\n  element(matcher) {\n    return matcher === 'welcome';\n  }\n\n  waitFor(element) {\n  }\n}\n\n//\n// The following is needed in order to make the various device API's work (e.g. device.launchApp()).\n\nclass LoginApp {\n  constructor(sessionId) {\n    this.type = 'login';\n    this.params = { sessionId, role: 'app' };\n    this.messageId;\n  }\n  async handle(response) {\n    if (response.type !== 'loginSuccess') throw new Error('Unexpected response type');\n  }\n}\n\nclass PluginApp {\n  constructor(deps) {\n    this.configuration = deps.sessionConfig;\n    this.client = deps.client;\n  }\n\n  async connect() {\n    // NOTE: This is a sample way to handle events in a custom app client, but not needed\n    // for the test suite:\n    //\n    // const { Action } = require('detox/src/client/actions/actions');\n    // class PongAction extends Action {\n    //   constructor(messageId) {\n    //     super('ping', { messageId });\n    //   }\n    //\n    //   handle() {\n    //   }\n    // }\n    //\n    // this.client.setEventCallback('ping', async (json) => {\n    //   await this.client.sendAction(new PongAction(json.messageId));\n    // });\n  }\n}\n\nclass PluginDeviceAllocationDriver {\n  constructor(deps) {\n    this.emitter = deps.eventEmitter;\n  }\n\n  async allocate(deviceConfig) {\n    console.log('TODO Allocate an actual device here', deviceConfig.device);\n    return { id: 'device ID' };\n  }\n\n  async free(cookie, { shutdown }) {\n    console.log('TODO: Free up device and resources, here');\n\n    if (shutdown) {\n      await this.emitter.emit('beforeShutdownDevice', { deviceId: id });\n      await this.emitter.emit('shutdownDevice', { deviceId: id });\n    }\n  }\n}\n\nclass PluginEnvironmentValidator {\n  async validate() {\n    console.log('TODO: perform some validations');\n  }\n}\n\nclass PluginArtifactsProvider {\n  declareArtifactPlugins() {\n    console.log('TODO: Set up artifact generation handlers');\n    return {};\n  }\n}\n\nclass PluginRuntimeDriver extends DeviceDriverBase {\n  constructor(deps, cookie) {\n    super(deps);\n\n    this.cookie = cookie;\n    this.app = new PluginApp(deps);\n  }\n\n  getExternalId() {\n    return this.cookie.id;\n  }\n\n  getDeviceName() {\n    return 'Plugin'; // TODO\n  }\n\n  async launchApp(bundleId, launchArgs, languageAndLocale) {\n    const deviceId = this.cookie.id;\n\n    await this.emitter.emit('beforeLaunchApp', {\n      bundleId,\n      deviceId,\n      launchArgs,\n    });\n\n    const pid = 'PID';\n    await this.emitter.emit('launchApp', {\n      bundleId,\n      deviceId,\n      launchArgs,\n      pid,\n    });\n\n    return pid;\n  }\n\n  validateDeviceConfig(deviceConfig) {\n    this.deviceConfig = deviceConfig;\n\n    if (!this.deviceConfig.binaryPath) {\n      throw new Error(\n        \"'binaryPath' property is missing, should hold the app binary path:\\n\" +\n        JSON.stringify(deviceConfig, null, 2)\n      );\n    }\n  }\n\n  async waitUntilReady() {\n    await this.app.connect();\n  }\n}\n\nmodule.exports = {\n  ExpectClass: PluginExpect,\n  EnvironmentValidatorClass: PluginEnvironmentValidator,\n  ArtifactPluginsProviderClass: PluginArtifactsProvider,\n  DeviceAllocationDriverClass: PluginDeviceAllocationDriver,\n  RuntimeDriverClass: PluginRuntimeDriver,\n};\n"
  },
  {
    "path": "examples/demo-plugin/e2e/app-hello.test.js",
    "content": "describe('Example (hello)', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  it('should have welcome', async () => {\n    await expect(element(by.id('welcome'))).toBeVisible();\n  });\n\n  it('should not have unwelcome', async () => {\n    let success = true;\n    try {\n      await expect(element(by.id('unwelcome'))).toBeVisible();\n      success = false;\n    } catch (e) {}\n\n    if (!success) throw new Error(\"test failed\");\n  });\n});\n"
  },
  {
    "path": "examples/demo-plugin/e2e/config.json",
    "content": "{\n  \"maxWorkers\": 1,\n  \"globalSetup\": \"detox/runners/jest/globalSetup\",\n  \"globalTeardown\": \"detox/runners/jest/globalTeardown\",\n  \"testEnvironment\": \"detox/runners/jest/testEnvironment\",\n  \"testTimeout\": 120000,\n  \"testMatch\": [\"<rootDir>/*.test.js\"],\n  \"reporters\": [\"detox/runners/jest/reporter\"],\n  \"verbose\": true\n}\n"
  },
  {
    "path": "examples/demo-plugin/package.json",
    "content": "{\n  \"name\": \"demo-plugin\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"test:plugin\": \"detox test --configuration plugin -l verbose\"\n  },\n  \"devDependencies\": {\n    \"detox\": \"workspace:*\",\n    \"jest\": \"^30.0.3\"\n  },\n  \"detox\": {\n    \"testRunner\": {\n      \"args\": {\n        \"config\": \"e2e/config.json\"\n      }\n    },\n    \"configurations\": {\n      \"plugin\": {\n        \"device\": {\n          \"type\": \"./driver\",\n          \"binaryPath\": \"my/random/path\",\n          \"device\": {\n            \"foo\": \"bar\"\n          }\n        },\n        \"app\": {\n          \"name\": \"plugin-example\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.cxx\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/.gitignore",
    "content": "/build"
  },
  {
    "path": "examples/demo-pure-native-android/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\n\nandroid {\n    compileSdkVersion 30\n    buildToolsVersion \"30.0.2\"\n\n    buildFeatures {\n        viewBinding true\n    }\n\n    defaultConfig {\n        applicationId \"com.example.detox.purenative\"\n        minSdkVersion 21\n        targetSdkVersion 30\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = '1.8'\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version\"\n    implementation 'androidx.core:core-ktx:1.5.0'\n    implementation 'androidx.appcompat:appcompat:1.3.0'\n    implementation 'com.google.android.material:material:1.3.0'\n    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'\n    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'\n    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'\n    testImplementation 'junit:junit:4.13.2'\n    androidTestImplementation 'com.wix:detox:999.999.999'\n    androidTestImplementation 'com.google.truth:truth:1.1.3'\n}\n\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/androidTest/java/com/example/detox/purenative/SanityInstrumentationTest.kt",
    "content": "package com.example.detox.purenative\n\nimport android.view.View\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.assertion.ViewAssertions.matches\nimport androidx.test.espresso.matcher.ViewMatchers.*\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport androidx.test.rule.ActivityTestRule\nimport com.wix.detox.actions.DetoxViewActions\nimport org.hamcrest.CoreMatchers.not\nimport org.hamcrest.Matcher\nimport org.junit.Before\nimport org.junit.Rule\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nclass ListDriver {\n    val itemHeight: Double\n        get() = 64.0\n\n    fun listMatcher(): Matcher<View> = withId(R.id.actions_rvList)\n    fun itemMatcher(position: Int): Matcher<View> = withText(\"Item @ position #$position\")\n}\n\n@RunWith(AndroidJUnit4::class)\nclass SanityInstrumentationTest {\n    @get:Rule\n    val rule = ActivityTestRule(MainActivity::class.java, true, true)\n\n    private val driver = ListDriver()\n\n    @Before\n    fun beforeEach() {\n        onView(withId(R.id.main_button_actions)).perform(DetoxViewActions.tap())\n    }\n\n    @Test\n    fun testTapping() {\n        onView(withText(\"Actions Screen\")).check(matches(isCompletelyDisplayed()))\n    }\n\n    @Test\n    fun testSubtleScrollBy() {\n        onView(driver.itemMatcher(1)).check(matches(isCompletelyDisplayed()))\n        onView(driver.itemMatcher(5)).check(matches(not(isCompletelyDisplayed())))\n\n        onView(driver.listMatcher()).perform(DetoxViewActions.scrollDownBy(driver.itemHeight))\n        onView(driver.itemMatcher(1)).check(matches(not(isCompletelyDisplayed())))\n        onView(driver.itemMatcher(5)).check(matches(isCompletelyDisplayed()))\n\n        onView(driver.listMatcher()).perform(DetoxViewActions.scrollUpBy(driver.itemHeight))\n        onView(driver.itemMatcher(1)).check(matches(isCompletelyDisplayed()))\n        onView(driver.itemMatcher(5)).check(matches(not(isCompletelyDisplayed())))\n    }\n\n    @Test\n    fun testScrollBy() {\n        onView(driver.listMatcher()).perform(DetoxViewActions.scrollDownBy(driver.itemHeight * 11, 0.1f, 0.95f))\n        onView(driver.itemMatcher(14)).check(matches(isCompletelyDisplayed()))\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.detox.purenative\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity\n            android:name=\".MainActivity\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/java/com/example/detox/purenative/ActionsFragment.kt",
    "content": "package com.example.detox.purenative\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport androidx.fragment.app.Fragment\nimport androidx.recyclerview.widget.LinearLayoutManager\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * A simple [Fragment] subclass as the second destination in the navigation.\n */\nclass ActionsFragment : Fragment() {\n\n    override fun onCreateView(\n            inflater: LayoutInflater, container: ViewGroup?,\n            savedInstanceState: Bundle?\n    ): View? {\n        // Inflate the layout for this fragment\n        return inflater.inflate(R.layout.fragment_actions, container, false)\n    }\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n        super.onViewCreated(view, savedInstanceState)\n\n        view.findViewById<RecyclerView>(R.id.actions_rvList).also {\n            it.adapter = DetoxRVAdapter()\n            it.layoutManager = LinearLayoutManager(view.context, RecyclerView.VERTICAL, false)\n        }\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/java/com/example/detox/purenative/DetoxRVAdapter.kt",
    "content": "package com.example.detox.purenative\n\nimport android.view.LayoutInflater\nimport android.view.ViewGroup\nimport android.widget.TextView\nimport androidx.recyclerview.widget.RecyclerView\nimport androidx.recyclerview.widget.RecyclerView.Adapter\nimport com.example.detox.purenative.utils.RainbowColors\n\nprivate const val LIST_SIZE = 180\nprivate val colorsProvider = RainbowColors(LIST_SIZE)\n\nclass ListVH internal constructor(parent: ViewGroup)\n    : RecyclerView.ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.actions_rv_item, parent, false)) {\n\n    private val textView\n        get() = itemView.findViewById<TextView>(R.id.actions_rv_item_text)\n\n    fun bindTo(position: Int) {\n        with(textView) {\n            text = \"Item @ position #${position + 1}\"\n            setTextColor(colorsProvider.getColor(position))\n        }\n    }\n}\n\nclass DetoxRVAdapter : Adapter<ListVH>() {\n    override fun getItemCount() = LIST_SIZE\n    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ListVH(parent)\n    override fun onBindViewHolder(holder: ListVH, position: Int) {\n        holder.bindTo(position)\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/java/com/example/detox/purenative/MainActivity.kt",
    "content": "package com.example.detox.purenative\n\nimport android.os.Bundle\nimport android.view.Menu\nimport android.view.MenuItem\nimport androidx.appcompat.app.AppCompatActivity\n\nclass MainActivity: AppCompatActivity() {\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n        setSupportActionBar(findViewById(R.id.toolbar))\n    }\n\n    override fun onCreateOptionsMenu(menu: Menu): Boolean {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        menuInflater.inflate(R.menu.menu_main, menu)\n        return true\n    }\n\n    override fun onOptionsItemSelected(item: MenuItem): Boolean {\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        return when (item.itemId) {\n            R.id.action_settings -> true\n            else -> super.onOptionsItemSelected(item)\n        }\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/java/com/example/detox/purenative/MainFragment.kt",
    "content": "package com.example.detox.purenative\n\nimport android.os.Bundle\nimport androidx.fragment.app.Fragment\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport android.widget.Button\nimport androidx.navigation.fragment.findNavController\n\nclass MainFragment : Fragment() {\n    override fun onCreateView(\n            inflater: LayoutInflater,\n            container: ViewGroup?,\n            savedInstanceState: Bundle?,\n    ): View? = inflater.inflate(R.layout.fragment_main, container, false)\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n        super.onViewCreated(view, savedInstanceState)\n\n        view.findViewById<Button>(R.id.main_button_actions).setOnClickListener {\n            findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment)\n        }\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/java/com/example/detox/purenative/utils/RainbowColors.kt",
    "content": "package com.example.detox.purenative.utils\n\nimport android.graphics.Color\n\nclass RainbowColors(intervalsCount: Int) {\n    private val interval = 360.0 / (intervalsCount.toFloat())\n\n    fun getColor(position: Int): Int {\n        return Color.HSVToColor(floatArrayOf((interval * position).toFloat(), 1.0f, 1.0f))\n    }\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#3DDC84\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"85.84757\"\n                android:endY=\"92.4963\"\n                android:startX=\"42.9492\"\n                android:startY=\"49.59793\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/layout/actions_rv_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    >\n    <androidx.cardview.widget.CardView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:cardElevation=\"5dp\"\n        android:layout_marginVertical=\"8dp\"\n        android:layout_marginHorizontal=\"12dp\"\n        >\n        <TextView\n            android:id=\"@+id/actions_rv_item_text\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"start|center_vertical\"\n            android:padding=\"16dp\"\n            android:textSize=\"16sp\"\n            android:textColor=\"@color/colorPrimary\"\n            />\n    </androidx.cardview.widget.CardView>\n</FrameLayout>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\">\n\n    <com.google.android.material.appbar.AppBarLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:theme=\"@style/AppTheme.AppBarOverlay\">\n\n        <androidx.appcompat.widget.Toolbar\n            android:id=\"@+id/toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"?attr/actionBarSize\"\n            android:background=\"?attr/colorPrimary\"\n            app:popupTheme=\"@style/AppTheme.PopupOverlay\" />\n\n    </com.google.android.material.appbar.AppBarLayout>\n\n    <include layout=\"@layout/content_main\" />\n\n</androidx.coordinatorlayout.widget.CoordinatorLayout>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/layout/content_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\">\n\n    <fragment\n        android:id=\"@+id/nav_host_fragment\"\n        android:name=\"androidx.navigation.fragment.NavHostFragment\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"0dp\"\n        app:defaultNavHost=\"true\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        app:navGraph=\"@navigation/nav_graph\" />\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/layout/fragment_actions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".ActionsFragment\">\n\n    <androidx.recyclerview.widget.RecyclerView\n        android:id=\"@+id/actions_rvList\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        android:background=\"@android:color/transparent\"\n        app:layout_constraintHeight_percent=\".5\"\n        app:layout_constraintHeight_default=\"percent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        android:clipChildren=\"true\"\n        />\n\n    <TextView\n        android:id=\"@+id/textView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/actions_heading\"\n        app:layout_constraintBottom_toTopOf=\"@+id/actions_rvList\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        />\n\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/layout/fragment_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainFragment\">\n\n    <ImageView\n        android:id=\"@+id/main_logo\"\n        android:layout_width=\"77dp\"\n        android:layout_height=\"104dp\"\n        android:layout_marginTop=\"24dp\"\n        android:contentDescription=\"@string/main_logo__cd\"\n        android:src=\"@drawable/detox_logo\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintHorizontal_chainStyle=\"spread_inside\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n\n    <Button\n        android:id=\"@+id/main_button_actions\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/main_navto_actions\"\n        app:layout_constraintTop_toBottomOf=\"@id/main_logo\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintHorizontal_chainStyle=\"spread_inside\"\n        />\n\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/menu/menu_main.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.example.detox.purenative.MainActivity\">\n    <item\n        android:id=\"@+id/action_settings\"\n        android:orderInCategory=\"100\"\n        android:title=\"@string/action_settings\"\n        app:showAsAction=\"never\" />\n</menu>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/navigation/nav_graph.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<navigation xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/nav_graph\"\n    app:startDestination=\"@id/FirstFragment\">\n\n    <fragment\n        android:id=\"@+id/FirstFragment\"\n        android:name=\"com.example.detox.purenative.MainFragment\"\n        android:label=\"@string/first_fragment_label\"\n        tools:layout=\"@layout/fragment_main\">\n\n        <action\n            android:id=\"@+id/action_FirstFragment_to_SecondFragment\"\n            app:destination=\"@id/ActionsFragment\" />\n    </fragment>\n    <fragment\n        android:id=\"@+id/ActionsFragment\"\n        android:name=\"com.example.detox.purenative.ActionsFragment\"\n        android:label=\"@string/actions_fragment_label\"\n        tools:layout=\"@layout/fragment_actions\">\n\n        <action\n            android:id=\"@+id/action_SecondFragment_to_FirstFragment\"\n            app:destination=\"@id/FirstFragment\" />\n    </fragment>\n</navigation>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#6200EE</color>\n    <color name=\"colorPrimaryDark\">#3700B3</color>\n    <color name=\"colorAccent\">#03DAC5</color>\n</resources>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <dimen name=\"fab_margin\">16dp</dimen>\n</resources>"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">DetoxExample</string>\n    <string name=\"action_settings\">Settings</string>\n\n    <!-- Strings used for inter-fragments navigation -->\n    <string name=\"first_fragment_label\">First Fragment</string>\n    <string name=\"actions_fragment_label\">Actions Fragment</string>\n    <string name=\"main_navto_actions\">Actions</string>\n\n    <string name=\"main_fragment_heading\">Detox!</string>\n    <string name=\"main_logo__cd\">Main Logo</string>\n    <string name=\"actions_heading\">Actions Screen</string>\n</resources>\n"
  },
  {
    "path": "examples/demo-pure-native-android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n    </style>\n\n    <style name=\"AppTheme.AppBarOverlay\" parent=\"ThemeOverlay.AppCompat.Dark.ActionBar\" />\n\n    <style name=\"AppTheme.PopupOverlay\" parent=\"ThemeOverlay.AppCompat.Light\" />\n\n</resources>"
  },
  {
    "path": "examples/demo-pure-native-android/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    ext.kotlin_version = \"1.6.21\"\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:4.1.3\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n\n        // This is here in order to resolve the Detox .aar from the local folder (assuming it's\n        // been prebuilt, regardless of this project). Commenting this out would have the app\n        // resolve the actual (published) .aar from maven-central.\n        maven {\n            url \"$rootDir/../../detox/Detox-android\"\n        }\n        mavenCentral()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "examples/demo-pure-native-android/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sun Jun 06 14:14:57 IDT 2021\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.9-bin.zip\n"
  },
  {
    "path": "examples/demo-pure-native-android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx2048m\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app\"s APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official"
  },
  {
    "path": "examples/demo-pure-native-android/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "examples/demo-pure-native-android/settings.gradle",
    "content": "include ':app'\nrootProject.name = \"DetoxExample\""
  },
  {
    "path": "examples/demo-react-native/.buckconfig",
    "content": "\n[android]\n  target = Google Inc.:Google APIs:23\n\n[maven_repositories]\n  central = https://repo1.maven.org/maven2\n"
  },
  {
    "path": "examples/demo-react-native/.flowconfig",
    "content": "[ignore]\n\n# We fork some components by platform.\n.*/*.web.js\n.*/*.android.js\n\n# Some modules have their own node_modules with overlap\n.*/node_modules/node-haste/.*\n\n# Ugh\n.*/node_modules/babel.*\n.*/node_modules/babylon.*\n.*/node_modules/invariant.*\n\n# Ignore react and fbjs where there are overlaps, but don't ignore\n# anything that react-native relies on\n.*/node_modules/fbjs/lib/Map.js\n.*/node_modules/fbjs/lib/ErrorUtils.js\n\n# Flow has a built-in definition for the 'react' module which we prefer to use\n# over the currently-untyped source\n.*/node_modules/react/react.js\n.*/node_modules/react/lib/React.js\n.*/node_modules/react/lib/ReactDOM.js\n\n.*/__mocks__/.*\n.*/__tests__/.*\n\n.*/commoner/test/source/widget/share.js\n\n# Ignore commoner tests\n.*/node_modules/commoner/test/.*\n\n# See https://github.com/facebook/flow/issues/442\n.*/react-tools/node_modules/commoner/lib/reader.js\n\n# Ignore jest\n.*/node_modules/jest-cli/.*\n\n# Ignore Website\n.*/website/.*\n\n# Ignore generators\n.*/local-cli/generator.*\n\n# Ignore BUCK generated folders\n.*\\.buckd/\n\n# Ignore RNPM\n.*/local-cli/rnpm/.*\n\n.*/node_modules/is-my-json-valid/test/.*\\.json\n.*/node_modules/iconv-lite/encodings/tables/.*\\.json\n.*/node_modules/y18n/test/.*\\.json\n.*/node_modules/spdx-license-ids/spdx-license-ids.json\n.*/node_modules/spdx-exceptions/index.json\n.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json\n.*/node_modules/resolve/lib/core.json\n.*/node_modules/jsonparse/samplejson/.*\\.json\n.*/node_modules/json5/test/.*\\.json\n.*/node_modules/ua-parser-js/test/.*\\.json\n.*/node_modules/builtin-modules/builtin-modules.json\n.*/node_modules/binary-extensions/binary-extensions.json\n.*/node_modules/url-regex/tlds.json\n.*/node_modules/joi/.*\\.json\n.*/node_modules/isemail/.*\\.json\n.*/node_modules/tr46/.*\\.json\n\n\n[include]\n\n[libs]\nnode_modules/react-native/Libraries/react-native/react-native-interface.js\nnode_modules/react-native/flow\nflow/\n\n[options]\nmodule.system=haste\n\nesproposal.class_static_fields=enable\nesproposal.class_instance_fields=enable\n\nmunge_underscores=true\n\nmodule.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'\nmodule.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> 'RelativeImageStub'\n\nsuppress_type=$FlowIssue\nsuppress_type=$FlowFixMe\nsuppress_type=$FixMe\n\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\\\\($\\\\|[^(]\\\\|(\\\\(>=0\\\\.\\\\(2[0-5]\\\\|1[0-9]\\\\|[0-9]\\\\).[0-9]\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowIssue\\\\((\\\\(>=0\\\\.\\\\(2[0-5]\\\\|1[0-9]\\\\|[0-9]\\\\).[0-9]\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)?:? #[0-9]+\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixedInNextDeploy\n\n[version]\n^0.25.0\n"
  },
  {
    "path": "examples/demo-react-native/.gitignore",
    "content": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\nGemfile.lock\n/Pods\n\n# Android/IJ\n#\n.idea\n.gradle\nlocal.properties\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n\n# BUCK\nbuck-out/\n\\.buckd/\nandroid/app/libs\nandroid/keystores/debug.keystore\n\n# keystore\n*.keystore\n!debug.keystore\n"
  },
  {
    "path": "examples/demo-react-native/.watchmanconfig",
    "content": "{}"
  },
  {
    "path": "examples/demo-react-native/Gemfile",
    "content": "# Gemfile\nsource \"https://rubygems.org\"\n\nruby '>= 2.6.10'\n\ngem 'cocoapods', '>= 1.13', '< 1.15'\ngem 'activesupport', '>= 6.1.7.5', '< 7.1.0'\n"
  },
  {
    "path": "examples/demo-react-native/README.md",
    "content": "# React Native Demo Project\n\n## Environment\n\n### Fundamentals\n\n**IMPORTANT:** Get your environment properly set up, as explained in our [contribution guide](../../docs/contributing.md).\n\n### Execution Target\n\nBe sure to set up either an iOS simulator or a proper Android AVD emulator matching the Detox configurations of the project (`devices` section of the `detox.config.js` file).\n\n## Running this project in Release mode\n\n### Step 0: Prebuild\n\n#### Android\n\nPrebuild Detox as an Android archive (a `.aar` file), locally:\n\n```sh\ncd detox\nnpm run build:android\n```\n\n> On success, the result is a set of maven artifacts published in subdirectories under `detox/Detox-android/`. That includes `detox-999.999.999.aar` (i.e. Detox' native code packaged with the fake version `999.999.999`).\n\n#### iOS\n\nInstall the necessary pods:\n\n```sh\ncd detox\nnpm run podInstall:ios\n```\n\n### Step 1: Build\n\nBuild the demo project using one of the `npm` scripts.\n\n```sh\nnpm run build:ios-release\n-or-\nnpm run build:android-release\n```\n\n### Step 2: Execute Tests\n\n```sh\nnpm run test:ios-release\n-or-\nnpm run test:android-release\n```\n\n## Running this project in Debug mode\n\nThe project’s tests can also be executed with the app running in debug mode (mainly, with JavaScript code getting bundled on-the-fly using the `metro` server).\n\nFor that, first run the `metro` server:\n\n```sh\nnpm start\n```\n\nthen follow the same instructions specified for Release mode, above, using associated `debug` scripts instead of the `release` ones. Namely -\n\nBuild:\n\n```sh\nnpm run build:ios-debug\n-or-\nnpm run build:android-debug\n```\n\nTest:\n\n```sh\nnpm run test:ios-debug\n-or-\nnpm run test:android-debug\n```\n"
  },
  {
    "path": "examples/demo-react-native/android/app/BUCK",
    "content": "import re\n\n# To learn about Buck see [Docs](https://buckbuild.com/).\n# To run your application with Buck:\n# - install Buck\n# - `npm start` - to start the packager\n# - `cd android`\n# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US`\n# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n# - `buck install -r android/app` - compile, install and run application\n#\n\nlib_deps = []\nfor jarfile in glob(['libs/*.jar']):\n  name = 'jars__' + re.sub(r'^.*/([^/]+)\\.jar$', r'\\1', jarfile)\n  lib_deps.append(':' + name)\n  prebuilt_jar(\n    name = name,\n    binary_jar = jarfile,\n  )\n\nfor aarfile in glob(['libs/*.aar']):\n  name = 'aars__' + re.sub(r'^.*/([^/]+)\\.aar$', r'\\1', aarfile)\n  lib_deps.append(':' + name)\n  android_prebuilt_aar(\n    name = name,\n    aar = aarfile,\n  )\n\nandroid_library(\n  name = 'all-libs',\n  exported_deps = lib_deps\n)\n\nandroid_library(\n  name = 'app-code',\n  srcs = glob([\n    'src/main/java/**/*.java',\n  ]),\n  deps = [\n    ':all-libs',\n    ':build_config',\n    ':res',\n  ],\n)\n\nandroid_build_config(\n  name = 'build_config',\n  package = 'com.example',\n)\n\nandroid_resource(\n  name = 'res',\n  res = 'src/main/res',\n  package = 'com.example',\n)\n\nandroid_binary(\n  name = 'app',\n  package_type = 'debug',\n  manifest = 'src/main/AndroidManifest.xml',\n  keystore = '//android/keystores:debug',\n  deps = [\n    ':app-code',\n  ],\n)\n"
  },
  {
    "path": "examples/demo-react-native/android/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'com.facebook.react'\napply plugin: 'kotlin-android'\n\nreact {\n    autolinkLibrariesWithApp()\n}\n\nandroid {\n    namespace 'com.example'\n\n    ndkVersion rootProject.ext.ndkVersion\n    buildToolsVersion = rootProject.ext.buildToolsVersion\n\n    println(\"[$project] Using buildToolsVersion $buildToolsVersion\")\n\n    defaultConfig {\n        applicationId 'com.detox.rn.example'\n        versionCode 1\n        versionName '1.0'\n\n        compileSdk rootProject.ext.compileSdkVersion\n        minSdkVersion rootProject.ext.minSdkVersion\n        targetSdkVersion rootProject.ext.targetSdkVersion\n\n        ndk {\n            abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'\n        }\n\n        testBuildType System.getProperty('testBuildType', 'debug')\n        testInstrumentationRunner 'com.example.DetoxTestAppJUnitRunner'\n    }\n    splits {\n        abi {\n            reset()\n            enable false\n            universalApk false  // If true, also generate a universal APK\n            include 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'\n        }\n    }\n    signingConfigs {\n        release {\n            storeFile file(\"keystore.jks\")\n            storePassword \"12345678\"\n            keyAlias \"key0\"\n            keyPassword \"12345678\"\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n            signingConfig signingConfigs.release\n        }\n    }\n\n    packagingOptions {\n        exclude 'META-INF/DEPENDENCIES'\n        exclude 'META-INF/NOTICE'\n        exclude 'META-INF/LICENSE'\n        exclude 'META-INF/LICENSE.txt'\n        exclude 'META-INF/NOTICE.txt'\n    }\n\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_17\n        targetCompatibility = JavaVersion.VERSION_17\n    }\n}\n\ndependencies {\n    implementation 'androidx.appcompat:appcompat:1.6.1'\n    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'\n\n    implementation 'com.facebook.react:react-android'\n    // Apply Hermes as the JS engine\n    implementation 'com.facebook.react:hermes-android'\n\n    // noinspection GradleDynamicVersion\n    androidTestImplementation 'com.wix:detox:+'\n    androidTestImplementation 'com.github.wix-incubator:detox-butler:1.0.4'\n}\n"
  },
  {
    "path": "examples/demo-react-native/android/app/proguard-rules.pro",
    "content": "#\n# Most needed rules come from React Native's proguard-rules.pro (either .aar or source) -- hence\n# the lean configuration file.\n###\n\n-dontnote android.net.**\n-dontnote org.apache.**\n\n# An addition to RN's 'keep' and 'dontwarn' configs -- need to also 'dontnote' some stuff.\n\n-dontnote com.facebook.**\n-dontnote sun.misc.Unsafe\n-dontnote okhttp3.**\n-dontnote okio.**\n\n# Do not strip any method/class that is annotated with @DoNotStrip\n# This should really come from React Native itself. See here: https://github.com/react-native-community/upgrade-support/issues/31\n-keep @com.facebook.jni.annotations.DoNotStrip class *\n-keep class * {\n    @com.facebook.proguard.annotations.DoNotStrip *;\n    @com.facebook.common.internal.DoNotStrip *;\n    @com.facebook.jni.annotations.DoNotStrip *;\n}\n-keepclassmembers class * {\n    @com.facebook.jni.annotations.DoNotStrip *;\n}\n\n-keep class com.facebook.hermes.unicode.** { *; }\n-keep class com.facebook.jni.** { *; }\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/androidTest/java/com/example/DetoxTest.java",
    "content": "// Replace \"com.example\" here and below with your app's package name from the top of MainActivity.java\npackage com.example;\n\nimport com.wix.detox.Detox;\nimport com.wix.detox.config.DetoxConfig;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.rule.ActivityTestRule;\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class DetoxTest {\n    // Replace 'MainActivity' with the value of android:name entry in\n    // <activity> in AndroidManifest.xml\n    @Rule\n    public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);\n\n    @Test\n    public void runDetoxTests() {\n        DetoxConfig detoxConfig = new DetoxConfig();\n        detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;\n        detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;\n        detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);\n\n        Detox.runTests(mActivityRule, detoxConfig);\n    }\n}\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/androidTest/java/com/example/DetoxTestAppJUnitRunner.java",
    "content": "package com.example;\n\nimport android.os.Bundle;\n\nimport androidx.test.runner.AndroidJUnitRunner;\nimport com.wix.detoxbutler.DetoxButler;\n\n\npublic class DetoxTestAppJUnitRunner extends AndroidJUnitRunner {\n    @Override\n    public void onStart() {\n        DetoxButler.setup(getTargetContext());\n        super.onStart();\n    }\n\n    @Override\n    public void finish(int resultCode, Bundle results) {\n        DetoxButler.teardown(getTargetContext());\n        super.finish(resultCode, results);\n    }\n}\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\"\n    >\n\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n\n    <application\n      android:name=\".MainApplication\"\n      android:allowBackup=\"false\"\n      android:label=\"@string/app_name\"\n      android:icon=\"@mipmap/ic_launcher\"\n      android:theme=\"@style/AppTheme\"\n      android:networkSecurityConfig=\"@xml/network_security_config\"\n      >\n      <activity\n        android:name=\".MainActivity\"\n        android:label=\"@string/app_name\"\n        android:exported=\"true\"\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode\">\n        <intent-filter>\n            <action android:name=\"android.intent.action.MAIN\" />\n            <category android:name=\"android.intent.category.LAUNCHER\" />\n        </intent-filter>\n      </activity>\n      <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/java/com/example/MainActivity.kt",
    "content": "package com.example\n\nimport com.facebook.react.ReactActivity\nimport com.facebook.react.ReactActivityDelegate\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\nimport com.facebook.react.defaults.DefaultReactActivityDelegate\n\nclass MainActivity : ReactActivity() {\n    /**\n     * Returns the name of the main component registered from JavaScript.\n     * This is used to schedule rendering of the component.\n     */\n    override fun getMainComponentName(): String = \"example\"\n\n    override fun createReactActivityDelegate(): ReactActivityDelegate =\n        DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)\n}\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/java/com/example/MainApplication.kt",
    "content": "package com.example\n\nimport android.app.Application\nimport com.facebook.react.PackageList\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.ReactHost\nimport com.facebook.react.ReactNativeHost\nimport com.facebook.react.ReactPackage\nimport com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\nimport com.facebook.react.defaults.DefaultReactNativeHost\nimport com.facebook.react.soloader.OpenSourceMergedSoMapping\nimport com.facebook.soloader.SoLoader\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\nimport com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative\n\n\nclass MainApplication : Application(), ReactApplication {\n    override val reactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) {\n        override fun getUseDeveloperSupport(): Boolean {\n            return BuildConfig.DEBUG\n        }\n\n        override fun getPackages(): List<ReactPackage> {\n            return PackageList(this).packages\n        }\n\n        override fun getJSMainModuleName(): String {\n            return \"index\"\n        }\n\n        override val isNewArchEnabled: Boolean\n            get() = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n\n        override val isHermesEnabled: Boolean\n            get() = BuildConfig.IS_HERMES_ENABLED\n    }\n\n\n    override val reactHost: ReactHost\n        get() = getDefaultReactHost(this, reactNativeHost)\n\n    override fun onCreate() {\n        super.onCreate()\n        loadReactNative(this)\n    }\n}\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">example</string>\n</resources>\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "examples/demo-react-native/android/app/src/main/res/xml/network_security_config.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n    <domain-config cleartextTrafficPermitted=\"true\">\n        <domain includeSubdomains=\"true\">10.0.2.2</domain>\n        <domain includeSubdomains=\"true\">10.0.3.2</domain>\n        <domain includeSubdomains=\"true\">localhost</domain>\n    </domain-config>\n</network-security-config>\n"
  },
  {
    "path": "examples/demo-react-native/android/build.gradle",
    "content": "buildscript {\n    apply from: '../../../detox/android/rninfo.gradle'\n\n    ext {\n        kotlinVersion = '2.1.20'\n        buildToolsVersion = '36.0.0'\n        compileSdkVersion = 36\n        targetSdkVersion = 36\n        ndkVersion = \"27.1.12297006\"\n        minSdkVersion = 26\n    }\n\n    repositories {\n        mavenCentral()\n        google()\n    }\n\n    dependencies {\n        classpath \"com.android.tools.build:gradle\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n        classpath \"com.facebook.react:react-native-gradle-plugin\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        maven {\n            url \"$rootDir/../node_modules/detox/Detox-android\"\n        }\n    }\n}\n\nsubprojects {\n    // Apply common configurations to all sub-projects\n    afterEvaluate { project ->\n        if (project.hasProperty(\"android\")) {\n            project.android {\n                buildToolsVersion = rootProject.ext.buildToolsVersion\n            }\n        }\n    }\n}\n\napply plugin: \"com.facebook.react.rootproject\"\n"
  },
  {
    "path": "examples/demo-react-native/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.14.3-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "examples/demo-react-native/android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx3g -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\nandroid.useAndroidX=true\nnewArchEnabled=true\nhermesEnabled=true\nedgeToEdgeEnabled=false\n"
  },
  {
    "path": "examples/demo-react-native/android/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd \"${APP_HOME:-./}\" > /dev/null && pwd -P ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    if ! command -v java >/dev/null 2>&1\n    then\n        die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "examples/demo-react-native/android/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 0 goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "examples/demo-react-native/android/keystores/BUCK",
    "content": "keystore(\n  name = 'debug',\n  store = 'debug.keystore',\n  properties = 'debug.keystore.properties',\n  visibility = [\n    'PUBLIC',\n  ],\n)\n"
  },
  {
    "path": "examples/demo-react-native/android/keystores/debug.keystore.properties",
    "content": "key.store=debug.keystore\nkey.alias=androiddebugkey\nkey.store.password=android\nkey.alias.password=android\n"
  },
  {
    "path": "examples/demo-react-native/android/settings.gradle",
    "content": "pluginManagement { includeBuild(\"../node_modules/@react-native/gradle-plugin\") }\nplugins { id(\"com.facebook.react.settings\") }\nextensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }\nincludeBuild('../node_modules/@react-native/gradle-plugin')\nrootProject.name = 'DetoxRNExample'\ninclude ':app'\n"
  },
  {
    "path": "examples/demo-react-native/app.js",
    "content": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  TouchableOpacity\n} from 'react-native';\n\nclass example extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined\n    };\n  }\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View testID='welcome' style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25, marginBottom: 30}}>\n          Welcome\n        </Text>\n        <TouchableOpacity testID='hello_button' onPress={this.onButtonPress.bind(this, 'Hello')}>\n          <Text style={{color: 'blue', marginBottom: 20}}>Say Hello</Text>\n        </TouchableOpacity>\n        <TouchableOpacity testID='world_button' onPress={this.onButtonPress.bind(this, 'World')}>\n          <Text style={{color: 'blue', marginBottom: 20}}>Say World</Text>\n        </TouchableOpacity>\n        <TouchableOpacity testID='goodbye_button' onPress={this.onButtonPress.bind(this, 'Goodbye, World')}>\n          <Text style={{color: 'blue', marginTop: 50, marginBottom: 20}}>Say Goodbye</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n  onButtonPress(greeting) {\n    this.setState({\n      greeting: greeting\n    });\n  }\n}\n\nAppRegistry.registerComponent('example', () => example);\n"
  },
  {
    "path": "examples/demo-react-native/babel.config.json",
    "content": "{\n\n}\n"
  },
  {
    "path": "examples/demo-react-native/detox.config.js",
    "content": "/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  logger: {\n    level: process.env.CI ? 'debug' : undefined,\n  },\n  testRunner: {\n    args: {\n      config: 'e2e/jest.config.js',\n      maxWorkers: process.env.CI ? 2 : undefined,\n      _: ['e2e']\n    },\n  },\n  artifacts: {\n    plugins: {\n      log: process.env.CI ? 'failing' : undefined,\n      screenshot: process.env.CI ? 'failing' : undefined,\n    },\n  },\n  apps: {\n    \"ios.release\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/example.app\",\n      \"build\": \"export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/example.xcworkspace -UseNewBuildSystem=NO -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet\",\n    },\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/example.app\",\n      \"build\": \"xcodebuild -workspace ios/example.xcworkspace -UseNewBuildSystem=NO -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build\",\n      \"start\": \"scripts/start-rn.sh ios\",\n    },\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/debug/app-debug.apk\",\n      \"build\": \"cd android ; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug ; cd -\",\n      \"start\": \"scripts/start-rn.sh android\",\n      reversePorts: [8081]\n    },\n    \"android.release\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/release/app-release.apk\",\n      \"build\": \"cd android ; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd -\"\n    }\n  },\n  devices: {\n    simulator: {\n      type: \"ios.simulator\",\n      headless: Boolean(process.env.CI),\n      device: {\n        type: \"iPhone 15 Pro Max\",\n        os: \"17.0.1\"\n      }\n    },\n    emulator: {\n      type: \"android.emulator\",\n      headless: Boolean(process.env.CI),\n      gpuMode: process.env.CI ? 'off' : undefined,\n      device: {\n        avdName: \"Pixel_3a_API_34\"\n      },\n      reversePorts: [8081],\n\n      utilBinaryPaths: [\n        \"../../detox/test/e2e/util-binary/detoxbutler-1.1.0-aosp-release.apk\"\n      ],\n    },\n    \"genymotion.emulator.uuid\": {\n      type: \"android.genycloud\",\n      device: {\n        recipeUUID: \"9baf12f9-a645-4ffa-a688-0e92584d6194\"\n      },\n      utilBinaryPaths: [\n        \"../../detox/test/e2e/util-binary/detoxbutler-1.1.0-genymotion-release.apk\"\n      ],\n    },\n    \"genymotion.emulator.name\": {\n      type: \"android.genycloud\",\n      device: {\n        recipeName: \"Detox_Pixel_3a_API_34\"\n      },\n      utilBinaryPaths: [\n        \"../../detox/test/e2e/util-binary/detoxbutler-1.1.0-genymotion-release.apk\"\n      ],\n    }\n  },\n  configurations: {\n    \"ios.sim.release\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.release\"\n    },\n    \"ios.sim.debug\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.debug\"\n    },\n    \"ios.manual\": {\n      \"type\": \"ios.manual\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      },\n      \"artifacts\": false,\n      \"session\": {\n        \"autoStart\": true,\n        \"server\": \"ws://localhost:8099\",\n        \"sessionId\": \"com.wix.demo.react.native\"\n      }\n    },\n    \"android.emu.debug\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.debug\"\n    },\n    \"android.emu.release\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.release\"\n    }\n  }\n};\n"
  },
  {
    "path": "examples/demo-react-native/e2e/globalSetup.ts",
    "content": "import { execSync } from 'child_process';\n\nimport { pathExists, ensureDir } from 'fs-extra';\n\nimport { resolveConfig } from 'detox/internals';\nimport { globalSetup } from 'detox/runners/jest';\n\nexport default async function customGlobalSetup() {\n  const config = await resolveConfig();\n  if (config.device.type === 'android.emulator') {\n    await downloadTestButlerAPK();\n  }\n\n  await globalSetup();\n}\n\nasync function downloadTestButlerAPK() {\n  const version = '2.2.1';\n  const artifactUrl = `https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/${version}/test-butler-app-${version}.apk`;\n  const filePath = `cache/test-butler-app.apk`;\n\n  await ensureDir('cache');\n  if (!(await pathExists(filePath))) {\n    console.log(`\\nDownloading Test-Butler APK v${version}...`);\n    execSync(`curl -f -o ${filePath} ${artifactUrl}`);\n  }\n}\n\nmodule.exports = customGlobalSetup;\n"
  },
  {
    "path": "examples/demo-react-native/e2e/jest.config.js",
    "content": "/** @type {import('jest').Config} */\nmodule.exports = {\n  maxWorkers: 1,\n  globalSetup: \"./globalSetup.ts\",\n  globalTeardown: \"detox/runners/jest/globalTeardown\",\n  testEnvironment: \"detox/runners/jest/testEnvironment\",\n  setupFilesAfterEnv: [\"./setup.ts\"],\n  testRunner: \"jest-circus/runner\",\n  testTimeout: 120000,\n  testMatch: [\"**/*.test.ts\"],\n  transform: {\n    \"\\\\.tsx?$\": \"ts-jest\"\n  },\n  reporters: [\"detox/runners/jest/reporter\"],\n  verbose: true\n};\n"
  },
  {
    "path": "examples/demo-react-native/e2e/setup.ts",
    "content": "import { device } from 'detox';\n\nbeforeAll(async () => {\n  await device.launchApp();\n});\n"
  },
  {
    "path": "examples/demo-react-native/e2e/suite1.test.ts",
    "content": "import { by, device, element, expect } from 'detox';\n\ndescribe('Test suite 1', () => {\n  beforeAll(async () => {\n    await device.relaunchApp();\n  });\n\n  it('should have welcome screen', async () => {\n    await expect(element(by.id('welcome'))).toBeVisible();\n  });\n\n  it('should show hello screen after tap', async () => {\n    await element(by.id('hello_button')).tap();\n    await expect(element(by.text('Hello!!!'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "examples/demo-react-native/e2e/suite2.test.ts",
    "content": "import { by, device, element, expect } from 'detox';\n\ndescribe('Example (goodbye)', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should show goodbye screen after tap', async () => {\n    await element(by.id('goodbye_button')).tap();\n    await expect(element(by.text('Goodbye, World!!!'))).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "examples/demo-react-native/index.android.js",
    "content": "require('./app');"
  },
  {
    "path": "examples/demo-react-native/index.ios.js",
    "content": "require('./app');"
  },
  {
    "path": "examples/demo-react-native/ios/Podfile",
    "content": "require Pod::Executable.execute_command('node', ['-p',\n  'require.resolve(\n    \"react-native/scripts/react_native_pods.rb\",\n    {paths: [process.argv[1]]},\n  )', __dir__]).strip\n\nplatform :ios, min_ios_version_supported\n\ntarget 'example' do\n  config = use_native_modules!\n\n  use_react_native!(\n    :path => config[:reactNativePath],\n    # to enable hermes on iOS, change `false` to `true` and then install pods\n    :hermes_enabled => false,\n    # :flipper_configuration => FlipperConfiguration.enabled,\n  )\n\n  post_install do |installer|\n    __apply_update_deployment_target_workaround(installer)\n    __apply_Xcode_15_workaround(installer)\n\n     react_native_post_install(\n       installer,\n       config[:reactNativePath],\n       # Set `mac_catalyst_enabled` to `true` in order to apply patches\n       # necessary for Mac Catalyst builds\n       :mac_catalyst_enabled => false\n     )\n  end\nend\n\ndef __apply_update_deployment_target_workaround(installer)\n  # This is a workaround for updating the deployment target of pod targets to the minimal supported version.\n  # See StackOverflow: https://stackoverflow.com/questions/72729591/fbreactnativespec-h-error-after-upgrading-from-0-68-x-to-0-69-0/75915794#75915794\n  installer.pods_project.targets.each do |target|\n    target.build_configurations.each do |config|\n      config.build_settings['SWIFT_VERSION'] = '5.0'\n      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] < '12.4'\n        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'\n      end\n    end\n  end\nend\n\ndef __apply_Xcode_15_workaround(installer)\n  # This is a workaround for Xcode 15, see: https://github.com/facebook/react-native/issues/37748.\n  puts \"Applying Xcode 15 post install workaround\"\n  installer.pods_project.targets.each do |target|\n    target.build_configurations.each do |config|\n      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']\n    end\n  end\nend\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/AppDelegate.h",
    "content": "#import <RCTAppDelegate.h>\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : RCTAppDelegate\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/AppDelegate.m",
    "content": "#import \"AppDelegate.h\"\n\n#import <React/RCTBundleURLProvider.h>\n#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n    self.moduleName = @\"example\";\n    self.dependencyProvider = [RCTAppDependencyProvider new];\n    self.initialProps = @{};\n\n    return [super application:application didFinishLaunchingWithOptions:launchOptions];\n}\n\n- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n{\n    return [self bundleURL];\n}\n\n- (NSURL *)bundleURL\n{\n#if DEBUG\n    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n#else\n    return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n#endif\n}\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/Base.lproj/LaunchScreen.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"7702\" systemVersion=\"14D136\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"7701\"/>\n        <capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Powered by React Native\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">\n                    <rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\"/>\n                    <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"example\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">\n                    <rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\"/>\n                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"5cJ-9S-tgC\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\"/>\n                <constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\"/>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\"/>\n            </constraints>\n            <nil key=\"simulatedStatusBarMetrics\"/>\n            <freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\"/>\n            <point key=\"canvasLocation\" x=\"548\" y=\"455\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<false/>\n\t\t<key>NSAllowsLocalNetworking</key>\n\t\t<true/>\n\t</dict>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>RCTNewArchEnabled</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/PrivacyInfo.xcprivacy",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>NSPrivacyAccessedAPITypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>C617.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryUserDefaults</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>CA92.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategorySystemBootTime</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>35F9.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>NSPrivacyCollectedDataTypes</key>\n\t<array/>\n\t<key>NSPrivacyTracking</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example/main.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import \"AppDelegate.h\"\n\nint main(int argc, char *argv[]) {\n  @autoreleasepool {\n    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n  }\n}\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t1BAD7B53CE6DD3482C8FCEFD /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 7A91D49EFF21FA01D7EBC556 /* PrivacyInfo.xcprivacy */; };\n\t\t3953CBBA229AA464005DD98C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3953CBB9229AA464005DD98C /* JavaScriptCore.framework */; };\n\t\tA841B4E4EB5F0E5AD67AB44C /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 33F6F5509FC640CB686853BD /* libPods-example.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tCC0F353E1D461097008BB94F /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n\t\t00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = \"<group>\"; };\n\t\t0B14F02FC5BD7E09C5608F8E /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example.debug.xcconfig\"; path = \"Target Support Files/Pods-example/Pods-example.debug.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = \"<group>\"; };\n\t\t33F6F5509FC640CB686853BD /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-example.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3953CBB9229AA464005DD98C /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n\t\t7A91D49EFF21FA01D7EBC556 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = \"<group>\"; };\n\t\tF2A6AA700D46D462A8502B2C /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-example.release.xcconfig\"; path = \"Target Support Files/Pods-example/Pods-example.release.xcconfig\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3953CBBA229AA464005DD98C /* JavaScriptCore.framework in Frameworks */,\n\t\t\t\tA841B4E4EB5F0E5AD67AB44C /* libPods-example.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t00E356EF1AD99517003FC87E /* exampleTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F21AD99517003FC87E /* exampleTests.m */,\n\t\t\t\t00E356F01AD99517003FC87E /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = exampleTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356F01AD99517003FC87E /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F11AD99517003FC87E /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* example */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t\t7A91D49EFF21FA01D7EBC556 /* PrivacyInfo.xcprivacy */,\n\t\t\t);\n\t\t\tname = example;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* example */,\n\t\t\t\tCCFA7DE41D11D22600E15EDF /* Frameworks */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t00E356EF1AD99517003FC87E /* exampleTests */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\tCFDAD490851E165C3018B264 /* Pods */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* example.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tCCFA7DE41D11D22600E15EDF /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3953CBB9229AA464005DD98C /* JavaScriptCore.framework */,\n\t\t\t\t33F6F5509FC640CB686853BD /* libPods-example.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tCFDAD490851E165C3018B264 /* Pods */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0B14F02FC5BD7E09C5608F8E /* Pods-example.debug.xcconfig */,\n\t\t\t\tF2A6AA700D46D462A8502B2C /* Pods-example.release.xcconfig */,\n\t\t\t);\n\t\t\tpath = Pods;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t13B07F861A680F5B00A75B9A /* example */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tD7C644E9E75952B396B764FD /* [CP] Check Pods Manifest.lock */,\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t\tCC0F353E1D461097008BB94F /* Embed Frameworks */,\n\t\t\t\t7D57265F10EEF7CD92D7973F /* Copy Detox Framework */,\n\t\t\t\t59AE1E981DF0DF7503E7F63F /* [CP] Copy Pods Resources */,\n\t\t\t\t4972E179C5B5917F8E02541F /* [CP] Embed Pods Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = example;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* example.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\tEnglish,\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* example */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,\n\t\t\t\t1BAD7B53CE6DD3482C8FCEFD /* PrivacyInfo.xcprivacy in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native/scripts/react-native-xcode.sh\";\n\t\t};\n\t\t4972E179C5B5917F8E02541F /* [CP] Embed Pods Frameworks */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\",\n\t\t\t\t\"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermesvm.framework/hermesvm\",\n\t\t\t);\n\t\t\tname = \"[CP] Embed Pods Frameworks\";\n\t\t\toutputPaths = (\n\t\t\t\t\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermesvm.framework\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t59AE1E981DF0DF7503E7F63F /* [CP] Copy Pods Resources */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle\",\n\t\t\t\t\"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle\",\n\t\t\t);\n\t\t\tname = \"[CP] Copy Pods Resources\";\n\t\t\toutputPaths = (\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle\",\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle\",\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle\",\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle\",\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle\",\n\t\t\t\t\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t7D57265F10EEF7CD92D7973F /* Copy Detox Framework */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Copy Detox Framework\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/bash;\n\t\t\tshellScript = \"if [ -n \\\"$DEPLOY_DETOX_FRAMEWORK\\\" ]; then\\nmkdir -p \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\ncp -r \\\"${PROJECT_DIR}\\\"/../node_modules/detox/Detox.framework \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\nfi\";\n\t\t};\n\t\tD7C644E9E75952B396B764FD /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FB21A68108700A75B9A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tpath = example;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 0B14F02FC5BD7E09C5608F8E /* Pods-example.debug.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = \"$(inherited)\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.react.native;\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = F2A6AA700D46D462A8502B2C /* Pods-example.release.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = \"$(inherited)\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.react.native;\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCC = \"\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCXX = \"\";\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD = \"\";\n\t\t\t\tLDPLUSPLUS = \"\";\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_CFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"$(inherited)\";\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = \"$(inherited) DEBUG\";\n\t\t\t\tUSE_HERMES = true;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCC = \"\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tCXX = \"\";\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD = \"\";\n\t\t\t\tLDPLUSPLUS = \"\";\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_CFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"$(inherited)\";\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tUSE_HERMES = true;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"example.app\"\n               BlueprintName = \"example\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Release\"\n      selectedDebuggerIdentifier = \"\"\n      selectedLauncherIdentifier = \"Xcode.IDEFoundation.Launcher.PosixSpawn\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"example.app\"\n               BlueprintName = \"example\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:example.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:Pods/Pods.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native/ios/example.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>PreviewsEnabled</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native/ios/exampleTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native/ios/exampleTests/exampleTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTLog.h>\n#import <React/RCTRootView.h>\n\n#define TIMEOUT_SECONDS 600\n#define TEXT_TO_LOOK_FOR @\"Welcome to React Native!\"\n\n@interface exampleTests : XCTestCase\n\n@end\n\n@implementation exampleTests\n\n- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test\n{\n  if (test(view)) {\n    return YES;\n  }\n  for (UIView *subview in [view subviews]) {\n    if ([self findSubviewInView:subview matching:test]) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n- (void)testRendersWelcomeScreen\n{\n  UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];\n  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];\n  BOOL foundElement = NO;\n\n  __block NSString *redboxError = nil;\n  RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {\n    if (level >= RCTLogLevelError) {\n      redboxError = message;\n    }\n  });\n\n  while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {\n    [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n    [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n\n    foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {\n      if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {\n        return YES;\n      }\n      return NO;\n    }];\n  }\n\n  RCTSetLogFunction(RCTDefaultLogFunction);\n\n  XCTAssertNil(redboxError, @\"RedBox error: %@\", redboxError);\n  XCTAssertTrue(foundElement, @\"Couldn't find element with text '%@' in %d seconds\", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);\n}\n\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native/metro.config.js",
    "content": "const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');\n\n/**\n * Metro configuration\n * https://facebook.github.io/metro/docs/configuration\n *\n * @type {import('@react-native/metro-config').MetroConfig}\n */\nconst config = {\n  resolver: {\n    blockList: [/detox\\/node_modules\\/react-native\\/.*/],\n  },\n};\n\nmodule.exports = mergeConfig(getDefaultConfig(__dirname), config);\n"
  },
  {
    "path": "examples/demo-react-native/package.json",
    "content": "{\n  \"name\": \"example\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"react-native start\",\n    \"postinstall\": \"node scripts/postinstall.js\",\n    \"bloat-bundle\": \"node scripts/bloatBundle.mjs\",\n    \"build:ios\": \"detox build --configuration ios.sim.debug\",\n    \"build:ios-debug\": \"detox build --configuration ios.sim.debug\",\n    \"build:ios-release\": \"detox build --configuration ios.sim.release\",\n    \"build:android-debug\": \"detox build --configuration android.emu.debug\",\n    \"build:android-release\": \"detox build --configuration android.emu.release\",\n    \"test:ios\": \"detox test --configuration ios.sim.debug\",\n    \"test:ios-debug\": \"detox test --configuration ios.sim.debug\",\n    \"test:ios-release\": \"detox test --configuration ios.sim.release\",\n    \"test:android-debug\": \"detox test --configuration android.emu.debug\",\n    \"test:android-release\": \"detox test --configuration android.emu.release\",\n    \"e2e:ios\": \"npm run build:ios-release && npm run test:ios-release\",\n    \"e2e:android\": \"npm run build:android-release && npm run test:android-release\",\n    \"podInstall:ios\": \"cd ios && bundle exec pod install\",\n    \"clean:android\": \"pushd android && ./gradlew clean && popd\"\n  },\n  \"dependencies\": {\n    \"@react-native-async-storage/async-storage\": \"^2.1.0\",\n    \"react\": \"19.2.0\",\n    \"react-native\": \"0.83.0\",\n    \"tslib\": \"^2.0.3\"\n  },\n  \"devDependencies\": {\n    \"@babel/preset-env\": \"^7.25.3\",\n    \"@react-native-community/cli\": \"20.0.2\",\n    \"@react-native-community/cli-platform-android\": \"20.0.2\",\n    \"@react-native-community/cli-platform-ios\": \"20.0.2\",\n    \"@react-native/babel-preset\": \"0.83.0\",\n    \"@react-native/eslint-config\": \"0.83.0\",\n    \"@react-native/metro-config\": \"0.83.0\",\n    \"@react-native/typescript-config\": \"0.83.0\",\n    \"@tsconfig/react-native\": \"^3.0.5\",\n    \"@types/fs-extra\": \"^9.0.13\",\n    \"@types/jest\": \"^29.2.1\",\n    \"@types/react\": \"^19.2.0\",\n    \"detox\": \"workspace:*\",\n    \"fs-extra\": \"^9.1.0\",\n    \"jest\": \"^30.0.3\",\n    \"react-test-renderer\": \"19.2.0\",\n    \"ts-jest\": \"^29.4.0\",\n    \"typescript\": \"^5.8.3\"\n  }\n}\n"
  },
  {
    "path": "examples/demo-react-native/rn-cli.config.js",
    "content": "/*\n * This has been replaced by 'metro.config.js'. It's only here to enable running with RN<60.x\n */\n\nlet metroBundler;\ntry {\n  metroBundler = require('metro');\n} catch (ex) {\n  metroBundler = require('metro-bundler');\n}\n\nmodule.exports = {\n  getBlacklistRE: function() {\n    return metroBundler.createBlacklist([/test\\/.*/, /detox\\/node_modules\\/.*/]);\n  }\n};\n"
  },
  {
    "path": "examples/demo-react-native/scripts/bloatBundle.mjs",
    "content": "import { appendFile } from 'fs/promises';\nconst bundlePath = `${process.argv[2]}`;\n\nasync function bloatBundle() {\n  const garbageToAppend = `/* ${ 'junk '.repeat(50000) } */`\n  await appendFile(bundlePath, garbageToAppend, 'utf8');\n}\n\nsetTimeout(() => {\n  console.error('Bundle bloat timed out');\n  process.exit(1);\n}, 3000);\n\ntry {\n  await bloatBundle();\n  console.log('Bundle bloated');\n  process.exit(0);\n} catch (error) {\n  console.error('Bundle bloat failed', error);\n  process.exit(1);\n}\n"
  },
  {
    "path": "examples/demo-react-native/scripts/postinstall.js",
    "content": "const fs = require('fs-extra');\nconst cp = require('child_process');\nconst { patchGradleByRNVersion } = require('detox/scripts/updateGradle');\n\nconst patchBoostPodspec = () => {\n  const log = message => console.log(`[POST-INSTALL] ${message}`);\n  const boostPodspecPath = `${process.cwd()}/node_modules/react-native/third-party-podspecs/boost.podspec`;\n  const originalUrl = 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2';\n  const patchedUrl = 'https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2';\n\n  if (!fs.existsSync(boostPodspecPath)) {\n    log('boost.podspec does not exist, skipping patch...');\n    return;\n  }\n\n  let boostPodspec = fs.readFileSync(boostPodspecPath, 'utf8');\n\n  if (!boostPodspec.includes(originalUrl)) {\n    log('boost.podspec is already patched or the URL is different, skipping patch...');\n    return;\n  }\n\n  log('Applying boost.podspec patch...');\n  boostPodspec = boostPodspec.replace(originalUrl, patchedUrl);\n  fs.writeFileSync(boostPodspecPath, boostPodspec, 'utf8');\n};\n\nfunction podInstallIfRequired() {\n  if (process.platform === 'darwin' && !process.env.DETOX_DISABLE_POD_INSTALL) {\n    console.log('[POST-INSTALL] Running pod install...');\n    patchBoostPodspec();\n\n    cp.execSync('pod install', {\n      cwd: `${process.cwd()}/ios`,\n      stdio: 'inherit'\n    });\n  }\n}\n\nconsole.log('[POST-INSTALL] Running Detox\\'s example-app post-install script...');\npodInstallIfRequired();\npatchGradleByRNVersion();\nconsole.log('[POST-INSTALL] Completed!');\n"
  },
  {
    "path": "examples/demo-react-native/scripts/start-rn.sh",
    "content": "#!/usr/bin/env bash\n\ntrap 'kill $RN_PID' EXIT\n\nPLATFORM=$1\n\nnpm start &\nRN_PID=$!\nsleep 2 && curl>/dev/null http://localhost:8081/index.$PLATFORM.bundle\nwait $RN_PID\n"
  },
  {
    "path": "examples/demo-react-native/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es2018\",\n    \"module\": \"commonjs\",\n    \"importHelpers\": true,\n    \"noEmit\": true,\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"noImplicitReturns\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"moduleResolution\": \"node\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"types\": [\"node\", \"jest\", \"detox\"]\n  },\n  \"include\": [\n    \"e2e/**/*.ts\"\n  ]\n}\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/.buckconfig",
    "content": "\n[android]\n  target = Google Inc.:Google APIs:23\n\n[maven_repositories]\n  central = https://repo1.maven.org/maven2\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/.flowconfig",
    "content": "[ignore]\n\n# We fork some components by platform.\n.*/*.web.js\n.*/*.android.js\n\n# Some modules have their own node_modules with overlap\n.*/node_modules/node-haste/.*\n\n# Ugh\n.*/node_modules/babel.*\n.*/node_modules/babylon.*\n.*/node_modules/invariant.*\n\n# Ignore react and fbjs where there are overlaps, but don't ignore\n# anything that react-native relies on\n.*/node_modules/fbjs/lib/Map.js\n.*/node_modules/fbjs/lib/ErrorUtils.js\n\n# Flow has a built-in definition for the 'react' module which we prefer to use\n# over the currently-untyped source\n.*/node_modules/react/react.js\n.*/node_modules/react/lib/React.js\n.*/node_modules/react/lib/ReactDOM.js\n\n.*/__mocks__/.*\n.*/__tests__/.*\n\n.*/commoner/test/source/widget/share.js\n\n# Ignore commoner tests\n.*/node_modules/commoner/test/.*\n\n# See https://github.com/facebook/flow/issues/442\n.*/react-tools/node_modules/commoner/lib/reader.js\n\n# Ignore jest\n.*/node_modules/jest-cli/.*\n\n# Ignore Website\n.*/website/.*\n\n# Ignore generators\n.*/local-cli/generator.*\n\n# Ignore BUCK generated folders\n.*\\.buckd/\n\n# Ignore RNPM\n.*/local-cli/rnpm/.*\n\n.*/node_modules/is-my-json-valid/test/.*\\.json\n.*/node_modules/iconv-lite/encodings/tables/.*\\.json\n.*/node_modules/y18n/test/.*\\.json\n.*/node_modules/spdx-license-ids/spdx-license-ids.json\n.*/node_modules/spdx-exceptions/index.json\n.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json\n.*/node_modules/resolve/lib/core.json\n.*/node_modules/jsonparse/samplejson/.*\\.json\n.*/node_modules/json5/test/.*\\.json\n.*/node_modules/ua-parser-js/test/.*\\.json\n.*/node_modules/builtin-modules/builtin-modules.json\n.*/node_modules/binary-extensions/binary-extensions.json\n.*/node_modules/url-regex/tlds.json\n.*/node_modules/joi/.*\\.json\n.*/node_modules/isemail/.*\\.json\n.*/node_modules/tr46/.*\\.json\n\n\n[include]\n\n[libs]\nnode_modules/react-native/Libraries/react-native/react-native-interface.js\nnode_modules/react-native/flow\nflow/\n\n[options]\nmodule.system=haste\n\nesproposal.class_static_fields=enable\nesproposal.class_instance_fields=enable\n\nmunge_underscores=true\n\nmodule.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'\nmodule.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> 'RelativeImageStub'\n\nsuppress_type=$FlowIssue\nsuppress_type=$FlowFixMe\nsuppress_type=$FixMe\n\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\\\\($\\\\|[^(]\\\\|(\\\\(>=0\\\\.\\\\(2[0-5]\\\\|1[0-9]\\\\|[0-9]\\\\).[0-9]\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowIssue\\\\((\\\\(>=0\\\\.\\\\(2[0-5]\\\\|1[0-9]\\\\|[0-9]\\\\).[0-9]\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)?:? #[0-9]+\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixedInNextDeploy\n\n[version]\n^0.25.0\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/.gitignore",
    "content": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n\n# Android/IJ\n#\n.idea\n.gradle\nlocal.properties\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n\n# BUCK\nbuck-out/\n\\.buckd/\nandroid/app/libs\nandroid/keystores/debug.keystore\n\nartifacts\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/.watchmanconfig",
    "content": "{}"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/README.md",
    "content": "# React Native Demo Project\n\n**IMPORTANT:** Get your environment properly set up, as explained in our [contribution guide](../../docs/contributing.md).\n\n## To test Release build of your app\n\n### \\[Release] Step 1: Build\n\nBuild the demo project:\n\n```sh\ndetox build --configuration ios.sim.release\n```\n\n### \\[Release] Step 2: Test\n\nRun tests on the demo project:\n\n```sh\ndetox test --configuration ios.sim.release\n```\n\nThis action will open a new simulator and run the tests on it.\n\n## To test Debug build of your app\n\n### \\[Debug] Step 1: Build\n\nBuild the demo project:\n\n```sh\ndetox build --configuration ios.sim.debug\n```\n\n### \\[Debug] Step 2: Test\n\n1. Start react-native packager:\n\n   ```sh\n   npm run start\n   ```\n\n1. Run tests on the demo project:\n\n   ```sh\n   detox test --configuration ios.sim.debug\n   ```\n\n   This action will open a new simulator and run the tests on it.\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/app.js",
    "content": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  TouchableOpacity\n} from 'react-native';\n\nclass example extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      greeting: undefined\n    };\n  }\n  render() {\n    if (this.state.greeting) return this.renderAfterButton();\n    return (\n      <View testID='welcome' style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25, marginBottom: 30}}>\n          Welcome\n        </Text>\n        <TouchableOpacity testID='hello_button' onPress={this.onButtonPress.bind(this, 'Hello')}>\n          <Text style={{color: 'blue', marginBottom: 20}}>Say Hello</Text>\n        </TouchableOpacity>\n        <TouchableOpacity testID='world_button' onPress={this.onButtonPress.bind(this, 'World')}>\n          <Text style={{color: 'blue', marginBottom: 20}}>Say World</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n  renderAfterButton() {\n    return (\n      <View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}>\n        <Text style={{fontSize: 25}}>\n          {this.state.greeting}!!!\n        </Text>\n      </View>\n    );\n  }\n  onButtonPress(greeting) {\n    this.setState({\n      greeting: greeting\n    });\n  }\n}\n\nAppRegistry.registerComponent('example', () => example);\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/index.android.js",
    "content": "require('./app');"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/index.js",
    "content": "require('./app');"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/AppDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (nonatomic, strong) UIWindow *window;\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/AppDelegate.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"AppDelegate.h\"\n#import <React/RCTRootView.h>\n#import <React/RCTBundleURLProvider.h>\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n  NSURL *jsCodeLocation;\n  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\" fallbackResource:nil];\n\n\n  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                      moduleName:@\"example\"\n                                               initialProperties:nil\n                                                   launchOptions:launchOptions];\n  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];\n\n  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n  UIViewController *rootViewController = [UIViewController new];\n  rootViewController.view = rootView;\n  self.window.rootViewController = rootViewController;\n  [self.window makeKeyAndVisible];\n  \n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/Base.lproj/LaunchScreen.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"7702\" systemVersion=\"14D136\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"7701\"/>\n        <capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Powered by React Native\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">\n                    <rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\"/>\n                    <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"example\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">\n                    <rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\"/>\n                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"5cJ-9S-tgC\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\"/>\n                <constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\"/>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\"/>\n            </constraints>\n            <nil key=\"simulatedStatusBarMetrics\"/>\n            <freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\"/>\n            <point key=\"canvasLocation\" x=\"548\" y=\"455\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example/main.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import \"AppDelegate.h\"\n\nint main(int argc, char * argv[]) {\n  @autoreleasepool {\n    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n  }\n}\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };\n\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t461BBF5F22788D6F0069D237 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 461BBF3322788D6F0069D237 /* JavaScriptCore.framework */; };\n\t\t46EE18632047465300FAAB0E /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46EE18602047463E00FAAB0E /* libRCTAnimation.a */; };\n\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTActionSheet;\n\t\t};\n\t\t00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTGeolocation;\n\t\t};\n\t\t00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 832C81801AAF6DEF007FA2F7;\n\t\t\tremoteInfo = RCTVibration;\n\t\t};\n\t\t139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTSettings;\n\t\t};\n\t\t139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t146834031AC3E56700842450 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t392FDE1D1E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A283A1D9B042B00D4039D;\n\t\t\tremoteInfo = \"RCTImage-tvOS\";\n\t\t};\n\t\t392FDE211E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28471D9B043800D4039D;\n\t\t\tremoteInfo = \"RCTLinking-tvOS\";\n\t\t};\n\t\t392FDE251E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\n\t\t\tremoteInfo = \"RCTNetwork-tvOS\";\n\t\t};\n\t\t392FDE291E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28611D9B046600D4039D;\n\t\t\tremoteInfo = \"RCTSettings-tvOS\";\n\t\t};\n\t\t392FDE2D1E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A287B1D9B048500D4039D;\n\t\t\tremoteInfo = \"RCTText-tvOS\";\n\t\t};\n\t\t392FDE321E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28881D9B049200D4039D;\n\t\t\tremoteInfo = \"RCTWebSocket-tvOS\";\n\t\t};\n\t\t392FDE3C1E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28131D9B038B00D4039D;\n\t\t\tremoteInfo = \"React-tvOS\";\n\t\t};\n\t\t392FDE3E1E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C059A1DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t392FDE401E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C06751DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t392FDE421E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t392FDE441E2E5F680058768A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t461BBF5722788D6F0069D237 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EDEBC6D6214B3E7000DD5AC8;\n\t\t\tremoteInfo = jsi;\n\t\t};\n\t\t461BBF5922788D6F0069D237 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EDEBC73B214B45A300DD5AC8;\n\t\t\tremoteInfo = jsiexecutor;\n\t\t};\n\t\t461BBF5B22788D6F0069D237 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = ED296FB6214C9A0900B7C4FE;\n\t\t\tremoteInfo = \"jsi-tvOS\";\n\t\t};\n\t\t461BBF5D22788D6F0069D237 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = ED296FEE214C9CF800B7C4FE;\n\t\t\tremoteInfo = \"jsiexecutor-tvOS\";\n\t\t};\n\t\t46EE1805204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D001F3B181A0099AA32;\n\t\t\tremoteInfo = fishhook;\n\t\t};\n\t\t46EE1807204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;\n\t\t\tremoteInfo = \"fishhook-tvOS\";\n\t\t};\n\t\t46EE1819204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EBF21BDC1FC498900052F4D5;\n\t\t\tremoteInfo = jsinspector;\n\t\t};\n\t\t46EE181B204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EBF21BFA1FC4989A0052F4D5;\n\t\t\tremoteInfo = \"jsinspector-tvOS\";\n\t\t};\n\t\t46EE181D204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;\n\t\t\tremoteInfo = \"third-party\";\n\t\t};\n\t\t46EE181F204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D383D3C1EBD27B6005632C8;\n\t\t\tremoteInfo = \"third-party-tvOS\";\n\t\t};\n\t\t46EE1821204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 139D7E881E25C6D100323FB7;\n\t\t\tremoteInfo = \"double-conversion\";\n\t\t};\n\t\t46EE1823204743A500FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D383D621EBD27B9005632C8;\n\t\t\tremoteInfo = \"double-conversion-tvOS\";\n\t\t};\n\t\t46EE185F2047463E00FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46EE185A2047463E00FAAB0E /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTAnimation;\n\t\t};\n\t\t46EE18612047463E00FAAB0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46EE185A2047463E00FAAB0E /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28201D9B03D100D4039D;\n\t\t\tremoteInfo = \"RCTAnimation-tvOS\";\n\t\t};\n\t\t78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\t832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tCC0F353E1D461097008BB94F /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTActionSheet.xcodeproj; path = \"../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTGeolocation.xcodeproj; path = \"../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = \"../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = \"../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTVibration.xcodeproj; path = \"../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = \"<group>\"; };\n\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = \"<group>\"; };\n\t\t146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = \"../node_modules/react-native/React/React.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t461BBF3322788D6F0069D237 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n\t\t46EE185A2047463E00FAAB0E /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native/Libraries/Text/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t461BBF5F22788D6F0069D237 /* JavaScriptCore.framework in Frameworks */,\n\t\t\t\t46EE18632047465300FAAB0E /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */,\n\t\t\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,\n\t\t\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,\n\t\t\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,\n\t\t\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,\n\t\t\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n\t\t\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,\n\t\t\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t00C302A81ABCB8CE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302B61ABCB90400DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302BC1ABCB91800DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,\n\t\t\t\t392FDE1E1E2E5F680058768A /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302D41ABCB9D200DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,\n\t\t\t\t392FDE261E2E5F680058768A /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302E01ABCB9EE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356EF1AD99517003FC87E /* exampleTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F21AD99517003FC87E /* exampleTests.m */,\n\t\t\t\t00E356F01AD99517003FC87E /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = exampleTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356F01AD99517003FC87E /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F11AD99517003FC87E /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139105B71AF99BAD00B5F7CC /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,\n\t\t\t\t392FDE2A1E2E5F680058768A /* libRCTSettings-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDEE71B06529A00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,\n\t\t\t\t392FDE331E2E5F680058768A /* libRCTWebSocket-tvOS.a */,\n\t\t\t\t46EE1806204743A500FAAB0E /* libfishhook.a */,\n\t\t\t\t46EE1808204743A500FAAB0E /* libfishhook-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* example */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t);\n\t\t\tname = example;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t146834001AC3E56700842450 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t146834041AC3E56700842450 /* libReact.a */,\n\t\t\t\t392FDE3D1E2E5F680058768A /* libReact.a */,\n\t\t\t\t392FDE3F1E2E5F680058768A /* libyoga.a */,\n\t\t\t\t392FDE411E2E5F680058768A /* libyoga.a */,\n\t\t\t\t392FDE431E2E5F680058768A /* libcxxreact.a */,\n\t\t\t\t392FDE451E2E5F680058768A /* libcxxreact.a */,\n\t\t\t\t46EE181A204743A500FAAB0E /* libjsinspector.a */,\n\t\t\t\t46EE181C204743A500FAAB0E /* libjsinspector-tvOS.a */,\n\t\t\t\t46EE181E204743A500FAAB0E /* libthird-party.a */,\n\t\t\t\t46EE1820204743A500FAAB0E /* libthird-party.a */,\n\t\t\t\t46EE1822204743A500FAAB0E /* libdouble-conversion.a */,\n\t\t\t\t46EE1824204743A500FAAB0E /* libdouble-conversion.a */,\n\t\t\t\t461BBF5822788D6F0069D237 /* libjsi.a */,\n\t\t\t\t461BBF5A22788D6F0069D237 /* libjsiexecutor.a */,\n\t\t\t\t461BBF5C22788D6F0069D237 /* libjsi-tvOS.a */,\n\t\t\t\t461BBF5E22788D6F0069D237 /* libjsiexecutor-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46EE185B2047463E00FAAB0E /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46EE18602047463E00FAAB0E /* libRCTAnimation.a */,\n\t\t\t\t46EE18622047463E00FAAB0E /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t78C398B11ACF4ADC00677621 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */,\n\t\t\t\t392FDE221E2E5F680058768A /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46EE185A2047463E00FAAB0E /* RCTAnimation.xcodeproj */,\n\t\t\t\t146833FF1AC3E56700842450 /* React.xcodeproj */,\n\t\t\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,\n\t\t\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,\n\t\t\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,\n\t\t\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,\n\t\t\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n\t\t\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,\n\t\t\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n\t\t\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,\n\t\t\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341B11AAA6A8300B99B32 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */,\n\t\t\t\t392FDE2E1E2E5F680058768A /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* example */,\n\t\t\t\tCCFA7DE41D11D22600E15EDF /* Frameworks */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t00E356EF1AD99517003FC87E /* exampleTests */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* example.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tCCFA7DE41D11D22600E15EDF /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t461BBF3322788D6F0069D237 /* JavaScriptCore.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t13B07F861A680F5B00A75B9A /* example */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t\tCC0F353E1D461097008BB94F /* Embed Frameworks */,\n\t\t\t\t7D57265F10EEF7CD92D7973F /* Copy Detox Framework */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = example;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* example.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\tEnglish,\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 46EE185B2047463E00FAAB0E /* Products */;\n\t\t\t\t\tProjectRef = 46EE185A2047463E00FAAB0E /* RCTAnimation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 78C398B11ACF4ADC00677621 /* Products */;\n\t\t\t\t\tProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;\n\t\t\t\t\tProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 832341B11AAA6A8300B99B32 /* Products */;\n\t\t\t\t\tProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDEE71B06529A00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 146834001AC3E56700842450 /* Products */;\n\t\t\t\t\tProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* example */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTActionSheet.a;\n\t\t\tremoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTGeolocation.a;\n\t\t\tremoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTVibration.a;\n\t\t\tremoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTSettings.a;\n\t\t\tremoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t146834041AC3E56700842450 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE1E1E2E5F680058768A /* libRCTImage-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTImage-tvOS.a\";\n\t\t\tremoteRef = 392FDE1D1E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE221E2E5F680058768A /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tremoteRef = 392FDE211E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE261E2E5F680058768A /* libRCTNetwork-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTNetwork-tvOS.a\";\n\t\t\tremoteRef = 392FDE251E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE2A1E2E5F680058768A /* libRCTSettings-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTSettings-tvOS.a\";\n\t\t\tremoteRef = 392FDE291E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE2E1E2E5F680058768A /* libRCTText-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTText-tvOS.a\";\n\t\t\tremoteRef = 392FDE2D1E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE331E2E5F680058768A /* libRCTWebSocket-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTWebSocket-tvOS.a\";\n\t\t\tremoteRef = 392FDE321E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE3D1E2E5F680058768A /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 392FDE3C1E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE3F1E2E5F680058768A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 392FDE3E1E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE411E2E5F680058768A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 392FDE401E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE431E2E5F680058768A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 392FDE421E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t392FDE451E2E5F680058768A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 392FDE441E2E5F680058768A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t461BBF5822788D6F0069D237 /* libjsi.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjsi.a;\n\t\t\tremoteRef = 461BBF5722788D6F0069D237 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t461BBF5A22788D6F0069D237 /* libjsiexecutor.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjsiexecutor.a;\n\t\t\tremoteRef = 461BBF5922788D6F0069D237 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t461BBF5C22788D6F0069D237 /* libjsi-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsi-tvOS.a\";\n\t\t\tremoteRef = 461BBF5B22788D6F0069D237 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t461BBF5E22788D6F0069D237 /* libjsiexecutor-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsiexecutor-tvOS.a\";\n\t\t\tremoteRef = 461BBF5D22788D6F0069D237 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE1806204743A500FAAB0E /* libfishhook.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libfishhook.a;\n\t\t\tremoteRef = 46EE1805204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE1808204743A500FAAB0E /* libfishhook-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libfishhook-tvOS.a\";\n\t\t\tremoteRef = 46EE1807204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE181A204743A500FAAB0E /* libjsinspector.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjsinspector.a;\n\t\t\tremoteRef = 46EE1819204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE181C204743A500FAAB0E /* libjsinspector-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsinspector-tvOS.a\";\n\t\t\tremoteRef = 46EE181B204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE181E204743A500FAAB0E /* libthird-party.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libthird-party.a\";\n\t\t\tremoteRef = 46EE181D204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE1820204743A500FAAB0E /* libthird-party.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libthird-party.a\";\n\t\t\tremoteRef = 46EE181F204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE1822204743A500FAAB0E /* libdouble-conversion.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libdouble-conversion.a\";\n\t\t\tremoteRef = 46EE1821204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE1824204743A500FAAB0E /* libdouble-conversion.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libdouble-conversion.a\";\n\t\t\tremoteRef = 46EE1823204743A500FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE18602047463E00FAAB0E /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 46EE185F2047463E00FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46EE18622047463E00FAAB0E /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 46EE18612047463E00FAAB0E /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native/scripts/react-native-xcode.sh\";\n\t\t};\n\t\t7D57265F10EEF7CD92D7973F /* Copy Detox Framework */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Copy Detox Framework\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/bash;\n\t\t\tshellScript = \"if [ -n \\\"$DEPLOY_DETOX_FRAMEWORK\\\" ]; then\\nmkdir -p \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\ncp -r \\\"${PROJECT_DIR}\\\"/../node_modules/detox/Detox.framework \\\"${BUILT_PRODUCTS_DIR}\\\"/\\\"${FRAMEWORKS_FOLDER_PATH}\\\"\\nfi\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FB21A68108700A75B9A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tpath = example;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-F\\\"${CODESIGNING_FOLDER_PATH}\\\"/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.react.native;\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-F\\\"${CODESIGNING_FOLDER_PATH}\\\"/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.wix.demo.react.native;\n\t\t\t\tPRODUCT_NAME = example;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"example\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"example.app\"\n               BlueprintName = \"example\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Release\"\n      selectedDebuggerIdentifier = \"\"\n      selectedLauncherIdentifier = \"Xcode.IDEFoundation.Launcher.PosixSpawn\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"example.app\"\n               BlueprintName = \"example\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"exampleTests.xctest\"\n               BlueprintName = \"exampleTests\"\n               ReferencedContainer = \"container:example.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"example.app\"\n            BlueprintName = \"example\"\n            ReferencedContainer = \"container:example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/exampleTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/ios/exampleTests/exampleTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTLog.h>\n#import <React/RCTRootView.h>\n\n#define TIMEOUT_SECONDS 600\n#define TEXT_TO_LOOK_FOR @\"Welcome to React Native!\"\n\n@interface exampleTests : XCTestCase\n\n@end\n\n@implementation exampleTests\n\n- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test\n{\n  if (test(view)) {\n    return YES;\n  }\n  for (UIView *subview in [view subviews]) {\n    if ([self findSubviewInView:subview matching:test]) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n- (void)testRendersWelcomeScreen\n{\n  UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];\n  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];\n  BOOL foundElement = NO;\n\n  __block NSString *redboxError = nil;\n  RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {\n    if (level >= RCTLogLevelError) {\n      redboxError = message;\n    }\n  });\n\n  while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {\n    [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n    [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n\n    foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {\n      if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {\n        return YES;\n      }\n      return NO;\n    }];\n  }\n\n  RCTSetLogFunction(RCTDefaultLogFunction);\n\n  XCTAssertNil(redboxError, @\"RedBox error: %@\", redboxError);\n  XCTAssertTrue(foundElement, @\"Couldn't find element with text '%@' in %d seconds\", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);\n}\n\n\n@end\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/metro.config.js",
    "content": "const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');\n\n/**\n * Metro configuration\n * https://facebook.github.io/metro/docs/configuration\n */\nconst config = {\n  resolver: {\n    blockList: [/test\\/.*/, /detox\\/node_modules\\/.*/],\n  },\n};\n\nmodule.exports = mergeConfig(getDefaultConfig(__dirname), config);\n"
  },
  {
    "path": "examples/demo-react-native-detox-instruments/package.json",
    "content": "{\n  \"name\": \"demo-react-native-detox-instruments\",\n  \"version\": \"20.46.0\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"detox\": \"workspace:*\"\n  },\n  \"detox\": {\n    \"configurations\": {\n      \"ios.sim.release\": {\n        \"binaryPath\": \"../demo-react-native/ios/build/Build/Products/Release-iphonesimulator/example.app\",\n        \"type\": \"ios.simulator\",\n        \"name\": \"iPhone 15 Pro Max\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "generation/.prettierignore",
    "content": "package.json\npackage-lock.json\n\n"
  },
  {
    "path": "generation/README.md",
    "content": "# Generation\n\nThis part of the repository aims to automate the adaption of the underlying testing frameworks.\nFor now, it only covers `EarlGrey`’s `GREYActions`.\n\nWe chose to check the generated files into version control to have them available as documentation.\n\nTo correlate changes to the generation with changes in the generated code, please make sure to run the build before every commit.\n\n## Development\n\n- `npm install`\n- `npm run build` builds every file specified in the `index.js`\n- `npm test`\n\n## Testing\n\n- We test with integration level tests by having a fixture Objective-C file which we generate and import before the tests.\n- We only add unit tests for code that is used in production, e.g. helper functions.\n- We then test against this file to ensure that the code generation result works with the specified interface.\n- We decided to base our tests around snapshot tests with the goal to spot mistakes in the return values of the functions without over-specification.\n- If you add functionality that affects the API surface of detox, please also make sure to include [End to End tests for it](../detox/test/e2e).\n\n## Resources\n\nParsing, ASTs, and code generation are hard topics but don’t worry; we got your back.\nHere are some resources that might come in handy:\n\n- [astexplorer](https://astexplorer.net): Allows you to understand Abstract Syntax Trees by showing you code and the resulting AST side-by-side.\n- [Babel Handbook](https://github.com/thejameskyle/babel-handbook):\n- [babel-types](https://github.com/babel/babel/tree/master/packages/babel-types): A builder library for ASTs.\n- [babel-template](https://github.com/babel/babel/tree/master/packages/babel-template): A useful tool we do not use yet for generating bigger ASTs with less code by the usage of string interpolation.\n- [regex101](https://regex101.com): You might need to extract parts of a string; This tool helps you to quickly build the right Regular Expression for the job.\n"
  },
  {
    "path": "generation/__tests__/__snapshots__/android.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Android generation methods should add a sanitizer for the function with the correct name 1`] = `\n{\n  \"args\": [\n    {\n      \"type\": \"Integer\",\n      \"value\": 4,\n    },\n    {\n      \"type\": \"Double\",\n      \"value\": 42,\n    },\n  ],\n  \"method\": \"scrollInDirection\",\n  \"target\": {\n    \"type\": \"Class\",\n    \"value\": \"com.wix.detox.espresso.DetoxAction\",\n  },\n}\n`;\n\nexports[`Android generation methods should generate type checks 1`] = `\"times should be a number, but got FOO (string)\"`;\n\nexports[`Android generation methods should return adapter calls 1`] = `\n{\n  \"args\": [\n    {\n      \"type\": \"Integer\",\n      \"value\": 3,\n    },\n  ],\n  \"method\": \"multiClick\",\n  \"target\": {\n    \"type\": \"Class\",\n    \"value\": \"com.wix.detox.espresso.DetoxAction\",\n  },\n}\n`;\n"
  },
  {
    "path": "generation/__tests__/__snapshots__/global-functions.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`globals sanitize_android_direction should fail with unknown value 1`] = `\"direction must be a 'left'/'right'/'up'/'down', got kittens\"`;\n\nexports[`globals sanitize_android_edge should fail with unknown value 1`] = `\"edge must be a 'left'/'right'/'top'/'bottom', got kittens\"`;\n\nexports[`globals sanitize_greyContentEdge should fail with unknown value 1`] = `\"GREYAction.GREYContentEdge must be a 'left'/'right'/'top'/'bottom', got kittens\"`;\n\nexports[`globals sanitize_greyDirection should fail with unknown value 1`] = `\"GREYAction.GREYDirection must be a 'left'/'right'/'up'/'down', got kittens\"`;\n\nexports[`globals sanitize_greyPinchDirection should fail with unknown value 1`] = `\"GREYAction.GREYPinchDirection must be a 'outward'/'inward', got kittens\"`;\n\nexports[`globals sanitize_uiAccessibilityTraits should throw if unknown trait is accessed 1`] = `\"Unknown trait 'unknown', see list in https://facebook.github.io/react-native/docs/accessibility.html#accessibilitytraits-ios\"`;\n"
  },
  {
    "path": "generation/__tests__/__snapshots__/helpers.js.snap",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`helpers methodNameToSnakeCase should return the correct snake case method name 1`] = `\"actionForScrollInDirectionAmountXOriginStartPercentageYOriginStartPercentage\"`;\n"
  },
  {
    "path": "generation/__tests__/android.js",
    "content": "const fs = require('fs');\nconst remove = require('remove');\nconst androidGenerator = require('../adapters/android');\n\ndescribe('Android generation', () => {\n  let ExampleClass;\n  let exampleContent;\n  beforeAll(() => {\n    // Generate the code to test\n    fs.mkdirSync('./__tests__/generated-android');\n\n    const files = {\n      './fixtures/example.java': './__tests__/generated-android/example.js'\n    };\n\n    console.log('==> generating android files');\n    androidGenerator(files);\n\n    console.log('==> loading android files');\n    // Load\n    ExampleClass = require('./generated-android/example.js');\n    exampleContent = fs.readFileSync('./__tests__/generated-android/example.js', 'utf8');\n  });\n\n  afterAll(() => {\n    // Clean up\n    remove.removeSync('./__tests__/generated-android');\n  });\n\n  describe('methods', () => {\n    it('should expose the functions', () => {\n      expect(ExampleClass.multiClick).toBeInstanceOf(Function);\n    });\n\n    it('should generate type checks', () => {\n      expect(() => {\n        ExampleClass.multiClick('FOO');\n      }).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should return adapter calls', () => {\n      const result = ExampleClass.multiClick(3);\n      expect(result.method).toBe('multiClick');\n      expect(result.target.value).toBe('com.wix.detox.espresso.DetoxAction');\n      expect(result.args[0].type).toBe('Integer');\n      expect(result.args[0].value).toBe(3);\n\n      expect(result).toMatchSnapshot();\n    });\n\n    it('should add a sanitizer for the function with the correct name', () => {\n      const fn = ExampleClass.scrollInDirection;\n\n      expect(() => {\n        fn(3, 42);\n      }).toThrow();\n\n      expect(() => {\n        fn('down', 42);\n      }).not.toThrow();\n\n      expect(fn('down', 42)).toMatchSnapshot();\n    });\n  });\n\n  describe('validation', () => {\n    describe('Matcher<View>', () => {\n      it(\"should succeed with the 'right' class\", () => {\n        // stub for matcher class\n        class Matcher {\n          _call() {\n            return {\n              target: { type: 'Class', value: 'Detox.Matcher' },\n              method: 'matchNicely'\n            };\n          }\n        }\n\n        const m = new Matcher();\n        expect(() => {\n          ExampleClass.matcherForAnd(m, m);\n        }).not.toThrow();\n      });\n    });\n  });\n\n  describe('method overloading', () => {\n    it('should distinguish between one and two argument call of method', () => {\n      expect(ExampleClass.overloadable(true, 42)).toEqual({\n        args: [\n          { type: 'boolean', value: true },\n          { type: 'Integer', value: 42 }\n        ],\n        method: 'overloadable',\n        target: { type: 'Class', value: 'com.wix.detox.espresso.DetoxAction' }\n      });\n\n      expect(ExampleClass.overloadable(true)).toEqual({\n        args: [{ type: 'boolean', value: true }],\n        method: 'overloadable',\n        target: { type: 'Class', value: 'com.wix.detox.espresso.DetoxAction' }\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "generation/__tests__/global-functions.js",
    "content": "const globals = require('../core/global-functions');\n\ndescribe('globals', () => {\n  describe('sanitize_android_direction', () => {\n    it('should return numbers for strings', () => {\n      expect(globals.sanitize_android_direction('left')).toBe(1);\n      expect(globals.sanitize_android_direction('right')).toBe(2);\n      expect(globals.sanitize_android_direction('up')).toBe(3);\n      expect(globals.sanitize_android_direction('down')).toBe(4);\n    });\n\n    it('should fail with unknown value', () => {\n      expect(() => {\n        globals.sanitize_android_direction('kittens');\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('sanitize_android_edge', () => {\n    it('should return numbers for strings', () => {\n      expect(globals.sanitize_android_edge('left')).toBe(1);\n      expect(globals.sanitize_android_edge('right')).toBe(2);\n      expect(globals.sanitize_android_edge('top')).toBe(3);\n      expect(globals.sanitize_android_edge('bottom')).toBe(4);\n    });\n\n    it('should fail with unknown value', () => {\n      expect(() => {\n        globals.sanitize_android_edge('kittens');\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('sanitize_greyDirection', () => {\n    it('should return numbers for strings', () => {\n      expect(globals.sanitize_greyDirection('left')).toBe(1);\n      expect(globals.sanitize_greyDirection('right')).toBe(2);\n      expect(globals.sanitize_greyDirection('up')).toBe(3);\n      expect(globals.sanitize_greyDirection('down')).toBe(4);\n    });\n\n    it('should fail with unknown value', () => {\n      expect(() => {\n        globals.sanitize_greyDirection('kittens');\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n  describe('sanitize_greyPinchDirection', () => {\n    it('should return numbers for strings', () => {\n      expect(globals.sanitize_greyPinchDirection('outward')).toBe(1);\n      expect(globals.sanitize_greyPinchDirection('inward')).toBe(2);\n    });\n\n    it('should fail with unknown value', () => {\n      expect(() => {\n        globals.sanitize_greyPinchDirection('kittens');\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('sanitize_greyContentEdge', () => {\n    it('should return numbers for strings', () => {\n      expect(globals.sanitize_greyContentEdge('left')).toBe(0);\n      expect(globals.sanitize_greyContentEdge('right')).toBe(1);\n      expect(globals.sanitize_greyContentEdge('top')).toBe(2);\n      expect(globals.sanitize_greyContentEdge('bottom')).toBe(3);\n    });\n\n    it('should fail with unknown value', () => {\n      expect(() => {\n        globals.sanitize_greyContentEdge('kittens');\n      }).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  describe('sanitize_uiAccessibilityTraits', () => {\n    it('should return numbers for traits', () => {\n      expect(globals.sanitize_uiAccessibilityTraits(['button'])).toBe(1);\n      expect(globals.sanitize_uiAccessibilityTraits(['image'])).toBe(4);\n      expect(globals.sanitize_uiAccessibilityTraits(['header'])).toBe(65536);\n\n      [\n        'button',\n        'link',\n        'header',\n        'search',\n        'image',\n        'selected',\n        'plays',\n        'key',\n        'text',\n        'summary',\n        'disabled',\n        'frequentUpdates',\n        'startsMedia',\n        'adjustable',\n        'allowsDirectInteraction',\n        'pageTurn'\n      ].forEach((trait) => {\n        expect(typeof globals.sanitize_uiAccessibilityTraits([trait])).toBe('number');\n      });\n    });\n    it('should combine the traits', () => {\n      expect(globals.sanitize_uiAccessibilityTraits(['summary', 'allowsDirectInteraction'])).toBe(8320);\n    });\n\n    it('should throw if unknown trait is accessed', () => {\n      expect(() => globals.sanitize_uiAccessibilityTraits(['unknown'])).toThrowErrorMatchingSnapshot();\n    });\n  });\n\n  const matcherInvocation = {\n    target: { type: 'Class', value: 'Detox.Matcher' },\n    method: 'matchNicely'\n  };\n  describe('sanitize_matcher', () => {\n    it(\"should return the object if it's no function\", () => {\n      expect(globals.sanitize_matcher({ _call: matcherInvocation })).toEqual(matcherInvocation);\n    });\n\n    it(\"should return the ._call property if it's a function\", () => {\n      const matcherLikeObj = { _call: () => matcherInvocation };\n      expect(globals.sanitize_matcher(matcherLikeObj)).toEqual(matcherInvocation);\n    });\n\n    it(\"should unwrap the object if it's in an invocation\", () => {\n      const invoke = { type: 'Invocation', value: matcherInvocation };\n      const invokeCalled = { _call: invoke };\n      const invokeThunk = { _call: () => invoke };\n\n      expect(globals.sanitize_matcher(invokeCalled)).toEqual(matcherInvocation);\n      expect(globals.sanitize_matcher(invokeThunk)).toEqual(matcherInvocation);\n    });\n\n    it('should not call on string', () => {\n      const matcherLikeObj = {\n        _call: 'I am a call'\n      };\n      expect(globals.sanitize_matcher(matcherLikeObj)).toBe('I am a call');\n    });\n\n    it('should not get _call property if it is not present', () => {\n      const unwrappedMatcher = 'I am a call';\n      expect(globals.sanitize_matcher(unwrappedMatcher)).toBe('I am a call');\n    });\n  });\n\n  describe('sanitize_greyElementInteraction', () => {\n    it('should wrap the argument in an invocation', () => {\n      expect(globals.sanitize_greyElementInteraction('Foo')).toEqual({\n        type: 'Invocation',\n        value: 'Foo'\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "generation/__tests__/helpers.js",
    "content": "const { methodNameToSnakeCase } = require('../helpers');\n\ndescribe('helpers', () => {\n  describe('methodNameToSnakeCase', () => {\n    it('should not fail with empty string', () => {\n      expect(() => methodNameToSnakeCase('')).not.toThrow();\n    });\n\n    it('should return the correct snake case method name', () => {\n      expect(methodNameToSnakeCase('actionForScrollInDirection:amount:xOriginStartPercentage:yOriginStartPercentage:')).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "generation/adapters/android.js",
    "content": "const generator = require('../core/generator');\nconst { callGlobal } = require('../helpers');\n\nconst { isNumber, isString, isBoolean, isArray, isDefined } = require('../core/type-checks');\n\nconst typeCheckInterfaces = {\n  'ArrayList<String>': isArray,\n  'ArrayList<Object>': isArray,\n  'Matcher<View>': null, // isOfClass('Matcher') would be better,\n  boolean: isBoolean,\n  Double: isNumber,\n  Integer: isNumber,\n  String: isString,\n  ViewAction: null, // there are optional view actions\n  ViewInteraction: null,\n  WebElement: null,\n  'Atom<List<ElementReference>>': null\n};\n\nconst contentSanitizersForFunction = {\n  scrollInDirection: {\n    argumentName: 'direction',\n    newType: 'String',\n    name: 'sanitize_android_direction',\n    value: callGlobal('sanitize_android_direction')\n  },\n  scrollInDirectionStaleAtEdge: {\n    argumentName: 'direction',\n    newType: 'String',\n    name: 'sanitize_android_direction',\n    value: callGlobal('sanitize_android_direction')\n  },\n  swipeInDirection: {\n    argumentName: 'direction',\n    newType: 'String',\n    name: 'sanitize_android_direction',\n    value: callGlobal('sanitize_android_direction')\n  },\n  scrollToEdge: {\n    argumentName: 'edge',\n    newType: 'String',\n    name: 'sanitize_android_edge',\n    value: callGlobal('sanitize_android_edge')\n  },\n  'Matcher<View>': {\n    type: 'String',\n    name: 'sanitize_matcher',\n    value: callGlobal('sanitize_matcher')\n  }\n};\n\nconst contentSanitizersForType = {\n  'Matcher<View>': {\n    type: 'Invocation',\n    name: 'sanitize_matcher',\n    value: callGlobal('sanitize_matcher')\n  }\n};\n\nmodule.exports = generator({\n  typeCheckInterfaces,\n  contentSanitizersForFunction,\n  contentSanitizersForType,\n  supportedTypes: [\n    'ArrayList<String>',\n    'ArrayList<Object>',\n    'boolean',\n    'double',\n    'Double',\n    'float',\n    'Float',\n    'int',\n    'Integer',\n    'Matcher<View>',\n    'String',\n    'ViewAction',\n    'ViewInteraction',\n    'WebElement',\n    'Atom<List<ElementReference>>'\n  ],\n  renameTypesMap: {\n    int: 'Integer', // TODO: add test\n    double: 'Double',\n    ViewInteraction: 'Invocation',\n    WebInteraction: 'Invocation',\n    WebElement: 'Invocation',\n    'Atom<List<ElementReference>>': 'Invocation'\n  },\n  classValue: ({ package: pkg, name }) => `${pkg}.${name}`\n});\n"
  },
  {
    "path": "generation/check-for-git-changes.sh",
    "content": "#!/bin/bash\n\nset -e\n\nisGitClean=true\nif [ -z \"$(git status --porcelain)\" ]; then\n  isGitClean=true\nelse\n  isGitClean=false\nfi\n\nif [ \"isGitClean\" = true ] ; then\n    git stash\nfi\n\nnpm run build\n\ngitDiff=`git --no-pager diff -- .. \":(exclude)../**/package.json\"`\nif [[ -n \"${gitDiff}\" ]]; then\n    printf \"\\n\\n\"\n    echo \"There seem to be changes after running the code generation.\"\n    echo \"This might be because you updated a native dependency and forgot to run the code generation.\"\n    echo \"If this is the case run 'cd generation && npm run build'\"\n    printf \"\\n\"\n    echo \"Another source of this error might be that you have changed generated code and checked it in.\"\n    echo \"You should not be doing this, please change the source of the generated code and not the code itself.\"\n    printf \"\\n\"\n    echo \"Diff summary:\"\n    echo \"${gitDiff}\"\n\n    if [ \"isGitClean\" = true ] ; then\n      git stash pop\n    fi\n    exit 1\nelse\n    if [ \"isGitClean\" = true ] ; then\n      git stash pop\n    fi\nfi\n"
  },
  {
    "path": "generation/core/generator.js",
    "content": "const t = require('@babel/types');\nconst template = require('@babel/template').default;\nconst generate = require('@babel/generator').default;\nconst javaMethodParser = require('java-method-parser');\nconst fs = require('fs');\nconst path = require('path');\n\nconst { methodNameToSnakeCase } = require('../helpers');\nlet globalFunctionUsage = {};\nmodule.exports = function getGenerator({\n  typeCheckInterfaces,\n  renameTypesMap,\n  supportedTypes,\n  classValue,\n  contentSanitizersForFunction,\n  contentSanitizersForType,\n  blacklistedFunctionNames = []\n}) {\n  function createClass(json) {\n    return t.classDeclaration(\n      t.identifier(json.name),\n      null,\n      t.classBody(\n        json.methods\n          .filter(filterMethodsWithUnsupportedParams)\n          .filter(filterMethodsWithBlacklistedName)\n          .reduce(handleOverloadedMethods, [])\n          .map(createMethod.bind(null, json))\n      ),\n      []\n    );\n  }\n\n  function filterMethodsWithBlacklistedName({ name }) {\n    return !blacklistedFunctionNames.find((blacklisted) => name.indexOf(blacklisted) !== -1);\n  }\n\n  function filterMethodsWithUnsupportedParams(method) {\n    return method.args.reduce((carry, methodArg) => {\n      if (methodArg === null) {\n        console.error(method);\n      }\n      return carry && supportedTypes.includes(methodArg.type);\n    }, true);\n  }\n\n  function handleOverloadedMethods(list, method) {\n    const methodInstance = {\n      args: method.args\n    };\n\n    const firstDeclaration = list.find((item) => item.name === method.name);\n    if (firstDeclaration) {\n      firstDeclaration.instances.push(methodInstance);\n      return list;\n    }\n\n    return list.concat(Object.assign({}, method, { instances: [methodInstance] }));\n  }\n\n  function createExport(json) {\n    return t.expressionStatement(\n      t.assignmentExpression('=', t.memberExpression(t.identifier('module'), t.identifier('exports'), false), t.identifier(json.name))\n    );\n  }\n\n  const blacklistedArgumentTypes = ['__strong NSError **'];\n  function filterBlacklistedArguments(arg) {\n    return !blacklistedArgumentTypes.includes(arg.type);\n  }\n\n  function createMethod(classJson, json) {\n    const isOverloading = json.instances.length > 1;\n    if (isOverloading && hasProblematicOverloading(json.instances)) {\n      console.log(classJson, json);\n      throw 'Could not handle this overloaded method';\n    }\n\n    json.args = json.args.filter(filterBlacklistedArguments);\n    // Args might be unused due to overloading\n    const args = json.args.map(({ name }) => t.identifier(name));\n\n    if (!json.static) {\n      const prefixedArgs = [t.identifier('element')];\n      args.unshift(...prefixedArgs);\n      json.prefixedArgs = prefixedArgs;\n    }\n\n    const body = isOverloading ? createOverloadedMethodBody(classJson, json) : createMethodBody(classJson, json);\n\n    const m = t.classMethod('method', t.identifier(methodNameToSnakeCase(json.name)), args, body, false, true);\n\n    if (json.comment) {\n      t.addComment(m, 'leading', json.comment);\n    }\n    return m;\n  }\n\n  function createOverloadedMethodBody(classJson, json) {\n    const sanitizedName = methodNameToSnakeCase(json.name);\n    // Lets create an inline function for each of the instances\n    // for this let's construct a JSON like we would need it\n    // name: thisName_argLength\n    // static: false\n    // args: instance.args\n    // Let's check the length of the call and use the matching one of the instances then\n\n    const overloadFunctionExpressions = json.instances.map(({ args }) => {\n      const params = [...(json.prefixedArgs || []), ...args];\n      return t.functionDeclaration(\n        t.identifier(sanitizedName + params.length),\n        params.filter(filterBlacklistedArguments).map(({ name }) => t.identifier(name)),\n        createMethodBody(classJson, Object.assign({}, json, { args }))\n      );\n    });\n\n    const offset = (json.prefixedArgs || []).length;\n    const returnStatementsForNumber = (num) =>\n      template(`\n      if (arguments.length === ${num + offset}) {\n        return ${sanitizedName + (num + offset)}.apply(null, arguments);\n      }\n    `)();\n\n    const returns = json.instances.map(({ args }) => returnStatementsForNumber(args.length));\n\n    return t.blockStatement([...overloadFunctionExpressions, ...returns]);\n  }\n\n  // We don't handle same lengthed argument sets right now.\n  // In the future we could write the type checks in a way that\n  // would allow us to do an either or switch in this case\n  function hasProblematicOverloading(instances) {\n    // Check if there are same lengthed argument sets\n    const knownLengths = [];\n    return instances\n      .map(({ args }) => args.length)\n      .reduce((carry, item) => {\n        if (carry || knownLengths.some((l) => l === item)) {\n          return true;\n        }\n\n        knownLengths.push(item);\n        return false;\n      }, false);\n  }\n\n  function sanitizeArgumentType(json) {\n    if (renameTypesMap[json.type]) {\n      return Object.assign({}, json, {\n        type: renameTypesMap[json.type]\n      });\n    }\n    return json;\n  }\n\n  function createMethodBody(classJson, json) {\n    const sanitizedJson = Object.assign({}, json, {\n      args: json.args.map((argJson) => sanitizeArgumentType(argJson))\n    });\n\n    const allTypeChecks = createTypeChecks(sanitizedJson, sanitizedJson.name).reduce(\n      (carry, item) => (item instanceof Array ? [...carry, ...item] : [...carry, item]),\n      []\n    );\n    const typeChecks = allTypeChecks.filter((check) => typeof check === 'object' && check.type !== 'EmptyStatement');\n    const returnStatement = createReturnStatement(classJson, sanitizedJson);\n    return t.blockStatement([...typeChecks, returnStatement]);\n  }\n\n  function createTypeChecks(json, functionName) {\n    const checks = json.args.map((arg) => createTypeCheck(arg, functionName));\n    checks.filter((check) => Boolean(check));\n    return checks;\n  }\n\n  function addArgumentContentSanitizerCall(json, functionName) {\n    if (contentSanitizersForType[json.type]) {\n      globalFunctionUsage[contentSanitizersForType[json.type].name] = true;\n      return contentSanitizersForType[json.type].value(json.name);\n    }\n\n    if (contentSanitizersForFunction[functionName] && contentSanitizersForFunction[functionName].argumentName === json.name) {\n      globalFunctionUsage[contentSanitizersForFunction[functionName].name] = true;\n      return contentSanitizersForFunction[functionName].value(json.name);\n    }\n\n    return t.identifier(json.name);\n  }\n\n  function addArgumentTypeSanitizer(json) {\n    if (contentSanitizersForType[json.type]) {\n      return contentSanitizersForType[json.type].type;\n    }\n\n    return json.type;\n  }\n\n  // These types need no wrapping with {type: ..., value: }\n  const plainArgumentTypes = [\n    'id',\n    'id<GREYAction>',\n    'id<GREYMatcher>',\n    'GREYElementInteraction*',\n    'String',\n    'ArrayList<Object>',\n    'ArrayList<String>',\n    'ViewAction'\n  ];\n\n  function shouldBeWrapped({ type }) {\n    return !plainArgumentTypes.includes(type);\n  }\n\n  function createReturnStatement(classJson, json) {\n    const args = json.args.map((arg) =>\n      shouldBeWrapped(arg)\n        ? t.objectExpression([\n            t.objectProperty(t.identifier('type'), t.stringLiteral(addArgumentTypeSanitizer(arg))),\n            t.objectProperty(t.identifier('value'), addArgumentContentSanitizerCall(arg, json.name))\n          ])\n        : addArgumentContentSanitizerCall(arg, json.name)\n    );\n\n    return t.returnStatement(\n      t.objectExpression([\n        t.objectProperty(\n          t.identifier('target'),\n          json.static\n            ? t.objectExpression([\n                t.objectProperty(t.identifier('type'), t.stringLiteral('Class')),\n                t.objectProperty(t.identifier('value'), t.stringLiteral(classValue(classJson)))\n              ])\n            : t.identifier('element')\n        ),\n        t.objectProperty(t.identifier('method'), t.stringLiteral(json.name)),\n        t.objectProperty(t.identifier('args'), t.arrayExpression(args))\n      ])\n    );\n  }\n\n  function createTypeCheck(json, functionName) {\n    const optionalSanitizer = contentSanitizersForFunction[functionName];\n    const type = optionalSanitizer && optionalSanitizer.argumentName === json.name ? optionalSanitizer.newType : json.type;\n    const typeCheckCreator = typeCheckInterfaces[type];\n    const isListOfChecks = typeCheckCreator instanceof Array;\n    return isListOfChecks\n      ? typeCheckCreator.map((singleCheck) => singleCheck(json, functionName))\n      : typeCheckCreator instanceof Function\n      ? typeCheckCreator(json, functionName)\n      : t.emptyStatement();\n  }\n\n  function createLogImport(pathFragments) {\n    const fragments = [...pathFragments];\n    fragments.pop(); // remove filename\n    const outputPath = fragments.join('/');\n    const absoluteUtilsPath = path.resolve('../detox/src/utils');\n    const relativeUtilsPath = path.relative(outputPath, absoluteUtilsPath);\n\n    return `const log = require('${relativeUtilsPath}/logger').child({ __filename });\\n` + `const util = require('util');\\n`;\n  }\n\n  return function generator(files) {\n    Object.entries(files).forEach(([inputFile, outputFile]) => {\n      console.log(`\\n\\r${inputFile} => ${outputFile}`);\n\n      globalFunctionUsage = {};\n      const input = fs.readFileSync(inputFile, 'utf8');\n      const json = javaMethodParser(input);\n\n      // set default name\n      const pathFragments = outputFile.split('/');\n      if (!json.name) {\n        json.name = pathFragments[pathFragments.length - 1].replace('.js', '');\n      }\n      const ast = t.program([createClass(json), createExport(json)]);\n      const output = generate(ast);\n\n      const commentBefore = '/**\\n\\n\\tThis code is generated.\\n\\tFor more information see generation/README.md.\\n*/\\n\\n';\n\n      // Add global helper functions\n      const globalFunctionsStr = fs.readFileSync(__dirname + '/global-functions.js', 'utf8');\n      const globalFunctionsSource = globalFunctionsStr.substr(0, globalFunctionsStr.indexOf('module.exports'));\n\n      // Only include global functions that are actually used\n      const usedGlobalFunctions = Object.entries(globalFunctionUsage)\n        .filter(([key, value]) => value)\n        .map(([key]) => key);\n      const globalFunctions = usedGlobalFunctions\n        .map((name) => {\n          const start = globalFunctionsSource.indexOf(`function ${name}`);\n          const end = globalFunctionsSource.indexOf(`// END ${name}`);\n          return globalFunctionsSource.substr(start, end - start);\n        })\n        .join('\\n');\n\n      // TODO: add createLogImport(pathFragments) again\n      const code = [commentBefore, globalFunctions, output.code].join('\\n');\n      fs.writeFileSync(outputFile, code, 'utf8');\n\n      // Output methods that were not created due to missing argument support\n      const unsupportedMethods = json.methods.filter((x) => !filterMethodsWithUnsupportedParams(x));\n      if (unsupportedMethods.length) {\n        console.log(`Could not generate the following methods for ${json.name}`);\n        unsupportedMethods.forEach((method) => {\n          const methodArgs = method.args.filter((methodArg) => !supportedTypes.includes(methodArg.type)).map((methodArg) => methodArg.type);\n          console.log(`\\t ${method.name} misses ${methodArgs}`);\n        });\n      }\n    });\n  };\n};\n"
  },
  {
    "path": "generation/core/global-functions.js",
    "content": "// Globally declared helpers\n// Each function needs to end with }// END function_name so that it can be\n// dynamically included while generating\n\nfunction sanitize_android_direction(direction) {\n  switch (direction) {\n    case 'left':\n      return 1;\n    case 'right':\n      return 2;\n    case 'up':\n      return 3;\n    case 'down':\n      return 4;\n    default:\n      throw new Error(`direction must be a 'left'/'right'/'up'/'down', got ${direction}`);\n  }\n} // END sanitize_android_direction\n\nfunction sanitize_android_edge(edge) {\n  switch (edge) {\n    case 'left':\n      return 1;\n    case 'right':\n      return 2;\n    case 'top':\n      return 3;\n    case 'bottom':\n      return 4;\n    default:\n      throw new Error(`edge must be a 'left'/'right'/'top'/'bottom', got ${edge}`);\n  }\n} // END sanitize_android_edge\n\nfunction sanitize_greyDirection(action) {\n  switch (action) {\n    case 'left':\n      return 1;\n    case 'right':\n      return 2;\n    case 'up':\n      return 3;\n    case 'down':\n      return 4;\n\n    default:\n      throw new Error(`GREYAction.GREYDirection must be a 'left'/'right'/'up'/'down', got ${action}`);\n  }\n} // END sanitize_greyDirection\n\nfunction sanitize_greyPinchDirection(action) {\n  switch (action) {\n    case 'outward':\n      return 1;\n    case 'inward':\n      return 2;\n\n    default:\n      throw new Error(`GREYAction.GREYPinchDirection must be a 'outward'/'inward', got ${action}`);\n  }\n} // END sanitize_greyPinchDirection\n\nfunction sanitize_greyContentEdge(action) {\n  switch (action) {\n    case 'left':\n      return 0;\n    case 'right':\n      return 1;\n    case 'top':\n      return 2;\n    case 'bottom':\n      return 3;\n\n    default:\n      throw new Error(`GREYAction.GREYContentEdge must be a 'left'/'right'/'top'/'bottom', got ${action}`);\n  }\n} // END sanitize_greyContentEdge\n\nfunction sanitize_uiAccessibilityTraits(value) {\n  let traits = 0;\n  for (let i = 0; i < value.length; i++) {\n    switch (value[i]) {\n      case 'button':\n        traits |= 1;\n        break;\n      case 'link':\n        traits |= 2;\n        break;\n      case 'image':\n        traits |= 4;\n        break;\n      case 'selected':\n        traits |= 8;\n        break;\n      case 'plays':\n        traits |= 16;\n        break;\n      case 'key':\n        traits |= 32;\n        break;\n      case 'text':\n        traits |= 64;\n        break;\n      case 'summary':\n        traits |= 128;\n        break;\n      case 'disabled':\n        traits |= 256;\n        break;\n      case 'frequentUpdates':\n        traits |= 512;\n        break;\n      case 'search':\n        traits |= 1024;\n        break;\n      case 'startsMedia':\n        traits |= 2048;\n        break;\n      case 'adjustable':\n        traits |= 4096;\n        break;\n      case 'allowsDirectInteraction':\n        traits |= 8192;\n        break;\n      case 'pageTurn':\n        traits |= 16384;\n        break;\n      case 'tabBar':\n        traits |= 32768;\n        break;\n      case 'header':\n        traits |= 65536;\n        break;\n      default:\n        throw new Error(\n          `Unknown trait '${value[i]}', see list in https://facebook.github.io/react-native/docs/accessibility.html#accessibilitytraits-ios`\n        );\n    }\n  }\n\n  return traits;\n} // END sanitize_uiAccessibilityTraits\n\nfunction sanitize_matcher(matcher) {\n  if (!matcher._call) {\n    return matcher;\n  }\n\n  const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call;\n  return originalMatcher.type ? originalMatcher.value : originalMatcher;\n} // END sanitize_matcher\n\nfunction sanitize_greyElementInteraction(value) {\n  return {\n    type: 'Invocation',\n    value\n  };\n} // END sanitize_greyElementInteraction\n\nfunction sanitize_uiDeviceOrientation(value) {\n  const orientationMapping = {\n    landscape: 3, // top at left side landscape\n    portrait: 1 // non-reversed portrait\n  };\n\n  return orientationMapping[value];\n} // END sanitize_uiDeviceOrientation\n\nmodule.exports = {\n  sanitize_greyDirection,\n  sanitize_greyPinchDirection,\n  sanitize_greyContentEdge,\n  sanitize_uiAccessibilityTraits,\n  sanitize_android_direction,\n  sanitize_android_edge,\n  sanitize_matcher,\n  sanitize_greyElementInteraction,\n  sanitize_uiDeviceOrientation\n};\n"
  },
  {
    "path": "generation/core/type-checks.js",
    "content": "const t = require('@babel/types');\nconst template = require('@babel/template').default;\nconst { generateTypeCheck, generateIsOneOfCheck } = require('babel-generate-guard-clauses');\n\nconst templateFromString = (templateStr, argValue) =>\n  template(templateStr, {\n    placeholderPattern: false,\n    placeholderWhitelist: new Set(['ARG'])\n  })({\n    ARG: argValue\n  });\n\nconst isNumber = generateTypeCheck('number');\nconst isString = generateTypeCheck('string');\nconst isBoolean = generateTypeCheck('boolean');\nconst isPoint = [\n  generateTypeCheck('object'),\n  generateTypeCheck('number', { selector: 'x' }),\n  generateTypeCheck('number', { selector: 'y' })\n];\nconst isOneOf = generateIsOneOfCheck;\nfunction isGreyMatcher({ name }) {\n  return templateFromString(\n    `\n  if (\n    typeof ARG !== \"object\" ||\n    ARG.type !== \"Invocation\" ||\n    typeof ARG.value !== \"object\" ||\n    typeof ARG.value.target !== \"object\" ||\n    ARG.value.target.value !== \"GREYMatchers\"\n  ) {\n    throw new Error('${name} should be a GREYMatcher, but got ' + JSON.stringify(ARG));\n  }\n`,\n    t.identifier(name)\n  );\n}\n\nfunction isGreyAction({ name }) {\n  return templateFromString(\n    `\n  if (\n    typeof ARG !== \"object\" ||\n    ARG.type !== \"Invocation\" ||\n    typeof ARG.value !== \"object\" ||\n    typeof ARG.value.target !== \"object\" ||\n    ARG.value.target.value !== \"GREYActions\"\n  ) {\n    throw new Error('${name} should be a GREYAction, but got ' + JSON.stringify(ARG));\n    }\n`,\n    t.identifier(name)\n  );\n}\n\nfunction isGreyElementInteraction({ name }) {\n  return templateFromString(\n    `\n  if (\n    typeof ARG !== \"object\"\n  ) {\n\t\t// TODO: This currently only checks for object, we should add more fine grained checks here\n    throw new Error('${name} should be a GREYElementInteraction, but got ' + JSON.stringify(ARG));\n  }\n`,\n    t.identifier(name)\n  );\n}\nfunction isArray({ name }) {\n  return templateFromString(\n    `\nif (\n  (typeof ARG !== 'object') ||\n  !Array.isArray(ARG)\n) {\n    throw new Error('${name} must be an array, got ' + typeof ARG);\n  }\n`,\n    t.identifier(name)\n  );\n}\n\nfunction isDefined() {\n  return ({ name }) =>\n    templateFromString(\n      `\n\tif (!ARG) {\n\t\tthrow new Error('${name} should be truthy, but it is \"' + ARG + '\"');\n\t}\n\t`,\n      t.identifier(name)\n    );\n}\n\nmodule.exports = {\n  isNumber,\n  isString,\n  isBoolean,\n  isPoint,\n  isOneOf,\n  isGreyAction,\n  isGreyMatcher,\n  isArray,\n  isGreyElementInteraction,\n  isDefined\n};\n"
  },
  {
    "path": "generation/fixtures/example.java",
    "content": "package com.wix.detox.espresso;\n\nimport android.support.test.espresso.UiController;\nimport android.support.test.espresso.ViewAction;\nimport android.support.test.espresso.action.CoordinatesProvider;\nimport android.support.test.espresso.action.GeneralClickAction;\nimport android.support.test.espresso.action.GeneralLocation;\nimport android.support.test.espresso.action.GeneralSwipeAction;\nimport android.support.test.espresso.action.Press;\nimport android.support.test.espresso.action.Swipe;\nimport android.support.test.espresso.action.Tap;\nimport android.view.InputDevice;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.widget.AbsListView;\nimport android.widget.HorizontalScrollView;\nimport android.widget.ScrollView;\n\nimport org.hamcrest.Matcher;\n\nimport static android.support.test.espresso.action.ViewActions.actionWithAssertions;\nimport static android.support.test.espresso.action.ViewActions.swipeDown;\nimport static android.support.test.espresso.action.ViewActions.swipeLeft;\nimport static android.support.test.espresso.action.ViewActions.swipeRight;\nimport static android.support.test.espresso.action.ViewActions.swipeUp;\nimport static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;\nimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static org.hamcrest.Matchers.allOf;\n\n/**\n * Created by simonracz on 10/07/2017.\n */\n\npublic class DetoxAction {\n    private static final String LOG_TAG = \"detox\";\n\n    private DetoxAction() {\n        // static class\n    }\n\n    public static ViewAction multiClick(int times) {\n        return actionWithAssertions(\n                new GeneralClickAction(new MultiTap(times), GeneralLocation.CENTER, Press.FINGER, 0, 0));\n    }\n\n    public static ViewAction tapAtLocation(final int x, final int y) {\n        final int px = UiAutomatorHelper.convertDiptoPix(x);\n        final int py = UiAutomatorHelper.convertDiptoPix(y);\n        CoordinatesProvider c = new CoordinatesProvider() {\n            @Override\n            public float[] calculateCoordinates(View view) {\n                final int[] xy = new int[2];\n                view.getLocationOnScreen(xy);\n                final float fx = xy[0] + px;\n                final float fy = xy[1] + py;\n                float[] coordinates = { fx, fy };\n                return coordinates;\n            }\n        };\n        return actionWithAssertions(new GeneralClickAction(Tap.SINGLE, c, Press.FINGER, InputDevice.SOURCE_UNKNOWN,\n                MotionEvent.BUTTON_PRIMARY));\n    }\n\n    /**\n     * Scrolls to the edge of the given scrollable view.\n     *\n     * Edge 1 -> Left 2 -> Right 3 -> Top 4 -> Bottom\n     *\n     * @param edge\n     * @return ViewAction\n     */\n    public static ViewAction scrollToEdge(final int edge) {\n        return actionWithAssertions(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return allOf(isAssignableFrom(View.class), isDisplayed());\n            }\n\n            @Override\n            public String getDescription() {\n                return \"scrollToEdge\";\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                Class<?> recyclerViewClass = null;\n                try {\n                    recyclerViewClass = Class.forName(RecyclerViewScrollListener.CLASS_RECYCLERVIEW);\n                } catch (ClassNotFoundException e) {\n                    // ok\n                }\n                if (view instanceof AbsListView) {\n                    RNScrollListener l = new RNScrollListener((AbsListView) view);\n                    do {\n                        ScrollHelper.performOnce(uiController, view, edge);\n                    } while (l.didScroll());\n                    l.cleanup();\n                } else if (view instanceof ScrollView) {\n                    int prevScrollY = view.getScrollY();\n                    while (true) {\n                        ScrollHelper.performOnce(uiController, view, edge);\n                        int currentScrollY = view.getScrollY();\n                        if (currentScrollY == prevScrollY)\n                            break;\n                        prevScrollY = currentScrollY;\n                    }\n                } else if (view instanceof HorizontalScrollView) {\n                    int prevScrollX = view.getScrollX();\n                    while (true) {\n                        ScrollHelper.performOnce(uiController, view, edge);\n                        int currentScrollX = view.getScrollX();\n                        if (currentScrollX == prevScrollX)\n                            break;\n                        prevScrollX = currentScrollX;\n                    }\n                } else if (recyclerViewClass != null && recyclerViewClass.isInstance(view)) {\n                    RecyclerViewScrollListener l = new RecyclerViewScrollListener(view);\n                    do {\n                        ScrollHelper.performOnce(uiController, view, edge);\n                    } while (l.didScroll());\n                    l.cleanup();\n                } else {\n                    throw new RuntimeException(\n                            \"Only descendants of AbsListView, ScrollView, HorizontalScrollView and RecyclerView are supported\");\n                }\n            }\n        });\n    }\n\n    /**\n     * Scrolls the View in a direction by the Density Independent Pixel amount.\n     *\n     * Direction 1 -> left 2 -> Right 3 -> Up 4 -> Down\n     *\n     * @param direction  Direction to scroll\n     * @param amountInDP Density Independent Pixels\n     *\n     */\n    public static ViewAction scrollInDirection(final int direction, final double amountInDP) {\n        return actionWithAssertions(new ViewAction() {\n            @Override\n            public Matcher<View> getConstraints() {\n                return allOf(isAssignableFrom(View.class), isDisplayed());\n            }\n\n            @Override\n            public String getDescription() {\n                return \"scrollInDirection\";\n            }\n\n            @Override\n            public void perform(UiController uiController, View view) {\n                ScrollHelper.perform(uiController, view, direction, amountInDP);\n            }\n        });\n    }\n\n    private final static float EDGE_FUZZ_FACTOR = 0.083f;\n\n    /**\n     * Swipes the View in a direction.\n     *\n     * Direction 1 -> left 2 -> Right 3 -> Up 4 -> Down\n     *\n     * @param direction Direction to scroll\n     * @param fast      true if fast, false if slow\n     *\n     */\n    public static ViewAction swipeInDirection(final int direction, boolean fast) {\n        if (fast) {\n            switch (direction) {\n            case 1:\n                return swipeLeft();\n            case 2:\n                return swipeRight();\n            case 3:\n                return swipeUp();\n            case 4:\n                return swipeDown();\n            default:\n                throw new RuntimeException(\"Unsupported swipe direction: \" + direction);\n            }\n        }\n        switch (direction) {\n        case 1:\n            return actionWithAssertions(\n                    new GeneralSwipeAction(Swipe.SLOW, translate(GeneralLocation.CENTER_RIGHT, -EDGE_FUZZ_FACTOR, 0),\n                            GeneralLocation.CENTER_LEFT, Press.FINGER));\n        case 2:\n            return actionWithAssertions(\n                    new GeneralSwipeAction(Swipe.SLOW, translate(GeneralLocation.CENTER_LEFT, EDGE_FUZZ_FACTOR, 0),\n                            GeneralLocation.CENTER_RIGHT, Press.FINGER));\n        case 3:\n            return actionWithAssertions(\n                    new GeneralSwipeAction(Swipe.SLOW, translate(GeneralLocation.BOTTOM_CENTER, 0, -EDGE_FUZZ_FACTOR),\n                            GeneralLocation.TOP_CENTER, Press.FINGER));\n        case 4:\n            return actionWithAssertions(\n                    new GeneralSwipeAction(Swipe.SLOW, translate(GeneralLocation.TOP_CENTER, 0, EDGE_FUZZ_FACTOR),\n                            GeneralLocation.BOTTOM_CENTER, Press.FINGER));\n        default:\n            throw new RuntimeException(\"Unsupported swipe direction: \" + direction);\n        }\n    }\n\n    private static CoordinatesProvider translate(final CoordinatesProvider coords, final float dx, final float dy) {\n        return new CoordinatesProvider() {\n            @Override\n            public float[] calculateCoordinates(View view) {\n                float xy[] = coords.calculateCoordinates(view);\n                xy[0] += dx * view.getWidth();\n                xy[1] += dy * view.getHeight();\n                return xy;\n            }\n        };\n    }\n\n    public static Matcher<View> matcherForAnd(Matcher<View> m1, Matcher<View> m2) {\n        return allOf(m1, m2);\n    }\n\n    public static boolean overloadable(boolean one) {\n        return true;\n    }\n\n    public static boolean overloadable(boolean one, int two) {\n        return false;\n    }\n}"
  },
  {
    "path": "generation/helpers.js",
    "content": "const t = require(\"@babel/types\");\n\nfunction capitalizeFirstLetter(string) {\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction methodNameToSnakeCase(name) {\n  return name\n          .split(':')\n          .map((item, index) => \n            index === 0 ? item : capitalizeFirstLetter(item)\n          ).join('');\n}\n\nfunction callGlobal(sanitizerName) {\n  return argIdentifier =>\n    t.callExpression(t.identifier(sanitizerName), [t.identifier(argIdentifier)]);\n}\n\nmodule.exports = {\n  methodNameToSnakeCase,\n  callGlobal\n};"
  },
  {
    "path": "generation/index.js",
    "content": "#!/usr/bin/env node\nconst generateAndroidAdapters = require('./adapters/android');\nconst downloadEspressoFileByClass = require('./utils/downloadEspresso');\nconst downloadFile = require('./utils/downloadFile');\n\nconst espressoFilesToDownload = {\n  'androidx.test.espresso.action.ViewActions': '../detox/src/android/espressoapi/ViewActions.js'\n};\n\nconst externalFilesToDownload = {\n  // TODO replace this with the non-deprecated version of UiDevice (i.e. released as uiautomator under androidx).\n  // This is pending because the new code doesn't seem to exist online (not even on android/android-test on Github).\n  // Note: for now, it appears that the 'new' (androidx) and 'old' versions are identical (except for the package name, obviously).\n\n  // Disabled so as to avoid having to download this each time while there are no code changes...\n  // 'https://android.googlesource.com/platform/frameworks/uiautomator/+/master/src/com/android/uiautomator/core/UiDevice.java?format=TEXT': '../detox/src/android/espressoapi/UIDevice.js'\n};\n\nfunction createAndroidFiles() {\n  const downloadedEspressoFilesMap =\n    Object\n      .entries(espressoFilesToDownload)\n      .reduce(function (obj, [fullyQualifiedClass, dest]) {\n          obj[downloadEspressoFileByClass(fullyQualifiedClass)] = dest;\n          return obj;\n        }, {}\n      );\n\n  const downloadedAndroidFilesMap =\n    Object\n      .entries(externalFilesToDownload)\n      .reduce(function (obj, [url, dest]) {\n          obj[downloadFile(url, 'base64')] = dest;\n          return obj;\n        }, {}\n      );\n\n  return {\n    ...downloadedAndroidFilesMap,\n    ...downloadedEspressoFilesMap,\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java': '../detox/src/android/espressoapi/DetoxAction.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxAssertion.java': '../detox/src/android/espressoapi/DetoxAssertion.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxViewActions.java': '../detox/src/android/espressoapi/DetoxViewActions.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/DetoxMatcher.java': '../detox/src/android/espressoapi/DetoxMatcher.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/Detox.java': '../detox/src/android/espressoapi/Detox.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/EspressoDetox.java': '../detox/src/android/espressoapi/EspressoDetox.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/uiautomator/UiAutomator.java': '../detox/src/android/espressoapi/UIAutomator.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/web/EspressoWebDetox.java': '../detox/src/android/espressoapi/web/EspressoWebDetox.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java': '../detox/src/android/espressoapi/web/DetoxWebAtomMatcher.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java': '../detox/src/android/espressoapi/web/WebViewElement.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java': '../detox/src/android/espressoapi/web/WebElement.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebExpect.java': '../detox/src/android/espressoapi/web/WebExpect.js',\n    '../detox/android/detox/src/full/java/com/wix/detox/genymotion/DetoxGenymotionManager.java': '../detox/src/android/espressoapi/DetoxGenymotionManager.js'\n  };\n}\n\ngenerateAndroidAdapters(createAndroidFiles());\n"
  },
  {
    "path": "generation/package.json",
    "content": "{\n  \"name\": \"generation\",\n  \"version\": \"20.41.0\",\n  \"description\": \"Generate wrapper code for native dependencies\",\n  \"main\": \"index.js\",\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"./index.js\",\n    \"pretest\": \"./check-for-git-changes.sh\",\n    \"test\": \"jest\",\n    \"precommit\": \"lint-staged\",\n    \"format\": \"prettier ./**/*.{js,json,css,md} --write\"\n  },\n  \"author\": \"DanielMSchmidt <danielmschmidt92@gmail.com>\",\n  \"license\": \"MIT\",\n  \"lint-staged\": {\n    \"*.{js,json,css,md}\": [\n      \"prettier --write\",\n      \"git add\"\n    ]\n  },\n  \"dependencies\": {\n    \"@babel/generator\": \"7.0.0-beta.49\",\n    \"@babel/template\": \"7.0.0-beta.49\",\n    \"@babel/types\": \"7.0.0-beta.49\",\n    \"babel-generate-guard-clauses\": \"3.0.0-1\",\n    \"java-method-parser\": \"0.4.7\",\n    \"remove\": \"0.1.5\",\n    \"uuid\": \"^3.2.1\"\n  },\n  \"devDependencies\": {\n    \"jest\": \"^30.0.3\",\n    \"jest-allure2-reporter\": \"^2.2.6\",\n    \"lint-staged\": \"^6.0.0\",\n    \"prettier\": \"^1.8.2\"\n  },\n  \"jest\": {\n    \"coveragePathIgnorePatterns\": [\n      \"<rootDir>/index.js\"\n    ],\n    \"coverageThreshold\": {\n      \"global\": {\n        \"statements\": 100,\n        \"branches\": 100,\n        \"functions\": 100,\n        \"lines\": 100\n      }\n    },\n    \"resetMocks\": true,\n    \"resetModules\": true,\n    \"reporters\": [\n      \"default\",\n      \"jest-allure2-reporter\"\n    ],\n    \"testEnvironment\": \"jest-allure2-reporter/environment-node\"\n  }\n}\n"
  },
  {
    "path": "generation/utils/__tests__/downloadFile.js",
    "content": "describe(\"download-file util\", () => {\n  const OS_TMP_DIR = \"/tmp/ponies\";\n\n  let mockDownloadedContent;\n  let fs;\n  let downloadFile;\n\n  beforeEach(() => {\n    jest.mock(\"os\", () => ({\n      tmpdir: jest.fn(),\n    }));\n    require(\"os\").tmpdir.mockReturnValue(OS_TMP_DIR);\n\n    jest.mock(\"fs\", () => ({\n      writeFileSync: jest.fn(),\n    }));\n    fs = require(\"fs\");\n\n    jest.mock(\"child_process\", () => ({\n      execFileSync: () => mockDownloadedContent\n    }));\n\n    downloadFile = require(\"../downloadFile\");\n  });\n\n  it(\"should save content to the temp dir file\", () => {\n    mockDownloadedContent = 'can haz teh c0dez';\n\n    downloadFile(\"foo.bar\" /*, encoding = \"none\" */);\n\n    expect(fs.writeFileSync).toHaveBeenCalled();\n    const call = fs.writeFileSync.mock.calls[0];\n    expect(call[0]).toContain(OS_TMP_DIR);\n    expect(call[0]).toContain(\".java\");\n    expect(call[1]).toEqual(mockDownloadedContent);\n  });\n\n  it(\"should save the base64 decoded content to the temp dir file\", () => {\n    mockDownloadedContent = \"cGFja2FnZSBhbmRyb2lkLnN1cHBvcnQudGVzdC5lc3ByZXNzbzsNCmltcG9ydCBhbmRyb2lkLnZpZXcuVmlld0NvbmZpZ3VyYXRpb247DQoNCmltcG9ydCBvcmcuaGFtY3Jlc3QuTWF0Y2hlcjsNCg0KaW1wb3J0IGphdmEudXRpbC5MaXN0Ow0KDQovKioNCiAqIEVudHJ5IHBvaW50IHRvIHRoZSBFc3ByZXNzbyBmcmFtZXdvcmsuIFRlc3QgYXV0aG9ycyBjYW4gaW5pdGlhdGUgdGVzdGluZyBieSB1c2luZyBvbmUgb2YgdGhlIG9uKg0KICogbWV0aG9kcyAoZS5nLiBvblZpZXcpIG9yIH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BvblZpZXcoZmluYWwgTWF0Y2hlcjxWaWV3PiB2aWV3TWF0Y2hlcikgew0KICAgIHJldHVybiBCQVNFLnBsdXMobmV3IFZpZXdJbnRlcmFjdGlvbk1vZHVsZSh2aWV3TWF0Y2hlcikpLnZpZXdJbnRlcmFjdGlvbigpOw0KICB9DQp9\";\n\n    downloadFile(\"foo.bar\", \"base64\");\n\n    expect(fs.writeFileSync).toHaveBeenCalled();\n    const call = fs.writeFileSync.mock.calls[0];\n    expect(call[1]).toEqual(\n      expect.stringContaining(\"public final class Espresso {\")\n    );\n  });\n});\n"
  },
  {
    "path": "generation/utils/downloadEspresso.js",
    "content": "// Gets a fully qualified class path of espresso and downloads it in a temp dir\nconst downloadFile = require('./downloadFile');\n\nmodule.exports = function downloadEspresso(fullyQualifiedClass) {\n  const path = fullyQualifiedClass.replace(/\\./g, '/');\n  return downloadFile(`https://raw.githubusercontent.com/android/android-test/androidx-test-1.1.0/espresso/core/java/${path}.java`);\n};\n"
  },
  {
    "path": "generation/utils/downloadFile.js",
    "content": "const cp = require('child_process');\nconst os = require('os');\nconst fs = require('fs');\nconst URL = require('url');\nconst uuidv4 = require('uuid/v4');\n\nfunction dumpCertificate(url, port = 443) {\n  const execOptions = {\n    encoding: 'utf8',\n    stdio: ['ignore', 'pipe', 'inherit'],\n    timeout: 5000\n  };\n\n  let host = URL.parse(url).host;\n  if (!host.includes(':')) {\n    host += ':443';\n  }\n\n  const args = ['s_client', '-CApath', '/etc/ssl/certs/', '-showcerts', '-connect', host];\n  console.log(['openssl', ...args].join(' '));\n\n  return cp.execFileSync('openssl', args, execOptions);\n}\n\nfunction downloadFileSync(url) {\n  const flags = ['--silent', '--show-error', '-L'];\n  const execOptions = {\n    encoding: 'utf8'\n  };\n\n  try {\n    return cp.execFileSync('curl', [...flags, url], execOptions);\n  } catch (e) {\n    if (e.stderr.indexOf('SSL certificate problem') >= 0) {\n      console.log('\\nDumping SSL certificate details:\\n');\n      console.log(dumpCertificate(url));\n    }\n\n    throw e;\n  }\n}\n\nmodule.exports = function downloadJava(url, encoding = 'none') {\n  const tmpDir = os.tmpdir();\n  const fileContent = downloadFileSync(url);\n\n  let result = fileContent;\n  if (encoding === 'base64') {\n    result = Buffer.from(fileContent, 'base64').toString('ascii');\n  }\n\n  const filePath = tmpDir + `/${uuidv4()}.java`;\n  fs.writeFileSync(filePath, result);\n  return filePath;\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"root\",\n  \"private\": true,\n  \"packageManager\": \"yarn@4.12.0\",\n  \"workspaces\": [\n    \"detox\",\n    \"detox-cli\",\n    \"detox/test\",\n    \"examples/*\",\n    \"generation\",\n    \"website\"\n  ],\n  \"scripts\": {\n    \"prepare\": \"husky\",\n    \"docs:markdownlint\": \"markdownlint -p .remarkignore '**/*.md'\",\n    \"docs:remark\": \"remark .\",\n    \"docs:lint\": \"yarn docs:markdownlint && yarn docs:remark\",\n    \"docs:fix\": \"yarn docs:remark -o && yarn docs:markdownlint --fix\",\n    \"test:e2e:ios\": \"cd detox/test && yarn e2e:ios\",\n    \"test:e2e:android\": \"cd detox/test && yarn e2e:android\",\n    \"release\": \"node scripts/ci.release.js\",\n    \"package:android\": \"node scripts/ci.android-release.js\",\n    \"package:ios\": \"scripts/ci.ios-release.sh\",\n    \"ci:ios\": \"sh ./scripts/ci.ios.sh\",\n    \"ci:android\": \"sh ./scripts/ci.android.sh\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/wix/Detox.git\"\n  },\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"devDependencies\": {\n    \"chalk\": \"^4.0.0\",\n    \"dictionary-en\": \"^3.1.0\",\n    \"husky\": \"^9.0.0\",\n    \"lodash\": \"4.17.x\",\n    \"markdownlint-cli\": \"^0.29.0\",\n    \"remark\": \"^14.0.1\",\n    \"remark-cli\": \"^10.0.0\",\n    \"remark-frontmatter\": \"^4.0.1\",\n    \"remark-gfm\": \"^3.0.1\",\n    \"remark-github\": \"^11.2.2\",\n    \"remark-lint-no-dead-urls\": \"^1.1.0\",\n    \"remark-retext\": \"^5.0.1\",\n    \"remark-validate-links\": \"^11.0.2\",\n    \"retext-contractions\": \"^5.1.0\",\n    \"retext-diacritics\": \"^4.1.0\",\n    \"retext-english\": \"^4.1.0\",\n    \"retext-equality\": \"^6.5.0\",\n    \"retext-indefinite-article\": \"^3.1.0\",\n    \"retext-intensify\": \"^6.1.0\",\n    \"retext-passive\": \"^4.1.0\",\n    \"retext-profanities\": \"^7.1.0\",\n    \"retext-readability\": \"^7.1.0\",\n    \"retext-redundant-acronyms\": \"^4.2.0\",\n    \"retext-repeated-words\": \"^4.1.0\",\n    \"retext-sentence-spacing\": \"^5.1.0\",\n    \"retext-simplify\": \"^7.1.0\",\n    \"retext-spell\": \"^5.1.0\",\n    \"retext-syntax-mentions\": \"^3.1.0\",\n    \"retext-syntax-urls\": \"^3.1.1\",\n    \"semver\": \"5.x.x\",\n    \"shell-utils\": \"1.x.x\",\n    \"surge\": \"^0.24.0\",\n    \"unified\": \"^10.1.0\",\n    \"zx\": \"^8.0.0\"\n  },\n  \"version\": \"20.47.0\"\n}\n"
  },
  {
    "path": "scripts/aggregate_coverage.sh",
    "content": "#!/usr/bin/env bash\n\nif [ -d aggregated-coverage ]; then\n  npm install --no-save --no-package-lock \"lcov-result-merger@3.x.x\" \"coveralls@3.x.x\"\n\n  echo \"Merging LCOV files\"\n  rm -f \"aggregated-coverage/merged.lcov\"\n  node_modules/.bin/lcov-result-merger 'aggregated-coverage/**/*.lcov' \"aggregated-coverage/merged.lcov\"\n\n  echo \"Uploading to coveralls\"\n  { cat \"aggregated-coverage/merged.lcov\" | node_modules/.bin/coveralls; } || echo \"Failed to aggregate the test coverage, skipping.\"\nelse\n  echo \"Aggregated coverage directory was not found, skipping.\"\nfi\n"
  },
  {
    "path": "scripts/assets.uml.sh",
    "content": "#!/usr/bin/env bash\n\nplantuml -tsvg docs/uml/**/*.uml\nmkdir -p docs/img/uml\nmv docs/uml/**/*.svg docs/img/uml\n\n"
  },
  {
    "path": "scripts/change_all_react_native_versions.sh",
    "content": "#!/bin/bash -ex\n\nif [ ! -z ${REACT_NATIVE_VERSION} ]; then\n  node scripts/change_react_native_version.js \"examples/demo-react-native\" ${REACT_NATIVE_VERSION} \"dependencies\"\n  node scripts/change_react_native_version.js \"detox/test\" ${REACT_NATIVE_VERSION} \"dependencies\"\n  node scripts/change_react_native_version.js \"detox\" ${REACT_NATIVE_VERSION} \"devDependencies\"\n\n  # Update lockfile for the new RN version\n  yarn install --mode update-lockfile\nfi\n"
  },
  {
    "path": "scripts/change_react_native_version.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst https = require('https');\n\nasync function run() {\n  const projectPath = process.argv[2];\n  const reactNativeVersion = process.argv[3];\n  const depsSection = process.argv[4] || 'dependencies';\n\n  const filePath = path.join(process.cwd(), projectPath, 'package.json');\n  console.log(`Trying to change react-native dependency in  ${filePath}`);\n\n  let packageJson = require(filePath);\n\n  if (depsSection === 'devDependencies') {\n    console.log(`Changed dependency:\n      react-native: ${reactNativeVersion}`);\n    packageJson.devDependencies['react-native'] = reactNativeVersion;\n  } else {\n    const data = await fetch(`https://registry.npmjs.org/react-native/${reactNativeVersion}`);\n    const reactVersion = data.peerDependencies.react.replace('^', '');\n\n    console.log(`Changed dependencies:\n      react-native: ${reactNativeVersion}\n      react: ${reactVersion}`);\n\n    packageJson.dependencies['react'] = reactVersion;\n    packageJson.dependencies['react-native'] = reactNativeVersion;\n  }\n\n  updateReactNative73DevDependencies(reactNativeVersion, packageJson);\n  updateReactNative77DevDependencies(reactNativeVersion, packageJson);\n\n  fs.writeFileSync(filePath, JSON.stringify(packageJson, null, 2));\n}\n\nfunction updateReactNative73DevDependencies(reactNativeVersion, packageJson) {\n  const minorVersion = reactNativeVersion.split('.')[1];\n  if (minorVersion !== '73') {\n    return;\n  }\n\n  packageJson.devDependencies['@react-native/babel-preset'] = '0.73.21';\n  packageJson.devDependencies['@react-native/eslint-config'] = '0.73.2';\n  packageJson.devDependencies['@react-native/metro-config'] = '0.73.5';\n  packageJson.devDependencies['@react-native/typescript-config'] = '0.73.1';\n\n  delete packageJson.devDependencies['@react-native-community/cli'];\n  delete packageJson.devDependencies['@react-native-community/cli-platform-android'];\n  delete packageJson.devDependencies['@react-native-community/cli-platform-ios'];\n}\n\nfunction updateReactNative77DevDependencies(reactNativeVersion, packageJson) {\n  const minorVersion = reactNativeVersion.split('.')[1];\n  if (minorVersion !== '77') {\n    return;\n  }\n\n  packageJson.devDependencies['@react-native/babel-preset'] = '0.77.2';\n  packageJson.devDependencies['@react-native/eslint-config'] = '0.77.2';\n  packageJson.devDependencies['@react-native/metro-config'] = '0.77.2';\n  packageJson.devDependencies['@react-native/typescript-config'] = '0.77.2';\n  packageJson.devDependencies['@react-native-community/cli'] = '15.0.1';\n  packageJson.devDependencies['@react-native-community/cli-platform-android'] = '15.0.1';\n  packageJson.devDependencies['@react-native-community/cli-platform-ios'] = '15.0.1';\n}\n\nasync function fetch(url) {\n  return new Promise((resolve, reject) => {\n    https.get(url, res => {\n      res.setEncoding('utf8');\n      let body = \"\";\n      res.on('data', data => {\n        body += data;\n      });\n      res.on('end', () => {\n        body = JSON.parse(body);\n        resolve(body);\n      });\n      res.on('error', (error) => {\n        reject(error);\n      });\n    });\n  });\n}\n\nrun();\n"
  },
  {
    "path": "scripts/ci.android-release.js",
    "content": "const exec = require('shell-utils').exec;\nconst {log, logSection, getVersionSafe, getReleaseNpmTag, getReleaseVersionType} = require('./utils/releaseArgs');\n\nfunction run() {\n  logSection('Initializing');\n  exec.execSync('bash scripts/change_all_react_native_versions.sh')\n  exec.execSync('yarn install');\n\n  const versionType = getReleaseVersionType();\n  logSection(`Pre-calculating future version... (versionType=${versionType})`);\n\n  const npmTag = getReleaseNpmTag();\n  const preid = versionType.includes(\"pre\") ? `--preid=${npmTag}` : '';\n  exec.execSync(`npm version ${versionType} ${preid} --no-git-tag-version`);\n  const futureVersion = getVersionSafe();\n  log('Version is: ' + futureVersion);\n\n  logSection('Packing up Android artifacts...');\n  log('Accepting all Android SDK licenses...');\n  exec.execSync(`yes | ${process.env.ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses`);\n  process.chdir('detox/android');\n  exec.execSync(`./gradlew clean detox:publish -Dversion=${futureVersion}`);\n  process.chdir('../Detox-android/');\n  exec.execSync(`tar -zcf ARCHIVE_${futureVersion}.tgz *`);\n  process.chdir(`../../`);\n}\n\nrun();\n"
  },
  {
    "path": "scripts/ci.android.sh",
    "content": "#!/bin/bash -ex\n\nUPLOAD_ARTIFACT=\"$(pwd)/scripts/upload_artifact.sh\"\ntrap \"$UPLOAD_ARTIFACT\" EXIT\n\n### Approve unapproved SDK licenses\nyes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses\n\nsource $(dirname \"$0\")/ci.sh\n\n### JS integration tests\npushd detox/test\nrun_f \"yarn integration\"\npopd\n\n### Android native unit tests\npushd detox/android\nrun_f \"yarn unit:android-release\"\npopd\n\nmkdir -p coverage\n\n### E2E self-tests\npushd detox/test\n\nrun_f \"yarn build:android-debug\" # Workaround for asyncstorage issue https://github.com/react-native-async-storage/async-storage/issues/1216. Can be removed after fixing it\nrun_f \"yarn build:android\"\n\nrun_f \"yarn e2e:android\"\ncp coverage/lcov.info ../../coverage/e2e-emulator-ci.lcov\n\nif [ \"$TEST_GENYCLOUD_SANITY\" = \"true\" ]; then\n  # Sanity-test support for genycloud (though not ARM)\n  run_f \"yarn e2e:android:genycloud e2e/01* e2e/02* e2e/03.actions*\"\n  cp coverage/lcov.info ../../coverage/e2e-genycloud-ci.lcov\nfi\n\nrun_f \"scripts/ci_unhappy.sh android\"\n\n# run_f \"yarn verify-artifacts:android\"\npopd\n"
  },
  {
    "path": "scripts/ci.ios-release.sh",
    "content": "#!/bin/bash -e\n\ncd detox\nscripts/pack_ios.sh"
  },
  {
    "path": "scripts/ci.ios.sh",
    "content": "#!/bin/bash -ex\n\n#Set xcode version from .xcoderc file\nif [[ -f .xcoderc ]];then\n    xc_version=$(cat .xcoderc)\n    echo \"Setting $xc_version\"\n    export DEVELOPER_DIR=\"/Applications/Xcode_$xc_version.app/\"\nelse\n    echo \".xcoderc not found. Xcode is default\"\nfi\n\nUPLOAD_ARTIFACT=\"$(pwd)/scripts/upload_artifact.sh\"\ntrap \"$UPLOAD_ARTIFACT\" EXIT\n\nsource $(dirname \"$0\")/ci.sh\n\nmkdir -p coverage\n\npushd detox/test\n\n## For some reason iOS simulators are not shown after resetting builder env\n## After this command sims are available again\nxcrun simctl list > /dev/null\n\nrun_f \"yarn build:ios\"\nrun_f \"yarn e2e:ios\"\ncp coverage/lcov.info ../../coverage/e2e-ios-ci.lcov\n\nrun_f \"scripts/ci_unhappy.sh ios\"\n\n# run_f \"yarn verify-artifacts:ios\"\npopd\n"
  },
  {
    "path": "scripts/ci.release.js",
    "content": "/* tslint:disable: no-console */\nconst {exec} = require('shell-utils');\n\nconst {\n  log, logSection, isRelease, getPackagesFromPreviousBuilds\n} = require('./utils/releaseArgs');\nconst publishNewVersion = require('./utils/publishNewVersion');\n\nfunction run() {\n  logSection('Script started');\n  assertCI();\n\n  log('Configuring stuff...');\n  setupGitConfig();\n  getPackagesFromPreviousBuilds();\n  versionTagAndPublish();\n}\n\nfunction assertCI() {\n  if (!process.env.CI) {\n    throw new Error(`Release blocked: Not on a CI build machine!`);\n  }\n}\n\nfunction setupGitConfig() {\n  exec.execSyncSilent(`git config --global push.default simple`);\n  exec.execSyncSilent(`git config --global user.email \"${process.env.GIT_EMAIL}\"`);\n  exec.execSyncSilent(`git config --global user.name \"${process.env.GIT_USER}\"`);\n  const remoteUrl = new RegExp(`https?://(\\\\S+)`).exec(exec.execSyncRead(`git remote -v`))[1];\n  exec.execSyncSilent(`git remote set-url origin \"https://${process.env.GIT_USER}:${process.env.GIT_TOKEN}@${remoteUrl}\"`);\n}\n\nfunction versionTagAndPublish() {\n  logSection('Preparing to tag/release');\n\n  if (isRelease()) {\n    publishNewVersion();\n    log(`Great success, much amaze`);\n  } else {\n    log(`Skipping release...`);\n  }\n}\n\nrun();\n"
  },
  {
    "path": "scripts/ci.sh",
    "content": "#!/bin/bash -e\n\nsource $(dirname \"$0\")/logger.sh\nsource $(dirname \"$0\")/install.sh\n\nsource $(dirname \"$0\")/change_all_react_native_versions.sh\n\nrun_f \"yarn workspaces foreach -A run build\"\n"
  },
  {
    "path": "scripts/create_redirect_html.js",
    "content": "function template({ title = 'redirect page', url }) {\n  return `\\\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"refresh\" content=\"0; url=${url}\">\n  <title>${title}</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      text-align: center;\n      padding: 50px;\n      background-color: #f5f5f5;\n    }\n    .redirect-message {\n      background: white;\n      padding: 30px;\n      border-radius: 8px;\n      box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n      max-width: 500px;\n      margin: 0 auto;\n    }\n    .loading {\n      color: #666;\n      margin-top: 20px;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"redirect-message\">\n    <h2>Redirecting...</h2>\n    <p>You will be redirected to the requested page shortly.</p>\n    <p class=\"loading\">If you are not redirected automatically, <a href=\"${url}\">click here</a>.</p>\n  </div>\n  <script>\n    // Client-side JavaScript fallback redirect\n    setTimeout(function() {\n      window.location.href = \"${url}\";\n    }, 100);\n  </script>\n</body>\n</html>\n`;\n}\n\nprocess.stdout.write(template({ url: process.argv[2], title: process.argv[3] }));\n"
  },
  {
    "path": "scripts/demo-projects.android.sh",
    "content": "#!/bin/bash -e\n\nUPLOAD_ARTIFACT=\"$(pwd)/scripts/upload_artifact.sh\"\ntrap \"$UPLOAD_ARTIFACT\" EXIT\n\n# Approve unapproved SDK licenses\nyes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses\n\nSCRIPTS_PATH=\"$( cd -- \"$(dirname \"$0\")\" >/dev/null 2>&1 ; pwd -P )\"\n\nsource $SCRIPTS_PATH/demo-projects.sh\n\npushd detox\nrun_f \"yarn build:android\"\npopd\n\npushd examples/demo-react-native\n  run_f \"yarn build:android-debug\"\n  run_f \"yarn test:android-debug\"\n\n  # Run tests in release mode with bloated JS bundle:\n  source $SCRIPTS_PATH/demo-rn-bloat-bundle-test.sh android\npopd\n\n# Early completion if this is just about RN compatibility -\n# in which case, running the demo project's tests is enough.\nif [ \"$REACT_NATIVE_COMPAT_TEST\" = \"true\" ]; then\n  exit 0\nfi\n\npushd examples/demo-plugin\n  run_f \"yarn test:plugin\"\npopd\n\n# Detox Native\n##\n\npushd detox\n  run_f \"yarn build:android-native\"\npopd\n"
  },
  {
    "path": "scripts/demo-projects.ios.sh",
    "content": "#!/bin/bash -e\n\nUPLOAD_ARTIFACT=\"$(pwd)/scripts/upload_artifact.sh\"\ntrap \"$UPLOAD_ARTIFACT\" EXIT\n\nSCRIPTS_PATH=\"$( cd -- \"$(dirname \"$0\")\" >/dev/null 2>&1 ; pwd -P )\"\n\nsource $SCRIPTS_PATH/demo-projects.sh\n\n# This must be built first as all other demo apps use this binary.\npushd examples/demo-react-native\n  pushd ios\n    run_f \"pod install\"\n  popd\n\n  run_f \"yarn build:ios-debug\"\n  run_f \"yarn test:ios-debug\"\n\n  # Run tests with bloated JS bundle:\n  source $SCRIPTS_PATH/demo-rn-bloat-bundle-test.sh ios\npopd\n"
  },
  {
    "path": "scripts/demo-projects.sh",
    "content": "#!/usr/bin/env bash\n\nsource $(dirname \"$0\")/logger.sh\nsource $(dirname \"$0\")/install.sh\n\nif [ -z \"$REACT_NATIVE_VERSION\" ]; then\n  echo \"Error: REACT_NATIVE_VERSION variable was not defined!\"\n  exit 1\nfi\n\nif [ \"$REACT_NATIVE_COMPAT_TEST\" != \"true\" ]; then\n  node scripts/change_react_native_version.js \"detox\" ${REACT_NATIVE_VERSION} \"devDependencies\"\nfi\n\n# Update the dependencies of the test project\nnode scripts/change_react_native_version.js \"detox/test\" ${REACT_NATIVE_VERSION} \"dependencies\"\n# Only update the demo-react-native project; others will use this binary\nnode scripts/change_react_native_version.js \"examples/demo-react-native\" ${REACT_NATIVE_VERSION} \"dependencies\"\n\n# Update lockfile for new RN version\nrun_f \"yarn install --mode update-lockfile\"\nrun_f \"yarn install\"\n"
  },
  {
    "path": "scripts/demo-rn-bloat-bundle-test.sh",
    "content": "#!/bin/bash -ex\n# This script is used to run the demo project' tests with a bloated JS bundle.\n# See the original issue for the motivation behind this: https://github.com/wix/Detox/issues/3507\n\nOS_PLATFORM=$1\nWORKING_DIR=$(pwd)\nBUNDLE_FILE=app.js\nBUNDLE_PATH=$WORKING_DIR/$BUNDLE_FILE\n\necho \"Bloating the demo project bundle for $OS_PLATFORM\"\n\n# Copy the original bundle to a temporary location:\ncp $BUNDLE_PATH $BUNDLE_PATH.original\n\n# Bloat the bundle:\nyarn bloat-bundle ./$BUNDLE_FILE\n\n# Run the tests:\nyarn build:$OS_PLATFORM-release\nyarn test:$OS_PLATFORM-release\n\n# Reverse the bloating:\nmv $BUNDLE_PATH.original $BUNDLE_PATH\n"
  },
  {
    "path": "scripts/install.android.sh",
    "content": "#!/bin/bash -e\n\nsource $(dirname \"$0\")/install.sh\n"
  },
  {
    "path": "scripts/install.ios.sh",
    "content": "#!/bin/bash -e\n\nsource $(dirname \"$0\")/install.sh\n\ngem install xcpretty >/dev/null 2>&1\n\nexport CODE_SIGNING_REQUIRED=NO\nHOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew\nHOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils\n"
  },
  {
    "path": "scripts/install.sh",
    "content": "#!/bin/bash -e\n\necho \"Node version:\"\nnode --version\n\ncorepack enable\necho \"Yarn version: $(yarn --version)\"\n\nyarn install --immutable\n"
  },
  {
    "path": "scripts/logger.sh",
    "content": "#!/bin/bash -e\n\nset +x\n\ngreen='\\033[0;32m'\nyellow='\\033[33m'\nnocolor='\\033[0m'\n\nrun_f () {\n  cmd=\"${1}\"\n\n  echo -e \"--- \\\"Running command ${yellow}${cmd}${nocolor}\\\"\"\n  SECONDS=0\n\n  set -x\n  ($cmd)\n\n  set +x\n  duration=$SECONDS\n  echo -e \"${green}\\t--> ${cmd} done in $(($duration / 60)) minutes and $(($duration % 60)) seconds ${nocolor}\\n\"\n}\n"
  },
  {
    "path": "scripts/publish.sh",
    "content": "#!/bin/bash -e\n\nVERSION_TYPE=\"$1\"\nif [ -z \"$VERSION_TYPE\" ]; then\n  VERSION_TYPE=\"patch\"\nfi\n\necho \"[Publish] VERSION_TYPE=$VERSION_TYPE\"\necho \"\"\n\necho \"[Publish] Bumping version...\"\nyarn version $VERSION_TYPE\n\nVERSION=$(node -p \"require('./package.json').version\")\n\necho \"[Publish] Publishing detox@$VERSION...\"\ncd detox && npm publish && cd ..\n\necho \"[Publish] Publishing detox-cli@$VERSION...\"\ncd detox-cli && npm publish && cd ..\n\necho \"[Publish] Updating Github...\"\ngit add -A\ngit commit -m \"[skip ci] Publish $VERSION\"\ngit tag \"$VERSION\"\ngit push\ngit push --tags\n\necho \"[Publish] Over and out\"\n"
  },
  {
    "path": "scripts/purge_expired_domains.mjs",
    "content": "#!/usr/bin/env zx\n\nasync function main({ olderThan }) {\n  const now = new Date();\n  const surgeListOutput = await $`FORCE_COLOR=0 surge list`;\n  const lines = surgeListOutput.stdout.split('\\n');\n  for (let line of lines) {\n    const parts = line.trim().split(/\\s+/);\n    const domain = parts[1];\n    if (!domain || !domain.startsWith('allure-report-')) {\n      continue;\n    }\n\n    const creationDateStr = domain.split('-')[2] // Extract YYYYMMDDHHMMSS\n    const creationDate = new Date(\n      creationDateStr.slice(0, 4),\n      creationDateStr.slice(4, 6) - 1,\n      creationDateStr.slice(6, 8),\n      creationDateStr.slice(8, 10),\n      creationDateStr.slice(10, 12),\n      creationDateStr.slice(12, 14)\n    )\n\n    const daysDifference = (now - creationDate) / (1000 * 60 * 60 * 24);\n    if (daysDifference > olderThan) {\n      console.log(`Deleting ${domain}`)\n      await $`surge teardown ${domain}`\n    }\n  }\n}\n\nawait main({\n  olderThan: argv.olderThan ?? 10,\n});\n"
  },
  {
    "path": "scripts/unit.ios.sh",
    "content": "#!/bin/bash -e\n\nset -o pipefail && xcodebuild -project detox/ios/Detox.xcodeproj -scheme Detox -configuration Debug -sdk iphonesimulator build-for-testing | xcpretty\nset -o pipefail && xcodebuild -project detox/ios/Detox.xcodeproj -scheme Detox -configuration Debug -sdk iphonesimulator test-without-building -destination 'platform=iOS Simulator,name=iPhone 11 Pro'\n"
  },
  {
    "path": "scripts/upload_artifact.sh",
    "content": "#!/bin/bash\n\nDATE=`date '+%Y-%m-%d_%H-%M-%S'`\nSCRIPTS_DIR=$(dirname \"$0\")\nGENERATE_REDIRECT=\"$(readlink -f \"${SCRIPTS_DIR}/create_redirect_html.js\")\"\n\npack() {\n  local BASE_NAME=$1\n  local ARTIFACTS_DIR=$2\n  local CONTEXT=$3\n\n  if [ $CI ]; then\n    ARTIFACTS_NAME=\"${BASE_NAME}_${BUILDKITE_BUILD_NUMBER}_${CONTEXT}_${DATE}.tar.gz\"\n  else\n    ARTIFACTS_NAME=\"${BASE_NAME}_${TRAVIS_BUILD_ID}_${CONTEXT}_${DATE}.tar.gz\"\n  fi\n\n  if [ -d \"$ARTIFACTS_DIR\" ]; then\n    echo \"Packing ${BASE_NAME}... (${CONTEXT})\"\n    tar cvzf \"${ARTIFACTS_NAME}\" ${ARTIFACTS_DIR}\n  fi\n}\n\ngenerate_redirect() {\n  node \"${GENERATE_REDIRECT}\" \"$@\"\n}\n\nupload_to_surge() {\n  local TIMESTAMP=$(date +%Y%m%d%H%M%S)\n  local SURGE_PROJECT=$1\n  local REDIRECT_TITLE=$2\n  local SURGE_SUBDOMAIN=\"${SURGE_PROJECT}-${TIMESTAMP}\"\n  local SURGE_DOMAIN=\"${SURGE_SUBDOMAIN}.surge.sh\"\n\n  if [ -d \"${SURGE_PROJECT}\" ]; then\n    surge --domain \"${SURGE_DOMAIN}\" --project \"${SURGE_PROJECT}\" && \\\n    generate_redirect>>\"${SURGE_SUBDOMAIN}.html\" \"https://${SURGE_DOMAIN}\" \"${REDIRECT_TITLE}\"\n  else\n    echo \"Could not find directory named ${SURGE_PROJECT}.\"\n  fi\n}\n\ngenerate_allure_report() {\n  local ROOT_DIR=$1\n\n  cd $ROOT_DIR\n  if [ -d \"allure-results\" ]; then\n    set -x\n    allure generate && upload_to_surge allure-report \"Detox Allure Report\"\n    set +x\n  else\n    echo \"No allure-results found in ${ROOT_DIR}\"\n  fi\n  cd -\n}\n\ncd \"$(dirname \"$0\")/..\"\nnpm -g install surge\ngenerate_allure_report detox\ngenerate_allure_report detox/test\npack artifacts \"detox/test/artifacts\" \"detoxtest\"\npack artifacts \"examples/demo-react-native/artifacts\" \"rnexample\"\npack artifacts \"examples/demo-react-native-jest/artifacts\" \"rnexamplejest\"\n"
  },
  {
    "path": "scripts/utils/publishNewVersion.js",
    "content": "/* tslint:disable: no-console */\nconst exec = require('shell-utils').exec;\nconst fs = require('fs');\nconst path = require('path');\n\nconst {\n  log,\n  logSection,\n  getReleaseNpmTag,\n  getReleaseVersionType,\n  getVersionSafe,\n  isDryRun,\n  isSkipNpm\n} = require('./releaseArgs');\n\nconst {removeDocsForVersion, buildDocsForVersion} = require('./releaseDocumentation');\n\nfunction publishNewVersion() {\n  validatePrerequisites();\n  projectSetup();\n\n  const releaseTag = getReleaseNpmTag();\n  const currentVersion = queryNpmVersionByTag(releaseTag);\n  log(`    current published version on tag ${releaseTag}: ${currentVersion || 'N/A'}`);\n\n  publishToNpm(releaseTag);\n\n  const newVersion = getVersionSafe();\n  log(`    new published version on tag ${releaseTag}: ${newVersion}`);\n\n  if (releaseTag === 'latest') {\n    releaseDocsVersion(newVersion, currentVersion);\n  }\n}\n\nfunction validatePrerequisites() {\n  const yarnVersion = exec.execSyncRead('yarn --version').trim();\n  if (!yarnVersion.startsWith('4')) {\n    throw new Error(`Cannot publish: Yarn 4.x required, got ${yarnVersion}`);\n  }\n}\n\nfunction getPublishablePackages() {\n  const output = exec.execSyncRead('yarn workspaces list --json --no-private');\n  return output\n    .trim()\n    .split('\\n')\n    .filter(Boolean)\n    .map(line => JSON.parse(line).location);\n}\n\nfunction projectSetup() {\n  logSection('Project setup');\n  exec.execSync(`git checkout ${process.env.BUILDKITE_BRANCH}`);\n}\n\nfunction createNpmRc() {\n  const content = `\nemail=\\${NPM_EMAIL}\n//registry.npmjs.org/:_authToken=\\${NPM_TOKEN}\n`;\n  fs.writeFileSync('.npmrc', content);\n  log('Created .npmrc for npm authentication');\n}\n\nfunction publishToNpm(npmTag) {\n  logSection('Yarn publish');\n  const versionType = getReleaseVersionType();\n  const dryRun = isDryRun();\n  const skipNpm = isSkipNpm();\n\n  if (dryRun) {\n    log('DRY RUN: Publishing without pushing to NPM');\n  } else if (skipNpm) {\n    log('SKIP NPM is set: Skipping NPM publish');\n  }\n\n  // Bump version in root package.json using npm (supports --preid unlike yarn 4)\n  const preid = versionType.includes(\"pre\") ? `--preid=${npmTag}` : '';\n  exec.execSync(`npm version ${versionType} ${preid} --no-git-tag-version`);\n\n  const rootPkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8'));\n  const newVersion = rootPkg.version;\n\n  // Update versions in workspace packages\n  const packages = getPublishablePackages();\n  log(`Publishing version ${newVersion} for packages: ${packages.join(', ')}`);\n\n  for (const pkg of packages) {\n    const pkgPath = path.join(process.cwd(), pkg, 'package.json');\n    if (fs.existsSync(pkgPath)) {\n      const pkgJson = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));\n      pkgJson.version = newVersion;\n      fs.writeFileSync(pkgPath, JSON.stringify(pkgJson, null, 2) + '\\n');\n    }\n  }\n\n  if (!dryRun && !skipNpm) {\n    createNpmRc();\n    // Publish each public package\n    for (const pkg of packages) {\n      log(`Publishing ${pkg}@${newVersion} with tag ${npmTag}`);\n      exec.execSync(`cd ${pkg} && npm publish --tag ${npmTag}`);\n    }\n  }\n\n  // Git operations\n  if (!dryRun) {\n    exec.execSync(`git add -A`);\n    exec.execSync(`git commit -m \"Publish ${newVersion} [ci skip]\"`);\n    exec.execSync(`git tag ${newVersion}`);\n    exec.execSync(`git push`);\n    exec.execSync(`git push --tags`);\n  }\n}\n\nfunction releaseDocsVersion(newVersion, previousVersion) {\n  const newDocsVersion = newVersion.split('.', 1).concat('.x').join('');\n  const previousDocsVersion = previousVersion.split('.', 1).concat('.x').join('');\n\n  if (newDocsVersion === previousDocsVersion) {\n    removeDocsForVersion(previousDocsVersion);\n  }\n\n  buildDocsForVersion(newDocsVersion);\n}\n\nfunction queryNpmVersionByTag(npmTag) {\n  return exec.execSyncRead(`npm view detox dist-tags.${npmTag}`).trim();\n}\n\nmodule.exports = publishNewVersion;\n"
  },
  {
    "path": "scripts/utils/releaseArgs.js",
    "content": "/* tslint:disable: no-console */\nconst semver = require('semver');\nconst fs = require('fs');\nconst chalk = require('chalk');\nconst cp = require('child_process');\n\nconst log = (...args) => console.log('[RELEASE]', ...args);\nconst logSection = (message) => console.log(chalk.blue(`[RELEASE] ${message}`));\n\n// Export buildkite variables for Release build\n// We cast toString() because 'buildkite-agent meta-data get' function returns 'object'\nconst BRANCH = process.env.BUILDKITE_BRANCH;\nconst RELEASE = process.env.BUILDKITE_MESSAGE.match(/^release$/i);\nlet RELEASE_VERSION_TYPE, RELEASE_NPM_TAG, RELEASE_DRY_RUN, RELEASE_SKIP_NPM, PRE_RELEASE;\nif (RELEASE) {\n  RELEASE_VERSION_TYPE = cp.execSync(`buildkite-agent meta-data get release-version-type`).toString();\n  RELEASE_SKIP_NPM = cp.execSync(`buildkite-agent meta-data get release-skip-npm`).toString();\n  RELEASE_DRY_RUN = cp.execSync(`buildkite-agent meta-data get release-dry-run`).toString();\n  RELEASE_NPM_TAG = cp.execSync(`buildkite-agent meta-data get release-npm-tag`).toString();\n  PRE_RELEASE = cp.execSync(`buildkite-agent meta-data get pre-release`).toString();\n}\n\nfunction isRelease() {\n  return RELEASE;\n}\n\nfunction getReleaseVersionType() {\n  return (isPreRelease() ? 'pre' : '') + RELEASE_VERSION_TYPE;\n}\n\nfunction isPreRelease() {\n  return PRE_RELEASE === 'true';\n}\nfunction isSkipNpm() {\n  return RELEASE_SKIP_NPM === 'true';\n}\n\nfunction isDryRun() {\n  return RELEASE_DRY_RUN === 'true';\n}\n\nfunction getPackageJsonPath() {\n  return `${process.cwd()}/package.json`;\n}\n\nfunction readPackageJson() {\n  return JSON.parse(fs.readFileSync(getPackageJsonPath()));\n}\n\nfunction getVersionSafe() {\n  const version = semver.clean(readPackageJson().version);\n  if (!version) {\n    throw new Error('Error: failed to read version from package.json!');\n  }\n  return version;\n}\n\n// If theres a npm tag, use it. Otherwise, if releasing from `master` branch, use a `prerelease` prefix for\n// pre-releases, and \"latest\" otherwise, for non-master branches uses `next` if from the `next` branch and `smoke`\n// otherwise.\nfunction getReleaseNpmTag() {\n  if (RELEASE_NPM_TAG !== 'null') {\n    return RELEASE_NPM_TAG;\n  } else if (BRANCH === 'master') {\n    return isPreRelease() ? 'prerelease' : 'latest';\n  } else if (BRANCH === 'next') {\n    return 'next';\n  } else {\n    return 'smoke';\n  }\n}\n\nfunction getPackagesFromPreviousBuilds() {\n  cp.execSync(`buildkite-agent artifact download \"**/Detox*.tbz\" / --build ${process.env.BUILDKITE_BUILD_ID}`).toString();\n  cp.execSync(`mkdir -p detox/Detox-android`);\n  cp.execSync(`buildkite-agent artifact download \"**/com/**\" / --build ${process.env.BUILDKITE_BUILD_ID}`).toString();\n  cp.execSync(`find . -name \"*.t[bg]z\" -exec cp {} detox/ \\\\;`);\n}\n\nmodule.exports = {\n  log,\n  logSection,\n  getVersionSafe,\n  getReleaseNpmTag,\n  getReleaseVersionType,\n  getPackagesFromPreviousBuilds,\n  isRelease,\n  isDryRun,\n  isSkipNpm\n};\n"
  },
  {
    "path": "scripts/utils/releaseDocumentation.js",
    "content": "const shellUtils = require('shell-utils');\nconst exec = shellUtils.exec;\nconst fs = require('fs');\nconst includes = require('lodash/includes');\n\nconst docsPath = `${process.cwd()}/website`;\nconst docsVersionsJsonPath = `${docsPath}/versions.json`;\n\nfunction buildDocsForVersion(version) {\n  console.log(`Publishing documentation version: ${version}.`);\n  const originalDir = process.cwd();\n\n  try {\n    process.chdir(docsPath);\n    exec.execSync(`yarn install`);\n    exec.execSync(`yarn docusaurus docs:version ${version}`);\n    exec.execSync(`git add .`);\n    exec.execSync(`git diff --staged --quiet || git commit -m \"Publish docs version ${version}\"`);\n    exec.execSync(`git push origin ${process.env.BUILDKITE_BRANCH}`);\n  } finally {\n    process.chdir(originalDir);\n  }\n}\n\nfunction removeDocsForVersion(version) {\n  if (!_isVersionExists(version)) {\n    console.log(`Version ${version} does not exist.`);\n    return;\n  }\n\n  console.log(`Removing documentation version: ${version}.`);\n  exec.execSync(`rm -rf ${docsPath}/versioned_docs/version-${version}`);\n  exec.execSync(`rm -f ${docsPath}/versioned_sidebars/version-${version}-sidebars.json`);\n  const versions = _readDocsVersions();\n  versions.splice(versions.indexOf(version), 1);\n  _updateDocsVersionsFile(versions);\n}\n\nfunction _isVersionExists(version) {\n  console.log(`Check if version exists: ${version}.`);\n  const versions = _readDocsVersions();\n  return includes(versions, version);\n}\n\nfunction _readDocsVersions() {\n  if (fs.existsSync(docsVersionsJsonPath)) {\n    return JSON.parse(fs.readFileSync(docsVersionsJsonPath));\n  } else {\n    console.log(`Versions file (${docsVersionsJsonPath}) does not exist.`);\n    return [];\n  }\n}\n\nfunction _updateDocsVersionsFile(versions) {\n  fs.writeFileSync(docsVersionsJsonPath, JSON.stringify(versions, null, 2));\n}\n\nmodule.exports = {\n  buildDocsForVersion,\n  removeDocsForVersion\n};\n"
  },
  {
    "path": "scripts/utils/tagVersion.js",
    "content": "/* tslint:disable: no-console */\nconst exec = require('shell-utils').exec;\nconst semver = require('semver');\n\nfunction tagVersion(packageVersion, currentPublished) {\n  const tagName =\n    semver.gt(packageVersion, currentPublished)\n      ? `${packageVersion}-snapshot.${process.env.BUILD_ID}`\n      : `${currentPublished}-snapshot.${process.env.BUILD_ID}`;\n\n  gitTag(tagName);\n}\n\nfunction gitTag(newVersion) {\n  // exec.execSync(`npm --no-git-tag-version version ${newVersion}`);\n  // exec.execSync(`npm publish --tag ${VERSION_TAG}`);\n  exec.execSync(`git tag -a ${newVersion} -m \"${newVersion}\"`);\n  exec.execSyncSilent(`git push --tags deploy ${newVersion} || true`);\n}\n\nmodule.exports = tagVersion;\n"
  },
  {
    "path": "website/.gitignore",
    "content": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n## vs code\n.vscode\n"
  },
  {
    "path": "website/README.md",
    "content": "# Detox Website\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nExplore further about using Detox from our new **[website](https://wix.github.io/Detox/)**.\n\n[![Website Preview](https://user-images.githubusercontent.com/1962469/214340717-7ac3114b-8f22-4e94-960a-47dc21b6a88b.png)](https://wix.github.io/Detox)\n\n## Contributing\n\nSee our [Contributing Guide](https://wix.github.io/Detox/docs/contributing#detox-documentation-website).\n"
  },
  {
    "path": "website/babel.config.js",
    "content": "module.exports = {\n  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],\n};\n"
  },
  {
    "path": "website/blog/2022-11-10-detox-20-is-out.md",
    "content": "---\nauthors:\n  - noomorph\ntags: [major-release, genymotion]\n---\n\n# Detox 20 is out\n\nToday we're proud to announce the new major release, **Detox 20** (codename \"Ashán\"), which brings:\n\n* official support for Genymotion SaaS\n* improved integration with test runners\n* configurable logging subsystem\n* headless mode for iOS via configs and CLI\n* reversing TCP ports via Android app configs\n* and more optimizations to land in the next minor versions.\n\n## Genymotion SaaS\n\n**Highlights**: [`Using Genymotion SaaS`].\n\nTwo years ago we [added elementary support][Genymotion PR] for cloud-based Android emulators provided by [Genymotion SaaS] and started a beta testing phase across mobile projects at Wix.\n\nPreviously our mobile infrastructure engineers had been maintaining Android virtual devices on CI build agents on their own, so switching to cloud devices cleared up their time for more productive tasks. Another improvement was particularly noticeable for teams with a vast number of tests. We could reduce the duration of their CI pipelines almost by half after they scaled up from 2 parallel devices to 6[^1].\n\n[^1]: The mentioned threshold is not a hard limit, but rather a point where the return value of scaling up the number of devices starts dramatically diminishing in our case – not only the tests themselves, but installing NPM dependencies and building the projects also takes time.\n\nThis positive impact encouraged us to adopt [Genymotion SaaS] for CI as quickly as possible, ignoring some unresolved issues in the initial pull request. For the most part, those were minor problems in global lifecycle management. Yet that made us feel uncertain about releasing it as-is, so we decided to take time and gain more production experience before taking any direction.\n\nThe further experience was surprisingly smooth and rarely presented issues, spare for a few minor [glitches](https://github.com/wix/Detox/issues/3573) in advanced scenarios. Admittedly, revamping the [Detox lifecycle][`Internals API`] took us longer than expected, which is all the more reason for us to celebrate today.\n\nWe're looking forward to providing our users with more opportunities for testing in the cloud, and this step is only the first of many to come. We hope you'll utilize this new feature to your delight.\n\n## Integration with test runners\n\n**Highlights**: [`Config file > Test runner`], [`Internals API`], [`Dropping Mocha support`].\n\nIt took about a few months of work to formalize the contract between Detox and a test runner. While there's still a lot of place for improvement, the new Detox release refines their interaction and lays the groundwork for third-party integrations.\n\n[Mocha] was our first supported test runner, but unfortunately, it could not keep up with our scaling requirements as the number of end-to-end tests grew. [By the time][Mocha 8] it acquired the ability to run tests in parallel, we already had [to place bets][Jest PR] on another horse, and that was [Jest].\n\nWe attempted to keep compatibility with both Jest and Mocha, but the farther we went, the more obvious it was that we couldn't have it both ways. As it turned out, Jest wasn't easy to get along with – our first integration with it was too simplistic. Over a couple of years of use in production, we kept discovering various issues that forced us to rewrite our \"glue\" code from scratch twice, and this isn't over yet. All combined didn't leave much time and energy for tinkering with Mocha anymore.\n\nIn this release, we discontinued Mocha support to focus on the attunement of Jest with the new runner-independent [test runner config][`Config file > Test runner`] and [Internals API][`Internals API`]. If there's enough demand, now it is up to the open-source community to build a new integration between Detox and Mocha.\n\n## Configurable logger\n\n**Highlights**: [`Config file > Logger`], [`Logger API`].\n\nThe rigidity of the logging subsystem has always been showing itself [since its very creation][Logger rewrite] in the summer of 2019.\nDue to time constraints and existing tech debts, it was impossible to do it right the first time, so we lived about three years with a proof-of-concept rather than a full-fledged feature.\n\nThe inconveniences weren't fatal but quite noticeable, nevertheless. Here are a few syndromes you could have spotted if you have ever used Detox timeline and log artifacts, especially when running tests in parallel:\n\n* an uncanny file array: `detox_pid_7505.log`, `detox_pid_7505.log.json`, `detox_pid_7506.log`;\n* a relatively shallow `detox.trace.json`: test suites, test functions, and some user-defined segments.\n\nThe good news is that the new Detox release condenses all those numerous logs into two files:\n\n* the plain, human-readable `detox.log`;\n* the raw, machine-readable `detox.trace.json` for `chrome://trace`, [Perfetto] and other utilities.\n\n![A screenshot of timeline view generated by Perfetto](/img/blog/v20-perfetto-example.png)\n\nWith the help of the new [Logger API][`Logger API`], you can add custom duration events to the timeline, too, e.g.:\n\n```js\nawait detox.log.trace.complete('Login', async () => {\n  await element(by.id('email')).typeText('john@example.com');\n  await element(by.id('password')).typeText('123456');\n\n  detox.log.info('Trying to log in...');\n  await element(by.id('submit')).tap();\n});\n```\n\nBesides, it is possible now to customize the console output of Detox via the new [logger config][`Config file > Logger`], e.g.:\n\n```js title=\"detox.config.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  // ...\n  logger: {\n    options: {\n      showDate: false,\n      showLoggerName: false,\n      showPid: false,\n      prefixers: {\n        ph: null,\n      },\n    },\n  },\n};\n```\n\nIn the example above, we minimize all the metadata around the log messages – see the screenshot below:\n\n![Terser logs after applying the override](/img/blog/v20-logger-options.png)\n\n## Minor features\n\n### Headless iOS\n\nOne of Detox known issues was always booting iOS simulators in a hidden mode. You could see tests running on your local simulator only if you had manually opened the Simulator app beforehand. So, we unified the `headless` property for both iOS and Android, and now both the platforms visibly boot a device unless you configure it otherwise, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  devices: {\n    iphone: {\n      type: 'ios.simulator',\n      // highlight-next-line\n      headless: process.env.CI ? true : undefined,\n      device: {\n        type: 'iPhone 14'\n      },\n      /* ... */\n    }\n  },\n};\n```\n\nor, via CLI:\n\n```bash\ndetox test -c ios.sim.release --headless\n```\n\n### Reverse ports\n\nYour apps might try to access some `localhost:*` addresses (e.g., mock servers), but this is a bit more problematic in the case of Android. The Android emulators are separate virtual devices with their own loopback network interface. In such cases, you must set up reverse port forwarding via `adb reverse`.\n\nLocal servers are quite a common prerequisite for apps in debug mode – one could recall React Native bundler on port 8081, Storybook server on 9009, etc. That's why we decided to add an optional config property for Android apps, `reversePorts`:\n\n```js\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  // ...\n  apps: {\n    'android.debug': {\n      type: 'android.apk',\n      binaryPath: '...',\n      reversePorts: [8081, 3000],\n    },\n  },\n};\n```\n\nIn other words, this is a convenience API that tells Detox to run `device.reverseTcpPort(portNumber)` after installing the app. It should be helpful for anyone who prefers to keep such things as configs rather than as code.\n\n### Read-only emulators by default\n\nThe `-read-only` flag appeared in [Android emulator 28.0.16](https://developer.android.com/studio/releases/emulator#concurrent-avd). Detox promptly adopted it since the read-only mode allowed it to run multiple instances of a single Android virtual device (AVD) concurrently. This feature helped us to implement parallel test execution support for Android back then.\n\nBeing overcautious, we implemented that partially, only for cases when the user starts multiple concurrent workers. This decision created a moderately annoying UX issue. Imagine you run tests sequentially first, using one worker only. That provides you with a regular AVD instance, i.e., not a read-only one. After that, you switch to multiple workers only to get an error from the Android emulator, complaining about mixing regular and read-only instances.\n\nWhile the fix itself has always been straightforward – close the running AVD and try again – this entire overcaution brought more issues than solving them. That's why, from now on, Android emulators will always be starting in `-read-only` mode unless you configure `readonly: false` in your [device config][`Config file > Device`].\n\n### Reset lock file\n\nThis release adds a small CLI tool, [`detox reset-lock-file`][reset-lock-file], to help users with one specific use scenario.\n\nImagine you want to run tests for multiple Detox configurations at once, e.g.:\n\n```bash\ndetox test -c iphoneSE2020.release e2e/ui.test.js\ndetox test -c iphone14ProMax.release e2e/ui.test.js\n```\n\nThe problem is that Detox uses a file-locking mechanism to avoid situations when parallel test workers would take control of the same device. The `detox test` command, upon start, erases that file contents, creating a race condition risk.\n\nTo eliminate that risk, use a combination of `detox reset-lock-file` and `--keepLockFile` like this:\n\n```bash\ndetox reset-lock-file & \\\ndetox test --keepLockFile -c iphoneSE2020.release e2e/ui.test.js & \\\ndetox test --keepLockFile -c iphone14ProMax.release e2e/ui.test.js & \\\nwait\n```\n\nIn the future, we plan to minimize using lock files so that you don't have to think about this low-level implementation detail.\nSo, this tool adds some convenience until we provide a next-gen solution.\n\n## Deprecations\n\nDetox 20 executes many pending deprecations, so make sure to check out our [Migration Guide] before upgrading:\n\n* JS: minimum supported Node.js version is `14.x`;\n* JS: minimum supported Jest version is `27.2.5`;\n* JS: Mocha test runner is no longer supported;\n* JS: discontinued old adapters for Jest (`jest-jasmine`, first generation of `jest-circus` adapter);\n* JS: discontinued `{ permanent: true }` option in `device.appLaunchArgs.*` methods ([#3360](https://github.com/wix/Detox/pull/3360));\n* CLI: dropped `-w, --workers` and `-o, --runner-config` args – see a [dedicated section][Updating command-line scripts] in the migration guide;\n* CLI: dropped deprecated `--device-launch-args` ([#3665](https://github.com/wix/Detox/pull/3665));\n* Config: discontinued kebab-case properties: `test-runner`, `runner-config` ([#3371](https://github.com/wix/Detox/pull/3371))\n* Config: discontinued `skipLegacyWorkersInjections` property ([(#3286)](https://github.com/wix/Detox/pull/3286))\n* Config: deprecated `specs` and `runnerConfig` properties\n* Config: changed [semantics][`Config file > Test runner`] of `testRunner` property\n* Config: dropped support for all-in-one configurations ([#3386](https://github.com/wix/Detox/pull/3386));\n* Android: remove deprecated native IdlePolicyConfig ([#3332](https://github.com/wix/Detox/pull/3332/files))\n* iOS: discontinued `ios.none` device type – see the new way to [debug native code][Debugging Native] ([#3361](https://github.com/wix/Detox/pull/3361))\n\n## Afterword\n\nOver the last year and a half, we have established a centralized configuration system for more than 50 projects using Detox at Wix. While it never seemed to be a cakewalk, the entire experience of troubleshooting over a hundred issues across the organization did not leave us unchanged.\n\nWe see numerous things to improve in Detox, but most of them boil down to the same thing – **scaling**. Surprisingly, \"scaling\" makes an excellent umbrella term for nearly every challenge we've been encountering lately:\n\n* _scaling up the number of users_ requires us to improve the onboarding and troubleshooting experience;\n* _scaling up the number of projects_ forces us to centralize scattered configs into flexible organization presets;\n* _scaling up the number of tests_ prompts us to optimize the codebase and incline it towards cloud and remote execution.\n\nOur core team has been facing challenges of limited human resource constraints and growing scaling needs for a long time. In many ways, that has shaped a specific mindset within the team. We evaluate every discussed feature by asking a simple question: _will it save other people and us time to focus on more important things?_ Teaching a man to fish is better than giving fish, so our success at preventing support issues matters more than our success at solving them ourselves.\n\nThat's why we'll be making subsequent efforts in these three areas, hoping to get back to you soon with even more exciting updates.\n\nEnjoy your drive with Detox 20!\n\nCheers! :wave:\n\n[`Using Genymotion SaaS`]: /docs/guide/genymotion-saas\n[`Config file > Test runner`]: /docs/config/testRunner\n[`Internals API`]: /docs/api/internals\n[`Dropping Mocha support`]: https://github.com/wix/Detox/issues/3193\n[`Config file > Device`]: /docs/config/devices\n[`Config file > Logger`]: /docs/config/logger\n[`Config file > Test runner`]: /docs/config/testRunner\n[`Logger API`]: /docs/api/logger\n[reset-lock-file]: /docs/cli/reset-lock-file\n[Jest]: https://jestjs.io\n[Mocha]: https://mochajs.org\n[Mocha 8]: https://github.com/mochajs/mocha/releases/tag/v8.0.0\n[Jest PR]: https://github.com/wix/Detox/pull/609\n[Logger rewrite]: https://github.com/wix/Detox/pull/835\n[Genymotion PR]: https://github.com/wix/Detox/pull/2446\n[Genymotion SaaS]: https://cloud.geny.io\n[Genymotion issues]: https://github.com/wix/Detox/issues/3573\n[Perfetto]: https://ui.perfetto.dev/\n[Migration Guide]: /docs/guide/migration#200\n[Updating command-line scripts]: /docs/guide/migration#updating-command-line-scripts\n[Debugging Native]: /docs/introduction/debugging#native-application-code\n[typings]: https://github.com/wix/Detox/blob/master/detox/index.d.ts\n"
  },
  {
    "path": "website/blog/2024-10-09-detox-copilot-is-out.md",
    "content": "---\nauthors:\n  - asafkorem\ntags: [minor-release, detox-pilot, ai-integration]\n---\n\n# Introducing Detox Copilot\n\n## Detox Copilot: Write Tests in Natural Language\n\nWe're excited to announce **Detox Copilot**, a groundbreaking feature that brings natural language testing to Detox. With Detox Copilot, you can now write end-to-end tests using plain textual commands, making test creation more intuitive and accessible than ever.\n\n![Detox Copilot in action GIF](/img/blog/copilot-demo.gif)\n\nDetox Copilot leverages advanced Large Language Models (LLMs) to interpret natural language instructions and translate them into Detox actions and assertions. This means you can describe your test scenarios in everyday language, aligning perfectly with **Behavior-Driven Development (BDD)** principles.\n\n### Why Natural Language Testing?\n\n- **Improved Collaboration**: Teams can collaborate more effectively, as tests are written in plain language understandable by developers, QA engineers, and non-technical stakeholders alike.\n- **Faster Test Creation**: Reduce the time spent writing and maintaining complex test scripts.\n- **Enhanced Test Coverage**: Lower the barrier to writing tests, encouraging more comprehensive testing.\n- **Reduced Maintenance Costs**: Thanks to the decoupling from specific matchers (e.g., avoiding brittle XPath selectors or relying on `testID` attributes commonly used in React Native apps), tests are less prone to breaking when the UI changes, leading to lower maintenance overhead.\n\n## Key Features of Detox Copilot\n\n### Write Tests in Plain Text\n\nDetox Copilot allows you to write tests using natural language commands. Each step corresponds to a specific action or assertion within your app.\n\n```javascript\nit('should navigate and add a product to the cart', async () => {\n  await copilot.perform(\n    'Navigate to the \"Products\" page',\n    'Tap on the \"Add to Cart\" button for the first product',\n    'Verify that the \"Added to Cart\" pop-up is displayed'\n  );\n});\n```\n\n### Seamless Integration with Detox\n\nDetox Copilot is built into Detox and requires no additional installation. Simply initialize it in your test setup, and you're ready to start writing natural language tests.\n\n### LLM-Agnostic Design\n\nDetox Copilot uses LLMs to interpret instructions but is designed to be LLM-agnostic. This means you can connect it to your preferred language model service, offering flexibility and future-proofing your testing strategy.\n\n## How Detox Copilot Works\n\nOnce you've written your tests using natural language instructions, Detox Copilot takes care of the rest.\nHere is a high-level overview of the execution flow:\n\n1. **Gather Context**: Collect relevant app state, view hierarchy, and previous step results.\n2. **Interpret Intent**: Use the LLM to interpret the natural language instruction.\n3. **Generate Code**: Create the appropriate Detox commands.\n4. **Execute Action**: Run the generated Detox code.\n5. **Cache Results**: Store execution results to optimize future runs.\n6. **Provide Feedback**: Return values or confirm actions for subsequent steps.\n\nBy combining these steps, Detox Copilot effectively bridges the gap between natural language instructions and concrete test actions.\n\n:::info\n\nCheck Detox Copilot **[Technical Overview]** for a detailed explanation of the building blocks and the execution flow.\n\n:::\n\n## Getting Started with Detox Copilot\n\nGetting started with Detox Copilot is easy. Simply initialize Copilot in your test setup and start writing tests using natural language instructions.\n\nCheck our [Testing with Copilot guide] for detailed instructions on setting up and writing tests with Detox Copilot.\n\n\n## Extending Beyond Detox\n\nDetox Copilot is built on a standalone core library called [detox-copilot] designed to interpret natural language testing instructions and generate test code. Though initially developed for Detox, it can be extended to work with other testing frameworks.\n\n## Learn More\n\nFor detailed guidance, check out our [Testing with Copilot guide] and the [Detox Copilot API Documentation].\n\n## Join the Future of Testing\n\nDetox Copilot represents a major step forward in making end-to-end testing more accessible and efficient. By embracing natural language testing, you can enhance collaboration, speed up test creation, and improve overall test coverage.\n\nWe're **excited** to see how you'll leverage Detox Copilot in your tests! Share your experiences, feedback, and suggestions with us as we continue to refine and expand this groundbreaking feature.\n\n[Testing with Copilot guide]: /docs/pilot/testing-with-pilot\n[Detox Copilot API Documentation]: https://wix-pilot.com\n[detox-copilot]: https://github.com/wix-incubator/pilot\n[Technical Overview]: https://wix-pilot.com/docs/guides/technical-overview\n"
  },
  {
    "path": "website/blog/authors.yml",
    "content": "asafkorem:\n    name: Asaf Korem\n    title: Detox Core Contributor\n    url: https://github.com/asafkorem\n    image_url: https://github.com/asafkorem.png\nd4vidi:\n    name: Amit Davidi\n    title: Detox Team Lead\n    url: https://github.com/d4vidi\n    image_url: https://github.com/d4vidi.png\ngosha212:\n    name: Georgy Steshin\n    title: Detox Core Contributor\n    url: https://github.com/gosha212\n    image_url: https://github.com/gosha212.png\nnoomorph:\n    name: Yaroslav Serhieiev\n    title: Detox Core Contributor\n    url: https://github.com/noomorph\n    image_url: https://github.com/noomorph.png\n"
  },
  {
    "path": "website/docusaurus.config.js",
    "content": "// @ts-check\n// Note: type annotations allow type checking and IDEs autocompletion\n\nconst lightCodeTheme = require('prism-react-renderer/themes/github');\nconst darkCodeTheme = require('prism-react-renderer/themes/dracula');\n\n/** @type {import('@docusaurus/types').Config} */\nconst config = {\n  title: 'Detox',\n  tagline: 'Gray box end-to-end testing and automation framework for React Native apps',\n  url: 'https://wix.github.io',\n  baseUrl: '/Detox/',\n  onBrokenLinks: 'throw',\n  onBrokenMarkdownLinks: 'warn',\n  favicon: '/img/favicon.ico',\n  organizationName: 'wix',\n  projectName: 'Detox',\n  plugins: ['docusaurus-plugin-sass',\n    ['@docusaurus/plugin-client-redirects',\n      {\n        redirects: [\n          {\n            from: '/docs',\n            to: '/docs/next/introduction/getting-started',\n          }\n        ]\n      }\n    ]\n  ],\n  presets: [\n    [\n      '@docusaurus/preset-classic',\n      /** @type {import('@docusaurus/preset-classic').Options} */\n      ({\n        gtag: {\n          trackingID: 'G-2Z5WTH61Y3',\n          anonymizeIP: true\n        },\n        googleTagManager: {\n          containerId: 'GTM-M58K66V8'\n        },\n        blog: {\n          path: 'blog',\n          // Simple use-case: string editUrl\n          // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',\n          // Advanced use-case: functional editUrl\n          editUrl: ({ locale, blogDirPath, blogPath, permalink }) =>\n            `https://github.com/wix/Detox/edit/master/website/${blogDirPath}/${blogPath}`,\n          editLocalizedFiles: false,\n          authorsMapPath: 'authors.yml',\n          blogTitle: 'Blog',\n          blogDescription:\n            'All the important updates and announcements from Detox crew, tips and tricks and everything else that you don\\'t want to miss.',\n          blogSidebarCount: 5,\n          blogSidebarTitle: 'All our posts',\n          routeBasePath: 'blog',\n          include: ['**/*.{md,mdx}'],\n          exclude: ['**/_*.*', '**/_*/**'],\n          postsPerPage: 10,\n          truncateMarker: /<!--\\s*(truncate)\\s*-->/,\n          showReadingTime: true\n        },\n        docs: {\n          path: '../docs',\n          sidebarPath: require.resolve('./sidebars.js'),\n          editUrl: 'https://github.com/wix/Detox/edit/master/docs/',\n          docLayoutComponent: '@site/src/components/CustomLayout',\n          remarkPlugins: [[require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }]]\n        },\n        pages: {\n          remarkPlugins: [[require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }]]\n        },\n        theme: {\n          customCss: require.resolve('./src/css/custom.scss')\n        }\n      })\n    ]\n  ],\n\n  themeConfig:\n  /** @type {import('@docusaurus/preset-classic').ThemeConfig} */\n    ({\n      navbar: {\n        title: 'Detox',\n        logo: {\n          alt: 'Detox Logo',\n          src: '/img/logo.png'\n        },\n        items: [\n          {\n            type: 'doc',\n            docId: 'introduction/getting-started',\n            position: 'left',\n            label: 'Docs'\n          },\n          {\n            type: 'doc',\n            docId: 'config/overview',\n            position: 'left',\n            label: 'API'\n          },\n          {\n            type: 'doc',\n            docId: 'contributing',\n            position: 'left',\n            label: 'Contribute'\n          },\n          {\n            to: 'blog',\n            label: 'Blog',\n            position: 'left'\n          },\n          {\n            to: 'showcase',\n            label: 'Showcase',\n            position: 'left',\n            className: 'header-showcase-link'\n          },\n          {\n            type: 'docsVersionDropdown',\n            position: 'right',\n            dropdownActiveClassDisabled: true\n          },\n          {\n            href: 'https://github.com/wix/Detox',\n            position: 'right',\n            className: 'header-github-link',\n            'aria-label': 'GitHub repository'\n          }\n        ]\n      },\n      algolia: {\n        appId: 'KTM5GBP42S',\n        apiKey: 'd01d9c1bae30c64fa2b9bfbdad9adbfd',\n        indexName: 'detox'\n      },\n      footer: {\n        style: 'light',\n        links: [\n          {\n            title: 'Docs',\n            items: [\n              {\n                label: 'Getting Started',\n                to: 'docs/introduction/getting-started'\n              },\n              {\n                label: 'Contributing to Detox',\n                to: 'docs/contributing'\n              }\n            ]\n          },\n          {\n            title: 'Support',\n            items: [\n              {\n                label: 'Ask a question on Stack Overflow',\n                href: 'https://stackoverflow.com/questions/tagged/detox'\n              },\n              {\n                label: 'Create new issue on Github',\n                href: 'https://github.com/wix/Detox/issues/new/choose'\n              }\n            ]\n          },\n          {\n            title: 'More',\n            items: [\n              {\n                label: 'GitHub',\n                href: 'https://github.com/wix/Detox'\n              },\n              {\n                label: 'Twitter',\n                href: 'https://twitter.com/detoxe2e/'\n              },\n              {\n                label: 'Discord',\n                href: 'https://discord.gg/CkD5QKheF5'\n              }\n            ]\n          }\n        ]\n      },\n      docs: {\n        sidebar: {\n          autoCollapseCategories: true\n        }\n      },\n      prism: {\n        additionalLanguages: ['gradle', 'ini', 'java'],\n        theme: lightCodeTheme,\n        darkTheme: darkCodeTheme\n      },\n      colorMode: {\n        defaultMode: 'dark',\n        disableSwitch: false,\n        respectPrefersColorScheme: false\n      }\n    }),\n  scripts: [\n    {\n      src: 'https://platform.twitter.com/widgets.js',\n      async: true\n    }\n  ]\n};\n\nmodule.exports = config;\n"
  },
  {
    "path": "website/package.json",
    "content": "{\n  \"name\": \"website\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"docusaurus\": \"docusaurus\",\n    \"start\": \"docusaurus start\",\n    \"build\": \"docusaurus build\",\n    \"swizzle\": \"docusaurus swizzle\",\n    \"deploy\": \"docusaurus deploy\",\n    \"clear\": \"docusaurus clear\",\n    \"serve\": \"docusaurus serve\",\n    \"write-translations\": \"docusaurus write-translations\",\n    \"write-heading-ids\": \"docusaurus write-heading-ids\"\n  },\n  \"dependencies\": {\n    \"@docusaurus/core\": \"^2.3.1\",\n    \"@docusaurus/plugin-client-redirects\": \"^2.4.3\",\n    \"@docusaurus/plugin-google-gtag\": \"^2.3.1\",\n    \"@docusaurus/preset-classic\": \"^2.3.1\",\n    \"@docusaurus/remark-plugin-npm2yarn\": \"^2.3.1\",\n    \"@docusaurus/theme-search-algolia\": \"^2.3.1\",\n    \"@mdx-js/react\": \"^1.6.21\",\n    \"clsx\": \"^1.1.1\",\n    \"docusaurus\": \"^1.14.7\",\n    \"docusaurus-plugin-sass\": \"^0.2.3\",\n    \"file-loader\": \"^6.2.0\",\n    \"prism-react-renderer\": \"^1.2.1\",\n    \"react\": \"^17.0.1\",\n    \"react-dom\": \"^17.0.1\",\n    \"react-loader-spinner\": \"^5.3.4\",\n    \"sass\": \"^1.57.1\",\n    \"sass-loader\": \"^13.2.0\",\n    \"url-loader\": \"^4.1.1\",\n    \"zx\": \"^7.1.1\"\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.5%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@svgr/webpack\": \"^8.1.0\"\n  }\n}\n"
  },
  {
    "path": "website/showcase.json",
    "content": "[\n  {\n    \"title\": \"Wix Spaces\",\n    \"image\": \"img/showcase/wix-spaces.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.wix.android\",\n    \"linkApple\": \"https://apps.apple.com/us/app/spaces-follow-businesses/id1099748482\",\n    \"shouldStayOnTop\": true,\n    \"backgroundGradietColor\": \"rgb(17,109,255)\"\n  },\n  {\n    \"title\": \"Wix Owner\",\n    \"image\": \"img/showcase/wix-owner.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.wix.admin\",\n    \"linkApple\": \"https://apps.apple.com/us/app/wix-owner-website-builder/id1545924344\",\n    \"shouldStayOnTop\": true,\n    \"backgroundGradietColor\": \"white\"\n  },\n  {\n    \"title\": \"Fit by Wix\",\n    \"image\": \"img/showcase/wix-fit.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.wix.fitness\",\n    \"linkApple\": \"https://apps.apple.com/us/app/fit-by-wix/id1552621043\",\n    \"shouldStayOnTop\": true,\n    \"backgroundGradietColor\": \"rgb(5,122,105)\"\n  },\n  {\n    \"title\": \"Dine by Wix\",\n    \"image\": \"img/showcase/wix-dine.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.wix.restaurants\",\n    \"linkApple\": \"https://apps.apple.com/us/app/dine-by-wix/id1561524113\",\n    \"shouldStayOnTop\": true,\n    \"backgroundGradietColor\": \"rgb(90,15,127)\"\n  },\n  {\n    \"title\": \"Hudl\",\n    \"image\": \"img/showcase/hudl.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.hudl.hudroid\",\n    \"linkApple\": \"https://apps.apple.com/us/app/hudl/id412223222\",\n    \"backgroundGradietColor\": \"rgb(255,99,0)\"\n  },\n  {\n    \"title\": \"Valora\",\n    \"image\": \"img/showcase/valora.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=co.clabs.valora\",\n    \"linkApple\": \"https://apps.apple.com/us/app/valora-crypto-wallet/id1520414263\",\n    \"backgroundGradietColor\": \"rgb(123,228,142)\"\n  },\n  {\n    \"title\": \"Rocket Chat\",\n    \"image\": \"img/showcase/rocket-chat.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=chat.rocket.android\",\n    \"linkApple\": \"https://apps.apple.com/us/app/rocket-chat/id1148741252\",\n    \"backgroundGradietColor\": \"rgb(245,69,92)\"\n  },\n  {\n    \"title\": \"WealthSimple\",\n    \"image\": \"img/showcase/wealthsimple.png\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.wealthsimple.trade\",\n    \"linkApple\": \"https://apps.apple.com/us/app/wealthsimple-invest/id948087968\",\n    \"backgroundGradietColor\": \"white\"\n  },\n  {\n    \"title\": \"Pitch\",\n    \"image\": \"img/showcase/pitch.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.pitch.android&gl=IL\",\n    \"linkApple\": \"https://apps.apple.com/us/app/pitch-collaborate-on-decks/id1551335606?platform=iphone\",\n    \"backgroundGradietColor\": \"red\"\n  },\n  {\n    \"title\": \"RN DateTimePicker\",\n    \"titleFontSize\": \"1.5rem\",\n    \"image\": \"img/showcase/rn-datetimepicker.png\",\n    \"linkGitHub\": \"https://github.com/react-native-datetimepicker/datetimepicker\",\n    \"backgroundGradietColor\": \"white\"\n  },\n  {\n    \"title\": \"Maiia\",\n    \"image\": \"img/showcase/maiia.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.cegedim.maiia.patient\",\n    \"linkApple\": \"https://apps.apple.com/fr/app/maiia-t%C3%A9l%C3%A9consultation-rdv/id1489590732?agc_click_id=596983166549379072\",\n    \"backgroundGradietColor\": \"rgb(125,165,180)\"\n  },\n  {\n    \"title\": \"Noona\",\n    \"image\": \"img/showcase/noona.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.timatorgmobile&gl=IL\",\n    \"linkApple\": \"https://apps.apple.com/is/app/noona-book-anything/id1448498295\",\n    \"backgroundGradietColor\": \"white\"\n  },\n  {\n    \"title\": \"Omnon Notes\",\n    \"image\": \"img/showcase/omnon.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.nieratechinc.omnomnotes&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1\",\n    \"linkApple\": \"https://apps.apple.com/us/app/omnom-notes/id1505867777?ls=1\",\n    \"backgroundGradietColor\": \"rgb(185,234,251)\"\n  },\n  {\n    \"title\": \"Bolt Food\",\n    \"image\": \"img/showcase/bolt-food.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.bolt.deliveryclient\",\n    \"linkApple\": \"https://apps.apple.com/us/app/bolt-food/id1451492388\",\n    \"backgroundGradietColor\": \"rgb(21, 209, 118)\"\n  },\n  {\n    \"title\": \"Next\",\n    \"image\": \"img/showcase/next.jpg\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.nextinsurance\",\n    \"linkApple\": \"https://apps.apple.com/us/app/next-insurance/id1580721755\",\n    \"backgroundGradietColor\": \"rgb(173, 216, 230)\"\n  },\n  {\n    \"title\": \"PlayerData\",\n    \"image\": \"img/showcase/player-data.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=uk.co.playerdata.mobile\",\n    \"linkApple\": \"https://apps.apple.com/gb/app/playerdata-insight/id1462268462\",\n    \"backgroundGradietColor\": \"rgb(52, 211, 48)\"\n  },\n  {\n    \"title\": \"Expo\",\n    \"image\": \"img/showcase/expo.png\",\n    \"linkWebsite\": \"https://expo.dev/\",\n    \"backgroundGradietColor\": \"white\"\n  },\n  {\n    \"title\": \"Currenxie Global Account\",\n    \"titleFontSize\": \"1.3rem\",\n    \"image\": \"img/showcase/currenxie.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.currenxiemobilereactnative\",\n    \"linkApple\": \"https://apps.apple.com/us/app/currenxie-global-account/id1550022183\",\n    \"backgroundGradietColor\": \"rgb(30, 215, 155)\"\n  },\n  {\n    \"title\": \"Mercari: Your Marketplace\",\n    \"titleFontSize\": \"1.3rem\",\n    \"image\": \"img/showcase/mercari.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.mercariapp.mercari\",\n    \"linkApple\": \"https://apps.apple.com/us/app/mercari-your-marketplace/id896130944\",\n    \"backgroundGradietColor\": \"rgb(94, 109, 243)\"\n  },\n  {\n    \"title\": \"DealerCenter\",\n    \"image\": \"img/showcase/DealerCenter.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.nowcom.dcmobile&hl=en_US&pli=1\",\n    \"linkApple\": \"https://apps.apple.com/us/app/dealercenter/id521054271\",\n    \"backgroundGradietColor\":\"rgb(0, 122 , 197)\"\n  },\n  {\n    \"title\": \"Bumpy: International Dating\",\n    \"titleFontSize\": \"1.2rem\",\n    \"image\": \"img/showcase/Bumpy.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=app.bumpy.android\",\n    \"linkApple\": \"https://apps.apple.com/us/app/bumpy-international-dating/id1455336523\",\n    \"backgroundGradietColor\": \"rgb(68, 200, 205)\"\n  },\n  {\n    \"title\": \"Rippling\",\n    \"image\": \"img/showcase/Rippling.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.people.rippling&hl=en&gl=US&pli=1\",\n    \"linkApple\": \"https://apps.apple.com/us/app/rippling-hr-it-finance/id1231325957\",\n    \"backgroundGradietColor\": \"rgb(255,191,28)\"\n  },\n  {\n    \"title\": \"Qwil Messenger\",\n    \"image\": \"img/showcase/Qwil.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=io.qwil.android&hl=en_US\",\n    \"linkApple\": \"https://apps.apple.com/us/app/qwil-messenger/id1356119152\",\n    \"backgroundGradietColor\": \"rgb(59, 75, 107)\"\n  },\n  {\n    \"title\": \"Abacus for Firefly III\",\n    \"titleFontSize\": \"1.3rem\",\n    \"image\": \"img/showcase/Abacus.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=abacus.fireflyiii.android.app\",\n    \"linkApple\": \"https://apps.apple.com/us/app/1627093491\",\n    \"backgroundGradietColor\": \"rgb(252, 96, 47)\"\n  },\n  {\n    \"title\": \"The Newt In Somerset\",\n    \"titleFontSize\": \"1.3rem\",\n    \"image\": \"img/showcase/theNewt.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.candide.thenewt\",\n    \"linkApple\": \"https://apps.apple.com/us/app/the-newt-in-somerset/id1645524424the\",\n    \"backgroundGradietColor\": \"rgb(0, 73, 155)\"\n  },\n  {\n    \"title\": \"Babylonstoren\",\n    \"image\": \"img/showcase/babylonstoren.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.candide.babylonstoren\",\n    \"linkApple\": \"https://apps.apple.com/us/app/babylonstoren/id1626456402\",\n    \"backgroundGradietColor\": \"rgb(0, 73, 155)\"\n  },\n  {\n    \"title\": \"Lyrist\",\n    \"image\": \"img/showcase/Lyrist.webp\",\n    \"linkGoogle\": \"https://play.google.com/store/apps/details?id=com.rapbook\",\n    \"linkApple\": \"https://apps.apple.com/us/app/lyrist-ai-songwriting-toolkit/id1352247113\",\n    \"backgroundGradietColor\": \"white\"\n  }\n\n]"
  },
  {
    "path": "website/sidebars.js",
    "content": "/**\n * Creating a sidebar enables you to:\n - create an ordered group of docs\n - render a sidebar for each doc of that group\n - provide next/previous navigation\n\n The sidebars can be generated from the filesystem, or explicitly defined here.\n\n Create as many sidebars as you want.\n */\n\n// @ts-check\n\n/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */\nconst sidebars = {\n  tutorialSidebar: [\n    {\n      type: 'category',\n      label: 'Introduction',\n      items: [\n        'introduction/getting-started',\n        'introduction/environment-setup',\n        'introduction/project-setup',\n        'introduction/your-first-test',\n        'introduction/debugging',\n        'introduction/preparing-for-ci',\n      ]\n    },\n    {\n      type: 'category',\n      label: 'Guides',\n      items: [\n        'guide/test-id',\n        'guide/parallel-test-execution',\n        'guide/detox-repl',\n        'guide/typescript',\n        'guide/testing-webviews',\n        'guide/genymotion-saas',\n        'guide/taking-screenshots',\n        'guide/mocking',\n        'guide/launch-args',\n        'guide/mocking-open-with-url',\n        'guide/mocking-user-notifications',\n        'guide/mocking-user-activity',\n        'guide/developing-while-writing-tests',\n        'guide/android-dev-env',\n        'guide/proguard-configuration',\n        'guide/cucumber-js-integration',\n        'guide/uninstalling',\n      ]\n    },\n    {\n      type: 'category',\n      label: 'Pilot-Powered Detox Testing',\n      items: [\n        'pilot/testing-with-pilot',\n        'pilot/best-practices',\n      ]\n    },\n    {\n      type: 'category',\n      label: 'Troubleshooting',\n      items: [\n        'troubleshooting/building-the-app',\n        'troubleshooting/running-tests',\n        'troubleshooting/synchronization',\n        'troubleshooting/flakiness',\n        'troubleshooting/element-matching',\n      ]\n    },\n    {\n      type: 'doc',\n      id: 'guide/migration',\n    }\n  ],\n  apiSidebar: [\n    {\n      type: 'category',\n      label: 'Config file',\n      items: [\n        'config/overview',\n        'config/devices',\n        'config/apps',\n        'config/artifacts',\n        'config/behavior',\n        'config/logger',\n        'config/session',\n        'config/testRunner',\n      ]\n    },\n    {\n      type: 'category',\n      label: 'Command Line Interface',\n      items: [\n        'cli/overview',\n        'cli/init',\n        'cli/build',\n        'cli/start',\n        'cli/test',\n        'cli/recorder',\n        'cli/build-framework-cache',\n        'cli/clean-framework-cache',\n        'cli/rebuild-framework-cache',\n        'cli/reset-lock-file',\n        'cli/run-server',\n      ]\n    },\n    {\n      type: 'category',\n      label: 'Client API',\n      items: [\n        'api/device',\n        'api/matchers',\n        'api/actions',\n        'api/expect',\n        'api/webviews',\n        'api/system',\n        'api/logger',\n        'api/pilot',\n      ]\n    },\n    'api/internals',\n    {\n      type: 'category',\n      label: 'Tech Articles',\n      items: [\n        'articles/design-principles',\n        'articles/how-detox-works',\n        'articles/third-party-drivers',\n      ]\n    },\n  ],\n  contributeSidebar: [\n    'contributing',\n    {\n      type: 'category',\n      label: 'Questions & Answers',\n      items: [\n        'contributing/questions/asking-questions',\n        'contributing/questions/answering-questions',\n      ]\n    },\n    'contributing/reporting-bugs',\n    'contributing/feature-requests',\n    {\n      type: 'category',\n      label: 'Code Changes',\n      items: [\n        'contributing/code/overview',\n        'contributing/code/setting-up-the-dev-environment',\n        'contributing/code/building-and-testing',\n        'contributing/code/example-projects',\n        'contributing/code/submitting-pull-requests',\n        'contributing/code/reviewing-pull-requests',\n      ]\n    },\n    'contributing/documentation',\n    'contributing/code-of-conduct'\n  ],\n};\n\nmodule.exports = sidebars;\n"
  },
  {
    "path": "website/snapshots.yml",
    "content": "- name: Home page dark theme\n  url: http://localhost:3000/Detox/\n  execute: document.documentElement.setAttribute(\"data-theme\", \"dark\")\n\n- name: Home page light theme\n  url: http://localhost:3000/Detox/\n  execute: document.documentElement.setAttribute(\"data-theme\", \"light\")\n\n- name: Demo page dark theme\n  url: http://localhost:3000/Detox/docs/next/demo\n  execute: document.documentElement.setAttribute(\"data-theme\", \"dark\")\n\n- name: Demo page light theme\n  url: http://localhost:3000/Detox/docs/next/demo\n  execute: document.documentElement.setAttribute(\"data-theme\", \"light\")\n\n- name: Blog page dark theme\n  url: http://localhost:3000/Detox/blog\n  execute: document.documentElement.setAttribute(\"data-theme\", \"dark\")\n\n- name: Blog page light theme\n  url: http://localhost:3000/Detox/blog\n  execute: document.documentElement.setAttribute(\"data-theme\", \"light\")\n\n- name: Showcase page dark theme\n  url: http://localhost:3000/Detox/showcase?shuffle=disabled\n  execute: document.documentElement.setAttribute(\"data-theme\", \"dark\")\n\n- name: Showcase page light theme\n  url: http://localhost:3000/Detox/showcase?shuffle=disabled\n  execute: document.documentElement.setAttribute(\"data-theme\", \"light\")\n\n"
  },
  {
    "path": "website/src/components/CustomBanner/StandWithUkraine.js",
    "content": "import React from 'react';\nimport styles from './StandWithUkraine.module.scss';\nimport Link from '@docusaurus/Link';\n\nconst StandWithUkraine = (props) => {\n  return (\n    <div className={styles.banner}>\n      <Link to=\"https://stand-with-ukraine.pp.ua\" className={styles.link}>\n        <span className={styles.uaFlag}></span> This project is created with substantial contributions from our Ukrainian colleagues.{' '}\n        <span className={styles.hashtag}>#StandWithUkraine</span>\n      </Link>\n    </div>\n  );\n};\n\nexport default StandWithUkraine;\n"
  },
  {
    "path": "website/src/components/CustomBanner/StandWithUkraine.module.scss",
    "content": ".banner {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  background-color: #1f253c;\n  padding: 0.5em;\n}\n\n.link {\n  color: #fff;\n  font-weight: bolder;\n  text-align: center;\n}\n\n.link:hover {\n  color: #fff;\n  text-decoration: none;\n}\n\n.uaFlag {\n  background-image: url(@site/static/img/homepage/flag_of_ukraine_with_waves.svg);\n  background-repeat: no-repeat;\n  display: inline-block;\n  height: 13px;\n  width: 18px;\n}\n\n\n.hashtag {\n  color: #ffd600;\n}\n\n@media (min-width: 768px) {\n  .banner {\n    height: 56px;\n  }\n}"
  },
  {
    "path": "website/src/components/CustomLayout.js",
    "content": "import React from 'react';\nimport DocPage from '@theme/DocPage';\nimport StandWithUkraine from '@site/src/components/CustomBanner/StandWithUkraine';\n\nconst CustomLayout = (props) => {\n  return (\n    <>\n      <StandWithUkraine />\n      <DocPage {...props} />\n    </>\n  );\n};\n\nexport default CustomLayout;\n"
  },
  {
    "path": "website/src/components/FlavorizedCodeBlock.js",
    "content": "import React from 'react';\nimport CodeBlock from '@theme/CodeBlock';\n\nconst FlavorizedCodeBlock = ({ flavors, children, header, footer, ...codeBlockProps }) => {\n  return (\n    <CodeBlock {...codeBlockProps}>\n      {header}\n      {flavors.map(children).join('\\n')}\n      {footer}\n    </CodeBlock>\n  );\n};\n\nexport default FlavorizedCodeBlock;\n"
  },
  {
    "path": "website/src/components/Homepage/Features/FeatureList.js",
    "content": "import React from 'react';\n\nconst FeatureList = [\n  {\n    title: 'Cross Platform',\n    Svg: require('@site/static/img/homepage/cross-platform.svg').default, // taken from: https://uxwing.com/magic-icon/\n    description: <>Write cross-platform end-to-end tests in JavaScript. Currently supports iOS and Android.</>\n  },\n  {\n    title: 'Debuggable',\n    Svg: require('@site/static/img/homepage/debug.svg').default, // taken from: https://uxwing.com/bug-icon/\n    description: <>Modern async-await API allows breakpoints in asynchronous tests to work as expected.</>\n  },\n  {\n    title: 'Automatically Synchronized',\n    Svg: require('@site/static/img/homepage/sync.svg').default, // taken from: https://uxwing.com/wait-sandclock-icon/\n    description: <>Stops flakiness at the core by monitoring asynchronous operations in your app.</>\n  },\n  {\n    title: 'Made For CI',\n    Svg: require('@site/static/img/homepage/ci.svg').default, // taken from: https://iconarchive.com/show/flatastic-9-icons-by-custom-icon-design/Semi-success-icon.html\n    description: <>Execute your E2E tests on CI platforms like Travis CI, CircleCI or Jenkins without grief.</>\n  },\n  {\n    title: 'Runs on Devices',\n    Svg: require('@site/static/img/homepage/devices.svg').default, // taken from: https://uxwing.com/mobile-phone-icon/\n    description: <>Gain confidence to ship by testing your app on a device/simulator just like a real user (not yet supported on iOS).</>\n  },\n  {\n    title: 'Test Runner Agnostic',\n    Svg: require('@site/static/img/homepage/test-runner.svg').default, // taken from: https://uxwing.com/testing-icon/\n    description: (\n      <>\n        Detox provides a set of APIs to use with any test runner or without it. It comes with{' '}\n        <a href=\"https://jestjs.io\" target=\"_blank\" rel=\"noopener noreferrer\">\n          Jest\n        </a>{' '}\n        integration out of the box.\n      </>\n    )\n  }\n];\n\nexport default FeatureList;\n"
  },
  {
    "path": "website/src/components/Homepage/Features/Features.js",
    "content": "import React from 'react';\nimport styles from './Features.module.scss';\nimport clsx from 'clsx';\n\nconst Features = ({ Svg, title, description }) => {\n  return (\n    <div className={clsx('col col--4', styles.featuresGap)}>\n      <Svg className={styles.featureImage} alt={title} />\n      <div>\n        <h3 className={styles.featureTitle}>{title}</h3>\n        <p className={styles.featureText}>{description}</p>\n      </div>\n    </div>\n  );\n};\n\nexport default Features;\n"
  },
  {
    "path": "website/src/components/Homepage/Features/Features.module.scss",
    "content": "@import '@site/src/css/fonts';\n\n.featuresGap {\n  --ifm-col-width: calc(1 / 3 * 100%);\n  margin-bottom: 91px;\n}\n\n.featureImage {\n  height: 60px;\n  width: 60px;\n  margin-bottom: 18px;\n}\n\n.featureTitle {\n  @include h5;\n  margin-bottom: 14px;\n  letter-spacing: -0.2px;\n}\n\n.featureText {\n  @include t2;\n  max-width: 256px;\n}\n\n@media only screen and (max-width: 996px) {\n  .featuresGap {\n    --ifm-col-width: 50%;\n  }\n}\n\n@media only screen and (max-width: 500px) {\n  .featuresGap {\n    --ifm-col-width: 100%;\n\n    margin-bottom: 29px;\n    padding-left: 25px;\n  }\n\n  .featureImage {\n    height: 45px;\n    width: 45px;\n    margin-bottom: 7px;\n  }\n\n  .featureTitle {\n    margin-bottom: 11px;\n  }\n\n  .featureText {\n    max-width: 290px;\n  }\n}"
  },
  {
    "path": "website/src/components/Homepage/Features/HomepageFeatures.js",
    "content": "import React from 'react';\nimport styles from './HomepageFeatures.module.scss';\nimport clsx from 'clsx';\nimport FeatureList from './FeatureList';\nimport Features from './Features';\n\nconst HomepageFeatures = () => {\n  return (\n    <section>\n      <div className={clsx('container', styles.benefitsHeader)}>\n        <div className=\"row\">\n          <div className=\"col\">\n            <h1 className={styles.benefitsTitle}>Detox benefits</h1>\n          </div>\n        </div>\n        <div className=\"row\">\n          {FeatureList.map((props, idx) => (\n            <Features key={idx} {...props} />\n          ))}\n        </div>\n      </div>\n    </section>\n  );\n};\n\nexport default HomepageFeatures;\n"
  },
  {
    "path": "website/src/components/Homepage/Features/HomepageFeatures.module.scss",
    "content": "@import '@site/src/css/fonts';\n\n.benefitsHeader {\n  margin-bottom: 24px;\n\n  @media only screen and (max-width: 1200px) {\n    --ifm-spacing-horizontal: 1.625rem;\n  }\n}\n\n.benefitsTitle {\n  @include h2;\n  color: var(--ifm-heading-color);\n  margin-top: 136px;\n  margin-bottom: 104px;\n  margin-left: -5px;\n\n  @media only screen and (max-width: 500px) {\n    font-size: 40px;\n    margin-top: 47px;\n    margin-bottom: 30px;\n  }\n}"
  },
  {
    "path": "website/src/components/Homepage/Header/HomepageHeader.js",
    "content": "import React from 'react';\nimport Link from '@docusaurus/Link';\nimport useDocusaurusContext from '@docusaurus/useDocusaurusContext';\nimport styles from './HomepageHeader.module.scss';\nimport clsx from 'clsx';\n\nconst HomepageHeader = () => {\n  const { siteConfig } = useDocusaurusContext();\n\n  return (\n    <header className={styles.heroBanner}>\n      <div className=\"container\">\n        <div className=\"row\">\n          <div className=\"col\">\n            <h1 className={styles.title}>{siteConfig.title}</h1>\n            <h2 className={styles.tagline}>{siteConfig.tagline}</h2>\n            <div className={styles.buttons}>\n              <Link\n                className={clsx('button button--secondary button--lg', styles.linkText)}\n                href=\"/docs/introduction/getting-started\"\n                target=\"_blank\">\n                Getting Started <strong>with Detox</strong>\n              </Link>\n            </div>\n          </div>\n        </div>\n      </div>\n    </header>\n  );\n};\n\nexport default HomepageHeader;\n"
  },
  {
    "path": "website/src/components/Homepage/Header/HomepageHeader.module.scss",
    "content": "@import '@site/src/css/fonts';\n\n.heroBanner {\n  --ifm-heading-color: #fff;\n\n  width: 100%;\n  height: calc(357px + 23vw);\n  padding-top: 54px;\n  min-height: 450px;\n  max-height: 725px;\n  overflow: hidden;\n  position: relative;\n  background-attachment: local;\n  background-color: #15216b;\n  background-image: url(@site/static/img/homepage/hero-image.webp);\n  background-position-x: calc(-495px + 31vw);\n  background-position-y: calc(19px - 19vw);\n  background-size: calc(947px + 41vw);\n  background-repeat: no-repeat;\n\n  @media only screen and (max-width: 375px) {\n    background-position-x: -379px;\n    background-position-y: -53px;\n    background-size: 1100px;\n  }\n\n  @media only screen and (max-width: 890px) {\n    padding-top: 32px;\n    padding-bottom: 32px;\n  }\n\n  @media only screen and (max-width: 1200px) {\n    --ifm-spacing-horizontal: 1.625rem;\n  }\n\n  @media only screen and (min-width: 1600px) {\n    background-position-x: center;\n    background-position-y: bottom;\n    background-size: cover;\n  }\n}\n\n.title {\n  @include h2;\n  font-size: 120px;\n  line-height: normal;\n  letter-spacing: -6px;\n  margin-left: -10px;\n\n  @media only screen and (max-width: 890px) {\n    font-size: 72px;\n    line-height: normal;\n    letter-spacing: -3.6px;\n    margin-left: -6px;\n  }\n}\n\n.tagline {\n  @include t1;\n  max-width: 450px;\n  min-height: 60px;\n  margin-top: -30px;\n  margin-bottom: 32px;\n  letter-spacing: 0.1px;\n\n  @media only screen and (max-width: 890px) {\n    margin-top: -22px;\n    margin-bottom: 21px;\n  }\n}\n\n.buttons {\n  height: 50px;\n}\n\n.linkText {\n  @include t2;\n  font-size: 17px;\n  color: var(--ifm-color-gray-900);\n  background-color: var(--ifm-button-background-color);\n  min-width: 250px;\n  padding: 12px 20px;\n  border: 0;\n  border-radius: 10px;\n}\n"
  },
  {
    "path": "website/src/components/Homepage/SubHeader/HomepageSubHeader.js",
    "content": "import React from 'react';\nimport clsx from 'clsx';\nimport styles from './HomepageSubHeader.module.scss';\n\nconst HomepageSubHeader = () => {\n  return (<div className={styles.subHeaderWrapper}>\n      <div className='container'>\n        <div className='row'>\n          <div className={clsx('col', styles.subHeader)}>\n            <div className={styles.callToAction}>\n              <span>\n                Follow&nbsp;us&nbsp;on <strong>social&nbsp;networks:</strong>\n              </span>\n            </div>\n            <div className={styles.socialNetworks}>\n              <a className={styles.discordButton} href='https://discord.gg/CkD5QKheF5' target='_blank'></a>\n              <a className={styles.twitterButton} href='https://x.com/detoxe2e?s=20' target='_blank'>\n                <span className={styles.twitterLogo}></span>\n                <span className={styles.twitterFollowText}>Follow </span>\n                <span className={styles.twitterFollowId}>@detoxe2e</span>\n              </a>\n              <a className={styles.twitterCounter} href='https://x.com/detoxe2e?s=20' target='_blank'>\n                <span>542</span>\n                <span>&nbsp;followers</span>\n              </a>\n              <a className={styles.githubButton} href='https://github.com/wix/detox' target='_blank'></a>\n              <a className={styles.githubCounter} href='https://github.com/wix/detox/stargazers' target='_blank'>\n                <span>11,052</span>\n              </a>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>);\n};\n\nexport default HomepageSubHeader;\n"
  },
  {
    "path": "website/src/components/Homepage/SubHeader/HomepageSubHeader.module.scss",
    "content": "@import '@site/src/css/fonts';\n\n.subHeaderWrapper {\n  background-color: #171b20;\n  width: 100%;\n  color: #fff;\n\n  @media only screen and (max-width: 1200px) {\n    --ifm-spacing-horizontal: 1.625rem;\n  }\n}\n\n.subHeader {\n  min-height: 85px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.callToAction {\n  @include h5;\n  font-weight: 300;\n  line-height: 35px;\n  color: #fff;\n  display: flex;\n  align-items: center;\n  margin-right: 10px;\n  flex-wrap: nowrap;\n\n  @media only screen and (max-width: 570px) {\n    font-size: 18px;\n    line-height: 25px;\n  }\n\n  @media only screen and (max-width: 480px) {\n    max-width: 140px;\n    margin-top: 16px;\n    align-items: normal;\n  }\n\n  @media only screen and (max-width: 370px) {\n    letter-spacing: -1px;\n  }\n}\n\n.socialNetworks {\n  display: flex;\n  align-items: center;\n  margin: 20px 0;\n  @include t2;\n}\n\n.discordButton {\n  background-color: #718CD8;\n  background-image: url(@site/static/img/homepage/join-us-on-disc.svg);\n  height: 45px;\n  width: 141px;\n  margin-right: 25px;\n  border-radius: 10px;\n  cursor: pointer;\n}\n\n.discordButton:hover {\n  background-color: #819ff8;\n  transition: transform 0.25s ease-in-out;\n  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));\n}\n\n.twitterButton {\n  display: inline-block;\n  background-color: #1E9EEE;\n  height: 45px;\n  line-height: 45px;\n  width: 199px;\n  border-radius: 10px;\n  margin-right: 10px;\n  cursor: pointer;\n}\n\n.twitterLogo {\n  display: inline-block;\n  position: relative;\n  top: 8px;\n  left: 12px;\n  background-image: url(@site/static/img/homepage/twitter-logo.svg);\n  background-repeat: no-repeat;\n  width: 24px;\n  height: 24px;\n}\n\n.twitterFollowText,\n.twitterFollowId {\n  color: #fff;\n}\n\n.twitterFollowText {\n  margin-left: 20px;\n}\n\n.twitterCounter {\n  width: 119px;\n  height: 35px;\n  margin-right: 25px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 5px;\n  background: #313439;\n  color: #fff;\n\n  @media only screen and (max-width: 1100px) {\n    display: none;\n  }\n}\n\n.githubButton {\n  background-image: url(@site/static/img/homepage/github.svg);\n  height: 45px;\n  width: 93px;\n  border-radius: 10px;\n  margin-right: 10px;\n  cursor: pointer;\n}\n\n.githubCounter {\n  width: 57px;\n  height: 35px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 5px;\n  background: #313439;\n  color: #fff;\n\n  @media only screen and (max-width: 950px) {\n    display: none;\n  }\n}\n\n.twitterCounter,\n.githubCounter {\n  position: relative;\n\n  &::before {\n    content: '';\n    position: absolute;\n    right: 100%;\n    width: 0;\n    height: 0;\n    border-style: solid;\n    border-width: 4px 6px 4px 0;\n    border-color: transparent #23272F transparent transparent;\n  }\n}\n\n@media only screen and (max-width: 1100px) {\n  .discordButton {\n    margin-right: 20px;\n  }\n\n  .twitterButton {\n    margin-right: 20px;\n  }\n}\n\n@media only screen and (max-width: 890px) {\n  .discordButton {\n    margin-right: 10px;\n  }\n\n  .twitterButton {\n    width: 110px;\n    margin-right: 10px;\n  }\n\n  .twitterFollowId {\n    display: none;\n  }\n}\n\n@media only screen and (max-width: 780px) {\n  .subHeader {\n    padding-top: 10px;\n    padding-bottom: 10px;\n\n  }\n\n  .discordButton,\n  .twitterButton,\n  .githubButton {\n    height: 45px;\n    width: 45px;\n    border-radius: 10px;\n    margin-right: 10px;\n  }\n\n  .discordButton {\n    background-image: url(@site/static/img/homepage/mobile-discord.svg);\n  }\n\n  .twitterButton {\n    background-image: url(@site/static/img/homepage/mobile-twitter.svg);\n  }\n\n  .githubButton {\n    background-image: url(@site/static/img/homepage/mobile-github.svg);\n    margin-right: 0;\n  }\n\n  .twitterFollowText {\n    display: none;\n  }\n}\n"
  },
  {
    "path": "website/src/components/Showcase/Card.js",
    "content": "import React from 'react';\nimport clsx from 'clsx';\nimport Link from '@docusaurus/Link';\nimport styles from './Card.module.scss';\n\nfunction Card({ className, title, titleFontSize, image, linkGoogle, linkApple, linkGitHub, linkWebsite, backgroundGradietColor }) {\n  return (\n    <li className={clsx(className, styles.card)}\n    style={{ '--bg-color': backgroundGradietColor }} >\n      <img src={require(`@site/static/${image}`).default} className={styles.image} />\n      <span className={styles.title} style={{ fontSize: titleFontSize}}>\n        {title}\n      </span>\n      <div>\n        {linkGoogle && (\n          <Link className={styles.storeButton} href={linkGoogle}>\n            Google Play\n          </Link>\n        )}\n        {linkApple && (\n          <Link className={styles.storeButton} href={linkApple}>\n            App Store\n          </Link>\n        )}\n        {linkGitHub && (\n          <Link className={styles.storeButton} href={linkGitHub}>\n            GitHub\n          </Link>\n        )}\n        {linkWebsite && (\n          <Link className={styles.storeButton} href={linkWebsite}>\n            Website\n          </Link>\n        )}\n      </div>\n    </li>\n  );\n}\n\nexport default Card;\n"
  },
  {
    "path": "website/src/components/Showcase/Card.module.scss",
    "content": ".card {\n  box-sizing: border-box;\n  width: 310px;\n\n  position: relative;\n  overflow: hidden;\n\n  display: flex;\n  flex-direction: column;\n  align-items: flex-start;\n\n  border: 1px solid rgb(239, 239, 239);\n  border-radius: 5%;\n  padding: 20px;\n\n  transition: box-shadow 0.25s ease-in-out;\n\n  font-family: 'Nunito Sans', sans-serif;\n  font-weight: normal;\n}\n\n.card:hover {\n  box-shadow: 0px 12px 12px #00000006;\n}\n\n.card::before {\n  content: '';\n\n  position: absolute;\n  z-index: -1;\n\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  opacity: 0;\n}\n\n[data-theme='dark'] .card::before {\n  background: radial-gradient(100% 100% at 1.07% 0%, var(--bg-color, white) 0%, rgba(0, 0, 0, 0) 100%);\n  transition: opacity 0.25s ease-in-out;\n}\n\n.card:hover::before {\n  opacity: 0.3;\n}\n\n[data-theme='dark'] .card {\n  border-color: #313439;\n}\n\n[data-theme='dark'] .card:hover {\n  box-shadow: 0px 12px 12px #0000001d;\n}\n\n.title {\n  font-weight: 700;\n  font-size: 30px;\n  margin: 20px 0 38px;\n  height: 50px;\n}\n\n.image {\n  width: 70px;\n  height: 70px;\n  border-radius: 25%;\n  box-shadow: 0 1px 2px 0 rgb(60 64 67 / 30%), 0 1px 3px 1px rgb(60 64 67 / 15%);\n}\n\n.storeButton {\n  display: inline-block;\n  width: 115px;\n  height: 30px;\n  line-height: 30px;\n  margin-right: 10px;\n  color: #000;\n  text-align: center;\n  text-decoration: none;\n  border-radius: 25px;\n  font-size: 16px;\n  background: #f1f1f1;\n}\n\n.storeButton:hover {\n  background-color: #5a3fc6;\n  transition: transform 0.25s ease-in-out;\n  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));\n  color: #ffffff;\n  text-decoration: none;\n}\n\n[data-theme='dark'] .storeButton {\n  background-color: #313439;\n  color: #fff;\n}\n\n[data-theme='dark'] .storeButton:hover {\n  background-color: #5a3fc6;\n}\n\n.storeButton:focus {\n  outline: none;\n}\n"
  },
  {
    "path": "website/src/components/Showcase/Hero.js",
    "content": "import clsx from 'clsx';\nimport React from 'react';\nimport Link from '@docusaurus/Link';\nimport styles from './Hero.module.scss';\n\nexport default function ShowcaseHero() {\n  return (\n    <section className={clsx('hero hero--primary', styles.heroBanner)}>\n      <div className=\"container\">\n        <h1 className=\"hero__title\">Users Showcase</h1>\n        <p className=\"hero__subtitle\">Check out who is using Detox to Gray box test their React Native Apps</p>\n\n        <a href=\"https://forms.gle/C1BWzd8k5LhogDtM7\" target=\"_blank\" className={styles.button}>\n          Join the Showcase!\n        </a>\n      </div>\n    </section>\n  );\n}\n"
  },
  {
    "path": "website/src/components/Showcase/Hero.module.scss",
    "content": "@import '@site/src/css/fonts';\n\n.heroBanner {\n  --ifm-heading-color: #fff;\n\n  height: 420px;\n  width: auto;\n  color: white;\n  text-align: center;\n  position: relative;\n  overflow: hidden;\n  background-color: #12161b;\n  background-image: url(@site/static/img/showcase/showcase-illustration.png);\n  background-position-x: center;\n  background-position-y: top;\n  background-repeat: no-repeat;\n  background-size: cover;\n  border-bottom: 1px solid #202429;\n\n  h1 {\n    @include h2;\n  }\n\n  p {\n    @include t1;\n    font-weight: 300;\n  }\n\n  a {\n    @include t2;\n  }\n}\n\n.button {\n  color: #ffffff;\n  box-sizing: border-box;\n  display: flex;\n  position: relative;\n  margin: auto;\n  margin-top: 20px;\n  text-align: center;\n  align-items: center;\n  justify-content: center;\n  width: 200px;\n  height: 45px;\n  border-radius: 10px;\n  border: 1px solid #000000;\n  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));\n  background: radial-gradient(100% 100% at 1.07% 0%, #7633e5 0%, #5d71e5 100%);\n\n  &:focus {\n    outline: none;\n  }\n\n  &--secondary {\n    background-color: #7633e5;\n    color: #ffffff;\n    width: 500px;\n  }\n\n  &:hover {\n    background: #7633e5;\n    color: #ffffff;\n    text-decoration: none;\n  }\n\n  a {\n    color: #ffffff;\n    text-decoration: none;\n\n    @include t2;\n    /* identical to box height, or 156% */\n    color: #ffffff;\n  }\n}\n\n@media screen and (max-width: 966px) {\n  .heroBanner {\n    padding: 2rem;\n  }\n}\n"
  },
  {
    "path": "website/src/components/Showcase/Showcase.js",
    "content": "import React, { useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport Card from './Card';\nimport cardList from '@site/showcase.json';\nimport styles from './Showcase.module.scss';\nimport _ from 'lodash';\nimport { TailSpin } from 'react-loader-spinner';\n\nconst Showcase = () => {\n  const [cards, setCards] = useState([]);\n\n  useEffect(() => {\n    const shouldShuffle = new URLSearchParams(window.location.search).get('shuffle') !== 'disabled';\n    const resultingCardList = shouldShuffle ? _makeShuffledCardList(cardList) : cardList;\n    setCards(resultingCardList.map(_makeCard));\n  }, []);\n\n  return cards.length > 0 ? _makeCardsContainer(cards) : _makeLoadingSpinner();\n};\n\nconst _makeShuffledCardList = (cardList) => {\n  const partition = _.partition(cardList, 'shouldStayOnTop');\n  return partition[0].concat(_.shuffle(partition[1]));\n};\n\nconst _makeCard = (props) => <Card key={props.title} {...props} />;\n\nconst _makeCardsContainer = (cards) => (\n  <section className={clsx('container', styles.container)}>\n    <ul className={clsx('col', 'col--12', styles.list)}>{cards}</ul>\n  </section>\n);\n\nconst _makeLoadingSpinner = () => (\n  <TailSpin height=\"60\" width=\"60\" color=\"#dddddd\" ariaLabel=\"loading\" radius=\"2\" wrapperClass={styles.spinner} visible={true} />\n);\n\nexport default Showcase;\n"
  },
  {
    "path": "website/src/components/Showcase/Showcase.module.scss",
    "content": ".container {\n  padding: 80px 20px 60px 20px;\n}\n\n.list {\n  list-style: none;\n  display: flex;\n  flex-flow: row wrap;\n  justify-content: center;\n  gap: 60px;\n}\n\n.spinner {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  padding: 5rem;\n}\n"
  },
  {
    "path": "website/src/components/Showcase/index.js",
    "content": "export { default as Hero } from './Hero';\nexport { default as List } from './Showcase';\n"
  },
  {
    "path": "website/src/css/_benefits-section.scss",
    "content": ".benefits-header {\n  font-family: 'Nunito Sans', sans-serif;\n  font-style: normal;\n  font-weight: 700;\n  font-size: 58px;\n  line-height: 70px;\n  color: #131419;\n  margin-top: 125px;\n  margin-bottom: 125px;\n}\n\n[data-theme='dark'] .benefits-header {\n  color: #ffffff;\n}\n\n.social-buttons {\n  justify-content: flex-end;\n  display: flex;\n}\n\n.flex-jc-fe {\n  display: flex;\n  justify-content: flex-end;\n}\n"
  },
  {
    "path": "website/src/css/_colors.scss",
    "content": "@mixin define-detox-extra-colors() {\n  // Define the base colors\n  $color: (\n    'r': #f14c52,\n    'y': #f7ba29,\n    'b': #3e77e4,\n    'u': #7633e5,\n    'e': #3ebf72\n  );\n\n  // Define the transparency levels\n  $alpha: (\n    '0': 1,\n    '1a': 0.54,\n    '2a': 0.35,\n    '3a': 0.25,\n    '4a': 0.15,\n    '5a': 0.7\n  );\n\n  @each $key, $hex in $color {\n    @each $level, $fraction in $alpha {\n      --detox-color-#{$key}#{$level}: #{transparentize($hex, 1 - $fraction)};\n    }\n  }\n}\n\n@mixin define-detox-colors($map) {\n  @each $key, $hex in $map {\n    --detox-color-#{$key}: #{$hex};\n  }\n}\n\n@mixin define-detox-light-colors() {\n  @include define-detox-colors((\n    'a0': #000000,\n    'a1': #babbbd,\n    'a2': #e0e1e1,\n    'a3': #f1f1f1,\n    'a4': #fafafa,\n    'a5': #ffffff\n  ));\n}\n\n@mixin define-detox-dark-colors() {\n  @include define-detox-colors((\n    'a0': #ffffff,\n    'a1': #12161b,\n    'a2': #171b20,\n    'a3': #202429,\n    'a4': #313439,\n    'a5': #575a5d\n  ));\n}\n"
  },
  {
    "path": "website/src/css/_fonts.scss",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;700&display=swap');\n\n@mixin h1 {\n  font: 80px/96px 'Nunito Sans', sans-serif;\n}\n\n@mixin h2 {\n  font: 700 58px/70px 'Nunito Sans', sans-serif;\n}\n\n@mixin h3 {\n  font: 600 40px/50px 'Nunito Sans', sans-serif;\n}\n\n@mixin h4 {\n  font: 700 30px/40px 'Nunito Sans', sans-serif;\n}\n\n@mixin h5 {\n  font: 600 24px/30px 'Nunito Sans', sans-serif;\n}\n\n@mixin t1 {\n  font: 400 20px/30px 'Nunito Sans', sans-serif;\n}\n\n@mixin t2 {\n  font: 300 16px/25px 'Nunito Sans', sans-serif;\n}\n\n@mixin t2b {\n  font: 600 16px/25px 'Nunito Sans', sans-serif;\n}\n\n@mixin t3 {\n  font: 400 13px/20px 'Nunito Sans', sans-serif;\n}"
  },
  {
    "path": "website/src/css/_footer.scss",
    "content": ".footer {\n  @include t2;\n\n  [data-theme='light'] & {\n    border-top: 1px solid rgba(19, 20, 25, 0.15);\n  }\n\n  [data-theme='dark'] & {\n    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);\n    border-top: 1px solid var(--detox-color-a3);\n  }\n\n  &__title {\n    @include t2b;\n  }\n\n  &__link-item {\n    .footer__col_more & {\n      display: inline;\n      padding-left: 30px;\n      background-repeat: no-repeat;\n    }\n\n    &_git-hub {\n      [data-theme='light'] & {\n        background-image: url(@site/static/img/showcase/gh-footer-light.svg);\n      }\n\n      [data-theme='dark'] & {\n        background-image: url(@site/static/img/showcase/gh-footer-dark.svg);\n      }\n    }\n\n    &_twitter {\n      [data-theme='light'] & {\n        background-image: url(@site/static/img/showcase/twitter-footer-light.svg);\n      }\n\n      [data-theme='dark'] & {\n        background-image: url(@site/static/img/showcase/twitter-footer-dark.svg);\n      }\n    }\n\n    &_discord {\n      [data-theme='light'] & {\n        background-image: url(@site/static/img/showcase/discord-footer-light.svg);\n      }\n\n      [data-theme='dark'] & {\n        background-image: url(@site/static/img/showcase/discord-footer-dark.svg);\n      }\n    }\n  }\n\n  @media only screen and (min-width: 320px) and (max-width: 996px) {\n    &__col_more>&__items {\n      display: flex;\n      justify-content: space-between;\n      flex-wrap: wrap;\n      max-width: 325px;\n    }\n  }\n\n  @media only screen and (max-width: 996px) {\n    &__col {\n      margin-bottom: calc(var(--ifm-spacing-vertical) * 2.8);\n    }\n\n    &__col_more &__title {\n      margin-bottom: 7px;\n    }\n\n    &__link-item a {\n      margin-bottom: 12px;\n    }\n  }\n}"
  },
  {
    "path": "website/src/css/_header-github.scss",
    "content": ".header-github-link:hover {\n  opacity: 0.6;\n}\n\n.header-github-link:before {\n  content: '';\n  width: 24px;\n  height: 24px;\n  display: flex;\n  background: url(@site/static/img/showcase/gh-nav-light.svg) no-repeat;\n}\n\nhtml[data-theme='dark'] .header-github-link:before {\n  background: url(@site/static/img/showcase/gh-nav-dark.svg) no-repeat;\n}\n\n.header-github-link:hover {\n  -webkit-tap-highlight-color: transparent;\n  background-color: #ebedf0;\n  border-radius: 50%;\n  transition: background var(--ifm-transition-fast);\n}\n\nhtml[data-theme='dark'] .header-github-link:hover {\n  background-color: #444950;\n}\n"
  },
  {
    "path": "website/src/css/_markdown.scss",
    "content": ".docusaurus-highlight-code-line {\n  display: block;\n  margin: 0 calc(-1 * var(--ifm-pre-padding));\n  padding: 0 var(--ifm-pre-padding);\n}\n\n.markdown {\n  @media (min-width: 768px) {\n    code {\n      white-space: pre;\n    }\n  }\n\n  h1, h2, h3, h4, h5, h6 {\n    code {\n      white-space: pre-wrap;\n    }\n  }\n}\n"
  },
  {
    "path": "website/src/css/_navbar.scss",
    "content": "@import '@site/src/css/fonts';\n\n[data-theme='dark'] .navbar {\n  background-color: #12161b;\n}\n\n.navbar__title {\n  @include t2b;\n  font-weight: 700;\n}\n\n.navbar__link {\n  margin-right: 20px;\n  font-weight: 300;\n}\n\n.navbar__link--active {\n  text-decoration: none;\n  color: var(--ifm-navbar-link-color);\n  font-weight: var(--ifm-font-weight-semibold);\n}\n\n.navbar__item {\n  padding: 5px;\n  font-weight: 300;\n}\n\n.navbar__brand {\n  margin-right: 30px;\n}\n\n[data-theme='dark'] .navbar__item {\n  padding: 5px;\n  font-weight: 300;\n}\n\n/*===========*/\n\n/* Restyle logo & hamburger button */\n\n.navbar {\n  height: 60px;\n\n  &__items {\n    &--right {\n      position: relative;\n    }\n  }\n\n  &__logo {\n    height: 26px;\n    margin: 0 10px 0 0;\n  }\n\n  &__toggle {\n    width: 40px;\n    height: 40px;\n    background-color: var(--detox-color-a3);\n    border-radius: 10px;\n    justify-content: center;\n    align-items: center;\n    position: absolute;\n    margin-right: 0;\n    top: 15px;\n    right: 25px;\n  }\n}\n\n@media (max-width: 996px) {\n  .navbar__toggle {\n    display: none;\n  }\n}\n\n\n@media (max-width: 768px) {\n  .navbar__toggle {\n    display: inherit;\n    position: absolute;\n    margin: 0;\n    top: 10px;\n    right: 25px;\n  }\n}\n\n/* Restyle search button */\n\n.DocSearch-Button {\n  font-family: inherit;\n}\n\n@media (max-width: 768px) {\n  button.DocSearch-Button {\n    background-color: var(--detox-color-a3);\n    height: 40px;\n    border-radius: 10px;\n    padding: 0 10px;\n  }\n\n  .DocSearch-Search-Icon {\n    opacity: 0.6;\n  }\n}\n"
  },
  {
    "path": "website/src/css/_root.scss",
    "content": "@import 'colors';\n\n:root {\n  @include define-detox-extra-colors();\n\n  &[data-theme] {\n    --ifm-color-primary: #048fc0;\n    --ifm-color-primary-dark: #253282;\n    --ifm-color-primary-darker: #161360;\n    --ifm-color-primary-darkest: #150a51;\n    --ifm-color-primary-light: var(--detox-color-p0);\n    --ifm-color-primary-lighter: var(--detox-color-p1);\n    --ifm-color-primary-lightest: var(--detox-color-p2);\n\n    --ifm-color-secondary-contrast-background: var(--detox-color-u4a);\n    --ifm-color-secondary-contrast-foreground: var(--detox-color-a0);\n    --ifm-color-secondary-dark: var(--detox-color-u0);\n    --ifm-color-danger-contrast-background: var(--detox-color-r4a);\n    --ifm-color-danger-dark: var(--detox-color-r0);\n    --ifm-color-warning-contrast-background: var(--detox-color-y4a);\n    --ifm-color-warning-dark: var(--detox-color-y0);\n    --ifm-color-success-contrast-background: var(--detox-color-e4a);\n    --ifm-color-success-dark: var(--detox-color-e0);\n    --ifm-color-info-contrast-background: var(--detox-color-b4a);\n    --ifm-color-info-dark: var(--detox-color-b0);\n\n    --ifm-footer-background-color: #FDFDFD;\n\n    --ifm-code-font-size: 95%;\n\n\n    --ifm-button-background-color: #fff;\n    --ifm-color-gray-900: #12161B;\n\n    --ifm-font-family-base: 'Nunito Sans', sans-serif;\n  }\n\n  &[data-theme='light'] {\n    @include define-detox-light-colors();\n    --docusaurus-highlighted-code-line-bg: #d9e5f6;\n    --ifm-heading-color: #12161B;\n  }\n\n  &[data-theme='dark'] {\n    @include define-detox-dark-colors();\n    --docusaurus-highlighted-code-line-bg: #414458;\n    --ifm-background-color: var(--detox-color-a1);\n    --ifm-footer-background-color: var(--detox-color-a1);\n    --ifm-heading-color: #fff;\n  }\n}\n\nhtml {\n  -webkit-font-smoothing: initial;\n  text-rendering: initial;\n}\n"
  },
  {
    "path": "website/src/css/_showcase-link.scss",
    "content": "// Header for showcase page\n.header-showcase-link:after {\n  background: url(@site/static/img/showcase/showcase-icon-dark.svg) no-repeat;\n  content: '';\n  display: inline-flexbox;\n  padding-left: 28px;\n}\n\n.header-showcase-link:hover::after {\n  background: url(@site/static/img/showcase/showcase-icon-hover.svg) no-repeat;\n}\n\n[data-theme='dark'] .header-showcase-link:hover::after {\n  background: url(@site/static/img/showcase/showcase-icon-hover.svg) no-repeat;\n}\n\n[data-theme='dark'] .header-showcase-link:after {\n  background: url(@site/static/img/showcase/showcase-icon-white.svg) no-repeat;\n}\n"
  },
  {
    "path": "website/src/css/custom.scss",
    "content": "@import 'colors';\n@import 'fonts';\n\n@import 'root';\n@import 'benefits-section';\n@import 'footer';\n@import 'header-github';\n@import 'navbar';\n@import 'showcase-link';\n@import 'markdown';"
  },
  {
    "path": "website/src/pages/index.js",
    "content": "import React from 'react';\nimport Layout from '@theme/Layout';\nimport HomepageHeader from '@site/src/components/Homepage/Header/HomepageHeader';\nimport HomepageFeatures from '@site/src/components/Homepage/Features/HomepageFeatures';\nimport HomepageSubHeader from '@site/src/components/Homepage/SubHeader/HomepageSubHeader';\nimport StandWithUkraine from '@site/src/components/CustomBanner/StandWithUkraine';\n\nconst Home = () => {\n  return (\n    <>\n      <StandWithUkraine />\n      <Layout>\n        <HomepageHeader />\n        <HomepageSubHeader />\n        <main>\n          <HomepageFeatures />\n        </main>\n      </Layout>\n    </>\n  );\n};\n\nexport default Home;\n"
  },
  {
    "path": "website/src/pages/showcase.js",
    "content": "import React from 'react';\nimport Head from '@docusaurus/Head';\nimport Layout from '@theme/Layout';\nimport StandWithUkraine from '@site/src/components/CustomBanner/StandWithUkraine';\nimport * as Showcase from '@site/src/components/Showcase';\n\nexport default function ShowcasePage() {\n  return (\n    <>\n      <Head>\n        <title>Showcase | Detox</title>\n      </Head>\n      <StandWithUkraine />\n      <Layout>\n        <main>\n          <Showcase.Hero />\n          <Showcase.List />\n        </main>\n      </Layout>\n    </>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/Copyright/index.js",
    "content": "import React from 'react';\nexport default function FooterCopyright({copyright}) {\n  return (\n    <div\n      className=\"footer__copyright\"\n      // Developer provided the HTML, so assume it's safe.\n      // eslint-disable-next-line react/no-danger\n      dangerouslySetInnerHTML={{__html: copyright}}\n    />\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/Layout/index.js",
    "content": "import React from 'react';\nimport clsx from 'clsx';\nexport default function FooterLayout({ style, links, logo, copyright }) {\n  return (\n    <footer\n      className={clsx('footer', {\n        'footer--dark': style === 'dark'\n      })}>\n      <div className=\"container container-fluid\">\n        {links}\n        {(logo || copyright) && (\n          <div className=\"footer__bottom text--center\">\n            {logo && <div className=\"margin-bottom--sm\">{logo}</div>}\n            {copyright}\n          </div>\n        )}\n      </div>\n    </footer>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/LinkItem/index.js",
    "content": "import React from 'react';\nimport { kebabCase } from 'lodash';\nimport Link from '@docusaurus/Link';\nimport useBaseUrl from '@docusaurus/useBaseUrl';\nimport isInternalUrl from '@docusaurus/isInternalUrl';\nimport clsx from 'clsx';\n\nexport default function FooterLinkItem({ item }) {\n  const { to, href, label, prependBaseUrlToHref, ...props } = item;\n  const toUrl = useBaseUrl(to);\n  const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true });\n  return (\n    <Link\n      {...(href\n        ? {\n            href: prependBaseUrlToHref ? normalizedHref : href\n          }\n        : {\n            to: toUrl\n          })}\n      {...props}\n      className={clsx('footer__link-item', !!href && `footer__link-item_${kebabCase(item.label)}`)}>\n      {label}\n      {href && !isInternalUrl(href)}\n    </Link>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/Links/index.js",
    "content": "import React from 'react';\nimport { kebabCase } from 'lodash';\nimport LinkItem from '@theme/Footer/LinkItem';\nimport clsx from 'clsx';\n\nfunction ColumnLinkItem({ item }) {\n  return item.html ? (\n    <li\n      className=\"footer__item\"\n      // Developer provided the HTML, so assume it's safe.\n      // eslint-disable-next-line react/no-danger\n      dangerouslySetInnerHTML={{ __html: item.html }}\n    />\n  ) : (\n    <li key={item.href ?? item.to} className=\"footer__item\">\n      <LinkItem item={item} />\n    </li>\n  );\n}\n\nfunction Column({ column }) {\n  return (\n    <div className={clsx(\"col footer__col\", `footer__col_${kebabCase(column.title)}`)}>\n      <div className=\"footer__title\">{column.title}</div>\n      <ul className=\"footer__items clean-list\">\n        {column.items.map((item, i) => (\n          <ColumnLinkItem key={i} item={item} />\n        ))}\n      </ul>\n    </div>\n  );\n}\n\nexport default function FooterLinks({ links }) {\n  return (\n    <div className=\"row footer__links\">\n      {links.map((column, i) => (\n        <Column key={i} column={column} />\n      ))}\n    </div>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/Logo/index.js",
    "content": "import React from 'react';\nimport clsx from 'clsx';\nimport Link from '@docusaurus/Link';\nimport {useBaseUrlUtils} from '@docusaurus/useBaseUrl';\nimport ThemedImage from '@theme/ThemedImage';\nimport styles from './styles.module.css';\nfunction LogoImage({logo}) {\n  const {withBaseUrl} = useBaseUrlUtils();\n  const sources = {\n    light: withBaseUrl(logo.src),\n    dark: withBaseUrl(logo.srcDark ?? logo.src),\n  };\n  return (\n    <ThemedImage\n      className={clsx('footer__logo', logo.className)}\n      alt={logo.alt}\n      sources={sources}\n      width={logo.width}\n      height={logo.height}\n      style={logo.style}\n    />\n  );\n}\nexport default function FooterLogo({logo}) {\n  return logo.href ? (\n    <Link\n      href={logo.href}\n      className={styles.footerLogoLink}\n      target={logo.target}>\n      <LogoImage logo={logo} />\n    </Link>\n  ) : (\n    <LogoImage logo={logo} />\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Footer/Logo/styles.module.css",
    "content": "/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n.footerLogoLink {\n  opacity: 0.5;\n  transition: opacity var(--ifm-transition-fast)\n    var(--ifm-transition-timing-default);\n}\n\n.footerLogoLink:hover {\n  opacity: 1;\n}\n"
  },
  {
    "path": "website/src/theme/Footer/index.js",
    "content": "import React from 'react';\nimport {useThemeConfig} from '@docusaurus/theme-common';\nimport FooterLinks from '@theme/Footer/Links';\nimport FooterLogo from '@theme/Footer/Logo';\nimport FooterCopyright from '@theme/Footer/Copyright';\nimport FooterLayout from '@theme/Footer/Layout';\nfunction Footer() {\n  const {footer} = useThemeConfig();\n  if (!footer) {\n    return null;\n  }\n  const {copyright, links, logo, style} = footer;\n  return (\n    <FooterLayout\n      style={style}\n      links={links && links.length > 0 && <FooterLinks links={links} />}\n      logo={logo && <FooterLogo logo={logo} />}\n      copyright={copyright && <FooterCopyright copyright={copyright} />}\n    />\n  );\n}\nexport default React.memo(Footer);\n"
  },
  {
    "path": "website/src/theme/Icon/Menu/index.js",
    "content": "import React from 'react';\nexport default function IconMenu({ width = 19, height = 12, className, ...restProps }) {\n  return (\n    <svg className={className} width={width} height={height} viewBox=\"0 0 19 12\" fill=\"currentColor\" aria-hidden=\"true\" {...restProps}>\n      <rect x=\"0.5\" y=\"5.5\" width=\"18\" height=\"1\" rx=\"0.5\" stroke=\"currentColor\" strokeLinecap=\"round\" />\n      <rect x=\"0.5\" y=\"10.5\" width=\"18\" height=\"1\" rx=\"0.5\" stroke=\"currentColor\" strokeLinecap=\"round\" />\n      <rect x=\"0.5\" y=\"0.5\" width=\"18\" height=\"1\" rx=\"0.5\" stroke=\"currentColor\" strokeLinecap=\"round\" />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Navbar/Search/index.js",
    "content": "import React from 'react';\nimport Search from '@theme-original/Navbar/Search';\nimport styles from './styles.module.scss';\n\nexport default function SearchWrapper(props) {\n  return (\n    <>\n      <Search className={styles.searchWrapper} {...props} />\n    </>\n  );\n}\n"
  },
  {
    "path": "website/src/theme/Navbar/Search/styles.module.scss",
    "content": ".searchWrapper {\n  padding: var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal);\n  margin-left: 10px;\n\n  @media (max-width: 768px) {\n    padding: 0;\n    margin: 0;\n\n    right: 64px;\n  }\n}"
  },
  {
    "path": "website/static/.nojekyll",
    "content": ""
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.ActionsOnElement.md",
    "content": "---\nid: actions-on-element\nslug: api/actions-on-element\ntitle: Actions\nsidebar_label: Actions\n---\n\n## Actions\n\nDetox uses [matchers](APIRef.Matchers.md) to find UI elements in your app and actions to simulate user interaction with those elements.\n\nUse [expectations](APIRef.Expect.md) to verify element states.\n\n### Methods\n\n- [`.tap()`](#tappoint)\n- [`.multiTap()`](#multitaptimes)\n- [`.longPress()`](#longpressduration)\n- [`.longPressAndDrag()`](#longpressanddragduration-normalizedpositionx-normalizedpositiony-targetelement-normalizedtargetpositionx-normalizedtargetpositiony-speed-holdduration--ios-only) **iOS only**\n- [`.swipe()`](#swipedirection-speed-normalizedoffset-normalizedstartingpointx-normalizedstartingpointy)\n- [`.pinch()`](#pinchscale-speed-angle--ios-only) **iOS only**\n- [`.scrollToIndex()`](#scrolltoindexindex--android-only) **Android only**\n- [`.scroll()`](#scrolloffset-direction-startpositionx-startpositiony)\n  - [`whileElement()`](#whileelementelement)\n- [`.scrollTo()`](#scrolltoedge)\n- [`.typeText()`](#typetexttext)\n- [`.replaceText()`](#replacetexttext)\n- [`.clearText()`](#cleartext)\n- [`.tapReturnKey()`](#tapreturnkey)\n- [`.tapBackspaceKey()`](#tapbackspacekey)\n- [`.setColumnToValue()`](#setcolumntovaluecolumn-value--ios-only) **iOS only**\n- [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat--ios-only) **iOS only**\n- [`.adjustSliderToPosition()`](#adjustslidertopositionnormalizedposition)\n- [`.getAttributes()`](#getattributes)\n- [`.takeScreenshot(name)`](#takescreenshotname)\n\n#### `tap(point)`\n\nSimulates a tap on the element at the specified point, or at element’s activation point if no point is specified.\n\n`point`—a point in the element’s coordinate space (optional, valid input: object with x and y numerical values, default is `null`)\n\n**Note:** Special care should be applied when specifying a point with this method. Elements may have different dimensions when displayed on different device screen sizes, different text sizes, etc.\n\n```js\nawait element(by.id('tappable')).tap();\nawait element(by.id('tappable')).tap({x:5, y:10});\n```\n\n#### `multiTap(times)`\n\nSimulates multiple taps on the element at its activation point. All taps are applied as a part of the same gesture and there is no synchronization attempt between taps.\n\n`times`—the number of taps to simulate (number, 1 and above)\n\n```js\nawait element(by.id('tappable')).multiTap(3);\n```\n\n#### `longPress(duration)`\n\nSimulates a long press on the element at its activation point.\n\n`duration` (iOS only) — press during time, in milliseconds. Optional (default is 1000 ms).\n\n```js\nawait element(by.id('tappable')).longPress();\nawait element(by.id('tappable')).longPress(1500);\n```\n\n#### `longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration)`  iOS only\n\nSimulates a long press on the element and then drag it to a position of another element.\n\n`duration` —the duration to press for, in ms (required) <br/>\n`normalizedPositionX` — X coordinate of the starting point, relative to the element width (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n`normalizedPositionY` — Y coordinate of the starting point, relative to the element height (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n`targetElement`— the target element to drag to (required) <br/>\n`normalizedTargetPositionX` — X coordinate of the ending point, relative to the target element width (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n`normalizedTargetPositionY` — Y coordinate of the ending point, relative to the target element height (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n`speed` — the speed of the drag (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n`holdDuration` — the duration before releasing at the end, in ms (optional, default is 1000)\n\n```js\nawait element(by.id('elementToDrag')).longPressAndDrag(2000, NaN, NaN, element(by.id('targetElement')), NaN, NaN);\nawait element(by.id('cellId_1')).longPressAndDrag(2000, 0.9, NaN, element(by.id('cellId_6')), 0.9, NaN, 'slow', 0);\n```\n\n#### `swipe(direction, speed, normalizedOffset, normalizedStartingPointX, normalizedStartingPointY)`\n\nSimulates a swipe on the element with the provided options.\n\n`direction` — the direction of the swipe (required, valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n`speed` — the speed of the swipe (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n`normalizedOffset` — swipe amount relative to the screen width/height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n`normalizedStartingPointX` — X coordinate of the swipe starting point, relative to the element width (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n`normalizedStartingPointY` — Y coordinate of the swipe starting point, relative to the element height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically)\n\n```js\nawait element(by.id('scrollView')).swipe('down');\nawait element(by.id('scrollView')).swipe('down', 'slow'); // set swipe speed\nawait element(by.id('scrollView')).swipe('down', 'fast', 0.75); // set swipe amount\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, 0.8); // set starting point X\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, NaN, 0.25); // set starting point Y\n```\n\n#### `pinch(scale, speed, angle)`  iOS only\n\nSimulates a pinch on the element with the provided options.\n\n`scale`—the scale of the pinch gesture; use a scale between 0 and 1 to zoom out, and a scale greater than 1 to zoom in; the system makes a best effort to accommodate the requested scale, taking into account the element’s dimensions (valid input: (0.0, inf]) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinch(1.1); //Zooms in a little bit\nawait element(by.id('PinchableScrollView')).pinch(2.0); //Zooms in a lot\nawait element(by.id('PinchableScrollView')).pinch(0.001); //Zooms out a lot\n```\n\n#### `scrollToIndex(index)`  Android only\n\nScrolls until it reaches the element with the provided index. This works for `ReactScrollView` and `ReactHorizontalScrollView`.\n\n`index`—the index of the target element <br/>\n\n```js\nawait element(by.id('scrollView')).scrollToIndex(0);\n```\n\n#### `scroll(offset, direction, startPositionX, startPositionY)`\n\nSimulates a scroll on the element with the provided options.\n\n`offset`—the offset to scroll, in points <br/>\n`direction`—the scroll’s direction (valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n`startPositionX`—the normalized x percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`) <br/>\n`startPositionY`—the normalized y percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`)\n\n```js\nawait element(by.id('scrollView')).scroll(100, 'up');\nawait element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85);\n```\n\n#### `whileElement(element)`\n\nContinuously scrolls the scroll element until the specified expectation is resolved. If the edge of the scroll element is reached while the expectation is not resolved, the operation is failed.\n\n```js\nawait waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down');\n```\n\n#### `scrollTo(edge)`\n\nSimulates a scroll to the specified edge.\n\n`edge`—the edge to scroll to (valid input: `\"left\"`/`\"right\"`/`\"top\"`/`\"bottom\"`)\n\n```js\nawait element(by.id('scrollView')).scrollTo('bottom');\nawait element(by.id('scrollView')).scrollTo('top');\n```\n\n#### `typeText(text)`\n\nSimulates typing of the specified text into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be typed into, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before typing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to type (valid input: string)\n\n```js\nawait element(by.id('textField')).typeText('passcode');\n```\n\n#### `replaceText(text)`\n\nReplaces the element’s text with the specified text, without using the system’s builtin keyboard or typing behavior. **Note**, that using this method is faster than using [`.typeText()`](#typetexttext), but may not trigger all text input callbacks, causing an undefined state in your app.\n\nOn iOS, any element’s text can be replaced, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before replacing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to replace with (valid input: string)\n\n```js\nawait element(by.id('textField')).replaceText('passcode again');\n```\n\n#### `clearText()`\n\nSimulates clearing the text of the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element’s text can be cleared, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before clearing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).clearText();\n```\n\n#### `tapReturnKey()`\n\nSimulates tapping on the return key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent return key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the return key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapReturnKey();\n```\n\n#### `tapBackspaceKey()`\n\nSimulates tapping of the backspace key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent backspace key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the backspace key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapBackspaceKey();\n```\n\n#### `setColumnToValue(column, value)`  iOS only\n\nSets the element’s specified column to the specified value, using the system’s picker view APIs.\n\nValues accepted by this method are strings only, and the system will do its best to match complex picker view cells to the string.\n\nThis function does not support date pickers. Use [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat--ios-only) instead.\n\n`column`—the element’s column to set (valid input: number, 0 and above) <br/>\n`value`—the string value to set (valid input: string)\n\n```js\nawait element(by.id('pickerView')).setColumnToValue(1, \"6\");\nawait element(by.id('pickerView')).setColumnToValue(2, \"Hello World\");\n```\n\n> **Note:** When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles. See [here](APIRef.DeviceObjectAPI.md#9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only) for more information.\n\n#### `setDatePickerDate(dateString, dateFormat)`  iOS only\n\nSets the element’s date to the specified date string, parsed using the specified date format.\n\nThe specified date string is converted by the system to an [`NSDate`](https://developer.apple.com/documentation/foundation/nsdate) object, using [`NSDateFormatter`](https://developer.apple.com/documentation/foundation/dateformatter) with the specified date format, or [`NSISO8601DateFormatter`](https://developer.apple.com/documentation/foundation/iso8601dateformatter) in case of ISO 8601 date strings. If you use JavaScript’s [Date.toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) or otherwise provide a valid ISO 8601 date string, set the date format to `\"ISO8601\"`, which is supported as a special case.\n\n`dateString`—the date to set (valid input: valid, parsable date string) <br/>\n`dateFormat`—the date format of `dateString` (valid input: `\"ISO8601\"` or a valid, parsable date format supported by [`NSDateFormatter`](https://developer.apple.com/documentation/foundation/dateformatter))\n\n```js\nawait element(by.id('datePicker')).setDatePickerDate('2019-02-06T05:10:00-08:00', \"ISO8601\");\nawait element(by.id('datePicker')).setDatePickerDate('2019/02/06', \"yyyy/MM/dd\");\n```\n\n#### `adjustSliderToPosition(normalizedPosition)`\n\nManipulates the UI to change the displayed value of the slider element to a new value, based on a normalized position.\n\n`normalizedPosition`—The normalized position to adjust the slider element. (valid input: \\[0, 1], 0 corresponds to the minimum value of the slider, and 1 corresponds to the maximum value)\n\n```js\nawait element(by.id('slider')).adjustSliderToPosition(0.75);\n```\n\n#### `getAttributes()`\n\nReturns an object, representing various attributes of the element.\n\nRetrieved attributes are:\n\n- `text`: The text value of any textual element.\n- `label`: The label of the element. Matches `accessibilityLabel` for iOS, and `contentDescription` for android.\n- `placeholder`: The placeholder text value of the element. Matches `hint` on android.\n- `enabled`: Whether the element is enabled for user interaction.\n- `identifier`: The identifier of the element. Matches `accessibilityIdentifier` on iOS, and the main view tag, on Android - both commonly **holding the component’s test ID in React Native apps**.\n- `visible`: Whether the element is visible. On iOS, visibility is calculated for the [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint). On Android, the attribute directly holds the value returned by [View.getLocalVisibleRect()](https://developer.android.com/reference/kotlin/android/view/View#getglobalvisiblerect)).\n- `value`: The value of the element, where applicable. For example: the position of a slider, or whether a checkbox has been marked. Matches `accessibilityValue`, on iOS.\n\n##### iOS-Only\n\n- `activationPoint`: The [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint) of the element, in element coordinate space.\n- `normalizedActivationPoint`: The activation point of the element, in normalized percentage (\\[0.0, 1.0]).\n- `hittable`: Whether the element is hittable at the activation point.\n- `frame`: The frame of the element, in screen coordinate space.\n- `elementFrame`: The frame of the element, in container coordinate space.\n- `elementBounds`: The bounds of the element, in element coordinate space.\n- `safeAreaInsets`: The safe area insets of the element, in element coordinate space.\n- `elementSafeBounds`: The safe area bounds of the element, in element coordinate space.\n- `date`: The date of the element (in case the element is a date picker).\n- `normalizedSliderPosition`: The normalized slider position (in case the element is a slider).\n- `contentOffset`: The content offset (in case the element is a scroll view).\n- `contentInset`: The content inset (in case the element is a scroll view).\n- `adjustedContentInset`: The adjusted content inset (in case the element is a scroll view).\n\n##### Android-Only\n\n- `visibility`: The OS visibility type associated with the element: `visible`, `invisible` or `gone`.\n- `width`: Width of the element, in pixels.\n- `height`: Height of the element, in pixels.\n- `elevation`: Elevation of the element.\n- `alpha`: Alpha value for the element.\n- `focused`: Whether the element is the one currently in focus.\n- `textSize`: The text size for the text element.\n- `length`: The length of the text element (character count).\n\nIf the value for a given attribute is null or cannot be otherwise computed, the key will not be present, but empty strings may be found in the object.\n\nIf the query matches multiple elements, the attributes of all matched elements is returned as an array of objects under the `elements` key.\n\n```js\nconst attributes = await element(by.text('Tap Me')).getAttributes();\njestExpect(attributes.text).toBe('Tap Me');\n\nconst multipleMatchedElements = await element(by.text('Multiple')).getAttributes();\njestExpect(multipleMatchedElements.elements.length).toBe(5);\njestExpect(multipleMatchedElements.elements[0].identifier).toBe('FirstElement');\n```\n\n#### `takeScreenshot(name)`\n\nTakes a screenshot of the matched element. For full details on taking screenshots with Detox, refer to the [screenshots guide](APIRef.Screenshots.md).\n\n`name`—the name of the screenshot\n\n### Deprecated Methods\n\n- [`.tapAtPoint()`](#tapatpointpoint)\n- [`.pinchWithAngle()`](#pinchwithangledirection-speed-angle--ios-only) **iOS only**\n\n#### `tapAtPoint(point)`\n\n**Deprecated:** Use [`.tap()`](#tappoint) instead.\n\nSimulates a tap at on the element at the specified point.\n\n`point`—a point in the element’s coordinate space\n\n```js\nawait element(by.id('tappable')).tapAtPoint({x:5, y:10});\n```\n\n#### `pinchWithAngle(direction, speed, angle)`  iOS only\n\n**Deprecated:** Use [`.pinch()`](#pinchscale-speed-angle--ios-only) instead.\n\nSimulates a pinch on the element with the provided options.\n\n`direction`—the direction of the pinch gesture (valid input: `\"inward\"`/`\"outward\"`) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinchWithAngle('outward', 'slow', 0);\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.Artifacts.md",
    "content": "---\nid: artifacts\nslug: api/artifacts\ntitle: Artifacts\nsidebar_label: Artifacts\n---\n\n## Artifacts\n\nArtifacts are various recordings during tests including, but not limited to, device logs, device screenshots and screen recordings (videos).\n\n### Enabling Artifacts\n\nArtifacts are disabled by default. To enable them, specify via **launch arguments** or a **configuration** object what artifacts you want to record.\n\n#### Launch Arguments\n\n- To record `.log` files, add `--record-logs all` (or `--record-logs failing`, if you want to keep logs only for failing tests).\n- To record `.mp4` test run videos, add `--record-videos all` (or `--record-videos failing`, if you want to keep video recordings only for failing tests).\n- To record `.dtxrec` (Detox Instruments recordings) for each test, add `--record-performance all`. To open those recordings, you’ll need [Detox Instruments](https://github.com/wix/DetoxInstruments). **NOTE:** only iOS is supported.\n- To capture `.uihierarchy` snapshots (**iOS only, Xcode 12.0+**) on view action failures, add `--capture-view-hierarchy enabled`.\n- To take `.png` screenshots before and after each test, add `--take-screenshots all` (or `--take-screenshots failing`, if you want to keep only screenshots of failing tests).\\\n  Alternatively, you might leverage the [device.takeScreenshot()](APIRef.DeviceObjectAPI.md#devicetakescreenshotname) API for manual control.\n\n##### Artifacts root directory\n\n- To change artifacts root directory location (by default it is `./artifacts`), add `--artifacts-location <path>`.\\\n  **NOTE:** There is a slightly obscure convention. If you want to create automatically a subdirectory with timestamp and configuration name (to avoid file overwrites upon consequent reruns), specify a path to directory that does not end with a slash. Otherwise, if you want to put artifacts straight to the specified directory (in a case where you make a single run only, e.g. on CI), add a slash (or a backslash) to the end.\n\n```sh\ndetox test --artifacts-location /tmp/detox_artifacts  # will also append /android.emu.release.2018-06-14 08:54:11Z\ndetox test --artifacts-location /tmp/detox_artifacts/ # won’t append anything, hereby treating it as a root\n```\n\n#### Configuration Object\n\nDetox artifacts can be configured in a more advanced way with the `artifacts` configuration in `package.json` (or `.detoxrc`):\n\n```json\n{\n  \"artifacts\": {},\n  \"configurations\": {\n    \"some.device\": {\n      \"artifacts\": {},\n    },\n  },\n}\n```\n\n**NOTE:** As you can see, there is a global and a local (per-configuration) configuration of the artifacts.\nDetox merges those configurations, and the per-device artifacts configuration has a higher priority over the general one.\n\nThe `artifacts` object has the following properties:\n\n| Property    | Example values                  | Default value | Description                                                                                                                                                          |\n| ----------- | ------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| rootDir     | `\".artifacts/\"`                 | `./artifacts` | A directory, where all the recorded artifacts will be placed in. Please note that there is a trailing slash convention [described above](#artifacts-root-directory). |\n| pathBuilder | `\"./e2e/config/pathbuilder.js\"` | `undefined`   | Path to a module that exports a custom `PathBuilder` [ᵃ](#path-builder)                                                                                              |\n| plugins     | `{ ... }`                       | ... see below | ... see below                                                                                                                                                        |\n\n##### Path builder\n\n**ᵃ** `PathBuilder` should be either an _object_ with a method `buildPathForTestArtifact` or a _class_ — see the corresponding interfaces below:\n\n```typescript\ninterface PathBuilder {\n    buildPathForTestArtifact(artifactPath: string, testSummary?: TestSummary): string;\n}\n\ninterface PathBuilderClass {\n    new(opts: { rootDir: string; }): PathBuilder;\n}\n```\n\nAs one can see, if a custom implementation of `PathBuilder` exports a class instead of an object, then the class constructor can also get and save `rootDir` location:\n\n```js\nclass MyPathBuilder {\n  constructor({ rootDir }) {\n    this._rootDir = rootDir;\n  }\n\n  buildPathForTestArtifact(artifactName, testSummary) {\n    /* ... use this._rootDir ... */\n  }\n}\n\nmodule.exports = MyPathBuilder;\n```\n\nIts main method, `buildPathForTestArtifact` should return a full path to the custom artifact location, when called with a suggested artifact name (e.g., `testDone.png`, `device.log`) and the current `TestSummary`, where `TestSummary` is:\n\n```typescript\ninterface TestSummary {\n    /**\n     * Name of the current test, e.g., for:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"should have a menu\".\n     */\n    title: string;\n    /**\n     * Full name of the current test, usually preceded by a suite name, e.g.:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"that screen should have a menu\".\n     */\n    fullName: string;\n    /**\n     * Status of the current test. Free-form strings are not allowed.\n     */\n    status: 'running' | 'passed' | 'failed';\n    /**\n     * Clarifies the reason for why the test has failed.\n     * Expected to coincide only with status: 'failed'.\n     */\n    timedOut?: boolean;\n    /**\n     * If the test runner is capable of retrying failed tests, then\n     * this property indicates for which time this test is running.\n     * When the property is undefined, its value is considered to be 1.\n     * */\n    invocations?: number;\n}\n```\n\nFor more technical details, search for `ArtifactPathBuilder.js` in Detox source code.\n\nThe further subsections describe the `plugins` object structure.\n\n##### Screenshot Plugin\n\nBelow is a default screenshot plugin object configuration, which is loaded implicitly and corresponds to the `manual` preset:\n\n```json\n{\n  \"plugins\": {\n    \"screenshot\": {\n      \"enabled\": true,\n      \"shouldTakeAutomaticSnapshots\": false,\n      \"keepOnlyFailedTestsArtifacts\": false,\n      \"takeWhen\": {\n        \"testStart\": true,\n        \"testDone\": true,\n        \"appNotReady\": true,\n      },\n    }\n  }\n}\n```\n\nThe other string presets override the following properties compared to the default configuration:\n\n- `none` => `{ enabled: false }`.\n- `failing` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: true }`.\n- `all` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: false }`\n\nThe individual property behavior is the following:\n\n- If `enabled` is _false_, then the screenshots will never be saved to the artifacts' folder.\n- If `shouldTakeAutomaticSnapshots` is _false_, then no one of the events described in `takeWhen` object is going to trigger a screenshot.\n- If `keepOnlyFailedTestsArtifacts` is _true_, then only screenshots from a failed test will be saved to the artifacts folder.\n- If `takeWhen` is _undefined_, it is going to have the default value described above (all props are true).\n- If `takeWhen` is set to be an empty object `{}`, that is equivalent to:\n\n```json\n{\n  \"testStart\": false,\n  \"testDone\": false,\n  \"appNotReady\": true,\n}\n```\n\nHence, for example, if you wish to enable only `testDone` screenshots and leave taking `appNotReady` screenshots as-is, you have to pass:\n\n```json\n{\n  \"artifacts\": {\n    \"plugins\": {\n      \"screenshot\": {\n        \"takeWhen\": { \"testDone\": true }\n      }\n    }\n  }\n}\n```\n\n##### Video Plugin\n\nTo be done. See meanwhile the example in [artifacts configuration section](config/overview.md#artifacts-configuration).\n\n##### Log Plugin\n\nTo be done. See meanwhile the example in [artifacts configuration section](config/overview.md#artifacts-configuration).\n\n##### Instruments Plugin\n\nTo be done. See meanwhile the example in [artifacts configuration section](config/overview.md#artifacts-configuration).\n\n##### UI hierarchy Plugin\n\nTo be done. See meanwhile the example in [artifacts configuration section](config/overview.md#artifacts-configuration).\n\n##### Timeline Plugin\n\nWhen enabled using the `--record-timeline all` argument to Detox, the time-line of the entire testing session is recorded, based on trace calls made by Detox internally, and explicit calls made in user test-code, combined.\nThe final outcome is a JSON-like file named `detox.trace.json`, which, if loaded into a Chrome-browser tab with the `chrome://tracing` URL, would look something like this:\n\n![Timeline artifact example](img/timeline-artifact.png)\n\nThis _tracing_ view provides a visual, hierarchical representation of the various processes that took place during the execution of the testing session, over the execution’s _time-line_. These processes appear as hierarchical _sections_ -- sometimes visually ordered in a parent-child way, depending on their formation time and context.\nTo name a few predefined events, which are generated by Detox itself:\n\n- **`detoxInit`:** Initialization of Detox, prior to running the suites associated with a specific tests file.\n- **`awaitBoot`:** Waiting for an emulator to complete booting (thus being ready to run tests). Done in the surrounding context of `detoxInit` (and hence visually appears \"below\" it), as waiting for emulators' boot is an inherent part of Detox' initialization.\n- **`appInstall`**, **`appUninstall`**.\n- **\"Sanity\":** Execution of a user test suite called _Sanity_.\n- **`reloadRN`:** A dynamic reload of the React-Native. Bound to calls to `device.reloadReactNative()`, specifically.\n\nIn the above example, the following can be observed:\n\n1. There were 2 test workers (the Worker #⁠1, Worker #⁠2 time-lines) executing a total of two test suites.\n1. There were 2 Android emulators used for running the test session, namely `emulator-17800` and `emulator-12466`. They were used by worker 1 and worker 2, respectively.\n1. It took about a total of 54 seconds to initialize and run all the tests.\n1. The first worker took longer to initialize (as depicted by the `detoxInit` section). In particular, that happened because it took longer for the associated emulator too finish bootstrapping (see the child `awaitBoot` section). That suggests there might be a problem with the test execution environment.\n\n###### Purpose\n\n**This artifact can be helpful in looking up ways to optimize the execution of your E2E tests.** It may surface shortcomings in the test environment’s ability to run the test, or provide a means to consider different ways of splitting up your tests over test files so as to better utilize parallelism.\n\nThe artifact can in fact be even better utilized -- to the level of inspecting the inside of your tests, by explicitly calling `trace` via the `detox.traceCall()` and `detox.trace.startSection()`, `detox.trace.endSection()` [APIs](APIRef.DetoxObjectAPI.md#detoxtracecall) inside your tests.\n\n### Artifacts Structure\n\n1. **Artifacts root folder** is created per detox test run. If, for instance,`--artifacts-location /tmp` is used with `--configuration ios.sim.release` configuration on 14th June 2018 at 11:02:11 GMT+02, then the folder `/tmp/ios.sim.release.2018-06-14 09:02:11Z` is created.\n\n1. **Test folder** is created per test inside the root folder. The folder name consists of the test number, and the test’s full name provided to `detox.afterEach(testSummary)` as explained above and in [detox object](APIRef.DetoxObjectAPI.md) documentation. For instance, for the above example, the following folders will be created inside `/tmp/ios.sim.release.2018-06-14 09:02:11Z`:\n\n   ```plain text\n   ✗ Assertions should assert an element has (accessibility)\n   ✓ Network Synchronization Sync with short network requests - 100ms\n   ```\n\n1. **Artifacts files** are created inside the test folders. The files suffixes stand for the files types (currently there are .err.log and .out.log), and the files prefixes are the launch numbers of the application per test (if the app was executed more than once per test, you will have several artifacts of each type - one per launch). For instance, a test folder may contain the following artifacts files:\n\n   ```plain text\n   test.log\n   test.mp4\n   test.dtxrec/\n   beforeEach.png\n   afterEach.png\n   ```\n\n#### Example of the structure\n\n```plain text\nartifacts/android.emu.release.2018-06-12 06:36:18Z/startup.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/beforeEach.png\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.mp4\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/afterEach.png\n```\n\n### Troubleshooting\n\n#### Video Recording Issues on CI\n\nFor iOS, you might be getting errors on CI similar to this:\n\n```plain text\nError: Error Domain=NSPOSIXErrorDomain Code=22 \"Invalid argument\" UserInfo={NSLocalizedDescription=Video recording requires hardware Metal capability.}.\n```\n\nUnfortunately, this error is beyond our reach. To fix it, you have to enable hardware acceleration on your build machine, or just disable video recording on CI if it is not possible to turn on the acceleration.\n\nThere might be a similar issue on Android when the screen recording process exits with an error on CI. While the solution might be identical to the one above, also you might try to experiment with other emulator devices and Android OS versions to see if it helps.\n\n#### Detox Instruments is Installed in a Custom Location\n\nIf you have to use [Detox Instruments](https://github.com/wix/DetoxInstruments) installed in a custom location, you can point Detox to it with the `DETOX_INSTRUMENTS_PATH` environment variable, as shown below:\n\n```bash\nDETOX_INSTRUMENTS_PATH=\"/path/to/Detox Instruments.app\" detox test ...\n```\n\n> **Note:** If **Detox Instruments** had been [integrated into your project](https://github.com/wix/DetoxInstruments/blob/master/Documentation/XcodeIntegrationGuide.md), then the integrated [Detox Profiler framework](https://github.com/wix/DetoxInstruments/tree/master/Profiler) will be used when profiling with Detox.\n\n#### `Ctrl+C` Does Not Clean Up Temporary Files\n\nThis is a known issue. :man\\_shrugging:\nAfter you press `Ctrl+C` and stop the tests, some of temporary files won’t get erased (e.g. `/sdcard/83541_0.mp4` on Android emulator, or `/private/var/folders/lm/thz8hdxs4v3fppjh0fjc2twhfl_3x2/T/f12a4fcb-0d1f-4d98-866c-e7cea4942ade.png` on your Mac).\nIt cannot be solved on behalf of Detox itself, because the problem has to do with how Jest runner terminates its puppet processes.\nThe issue is on our radar, but the ETA for the fix stays unknown.\nIf you feel able to contribute the fix to [Jest](https://github.com/facebook/jest), you are very welcome.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.DetoxCLI.md",
    "content": "---\nid: detox-cli\nslug: api/detox-cli\ntitle: Detox Command Line Tools\nsidebar_label: Detox Command Line Tools\n---\n\n## Detox Command Line Tools (detox-cli)\n\n`detox-cli` lets you operate Detox from command line.\n\n### Installation\n\nInstall `detox-cli` globally via [npm](http://npmjs.org/detox-cli):\n\n```bash npm2yarn\nnpm install detox-cli --global\n```\n\n### Usage\n\n```sh\ndetox <command> [options]\n```\n\n### Commands\n\n| Command                           | Description                                                                                                                                                  |\n| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [init](#init)                     | Create initial E2E tests folder for jest or mocha                                                                                                            |\n| [build](#build)                   | **Convenience method.** Run the command defined in 'build' property of the specified configuration.                                                          |\n| [test](#test)                     | Initiating your test suite                                                                                                                                   |\n| [run-server](#run-server)         | Starts a standalone detox server                                                                                                                             |\n| [build-framework-cache](#cache)   | **MacOS only.** Builds Detox.framework to \\~/Library/Detox. The framework cache is specific for each combination of Xcode and Detox versions                 |\n| [clean-framework-cache](#cache)   | **MacOS only.** Deletes all compiled framework binaries from \\~/Library/Detox, they will be rebuilt on 'npm install' or when running 'build-framework-cache' |\n| [rebuild-framework-cache](#cache) | **MacOS only.** Rebuilds the Detox cache                                                                                                                     |\n| [recorder](#recorder)             | Starts a [Detox Recorder](https://github.com/wix/DetoxRecorder) recording                                                                                    |\n\n#### Options\n\n| Options   | Description         |\n| --------- | ------------------- |\n| --version | Show version number |\n| --help    | Show help           |\n\n#### init\n\nScaffolds initial E2E test folder structure for a specific test runner\n\n`detox init -r <test-runner-name>`\n\n| Option                            | Description                                      |\n| --------------------------------- | ------------------------------------------------ |\n| -r, --runner `<test-runner-name>` | test runner name (supported values: mocha, jest) |\n| --help                            | Show help                                        |\n\n#### build\n\nRun the command defined in `build` property of the specified **configuration**.\n\n`detox build [options]`\n\n| Option                                | Description                                                                                                                                   |\n| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| -c, --configuration `<device config>` | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it |\n| -C, --config-path `<configPath>`      | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                         |\n| -i, --if-missing                      | Execute the build command only if the app binary is missing.                                                                                  |\n| -s, --silent                          | Do not fail with error if an app config has no build command.                                                                                 |\n| --help                                | Show help                                                                                                                                     |\n\n#### test\n\nInitiating your test suite[^1].\n\n`detox test [options] <...testFilePaths>`\n\n| Option                                        | Description                                                                                                                                                                                                                                                                                               |\n| --------------------------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| -C, --config-path `<configPath>`              | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                                                                                                                                                                                     |\n| -c, --configuration `<device config>`         | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it                                                                                                                                                             |\n| -o, --runner-config `<config>`                | Test runner config file, defaults to 'e2e/mocha.opts' for mocha and 'e2e/config.json' for jest.                                                                                                                                                                                                           |\n| -n, --device-name \\[name]                     | Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.                                                                                                                                                                               |\n| -l, --loglevel \\[value]                       | Log level: fatal, error, warn, info, verbose, trace                                                                                                                                                                                                                                                       |\n| -d, --debug-synchronization `<value>`         | Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.                                                                                              |\n| -a, --artifacts-location `<path>`             | Artifacts (logs, screenshots, etc) root directory.[^2]                                                                                                                                                                                                                                                    |\n| --record-logs \\[failing/all/none]             | Save logs during each test to artifacts directory. Pass \"failing\" to save logs of failing tests only. The default value is **none**.                                                                                                                                                                      |\n| --take-screenshots \\[manual/failing/all/none] | Save screenshots before and after each test to artifacts directory. Pass \"failing\" to save screenshots of failing tests only. The default value is **manual**.                                                                                                                                            |\n| --record-videos \\[failing/all/none]           | Save screen recordings of each test to artifacts directory. Pass \"failing\" to save recordings of failing tests only. The default value is **none**.                                                                                                                                                       |\n| --record-performance \\[all/none]              | \\[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory. The default value is **none**.                                                                                                                                                                             |\n| --record-timeline \\[all/none]                 | \\[Jest Only] Record tests and events timeline, for visual display on the <chrome://tracing> tool. The default value is **none**.                                                                                                                                                                          |\n| --capture-view-hierarchy \\[enabled/disabled]  | \\[iOS Only] Capture `*.uihierarchy` snapshots on view action errors and `device.captureViewHierarchy()` calls. The default value is **disabled**.                                                                                                                                                         |\n| -R, --retries                                 | \\[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or `<N>` times at most.                                                                                                                                                                                  |\n| -r, --reuse                                   | Reuse existing installed app (do not delete + reinstall) for a faster run.                                                                                                                                                                                                                                |\n| -u, --cleanup                                 | Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue                                                                                                                                                                                            |\n| -w, --workers                                 | Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest). _Note: For workers > 1, Jest’s spec-level reporting is disabled, by default (can be overridden using --jest-report-specs)._                         |\n| --jest-report-specs                           | \\[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.                                                                                                                                                                                      |\n| -H, --headless                                | \\[Android Only] Launch emulator in headless mode. Useful when running on CI. Only applicable for **Google** emulators.                                                                                                                                                                                    |\n| --gpu                                         | \\[Android Only] Launch emulator with the specific `-gpu` [gpu mode](https://developer.android.com/studio/run/emulator-acceleration#command-gpu) parameter. Only applicable for **Google** emulators.                                                                                                      |\n| --device-launch-args                          | A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox.<br />**Note: the value must be specified after an equal sign (`=`) and inside quotes.** Usage example:<br />`--device-launch-args=\"-http-proxy http://1.1.1.1:8000 -no-snapshot-load\"` |\n| --app-launch-args                             | Custom arguments to pass (through) onto the app every time it is launched. The same **note** applies here, as for **--device-launch-args**.<br />See [launch arguments guide](APIRef.LaunchArgs.md) for complete info.                                                                                    |\n| --no-color                                    | Disable colors in log output                                                                                                                                                                                                                                                                              |\n| --use-custom-logger                           | Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test-runner’s implementation (e.g. Jest / Mocha).<br />_Default: true_                                                                                                        |\n| --force-adb-install                           | Due to problems with the `adb install` command on Android, Detox resorts to a different scheme for installing APKs. Setting true will disable that and force usage of `adb install`, instead.<br/>This flag is temporary until the Detox way proves stable.<br/>_Default: false_                          |\n| --inspect-brk                                 | Uses [node’s --inspect-brk](https://nodejs.org/en/docs/guides/debugging-getting-started/#enable-inspector) flag to let users debug the jest/mocha test runner <br />_Default: false_                                                                                                                      |\n| --help                                        | Show help                                                                                                                                                                                                                                                                                                 |\n\n##### `DETOX_ARGV_OVERRIDE`\n\nIf you happen to be troubleshooting Detox tests inside a complex script, or a failing CI build\n(e.g., on TeamCity or Jenkins), there is an escape-hatch feature for running Detox with\nsome extra CLI args just by setting the `DETOX_ARGV_OVERRIDE` environment variable before\nrerunning it again.\n\n```plain text\n> export DETOX_ARGV_OVERRIDE=\"--forceExit -w 1 --testNamePattern='that hanging test' e2e/sanity/login.test.js\"\n> bash scripts/ci.e2e.sh\n  # ... some output ...\n  > detox test -c ios.sim.release -l verbose --workers 3\n    # ...\n    configuration=ios.sim.release ... jest --maxWorkers 1 --forceExit --testNamePattern='that hanging test' e2e/sanity/login.test.js\n```\n\nConsider the example above, where `DETOX_ARGV_OVERRIDE` forces Detox to run Jest in a single worker\nmode with a forceful exit (after 1 second) only for a selected test in a specific file.\n\nAs you might see, the idea of `DETOX_ARGV_OVERRIDE` is quite similar to [NODE\\_OPTIONS](https://nodejs.org/api/cli.html#cli_node_options_options)\nexcept for the fact you use it not for regular flows, but for forced ad-hoc patching of a failing Detox configuration to\nsave your time.\n\nPlease avoid using it in your regular flows – instead, use Detox configuration files (`.detoxrc.js`)\nas your primary choice.\n\n#### run-server\n\nStart a standalone Detox server\n\n`detox run-server [options]`\n\n| Option                  | Description                                         |\n| ----------------------- | --------------------------------------------------- |\n| -p, --port \\[port]      | Port number (default: 8099)                         |\n| -l, --loglevel \\[value] | Log level: fatal, error, warn, info, verbose, trace |\n| --no-color              | Disable colorful logs                               |\n| --help                  | Show help                                           |\n\n#### recorder\n\nIf you have installed [Detox Recorder](https://github.com/wix/DetoxRecorder) in your project, you can use this command to start a new recording.\n\n#### Cache\n\nDetox stores a cached version of its framework in `~/Library/Detox`. A different cache folder is used for different Xcode and Detox versions. Use the various cache commands to clean or build this cache.\n\n[^1]: It should be noted that `detox test` is a convenience method to trigger an execution\n    of a supported test runner, so for the most part it reads configuration from CLI args and `package.json` and remaps it\n    to command-line arguments or environment variables that are supported by (or not conflict with) the test runner.\n    Hence, **extra arguments to** `detox test` **will be forwarded to your test runner**, e.g:\\\n    1\\. You run `detox test --bail`, and since `--bail` is an unknown option, it will be forwarded to the test runner as-is.\\\n    2\\. If there is a name conflict for some option (between the test runner and `detox test`), you can pass it explicitly\\\n    after the reserved `--` sequence. For instance, `detox test -- --help`, will pass `--help` to the test runner CLI\n    itself.\n\n[^2]: If `--artifacts-location` path does not end with a slash (`/`) or a backslash, then detox CLI will append to the\n    path a subdirectory with configuration name and timestamp (e.g. `artifacts/android.emu.release.2018-06-12 05:52:43Z`).\n    In other words, the path with a slash at the end assumes you do not want a subdirectory inside.\n    For more details, please check the [Enabling artifacts](APIRef.Artifacts.md#artifacts).\n    The default value is **artifacts** (plus a subdirectory).\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.DetoxObjectAPI.md",
    "content": "---\nid: detox-object-api\nslug: api/detox-object-api\ntitle: Detox Object API\nsidebar_label: The `detox` Object\n---\n\n## The `detox` Object\n\n`detox` is globally available in every test file, though currently it is only used in the setup/init file.\n\n> NOTE: detox is test runner independent, and we encourage you to choose your own test runner, but for the sake of demonstration we will use `mocha`’s syntax.\n\n### Methods\n\n- [`detox.init()`](#detoxinit)\n- [`detox.beforeEach()`](#detoxbeforeeach)\n- [`detox.afterEach()`](#detoxaftereach)\n- [`detox.cleanup()`](#detoxcleanup)\n- [`detox.traceCall()`](#detoxtracecall)\n- [`detox.trace.startSection(), detox.trace.endSection()`](#detoxtracestartsection-detoxtraceendsection)\n\n#### `detox.init()`\n\nThe setup phase happens inside `detox.init()`. This is the phase where detox reads its configuration, starts a server, loads its expectation library and starts a simulator.\n\n**If you’re using _mocha_**, in your `init.js` add:\n\n```js\nconst detox = require('detox');\n\nbefore(async () => {\n  await detox.init();\n});\n```\n\n##### Explicit imports during initialization\n\nDetox exports `device`, `expect`, `element`, `by` and `waitFor` as globals by default, if you want to control their initialization manually, set init detox with `initGlobals` set to `false`. This is useful when during E2E tests you also need to run regular expectations in node. jest `Expect` for instance, will not be overridden by Detox when this option is used.\n\n```js\nconst detox = require('detox');\n\nbefore(async () => {\n  await detox.init(undefined, {initGlobals: false});\n});\n```\n\nThen import them manually:\n\n```js\nconst {device, expect, element, by, waitFor} = require('detox');\n```\n\nUse [this example](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2eExplicitRequire) for initial setup\n\n##### Reusing existing app\n\nBy default `await detox.init();` will uninstall and install the app. If you wish to reuse the existing app for a faster run, add `{reuse: true}` param to your init.\n\n```js\nbefore(async () => {\n  await detox.init(undefined, {reuse: true});\n});\n```\n\n#### `detox.beforeEach()`\n\nThis method should be called at the start of every test to let Detox’s artifacts lifecycle know it is the time to start recording logs and videos, or to take another `beforeEach.png` screenshot. Although this is one of usage of `beforeEach`, Detox does not limit itself to this usage and may utilize calls to `beforeEach` for additional purposes in the future.\n\n```typescript\ndeclare function beforeEach(testSummary: {\n  title: string;\n  fullName: string;\n  status: 'running';\n})\n```\n\nUsually, you are not supposed to write own implementation of this call, instead rely on Detox in-house adapters for [mocha](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/init.js) and [jest](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/init.js) as in the examples. It should alleviate transitions to newer Detox versions for you as the chances are that API specification won’t prove itself as sufficient and it may undergo rewrites and extensions.\n\n> NOTE: If you are implementing support for a test runner different from Mocha and Jest, please keep in mind that _pending_ (also known as _skipped_) tests should not trigger `detox.beforeEach()` at all, neither `detox.afterEach()`. The rule of thumb is either you guarantee you call them both, or you don’t call anyone.\n\n#### `detox.afterEach()`\n\nYou are expected to call this method only after the test and all its inner `afterEach()`-es complete. Besides passing test title and full name, you should pay heed on delivering a valid status field: _failed_ or _passed_. If the test has another status (e.g. _skipped_), please comply to the note above in [detox.beforeEach()](#detoxbeforeEach) or use one of these two values as a fallback.\n\n```typescript\ndeclare function afterEach(testSummary: {\n  title: string;\n  fullName: string;\n  status: 'failed' | 'passed';\n})\n```\n\nNormally, you are not supposed to write own implementation of this call, as mentioned earlier in the [detox.beforeEach()](#detoxbeforeeach) documentation.\n\n#### `detox.cleanup()`\n\nThe cleanup phase should happen after all the tests have finished. This is the phase where detox server shuts down. The simulator will also shut itself down if `--cleanup` flag is added to `detox test`\n\n**If you’re using _mocha_**, in your `init.js` add:\n\n```js\nafter(async () => {\n  await detox.cleanup();\n});\n```\n\n#### `detox.traceCall()`\n\n:warning: **Beta**\n\nTrace a subprocess of your test’s runtime such that it would leave traces inside the [Timeline artifact](APIRef.Artifacts.md#timeline-plugin), for a later inspection.\n\nExample:\n\n```js\nit('Verify sanity things', async () => {\n  // Instead of this typical direct call:\n  // await element(by.id('sanityButton')).tap()\n  \n  // Use traceCall() as a wrapper:\n  await detox.traceCall('Navigate to sanity', () =>\n    element(by.id('sanityButton')).tap());\n});\n```\n\nThis would have the `tap` action traced to the final artifact, so it would look something like this:\n\n![User event](img/timeline-artifact-userEvent.png)\n\nAt the bottom right, you can see what portion of the test was spent in handling the whole navigation process: tap + screen push + screen rendering (i.e. action time, alongside Detox' inherent wait for the application to become idle).\n\n#### `detox.trace.startSection(), detox.trace.endSection()`\n\n:warning: **Beta**\n\nThis is similar to the `traceCall()` API, except that it gives more freedom with respect to when a section’s start and ending times are defined, so as to monitor a nontrivial flow. As a usage example:\n\n```js\nit('Verify sanity things', async () => {\n  try {\n    detox.trace.startSection('Turn off notifications');\n    await element(by.id('gotoNotifications')).tap();\n    await element(by.id('notificationsToggle')).tap();\n    await device.pressBack();    \n  } finally {\n    detox.trace.endSection('Turn off notifications');    \n  }\n});\n```\n\nEffectively, `start` and `end` can even be called in two complete different places - such as a `before` and an `after`. But that is discouraged. In fact, **usage of `detox.traceCall()` is the recommended way of tracing things, altogether.**\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.DeviceObjectAPI.md",
    "content": "---\nid: device-object-api\nslug: api/device-object-api\ntitle: Device Object API\nsidebar_label: The `device` Object\n---\n\n## The `device` Object\n\n`device` is globally available in every test file, it enables control over the current attached device (currently only simulators are supported).\n\n### Public Properties\n\n- [`device.id`](#deviceid)\n- [`device.name`](#devicename)\n- [`device.appLaunchArgs`](#deviceapplaunchargs)\n\n#### `device.id`\n\nHolds the environment-unique ID of the device - namely, the `adb` ID on Android (e.g. `emulator-5554`) and the Mac-global simulator UDID on iOS, as used by `simctl` (e.g. `AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE`).\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n#### `device.name`\n\nHolds a descriptive name of the device. Example: `emulator-5554 (Pixel_API_26)`\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n#### `device.appLaunchArgs`\n\nAccess the launch-arguments predefined by the user in preliminary, static scopes such as the Detox [configuration file](config/overview.md) and [command-line arguments](APIRef.DetoxCLI.md). This access allows, through dedicated methods, for both value-querying and modification:\n\n```js\n// Modify some of the predefined arguments:\ndevice.appLaunchArgs.modify({\n  mockServerPort: 1234,\n});\n// Retrieve the arguments:\ndevice.appLaunchArgs.get(); // ==> { mockServerPort: 1234 }\n// Reset (i.e. remove all arguments):\ndevice.appLaunchArgs.reset();\n```\n\nIn multi-app environments, you might want to persist your values between `device.selectApp(name)` calls:\n\n```js\ndevice.appLaunchArgs.modify({ transientArg: 'value' });\ndevice.appLaunchArgs.shared.modify({\n  permanentMockServerPort: 1234,\n};\n\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234, transientArg: 'value' }\ndevice.appLaunchArgs.shared.get(); // ==> { permanentMockServerPort: 1234 }\n\nawait device.selectApp('anotherApp');\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.reset();\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.shared.reset();\ndevice.appLaunchArgs.get(); // ==> {}\n```\n\nThis is the most flexible way of editing the launch arguments. Refer to the [launch arguments guide](APIRef.LaunchArgs.md) for complete details.\n\n### Methods\n\n- [`device.selectApp(name)`](#deviceselectappname)\n- [`device.launchApp(params)`](#devicelaunchappparams)\n- [`device.terminateApp()`](#deviceterminateapp)\n- [`device.sendToHome()`](#devicesendtohome)\n- [`device.reloadReactNative()`](#devicereloadreactnative)\n- [`device.installApp()`](#deviceinstallapp)\n- [`device.uninstallApp()`](#deviceuninstallapp)\n- [`device.openURL({url, sourceApp[optional]})`](#deviceopenurlurl-sourceappoptional)\n- [`device.sendUserNotification(params)`](#devicesendusernotificationparams)\n- [`device.sendUserActivity(params)` **iOS Only**](#devicesenduseractivityparams-ios-only)\n- [`device.setOrientation(orientation)`](#devicesetorientationorientation)\n- [`device.setLocation(lat, lon)`](#devicesetlocationlat-lon)\n- [`device.enableSynchronization()`](#deviceenablesynchronization)\n- [`device.disableSynchronization()`](#devicedisablesynchronization)\n- [`device.setURLBlacklist([urls])`](#deviceseturlblacklisturls)\n- [`device.resetContentAndSettings()` **iOS Only**](#deviceresetcontentandsettings-ios-only)\n- [`device.getPlatform()`](#devicegetplatform)\n- [`device.takeScreenshot([name])`](#devicetakescreenshotname)\n- [`device.captureViewHierarchy([name])`](#devicecaptureviewhierarchyname)\n- [`device.shake()` **iOS Only**](#deviceshake-ios-only)\n- [`device.setBiometricEnrollment(bool)` **iOS Only**](#devicesetbiometricenrollmentbool-ios-only)\n- [`device.matchFace()` **iOS Only**](#devicematchface-ios-only)\n- [`device.unmatchFace()` **iOS Only**](#deviceunmatchface-ios-only)\n- [`device.matchFinger()` **iOS Only**](#devicematchfinger-ios-only)\n- [`device.unmatchFinger()` **iOS Only**](#deviceunmatchfinger-ios-only)\n- [`device.clearKeychain()` **iOS Only**](#deviceclearkeychain-ios-only)\n- [`device.setStatusBar()` **iOS Only**](#devicesetstatusbar-ios-only)\n- [`device.resetStatusBar()` **iOS Only**](#deviceresetstatusbar-ios-only)\n- [`device.reverseTcpPort()` **Android Only**](#devicereversetcpport-android-only)\n- [`device.unreverseTcpPort()` **Android Only**](#deviceunreversetcpport-android-only)\n- [`device.pressBack()` **Android Only**](#devicepressback-android-only)\n- [`device.getUiDevice()` **Android Only**](#devicegetuidevice-android-only)\n\n#### `device.selectApp(name)`\n\nUse **only for advanced multi-app configs** when you need to switch between your apps\nwithin the same test scenario. Refer to the [configuration doc](config/overview.md#apps-configurations)\nto discover how to define multiple apps with different `name`s.\n\n```js\nawait device.selectApp('myAppName');\n```\n\nAs a side effect (due to the current architectural limitation) running `device.selectApp` terminates the previous\napp that had been running before.\n\n#### `device.launchApp(params)`\n\nLaunch the app defined in the current [`configuration`](config/overview.md#apps-configurations).\n\n`params`—object, containing one of more of the following keys and values:\n\n##### 1. `newInstance`—Launching a New Instance of the App\n\nTerminate the app and launch it again.\n\nIf set to `false`, the device will try to resume the app (e.g. bring from foreground to background). If the app isn’t running, **it will launch a new instance** nonetheless. **Default is `false`.**\n\n```js\nawait device.launchApp({newInstance: true});\n```\n\n##### 2. `permissions`—Set Runtime Permissions (iOS Only)\n\nGrants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied.\n\n```js\nawait device.launchApp({permissions: {calendar: 'YES'}});\n```\n\nDetox uses [AppleSimUtils](https://github.com/wix/AppleSimulatorUtils) to implement this functionality for iOS simulators. Read about the different types of permissions and how to set them in AppleSimUtils' documentation and by checking out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/13.permissions.test.js).\n\n##### 3. `url`—Launching with URL\n\nLaunches the app with the specified URL to test your app’s deep link handling mechanism.\n\n```js\nawait device.launchApp({url});\nawait device.launchApp({url, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({url, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](APIRef.MockingOpenWithURL.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n##### 4. `userNotification`—Launching with User Notifications\n\nLaunches with the specified user notification.\n\n```js\nawait device.launchApp({userNotification});\nawait device.launchApp({userNotification, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({userNotification, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](APIRef.MockingUserNotifications.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n##### 5. `userActivity`—Launch with User Activity (iOS Only)\n\nLaunches the app with the specified user activity.\n\n```js\nawait device.launchApp({userActivity: activity});\nawait device.launchApp({userActivity: activity, newInstance: true}); //Launch a new instance of the app\nawait device.launchApp({userActivity: activity, newInstance: false}); //Reuse existing instance\n```\n\nRead more in [here](APIRef.MockingUserActivity.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n##### 6. `delete`—Delete and Reinstall Application Before Launching\n\nBefore launching the application, it is uninstalled and then reinstalled.\n\nA flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary). Default is `false`.\n\n```js\nawait device.launchApp({delete: true});\n```\n\n##### 7. `launchArgs`—Additional Process Launch Arguments\n\nLaunches the app on the device with on-site, user-specified launch arguments:\n\n```js\nawait device.launchApp({\n  launchArgs: {\n    arg1: 1,\n    arg2: \"2\",\n  }\n});\n```\n\nThis is the most explicit and straightforward way of setting launch arguments. Refer to the [launch arguments guide](APIRef.LaunchArgs.md) for a complete overview on app launch arguments.\n\n##### 8. `disableTouchIndicators`—Disable Touch Indicators (iOS Only)\n\nDisables touch indicators on iOS. Default is `false`.\n\n```js\nawait device.launchApp({disableTouchIndicators: true});\n```\n\n##### 9. `languageAndLocale`—Launch with a Specific Language and/or Local (iOS Only)\n\nLaunch the app with a specific system language\n\nInformation about accepted values can be found [here](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html).\n\n```js\nawait device.launchApp({\n  languageAndLocale: {\n    language: \"es-MX\",\n    locale: \"es-MX\"\n  }\n});\n```\n\nWith this API, you can run sets of E2E tests per language. For example:\n\n```js\n['es-MX', 'fr-FR', 'pt-BR'].forEach(locale => {\n  describe(`Test suite in ${locale}`, () => {\n\n    beforeAll(async () => {\n      await device.launchApp({\n        newInstance: true,\n        languageAndLocale: {\n          language: locale,\n          locale\n        }\n      });\n    });\n\n\n    it('Test A', () => {\n\n    })\n\n    it('Test B', () => {\n\n    })\n\n  });\n});\n```\n\n##### 10. `detoxEnableSynchronization`—Initialize Detox with synchronization enabled or disabled at app launch\n\nLaunches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using `device.enableSynchronization()`.\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxEnableSynchronization: 0 }\n});\n```\n\n##### 11. `detoxURLBlacklistRegex`—Initialize the URL Blacklist at app launch\n\nLaunches the app with a URL blacklist to disable network synchronization on certain endpoints. Useful if the app makes frequent network calls to blacklisted endpoints upon startup.\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxURLBlacklistRegex: ' \\\\(\"http://192.168.1.253:19001/onchange\",\"https://e.crashlytics.com/spi/v2/events\"\\\\)' },\n});\n```\n\n#### `device.relaunchApp(params)`\n\n**Deprecated:** Use `device.launchApp(params)` instead. The method calls `launchApp({newInstance: true})` for backwards compatibility.\n\n#### `device.terminateApp()`\n\nBy default, `terminateApp()` with no params will terminate the app file defined in the current [`configuration`](config/overview.md).\n\nTo terminate another app, specify its bundle id\n\n```js\nawait device.terminateApp('other.bundle.id');\n```\n\n#### `device.sendToHome()`\n\nSend application to background by bringing `com.apple.springboard` to the foreground.\nCombining `sendToHome()` with `launchApp({newInstance: false})` will simulate app coming back from background.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n```js\nawait device.sendToHome();\nawait device.launchApp({newInstance: false});\n// app returned from background, do stuff\n```\n\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n#### `device.reloadReactNative()`\n\nIf this is a React Native app, reload the React Native JS bundle. This action is much faster than `device.launchApp()`, and can be used if you just need to reset your React Native logic.\n\n<i>**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle.</i>\n\n#### `device.installApp()`\n\nBy default, `installApp()` with no params will install the app file defined in the current [`configuration`](config/overview.md).\n\nTo install another app, specify its path\n\n```js\nawait device.installApp('path/to/other/app');\n```\n\n#### `device.uninstallApp()`\n\nBy default, `uninstallApp()` with no params will uninstall the app defined in the current [`configuration`](config/overview.md).\n\nTo uninstall another app, specify its bundle id\n\n```js\nawait device.uninstallApp('other.bundle.id');\n```\n\n#### `device.openURL({url, sourceApp[optional]})`\n\nMock opening the app from URL. `sourceApp` is an optional **iOS-only** parameter to specify source application bundle id.\n\nRead more in [Mocking Open with URL](APIRef.MockingOpenWithURL.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js)\n\n#### `device.sendUserNotification(params)`\n\nMock handling of a user notification previously received in the system, while the app is already running.\n\nRead more in [Mocking User Notifications](APIRef.MockingUserNotifications.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js)\n\n#### `device.sendUserActivity(params)` **iOS Only**\n\nMock handling of received user activity when app is in foreground.\nRead more in [Mocking User Activity](APIRef.MockingUserActivity.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js)\n\n#### `device.setOrientation(orientation)`\n\nTakes `\"portrait\"` or `\"landscape\"` and rotates the device to the given orientation.\n\n**Note:** Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed.\n\nCheck out Detox’s [own test suite.](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js)\n\n#### `device.setLocation(lat, lon)`\n\nSets the simulator/emulator location to the given latitude and longitude.\n\n> On iOS `setLocation` is dependent on [`fbsimctl`](https://github.com/facebook/idb/tree/4b7929480c3c0f158f33f78a5b802c1d0e7030d2/fbsimctl) which [is now deprecated](https://github.com/wix/Detox/issues/1371). If `fbsimctl` is not installed, the command will fail, asking for it to be installed.\n>\n> On Android `setLocation` will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.\n\n```js\nawait device.setLocation(32.0853, 34.7818);\n```\n\n#### `device.disableSynchronization()`\n\nTemporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.\n\nThis API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly _busy_ (e.g. due to an endlessly repeating on-screen animation).\nHowever, using it inherently suggests that you are likely to resort to applying `sleep()`’s in your test code - testing that area, **which is not recommended and can never be 100% stable.** Therefore, as a rule of thumb, test code running \"inside\" a sync-disabled mode must be reduced to the bare minimum.\n\nNote: Synchronization is enabled by default, and it gets **re-enabled on every launch of a new instance of the app.**\n\n```js\nawait device.disableSynchronization();\n```\n\n#### `device.enableSynchronization()`\n\nRe-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to `device.disableSynchronization()`.\n\n:warning: Note: Making this call would resume synchronization **instantly**, having its returned promise only resolve when the app becomes idle again. In other words, this **must only be called after you navigate back to \"the safe zone\", where the app should be able to eventually become idle again**, or it would remain suspended \"forever\" (i.e. until a safeguard time-out expires).\n\n```js\nawait device.enableSynchronization();\n```\n\n#### `device.setURLBlacklist([urls])`\n\nExclude synchronization with respect to network activity (i.e. don’t wait for network to go idle before moving forward in the test execution) according to **specific** endpoints, denoted as URL reg-exp’s. To disable endpoints at initialization, pass in the black-list as an [app-launch argument](APIRef.LaunchArgs.md) named `detoxURLBlacklistRegex` (as explained [here](#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch)).\n\n```js\nawait device.setURLBlacklist(['.*127.0.0.1.*', '.*my.ignored.endpoint.*']);\n```\n\n#### `device.resetContentAndSettings()` **iOS Only**\n\nResets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing\npreviously set permissions.\n\n```js\nawait device.resetContentAndSettings();\n```\n\n#### `device.getPlatform()`\n\nReturns the current device, `ios` or `android`.\n\n```js\nif (device.getPlatform() === 'ios') {\n  await expect(loopSwitch).toHaveValue('1');\n}\n```\n\n#### `device.takeScreenshot([name])`\n\nTakes a screenshot of the device. For full details on taking screenshots with Detox, refer to the [screen-shots guide](APIRef.Screenshots.md).\n\n#### `device.captureViewHierarchy([name])`\n\n**iOS Only.** Saves a view hierarchy snapshot (`*.viewhierarchy`) of the\ncurrently opened application to a temporary folder and schedules putting it to\nthe artifacts' folder upon the completion of the current test. The file can be\nopened later in Xcode 12.0 and above.\nSee [Xcode 12 Release notes: #57933113](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:\\~:text=57933113)\nfor more details.\n\nThe `name` parameter is optional — by default, it equals to `capture`.\n\n```js\ntest('Capture view hierarchy', async () => {\n  const temporaryArtifactPath = await device.captureViewHierarchy('myElements');\n\n  // The temporary path will remain valid until the test completion.\n  // Afterwards, the artifact will be moved, e.g.:\n  // * on success, to: <artifacts-location>/✓ Capture view hierarchy/myElements.viewhierarchy\n  // * on failure, to: <artifacts-location>/✗ Capture view hierarchy/myElements.viewhierarchy\n});\n```\n\n#### `device.shake()` **iOS Only**\n\nSimulate shake\n\n#### `device.setBiometricEnrollment(bool)` **iOS Only**\n\nToggles device enrollment in biometric authentication (Touch ID or Face ID).\n\n```js\nawait device.setBiometricEnrollment(true);\n// or\nawait device.setBiometricEnrollment(false);\n```\n\n#### `device.matchFace()` **iOS Only**\n\nSimulates the success of a face match via Face ID\n\n#### `device.unmatchFace()` **iOS Only**\n\nSimulates the failure of face match via Face ID\n\n#### `device.matchFinger()` **iOS Only**\n\nSimulates the success of a finger match via Touch ID\n\n#### `device.unmatchFinger()` **iOS Only**\n\nSimulates the failure of a finger match via Touch ID\n\n#### `device.clearKeychain()` **iOS Only**\n\nClears the device keychain\n\n#### `device.setStatusBar()` **iOS Only**\n\nOverride simulator’s status bar. Available options:\n\n```js\nawait device.setStatusBar({\n  time: \"12:34\",\n  // Set the date or time to a fixed value.\n  // If the string is a valid ISO date string it will also set the date on relevant devices.\n  dataNetwork: \"wifi\",\n  // If specified must be one of 'wifi', '3g', '4g', 'lte', 'lte-a', or 'lte+'.\n  wifiMode: \"failed\",\n  // If specified must be one of 'searching', 'failed', or 'active'.\n  wifiBars: \"2\",\n  // If specified must be 0-3.\n  cellularMode: \"searching\",\n  // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n  cellularBars: \"3\",\n  // If specified must be 0-4.\n  batteryState: \"charging\",\n  // If specified must be one of 'charging', 'charged', or 'discharging'.\n  batteryLevel: \"50\",\n  // If specified must be 0-100.\n});\n```\n\n#### `device.resetStatusBar()` **iOS Only**\n\nResets any override in simulator’s status bar.\n\n#### `device.reverseTcpPort()` **Android Only**\n\nReverse a TCP port from the device (guest) back to the host-computer, as typically done with the `adb reverse` command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer.\n\n#### `device.unreverseTcpPort()` **Android Only**\n\nClear a _reversed_ TCP-port (e.g. previously set using `device.reverseTcpPort()`).\n\n#### `device.pressBack()` **Android Only**\n\nSimulate press back button.\n\n```js\nawait device.pressBack();\n```\n\n#### `device.getUiDevice()` **Android Only**\n\nExposes [`UiAutomator`’s `UiDevice` API](https://developer.android.com/reference/androidx/test/uiautomator/UiDevice).\n**This is not a part of the official Detox API**, it may break and change whenever an update to `UiDevice` or `UiAutomator` Gradle dependencies (`androidx.test.uiautomator:uiautomator`) is introduced.\n\n[`UiDevice`’s autogenerated code](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js)\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.Expect.md",
    "content": "---\nid: expect\nslug: api/expect\ntitle: Expect\nsidebar_label: Expect\n---\n\n## Expect\n\nDetox uses [matchers](APIRef.Matchers.md) to match UI elements in your app and expectations to verify those elements are in the expected state.\n\nUse [actions](APIRef.ActionsOnElement.md) to simulate use interaction with elements.\n\n### Methods\n\n- [`.toBeVisible()`](#tobevisible)\n- [`.toExist()`](#toexist)\n- [`.toBeFocused()`](#tobefocused)\n- [`.toHaveText()`](#tohavetexttext)\n- [`.toHaveLabel()`](#tohavelabellabel)\n- [`.toHaveId()`](#tohaveidid)\n- [`.toHaveValue()`](#tohavevaluevalue)\n- [`.toHaveSliderPosition()`](#tohavesliderpositionnormalizedposition-tolerance)\n- [`.toHaveToggleValue()`](#tohavetogglevaluevalue)\n- [`.not`](#not)\n- [`.withTimeout()`](#withtimeouttimeout)\n\n#### `toBeVisible()`\n\nExpects the view to be at least N% visible on the screen.\nAccepts an optional parameter of percent threshold of element visibility, integer ranging from 1 to 100, that determines whether the element is visible or not. If no number is provided then defaults to 75%.\n\nNegating this expectation with a `not` expression expects the view’s visible area to be lower than N%.\n\nOn iOS, visibility is defined by having the view, or one of its subviews, be topmost at the view’s activation point on screen.\n\n```js\nawait expect(element(by.id('UniqueId203'))).toBeVisible();\nawait expect(element(by.id('UniqueId204'))).toBeVisible(35);\n```\n\n#### `toExist()`\n\nExpects the element to exist within the app’s current UI hierarchy.\n\n```js\nawait expect(element(by.id('UniqueId205'))).toExist();\n```\n\n#### `toBeFocused()`\n\nExpects the element to be the focused element.\n\n```js\nawait expect(element(by.id('textFieldId'))).toBeFocused();\n```\n\n#### `toHaveText(text)`\n\nExpects the element to have the specified text.\n\n```js\nawait expect(element(by.id('UniqueId204'))).toHaveText('I contain some text');\n```\n\n#### `toHaveLabel(label)`\n\nExpects the element to have the specified label as its accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n:::note\nNote that there is an inconsistency between the implementation for accessibility between Android and iOS. On iOS if a View has no `accessibilityLabel` explicitly defined, then it defaults to having a concatenation of the accessibilityLabels of the child Views. On Android, the same View would have no `accessibilityLabel` at all. See [this](https://github.com/facebook/react-native/issues/32826) issue for details.\n:::\n\n```js\nawait expect(element(by.id('UniqueId204'))).toHaveLabel('Done');\n```\n\n#### `toHaveId(id)`\n\nExpects the element to have the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nawait expect(element(by.text('I contain some text'))).toHaveId('UniqueId204');\n```\n\n#### `toHaveValue(value)`\n\nExpects the element to have the specified accessibility value. In React Native, this corresponds to the value in the [`accessibilityValue`](https://reactnative.dev/docs/view.html#accessibilityvalue) prop.\n\n```js\nawait expect(element(by.id('UniqueId533'))).toHaveValue('0');\n```\n\n#### `toHaveSliderPosition(normalizedPosition, tolerance)`\n\nExpects the slider element to have the specified normalized position (\\[0, 1]), within the provided tolerance (optional).\n\n```js\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.75);\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.3113, 0.00001);\n```\n\n#### `toHaveToggleValue(value)`\n\nExpects a toggle-able element (e.g. a Switch or a Check-Box) to be on/checked or off/unchecked. As a reference, in react-native, this is the [equivalent switch component](https://reactnative.dev/docs/switch).\n\n```js\nawait expect(element(by.id('switch'))).toHaveToggleValue(true);\nawait expect(element(by.id('checkbox'))).toHaveToggleValue(false);\n```\n\n#### `not`\n\nNegates the expectation.\n\n```js\nawait expect(element(by.id('UniqueId533'))).not.toBeVisible();\n```\n\n#### `withTimeout(timeout)`\n\nWaits until the expectation is resolved for the specified amount of time. If timeout is reached before resolution, the expectation is failed.\n\n`timeout`—the timeout to wait, in ms\n\n```js\nawait waitFor(element(by.id('UniqueId204'))).toBeVisible().withTimeout(2000);\n```\n\n### Deprecated Methods\n\n- [`.toBeNotVisible()`](#tobenotvisible)\n- [`.toNotExist()`](#tonotexist)\n- [`.toBeNotFocused()`](#tobenotfocused)\n\n#### `toBeNotVisible()`\n\n**Deprecated:** Use `.not.toBeVisible()` instead.\n\nExpects the element to not be visible on screen.\n\n```js\nawait expect(element(by.id('UniqueId205'))).toBeNotVisible();\n```\n\n#### `toNotExist()`\n\n**Deprecated:** Use `.not.toExist()` instead.\n\nExpects the element to not exist within the app’s current UI hierarchy.\n\n```js\nawait expect(element(by.id('RandomJunk959'))).toNotExist();\n```\n\n#### `toBeNotFocused()`\n\n**Deprecated:** Use `.not.toBeFocused()` instead.\n\nExpects the element not to be the focused element.\n\n```js\nawait expect(element(by.id('textFieldId'))).toBeFocused();\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.LaunchArgs.md",
    "content": "---\nid: launch-args\nslug: api/launch-args\ntitle: Launch Arguments\nsidebar_label: Launch Arguments\n---\n\n## Launch Arguments\n\nIn Detox, the app under test is launched via an explicit call to [`device.launchApp()`](APIRef.DeviceObjectAPI.md). Through various means, Detox enables specifying a set of user-defined arguments (key-value pairs) to be passed on to the app when launched, so as to make them available inside the launched app itself at runtime (both on the native side, and - if applicable, on the JavaScript side).\n\n### Motivation\n\n> If this is clear to you first hand, you can skip right to the section about arguments setup.\n\nIn particular, the common use case of using launch argument (although not distinctly), is for [mocking](Guide.Mocking.md) external entities such as servers - replacing them with equivalent _mock servers_, sporting equivalent (yet fake) API-endpoints that run alongside the testing host (i.e. the one running Detox). These mock servers can typically be configured during the test, to return deterministic responses to network requests coming from the app.\n\nTypically, the process of setting up such servers - especially in a parallel test-execution environment, involves three major steps (within the context of a test set-up):\n\n1. Allocating a port for a mock server, dynamically.\n1. Bringing up a mock server instance bound to that port (e.g. at `localhost:1234`).\n1. Launching the app with a predefined argument that holds the port, for example `mockServerPort=1234`.\n   (It is assumed here that there’s designated mocked code inside the app that can read `mockServerPort` and rewire all connections to `localhost:1234` instead of to the real production server).\n\nIn this context, launch argument are useful for implementing step [#3](https://github.com/wix/Detox/issues/3).\n\n### Arguments Setup\n\nUser-defined launch arguments specification is very flexible, and can be defined on 4 levels:\n\n| Level                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                           |\n| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 1. Static Configuration                   | As a part of a static [Detox configuration](config/overview.md), using the `launchArgs` property.<br />This is can sufficient, for example, if you only require one mock server instance, and can use the same static port throughout the entire testing execution session.                                                                                                                                      |\n| 2. Static via CLI                         | As arguments specified explicitly in the [command-line](APIRef.DetoxCLI.md) execution of `detox test`, using `--app-launch-args`.                                                                                                                                                                                                                                                                                     |\n| 3.`device.appLaunchArgs`                  | Dynamically, using the [`device.appLaunchArgs`](APIRef.DeviceObjectAPI.md#deviceapplaunchargs) API, which initially holds the static configuration, and then allows for the modification of it before applied through `device.launchApp()`.<br/>Mostly required in complex test environments, where the servers and ports are dynamic, and are determined via distinct software components (e.g. separate test kits). |\n| 4. `device.launchApp()` with `launchArgs` | Dynamically and explicitly, using on-site arguments specified in calls to [`device.launchApp()`](APIRef.DeviceObjectAPI.md#devicelaunchappparams) through the `launchArgs` parameter.<br />Ideal for fairly simple test environments, where the ports are dynamic but are in complete control of the user.                                                                                                            |\n\n**Important: Arguments specified in each level take precedence over equivalent underlying levels**.\n\nExamples:\n\n1. In an environment where `mockServerPort` is statically pre-set to `1001` in Detox configuration, and then set to `1003` using `device.appLaunchArgs` inside a test, the app would eventually be launched with `1003` as its value, in calls to `device.launchApp()` in that test.\n1. (Scenario continues) In subsequent calls to `device.launchApp()` with this parameter: `device.launchApp({ launchArgs: {mockServerPort: 1004} })`, the app will be (re-)launched with `1004` as the value for `mockServerPort`.\n\n### In-App Arguments Access\n\nOn iOS, the specified launch arguments are passed as the process launch arguments and available through normal means.\n\nOn Android, the launch arguments are set as bundle-extra’s into the activity’s intent. It will therefore be accessible on the native side via the current activity as: `currentActivity.getIntent().getBundleExtra(\"launchArgs\")`.\n\nFurther, handling of these launch arguments is up to the user’s responsibility and is out of scope for Detox.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.Matchers.md",
    "content": "---\nid: matchers\nslug: api/matchers\ntitle: Matchers\nsidebar_label: Matchers\n---\n\n## Matchers\n\nDetox uses [matchers](APIRef.Matchers.md) to match UI elements in your app.\n\nUse [actions](APIRef.ActionsOnElement.md) to simulate use interaction with elements and [expectations](APIRef.Expect.md) to verify element states.\n\n**Note:** For best results, it is recommended to match elements by unique identifiers. Matching by text or labels can introduce test flakiness when your app’s text change or when changing your app’s localization.\n\n### Methods\n\n- [`by.id()`](#byidid)\n- [`by.label()`](#bylabellabel)\n- [`by.text()`](#bytexttext)\n- [`by.type()`](#bytypeclassname)\n- [`by.traits()`](#bytraitstraits-ios-only) **iOS Only**\n- [`withAncestor()`](#withancestormatcher)\n- [`withDescendant()`](#withdescendantmatcher)\n- [`and()`](#andmatcher)\n- [`atIndex()`](#atindexindex)\n\n#### `by.id(id)`\n\nMatch elements with the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nelement(by.id('tap_me'));\n```\n\n#### `by.label(label)`\n\nMatch elements with the specified accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n```js\nelement(by.label('Welcome'));\n```\n\n#### `by.text(text)`\n\nMatch elements with the specified text.\n\n```js\nelement(by.text('Tap Me'));\n```\n\n#### `by.type(className)`\n\nMatches elements whose class is, or inherits from, the specified class name. On Android, provide the class canonical name.\n\n**Note:** iOS and Android class names differ.\n\n```js\nelement(by.type('RCTImageView')); //iOS class name\nelement(by.type('android.widget.ImageView')); //Android class canonical name\n```\n\n#### `by.traits([traits])` **iOS Only**\n\nMatches elements by their [accessibility traits](https://developer.apple.com/documentation/uikit/uiaccessibilityelement/1619584-accessibilitytraits).\n\nCurrently supported values:\n\n`\"none\"`\n`\"button\"`\n`\"link\"`\n`\"header\"`\n`\"searchField\"`\n`\"image\"`\n`\"selected\"`\n`\"playsSound\"`\n`\"keyboardKey\"`\n`\"staticText\"`\n`\"summaryElement\"`\n`\"notEnabled\"`\n`\"updatesFrequently\"`\n`\"startsMediaSession\"`\n`\"adjustable\"`\n`\"allowsDirectInteraction\"`\n`\"causesPageTurn\"`\n`\"tabBar\"`\n\n```js\nelement(by.traits(['button']));\n```\n\n#### `withAncestor(matcher)`\n\nMatches elements with an ancestor that matches the specified matcher.\n\n```js\nelement(by.id('child').withAncestor(by.id('parent')));\n```\n\n#### `withDescendant(matcher)`\n\nMatches elements with at least one descendant that matches the specified matcher.\n\n```js\nelement(by.id('parent').withDescendant(by.id('child')));\n```\n\n#### `and(matcher)`\n\nMatches elements by combining several matchers together.\n\n```js\nelement(by.id('uniqueId').and(by.text('some text')));\n```\n\n#### `atIndex(index)`\n\nIf a matcher resolves into multiple matched UI elements, you may specify which element to use by its index.\n\nOn iOS, matched elements are sorted by their x and y axes.\n\n**Note:** Due to different underlying implementations of Detox on iOS and Android, as well as other differences in the OS implementations, as well as RN implementation differences on each OS, indices may not match between iOS and Android. Relying on indices may also introduce flakiness in your tests as your app’s user interface is updated. It is recommended to use unique identifier matchers for your elements.\n\n```js\nelement(by.text('Product')).atIndex(2);\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.MockingOpenWithURL.md",
    "content": "---\nid: mocking-open-with-url\nslug: api/mocking-open-with-url\ntitle: Mocking Open With URL (Deep Links)\nsidebar_label: Mocking Open With URL (Deep Links)\n---\n\n## Mocking Open With URL (Deep Links)\n\nYou can mock opening the app from URL to test your app’s deep link handling mechanism.\n\n### Mocking App Launch With a URL\n\n```js\nawait device.launchApp({newInstance: true, url, sourceApp: bundleId}); // sourceApp is an optional iOS-only argument\n```\n\n#### Example\n\n```js\ndescribe('launch app from URL', () => {\n    it('should handle URL successfully', async () => {\n      await device.launchApp({\n        newInstance: true,\n        url: 'scheme://some.url',\n        sourceApp: 'com.apple.mobilesafari'\n      });\n      await expect(element(by.text('a label'))).toBeVisible();\n    });\n  });\n```\n\n### Mocking Opening With a URL On a Launched App\n\n> iOS-only\n\n```js\nawait device.openURL({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.MockingUserActivity.md",
    "content": "---\nid: mocking-user-activity\nslug: api/mocking-user-activity\ntitle: Mocking User Activity\nsidebar_label: Mocking User Activity\n---\n\n## Mocking User Activity\n\nDetox supports mocking user activity for iOS apps.\n\nThe user activity API is used to mock an external user activity state. The app normally uses this state to continue the activity inside the app. This API is also used for associated domains, Spotlight search handling and Siri intents.\n\n### Mocking App Launch with a User Activity\n\nUsing `launchApp()` with custom params will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({userActivity: activity});\n```\n\n**Example:**\n\n```js\ndescribe('Background user activity', () => {\n  it('Launch with user activity', async () => {\n    await device.launchApp({userActivity: activity})\n    await expect(element(by.text('From user activity'))).toBeVisible();\n  });\n});\n```\n\n### Sending User Activity to a Running App\n\nUse the `sendUserActivity()` method.\n\n```js\nawait device.sendUserActivity(activity)\n```\n\n**Example:**\n\n```js\n \ndescribe('Foreground user activity', () => {\n\nbeforeEach(async () => {\n  await device.launchApp({newInstance: true});\n});\n\nit('User activity from inside the app', async () => {\n  await device.sendUserActivity(activity);\n  await expect(element(by.text('From user activity'))).toBeVisible();\n });\n});\n```\n\n### User Activity JSON Format\n\nUser activities are passed as JSON objects to Detox, which then parses them and creates native objects representing the passed information.\n\nThe JSON object passed to Detox needs to provide some required data, but can also provide additional, optional data.\n\n<!--- Use http://www.tablesgenerator.com/markdown_tables to edit these tables. --->\n\n| Key            | Required | Value Type | Description                                                                                                                         |\n| -------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| `activityType` | Yes      | String     | The activity type. Either a custom user string or a predefined constant as provided by Detox. See the Activity Types section below. |\n| `webpageURL`   | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed to.                                   |\n| `referrerURL`  | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed from.                                 |\n| `userInfo`     | No       | Object     | An additional key-value pair storage, used for general purpose data passing to the app.                                             |\n\n#### Activity Types\n\nActivities can be both developer-generated user activity state, such as actions from another system—another iOS device, macOS, Safari, etc., and system-generated user activities, such as user browsed an associated domain, Spotlight search tapped, Siri intent activity, etc.,  where the app should handle such an activity.\n\nDetox supports mocking both types.\n\nFor developer-generated user activities, use a custom `activityType` that is expected by the application.\n\nFor system-generated user activities, use set the `activityType` to a predefined constant in Detox, like so:\n\n```js\nconst DetoxConstants = require('detox').DetoxConstants;\n\nconst userActivityBrowsingWeb = {\n  \"activityType\": DetoxConstants.userActivityTypes.browsingWeb,\n  \"webpageURL\": \"https://my.deeplink.dtx\",\n  \"referrerURL\": \"https://google.com/\"\n};\n```\n\nCurrently supported system-generated activity types:\n\n- DetoxConstants.userActivityTypes.browsingWeb - Used for associated domains (deep links)\n- DetoxConstants.userActivityTypes.searchableItem - Used for Spotlight search results\n\n#### Spotlight Search Results\n\nIn addition to `DetoxConstants.userActivityTypes.searchableItem`, Detox also provides an additional constant, used to provide the item identifier, which was selected in Spotlight. The app uses this identifier to display the item on screen.\n\nAn example on a Spotlight search user activity:\n\n```js\nconst DetoxConstants = require('detox').DetoxConstants;\n\nlet userActivitySearchableItem = {\n  \"activityType\": DetoxConstants.userActivityTypes.searchableItem,\n  \"userInfo\": {\"customKey\": \"value\"}\n};\nuserActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = \"com.test.itemId\"\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.MockingUserNotifications.md",
    "content": "---\nid: mocking-user-notifications\nslug: api/mocking-user-notifications\ntitle: Mocking User Notifications\nsidebar_label: Mocking User Notifications\n---\n\n## Mocking User Notifications\n\nDetox supports mocking user notifications.\n\n> **Note:** The mocking mechanism will not mimic the UI of a user notification. Instead, it will only simulate a user interaction with the notification - namely, the \"opening\" of it (equivalent to a user’s tap/swipe on it in the notification center).\n\n### Mocking App Launch With a Notification\n\n`launchApp()` with custom parameters (i.e. `userNotification`) will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({newInstance: true, userNotification: notification});\n```\n\n#### Example\n\n```js\ndescribe('Launch with push notification', () => {\n  it('should handle the notification', async () => {\n    await device.launchApp({\n      newInstance: true,\n      userNotification: userNotificationPushTrigger,\n    });\n    await expect(element(by.text('From push'))).toBeVisible();\n  });\n});\n```\n\n### Mocking Notification Reception on a Running App\n\nUse the `sendUserNotification()` method to send notification to **running** app. Notifications can be sent to an active or a background app.\n\n> Note: while the name `sendUserNotification()` is not very idiomatic on Android, as notification data is not \"sent\" to apps (rather, it is bundled into an Activity/Service launch Intent as Intent-extras), this unified API is used, for the time being, for both platforms equivalently. With [plans of a more extensive support](https://github.com/wix/Detox/issues/2141) for Android, we estimate it would be deprecated when the time comes.\n\n```js\nawait device.sendUserNotification(notification);\n```\n\n**Example:**\n\n```js\ndescribe('Foreground user notifications', () => {\n  it('should handle the local notification from inside the app', async () => {\n    await device.launchApp();\n    await device.sendUserNotification(localNotification);\n    await expect(element(by.text('from local notification'))).toBeVisible();\n   });\n});\n```\n\n### Notification JSON Format\n\nUser notifications are passed as JSON objects to Detox. The JSON object needs to provide some required data, but can also provide an additional, optional payload.\n\n**Mind the major difference here between the two platforms.** While on iOS many types of data fields are applicable, Android is very loosely defined - with support for just free-form user data in the `payload` field.\n\n| Key                 | Required                  | Value Type | Platform      | Description                                                                                                                                                                              |\n| ------------------- | ------------------------- | ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `trigger`           | Yes                       | Object     | iOS           | The conditions that trigger the delivery of the notification. See the [Triggers section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#triggers) below. |\n| `title`             | No                        | String     | iOS           | A short description of the reason for the alert.                                                                                                                                         |\n| `subtitle`          | No                        | String     | iOS           | A secondary description of the reason for the alert.                                                                                                                                     |\n| `body`              | No                        | String     | iOS           | The body of the notification.                                                                                                                                                            |\n| `badge`             | No                        | Integer    | iOS           | The number to display as the app’s icon badge.                                                                                                                                           |\n| `payload`           | iOS: No<br />Android: Yes | Object     | iOS & Android | An object of custom information associated with the notification.<br />Android: see [full description below](#Payload)                                                                   |\n| `category`          | No                        | String     | iOS           | The identifier of the app-defined category object.                                                                                                                                       |\n| `content-available` | No                        | Integer    | iOS           | Include this key with a value of 1 to configure a silent notification.                                                                                                                   |\n| `user-text`         | No                        | String     | iOS           | The text response provided by the user.                                                                                                                                                  |\n| `action-identifier` | No                        | String     | iOS           | The identifier for the action that the user selected.                                                                                                                                    |\n\n#### Triggers (iOS-only)\n\nTriggers are objects representing the trigger.\n\n| Key               | Required                            | Value Type | Description                                                                                                 |\n| ----------------- | ----------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |\n| `type`            | Yes                                 | String     | The conditions that trigger the delivery of the notification. See the Trigger Types section below.          |\n| `repeats`         | No                                  | Boolean    | Indicates whether the event repeats. Only used for `calendar`, `timeInterval` and `location` trigger types. |\n| `timeInterval`    | Yes for `timeInterval` trigger type | Number     | The time interval used to create the trigger.                                                               |\n| `date-components` | Yes for `calendar` trigger type     | Object     | The date components used to construct this object. See the Date Components section below.                   |\n| `region`          | Yes for `location` trigger type     | Object     | The region used to determine when the notification is sent. See the Region section below.                   |\n\n##### Trigger Types\n\nThere are four types of triggers supported by Detox at this time:\n\n- `push`\n- `calendar`\n- `timeInterval`\n- `location`\n\nFor convenience, these trigger types are provided as constants in `DetoxConstants`:\n\n```js\nconst DetoxConstants = require('detox').DetoxConstants;\n\nconst userNotification = {\n  \"trigger\": {\n    \"type\": DetoxConstants.userNotificationTriggers.push\n  },\n  // ...\n}\n```\n\n#### Date Components (iOS-only)\n\n| Key              | Required | Value Type | Description                                           |\n| ---------------- | -------- | ---------- | ----------------------------------------------------- |\n| `era`            | No       | Integer    | The number of era units for the receiver.             |\n| `year`           | No       | Integer    | The number of year units for the receiver.            |\n| `month`          | No       | Integer    | The number of month units for the receiver.           |\n| `day`            | No       | Integer    | The number of day units for the receiver.             |\n| `hour`           | No       | Integer    | The number of hour units for the receiver.            |\n| `minute`         | No       | Integer    | The number of minute units for the receiver.          |\n| `second`         | No       | Integer    | The number of second units for the receiver.          |\n| `weekday`        | No       | Integer    | The number of the weekday unit for the receiver.      |\n| `weekdayOrdinal` | No       | Integer    | The ordinal number of weekday units for the receiver. |\n| `quarter`        | No       | Integer    | The number of quarters for the receiver.              |\n| `weekOfMonth`    | No       | Integer    | The week number of the month for the receiver.        |\n| `leapMonth`      | No       | Boolean    | Indicates whether the month is a leap month.          |\n\n#### Region (iOS-only)\n\n| Key             | Required | Value Type | Description                                                                                                                                                             |\n| --------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `center`        | Yes      | Object     | The center point of the geographic area. See the [Coordinate section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#coordinate) below. |\n| `radius`        | Yes      | Number     | The radius (measured in meters) that defines the geographic area’s outer boundary.                                                                                      |\n| `notifyOnEntry` | No       | Boolean    | Indicates that notifications are generated upon entry into the region.                                                                                                  |\n| `notifyOnExit`  | No       | Boolean    | Indicates that notifications are generated upon exit from the region.                                                                                                   |\n\n#### Coordinate (iOS-only)\n\n| Key         | Required | Value Type | Description                                                                                                                                                                       |\n| ----------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `latitude`  | Yes      | Number     | The latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator.                                        |\n| `longitude` | Yes      | Number     | The longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian. |\n\n#### Payload\n\nOn Android, the content will be available via the activity’s [`getIntent()`](https://developer.android.com/reference/android/app/Activity#getIntent\\(\\)) API, inside the intent’s _extra_ bundle. Under some limitations, that includes data-cascading so as to provide comprehensive support for JavaScript’s advanced object-hierarchy capabilities as much as possible. As an example, consider this payload:\n\n```javascript\nconst userNotification = {\n  payload: {\n    userData: 'userDataValue',\n    userDataNum: 111.2,\n    userDataFlag: true,\n    userDataArray: ['rock', 'paper', 'scissors'],\n    userDataObj: {\n      cascadedKey: 'cascadedValue'\n    },\n  },\n};\n```\n\nThe outcome on the native side will be such that all of these conditions evaluate to _true_:\n\n```java\nactivity.getIntent().getStringExtra(\"userData\") == \"userDataValue\";\nactivity.getIntent().getDoubleExtra(\"userDataNum\") == 111.2;\nactivity.getIntent().getBooleanExtra(\"userDataFlag\") == true;\nactivity.getIntent().getStringArrayExtra(\"userDataArray\")[0] == \"rock\";\nactivity.getIntent().getBundleExtra(\"userDataObj\").getString(\"cascadedKey\") == \"cascadedValue\";\n```\n\n##### Handling at Runtime\n\nNote that on Android, data delivered through an intent at runtime, is typically received in your activity’s [`onNewIntent`](https://developer.android.com/reference/android/app/Activity#onNewIntent\\(android.content.Intent\\)) callback. Be sure to consider what should be done in order to handle this type of a use case in your app: Namely, that `setIntent()` should be called in order for the data to be later available in your app through `getIntent()`, as explained earlier.\n\n> **This isn’t related to Detox in particular**, and is set here simply to help you consider all the use cases in your app so that tests coverage would be optimal.\n\n#### Examples\n\n1. [Calendar Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json)\n1. [Location Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json)\n1. [Time Interval Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json)\n1. [Push Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json)\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.Screenshots.md",
    "content": "---\nid: screenshots\nslug: api/screenshots\ntitle: Taking Screenshots\nsidebar_label: Taking Screenshots\n---\n\n## Taking Screenshots\n\nDetox supports taking in-test screenshots of the device, making the result immediately available in the form of an image file.\n\nScreenshots can be taken in two levels:\n\n- **Device-level:** taking a screenshot of the entire screen.\n- **Element-level:** taking a screenshot of a specific element (and the view-hierarchy associated with it), currently appearing on the screen.\n\nIn both cases, the concept is mainly useful for verifying the proper visual structure and layout of elements appearing on the device’s screen, in the form of a snapshot-test. Namely, by following these conceptual steps:\n\n1. Taking a screenshot, once, and manually verifying it, visually.\n1. Storing it as an E2E test asset (i.e. the _snapshot_).\n1. Using it as the point-of-reference for comparison against screenshots taken in consequent tests, from that point on.\n\n```js\nconst fs = require('fs');\n\ndescribe('Members area', () => {\n  const snapshottedImagePath = './e2e/assets/snapshotted-image.png';\n\n  it('should greet the member with an announcement', async () => {\n    const imagePath = (take screenshot from the device); // Discussed below\n    expectBitmapsToBeEqual(imagePath, snapshottedImagePath);  \n  });  \n});\n\nfunction expectBitmapsToBeEqual(imagePath, expectedImagePath) {\n  const bitmapBuffer = fs.readFileSync(imagePath);\n  const expectedBitmapBuffer = fs.readFileSync(expectedImagePath);\n  if (!bitmapBuffer.equals(expectedBitmapBuffer)) {\n    throw new Error(`Expected image at ${imagePath} to be equal to image at ${expectedImagePath}, but it was different!`);\n  }\n}\n```\n\n**Important:** The recommended, more practical way of doing this, is by utilizing more advanced 3rd-party image snapshotting & comparison tools such as [Applitools](https://applitools.com).\n\n### Device-level Screenshots\n\nTaking a screenshot of the entire screen can be done using a device-level API:\n\n```js\nconst imagePath = await device.takeScreenshot('opened general section');\n```\n\nThe API immediately returns the path of a temporary, readable image file where the screenshot is stored, all-the-while scheduling the transferring of it to the [artifacts folder](APIRef.Artifacts.md#enabling-artifacts) upon completion of the currently running test.\n\n**Returns:**\n\nThe path of a temporary file containing the resulted `.png` image.\n\nImportant: The returned path is guaranteed to be valid only during the test execution. Later on, the screenshot will be moved to the artifacts' folder, and will not be available.\n\n**Parameters:**\n\n`name (optional)` - Name of the final image-file to store as the artifact. For example, setting `name` to `opened general section` would result in an artifact file named `opened general section.png`. In case the name isn’t provided, Detox would self-generate a random, distinct name, instead (though not a very descriptive one).\n\n#### Artifacts Management\n\nMeans of creation of the final image as an artifact is tightly connected to the `--take-screenshots` argument to Detox CLI:\n\n- If `--take-screenshots none` is set, the screenshot will be taken, but it won’t be saved to `<artifacts-location>` after the test ends.\n- If `--take-screenshots failing` is set, and the test passes, the screenshot won’t be saved to `<artifacts-location>` after the test ends.\n- In the other modes (`manual` and `all`), if the test passes, the screenshot will be put to `<artifacts-location>/✓ Members area should greet the member with an announcement/opened general section.png`.\n- In the other modes (`manual` and `all`), if the test fails, the screenshot will be put to `<artifacts-location>/✗ Members area should greet the member with an announcement/opened general section.png`.\n\n#### Caveats\n\nThis API well-captures all elements, although alongside surrounding \"visual noise\" such as the navigation bar, as can be seen in the image below:\n\n![device-screenshot](img/device-screenshot.png)\n\nAs the image includes, for example, the current time (in the top-left corner), running the test in any _different_ time would unnecessarily result in an utter comparison failure, making the test downright useless. Fortunately, this can be resolved, by putting the device into \"demo mode\" (i.e. freezing the irrelevant, volatile elements) . For example (credits - [Miki](https://github.com/M-i-k-e-l)):\n\n```js\nasync function setDemoMode() {\n  if (device.getPlatform() === 'ios') {\n    execSync(\n      'xcrun simctl status_bar \"iPhone 11\" override --time \"12:00\" --batteryState charged --batteryLevel 100 --wifiBars 3 --cellularMode active --cellularBars 4'\n    );\n  } else {\n    // enter demo mode\n    execSync('adb shell settings put global sysui_demo_allowed 1');\n    // display time 12:00\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200');\n    // Display full mobile data with 4g type and no wifi\n    execSync(\n      'adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype 4g -e wifi false'\n    );\n    // Hide notifications\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false');\n    // Show full battery but not in charging state\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100');\n  }\n}\n```\n\n> Note: This script implicitly assumes only one device is used, as device ID isn’t specified anywhere (e.g. with `adb -s <id>`).\n\n### Element-level Screenshots\n\nTaking a screenshot of a specific element can be simply done using an API similar to other element-interaction Detox APIs:\n\n```js\nconst imagePath = await element(by.id('announcementsRoot')).takeScreenshot('welcome announcement');\n```\n\n> The API works in the exact same way as `device.takeScreenshot()` does in terms of return value, arguments, and artifacts management.\n\nIn this example, the image-file specified by `imagePath` will hold the visual content of a native view whose test ID is `announcementsRoot`, alongside all of the views in the view-hierarchy formed by it as the root-view. Visually, this can be, for example:\n\n![Announcements view](img/element-screenshot-view.png)\n\nMeaning, assuming `announcementsRoot` has been specified over some ancestor view which has both the `Announcement` title _and_ the card as its direct or indirect children, the result would include both. That, in turns, also includes the card’s children, such as the avatar, welcome text, etc.\n\n#### Caveats of this approach\n\nFocusing on specific elements, this approach is key to more stable comparisons, and hence more stable tests, over time. However, inspecting less content evidently means protecting against less bugs. For example, In a screen where the element in question is partly obstructed by other elements drawn on the screen, the image created by `takeScreenshot()` will successfully hold all of it’s content, nonetheless.\n\nConsider this situation in one of the app’s screens, where the upcoming schedule overlaps the top-hand announcement card:\n\n![overlap](img/element-screenshot-overlap.png)\n\nTaking an element-screenshot of the announcement part alone, would yield a proper result, leaving this bug overlooked:\n\n![announcement element](img/element-screenshot-view.png)\n\nOnly by taking the element-screenshot of a common ancestor, will this bug be surfaced. However, in turn, that can affect stability, as the result is now sensitive to more details such as padding and background color.\n\n**As a bottom line, this API is mostly suited for testing UI components rather than complete screens.**\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/APIRef.TestLifecycle.md",
    "content": "---\nid: test-lifecycle\nslug: api/test-lifecycle\ntitle: Test Lifecycle\nsidebar_label: Test Lifecycle\n---\n\n## Test Lifecycle\n\nDetox is test runner independent, and we encourage you to choose your own test runner, but for the sake of demonstration we will use `mocha`’s syntax.\n\n### Initial Setup\n\nThe setup phase happens inside `detox.init()`.\nThis is the phase where detox reads its configuration, starts a server, loads its expectation library and starts a simulator.\n\n```js\nbefore(async () => {\n  await detox.init();\n});\n```\n\nOf course, you can add any of your initializations in this phase.\n\n### Before and After Each Test\n\nDespite being a recent and _still_ an optional formation, `detox.beforeEach` and `detox.afterEach` lifecycle functions are **highly** recommended to be called in your test setups. The newer features (including test artifacts: video recordings, screenshots, logs) are not expected to work without these calls.\n\n> **TIP**: This API is still apt to change in the future, thus to minimize the risks, you are encouraged to switch to the built-in adapters for `mocha` and `jest` like in examples here: [mocha adapter example](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/init.js), [jest adapter example](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/init.js).\n\nIf nevertheless you use another test runner with Detox (not `mocha` and not `jest`), then you have to implement a logic similar to the one below. Futurewise, consider refactoring it to an adapter and sharing with Detox project (e.g. adapter for `ava.js` or `tape`):\n\n```js\nlet testSummary;\n\nbeforeEach(async function () {\n  testSummary = {\n    title: this.currentTest.title,\n    fullName: this.currentTest.fullTitle(),\n    status: 'running',\n  };\n\n await detox.beforeEach(testSummary);\n});\n\nafterEach(async function () {\n  testSummary.status = this.currentTest.state || 'failed';\n  await detox.afterEach(testSummary);\n});\n```\n\n### Teardown\n\nThe cleanup phase should happen after all the tests have finished, can be initiated using `detox.cleanup()`. This is the phase where detox server shuts down. The simulator will also shut itself down if `--cleanup` flag is added to `detox test`\n\n```js\nafter(async () => {\n  await detox.cleanup();\n});\n```\n\n### Repeating Setup for All Tests\n\nA good practice for testing in general is to have decoupled tests, meaning that each test has the same starting point, and the tests can run in any order and still produce the same results. We strongly encourage either restarting your application or restart react-native (if your application is built with it).\n\n#### Reloading React Native\n\n```js\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n```\n\n#### Relaunching the Entire App\n\n```js\n  beforeEach(async () => {\n    await device.launchApp({newInstance: true});\n  });\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Contributing.md",
    "content": "---\nid: contributing\nslug: contributing\ntitle: Contributing\nsidebar_label: Contributing\n---\n\n## Contributing\n\nThis guide is about contributing to our codebase.\n\nWe don’t have any special guidelines - just some setup walk-through!\n\n### Environment\n\n#### Install Homebrew\n\nIf you haven’t yet - install [`brew`](https://brew.sh/).\n\n#### Install Node.js v12.x or newer\n\nThere’s more than one way to install Node.js:\n\n- Download from the [official download page](https://nodejs.org/en/download/)\n- Use [Homebrew](https://formulae.brew.sh/formula/node)\n- Use `nvm` - if you need to allow for several versions to be installed on a single machine\n\nThe best way is to use `nvm`, but the simplest way is to use Homebrew:\n\n```sh\nbrew install node\n```\n\n#### Install `npm`\n\nEither install `npm` or check that you have it installed, using their [official guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).\n\n> **NOTE: For Detox, please use the latest `npm` version `6.x.x` (i.e not version 7.0.0 or newer).**\n\n#### Install the monorepo management tool, `lerna`\n\n```bash npm2yarn\nnpm install lerna@3.x.x --global\n```\n\nFor all the internal projects (detox, detox-cli, demos, test) `lerna` will create symbolic links in `node_modules` instead of `npm` copying the content of the projects. This way, any change you do on any code is there immediately. There is no need to update node modules or copy files between projects.\n\n#### Install common React Native dependencies\n\nReact-Native CLI:\n\n```bash npm2yarn\nnpm install react-native-cli --global\n```\n\nWatchman:\n\n```sh\nbrew install watchman\n```\n\n#### iOS\n\nFor iOS, you must install Xcode and related tools. Refer to our [Setting Up an iOS Environment](Introduction.iOSDevEnv.md) guide.\n\nYou must also have `xcpretty` installed:\n\n```sh\ngem install xcpretty\n```\n\n#### Android\n\nFor Android, you need to have Java and the Android SDK properly set up. Refer to our [Setting Up an Android Development & Testing Environment](Introduction.AndroidDevEnv.md) guide.\n\n### Detox\n\n#### Clone Detox and Submodules\n\n```sh\ngit clone git@github.com:wix/detox.git\ncd detox\ngit submodule update --init --recursive\n```\n\n(this makes sure all git submodule dependencies have been properly checked out)\n\n#### Installing and Linking Internal Projects\n\n```sh\nlerna bootstrap\n```\n\n#### Building and Testing\n\n##### Automatically\n\n`scripts/ci.ios.sh` and `scripts/ci.android.sh` are the scripts Detox runs in CI, they will run `lerna bootstrap`, unit tests, and E2E tests. Make sure these scripts pass before submitting a PR, this is exactly what Detox is going to run in CI.\n\n##### Manually\n\nThe following steps can be run manually in order to build / test the various components of Detox.\n\n###### 0. (React Native ≤ 0.55.x) Fixing Compilation Issues in RN Sources\n\nDetox Android test project uses React Native sources instead of the precompiled AAR. The test project uses React Native 0.51 and 0.53, both have issues with compilation ([fixed in 0.55](https://github.com/facebook/react-native/commit/d8bb990abc226e778e2f32c2de3c6661c0aa64e5#diff-f44163238d434a443b56bd27b3ba0578)). In order to fix this issue, from inside `detox/test` run:\n\n```sh\nmv node_modules/react-native/ReactAndroid/release.gradle node_modules/react-native/ReactAndroid/release.gradle.bak\n```\n\n###### 1. Unit Tests and Lint\n\n```sh\nlerna run test\n```\n\nDetox JS code is 100% test covered and is set to break the build if coverage gets below, so make sure you run unit tests (`lerna run test`) locally before pushing.\n\nAlternatively, to run only the JS tests, run the following from the `detox/detox` directory:\n\n```bash npm2yarn\nnpm run unit\n```\n\nor\n\n```bash npm2yarn\nnpm run unit:watch\n```\n\nAfter running the tests, _Jest_ will create a coverage report you can examine:\n\n```sh\ncd detox\nopen coverage/lcov-report/index.html\n```\n\n###### 2. Running Detox E2E Coverage Tests\n\nDetox has a suite of end-to-end tests to test its own API while developing (and for regression); We maintain a special application that is \"tested\" against Detox’s API, but essentially, it’s the API that is tested, not the app.\n\nTo run the tests, you must first build the native code and then run based on your target of choice (Android / iOS):\n\n- **iOS:**\n\n  ```bash npm2yarn\n  cd detox/test\n  npm run build:ios\n  npm run e2e:ios\n  ```\n\n- **Android:**\n\n  ```bash npm2yarn\n  cd detox/test\n  npm run build:android\n  npm run e2e:android\n  ```\n\nFYI Android test project includes two flavors:\n\n- `fromBin` - (**standard use case**) utilizes the precompiled `.aar` from `node_modules` just like a standard RN project.\n- `fromSource` - compiles the project with RN sources from `node_modules`, this is useful when developing and debugging Espresso idle resource.\n  [Here](https://github.com/facebook/react-native/wiki/Building-from-source#android) are the prerequisites to compiling React Native from source.\n\nEach build can be triggered separately by running its Gradle assembling task (under `detox/test/android/`):\n\n```sh\n./gradlew assembleFromSourceDebug\n-or-\n./gradlew assembleFromBinDebug\n```\n\nTo run from Android Studio, React Native’s `react.gradle` script may require `node` to be in path.\nOn MacOS, environment variables can be exported to desktop applications by adding the following to your `.bashrc`/`.zshrc`:\n\n```sh\nlaunchctl setenv PATH $PATH\n```\n\n###### 3. Android Native Unit-Tests\n\nUnder `detox/android`:\n\n```sh\n./gradlew testFullRelease\n```\n\n### Detox - Example Projects\n\nThis is in fact a monorepo that also sports some example projects (for usage reference), alongside the main test project:\n\n- `examples/demo-react-native` and `examples/demo-react-native-jest`: Demonstrate usage of Detox in React-Native app projects, with `mocha.js` and `Jest` as the hosting test-runner frameworks, respectively.\n- `examples/demo-native-ios`: Demonstrates usage of Detox in a pure-native iOS app.\n- `examples/demo-native-android` (broken): Demonstrates usage of Detox in a pure-native Android app.\n- `examples/demo-pure-native-android`: Demonstrates usage of the _pure_ [Detox-Native](https://github.com/wix/Detox/tree/master/detox-native/README.md) project\n- more...\n\n**In order to run E2E tests associated with any of these projects, refer to the [project-specific](https://github.com/wix/Detox/tree/master/examples) READMEs.**\n\n### Detox Documentation Website\n\nThe [documentation website](https://wix.github.io/Detox) is built using [Docusaurus](https://docusaurus.io/).\n\nTo run the website locally, run the following commands:\n\n```sh\ncd website\nnpm install\nnpm start\n```\n\n#### Updating the Website\n\nTo update a specific page, edit the corresponding markdown file in `docs/`. To add a new page, create a new markdown file in `docs/` and add a link to it in `website/sidebars.json`.\n\n##### Website Deployment\n\nWhile changes to the website are published automatically on every commit to `master` under the `Next` version, tagging and locking docs to a specific version is done automatically on every Detox release.\n\nIn case you want to update the docs for a specific version, you can change the related files and code under `website/versioned_docs/version-<version>/` and `website/versioned_sidebars/version-<version>-sidebars.json`.\n\n##### Update Old Versions\n\nTo update a specific version with the latest changes:\n\n1. Remove the version from `versions.json`.\n2. Run `npm run docusaurus docs:version <version>`.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.DebuggingInAndroidStudio.md",
    "content": "---\nid: debugging-in-android-studio\nslug: guide/debugging-in-android-studio\ntitle: Debugging in Android Studio During Detox Tests\nsidebar_label: Debugging in Android Studio\n---\n\n## Debugging in Android Studio During Detox Tests\n\n> This flow is not standard and serves mostly for investigating weird crashes or\n> when contributing to Detox itself.\\\n> **Don’t use it unless you have a good reason.**\n\n### Setting Detox up as a compiling dependency\n\nBefore you go anywhere further, follow the\n[Setting Detox up as a compiling dependency](Introduction.Android.md#setting-detox-up-as-a-compiling-dependency)\nsection from the **Detox for Android** document.\n\n### Add \"manual\" device configurations to your `.detoxrc`\n\nLocate your `.detoxrc` config file or the corresponding `detox` section in your `package.json`\nand add a configuration similar to this one:\n\n```json\n{\n  \"devices\": {\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"<e.g., Pixel_API_28>\"\n      }\n    }\n  },\n  \"apps\": {\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"<path to your app binary built before>\"\n    }\n  },\n  \"configurations\": {\n    \"android.manual\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.debug\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      }\n    }\n  }\n}\n```\n\nWhile the `behavior` section is a **mandatory** thing to include, there are a few more optional\nparameters to disable various side effects and make life easier when debugging:\n\n```diff\n   \"behavior\": {\n     \"launchApp\": \"manual\"\n   },\n+  \"session\": {\n+    \"autoStart\": true,\n+    \"debugSynchronization\": 0,\n+    \"server\": \"ws://localhost:8099\",\n+    \"sessionId\": \"test\"\n+  },\n+  \"artifacts\": false\n```\n\n- Using a preconfigured `session` with an autostarting server removes the legwork of copying and\n  pasting values to the instrumentation runner launch arguments dialog every time before any launch\n  from the IDE. Otherwise, by default when the `session` object omitted, `server` and `sessionId`\n  are randomly generated for every new test session.\n\n  - The `debugSynchronization: 0` override matters only if you have a global `session` config\n    with `debugSynchronization` set to a positive integer value. Otherwise, it is not needed. The point\n    is to disable regular app polling requests during debugging, since that only can hinder the debugging.\n\n- Setting `artifacts: false` override also matters only if you have a global `artifacts` config.\n  The motivation is to disable irrelevant taxing activities on the device such as capturing logs\n  screenshots, videos and so on.\n  - If your investigation addresses a specific artifact plugin glitch on the native side, then just\n    disable all the other plugins. See [Detox Configuration](config/overview.md) document\n    for the reference.\n\n### Run a specific test\n\nUsually, you would want to focus on a specific test suite to save time, e.g.:\n\n```sh\ndetox test -c android.manual e2e/someSuite.test.js\n```\n\nIf you are using Jest as a test runner, you might want to increase the test timeout via appending\n`--testTimeout 999999` to the command. For Mocha, that would be `--timeout 999999`.\n\nAlso, if there is something you want to do step by step in JS code while debugging native, append\n`--inspect-brk` flag. To learn more about debugging with `--inspect-brk`, refer to\n[Debugging — Getting Started](https://nodejs.org/en/docs/guides/debugging-getting-started/) on the official Node.js website.\n\nAfterwards, you should see your test suite starting as usual until it reaches the app launch, where\nDetox stops instead and prompts you to launch the app from the IDE:\n\n```plain text\ndetox[53038] INFO:  [AndroidDriver.js] Waiting for you to manually launch your app in Android Studio.\n\nInstrumentation class: com.wix.detox.test.test/com.example.DetoxTestAppJUnitRunner\nInstrumentation arguments:\n------------------------------------\nKey            | Value\n------------------------------------\ndetoxServer    | ws://localhost:8099\ndetoxSessionId | test\n------------------------------------\n\nPress any key to continue...\n```\n\nNow it is time to switch back to Android Studio. However, if for some reason you wish to terminate the process, use `Ctrl+C` to exit.\n\n### Launching the app\n\nBefore you launch the app from Android Studio, make sure to put breakpoints at the points of interest.\n\nYou’ll need to run your instrumentation runner with the said arguments, this is why you\nshould create a debug configuration of `Android Instrumented Tests` type similar to the\none below:\n\n![Android Debug Configuration - Android Instrumented Tests](img/android-studio-debug-configuration.png)\n\nThe moment you see the app has started on the device, go back to the Terminal where Detox is\nrunning and press any key.\n\nAs a result, you are expected to see a confirmation from Detox, e.g.:\n\n```plain text\nFound the app (com.wix.detox-example) with process ID = 16854. Proceeding...\n```\n\nNow the entire test will run as usual until it sends an action to the app, which gets trapped\nin your breakpoint.\n\n![Breakpoint is active](img/android-happy-debugging.png)\n\nHappy debugging!\n\n### Extra tweaks\n\nIf you feel like you see too often this timeout error while debugging:\n\n```plain text\nWaited for the new RN-context for too long! (60 seconds)\nIf you think that’s not long enough, consider applying a custom Detox runtime-config in DetoxTest.runTests().\n```\n\nyou can temporarily hack the timeout here:\n\n```diff\ndiff --git a/detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt b/detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt\nindex b33b2086..aaf8e9e2 100644\n--- a/detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt\n+++ b/detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt\n@@ -1,8 +1,10 @@\n package com.wix.detox.config\n\n class DetoxConfig {\n     @JvmField var idlePolicyConfig: DetoxIdlePolicyConfig = DetoxIdlePolicyConfig()\n-    @JvmField var rnContextLoadTimeoutSec = 60\n+    @JvmField var rnContextLoadTimeoutSec = Int.MAX_VALUE\n\n     fun apply() {\n         idlePolicyConfig.apply()\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.DebuggingInXcode.md",
    "content": "---\nid: debugging-in-xcode\nslug: guide/debugging-in-xcode\ntitle: Debugging in Xcode During Detox Tests\nsidebar_label: Debugging in Xcode During Detox Tests\n---\n\n## Debugging in Xcode During Detox Tests\n\n> This is mostly useful for investigating weird crashes or when contributing to Detox itself. **This workflow isn’t standard. Don’t use it unless you have a good reason.**\n\n### Add Detox Framework to Your Project\n\n- Go to `node_modules/detox` and extract `Detox-ios-src.tbz`\n- Drag `Detox-ios-src/Detox.xcodeproj` into your Xcode project\n- Go to your project settings -> **General** and add **Detox.framework** to **Frameworks, Libraries, and Embedded Content** (make sure **Embed & Sign** is selected under **Embed**)\n\n> NOTE: Apps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove **Detox.framework** from your project.\n\n### Add an `ios.none` Configuration to Detox Section\n\nEdit your Detox configuration to add the following configuration:\n\n```json\n\"ios.none\": {\n  \"binaryPath\": \"ios\",\n  \"type\": \"ios.none\",\n  \"device\": {\n    \"type\": \"iPhone 12 Pro Max\"\n  },\n  \"session\": {\n    \"server\": \"ws://localhost:8099\",\n    \"sessionId\": <your app’s bundle identifier>\n  }\n}\n```\n\n> **Note:** This configuration will not handle simulator and application lifecycle, they will have to be performed manually (e.g. running your application from Xcode).\n\n### Run Detox Server Manually\n\nRun the following command in your project root directory:\n\n```sh\ndetox run-server\n```\n\n### Run Your Application From Xcode\n\nRun your application from Xcode as you normally do.\n\n> **Note:** Before running, place breakpoints in places where you wish to debug.\n\n### Run Detox Tests\n\nRun the following command in your project root directory:\n\n```sh\ndetox test --configuration ios.none\n```\n\n> **Note:** Calls to `device.launchApp()` may fail as this API is unavailable when using `ios.none` configuration types. Instead, use `it.only` to run specific tests and restart your app from Xcode.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.DevelopingWhileWritingTests.md",
    "content": "---\nid: developing-while-writing-tests\nslug: guide/developing-while-writing-tests\ntitle: Developing Your App While Writing Tests\nsidebar_label: Developing Your App While Writing Tests\n---\n\n## Developing Your App While Writing Tests\n\n> If your app requires active development, such as adding testID fields for tests, this is a good workflow. It allows you to work both on your app and your tests at the same time.\n\nThe main idea behind this workflow is to run your app in debug with Detox on a simulator. Once the app is up and running, it will still be connected to the React Native packager. This means that you’ll be able to do JavaScript code modifications in your app codebase and press CMD+R to reload the bundle inside the Detox simulator.\n\n### Step 1: Build Your App in Debug\n\nDetox is going to need the executable for your app. This means we need to build it first. Since we want a build that’s connected to the live React Native packager (to update bundle changes), we’re going to need a _debug_ build.\n\nThere are multiple ways to build your app, let’s find the alternative you like best:\n\n- **I like to build my app by clicking \"Play\" in Xcode** — This isn’t a great approach here because using Xcode IDE to build your app will place the executable in an internal directory which path that is difficult to predict (`~/Library/Developer/Xcode/DerivedData/...`). This means we won’t be able to tell Detox where to find it. Although you can change the default `derivedData` path by altering your Xcode settings, we encourage you to try the alternative ways to build.\n  If you’d like to debug Detox with Xcode, see [Debugging In Xcode](Guide.DebuggingInXcode.md).\n\n- **I like to build my app with `react-native run-ios`** — The official React Native command line tools provide a script to build your app from terminal. Go to your project root and type `react-native run-ios`. This will build the app in debug and place the executable in the folder `ios/build/Build/Products/Debug-iphonesimulator`. This is a great way to build because it’s easy to specify this path in Detox configuration inside `package.json`. This is actually the path we specified in the getting started tutorial.\n\n  ```sh\n  react-native run-ios\n  ```\n\n- **I like to build my app with `detox build`** — During the installation instructions, we provided Detox configuration in `package.json` with a command line to build your app executable. We can execute this build command by going to the project root and typing `detox build`. Please make sure that you’re using a Detox configuration that builds a debug version of your app. The default we specified in the getting started tutorial should work.\n\n  ```sh\n  detox build\n  ```\n\n> TIP: Running `react-native run-ios` will also start a simulator and install your app on it, running `detox test` later will possibly start a different simulator, so you’ll find yourself with two open simulators. You can safely close the simulator started by `react-native`, everything will continue working as expected.\n\n### Step 2: Make Sure Your React-Native Packager is Running\n\nIf you can’t see a React Native packager instance running in a terminal, you can run it manually by typing:\n\n```sh\nreact-native start\n```\n\nThe packager instance will reload the JavaScript bundle of your app when you press CMD+R in the simulator window. This will allow you to make modifications in your app codebase.\n\n### Step 3: Run Detox Tests\n\nType the following inside your project root:\n\n```sh\ndetox test\n```\n\nThis will use Detox to find the app executable we’ve built in step 1, install it on a simulator and run Detox tests against it.\n\n### Step 4: Make Changes to Your App’s Codebase as Usual\n\nYou can keep working on the JavaScript codebase of your app as usual. As long as you keep the simulator from step 3 running, you’ll be able to press CMD+R inside and reload your app with the new changes.\n\n### Step 5: Re-run Detox Tests Without Re-installing the App\n\nYou can make changes to your Detox tests as well. When you want to run your tests on the simulator, we recommend using the following command:\n\n```sh\ndetox test --reuse\n```\n\nThe reuse option will prevent Detox from compiling and re-installing your app again in the simulator. The tests will simply run against the current app instance currently running in the simulator. This will make the process much faster.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Expo.md",
    "content": "---\nid: expo\nslug: guide/expo\ntitle: Expo\nsidebar_label: Expo\n---\n\n## Expo\n\n**Note**: Expo support with Detox is entirely a community driven effort. We have no specific support in Detox for Expo applications (ejected or otherwise).\n\nIf you are seeing an issue, it is most likely not an issue with Detox itself, but with the Expo runtime or with an incorrect Detox setup. For support on how to use Detox with Expo, you should contact the Expo team or the Expo community.\n\nGeneral Expo issues will no longer be allowed in the Detox issue tracker. If you’ve investigated the Expo runtime or your app, and found a genuine issue with Detox, please open an issue.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Jest.md",
    "content": "---\nid: jest\nslug: guide/jest\ntitle: Jest Setup Guide\nsidebar_label: Jest Setup Guide\n---\n\n## Jest Setup Guide\n\n> **NOTE: This article previously focused on deprecated `jest-jasmine2` runner setup, and if you nevertheless need to access it, [follow this Git history link](https://github.com/wix/Detox/blob/ef466822129a4befcda71111d02b1a334539889b/docs/Guide.Jest.md).**\n\nThis guide describes how to install [Jest](https://jestjs.io) as a test runner to be used by Detox for running the E2E tests.\n\n### Introduction\n\nAs already mentioned in the [Getting Started](introduction/getting-started.md#set-up-a-test-runner) guide, Detox itself does not effectively run tests logic, but rather delegates that responsibility onto a test runner. At the moment, Jest is the only recommended choice, for many reasons, including - but not limited to, parallel test suite execution capability, and complete integration with Detox API.\n\nBy the way, Jest itself — much like Detox, also does not effectively run any tests. Instead, it is more of a dispatcher and orchestrator of multiple instances of a delegated runner capable of running in parallel. For more info, refer to [this video](https://youtu.be/3YDiloj8_d0?t=2127) (source: [Jest architecture](https://jestjs.io/docs/en/architecture)).\n\nFor its part, Detox supports only one Jest’s concrete runner, which is [`jest-circus`](https://www.npmjs.com/package/jest-circus) ([ships by default with Jest since 27.0.0](https://jestjs.io/blog/2021/05/25/jest-27)). The former runner, `jest-jasmine2`, is deprecated due to specific bugs in the past, and architectural limitations at present.\n\n### Installation\n\n**Disclaimer:**\n\n1. Here we focus on installing Detox on _new projects_. If you’re migrating a project with an existing Detox installation, please apply some common sense while using this guide.\n1. These instructions are relevant for `jest@^27.0.0` (and `jest@^26.0.1 + jest-circus@^26.0.1`). They should likely work for the newer `jest` versions too, but for **the older ones** (25.x, 24.x) — **they will not, due to blocking issues.**\n\n#### 1. Install Jest\n\nBefore starting with Jest setup, be sure to complete the preliminary sections of the [Getting Started](introduction/getting-started.md) guide.\n\nAfterward, install the respective npm package:\n\n```bash npm2yarn\nnpm install -D \"jest@>=27.2.5\"\n```\n\n**NOTE:** The command will install the _latest Jest version_. However, `@>=27.2.5` addendum is recommended just to be on the safe side in a common scenario, when a `package-lock.json`\ngenerated by an official React Native project template limits Jest version to a very old `26.x`, maybe due to some optimization mechanism.\nGenerally we recommend not to stay on outdated Jest versions for too long, e.g. `jest@27.2.5` will be the minimal version supported by Detox 20.\n\n#### 2. Set up Test-code Scaffolds\n\nRun the automated init script:\n\n```sh\ndetox init -r jest\n```\n\n> **Note:** errors occurring in the process may appear in red.\n\nIf things go well, the following will be created:\n\n- An `e2e/` folder in your project root\n- An `e2e/config.json` file; [example](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/config.json)\n- An `e2e/environment.js` file; [example](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/environment.js)\n- An `e2e/firstTest.e2e.js` file with content similar to [this](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/app-hello.e2e.ts).\n\n#### 3. Fix / Verify\n\nEven if `detox init` passes well, and everything is green, we still recommend going over the checklist below. You can also use our example project, [`demo-react-native-jest`](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest), as a reference in case of ambiguities.\n\n##### .detoxrc.json\n\n| Property                     | Value                               | Description                                                                                                                                                                                                                                                                                              |\n| ---------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `testRunner`                 | `\"jest\"`                            | _Required._ Should be `\"jest\"` for the proper `detox test` CLI functioning.                                                                                                                                                                                                                              |\n| `runnerConfig`               | (optional path to Jest config file) | _Optional._ This field tells `detox test` CLI where to look for Jest’s config file. If omitted, the default value is `e2e/config.json`.                                                                                                                                                                  |\n| `skipLegacyWorkersInjection` | `false` or `true`                   | _Optional._ This field tells `detox test` to stop appending `--maxWorkers 1` argument to `jest ...` command by default. Since `detox@18.19.0`, the control over `maxWorkers` count has been transfered to Jest config files, and that allows you to set any other value as a default `maxWorkers` count. |\n\nA typical Detox configuration in `.detoxrc.json` file looks like:\n\n```json\n{\n  \"testRunner\": \"jest\",\n  \"runnerConfig\": \"e2e/config.json\",\n  \"skipLegacyWorkersInjection\": true,\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        \"type\": \"iPhone 12 Pro Max\"\n      }\n    }\n  },\n  \"apps\": {\n    \"ios.release\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/example.app\",\n      \"build\": \"<...xcodebuild command...>\",\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.release\"\n    }\n  }\n}\n```\n\n##### `e2e/config.json`\n\n| Property          | Value                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| ----------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `maxWorkers`      | `1`                                         | _Recommended._ When being used with `skipLegacyWorkersInjection: true` in Detox config, it prevents overallocation of mobile devices in the light of Jest’s default logic (`= cpusCount — 1`), when you do not pass any specific worker count. To override it, [use CLI arguments](APIRef.DetoxCLI.md#test), or see [Jest documentation](https://jestjs.io/docs/configuration#maxworkers-number--string) if you plan to change the default value in the config.           |\n| `testEnvironment` | `\"./environment\"`                           | _Required._ Needed for the proper functioning of Jest and Detox. See [Jest documentation](https://jestjs.io/docs/en/configuration#testenvironment-string) for more details.                                                                                                                                                                                                                                                                                               |\n| `testRunner`      | `\"jest-circus/runner\"`                      | _Required._ Needed for the proper functioning of Jest and Detox. See [Jest documentation](https://jestjs.io/docs/en/configuration#testrunner-string) for more details.                                                                                                                                                                                                                                                                                                    |\n| `testTimeout`     | `120000`                                    | _Required_. Overrides the default timeout (5 seconds), which is usually too short to complete a single end-to-end test.                                                                                                                                                                                                                                                                                                                                                   |\n| `reporters`       | `[\"detox/runners/jest/streamlineReporter\"]` | _Recommended._ Sets up our streamline replacement for [Jest’s default reporter](https://jestjs.io/docs/en/configuration#reporters-array-modulename-modulename-options), which removes Jest’s default buffering of `console.log()` output. That is helpful for end-to-end tests since log messages appear on the screen without any artificial delays. For more context, [read Detox 12.7.0 migration guide](Guide.Migration.md#migrating-to-1270-from-older-nonbreaking). |\n| `verbose`         | `true`                                      | _Conditional._ Must be `true` if above you have replaced Jest’s default reporter with Detox’s `streamlineReporter`. Optional otherwise.                                                                                                                                                                                                                                                                                                                                   |\n\nA typical `jest-circus` configuration in `e2e/config.json` file would look like:\n\n```json\n{\n  \"testRunner\": \"jest-circus/runner\",\n  \"testEnvironment\": \"./environment\",\n  \"testTimeout\": 120000,\n  \"reporters\": [\"detox/runners/jest/streamlineReporter\"],\n  \"verbose\": true\n}\n```\n\n##### `e2e/environment.js`\n\nIf you are not familiar with Environment concept in Jest, you could check [their documentation](https://jestjs.io/docs/en/configuration#testenvironment-string).\n\nFor Detox, having a `CustomDetoxEnvironment` class derived from `NodeEnvironment` enables implementing cross-cutting concerns such as taking screenshots the exact moment a test function (it/test) or a hook (e.g., beforeEach) fails, skip adding tests if they have `:ios:` or `:android:` within their title, starting device log recordings before test starts and so on.\n\nAPI of `CustomDetoxEnvironment` is not entirely public in a sense that there’s no guide on how to write custom `DetoxCircusListeners` and override `initDetox()` and `cleanupDetox()` protected methods, since this is not likely to be needed for typical projects, but this is under consideration if there appears specific demand. You may want to check out this [simple example](https://github.com/wix/Detox/pull/2009#issuecomment-648971528) of overriding `initDetox()`, or some [alternative approaches](https://github.com/wix/Detox/pull/2009#issuecomment-649342823) to overriding `initDetox()`.\n\n```js\nconst {\n  DetoxCircusEnvironment,\n  SpecReporter,\n  WorkerAssignReporter,\n} = require('detox/runners/jest-circus');\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  constructor(config, context) {\n    super(config, context);\n\n    // Can be safely removed, if you are content with the default value (=300000ms)\n    this.initTimeout = 300000;\n\n    // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.\n    // This is strictly optional.\n    this.registerListeners({\n      SpecReporter,\n      WorkerAssignReporter,\n    });\n  }\n}\n\nmodule.exports = CustomDetoxEnvironment;\n```\n\n**Notes:**\n\n- The custom `SpecReporter` is recommended to be registered as a listener. It takes care of logging on a per-spec basis (i.e. when `it('...')` functions start and end) — which Jest does not do by default.\n- The custom `WorkerAssignReporter` prints for every next test suite which device is assigned to its execution.\n\nThis is how a typical Jest log output looks when `SpecReporter` and `WorkerAssignReporter` are enabled in `streamline-reporter` is set up in `config.json` and\n`SpecReporter` added in `e2e/environment.js`:\n\n![Streamlined output](img/jest-guide/streamlined_logging.png)\n\n### Writing Tests\n\nThere are some things you should notice:\n\n- Don’t worry about mocks being used, Detox works on the compiled version of your app.\n- Detox exposes its primitives (`expect`, `device`, ...) globally, it will override Jest’s global `expect` object.\n\n### Parallel Test Execution\n\nThrough Detox' CLI, Jest can be started with [multiple workers](Guide.ParallelTestExecution.md) that run tests simultaneously, e.g.:\n\n```bash\ndetox test --configuration <yourConfigurationName> --workers 2\n```\n\nIn this mode, Jest effectively assigns one worker per each test file.\nPer-spec logging offered by the `SpecReporter` mentioned earlier, does not necessarily make sense, as the workers' outputs get mixed up.\n\nBy default, we disable `SpecReporter` in a multi-workers environment.\nIf you wish to force-enable it nonetheless, the [`--jest-report-specs`](APIRef.DetoxCLI.md#test) CLI option can be used with `detox test`, e.g.:\n\n```bash\ndetox test --configuration <yourConfigurationName> --workers 2 --jest-report-specs\n```\n\n### How to Run Unit and E2E Tests in the Same Project\n\n- Create different Jest configs for unit and E2E tests, e.g. in `e2e/config.json` (for Detox) and `jest.config.js`\n  (for unit tests). For example, in Jest’s E2E config you can set `testRegex` to look for `\\.e2e.js$` regexp,\n  and this way avoid accidental triggering of unit tests with `.test.js` extension.\n- To run your E2E tests, use `detox test` command (or `npx detox test`, if you haven’t installed `detox-cli`).\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Migration.md",
    "content": "---\nid: migration\nslug: guide/migration\ntitle: Migration Guide\nsidebar_label: Migration Guide\n---\n\n## Migration Guide\n\nWe are improving Detox API as we go along, sometimes these changes require us to break the API in order for it to make more sense. These migration guides refer to breaking changes. If a newer version has no entries in this document, it means it does not require special migration steps. Refer to the release notes of the latter builds to learn about their improvements and changes.\n\n### 19.2\n\nThe release has a **developer experience** improvement – _Detect pending in-flight requests_ ([#3003](https://github.com/wix/Detox/issues/3003), [**@jonathanmos**](https://github.com/jonathanmos)).\nThe feature adds extra logic that prevents forgotten `await` statements on asynchronous Detox APIs. That’s why you might see a new error like this:\n\n```plain text\nFAILED\nDetoxRuntimeError: The pending request \\#246 (\"invoke\") has been rejected due to the following error:\n\nDetox has detected multiple interactions taking place simultaneously. Have you forgotten to apply an await over one of the Detox actions in your test code?\n```\n\nThat should help you find forgotten `await`s in your code that are a potential reason for flakiness in E2E tests.\nYou’ll need to find those places and apply trivial fixes like shown below:\n\n```diff\n   await screenDriver.performSomeAction();\n-  expect(screenDriver.get.myElement()).toBeNotVisible();\n+  await expect(screenDriver.get.myElement()).toBeNotVisible();\n```\n\n### 19.0\n\n**Version 19 is not really a breaking change!**\n\nWe decided to bump Detox into a major version release, nonetheless, because it is breaking for projects that sport [custom Detox drivers](Guide.ThirdPartyDrivers.md), such as [`detox-puppeteer`](https://github.com/ouihealth/detox-puppeteer).\n\nIf you are a maintainer of such a project, and you wish to upgrade your Detox dependency to 19 (kudos! :clap:),  follow this step-by-step migration guide; You can refer to [this pull-request](https://github.com/ouihealth/detox-puppeteer/pull/13), which does that for the  `detox-puppeteer` project.\n\n#### Migrating Custom Drivers\n\nThe core of the change is that Detox' drivers framework is **no longer a single monolith**, responsible for everything platform-specific. Rather, it’s been broken down to these subresponsibilies:\n\n- Allocation: The process of launching / selecting a device over which the tests would run in the current execution.\n- Validation: Execution environment checkups.\n- Artifacts: Platform-based selection of build-artifacts implementation (e.g. screenshots).\n- Runtime\n\n> You can find a visual explanation, [here](https://github.com/wix/Detox/files/7338121/pre-multiapps-rfc.pdf).\n\nIn addition, the runtime driver is no longer state-less -- basically, allowing implementation to hold any state that is required in identifying and managing the associated device.\n\n##### How to migrate\n\nEverything here will be based on the changes made in the [`detox-puppeteer` example](https://github.com/ouihealth/detox-puppeteer) - names included (please don’t use them as-is in your own implementation!).\n\n**Allocation:**\n\n- Create a new class, called `PuppeteerDeviceAllocation` (change name to something that would make sense in your project).\n- Move everything currently in `PuppeteerDriver.acquireFreeDevice()` and `.shutdown()` onto `PuppeteerDeviceAllocation.allocate()` and `.free()`, respectively.\n- Create a POJO class called `PuppeteerAllocCookie`. This class should hold anything that would later be required in order to specify the specifically associated device (example: `UDID` for iOS simulators, `adb` names for Android devices).\n- Make `.allocate()` return an instance of your cookie class. Puppeteer example: [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R841).\n- **Delete `PuppeteerDriver.acquireFreeDevice()` and `PuppeteerDriver.shutdown()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R830).\n\nAdd the new allocation class to the `module.exports` list, under the name: `DeviceAllocationDriverClass`.\n\n**Validation:**\n\n- If you have any validations implemented in `PuppeteerDriver.prepare()`, create a class called `PuppeteerEnvironmentValidator`.\n- Move anything inside `PuppeteerDriver.prepare()` to `PuppeteerEnvironmentValidator.validate()`.\n- **Delete `PupeteerDriver.prepare()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R798).\n\nAdd the new (optional) class to the `module.exports` list, under the name: `EnvironmentValidatorClass`.\n\n**Artifacts:**\n\n- Move your implementation of `PuppeteerDriver.declareArtifactPlugins()` to the same method in a new class, called `PuppeteerArtifactPluginsProvider.declareArtifactPlugins()` (change name to something that would make sense in your project).\n\n> There are no changes in method signature in this case.\n\nAdd the new class to the `module.exports` list, under the name: `ArtifactPluginsProviderClass`.\n\n**Runtime:**\n\n- Optionally rename your class from `PuppeteerDriver` to `PuppeteerRuntimeDriver`.\n- In the methods remaining in the class accepting the `deviceId` arg: **remove the `deviceId` arg entirely**. This might break your implementation - don’t worry, continue reading.\n- If applicable, change the signature of the class' c'tor to accept the cookie as its 2nd argument (instance previously allocated in `PuppeteerAllocationDriver.allocate()`). Save data from the cookie as part of the driver’s state, in order to unbreak your implementation, following the previous step.\n- Add two methods: `getExternalId()` and `getDeviceName()`. Implement them such that they would comply with the `device.id` and `device.name` [API contracts](APIRef.DeviceObjectAPI.md), respectively.\n\nExport the runtime driver class in the `module.exports` list as `RuntimeDriverClass`, **instead of `DriverClass`.**\n\n##### Troubleshooting\n\nFor issue related to these migrations, approach us by [submitting an issue on GitHub](https://github.com/wix/Detox/issues/new/choose). Please apply the `Detox19` label.\n\n### 18.6.0\n\nDetox has normalized the configuration format, so that along with the combined `configurations` object you now can define your `devices` and `apps` separately.\nPlease refer to the [configuration doc](https://github.com/wix/Detox/blob/18.6.0/docs/config/overview.md) to obtain more details.\nThis change is backward-compatible, although the new format is now the recommended option.\n\n### 18.0\n\nDetox now uses a custom synchronization system on iOS, [developed in-house](https://github.com/wix/DetoxSync); this is the second step in phasing out our Earl Grey usage. We have tested this system extensively internally, and are confident that it should work as expected. There are no known limitations with the new system.\n\nIf you are seeing issues with the new sync system, please open an issue.\n\n**Breaking:**\n\n- **iOS.** Detox now requires iOS 13.0 and above iOS simulator runtimes, and iOS 12.x and below are no longer supported. This does not require that you drop support for iOS 12.x in your apps, just that tests will no longer work on iOS 12 and below. Please make sure your tests are running on iOS 13 or above\n- **JS.** :warning: Detox no longer launches the app automatically (even if asked to do so in configuration) — you have to launch your app explicitly:\n\n```diff\n+  beforeAll(async () => {\n+    await device.launchApp();\n+  });\n```\n\n- **JS (jest-circus).** The `DetoxCircusEnvironment` provided from `detox/runners/jest-circus` package now requires two arguments in its constructor, so you have to update your descendant class signature:\n\n```diff\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n-  constructor(config) {\n-    super(config);\n+  constructor(config, context) {\n+    super(config, context);\n```\n\n- **JS (iOS).** `device.launchApp({ launchArgs: { ... })` argument escaping has been improved. If you use complex launch args such as regular expressions, make sure you remove manual escaping from now on to avoid erroneous double escaping, e.g.:\n\n```diff\n await device.launchApp({\n   launchArgs: {\n-    detoxURLBlacklistRegex: '(\\\\\".*example.com/some-url/.*\\\\\")' }`,\n+    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")' }`,\n   },\n });\n```\n\n- **JS (internal).** There is a breaking change for people writing custom Detox integrations. Environment variable naming schema has changed – now Detox uses prefix to distinguish its own environment variables (usually passed from `detox test` CLI), e.g.: `recordLogs=all` becomes `DETOX_RECORD_LOGS=all`, `loglevel=trace` becomes `DETOX_LOGLEVEL=trace`, and so on.\n\n### 17.5.2\n\nFixes the issue from **17.4.7** (see below) - now the migration guide for **17.4.7** can be safely ignored.\n\n### 17.4.7\n\nThis release was not meant to be breaking in any sense, but unfortunately there are two minor caveats that leaked in.\n\n#### `jest-cli`\n\nFrom now on, Detox explicitly depends on `jest-cli` package (marked as a peer dependency), that’s why if you see an error like the one below:\n\n```plain text\nCannot find module 'jest-cli/build/cli/args'\n```\n\n~~You should add `jest-cli` to your `package.json`’s `devDependencies` and rerun `npm install`, e.g.:~~\n\n**UPD**: since `detox@17.5.2` you can ignore this advice. The problem should go away **without** these edits:\n\n```diff\n \"devDependencies\": {\n   \"jest\": \"26.x.x\",\n+  \"jest-cli\": \"26.x.x\",\n```\n\n#### `detox-cli`\n\nIf you were using `detox-cli` global package, make sure to upgrade it before proceeding to `detox@17.4.7`.\n\n```bash npm2yarn\nnpm install detox-cli --global\n```\n\nIf you have an older version of `detox-cli`, then you might see the following error on an attempt to run  `detox test <...args>`:\n\n```plain text\n'jest' is not recognized as an internal or external command,\noperable program or batch file.\ndetox[43764] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern \"^((?!:android:).)*$\" --maxWorkers 1 e2e\n```\n\n### 17.3.0\n\nIn the context of introducing the element screenshots feature ([#2012](https://github.com/wix/Detox/issues/2012)), we decided to slightly change the contract between Detox and externally-implemented _drivers_. These should be modified according to the follow diff-snippet:\n\n```diff\nclass Expect {\n-  constructor(invocationManager) {\n+  constructor({ invocationManager }) {\n     this._invocationManager = invocationManager;\n  }\n}\n\nclass PluginDriver {\n  constructor() {\n-    this.matchers = new Expect(new invocationManager());\n  }\n}\n\n-module.exports = PluginDriver;\n+module.exports = {\n+  DriverClass: PluginDriver,\n+  ExpectClass: Expect,\n+}\n```\n\n### 17.0.0\n\nDetox for iOS now uses an entirely new, custom-built matcher, action and expectation infrastructure. This is the first step in our roadmap of removing Earl Grey as a dependency.\n\nWhile the new system has been designed to be as compatible as possible with the existing system, some changes we made to existing APIs that may or may not require your attention.\n\n#### New API\n\n- `pinch()`—new API for pinching elements, replacing the deprecated `pinchWithAngle()` (iOS)\n- `getAttributes()`—new API for obtaining element properties (iOS)\n- `not`—new API for inverting expectation logic (iOS, Android)\n\n#### Modified API (**Potentially Breaking Changes**)\n\nThe following APIs have changed and require attention\n\n- `by.text()`—matching elements by text actually uses the element’s text value instead of using the accessibility label (iOS)\n- `by.traits()`—the supported trait values have changed (iOS)\n- `atIndex()`—matched elements are now sorted by x and y axes to allow for stability between tests; indices will most likely change after upgrading to this version of Detox (iOS)\n- `tap()`—this method now accepts an optional point to tap (iOS, Android)\n- `setColumnToValue()`—this method no longer supports date pickers; use `setDatePickerDate()` to change picker dates (iOS)\n- `setDatePickerDate()`—in addition to normal date formats, a new special case is introduced for ISO 8601 formatted date strings: `\"ISO8601\"` (iOS)\n\n#### Deprecated API\n\nThe following APIs have been deprecated, but is still available\n\n- `tapAtPoint()`—the API has been consolidated with `tap(point)` (iOS, Android)\n- `pinchWithAngle()`—this API has been replaced with `pinch()` (iOS)\n- `toBeNotVisible()`—deprecated in favor of `not.toBeVisible()` (iOS, Android)\n- `toNotExist()`—deprecated in favor of `not.toExist()` (iOS, Android)\n\nMake sure to read the API reference for [matchers](https://github.com/wix/Detox/blob/master/docs/APIRef.Matchers.md), [actions](https://github.com/wix/Detox/blob/master/docs/APIRef.ActionsOnElement.md) and [expectations](https://github.com/wix/Detox/blob/master/docs/APIRef.Expect.md).\n\nIf you see unexpected results, make sure to open an issue.\n\n### 16.0.0\n\nDetox now comes as a prebuilt framework on iOS, thus lowering npm install times and saving some build issues that happen due to unexpected Xcode setups.\n\nTo support this, Detox needs Swift 5 support, so the iOS requirements have changed slightly:\n\n- **Xcode**: 10.2 or higher\n  - **iOS Simulator Runtime**: iOS 12.2 or higher\n\nThis does not require that your app require iOS 12.2, only that you build and run your app on Xcode 10.2 or above, and use an iOS 12.2 or above simulator.\n\n### 14.5.0\n\nIt is recommended to change \"name\" string to \"device\" object in your configurations, like shown below:\n\nBefore:\n\n```json\n{\n  \"ios.sim.debug\": {\n    \"type\": \"ios.simulator\",\n    \"name\": \"iPhone 11 Pro\"\n  },\n  \"android.emu.release\": {\n    \"type\": \"android.emulator\",\n    \"name\": \"Nexus_5X_API_29\"\n  },\n  \"android.att.release\": {\n    \"type\": \"android.attached\",\n    \"name\": \"YOGAA1BBB412\"\n  }\n}\n```\n\nAfter:\n\n```js\n{\n  \"ios.sim.debug\": {\n    \"type\": \"ios.simulator\",\n    \"device\": { // one of these or a combination of them\n      \"id\": \"D53474CF-7DD1-4673-8517-E75DAD6C34D6\",\n      \"type\": \"iPhone 11 Pro\",\n      \"name\": \"MySim\",\n      \"os\": \"iOS 13.0\",\n    }\n  },\n  \"android.emu.release\": {\n    \"type\": \"android.emulator\",\n    \"device\": { // only avdName is supported at the moment\n      \"avdName\": \"Nexus_5X_API_29\",\n    }\n  },\n  \"android.att.release\": {\n    \"type\": \"android.attached\",\n    \"device\": { // only adbName is supported at the moment\n      \"adbName\": \"YOGAA1BBB412\",\n    }\n  }\n}\n```\n\n### 14.0.0\n\nDetox 14.0.0 drops support for iOS 9.x simulators, and thus it also drops support for any API that is deprecated in iOS 10 and above. This includes legacy [remote](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application?language=objc) and [local](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622930-application?language=objc) notifications handling API. These APIs have been deprecated since iOS 10, and we believe we’ve given app developers enough time to use the modern APIs. Make sure you transition to the [`UserNotifications` framework](https://developer.apple.com/documentation/usernotifications?language=objc) as soon as possible.\n\n**Please note that for React Native apps, [`PushNotificationIOS` (`RCTPushNotificationManager`)](https://facebook.github.io/react-native/docs/pushnotificationios) is severely outdated and does not support these modern APIs.** It is recommended to transition to a more modern solution. While it is sad that such an important app feature is let to stagnate so much by Facebook, it cannot be the concern of Detox. It is up to RN users to keep their apps up to date with the latest Apple APIs.\n\nOur [own React Native notifications solution](https://github.com/wix/react-native-notifications) supports these modern APIs.\n\nSee [#1514](https://github.com/wix/Detox/issues/1514).\n\n### Migrating to 12.7.0 from older (nonbreaking)\n\n**This is only relevant to those running Detox using [`Jest` as the test runner](Guide.Jest.md)**!\n\nIn `12.7.0` we’ve greatly improved our support in Jest - trying to tackle these two caveats which hold developers back from embracing it:\n\n1. Jest file-level summary logs take precedence over 'plain' output, which makes them and all other logs (e.g. user in-test logging) seem cluttered.\n1. Plain logs output is batched, and thus often does not show in real-time as the test is run. This is particularly annoying when running tests on the local computer.\n1. Jest offers no spec-level logging => no way to tell what’s running \"right now\" and which test created what log-outputs.\n\n_Put in simple words, Jest is optimized for running tests concurrently using multiple workers. This isn’t the case when writing/debugging tests on a local machine._\n\nIn `12.7.0` we’ve worked out a configuration scheme that aims at solving these by streamlining all test-related outputs. **Please follow the updated [Jest installation guide](Guide.Jest.md), to set it up.**\n\n### Migrating from Detox 12.4.x to 12.5.0 (nonbreaking)\n\nStarting Detox `12.5.0`, we ship Android with precompiled sources under a  `.aar` file. The complete configuration process is thoroughly described in the [Android setup guide](Introduction.Android.md) - but it mostly fits **new** projects. For existing projects, migrating is strongly recommended; here’s the diff:\n\nRoot `settings.gradle` file:\n\n```diff\n-include ':detox'\n-project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')\n```\n\nRoot `buildscript` (i.e. `build.gradle`):\n\n```diff\nallprojects {\n    repositories {\n         // ...\n+        maven {\n+            url \"$rootDir/../node_modules/detox/Detox-android\"\n+        }\n     }\n }\n```\n\nApp `buildscript` (i.e. `app/build.gradle`):\n\n```diff\n dependencies {\n-    androidTestImplementation(project(path: \":detox\"))\n+    androidTestImplementation('com.wix:detox:+') { transitive = true }\n }\n```\n\n#### ProGuard Configuration\n\nIf you have Detox ProGuard rules integrated into the `app/build.gradle`, be sure to switch to an explicit search path:\n\n```diff\n     buildTypes {\n         release {\n\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n-            proguardFile \"${project(':detox').projectDir}/proguard-rules-app.pro\"\n+            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n\n         }\n     }\n```\n\n### Migrating from Detox 12.3.x to 12.4.0\n\nThe deprecation of `\"specs\"` (in `package.json`) introduced in 12.1.0 is **no longer relevant**.\nIt is valid now, like it was before, but from now on the semantics has been slightly changed -\nit acts as a fallback for the default root for your Detox E2E specs, in cases when\nyou don’t specify it explicitly, e.g.:\n\n```sh\ndetox test   # translates to: mocha <...args> e2e\ndetox test e2e/01.sanity.test.js  # translates to: mocha <...args> e2e/01.sanity.test.js\n```\n\nBetween 12.1.x and 12.3.x, it was buggy and used to work like this:\n\n```sh\ndetox test   # translates to: mocha <...args> e2e\ndetox test e2e/01.sanity.test.js  # translates to: mocha <...args> e2e e2e/01.sanity.test.js\n```\n\n### Migrating from Detox 12.0.x to 12.1.x\n\nThis is not a breaking change yet, but starting from `detox@12.1.0` you’ll start seeing warnings like:\n\n```plain text\ndetox[21201] WARN:  [deprecation.js] Beware: -f, --file will be removed in the next version of Detox.\ndetox[21201] WARN:  [deprecation.js] See the migration guide:\nhttps://github.com/wix/Detox/blob/master/docs/Guide.Migration.md#migrating-from-detox-120x-to-121x\n```\n\nIn the next major version `--file` and `--specs` will be treated as unknown arguments\nand therefore passed as-is to your appropriate test runner. That allows to avoid name\nconflict with the respective `--file` option in Mocha runner itself and other potential\ncollisions.\n\nSo, if you have been using CLI arguments like `--file e2e` or\n`--specs e2e`, please drop the preceding `--file` and `--specs`, so that:\n\n```sh\ndetox test --file e2e/01.sanity.test.js\n```\n\nbecomes:\n\n```sh\ndetox test e2e/01.sanity.test.js\n```\n\n**UPDATE:** It was decided not to deprecate `\"specs\"` in `package.json`, so the text below\nis not relevant to a large extent. Please ignore the guide below.\n\n~~To get rid of this warning:~~\n\n- ~~find `\"specs\"` or `\"file\"` entry in your project’s `package.json` and empty it (e.g. `\"e2e\"` ⟶ `\"\"`);~~\n- ~~update your `detox test` scripts — make sure they have an explicit path to your Detox tests folder, e.g. `detox test e2e`.~~\n\n~~For example, if it were a `package.json` before:~~\n\n```json\n{\n  \"name\": \"your-project\",\n  \"scripts\": {\n    \"e2e:ios\": \"detox test -c ios.simulator.release\"\n  },\n  \"detox\": {\n    \"specs\": \"e2e\"\n  }\n}\n```\n\n~~Then this is how it should look like afterwards:~~\n\n```json\n{\n  \"name\": \"your-project\",\n  \"scripts\": {\n    \"e2e:ios\": \"detox test -c ios.simulator.release e2e\"\n  },\n  \"detox\": {\n    \"specs\": \"\"\n  }\n}\n```\n\n~~Notice that we appended `e2e` to the `e2e:ios` test script and\nemptied `\"specs\"` property in `detox` configuration.~~\n\n~~In a case if you had no `\"specs\"` property in your `detox` configuration\nin `package.json`, then please add it temporarily like this:~~\n\n```json\n{\n    \"specs\": \"\"\n}\n```\n\n### Migrating from Detox 11.0.1 to 12.0.0\n\nThe new version explicitly requires **Xcode 10.1 or higher** in order to run tests on iOS ([#1229](https://github.com/wix/Detox/issues/1229)).\n\n### Migrating from Detox 11.0.0 to 11.0.1 (nonbreaking)\n\n**React Native versions older than 0.46 are no longer supported**, so the `missingDimentsionStrategy` can be removed from `android/app/build.gradle`:\n\n```diff\nandroid {\n  defaultConfig {\n      // ...\n-        missingDimensionStrategy \"minReactNative\", \"minReactNative46\"\n    }\n}\n```\n\n### Migrating from Detox 10.x.x to 11.x.x\n\n#### Step 1\n\n`android/app/build.gradle`\n\n```diff\nandroid {\n    defaultConfig {\n         // ...\n-        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n+        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n}\n\ndependencies {\n    implementation \"com.facebook.react:react-native:+\"  // From node_modules\n    androidTestImplementation(project(path: \":detox\"))\n    androidTestImplementation 'junit:junit:4.12'\n-   androidTestImplementation 'com.android.support.test:runner:1.0.2'\n-   androidTestImplementation 'com.android.support.test:rules:1.0.2'\n```\n\n#### Step 2\n\nRewrite your `DetoxTest.java` file according to the updated [Android setup guide](Introduction.Android.md#5-create-a-detox-test-class).\n\n### Migrating from Detox 9.x.x to 10.x.x\n\nIf your project does not already use Kotlin, add the Kotlin Gradle-plugin to your `classpath` in `android/build.gradle`:\n\n```groovy\nbuildscript {\n    // ...\n    ext.kotlinVersion = '1.3.0'\n\n    dependencies {\n        // ...\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n    }\n}\n```\n\n_Note: most guides advise of defining a global `kotlinVersion` constant - as in this example, but that is not mandatory._\n\n**IMPORTANT:** Detox aims at a playing fair with your app, and so it allows you to explicitly define the Kotlin version for it to use - so as to align it with your own; Please do so - in your root `android/build.gradle` configuration file:\n\n```groovy\nbuildscript {\n    ext.kotlinVersion = '1.3.0' // Your app’s version\n    ext.detoxKotlinVersion = ext.kotlinVersion // Detox' version: should be 1.1.0 or higher!\n}\n```\n\n_**Note that Detox has been tested for version 1.1.0 of Kotlin, and higher!**_\n\n### Migrating from Detox 8.x.x to 9.x.x\n\nDetox 9.0.0 brings the latest Espresso (3.0.2), and React Native 56 support on Android.\nEspresso 3.0.2 has a few mandatory dependency changes, which break the current setup for Detox users on Android.\n\nUse this to diff to upgrade your dependencies, and follow Android Studio’s in-editor guidance/lint support.\n\n`android/app/build.gradle`\n\n```diff\n\ndependencies {\n-   implementation \"com.android.support:appcompat-v7:27.0.2\"\n+   implementation \"com.android.support:appcompat-v7:27.1.1\"\n    implementation \"com.facebook.react:react-native:+\"  // From node_modules\n    androidTestImplementation(project(path: \":detox\"))\n    androidTestImplementation 'junit:junit:4.12'\n-   androidTestImplementation 'com.android.support.test:runner:1.0.1'\n-   androidTestImplementation 'com.android.support.test:rules:1.0.1'\n+   androidTestImplementation 'com.android.support.test:runner:1.0.2'\n+   androidTestImplementation 'com.android.support.test:rules:1.0.2'\n```\n\n`android/build.gradle`\n\n```diff\ndependencies {\n-   classpath 'com.android.tools.build:gradle:3.0.1'\n+   classpath 'com.android.tools.build:gradle:3.1.4'\n}\n```\n\nAn example for the above changes can be found on [`demo-react-native` project](https://github.com/wix/Detox/pull/914/files#diff-a4582798f3b7df5ccd62283b37b5573e)\n\nMore details about Espresso dependencies [here](https://developer.android.com/training/testing/espresso/setup)\n\n### Migrating from Detox 7.x.x to 8.x.x\n\nDetox 8.x.x brings support for test artifacts (videos, screenshot, logs), and to learn more about it, you can refer to [Artifacts documentation](APIRef.Artifacts.md) and to [Detox CLI documentation](APIRef.DetoxCLI.md).\n\n#### Changes to `e2e/init.js`\n\nIn order for Detox to be able to create artifacts, `detox.beforeEach(testSummary)` and `detox.afterEach(testSummary)` must be called with a current test summary object (test title, full test name, test status).\n\nDetox 8 introduces adapters for both Mocha and Jest, wrapping the original `detox.beforeEach(testSummary)` and `detox.afterEach(testSummary)` functions, for easier integration.\n\nyou are encouraged to reuse the examples of `./e2e/init.js` for  [mocha](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/init.js) and [jest](https://github.com/wix/Detox/tree/master/examples/demo-react-native-jest/e2e/init.js). The gist is brought in the following sections:\n\n##### _Mocha_\n\n```js\nconst detox = require('detox');\nconst adapter = require('detox/runners/mocha/adapter');\n\nbefore(async () => {\n  await detox.init();\n});\n\nbeforeEach(async function () {\n  await adapter.beforeEach(this);\n});\n\nafterEach(async function () {\n  await adapter.afterEach(this);\n});\n\nafter(async () => {\n  await detox.cleanup();\n});\n```\n\n> _NOTICE:_\n> Make sure you use ES5 functions in `beforeEach` and `afterEach`. `this` refers to mocha’s test object, using arrow functions will result with failure to acquire a correct **`this`** inside the adapter.\n\n```js\n// ✗ INCORRECT\n\nbeforeEach(() => { /* ... your content ... */ }); // won’t work\nafterEach(() => { /* ... your content ... */ }); // won’t work\n\n// CORRECT\n\nbeforeEach(function ( /* ... your content ... */ ) {});\nafterEach(function ( /* ... your content ... */ ) {});\n```\n\n##### _Jest_\n\n```js\nconst detox = require('detox');\nconst adapter = require('detox/runners/jest/adapter');\n\njest.setTimeout(120000);\njasmine.getEnv().addReporter(adapter); // don’t forget this line\n\nbeforeAll(async () => {\n  await detox.init();\n});\n\nbeforeEach(async () => {\n  await adapter.beforeEach();\n});\n\nafterAll(async () => {\n  await adapter.afterAll();\n  await detox.cleanup();\n});\n```\n\n> _NOTICE:_\n> Make sure to register the adapter as a Jasmine reporter in `init.js` like this:\n\n```js\njasmine.getEnv().addReporter(adapter);\n```\n\n- Jest adapter requires a hook to `afterAll`:\n\n```js\nafterAll(async () => {\n  await adapter.afterAll();\n  await detox.cleanup();\n});\n```\n\n##### Note regarding `detox.beforeEach` and `detox.afterEach`\n\nAPI of these methods is subject to change in future versions due to complexity behind composing test summary objects (as in the case with Jest test runner). If you have reasons to make direct calls to `detox.beforeEach` and `detox.afterEach` (e.g. you’re adding support for another test runner), please refer to [detox object documentation](APIRef.DetoxObjectAPI.md).\n\n##### Changes to `detox test` CLI\n\nThe `--artifact-location` argument became optional for `detox test` in the version 8.x.x.\nBy default, it dynamically creates `./artifacts/{configuration}.{timestamp}` directory in the project folder as soon as it has to save a recorded artifact.\n\nPreviously, to enable log recording you just had to specify `--artifact-location` arg. Currently, you need to tell that explicitly via a new CLI flag: `--record-logs all` or `--record-logs failing`.\n\nNotice that `--artifact-location` became sensitive to whether you end your directory path with a slash or not. It has the next convention:\n\n- If you want to create automatically a subdirectory with timestamp and configuration name (to avoid file overwrites upon consequent reruns), specify a path to directory that _does not end_ with a slash.\n- Otherwise, if you want to put artifacts straight to the specified directory (in a case where you make a single run only, e.g. on CI), _add a slash_ to the end.\n\nFor more information see [CLI documentation](APIRef.DetoxCLI.md).\n\n### Migrating from Detox 4.x.x to 5.x.x\n\nThe clearest example for the 4->5 API changes is the change log of detox’s own test suite.\nCheck [detox test change log](https://github.com/wix/Detox/commit/c636e2281d83d07fe0b479681c1a8a6b809823ff#diff-bf5e338e4f0bb49210688c7691dc8589) for a real life example.\n\n#### Version 5.x.x breaks detox’s API in 4 different places\n\n##### 1. Promise based flow\n\nAll of the API calls are now promise based, and must use either promise chains or `async`-`await`.\n\nHere’s an example of an async call to tap an element:\n\n```js\n// <=4.x.x\nbeforeEach(() => {\n  element(by.text('Sanity')).tap();\n});\n```\n\n```js\n// 5.x.x\nbeforeEach(async () => {\n  await element(by.text('Sanity')).tap();\n});\n```\n\nSame thing with expectations\n\n```js\n// <=4.x.x\nit('should have welcome screen', () => {\n  expect(element(by.text('Welcome'))).toBeVisible();\n  expect(element(by.text('Say Hello'))).toBeVisible();\n  expect(element(by.text('Say World'))).toBeVisible();\n};\n```\n\n```js\n// 5.x.x\nit('should have welcome screen', async () => {\n  await expect(element(by.text('Welcome'))).toBeVisible();\n  await expect(element(by.text('Say Hello'))).toBeVisible();\n  await expect(element(by.text('Say World'))).toBeVisible();\n});\n```\n\n##### 2. `detox` object has a leaner API\n\nConfigure and init detox with just one promise based function.\n\n```js\n// <=4.x.x\ndetox.config(config);\ndetox.start(done);\n```\n\n```js\n// 5.x.x\nawait detox.init(config);\n```\n\nNo need to wait for test result after each test, you can safely remove `detox.waitForTestResult`\n\n```js\n// <=4.x.x\nafterEach((done) => {\n  detox.waitForTestResult(done);\n});\n```\n\ncleanup is promise based\n\n```js\n// <=4.x.x\ndetox.cleanup(done);\n```\n\n```js\n// 5.x.x\nawait detox.cleanup();\n```\n\n##### 3. `simulator` is now `device`\n\nThe global object `simulator` is now `device`, this change makes sense when thinking about multi-platform tests (Android support).\nAlong with the new promise based API, this is how we now control the attached device\n\n| <=4.x.x                                        | 5.x.x                                       |\n| ---------------------------------------------- | ------------------------------------------- |\n| `simulator.reloadReactNativeApp(done)`         | `await device.reloadReactNative()`          |\n| `simulator.relaunchApp(done)`                  | `await device.relaunchApp()`                |\n| `simulator.sendUserNotification(params, done)` | `await device.sendUserNotification(params)` |\n| `simulator.openURL(url)`                       | `await device.openURL(url)`                 |\n\n##### 4. Detox config scheme\n\nIn order for our API to support multiple platforms and devices, and to be able to provide a valid command line tool, we changed the Detox configuration scheme (in package.json)\n\nPrevious config looked like this:\n\n```json\n//<=4.x.x\n  \"detox\": {\n    \"session\": {\n      \"server\": \"ws://localhost:8099\",\n      \"sessionId\": \"test\"\n    },\n    \"ios-simulator\": {\n        \"app\": \"ios/build/Build/Products/Release-iphonesimulator/example.app\",\n        \"device\": \"iPhone 7 Plus\"\n    }\n  }\n```\n\nThe new configuration holds a dictionary of `configurations`.\n\n1. Each configuration must state `type` - currently only simulator is supported\n1. `app` is now `binaryPath`\n1. `build` - **\\[optional]** build command (either `xcodebuild`, `react-native run-ios`, etc...), will be later available through detox CLI tool.\n1. **session object is not mandatory anymore**, if is not provided detox will handle server creation by itself.\n\n```json\n//5.x.x\n  \"detox\": {\n    \"configurations\": {\n      \"ios.sim.release\": {\n        \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/example.app\",\n        \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build\",\n        \"type\": \"ios.simulator\",\n        \"name\": \"iPhone 7 Plus\"\n      }\n    }\n  }\n```\n\n##### 3.1 Start using `detox-cli`\n\nYou will now be able to run builds and tests from your command line `detox build` and `detox test`, read more about CLI tools [here](https://github.com/wix/Detox/blob/7323ad98f576a10404b24feba662d064cda9cc30/docs/APIRef.DetoxCLI.md)\n\n### Migrating from Detox 3.x.x to 4.x.x\n\nIf you have integrated with Detox in version 3.x.x, you will need to clean your project from previously generated targets.\n\n- Use the provided `cleanup_4.0.rb` to remove unneeded changes made with Detox 4.x.x.\n\n  ```sh\n  ruby node_modules/detox/scripts/cleanup_4.0.rb\n  ```\n\n- The script will delete previously configured project targets `*_Detox`. The targets are not used by detox anymore since the framework is now injected at runtime and doesn’t need to be linked in a different target.\n\n- Make sure to add changes performed by running this script to version control.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Mocha.md",
    "content": "---\nid: mocha\nslug: guide/mocha\ntitle: Mocha Setup Guide\nsidebar_label: Mocha Setup Guide\n---\n\n## Mocha Setup Guide\n\nThis guide describes how to install [Mocha](https://mochajs.org) as a test runner to be used by Detox for running the E2E tests.\n\nNote that while Mocha is lightweight and easy to set up, we nevertheless encourage usage of [Jest](Guide.Jest.md) instead, for 2 main reasons:\n\n1. Mocha does not support parallel-test execution (i.e. splitting the test suites between concurrently running test devices/emulators).\n1. Advanced integration features such as taking device screenshots on failures will not be as timely accurate as with working with Jest.\n\n### Installation\n\n**Disclaimer:** Here we focus on installing Detox on _new projects_. If you’re migrating a project with an existing Detox installation, please apply some common sense while using this guide.\n\n#### 1. Install Mocha\n\nBefore starting with Mocha setup, be sure to complete the preliminary sections of the [Getting Started](introduction/getting-started.md) guide.\n\n```bash npm2yarn\nnpm install mocha --save-dev --no-package-lock\n```\n\n#### 2. Set up Test-code Scaffolds\n\n```sh\ndetox init -r mocha\n```\n\n> **Note:** errors occurring in the process may appear in red.\n\nIf things go well, you should to have this set up:\n\n- An `e2e/` folder in your project root\n- An `e2e/.mocharc.json` file; [example](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/.mocharc.json)\n- An `e2e/init.js` file; [example](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/init.js)\n- An `e2e/firstTest.spec.js` file with content similar to [this](https://github.com/wix/Detox/tree/master/examples/demo-react-native/e2e/example.spec.js).\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Mocking.md",
    "content": "---\nid: mocking\nslug: guide/mocking\ntitle: Mocking\nsidebar_label: Mocking\n---\n\n## Mocking\n\n> **NOTE: This article previously focused on the older React Native versions (`<0.59`), so if you need to access it, [follow this Git history link](https://github.com/wix/Detox/blob/01ad250fe4168502a57339b8bcab0ec5a5c89e4b/docs/Guide.Mocking.md).**\n\nMocking is an integral part of testing.\nYou may want to use mocks to alter specific behavior of your app during tests, e.g., to:\n\n- change server endpoints to point to a mock/staging server instead of the regular production server;\n- stub a feature the simulator doesn’t support;\n- prepare mock environment data such as GPS position, Contacts/Photos found on the device, etc.\n\nThis guide assumes you are testing a React Native app with Detox.\n\nPlease note that you **cannot** apply mocking techniques familiar from the prior Jest experience, even though Detox runs on top of Jest, e.g.:\n\n```js\njest.mock('./src/myModule'); // NO, THIS WON'T WORK\n```\n\nAll the mocking must be conducted with the help of [Metro bundler](https://facebook.github.io/metro), which powers React Native under the hood.\nThanks to Metro bundler, there are two modes your React Native application can run in:\n\n1. **Debug mode**. Running `npx react-native start` spawns the _Metro bundler_ on port 8081 (by default). It serves JavaScript files of your app over HTTP, expecting that the native code will request it right upon the launch on the mobile device. Thus, the native app keeps re-downloading and executing the new code every time you change the code locally.\n\n1. **Release mode**. In contrast to the debug mode, _Metro bundler_ does not need to run as a server on the side. It bundles your JavaScript code once into the native app binary file. Hence, every edit to the source code requires rebuilding the entire app binary and reinstalling it on the device before you can see the effect.\n\nThere are two ways to configure the _Metro bundler_ to use your mocks: quick (**debug mode** only) and universal.\nLet's start with the quicker way.\n\n### Quick flow\n\n1. Pick a module that you are going to mock, e.g.:\n\n   ```js file=src/config.js\n   // src/config.js\n\n   export const SERVER_URL = 'https://production.mycompany.name/api';\n   export const FETCH_TIMEOUT = 60000;\n   ```\n\n1. Create a mock module alongside, with an arbitrary extension (e.g. `.mock.js`):\n\n   ```js file=src/config.js\n   // src/config.mock.js\n\n   export * from './config.js';\n\n   // override the url from the original file:\n   export const SERVER_URL = 'http://localhost:3000/api';\n   ```\n\n1. Stop your _Metro bundler_ if it has been already running, and run it again with the corresponding file extension override, e.g.:\n\n   ```sh\n   npx react-native start --sourceExts mock.js,js,json,ts,tsx\n   ```\n\n   This command is already enough to start your application in an altered mode, and you can start running your tests. Now, if some module imports `./src/config`, you tell _Metro bundler_ to prefer `./src/config.mock.js` over the plain `./src/config.js`, which means the consumer gets the mocked implementation.\n\n> CAVEAT: whichever file extension you might take for the mock files – make sure you don’t accidentally \"pick up\" unforeseen file overrides from `node_modules/**/*.your-extension.js`!\n> _Metro bundler_ does not limit itself to your project files only – applying those `--sourceExts` also affects the resolution of the `node_modules` content!\n\n### Configuring Metro bundler\n\nWhile the mentioned way is good enough for the **debug mode**, it falls short for the **release builds**. The problem is that the `--sourceExts` argument is supported only by `react-native start` command. Hence, you’d need a CLI-independent way to configure your Metro bundler, and that is patching your project's `metro.config.js`:\n\n```diff\n/**\n * Metro configuration for React Native\n * https://github.com/facebook/react-native\n *\n * @format\n */\n+const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;\n\n module.exports = {\n+  resolver: {\n+    sourceExts: process.env.MY_APP_MODE === 'mocked'\n+        ? ['mock.js', ...defaultSourceExts]\n+        : defaultSourceExts,\n+  },\n   transformer: {\n     getTransformOptions: async () => ({\n       transform: {\n         experimentalImportSupport: false,\n         inlineRequires: true,\n       },\n     }),\n   },\n };\n```\n\nThis way, we are enforcing a custom convention that if the Metro bundler finds the `MY_APP_MODE=mocked` environment variable, it should apply our `sourceExts` override instead of the default values.\n\nTherefore, to start the Metro bundler in the mocked mode, you would run something like:\n\n```sh\nMY_APP_MODE=mocked npx react-native start\n```\n\nThis principle stays the same for the **release mode**, although the build commands might differ depending on the platform and a specific script:\n\n```sh\nexport MY_APP_MODE=mocked\n# from now on, even an implicit run of Metro bundler will use our override\n\n# via React Native CLI\nnpx react-native run-ios --configuration Release\nnpx react-native run-android --variant=release\n\n# via native tools\nxcodebuild -workspace ... -configuration release -scheme ...\n./gradlew assembleRelease\n```\n\nPlease note that preparing React Native apps for the release mode requires groundwork for both [iOS](https://reactnative.dev/docs/publishing-to-app-store) and [Android](https://reactnative.dev/docs/signed-apk-android), which is out of scope of this current article.\n\nAs you might have noticed, this tutorial has no direct connection to Detox itself, which is a correct observation.\nThe suggested mocking techniques are a part of the React Native world itself, so please consult the further resources:\n\n- <https://facebook.github.io/metro/>\n- <https://github.com/react-native-community/cli/blob/master/docs/commands.md>\n\nHappy Detoxing!\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.ParallelTestExecution.md",
    "content": "---\nid: parallel-test-execution\nslug: guide/parallel-test-execution\ntitle: Parallel Test Execution\nsidebar_label: Parallel Test Execution\n---\n\n## Parallel Test Execution\n\nDetox can leverage multi worker support of JS test runners ([Jest](http://jestjs.io/docs/en/cli#maxworkers-num), [AVA](https://github.com/avajs/ava#process-isolation), etc.).\n\nBy default `detox test` will run the test runner with one worker (it will pass `--maxWorkers=1` to Jest CLI, Mocha is unaffected). Worker count can be controlled by adding `--workers n` to `detox test`, read more in [`detox-cli` section](APIRef.DetoxCLI.md#test).\n\n### Device Creation\n\nWhile running with multiple workers, Detox might not have an available simulator for every worker.\nIf no simulator is available for that worker, the worker will create one with the name `{name}-Detox`.\n\n### Lock File\n\nSimulators/emulators run on a different process, outside of node, and require some sort of lock mechanism to make sure only one process controls a simulator in a given time. Therefore, Detox 7.4.0 introduced `device.registry.state.lock`, a lock file controlled by Detox, that registers all in-use simulators.\n\n> **Note:** Each worker is responsible for removing the device ID from the list in `device.registry.state.lock`. Exiting a test runner abruptly (using `Ctrl+C` / `⌘+C`) will not give the worker a chance to unregister the device from the lock file, resulting in an inconsistent state, which can result in creation of unnecessary new simulators.\n>\n> - `detox-cli` makes sure `device.registry.state.lock` is cleaned whenever it executes.\n> - If you use Detox without `detox-cli` make sure you delete or reset the lock file before running tests.\n>\n>   ```sh\n>   echo \"[]\" > ~/Library/Detox/device.registry.state.lock\n>   ```\n\nThe lock file location is determined by the OS, and [defined here](https://github.com/wix/detox/blob/master/detox/src/utils/appdatapath.js).\n\n- **MacOS**: `~/Library/Detox/device.registry.state.lock`\n- **Linux**: `~/.local/share/Detox/device.registry.state.lock`\n- **Windows**: `%LOCALAPPDATA%/data/Detox/device.registry.state.lock` or `%USERPROFILE%/Application Data/Detox/device.registry.state.lock`\n\n#### Persisting the Lock File\n\nBy default, once all workers finish their test runs, Detox will delete the lock file. Under certain conditions, you may want to persist the lock file. Use the `--keepLockFile` flag to disable automatic deletion.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.RunningLocally.md",
    "content": "---\nid: running-locally\nslug: guide/running-locally\ntitle: Running Locally\nsidebar_label: Running Locally\n---\n\n## Running Locally\n\nIf your app is ready and does not require any active development, you can write your tests using this workflow and run them locally on your machine. This is convenient for developing your test suite without actively developing your app.\n\nThis is the basic workflow. It takes your app executable and runs Detox tests against it.\n\n### Step 1: Build Your App\n\nDetox is going to need the executable for your app. This means we need to build it first. We’re going to use the Detox command line tools to build the app. During the installation, we’ve specified the actual build command line inside `package.json` under the `detox` configuration section.\n\nBuild the app by typing in terminal inside your project root:\n\n```sh\ndetox build\n```\n\n### Step 2: Run Detox Tests\n\nType the following inside your project root:\n\n```sh\ndetox test\n```\n\nThis will use Detox to find the app executable we’ve built in step 1, install it on a simulator and run Detox tests against it.\n\n**Note:** If you have multiple configurations, you will need to specify the configuration to test.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.RunningOnCI.md",
    "content": "---\nid: running-on-ci\nslug: guide/running-on-ci\ntitle: Running on CI\nsidebar_label: Running on CI\n---\n\n## Running on CI\n\n> Disclaimer: This guide is focused on iOS (i.e. lacking info about Android) and is generally out of date.\n\nWhen your test suite is finally ready, it should be set up to run automatically on your CI server on every git push. This will alert you if new changes to the app break existing functionality.\n\nRunning Detox on CI is not that different from running it locally. There are two main differences:\n\n- You should test a release build rather than a debug build\n- Tell Detox to shut down the simulator when test is over\n\n### Step 1: Prepare a Release Configuration for Your App\n\nWe will need to create a [release device configuration for Detox](config/overview.md#device-configurations) inside `package.json` under the `detox` section.\n\n**Example:**\n\n```json\n\"detox\": {\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        \"type\": \"iPhone 12 Pro Max\"\n      }\n    }\n  },\n  \"apps\": {\n    \"ios.release\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/example.app\",\n      \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build\",\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.release\"\n    }\n  }\n}\n```\n\n> TIP: Notice that the name `example` above should be replaced with your actual project name.\n\n### Step 2: Add `build` and `test` Commands to Your CI Script\n\nAssuming your CI is executing some sort of shell script, add the following commands that should run inside the project root:\n\n```sh\ndetox build --configuration ios.sim.release\ndetox test --configuration ios.sim.release --cleanup\n```\n\n> **Tip:** Adding `--cleanup` to the test command will make sure detox exits cleanly by shutting down the simulator when the test is over.\n\n### Running Android Tests on CI\n\nSetting up a CI environment capable of running Android tests isn’t as trivial. Fortunately, we’ve written all about it in a [blogpost on medium!](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f)\n\n### Appendix\n\n#### • Running Detox on [Travis CI](https://travis-ci.org/)\n\nDetox’s own build is running on Travis, check out Detox’s [`.travis.yml`](https://github.com/wix/Detox/tree/master/.travis.yml) file to see how it’s done.\n\nThis is a simple example configuration to get you started with Detox on Travis:\n\n```yaml\nlanguage: objective-c\nosx_image: xcode8.3\n\nbranches:\n  only:\n  - master\n\nenv:\n  global:\n  - NODE_VERSION=stable\n\ninstall:\n- brew tap wix/brew\n- brew install applesimutils\n- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash\n- export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"\n- nvm install $NODE_VERSION\n- nvm use $NODE_VERSION\n- nvm alias default $NODE_VERSION\n\n- npm install react-native-cli --global\n- npm install detox-cli --global\n\nscript:\n- detox build --configuration ios.sim.release\n- detox test --configuration ios.sim.release --cleanup\n\n```\n\n#### • Running Detox on [Bitrise](https://www.bitrise.io/)\n\nBitrise is a popular CI service for automating React Native apps. If you are looking to get started with Bitrise, check out [this](https://blog.bitrise.io/post/how-to-set-up-a-react-native-app-on-bitrise) guide.\n\nYou can run Detox on Bitrise by creating a new workflow. Below is an example of the Bitrise `.yml` file for a workflow called `tests`.\n\nAdditionally, you can use a [webhook](https://devcenter.bitrise.io/en/apps/webhooks/adding-incoming-webhooks.html) on Bitrise to post the build status directly into your Slack channel.\n\n```yml\n---\nformat_version: 1.1.0\ndefault_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git\ntrigger_map:\n- push_branch: \"*\"\n  workflow: tests\nworkflows:\n  _tests_setup:\n    steps:\n    - activate-ssh-key: {}\n    - git-clone:\n        inputs:\n        - clone_depth: ''\n        title: Git Clone Repo\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            npm cache verify\n\n            npm install\n        title: Install NPM Packages\n    before_run:\n    after_run:\n  _detox_tests:\n    before_run: []\n    after_run: []\n    steps:\n    - npm:\n        inputs:\n        - command: install -g detox-cli\n        title: Install Detox CLI\n    - npm:\n        inputs:\n        - command: install -g react-native-cli\n        title: Install React Native CLI\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            brew tap wix/brew\n            brew install applesimutils\n        title: Install Detox Utils\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox build --configuration ios.sim.release\n        title: Detox - Build Release App\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox test --configuration ios.sim.release --cleanup\n        title: Detox - Run E2E Tests\n  tests:\n    before_run:\n    - _tests_setup\n    - _detox_tests\n    after_run: []\n```\n\n#### • Running Detox on [GitLab CI](https://docs.gitlab.com/ee/ci/README.html) - Android Only\n\nGitLab is also a popular git management service which also include a built-in CI system. They provide free runner up to 2000 minutes for private projects, however, the runners provided by them cannot be used to run Detox due to the lack of KVM support (in order to run Android Emulators). You can, instead, [create your own runner](https://docs.gitlab.com/ee/ci/runners/README.html) with KVM support. Some example of cloud providers offering this are: [Digital Ocean](https://www.digitalocean.com/products/droplets/), AWS (with [C5 instance types](https://aws.amazon.com/ec2/instance-types/c5/)), [Google Cloud](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances) and [Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/nested-virtualization)\n\nOne example of such job can be:\n\n```yml\ndetox_e2e:\n  stage: test\n  image: reactnativecommunity/react-native-android\n  variables:\n  before_script:\n    - npm install envinfo detox-cli --global && envinfo\n    # Increase file watcher limit, see more here: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details\n    - echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p\n    - mkdir -p /root/.android && touch /root/.android/repositories.cfg\n    # The Dockerimage provides two paths for sdkmanager and avdmanager, which the defaults are from $ANDROID_HOME/cmdline-tools\n    # That is not compatible with the one that Detox is using ($ANDROID_HOME/tools/bin)\n    - echo yes | $ANDROID_HOME/tools/bin/sdkmanager --channel=0 --verbose \"system-images;android-27;default;x86_64\"\n    # Nexus 6P, API 27, XXXHDPI\n    - echo no | $ANDROID_HOME/tools/bin/avdmanager --verbose create avd --force --name \"Nexus6P\" --package \"system-images;android-27;default;x86_64\" --sdcard 200M --device 11\n    - adb start-server\n  script:\n    - npx detox build -c android.emu.release.ci\n    - npx detox test -c android.emu.release.ci --headless\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.ThirdPartyDrivers.md",
    "content": "---\nid: third-party-drivers\nslug: guide/third-party-drivers\ntitle: Third-Party Drivers\nsidebar_label: Third-Party Drivers\n---\n\n## Third-Party Drivers\n\nDetox comes with built-in support for running on Android and iOS by choosing a driver type in your Detox configurations.\nFor example, the following configuration uses the \"ios.simulator\" driver.\n\n```json\n{\n  \"ios.sim\": {\n    \"type\": \"ios.simulator\",\n    \"device\": \"...\",\n    \"binaryPath\": \"bin/YourApp.app\"\n  }\n}\n```\n\nWhile Detox technically supports Android devices and iOS simulators out of the box, devices running other platforms such as [Web](https://github.com/necolas/react-native-web) or [Windows](https://github.com/microsoft/react-native-windows) can be targeted.\n\nIf your app targets a third-party platform, you may switch to use a [third-party driver](#how-to-use-a-third-party-driver) to run your tests on said platform. If one doesn’t already exist, you can [write your own](#Writing-a-new-third-party-driver).\n\n### How to Use a Third-party Driver\n\nCheck to see if a [third-party driver](#existing-third-party-drivers) already exists for the platform you wish to target. Mostly likely, the driver will have setup instructions.\n\nOverall the setup for any third party driver is fairly simple.\n\n1. Add the driver to your `package.json` with:\n\n   ```bash npm2yarn\n   npm install --save-dev detox-driver-package\n   ```\n\n1. Add a new Detox configuration to your existing configurations with the `type` set to driver’s package name.\n\n   ```diff\n   +  \"thirdparty.driver.config\": {\n   +    \"type\": \"detox-driver-package\",\n   +    \"binaryPath\": \"bin/YourApp.app\",\n   +  }\n   ```\n\n1. Run Detox while specifying the name of your new configuration:\n\n   ```sh\n   detox test --configuration thirdparty.driver.config\n   ```\n\n### Writing a New Third-party Driver\n\n#### Anatomy of the Drivers\n\nThe architecture of a driver is split into a few different pieces; Understanding the [overall architecture of Detox](Introduction.HowDetoxWorks.md#Architecture) will help with this section.\n\n_Components running in the context of the test logic execution on the Node.js process on the host computer:_\n\n1. **The Device Drivers layer:** The layer contains a collection of drivers, implementing - mostly, though not exclusively, the platform-specific details for the Detox [`device` object](https://github.com/wix/Detox/blob/master/docs/APIRef.DeviceObjectAPI.md) that is exposed in the Detox tests.\n   The implementation is responsible for managing devices your tests will run on, in terms of device allocation, app installation user interactions (e.g. taps) execution and so on.\n1. **Matchers:** code powering the `expect`, `element`, `waitFor` and `by` globals in your tests.\n   In essence, it translates and sends test-logic commands (such as taps and assertions) over the network to the device on which your tests are running. In turn, the device natively performs these commands.\n\n_The component running on the device being tested, injected into the test app:_\n\n1. **Native Client:** The driver client communicates with the server over\n   websocket where it receives information from the serialized matchers, and expectations, and also sends responses\n   back of whether each step of your test succeeds or fails. Typically, a device client will use an underlying library specific\n   to the platform at hand to implement the expectations.\n\n#### Implementation Details\n\nIn order to introduce a third-party Driver, there is a set of core classes you must implement - each responsible for a different Detox concern:\n\n- Allocation: The process of launching / selecting a device over which the tests would run.\n- Pre-validation: The checkup of the execution-environment (e.g. verifying the Android SDK is installed).\n- Artifact handlers registration: The process where platform-based artifacts generation handlers are registered (e.g. handlers for taking screenshots, which are different between the Android and iOS platforms).\n- Runtime: The _de facto_ execution of test logic.\n- Matchers: The matching of visible elements and visibility assertion.\n\nTo understand the exact contract of these classes, refer to [`examples/demo-plugin/driver.js`](https://github.com/wix/Detox/blob/master/examples/demo-plugin/driver.js) for a dummy implementation, or to [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer) for an actual implementation of such as driver.\n\nVery roughly speaking, this is the expected skeletal implementation:\n\n```js\nconst DeviceDriverBase = require('detox/src/devices/runtime/drivers/DeviceDriverBase');\n\nclass Cookie {\n  constructor(id) {\n    this.id = id; // hold any info necessary in order to identify the associated device\n  }\n}\n\nclass MyNewAllocationDriver {\n  constructor(deps) {\n    this.emitter = deps.eventEmitter;\n  }\n  \n  async allocate(deviceConfig) {\n    // ...\n    return new Cookie(id); // This is where a cookie is formed once for the entire process\n  }\n  \n  async free(cookie, options) {\n    // ...\n  }\n}\n\nclass MyNewEnvValidator {\n  validate() {\n    // ...\n  }\n}\n\nclass MyNewArtifactsProvider {\n  declareArtifactPlugins() {\n    // ...\n  }\n}\n\nclass MyNewRuntimeDriver extends DeviceDriverBase {\n  constructor(deps, cookie) {\n    // ...\n  }\n  \n  // ...\n}\n\nclass MyExpect {\n  // ...\n}\n\n\nmodule.exports = MyNewDriver;\n```\n\n### Existing Third-party Drivers\n\n- [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer)\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Guide.Uninstalling.md",
    "content": "---\nid: uninstalling\nslug: guide/uninstalling\ntitle: Uninstalling Detox\nsidebar_label: Uninstalling Detox\n---\n\n## Uninstalling Detox\n\nInstalling and using Detox implies certain side effects: cloned devices, cache files, state files, temporary files, etc.\n\nThis checklist might come in handy whenever you have to make a clean uninstallation after using Detox.\n\n### Detox Framework Cache\n\nEvery install of Detox also triggers a `postinstall` script in its `package.json`, which builds (or unpacks) `Detox.framework` into `~/Library/Detox`.\n\nYou can either delete the folder manually:\n\n```sh\nrm -rf ~/Library/Detox\n```\n\nor run:\n\n```sh\ndetox clean-framework-cache\n```\n\n### Test Session State\n\nOn every test run, Detox rewrites a few temporary files in `DETOX_LIBRARY_ROOT_PATH`, i.e.:\n\n1. The respective iOS and Android lockfiles to tell apart the busy and the available devices for use with multiple workers:\n   - `device.registry.state.lock`\n   - `android-device.registry.state.lock`.\n1. A plain text file with the line-separated list of last failed test files to rerun via `-R <retries-count>` CLI feature:\n   - `last-failed.txt`.\n\nThe location of `DETOX_LIBRARY_ROOT_PATH` may vary depending on the operating system:\n\n- macOS:\n  - `~/Library/Detox`.\n- Linux:\n  - `$XDG_DATA_HOME/Detox`, if `$XDG_DATA_HOME` is defined;\n  - `~/.local/share/Detox`, otherwise.\n- Windows:\n  - `%LOCALAPPDATA%\\data\\Detox`, if `%LOCALAPPDATA%` is defined;\n  - `%USERPROFILE%\\Application Data\\Detox`, otherwise.\n\n### Cloned Simulators (macOS)\n\nTo support the \"multiple workers\" feature on iOS, Detox clones simulator instances when there aren’t enough available ones.\nThe autogenerated simulators have names with `-Detox` suffix appended, so you can easily spot them with:\n\n```sh\nxcrun simctl list | grep \"-Detox\"\n```\n\nTo delete a simulator, you can use:\n\n```sh\nxcrun simctl delete <uuid>\n```\n\n### Remnants of Artifacts\n\nForced exits may result in leaving some temporary files behind.\n\n#### iOS\n\nTo ensure there are no temporary artifact files (logs, screenshots, etc.), you can run:\n\n```sh\nrm -rf $TMPDIR/*.detox.*\n```\n\nIf you wish to clean up your iOS simulators from the installed apps and other customizations, just run the erase procedure for the relevant ones:\n\n```sh\nxcrun simctl erase <uuid>\n```\n\n#### Android\n\nThe advice for iOS applies to the Android virtual devices as well. To wipe user files on a specific AVD, run:\n\n```sh\nemulator -avd <your_AVD> -wipe-data\n```\n\nIf you have to clean temporary Detox files from an individual booted device, look out for files like `11159175_0.log` in `/sdcard` folder.\nYou can try deleting them using a simple wildcard like below or use your own:\n\n```sh\nadb -s <emulator-port> shell rm -rf /sdcard/*_*.* \n```\n\n### Detox CLI\n\nIf you have installed the official CLI wrapper for Detox, then make sure to uninstall it as well:\n\n```bash npm2yarn\nnpm uninstall detox-cli --global\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.Android.md",
    "content": "---\nid: android\nslug: introduction/android\ntitle: Detox for Android\nsidebar_label: Detox for Android\n---\n\n<!-- markdownlint-configure-file { \"no-trailing-punctuation\": 0 } -->\n\n## Detox for Android\n\n### Breaking Changes :warning:\n\n**If you are installing Detox for Android for the first time, you can skip over to the setup section.**\n\n> Follow our [Migration Guide](Guide.Migration.md) for instructions on how to upgrade from older versions.\n\n- **In version 11 we switched to using Android Espresso of Android’s new [androidx.\\*  support libraries](https://developer.android.com/jetpack/androidx/).** We did this in order to stay up to date with Google’s latest features and bug fixes, in the hopes of using them to improve our own Android support (which gets better every day!).\n\n- **In version 10, we’ve made [Kotlin](https://kotlinlang.org/) mandatory for integrating Detox into your Android project.** In the very least, you must include the Kotlin Gradle plugin in your project, as we shall see later on. Nevertheless, this is a breaking change so bear that in mind when upgrading. In any case, worry not of the impact on your app, as - unless you effectively use Kotlin in your own native code, **there will be no impact on the final APK**, in terms of size and methods count.\n\n- **As of version 7** we require Android Gradle plugin 3.0.0 or newer. This is a breaking change that makes it impossible to support previous Android Gradle plugin versions.\n\n  <https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html>\n\n  For older Android Gradle plugin support use `detox@6.x.x` instead ([previous setup guide here](https://github.com/wix/detox/blob/97654071573053def90e8207be8eba011408f977/docs/Introduction.Android.md)).\n\n**Note: As a rule of thumb, we consider all old major versions discontinued; We only support the latest Detox major version.**\n\n### Setup :gear:\n\n#### 1. Preliminary\n\nRun through the basic steps of the [Getting Started guide](introduction/getting-started.md), such as the environment and tools setup.\n\n#### 2. Apply Detox Configuration\n\nWhether you’ve selected to apply the configuration in a  `.detoxrc.json` or bundle it into your project’s `package.json` (under the `detox` section), this is what the configuration should roughly look like for Android:\n\n```json\n{\n  \"devices\": {\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"Pixel_API_28\"\n      }\n    }\n  },\n  \"apps\": {\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/debug/app-debug.apk\",\n      \"build\": \"cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..\"\n    },\n    \"android.release\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/release/app-release.apk\",\n      \"build\": \"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..\"\n    }\n  },\n  \"configurations\": {\n    \"android.emu.debug\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.debug\"\n    },\n    \"android.emu.release\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.release\"\n    }\n  }\n}\n```\n\n> For a comprehensive explanation of Detox configuration, refer to the [dedicated API-reference guide](config/overview.md).\n\nPay attention to `-DtestBuildType`, set either to `debug` or `release` according to the main APK type.\n\nFollowing device types could be used to control Android devices:\n\n- `android.emulator`. Boot stock Android-SDK emulator (AVD) with provided `name`, for example `Pixel_API_28`.\n\n- `android.attached`. Connect to already-attached android device. The device should be listed in the output of `adb devices` command under provided `name`.\n  Use this type to connect to Genymotion emulator.\n  The `avdName` property accepts a regular expression pattern that allows to specify the pool of device candidates to which you wish to connect. Use this property to run tests in parallel on multiple attached devices.\n\nFor a complete, working example, refer to the [Detox example app](https://github.com/wix/Detox/tree/master/examples/demo-react-native/detox.config.js).\n\n##### Using product flavors\n\nIf you are using custom [`productFlavors`](https://developer.android.com/studio/build/build-variants#product-flavors) the config needs to be applied a bit differently. This example shows how a `beta` product flavor would look for both debug and release build types:\n\n```json\n\"detox\" : {\n  \"devices\": {\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"Pixel_API_28\"\n      }\n    }\n  },\n  \"apps\": {\n    \"android.beta.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/beta/debug/app-beta-debug.apk\",\n      \"build\": \"cd android && ./gradlew assembleBetaDebug assembleBetaDebugAndroidTest -DtestBuildType=debug && cd ..\"\n    },\n    \"android.beta.release\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"android/app/build/outputs/apk/beta/release/app-beta-release.apk\",\n      \"build\": \"cd android && ./gradlew assembleBetaRelease assembleBetaReleaseAndroidTest -DtestBuildType=release && cd ..\"\n    }\n  },\n  \"configurations\": {\n    \"android.emu.beta.debug\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.beta.debug\"\n    },\n    \"android.emu.beta.release\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.beta.release\"\n    }\n  }\n}\n```\n\n#### 3. Add the Native Detox dependency\n\n> **Starting Detox 12.5.0, Detox is shipped as a precompiled `.aar`.**\n> To configure Detox as a _compiling dependency_, nevertheless -- refer to the _Setting Detox up as a compiling dependency_ section at the bottom.\n\nIn your _root_ `buildscript` (i.e. `android/build.gradle`), register both `google()` _and_ detox as repository lookup points in all projects:\n\n```groovy\n// Note: add the 'allproject' section if it doesn’t exist\nallprojects {\n    repositories {\n        // ...\n        google()\n        maven {\n            // All of Detox' artifacts are provided via the npm module\n            url \"$rootDir/../node_modules/detox/Detox-android\"\n        }\n    }\n}\n```\n\nIn your app’s `buildscript` (i.e. `android/app/build.gradle`) add this in `dependencies` section:\n\n```groovy\ndependencies {\n    // ...\n    androidTestImplementation('com.wix:detox:+')\n}\n```\n\nalso ensure that this line appears in `dependencies`:\n\n```groovy\ndependencies {\n    // ...\n    implementation 'androidx.appcompat:appcompat:1.1.0' // (check what the latest version is!)\n}\n```\n\n... and add this to the `defaultConfig` subsection:\n\n```groovy\nandroid {\n  // ...\n\n  defaultConfig {\n      // ...\n      testBuildType System.getProperty('testBuildType', 'debug')  // This will later be used to control the test apk build type\n      testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n  }\n}\n```\n\nPlease be aware that the `minSdkVersion` needs to be at least 18.\n\n#### 4. Add Kotlin\n\nIf your project does not already support Kotlin, add the Kotlin Gradle-plugin to your `classpath` in the root build-script (i.e.`android/build.gradle`):\n\n```groovy\nbuildscript {\n    // ...\n    ext.kotlinVersion = '1.3.0' // (check what the latest version is!)\n    dependencies {\n        // ...\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n    }\n}\n```\n\n_Note: most guides advise of defining a global `kotlinVersion` constant - as in this example, but that is not mandatory._\n\n_**Note that Detox has been tested for version 1.1.0 of Kotlin, and higher!**_\n\n#### 5. Create a Detox-Test Class\n\nDetox requires a dummy implementation of a single Android-native test.\n\n1. Add a new file to your project, under this path and name: `android/app/src/androidTest/java/com/[your.package]/DetoxTest.java`. **Double-check that the path is correct!**\n1. Copy & paste the content of the equivalent file from [the detox example app for RN](https://github.com/wix/Detox/tree/master/examples/demo-react-native/android/app/src/androidTest/java/com/example/DetoxTest.java), into it. **Don’t forget to change the package name to your project’s package name!**\n\n#### 6. Enable clear-text (unencrypted) traffic for Detox\n\nStarting from Android SDK API level 28, Google have disabled all clear-text network traffic by default. Namely, unless explicitly configured, all of your application’s outgoing unencrypted traffic (i.e. non-TLS using HTTP rather than HTTPS) is blocked by the device.\n\nFor Detox to work, Detox test code running on the device must connect to the test-running host through its virtual localhost interface<sup>(\\*)</sup> using simple HTTP traffic. Therefore, the following network-security exemption configuration must be applied --\n\n_In an XML resource file, e.g. `android/app/src/main/res/xml/network_security_config.xml`:_\n\n```xml\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n    <domain-config cleartextTrafficPermitted=\"true\">\n        <domain includeSubdomains=\"true\">10.0.2.2</domain>\n        <domain includeSubdomains=\"true\">localhost</domain>\n    </domain-config>\n</network-security-config>\n```\n\n_In the app’s `AndroidManifest.xml`_\n\n```xml\n<manifest>\n  <application\n        ...\n        android:networkSecurityConfig=\"@xml/network_security_config\">\n  </application>\n</manifest>\n```\n\n> _Refer to the [Detox example app](https://github.com/wix/Detox/tree/master/examples/demo-react-native/android/app/src/main) for an example on how this is effectively implemented._\n\n**Note: if properly configured, this in no way compromises the security settings of your app.**\n\nFor full details, refer to [Android’s security-config guide](https://developer.android.com/training/articles/security-config), and the dedicated article in the [Android developers blog](https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html).\n\n> _(\\*) 10.0.2.2 for Google emulators, 10.0.3.2 for Genymotion emulators._\n\n#### 7. ProGuard (Minification, Obfuscation)\n\nIn apps running [minification using ProGuard](https://developer.android.com/studio/build/shrink-code), in order for Detox to work well on release builds, please enable some Detox ProGuard configuration rules by applying the custom configuration file on top of your own. Typically, this is defined using the `proguardFiles` statement in the minification-enabled build-type in your `app/build.gradle`:\n\n```groovy\n    buildTypes {\n        // 'release' is typically the default proguard-enabled build-type\n        release {\n            minifyEnabled true\n\n            // Typical pro-guard definitions\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n            // Detox-specific additions to pro-guard\n            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n        }\n    }\n\n```\n\n:warning: **Note:** In order for Detox to be able to work properly, in `proguard-rules-app.pro`, it effectively declares rules that retain most of React-Native’s code (i.e. keep it unminified, unobfuscated) in your **production** APK. Though generally speaking, this should not be an issue (as React-Native is an open-source project), there are ways around that, if it bothers you. For example, running your E2E over a build-type specifically designed to run E2E tests using Detox would do the trick -- roughly, like so (in `app/build.gradle`):\n\n```groovy\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n\n            signingConfig signingConfigs.release\n        }\n        releaseE2E {\n            initWith release\n            setMatchingFallbacks('release')\n\n            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n        }\n    }\n```\n\nHere we utilize Gradle’s `initWith` to easily define `releaseE2E` in a way that is identical to the `release` build-type, with the exception of considering Detox' `proguard-rules-app.pro` in the minification process.\n\nFollowing the example, you would then have to build your app using `gradlew assembleReleaseE2E` rather than `gradlew assembleRelease` before running Detox, and instruct Detox (i.e. via `binaryPath` in the Detox configuration file) to use the APK resulted specifically by _that_ Gradle target (e.g. in `app/build/apk/releaseE2E/app-releaseE2E.apk` instead of the equivalent `app/build/apk/release/app-release.apk`).\n\n> Note: if your app contains flavors -- that makes things a bit trickier, but the approach can generally be adjusted to support that as well.\n\n**Last but not least:** If you’re having issue with Detox' ProGuard rules, please report them [here](https://github.com/wix/Detox/issues/new/choose).\nA special thanks to [@GEllickson-Hover](https://github.com/GEllickson-Hover) for reporting issues related to obfuscation in [#2431](https://github.com/wix/Detox/issues/2431).\n\n#### 8. Test Butler Support (Optional)\n\nIf, when [setting up your work environment](Introduction.AndroidDevEnv.md), you’ve selected Google emulators with an AOSP image as the test target - as recommended, **we strongly encourage** you would also integrate [Test Butler](https://github.com/linkedin/test-butler): in the very least - in order to suppress crash and ANR dialogs. They are a soft spot in UI testing on Android, all around, as - when displayed, they make the UI entirely inaccessible (and thus cause tests to fail in bulks).\n\nSetting Test Butler up for working with Detox is a bit different than explained in their guides. The process, as a whole, is twofold:\n\n1. Preinstalling the test-butler-app APK onto the test device.\n1. Integrating the test-butler-lib into your own test APK, and initializing it in a custom test-runner (as explained).\n\nThe library part can be easily achieved as explained there (i.e. by using Gradle’s `androidTestImplementation`). Same goes for initialization. As for the APK, the suggested usage of Gradle’s `androidTestUtil` is scarce when running with Detox (i.e. non-native instrumentation tests). Here’s what to do instead.\n\n> _For a complete and thorough coverage of the Test Butler integration with Detox, consider going over our [blogpost on CI execution](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f) on medium_.\n\n##### Solution 1: Prebaked Images\n\nIf you have control over the emulators' snapshots, simply download (see test-butler’s guide) and install the test-butler APK once (e.g. use `adb install -r -t path/to/test-butler-app.apk`), and save an updated version of the snapshot. This is the best solution.\n\n> Note: you will have to reiterate this if you upgrade to a newer version of Test-Butler, in the future.\n\n##### Solution 2: Dynamic Installation\n\nAssuming you have the APK available in the system, you can dynamically have Detox automatically install it in all of the running target-emulators by utilizing `utilBinaryPaths` in your Detox configuration. Example:\n\n```json\n{\n  \"devices\": {\n    \"emulator.oss\": {\n      \"type\": \"android.emulator\",\n      \"device\": \"...\",\n      \"utilBinaryPaths\": [\"relative/path/to/test-butler-app-2.2.1.apk\"],\n    }\n  }\n}\n```\n\n> Refer to our [configuration guide](config/overview.md) for further details on `utilBinaryPaths`.\n\nAs per _making_ the APK available - for that, we have no really good solution, for the time being (but it’s in the works). A few options might be:\n\na. In a custom script, have it predownloaded from Maven directly, as suggested in the Test Butler guide. For example (on a Mac / Linux):\n\n```sh\ncurl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk\n```\n\n_Jests' [global-setup](https://jestjs.io/docs/en/configuration#globalsetup-string) is a recommend place for those kinds of things._\n\n> Should you decide to go this path, we recommend you add `./temp/test-butler-app.apk` to the relevant `.gitignore`.\n\nb. (Discouraged) Add it to your source control (e.g. git), as part of the repository.\n\n### Setting Detox up as a compiling dependency\n\nThis is an **alternative** to the setup process described under the previous section, on adding Detox as a dependency.\n\nIn your project’s `settings.gradle` add:\n\n```groovy\ninclude ':detox'\nproject(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')\n```\n\nIn your _root_ `buildscript` (i.e. `android/build.gradle`), register `google()` as a repository lookup point in all projects:\n\n```groovy\n// Note: add the 'allproject' section if it doesn’t exist\nallprojects {\n    repositories {\n        // ...\n        google()\n    }\n}\n```\n\nIn your app’s `buildscript` (i.e. `android/app/build.gradle`) add this in `dependencies` section:\n\n```groovy\ndependencies {\n   // ...\n    androidTestImplementation(project(path: \":detox\"))\n}\n```\n\nIn your app’s `buildscript` (i.e. `android/app/build.gradle`) add this to the `defaultConfig` subsection:\n\n```groovy\nandroid {\n  // ...\n\n  defaultConfig {\n      // ...\n      testBuildType System.getProperty('testBuildType', 'debug')  // This will later be used to control the test apk build type\n      testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n      missingDimensionStrategy 'detox', 'full'\n  }\n}\n```\n\nPlease be aware that the `minSdkVersion` needs to be at least 18.\n\n### Troubleshooting\n\nPlease refer to [troubleshooting guide about build issues](Troubleshooting.BuildingTheApp.md#android) for assistance.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.AndroidDevEnv.md",
    "content": "---\nid: android-dev-env\nslug: introduction/android-dev-env\ntitle: Setting Up an Android Development & Testing Environment\nsidebar_label: Setting Up an Android Development & Testing Environment\n---\n\n## Setting Up an Android Development & Testing Environment\n\nThis guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) -- be it on a personal, _local_ computer, or a powerful CI machine.\n\nNote that running automated UI tests is _not the same_ as developing Android apps. Hence, you may find yourself not 100% aligned with the recommendations here, and should consider being so.\n\n## Java Setup\n\nThis is the most basic step in the process, as without a proper Java SDK installed, nothing Android-ish works -- at least not from command-line, which is mandatory for executing `Detox`.\n\n_The bottom line is that **Android needs Java installed**. If you want to run with React Native 66 and Android 12 then it needs to be at least Java 11, otherwise you should have Java 8._\n\nTo check for your real java-executable’s version, in a command-line console, run:\n\n```sh\njava -version\n```\n\nWhat needs to be verified is that `java` is in-path and that the output contains something like this:\n\n```sh\njava version \"11.x.x\"\n...\n```\n\nor, if you have [openjdk](https://techoral.com/blog/openjdk-developers-guide.html) installed:\n\n```sh\nopenjdk version \"11.0.2\" 2019-01-1\n...\n```\n\n**Namely, that the version is `11.x.x`**.\n\n> Note: Do not be confused by the Java version potentially used by your browsers, etc. For `Detox`, what the command-line sees is what matters.\n\n---\n\nIf `java -version` yields an error, it is likely that `java` is either not in your path or not even installed at all. To try to understand which of the two is true, use [this guide](https://www.java.com/en/download/help/path.xml).\n\nIf otherwise the version is simply wrong, try these course of actions:\n\n- On MacOS, in particular, Java comes from both the OS _and_ possibly other installers such as `homebrew`. That can really get things tangled up. To mitigate:\n  - Use one of the options suggested in this [Stack Overflow post](https://stackoverflow.com/questions/52524112/how-do-i-install-java-on-mac-osx-allowing-version-switching/52524114#52524114).\n  - Install OpenJDK 11 on top of the existing versions ([how to check?](https://medium.com/notes-for-geeks/java-home-and-java-home-on-macos-f246cab643bd)): <https://techoral.com/blog/java/install-openjdk-11-on-mac.html>. Consider employing the `JAVA_HOME` variable to get things to work right. _Note: This is more suitable if your environment is fairly clean, and does not contain versions from 3rd-party installers (e.g. `homebrew`)._\n- Use these refs, which might be useful:\n  - <https://java.com/en/download/faq/java_mac.xml#version>\n  - <https://www.java.com/en/download/help/version_manual.xml>\n\n## Android SDK\n\nIf you have Android Studio installed - as most of us do, then the SDK should be available for you somewhere on your machine<sup>\\*</sup>. However, for CI agents -- possibly running with no GUI, or if you simply don’t want the somewhat bloated piece of software on your computer, it is possible to simply download the SDK and tool-set, purely. Both cases are covered in Google’s [Android guide about Android Studio](https://developer.android.com/studio/). For the pure-tools option, refer to the `Command line tools only` section at the bottom.\n\nFor more help on setting the SDK up, [this guide might be helpful](https://www.androidcentral.com/installing-android-sdk-windows-mac-and-linux-tutorial).\n\nWhatever option you choose, and whichever platform you’re running on (Mac, Linux, Windows), we strongly recommend that eventually you would have 2 additional things set up:\n\n- The path to the SDK’s root directory is set into the `ANDROID_SDK_ROOT` [environment variable](https://developer.android.com/studio/command-line/variables).\n- The path to the SDK’s root directory is bundled into the global [`PATH`](https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them) on your computer.\n\n_<sup>\\* Inspect the content of your `ANDROID_SDK_ROOT` and `ANDROID_HOME` environment variables.</sup>_\n\n## Android (AOSP) Emulators\n\nMobile-apps' automation needs an Android device to run on. If you haven’t already done so, you should  [set up an Emulator](https://developer.android.com/studio/run/emulator). But, wait - don’t go and install the default one: read through, first.\n\nWe’ve long proven that for automation - which requires a stable and deterministic environment, Google’s emulators running with Google APIs simply don’t deliver what’s needed. Be it the preinstalled Google play-services - which tend to take up a lot of CPU, or even Google’s `gboard` Keyboard - which is full-featured but overly bloated: These encourage flakiness in tests, which we are desperate to avoid in automation.\n\nFortunately, the Android team at Google offers a pretty decent alternative: **AOSP emulators** (Android Open-Source Project). While possibly lacking some of the extended Google services, and a bit less fancy overall, **we strongly recommend** to strictly use this flavor of emulators for running automation/Detox tests. They can be installed alongside regular emulators.\n\n_Here’s a visual comparison between the two - an SDK 28 (Android 9) AOSP emulator (left) vs. an emulator with Google APIs installed (right):_\n\n<img src=\"img/android/aosp-vs-googleapi.png\" alt=\"AOSP vs Google-API\" />\n\n### Here’s how to install them using the command line\n\nWhile it’s possible to do this using Android Studio, we’ll focus on the command line, as it is also good for _headless_ CI machines.\n\n1. Locate your 'Android home' folder - typically set in the `ANDROID_HOME` environment variable, or in its successor - `ANDROID_SDK_ROOT`. If `ANDROID_HOME` isn’t set, either set it yourself or run the following commands after `cd`-ing into the home folder.\n\n1. Preliminary: Upgrade your `emulator` executable to the latest version.\n   _Note: It is OK if the emulator’s version is not aligned with the SDK or platform-tools' version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n   ```sh\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install emulator\n   ```\n\n:::note\nIn previous Android Studio versions, the SDK-Manager path was located at `$ANDROID_HOME/tools/bin/sdkmanager`. We highly recommend working with the latest version, however, in case you are working with an old version, and this command fails, try this path instead.\n:::\n\n1. Install an emulator image without Google APIs:\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \"system-images;android-28;default;x86_64\"\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses\n   ```\n\n   > - With `;android-28;`, we assumed SDK 28 here, but other APIs are supported just the same.\n   > - The `;default;` part replaces `;google_apis;`, which is the default, and is what matters here.\n   > - If you are running on a M1 you must install an arm64 architecture i.e. `system-images;android-28;default;arm64-v8a`\n\n1. Create an emulator (i.e. AVD - Android Virtual Device):\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_28_AOSP -d pixel --package \"system-images;android-28;default;x86_64\"\n   ```\n\n   > - `Pixel_API_28_AOSP` is just a suggestion for a name. Any name can work here, even `Pixel_API_28` - but you might have to delete an existing non-AOSP emulator, first. In any case, the name used in Detox configuration (typically in `package.json`) should be identical to this one.\n   > - `-d pixel` will install an emulator with the specs of a Pixel-1 device. Other specs can be used.\n   > - `--package` is the most important argument: be sure to use the same value as you did in part 2, above, with `;default;`.\n   >\n   > Run `avdmanager create --help` for the full list of options.\n\n1. Launch the emulator:\n\nThis isn’t mandatory, of course, but it’s always good to launch the emulator at least once before running automated tests. The section below will discuss optimizing emulators bootstrapping.\n\nAt this point, you should be able to launch the emulator from Android Studio, but that can also be done from a command line console, as explained in the [cheatsheet below](#locating-the-avds-home-directory).\n\n> See [this guide](https://developer.android.com/studio/run/emulator-commandline) for full details on the `emulator` executable.\n\n### Installing from Android Studio\n\nWe won’t go into all the details but once the proper image is installed using the `sdkmanager`, the option becomes available in the AVD creation dialog  (see `Target` column of the Virtual Device Configuration screen below):\n\n![SDK manager in AS](img/android/aosp-image-as.png)\n\n![Install AOSP in AS](img/android/install-aosp-as.png)\n\nAlso, be sure to upgrade your emulator executable to the latest version: If it isn’t up-to-date, you will get an \"Update Available\" message under the _status_ column, instead of \"Installed\":\n\n![Upgrade emulator in AS](img/android/upgrade-emulator-as.png)\n\n**Note:** _It is OK if the emulator’s version is not aligned with the SDK or platform-tools' version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n## Emulator Quick-Boot\n\nIf the system allows saving a state (for example, in personal computers or a CI system that can start from prebaked images you can configure), we highly and strongly recommend setting up quick-boot snapshots for any emulator that is used for testing automation.\n\nQuick-boot saves significant time otherwise wasted when emulators cold-boot from scratch. The concept becomes more prominent in environments capable of parallel-executing tests in multiple, concurrently running emulators (as when [Detox is run with multiple Jest workers](Guide.Jest.md)).\n\nThis is something that we actually recommend applying in the emulator itself rather than using command-line, but we’ll include both options.\n\nIn any case, the general principle we’re going to instruct is as follows:\n\n1. Enable auto-save for an installed / running emulator.\n1. Launch it, and, when stable, terminate -- a snapshot is saved as a result.\n1. Disable auto-save, so that future, test-tainted snapshots won’t be saved.\n\n### Setting up a quick-boot snapshot from the Emulator\n\nStart by launching a freshly baked emulator. Wait for it to go stable.\n\nWhen running, go to settings (3 dots in the sidebar) > `Snapshots` > `Settings` tab. If not already set, select `Yes` in the `auto-save` option. This should prompt for a restart -- choose `Yes`. The emulator should restart **and save a snapshot.**\n\n<img src=\"img/android/snapshot-autosave.png\" alt=\"Emulator auto-save menu\" />\n\nDo this again after the emulator is back up, but set `No` in the `auto-save` option. Allow it to restart yet again: it will immediately boot into the state saved as a snapshot earlier.\n\nYou can also try these as alternative sources for this:\n\n- [Snapshots in Google Developers page](https://developer.android.com/studio/run/emulator#snapshots) for full details on snapshots.\n- [Highly detailed blog post](https://devblogs.microsoft.com/xamarin/android-emulator-quick-boot/)\n\n### Setting up a quick-boot snapshot from command-line\n\nThis is a bit more difficult, but is also applicable even for UI-less machines.\n\n1. [Locate the AVD’s `config.ini`](#locating-the-avds-home-directory)\n1. Using your favorite text editor, either change or add these key-value sets:\n\n   ```ini\n   fastboot.chosenSnapshotFile=\n   fastboot.forceChosenSnapshotBoot=no\n   fastboot.forceColdBoot=no\n   fastboot.forceFastBoot=yes\n   ```\n\n> Empirically, `forceFastBoot=yes` and `forceColdBoot=no` should be enough.\n\n1. Under the AVD’s home directory, either create or edit yet another `ini` file called `quickbootChoice.ini` with the following content:\n\n   ```ini\n   saveOnExit = true\n   ```\n\n1. Now that everything is in place, [launch your emulator](#booting-an-emulator-via-command-line) once (in verbose mode) and wait for it to fully load. Then, shut it down, and make sure the [state has been saved](#verifying-the-emulators-quick-boot-snapshot-has-been-saved).\n\n1. Last but not least, go back to `quickbootChoice.ini` and now switch to:\n\n   ```ini\n   saveOnExit = false\n   ```\n\n### Disclaimer\n\nAfter upgrading the emulator’s binary to a newer version, it usually considers all existing snapshots invalid.\n\nThis can be addressed by deleting and recreating the snapshots as explained, or by recreating the AVD’s altogether.\n\n## Cheatsheet\n\n### Locating the AVD’s home directory\n\nEach AVD generated by the Android tools gets its own directory where associated content is stored:\n\n- **Configuration file (i.e. `config.ini`)**\n- Snapshot images\n- SD-card content\n\nto name a few.\n\nOn Mac machines, the AVD directory typically maps to:\n\n```sh\n$HOME/.android/avd/<AVD Name>.avd/\n```\n\n_(for example: `/Users/root/.android/avd/Pixel_API_28_AOSP.avd/`)_\n\nThe path should be similar on Linux machines, even though `$HOME` isn’t `/Users/root` but typically `/home/root` _(for example: `/home/root/.android/avd/Pixel_API_28_AOSP.avd/`)._\n\n### Booting an emulator via command-line\n\n> - The following examples apply for both Mac and Linux, and should be similar on Windows.\n> - They assume the emulator’s name is `Pixel_API_28_AOSP`. If it isn’t, adjust the names accordingly:\n\n#### Shortcut for booting a verbose, visible emulator in a GUI supporting system\n\n```shell\n$ANDROID_HOME/emulator/emulator -verbose @Pixel_API_28_AOSP &\n```\n\n**Shortcut for booting a verbose, _headless_ emulator in a UI-less Linux system**\n\n```shell\n$ANDROID_HOME/emulator/emulator -verbose -no-window -no-audio -gpu swiftshader_indirect @Pixel_API_28_AOSP &\n```\n\n### Verifying the emulator’s quick-boot snapshot has been saved\n\nIf you’ve run your emulator in verbose mode from a shell, it’s easy to verify the state has been saved by following the logs. In particular, when shutting the emulator down, this log asserts the state has been saved:\n\n```plain text\nemulator: Saving state on exit with session uptime 9423 ms\n```\n\n> as a reference, when the state is _not_ saved, the typical output is:\n>\n> ```plain text\n> emulator: WARNING: Not saving state: RAM not mapped as shared\n> ```\n>\n> It can be a result of an improper configuration, or an emulator launch where the `-read-only` argument was provided.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.DesignPrinciples.md",
    "content": "---\nid: design-principles\nslug: introduction/design-principles\ntitle: Design Principles\nsidebar_label: Design Principles\n---\n\n## Design Principles\n\nTraditionally, end-to-end tests on mobile are riddled with inherent issues, making the testing process difficult and lowering ROI for developers. We believe that the only way to solve these issues at the core is by changing some of the basic principles of our approach.\n\n- **Detox does not rely on [WebDriver](https://www.selenium.dev/documentation/webdriver)** — Detox is built from the ground up to integrate with native layers of your mobile app directly. We try to avoid generic cross-platform interfaces that are often the lowest common denominator. We want to optimize per platform\n\n- **Detox does gray box, not black box** — Theoretically, it sounds better to test exactly what you ship as a black box. In practice, switching to gray box allows the test framework to monitor the app from the inside and delivers critical wins like fighting flakiness at the core\n\n- **Detox synchronizes with your app’s activity** — By being aware of what your app is doing and synchronizing with it, Detox times its actions, by default, to run only when your app is idle, meaning it has determined that your app has finished its work, such as animations, network requests, React Native load, etc. You can further read on this [here](https://github.com/wix/Detox/blob/master/docs/Troubleshooting.Synchronization.md)\n\n- **Built from the ground up for mobile apps, has first-class React Native support** — Detox is built from the ground up for native mobile and has a first-class support for React Native apps\n\n- **Expectations run on the app, not the tester process** — Traditionally, test frameworks evaluate expectations in the test script, running on Node.js. Detox evaluates expectations directly in the tested app, running on device; this enables operations that were impossible before due to performance reasons\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.HowDetoxWorks.md",
    "content": "---\nid: how-detox-works\nslug: introduction/how-detox-works\ntitle: How Detox Works\nsidebar_label: How Detox Works\n---\n\n## How Detox Works\n\nDetox is an end-to-end testing framework. This means it runs your app on an actual device/simulator and interacts with it just like a real user would. This type of testing can give a lot of confidence in your app and help automate a manual QA process.\n\nWhen a Detox test executes, you actually have two different parts running side by side:\n\n- **The mobile app itself**, usually running on a simulator/emulator. A regular native build of your app is installed and executed on the device. Your app is usually built once before the tests start running.\n\n- **The test suite**, running on Node.js, using a test runner like Jest. The tests are normally written in JavaScript. Because the tests are asynchronous in nature (every test line requires to access the app and wait for a response), the tests rely heavily on [`async`-`await`](https://ponyfoo.com/articles/understanding-javascript-async-await).\n\nThe two parts are usually running in separate processes on your machine. It is also possible to run the two parts on different machines. Communication between the two parts takes place over the network using a web socket.\n\nIn practice, to make the communication more resilient, both parts are implemented as clients and communicate with a Detox server that acts as proxy. This allows some nice behaviors like allowing one side to disconnect (during a simulator boot for example or app restart) without disconnecting the other side and losing its state.\n\n### How Detox Automatically Synchronizes With Your App\n\nOne of the key features of Detox is its ability to automatically synchronize the test execution with your app. The most annoying aspect of end-to-end tests is flakiness—tests sometimes fail without anything changing. Flakiness happens because tests are nondeterministic. Every time a test is running, things take place in a slightly different order inside your app.\n\nConsider a scenario where the app is making multiple network requests at the same time. What is the order of execution? It depends on which request completes first. This is an external concern depending on network congestion and how busy the server is.\n\nThe traditional method of dealing with flakiness is adding various `sleep()`/`waitFor()` commands throughout the test in an attempt to force a certain execution order. This is a bad practice, riddled with fragile magic values that often change if the machine running the tests becomes faster or slower.\n\nDetox tries to eliminate flakiness by automatically synchronizing your tests with the app. A test cannot continue to the next command until the app becomes idle. Detox monitors your app very closely in order to know when it’s idle. It tracks several asynchronous operations and waits until they complete. This includes:\n\n- Keeping track of all network requests that are currently in-flight and waiting until they complete\n- Keeping track of pending animations and waiting until they complete\n- Keeping track of timers and waiting until they expire or are cancelled\n- Keeping track of the React Native operations\n\n### Architecture\n\nDetox comprises the following components:\n\n- [**Tester**](https://github.com/wix/Detox/tree/master/detox/src): The testing component, running in a Node.js process on the host computer, executing the test logic. The tester is also responsible for device management and artifact collection.\n- **Detox native client ([iOS](https://github.com/wix/Detox/tree/master/detox/ios) & [Android](https://github.com/wix/Detox/tree/master/detox/android)):** A component that gets seamlessly integrated into the tested app on the tested device, right as Detox starts executing. It synchronizes with the app, matches user queries, executes user commands (e.g. taps, scrolls) and validates expectations.\n- **[Detox mediator server](https://github.com/wix/Detox/tree/master/detox/src/server)**: A small web socket server, running in a Node.js process on the host computer, used to connect between the tester and the client. Normally, the tester starts a server on a randomized session id and an available port, and sends the session and port to the client app as a launch argument.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.Workflows.md",
    "content": "---\nid: workflows\nslug: introduction/workflows\ntitle: Workflows\nsidebar_label: Workflows\n---\n\n## Workflows\n\nThere are multiple recommended ways to work with Detox and make it a part of your development process. Choose the best workflow for your needs:\n\n- [Running Tests Locally on Your Machine](Guide.RunningLocally.md) — If your app is ready and does not require any active development, you can write your tests using this workflow and run them locally on your machine. This is convenient for developing your test suite without actively developing your app.\n\n- [Developing Your App While Writing Tests](Guide.DevelopingWhileWritingTests.md) — If your app requires active development, such as adding [testID](https://facebook.github.io/react-native/docs/view.html#testid) fields for tests, this is a good workflow. It allows you to work both on your app and your tests at the same time.\n\n- [Running Tests on CI (like Travis)](Guide.RunningOnCI.md) — When your test suite is finally ready, it should be set up to run automatically on your CI server on every git push. This will alert you if new changes to the app break existing functionality.\n\n- [Debugging Apps in Xcode During a Test](Guide.DebuggingInXcode.md) — Advanced users might need to natively debug their app inside Xcode during a Detox test. This is mostly useful for investigating weird crashes or when contributing to Detox itself.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.WritingFirstTest.md",
    "content": "---\nid: writing-first-test\nslug: introduction/writing-first-test\ntitle: Writing Your First Test\nsidebar_label: Writing Your First Test\n---\n\n## Writing Your First Test\n\nThis tutorial assumes you’ve already installed Detox successfully on a working React Native project.\n\n### Detox Recorder\n\nCheck out [Detox Recorder](https://github.com/wix/DetoxRecorder), our tool for recording tests directly from your device.\n\n### Step 1: Prepare a JavaScript File to Hold Your Scenario (Spec)\n\nEvery Detox test scenario is usually placed in its own JavaScript file. If you’ve followed the [installation tutorial](introduction/getting-started.md), these files are located in `/e2e/*.spec.js` under your React Native project root. Feel free to place these files wherever you like, this directory structure is just a recommendation.\n\nIf you’re using Mocha as your test runner, these files will simply be executed one by one when you run your tests.\n\nIf you’ve followed the installation tutorial, you should already have `firstTest.spec.js` as a placeholder to start from.\n\n### Step 2: Decide how to Reset Your App for the Beginning of the Scenario\n\nIn order to start the scenario from a predictable app state and reset the state from any previous scenarios that may have been running, it’s customary to start the scenario by restarting the app.\n\nThe fastest way to reset is by calling `await device.reloadReactNative();`. This is equivalent to pressing CMD+R in the simulator window - it will just reload the React Native bundle. You can find other alternatives that may be slower but more thorough [here](APIRef.DeviceObjectAPI.md).\n\nOur scenario is made from multiple different test cases (`it()` clauses). We usually want to reset before each one is running. This can be accomplished by placing the reset logic inside a `beforeEach()` clause.\n\n### Step 3: Add `testID`s to Your App to Assist in Matching Elements\n\nMost test cases start by finding a UI element on screen (_matching_) and performing some user interaction on it (_action_). To assist in finding the correct UI element, it’s recommended to mark it in some way. The best practice is to use the [`testID`](https://facebook.github.io/react-native/docs/view.html#testid) prop for this purpose. This means we’ll modify the app code and add these props to various elements.\n\nNote that not all React components support this prop. Most of the built-in native components in React Native like `View`, `Text`, `TextInput`, `Switch`, `ScrollView` have support though. If you create your own composite components, you will have to propagate this prop manually to the correct native component.\n\n```jsx\n<View>\n  <TouchableOpacity testID='MyUniqueId123'>\n    <Text>Some button</Text>\n  </TouchableOpacity>\n</View>\n```\n\n### Step 4: Match an Element and Perform an Action\n\nChoose a method to match your element, the various alternatives are documented [here](APIRef.Matchers.md). You will most likely be relying on `testID` which means our matching code will look like `element(by.id('MyUniqueId123'))`.\n\nChoose an action to perform on the element, the various alternatives are documented [here](APIRef.ActionsOnElement.md). If we have a button, a `tap` is probably what you’re looking for, resulting in this code:\n\n```jsx\nawait element(by.id('MyUniqueId123')).tap();\n```\n\n### Step 5: Set an Expectation on the Result\n\nAfter performing the action, the app will most likely do something. The process might also take a little time - for example if we’re logging in, there would be a server request. The great thing about detox is that you’re not supposed to worry about synchronization and how much time actions take. Detox will monitor the app and continue to the next line in your test only when the app completes pending operations and becomes idle.\n\nThe most natural expectation is to verify that some UI element has eventually appeared on screen as a result. Like before, we’ll need to match this element first. We can keep using `testID` for this purpose with `element(by.id('AnotherUniqueId456'))`.\n\nThe various available expectations are documented [here](APIRef.Expect.md). If we want to make sure an element is visible, we’ll get:\n\n```jsx\nawait expect(element(by.id('AnotherUniqueId456'))).toBeVisible();\n```\n\nNote that the visibility matcher makes sure the element is actually visible on screen (at least 75% of it to be exact). If it appears under the fold (e.g. the user has to scroll to see it), this specific matcher will fail.\n\n### Step 6: Rinse and Repeat\n\nCreate more complicated test cases by stringing actions and expectations one after the other. Explore the rest of the API to see what other things you can do in your tests.\n\nAdd more test cases to your file by adding `it()` clauses. Add new scenarios by adding new `*.spec.js` files.\n\n### Step 7: Run Your Tests and Make Sure They Pass\n\nThis is usually done by running `detox test` in terminal. If your test is failing, and you don’t understand why, take a look at the [troubleshooting tutorial](Troubleshooting.RunningTests.md).\n\nHow do you continue from here? Read about the various recommended workflows with detox documented [here](Introduction.Workflows.md). Hopefully you’ll find a workflow that makes sense moving forward and complements your development process.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.iOS.md",
    "content": "---\nid: ios\nslug: introduction/ios\ntitle: Detox for iOS\nsidebar_label: Detox for iOS\n---\n\n## Detox for iOS\n\n### 1. Preliminary\n\nRun through the basic steps of the [Getting Started guide](introduction/getting-started.md), such as the environment and tools setup.\n\n### 2. Apply Detox Configuration\n\nWhether you’ve selected to apply the configuration in a  `.detoxrc.json` or bundle it into your project’s `package.json` (under the `detox` section), this is what the configuration should roughly look like for iOS:\n\n```json\n{\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        \"type\": \"iPhone 12 Pro Max\"\n      }\n    }\n  },\n  \"apps\": {\n    \"ios.release\": {\n      \"name\": \"YourProject\",\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/YourProject.app\",\n      \"build\": \"xcodebuild -project ios/YourProject.xcodeproj -scheme YourProject -sdk iphonesimulator -derivedDataPath ios/build\"\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.release\"\n    }\n  }\n}\n```\n\n:::info\n\nFor a comprehensive explanation of Detox configuration, see our [dedicated API-reference guide](config/overview.md).\n\n:::\n\nIn the above configuration example, make sure to provide the correct information for your project/app. Under the key `\"binaryPath\"`, you should provide the path of the .app bundle to use. Normally, this is the path where the `\"build”` command would output this bundle. Under the key `\"build\"`, specify the `xcodebuild` command for your project.\n\n:::tip\n\nIf your app uses CocoaPods, pass `-workspace` in your `xcodebuild` command, for example:\n\n```json\n\"build\": \"xcodebuild -workspace ios/YourProject.xcworkspace -scheme YourProject -sdk iphonesimulator -derivedDataPath ios/build\"\n```\n\n:::\n\n:::info\n\nFor more information on using the xcodebuild command, visit [Apple Docs](https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_DO_I_BUILD_MY_PROJECTS_FROM_THE_COMMAND_LINE_).\n\n:::\n\nAlso, make sure the simulator model specified under the key `device.type` (e.g. `iPhone 12 Pro Max` above) is actually available on your machine (it was installed by Xcode). Check this by typing `applesimutils --list` in Terminal to display all available simulators.\n\nFor a complete, working example, refer to the [Detox example project configuration](https://github.com/wix/Detox/blob/master/detox/test/package.json).\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Introduction.iOSDevEnv.md",
    "content": "---\nid: ios-dev-env\nslug: introduction/ios-dev-env\ntitle: Setting Up an iOS Development & Testing Environment\nsidebar_label: Setting Up an iOS Development & Testing Environment\n---\n\n## Setting Up an iOS Development & Testing Environment\n\nThis guide sums up the tools required for an environment for running automated UI tests using iOS simulators (using Detox, in particular).\n\n### Prerequisites\n\nRunning Detox (on iOS) requires the following:\n\n- MacOS Catalina or newer\n- Xcode `v12.x` or newer (`v13` support - see [here](https://github.com/wix/Detox/issues/2895)), with Xcode command-line tools installed\n\n  Xcode can be installed from the App Store, or downloaded [directly from Apple Developer](https://developer.apple.com/download/more/)\n\n### Dependencies\n\n#### Install the Latest Version of [Homebrew](http://brew.sh)\n\nHomebrew is a package manager for macOS, used to install other command line tools.\n\nTo ensure everything needed for Homebrew tool installation is installed, run\n\n```sh\nxcode-select --install\n```\n\n#### Install [`applesimutils`](https://github.com/wix/AppleSimulatorUtils)\n\nA collection of utils for Apple simulators, Detox uses it to query and communicate with the simulator.\n\n```sh\nbrew tap wix/brew\nbrew install applesimutils\n```\n\n> **Note:** Make sure to periodically update your version of `applesimutils` to the latest version.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/README.md",
    "content": "## Detox Documentation\n\n### Introduction\n\n- [Getting Started](introduction/getting-started.md)\n- [Setting Up an iOS Environment](Introduction.iOSDevEnv.md)\n- [Setting Up an Android Development](Introduction.AndroidDevEnv.md)\n- [Detox for iOS](Introduction.iOS.md)\n- [Detox for Android](Introduction.Android.md)\n- [Writing Your First Test](Introduction.WritingFirstTest.md)\n- [How Detox Works](Introduction.HowDetoxWorks.md)\n- [Detox Design Principles](Introduction.DesignPrinciples.md)\n- [Workflows](Introduction.Workflows.md)\n\n### API Reference\n\n- [Detox Command Line Tools](APIRef.DetoxCLI.md)\n- [Configuration](config/overview.md)\n- [The `detox` Object](APIRef.DetoxObjectAPI.md)\n- [The `device` Object](APIRef.DeviceObjectAPI.md)\n- [Test Lifecycle](APIRef.TestLifecycle.md)\n- [Matchers](APIRef.Matchers.md)\n- [Actions](APIRef.ActionsOnElement.md)\n- [Expectations](APIRef.Expect.md)\n- [Mocking Open With URL](APIRef.MockingOpenWithURL.md)\n- [Mocking User Notifications](APIRef.MockingUserNotifications.md)\n- [Mocking User Activity](APIRef.MockingUserActivity.md)\n- [Test Artifacts](APIRef.Artifacts.md)\n- [Taking Screenshots](APIRef.Screenshots.md)\n\n### Troubleshooting\n\n- [Table of contents](Troubleshooting.md)\n  - [Building the App](Troubleshooting.BuildingTheApp.md)\n  - [Running tests](Troubleshooting.RunningTests.md)\n  - [Synchronization issues](Troubleshooting.Synchronization.md)\n  - [General tests stability issues](Troubleshooting.Flakiness.md)\n\n### Guides\n\n- [Running Locally](Guide.RunningLocally.md)\n  - [Developing Your App While Writing Tests](Guide.DevelopingWhileWritingTests.md)\n- [Running on CI](Guide.RunningOnCI.md)\n- [Debugging in Xcode](Guide.DebuggingInXcode.md)\n- [Debugging in Android Studio](Guide.DebuggingInAndroidStudio.md)\n- [Mocking](Guide.Mocking.md)\n- [Migration Between Detox Versions](Guide.Migration.md)\n- [Jest Setup Guide](Guide.Jest.md)\n- [Mocha Setup Guide](Guide.Mocha.md)\n- [Parallel Test Execution](Guide.ParallelTestExecution.md)\n- [Third-party Drivers](Guide.ThirdPartyDrivers.md)\n- [Uninstalling Detox](Guide.Uninstalling.md)\n- [Detox & Expo](Guide.Expo.md)\n\n### Contributing to Detox\n\n- [Detox Contribution Guide](Guide.Contributing.md)\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Troubleshooting.BuildingTheApp.md",
    "content": "---\nid: building-the-app\nslug: troubleshooting/building-the-app\ntitle: Dealing With Problems With Building the App & Detox\nsidebar_label: Dealing With Problems With Building the App & Detox\n---\n\n## Dealing With Problems With Building the App & Detox\n\nThis page is about issues related to building the app, typically triggered when running `detox build` (and not `detox test`, for example).\n\nFor troubleshooting of other issue, refer to our [troubleshooting index](Troubleshooting.md).\n\n## Android\n\n### Problem: AAPT - resource linking failure\n\nFor build errors involving AAPT resource linking failure, such as this one:\n\n```text\nExecution failed for task ':app:processReleaseAndroidTestResources'.\n> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction\n   > Android resource linking failed\n     ERROR:: AAPT: error: resource style/Widget.AppCompat.TextView ...\n```\n\nEnsure that the following line appears in your app's `buildscript` (`android/app/build.gradle`) in the `dependencies` section:\n\n```groovy\ndependencies {\n    // ...\n    implementation 'androidx.appcompat:appcompat:1.1.0' // (check what the latest version is!)\n}\n```\n\n### Problem: minSdkVersion mismatch\n\nFor Gradle errors involving `minSdkVersion` mismatches resembling this one:\n\n```text\nuses-sdk:minSdkVersion 18 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.3] /Users/janedoe/.gradle/caches/transforms-3/6a9cd4eeeb285f80b9e6f413ecd78d0d/transformed/jetified-react-native-0.64.3/AndroidManifest.xml as the library might be using APIs not available in 18\n        Suggestion: use a compatible library with a minSdk of at most 18,\n                or increase this project's minSdk version to at least 21,\n                or use tools:overrideLibrary=\"com.facebook.react\" to force usage (may lead to runtime failures)\n```\n\nTry applying the solution suggested in [this Stack-overflow](https://stackoverflow.com/questions/21032271/how-to-inject-android-configuration-to-each-subproject-with-gradle) post, namely adding this to your root-project's `build.gradle` file (replace `21` those matching your app's `build.gradle`):\n\n```groovy\n// build.gradle\n\nallprojects {\n    afterEvaluate {\n        if (it.hasProperty('android')){\n            android {\n                defaultConfig {\n                    minSdkVersion 21 // Replace '21' with whatever suites your case\n                }\n            }\n        }\n    }\n}\n```\n\n### Problem: Kotlin `stdlib` version conflicts\n\nThe problems and resolutions here are different depending on whether you’re using Detox as a precompiled dependency artifact (i.e. an `.aar`) - which is by far the common case, or compiling it yourself.\n\n#### Resolving for a precompiled dependency (`.aar`)\n\nOf all [Kotlin implementation flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies), Detox assumes the most recent one, namely `kotlin-stdlib-jdk8`. If your Android build fails due to conflicts with implementations coming from other dependencies or even your own app, consider adding an exclusion to either the \"other\" dependencies or detox itself, for example:\n\n```diff\ndependencies {\n-    androidTestImplementation('com.wix:detox:+')\n+    androidTestImplementation('com.wix:detox:+') { \n+        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'\n+    }\n}\n```\n\nDetox should work with `kotlin-stdlib-jdk7`, as well.\n\nA typical error output formed by `Gradle` in this case is as provided, for example, in [#1380](https://github.com/wix/Detox/issues/1380):\n\n```text\nCould not determine the dependencies of task ':detox:compileDebugAidl'.\n> Could not resolve all task dependencies for configuration ':detox:debugCompileClasspath'.\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.30'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n```\n\n(i.e. the project indirectly depends on different versions of `kotlin-stdlib`, such as `1.3.0`, `1.3.30`, `1.2.60`)\n\n#### Resolving for a compiling subproject\n\nDetox requires the Kotlin standard-library as its own dependency. Due to the [many flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies) by which Kotlin has been released, multiple dependencies often create a conflict.\n\nFor that, Detox allows for the exact specification of the standard library to use using two Gradle globals: `detoxKotlinVersion` and `detoxKotlinStdlib`. You can define both in your  root build-script file (i.e.`android/build.gradle`):\n\n```groovy\nbuildscript {\n    // ...\n    ext.detoxKotlinVersion = '1.3.0' // Detox' default is 1.2.0\n    ext.detoxKotlinStdlib = 'kotlin-stdlib-jdk7' // Detox' default is kotlin-stdlib-jdk8\n}\n```\n\n### Problem: `Duplicate files copied in ...`\n\nIf you get an error like this:\n\n```text\nExecution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.\n> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE\n```\n\nYou need to add this to the `android` section of your `android/app/build.gradle`:\n\n```groovy\npackagingOptions {\n    exclude 'META-INF/LICENSE'\n}\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Troubleshooting.Flakiness.md",
    "content": "---\nid: flakiness\nslug: troubleshooting/flakiness\ntitle: Dealing With Flakiness in Tests\nsidebar_label: Dealing With Flakiness in Tests\n---\n\n## Dealing With Flakiness in Tests\n\n> What is a flaky test?\n\nA flaky test is a test that passes most of the time, and sometimes without any apparent reason and without any changes to your app - it fails. This can even happen only on certain machines. For example, on your own machine it always passes, but on a different slower machine, like the CI, it fails.\n\n### 1. We Feel Your Pain\n\nFlakiness is the greatest challenge in E2E. The good news is that Detox was designed with this mission in mind: dealing with flakiness head on.\n\nAssume you have a suite of 100 tests and each test is flaky in 0.5% of executions (failing without an actual bug in your app). The total flakiness of your entire suite is about 40% (the exact formula is `1 - (1 - 0.005)^100`). This means that there’s 40% chance your suite will fail without an actual bug! This makes your entire suite useless.\n\n### 2. Sources of Flakiness\n\nIt’s important to identify the various sources of flakiness in Detox tests.\n\n- Control of the device / simulator - in order to run your tests, Detox must communicate with a simulator and instruct it to install the app, restart it, etc. Simulators don’t always behave and controlling them might occasionally fail. Detox’s underlying simulator control is [`AppleSimulatorUtils`](https://github.com/wix/AppleSimulatorUtils), it is a tool that supports both basic and advanced simulator and device interaction options, it uses some core simulator features which are not always stable and may need time to \"warm up\" (booting, shutting down, etc.). Detox is set to have a few retries on any of these actions before failing. It will also print all the `exec` commands when using `verbose` log level, and with `trace` level it will print everything.\n\n- Asynchronous operations inside your app - every time an E2E test runs, operations might take place in a different order inside your app. This makes E2E tests nondeterministic. Consider an HTTP request made to a server, this request may take a variable time to complete due to external concerns like network congestion and server load. Detox takes this into account by monitoring all asynchronous operations that take place in your app from the inside. Detox knows which network requests are currently in-flight. Detox knows how busy the React Native bridge is. Tests are automatically synchronized to the app and only move forward when the app is idle.\n\n### 3. Get More Data About the Problem\n\nIn order to identify the source of flakiness you’re suffering from you need more data. If you catch a failing test that should be passing, you need to record as much information as possible in order to investigate.\n\n- Enable `trace` mode in Detox. This will output a lot of information about what happening during the test:\n  1. `exec` commands\n  1. All communication going over the websocket, both from tester and app\n\nTo enable `trace` mode run your tests in trace log mode:\n\n```sh\ndetox test --loglevel trace\n```\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Troubleshooting.RunningTests.md",
    "content": "---\nid: running-tests\nslug: troubleshooting/running-tests\ntitle: Dealing With Problems With Running Tests\nsidebar_label: Dealing With Problems With Running Tests\n---\n\n## Dealing With Problems With Running Tests\n\nThis page is about issues related to executing your Detox tests, typically triggered when running `detox test` (and not `detox build`, for example).\n\nFor troubleshooting of other issue, refer to our [troubleshooting index](Troubleshooting.md).\n\n### Table of Contents\n\n- [Trace Mode](#trace-mode)\n- [Tests execution hangs](#tests-execution-hangs)\n- [No Simulators Found (iOS)](#no-simulators-found-ios)\n- [Syntax Error: Unexpected Token](#syntax-error-unexpected-token)\n- [Can’t Find My Component Even Though I Added a `testID` to Its Props](#cant-find-my-component-even-though-i-added-a-testid-to-its-props)\n- [Test Tries to Find My Component Before It’s Created](#test-tries-to-find-my-component-before-its-created)\n- [Can’t synchronize the test with my app](#cant-synchronize-the-test-with-my-app)\n- [Unknown option \"configuration\" (Mocha.js)](#unknown-option-configuration-mochajs)\n- [An Element is Not Visible](#an-element-is-not-visible)\n- [Debug View Hierarchy](#debug-view-hierarchy)\n- [Compare to a Working Setup](#compare-to-a-working-setup)\n- [Take a Look at Past Issues](#take-a-look-at-past-issues)\n- [How to Open a New Issue](#how-to-open-a-new-issue)\n\n#### Trace Mode\n\nIt’s a good idea to get as much information as possible about what’s going on. We can enable trace mode during tests by running our tests with:\n\n```sh\ndetox test --loglevel trace\n```\n\n#### Enable debugging of synchronization issues\n\nSee [here](Troubleshooting.Synchronization.md#identifying-which-synchronization-mechanism-causes-us-to-wait-too-much).\n\n#### No simulators found (iOS)\n\nIn order to run tests on a simulator, you need to have simulator images installed on your machine. This process is performed by Xcode itself. You can list all available simulators using `simctl` by typing `xcrun simctl list` in terminal.\n\nIf you’re missing a simulator, make sure Xcode is installed and use it to download the simulator. Take a look at the Preferences screen, some screenshots can be seen [here](http://stackoverflow.com/questions/33738113/how-to-install-ios-9-1-simulator-in-xcode-version-7-1-1-7b1005).\n\nOnce the desired simulator is installed and returned by `xcrun simctl list`, double check its name in the list and make sure this name is found in the `detox` configuration entry in `package.json`. The reference for the configuration options is available [here](config/overview.md).\n\n#### Tests execution hangs\n\n**Issue:** A while after running Detox, you get a message about failure to connect to the running app, in the logs:\n\n```plain text\nDetox can’t seem to connect to the test app(s)!\n```\n\nThis can be a result of various reasons. It is generally up to you to debug and find the root cause. In any case, below are the common ones.\n\n##### If you do not see your app running on the device\n\n- You might have forgotten to run `device.launchApp()` in the beginning of your test.\n- The app might have crashed before Detox has had a chance to connect to it. To get the crash details, you can run Detox tests with `--record-logs all` CLI option and then inspect the device logs in the artifacts' folder.\n- **On Android**, there might be a problem with the native test code in the `DetoxTest.java` file. Revisit the [associated section](Introduction.Android.md#5-create-a-detox-test-class) in the setup guide.\n\n##### If you _do_ see your app running on the device\n\n- **On Android with SDK≥28**, the app’s connection to the Detox test server is blocked due to clear-traffic blockage (as reported in issue [#1450](https://github.com/wix/Detox/issues/1450)).\n  The main step for getting this fixed is to revisit the [associated section](Introduction.Android.md#6-enable-clear-text-unencrypted-traffic-for-detox) in the setup guide, which discusses network-security. Alternatively, the `android:usesCleartextTraffic=\"true\"` attribute can be configured in the `<application>` tag of the app’s `AndroidManifest.xml`, but **that is highly discouraged**.\n- If you’ve applied the above suggestion but the app fails to connect to the Detox test server, nonetheless: Refer to the device’s logs, which should contain messages about failed connection attempts (get them using the `--record-logs all` argument)\n- The app could be running without Detox native code injected. In this case, first, make sure you’re not trying to run in manual launch mode (where this behavior is valid). If so, examine the logs from the device (get them using the `--record-logs all` argument). If you see a crash related to Detox’s native code, you are welcome to report it on our GitHub tracker.\n- If you are in fact debugging your native code integration with Detox, these guides may prove helpful:\n  - [Debugging in Android Studio](Guide.DebuggingInAndroidStudio.md)\n  - [Debugging in Xcode](Guide.DebuggingInXcode.md)\n\n#### Syntax Error: Unexpected Token\n\n**Issue:** Running tests immediately throws the following error:\n\n```js\nbeforeEach(async () => {\n                   ^\nSyntaxError: Unexpected token (\n    at Object.exports.runInThisContext (vm.js:76:16)\n    at Module._compile (module.js:545:28)\n    at loader (/Users/builduser/buildAgent/work/34eee2d16ef6c34b/node_modules/babel-register/lib/node.js:144:5)\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/builduser/buildAgent/work/34eee2d16ef6c34b/node_modules/babel-register/lib/node.js:154:7)\n...\nchild_process.js:531\n    throw err;\n```\n\n**Solution:** This error means that your version of Node does not support `async-await` syntax. You should do the following:\n\n1. Update Node to a version **8.3.0 or higher**.\n\n#### Can’t Find My Component Even Though I Added a `testID` to Its Props\n\n**Issue:** Detox fails to match a component even though it has a `testID`. Detox will throw the following error:\n\n```plain text\nError: Cannot find UI Element.\nException with Assertion: {\n  \"Assertion Criteria\" : \"assertWithMatcher: matcherForSufficientlyVisible(>=0.750000)\",\n  \"Element Matcher\" : \"(((respondsToSelector(accessibilityIdentifier) && accessibilityID('Welcome')) && !kindOfClass('RCTScrollView')) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('Welcome')) && kindOfClass('RCTScrollView'))))))\",\n  \"Recovery Suggestion\" : \"Check if element exists in the UI, modify assert criteria, or adjust the matcher\"\n}\n\nError Trace: [\n  {\n    \"Description\" : \"Interaction cannot continue because the desired element was not found.\",\n    \"Domain\" : \"com.google.earlgrey.ElementInteractionErrorDomain\",\n    \"Code\" : \"0\",\n    \"File Name\" : \"GREYElementInteraction.m\",\n    \"Function Name\" : \"-[GREYElementInteraction matchedElementsWithTimeout:error:]\",\n    \"Line\" : \"119\"\n  }\n]\n```\n\n**Solution:** React Native only supports the `testID` prop on the native built-in components. If you’ve created a custom composite component, you will have to support this prop yourself. You should probably propagate the `testID` prop to one of your rendered children (a built-in component):\n\n```jsx\nexport class MyCompositeComponent extends Component {\n  render() {\n    return (\n      <TouchableOpacity testID={this.props.testID}>\n        <View>\n          <Text>Something something</Text>\n        </View>\n      </TouchableOpacity>\n    );\n  }\n}\n```\n\nNow, adding `testID` to your composite component should work:\n\n```jsx\nrender() {\n  return <MyCompositeComponent testID='MyUniqueId123' />;\n}\n```\n\n#### Test Tries to Find My Component Before It’s Created\n\n**Issue:** Due to a synchronization issue, the test tries to perform an expectation and fails because it runs the expectation too soon. Consider this example:\n\n```js\nawait element(by.text('Login')).tap();\nawait expect(element(by.text('Welcome'))).toBeVisible();\n```\n\nIn the test above, after tapping the Login button, the app performs several complex asynchronous operations until the Welcome message is displayed post-login. These can include querying a server, waiting for a response and then running an animated transition to the Welcome screen. Detox attempts to simplify your test code by synchronizing _automatically_ with these asynchronous operations. What happens if for some reason the automatic synchronization doesn’t work? As a result, Detox will not wait correctly until the Welcome screen appears and instead will continue immediately to the next line and try to run the expectation. Since the screen is not there yet, the test will fail.\n\n**Solution:** When you suspect that automatic synchronization didn’t work, you have a fail-safe by synchronizing manually with `waitFor`. Using `waitFor` will poll until the expectation is met. This isn’t a recommended approach so please use it as a workaround and open and issue to resolve the synchronization issue.\n\nThis is what the fixed test would look like:\n\n```js\nawait element(by.text('Login')).tap();\nawait waitFor(element(by.text('Welcome'))).toBeVisible().withTimeout(2000);\n```\n\n#### Can’t synchronize the test with my app\n\nIf you suspect that the test is failing because Detox fails to synchronize the test steps with your app, take a look at this in-depth [synchronization troubleshooting tutorial](Troubleshooting.Synchronization.md).\n\n#### Unknown option \"configuration\" (Mocha.js)\n\nIn an attempt to run `detox test`, the following error is thrown:\n\n```plain text\ndetox[4498] INFO:  [test.js] node_modules/.bin/mocha --opts e2e/mocha.opts --configuration ios.sim.release --grep :android: --invert\n\n  error: unknown option `--configuration'\n```\n\n**Solution:** Upgrade to `detox@^12.4.0` or newer (latest, recommended), and `mocha@^6.1.3`.\nThat weird error has been spotted in older versions of `mocha` (including `v5.2.0`) and was fixed in `v6.0.0`. In fact, it conceals the genuine error:\n\n```plain text\nError: No test files found\n```\n\nIf the error appeared after running a short command like `detox test`, please try out `detox test e2e/` (in other words, append the path to your end-to-end tests folder) - and if that fixes the error, then you deal the bug in the question and upgrading `detox` and `mocha` should help.\n\nAfter you upgrade, you can configure the default path to your end-to-end tests folder in `package.json`:\n\n```diff\n {\n   \"detox\": {\n-    \"specs\": \"\",\n+    \"specs\": \"your-e2e-tests-folder\",\n   }\n }\n```\n\nPlease mind that if your E2E tests are located at the default path (`e2e`), then you don’t need to add `\"specs\"` property explicitly to `package.json`.\n\n#### An Element is Not Visible\n\n**On iOS**, you may run in a situation, when one of the interactions (tap, scroll, etc.) on an element fails with an error like:\n\n```plain text\nTest Failed: View \"<RCTScrollView: 0x7f8d32296d70>\" is not visible: view does not pass visibility threshold (0% visible of 75% required)\n```\n\n1. Try retrieving `ui.viewhierarchy` artifact — sometimes examining the hierarchy visually can give you insights.\n   Add a line `\"uiHierarchy\": \"enabled\"` to your artifacts' configuration in `.detoxrc.js`, like in an example here: [Artifacts Configuration](https://github.com/wix/Detox/blob/master/docs/config/overview.md#artifacts-configuration). After a rerun, you should find\n   a `ui.viewhierarchy` in a folder of your failing test. Please mind that you need Xcode 12 at least to open `*.viewhierarchy` files.\n\n1. Besides, you can rerun your iOS app tests with `--take-screenshots failing`. What will happen is, for each view that fails visibility, two images will be saved at `artifacts/<configuration-timestamp-dir>/<test name>/DETOX_VISIBILITY_<viewType>__<viewID>__SCREEN.png` (and `.../DETOX_VISIBILITY_<viewType>__<viewID>__TEST.png` folder aside) with autogenerated names, e.g. `DETOX_VISIBILITY_RCTTextView__0x7fab7660f3e0__TEST.png`:\n\n|                                                            in `DETOX_*_SCREEN.png`                                                           |                                                              in `DETOX_*_TEST.png`                                                             |\n| :------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: |\n| <img alt=\"visible\" src=\"https://user-images.githubusercontent.com/2270433/94178906-68872380-fea4-11ea-845c-c55c25b68c0e.png\" height=\"480\" /> | <img alt=\"internals\" src=\"https://user-images.githubusercontent.com/2270433/94178919-6c1aaa80-fea4-11ea-8db6-64f1f4b21361.png\" height=\"480\" /> |\n\nThe first is supposed to show what is seen on screen. The second shows the internal buffer that Detox tests for visibility; if the pixels aren’t transparent enough and less than 75% of tested region is not transparent, the view is not considered visible.\n\nIf you are developing a React Native app, then the following applies. If, for instance, you see that tapping fails due to a view with `pointerEvents=\"none\"` obscuring your target — well, the only solutions are: either to make the obscurer a descendant of your target (instead of being a sibling), or to tap on the parent container.\n\nIf you see that your issue cannot be solved via testID replacement or a simple hierarchy rearrangement, then there’s a chance this is a bug in Detox. Make sure to provide your `ui.viewhierarchy` artifact, the generated `DETOX_VISIBILITY_*` pictures and a comprehensive description of the issue backed up with sound arguments.\n\n#### Debug View Hierarchy\n\n**Issue:** I added the `testID` prop, but I still can’t find the view by id in my tests.\n\n**Solution:** You can investigate the app’s native view hierarchy, this might shed some light on how the app’s view hierarchy is laid out.\n\nDo the following:\n\n1. Start a debuggable app (not a release build) in your simulator\n1. Open Xcode\n1. Attach Xcode to your app’s process\n   ![attach to process](img/attach-to-process.jpg)\n1. Press the `Debug View Hierarchy` button\n   ![debug view hierarchy](img/debug-view-hierarchy.jpg)\n1. This will open the hierarchy viewer, and will show a breakdown of your app’s native view hierarchy. Here you can browse through the views\n1. React Native testIDs are manifested as _accessibility identifiers_ in the native view hierarchy\n\nLet’s see an example. We will find the following view in the native hierarchy:\n\n```jsx\n<TouchableOpacity onPress={this.onButtonPress.bind(this, 'ID Working')}>\n  <Text testID='UniqueId345' style={{color: 'blue', marginBottom: 20}}>ID</Text>\n</TouchableOpacity>\n```\n\nThis is the hierarchy viewer, pointing to the native view just mentioned:\n\n![hierarchy viewer](img/hierarchy-viewer.jpg)\n\n#### Compare to a Working Setup\n\nIf you feel lost, try starting from a working example for sanity.\n\nThere are multiple working examples included in this repo, such as [demo-react-native](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\n\nFirst, install, build and make sure the tests are indeed passing. If they are, try comparing this setup with what you have.\n\n#### Take a Look at Past Issues\n\nBefore opening a new issue, search the [list of issues](https://github.com/wix/detox/issues?utf8=%E2%9C%93\\&q=is%3Aissue) on GitHub. There’s a good chance somebody faced the same problem you are having.\n\n#### How to Open a New Issue\n\nBefore opening a new issue, please follow the entire troubleshooting guide and go over past issues.\n\nGeneral usage questions should be opened on Stack Overflow, where the core Detox team is active and responds to questions:\n<https://stackoverflow.com/questions/tagged/detox>\n\nIf you believe you are seeing a Detox issue, select the correct template from the options, and make sure to fill all requested information in the template. Omitting important information will likely result in a closed issue.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Troubleshooting.Synchronization.md",
    "content": "---\nid: synchronization\nslug: troubleshooting/synchronization\ntitle: Dealing With Synchronization Issues in Tests\nsidebar_label: Dealing With Synchronization Issues in Tests\n---\n\n## Dealing With Synchronization Issues in Tests\n\nTraditionally, one of the most difficult aspects of E2E testing is synchronizing the test scenario with the app. Complex operations inside the app (like accessing servers or performing animations) often take variable amount of time to complete. We can’t continue the test until they’ve completed. How can we synchronize the test with these operations?\n\nSynchronizing manually with `sleep()` commands is a bad idea. It’s flaky, complicates the tests, behaves differently on different machines and makes tests needlessly slow.\n\nInstead, Detox tries to synchronize the test with the app completely _automatically_.\n\nWhen this works it’s like magic. You simply execute actions one after the other without worrying about timing, and Detox waits for the app to stabilize before moving to the next test line. If there’s an in-flight request to a server, for example, the test will not move forward until the request completes.\n\n### What operations do we try to synchronize with automatically\n\n- **Network requests** - Detox monitors in-flight requests over the network.\n\n- **Main thread (native)** - Detox monitors pending native operations on the main thread (main dispatch queue and main `NSOperationQueue`).\n\n- **Layout of UI** - Detox monitors UI layout operations. There’s also special support for React Native layout which includes the Shadow Queue where [yoga](https://github.com/facebook/yoga) runs.\n\n- **Timers** - Detox monitors timers (explicit asynchronous delays). There’s special support for JavaScript timers like `setTimeout` and `setInterval`.\n\n- **Animations** - Detox monitors active animations and transitions. There’s special support for React Native animations with the Animated library.\n\n- **React Native JavaScript thread** - Detox monitors pending operations on the JavaScript thread in RN apps.\n\n- **React Native bridge** - Detox monitors the React Native bridge and asynchronous messages sent on it.\n\n### Automatic synchronization works most of the time\n\nIt’s difficult for an automatic mechanism to be correct in 100% of the cases. There are always exceptions. We are optimizing for the common case so most of your scenarios will not have to deal with synchronization issues.\n\nFor the rest of this tutorial, we’ll assume the test is having some sort of synchronization issue.\n\n### Are we waiting too much or not waiting enough?\n\nWhen the automatic synchronization mechanism doesn’t work, we have 2 potential problems:\n\n- We are waiting too much - The test will appear to hang and fail with timeout. This happens because Detox thinks an asynchronous operation is currently taking place and is waiting for it endlessly.\n\n- We are not waiting enough - The test will appear to fail at some point because an element isn’t found according to an expectation or isn’t found when attempting to perform an action on it. This happens because Detox didn’t take some asynchronous operation into account and isn’t waiting until it completes.\n\n### Identifying which synchronization mechanism causes us to wait too much\n\nInteractions with the application are synchronized, meaning that they will not execute unless the app is idle. You may encounter situations where the tests just hang.\nWhen an action/expectation takes a significant amount of time use this option to print device synchronization status.\nThe status will be printed if the action takes more than \\[value] (in ms) to complete\n\n```sh\ndetox test --debug-synchronization 500\n```\n\nThen, reproduce your issue, and you should see output similar to the following:\n\n```plain text\ndetox[9733] INFO:  [APP_STATUS] The app is busy with the following tasks:\n• There are 1 work items pending on the dispatch queue: \"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)\".\n• Run loop \"Main Run Loop\" is awake.\n• 1 enqueued native timers:\n  - Timer #1:\n    + Fire date: 2021-11-11 14:19:57 +0200.\n    + Time until fire: 0.072.\n    + Repeat interval: 0.\n    + Is recurring: NO.\n```\n\nSee [this document](https://github.com/wix/DetoxSync/blob/master/StatusDocumentation.md) for documentation of the debug synchronization output.\n\n#### Lower-level Idling Resources Debug (iOS Only)\n\nIf `--debug-synchronization` does not provide the necessary information, on iOS you can add the following launch argument to your app (using `launchArgs` in your `launchApp()` call) to enable a very verbose logging of the idling resource system to the system log:\n\n```shell\n-DTXEnableVerboseSyncSystem YES -DTXEnableVerboseSyncResources YES\n```\n\nYou can then obtain this log by running the following command:\n\n```shell\nxcrun simctl spawn booted log stream --level debug --style compact --predicate \"category=='SyncManager'\"\n```\n\nFor example, change your `/e2e/init.js` like so:\n\n```js\nawait detox.init(undefined, { launchApp: false });\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { 'DTXEnableVerboseSyncSystem': 'YES', 'DTXEnableVerboseSyncResources': 'YES' }\n});\n```\n\n### Switching to manual synchronization as a workaround\n\nWe always have the fail-safe of turning off automatic synchronization and waiting manually by ourselves. This isn’t the recommended approach, but sometimes we don’t have a choice.\n\n#### How do we turn off automatic synchronization?\n\nThis makes sense only if we’re waiting too much.\n\n##### [Controlling the entire synchronization mechanism](https://github.com/wix/detox/blob/master/docs/APIRef.DeviceObjectAPI.md#devicedisablesynchronization)\n\nThe synchronization mechanism can be shut down using\n\n```js\nawait device.disableSynchronization();\n```\n\nto turn it on again use\n\n```js\nawait device.enableSynchronization();\n```\n\n##### [Controlling network synchronization](https://github.com/wix/detox/blob/master/docs/APIRef.DeviceObjectAPI.md#deviceseturlblacklisturls)\n\nYou can skip over synchronizing on certain URLs (for long polling tasks, or websocket connections)\n\n```js\nawait device.setURLBlacklist(['.*127.0.0.1.*']);\n```\n\nIn order to gain sync back on an endpoint, just remove it from the blacklist:\n\n```js\nawait device.setURLBlacklist([]);\n```\n\nAlternatively, you can launch your app already with the URL blacklist defined — that can help with a network sync issue at the very beginning:\n\n```js\nawait device.launchApp({\n  launchArgs: {\n    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")',\n  },\n});\n```\n\n#### How do we wait manually?\n\nThis makes sense only if we’re not waiting enough (or if we’ve disabled automatic synchronization). Use the `withTimeout()` API to wait until an expectation is met. The API is documented [here](APIRef.Expect.md#withtimeouttimeout).\n\n### Tweaking and fine-tuning the synchronization mechanisms\n\n> This isn’t exposed yet, to be done...\n\n### Modifying your app to avoid waiting too much\n\nWhen facing a synchronization issue and tweaking doesn’t help, consider modifying your app. When Detox is having trouble synchronizing due to intense non-stopping activity, it may be a sign that your app is abusing resources.\n\nYou can also modify your app, for the sake of tests only, by using mocking. Read more [here](https://github.com/wix/Detox/blob/master/docs/Guide.Mocking.md).\n\n#### `setTimeout` and `setInterval`\n\nBy default, Detox is designed to ignore `setInterval` and will only wait for `setTimeout` of up to 1.5 seconds. If you have an endless polling loop with short intervals implemented with `setTimeout`, switch the implementation to `setInterval`. If possible, avoid aggressive polling in your app altogether, the poor single JavaScript thread we have doesn’t like it.\n\n#### Endless looping animations\n\nBy default, Detox will wait until animations complete. If you have an endless looping animation, this may cause Detox to hang. In this case, consider turning off the animation synchronization or remove the endless loop in your E2E build with [mocking](https://github.com/wix/Detox/blob/master/docs/Guide.Mocking.md).\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/Troubleshooting.md",
    "content": "---\nid: troubleshooting\nslug: troubleshooting/troubleshooting\ntitle: Troubleshooting\nsidebar_label: Troubleshooting\n---\n\n## Troubleshooting\n\nIssues related to building the app:\n\n- [Building the App](Troubleshooting.BuildingTheApp.md)\n\nIssues related to tests execution & runtime:\n\n- [Running tests](Troubleshooting.RunningTests.md)\n- [Synchronization issues](Troubleshooting.Synchronization.md)\n- [General tests stability issues](Troubleshooting.Flakiness.md)\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/config/overview.md",
    "content": "---\nid: overview\ntitle: Configuration Options\n---\n\n## Configuration Options\n\n### Configuration File\n\nIn order for Detox to know what device & app to use (and a lot more, actually), it needs some configuration to be statically available in a configuration file. It supports both standalone configuration files, and a configuration bundling inside the project’s `package.json`.\n\nIn essence, Detox scans for the configuration to use, through multiple files. It starts from the current working directory, and runs over the following options, in this order:\n\n1. `.detoxrc.js`\n1. `.detoxrc.json`\n1. `.detoxrc`\n1. `detox.config.js`\n1. `detox.config.json`\n1. `package.json` (`\"detox\"` section)\n\nOptions 1-5 allow for a standalone Detox configuration in either a `json` format or using JavaScript syntax.\nOption 6 means the configuration is available in `json` format inside the project’s `package.json`, which is more suitable if you like having all of your project’s configurations in one place.\n\nPlease find the [Detox example app](https://github.com/wix/Detox/blob/master/examples/demo-react-native/detox.config.js) as a working reference. Also, look at\n[the typings file](https://github.com/wix/Detox/blob/master/detox/index.d.ts) provided by Detox.\n\n#### Extending configurations\n\nSince Detox [18.9.0](https://github.com/wix/Detox/releases/tag/18.9.0), you can also define base Detox configurations,\ndistribute them as `npm` modules for reuse across multiple projects, e.g.:\n\n```js\n{\n  \"extends\": \"@my-org/detox-preset\",\n  \"runnerConfig\": \"e2e/jest.config.some-override.js\"\n}\n```\n\nPlease note that `extends` has to be a valid Node module path. Relative module paths will be resolved relatively\nto the Detox config file which contains that specific `extends` property, e.g.:\n\n```js\n// given: ~/Projects/my-project/.detoxrc.json\n{ extends: \"./e2e/detox-base-config\" }\n// goes to: ~/Projects/my-project/e2e/detox-base-config.js\n{ extends: \"./configs/base\" }\n// then goes to: ~/Projects/my-project/e2e/configs/base/index.js\n// and so on...\n```\n\n#### Individual Configurations\n\n> NOTE: The configuration format has been significantly updated since [18.3.1](https://github.com/wix/Detox/blob/18.3.1/docs/config/overview.md) in a backward-compatible way.\n> Click [here](https://github.com/wix/Detox/blob/18.3.1/docs/config/overview.md) to the reference on the former configuration format.\n\n`configurations` holds all the device/app-oriented configurations. To select a specific configuration when running Detox in command-line (i.e. `detox build`, `detox test`), use the `--configuration` argument.\nNote: If there is only one configuration in `configurations`, Detox will default to it.\n\n| Configuration Params | Details                                                                                                              |\n| -------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `device`             | Device config (object) or an alias pointing to an already defined device in `\"devices\"` dictionary (see below).      |\n| `app`                | App config (object) or an alias pointing to an already defined application in `\"apps\"` dictionary (see below).       |\n| `apps`               | Same as the `app`, but that is an array form used for multi-app testing. Mutually exclusive with the `app` property. |\n| `artifacts`          | Overrides to the artifacts config. See [Artifacts guide](#artifacts-configuration).                                  |\n| `behavior`           | Overrides to the behavior config. See [Behavior guide](#behavior-configuration).                                     |\n| `session`            | Overrides to the session config. See [Session guide](#server-configuration).                                         |\n|                      |                                                                                                                      |\n| `runnerConfig`       | Path to the test runner config. Default value: `e2e/config.json` (for Jest), `e2e/mocha.opts` (for Mocha).           |\n| `specs`              | A default glob pattern for a test runner to use when no test files are specified, e.g.: `e2e/**/*.test.js`           |\n\n**Example:**\n\n```js\n{\n  // ...\n  \"detox\": {\n    // ...\n    \"devices\": {\n      // ... see below ...\n    },\n    \"apps\": {\n      // ... see below ...\n    },\n    \"session\": {\n      // ... see below ...\n    },\n    \"configurations\": {\n      \"ios.sim.debug\": {\n        \"device\": \"simulator\",\n        \"app\": \"ios.debug\"\n      },\n      \"android.emu.release\": {\n        \"device\": \"emulator\",\n        \"app\": \"android.release\"\n      },\n      \"android.att.release\": {\n        \"device\": \"android.attached\",\n        \"app\": \"android.release\"\n      },\n      \"android.genymotion.release\": {\n        \"device\": \"android.genycloud\",\n        \"app\": \"android.release\"\n      }\n    }\n  }\n}\n```\n\n#### Device configurations\n\nThe format of Detox config allows you to define inside it multiple device configs in a key-value manner, i.e.:\n\n```js\n{\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        // one of these or a combination of them\n        \"id\": \"D53474CF-7DD1-4673-8517-E75DAD6C34D6\",\n        \"type\": \"iPhone 11 Pro\",\n        \"name\": \"MySim\",\n        \"os\": \"iOS 13.0\"\n      }\n    },\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"Pixel_2_API_29\"\n      },\n      \"utilBinaryPaths\": [\n        \"optional-property-with/path/to/test-butler-or-anything-else.apk\"\n      ]\n    },\n    \"android.attached\": {\n      \"type\": \"android.attached\",\n      \"device\": {\n        \"adbName\": \"YOGAA1BBB412\"\n      }\n    },\n    \"android.genycloud\": {\n      \"type\": \"android.genycloud\",\n      \"device\": {\n        \"recipeUUID\": \"11111111-2222-3333-4444-555555555555\"\n        // or recipeName: \"MyRecipeName\",\n      }\n    }\n  },\n  \"apps\": {\n    // ... see below ...\n  },\n  \"configurations\": {\n    // ... see above ...\n  }\n}\n```\n\nA device config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`               | _**Required.** String Literal_. Mandatory property to discern device types: `ios.simulator`, `android.emulator`, `android.attached`, `android.genycloud`, `ios.none`, etc.                                                                                                                                                                                                                                                                                                                          |\n| `device`             | _**Required.** Object._ Device query, e.g. `{ \"byType\": \"iPhone 11 Pro\" }` for iOS simulator, `{ \"avdName\": \"Pixel_2_API_29\" }` for Android emulator or `{ \"adbName\": \"<pattern>\" }` for attached Android device with name matching the regex.                                                                                                                                                                                                                                                      |\n| `bootArgs`           | _Optional. String. Supported by `ios.simulator` and `android.emulator` only._ <br/> Supply an extra **string** of arguments to `xcrun simctl boot ...` or `emulator -verbose ... @AVD_Name`.                                                                                                                                                                                                                                                                                                        |\n| `forceAdbInstall`    | _Optional. Boolean. Supported for Android devices only._ <br/> A **boolean** value, **false** by default. When set **true**, it tells `device.installApp()` to use `adb install`. Otherwise, it would use the combination of `adb push <app.apk>` and `adb shell pm install`.                                                                                                                                                                                                                       |\n| `utilBinaryPaths`    | _Optional. Array of strings. Supported for Android devices only._ <br/> An array of relative paths of _utility_ app (APK) binary-files to preinstall on the tested devices - once before the test execution begins.<br/>**Note**: these are not affected by various install-lifecycle events, such as launching an app with `device.launchApp({delete: true})`, which reinstalls the app. A good example of why this might come in handy is [Test Butler](https://github.com/linkedin/test-butler). |\n| `gpuMode`            | _Optional. String Literal (<code>auto \\| host \\| swiftshader\\_indirect \\| angle\\_indirect \\| guest</code>). Supported by `android.emulator` only._ <br/> A fixed **string** , which tells [in which GPU mode](https://developer.android.com/studio/run/emulator-acceleration#command-gpu) the emulator should be booted.                                                                                                                                                                            |\n| `headless`           | _Optional. Boolean. Supported by `android.emulator` only._ <br/>  _False_ by default. When set to _true_, it tells Detox to boot an Android emulator with `-no-window` option.                                                                                                                                                                                                                                                                                                                      |\n| `readonly`           | _Optional. Boolean. Supported by `android.emulator` only._ <br/>  _False_ by default. When set to _true_, it forces Detox to boot even a single emulator with `-read-only` option.<br/>**Note**: when used with multiple workers, this setting has no effect — emulators will be booted always with `-read-only`.                                                                                                                                                                                   |\n\nAlso, in the Detox `configurations` you can use the device configs as-is, without aliasing:\n\n```js\n{\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"device\": {\n        \"type\": \"ios.simulator\",\n        \"device\": {\n          \"type\": \"iPhone 12 Pro\"\n        }\n      },\n      \"app\": \"alias-to-app\"\n      // ...\n    }\n  }\n}\n```\n\n#### Apps configurations\n\nThe format of Detox config allows you to define inside it multiple app configs in a key-value manner, i.e.:\n\n```js\n{\n  \"devices\": {\n    // ... see above ...\n  },\n  \"apps\": {\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/example.app\",\n      \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build\"\n    },\n    \"android.release\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"path/to/myApp.apk\",\n      \"build\": \"...\"\n    }\n  },\n  \"configurations\": {\n    // ... see above ...\n  }\n}\n```\n\nAn app config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                             |\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`               | Mandatory property to discern app types: `ios.app`, `android.apk`.                                                                                                                                                  |\n| `name`               | Use only when working with multiple apps within the same configuration. See an example below.                                                                                                                       |\n| `binaryPath`         | Relative path to the ipa/app/apk due to be tested (make sure you build the app in a project relative path)                                                                                                          |\n| `build`              | **\\[optional]** Build command (normally an `xcodebuild` command you use to build your app), which can be called later using Detox CLI tool as a convenience.                                                        |\n| `testBinaryPath`     | (optional, Android only): relative path to the test app (apk)                                                                                                                                                       |\n| `launchArgs`         | **\\[optional]** An object specifying arguments (key-values pairs) to pass through into the app, upon launching on the device. For more info, refer to the dedicated [launch-arguments guide](versioned_docs/version-19.x/APIRef.LaunchArgs.md). |\n\nTo work with multiple apps within the same configuration you should be giving each app its name, e.g.:\n\n```js\n{\n  \"apps\": {\n    \"driver.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"driver\",\n      \"binaryPath\": \"path/to/driver.app\"\n    },\n    \"passenger.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"passenger\",\n      \"binaryPath\": \"path/to/passenger.app\"\n    }\n  },\n  \"configurations\": {\n    \"ios.release\": {\n      \"device\": \"simulator\",\n      \"apps\": [\"driver\", \"passenger\"]\n    }\n  }\n}\n```\n\nAfter that, you can change the current app in your tests via [device API](versioned_docs/version-19.x/APIRef.DeviceObjectAPI.md):\n\n```js\nawait device.selectApp('driver');\nawait device.launchApp();\n// ... run tests ...\nawait device.selectApp('passenger');\nawait device.launchApp();\n// ... run tests ...\n```\n\nSimilar to device configs, any app config can be inlined as well:\n\n```js\n{\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"device\": \"simulator\",\n      \"app\": {\n        \"type\": \"ios.app\",\n        \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/example.app\",\n        \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build\"\n      }\n    }\n  }\n}\n```\n\n#### Artifacts Configuration\n\nSee more details in [artifacts doc](versioned_docs/version-19.x/APIRef.Artifacts.md).\n\nDetox can store artifacts such as transient screenshots and device logs.\nYou can control artifacts collection via Detox configuration:\n\n```js\n{\n  \"artifacts\": {\n    \"rootDir\": \".artifacts\",\n    \"pathBuilder\": \"./config/pathbuilder.js\",\n    \"plugins\": {\n      \"instruments\": {\"enabled\": false},\n      \"log\": {\"enabled\": true},\n      \"uiHierarchy\": \"enabled\",\n      \"screenshot\": {\n        \"shouldTakeAutomaticSnapshots\": true,\n        \"keepOnlyFailedTestsArtifacts\": true,\n        \"takeWhen\": {\n          \"testStart\": false,\n          \"testDone\": true\n        }\n      },\n      \"video\": {\n        \"android\": {\n          \"bitRate\": 4000000\n        },\n        \"simulator\": {\n          \"codec\": \"hevc\"\n        }\n      }\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      // ...\n      \"artifacts\": {\n        \"rootDir\": \".artifacts/ios\",\n        \"plugins\": {\n          \"instruments\": \"all\"\n        }\n      }\n    }\n  }\n}\n```\n\nAs can be seen from the example above, in a specific configuration you may override individual properties from the default artifacts\nconfiguration. For instance, in the example above you can see that specifically in `ios.sim.release` we turn on `instruments` plugin.\n\nCLI arguments (e.g., `--artifacts-location`, `--record-logs`) still have the highest priority and override their counterparts from JSON.\n\nAlso, that example demonstrates that you can use strings (identical to the ones from CLI) in parallel to the object configurations for plugins.\nBelow you can see mappings between the string presets and the corresponding objects:\n\n| preset  | object                                                       |\n| ------- | ------------------------------------------------------------ |\n| none    | `{ \"enabled\": false }`                                       |\n| all     | `{ \"enabled\": true }`                                        |\n| failing | `{ \"enabled\": true, \"keepOnlyFailedTestsArtifacts\": true }`  |\n| manual  | `{ \"enabled\": true, \"shouldTakeAutomaticSnapshots\": false }` |\n\nThere is also a shortcut to disable artifacts for a specific configuration:\n\n```js\n{\n  \"configurations\": {\n    \"ios.no-artifacts\": {\n      // ...\n      \"artifacts\": false\n    }\n  }\n}\n```\n\n#### Behavior Configuration\n\nIf you need to tweak the flow of `detox.init()` or `detox.cleanup()` steps,\nyou have a few options to change. These are the default behavior values:\n\n```json\n{\n  \"detox\": {\n    \"behavior\": {\n      \"init\": {\n        \"reinstallApp\": true,\n        \"exposeGlobals\": true\n      },\n      \"launchApp\": \"auto\",\n      \"cleanup\": {\n        \"shutdownDevice\": false\n      }\n    }\n  }\n}\n```\n\nThe `launchApp: \"auto\"` setting can be changed to `\"manual\"` for cases when you want to debug the\nnative codebase when running Detox tests. Usually **you never need that**, but if you do, follow the\n[Debugging Apps in Android Studio During a Test](versioned_docs/version-19.x/Guide.DebuggingInAndroidStudio.md) guide to learn\nmore about this. When set to `manual`, it changes the default value of `reinstallApp` to `false`.\n\nSetting `reinstallApp: false` will make the tests reuse the currently installed app on the device,\nprovided you have installed it beforehand explicitly or manually.\n\nIf you do not wish to leak Detox globals (`expect`, `device`, `by`, etc.) to the global\nscope, you can set `\"exposeGlobals\": false` and destructure them respectively from the\nexported Detox interface:\n\n```js\nconst { by, device, expect, element } = require('./index');\n```\n\nAlso, you can override the behavior in specific Detox configurations:\n\n```js\n{\n  \"behavior\": {\n    // ... global behavior ...\n  },\n  \"configurations\": {\n    \"ios.manual\": {\n      \"behavior\": {\n        // ... overrides ...\n        \"launchApp\": \"manual\"\n        // ... overrides ...\n      }\n    }\n  }\n}\n```\n\n#### Server Configuration\n\nDetox can either initialize a server using a generated configuration, or can be overridden with a manual configuration:\n\n```json\n{\n  \"session\": {\n    \"server\": \"ws://localhost:8099\",\n    \"sessionId\": \"YourProjectSessionId\"\n  }\n}\n```\n\nWhen you define a session config, the Detox server won’t start automatically anymore — it is assumed that\nyou will be running it independently via `detox run-server` CLI command. Alternatively, you can set the\n`autoStart` property to be explicitly `true`:\n\n```diff\n   \"session\": {\n+    \"autoStart\": true,\n     \"server\": \"ws://localhost:8099\",\n     \"sessionId\": \"YourProjectSessionId\"\n```\n\nDefining an explicit session config with `server` and `sessionId` also means you cannot use multiple workers,\nsince the specified port will become busy for any test worker next to the first one to occupy it.\n\nSession can be set also per device configuration — then it takes a higher priority over the global\nsession config:\n\n```json\n{\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      // ...\n      \"session\": {\n        \"server\": \"ws://localhost:8099\",\n        \"sessionId\": \"YourProjectSessionId\"\n      }\n    }\n  }\n}\n```\n\nAlso, you can specify an optional numeric `debugSynchronization` parameter\n(see also `--debug-synchronization` in [`detox-cli` test section](APIRef.DetoxCLI.md#test)).\nWhen an action/expectation takes a significant amount time, use this option to print device synchronization status.\nThe status will be printed if the action takes more than _\\[N]_ ms to complete.\n\n```json\n{\n  \"session\": {\n    \"debugSynchronization\": 20000\n  }\n}\n```\n\nTo disable `debugSynchronization` explicitly, use `0`.\n\n### `detox-cli`\n\n#### Build Configuration\n\nIn your detox config (in `package.json`) paste your build command into the configuration’s `build` field.\nThe build command will be triggered when running `detox build`.\n**This is only a convenience method, to help you manage building multiple configurations of your app and couple them to your tests. You can also choose not to use it and provide a compiled `app` by yourself.**\n\nYou can choose to build your project in any of these ways...\n\n- If there’s only one configuration, you can simply use:\n\n  ```sh\n  detox build\n  ```\n\n- To choose a specific configuration:\n\n  ```sh\n  detox build --configuration yourConfiguration\n  ```\n\n- Building with `xcodebuild`:\n\n  ```sh\n  xcodebuild -project ios/YourProject.xcodeproj -scheme YourProject -sdk iphonesimulator -derivedDataPath ios/build\n  ```\n\n- Building using React Native, this is the least suggested way of running your build, since it also starts a random simulator and installs the app on it.\n\n  ```sh\n  react-native run-ios\n  ```\n\n> Note: remember to update the `app` path in your `package.json`.\n\n#### Test Configuration\n\n- If there’s only one configuration, you can simply use:\n\n  ```sh\n  detox test ./e2e\n  ```\n\nwhere `./e2e` is the path to your Detox tests folder.\n\n- For multiple configurations, choose your configuration by passing `--configuration` param:\n\n  ```sh\n  detox test ./e2e --configuration yourConfiguration\n  ```\n\n#### Faster Test Runs with App Reuse\n\nBy default, the app is removed, reinstalled and launched before each run.\nStarting fresh is critical in CI but during the development you might be able to save time between test runs and reuse the app that was previously installed in the simulator. To do so use the `reuse` flag and run your tests like this:\n\n```sh\ndetox test ./e2e --reuse\n```\n\nThis is especially useful with React Native development mode when making JavaScript code changes that are getting picked up by the packager (and thus no reinstall is needed). This can save up to 7 seconds per run!\nYou should not use this option if you made native code changes or if your app relies on local (\"disk\") storage.\n"
  },
  {
    "path": "website/versioned_docs/version-19.x/introduction/getting-started.md",
    "content": "---\ntitle: Getting Started\n---\n\n## Getting Started\n\n**Welcome to Detox!**\n\nIn this guide, we will walk you through setting Detox up in your project, one step at a time.\n\nYou will find that some steps are longer than the others: some are just one-paragraph long, while for others we have a dedicated multistep guide worked out. Bear with us - it is all necessary, and once set-up, it is easy to move forward with writing tests very rapidly.\n\n## Step 1: Environment Setup\n\n### Install [Node.js](https://nodejs.org/en/)\n\n`Node.js` is the JavaScript runtime Detox will run on. **Install Node.js `v12.0` or above**.\n\nThere’s more than one way to install Node.js:\n\n- Download from the [official download page](https://nodejs.org/en/download/)\n- Use [Homebrew](https://formulae.brew.sh/formula/node)\n- Use `nvm` - if you need to allow for several versions to be installed on a single machine\n\nThe simplest way is to use Homebrew:\n\n```sh\nbrew install node\n```\n\n> Tip: Verify installation succeeded by typing in `node -v` in the terminal to output current node version.\n\n### Install Detox Command Line Tools (`detox-cli`)\n\nThis package makes it easier to operate Detox from the command line. `detox-cli` should be installed globally, enabling usage of the command line tools outside your npm scripts. `detox-cli` is merely a script that passes commands through to a command line tool shipped inside `detox` package (in `node_modules/.bin/detox`).\n\n```bash npm2yarn\nnpm install detox-cli --global\n```\n\n### Install Platform-specific Dependencies, Tools and SDKs\n\nDepending on the platform/s you’re aiming at (iOS, Android), take the time to run through these environment setup guides:\n\n- [Android](../Introduction.AndroidDevEnv.md)\n- [iOS](../Introduction.iOSDevEnv.md)\n\n## Step 2: Add Detox to Your Project\n\n### Install the Detox Node-module\n\nIf you have a React Native project, go to its root folder (where `package.json` is found) and type the following command:\n\n```bash npm2yarn\nnpm install detox --save-dev\n```\n\nIf you have a project without Node integration (such as a native project), add the following `package.json` file to the root folder of your project:\n\n```json\n{\n  \"name\": \"<your_project_name>\",\n  \"version\": \"0.0.1\"\n}\n```\n\nName your project in `package.json` and then run the following command:\n\n```bash npm2yarn\nnpm install detox --save-dev --no-package-lock\n```\n\n**You should now have Detox available in `node_modules/detox`**\n\n> **Tip:** Remember to add the `node_modules` folder to your git ignore file (e.g. `.gitignore`).\n\n### Set Up a Test Runner\n\nDetox delegates the actual JavaScript test-code execution to a dedicated test-runner. It supports the popular `Jest` and `Mocha` out of the box. You need to choose and set up one of them now, but it _is_ possible to switch later on, should you change your mind.\n\n- **[Jest](https://jestjs.io/) is the recommended test runner for use with Detox**, since it provides parallel test execution and a complete lifecycle integration with Detox. To set up, follow [our comprehensive guide for Jest](versioned_docs/version-19.x/Guide.Jest.md).\n- [Mocha](https://mochajs.org/), albeit its integration is less complete, is still lightweight, and a bit easier to set up. To set up, follow [our guide for Mocha](versioned_docs/version-19.x/Guide.Mocha.md).\n\n> **Note:** Detox is coupled to neither Mocha or Jest, nor with a specific directory structure. Both runners are just a recommendation — with some effort, they can be replaced without touching the internal implementation of Detox itself.\n\n### Apply Detox Configuration\n\nIf you’ve completed the test-runner setup successfully using `detox init`, you should have a `.detoxrc.json` file containing a skeletal configuration for Detox to use. This configuration is only half-baked and needs to be set up properly. You now need to either create or edit that file, and apply the actual configuration suitable for your specific project.\n\nDetox scans for a configuration through multiple files. It starts from the current working directory, and runs over the following options, in this order:\n\n1. `.detoxrc.js`\n1. `.detoxrc.json`\n1. `.detoxrc`\n1. `detox.config.js`\n1. `detox.config.json`\n1. `package.json` (`\"detox\"` section)\n\nIf you prefer to use something other than `.detoxrc.json`—for example, would like to keep all project configs in one place—you can create a `detox` section in your `package.json`. If you otherwise prefer separating configs, all of the other options are valid.\n\nFor specific configuration options for each supported platform, see:\n\n- [Android](versioned_docs/version-19.x/Introduction.Android.md)\n- [iOS](versioned_docs/version-19.x/Introduction.iOS.md)\n\n## Step 3: Build Your App and Run Detox Tests\n\n### 1. Build Your App\n\nUse a convenience method in Detox command line tools to build your project easily:\n\n```sh\ndetox build --configuration <your configuration name>\n```\n\n> **Note:** Detox executes the build command you specified in your Detox configuration. If your build fails, make sure to provide the correct build command.\n\n### 2. Run the Tests\n\nUse the Detox command line tools to test your project easily:\n\n```sh\ndetox test --configuration <your configuration name>\n```\n\nThat’s it. Your first failing Detox test is running!\n\nNext, we’ll go over usage and how to make this test [actually pass](versioned_docs/version-19.x/Introduction.WritingFirstTest.md).\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/actions.md",
    "content": "# Actions\n\nDetox uses [matchers](matchers.md) to find UI elements in your app and actions to simulate user interaction with those elements.\n\nUse [expectations](expect.md) to verify element states.\n\n## Methods\n\n- [`.tap()`](#tappoint)\n- [`.multiTap()`](#multitaptimes)\n- [`.longPress()`](#longpresspoint-duration)\n- [`.longPressAndDrag()`](#longpressanddragduration-normalizedpositionx-normalizedpositiony-targetelement-normalizedtargetpositionx-normalizedtargetpositiony-speed-holdduration)\n- [`.swipe()`](#swipedirection-speed-normalizedoffset-normalizedstartingpointx-normalizedstartingpointy)\n- [`.pinch()`](#pinchscale-speed-angle--ios-only) **iOS only**\n- [`.scrollToIndex()`](#scrolltoindexindex--android-only) **Android only**\n- [`.scroll()`](#scrolloffset-direction-startpositionx-startpositiony)\n  - [`whileElement()`](#whileelementelement)\n- [`.scrollTo()`](#scrolltoedge)\n- [`.typeText()`](#typetexttext)\n- [`.replaceText()`](#replacetexttext)\n- [`.clearText()`](#cleartext)\n- [`.tapReturnKey()`](#tapreturnkey)\n- [`.tapBackspaceKey()`](#tapbackspacekey)\n- [`.setColumnToValue()`](#setcolumntovaluecolumn-value--ios-only) **iOS only**\n- [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat)\n- [`.adjustSliderToPosition()`](#adjustslidertopositionnormalizedposition)\n- [`.getAttributes()`](#getattributes)\n- [`.takeScreenshot(name)`](#takescreenshotname)\n- [`.performAccessibilityAction()`](#performaccessibilityactionactionname)\n\n### `tap(point)`\n\nSimulates a tap on the element at the specified point, or at element’s activation point if no point is specified.\n\n`point`—a point in the element’s coordinate space (optional, valid input: object with x and y numerical values, default is `null`)\n\n**Note:** Special care should be applied when specifying a point with this method. Elements may have different dimensions when displayed on different device screen sizes, different text sizes, etc.\n\n```js\nawait element(by.id('tappable')).tap();\nawait element(by.id('tappable')).tap({x:5, y:10});\n```\n\n### `multiTap(times)`\n\nSimulates multiple taps on the element at its activation point. All taps are applied as a part of the same gesture and there is no synchronization attempt between taps.\n\n`times`—the number of taps to simulate (number, 1 and above)\n\n```js\nawait element(by.id('tappable')).multiTap(3);\n```\n\n### `longPress(point, duration)`\n\nSimulates a long press on the element at its activation point or at the specified point.\n\n`point` — a point in the element’s coordinate space (optional, object with `x` and `y` numerical values, default is `null`).\n`duration` — press during time, in milliseconds. Optional (defaults to the standard long-press duration for the platform).\n\n```js\nawait element(by.id('tappable')).longPress();\nawait element(by.id('tappable')).longPress({x:5, y:10});\nawait element(by.id('tappable')).longPress(1500);\nawait element(by.id('tappable')).longPress({x:5, y:10}, 1500);\n```\n\n:::note Important\n\nCustom durations should be used cautiously, as they can affect test consistency and user experience expectations.\nThey are typically necessary when testing components that behave differently from the platform's defaults or when simulating unique user interactions.\n\n:::\n\n### `longPressAndDrag(duration, normalizedPositionX, normalizedPositionY, targetElement, normalizedTargetPositionX, normalizedTargetPositionY, speed, holdDuration)`\n\nSimulates a long press on the element and then drag it to a position of another element.\n\n- `duration` —the duration to press for, in ms (required) <br/>\n- `normalizedPositionX` — X coordinate of the starting point, relative to the element width (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `normalizedPositionY` — Y coordinate of the starting point, relative to the element height (required, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `targetElement`— the target element to drag to (required) <br/>\n- `normalizedTargetPositionX` — X coordinate of the ending point, relative to the target element width (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `normalizedTargetPositionY` — Y coordinate of the ending point, relative to the target element height (optional, a number between 0.0 and 1.0, `NaN` — choose an optimal value automatically) <br/>\n- `speed` — the speed of the drag (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n- `holdDuration` — the duration before releasing at the end, in ms (optional, default is 1000)\n\n```js\nawait element(by.id('elementToDrag')).longPressAndDrag(2000, NaN, NaN, element(by.id('targetElement')), NaN, NaN);\nawait element(by.id('cellId_1')).longPressAndDrag(2000, 0.9, NaN, element(by.id('cellId_6')), 0.9, NaN, 'slow', 0);\n```\n\n### `swipe(direction[, speed, normalizedOffset, normalizedStartingPointX, normalizedStartingPointY])`\n\nSimulates a swipe on the element with the provided options.\n\n- `direction` — the direction of the swipe (required, valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n- `speed` — the speed of the swipe (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"fast\"`) <br/>\n- `normalizedOffset` — swipe amount relative to the screen width/height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n- `normalizedStartingPointX` — X coordinate of the swipe starting point, relative to the element width (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically) <br/>\n- `normalizedStartingPointY` — Y coordinate of the swipe starting point, relative to the element height (optional, a number between 0.0 and 1.0, default is `NaN` — choose an optimal value automatically)\n\n```js\nawait element(by.id('scrollView')).swipe('down');\nawait element(by.id('scrollView')).swipe('down', 'slow'); // set swipe speed\nawait element(by.id('scrollView')).swipe('down', 'fast', 0.75); // set swipe amount\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, 0.8); // set starting point X\nawait element(by.id('scrollView')).swipe('down', 'fast', NaN, NaN, 0.25); // set starting point Y\n```\n\n### `pinch(scale, speed, angle)`  iOS only\n\nSimulates a pinch on the element with the provided options.\n\n`scale`—the scale of the pinch gesture; use a scale between 0 and 1 to zoom out, and a scale greater than 1 to zoom in; the system makes a best effort to accommodate the requested scale, taking into account the element’s dimensions (valid input: (0.0, inf]) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinch(1.1); //Zooms in a little bit\nawait element(by.id('PinchableScrollView')).pinch(2.0); //Zooms in a lot\nawait element(by.id('PinchableScrollView')).pinch(0.001); //Zooms out a lot\n```\n\n### `scrollToIndex(index)`  Android only\n\nScrolls until it reaches the element with the provided index. This works for `ReactScrollView` and `ReactHorizontalScrollView`.\n\n`index`—the index of the target element <br/>\n\n```js\nawait element(by.id('scrollView')).scrollToIndex(0);\n```\n\n### `scroll(offset, direction[, startPositionX, startPositionY])`\n\nSimulates a scroll on the element with the provided options.\n\n`offset`—the offset to scroll, in points <br/>\n`direction`—the scroll’s direction (valid input: `\"left\"`/`\"right\"`/`\"up\"`/`\"down\"`) <br/>\n`startPositionX`—the normalized x percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`) <br/>\n`startPositionY`—the normalized y percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`)\n\n```js\nawait element(by.id('scrollView')).scroll(100, 'up');\nawait element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85);\n```\n\n### `whileElement(element)`\n\nContinuously scrolls the scroll element until the specified expectation is resolved. If the edge of the scroll element is reached while the expectation is not resolved, the operation is failed.\n\n```js\nawait waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down');\n```\n\n### `scrollTo(edge[, startPositionX, startPositionY])`\n\nSimulates a scroll to the specified edge.\n\n`edge`—the edge to scroll to (valid input: `\"left\"`/`\"right\"`/`\"top\"`/`\"bottom\"`) <br/>\n`startPositionX`—the normalized x percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`) <br/>\n`startPositionY`—the normalized y percentage of the element to use as scroll start point (optional, valid input: \\[0.0, 1.0], `NaN`—choose an optimal value automatically, default is `NaN`)\n\n```js\nawait element(by.id('scrollView')).scrollTo('bottom');\nawait element(by.id('scrollView')).scrollTo('top', NaN, 0.2);\n```\n\n### `typeText(text)`\n\nSimulates typing of the specified text into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be typed into, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before typing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to type (valid input: string)\n\n```js\nawait element(by.id('textField')).typeText('passcode');\n```\n\n### `replaceText(text)`\n\nReplaces the element’s text with the specified text, without using the system’s builtin keyboard or typing behavior. **Note**, that using this method is faster than using [`.typeText()`](#typetexttext), but may not trigger all text input callbacks, causing an undefined state in your app.\n\nOn iOS, any element’s text can be replaced, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before replacing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n`text`—the text to replace with (valid input: string)\n\n```js\nawait element(by.id('textField')).replaceText('passcode again');\n```\n\n### `clearText()`\n\nSimulates clearing the text of the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element’s text can be cleared, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before clearing the text, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).clearText();\n```\n\n### `tapReturnKey()`\n\nSimulates tapping on the return key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent return key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the return key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapReturnKey();\n```\n\n### `tapBackspaceKey()`\n\nSimulates tapping of the backspace key into the element, using the system’s builtin keyboard and typing behavior.\n\nOn iOS, any element can be sent backspace key input, as long as it can become first responder and conforms to the [`UITextInput`](https://developer.apple.com/documentation/uikit/uitextinput) protocol. Before tapping on the backspace key, Detox attempts making the element the first responder, if it isn’t already. If the element’s window is not key window, Detox attempts making it the key window.\n\n```js\nawait element(by.id('textField')).tapBackspaceKey();\n```\n\n### `setColumnToValue(column, value)`  iOS only\n\nSets the element’s specified column to the specified value, using the system’s picker view APIs.\n\nValues accepted by this method are strings only, and the system will do its best to match complex picker view cells to the string.\n\nThis function does not support date pickers. Use [`.setDatePickerDate()`](#setdatepickerdatedatestring-dateformat) instead.\n\n`column`—the element’s column to set (valid input: number, 0 and above) <br/>\n`value`—the string value to set (valid input: string)\n\n```js\nawait element(by.id('pickerView')).setColumnToValue(1, \"6\");\nawait element(by.id('pickerView')).setColumnToValue(2, \"Hello World\");\n```\n\n> **Note:** When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles. See [here](device.md#9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only) for more information.\n\n### `setDatePickerDate(dateString, dateFormat)`\n\nSets the date-picker’s date to the specified date and time.\n\n`dateString`—The date to set. Should match the format provided by `dateFormat`.<br/>\n`dateFormat`—The format of `dateString`. Should be either [`'ISO8601'`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString), or an explicit date representation format, as supported by [`NSDateFormatter`] on iOS / [`DateTimeFormatter`] on Android (e.g. `'yyyy/MM/dd'`).\n\n> _The recommended `dateFormat` is `ISO8601`._\n\nExamples:\n\n```js\nconst datePicker = element(by.id('datePicker'));\n\n// ISO8601:\nawait datePicker.setDatePickerDate('2019-02-06T05:10:00-08:00', 'ISO8601');\nawait datePicker.setDatePickerDate(new Date().toISOString(), 'ISO8601'); // toISOString returns an ISO8601 format with no timezone (UTC-0)\n\n// Explicit format:\nawait datePicker.setDatePickerDate('2019/02/06', \"yyyy/MM/dd\");\n```\n\n:::info\n\nAs far as element-matching is concerned, on Android, older versions of the popular [`@react-native-community/datetimepicker`] package don’t allow for the specification of your own [`testID`] prop for the date-picker component. Therefore, you'd have to either upgrade your package  to a newer version containing [PR datetimepicker#705] inside, or use Detox's [`by.type`] matcher as a workaround. For example:\n\n```js\nconst datePicker = device.getPlatform() === 'android'\n  ? element(by.type('android.widget.DatePicker'))\n  : element(by.id('datePicker'));\n```\n\n:::\n\n### `adjustSliderToPosition(normalizedPosition)`\n\nManipulates the UI to change the displayed value of the slider element to a new value, based on a normalized position.\n\n`normalizedPosition`—The normalized position to adjust the slider element. (valid input: \\[0, 1], 0 corresponds to the minimum value of the slider, and 1 corresponds to the maximum value)\n\n```js\nawait element(by.id('slider')).adjustSliderToPosition(0.75);\n```\n\n### `getAttributes()`\n\nReturns an object, representing various attributes of the element.\n\nRetrieved attributes are:\n\n- `text`: The text value of any textual element.\n- `label`: The label of the element. Matches `accessibilityLabel` for iOS, and `contentDescription` for android. Refer to the [`.toHaveLabel()` API](./expect.md#tohavelabellabel) in order to learn about caveats associated with this attribute in React Native apps.\n- `placeholder`: The placeholder text value of the element. Matches `hint` on android.\n- `enabled`: Whether the element is enabled for user interaction.\n- `identifier`: The identifier of the element. Matches `accessibilityIdentifier` on iOS, and the main view tag, on Android - both commonly **holding the component’s test ID in React Native apps**.\n- `visible`: Whether the element is visible. On iOS, visibility is calculated for the [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint). On Android, the attribute directly holds the value returned by [View.getLocalVisibleRect()](https://developer.android.com/reference/kotlin/android/view/View#getglobalvisiblerect)).\n- `value`: The value of the element, where applicable. For example: the position of a slider, or whether a checkbox has been marked. Matches `accessibilityValue`, on iOS.\n- `frame`: The frame of the element, in screen coordinate space.\n\n#### iOS-Only\n\n- `activationPoint`: The [activation point](https://developer.apple.com/documentation/objectivec/nsobject/1615179-accessibilityactivationpoint) of the element, in element coordinate space.\n- `normalizedActivationPoint`: The activation point of the element, in normalized percentage (\\[0.0, 1.0]).\n- `hittable`: Whether the element is hittable at the activation point.\n- `elementFrame`: The frame of the element, in container coordinate space.\n- `elementBounds`: The bounds of the element, in element coordinate space.\n- `safeAreaInsets`: The safe area insets of the element, in element coordinate space.\n- `elementSafeBounds`: The safe area bounds of the element, in element coordinate space.\n- `date`: The date of the element (in case the element is a date picker).\n- `normalizedSliderPosition`: The normalized slider position (in case the element is a slider).\n- `contentOffset`: The content offset (in case the element is a scroll view).\n- `contentInset`: The content inset (in case the element is a scroll view).\n- `adjustedContentInset`: The adjusted content inset (in case the element is a scroll view).\n\n#### Android-Only\n\n- `visibility`: The OS visibility type associated with the element: `visible`, `invisible` or `gone`.\n- `width`: Width of the element, in pixels (deprecated).\n- `height`: Height of the element, in pixels (deprecated).\n- `elevation`: Elevation of the element.\n- `alpha`: Alpha value for the element.\n- `focused`: Whether the element is the one currently in focus.\n- `textSize`: The text size for the text element.\n- `length`: The length of the text element (character count).\n\nIf the value for a given attribute is null or cannot be otherwise computed, the key will not be present, but empty strings may be found in the object.\n\nIf the query matches multiple elements, the attributes of all matched elements is returned as an array of objects under the `elements` key.\n\n```js\n// import jestExpect from 'expect';\nconst jestExpect = require('expect').default;\n\n// ...\nconst attributes = await element(by.text('Tap Me')).getAttributes();\njestExpect(attributes.text).toBe('Tap Me');\n\nconst multipleMatchedElements = await element(by.text('Multiple')).getAttributes();\njestExpect(multipleMatchedElements.elements.length).toBe(5);\njestExpect(multipleMatchedElements.elements[0].identifier).toBe('FirstElement');\n```\n\n### `takeScreenshot(name)`\n\nTakes a screenshot of the matched element. For full details on taking screenshots with Detox, refer to the [screenshots guide](../guide/taking-screenshots.md).\n\n`name`—the name of the screenshot\n\n### `performAccessibilityAction(actionName)`\n\nTriggers an [accessibility action](https://reactnative.dev/docs/accessibility#accessibility-actions).\n\n`actionName`—the name of the accessibility action <br/>\n\n```js\nawait element(by.id('scrollView')).performAccessibilityAction(\"activate\");\n```\n\n## Deprecated Methods\n\n- [`.tapAtPoint()`](#tapatpointpoint)\n- [`.pinchWithAngle()`](#pinchwithangledirection-speed-angle--ios-only) **iOS only**\n\n### `tapAtPoint(point)`\n\n**Deprecated:** Use [`.tap()`](#tappoint) instead.\n\nSimulates a tap at on the element at the specified point.\n\n`point`—a point in the element’s coordinate space\n\n```js\nawait element(by.id('tappable')).tapAtPoint({x:5, y:10});\n```\n\n### `pinchWithAngle(direction, speed, angle)`  iOS only\n\n**Deprecated:** Use [`.pinch()`](#pinchscale-speed-angle--ios-only) instead.\n\nSimulates a pinch on the element with the provided options.\n\n`direction`—the direction of the pinch gesture (valid input: `\"inward\"`/`\"outward\"`) <br/>\n`speed`—the speed of the pinch (optional, valid input: `\"fast\"`/`\"slow\"` , default is `\"slow\"`) <br/>\n`angle`—the angle of the pinch, in radians (optional, default is 0.0)\n\n```js\nawait element(by.id('PinchableScrollView')).pinchWithAngle('outward', 'slow', 0);\n```\n\n[`testID`]: ../guide/test-id.md\n\n[`by.type`]: ../api/matchers.md#bytypeclassname\n\n[`Date.prototype.toISOString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n\n[`NSDateFormatter`]: https://developer.apple.com/documentation/foundation/dateformatter\n\n[`DateTimeFormatter`]: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html\n\n[`@react-native-community/datetimepicker`]: https://www.npmjs.com/package/@react-native-community/datetimepicker\n\n[PR datetimepicker#705]: https://github.com/react-native-datetimepicker/datetimepicker/pull/705\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/device.md",
    "content": "# Device\n\nThe `device` object is globally available in every test file, unless you use `exposeGlobals: false` in the behavior config,\nand even then you can import it from Detox package:\n\n```js\nconst { device } = require('detox');\n```\n\nIt enables control over the current attached device.\n\n## Public Properties\n\n### `device.id`\n\nHolds the environment-unique ID of the device - namely, the `adb` ID on Android (e.g. `emulator-5554`) and the Mac-global simulator UDID on iOS, as used by `simctl` (e.g. `AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE`).\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n### `device.name`\n\nHolds a descriptive name of the device. Example: `emulator-5554 (Pixel_API_26)`\n\nThe value will be `undefined` until the device is properly _prepared_ (i.e. in `detox.init()`).\n\n### `device.appLaunchArgs`\n\nAccess the launch-arguments predefined by the user in preliminary, static scopes such as the Detox [configuration file](../config/apps.mdx)\nand [command-line arguments](../cli/test.md). This access allows, through dedicated methods, for both value-querying and modification:\n\n```js\n// Modify some of the predefined arguments:\ndevice.appLaunchArgs.modify({\n  mockServerPort: 1234,\n});\n// Retrieve the arguments:\ndevice.appLaunchArgs.get(); // ==> { mockServerPort: 1234 }\n// Reset (i.e. remove all arguments):\ndevice.appLaunchArgs.reset();\n```\n\nIn multi-app environments, you might want to persist your values between `device.selectApp(name)` calls:\n\n```js\ndevice.appLaunchArgs.modify({ transientArg: 'value' });\ndevice.appLaunchArgs.shared.modify({\n  permanentMockServerPort: 1234,\n};\n\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234, transientArg: 'value' }\ndevice.appLaunchArgs.shared.get(); // ==> { permanentMockServerPort: 1234 }\n\nawait device.selectApp('anotherApp');\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.reset();\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.shared.reset();\ndevice.appLaunchArgs.get(); // ==> {}\n```\n\nThis is the most flexible way of editing the launch arguments. Refer to the [launch arguments guide](../guide/launch-args.md) for complete details.\n\n## Methods\n\n### `device.selectApp(name)`\n\nUse **only for advanced multi-app configs** when you need to switch between your apps\nwithin the same test scenario. Refer to the [configuration doc](../config/apps.mdx)\nto discover how to define multiple apps with different `name`s.\n\n```js\nawait device.selectApp('myAppName');\n```\n\nAs a side effect (due to the current architectural limitation) running `device.selectApp` terminates the previous\napp that had been running before.\n\n### `device.launchApp(params)`\n\nLaunch the app defined in the current [`configuration`](../config/overview.mdx).\n\n`params`—object, containing one of more of the following keys and values:\n\n#### 1. `newInstance`—Launching a New Instance of the App\n\nTerminate the app and launch it again.\n\nIf set to `false`, the device will try to resume the app (e.g. bring from foreground to background). If the app isn’t running, **it will launch a new instance** nonetheless. **Default is `false`.**\n\n```js\nawait device.launchApp({newInstance: true});\n```\n\n#### 2. `permissions`—Set Runtime Permissions (iOS Only)\n\nGrants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied.\n\n```js\nawait device.launchApp({permissions: {calendar: 'YES'}});\n```\n\nDetox uses [AppleSimUtils](https://github.com/wix/AppleSimulatorUtils) and [`xcrun simctl`](https://nshipster.com/simctl/) to implement this functionality for iOS simulators.\nPlease make sure you have the most recent version of both tools installed, since we rely on their latest versions.\n\n##### Supported Permissions\n\n| Permission    | Values                         | Notes                                                        |\n| ------------- | ------------------------------ | ------------------------------------------------------------ |\n| location      | always / inuse / never / unset | inuse - provides location access only when the app is in use |\n| contacts      | YES / NO / unset / limited     | limited - grants limited access to contacts                  |\n| photos        | YES / NO / unset / limited     | limited - grants limited access to photos                    |\n| calendar      | YES / NO / unset               |                                                              |\n| camera        | YES / NO / unset               |                                                              |\n| medialibrary  | YES / NO / unset               |                                                              |\n| microphone    | YES / NO / unset               |                                                              |\n| motion        | YES / NO / unset               |                                                              |\n| reminders     | YES / NO / unset               |                                                              |\n| siri          | YES / NO / unset               |                                                              |\n| notifications | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| health        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| homekit       | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| speech        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| faceid        | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n| userTracking  | YES / NO / unset               | Requires AppleSimUtils; unsupported by simctl                |\n\nCheck Detox's [own test suite](https://github.com/wix/Detox/blob/master/detox/test/e2e/13.permissions.test.js) for usage examples.\n\n#### 3. `url`—Launching with URL\n\nLaunches the app with the specified URL to test your app’s deep link handling mechanism.\n\n```js\nawait device.launchApp({url});\nawait device.launchApp({url, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({url, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](../guide/mocking-open-with-url.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 4. `userNotification`—Launching with User Notifications\n\nLaunches with the specified user notification.\n\n```js\nawait device.launchApp({userNotification});\nawait device.launchApp({userNotification, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({userNotification, newInstance: false}); // Reuse existing instance\n```\n\nRead more [here](../guide/mocking-user-notifications.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 5. `userActivity`—Launch with User Activity (iOS Only)\n\nLaunches the app with the specified user activity.\n\n```js\nawait device.launchApp({userActivity: activity});\nawait device.launchApp({userActivity: activity, newInstance: true}); //Launch a new instance of the app\nawait device.launchApp({userActivity: activity, newInstance: false}); //Reuse existing instance\n```\n\nRead more in [here](../guide/mocking-user-activity.md). Go back to subsection 1 to read about the full effect of the `newInstance` argument.\n\n#### 6. `resetAppState`—Reset App State Before Launching\n\nResets the app’s state and launches without necessarily performing a full uninstall/reinstall cycle.\n\n- Android: clears app data using `pm clear`, which is typically faster than reinstalling.\n- iOS: uninstalls and reinstalls the app to restore a clean state.\n\n```js\nawait device.launchApp({resetAppState: true});\n```\n\n#### 7. `delete`—Delete and Reinstall Application Before Launching\n\nUninstalls the app and then reinstalls it before launching. Slower than `resetAppState`,\nbut guarantees a completely fresh install of the app and all its data.\n\n```js\nawait device.launchApp({delete: true});\n```\n\n#### 8. `launchArgs`—Additional Process Launch Arguments\n\nLaunches the app on the device with on-site, user-specified launch arguments:\n\n```js\nawait device.launchApp({\n  launchArgs: {\n    arg1: 1,\n    arg2: \"2\",\n  }\n});\n```\n\nThis is the most explicit and straightforward way of setting launch arguments. Refer to the [launch arguments guide](../guide/launch-args.md) for a complete overview on app launch arguments.\n\n#### 9. `disableTouchIndicators`—Disable Touch Indicators (iOS Only)\n\nDisables touch indicators on iOS. Default is `false`.\n\n```js\nawait device.launchApp({disableTouchIndicators: true});\n```\n\n#### 10. `languageAndLocale`—Launch with a Specific Language and/or Local (iOS Only)\n\nLaunch the app with a specific system language\n\nInformation about accepted values can be found [here](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html).\n\n```js\nawait device.launchApp({\n  languageAndLocale: {\n    language: \"es-MX\",\n    locale: \"es-MX\"\n  }\n});\n```\n\nWith this API, you can run sets of E2E tests per language. For example:\n\n```js\ndescribe.each([\n  ['es-MX'], ['fr-FR'], ['pt-BR'],\n])(`Test suite (locale: %s)`, (locale) => {\n  beforeAll(async () => {\n    await device.launchApp({\n      newInstance: true,\n      languageAndLocale: {\n        language: locale,\n        locale\n      }\n    });\n  });\n\n  test('some description', async () => {\n    // …\n  });\n});\n```\n\n#### 11. `detoxEnableSynchronization`—Initialize Detox with synchronization enabled or disabled at app launch\n\nLaunches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using `device.enableSynchronization()`.\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxEnableSynchronization: 0 }\n});\n```\n\n#### 12. `detoxURLBlacklistRegex`—Initialize the URL Blacklist at app launch\n\nLaunches the app with a URL blacklist to disable network synchronization on certain endpoints.\nUseful if the app makes frequent network calls to blacklisted endpoints upon startup.\n\n> Note that due to the complexity of reg-exps and interoperability concerns, the implementation is fairly sensitive to the format of the string of urls.\n> Please do your best to follow the example below:\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { detoxURLBlacklistRegex: '\\\\(\"^http://192\\.168\\.1\\.253:\\\\d{4}/.*\",\"https://e\\.crashlytics\\.com/spi/v2/events\"\\\\)' },\n});\n```\n\n#### 13. `detoxDisableWebKitSecurity`—Disable WebKit Security (iOS Only)\n\nDisables WebKit security on iOS. Default is `false`.\n\nThis is useful for testing web views with iframes that loads CORS-protected content.\n\n:::caution Important\n\nSome pages may not load correctly when WebKit security is disabled (for example, PCI DSS-compliant pages).\nDisabling WebKit security may cause errors when loading pages that have strict security policies.\n\n:::\n\n```js\nawait device.launchApp({\n  launchArgs: { detoxDisableWebKitSecurity: true }\n});\n```\n\n### `device.terminateApp()`\n\nBy default, `terminateApp()` with no params will terminate the app file defined in the current [`configuration`](../config/overview.mdx).\n\nTo terminate another app, specify its bundle id\n\n```js\nawait device.terminateApp('other.bundle.id');\n```\n\n### `device.sendToHome()`\n\nSend application to background by bringing `com.apple.springboard` to the foreground.\nCombining `sendToHome()` with `launchApp({newInstance: false})` will simulate app coming back from background.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n```js\nawait device.sendToHome();\nawait device.launchApp({newInstance: false});\n// app returned from background, do stuff\n```\n\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js)\n\n### `device.reloadReactNative()`\n\nIf this is a React Native app, reload the React Native JS bundle. This action is much faster than `device.launchApp()`, and can be used if you just need to reset your React Native logic.\n\n<i>**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle.</i>\n\n### `device.installApp()`\n\nBy default, `installApp()` with no params will install the app file defined in the current [`configuration`](../config/overview.mdx).\n\nTo install another app, specify its path\n\n```js\nawait device.installApp('path/to/other/app');\n```\n\n### `device.uninstallApp()`\n\nBy default, `uninstallApp()` with no params will uninstall the app defined in the current [`configuration`](../config/overview.mdx).\n\nTo uninstall another app, specify its bundle id\n\n```js\nawait device.uninstallApp('other.bundle.id');\n```\n\n**Note:** For app state reset operations, consider using [`device.resetAppState()`](#deviceresetappstatebundleids) which is more efficient than uninstall/install cycles.\n\n### `device.openURL({url, sourceApp[optional]})`\n\nMock opening the app from URL. `sourceApp` is an optional **iOS-only** parameter to specify source application bundle id.\n\nRead more in [Mocking Open with URL](../guide/mocking-open-with-url.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js)\n\n### `device.sendUserNotification(params)`\n\nMock handling of a user notification previously received in the system, while the app is already running.\n\nRead more in [Mocking User Notifications](../guide/mocking-user-notifications.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js)\n\n### `device.sendUserActivity(params)` **iOS Only**\n\nMock handling of received user activity when app is in foreground.\nRead more in [Mocking User Activity](../guide/mocking-user-activity.md) section.\nCheck out Detox’s [own test suite](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js)\n\n### `device.setOrientation(orientation)`\n\nTakes `\"portrait\"` or `\"landscape\"` and rotates the device to the given orientation.\n\n**Note:** Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed.\n\nCheck out Detox’s [own test suite.](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js)\n\n### `device.setLocation(lat, lon)`\n\nSets the simulator/emulator location to the given latitude and longitude.\n\n> On iOS `setLocation` depends on `xcrun simctl`, and we recommend using its latest version.\n>\n> On Android `setLocation` will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.\n\n```js\nawait device.setLocation(32.0853, 34.7818);\n```\n\n### `device.disableSynchronization()`\n\nTemporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.\n\nThis API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly _busy_ (e.g. due to an endlessly repeating on-screen animation).\nHowever, using it inherently suggests that you are likely to resort to applying `sleep()`’s in your test code - testing that area, **which is not recommended and can never be 100% stable.** Therefore, as a rule of thumb, test code running \"inside\" a sync-disabled mode must be reduced to the bare minimum.\n\nNote: Synchronization is enabled by default, and it gets **re-enabled on every launch of a new instance of the app.**\n\n```js\nawait device.disableSynchronization();\n```\n\n### `device.enableSynchronization()`\n\nRe-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to `device.disableSynchronization()`.\n\n:warning: Note: Making this call would resume synchronization **instantly**, having its returned promise only resolve when the app becomes idle again. In other words, this **must only be called after you navigate back to \"the safe zone\", where the app should be able to eventually become idle again**, or it would remain suspended \"forever\" (i.e. until a safeguard time-out expires).\n\n```js\nawait device.enableSynchronization();\n```\n\n### `device.setURLBlacklist([urls])`\n\nExclude synchronization with respect to network activity (i.e. don’t wait for network to go idle before moving forward in the test execution) according to **specific** endpoints, denoted as URL reg-exp’s. To disable endpoints at initialization, pass in the black-list as an [app-launch argument](../guide/launch-args.md) named `detoxURLBlacklistRegex` (as explained [here](#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch)).\n\n```js\nawait device.setURLBlacklist(['.*127.0.0.1.*', '.*my.ignored.endpoint.*']);\n```\n\n### `device.resetAppState([...bundleIds])`\n\nResets the app state by clearing app data and restoring it to a clean state.\n\nOn Android, this command clears the app's data using the `pm clear` command, effectively resetting the app to its initial installed state without uninstalling it.\n\nOn iOS, Detox uses a fallback that uninstalls and installs your app again to achieve a clean state.\n\n```js\n// Reset current app state\nawait device.resetAppState();\n\n// Reset specific app state\nawait device.resetAppState('com.example.app');\n\n// Reset multiple apps\nawait device.resetAppState('com.app1', 'com.app2');\n```\n\n### `device.resetContentAndSettings()` **iOS Only**\n\nResets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing\npreviously set permissions.\n\n```js\nawait device.resetContentAndSettings();\n```\n\n### `device.getPlatform()`\n\nReturns the current device, `ios` or `android`.\n\n```js\nif (device.getPlatform() === 'ios') {\n  await expect(loopSwitch).toHaveValue('1');\n}\n```\n\n### `device.tap(point, shouldIgnoreStatusBar)`\n\nPerform a tap at arbitrary coordinates on the device's screen.\n\n#### tap parameters\n\n- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>\n- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>\n\n#### tap examples\n\n```js\n\nawait device.tap();\nawait device.tap({ x: 100, y: 150 }, false);\nawait device.tap({ x: 100, y: 150 });\nawait device.tap(false);\n\n```\n\n### `device.longPress(point, duration, shouldIgnoreStatusBar)`\n\nPerform a long press at arbitrary coordinates on the device's screen. Custom press duration if needed.\n\n#### longPress parameters\n\n- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>\n- `duration` — Custom press duration time, in milliseconds. (default values: Android: Standard long-press duration.  IOS: 1000 milliseconds, platforms: Android & IOS) <br/>\n- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>\n\n#### longPress examples\n\n```js\n\nawait device.longPress();\nawait device.longPress({ x: 100, y: 150 }, 2000, false);\nawait device.longPress({ x: 100, y: 150 }, 2000);\nawait device.longPress(2000, false);\nawait device.longPress({ x: 100, y: 150 }, false);\nawait device.longPress({ x: 100, y: 150 });\nawait device.longPress(2000);\nawait device.longPress(false);\n\n```\n\n### `device.takeScreenshot([name])`\n\nTakes a screenshot of the device. For full details on taking screenshots with Detox, refer to the [screen-shots guide](../guide/taking-screenshots.md).\n\n### `device.captureViewHierarchy([name])`\n\n**iOS Only.** Saves a view hierarchy snapshot (`*.viewhierarchy`) of the\ncurrently opened application to a temporary folder and schedules putting it to\nthe artifacts' folder upon the completion of the current test. The file can be\nopened later in Xcode 12.0 and above.\nSee [Xcode 12 Release notes: #57933113](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:~:text=57933113)\nfor more details.\n\nThe `name` parameter is optional — by default, it equals to `capture`.\n\n```js\ntest('Capture view hierarchy', async () => {\n  const temporaryArtifactPath = await device.captureViewHierarchy('myElements');\n\n  // The temporary path will remain valid until the test completion.\n  // Afterwards, the artifact will be moved, e.g.:\n  // * on success, to: <artifacts-location>/✓ Capture view hierarchy/myElements.viewhierarchy\n  // * on failure, to: <artifacts-location>/✗ Capture view hierarchy/myElements.viewhierarchy\n});\n```\n\n### `device.generateViewHierarchyXml([shouldInjectTestIds])`\n\nGenerates a view hierarchy XML of the currently opened application. The XML is returned as a string.\n\nThe `shouldInjectTestIds` parameter is optional and defaults to `false`. When set to `true`, Detox will attempt to inject `testID` attributes into the XML for each element if undefined.\n\n```js\nconst viewHierarchyXml = await device.generateViewHierarchyXml();\n```\n\n### `device.shake()` **iOS Only**\n\nSimulate shake\n\n### `device.setBiometricEnrollment(bool)` **iOS Only**\n\nToggles device enrollment in biometric authentication (Touch ID or Face ID).\n\n```js\nawait device.setBiometricEnrollment(true);\n// or\nawait device.setBiometricEnrollment(false);\n```\n\n### `device.matchFace()` **iOS Only**\n\nSimulates the success of a face match via Face ID\n\n### `device.unmatchFace()` **iOS Only**\n\nSimulates the failure of face match via Face ID\n\n### `device.matchFinger()` **iOS Only**\n\nSimulates the success of a finger match via Touch ID\n\n### `device.unmatchFinger()` **iOS Only**\n\nSimulates the failure of a finger match via Touch ID\n\n### `device.clearKeychain()` **iOS Only**\n\nClears the device keychain\n\n### `device.setStatusBar()` **iOS Only**\n\nOverride simulator’s status bar. Available options:\n\n```js\nawait device.setStatusBar({\n  time: \"12:34\",\n  // Set the date or time to a fixed value.\n  // If the string is a valid ISO date string it will also set the date on relevant devices.\n  dataNetwork: \"wifi\",\n  // If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.\n  wifiMode: \"failed\",\n  // If specified must be one of 'searching', 'failed', or 'active'.\n  wifiBars: \"2\",\n  // If specified must be 0-3.\n  cellularMode: \"searching\",\n  // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n  cellularBars: \"3\",\n  // If specified must be 0-4.\n  operatorName: \"A1\",\n  // Set the cellular operator/carrier name. Use '' for the empty string.\n  batteryState: \"charging\",\n  // If specified must be one of 'charging', 'charged', or 'discharging'.\n  batteryLevel: \"50\",\n  // If specified must be 0-100.\n});\n```\n\n### `device.resetStatusBar()` **iOS Only**\n\nResets any override in simulator’s status bar.\n\n### `device.reverseTcpPort()` **Android Only**\n\nReverse a TCP port from the device (guest) back to the host-computer, as typically done with the `adb reverse` command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer.\n\n### `device.unreverseTcpPort()` **Android Only**\n\nClear a _reversed_ TCP-port (e.g. previously set using `device.reverseTcpPort()`).\n\n### `device.pressBack()` **Android Only**\n\nSimulate press back button.\n\n```js\nawait device.pressBack();\n```\n\n### `device.getUiDevice()` **Android Only**\n\nExposes [`UiAutomator`’s `UiDevice` API](https://developer.android.com/reference/androidx/test/uiautomator/UiDevice).\n**This is not a part of the official Detox API**, it may break and change whenever an update to `UiDevice` or `UiAutomator` Gradle dependencies (`androidx.test.uiautomator:uiautomator`) is introduced.\n\n[`UiDevice`’s autogenerated code](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/expect.md",
    "content": "# Expect\n\nDetox uses [matchers](matchers.md) to match UI elements in your app and expectations to verify those elements are in the expected state.\n\nUse [actions](actions.md) to simulate use interaction with elements.\n\n## Methods\n\n- [`.toBeVisible()`](#tobevisible)\n- [`.toExist()`](#toexist)\n- [`.toBeFocused()`](#tobefocused)\n- [`.toHaveText()`](#tohavetexttext)\n- [`.toHaveLabel()`](#tohavelabellabel)\n- [`.toHaveId()`](#tohaveidid)\n- [`.toHaveValue()`](#tohavevaluevalue)\n- [`.toHaveSliderPosition()`](#tohavesliderpositionnormalizedposition-tolerance)\n- [`.toHaveToggleValue()`](#tohavetogglevaluevalue)\n- [`.not`](#not)\n- [`.withTimeout()`](#withtimeouttimeout)\n\n### `toBeVisible()`\n\nExpects the view to be at least N% visible on the screen.\nAccepts an optional parameter of percent threshold of element visibility, integer ranging from 1 to 100, that determines whether the element is visible or not. If no number is provided then defaults to 75%.\n\nNegating this expectation with a `not` expression expects the view’s visible area to be lower than N%.\n\nOn iOS, visibility is defined by having the view, or one of its subviews, be topmost at the view’s activation point on screen.\n\n```js\nawait expect(element(by.id('subtitle'))).toBeVisible();\nawait expect(element(by.id('mainTitle'))).toBeVisible(35);\n```\n\n### `toExist()`\n\nExpects the element to exist within the app’s current UI hierarchy.\n\n```js\nawait expect(element(by.id('okButton'))).toExist();\n```\n\n### `toBeFocused()`\n\nExpects the element to be the focused element.\n\n```js\nawait expect(element(by.id('emailInput'))).toBeFocused();\n```\n\n### `toHaveText(text)`\n\nExpects the element to have the specified text.\n\n```js\nawait expect(element(by.id('mainTitle'))).toHaveText('Welcome back!');\n```\n\n### `toHaveLabel(label)`\n\nExpects the element to have the specified label as its accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n:::note\nNote that in React Native apps, the `accessibilityLabel` is computed in a non-standard way, which happens to [differ between iOS and Android](https://github.com/facebook/react-native/issues/32826). Detox [bridges over that gap](https://github.com/wix/Detox/issues/3977) by artificially aligning Android to iOS.\nEffectively, that means that in React Native apps, performing accessibility-label based matching for elements **with no explicit label** suggests that the matching will be performed against a concatenation of labels from the child-elements, if applicable. For example:\n\n```js\n<View testID='title-root'>\n  <Text accessibilityLabel={'title'}>Goodbye!</Text>\n  <Text accessibilityLabel={'subtitle'}>Thanks for all the fish.</Text>\n</View>\n```\n\nIn this case, where `title-root` has no accessibility label of its own, matching the label of `title-root` will be performed against the text: `title subtitle`.\n\nAlso note that in iOS, `accessibilityLabel` for primitive elements such as text, automatically receives the text itself - even if the accessibilityLabel prop isn't explicitly specified.\n:::\n\n```js\nawait expect(element(by.id('submitButton'))).toHaveLabel('Submit');\n```\n\n### `toHaveId(id)`\n\nExpects the element to have the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nawait expect(element(by.text('Submit'))).toHaveId('submitButton');\n```\n\n### `toHaveValue(value)`\n\nExpects the element to have the specified accessibility value. In React Native, this corresponds to the value in the [`accessibilityValue`](https://reactnative.dev/docs/view.html#accessibilityvalue) prop.\n\n```js\nawait expect(element(by.id('temperatureDial'))).toHaveValue('25');\n```\n\n### `toHaveSliderPosition(normalizedPosition, tolerance)`\n\nExpects the slider element to have the specified normalized position (\\[0, 1]), within the provided tolerance (optional).\n\n```js\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.75);\nawait expect(element(by.id('slider'))).toHaveSliderPosition(0.3113, 0.00001);\n```\n\n### `toHaveToggleValue(value)`\n\nExpects a toggle-able element (e.g. a Switch or a Check-Box) to be on/checked or off/unchecked. As a reference, in react-native, this is the [equivalent switch component](https://reactnative.dev/docs/switch).\n\n```js\nawait expect(element(by.id('switch'))).toHaveToggleValue(true);\nawait expect(element(by.id('checkbox'))).toHaveToggleValue(false);\n```\n\n### `withTimeout(timeout)`\n\nWaits until the expectation is resolved for the specified amount of time. If timeout is reached before resolution, the expectation is failed.\n\n`timeout`—the timeout to wait, in ms\n\n```js\nawait waitFor(element(by.id('bigButton'))).toBeVisible().withTimeout(2000);\n```\n\n## Properties\n\n### `not`\n\nNegates the expectation, e.g.:\n\n```js\nawait expect(element(by.id('tinyButton'))).not.toBeVisible();\nawait expect(element(by.id('tinyButton'))).not.toExist();\nawait expect(element(by.id('tinyButton'))).not.toBeFocused();\nawait expect(element(by.id('tinyButton'))).not.toHaveText('');\nawait expect(element(by.id('tinyButton'))).not.toHaveValue('');\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/internals.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport LifecycleManyWorkersCLI from './partials/_lifecycle-cli-many-workers.md';\nimport LifecycleManyWorkersJest from './partials/_lifecycle-jest-many-workers.md';\nimport LifecycleSingleWorkerCLI from './partials/_lifecycle-cli-single-worker.md';\nimport LifecycleSingleWorkerJest from './partials/_lifecycle-jest-single-worker.md';\n\n# Internals API\n\n:::caution\n\nThis section might be more volatile than the other ones, yet we'll do our best to adhere to Semantic Release standards even here.\n\n:::\n\nDetox Internals might be useful for developing advanced enterprise presets or when you are planning to integrate with a third-party test runner like [Mocha], [Ava], [Vitest] or other ones.\n\n## Lifecycle\n\nThe purpose of **Internals API** is mostly to align the lifecycles of Detox and a test runner underneath.\nAlthough it is generic enough, there is no denying that its design has been influenced by our official integration with Jest test runner.\nThat's why it might be better to start the overview from Jest lifecycle first, and then move on to Detox lifecycle and how they fit together.\n\n### Jest lifecycle\n\n![UML sequence diagram](../img/uml/jest-diagram.svg)\n\n1. Jest's main process starts from resolving and evaluating its config file, e.g. `jest.config.js`:\n  ```js\n  module.exports = async function () {\n    return {\n      globalSetup: '/path/to/globalSetup.js',\n      globalTeardown: '/path/to/globalTeardown.js',\n      reporters: ['/path/to/reporter.js'],\n      /* ... jest config ... */\n    };\n  };\n  ```\n1. If a [`globalSetup`][globalSetup] handler is defined, it is resolved and executed in the main process:\n  ```js\n  module.exports = async function () {\n    // ... global setup code ...\n  };\n  ```\n1. The next come [`reporters`][reporters], one of the longest-living entities in the test session. After instantiating reporters, Jest calls their `onRunStart` method:\n  ```js\n  class Reporter {\n    async onRunStart(aggregatedResults, options) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n1. If Jest is not running in band (see [`-i, --runInBand`][runInBand]), and if it has _N_ [workers][maxWorkers] (_N > 1_), then it spawns _N_ child processes that keep taking test files one after another, running their tests inside and reporting back to the reporters:\n  ```js\n  class Reporter {\n    async onTestFileResult(test, testResult, aggregatedResult) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n  Otherwise, Jest runs all the tests in the main process without spawning any other processes, but the reporting flow itself remains the same, as can be seen in the diagram:\n\n  ![UML sequence diagram](../img/uml/jest-diagram-runInBand.svg)\n1. After all the tests have been executed, Jest calls `onRunComplete` in the reporters, and this is the final phase for any reporter:\n  ```js\n  class Reporter {\n    async onRunComplete(testContexts, results) {\n      // ... reporter code ...\n    }\n\n    // ...\n  };\n  ```\n1. The last user-controlled hook is the global teardown. If a [`globalTeardown`][globalTeardown] handler is defined, it is resolved and executed in the main process:\n  ```js\n  module.exports = async function () {\n    // ... global teardown code ...\n  };\n  ```\n\n### Detox lifecycle\n\nTheoretically, Detox CLI could be totally agnostic about the test runner under the hood, but that would deprive us of some convenience.\nFor instance, there is a [retry mechanism][testRunner.retries], built into Detox CLI, which can schedule extra runs for failed test files.\nThis requirement obliges Detox context to live longer than any test runner, and requires from the test runner to be able to report back to Detox CLI, whereas the resulting child process hierarchy can be broad and multi-tiered, e.g.:\n\n```plain text\n└── detox test ...\n    └── jest ... --maxWorkers N\n        ├── jest-worker (1)\n        ├── ...\n        └── jest-worker (N)\n```\n\nEven if we run Jest directly, without Detox CLI, there's still a one-to-many relationship between its processes:\n\n```plain text\n└── jest ... --maxWorkers N\n    ├── jest-worker (1)\n    ├── ...\n    └── jest-worker (N)\n```\n\nSo, if we want to be on the safe side, every process should be able to communicate with the root process, where we have the primary context of Detox, and vice versa.\nRetrying failed tests is just one of numerous needs, and there are more:\n\n* the primary context (and workers themselves, at times) needs to know how many workers are there;\n* the workers should request from the primary context to allocate a device and return it back when they are done;\n* any secondary context should be able to tell whether this is a first time it is running, or it is an _N_-th attempt already;\n\nThis list can be continued and might expand even more with time, but the point is that Detox contexts will get instantiated as many times as child processes are created during the test session, and it should be something trivial to synchronize the primary and the secondary contexts to ensure a seamless experience.\n\nIt is worth mentioning that Jest's main process is ill-suited for taking a device and running the tests, as its purpose is to orchestrate the entire test session and not run the tests themselves.\nThis means that not all secondary contexts of Detox are \"born equal\" – most of them will be allocating a device for running tests, but at least one will be merely communicating with the primary context.\n\nThis is exactly the reason why we call [`init()`][init] in every child process, but sometimes it is not just a simple call, but an [`init({ workerId: null })`][init] override to avoid creating a worker.\nHowever, the fact of initializing without a worker does not mean we can't call [`installWorker()`][installWorker] later. For example, if it turns out that Jest is running in a single process, then instead of creating two Detox contexts within the same process, we're going to reuse the existing one and just supplement it with the worker itself.\n\nThere's one more implicit thing that happens at the very beginning of [`init([options])`][init] method, and that is the config resolution. It is also available as a separate method, [`resolveConfig([options])`][resolveConfig] based on the following considerations.\nWhen you use a test runner directly, without Detox CLI (e.g. `jest …` instead of `detox test …`), then the test runner config gets resolved earlier than Detox config itself. That creates a dangerous scenario for dynamically generated configs:\n\n```js title=\"jest.config.js\"\nconst { config } = require('detox/internals');\n\nmodule.exports = async () => {\n  if (config.device.type === 'ios.simulator') {\n    return { /* iOS-specific preset */ };\n  } else {\n    return { /* Android-specific preset */ };\n  }\n};\n```\n\nThe problem in this case is that we are accessing an unresolved (yet) config. Of course, one could assume that it is possible to overcome with a plain [`init()`][init] call like this:\n\n```js title=\"bad-idea.config.js\"\nconst { init, config } = require('detox/internals');\n\nmodule.exports = async () => {\n  await init();\n\n  if (config.device.type === 'ios.simulator') {\n    // ... use config now ...\n  }\n};\n```\n\nThis solution will work, but it is rather a bad one, since Jest config resolution is an asymmetrical step compared to `globalSetup` and `globalTeardown`. While solving one problem, it creates another one. Consider running this:\n\n```sh\njest --config bad-idea.config.js --showConfig\n```\n\nFor reference, when Jest runs with a [`--showConfig`][showConfig] option, all it does is _to resolve the config and to print it_. Hence, neither [`globalSetup`][globalSetup] nor [`globalTeardown`][globalTeardown] will be called, and the test runner will hang up since there's no one to call the [`cleanup()`][cleanup] method which stops the [IPC server] used for the communication between the primary and the secondary contexts.\n\nStill, we have to be able to access the config early, and that is exactly why [`init()`][init] method is a composite of [`resolveConfig()`][resolveConfig], the _actual_ init, and [`installWorker()`][installWorker]. We could describe what it does on the high level with the following pseudocode:\n\n```js\nasync function init(options = {}) {\n  config = config || await resolveConfig();\n\n  await logger.init(config);\n  await ipcServer.init(config);\n  // ... init more things  ...\n\n  if (options.workerId != null) {\n    await installWorker();\n  }\n}\n```\n\nIn other words, it will resolve config only if it has not been resolved before, and install a worker unless it has been forbidden explicitly.\nAnd even that we can [`installWorker()`][installWorker] later if we ever need it.\n\nNow, when many details are clarified, we can review the actual sequence diagrams step by step. There are four scenarios depending on the initiator (Detox CLI or the test runner itself) and on child process hierarchy (a single process or parent-children).\n\nA few words about the diagram and its conventions:\n* The `ClassName.0`, `ClassName.1`, …, `ClassName.N` suffixes mean the index of the instance of the class created.\n* `DetoxCircusEnvironment.N` is our custom [`testEnvironment`][testEnvironment] created one or multiple times in every Jest worker. Make sure to read about Jest [test environments][testEnvironment] and look at the example section there for better understanding.\n\n<Tabs>\n  <TabItem value=\"detox test … --maxWorkers N\">\n    <LifecycleManyWorkersCLI />\n  </TabItem>\n  <TabItem value=\"jest … --maxWorkers N\">\n    <LifecycleManyWorkersJest />\n  </TabItem>\n  <TabItem value=\"detox test … --runInBand\">\n    <LifecycleSingleWorkerCLI />\n  </TabItem>\n  <TabItem value=\"jest … --runInBand\">\n    <LifecycleSingleWorkerJest />\n  </TabItem>\n</Tabs>\n\n## Methods\n\n:::info\n\nFeel free to browse through [the typings file][typings] provided by Detox.\n\n:::\n\n### `resolveConfig([options])` \\[Promise<RuntimeConfig\\>]\n\nUse sparingly for cases when you need to read Detox config before [`init()`][init] is called.\n\nIf you use Detox with Jest, our default integration, the only place where you might need it is your `jest.config.js`, e.g.:\n\n```js title=\"jest.config.js\"\nconst { resolveConfig } = require('detox/internals');\n\nmodule.exports = async () => {\n  /** @type {DetoxInternals.RuntimeConfig} */\n  const config = await resolveConfig();\n\n  return { /* Jest config */ };\n};\n```\n\nFor example, you could use that to evaluate the [`maxWorkers`][maxWorkers] count depending on the device type,\nbut please mind, though, that Detox allows to override test runner options via its own config, e.g.:\n\n```js title=\"detox.config.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  apps: { /* ... */ },\n  devices: { /* ... */ },\n  configurations: {\n    'ios.sim.release': {\n      app: 'ios.release',\n      device: 'iphone',\n      testRunner: {\n        args: {\n// highlight-next-line\n          maxWorkers: process.env.CI === 'true' ? 3 : undefined,\n        },\n      },\n    },\n    'android.emu.release': {\n      app: 'android.release',\n      device: 'nexus',\n      testRunner: {\n        args: {\n// highlight-next-line\n          maxWorkers: process.env.CI === 'true' ? 2 : undefined,\n        },\n      },\n    },\n  },\n};\n```\n\nThis trick shown above allows to forward extra CLI arguments to `jest` conditionally, e.g. when running in CI mode:\n\n```bash\nCI=true detox test -c ios.sim.release\n# jest --config e2e/jest.config.js --maxWorkers 3\n```\n\n### `getStatus()` \\[enum]\n\nReturns one of statuses depending on what’s going with the current Detox context:\n\n* `inactive` – before [`init()`][init] and after [`cleanup()`][cleanup] is called.\n* `init` – while [`init()`][init] is executing.\n* `active` – after [`init()`][init] and before [`cleanup()`][cleanup] is called.\n* `cleanup` – while [`cleanup`][cleanup] is executing.\n\n### `init([options])` \\[Promise]\n\nThis is the phase where:\n\n* a primary Detox context resolves its configuration, starts the logger, IPC server, and more;\n* a secondary Detox context connects to IPC server and registers itself;\n* if `workerId` is not null, [installs the worker][installWorker];\n\nAccepts an optional parameter, `options` object with the following properties, _all optional_ as well:\n\n* `cwd` (string) – current working directory, used to [resolve Detox config][detox config resolution].\n* `argv` (key-value map) – **Internal!**. CLI arguments parsed by Detox CLI.\n* `testRunnerArgv` (key-value map) – CLI arguments to be forwarded to the test runner.\n* `override` (Partial<Detox.DetoxConfig\\>) – ad-hoc adjustments to deep merge with the file-based config.\n* `global` – reference to a custom [global][node globals] scope, usually needed when your test runner [uses sandboxing][node vm].\nThis prevents creating issues when a Detox context cannot be accessed from within the sandboxed environment.\n* `workerId` – (string \\| null) a unique ID, e.g. `worker-1`, `worker-2`. Giving `null` disables installing the worker.\n\n### `installWorker([options])` \\[Promise]\n\nThis is the phase where Detox loads its expectation library and boots a device. You don't need to call it separately\nunless you use [`init({ workerId: null })`][init] override.\n\nAccepts an optional parameter, `options` object with the following properties, _all optional_ as well:\n\n* `global` – reference to a custom [global][node globals] scope, usually needed when your test runner [uses sandboxing][node vm].\nThis prevents creating issues when a Detox context cannot be accessed from within the sandboxed environment.\n* `workerId` – (string \\| null) a unique ID, e.g. `worker-1`, `worker-2`. Giving `null` disables installing the worker.\n\n### `uninstallWorker()` \\[Promise]\n\nDeallocates the device. Most Client API ([`device`][Device API], [`by`][Matchers API], [`element`][Actions API], [`expect`][Expect API]) will stop working, except for [the logger][Logger API].\n\n### `cleanup()` \\[Promise]\n\nThis method should be called when the main or child process is about to exit. Under the hood, it:\n\n* [uninstalls the worker][uninstallWorker] if there is a worker installed;\n* a secondary Detox context disconnects from the [IPC server];\n* a primary Detox context stops the IPC server and collects the log artifacts.\n\n## Optional lifecycle\n\n### `reportTestResults(array)` \\[Promise]\n\n:::note\n\nThis method has an effect only when the tests are run via [Detox CLI][detox test].\n\n:::\n\nReports to the primary context about failed tests that could have been re-run if [`-R, --retries`][CLI options] mechanism is enabled.\n\nIt takes one argument, an array of test file reports. Each report is an object with the following properties:\n\n- `testFilePath` (string) — global or relative path to the failed test file;\n- `success` (boolean) — whether the test passed or not;\n- `testExecError` (optional error) — top-level error, use it only if the entire test file failed, e.g. due to a syntax error or environment setup failure;\n- `isPermanentFailure` (optional boolean) — if the test failed, it should tell whether the failure is permanent. Permanent failure means that the test file should not be re-run. For instance, we use it to [prevent double retries][testRunner.retryAfterCircusRetries]: with Detox CLI and with [`jest.retryTimes()`][retryTimes].\n\n### `onRunDescribeStart(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner started executing a test suite, e.g. a `beforeAll` hook or a first test:\n\n```js\nawait onRunDescribeStart({\n  name: 'Suite name'\n});\n```\n\n### `onTestStart(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner started executing a specific test. Use `invocations` when a test is being re-run after a failure:\n\n```js\nawait onTestStart({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 1,\n  status: 'running',\n});\n```\n\n### `onHookFailure(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports about an error in the midst of `beforeAll`, `beforeEach`, `afterEach`, `afterAll` or any other hook. We use it, for example, to generate [screenshot artifacts][artifacts docs] like `beforeAllFailure.png`.\n\n```js\nawait onHookFailure({\n  error: new Error('Some assertion failed'),\n  hook: 'beforeEach',\n});\n```\n\n### `onTestFnFailure(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports about an error in the midst of a test function. We use it, for example, to generate [screenshot artifacts][artifacts docs] like `testFnFailure.png`.\n\n```js\nawait onTestFnFailure({ error: new Error('Some assertion failed') });\n```\n\n### `onTestDone(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports the final status of the test, `passed` or `failed`, e.g.:\n\n```js\nawait onTestDone({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 1,\n  status: 'failed',\n  timedOut: false,\n});\n```\n\nBesides collecting [log, screenshot and video artifacts][artifacts docs], this hook resets the pending network requests –\nthese are usually some actions to which the app did not respond during the test. Setting `timedOut: true` tells Detox to dump those pending requests, if there are any.\n\nIf your test runner supports re-running internally the failed tests, and, for example, your test passes on the second attempt, you would call the method with something like this:\n\n```js\nawait onTestDone({\n  title: 'should do something expected',\n  fullName: 'Suite name should do something expected',\n  invocations: 2,\n  status: 'passed',\n});\n```\n\n### `onRunDescribeFinish(event)` \\[Promise]\n\n**Requires an installed worker.**\nReports that the test runner has finished executing a test suite, e.g. all the `afterAll` hooks have been executed or the last test has finished running:\n\n```js\nawait onRunDescribeFinish({ name: 'Suite name' });\n```\n\n## Properties\n\n### `config` \\[RuntimeConfig]\n\nOpen [the typings file][typings] and search for `RuntimeConfig`.\n\nFor the most part, this config is identical to what we describe in [Config docs], except that it is non-optional.\nIn other words, even if you never customized your [Session config], you'll still be able to access some default\nvalues safely, without null checks.\n\n```js\nconst { config } = require('detox/internals');\ntypeof config.session.autoStart // \"boolean\"\n```\n\n### `session` \\[SessionState]\n\nThe session state contains the following read-only properties:\n\n* `id` (string) – randomly generated ID for the entire Detox test session, including retries.\n* `testResults` (DetoxTestFileReport[]) – results of the prior test file executions, used by Detox CLI retry mechanism.\n* `testSessionIndex` (number) – the retry index of the test session: `0..<retriesCount>`.\n* `workersCount` (number) – count of Detox contexts with a worker installed.\nIf we oversimplify it, it reflects the count of allocated devices in the current test session.\n\nThe session state, including the resolved config, is serialized by the primary context, so that the secondary Detox contexts can read it synchronously from a file at the earliest point possible.\nAfter the secondary contexts connect to the IPC server hosted by the primary context, they register themselves and get the up-to-date session state.\nThe IPC server broadcasts the updates to all the connected contexts on every action like [`installWorker()`][installWorker] or [`reportTestResults()`][reportTestResults].\n\n### `log` \\[Logger]\n\nSee [Logger API] for all the details.\n\nThe only difference from the Client API here is that you don't have a predefined `user` category, i.e.:\n\n```js\nconst { log: logClient } = require('detox');\nconst { log: logInternal } = require('detox/internals');\n\n// oversimplified, it looks like:\nlogClient == logInternal.child({ cat: 'user' })\n```\n\nFor example, we leverage this for adding more `lifecycle` events in our integration with Jest:\n\n```js title=\"detox/runners/jest/testEnvironment/index.js\"\nclass DetoxCircusEnvironment extends NodeEnvironment {\n  constructor(config, context) {\n    super(/* ... */);\n    log.trace.begin({ cat: 'lifecycle' }, context.testPath);\n    // ...\n  }\n}\n```\n\n### `tracing`\n\nAn advanced API useful for creating reports based on logged Detox events.\n\n#### `tracing.createEventStream()`\n\nCreates a readable stream of the currently recorded events in\n[Chrome Trace Event format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU).\n\n```js\nconst { tracing } = require('detox/internals');\n\nasync function processDetoxEvents() {\n  await new Promise((resolve, reject) => {\n    tracing\n      .createEventStream()\n      .on('end', resolve)\n      .on('error', reject)\n      .on('data', (event) => {\n        if (event.ph === 'B') { /* duration event (begin) */ }\n        if (event.ph === 'E') { /* duration event (end) */ }\n        if (event.ph === 'i') { /* instant event */ }\n      });\n  });\n}\n```\n\nPlease mind that you'll be getting a snapshot of events aggregated from all the sibling and child processes, and it never will be complete until the very end of the test session.\n\nSee also: [`DurationBeginEvent`], [`DurationEndEvent`], [`InstantEvent`].\n\n### `worker` \\[object]\n\nNot documented on purpose. Provides direct access to the object which holds the device driver, websocket client, matchers, expectations, etc.\n\n[Mocha]: https://mochajs.org\n[Ava]: https://github.com/avajs/ava\n[Vitest]: https://vitest.dev\n[`DurationBeginEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/DurationBeginEvent.html\n[`DurationEndEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/DurationEndEvent.html\n[`InstantEvent`]: https://wix-incubator.github.io/trace-event-lib/interfaces/InstantEvent.html\n[globalSetup]: https://jestjs.io/docs/configuration#globalsetup-string\n[globalTeardown]: https://jestjs.io/docs/configuration#globalteardown-string\n[maxWorkers]: https://jestjs.io/docs/configuration#maxworkers-number--string\n[reporters]: https://jestjs.io/docs/configuration#reporters-arraymodulename--modulename-options\n[runInBand]: https://jestjs.io/docs/cli#--runinband\n[showConfig]: https://jestjs.io/docs/cli#--showconfig\n[testEnvironment]: https://jestjs.io/docs/configuration#testenvironment-string\n[resolveConfig]: #resolveconfigoptions-promise\n[getStatus]: #getstatus-enum\n[init]: #initoptions-promise\n[installWorker]: #installworkeroptions-promise\n[uninstallworker]: #uninstallworker-promise\n[reportTestResults]: #reporttestresultsarray-promise\n[cleanup]: #cleanup-promise\n[detox config resolution]: ../config/overview.mdx#path-conventions\n[detox test]: ../cli/test.md\n[CLI options]: ../cli/test.md#options\n[config docs]: ../config/overview.mdx\n[artifacts docs]: ../config/artifacts.mdx\n[Session config]: ../config/session.mdx\n[testRunner.retries]: ../config/testRunner.mdx#testrunnerretries-number\n[testRunner.retryAfterCircusRetries]: ../config/testRunner.mdx#testrunnerjestretryaftercircusretries-boolean\n[IPC server]: https://www.npmjs.com/package/node-ipc\n[Device API]: device.md\n[Matchers API]: matchers.md\n[Actions API]: actions.md\n[Expect API]: expect.md\n[Logger API]: logger.mdx\n[typings]: https://github.com/wix/Detox/blob/master/detox/internals.d.ts\n[node globals]: https://nodejs.org/api/globals.html\n[node vm]: https://nodejs.org/api/vm.html\n[retryTimes]: https://jestjs.io/docs/jest-object#jestretrytimesnumretries-options\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/logger.mdx",
    "content": "# Logger\n\nDetox Logger API allows you to save your custom messages and events alongside the built-in ones.\nIn addition to being formatted and printed to the console, they can be preserved as log artifacts if you enable them via [`--record-logs`] CLI option or [`artifacts.plugins.log.enabled`] in the config:\n\n- `<artifacts-location>/detox.log` – plain text log;\n- `<artifacts-location>/detox.trace.json` – [Trace Event format] file, viewable via [Perfetto] or `chrome://tracing`.\n\n![](../img/log-example.png)\n\nBelow we’ll be listing all the public properties and methods of the logger.\n\n## Properties\n\n### `log.level` \\[enum]\n\n**Read-only.** Returns the current [log level](../config/logger.mdx#loggerlevel-enum), one of values:\n`fatal`, `error`, `warn`, `info`, `debug`, `trace`.\n\n## Methods\n\n### `log.*([event,] ...msg)`\n\nLogs an instant message with an optional [event metadata].\nThere are six methods for producing log messages varying by log level:\n\n* `log.fatal([event,] ...msg)`\n* `log.error([event,] ...msg)`\n* `log.warn([event,] ...msg)`\n* `log.info([event,] ...msg)`\n* `log.debug([event,] ...msg)`\n* `log.trace([event,] ...msg)`\n\nExample:\n\n```js\nconst { log } = require('detox');\n\nlog.info('Some message');\n// detox[2020] i Some message\n\nlog.error({ err: new Error('Test') }, 'An error message');\n// detox[2020] i An error message\n//   err: Test\n```\n\n### `log.*.begin([event,] msg)`\n\nLogs a beginning of a _duration event_ with an optional [event metadata].\nDuration events are displayed as continuous colorful segments on the timeline and can be stacked if you\ncall the method multiple times, e.g.:\n\n```js\nlog.info.begin({ data: { email } }, 'Login Flow');\n// detox[2020] B Login Flow\n//   data: { email: 'tester@example.com' }\nlog.info.begin('Nested sub-flow');\n// detox[2020] B Nested sub-flow\n```\n\nMake sure you always end your events so that they don't get marked as unfinished, like shown on the screenshot below:\n\n![](../img/timeline-artifact-unfinished.png)\n\n### `log.*.end([event, msg])`\n\nLogs an end of a duration event with an optional [event metadata] and a message. If the message is omitted,\nthe logger prints the corresponding message from the duration begin event:\n\n```js\nlog.info.end();\n// detox[2020] E Nested sub-flow\nlog.info.end({ success: true }, 'Login Flow (custom end message)');\n// detox[2020] E Login Flow (custom end message)\n```\n\n### `log.*.complete([event,] msg, functionOrPromise)`\n\nA convenience method to wrap functions and promises with [`log.*.begin`] and [`log.*.end`], e.g.:\n\n```js\nawait log.info.complete('Login Flow', async () => {\n  // …\n});\n// detox[2020] B Login Flow\n// detox[2020] E Login Flow\n```\n\nAs a bonus, this wrapper also adds `{ success: true }` or `{ success: false, error }` metadata to\nthe end event.\n\nEffectively, `begin` and `end` can even be called in two complete different places - such as `beforeEach` and `afterEach`, but that is discouraged.\n\nIn fact, `log.*.complete()` is the recommended way of tracing things, e.g.:\n\n## Event metadata\n\nAll the log methods accept an optional first argument which can contain some custom\nmetadata: numbers, strings and booleans:\n\n```js\ndetox.log.info({ /* metadata */ }, message);\ndetox.log.trace.begin({ /* metadata */ }, message);\ndetox.log.trace.end({ /* metadata */ });\n```\n\nAside from custom user properties, there are a few meaningful properties that affect the timeline representation.\n\n### `id` \\[string \\| number]\n\nUse arbitrary IDs when you have a risk of overlapping concurrent events, e.g.:\n\n```js\nawait Promise.all([\n  await detox.log.complete({ id: 1 }, 'Do this', async () => { /* … */ }),\n  await detox.log.complete({ id: 2 }, 'Do that', async () => { /* … */ }),\n]);\n```\n\nUsing IDs will prevent situations like this, where the nested event outlasts its parent:\n\n```plain text\nB               E\n|-- event 1 ----|\n   B                E\n   |-- event 2 -----|\n```\n\nIn the example above, the actual sequence of calls will be:\n\n```js\nlog.info.begin('event 1');\nlog.info.begin('event 2');\nlog.info.end(); // from event 1\nlog.info.end(); // from event 2\n```\n\nTherefore, it will be interpreted erroneously on the timeline, as if the second event has ended before the first one:\n\n```plain text\nB                   E\n|-- event 1 --------|\n   B            E\n   |-- event 2 -|\n```\n\nWhen you begin an event with a specific `id` while there's already some other duration event, the logger allocates another \"lane\" for that event by assigning a distinct `tid` (thread ID) to it:\n\n![](../img/timeline-tid.png)\n\n### `cat` \\[string \\| string\\[]]\n\nEvent category. Helpful for filtering specific events.\n\nPass either a string of comma-separated values or a string array, e.g.:\n\n```js\nlog.info({ cat: 'login,login-email' }, 'Starting e-mail login flow...');\n// is identical to:\nlog.info({ cat: ['login', 'login-email'] }, 'Starting e-mail login flow...');\n```\n\n### `cname` \\[string]\n\nCustom event color. See the available color names [here](https://github.com/catapult-project/catapult/blob/main/tracing/tracing/base/color_scheme.html).\n\n### `*` \\[string \\| number \\| boolean]\n\nYour custom properties, e.g.:\n\n```js\ndetox.log.info({ login: 'test@example.com' }, 'Entering credentials...');\n```\n\nCustom properties are not printed to the terminal logs, but there are a few reserved names which have\nan extra formatting due to our default [`logger.options.stringifiers`] — these are: `args`, `data`, `error`, `stack`, `origin`.\n\nAlso, there are a few reserved properties which cannot be logged:\n- `pid` — process ID,\n- `tid` — thread ID,\n- `ts` — timestamp,\n- `ph` — phase: _begin_ (B), _end_ (E), _instant_ (i) event.\n\n## Artifacts\n\nThe logger subsystem produces two artifacts when [`--record-logs`] CLI option is enabled or [`artifacts.plugins.log.enabled`] config is set to true.\n\n### `detox.log`\n\nThis file contains all the log messages you could see in the terminal window, except that there are messages of all the log levels, from `fatal` to `trace`.\n\n### `detox.trace.json`\n\nJSON file, which, if loaded into [Perfetto] or `chrome://tracing` (internal address in Google Chrome browser), would look something like this:\n\n![Timeline artifact example](../img/timeline-artifact.png)\n\nThe tracing view provides a visual, hierarchical representation of the various processes that took place during the execution of the testing session, over the execution’s _time-line_. These processes appear as hierarchical _sections_ – sometimes visually ordered in a parent-child way, depending on their formation time and context.\n\n[`log.*.begin`]: #logbeginevent-msg\n[`log.*.end`]: #logendevent-msg\n[`logger.options.stringifiers`]: ../config/logger.mdx#loggeroptions-bunyandebugstreamoptions\n[`--record-logs`]: ../cli/test.md\n[`artifacts.plugins.log.enabled`]: ../config/artifacts.mdx#example\n[Trace Event format]: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview\n[Perfetto]: https://ui.perfetto.dev\n[Event metadata]: #event-metadata\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/matchers.md",
    "content": "# Matchers\n\nDetox uses [matchers](matchers.md) to match UI elements in your app.\n\nUse [actions](actions.md) to simulate use interaction with elements and [expectations](expect.md) to verify element states.\n\n**Note:** For best results, it is recommended to match elements by unique identifiers. Matching by text or labels can introduce test flakiness when your app’s text change or when changing your app’s localization.\n\n## Methods\n\n- [`by.id()`](#byidid)\n- [`by.label()`](#bylabellabel)\n- [`by.text()`](#bytexttext)\n- [`by.type()`](#bytypeclassname)\n- [`by.traits()`](#bytraitstraits-ios-only) **iOS Only**\n- [`withAncestor()`](#withancestormatcher)\n- [`withDescendant()`](#withdescendantmatcher)\n- [`and()`](#andmatcher)\n- [`atIndex()`](#atindexindex)\n\n### `by.id(id)`\n\nMatch elements with the specified accessibility identifier. In React Native, this corresponds to the value in the [`testID`](https://reactnative.dev/docs/view.html#testid) prop.\n\n```js\nelement(by.id('tap_me'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.id(/^tap_[a-z]+$/));\n```\n\n### `by.label(label)`\n\nMatch elements with the specified accessibility label (iOS) or content description (Android). In React Native, this corresponds to the value in the [`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel) prop.\n\n```js\nelement(by.label('Welcome'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.label(/[a-z]+/i));\n```\n\n### `by.text(text)`\n\nMatch elements with the specified text.\n\n```js\nelement(by.text('Tap Me'));\n```\n\nSupports [regex matching](#regex-matching).\n\n```js\nelement(by.text(/^Tap .*$/));\n```\n\n### `by.type(className)`\n\nMatches elements whose class is, or inherits from, the specified class name. On Android, provide the class canonical name.\n\n**Note:** iOS and Android class names differ.\n\n```js\nelement(by.type('RCTImageView')); //iOS class name\nelement(by.type('android.widget.ImageView')); //Android class canonical name\n```\n\n### `by.traits([traits])` **iOS Only**\n\nMatches elements by their [accessibility traits](https://developer.apple.com/documentation/uikit/uiaccessibilityelement/1619584-accessibilitytraits).\n\nCurrently supported values:\n\n`\"none\"`\n`\"button\"`\n`\"link\"`\n`\"header\"`\n`\"searchField\"`\n`\"image\"`\n`\"selected\"`\n`\"playsSound\"`\n`\"keyboardKey\"`\n`\"staticText\"`\n`\"summaryElement\"`\n`\"notEnabled\"`\n`\"updatesFrequently\"`\n`\"startsMediaSession\"`\n`\"adjustable\"`\n`\"allowsDirectInteraction\"`\n`\"causesPageTurn\"`\n`\"tabBar\"`\n\n```js\nelement(by.traits(['button']));\n```\n\n### `withAncestor(matcher)`\n\nMatches elements with an ancestor that matches the specified matcher.\n\n```js\nelement(by.id('child').withAncestor(by.id('parent')));\n```\n\n### `withDescendant(matcher)`\n\nMatches elements with at least one descendant that matches the specified matcher.\n\n```js\nelement(by.id('parent').withDescendant(by.id('child')));\n```\n\n### `and(matcher)`\n\nMatches elements by combining several matchers together.\n\n```js\nelement(by.id('uniqueId').and(by.text('some text')));\n```\n\n### `atIndex(index)`\n\nIf a matcher resolves into multiple matched UI elements, you may specify which element to use by its index.\n\nOn iOS, matched elements are sorted by their x and y axes.\n\n**Note:** Due to different underlying implementations of Detox on iOS and Android, as well as other differences in the OS implementations, as well as RN implementation differences on each OS, indices may not match between iOS and Android. Relying on indices may also introduce flakiness in your tests as your app’s user interface is updated. It is recommended to use unique identifier matchers for your elements.\n\n```js\nelement(by.text('Product')).atIndex(2);\n```\n\n## Regex matching\n\nFor supported matchers ([`id`](#byidid), [`label`](#bylabellabel), [`text`](#bytexttext)), you can also utilize regex (Regular Expressions) alongside certain flags. Here's a table with the supported flags:\n\n| Flag | Name          | Modification                                                                                                                                             |\n| ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `i`  | Ignore Casing | Makes the expression search case-insensitively.                                                                                                          |\n| `s`  | Dot All       | Makes the wild character `.` match newlines as well.                                                                                                     |\n| `m`  | Multiline     | Makes the boundary characters (`^` and `$`) match the beginning and ending of every single line instead of the beginning and ending of the whole string. |\n\n:::caution Note\n\nRegular expression flags such as `g` (global) and `y` (sticky) that are not supported, as well as `u` (unicode) which is always implied, are ignored when parsing input.\n\nPay attention that as of writing this note, Android supports lookbehind assertions in its regular expression implementation, while iOS does not. It's advisable to check the official platform-specific documentation for limitations.\n\n:::\n\nThe following sample code snippet matches text starting with \"Tap\" followed by any number of alphabetic characters, case-insensitively:\n\n```js\nelement(by.text(/Tap [A-Za-z]+/i));\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/partials/_lifecycle-cli-many-workers.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-cli-many-workers.svg)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/partials/_lifecycle-cli-single-worker.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-cli-single-worker.svg)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/partials/_lifecycle-jest-many-workers.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-jest-many-workers.svg)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/partials/_lifecycle-jest-single-worker.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n![UML sequence diagram](../../img/uml/boot-jest-single-worker.svg)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/pilot.md",
    "content": "# Wix Pilot\n\nWix Pilot is an AI-powered plugin that allows you to write tests using natural language commands, powered by large language models (LLMs). It simplifies the process of writing end-to-end tests by translating human-readable instructions into actions and assertions.\n\n:::caution Work in Progress\n\nWix Pilot is in active development, and APIs are subject to change in future releases.\n\n:::\n\n:::note Migration Notice\n\nWith the introduction of **Wix Pilot**, the `copilot` API is now deprecated.\n\n- **Wix Pilot** is a standalone plugin that enables natural language-based testing and can work across different testing frameworks.\n- **Detox Pilot** is a built-in facade within Detox that leverages Wix Pilot for Detox-specific testing.\n\nFrom now on, use the `pilot` API. The `copilot` API will remain temporarily supported for backward compatibility but will be removed in future releases.\n\n:::\n\n## Overview\n\nDetox Pilot exposes a simple API that integrates seamlessly with your Detox tests. It requires minimal setup and allows you to perform complex testing operations by simply describing them in natural language.\n\nFor a more detailed guide on integrating Wix Pilot in your tests, refer to the \\[Detox Pilot Guide].\n\n## Methods\n\n- [`pilot.init()`](#pilotinitprompthandler)\n- [`pilot.perform()`](#pilotperformsteps)\n- [`pilot.autopilot()`](#pilotautopilotgoal)\n\n## `pilot.init(promptHandler)`\n\nInitializes Pilot with the given prompt handler. Must be called before any other Pilot methods.\n\n**Parameters:**\n\n- `promptHandler` (PromptHandler): An object implementing the [`PromptHandler`](#prompthandler-interface) interface.\n\n**Example:**\n\n```javascript\nconst { pilot } = require('detox');\nconst OpenAIPromptHandler = require('./OpenAIPromptHandler');\n\nbeforeAll(() => {\n  const promptHandler = new OpenAIPromptHandler('YOUR_OPENAI_API_KEY');\n  pilot.init(promptHandler);\n});\n```\n\n## `pilot.perform(...steps)`\n\nPerforms a testing operation or series of operations based on the given steps.\n\n**Parameters:**\n\n- `steps` (string\\[]): One or more natural language instructions specifying the actions or assertions to perform.\n\n**Returns:**\n\n- A promise that resolves when all steps have been executed.\n\n**Example:**\n\n```javascript\nawait pilot.perform(\n  'Start the application',\n  'Tap on the \"Login\" button',\n  'Enter \"user@example.com\" into the email field',\n  'Enter \"password123\" into the password field',\n  'Press the \"Submit\" button',\n  'The welcome message \"Hello, User!\" should be displayed'\n);\n```\n\n## `pilot.autopilot(goal)`\n\nAutomatically generates a series of steps to achieve the given goal.\n\n**Parameters:**\n\n- `goal` (string): A natural language description of the desired outcome.\n\n**Example:**\n\n```javascript\nawait pilot.autoPilot('Log in and navigate to the profile page');\n```\n\n## `PromptHandler` Interface\n\nThe `PromptHandler` interface defines how Pilot communicates with the LLM service.\n\n```typescript\ninterface PromptHandler {\n  /**\n   * Sends a prompt to the LLM service and returns the response.\n   * @param prompt The prompt to send.\n   * @param image Optional path to an image capturing the current UI state.\n   * @returns A promise resolving to the LLM's response.\n   */\n  runPrompt(prompt: string, image?: string): Promise<string>;\n\n  /**\n   * Indicates whether the LLM service supports snapshot images.\n   * @returns A boolean value.\n   */\n  isSnapshotImageSupported(): boolean;\n}\n```\n\nYou can refer to the [Pilot Guide] for an example of implementing a `PromptHandler` for OpenAI's service.\n\n[Detox Pilot Guide]: ../pilot/testing-with-pilot\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/system.md",
    "content": "# System\n\nSystem APIs allows you to interact with dialogs in the system-level (e.g. permissions, alerts, etc.).\n\n:::caution Experimental\n\nSystem APIs are currently in an experimental phase.\nThis means that the API is not yet final and **may change over minor releases.**\n\n:::\n\n:::note\n\n**System APIs are only available on iOS**. Android support is coming soon.\n\nAt the moment, System APIs are limited to system dialogs (e.g. permissions, alerts, etc.).\nWe plan to expand the System APIs to include more system-level interactions in the future,\nsuch as OS browser (Safari / Chrome), interactions with push notifications, photo library, etc.\n\n:::\n\n## Matchers\n\nSystem matchers are used to find elements within the system:\n\n- [`by.system.label(label)`]\n- [`by.system.type(type)`]\n\n### `by.system.label(label)`\n\nMatch elements with the specified label.\n\n```js\nsystem.element(by.system.label('Dismiss'));\n```\n\n### `by.system.type(type)`\n\nMatch elements with the specified type.\n\nThe type value can be any of [`XCUIElement.ElementType`][iOS element-type] values, such as `'button'` or `'textField'`.\n\n```js\nsystem.element(by.system.type('button'));\n```\n\n## Actions\n\nSystem actions are used to interact with elements within the system:\n\n- [`tap()`]\n\n### `tap()`\n\nTap on the element.\n\n```js\nsystem.element(by.system.label('Allow')).tap();\n```\n\n## Expectations\n\nSystem expectations are used to assert the state of elements within the system:\n\n- [`toExist()`]\n- [`not`]\n\n### `toExist()`\n\nAsserts that the element exists.\n\n```js\nawait expect(system.element(by.system.label('Allow'))).toExist();\n```\n\n### `not`\n\nNegates the expectation.\n\n```js\nawait expect(system.element(by.system.label('Allow'))).not.toExist();\n```\n\n[`by.system.label(label)`]: #bysystemlabellabel\n[`by.system.type(type)`]: #bysystemtypetype\n[`tap()`]: #tap\n[`toExist()`]: #toexist\n[`not`]: #not\n[iOS element-type]: https://developer.apple.com/documentation/xctest/xcuielement/elementtype\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/api/webviews.md",
    "content": "# Web Views\n\nWeb views are native components that render content not natively supported by the platform, like web pages or PDF documents.\nHowever, elements within web views are not native components, making direct interaction through Detox challenging.\nTo address this, Detox offers a suite of matchers, actions, and expectations designed for interacting with content inside web views.\n\n## Locating Elements in Web Views\n\n### `web.element(matcher)`\n\nIn cases where there's only one web view present on the screen, you may use the `web.element()` function, paired with [web view matchers], to reference elements within the web view.\nUpon obtaining the element reference, you can utilize web view actions and expectations on the webView element.\n\n```js\nconst innerElement = web.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\nIn the example above, we locate an inner element by its `id` HTML attribute and verify its text content.\n\n### `web(nativeMatcher).element(matcher)`\n\nIf you have multiple web views on the screen, you must locate a specific web view first by using a [native matcher][native matchers], e.g.:\n\n```js\nconst myWebView = web(by.id('webview_identifier'));\n```\n\nFollowing that, you can locate the element within the identified web view:\n\n```js\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\n### `web(nativeMatcher).atIndex(index).element(matcher)` (iOS only)\n\n:::note\n\nThis matcher is available for iOS only. See [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\nIf you have multiple web views on the screen and you want to interact with a specific web view, you can use the `atIndex()` method to choose the web view at the specified index.\n\n```js\nconst myWebView = web(by.id('webview_identifier')).atIndex(1);\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'));\nawait expect(innerElement).toHaveText('Hello World!');\n```\n\nIn the example above, we use `atIndex()` to select the second web view on the screen (that has the specified accessibility identifier) and then locate an HTML element inside that web view.\n\n## Matchers\n\nWeb view matchers are used to find elements within a web view:\n\n- [`by.web.id()`]\n- [`by.web.className()`]\n- [`by.web.cssSelector()`]\n- [`by.web.name()`]\n- [`by.web.xpath()`]\n- [`by.web.href()`]\n- [`by.web.hrefContains()`]\n- [`by.web.tag()`]\n- [`by.web.value()`] (iOS only)\n- [`by.web.label()`] (iOS only, supports [`asSecured()`])\n- [`by.web.type()`] (iOS only, [`asSecured()`] only)\n- [`atIndex()`]\n\n### `by.web.id(id)`\n\nMatch elements with the specified accessibility identifier.\n\n```js\nweb.element(by.web.id('identifier'));\n```\n\n### `by.web.className(className)`\n\nMatch elements with the specified CSS class name.\n\n```js\nweb.element(by.web.className('className'));\n```\n\n### `by.web.cssSelector(cssSelector)`\n\nMatch elements with the specified CSS selector.\n\n```js\nweb.element(by.web.cssSelector('#cssSelector'));\n```\n\n### `by.web.name(name)`\n\nMatch form input elements with the specified [`name` attribute][name].\n\n```js\nweb.element(by.web.name('name'));\n```\n\n### `by.web.xpath(xpath)`\n\nMatch elements with the specified XPath.\n\n```js\nweb.element(by.web.xpath('//*[@id=\"testingh1-1\"]'));\n```\n\n### `by.web.href(href)`\n\nMatch elements with the specified `href`.\n\n```js\nweb.element(by.web.href('https://wix.com'));\n```\n\n:::note\n\nYou might face issues with this matcher on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `by.web.hrefContains(href)`\n\nMatch elements that contain the specified `href`.\n\n```js\nweb.element(by.web.hrefContains('wix'));\n```\n\n:::note\n\nYou might face issues with this matcher on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `by.web.tag(tag)`\n\nMatch elements with the specified tag.\n\n```js\nweb.element(by.web.tag('h1'));\n```\n\n### `by.web.value(value)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment.\n\n:::\n\nMatch elements with the specified value.\n\n```js\nweb.element(by.web.value('value'));\n```\n\n### `by.web.label(label)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment and supports [`asSecured()`].\n\n:::\n\nMatch elements with the specified label.\n\n```js\nweb.element(by.web.label('label'));\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nweb.element(by.web.label('label')).asSecured();\n```\n\n### `by.web.type(accessibilityType)`\n\n:::note\n\nThis matcher is available for **iOS only** at the moment and supported with [`asSecured()`] only.\n\n:::\n\nMatch elements with the specified type.\n\n```js\nweb.element(by.web.type('textField')).asSecured();\n```\n\nThe type value can be any of XCUIElement.ElementType values, such as 'button' or 'textField'. See [XCUIElement.ElementType](https://developer.apple.com/documentation/xctest/xcuielement/elementtype).\n\n### `atIndex(index)`\n\nChoose the element at the specified index.\n\n```js\nweb.element(by.web.tag('h1')).atIndex(1);\n```\n\nUse it sparingly for those rare cases when you cannot make your matcher less ambiguous, so it returns one element only.\n\n## Actions\n\nWeb view actions are used to interact with elements within a web view:\n\n- [`tap()`] (supports [`asSecured()`])\n- [`typeText()`] (supports [`asSecured()`])\n- [`replaceText()`] (supports [`asSecured()`])\n- [`clearText()`] (supports [`asSecured()`])\n- [`selectAllText()`]\n- [`getText()`]\n- [`scrollToView()`]\n- [`focus()`]\n- [`moveCursorToEnd()`]\n- [`runScript()`]\n- [`getCurrentUrl()`]\n- [`getTitle()`]\n\n### `tap()`\n\nTap the element.\n\n```js\nawait web.element(by.web.id('identifier')).tap();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.label('Submit')).asSecured().tap();\n```\n\n### `typeText(text[, isContentEditable])`\n\nType the specified text into the element.\n\n`isContentEditable` is an optional parameter that indicates whether the element should be a [content-editable] (`contenteditable`) element, and defaults to `false`.\n\n```js\nawait web.element(by.web.id('identifier')).typeText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:  \n\n```js\nawait web.element(by.web.type('textField')).asSecured().typeText('Hello World!');\n```\n\n:::note\n\nThe `isContentEditable` parameter is currently necessary for content-editable elements only on Android.\n\nOn iOS, Detox automatically detects content-editable elements regardless of this parameter.\n\n:::\n\n### `replaceText(text)`\n\nReplace the text of the element with the specified text.\n\n```js\nawait web.element(by.web.id('identifier')).replaceText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.type('textField')).asSecured().replaceText('Hello World!');\n```\n\n:::note\n\nThis action is currently not supported for content-editable elements on Android.\n\nOn iOS, Detox automatically detects content-editable elements and replaces their text.\n\n:::\n\n### `clearText()`\n\nClear the text of the element.\n\n```js\nawait web.element(by.web.id('identifier')).clearText();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait web.element(by.web.type('textField')).asSecured().clearText();\n```\n\n:::note\n\nThis action is currently not supported for content-editable elements on Android.\n\nOn iOS, Detox automatically detects content-editable elements and clears their text.\n\n:::\n\n### `selectAllText()`\n\nSelect all the text of the element.\n\n```js\nawait web.element(by.web.id('identifier')).selectAllText();\n```\n\n:::note\n\nThis action is currently supported for content-editable elements only on Android.\n\nOn iOS, Detox can select all the text of any element that supports it (for example, an input element).\n\n:::\n\n### `getText()`\n\nGet the text of the element.\n\n```js\nconst text = await web.element(by.web.id('identifier')).getText();\n```\n\n### `scrollToView()`\n\nScroll to the element until its top is at the top of the viewport.\n\n```js\nawait web.element(by.web.id('identifier')).scrollToView();\n```\n\n### `focus()`\n\nFocus on the element.\n\n```js\nawait web.element(by.web.id('identifier')).focus();\n```\n\n### `moveCursorToEnd()`\n\nMove the input cursor to the end of the element's content.\n\n```js\nawait web.element(by.web.id('identifier')).moveCursorToEnd();\n```\n\n:::note\n\nThis action is currently supported for content-editable elements only on Android.\n\nOn iOS, Detox can move the cursor to the end of any element that supports it (for example, an input element).\n\n:::\n\n### `runScript(script[, args])`\n\nRun the specified script on the element.\nThe script should be a string that contains a valid JavaScript function.\nIt will be called with that element as the first argument:\n\n```js\nconst webElement = web.element(by.web.id('identifier'));\nawait webElement.runScript('(el) => el.click()');\n```\n\nFor convenience, you can pass a function instead of a string, but please note that this will not work if the function uses any variables from the outer scope:\n\nThe script can accept additional arguments and return a value. Make sure the values are primitive types or serializable objects, as they will be converted to JSON and back:\n\n```js\nconst text = await webElement.runScript(function get(element, property) {\n  return element[property];\n}, ['textContent']);\n```\n\n### `getCurrentUrl()`\n\nGet the current URL of the web view.\n\n```js\nconst url = await web.element(by.web.id('identifier')).getCurrentUrl();\n```\n\n:::note\n\nAlthough this action returns the URL of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.\n\nYou might face issues with this action on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `getTitle()`\n\nGet the title of the web view.\n\n:::note\n\nAlthough this action returns the title of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.\n\n:::\n\n```js\nconst title = await web.element(by.web.id('identifier')).getTitle();\n```\n\n## Expectations\n\nWeb view expectations are used to assert the state of elements within a web view:\n\n- [`toHaveText()`]\n- [`toExist()`] (supports [`asSecured()`])\n- [`not`] (supports [`asSecured()`])\n\n### `toHaveText(text)`\n\nAssert that the element has the specified text.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n```\n\n### `toExist()`\n\nAssert that the element exists.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).toExist();\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait expect(web.element(by.web.label('Hello World!')).asSecured()).toExist();\n```\n\n:::note\n\nYou might face issues with this expectation on Android. Check [this GitHub issue](https://github.com/wix/Detox/issues/4398) for more information.\n\n:::\n\n### `not`\n\nNegate the expectation.\n\n```js\nawait expect(web.element(by.web.id('identifier'))).not.toHaveText('Hello World!');\n```\n\nSupports [`asSecured()`] on **iOS only**:\n\n```js\nawait expect(web.element(by.web.label('Hello World!')).asSecured().atIndex(1)).not.toExist();\n```\n\n## `asSecured()`\n\n:::note experimental\n\nThis API is available only on **iOS** and is currently in the experimental phase. It is subject to changes in the near future.\n\n:::\n\nThe `asSecured()` API is designed for interacting with web pages that use secured protocols, such as PCI DSS for payment pages. Use it when the regular API fails to interact with such pages. Detox uses system-level interactions with the webview in these scenarios. This approach is less performant and has fewer APIs.\n\nExample:\n\n```js\nawait web.element(by.web.label('Submit')).asSecured().tap();\n```\n\n### Why use `asSecured()`?\n\nUse `asSecured()` for web pages with secured protocols when regular Detox interactions fail. For CORS issues, consider passing the [`detoxDisableWebKitSecurity`] launch argument to enable less strict security limitations for interacting with secured web views.\n\n[native matchers]: matchers.md\n\n[`by.id()`]: matchers.md#byidid\n\n[web view matchers]: webviews.md#matchers\n\n[web view actions]: webviews.md#actions\n\n[web view expectations]: webviews.md#expectations\n\n[`by.web.id()`]: webviews.md#bywebidid\n\n[`by.web.className()`]: webviews.md#bywebclassnameclassname\n\n[`by.web.cssSelector()`]: webviews.md#bywebcssselectorcssselector\n\n[`by.web.name()`]: webviews.md#bywebnamename\n\n[`by.web.xpath()`]: webviews.md#bywebxpathxpath\n\n[`by.web.href()`]: webviews.md#bywebhrefhref\n\n[`by.web.hrefContains()`]: webviews.md#bywebhrefcontainshref\n\n[`by.web.tag()`]: webviews.md#bywebtagtag\n\n[`by.web.value()`]: webviews.md#bywebvaluevalue\n\n[`by.web.label()`]: webviews.md#byweblabellabel\n\n[`by.web.type()`]: webviews.md#bywebtypeaccessibilitytype\n\n[`atIndex()`]: webviews.md#atindexindex\n\n[`tap()`]: webviews.md#tap\n\n[`typeText()`]: webviews.md#typetexttext-iscontenteditable\n\n[content-editable]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable\n\n[`replaceText()`]: webviews.md#replacetexttext\n\n[`clearText()`]: webviews.md#cleartext\n\n[`selectAllText()`]: webviews.md#selectalltext\n\n[`getText()`]: webviews.md#gettext\n\n[`scrollToView()`]: webviews.md#scrolltoview\n\n[`focus()`]: webviews.md#focus\n\n[`moveCursorToEnd()`]: webviews.md#movecursortoend\n\n[name]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#name\n\n[`runScript()`]: webviews.md#runscriptscript-args\n\n[`getCurrentUrl()`]: webviews.md#getcurrenturl\n\n[`getTitle()`]: webviews.md#gettitle\n\n[`toHaveText()`]: webviews.md#tohavetexttext\n\n[`toExist()`]: webviews.md#toexist\n\n[`not`]: webviews.md#not\n\n[`asSecured()`]: webviews.md#assecured\n\n[`detoxDisableWebKitSecurity`]: device.md#12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/articles/design-principles.md",
    "content": "# Design Principles\n\nTraditionally, end-to-end tests on mobile are riddled with inherent issues, making the testing process difficult and lowering ROI for developers. We believe that the only way to solve these issues at the core is by changing some of the basic principles of our approach.\n\n- **Detox does not rely on [WebDriver](https://www.selenium.dev/documentation/webdriver)** — Detox is built from the ground up to integrate with native layers of your mobile app directly. We try to avoid generic cross-platform interfaces that are often the lowest common denominator. We want to optimize per platform\n\n- **Detox does gray box, not black box** — Theoretically, it sounds better to test exactly what you ship as a black box. In practice, switching to gray box allows the test framework to monitor the app from the inside and delivers critical wins like fighting flakiness at the core\n\n- **Detox synchronizes with your app’s activity** — By being aware of what your app is doing and synchronizing with it, Detox times its actions, by default, to run only when your app is idle, meaning it has determined that your app has finished its work, such as animations, network requests, React Native load, etc. You can further read on this [here](../troubleshooting/synchronization.md)\n\n- **Built from the ground up for mobile apps, has first-class React Native support** — Detox is built from the ground up for native mobile and has a first-class support for React Native apps\n\n- **Expectations run on the app, not the tester process** — Traditionally, test frameworks evaluate expectations in the test script, running on Node.js. Detox evaluates expectations directly in the tested app, running on device; this enables operations that were impossible before due to performance reasons\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/articles/how-detox-works.md",
    "content": "# How Detox Works\n\nDetox is an end-to-end testing framework. This means it runs your app on an actual device, or a device simulator/emulator and interacts with it just like a real user would. This type of testing can give a lot of confidence in your app and help automate an otherwise tedious manual QA process.\n\nWhen a Detox test executes, you actually have two different parts running side by side:\n\n1. **The mobile app itself**, running on a device or a device simulator/emulator. A regular native-build of your app is installed and executed on the device, orchestrated by native Detox code that is built separately and installed alongside the app itself.\n\n2. **The test suite**, running on Node.js, over a test runner like Jest. The tests are normally written in JavaScript, and utilize the JavaScript part of Detox.\n\nThe two parts are run in separate processes on your machine. It is also possible to run the two parts on different machines. Communication between the two parts takes place over the network using a web socket.\n\nIn practice, to make the communication more resilient, both parts are implemented as clients and communicate through a Detox server that acts as mediator. Having that server allows for some advantages like allowing one side to disconnect (during a simulator boot for example or app restart) without disconnecting the other side and losing its state.\n\n## Automatic App-State Synchronization\n\nOne of Detox's key features is the automatic synchronization of test execution with the app's state. For example, consider the following super-common moment in a test scenario:\n\n1. Node.js runs test code that effectively tells Detox to tap on the *login* button. Detox sends this tap command to the app.\n2. The app receives the command, the button is pressed, and the login process begins. A secure user session is obtained from the server, and the app navigates to the home screen. The home screen fetches yet even more data from the servers and renders elements with loading animations.\n3. **Detox - being a gray-box testing framework, monitors these changes in the app's state and waits for them to complete. This ensures that the test and the app's current state remain in-sync.**\n4. Detox proceeds to the next action in the test code only after the app is stable (!)\n\nLet’s deep-dive into step #2: So much UI work happens with numerous network requests performed in the background… What is the order of execution of those requests, and how long should you wait until all of them are replied to? How long should you wait until the UI is ready? For the network, it depends on which request completes first, which in turn depends on network congestion and how busy the server is. As for the UI, it depends on the specific test device / machine specs and how busy its processor is.\n\nIn the traditional black-box (rather than gray-box) testing approach, you normally deal with being blind to the app’s state by adding various `sleep()` / `waitFor()` commands throughout the test in an attempt to force order into the chaos. In step #3, **Detox eliminates the need for that malpractice, and so introduces stability into the otherwise inherently-flaky test world.**\n\n### Operations Detox synchronizes with automatically\n\n- **Network requests** - Detox monitors in-flight requests over the network (waiting for them to be responded).\n\n- **Main thread (native)** - Detox monitors pending native operations on the app's main thread (main dispatch queue and main `NSOperationQueue`).\n\n- **Layout of UI** - Detox monitors UI layout operations. There’s also special support for React Native layout which includes the Shadow Queue where [yoga](https://github.com/facebook/yoga) runs.\n\n- **Timers** - Detox monitors timers (explicit asynchronous delays). There’s special support for JavaScript's `setTimeout`, which is monitored.\n\n- **Animations** - Detox monitors active animations and transitions. There’s special support for React Native animations with the Animated library, and even the popular [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated).\n\n- **React Native JavaScript thread** - Detox monitors pending operations on the JavaScript thread in RN apps.\n\n- **React Native native-modules thread** - Detox monitors pending RN native-module actions executed on its dedicated thread.\n\n- **React Native bridge** - In non-bridge-less apps (i.e. before RN's new-architecture), Detox monitors the React Native bridge and asynchronous messages delivered through it.\n\n:::info\n\nIn this synchronization process, [`session.debugSynchronization`](../config/session.mdx#sessiondebugsynchronization-number) plays a significant role. This setting, enabled by default, keeps an eye on tasks that are keeping the app busy and logs the details if these actions take longer than the specified value to complete.\n\n:::\n\n## Architecture\n\nDetox comprises the following components:\n\n- [**Tester**](https://github.com/wix/Detox/tree/master/detox/src): The testing component, running in a Node.js process on the host computer, executing the test logic. The tester is also responsible for device management and artifact collection.\n- **Detox native client ([iOS](https://github.com/wix/Detox/tree/master/detox/ios) & [Android](https://github.com/wix/Detox/tree/master/detox/android)):** A component that gets seamlessly integrated into the tested app on the tested device, right as Detox starts executing. It synchronizes with the app, matches user queries, executes user commands (e.g. taps, scrolls) and validates expectations.\n- **[Detox mediator server](https://github.com/wix/Detox/tree/master/detox/src/server)**: A small web socket server, running in a Node.js process on the host computer, used to connect between the tester and the client. Normally, the tester starts a server on a randomized session id and an available port, and sends the session and port to the client app as a launch argument.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/articles/third-party-drivers.md",
    "content": "# Third-Party Drivers\n\nDetox comes with built-in support for running on Android and iOS by choosing a driver type in your Detox configurations.\nFor example, the following configuration uses the \"ios.simulator\" driver.\n\n```json\n{\n  \"ios.sim\": {\n    \"type\": \"ios.simulator\",\n    \"device\": \"...\",\n    \"app\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"bin/YourApp.app\"\n    }\n  }\n}\n```\n\nWhile Detox technically supports Android devices and iOS simulators out of the box, devices running other platforms such as [Web](https://github.com/necolas/react-native-web) or [Windows](https://github.com/microsoft/react-native-windows) can be targeted.\n\nIf your app targets a third-party platform, you may switch to use a [third-party driver](#how-to-use-a-third-party-driver) to run your tests on said platform. If one doesn’t already exist, you can [write your own](#Writing-a-new-third-party-driver).\n\n## How to Use a Third-party Driver\n\nCheck to see if a [third-party driver](#existing-third-party-drivers) already exists for the platform you wish to target. Mostly likely, the driver will have setup instructions.\n\nOverall the setup for any third party driver is fairly simple.\n\n1. Add the driver to your `package.json` with:\n\n   ```bash npm2yarn\n   npm install --save-dev detox-driver-package\n   ```\n\n1. Add a new Detox configuration to your existing configurations with the `type` set to driver’s package name.\n\n   ```diff\n   +  \"thirdparty.driver.config\": {\n   +    \"type\": \"detox-driver-package\",\n   +    \"app\": {\n   +      \"binaryPath\": \"bin/YourApp.app\",\n   +    }\n   +  }\n   ```\n\n1. Run Detox while specifying the name of your new configuration:\n\n   ```bash\n   detox test --configuration thirdparty.driver.config\n   ```\n\n## Writing a New Third-party Driver\n\n### Anatomy of the Drivers\n\nThe architecture of a driver is split into a few different pieces; Understanding the [overall architecture of Detox](how-detox-works.md#Architecture) will help with this section.\n\n_Components running in the context of the test logic execution on the Node.js process on the host computer:_\n\n1. **The Device Drivers layer:** The layer contains a collection of drivers, implementing - mostly, though not exclusively, the platform-specific details for the Detox [`device` object](../api/device.md) that is exposed in the Detox tests.\n   The implementation is responsible for managing devices your tests will run on, in terms of device allocation, app installation user interactions (e.g. taps) execution and so on.\n1. **Matchers:** code powering the `expect`, `element`, `waitFor` and `by` globals in your tests.\n   In essence, it translates and sends test-logic commands (such as taps and assertions) over the network to the device on which your tests are running. In turn, the device natively performs these commands.\n\n_The component running on the device being tested, injected into the test app:_\n\n1. **Native Client:** The driver client communicates with the server over\n   websocket where it receives information from the serialized matchers, and expectations, and also sends responses\n   back of whether each step of your test succeeds or fails. Typically, a device client will use an underlying library specific\n   to the platform at hand to implement the expectations.\n\n### Implementation Details\n\nIn order to introduce a third-party Driver, there is a set of core classes you must implement - each responsible for a different Detox concern:\n\n- Allocation: The process of launching / selecting a device over which the tests would run.\n- Pre-validation: The checkup of the execution-environment (e.g. verifying the Android SDK is installed).\n- Artifact handlers registration: The process where platform-based artifacts generation handlers are registered (e.g. handlers for taking screenshots, which are different between the Android and iOS platforms).\n- Runtime: The _de facto_ execution of test logic.\n- Matchers: The matching of visible elements and visibility assertion.\n\nTo understand the exact contract of these classes, refer to [`examples/demo-plugin/driver.js`](https://github.com/wix/Detox/blob/master/examples/demo-plugin/driver.js) for a dummy implementation, or to [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer) for an actual implementation of such as driver.\n\nVery roughly speaking, this is the expected skeletal implementation:\n\n```js\nconst DeviceDriverBase = require('detox/src/devices/runtime/drivers/DeviceDriverBase');\n\nclass Cookie {\n  constructor(id) {\n    this.id = id; // hold any info necessary in order to identify the associated device\n  }\n}\n\nclass MyNewAllocationDriver {\n  constructor(deps) {\n    this.emitter = deps.eventEmitter;\n  }\n\n  async allocate(deviceConfig) {\n    // ...\n    return new Cookie(id); // This is where a cookie is formed once for the entire process\n  }\n\n  async postAllocate(cookie) {\n    // Optional method to handle operations after the device is allocated\n    // like waiting until the boot animation is finished, configuring the device, etc.\n  }\n\n  async free(cookie, options) {\n    // ...\n  }\n}\n\nclass MyNewEnvValidator {\n  validate() {\n    // ...\n  }\n}\n\nclass MyNewArtifactsProvider {\n  declareArtifactPlugins() {\n    // ...\n  }\n}\n\nclass MyNewRuntimeDriver extends DeviceDriverBase {\n  constructor(deps, cookie) {\n    // ...\n  }\n\n  // ...\n}\n\nclass MyExpect {\n  // ...\n}\n\n\nmodule.exports = MyNewDriver;\n```\n\n## Existing Third-party Drivers\n\n- [detox-puppeteer](https://github.com/ouihealth/detox-puppeteer)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/build-framework-cache.md",
    "content": "# detox build-framework-cache\n\n```bash\ndetox build-framework-cache\n```\n\n**MacOS only.**\nBuilds cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively build components. By default, both components are built.\n\n## Options\n\n- `--detox` - Builds **only** the Detox injected framework. Default is false (build both).\n- `--xcuitest` - Builds **only** the XCUITest runner. Default is false (build both).\n\nDetox stores a cached version of its framework and XCUITest-runner in `~/Library/Detox/ios/*` in unique folders, where the folder name\nis a hash of Xcode and Detox version combination. This cache is used to speed up the build process and avoid unnecessary recompilations.\n\nHere is an example of the cache structure:\n\n```plain text\n├── ios\n│  ├── framework\n│  │   ├── 197a0586bd006583562a5916c969d158133a8c50\n│  │   ├── …\n│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f\n│  ├── xcuitest-runner\n|  │   ├── 197a0586bd006583562a5916c969d158133a8c50\n│  │   ├── …\n│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f\n│…\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/build.md",
    "content": "# detox build\n\n`detox build [options]`\n\nRuns the [`build` command](../config/apps.mdx#properties) of the app (or apps)\nfrom the specified [configuration](../config/overview.mdx#config-structure).\n\n| Option                                | Description                                                                                                                                   |\n| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| -c, --configuration `<device config>` | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it |\n| -C, --config-path `<configPath>`      | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                         |\n| -i, --if-missing                      | Execute the build command only if the app binary is missing.                                                                                  |\n| -s, --silent                          | Do not fail with error if an app config has no build command.                                                                                 |\n| --help                                | Show help                                                                                                                                     |\n\n## Examples\n\nIf you have only one configuration, you can simply use:\n\n```bash\ndetox build\n```\n\nTo choose a specific configuration:\n\n```bash\ndetox build --configuration yourConfiguration\n```\n\nTo skip building an app if it already is built:\n\n```bash\ndetox build --configuration yourConfiguration --if-missing\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/clean-framework-cache.md",
    "content": "# detox clean-framework-cache\n\n```bash\ndetox clean-framework-cache\n```\n\n**MacOS only.**\nCleans cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively remove components. By default, both components are cleaned.\n\n## Options\n\n- `--detox` - Cleans **only** the Detox injected framework. Default is false (clean both).\n- `--xcuitest` - Cleans **only** the XCUITest runner. Default is false (clean both).\n\nSee also: [`detox build-framework-cache`](build-framework-cache.md)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/init.md",
    "content": "# detox init\n\n```bash\ndetox init\n```\n\nCreates a few template files in the current project directory to [get you started with Detox](../introduction/project-setup.mdx):\n\n- `.detoxrc.js` – [Detox config](../config/overview.mdx);\n- `e2e/jest.config.js` – [Jest config](../config/testRunner.mdx#jest-config);\n- `e2e/starter.test.js` – a simple test suite.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/overview.md",
    "content": "# detox\n\nDetox CLI lets you operate Detox from command line.\n\n## Installation\n\nInstall `detox-cli` globally via [npm](http://npmjs.org/detox-cli):\n\n```bash\nnpm install detox-cli --global\n```\n\n## Usage\n\n```bash\ndetox <command> [options]\n```\n\n## Commands\n\n| Command                   | Description                                                                                                                                                                       |\n| ------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [init]                    | Create initial E2E tests folder for Detox.                                                                                                                                        |\n| [build]                   | Run the command defined in 'build' property of the specified configuration.                                                                                                       |\n| [test]                    | Initiating your test suite.                                                                                                                                                       |\n| [recorder]                | Starts a [Detox Recorder](https://github.com/wix/DetoxRecorder) recording.                                                                                                        |\n| [build-framework-cache]   | **MacOS only.** Builds or rebuilds a cached Detox framework and/or XCUITest-runner in ~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions.    |\n| [clean-framework-cache]   | **MacOS only.** Deletes all compiled framework and XCUITest-runner binaries from \\~/Library/Detox, they will be rebuilt on 'npm install' or when running 'build-framework-cache'. |\n| [rebuild-framework-cache] | **MacOS only.** Cleans and builds a cached Detox framework and XCUITest-runner in \\~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions.       |\n| [reset-lock-file]         | Resets Detox lock file completely - all devices are marked as available after that.                                                                                               |\n| [run-server]              | Starts a standalone Detox server.                                                                                                                                                 |\n\n## Options\n\n| Options   | Description         |\n| --------- | ------------------- |\n| --version | Show version number |\n| --help    | Show help           |\n\n[init]: init.md\n\n[build]: build.md\n\n[test]: test.md\n\n[recorder]: recorder.md\n\n[build-framework-cache]: build-framework-cache.md\n\n[clean-framework-cache]: clean-framework-cache.md\n\n[rebuild-framework-cache]: rebuild-framework-cache.md\n\n[reset-lock-file]: reset-lock-file.md\n\n[run-server]: run-server.md\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/rebuild-framework-cache.md",
    "content": "# detox rebuild-framework-cache\n\n```bash\ndetox rebuild-framework-cache\n```\n\n**MacOS only.**\nRebuilds cached versions of the Detox framework and XCUITest-runner.\nThis command uses the `--detox` and `--xcuitest` flags to selectively rebuild components. By default, both components are rebuilt.\n\n## Options\n\n- `--detox` - Rebuilds **only** the Detox injected framework. Default is false (rebuild both).\n- `--xcuitest` - Rebuilds **only** the XCUITest runner. Default is false (rebuild both).\n\nSee also: [`detox build-framework-cache`](build-framework-cache.md)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/recorder.md",
    "content": "# detox recorder\n\n:::danger Warning\n\nDetox Recorder tool is deprecated due to shortage of human resources in Detox team.\n\n:::\n\nIf you have installed [Detox Recorder](https://github.com/wix/DetoxRecorder) in your project,\nyou can use this command to start a new recording.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/reset-lock-file.md",
    "content": "# detox reset-lock-file\n\n```bash\ndetox reset-lock-file\n```\n\nResets Detox lock file. The lock file contains information about busy and free devices, and this way we can ensure no device can be used simultaneously by multiple Detox test sessions.\n\nBy default, [`detox test`](test.md) command cleans the lock file on start,\nbut it targets only the devices assigned to dead and non-existent processes.\nThis command, on contrary, cleans the lock file completely.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/run-server.md",
    "content": "# detox run-server\n\n:::note\n\nThis tool is useful mostly for contributing to the native codebase of Detox, not for the outside use.\n\n:::\n\nStarts a standalone Detox server.\n\n```bash\ndetox run-server [options]\n```\n\n| Option                  | Description                                         |\n| ----------------------- | --------------------------------------------------- |\n| -p, --port \\[port]      | Port number (default: 8099)                         |\n| -l, --loglevel \\[value] | Log level: fatal, error, warn, info, verbose, trace |\n| --no-color              | Disable colorful logs                               |\n| --help                  | Show help                                           |\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/start.md",
    "content": "# detox start\n\n`detox start [options]`\n\nRuns the [`start` command](../config/apps.mdx#properties) of the app (or apps)\nfrom the specified [configuration](../config/overview.mdx#config-structure).\n\n| Option                                | Description                                                                                                                                                                              |\n| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| -C, --config-path `<configPath>`      | Specify Detox config file path. If not supplied, Detox searches for .detoxrc\\[.js] or \"detox\" section in package.json.                                                                   |\n| -c, --configuration `<device config>` | Select a local configuration from your defined configurations to extract the app \"start\" scripts from it. If not supplied, and there’s only one configuration, Detox will default to it. |\n| -f, --force                           | Ignore errors from the \"start\" scripts and continue.                                                                                                                                     |\n| --help                                | Show help                                                                                                                                                                                |\n\n## Examples\n\nIf you have only one configuration, you can simply use:\n\n```bash\ndetox start\n```\n\nTo choose a specific configuration:\n\n```bash\n# long alias:\ndetox start --configuration yourConfiguration\n# short alias:\ndetox start -c yourConfiguration\n```\n\nTo forward extra arguments to the \"start\" script, e.g.:\n\n```bash\ndetox start -c yourConfiguration -- --port 8082\n```\n\nTo ignore errors from the \"start\" scripts and continue:\n\n```bash\ndetox start -c yourConfiguration --force\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/cli/test.md",
    "content": "# detox test\n\n```bash\ndetox test [options] <...testFilePaths>\n```\n\nFor the most part, `detox test` is a convenience method which converts CLI arguments to environment variables and\nruns a third-party test runner one or multiple times (if `--retries` configured). All unknown flags are just\nforwarded as-is to the test runner underneath, e.g.:\n\n```plain text\ndetox test -c ios.debug --showConfig\n```\n\ngets translated to:\n\n```plain text\nDETOX_CONFIGURATION=ios.debug jest --showConfig\n```\n\nYou can freely take the CLI command it prints and run it independently, without the help of Detox CLI.\n\nIf there is a name conflict for some option (both the test runner and `detox test` have a CLI argument with the same\nname), you can pass it explicitly after the reserved `--` sequence:\n\n```plain text\ndetox test -c ios.debug -- --help\n↓\nDETOX_CONFIGURATION=ios.debug jest --help\n```\n\n## Options\n\n| Option                                        | Description                                                                                                                                                                                                                                                                                             |\n| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| -C, --config-path `<configPath>`              | Specify Detox config file path. If not supplied, detox searches for .detoxrc\\[.js] or \"detox\" section in package.json                                                                                                                                                                                   |\n| -c, --configuration `<device config>`         | Select a device configuration from your defined configurations, if not supplied, and there’s only one configuration, detox will default to it                                                                                                                                                           |\n| -n, --device-name \\[name]                     | Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.                                                                                                                                                                             |\n| -l, --loglevel \\[value]                       | Log level: fatal, error, warn, info, verbose, trace                                                                                                                                                                                                                                                     |\n| -d, --debug-synchronization `<value>`         | Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.                                                                                            |\n| -a, --artifacts-location `<path>`             | Artifacts (logs, screenshots, etc) root directory.[^1]                                                                                                                                                                                                                                                  |\n| --record-logs \\[failing/all/none]             | Save logs during each test to artifacts directory. Pass \"failing\" to save logs of failing tests only. The default value is **none**.                                                                                                                                                                    |\n| --take-screenshots \\[manual/failing/all/none] | Save screenshots before and after each test to artifacts directory. Pass \"failing\" to save screenshots of failing tests only. The default value is **manual**.                                                                                                                                          |\n| --record-videos \\[failing/all/none]           | Save screen recordings of each test to artifacts directory. Pass \"failing\" to save recordings of failing tests only. The default value is **none**.                                                                                                                                                     |\n| --record-performance \\[all/none]              | \\[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory. The default value is **none**.                                                                                                                                                                           |\n| --capture-view-hierarchy \\[enabled/disabled]  | \\[iOS Only] Capture `*.uihierarchy` snapshots on view action errors and `device.captureViewHierarchy()` calls. The default value is **disabled**.                                                                                                                                                       |\n| -R, --retries                                 | Re-spawn the test runner for individual failing suite files until they pass, or `<N>` times at most.                                                                                                                                                                                                    |\n| -r, --reuse                                   | Reuse existing installed app (do not delete + reinstall) for a faster run.                                                                                                                                                                                                                              |\n| -u, --cleanup                                 | Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue                                                                                                                                                                                          |\n| --jest-report-specs                           | \\[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.                                                                                                                                                                                    |\n| -H, --headless                                | Launch device in headless mode. Useful when running on CI.                                                                                                                                                                                                                                              |\n| --device-boot-args                            | A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox.<br />**Note: the value must be specified after an equal sign (`=`) and inside quotes.** Usage example:<br />`--device-boot-args=\"-http-proxy http://1.1.1.1:8000 -no-snapshot-load\"` |\n| --app-launch-args                             | Custom arguments to pass (through) onto the app every time it is launched. The same **note** applies here, as for **--device-boot-args**.<br />See [launch arguments guide](../guide/launch-args.md) for complete info.                                                                                 |\n| --start                                       | Control execution of \"start\" commands in the app configs. By default, they run right before the test runner. Pass `--start=force` to ignore the errors coming from the \"start\" commands, and run the test runner anyway. Pass `--no-start` to skip the \"start\" commands altogether.                     |\n| --no-color                                    | Disable colors in log output                                                                                                                                                                                                                                                                            |\n| --use-custom-logger                           | Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test runner’s implementation (e.g. Jest).<br />_Default: true_                                                                                                              |\n| --gpu                                         | \\[Android Only] Launch Emulator with the specific -gpu \\[gpu mode] parameter.                                                                                                                                                                                                                           |\n| --force-adb-install                           | \\[Android Only] Due to problems with the `adb install` command on Android, Detox resorts to a different scheme for installing APKs. Setting true will disable that and force usage of `adb install`, instead.<br/>This flag is temporary until the Detox way proves stable.<br/>_Default: false_        |\n| --inspect-brk                                 | Uses [node’s --inspect-brk](https://nodejs.org/en/docs/guides/debugging-getting-started/#enable-inspector) flag to let users debug the test runner <br />_Default: false_                                                                                                                               |\n| --repl                                        | Launch REPL (Read-Eval-Print Loop) mode for interactive debugging. Use `--repl=auto` to enter REPL mode automatically on test failures. <br />_Default: false_                                                                                                                               |\n| --help                                        | Show help                                                                                                                                                                                                               |                                                                                |\n\n## `DETOX_ARGV_OVERRIDE`\n\nIf you happen to be troubleshooting Detox tests inside a complex script, or a failing CI build\n(e.g., on TeamCity or Jenkins), there is an escape-hatch feature for running Detox with\nsome extra CLI args just by setting the `DETOX_ARGV_OVERRIDE` environment variable before\nrerunning it again.\n\n```plain text\n> export DETOX_ARGV_OVERRIDE=\"--forceExit -w 1 --testNamePattern='that hanging test' e2e/sanity/login.test.js\"\n> bash scripts/ci.e2e.sh\n  # ... some output ...\n  > detox test -c ios.sim.release -l verbose --maxWorkers 3\n    # ...\n    configuration=ios.sim.release ... jest --maxWorkers 1 --forceExit --testNamePattern='that hanging test' e2e/sanity/login.test.js\n```\n\nConsider the example above, where `DETOX_ARGV_OVERRIDE` forces Detox to run Jest in a single worker\nmode with a forceful exit (after 1 second) only for a selected test in a specific file.\n\nAs you might see, the idea of `DETOX_ARGV_OVERRIDE` is quite similar to [NODE\\_OPTIONS](https://nodejs.org/api/cli.html#cli_node_options_options)\nexcept for the fact you use it not for regular flows, but for forced ad-hoc patching of a failing Detox configuration to\nsave your time.\n\nPlease avoid using it in your regular flows – instead, use Detox configuration files (`.detoxrc.js`)\nas your primary choice.\n\n[^1]: If `--artifacts-location` path does not end with a slash (`/`) or a backslash, then detox CLI will append to the\n    path a subdirectory with configuration name and timestamp (e.g. `artifacts/android.emu.release.2018-06-12 05:52:43Z`).\n    In other words, the path with a slash at the end assumes you do not want a subdirectory inside.\n    For more details, please check the [Enabling artifacts](../config/artifacts.mdx#artifacts).\n    The default value is **artifacts** (plus a subdirectory).\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/apps.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport Location from './partials/_location-dictionaries.mdx';\n\n# Apps\n\nThe format of Detox config allows you to define inside it multiple app configs in a key-value manner, i.e.:\n\n## Location\n\n<Location sectionName=\"apps\" propertyName=\"app\" />\n\n## Examples\n\n<Tabs groupId=\"mobileOS\">\n  <TabItem value=\"ios.app\" label=\"ios.app\" default>\n\n```json\n{\n  \"type\": \"ios.app\",\n  \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/example.app\",\n  \"build\": \"xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build\"\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.apk\" label=\"android.apk\">\n\n```json\n{\n  \"type\": \"android.apk\",\n  \"binaryPath\": \"path/to/myApp.apk\",\n  \"build\": \"cd android && ./gradlew …\"\n}\n```\n\n  </TabItem>\n</Tabs>\n\n## Properties\n\nAn app config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                                                                                                     |\n| -------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `type`               | Mandatory property to discern app types: `ios.app`, `android.apk`.                                                                                                                                                                                                                          |\n| `name`               | Use only when working with multiple apps within the same configuration. See an example below.                                                                                                                                                                                               |\n| `binaryPath`         | Relative path to the ipa/app/apk due to be tested (make sure you build the app in a project relative path)                                                                                                                                                                                  |\n| `build`              | **\\[optional]** Build command, which can be called using [`detox build`] CLI as a convenience.                                                                                                                                                                                              |\n| `start`              | **\\[optional]** Start command, which will be called before [`detox test`] CLI starts, or explicitly via [`detox start`] command.                                                                                                                                                            |\n| `testBinaryPath`     | (optional, Android only): relative path to the test app (apk)                                                                                                                                                                                                                               |\n| `launchArgs`         | **\\[optional]** An object specifying arguments (key-values pairs) to pass through into the app, upon launching on the device. For more info, refer to the dedicated [launch-arguments guide](../guide/launch-args.md).                                                                      |\n| `reversePorts`       | **(optional, Android only)** An array of TCP ports to reverse, so that the network requests to `localhost:{port}` on Android device are going to be forwarded to the host machine.                                                                                                          |\n\n## Multiple apps\n\nTo work with multiple apps within the same configuration you should be giving each app its name, e.g.:\n\n```js\n{\n  \"apps\": {\n    \"driver.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"driver\",\n      \"binaryPath\": \"path/to/driver.app\"\n    },\n    \"passenger.ios.release\": {\n      \"type\": \"ios.app\",\n      \"name\": \"passenger\",\n      \"binaryPath\": \"path/to/passenger.app\"\n    }\n  },\n  \"configurations\": {\n    \"ios.release\": {\n      \"device\": \"simulator\",\n      \"apps\": [\"driver\", \"passenger\"],\n      \"build\": \"scripts/build-both-apps.sh\",\n      \"start\": \"scripts/start-both-apps.sh\"\n    }\n  }\n}\n```\n\nAfter that, you can change the current app in your tests via [device API](../api/device.md):\n\n```js\nawait device.selectApp('driver');\nawait device.launchApp();\n// ... run tests ...\nawait device.selectApp('passenger');\nawait device.launchApp();\n// ... run tests ...\n```\n\nAs shown in the example above, you can override app build and start commands with a single, configuration-scoped one.\nThis may be useful when you have smart scripts for building and starting multiple apps at once.\n\n[`detox build`]: ../cli/build.md\n[`detox start`]: ../cli/start.md\n[`detox test`]: ../cli/test.md\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/artifacts.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Artifacts\n\n:::info\n\nThis article is incomplete. We're looking forward to improve this article as soon as we have an opportunity to do so.\n\n:::\n\nDetox can store artifacts such as transient screenshots and device logs.\n\n## Location\n\n<Location sectionName=\"artifacts\" />\n\n## Example\n\nYou can control artifacts collection via Detox configuration:\n\n```js\n{\n  \"artifacts\": {\n    \"rootDir\": \".artifacts\",\n    \"pathBuilder\": \"./config/pathbuilder.js\",\n    \"plugins\": {\n      \"instruments\": {\"enabled\": false},\n      \"log\": {\"enabled\": true},\n      \"uiHierarchy\": \"enabled\",\n      \"screenshot\": {\n        \"shouldTakeAutomaticSnapshots\": true,\n        \"keepOnlyFailedTestsArtifacts\": true,\n        \"takeWhen\": {\n          \"testStart\": false,\n          \"testDone\": true\n        }\n      },\n      \"video\": {\n        \"android\": {\n          \"bitRate\": 4000000\n        },\n        \"simulator\": {\n          \"codec\": \"hevc\"\n        }\n      }\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.release\": {\n      // ...\n      \"artifacts\": {\n        \"rootDir\": \".artifacts/ios\",\n        \"plugins\": {\n          \"instruments\": \"all\"\n        }\n      }\n    }\n  }\n}\n```\n\nAs can be seen from the example above, in a specific configuration you may override individual properties from the default artifacts\nconfiguration. For instance, in the example above you can see that specifically in `ios.sim.release` we turn on `instruments` plugin.\n\nCLI arguments (e.g., `--artifacts-location`, `--record-logs`) still have the highest priority and override their counterparts from JSON.\n\nAlso, that example demonstrates that you can use strings (identical to the ones from CLI) in parallel to the object configurations for plugins.\nBelow you can see mappings between the string presets and the corresponding objects:\n\n| preset  | object                                                       |\n| ------- | ------------------------------------------------------------ |\n| none    | `{ \"enabled\": false }`                                       |\n| all     | `{ \"enabled\": true }`                                        |\n| failing | `{ \"enabled\": true, \"keepOnlyFailedTestsArtifacts\": true }`  |\n| manual  | `{ \"enabled\": true, \"shouldTakeAutomaticSnapshots\": false }` |\n\nThere is also a shortcut to disable artifacts for a specific configuration:\n\n```js\n{\n  \"configurations\": {\n    \"ios.no-artifacts\": {\n      // ...\n      \"artifacts\": false\n    }\n  }\n}\n```\n\nArtifacts are various recordings during tests including, but not limited to, device logs, device screenshots and screen recordings (videos).\n\n## Enabling Artifacts\n\nArtifacts are disabled by default. To enable them, specify via **launch arguments** or a **configuration** object what artifacts you want to record.\n\n### Launch Arguments\n\n- To record `.log` files, add `--record-logs all` (or `--record-logs failing`, if you want to keep logs only for failing tests).\n- To record `.mp4` test run videos, add `--record-videos all` (or `--record-videos failing`, if you want to keep video recordings only for failing tests).\n- To record `.dtxrec` (Detox Instruments recordings) for each test, add `--record-performance all`. To open those recordings, you’ll need [Detox Instruments](https://github.com/wix/DetoxInstruments). **NOTE:** only iOS is supported.\n- To capture `.uihierarchy` snapshots (**iOS only, Xcode 12.0+**) on view action failures, add `--capture-view-hierarchy enabled`.\n- To take `.png` screenshots before and after each test, add `--take-screenshots all` (or `--take-screenshots failing`, if you want to keep only screenshots of failing tests).\\\n  Alternatively, you might leverage the [device.takeScreenshot()](../api/device.md#devicetakescreenshotname) API for manual control.\n\n#### Artifacts root directory\n\n- To change artifacts root directory location (by default it is `./artifacts`), add `--artifacts-location <path>`.\\\n  **NOTE:** There is a slightly obscure convention. If you want to create automatically a subdirectory with timestamp and configuration name (to avoid file overwrites upon consequent reruns), specify a path to directory that does not end with a slash. Otherwise, if you want to put artifacts straight to the specified directory (in a case where you make a single run only, e.g. on CI), add a slash (or a backslash) to the end.\n\n```bash\ndetox test --artifacts-location /tmp/detox_artifacts  # will also append /android.emu.release.2018-06-14 08:54:11Z\ndetox test --artifacts-location /tmp/detox_artifacts/ # won’t append anything, hereby treating it as a root\n```\n\n### Configuration Object\n\nDetox artifacts can be configured in a more advanced way with the `artifacts` configuration in `package.json` (or `.detoxrc`):\n\n```json\n{\n  \"artifacts\": {},\n  \"configurations\": {\n    \"some.device\": {\n      \"artifacts\": {},\n    },\n  },\n}\n```\n\n**NOTE:** As you can see, there is a global and a local (per-configuration) configuration of the artifacts.\nDetox merges those configurations, and the per-device artifacts configuration has a higher priority over the general one.\n\nThe `artifacts` object has the following properties:\n\n| Property    | Example values                  | Default value | Description                                                                                                                                                          |\n| ----------- | ------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| rootDir     | `\".artifacts/\"`                 | `./artifacts` | A directory, where all the recorded artifacts will be placed in. Please note that there is a trailing slash convention [described above](#artifacts-root-directory). |\n| pathBuilder | `\"./e2e/config/pathbuilder.js\"` | `undefined`   | Path to a module that exports a custom `PathBuilder` [ᵃ](#path-builder)                                                                                              |\n| plugins     | `{ ... }`                       | ... see below | ... see below                                                                                                                                                        |\n\n#### Path builder\n\n**ᵃ** `PathBuilder` should be either an _object_ with a method `buildPathForTestArtifact` or a _class_ — see the corresponding interfaces below:\n\n```typescript\ninterface PathBuilder {\n    buildPathForTestArtifact(artifactPath: string, testSummary?: TestSummary): string;\n}\n\ninterface PathBuilderClass {\n    new(opts: { rootDir: string; }): PathBuilder;\n}\n```\n\nAs one can see, if a custom implementation of `PathBuilder` exports a class instead of an object, then the class constructor can also get and save `rootDir` location:\n\n```js\nclass MyPathBuilder {\n  constructor({ rootDir }) {\n    this._rootDir = rootDir;\n  }\n\n  buildPathForTestArtifact(artifactName, testSummary) {\n    /* ... use this._rootDir ... */\n  }\n}\n\nmodule.exports = MyPathBuilder;\n```\n\nIts main method, `buildPathForTestArtifact` should return a full path to the custom artifact location, when called with a suggested artifact name (e.g., `testDone.png`, `device.log`) and the current `TestSummary`, where `TestSummary` is:\n\n```typescript\ninterface TestSummary {\n    /**\n     * Name of the current test, e.g., for:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"should have a menu\".\n     */\n    title: string;\n    /**\n     * Full name of the current test, usually preceded by a suite name, e.g.:\n     * describe('that screen', () =>\n     *   it('should have a menu', () =>\n     * The expected string would be: \"that screen should have a menu\".\n     */\n    fullName: string;\n    /**\n     * Status of the current test. Free-form strings are not allowed.\n     */\n    status: 'running' | 'passed' | 'failed';\n    /**\n     * Clarifies the reason for why the test has failed.\n     * Expected to coincide only with status: 'failed'.\n     */\n    timedOut?: boolean;\n    /**\n     * If the test runner is capable of retrying failed tests, then\n     * this property indicates for which time this test is running.\n     * When the property is undefined, its value is considered to be 1.\n     * */\n    invocations?: number;\n}\n```\n\nFor more technical details, search for `ArtifactPathBuilder.js` in Detox source code.\n\nThe further subsections describe the `plugins` object structure.\n\n#### Screenshot Plugin\n\nBelow is a default screenshot plugin object configuration, which is loaded implicitly and corresponds to the `manual` preset:\n\n```json\n{\n  \"plugins\": {\n    \"screenshot\": {\n      \"enabled\": true,\n      \"shouldTakeAutomaticSnapshots\": false,\n      \"keepOnlyFailedTestsArtifacts\": false,\n      \"takeWhen\": {\n        \"testStart\": true,\n        \"testDone\": true,\n        \"appNotReady\": true,\n      },\n    }\n  }\n}\n```\n\nThe other string presets override the following properties compared to the default configuration:\n\n- `none` => `{ enabled: false }`.\n- `failing` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: true }`.\n- `all` => `{ shouldTakeAutomaticSnapshots: true, keepOnlyFailedTestsArtifacts: false }`\n\nThe individual property behavior is the following:\n\n- If `enabled` is _false_, then the screenshots will never be saved to the artifacts' folder.\n- If `shouldTakeAutomaticSnapshots` is _false_, then no one of the events described in `takeWhen` object is going to trigger a screenshot.\n- If `keepOnlyFailedTestsArtifacts` is _true_, then only screenshots from a failed test will be saved to the artifacts folder.\n- If `takeWhen` is _undefined_, it is going to have the default value described above (all props are true).\n- If `takeWhen` is set to be an empty object `{}`, that is equivalent to:\n\n```json\n{\n  \"testStart\": false,\n  \"testDone\": false,\n  \"appNotReady\": true,\n}\n```\n\nHence, for example, if you wish to enable only `testDone` screenshots and leave taking `appNotReady` screenshots as-is, you have to pass:\n\n```json\n{\n  \"artifacts\": {\n    \"plugins\": {\n      \"screenshot\": {\n        \"takeWhen\": { \"testDone\": true }\n      }\n    }\n  }\n}\n```\n\n#### Video Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### Log Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### Instruments Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n#### UI hierarchy Plugin\n\nTo be done. See meanwhile the example [above](#artifacts).\n\n## Artifacts Structure\n\n1. **Artifacts root folder** is created per detox test run. If, for instance,`--artifacts-location /tmp` is used with `--configuration ios.sim.release` configuration on 14th June 2018 at 11:02:11 GMT+02, then the folder `/tmp/ios.sim.release.2018-06-14 09:02:11Z` is created.\n\n1. **Test folder** is created per test inside the root folder. The folder name consists of the test number, and the test’s full name provided to `detox.afterEach(testSummary)` as explained above and in [detox object](../api/logger.mdx) documentation. For instance, for the above example, the following folders will be created inside `/tmp/ios.sim.release.2018-06-14 09:02:11Z`:\n\n   ```plain text\n   ✗ Assertions should assert an element has (accessibility)\n   ✓ Network Synchronization Sync with short network requests - 100ms\n   ```\n\n1. **Artifacts files** are created inside the test folders. The files suffixes stand for the files types (currently there are .err.log and .out.log), and the files prefixes are the launch numbers of the application per test (if the app was executed more than once per test, you will have several artifacts of each type - one per launch). For instance, a test folder may contain the following artifacts files:\n\n   ```plain text\n   test.log\n   test.mp4\n   test.dtxrec/\n   beforeEach.png\n   afterEach.png\n   ```\n\n### Example of the structure\n\n```plain text\nartifacts/android.emu.release.2018-06-12 06:36:18Z/startup.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/beforeEach.png\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.log\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/test.mp4\nartifacts/android.emu.release.2018-06-12 06:36:18Z/✗ Assertions should assert an element has (accessibility) id/afterEach.png\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/behavior.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Behavior\n\nIf you need to tweak the flow of `detox.init()` or `detox.cleanup()` steps,\nyou have a few options to change. These are the default behavior values:\n\n## Location\n\n<Location sectionName=\"behavior\" />\n\n## Default values\n\n```json\n{\n  \"behavior\": {\n    \"init\": {\n      \"reinstallApp\": true,\n      \"exposeGlobals\": true,\n    },\n    \"launchApp\": \"auto\",\n    \"cleanup\": {\n      \"shutdownDevice\": false\n    }\n  }\n}\n```\n\n## Properties\n\n### `behavior.init.reinstallApp` \\[boolean]\n\nDefault: `true`.\n\nWhen _true_, Detox will uninstall and install the app upon the initialization.\n\nSetting it to _false_ forces the tests to use the previously installed app on the device,\nprovided you have installed it beforehand [explicitly](../api/device.md#deviceinstallapp) or manually.\n\n### `behavior.init.exposeGlobals` \\[boolean]\n\nDefault: `true`.\n\nWhen _true_, it forces Detox to expose `device`, `expect`, `element`, `by` and `waitFor`\nas global variables.\n\nWhen _false_, you should import them explicitly instead:\n\n```js\nconst { by, device, expect, element } = require('detox');\n```\n\nor, in TypeScript:\n\n```js\nimport { by, device, expect, element } from 'detox';\n```\n\n### `behavior.launchApp` \\[enum]\n\nDefault: `auto`.\n\nPossible values: `auto`, `manual`.\n\nWhen set to `manual`, Detox won't be launching your app automatically. Instead, it will\nbe waiting until you launch it manually from IDE and press any key to resume the test\nexecution. This is useful when you want to [debug the native codebase](../introduction/debugging.mdx) when running Detox tests.\n\nAlso, setting it to `manual` resets `behavior.reinstallApp` to _false_.\n\n### `behavior.cleanup.shutdownDevice` \\[boolean]\n\nDefault: `false`.\n\nWhen set to _true_, Detox will shut down the device after the tests finish.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/devices.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport Location from './partials/_location-dictionaries.mdx';\n\n# Devices\n\nThe format of Detox config allows you to define inside it multiple device configs in a key-value manner, i.e.:\n\n## Location\n\n<Location sectionName=\"devices\" propertyName=\"device\" />\n\n## Examples\n\n<Tabs groupId=\"deviceType\">\n  <TabItem value=\"ios.simulator\" default>\n\n```json\n{\n  \"type\": \"ios.simulator\",\n  \"device\": {\n    // one of these or a combination of them\n    \"id\": \"D53474CF-7DD1-4673-8517-E75DAD6C34D6\",\n    \"type\": \"iPhone 11 Pro\",\n    \"name\": \"MySim\",\n    \"os\": \"iOS 13.0\"\n  },\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.emulator\">\n\n```json\n{\n  \"type\": \"android.emulator\",\n  \"device\": {\n    \"avdName\": \"Pixel_2_API_29\"\n  },\n  \"utilBinaryPaths\": [\n    \"optional-property-with/path/to/test-butler-or-anything-else.apk\"\n  ],\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.attached\">\n\n```json\n{\n  \"type\": \"android.attached\",\n  \"device\": {\n    \"adbName\": \"YOGAA1BBB412\"\n  }\n}\n```\n\n  </TabItem>\n  <TabItem value=\"android.genycloud\">\n\n```json\n{\n  \"type\": \"android.genycloud\",\n  \"device\": {\n    // one of these:\n    \"recipeUUID\": \"11111111-2222-3333-4444-555555555555\"\n    \"recipeName\": \"MyRecipeName\",\n  }\n}\n```\n\n  </TabItem>\n</Tabs>\n\n## Properties\n\nA device config can have the following params:\n\n| Configuration Params | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`               | _**Required.** String Literal_. Mandatory property to discern device types: `ios.simulator`, `android.emulator`, `android.attached`, `android.genycloud` etc.                                                                                                                                                                                                                                                                                                                                       |\n| `device`             | _**Required.** Object._ Device query, e.g. `{ \"byType\": \"iPhone 11 Pro\" }` for iOS simulator, `{ \"avdName\": \"Pixel_2_API_29\" }` for Android emulator or `{ \"adbName\": \"<pattern>\" }` for attached Android device with name matching the regex.                                                                                                                                                                                                                                                      |\n| `bootArgs`           | _Optional. String. Supported by `ios.simulator` and `android.emulator` only._ <br/> Supply an extra _String_ of arguments to `xcrun simctl boot ...` or `emulator -verbose ... @AVD_Name`.                                                                                                                                                                                                                                                                                                          |\n| `forceAdbInstall`    | _Optional. Boolean. Supported for Android devices only._ <br/> A _Boolean_ value, `false` by default. When set to `true`, it tells `device.installApp()` to use `adb install`. Otherwise, it would use the combination of `adb push <app.apk>` and `adb shell pm install`.                                                                                                                                                                                                                          |\n| `utilBinaryPaths`    | _Optional. Array of strings. Supported for Android devices only._ <br/> An array of relative paths of _utility_ app (APK) binary-files to preinstall on the tested devices - once before the test execution begins.<br/>**Note**: these are not affected by various install-lifecycle events, such as launching an app with `device.launchApp({delete: true})`, which reinstalls the app. A good example of why this might come in handy is [Test Butler](https://github.com/linkedin/test-butler). |\n| `gpuMode`            | _Optional. String Literal (<code>auto \\| host \\| swiftshader\\_indirect \\| angle\\_indirect \\| guest</code>). Supported by `android.emulator` only._ <br/> A fixed **string** , which tells [in which GPU mode](https://developer.android.com/studio/run/emulator-acceleration#command-gpu) the emulator should be booted.                                                                                                                                                                            |\n| `headless`           | _Optional. Boolean._ `false` by default. When set to `true`, it tells Detox to boot an Android emulator with `-no-window` option, or to not open the iOS Simulator app when running with Android or iOS respectively.                                                                                                                                                                                                                                                                               |\n| `readonly`           | _Optional. Boolean. Supported by `android.emulator` only._ <br/>  `false` by default. When set to `true`, it forces Detox to boot even a single emulator with `-read-only` option.<br/>**Note**: when used with multiple workers, this setting has no effect — emulators will be booted always with `-read-only`.                                                                                                                                                                                   |\n| `systemUI`           | _Optional. String or Object. Supported by Android devices only._ <br/> Configures the Android System UI for consistent screenshots and test stability. Can be set to `\"minimal\"` or `\"genymotion\"` (preset configurations) or an object with granular control. When using an object, you can set `extends: \"minimal\"` or `extends: \"genymotion\"` to start from a preset and override specific properties. All properties accept `null` to explicitly reset to default behavior. <br/><br/>**Object properties:**<br/>- `keyboard`: `'hide'` \\| `'show'` \\| `null` - Controls keyboard visibility. Note: For `'hide'` to work in Google emulators, set `hw.keyboard=yes` in AVD configuration.<br/>- `touches`: `'hide'` \\| `'show'` \\| `null` - Controls touch indicator visibility.<br/>- `pointerLocationBar`: `'hide'` \\| `'show'` \\| `null` - Controls pointer location bar visibility.<br/>- `navigationMode`: `'3-button'` \\| `'gesture'` \\| `null` - Sets navigation bar mode.<br/>- `statusBar`: Object with the following properties:<br/>  - `notifications`: `'show'` \\| `'hide'` \\| `null` - Controls notification icons visibility.<br/>  - `wifiSignal`: `'strong'` \\| `'weak'` \\| `'none'` \\| `null` - Sets WiFi signal strength indicator.<br/>  - `cellSignal`: `'strong'` \\| `'weak'` \\| `'none'` \\| `null` - Sets cellular signal strength indicator. Note: Some Android versions fail to set the network type (3g, lte, etc.).<br/>  - `batteryLevel`: `'full'` \\| `'half'` \\| `'low'` \\| `null` - Sets battery level indicator.<br/>  - `charging`: `true` \\| `false` \\| `null` - Controls charging indicator.<br/>  - `clock`: `string` \\| `null` - Sets the clock time in \"hhmm\" format (e.g., `\"1337\"` for 13:37). |\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/logger.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Logger\n\nThe `logger` section controls how the printed logs are going to look like in your terminal window.\n\n![](../img/log-example.png)\n\n## Location\n\n<Location sectionName=\"logger\" />\n\n## Properties\n\n## `logger.level` \\[enum\\]\n\nDefault: `info`.\n\nPossible values in the descending severity order: `fatal`, `error`, `warn`, `info`, `debug`, `trace`.\n\n* Use `info` by default.\n* Use `error` or `warn` when you want to make the output as silent as possible.\n* Use `debug` to control what generally is happening under the hood.\n* Use `trace` when troubleshooting specific issues.\n\nPlease note that the log level has no effect on the [generated log files](artifacts.mdx) and their content – it filters only the messages printed to your terminal.\n\n:::info\n\nThe verbosity of the logs can be influenced by the [`session.debugSynchronization`](session.mdx#sessiondebugsynchronization-number) setting in your Detox configuration. Enabled by default, this setting helps track the reasons preventing your current actions from completing by identifying what the app is still busy with. It produces logs like this:\n\n```\n15:13:07.309 detox[17005] i The app is busy with the following tasks:\n• There are 10 work items pending on the dispatch queue: \"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)\".\n...\n```\n\nIf you want to disable or decrease how often session logs are saved, change the `session.debugSynchronization` value to `0` (to turn off logs) or increase it to `60000` (to lower the frequency of logs). For a deeper understanding of this setting's purpose, refer to the [How Detox Works](../articles/how-detox-works.md#how-detox-automatically-synchronizes-with-your-app) article.\n\n:::\n\n---\n\n## `logger.overrideConsole` \\[boolean\\]\n\nDefault: `true`.\n\nWhen enabled, hijacks all the console methods (console.log, console.warn, etc) so that the messages\nprinted via them are formatted and saved as Detox logs.\n\n## `logger.options` [BunyanDebugStreamOptions]\n\nDefault: varies according to the `logger.level`.\n\nSince Detox is using [bunyan-debug-stream](https://github.com/jwalton/bunyan-debug-stream) for printing logs,\nwe decided just to expose all its options for sake of simplicity of customization:\n\n```typescript\nexport interface BunyanDebugStreamOptions {\n    colors?: { [key: number]: string | string[] } | false | null;\n    forceColor?: boolean;\n    basepath?: string;\n    basepathReplacement?: string;\n    showProcess?: boolean;\n    showDate?: boolean | ((time: Date, entry: any) => string);\n    showPrefixes?: boolean | ((prefixes: string[]) => string);\n    processName?: string;\n    maxExceptionLines?: number | 'auto';\n    stringifiers?: { [key: string]: Stringifier | null };\n    prefixers?: { [key: string]: Stringifier | null };\n    indent?: string;\n    showLoggerName?: boolean;\n    showPid?: boolean;\n    showLevel?: boolean;\n    showMetadata?: boolean;\n}\n```\n\nThere's one caveat inside `logger.options`, however – all the custom functions **must not** use closures! That's\nbecause they get `eval()`-ed every time the test runner spawns a new child worker process. In other words:\n\n```js\nconst dontDoThis = date => date.toISOString();\n\nmodule.exports = {\n  logger: {\n    level: 'debug',\n    options: {\n      // showDate: (date) => dontDoThis(date),\n// highlight-next-line\n      showDate: (date) => date.toISOString(), /* do this instead */\n    },\n  },\n  // ...\n};\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/overview.mdx",
    "content": "# Overview\n\n:::info\n\nIf you prefer to read TypeScript files instead of docs, feel free to browse through\n[the typings file](https://github.com/wix/Detox/blob/master/detox/index.d.ts) provided by Detox.\n\n:::\n\nRunning automated tests on your mobile application implies firstly that\nyou have a mobile device and an application. Unlike unit tests, where\npassing tests don’t require extra checks, the end-to-end tests are better\nto be executed multiple times – on various devices and app flavors (e.g.\n_debug_ and _release_).\n\nThis is why Detox is inclined towards static configuration files describing\npermutations of _apps_, _devices_ and a lot more, actually. If you come to\nthink of it, even a simple React Native application is likely to have four\ncombinations:\n\n1. iOS simulator running a _debug_ build;\n1. iOS simulator running a _release_ build;\n1. Android emulator running a _debug_ build;\n1. Android emulator running a _release_ build;\n\nImagine you want to check your app both on phones and tablets, and now you\nhave eight combinations already! Add multiple OS versions into the test\ncoverage matrix equation, and the configuration grows by a factor of N.\n\n## Config structure\n\nIn view of the arguments above, our recommendation to keep Detox configs\nneat and tidy is to keep them inside three key-value dictionaries:\n`devices`, `apps` and `configurations`. See the schematic code below:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n// highlight-next-line\n  devices: {\n    device1: { /* ... */  },\n    device2: { /* ... */  },\n  },\n// highlight-next-line\n  apps: {\n    app1: { /* ... */  },\n    app2: { /* ... */  },\n  },\n// highlight-next-line\n  configurations: {\n    'device1+app1': {\n      device: 'device1',\n      app: 'app1',\n    },\n    /* ... */\n  },\n};\n```\n\nConfiguration names serve as an entry point, when you want to run Detox tests:\n\n```bash\ndetox test -c 'device1+app1'\n```\n\nWhen Detox starts, it picks the specified configuration and resolves its aliases to the device and\nthe application. However, the config file is not limited only to devices and applications – there\nare more sections:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n// highlight-start\n  artifacts: { /* ... */ },\n  behavior: { /* ... */ },\n  logger: { /* ... */ },\n  session: { /* ... */ },\n  testRunner: { /* ... */ },\n// highlight-end\n  devices: { /* ... */ },\n  apps: { /* ... */ },\n  configurations: { /* ... */ },\n};\n```\n\nWhen the config gets finally resolved, it looks more like a flat structure, as shown on the diagram:\n\n![Detox config with its global dictionaries for apps, devices and configurations, and also its other config sections, when resolved, it becomes a flat object with all imaginable properties: device, apps, test runner, logger, artifacts, behavior, session, etc.](../img/internals/config-resolution.png)\n\nAside from mandatory `device` and `app` properties, each configuration can have\noverrides to the global config sections such as `testRunner`, `artifacts`,\n`behavior` and others, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  logger: {\n// highlight-next-line\n    level: process.env.CI ? 'debug' : 'info',\n  },\n  /* ... */\n  configurations: {\n    'ios.sim.debug': {\n      device: 'iphone',\n      app: 'ios.debug',\n// highlight-start\n      testRunner: {\n        args: {\n          runInBand: true,\n        },\n      },\n// highlight-end\n      // ...\n// highlight-start\n      logger: {\n        level: 'trace' // override\n      },\n// highlight-end\n    },\n  },\n};\n```\n\nFor more clarity, this relationship might be illustrated with a diagram:\n\n![Detox configurations refer to devices and apps dictionaries, and may also contain overrides to the other global config sections: test runner, artifacts, behavior, logger and session.](../img/internals/config-dictionaries.png)\n\nIt should be noted that the aliasing of devices and apps is optional in fact.\nInstead of using keys, you can inline both device and app configs into your\nconfiguration, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  configurations: {\n    'ios.sim.debug': {\n      device: {\n        type: 'ios.simulator',\n        device: {\n          type: 'iPhone 13 Pro',\n        },\n      },\n      app: {\n        type: 'ios.app',\n        binaryPath: '/path/to/your.app',\n      },\n    },\n  },\n};\n```\n\nBesides, there is [basic support](apps.mdx) for tests with multiple applications, if you switch\nto `apps` array (aliased or inlined) instead of `app`, e.g.:\n\n```js\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  apps: { /* ... */ },\n  devices: { /* ... */ },\n  configurations: {\n    'multi.ios.debug': {\n      device: 'iphone',\n      apps: ['passenger.ios.debug', 'driver.ios.debug'],\n    },\n  },\n};\n```\n\n## Path conventions\n\nDetox supports standalone configuration files and the respective named section inside `package.json`.\nIt starts scanning from the current working directory, and runs over the following options, in this order:\n\n1. `.detoxrc.js`\n1. `.detoxrc.json`\n1. `.detoxrc` (JSON)\n1. `detox.config.js`\n1. `detox.config.json`\n1. `package.json`\n\nIf you decide to have `detox` section in your `package.json`, it should be defined as a top-level\nproperty:\n\n```json\n{\n  \"name\": \"your-project\",\n  \"version\": \"X.Y.Z\",\n  \"scripts\": {},\n// highlight-start\n  \"detox\": {\n    \"devices\": {},\n    \"apps\": {},\n    \"configurations\": {},\n  }\n// highlight-end\n}\n```\n\n## Extending\n\nAll Detox config files are extensible by definition.\nThat helps if you ever need to share certain settings across multiple mobile projects, e.g.:\n\n```json\n{\n// highlight-next-line\n  \"extends\": \"@my-org/detox-preset\",\n  \"configurations\": {\n    // …\n  },\n}\n```\n\nPlease note that `extends` has to be a valid Node module path. Relative module paths will be resolved relatively\nto the Detox config file which contains that specific `extends` property, e.g.:\n\n```js title=\"~/Projects/my-project/e2e/detox.config.js\"\nmodule.exports = { extends: \"../base.detox.config.js\" };\n// the path resolves to: ~/Projects/my-project/base.detox.config.js\n\nmodule.exports = { extends: \"./ci.detox.config.js\" };\n// the path resolves to: ~/Projects/my-project/e2e/ci.detox.config.js\n```\n\nThe extension chain can have an arbitrary length. All the configs are going to be _deep-merged_ in the logical\norder: grandparent ← parent ← child.\n\n## Default configuration\n\nAs you might have noticed, you always have to pass `-c <configuration name>` argument when running Detox tests:\n\n```bash\ndetox test -c ios.sim.debug\n```\n\nTechnically this is not true. You can omit the configuration name if:\n\n- there is only one configuration in `configurations` dictionary;\n- you set some configuration as a default choice via `selectedConfiguration` property:\n\n  ```js\n  /* @type {Detox.DetoxConfig} */\n  module.exports = {\n  // highlight-next-line\n    selectedConfiguration: 'device1+app1',\n    devices: {\n      device1: { /* ... */  },\n      device2: { /* ... */  },\n    },\n    apps: {\n      app1: { /* ... */  },\n      app2: { /* ... */  },\n    },\n    configurations: {\n  // highlight-next-line\n      'device1+app1': {\n        device: 'device1',\n        app: 'app1',\n      },\n      /* ... */\n    },\n  };\n  ```\n\nThe next articles will be describing each configuration section in detail.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/partials/_location-dictionaries.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<p>\n  You can define the {props.propertyName} config in two\n  ways: <i>aliased</i> and <i>inlined</i> (per a configuration):\n</p>\n\n<CodeBlock title=\".detoxrc.js\" language=\"javascript\">\n  {[\n    '/** @type {Detox.DetoxConfig} */',\n    'module.exports = {',\n    `  ${props.sectionName}: {`,\n    '// highlight-start',\n    `    ${props.propertyName}Key: {`,\n    `      /* … ${props.propertyName} config … */`,\n    '    }',\n    '// highlight-end',\n    '  },',\n    '  /* … */',\n    '  configurations: {',\n    `    'example.aliased': {`,\n    '      /* … */',\n    '// highlight-next-line',\n    `      ${props.propertyName}: '${props.propertyName}Key', // (1)`,\n    '    },',\n    `    'example.inlined': {`,\n    '      /* … */',\n    '// highlight-start',\n    `      ${props.propertyName}: { // (2)`,\n    `        /* … ${props.propertyName} config … */`,\n    '      },',\n    '// highlight-end',\n    '    },',\n    '  },',\n    '};',\n  ].join('\\n')}\n</CodeBlock>\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/partials/_location.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<p>\n  You can define the <code>{props.sectionName}</code> config section in two\n  ways: <i>globally</i> and <i>locally</i> (per a configuration):\n</p>\n\n<CodeBlock title=\".detoxrc.js\" language=\"javascript\">\n  {[\n    '/** @type {Detox.DetoxConfig} */',\n    'module.exports = {',\n    '// highlight-start',\n    `  ${props.sectionName}: {`,\n    '    /* global section */',\n    '  },',\n    '// highlight-end',\n    '  devices: { /* … */ },',\n    '  apps: { /* … */ },',\n    '  configurations: {',\n    `    'ios.sim.debug': {`,\n    `      device: 'iphone',`,\n    `      app: 'ios.debug',`,\n    '// highlight-start',\n    `      ${props.sectionName}: {`,\n    '        /* local (per-configuration) section */',\n    '      },',\n    '// highlight-end',\n    '    },',\n    '  },',\n    '};',\n  ].join('\\n')}\n</CodeBlock>\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/session.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Session\n\n:::info Note\n\nIt is not recommended to customize this section unless [you are debugging native code](../introduction/debugging.mdx)\nor contributing to the native iOS/Android code of Detox.\n\n:::\n\nThe `session` section tells Detox how to set up its web socket server and client. They are used to forward the JSON-serialized expectations and element interactions to the native implementation of Detox side-loaded with the app.\n\n## Location\n\n<Location sectionName=\"session\" />\n\n## Properties\n\nThere is one important thing to note when you’ll be defining a session config, e.g.:\n\n### `session.server` \\[string]\n\nDefault: `ws://localhost:{randomPort}`.\n\n```json\n{\n  \"session\": {\n// highlight-next-line\n    \"server\": \"ws://localhost:8099\"\n  }\n}\n```\n\nWhen you define a URL for `server`, it automatically sets [`session.autoStart`](#sessionautostart-boolean) to _false_ (mainly due to backward compatibility reasons), so make sure to override it back if you didn’t intend that.\n\n### `session.sessionId` \\[string]\n\nDefault: a random UUID, e.g. `7731871e-2f07-46bb-acbc-cb0eb6a0ace7`.\n\nSince the Detox server is a single entity, but there can be multiple test workers running multiple devices and apps,\nit needs to understand which connection belongs to which app.\n\nDetox forwards `sessionId` to the app as a launch argument, so the app immediately knows where to connect to.\n\n:::caution\n\nDefining an explicit `sessionId` means you cannot use **multiple workers**,\nsince the specified session will become busy for any test worker next to the first one to occupy it.\n\n```json\n{\n  \"session\": {\n    \"server\": \"ws://localhost:8099\",\n// highlight-next-line\n    \"sessionId\": \"YourProjectSessionId\"\n  }\n}\n```\n\n:::\n\n### `session.autoStart` \\[boolean]\n\nDefault: `true` for undefined `session.server`, and `false` for defined.\n\nControls whether Detox web socket server will be starting automatically.\nIf `false`, it is assumed that you will be running it independently via [`detox run-server`](../cli/run-server.md) CLI command.\n\n```diff\n   \"session\": {\n+    \"autoStart\": true,\n     \"server\": \"ws://localhost:8099\",\n     \"sessionId\": \"YourProjectSessionId\"\n```\n\n### `session.debugSynchronization` \\[number]\n\n**Enabled by default**, with the value of `10_000`ms.\n\nTells Detox how long (in milliseconds) to wait for the app to become idle until it starts querying it for more details in order to print out automated-synchronization debugging logs.\n\n```json\n{\n  \"session\": {\n    \"debugSynchronization\": 5000\n  }\n}\n```\n\nDetox will be printing the list of busy idling resources every time an action takes more than the specified period, e.g.:\n\n```plain text\n09:41:00.941 detox[1337] i The app is busy with the following tasks:\n• There are 10 work items pending on the dispatch queue: \"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)\".\n• UI elements are busy:\n  - Layers pending animations: 96.\n  - Layers needs layout: 173.\n  - View needs layout: 74.\n  - View needs display: 98.\n  - Layers needs display: 90.\n• Run loop \"Main Run Loop\" is awake.\n```\n\n<sup>(These are logs generated by Detox for iOS; Detox for Android generates different yet equivalent ones)</sup>\n\nTo disable this behavior (i.e. querying the app periodically), set the value to `0`.\n\nSeeing logs like these usually indicates certain issues in your application, as explained in the [Troubleshooting Guide](../troubleshooting/synchronization.md).\n\nFor extended, more detailed information on iOS, refer to the `DetoxSync` project's [Status Documentation](https://github.com/wix-incubator/DetoxSync/blob/master/StatusDocumentation.md).\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/config/testRunner.mdx",
    "content": "import Location from './partials/_location.mdx';\n\n# Test runner\n\nWhile Detox was created to test mobile applications, effectively it is **not a test runner** – instead, it **runs on top** of a test runner. There are many third-party solutions for running tests, so we're happy to not reinvent the wheel and to devote our time to the mobile domain itself.\n\nSince we focus on React Native and yet require some test runner under the hood, the most logical choice was to provide an official integration with Jest, which is the default test runner for such projects. This is why all our guides presume you have Jest under the hood, and the structure generated via  `detox init` is no exception.\n\nThe integration with a test runner is a matter of the configuration, not the implementation – Detox source code has no hard-coded logic for Jest save for a few minor places[^1]. Furthermore, we're looking forward to new third-party integrations with popular test runners as the [Internals API](../api/internals.mdx) keeps improving.\n\n[^1]: Detox has a few hard-coded default values for Jest: [`testRunner.args.$0`] and [`testRunner.inspectBrk`] hook. Also `detox test` CLI is aware of Jest boolean arguments (e.g. `-i, --runInBand`, `--bail`, etc.), and it can auto-fix ambiguous commands like `detox test --runInBand e2e/starter.test.js --bail`.\nWe're looking forward to make the code even more agnostic, but currently these caveats are worth mentioning for the developers of third-party test runner integrations.\n\n## Location\n\n<Location sectionName=\"testRunner\" />\n\n## Properties\n\n### `testRunner.args` \\[object]\n\nThis section is responsible for building the test runner command that is going to be spawned when you run:\n\n```bash\ndetox test\n# $0 --key1 value1 … ---keyN valueN ...positionalArguments\n```\n\nFor example, this configuration of a test runner:\n\n```json\n{\n  \"testRunner\": {\n    \"args\": {\n      \"$0\": \"nyc jest\",\n      \"bail\": true,\n      \"config\": \"e2e/jest.config.js\",\n      \"_\": [\"e2e/sanity-tests\"]\n    }\n  }\n}\n```\n\nwould eventually spawn:\n\n```bash\nnyc jest --bail --config e2e/jest.config.js e2e/sanity-tests\n```\n\nNow, when you have an idea of what it does, let's overview the properties one by one.\n\n### `testRunner.args.$0` \\[string]\n\nDefault: `jest`.\n\nDefines the beginning of the test runner command, usually just the name of the executable. The path to the executable is resolved according to your `PATH` environment variable.\n\nAlthough not recommended, you can specify composite commands like `node -r ./preload.js node_modules/.bin/my-runner`.\n\n### `testRunner.args[…]` \\[string | number | boolean]\n\nYou can define arbitrary arguments in the key-value format, e.g.:\n\n```json\n{\n  \"args\": {\n    \"$0\": \"jest\",\n// highlight-start\n    \"color\": false,\n    \"bail\": true,\n    \"testTimeout\": 60000,\n    \"config\": \"e2e/jest.ci.config.js\"\n// highlight-end\n  }\n}\n```\n\nFor example, the config above would generate a command like this:\n\n```bash\njest --no-color --bail --testTimeout 60000 --config e2e/jest.ci.config.js\n```\n\nAs you can see, `false` boolean values produce keys prefixed with `--no-`.\n\n### `testRunner.args._` \\[string\\[]]\n\nDefault: `[]`.\n\nThis property defines an array of **default** positional arguments to pass to the test runner. Consider an example:\n\n```json\n{\n  \"args\": {\n    \"$0\": \"jest\",\n// highlight-next-line\n    \"_\": [\"e2e/sanity-tests\"]\n  }\n}\n```\n\nIf you run tests without extra positional arguments, you’ll get `_` contents appended:\n\n```bash\ndetox test -c ios.sim.debug\n# jest … e2e/sanity-tests\n```\n\nIf you run tests with custom positional arguments, the `_` contents get replaced:\n\n```bash\ndetox test e2e/regression-tests\n# jest … e2e/regression-tests\n```\n\nIf you use the retry mechanism of `detox test`, be prepared that the failed test file paths will override `_` in all the subsequent re-runs.\n\n### `testRunner.retries` \\[number]\n\nDefault: `0`.\n\nTells `detox test` to keep re-running the test runner with failed test files until they pass, or the number of repeated attempts exceeds the specified value:\n\n```bash\ndetox test\nDETOX_CONFIGURATION=\"…\" jest --config e2e/jest.config.js e2e/sanity-tests\n# …\n# There were failing tests in the following files:\n#   1. /path/to/your/test.js\n#\n# Detox CLI is going to restart the test runner with those files...\nDETOX_CONFIGURATION=\"…\" jest --config e2e/jest.config.js /path/to/your/test.js\n# …\n```\n\nSee also [`-R, --retries`](../cli/test.md#options) in Detox CLI.\n\n### `testRunner.bail` \\[boolean]\n\nDefault: `false`.\n\nWhen true, tells `detox test` to cancel next retrying if it gets at least one report about a [permanent test suite failure](../api/internals.mdx#reporting-test-results).\nHas no effect, if [`testRunner.retries`] is undefined or set to zero.\n\n### `testRunner.noRetryArgs` \\[string[]]\n\nDefault: `['shard']`.\n\nSpecifies an array of command-line argument names that should be removed when retrying failed tests. This is useful for arguments that don't make sense or might cause issues during retry runs.\n\nFor example, with the default configuration, when tests fail and are retried, the `shard` argument will be removed from the test runner command:\n\n```bash\n# First run with sharding\njest --shard=1/3 e2e/tests\n# Retry run without sharding, only running failed tests\njest path/to/failed/test.js\n```\n\nYou can customize this array to include any arguments that should be excluded during retries:\n\n```json\n{\n  \"testRunner\": {\n    \"noRetryArgs\": [\"shard\", \"maxWorkers\", \"customArg\"]\n  }\n}\n```\n\n### `testRunner.detached` \\[boolean]\n\nDefault: `false`.\n\nWhen true, tells `detox test` to spawn the test runner in a detached mode.\n\nThis is useful in CI environments, where you want to intercept SIGINT and SIGTERM signals to gracefully shut down the test runner and the device.\n\nInstead of passing the kill signal to the child process (the test runner), Detox will send an emergency shutdown request to all the workers, and then it will wait for them to finish.\n\n### `testRunner.forwardEnv` \\[boolean]\n\nDefault: `false`.\n\nWhen enabled, tells `detox test` to pass command-line arguments as environment variables to the test runner, e.g.:\n\n```bash\ndetox test -c ios.sim.debug --record-logs all\nDETOX_CONFIGURATION=ios.sim.debug DETOX_RECORD_LOGS=all jest …\n```\n\nNevertheless, even if it is disabled, Detox will keep printing hints how to call your test runner without Detox CLI, so that you can copy and paste the command into your IDE when you want to debug something.\n\n### `testRunner.inspectBrk` \\[function]\n\n:::caution\n\nThis property is intended primarily for developing integrations with third-party test runners.\n\n:::\n\nDefault: _a Jest-specific callback that sets `$0`, `--runInBand` and cleans `-w, --maxWorkers`_.\n\nThe provided function is called when [`detox test`](../cli/test.md) is called with `--inspect-brk`.\nYour implementation should prepare [`testRunner.args`] for [debugging with Node.js inspector](../introduction/debugging.mdx), e.g. for Jest that would be:\n\n```js title=\".detoxrc.js\"\n/* @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    /** @param {Detox.DetoxTestRunnerConfig} config */\n    inspectBrk: (config) => {\n      config.args.$0 = os.platform() === 'win32'\n        ? `node --inspect-brk ./node_modules/jest/bin/jest.js`\n        : `node --inspect-brk ./node_modules/.bin/jest`;\n      config.args.runInBand = true;\n      delete config.args.w;\n      delete config.args.workers;\n    },\n  },\n};\n```\n\n### `testRunner.jest` \\[object]\n\nThis is an add-on section used by our Jest integration code (but not Detox core itself).\nIn other words, if you’re implementing (or using) a custom integration with some other test runner, feel free to define a section for yourself (e.g. `testRunner.mocha`)\n\n#### `testRunner.jest.setupTimeout` \\[number]\n\nDefault: `120000` (2 minutes).\n\nAs a part of the [environment setup](https://jestjs.io/docs/configuration/#testenvironment-string)), Detox boots the device and installs the apps.\nIf that takes longer than the specified value, the entire test suite will be considered as failed, e.g.:\n\n```plain text\n FAIL  e2e/starter.test.js\n  ● Test suite failed to run\n\n    Exceeded timeout of 120000ms while setting up Detox environment\n```\n\n#### `testRunner.jest.teardownTimeout` \\[number]\n\nDefault: `30000` (30 seconds).\n\nIf the [environment teardown](https://jestjs.io/docs/configuration/#testenvironment-string)) takes longer than the specified value, Detox will throw a timeout error.\n\n#### `testRunner.jest.reportSpecs` \\[boolean | undefined]\n\nDefault: `undefined` (auto).\n\nBy default, Jest prints the test names and their status (_passed_ or _failed_) at the very end of the test session. This might be fine for sub-second unit tests, but it is uncomfortable to wait a couple of minutes until you actually see anything.\n\nWhen enabled, it makes Detox to print messages like these each time the new test starts and ends:\n\n```plain text\n18:03:36.258 detox[40125] i Sanity: should have welcome screen\n18:03:37.495 detox[40125] i Sanity: should have welcome screen [OK]\n18:03:37.496 detox[40125] i Sanity: should show hello screen after tap\n18:03:38.928 detox[40125] i Sanity: should show hello screen after tap [OK]\n18:03:38.929 detox[40125] i Sanity: should show world screen after tap\n18:03:40.351 detox[40125] i Sanity: should show world screen after tap [OK]\n```\n\nBy default, it is enabled automatically in test sessions with a single worker. And vice versa, if multiple tests are executed concurrently, Detox turns it off to avoid confusion in the log. Use boolean values, `true` or `false`, to turn off the automatic choice.\n\n#### `testRunner.jest.reportWorkerAssign` \\[boolean]\n\nDefault: `true`.\n\nLike already mentioned, in the init phase, Detox boots the device and installs the apps. This flag tells Detox to print messages like these every time the device gets assigned to a specific suite:\n\n```plain text\n18:03:29.869 detox[40125] i starter.test.js is assigned to 4EC84833-C7EA-4CA3-A6E9-5C30A29EA596 (iPhone 12 Pro Max)\n```\n\n#### `testRunner.jest.retryAfterCircusRetries` \\[boolean]\n\nDefault: `false`.\n\nJest provides an API to re-run individual failed tests: [`jest.retryTimes(count)`](https://jestjs.io/docs/29.0/jest-object#jestretrytimesnumretries-options).\nWhen Detox detects the use of this API, it suppresses its own CLI retry mechanism controlled via `detox test … --retries <N>` or `testRunner.retries`. The motivation is simple – activating the both mechanisms is apt to increase your test duration dramatically, if your tests are flaky.\n\nIf you wish nevertheless to use both the mechanisms simultaneously, set it to `true`.\n\n## Jest config\n\nJest config generated by `detox init` is helpful for understanding how Detox integrates with Jest:\n\n```js title=\"e2e/jest.config.js\"\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n  rootDir: '..',\n  testMatch: ['<rootDir>/e2e/**/*.test.js'],\n  testTimeout: 120000,\n  maxWorkers: 1,\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  reporters: ['detox/runners/jest/reporter'],\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  verbose: true,\n};\n```\n\nAll the listed properties vary from mandatory to strongly recommended, and below we'll be explaining why (and, more importantly, how to customize them correctly). If you need to add extra properties, please consult the [Configuring Jest](https://jestjs.io/docs/configuration) article on its official website.\n\n1. `rootDir` and `testMatch` enforce the convention that your tests have `.test.js` extension and reside somewhere in `e2e` folder together with the Jest config:\n\n   ```plain text\n   ├── …\n   ├── e2e\n   //highlight-start\n   │   ├── feature1.test.js\n   │   ├── feature2\n   │   │   ├── subfeature1.test.js\n   │   │   └── subfeature2.test.js\n   //highlight-end\n   │   ├── …\n   │   └── jest.config.js\n   ├── …\n   ├── .detoxrc.js\n   └── package.json\n   ```\n\n1. `testTimeout: 120000` overrides the default value (5 seconds), which is usually too short to complete a single end-to-end test. Two minutes should be safe enough, but you’re welcome to increase or decrease depending on your needs.\n\n1. `maxWorkers: 1` prevents potential over-allocation of mobile devices according to the default Jest strategy. By default, Jest picks `cpusCount — 1` which is too much (e.g. 6-core laptop would spawn 11 devices). Note that casually you can override it via forwarding command-line argument [`--maxWorkers <N>`](https://jestjs.io/docs/cli#--maxworkersnumstring):\n\n   ```bash\n   detox test … --maxWorkers 2\n   # … jest … --maxWorkers 2\n   ```\n\n   Change it only if you want to change **the default value**. For instance, you could use different number of workers depending on the environment, e.g.:\n\n   ```js\n   /** @type {import('@jest/types').Config.InitialOptions} */\n   module.exports = {\n     // …\n   // highlight-next-line\n     maxWorkers: process.env.CI ? 2 : 1,\n   };\n   ```\n\n1. `globalSetup` file is essential as it integrates with Detox Internals API. If you need to set up something in addition, you should wrap it like this:\n\n   ```js\n   module.exports = async () => {\n      await require('detox/runners/jest').globalSetup();\n      await yourGlobalSetupFunction();\n   };\n   ```\n\n1. `globalTeardown` file is essential as it integrates with Detox Internals API. If you need to tear down something in addition, you should wrap it like this:\n\n   ```js\n   module.exports = async () => {\n     try {\n       await yourGlobalTeardownFunction();\n     } finally {\n       await require('detox/runners/jest').globalTeardown();\n     }\n   };\n   ```\n\n1. `reporters` array should always include a reporter from Detox. We reserve right to add anytime some integration code there. Although currently it is rather empty, not having it puts you under risk every time you upgrade Detox versions.\n\n1. `testEnvironment` is the most important part of the integration. If you need to add something on top of it, please inherit like shown below:\n\n   ```js title=\"e2e/testEnvironment.js\"\n   const { DetoxCircusEnvironment } = require('detox/runners/jest');\n\n   class CustomDetoxEnvironment extends DetoxCircusEnvironment {\n     constructor(config, context) {\n       super(config, context);\n       // custom code\n     }\n\n     async setup(config, context) {\n       await super.setup(config, context);\n       // custom code\n     }\n\n     async handleTestEvent(event, state) {\n       await super.handleTestEvent(event, state);\n       // custom code\n     }\n\n     async teardown(config, context) {\n       try {\n         // custom code\n       } finally {\n         await super.teardown(config, context);\n       }\n     }\n   }\n\n   module.exports = CustomDetoxEnvironment;\n   ```\n\n1. `verbose: true` [disables batching](https://github.com/facebook/jest/issues/8208) of Jest logs and ensures you see the logs in real time.\n\n## Globals\n\nUnless `behavior.init.exposeGlobals` is set to `false`, Detox exposes its primitives (`expect`, `device`, ...) globally, and it will override Jest’s global `expect` object.\nIf you need to use it nevertheless, import it explicitly:\n\n```js\nimport jestExpect from 'expect';\n```\n\n## Mocking\n\nDon’t use `jest.mock()` or any other similar mocking mechanism. Follow our [Mocking guide](../guide/mocking.md) instead.\n\n## Parallel Test Execution\n\nDetox relies on test runners to execute tests in parallel.\n\nIf you’re using Jest under the hood, the easiest way is to specify `-w, --maxWorkers`, e.g.:\n\n```bash\ndetox test … --maxWorkers 2\n```\n\nIn the other cases, consult your test runner documentation.\n\n## Forwarding CLI arguments\n\nIf Detox does not recognize CLI arguments you pass, it forwards them as-is to the underlying test runner, e.g.:\n\n```bash\ndetox test -c ios.sim.debug --key1 value1 --key2\n# DETOX_CONFIGURATION=ios.sim.debug jest --key1 value1 --key2\n#\n# ● Unrecognized CLI Parameters:\n#\n#   Following options were not recognized:\n#   [\"key1\", \"key2\"]\n#\n#   CLI Options Documentation:\n#   https://jestjs.io/docs/cli\n```\n\nTherefore, if test runner rejects such arguments, it is your responsibility to fix that.\n\nSince there might be argument clashes between Detox and a test runner, you can use `--` (double dash) to forward the arguments as-is, e.g.:\n\n```bash\ndetox test -c ios.sim.debug -- --help\n# DETOX_CONFIGURATION=ios.sim.debug jest --help\n# Usage: jest [--config=<pathToConfigFile>] [TestPathPattern]\n#\n# Options:\n# …\n```\n\n[`testRunner.args`]: #testrunnerargs-object\n[`testRunner.args.$0`]: #testrunnerargs0-string\n[`testRunner.inspectBrk`]: #testrunnerinspectbrk-function\n[`testRunner.retries`]: #testrunnerretries-number\n[`testRunner.noRetryArgs`]: #testrunnernoretryargs-string\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/building-and-testing.md",
    "content": "# Building and Testing\n\nOur JavaScript code is thoroughly verified with comprehensive unit tests, complemented by integration tests.\nAdditionally, our native code undergoes rigorous testing through both unit and integration tests.\nTo ensure complete functionality, we conduct end-to-end tests on a fully-featured React Native application, designed to encompass all our public APIs (refer to our [test app] for details).\n\n:::note Important\n\nBefore submitting a pull request, please ensure at a minimum that your code adheres to our linting standards and that all unit tests run successfully without any errors.\n\n:::\n\nThe following sections describe how to build and test our code, with a general instruction.\nHowever, we recommend you to refer to our `package.json` files for a complete list of available scripts:\n\n- Detox Framework: [`detox/package.json`]\n- Detox Test App: [`detox/test/package.json`]\n\n## Unit Tests (JavaScript)\n\nWe use [Jest] for running our unit tests.\n\nUnder the `detox/` directory, run the following command to run the unit tests with coverage:\n\n```bash\ncd detox\nnpm run unit\n```\n\nThe unit tests reside alongside the JavaScript code. Typically, they can also be easily run directly from within an IDE such as [WebStorm](https://www.jetbrains.com/webstorm/) or [vscode](https://code.visualstudio.com/), even in debug (i.e step-by-step execution) mode.\n\n## Unit Tests - Android Native\n\nWe also have unit tests for our native code (Android only). They reside alongside Detox's native Android code, under a dedicated subdirectory called `testFull`. You can run them using the following commands:\n\n```bash\ncd detox\nnpm run unit:android-release\n```\n\nThe native unit tests can also be run in [Android Studio](https://developer.android.com/studio) (i.e. the IDE for Android apps development). Most tests can be run seamlessly using Android Studio's build-in support for unit-tests, but some require a plugin called [Spek](https://plugins.jetbrains.com/plugin/10915-spek-framework), which can be installed from within Android Studio itself - under the Plugins marketplace.\n\n## iOS: Rebuilding the Native Code\n\n### Detox Framework\n\nAfter changing the native code of Detox iOS, you need to rebuild the Detox framework. This is done when running:\n\n```bash\ndetox build-framework-cache\n```\n\nNote that it is only required when you change the native code of Detox, or one of its dependencies (e.g. [DetoxSync]).\nIf you are only changing the JavaScript code, you don't need to rebuild the framework.\n\n## Building the Detox Test App\n\nThe Detox self-test app is a full-feature React Native app for testing Detox end-to-end.\n\nBefore running the tests, you must first build the Detox test app. To do so, under `detox/test`, use the `build` command of the Detox CLI.\nList of available configurations can be found under [`detox/test/e2e/detox.config.js`].\n\nFor example, to build the Detox test app for iOS in release mode, run:\n\n```bash\ncd detox/test\ndetox build --configuration ios.sim.release\n```\n\n### End-to-End Tests\n\nTo run the end-to-end tests (after building the app), use the `test` command of the Detox CLI.\n\nFor example, to run the end-to-end tests for iOS in release mode, run:\n\n```bash\ncd detox/test\ndetox test --configuration ios.sim.release\n```\n\n:::note\n\nMind that on iOS, Detox expects a specific simulator device with a specific name and os version to be available in your Xcode environment.\nThe required details are specified in the [detox.config.js](https://github.com/wix/Detox/blob/master/detox/test/e2e/detox.config.js) under `ios.simulator` device configuration (see `type` and `os`). Be sure to [install such a device](https://developer.apple.com/documentation/safari-developer-tools/adding-additional-simulators), beforehand.\n\n:::\n\nTo run in Android release mode, run:\n\n```bash\ncd detox/test\ndetox test --configuration android.emu.release\n```\n\n:::note\n\nMind that on Android, Detox expects a specific AVD with a specific name to be available on your computer.\nThe required details are specified in the [detox.config.js](https://github.com/wix/Detox/blob/master/detox/test/e2e/detox.config.js) under `android.emulator` device configuration (see `avdName`).\nBe sure to [install such an AVD](https://developer.android.com/studio/run/managing-avds#createavd), beforehand.\n\n:::\n\n## Integration Tests\n\nBesides unit tests and end-to-end tests, we have some middle ground integration tests, which typically run Detox in a custom headless-like mode (i.e. stubs replace devices). Those tests typically execute Detox from a command line in that mode, and then do some post-processing of the results. We use [Jest] for running our integration tests.\n\nThe integration reside under a dedicated directory alongside Detox's the self-test app's code.\n\nRun the following command to run the integration tests:\n\n```bash\ncd detox/test\nnpm run integration\n```\n\n### Linting\n\nWe use [ESLint] for linting our JavaScript code.\n\nYou can run the linter locally using the following command (under `detox/test`):\n\n```bash\nnpm run lint\n```\n\nWe also test our types using the following command:\n\n```bash\nnpm run test:types\n```\n\n## Running the CI Scripts Locally\n\nOn our CI, we test our changes on both iOS and Android, and we lint-check our code.\nYou can run the same scripts we run on our CI locally, to ensure your changes are passing the tests (under the project's root directory):\n\n```bash\nnpm run ci:ios\nnpm run ci:android\n```\n\nRefer to the scripts `scripts/ci.ios.sh` and `scripts/ci.android.sh` to see how we run the tests on our CI.\n\n[test app]: https://github.com/wix/Detox/tree/master/detox/test\n[DetoxSync]: https://github.com/wix/DetoxSync\n[`detox/test/e2e/detox.config.js`]: https://github.com/wix/Detox/blob/6e87dc13826341dba21ed0a732e5b57efa08e7b5/detox/test/e2e/detox.config.js#L137\n[ESLint]: https://eslint.org/\n[Jest]: https://jestjs.io/\n[`detox/package.json`]: https://github.com/wix/Detox/blob/master/detox/package.json\n[`detox/test/package.json`]: https://github.com/wix/Detox/blob/master/detox/test/package.json\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/example-projects.md",
    "content": "# Example Projects\n\nExplore various example projects hosted in this monorepo to understand real-world usage and testing with Detox.\n\n- `examples/demo-react-native-jest`: Demonstrates Detox usage in a React Native app project.\n- `examples/demo-native-ios`: Illustrates Detox usage in a native (non-React Native) iOS app.\n- `examples/demo-native-android` <span style={{color: 'red'}}>(broken)</span>: Illustrates Detox usage in a native (non-React Native) Android app.\n- `examples/demo-pure-native-android`: Illustrates the subsidiary [Detox-Native](https://github.com/wix/Detox/blob/master/detox/detox-native/README.md) project.\n\nTo run end-to-end tests associated with these projects, refer to the [project-specific](https://github.com/wix/Detox/tree/master/examples) READMEs.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/overview.md",
    "content": "---\nsidebar_label: Overview\n---\n\n# Code Changes Overview\n\nWelcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions.\n\nOur collaborative workflow is simple:\n\n1. **Identify an Issue:** If not exists already, create an issue for new features or bug reports, outlining your proposal or the identified problem.\n2. **Propose a Solution:** Open a pull request with a proposed solution to the issue. On complex issues, it's recommended to discuss your approach with the community and maintainers before submitting a PR.\n3. **Engage in Review:** A collaborator will review your pull request. Reviews from other contributors are also encouraged.\n4. **Merge and Release:** After the review, a collaborator will merge your contribution, typically releasing it in the next version of the project.\n\nWe use [GitHub] for managing pull requests, conducting code reviews, and tracking issues.\n\nThe code review process is central to our collaboration. Every contribution must go through a review before merging to maintain the quality of our codebase. As a contributor, being willing to discuss your work, respond to feedback, and work with the community is key to improving the project and creating a positive environment for all contributors.\n\n## Repository Structure\n\nOur GitHub repository is a monorepo, which means it contains multiple Detox-related projects and packages.\n\nThe main package is the Detox framework, which is the core of the project.\nIt contains the native code for iOS and Android, as well as the JavaScript code.\nThe other projects are the Detox CLI, the Detox test app, example apps, and the Detox documentation website.\n\nHere's a high-level overview of the repository structure:\n\n- 📁 **detox-cli** - The CLI for Detox (e.g., `detox init`, `detox test`, read more about our [CLI docs])\n- 📁 **detox** - The Detox framework\n  - 📁 **android** - The Android native code, alongside native unit tests\n  - 📁 **ios** - The iOS native code, including its native submodules (e.g., DetoxSync)\n  - 📁 **test** - The Detox self-test app: A full-feature React Native app for end-to-end testing Detox itself\n    - 📁 **src** - The app's JavaScript code\n    - 📁 **e2e** - The Detox self-tests\n    - 📁 **integration** - Detox integration self-tests\n  - 📁 **local-cli** - Local CLI commands for Detox development (e.g., `detox rebuild-framework-cache`, which rebuilds the iOS framework)\n  - 📁 **runners** - The Detox runners, which are used to run the tests\n  - 📁 **scripts** - Scripts for building the framework for publishing\n  - 📁 **src** - The JavaScript source code of Detox. The include bundled JavaScript unit tests\n- 📁 **website** - The documentation website of Detox (read more about our [documentation site docs])\n- 📁 **docs** - The documentation of Detox, written in Markdown and published on the website\n- 📁 **examples** - Example apps for Detox (for more information, check the [list of example projects])\n- 📁 **scripts** - Scripts for building and testing Detox\n\n[GitHub]: https://github.com/wix/Detox\n[documentation site docs]: ../documentation.md\n[list of example projects]: ./example-projects.md\n[CLI docs]: ../../cli/overview.md\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/reviewing-pull-requests.md",
    "content": "# Review a Pull Request\n\nReviewing a PR is an important part of the contribution process. It ensures the quality of the codebase and provides an opportunity for the community to collaborate and learn from each other.\n\n:::note\n\nReviewers should refer to the [Submitting Pull Requests] page to understand the guidelines the contributor followed when creating the PR. This will provide context and ensure a thorough review process.\n\n:::\n\n## Understand the Changes\n\n- Ensure alignment with the project’s coding standards and overall architecture.\n- Read the provided description and any linked issues for context.\n\n## Provide Constructive Feedback\n\nCommunity members can provide valuable feedback on PRs, especially if they have experience with the feature or area of the codebase.\n\n- Be respectful and courteous.\n- Offer code snippet suggestions if something could be done better.\n- Request changes if necessary and provide clear, constructive feedback.\n\n## Review the Code\n\nExperienced developers are encouraged to review PRs and provide feedback. This is a great way to learn more about the project and collaborate with the community.\n\nYou can review the code by following these requirements:\n\n- Alignment with coding standards and architectural guidelines.\n- Adequate test coverage (unit, integration, and e2e).\n- Ensure the documentation reflects the changes in the PR, if necessary. Refer to the [Documentation Changes] page for guidelines.\n- Meaningful and semantically correct commit messages.\n\n## Merging Pull Requests\n\nEvery PR requires approval from a maintainer before it can be merged.\n\nHowever, we encourage the community to review and provide feedback on PRs. Helping with the review process not only improves the quality of the code changes, but also helps the maintainers by reducing the workload.\n\n[Documentation Changes]: ../documentation.md\n[Submitting Pull Requests]: ./submitting-pull-requests.md\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/setting-up-the-dev-environment.md",
    "content": "# Setting up the Development Environment\n\nThis document guides you through setting up your development environment to start contributing to our codebase.\n\n:::important Prerequisites\n\nPlease complete our [Introductory environment setup](introduction/environment-setup.md) guide before proceeding. This ensures you have the necessary tools and dependencies installed in order to _run_ Detox tests, which is a fundamental step before being able to contribute to the project itself.\n\n:::\n\n## Node.js\n\nWe recommend using [`nvm`](https://github.com/nvm-sh/nvm) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) to manage your Node.js versions. However, you can find our required Node.js version in the [`.nvmrc`](https://github.com/wix/Detox/blob/master/.nvmrc) file and install it using your preferred method or from the [official download page](https://nodejs.org/en/download/).\n\nCurrently, we require `lts/iron` (Node.js 20.x) for our development environment.\n\n:::tip\n\nThe exhaustive list of LTS codenames (e.g. `lts/iron`) can be found at [CODENAMES.md](https://github.com/nodejs/Release/blob/main/CODENAMES.md) in the Node.js repository.\n\n:::\n\n## Setting Up The Monorepo\n\nOur repository is a monorepo managed with Yarn workspaces. [Read more about our repository structure](../code/overview.md#repository-structure).\n\nTo set up the monorepo locally, follow these steps:\n\n### 1. Enable Corepack\n\nCorepack is Node.js's built-in package manager manager. Enable it to use the correct Yarn version:\n\n```bash\ncorepack enable\n```\n\n### 2. Clone the Repository\n\n```bash\ngit clone git@github.com:wix/Detox.git\ncd Detox\ngit submodule update --init --recursive\n```\n\n### 3. Install Dependencies\n\n```bash\nyarn install\n```\n\n:::note For Wix Internal Contributors\n\nSet the internal registry before installing:\n\n```bash\nexport YARN_NPM_REGISTRY_SERVER=\"<company's private npm registry>\"\nyarn install\n```\n\nYou can add this export to your shell profile (`~/.zshrc` or `~/.bashrc`) to make it permanent.\n\n:::\n\n## Installing Common Dependencies\n\n### React-Native CLI\n\n[react-native-cli] is a command line interface for React Native.\n\n```bash\nnpm install react-native-cli --global\n```\n\n### Watchman\n\n[Watchman] is a tool by Facebook for watching changes in the filesystem.\n\n```bash\nbrew install watchman\n```\n\n### xcpretty\n\n[xcpretty] is a fast and flexible formatter for xcodebuild.\n\n```bash\ngem install xcpretty\n```\n\n## Switching React Native Versions\n\nTo test against different React Native versions:\n\n```bash\nREACT_NATIVE_VERSION=0.77.0 ./scripts/change_all_react_native_versions.sh\n```\n\nThis updates the relevant `package.json` files and regenerates the lock file.\n\n## Common Commands\n\n| Command | Description |\n|---------|-------------|\n| `yarn install` | Install all dependencies |\n| `yarn workspaces foreach -A run build` | Build all packages |\n| `yarn workspace detox test` | Run detox tests |\n| `yarn workspace detox lint` | Run linting |\n\n[react-native-cli]: https://www.npmjs.com/package/react-native-cli\n[Watchman]: https://facebook.github.io/watchman/\n[xcpretty]: https://github.com/xcpretty/xcpretty\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code/submitting-pull-requests.md",
    "content": "# Submitting Pull Requests\n\n:::note\n\nBefore creating a PR, it's recommended to consult with the Detox collaborators. Request a design review or assistance with planning the tests to ensure alignment with project goals.\n\nContact us on our [Discord Server] or open an [issue on GitHub].\n\n:::\n\n## Fork the Repository\n\n- Fork the repository to your own GitHub account.\n- Create a new branch from the `master` branch for your work.\n\n## Test Your Changes\n\nBeing a testing framework, Detox is a highly self-tested project. Be sure to add/fix test coverage over your work, by running the various test flavors associated with your changes. You can review them, [here](./building-and-testing).\n\n## Modify Documentation\n\nIf your changes affect the public API, update the documentation accordingly to reflect your changes.\nRefer to the [Documentation Changes] page for guidelines.\n\n## Commit Message Guidelines\n\nWrite descriptive, meaningful commit messages that follow the **Conventional Commits** format, specifying the type of change, the scope, and a concise description. For example:\n\n```plaintext\nfix(ios): resolve crash on scrolling in iOS 17.0\nfeat(android): add new API for setting the device locale\ntest: update unit tests for new utility function\n```\n\nMore details on good commit messages can be found [here](https://www.conventionalcommits.org/en/v1.0.0/).\n\n## Open the Pull Request\n\n- Fill in the provided PR template fields on GitHub.\n- Provide a clear description of your changes and any necessary context.\n\n[Documentation Changes]: ../documentation.md\n[Discord Server]: https://discord.gg/CkD5QKheF5\n[issue on GitHub]: https://github.com/wix/Detox/issues/new/choose\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/code-of-conduct.md",
    "content": "# Code of Conduct\n\n:::note Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant],\nversion 2.1, available at\n[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].\n\nCommunity Impact Guidelines were inspired by\n[Mozilla's code of conduct enforcement ladder][Mozilla CoC].\n\nFor answers to common questions about this code of conduct, see the FAQ at\n[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at\n[https://www.contributor-covenant.org/translations][translations].\n\n:::\n\nOur community is dedicated to providing a safe and inclusive environment for all contributors.\nTo ensure this, we have adopted the **[Contributor Covenant]** code of conduct.\nThis widely recognized and respected code of conduct sets clear guidelines for behavior, and it's easy for everyone to understand and follow.\n\nBy participating in the Detox community, you agree to abide by the terms of this code of conduct.\nWe take violations of this code of conduct seriously, and we will not tolerate any form of harassment or discrimination.\n\nIf you have any questions or concerns, please reach out to the project maintainers.\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our\ncommunity a harassment-free experience for everyone, regardless of age, body\nsize, visible or invisible disability, ethnicity, sex characteristics, gender\nidentity and expression, level of experience, education, socio-economic status,\nnationality, personal appearance, race, caste, color, religion, or sexual\nidentity and orientation.\n\nWe pledge to act and interact in ways that contribute to an open, welcoming,\ndiverse, inclusive, and healthy community.\n\n## Our Standards\n\nExamples of behavior that contributes to a positive environment for our\ncommunity include:\n\n- Demonstrating empathy and kindness toward other people\n- Being respectful of differing opinions, viewpoints, and experiences\n- Giving and gracefully accepting constructive feedback\n- Accepting responsibility and apologizing to those affected by our mistakes,\n  and learning from the experience\n- Focusing on what is best not just for us as individuals, but for the overall\n  community\n\nExamples of unacceptable behavior include:\n\n- The use of sexualized language or imagery, and sexual attention or advances of\n  any kind\n- Trolling, insulting or derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or email address,\n  without their explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Enforcement Responsibilities\n\nCommunity leaders are responsible for clarifying and enforcing our standards of\nacceptable behavior and will take appropriate and fair corrective action in\nresponse to any behavior that they deem inappropriate, threatening, offensive,\nor harmful.\n\nCommunity leaders have the right and responsibility to remove, edit, or reject\ncomments, commits, code, wiki edits, issues, and other contributions that are\nnot aligned to this Code of Conduct, and will communicate reasons for moderation\ndecisions when appropriate.\n\n## Scope\n\nThis Code of Conduct applies within all community spaces, and also applies when\nan individual is officially representing the community in public spaces.\nExamples of representing our community include using an official e-mail address,\nposting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported to the community leaders responsible for enforcement at [our Discord server].\nAll complaints will be reviewed and investigated promptly and fairly.\n\nAll community leaders are obligated to respect the privacy and security of the\nreporter of any incident.\n\n## Enforcement Guidelines\n\nCommunity leaders will follow these Community Impact Guidelines in determining\nthe consequences for any action they deem in violation of this Code of Conduct:\n\n### Correction\n\n**Community Impact**: Use of inappropriate language or other behavior deemed\nunprofessional or unwelcome in the community.\n\n**Consequence**: A private, written warning from community leaders, providing\nclarity around the nature of the violation and an explanation of why the\nbehavior was inappropriate. A public apology may be requested.\n\n### Warning\n\n**Community Impact**: A violation through a single incident or series of\nactions.\n\n**Consequence**: A warning with consequences for continued behavior. No\ninteraction with the people involved, including unsolicited interaction with\nthose enforcing the Code of Conduct, for a specified period of time. This\nincludes avoiding interactions in community spaces as well as external channels\nlike social media. Violating these terms may lead to a temporary or permanent\nban.\n\n### Temporary Ban\n\n**Community Impact**: A serious violation of community standards, including\nsustained inappropriate behavior.\n\n**Consequence**: A temporary ban from any sort of interaction or public\ncommunication with the community for a specified period of time. No public or\nprivate interaction with the people involved, including unsolicited interaction\nwith those enforcing the Code of Conduct, is allowed during this period.\nViolating these terms may lead to a permanent ban.\n\n### Permanent Ban\n\n**Community Impact**: Demonstrating a pattern of violation of community\nstandards, including sustained inappropriate behavior, harassment of an\nindividual, or aggression toward or disparagement of classes of individuals.\n\n**Consequence**: A permanent ban from any sort of public interaction within the\ncommunity.\n\n[Contributor Covenant]: https://www.contributor-covenant.org\n[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html\n[Mozilla CoC]: https://github.com/mozilla/diversity\n[FAQ]: https://www.contributor-covenant.org/faq\n[translations]: https://www.contributor-covenant.org/translations\n[our Discord server]: https://discord.gg/CkD5QKheF5\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/documentation.md",
    "content": "# Documentation Site\n\nContributions towards enhancing our documentation are highly valued in the Detox community.\nClear, concise, and comprehensive documentation enables users to understand and utilize the project more effectively.\n\nWe appreciate all contributions, from correcting typos to creating new documentation pages.\n\n## Getting Started\n\nOur [documentation website](https://wix.github.io/Detox) is developed using [Docusaurus](https://docusaurus.io/). To set up a local version of the website for editing, follow these steps:\n\n```bash npm2yarn\ncd website\nnpm install\nnpm start\n```\n\n## Making Updates\n\nTo modify an existing page, find the associated markdown file in the `docs/` directory and make the required changes. To introduce a new page, create a markdown file in `docs/` and link to it in `website/sidebars.json`.\n\n## Deploying Changes\n\nAutomatic updates to the website occur with each commit to the `master` branch, with these changes reflected under the `Next` version. The process of tagging and locking documentation to a specific version is automated and coincides with each Detox release.\n\nIf there's a need to update the documentation of a particular version, modify the associated files and code located under `website/versioned_docs/version-<version>/` and `website/versioned_sidebars/version-<version>-sidebars.json`.\n\n## Modifying Old Versions\n\nTo update an older version with the latest changes:\n\n1. Remove the desired version from `versions.json`.\n1. Execute `npm run docusaurus docs:version <version>`.\n\n## Reviewing Style Modifications\n\nIf you're making changes to the stylesheets, use this [demo page](../demo.mdx) to visually inspect the impact of your changes and avoid unintentional visual regressions.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/feature-requests.md",
    "content": "# Feedback and Suggestions\n\nOpen dialogue and feedback, particularly feature requests, play an invaluable role in open-source communities like Detox. They provide insights into user preferences and requirements, aiding in the refinement and enhancement of the project.\n\nDetox project provides various platforms for feedback: [GitHub Issues], [Twitter], and [Discord].\n\nKeep in mind that feedback is varied, including feature suggestions, improvements, identification of missing functionality, and support requests. Each type of feedback has a preferred method of submission.\n\n## Giving Feedback\n\nFollow these tips to deliver clear, actionable feedback:\n\n- **Constructive Criticism:** Frame your feedback in a positive light, understanding the perspective of the project maintainers.\n- **Comprehensive Details:** Include as much relevant information as possible to help maintainers understand the context and use case.\n- **Clarity and Respect:** Make your feedback specific, clear, and respectful, ensuring it is actionable for the maintainers.\n- **Guidelines:** Adhere to the below suggestions for each type of feedback.\n\n## Suggesting Features\n\nWhen suggesting a new feature, remember to provide thorough information, such as examples, screenshots, and code snippets, to communicate your idea effectively.\n\nJust as in general feedback, make sure your feature request is:\n\n- **Specific:** Clearly describe the feature you wish to see implemented.\n- **Detailed:** Offer as much context as possible, including use cases, examples, and why this addition would benefit the community.\n- **Respectful:** Remember, the project maintainers or contributors are not obligated to implement your request. Be polite and respectful in your request.\n\nBy making your feedback as clear and detailed as possible, you'll greatly assist the maintainers in understanding and potentially implementing your suggestion.\n\n[GitHub Issues]: https://github.com/wix/Detox/issues\n[Twitter]: https://twitter.com/detoxe2e\n[Discord]: https://discord.gg/CkD5QKheF5\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/questions/answering-questions.md",
    "content": "# Answering Questions\n\nContributing answers is an invaluable part of supporting the Detox community. By sharing your knowledge and experience, you help others learn and grow, and you also contribute to enhancing Detox for the entire community.\n\n## Different Ways to Answer\n\nAnswering a question is not limited to providing a solution in the comments.\nSometimes, you may not have a solution, but you can still contribute by:\n\n- **Guide towards a solution**: If unsure about an answer, provide guidance on where to look, including relevant documentation or resources.\n- **Request more information**: Ask for more detail if required to better address the question. For example, you may ask for code snippets, screenshots, or reproducible examples.\n- **Refer to existing answers**: Link an already answered question if applicable.\n\n## Guidelines for Writing Clear Answers\n\nWhen answering questions, follow these guidelines to ensure your answers are clear and actionable:\n\n- **Be specific**: Try to pinpoint what exact information you need to effectively answer the question. General requests such as \"Please share more details\" are not very helpful.\n- **Maintain respect**: Ensure your communication is always polite and contextual. When asking for more information, it's better to explain why it's needed so that the person asking understands the relevance.\n- **Completeness**: Make sure to provide a detailed answer that includes all relevant information, such as code snippets, screenshots, and examples. This practice helps others understand your answer and apply it to their use case.\n\n:::tip In a Nutshell\n\nWhen you're answering a question, remember to be specific, clear, and respectful. By providing detailed and well-thought out response, you will play an important role in contributing to and enhancing the knowledge of our community.\n\n:::\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/questions/asking-questions.md",
    "content": "# Asking Questions\n\nPosting queries on public forums increases visibility and chances of getting an answer, and it also helps others with similar issues. However, it's essential to ask questions the right way to get the right answers.\n\nIn case you were able to resolve your issue, consider sharing your solution with the community. By doing so, you contribute to enhancing Detox for the entire community.\n\n## Before Asking\n\nIn case you're facing an issue, consider the following steps before posting a question:\n\n- **Suspect a bug?** Refer to our [Reporting Bugs] guide to determine if you've encountered a Detox bug and how to report it.\n- **Search** for existing answers that may have addressed your question already. [Below](#where-to-ask), we've listed the right platforms to ask (and search) questions.\n- Review our **documentation** thoroughly for any related information. Use <a href=\"#\" onClick={() => document.querySelector('.DocSearch-Button').click()}>the search bar</a> in the top right corner to streamline your search.\n\nIf an existing answer doesn't fully address your question, feel free to ask a follow-up in the same thread if comment-enabled or create a new question, linking back to the original one if possible.\n\n## Where to Ask\n\nIf you can't find an answer to your question, you can ask it in the following ways:\n\n- **Discord**: Join our dedicated [Discord server][Discord] to seek community assistance.\n- **Stack Overflow**: Tag your question with [\"Detox\" on Stack Overflow] to reach the right audience.\n- **GitHub**: Raise an issue on our [Detox repository].\n\n:::tip Pro Tip\n\nWhen posting a question, ensure to include all relevant information, such as code snippets, screenshots, and examples. This practice helps others understand your query and provide comprehensive answers.\n\n:::\n\n[Reporting Bugs]: ../reporting-bugs.md\n[Discord]: https://discord.gg/CkD5QKheF5\n[Detox repository]: https://github.com/wix/Detox/issues\n[\"Detox\" on Stack Overflow]: https://stackoverflow.com/questions/tagged/detox\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing/reporting-bugs.md",
    "content": "# Reporting Bugs\n\nEncountering a bug? Your detailed report is key for us to identify and rectify the issue.\n\nBefore reporting a bug, please review the following guidelines.\n\n## Search for Existing Issues\n\nBefore creating a new issue, search for [existing issues] to see if the bug has already been reported.\nIf you find an existing issue, add a comment to it with any additional information you have.\n\n## Create a Bug Report\n\nIf you can’t find an existing issue, create a new one. When creating a bug report, follow these guidelines:\n\n1. **Follow the Template:** While [creating a bug report on GitHub], adhere to the provided template for creating a clear and concise report.\n2. **Reproduction Steps:** Providing a reproduction example is essential.\n3. **Artifacts:** Include screenshots, logs, visibility artifacts, and any other relevant information. Be ready to provide more information upon request.\n4. **Detailed Description:** Avoid creating issues with brief descriptions or general error messages. Providing a thorough description and context is vital.\n\n:::tip Tip\n\nCreating a minimal code reproduction is crucial as it helps other contributors and maintainers understand and investigate the issue better.\n**Issues without a reproduction are less likely to be addressed**.\n\n:::\n\n[existing issues]: https://github.com/wix/Detox/issues\n[creating a bug report on GitHub]: https://github.com/wix/Detox/issues/new/choose\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/contributing.md",
    "content": "# Contributing to Detox\n\nDetox, an open-source project, greatly values community involvement. Whether you're a mobile developer, QA specialist, or an open source enthusiast, your contribution could significantly enhance the reliability, user experience, and development process of mobile applications.\n\n## Our Code of Conduct\n\nTo ensure an inclusive, safe environment for all contributors, we adhere to the [Contributor Covenant code of conduct]. This well-recognized code provides clear guidelines for respectful behavior.\n\n## Ways to Contribute\n\nAll contributions, regardless of size, can help shape Detox. We welcome:\n\n- **[Questions]**: Your inquiries can help identify gaps in our documentation and benefit all users.\n- **[Answers]**: Assisting other Detox users by providing guidance or responses to their questions.\n- **[Bug Reports]**: Help us identify and resolve Detox issues.\n- **[Feature Suggestions]**: Your ideas for new features can help us improve Detox according to user needs.\n- **[Code Contributions]**: Directly contribute by fixing bugs, adding features, or improving our codebase.\n- **[Code Reviews]**: Help maintain the quality of our codebase by reviewing others' contributions.\n- **[Documentation Enhancements]**: Improve Detox documentation from user guides to API references.\n- **Content Creation**: Share your knowledge of Detox through blog posts, tutorials, videos, and more. We're always excited to share your content on our [Twitter account] and [Discord server].\n\nYour active participation helps build a vibrant community dedicated to improving mobile development.\n\n## Engaging in the Community\n\nJoin our [Discord server] to discuss Detox, ask questions, and provide help. Follow our [Twitter account] for updates on the project.\n\nBecoming an active community member is a great way to start contributing to Detox. It provides familiarity with the project, helps identify opportunities to contribute, and allows guidance from other contributors. The more you engage, the more recognition your contributions receive and the greater impact you can make on the project's direction.\n\n## Appreciation and Recognition\n\nAll our contributors deserve recognition. We express our gratitude by featuring them in our [Release Notes].\n\n### Core Contributors Program\n\nWe plan to launch a \"Core Contributor\" program for individuals who have significantly contributed to Detox and shown deep understanding of the project while being active in the community. Core contributors will be invited to a private Discord channel for exclusive discussions and will receive a distinguished role on our Discord server.\n\n[Contributor Covenant code of conduct]: contributing/code-of-conduct.md\n[Questions]: contributing/questions/asking-questions.md\n[Answers]: contributing/questions/answering-questions.md\n[Bug Reports]: contributing/reporting-bugs.md\n[Feature Suggestions]: contributing/feature-requests.md\n[Code Contributions]: contributing/code/overview.md\n[Code Reviews]: contributing/code/reviewing-pull-requests.md\n[Documentation Enhancements]: contributing/documentation.md\n[Discord server]: https://discord.gg/CkD5QKheF5\n[Twitter account]: https://twitter.com/detoxe2e\n[Release Notes]: https://github.com/wix/Detox/releases\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/demo.mdx",
    "content": "---\ntitle: Internal Demo Page for Styling\n---\n\nimport CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<head>\n  <meta name=\"robots\" content=\"noindex, nofollow\" />\n</head>\n\n:::note\n\nThis page is for internal use only. If you are a contributor to the Detox project, you can use this page to test your changes to the website documentation pages\nstyling. If you are not a contributor, you can ignore this page. Follow this link to the [Detox Home Page](/).\n\n:::\n\n## Headings section\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### Third level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n#### Fourth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n#### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n##### Fifth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n##### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n###### Sixth level heading\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n### `example.​heading.​with.​a.​very.​very.​and.​really.​very.​long.​line.​which.​should.​be.​wrapped` \\[string \\| number\\]\n\n- Lorem ipsum dolor sit amet, consectetur elit, sed do eiusmod tempor `incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam`, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.)\n\n###### `id` \\[string \\| number\\]\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor, odio euismod accumsan dignissim, risus mi blandit ipsum, id ullamcorper risus urna eget augue.\n\n## Paragraphs section\n\nDummy double-spaced paragraph example, consectetur adipiscing elit. Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue, eget bibendum nibh tellus a mi.<br/>Integer blandit, enim quis malesuada fringilla, elit augue pellentesque justo, eget euismod elit sapien id magna. Sed molestie ultrices metus, a congue erat.\n\nThis is a regular text, an _italic text_, a **bold text**, a ***both italic and bold text***, a ~~strikethrough text~~, an `inline code text`, a [simple link](#), and a [`link with inline code`](#).\n\n```plain text\nHere is an example of a code block with plain text.\n// highlight-next-line\nAnd this is a highlighted line.\n```\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue, eget bibendum nibh tellus a mi. Integer blandit, enim quis malesuada fringilla, elit augue pellentesque justo, eget euismod elit sapien id magna. Sed molestie ultrices metus, a congue erat.\n\n![This is a placeholder image.](img/demo/placeholder.png)\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit:\n  - `dummy.config.js` – dummy config file;\n  - `dummy.test.js` – dummy test file;\n- Donec in dui eget metus aliquet facilisis ac eget tortor.\n- Donec scelerisque ex lacinia, commodo eros eget, pretium leo.\n\n## Table section\n\nA simple table:\n\n| Dummy Params | Details of Dummy Text Data                                                                                                                                                                                                          |\n| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type`       | **Required.** String Literal. Dummy property to discern device types: dummy.simulator, dummy.emulator, dummy.attached, dummy.genydummy etc.                                                                                         |\n| device       | **Required.** Object. Device query, e.g. `{ \"byType\": \"dummy_phone\" }` for dummy simulator, `{ \"avdName\": \"dummy_avd\" }` for dummy emulator or `{ \"adbName\": \"<pattern>\" }` for attached dummy device with name matching the regex. |\n| `bootArgs`   | _Optional. String. Supported by dummy.simulator and dummy.emulator only_ <br/> Supply an extra String of arguments to dummy_simctl boot ... or emulator -verbose ... @AVD_Name.                                                     |\n\nA workaround for displaying images side by side:\n\n| ![Left image](img/demo/left-image.png) | ![Right image](img/demo/right-image.png) |\n| ---------------------------------------------------------------------- | ------------------------------------------------------------------------ |\n\n## Admonitions section\n\n:::caution\n\nRhoncus magna eget, pellentesque auguerhoncus magna eget, pellentesque augue **Android** due to DUMMY issues:\n\n- [rhoncus magna eget, pellentesque auguerhoncus magna eget](#)\n- [Curabitur euismod, arcu eu commodo tincidunt, est eros auctor augue](#)\n- [pellentesque auguerhoncus magna eget](#)\n\n:::\n\n:::danger DANGER\n\nThis is a DANGER admonition SAMPLE with a custom background color, and a border color.\n\n:::\n\n:::info\n\nIf your app Dummy uses [DUMMYPods] (all modern React DUMMY projects do since `0.999.0`), make sure\nto run `DUMMY pod install` in your `ios/` folder before building.\n\nIf your DUMMY project doesn't use the DUMMY pods, then you won't have any `YourDUMMYApp.xdummyworkkspace` in your iOS DUMMY Project.\nYou should DUMMY search instead for something like `YourDUmmyApp.dummy` there, and see your DUMMY build command accordingly:\n\n```diff title=\"apps.diff\"\n   apps: {\n     'dummy.debug': {\n       type: 'dummy.app',\n-      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n+      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n-      build: 'dummy_command -workspace dummy/YOUR_APP.dummyworkspace -scheme YOUR_APP -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n+      build: 'dummy_command -workspace dummy/example.dummyworkspace -scheme example -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n```\n\n:::\n\n:::note NOTE\n\nThis is a NOTE admonition SAMPLE with a custom background color, and a border color.\n\n:::\n\n:::tip\n\nLorem ipsum `dolor sit amet`, (Sed porttitor purus ac risus bibendum), PELLENTESQUES back to\n[Fusce tempor nisl euismod](#) rhoncus magna eget, pellentesque auguerhoncus magna eget,\npellentesque augue **Fusce tempor nisl euismod**, rhoncus pellentesques magna tempus augue mollis.\n\nDonec in nulla `AUCTOR_SED_MALESUADA` (or `AMALESUADA_MASSA`) eros posuere\nCurabitur elementum mi massa, non molestie ipsum velit vel:\n\n<Tabs groupId=\"whateverId\">\n  <TabItem value=\"tab1\" label=\"Tab 1\">\n    <CodeBlock language=\"bash\">$ANDACISUS_SED_EGET/rhoncus/tempus -augue-mollis</CodeBlock>\n  </TabItem>\n  <TabItem value=\"tab2\" label=\"Tab 2\">\n    <CodeBlock language=\"bash\">$ANDACISUS_SED_EGET/rhoncus/tempus -augue-mollis</CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::\n\n## Syntax highlighting section\n\n### npm\n\n```bash npm2yarn\nnpm install \"dummy_package\" --save\n```\n\n### Shell\n\n```shell\n// highlight-start\n# Check the exit status of the last command\nif [ $? -eq 0 ]; then\n    echo \"dummy_command succeeded\"\n// highlight-end\nelse\n    echo \"dummy_command failed\"\nfi\n```\n\n### JSX\n\n```jsx title=\"src/DummyExample.jsx\"\nimport { DummyButton } from 'dummy-react-library';\n\n// A dummy component\nfunction DummyExample() {\n// highlight-next-line\n  const [dummyState, setDummyState] = React.useState(false);\n\n  return (\n    <DummyContainer>\n      <DummyButton onClick={() => setDummyState(!dummyState)}>\n        Click me\n      </DummyButton>\n    </DummyContainer>\n  );\n}\n```\n\n### Java\n\n```java\npackage com.dummy;\n\n@Test\npublic class DummyClass {\n    // A dummy comment\n    public static void main(String[] args) {\n        int dummyVariable = 5;\n// highlight-start\n        for (int i = 0; i < 10; i++) {\n            dummyVariable += i;\n            System.out.println(\"The dummy value is \" + dummyVariable);\n        }\n// highlight-end\n    }\n}\n```\n\n### diff\n\n```diff\n   apps: {\n     'dummy.debug': {\n// highlight-start\n       type: 'dummy.app',\n-      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n+      binaryPath: 'dummy/build/Products/${conf}-dummyplatform/YOUR_APP.dummy',\n// highlight-end\n-      build: 'dummy_command -workspace dummy/YOUR_APP.dummyworkspace -scheme YOUR_APP -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n+      build: 'dummy_command -workspace dummy/example.dummyworkspace -scheme example -configuration ${conf} -sdk  dummyplatform -derivedDataPath dummy/build'\n```\n\n### JSON\n\n```json\n{\n  \"items\": {\n    \"object1\": {\n      \"property1\": \"dummy_type\",\n      \"property2\": \"dummy_device\",\n// highlight-next-line\n      \"property3\": [\"dummy_path/to/dummy_file.dummy\"]\n    }\n  }\n}\n```\n\n### YAML\n\n```yaml\nactions:\n  - dummy install example\n    - push_dummytext: \"*\"\n\n  - dummy install example --save global\n  # Lorem ipsum dolor sit amet, consectetur SampleCo is using ($DUMMY/lorem-text)\n```\n\nThanks for checking with this visual regression suite!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/android-dev-env.md",
    "content": "---\ntitle: Setting Up an Android Development & Testing Environment\n---\n\nThis guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) – be it on a personal, _local_ computer, or a powerful CI machine.\n\nNote that running automated UI tests is _not the same_ as developing Android apps. Hence, you may find yourself not 100% aligned with the recommendations here, and should consider being so.\n\n## Java Setup\n\nThis is the most basic step in the process, as without a proper Java SDK installed, nothing Android-ish works – at least not from command-line, which is mandatory for executing `Detox`.\n\n_The bottom line is that **Android needs Java installed**. If you want to run with React Native 73 and Android 14 then it needs to be at least Java 17, otherwise you should have Java 11._\n\nTo check for your real java-executable’s version, in a command-line console, run:\n\n```bash\njava -version\n```\n\nWhat needs to be verified is that `java` is in-path and that the output contains something like this:\n\n```bash\njava version \"17.x.x\"\n...\n```\n\n> Note: Do not be confused by the Java version potentially used by your browsers, etc. For `Detox`, what the command-line sees is what matters.\n\n---\n\nIf `java -version` yields an error, it is likely that `java` is either not in your path or not even installed at all. To try to understand which of the two is true, use [this guide](https://www.java.com/en/download/help/path.xml).\n\nIf otherwise the version is simply wrong, try these course of actions:\n\n- On MacOS, in particular, Java comes from both the OS _and_ possibly other installers such as `homebrew`. That can really get things tangled up. To mitigate:\n  - Use one of the options suggested in this [Stack Overflow post](https://stackoverflow.com/questions/52524112/how-do-i-install-java-on-mac-osx-allowing-version-switching/52524114#52524114).\n  - Install OpenJDK 17 on top of the existing versions ([how to check?](https://medium.com/notes-for-geeks/java-home-and-java-home-on-macos-f246cab643bd)): <https://java.tutorials24x7.com/blog/how-to-install-openjdk-17-on-mac>. Consider employing the `JAVA_HOME` variable to get things to work right. _Note: This is more suitable if your environment is fairly clean, and does not contain versions from 3rd-party installers (e.g. `homebrew`)._\n- Use these refs, which might be useful:\n  - <https://java.com/en/download/faq/java_mac.xml#version>\n  - <https://www.java.com/en/download/help/version_manual.xml>\n\n## Android SDK\n\nIf you have Android Studio installed - as most of us do, then the SDK should be available for you somewhere on your machine<sup>\\*</sup>. However, for CI agents – possibly running with no GUI, or if you simply don’t want the somewhat bloated piece of software on your computer, it is possible to simply download the SDK and tool-set, purely. Both cases are covered in Google’s [Android guide about Android Studio](https://developer.android.com/studio/). For the pure-tools option, refer to the `Command line tools only` section at the bottom.\n\nFor more help on setting the SDK up, [this guide might be helpful](https://www.androidcentral.com/installing-android-sdk-windows-mac-and-linux-tutorial).\n\nWhatever option you choose, and whichever platform you’re running on (Mac, Linux, Windows), we strongly recommend that eventually you would have 2 additional things set up:\n\n- The path to the SDK’s root directory is set into the `ANDROID_SDK_ROOT` [environment variable](https://developer.android.com/studio/command-line/variables).\n- The path to the SDK’s root directory is bundled into the global [`PATH`](https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them) on your computer.\n\n_<sup>\\* Inspect the content of your `ANDROID_SDK_ROOT` and `ANDROID_HOME` environment variables.</sup>_\n\n## Android (AOSP) Emulators\n\nMobile-apps’ automation needs an Android device to run on. If you haven’t already done so, you should [set up an Emulator](https://developer.android.com/studio/run/emulator). But, wait - don’t go and install the default one: read through, first.\n\nWe’ve long proven that for automation - which requires a stable and deterministic environment, Google’s emulators running with Google APIs simply don’t deliver what’s needed. Be it the preinstalled Google play-services - which tend to take up a lot of CPU, or even Google’s `gboard` Keyboard - which is full-featured but overly bloated: These encourage flakiness in tests, which we are desperate to avoid in automation.\n\nFortunately, the Android team at Google offers a pretty decent alternative: **AOSP emulators** (Android Open-Source Project). While possibly lacking some of the extended Google services, and a bit less fancy overall, **we strongly recommend** to strictly use this flavor of emulators for running automation/Detox tests. They can be installed alongside regular emulators.\n\n_Here’s a visual comparison between the two - an SDK 28 (Android 9) AOSP emulator (left) vs. an emulator with Google APIs installed (right):_\n\n![AOSP vs Google-API](../img/android/aosp-vs-googleapi.png)\n\n### Here’s how to install them using the command line\n\nWhile it’s possible to do this using Android Studio, we’ll focus on the command line, as it is also good for _headless_ CI machines.\n\n1. Locate your 'Android home' folder - typically set in the `ANDROID_HOME` environment variable, or in its predecessor - `ANDROID_SDK_ROOT`. If `ANDROID_HOME` isn’t set, either set it yourself or run the following commands after `cd`-ing into the home folder.\n\n1. Preliminary: Upgrade your `emulator` executable to the latest version.\n   _Note: It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n   ```sh\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install emulator\n   ```\n\n   :::note\n\n   In previous Android Studio versions, the SDK-Manager path was located at `$ANDROID_HOME/tools/bin/sdkmanager`.\n   We highly recommend working with the latest version, however, in case you are working with an old version, and this command fails, try this path instead.\n\n   The command might also fail if the command-line tools aren’t installed. To install the tools using Android Studio, click `Tools > SDK Manager` and select the `SDK Tools` tab. Ensure that `Android SDK Command-line Tools (latest)` is checked and applied.\n\n   :::\n\n1. Install an emulator image without Google APIs:\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \"system-images;android-28;default;x86_64\"\n   $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses\n   ```\n\n   > - With `;android-28;`, we assumed SDK 28 here, but other APIs are supported just the same.\n   > - The `;default;` part replaces `;google_apis;`, which is the default, and is what matters here.\n   > - If you are running on a M1 you must install an arm64 architecture i.e. `system-images;android-28;default;arm64-v8a`\n   > - To get a list of available images, run `$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list`\n\n1. Create an emulator (i.e. AVD - Android Virtual Device):\n\n   ```shell\n   $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_28_AOSP -d pixel --package \"system-images;android-28;default;x86_64\"\n   ```\n\n   > - `Pixel_API_28_AOSP` is just a suggestion for a name. Any name can work here, even `Pixel_API_28` - but you might have to delete an existing non-AOSP emulator, first. In any case, the name used in Detox configuration (typically in `package.json`) should be identical to this one.\n   > - `-d pixel` will install an emulator with the specs of a Pixel-1 device. Other specs can be used. Running `$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list devices` will list all available device specs.\n   > - `--package` is the most important argument: be sure to use the same value as you did in part 2, above, with `;default;`.\n   >\n   > Run `avdmanager create --help` for the full list of options.\n\n1. Launch the emulator:\n\nThis isn’t mandatory, of course, but it’s always good to launch the emulator at least once before running automated tests. The section below will discuss optimizing emulators bootstrapping.\n\nAt this point, you should be able to launch the emulator from Android Studio, but that can also be done from a command line console, as explained in the [cheatsheet below](#locating-the-avds-home-directory).\n\n> See [this guide](https://developer.android.com/studio/run/emulator-commandline) for full details on the `emulator` executable.\n\n### Installing from Android Studio\n\nWe won’t go into all the details but once the proper image is installed using the `sdkmanager`, the option becomes available in the AVD creation dialog (see `Target` column of the Virtual Device Configuration screen below):\n\n![SDK manager in AS](../img/android/aosp-image-as.png)\n\n![Install AOSP in AS](../img/android/install-aosp-as.png)\n\nAlso, be sure to upgrade your emulator executable to the latest version: If it isn’t up-to-date, you will get an \"Update Available\" message under the _status_ column, instead of \"Installed\":\n\n![Upgrade emulator in AS](../img/android/upgrade-emulator-as.png)\n\n**Note:** _It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)_\n\n## Emulator Quick-Boot\n\nIf the system allows saving a state (for example, in personal computers or a CI system that can start from prebaked images you can configure), we highly and strongly recommend setting up quick-boot snapshots for any emulator that is used for testing automation.\n\nQuick-boot saves significant time otherwise wasted when emulators cold-boot from scratch. The concept becomes more prominent in environments capable of parallel-executing tests in multiple, concurrently running emulators (as when [Detox is run with multiple Jest workers](../config/testRunner.mdx)).\n\nThis is something that we actually recommend applying in the emulator itself rather than using command-line, but we’ll include both options.\n\nIn any case, the general principle we’re going to instruct is as follows:\n\n1. Enable auto-save for an installed / running emulator.\n1. Launch it, and, when stable, terminate – a snapshot is saved as a result.\n1. Disable auto-save, so that future, test-tainted snapshots won’t be saved.\n\n### Setting up a quick-boot snapshot from the Emulator\n\nStart by launching a freshly baked emulator. Wait for it to go stable.\n\nWhen running, go to settings (3 dots in the sidebar) > `Snapshots` > `Settings` tab. If not already set, select `Yes` in the `auto-save` option. This should prompt for a restart – choose `Yes`. The emulator should restart **and save a snapshot.**\n\n![Emulator auto-save menu](../img/android/snapshot-autosave.png)\n\nDo this again after the emulator is back up, but set `No` in the `auto-save` option. Allow it to restart yet again: it will immediately boot into the state saved as a snapshot earlier.\n\nYou can also try these as alternative sources for this:\n\n- [Snapshots in Google Developers page](https://developer.android.com/studio/run/emulator#snapshots) for full details on snapshots.\n- [Highly detailed blog post](https://devblogs.microsoft.com/xamarin/android-emulator-quick-boot/)\n\n### Setting up a quick-boot snapshot from command-line\n\nThis is a bit more difficult, but is also applicable even for UI-less machines.\n\n1. [Locate the AVD’s `config.ini`](#locating-the-avds-home-directory)\n1. Using your favorite text editor, either change or add these key-value sets:\n\n   ```ini\n   fastboot.chosenSnapshotFile=\n   fastboot.forceChosenSnapshotBoot=no\n   fastboot.forceColdBoot=no\n   fastboot.forceFastBoot=yes\n   ```\n\n> Empirically, `forceFastBoot=yes` and `forceColdBoot=no` should be enough.\n\n1. Under the AVD’s home directory, either create or edit yet another `ini` file called `quickbootChoice.ini` with the following content:\n\n   ```ini\n   saveOnExit = true\n   ```\n\n1. Now that everything is in place, [launch your emulator](#booting-an-emulator-via-command-line) once (in verbose mode) and wait for it to fully load. Then, shut it down, and make sure the [state has been saved](#verifying-the-emulators-quick-boot-snapshot-has-been-saved).\n\n1. Last but not least, go back to `quickbootChoice.ini` and now switch to:\n\n   ```ini\n   saveOnExit = false\n   ```\n\n### Test Butler Support (Optional)\n\nIf, when setting up your work environment, you’ve selected Google emulators with an AOSP image as the test target - as recommended,\n**we strongly encourage** you would also integrate [Test Butler](https://github.com/linkedin/test-butler): in the very least - in order to suppress crash and ANR dialogs.\nThey are a soft spot in UI testing on Android, all around, as - when displayed,they make the UI entirely inaccessible (and thus cause tests to fail in bulks).\n\nSetting Test Butler up for working with Detox is a bit different than explained in their guides. The process, as a whole, is twofold:\n\n1. Preinstalling the test-butler-app APK onto the test device.\n1. Integrating the test-butler-lib into your own test APK, and initializing it in a custom test runner (as explained).\n\nThe library part can be easily achieved as explained there (i.e. by using Gradle’s `androidTestImplementation`). Same goes for initialization. As for the APK, the suggested usage of Gradle’s `androidTestUtil` is scarce when running with Detox (i.e. non-native instrumentation tests). Here’s what to do instead.\n\n> _For a complete and thorough coverage of the Test Butler integration with Detox, consider going over our [blogpost on CI execution](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f) on medium_.\n\n#### Solution 1: Prebaked Images\n\nIf you have control over the emulators’ snapshots, simply download (see test-butler’s guide) and install the test-butler APK once (e.g. use `adb install -r -t path/to/test-butler-app.apk`), and save an updated version of the snapshot. This is the best solution.\n\n> Note: you will have to reiterate this if you upgrade to a newer version of Test-Butler, in the future.\n\n#### Solution 2: Dynamic Installation\n\nAssuming you have the APK available in the system, you can dynamically have Detox automatically install it in all of the running target-emulators by utilizing `utilBinaryPaths` in your Detox configuration. Example:\n\n```json\n{\n  \"devices\": {\n    \"emulator.oss\": {\n      \"type\": \"android.emulator\",\n      \"device\": \"...\",\n      \"utilBinaryPaths\": [\"relative/path/to/test-butler-app-2.2.1.apk\"]\n    }\n  }\n}\n```\n\n> Refer to our [configuration guide](../config/apps.mdx) for further details on `utilBinaryPaths`.\n\nAs per _making_ the APK available - for that, we have no really good solution, for the time being (but it’s in the works). A few options might be:\n\na. In a custom script, have it predownloaded from Maven directly, as suggested in the Test Butler guide. For example (on a Mac / Linux):\n\n```bash\ncurl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk\n```\n\n> Should you decide to go this path, we recommend you add `./temp/test-butler-app.apk` to the relevant `.gitignore`.\n\nb. (Discouraged) Add it to your source control (e.g. git), as part of the repository.\n\n### Disclaimer\n\nAfter upgrading the emulator’s binary to a newer version, it usually considers all existing snapshots invalid.\n\nThis can be addressed by deleting and recreating the snapshots as explained, or by recreating the AVD’s altogether.\n\n## Cheatsheet\n\n### Locating the AVD’s home directory\n\nEach AVD generated by the Android tools gets its own directory where associated content is stored:\n\n- **Configuration file (i.e. `config.ini`)**\n- Snapshot images\n- SD-card content\n\nto name a few.\n\nOn Mac machines, the AVD directory typically maps to:\n\n```bash\n$HOME/.android/avd/<AVD Name>.avd/\n```\n\n_(for example: `/Users/root/.android/avd/Pixel_API_28_AOSP.avd/`)_\n\nThe path should be similar on Linux machines, even though `$HOME` isn’t `/Users/root` but typically `/home/root` _(for example: `/home/root/.android/avd/Pixel_API_28_AOSP.avd/`)._\n\n### Booting an emulator via command-line\n\n> - The following examples apply for both Mac and Linux, and should be similar on Windows.\n> - They assume the emulator’s name is `Pixel_API_28_AOSP`. If it isn’t, adjust the names accordingly:\n\n#### Shortcut for booting a verbose, visible emulator in a GUI supporting system\n\n```bash\n$ANDROID_HOME/emulator/emulator -verbose @Pixel_API_28_AOSP &\n```\n\n**Shortcut for booting a verbose, _headless_ emulator in a UI-less Linux system**\n\n```bash\n$ANDROID_HOME/emulator/emulator -verbose -no-window -no-audio -gpu swiftshader_indirect @Pixel_API_28_AOSP &\n```\n\n### Verifying the emulator’s quick-boot snapshot has been saved\n\nIf you’ve run your emulator in verbose mode from a shell, it’s easy to verify the state has been saved by following the logs. In particular, when shutting the emulator down, this log asserts the state has been saved:\n\n```plain text\nemulator: Saving state on exit with session uptime 9423 ms\n```\n\n> as a reference, when the state is _not_ saved, the typical output is:\n>\n> ```plain text\n> emulator: WARNING: Not saving state: RAM not mapped as shared\n> ```\n>\n> It can be a result of an improper configuration, or an emulator launch where the `-read-only` argument was provided.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/cucumber-js-integration.md",
    "content": "# Cucumber.js Integration\n\n:::note Community resource\n\nThis is an article generously contributed [by the community][initial PR].\nFeel free to [contribute to it][Contributing] by submitting a pull request\nif you find any errors or have suggestions for improvements.\nIf you have any questions, please get in touch with the author directly.\n\n:::\n\n[Cucumber] is a tool for running automated tests written in plain language.\nIt can be integrated with Detox to run end-to-end tests for mobile applications\nif you manage [Detox Internals API] from [Cucumber.js hooks].\n\nIn your `init.js` or `init.ts` file, please import `detox/internals` on top of the file:\n\n```js\nimport detox from 'detox/internals'\n```\n\nAlso import the hooks we'll be using just a bit later:\n\n```js\nimport { Before, BeforeAll, AfterAll, After,  ITestCaseHookParameter } from '@cucumber/cucumber'\n```\n\nDefine the earliest [Cucumber.js] hook, `BeforeAll`, where you’ll [initialize][`detox.init()`] Detox and launch the app:\n\n```js\nBeforeAll({ timeout: 120 * 1000 }, async () => {\n    await detox.init()\n    await device.launchApp()\n})\n```\n\nYou must also tell Detox explicitly when [Cucumber.js] starts a test via calling [`detox.onTestStart()`] inside `Before` hook.\nOtherwise, Detox won't be able to _start recording_ logs, screenshots, videos, and other artifacts:\n\n```js\nBefore(async (message: ITestCaseHookParameter) => {\n    const { pickle } = message\n    await detox.onTestStart({\n        title: pickle.uri,\n        fullName: pickle.name,\n        status: 'running',\n    })\n})\n```\n\nThe symmetrical step is to inform Detox that the current test is over via calling [`detox.onTestDone()`] inside `After` hook.\nOtherwise, Detox won't be able to _save_ logs, screenshots, videos, and other artifacts:\n\n```js\nAfter(async (message: ITestCaseHookParameter) => {\n    const { pickle, result } = message\n    await detox.onTestDone({\n        title: pickle.uri,\n        fullName: pickle.name,\n        status: result ? 'passed' : 'failed',\n    })\n})\n```\n\nAfter the tests are over, you should call [`detox.cleanup()`] inside `AfterAll` hook so that Detox can clean up all the resources it has allocated:\n\n```js\nAfterAll(async () => {\n    await detox.cleanup();\n})\n```\n\nFor more information on [Cucumber.js] please check out this [documentation][Cucumber.js].\n\n[Cucumber]: https://cucumber.io/\n\n[Cucumber.js]: https://github.com/cucumber/cucumber-js#documentation\n\n[Cucumber.js hooks]: https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md\n\n[Initial PR]: https://github.com/wix/Detox/pull/3858\n\n[Detox Internals API]: ../api/internals.mdx\n\n[`detox.init()`]: ../api/internals.mdx#initoptions-promise\n\n[`detox.cleanup()`]: ../api/internals.mdx#cleanup-promise\n\n[`detox.onTestStart()`]: ../api/internals.mdx#onteststartevent-promise\n\n[`detox.onTestDone()`]: ../api/internals.mdx#ontestdoneevent-promise\n\n[Contributing]: ../contributing.md\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/detox-repl.md",
    "content": "# Debugging with Detox REPL\n\n:::caution Important\n\nREPL mode is currently only supported when using **Jest** as the test runner.\n\n:::\n\nDetox provides an interactive Read-Eval-Print Loop (REPL) that allows you to debug tests in real time. It’s particularly useful when exploring app state, running Detox commands manually, or diagnosing failing tests.\n\n## How to activate REPL\n\nREPL is only available when you pass one of the following CLI flags to [`detox test`](../cli/test.md) command:\n\n- `--repl=auto`\n\n  This mode enables **automatic entry into REPL** whenever a test or lifecycle hook fails — in addition to supporting manual `detox.REPL()` calls.\n\n- `--repl`\n\n  Use this mode when you want **manual control**. You must explicitly call `await detox.REPL()` inside your test or lifecycle hooks (e.g. `beforeEach`, `afterEach`, etc.). Detox will pause execution and open an interactive REPL prompt at that point.\n\n  ```ts\n  it('should debug manually', async () => {\n    await device.launchApp();\n    await element(by.id('login')).tap();\n\n    // Pause here for live debugging\n    await detox.REPL();\n\n    // Resume test after exiting REPL\n  });\n  ```\n\n:::tip Technical Note\n\nWhen you pass `--repl` CLI argument, you disable advanced terminal features which are normally interfering with interactive input. This step is essential for the REPL to function correctly — without it, interactive commands will be ignored, and you'll see a warning message instead.\n\n:::\n\n## Adding Custom Scope\n\nYou can expose additional helpers or variables inside the REPL context:\n\n```ts\nawait detox.REPL({\n  utils,\n  testUser,\n  delay: (ms) => new Promise(res => setTimeout(res, ms)),\n});\n```\n\nWhen you enter the REPL, you will be able to access given variables directly, e.g.:\n\n```text\ndetox> await utils.login(testUser)\ndetox> await delay(1000)\n```\n\n## Using REPL\n\nOnce inside, you can:\n\n- Run Detox commands, e.g.: `await element(by.id('foo')).tap()`\n- Use `.dumpxml` to inspect view hierarchy\n- Use `.pilot` to run natural language commands (requires [Detox Pilot](../pilot/testing-with-pilot.md))\n- Use Node.js REPL commands like `.exit`, `.help`, `.editor`, `.save`, etc.\n\n```text\n.detox> .help\n.break     Sometimes you get stuck, this gets you out\n.clear     Alias for .break\n.dumpxml   Print view hierarchy XML\n.editor    Enter editor mode\n.exit      Exit the REPL\n.help      Print this help message\n.load      Load JS from a file into the REPL session\n.pilot     Execute natural language command (e.g. .pilot Tap on login button)\n.save      Save all evaluated commands in this REPL session to a file\n```\n\nTo exit the REPL, either type `.exit` or press `Ctrl+C` twice.\n\n## See also\n\n- [Detox Pilot](../pilot/testing-with-pilot.md)\n- [Node.js REPL API](https://nodejs.org/api/repl.html)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/developing-while-writing-tests.md",
    "content": "# Developing Your App While Writing Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\n> If your app requires active development, such as adding testID fields for tests, this is a good workflow. It allows you to work both on your app and your tests at the same time.\n\nThe main idea behind this workflow is to run your app in debug with Detox on a simulator. Once the app is up and running, it will still be connected to the React Native packager. This means that you’ll be able to do JavaScript code modifications in your app codebase and press CMD+R to reload the bundle inside the Detox simulator.\n\n### Step 1: Build Your App in Debug\n\nDetox is going to need the executable for your app. This means we need to build it first.\nSince we want a build that’s connected to the live React Native packager (to update bundle changes),\nwe’re going to need a _debug_ build:\n\n```bash\ndetox build -c ios.sim.debug # or android.emu.debug\n```\n\nCheck out [Introduction > Building with Detox](../introduction/project-setup.mdx) for more details.\n\n### Step 2: Make Sure Your React-Native Packager is Running\n\nIf you can’t see a React Native packager instance running in a terminal, you can run it manually by typing:\n\n```bash\nnpx react-native start\n```\n\nThe packager instance will reload the JavaScript bundle of your app when you press CMD+R in the simulator window.\nThis will allow you to make modifications in your app codebase.\n\n### Step 3: Run Detox Tests\n\nType the following inside your project root:\n\n```bash\ndetox test -c ios.sim.debug # or android.emu.debug\n```\n\nThis will use Detox to find the app executable we’ve built in step 1, install it on the device and run Detox tests against it.\n\n### Step 4: Make Changes to Your App’s Codebase as Usual\n\nYou can keep working on the JavaScript codebase of your app as usual.\nAs long as you keep the simulator from step 3 running, you’ll be able to press CMD+R inside and reload your app with the new changes.\n\n### Step 5: Re-run Detox Tests Without Re-installing the App\n\nYou can make changes to your Detox tests as well. When you want to re-run your tests on the device,\nwe recommend adding `--reuse` flag to save your time when running the tests.\n\n```bash\ndetox test -c ios.sim.debug --reuse # or android.emu.debug\n```\n\nBy default, Detox re-installs the app before picking every next test suite which is redundant in this situation\nsince your app code changes are delivered via network with React Native packager, and the app binary itself does\nnot change.\n\nYou should not use this option if you made native code changes or if your app relies on local (\"disk\") storage.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/genymotion-saas.mdx",
    "content": "# Using Genymotion SaaS\n\nAs the number of your end-to-end tests grows, the overall test session duration might easily surpass an hour or two.\nA good idea first would be to parallelize the test execution using your test runner (e.g. for Jest that\nwould be forwarding `--maxWorkers <N>`), but this approach has its limitations. Indeed, an average build agent would handle\nrunning a few virtual devices at once, but running a dozen devices at once would make it slow and unreliable.\n\nIn other words, if you're experiencing scaling issues or struggling with managing local Android emulators,\na good idea would be to migrate to SaaS platforms, where you can start and stop devices on demand at any scale.\nAt the moment, Detox can offer you a first-class integration with\n[Genymotion SaaS], the platform that offers cloud-based Android Virtual Devices.\n\n## Prerequisites\n\nYou need to register an account in [Genymotion SaaS], so that you have valid credentials to use with their CLI tool,\n[`gmsaas`]. If you already have an account there, make sure there are available device minutes. Don't worry about\nthe new accounts – they come with **2** concurrent devices and free **60** minutes out of the box.\n\n![](../img/genymotion/register.png)\n\nNext, you should get `gmsaas` CLI tool [installed and configured][Genymotion SaaS tutorial],\nso that you're able to see your e-mail after running this:\n\n```bash\ngmsaas auth whoami\n# your_email@example.com\n```\n\nIf you encounter errors instead, please revisit the [Genymotion SaaS tutorial] and check out their [Known Issues]\nsection if your problem persists.\n\n## Configuring\n\nTo run tests on a device, you need to define its properties first: OS version, screen dimensions, etc.\nThis entire set of device specs is called a **recipe**. Genymotion SaaS offers you a predefined list of recipes\nto pick from, but you can create custom recipes as well. Refer to the [Basic Steps] tutorial on their website for\nmore details.\n\n![](../img/genymotion/recipe.png)\n\nEach recipe item in the list can be expanded for extra details, and that's where you can find its respective _UUID_.\nCopy that UUID and use it to create a new device and a new configuration in your Detox config:\n\n```diff title=\".detoxrc.js\"\n module.exports = {\n   devices: {\n     simulator: { /* ... */ },\n     emulator: { /* ... */ },\n+    genycloud: {\n+      type: 'android.genycloud',\n+      device: {\n+        recipeUUID: '<paste your chosen recipe UUID>'\n+      },\n+    },\n   },\n   apps: {\n     'ios.debug': { /* ... */ },\n     'ios.release': { /* ... */ },\n     'android.debug': { /* ... */ },\n     'android.release': { /* ... */ },\n   },\n   configurations: {\n     'ios.debug': { /* ... */ },\n     'ios.release': { /* ... */ },\n     'android.debug': { /* ... */ },\n     'android.release': { /* ... */ },\n+    'android.genycloud.release': {\n+      device: 'genycloud',\n+      app: 'android.release',\n+    },\n   },\n };\n```\n\nAlthough the _recipe UUIDs_ are guaranteed to be unique and never change unlike the _recipe names_, you still can use\nthe latter if you like – just switch from `recipeUUID` to `recipeName` property like this:\n\n```diff\n     genycloud: {\n       type: 'android.genycloud',\n       device: {\n-        recipeUUID: '<delete your recipeUUID property>'\n+        recipeName: '<paste the recipe name>'\n       },\n     },\n   },\n```\n\n:::info\n\nIn the example above we assume you'll be running a _release configuration_ of your app since this is what\nusually happens on CI.\n\nRunning _debug builds_ is trickier to set up (and might be less stable), but if you have to do it,\nfollow the instructions. You'll be setting up tunneling between your local machine (where React Native packager is\nrunning on port 8081) and the remote device in the cloud.\n\nFirst, patch your `MainApplication.java` (or your main activity class) to override `debug_http_host`, e.g.:\n\n```diff\n package com.example;\n\n import android.app.Application;\n+import android.content.SharedPreferences;\n+import android.os.Bundle;\n+import android.preference.PreferenceManager;\n\n import com.facebook.react.ReactApplication;\n import com.facebook.react.ReactNativeHost;\n@@ -37,6 +40,9 @@ public class MainApplication extends Application implements ReactApplication {\n     public void onCreate() {\n         super.onCreate();\n         SoLoader.init(this, /* native exopackage */ false);\n+        SharedPreferences preferences =\n+            PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n+        preferences.edit().putString(\"debug_http_host\", \"localhost:8081\").apply();\n     }\n\n }\n```\n\nNow, as your React Native app will be forced to use `localhost:8081` to download the bundle, you'll need to make sure\nthat there is a tunnel between your local machine and the remote device – add 8081 to `reversePorts` in your app config,\ne.g.:\n\n```diff\n  'android.debug': {\n    type: 'android.apk',\n    binaryPath: 'android/app/build/outputs/apk/fromBin/debug/app-fromBin-debug.apk',\n    build: 'cd android && ./gradlew assembleFromBinDebug assembleFromBinDebugAndroidTest -DtestBuildType=debug && cd ..',\n+   reversePorts: [8081],\n  },\n```\n\nClean your Android build intermediates and build your app again:\n\n```bash\ncd android\n./gradlew clean # remove ./ on Windows\ncd ..\ndetox build -c android.emu.debug\n```\n\nIf your application is trivial enough, these adjustments should be already enough to run _debug builds_ remotely.\n\n:::\n\n## Running\n\nAssuming you have created a new `android.genycloud.release` configuration, run:\n\n```bash\ndetox test -c android.genycloud.release\n```\n\nSoon enough you'll be seeing an output like this:\n\n```\nAllocating Genymotion-Cloud instance Detox.62dfc57b-3201-c861-29bb-8f31f60a8d39.w1 for testing.\nTo access it via a browser, go to: https://cloud.geny.io/instance/8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\nUse the link to see what's happening on your device in real time:\n\n![](../img/genymotion/live.png)\n\nAfter that, try running tests with 2 workers to make sure that your tests don't have issues with\nconcurrency. The latter might happen if different test files are fighting over the same resource\n(e.g. deleting an account while another test is using it, and so on):\n\n```bash\ndetox test -c android.genycloud.release --maxWorkers 2\n# DETOX_CONFIGURATION=\"android.genycloud.release\" jest --config e2e/jest.config.js --maxWorkers 2\n# …\n```\n\n:::info\n\nFree Genymotion SaaS accounts are limited to **2** concurrently running devices.\nIf you need more devices or more minutes for testing, you can reach Genymotion's team\nat <sales@genymobile.com>.\n\n:::\n\n## Caveats\n\n### Termination\n\nIf you have to terminate your tests execution via `Ctrl+C` or another forcible way, pay attention to\nthe warnings printed, e.g.:\n\n```plain text\ndetox[22314] i WARNING! Detected a Genymotion SaaS instance leakage, for the following instances:\ndetox[22314] i Instance Detox.1e0ee8a4-6949-90c7-6680-5c3a9010d1e5.w1 (8fc62d21-3de0-4ed8-bf18-e69b90246dc5)\n    Kill it by visiting https://cloud.geny.io/instance/8fc62d21-3de0-4ed8-bf18-e69b90246dc5, or by running:\n    gmsaas instances stop 8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\nLeaving the device unattended would mean spending extra money :grimacing: :dollar:, so make sure to follow the\ninstructions and stop your instances, e.g.:\n\n```bash\ngmsaas instances stop 8fc62d21-3de0-4ed8-bf18-e69b90246dc5\n```\n\n:::tip\n\nYou can set up a safeguard for the [maximum run duration](https://docs.genymotion.com/saas/05_Administration_interface/#maximum-run-duration)\non the [Administration > Settings](https://cloud.geny.io/administration/settings) panel. This can minimize the costs\neven if you accidentally leave the device powered on.\n\n:::\n\nWe plan to improve this behavior and secure emergency teardown someday, but beforehand the next issue\nshould be resolved (see it below). Besides, `Ctrl+C`'ing proves to be useful when you want to leave the device active\nat some point of your test scenario and interact with it manually.\n\n### `behavior.shutdownDevice` cannot be disabled\n\nDetox CLI has [`-u, --cleanup` argument], and the behavior config has the respective [`shutdownDevice` property], but **none of them can be effectively disabled** on Genymotion SaaS devices.\nDetox _always shuts them down_ in the end of the test session, unless you abruptly terminate its execution (see the previous caveat).\n\nIn other words, you can't leave Genymotion SaaS devices up and running after your test session ends. On the ond hand,\nthat reduces your chances to forget a running device. On the other hand, that doesn't allow you to keep a pool of\nimmediately ready devices – a kind of strategy that could be more efficient for busier CI pipelines. There are plans\nto improve this in the future, but currently you have to bare with this caveat.\n\n[Genymotion SaaS]: https://cloud.geny.io/\n[`gmsaas`]: https://docs.genymotion.com/gmsaas\n[Genymotion SaaS tutorial]: https://docs.genymotion.com/gmsaas/01_Get_Started\n[Known Issues]: https://docs.genymotion.com/gmsaas/04_Issues/\n[Basic Steps]: https://docs.genymotion.com/saas/04_Basic_Steps/\n[`-u, --cleanup` argument]: ../cli/test.md\n[`shutdownDevice` property]: ../config/behavior.mdx\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/launch-args.md",
    "content": "# Using Launch Arguments\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nIn Detox, the app under test is launched via an explicit call to [`device.launchApp()`](../api/device.md). Through various means, Detox enables specifying a set of user-defined arguments (key-value pairs) to be passed on to the app when launched, so as to make them available inside the launched app itself at runtime (both on the native side, and - if applicable, on the JavaScript side).\n\n### Motivation\n\n> If this is clear to you first hand, you can skip right to the section about arguments setup.\n\nIn particular, the common use case of using launch argument (although not distinctly), is for [mocking](mocking.md) external entities such as servers - replacing them with equivalent _mock servers_, sporting equivalent (yet fake) API-endpoints that run alongside the testing host (i.e. the one running Detox). These mock servers can typically be configured during the test, to return deterministic responses to network requests coming from the app.\n\nTypically, the process of setting up such servers - especially in a parallel test-execution environment, involves three major steps (within the context of a test set-up):\n\n1. Allocating a port for a mock server, dynamically.\n1. Bringing up a mock server instance bound to that port (e.g. at `localhost:1234`).\n1. Launching the app with a predefined argument that holds the port, for example `mockServerPort=1234`.\n   (It is assumed here that there’s designated mocked code inside the app that can read `mockServerPort` and rewire all connections to `localhost:1234` instead of to the real production server).\n\nIn this context, launch argument are useful for implementing step [#3](https://github.com/wix/Detox/issues/3).\n\n### Arguments Setup\n\nUser-defined launch arguments specification is very flexible, and can be defined on 4 levels:\n\n| Level                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                  |\n| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| 1. Static Configuration                   | As a part of a static [Detox configuration](../config/overview.mdx), using the `launchArgs` property.<br />This is can sufficient, for example, if you only require one mock server instance, and can use the same static port throughout the entire testing execution session.                                                                                                                              |\n| 2. Static via CLI                         | As arguments specified explicitly in the [command-line](../cli/test.md) execution of `detox test`, using `--app-launch-args`.                                                                                                                                                                                                                                                                                |\n| 3.`device.appLaunchArgs`                  | Dynamically, using the [`device.appLaunchArgs`](../api/device.md#deviceapplaunchargs) API, which initially holds the static configuration, and then allows for the modification of it before applied through `device.launchApp()`.<br/>Mostly required in complex test environments, where the servers and ports are dynamic, and are determined via distinct software components (e.g. separate test kits). |\n| 4. `device.launchApp()` with `launchArgs` | Dynamically and explicitly, using on-site arguments specified in calls to [`device.launchApp()`](../api/device.md#devicelaunchappparams) through the `launchArgs` parameter.<br />Ideal for fairly simple test environments, where the ports are dynamic but are in complete control of the user.                                                                                                            |\n\n**Important: Arguments specified in each level take precedence over equivalent underlying levels**.\n\nExamples:\n\n1. In an environment where `mockServerPort` is statically pre-set to `1001` in Detox configuration, and then set to `1003` using `device.appLaunchArgs` inside a test, the app would eventually be launched with `1003` as its value, in calls to `device.launchApp()` in that test.\n1. (Scenario continues) In subsequent calls to `device.launchApp()` with this parameter: `device.launchApp({ launchArgs: {mockServerPort: 1004} })`, the app will be (re-)launched with `1004` as the value for `mockServerPort`.\n\n### In-App Arguments Access\n\nOur official recommendation for getting the arguments inside the app is by integrating the [react-native-launch-arguments](https://github.com/iamolegga/react-native-launch-arguments) project, which provides that seamlessly. For those who are interested, here are the underlying details:\n\n- On iOS, the specified launch arguments are passed as the process launch arguments and available through normal means, such as accessing `[[NSProcessInfo processInfo] arguments]`.\n- On Android, the launch arguments are set as bundle-extra’s into the activity’s intent. They are therefore accessible on the native side via the current activity as: `currentActivity.getIntent().getBundleExtra(\"launchArgs\")`.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/migration.md",
    "content": "# Migration Guide\n\n<!-- markdownlint-configure-file { \"ol-prefix\": 0 } -->\n\nWe are improving Detox API as we go along, sometimes these changes require us to break the API in order for it to make more sense. These migration guides refer to breaking changes. If a newer version has no entries in this document, it means it does not require special migration steps. Refer to the release notes of the latter builds to learn about their improvements and changes.\n\n## 20.0\n\n### No [Mocha] support\n\nIf you were using Mocha, now you have two options:\n\n- switch to [Jest] using [`detox init`] boilerplate as a reference and [`testRunner` config];\n- wait until a third-party integration with Mocha appears.\n\n### Jest 27.2.5 and higher\n\nYou have to upgrade your Jest version to at least 27.2.5 or higher. The recommended choice is 28.x or 29.x.\n\n### All-in-one configs\n\nIf you see an error like this:\n\n```plain text\nDetoxConfigError: Configuration \"legacy\" uses a deprecated all-in-one schema,\nwhich is not supported by Detox.\n```\n\nYou have to extract device and app configs from your configuration, as shown in the example below:\n\n<table>\n<tr>\n  <th>Legacy schema</th>\n  <th>Modern schema</th>\n</tr>\n<tr>\n  <td>\n\n```json\n{\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"type\": \"ios.simulator\",\n      \"device\": \"iPhone 12\",\n      \"binaryPath\": \"/some/path/ios.app\",\n      \"build\": \"...\"\n    },\n    \"android.emu.debug\": {\n      \"type\": \"android.emulator\",\n      \"device\": \"Pixel_30_API\",\n      \"binaryPath\": \"/some/path/android.apk\",\n      \"build\": \"...\",\n      \"launchArgs\": {}\n    }\n  }\n}\n```\n\n  </td>\n  <td>\n\n```json\n{\n  \"apps\": {\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"/some/path/ios.app\",\n      \"build\": \"...\"\n    },\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"/some/path/android.apk\",\n      \"build\": \"...\",\n      \"launchArgs\": {}\n    }\n  },\n  \"devices\": {\n    \"ios.simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": { \"type\": \"iPhone 12\" }\n    },\n    \"android.emulator\": {\n      \"type\": \"android.apk\",\n      \"device\": { \"avdName\": \"Pixel_30_API\" }\n    }\n  },\n  \"configurations\": {\n    \"ios.sim.debug\": {\n      \"device\": \"ios.simulator\",\n      \"app\": \"ios.debug\"\n    },\n    \"android.emu.debug\": {\n      \"device\": \"android.emulator\",\n      \"app\": \"android.debug\"\n    }\n  }\n}\n```\n\n  </td>\n</tr>\n</table>\n\nFor more details refer to the [`Config > Devices`](../config/devices.mdx) and [`Config > Apps`](../config/apps.mdx) sections.\n\n### `testRunner` config section\n\nThree top-level string properties (`testRunner`, `runnerConfig`, `specs`) have been unified into a complex\n`testRunner` section which strives to be as agnostic as possible:\n\n```diff title=\".detoxrc.js\"\n-  testRunner: 'jest',\n-  runnerConfig: 'e2e/jest.config.js',\n-  specs: 'e2e',\n-  skipLegacyWorkersInjection: true,\n+  testRunner: {\n+    $0: 'jest',\n+    args: {\n+      config: 'e2e/jest.config.js',\n+      _: ['e2e']\n+    },\n+  },\n```\n\nAlso, `skipLegacyWorkersInjection` migration option no longer has meaning, so you can remove it safely.\n\nIf you didn’t have `runnerConfig` previously, use `e2e/config.json` (because that was an implicit default\nin Detox 19 and earlier):\n\n```diff\n  testRunner: {\n    $0: 'jest',\n    args: {\n+     config: 'e2e/config.json',\n    },\n },\n```\n\n### Custom Jest environment\n\nYou no longer need to have an autogenerated environment file if you haven’t been customizing it,\nand if it looks like below:\n\n```js title=\"e2e/environment.js\"\nconst {\n  DetoxCircusEnvironment,\n  SpecReporter,\n  WorkerAssignReporter,\n} = require('detox/runners/jest-circus');\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  constructor(config, context) {\n    super(config, context);\n\n    // Can be safely removed, if you are content with the default value (=300000ms)\n    this.initTimeout = 300000;\n\n    // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.\n    // This is strictly optional.\n    this.registerListeners({\n      SpecReporter,\n      WorkerAssignReporter,\n    });\n  }\n}\n\nmodule.exports = CustomDetoxEnvironment;\n```\n\nIf you want, for example:\n\n- to reduce the init timeout to 120 seconds,\n- remove `SpecReporter` output,\n- remove `WorkerAssignReporter` output,\n\nthen you can express this intent via config:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    $0: 'jest',\n    args: {\n      config: 'e2e/jest.config.js',\n      _: ['e2e']\n    },\n// highlight-start\n    jest: {\n      setupTimeout: 120000,\n      reportSpecs: false,\n      reportWorkerAssign: false,\n    },\n// highlight-end\n  },\n  // …\n};\n```\n\nIf you have some customizations beyond that, make sure to remove the boilerplate code:\n\n```js title=\"e2e/environment.js\"\n// highlight-next-line\nconst { DetoxCircusEnvironment } = require('detox/runners/jest');\n\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n  constructor(config, context) {\n    super(config, context);\n\n    // leave your custom code\n  }\n}\n\nmodule.exports = CustomDetoxEnvironment;\n```\n\nPay attention that the import has been changed to `detox/runners/jest` (previously it was `detox/runners/jest-circus`),\nand the reporters (`SpecReporter`, `WorkerAssignReporter`) are no longer exported. You can continue using\n`this.initTimeout` if you rename it there to `this.setupTimeout`, but you can also delegate that to Detox config like shown earlier.\n\n### New Jest config\n\nLet's examine **the old configs** first to see what needs to be removed or changed:\n\n```js showLineNumbers title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: 1,\n  testEnvironment: './environment',\n  testRunner: 'jest-circus/runner',\n  testTimeout: 120000,\n  testRegex: '\\\\.e2e\\\\.js$',\n  reporters: ['detox/runners/jest/streamlineReporter'],\n  verbose: true\n};\n```\n\nSee comments line by line:\n\n1\\. As a recommendation, switch to CommonJS (`module.exports = {}`) instead of JSON, if you haven’t done that already.\n\n2\\. If you don’t have `maxWorkers: 1` configured, please add it.\n\n3\\. If you removed your test environment in the previous step, remove the `testEnvironment` property.\n\n4\\. Remove `testRunner` since it is already `jest-circus` by default in Jest 27.x and higher.\n\n5\\. You need a long `testTimeout` value, because usually end-to-end tests cannot complete in 5 seconds, which is\nJest's default timeout value. We suggest 120 seconds by default, but you can fine-tine it.\n\n6\\. We recommend to use `rootDir` and `testMatch` instead of `testRegex`, like this (assuming your Jest config is\nin `e2e` folder of your project, together with the Detox test files):\n\n```diff\n-  testRegex: '',\n+  rootDir: '..',\n+  testMatch: ['<rootDir>/e2e/**/*.test.js'],\n```\n\n7\\. Remove that `streamlineReporter`. You’ll be adding a new reporter in a second.\n\n8\\. You need to set `verbose: true` to disable log batching. In other words, Jest will be printing\nlogs with a significant delay, which is just inconvenient and annoying when you need\nto know what exactly is happening right now.\n\nNow, let's take a look at **the new config** and the required additions:\n\n```js showLineNumbers title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: 1,\n  testTimeout: 120000,\n  verbose: true,\n// highlight-start\n  reporters: ['detox/runners/jest/reporter'],\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n// highlight-end\n};\n```\n\nLet's focus on lines 5-8:\n\n5. Add the new Detox reporter as the first one to your existing `reporters: [...]` array or create that property\n   like we show. It is a reserved reporter for Detox core logic, so it does not affect your logs or any other output –\n   just make sure you have it.\n\n5. Register `globalSetup` shipped with Detox. If you have your own `globalSetup`, then call both in a wrapper function:\n\n   ```js\n   module.exports = async () => {\n      await require('detox/runners/jest/index').globalSetup();\n      await yourGlobalSetupFunction();\n   };\n   ```\n\n5. Register `globalTeardown` shipped with Detox. If you have your own `globalTeardown`, then you should wrap it\n   with `try-finally` and call the teardown of Detox too:\n\n   ```js\n   module.exports = async () => {\n     try {\n       await yourGlobalTeardownFunction();\n     } finally {\n       await require('detox/runners/jest/index').globalTeardown();\n     }\n   };\n   ```\n\n5. If you already have removed your custom test environment, please switch to the default test environment shipped\n   with Detox like shown in the example. Otherwise, stay with your custom test environment but make sure to migrate it\n   as was described earlier.\n\n### Stop using timeline artifacts\n\nIf you have been using `--record-timeline all` CLI option or had timeline artifact configured in your config,\n\n```diff\n {\n   artifacts: {\n     plugins: {\n       logs: 'all',\n       screenshot: 'failing',\n-      timeline: 'all',\n     }\n   }\n }\n```\n\nplease remove it from your configs and scripts. Timeline artifacts have been merged with log artifacts, so if\nyou need to have `detox.trace.json` – just don’t turn off your logs, and you’ll get it.\n\n### Updating command-line scripts\n\nCheck your Detox scripts whether they had command-line arguments such as:\n\n```bash\ndetox test … -o path/to/jest.config …\ndetox test … --runner-config path/to/jest.config …\ndetox test … --workers 3 …\n```\n\nDetox became agnostic about third-party test runner arguments, and now you need to forward those arguments directly\nto your test runner (i.e. Jest):\n\n```bash\ndetox test … --config path/to/jest.config …\ndetox test … --maxWorkers 3 …\n```\n\nYou’ll be able to tell that you’ve run into a situation like this if you see error messages like:\n\n```plain text\n● Unrecognized CLI Parameter:\n\n  Unrecognized option \"workers\".\n\n  CLI Options Documentation:\n  https://jestjs.io/docs/cli\n```\n\nBesides, verify you don’t have a deprecated `--device-launch-args` parameter in your scripts.\nIt has been superseded by `--device-boot-args`:\n\n```bash\ndetox test ... --device-boot-args=\"arg1 arg2\"\n```\n\n### Revisit environment variables\n\nIf you’re relying somewhere in your code on things like `process.env.DETOX_CONFIGURATION` or any other that starts from `DETOX_`, as a matter of a workaround, you can turn on `testRunner.forwardEnv` in your Detox config:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  testRunner: {\n    args: {\n      $0: 'jest',\n    },\n    // highlight-next-line\n    forwardEnv: true,\n  },\n  devices: { /* ... */ },\n  apps: { /* ... */ },\n  configurations: { /* ... */ },\n};\n```\n\nThat should solve temporarily the issue with missing environment variables, but this is\nnot the best solution overall. The better fix for that would be switch to using Detox\nInternals API.\n\nFor example, you were determining the number of workers depending on your configuration:\n\n```js title=\"e2e/jest.config.js\"\nmodule.exports = {\n  maxWorkers: process.env.CI\n    ? (`${process.env.DETOX_CONFIGURATION}`.startsWith('ios.') ? 3 : 2)\n    : 1,\n    globalSetup: '...',\n    globalTeardown: '...',\n    // ... and so on ...\n};\n```\n\nThat would translate to a cleaner code in Detox 20:\n\n```js title=\"e2e/jest.config.js\"\nconst { resolveConfig } = require('detox/internals');\n\nmodule.exports = async () => {\n  const { device } = await resolveConfig();\n\n  return {\n    maxWorkers: process.env.CI ? (device.type === 'ios.simulator' ? 3 : 2) : 1,\n    globalSetup: '...',\n    globalTeardown: '...',\n    // ... and so on ...\n  };\n};\n```\n\n### Miscellaneous\n\nDetox 20 drops `ios.none` driver due to the low demand and legacy code issues.\nIf you have been using it, please follow the new [Debugging > Native application code](../introduction/debugging.mdx#native-application-code) tutorial which explains how to use `launchApp: 'manual'` as a replacement for `ios.none`.\n\nIf you have been using `{ permanent: true }` option for `device.appLaunch.args.modify` API, please note that it has been removed in PR [#3360](https://github.com/wix/Detox/pull/3360), in favor of `appLaunchArgs.shared`:\n\n```js\n// device.appLaunchArgs.modify({ /* ... */ }, { permanent: true });\ndevice.appLaunchArgs.shared.modify({ /* ... */ });\n```\n\n---\n\nThe hard part is over now, congratulations on finishing the migration!\nStay tuned for the upcoming minor releases leveraging the recent architectural changes in Detox.\n\n## 19.2\n\nThe release has a **developer experience** improvement – _Detect pending in-flight requests_ ([#3003](https://github.com/wix/Detox/issues/3003), [**@jonathanmos**](https://github.com/jonathanmos)).\nThe feature adds extra logic that prevents forgotten `await` statements on asynchronous Detox APIs. That’s why you might see a new error like this:\n\n```plain text\nFAILED\nDetoxRuntimeError: The pending request \\#246 (\"invoke\") has been rejected due to the following error:\n\nDetox has detected multiple interactions taking place simultaneously. Have you forgotten to apply an await over one of the Detox actions in your test code?\n```\n\nThat should help you find forgotten `await`s in your code that are a potential reason for flakiness in E2E tests.\nYou’ll need to find those places and apply trivial fixes like shown below:\n\n```diff\n   await screenDriver.performSomeAction();\n-  expect(screenDriver.get.myElement()).toBeNotVisible();\n+  await expect(screenDriver.get.myElement()).toBeNotVisible();\n```\n\n## 19.0\n\n**Version 19 is not really a breaking change!**\n\nWe decided to bump Detox into a major version release, nonetheless, because it is breaking for projects that sport [custom Detox drivers](../articles/third-party-drivers.md), such as [`detox-puppeteer`](https://github.com/ouihealth/detox-puppeteer).\n\nIf you are a maintainer of such a project, and you wish to upgrade your Detox dependency to 19 (kudos! :clap:),  follow this step-by-step migration guide; You can refer to [this pull-request](https://github.com/ouihealth/detox-puppeteer/pull/13), which does that for the  `detox-puppeteer` project.\n\n### Migrating Custom Drivers\n\nThe core of the change is that Detox' drivers framework is **no longer a single monolith**, responsible for everything platform-specific. Rather, it’s been broken down to these subresponsibilies:\n\n- Allocation: The process of launching / selecting a device over which the tests would run in the current execution.\n- Validation: Execution environment checkups.\n- Artifacts: Platform-based selection of build-artifacts implementation (e.g. screenshots).\n- Runtime\n\n> You can find a visual explanation, [here](https://github.com/wix/Detox/files/7338121/pre-multiapps-rfc.pdf).\n\nIn addition, the runtime driver is no longer state-less – basically, allowing implementation to hold any state that is required in identifying and managing the associated device.\n\n#### How to migrate\n\nEverything here will be based on the changes made in the [`detox-puppeteer` example](https://github.com/ouihealth/detox-puppeteer) - names included (please don’t use them as-is in your own implementation!).\n\n**Allocation:**\n\n- Create a new class, called `PuppeteerDeviceAllocation` (change name to something that would make sense in your project).\n- Move everything currently in `PuppeteerDriver.acquireFreeDevice()` and `.shutdown()` onto `PuppeteerDeviceAllocation.allocate()` and `.free()`, respectively.\n- Create a POJO class called `PuppeteerAllocCookie`. This class should hold anything that would later be required in order to specify the specifically associated device (example: `UDID` for iOS simulators, `adb` names for Android devices).\n- Make `.allocate()` return an instance of your cookie class. Puppeteer example: [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R841).\n- **Delete `PuppeteerDriver.acquireFreeDevice()` and `PuppeteerDriver.shutdown()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R830).\n\nAdd the new allocation class to the `module.exports` list, under the name: `DeviceAllocationDriverClass`.\n\n**Validation:**\n\n- If you have any validations implemented in `PuppeteerDriver.prepare()`, create a class called `PuppeteerEnvironmentValidator`.\n- Move anything inside `PuppeteerDriver.prepare()` to `PuppeteerEnvironmentValidator.validate()`.\n- **Delete `PupeteerDriver.prepare()`.**\n\n> For a precise class c'tor and method signatures, see [here](https://github.com/ouihealth/detox-puppeteer/pull/13/files#diff-818f6c5309fffe5c710e542216ffdb55f468fd2f8035feb0b0c917785489aca7R798).\n\nAdd the new (optional) class to the `module.exports` list, under the name: `EnvironmentValidatorClass`.\n\n**Artifacts:**\n\n- Move your implementation of `PuppeteerDriver.declareArtifactPlugins()` to the same method in a new class, called `PuppeteerArtifactPluginsProvider.declareArtifactPlugins()` (change name to something that would make sense in your project).\n\n> There are no changes in method signature in this case.\n\nAdd the new class to the `module.exports` list, under the name: `ArtifactPluginsProviderClass`.\n\n**Runtime:**\n\n- Optionally rename your class from `PuppeteerDriver` to `PuppeteerRuntimeDriver`.\n- In the methods remaining in the class accepting the `deviceId` arg: **remove the `deviceId` arg entirely**. This might break your implementation - don’t worry, continue reading.\n- If applicable, change the signature of the class' c'tor to accept the cookie as its 2nd argument (instance previously allocated in `PuppeteerAllocationDriver.allocate()`). Save data from the cookie as part of the driver’s state, in order to unbreak your implementation, following the previous step.\n- Add two methods: `getExternalId()` and `getDeviceName()`. Implement them such that they would comply with the `device.id` and `device.name` [API contracts](../api/device.md), respectively.\n\nExport the runtime driver class in the `module.exports` list as `RuntimeDriverClass`, **instead of `DriverClass`.**\n\n#### Troubleshooting\n\nFor issue related to these migrations, approach us by [submitting an issue on GitHub](https://github.com/wix/Detox/issues/new/choose). Please apply the `Detox19` label.\n\n## 18.6.0\n\nDetox has normalized the configuration format, so that along with the combined `configurations` object you now can define your `devices` and `apps` separately.\nPlease refer to the [configuration doc](../config/overview.mdx) to obtain more details.\nThis change is backward-compatible, although the new format is now the recommended option.\n\n## 18.0\n\nDetox now uses a custom synchronization system on iOS, [developed in-house](https://github.com/wix/DetoxSync); this is the second step in phasing out our Earl Grey usage. We have tested this system extensively internally, and are confident that it should work as expected. There are no known limitations with the new system.\n\nIf you are seeing issues with the new sync system, please open an issue.\n\n**Breaking:**\n\n- **iOS.** Detox now requires iOS 13.0 and above iOS simulator runtimes, and iOS 12.x and below are no longer supported. This does not require that you drop support for iOS 12.x in your apps, just that tests will no longer work on iOS 12 and below. Please make sure your tests are running on iOS 13 or above\n- **JS.** :warning: Detox no longer launches the app automatically (even if asked to do so in configuration) — you have to launch your app explicitly:\n\n```diff\n+  beforeAll(async () => {\n+    await device.launchApp();\n+  });\n```\n\n- **JS (jest-circus).** The `DetoxCircusEnvironment` provided from `detox/runners/jest-circus` package now requires two arguments in its constructor, so you have to update your descendant class signature:\n\n```diff\nclass CustomDetoxEnvironment extends DetoxCircusEnvironment {\n-  constructor(config) {\n-    super(config);\n+  constructor(config, context) {\n+    super(config, context);\n```\n\n- **JS (iOS).** `device.launchApp({ launchArgs: { ... })` argument escaping has been improved. If you use complex launch args such as regular expressions, make sure you remove manual escaping from now on to avoid erroneous double escaping, e.g.:\n\n```diff\n await device.launchApp({\n   launchArgs: {\n-    detoxURLBlacklistRegex: '(\\\\\".*example.com/some-url/.*\\\\\")' }`,\n+    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")' }`,\n   },\n });\n```\n\n- **JS (internal).** There is a breaking change for people writing custom Detox integrations. Environment variable naming schema has changed – now Detox uses prefix to distinguish its own environment variables (usually passed from `detox test` CLI), e.g.: `recordLogs=all` becomes `DETOX_RECORD_LOGS=all`, `loglevel=trace` becomes `DETOX_LOGLEVEL=trace`, and so on.\n\n## 17.5.2\n\nFixes the issue from **17.4.7** (see below) - now the migration guide for **17.4.7** can be safely ignored.\n\n## 17.4.7\n\nThis release was not meant to be breaking in any sense, but unfortunately there are two minor caveats that leaked in.\n\n### `jest-cli`\n\nFrom now on, Detox explicitly depends on `jest-cli` package (marked as a peer dependency), that’s why if you see an error like the one below:\n\n```plain text\nCannot find module 'jest-cli/build/cli/args'\n```\n\n~~You should add `jest-cli` to your `package.json`’s `devDependencies` and rerun `npm install`, e.g.:~~\n\n**UPD**: since `detox@17.5.2` you can ignore this advice. The problem should go away **without** these edits:\n\n```diff\n \"devDependencies\": {\n   \"jest\": \"26.x.x\",\n+  \"jest-cli\": \"26.x.x\",\n```\n\n### `detox-cli`\n\nIf you were using `detox-cli` global package, make sure to upgrade it before proceeding to `detox@17.4.7`.\n\n```bash\nnpm install detox-cli --global\n```\n\nIf you have an older version of `detox-cli`, then you might see the following error on an attempt to run  `detox test <...args>`:\n\n```plain text\n'jest' is not recognized as an internal or external command,\noperable program or batch file.\ndetox[43764] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern \"^((?!:android:).)*$\" --maxWorkers 1 e2e\n```\n\n## 17.3.0\n\nIn the context of introducing the element screenshots feature ([#2012](https://github.com/wix/Detox/issues/2012)), we decided to slightly change the contract between Detox and externally-implemented _drivers_. These should be modified according to the follow diff-snippet:\n\n```diff\nclass Expect {\n-  constructor(invocationManager) {\n+  constructor({ invocationManager }) {\n     this._invocationManager = invocationManager;\n  }\n}\n\nclass PluginDriver {\n  constructor() {\n-    this.matchers = new Expect(new invocationManager());\n  }\n}\n\n-module.exports = PluginDriver;\n+module.exports = {\n+  DriverClass: PluginDriver,\n+  ExpectClass: Expect,\n+}\n```\n\n## 17.0.0\n\nDetox for iOS now uses an entirely new, custom-built matcher, action and expectation infrastructure. This is the first step in our roadmap of removing Earl Grey as a dependency.\n\nWhile the new system has been designed to be as compatible as possible with the existing system, some changes we made to existing APIs that may or may not require your attention.\n\n### New API\n\n- `pinch()`—new API for pinching elements, replacing the deprecated `pinchWithAngle()` (iOS)\n- `getAttributes()`—new API for obtaining element properties (iOS)\n- `not`—new API for inverting expectation logic (iOS, Android)\n\n### Modified API (**Potentially Breaking Changes**)\n\nThe following APIs have changed and require attention\n\n- `by.text()`—matching elements by text actually uses the element’s text value instead of using the accessibility label (iOS)\n- `by.traits()`—the supported trait values have changed (iOS)\n- `atIndex()`—matched elements are now sorted by x and y axes to allow for stability between tests; indices will most likely change after upgrading to this version of Detox (iOS)\n- `tap()`—this method now accepts an optional point to tap (iOS, Android)\n- `setColumnToValue()`—this method no longer supports date pickers; use `setDatePickerDate()` to change picker dates (iOS)\n- `setDatePickerDate()`—in addition to normal date formats, a new special case is introduced for ISO 8601 formatted date strings: `\"ISO8601\"` (iOS)\n\n### Deprecated API\n\nThe following APIs have been deprecated, but is still available\n\n- `tapAtPoint()`—the API has been consolidated with `tap(point)` (iOS, Android)\n- `pinchWithAngle()`—this API has been replaced with `pinch()` (iOS)\n- `toBeNotVisible()`—deprecated in favor of `not.toBeVisible()` (iOS, Android)\n- `toNotExist()`—deprecated in favor of `not.toExist()` (iOS, Android)\n\nMake sure to read the API reference for [matchers](../api/matchers.md), [actions](../api/actions.md) and [expectations](../api/expect.md).\n\nIf you see unexpected results, make sure to open an issue.\n\n## 16.0.0\n\nDetox now comes as a prebuilt framework on iOS, thus lowering npm install times and saving some build issues that happen due to unexpected Xcode setups.\n\nTo support this, Detox needs Swift 5 support, so the iOS requirements have changed slightly:\n\n- **Xcode**: 10.2 or higher\n  - **iOS Simulator Runtime**: iOS 12.2 or higher\n\nThis does not require that your app require iOS 12.2, only that you build and run your app on Xcode 10.2 or above, and use an iOS 12.2 or above simulator.\n\n[Mocha]: https://mochajs.org\n\n[Jest]: https://jestjs.io\n\n[`detox init`]: ../cli/init.md\n\n[`testRunner` config]: ../config/testRunner.mdx\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/mocking-open-with-url.md",
    "content": "# Mocking Open With URL (Deep Links)\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nYou can mock opening the app from URL to test your app’s deep link handling mechanism.\n\n### Mocking App Launch With a URL\n\n```js\nawait device.launchApp({newInstance: true, url, sourceApp: bundleId}); // sourceApp is an optional iOS-only argument\n```\n\n#### Example\n\n```js\ndescribe('launch app from URL', () => {\n    it('should handle URL successfully', async () => {\n      await device.launchApp({\n        newInstance: true,\n        url: 'scheme://some.url',\n        sourceApp: 'com.apple.mobilesafari'\n      });\n      await expect(element(by.text('a label'))).toBeVisible();\n    });\n  });\n```\n\n### Mocking Opening With a URL On a Launched App\n\n> iOS-only\n\n```js\nawait device.openURL({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/mocking-user-activity.md",
    "content": "# Mocking User Activity\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nDetox supports mocking user activity for iOS apps.\n\nThe user activity API is used to mock an external user activity state. The app normally uses this state to continue the activity inside the app. This API is also used for associated domains, Spotlight search handling and Siri intents.\n\n### Mocking App Launch with a User Activity\n\nUsing `launchApp()` with custom params will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({userActivity: activity});\n```\n\n**Example:**\n\n```js\ndescribe('Background user activity', () => {\n  it('Launch with user activity', async () => {\n    await device.launchApp({userActivity: activity})\n    await expect(element(by.text('From user activity'))).toBeVisible();\n  });\n});\n```\n\n### Sending User Activity to a Running App\n\nUse the `sendUserActivity()` method.\n\n```js\nawait device.sendUserActivity(activity)\n```\n\n**Example:**\n\n```js\n\ndescribe('Foreground user activity', () => {\n\nbeforeEach(async () => {\n  await device.launchApp({newInstance: true});\n});\n\nit('User activity from inside the app', async () => {\n  await device.sendUserActivity(activity);\n  await expect(element(by.text('From user activity'))).toBeVisible();\n });\n});\n```\n\n### User Activity JSON Format\n\nUser activities are passed as JSON objects to Detox, which then parses them and creates native objects representing the passed information.\n\nThe JSON object passed to Detox needs to provide some required data, but can also provide additional, optional data.\n\n<!--- Use http://www.tablesgenerator.com/markdown_tables to edit these tables. --->\n\n| Key            | Required | Value Type | Description                                                                                                                         |\n| -------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| `activityType` | Yes      | String     | The activity type. Either a custom user string or a predefined constant as provided by Detox. See the Activity Types section below. |\n| `webpageURL`   | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed to.                                   |\n| `referrerURL`  | No       | String     | Used when simulating an associated domain link opening. This is the URL that the user browsed from.                                 |\n| `userInfo`     | No       | Object     | An additional key-value pair storage, used for general purpose data passing to the app.                                             |\n\n#### Activity Types\n\nActivities can be both developer-generated user activity state, such as actions from another system—another iOS device, macOS, Safari, etc., and system-generated user activities, such as user browsed an associated domain, Spotlight search tapped, Siri intent activity, etc.,  where the app should handle such an activity.\n\nDetox supports mocking both types.\n\nFor developer-generated user activities, use a custom `activityType` that is expected by the application.\n\nFor system-generated user activities, use set the `activityType` to a predefined constant in Detox, like so:\n\n```js\nconst DetoxConstants = require('detox/index').DetoxConstants;\n\nconst userActivityBrowsingWeb = {\n  \"activityType\": DetoxConstants.userActivityTypes.browsingWeb,\n  \"webpageURL\": \"https://my.deeplink.dtx\",\n  \"referrerURL\": \"https://google.com/\"\n};\n```\n\nCurrently supported system-generated activity types:\n\n- DetoxConstants.userActivityTypes.browsingWeb - Used for associated domains (deep links)\n- DetoxConstants.userActivityTypes.searchableItem - Used for Spotlight search results\n\n#### Spotlight Search Results\n\nIn addition to `DetoxConstants.userActivityTypes.searchableItem`, Detox also provides an additional constant, used to provide the item identifier, which was selected in Spotlight. The app uses this identifier to display the item on screen.\n\nAn example on a Spotlight search user activity:\n\n```js\nconst DetoxConstants = require('detox').DetoxConstants;\n\nlet userActivitySearchableItem = {\n  \"activityType\": DetoxConstants.userActivityTypes.searchableItem,\n  \"userInfo\": {\"customKey\": \"value\"}\n};\nuserActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = \"com.test.itemId\"\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/mocking-user-notifications.md",
    "content": "# Mocking User Notifications\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nDetox supports mocking user notifications.\n\n> **Note:** The mocking mechanism will not mimic the UI of a user notification. Instead, it will only simulate a user interaction with the notification - namely, the \"opening\" of it (equivalent to a user’s tap/swipe on it in the notification center).\n\n### Mocking App Launch With a Notification\n\n`launchApp()` with custom parameters (i.e. `userNotification`) will trigger the mocking mechanism.\n\n```js\nawait device.launchApp({newInstance: true, userNotification: notification});\n```\n\n#### Example\n\n```js\ndescribe('Launch with push notification', () => {\n  it('should handle the notification', async () => {\n    await device.launchApp({\n      newInstance: true,\n      userNotification: userNotificationPushTrigger,\n    });\n    await expect(element(by.text('From push'))).toBeVisible();\n  });\n});\n```\n\n### Mocking Notification Reception on a Running App\n\nUse the `sendUserNotification()` method to send notification to **running** app. Notifications can be sent to an active or a background app.\n\n> Note: while the name `sendUserNotification()` is not very idiomatic on Android, as notification data is not \"sent\" to apps (rather, it is bundled into an Activity/Service launch Intent as Intent-extras), this unified API is used, for the time being, for both platforms equivalently. With [plans of a more extensive support](https://github.com/wix/Detox/issues/2141) for Android, we estimate it would be deprecated when the time comes.\n\n```js\nawait device.sendUserNotification(notification);\n```\n\n**Example:**\n\n```js\ndescribe('Foreground user notifications', () => {\n  it('should handle the local notification from inside the app', async () => {\n    await device.launchApp();\n    await device.sendUserNotification(localNotification);\n    await expect(element(by.text('from local notification'))).toBeVisible();\n   });\n});\n```\n\n### Notification JSON Format\n\nUser notifications are passed as JSON objects to Detox. The JSON object needs to provide some required data, but can also provide an additional, optional payload.\n\n**Mind the major difference here between the two platforms.** While on iOS many types of data fields are applicable, Android is very loosely defined - with support for just free-form user data in the `payload` field.\n\n| Key                 | Required                  | Value Type | Platform      | Description                                                                                                                                                                              |\n| ------------------- | ------------------------- | ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `trigger`           | Yes                       | Object     | iOS           | The conditions that trigger the delivery of the notification. See the [Triggers section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#triggers) below. |\n| `title`             | No                        | String     | iOS           | A short description of the reason for the alert.                                                                                                                                         |\n| `subtitle`          | No                        | String     | iOS           | A secondary description of the reason for the alert.                                                                                                                                     |\n| `body`              | No                        | String     | iOS           | The body of the notification.                                                                                                                                                            |\n| `badge`             | No                        | Integer    | iOS           | The number to display as the app’s icon badge.                                                                                                                                           |\n| `payload`           | iOS: No<br />Android: Yes | Object     | iOS & Android | An object of custom information associated with the notification.<br />Android: see [full description below](#payload)                                                                   |\n| `category`          | No                        | String     | iOS           | The identifier of the app-defined category object.                                                                                                                                       |\n| `content-available` | No                        | Integer    | iOS           | Include this key with a value of 1 to configure a silent notification.                                                                                                                   |\n| `user-text`         | No                        | String     | iOS           | The text response provided by the user.                                                                                                                                                  |\n| `action-identifier` | No                        | String     | iOS           | The identifier for the action that the user selected.                                                                                                                                    |\n\n#### Triggers (iOS-only)\n\nTriggers are objects representing the trigger.\n\n| Key               | Required                            | Value Type | Description                                                                                                 |\n| ----------------- | ----------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |\n| `type`            | Yes                                 | String     | The conditions that trigger the delivery of the notification. See the Trigger Types section below.          |\n| `repeats`         | No                                  | Boolean    | Indicates whether the event repeats. Only used for `calendar`, `timeInterval` and `location` trigger types. |\n| `timeInterval`    | Yes for `timeInterval` trigger type | Number     | The time interval used to create the trigger.                                                               |\n| `date-components` | Yes for `calendar` trigger type     | Object     | The date components used to construct this object. See the Date Components section below.                   |\n| `region`          | Yes for `location` trigger type     | Object     | The region used to determine when the notification is sent. See the Region section below.                   |\n\n##### Trigger Types\n\nThere are four types of triggers supported by Detox at this time:\n\n- `push`\n- `calendar`\n- `timeInterval`\n- `location`\n\nFor convenience, these trigger types are provided as constants in `DetoxConstants`:\n\n```js\nconst DetoxConstants = require('detox/index').DetoxConstants;\n\nconst userNotification = {\n  \"trigger\": {\n    \"type\": DetoxConstants.userNotificationTriggers.push\n  },\n  // ...\n}\n```\n\n#### Date Components (iOS-only)\n\n| Key              | Required | Value Type | Description                                           |\n| ---------------- | -------- | ---------- | ----------------------------------------------------- |\n| `era`            | No       | Integer    | The number of era units for the receiver.             |\n| `year`           | No       | Integer    | The number of year units for the receiver.            |\n| `month`          | No       | Integer    | The number of month units for the receiver.           |\n| `day`            | No       | Integer    | The number of day units for the receiver.             |\n| `hour`           | No       | Integer    | The number of hour units for the receiver.            |\n| `minute`         | No       | Integer    | The number of minute units for the receiver.          |\n| `second`         | No       | Integer    | The number of second units for the receiver.          |\n| `weekday`        | No       | Integer    | The number of the weekday unit for the receiver.      |\n| `weekdayOrdinal` | No       | Integer    | The ordinal number of weekday units for the receiver. |\n| `quarter`        | No       | Integer    | The number of quarters for the receiver.              |\n| `weekOfMonth`    | No       | Integer    | The week number of the month for the receiver.        |\n| `leapMonth`      | No       | Boolean    | Indicates whether the month is a leap month.          |\n\n#### Region (iOS-only)\n\n| Key             | Required | Value Type | Description                                                                                                                                                             |\n| --------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `center`        | Yes      | Object     | The center point of the geographic area. See the [Coordinate section](https://github.com/wix/detox/wiki/User-Notifications-JSON-Format-Documentation#coordinate) below. |\n| `radius`        | Yes      | Number     | The radius (measured in meters) that defines the geographic area’s outer boundary.                                                                                      |\n| `notifyOnEntry` | No       | Boolean    | Indicates that notifications are generated upon entry into the region.                                                                                                  |\n| `notifyOnExit`  | No       | Boolean    | Indicates that notifications are generated upon exit from the region.                                                                                                   |\n\n#### Coordinate (iOS-only)\n\n| Key         | Required | Value Type | Description                                                                                                                                                                       |\n| ----------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `latitude`  | Yes      | Number     | The latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator.                                        |\n| `longitude` | Yes      | Number     | The longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian. |\n\n#### Payload\n\nOn Android, the content will be available via the activity’s [`getIntent()`](https://developer.android.com/reference/android/app/Activity#getIntent\\(\\)) API, inside the intent’s _extra_ bundle. Under some limitations, that includes data-cascading so as to provide comprehensive support for JavaScript’s advanced object-hierarchy capabilities as much as possible. As an example, consider this payload:\n\n```js\nconst userNotification = {\n  payload: {\n    userData: 'userDataValue',\n    userDataNum: 111.2,\n    userDataFlag: true,\n    userDataArray: ['rock', 'paper', 'scissors'],\n    userDataObj: {\n      cascadedKey: 'cascadedValue'\n    },\n  },\n};\n```\n\nThe outcome on the native side will be such that all of these conditions evaluate to _true_:\n\n```java\nactivity.getIntent().getStringExtra(\"userData\") == \"userDataValue\";\nactivity.getIntent().getDoubleExtra(\"userDataNum\") == 111.2;\nactivity.getIntent().getBooleanExtra(\"userDataFlag\") == true;\nactivity.getIntent().getStringArrayExtra(\"userDataArray\")[0] == \"rock\";\nactivity.getIntent().getBundleExtra(\"userDataObj\").getString(\"cascadedKey\") == \"cascadedValue\";\n```\n\n##### Handling at Runtime\n\nNote that on Android, data delivered through an intent at runtime, is typically received in your activity’s [`onNewIntent`](https://developer.android.com/reference/android/app/Activity#onNewIntent\\(android.content.Intent\\)) callback. Be sure to consider what should be done in order to handle this type of a use case in your app: Namely, that `setIntent()` should be called in order for the data to be later available in your app through `getIntent()`, as explained earlier.\n\n> **This isn’t related to Detox in particular**, and is set here simply to help you consider all the use cases in your app so that tests coverage would be optimal.\n\n#### Examples\n\n1. [Calendar Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json)\n1. [Location Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json)\n1. [Time Interval Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json)\n1. [Push Trigger](https://github.com/wix/detox/blob/master/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/mocking.md",
    "content": "# Mocking\n\n:::info\n\nThis article previously focused on the older React Native versions (`<0.59`), so if you need to access it, [follow this Git history link](https://github.com/wix/Detox/blob/01ad250fe4168502a57339b8bcab0ec5a5c89e4b/docs/Guide.Mocking.md).\n\n:::\n\nMocking is an integral part of testing.\nYou may want to use mocks to alter specific behavior of your app during tests, e.g., to:\n\n- change server endpoints to point to a mock/staging server instead of the regular production server;\n- stub a feature the simulator doesn’t support;\n- prepare mock environment data such as GPS position, Contacts/Photos found on the device, etc.\n\nThis guide assumes you are testing a React Native app with Detox.\n\nPlease note that you **cannot** apply mocking techniques familiar from the prior Jest experience, even though Detox runs on top of Jest, e.g.:\n\n```js\njest.mock('./src/myModule'); // NO, THIS WON'T WORK\n```\n\nAll the mocking must be conducted with the help of [Metro bundler](https://facebook.github.io/metro), which powers React Native under the hood.\nThanks to Metro bundler, there are two modes your React Native application can run in:\n\n1. **Debug mode**. Running `npx react-native start` spawns the _Metro bundler_ on port 8081 (by default). It serves JavaScript files of your app over HTTP, expecting that the native code will request it right upon the launch on the mobile device. Thus, the native app keeps re-downloading and executing the new code every time you change the code locally.\n\n1. **Release mode**. In contrast to the debug mode, _Metro bundler_ does not need to run as a server on the side. It bundles your JavaScript code once into the native app binary file. Hence, every edit to the source code requires rebuilding the entire app binary and reinstalling it on the device before you can see the effect.\n\nThere are two ways to configure the _Metro bundler_ to use your mocks: quick (**debug mode** only) and universal.\nLet's start with the quicker way.\n\n## Quick flow\n\n1. Pick a module that you are going to mock, e.g.:\n\n   ```js file=src/config.js\n   // src/config.js\n\n   export const SERVER_URL = 'https://production.mycompany.name/api';\n   export const FETCH_TIMEOUT = 60000;\n   ```\n\n1. Create a mock module alongside, with an arbitrary extension (e.g. `.mock.js`):\n\n   ```js file=src/config.js\n   // src/config.mock.js\n\n   export * from './config.js';\n\n   // override the url from the original file:\n   export const SERVER_URL = 'http://localhost:3000/api';\n   ```\n\n1. Stop your _Metro bundler_ if it has been already running, and run it again with the corresponding file extension override, e.g.:\n\n   ```bash\n   npx react-native start --sourceExts mock.js,js,json,ts,tsx\n   ```\n\n   This command is already enough to start your application in an altered mode, and you can start running your tests. Now, if some module imports `./src/config`, you tell _Metro bundler_ to prefer `./src/config.mock.js` over the plain `./src/config.js`, which means the consumer gets the mocked implementation.\n\n> CAVEAT: whichever file extension you might take for the mock files – make sure you don’t accidentally \"pick up\" unforeseen file overrides from `node_modules/**/*.your-extension.js`!\n> _Metro bundler_ does not limit itself to your project files only – applying those `--sourceExts` also affects the resolution of the `node_modules` content!\n\n## Configuring Metro bundler\n\nWhile the mentioned way is good enough for the **debug mode**, it falls short for the **release builds**. The problem is that the `--sourceExts` argument is supported only by `react-native start` command. Hence, you’d need a CLI-independent way to configure your Metro bundler, and that is patching your project's `metro.config.js`:\n\n```diff title=\"metro.config.js\"\n /**\n  * Metro configuration for React Native\n  * https://github.com/facebook/react-native\n  *\n  * @format\n  */\n+const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;\n\n module.exports = {\n+  resolver: {\n+    sourceExts: process.env.MY_APP_MODE === 'mocked'\n+        ? ['mock.js', ...defaultSourceExts]\n+        : defaultSourceExts,\n+  },\n   transformer: {\n     getTransformOptions: async () => ({\n       transform: {\n         experimentalImportSupport: false,\n         inlineRequires: true,\n       },\n     }),\n   },\n };\n```\n\nThis way, we are enforcing a custom convention that if the Metro bundler finds the `MY_APP_MODE=mocked` environment variable, it should apply our `sourceExts` override instead of the default values.\n\nTherefore, to start the Metro bundler in the mocked mode, you would run something like:\n\n```bash\nMY_APP_MODE=mocked npx react-native start\n```\n\nThis principle stays the same for the **release mode**, although the build commands might differ depending on the platform and a specific script:\n\n```bash\nexport MY_APP_MODE=mocked\n# from now on, even an implicit run of Metro bundler will use our override\n\n# via React Native CLI\nnpx react-native run-ios --configuration Release\nnpx react-native run-android --variant=release\n\n# via native tools\nxcodebuild -workspace ... -configuration release -scheme ...\n./gradlew assembleRelease\n```\n\nPlease note that preparing React Native apps for the release mode requires groundwork for both [iOS](https://reactnative.dev/docs/publishing-to-app-store) and [Android](https://reactnative.dev/docs/signed-apk-android), which is out of scope of this current article.\n\nAs you might have noticed, this tutorial has no direct connection to Detox itself, which is a correct observation.\nThe suggested mocking techniques are a part of the React Native world itself, so please consult the further resources:\n\n- <https://facebook.github.io/metro/>\n- <https://github.com/react-native-community/cli/blob/master/docs/commands.md>\n\nHappy Detoxing!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/parallel-test-execution.md",
    "content": "# Parallel Test Execution\n\nDetox comes out of the box with multi-worker support thanks to ([Jest's feature](http://jestjs.io/docs/en/cli#maxworkers-num),  etc.).\n\nBy default `detox test` will run the test runner with one worker. Worker count can be controlled by forwarding `--maxWorkers <N>` to Jest via [`detox test`](../cli/test.md).\n\n## Device Creation\n\nWhile running with multiple workers, Detox might not have an available simulator for every worker.\nIf no simulator is available for that worker, the worker will create one with the name `{name}-Detox`.\n\n## Lock File\n\nSince any attached device can potentially be used simultaneously by multiple workers, Detox needs to maintain a lock file to make sure that doesn't happen.\nTherefore, Detox maintains `device.registry.json`, a file with exclusive access based on `proper-lockfile`, controlled by Detox, that registers all simulators and emulators\ncurrently in use by Detox instances.\n\nThe lock file location is determined by the OS, and [defined here](https://github.com/wix/detox/blob/master/detox/src/utils/appdatapath.js).\n\n- **MacOS**: `~/Library/Detox/device.registry.json`\n- **Linux**: `~/.local/share/Detox/device.registry.json`\n- **Windows**: `%LOCALAPPDATA%/data/Detox/device.registry.json` or `%USERPROFILE%/Application Data/Detox/device.registry.json`\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/proguard-configuration.md",
    "content": "# ProGuard configuration\n\n:::tip\n\nYou can skip this guide if you are working solely with debug builds (`android.emu.debug`, etc.),\nbut as soon as you move to the **release builds**, where the native code gets minified and obfuscated,\nyou are going to have problems with Detox if you leave your ProGuard rules not configured.\n\n:::\n\nSince Detox relies on [Android Reflection API] to integrate with React Native on Android, you should keep [ProGuard minification] under tight control.\nOtherwise, you’ll be seeing Detox crashing or hanging up infinitely upon an attempt to run tests with your app built in **release mode**.\n\nTo fix that, you’d need to return to your app build script:\n\n```diff title=\"app/build.gradle\"\n     buildTypes {\n     …\n// highlight-next-line\n         release { /* (1) */\n             minifyEnabled true\n\n// highlight-next-line\n   /* (2) */ proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n// highlight-next-line\n+  /* (3) */ proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n         }\n     }\n```\n\n1. `release` build type is typically the one to have ProGuard enabled.\n1. ProGuard files present by default in React Native projects. Check out [Android docs][ProGuard minification] to get to know more.\n1. Detox-specific [exclude list](https://github.com/wix/Detox/blob/master/detox/android/detox/proguard-rules.pro) for ProGuard.\n\n:::info\n\nIn order for Detox to be able to work properly, in `proguard-rules-app.pro`, it effectively declares rules that retain most of React-Native’s code (i.e. keep it unminified, unobfuscated) in your **production** APK.\n\n:::\n\n## Obfuscation\n\nExempting source files from the obfuscation means that their contents might be restored by unauthorized people,\nbut this should not be an issue for you, because React Native is an open-source project per se.\n\nIf it nevertheless bothers you, there are workarounds such as defining multiple build flavors: one for running\nend-to-end tests with Detox, and the other one for publishing to the marketplaces:\n\n```gradle title=\"app/build.gradle\"\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n\n            signingConfig signingConfigs.release\n        }\n// highlight-start\n        releaseE2E {\n            initWith release\n            setMatchingFallbacks('release')\n\n            proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n        }\n    }\n// highlight-end\n```\n\nAs can be seen above, we use `initWith` and `setMatchingFallbacks` to extend the new `releaseE2E` build type from\nthe existing one, and then we add an override to it, i.e. `proguardFile`.\n\nFollowing the example, you would then have to adjust your `build` and `binaryPath` properties accordingly:\n\n```diff\n{\n  apps: {\n     'android.release': {\n       type: 'android.apk',\n-      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n+      binaryPath: 'android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk',\n-      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release'\n+      build: 'cd android && ./gradlew assembleReleaseE2E assembleAndroidTest -DtestBuildType=release'\n     },`\n```\n\n:::note\n\nIf your app already contains flavors – that makes things a bit trickier, but the approach can generally be adjusted to support that as well.\n\n:::\n\n**Last but not least:** If you’re having issue with Detox' ProGuard rules, please report them [here](https://github.com/wix/Detox/issues/new/choose).\n\nA special thanks to [@GEllickson-Hover](https://github.com/GEllickson-Hover) for reporting issues related to obfuscation in [#2431](https://github.com/wix/Detox/issues/2431).\n\n[Android Reflection API]: https://developer.android.com/reference/java/lang/reflect/package-summary\n\n[ProGuard minification]: https://developer.android.com/studio/build/shrink-code\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/taking-screenshots.md",
    "content": "# Taking Screenshots\n\nDetox supports taking in-test screenshots of the device, making the result immediately available in the form of an image file.\n\nScreenshots can be taken in two levels:\n\n- **Device-level:** taking a screenshot of the entire screen.\n- **Element-level:** taking a screenshot of a specific element (and the view-hierarchy associated with it), currently appearing on the screen.\n\nIn both cases, the concept is mainly useful for verifying the proper visual structure and layout of elements appearing on the device’s screen, in the form of a snapshot-test. Namely, by following these conceptual steps:\n\n1. Taking a screenshot, once, and manually verifying it, visually.\n1. Storing it as an E2E test asset (i.e. the _snapshot_).\n1. Using it as the point-of-reference for comparison against screenshots taken in consequent tests, from that point on.\n\n```js\nconst fs = require('fs');\n\ndescribe('Members area', () => {\n  const snapshottedImagePath = './e2e/assets/snapshotted-image.png';\n\n  it('should greet the member with an announcement', async () => {\n    const imagePath = (take screenshot from the device); // Discussed below\n    expectBitmapsToBeEqual(imagePath, snapshottedImagePath);\n  });\n});\n\nfunction expectBitmapsToBeEqual(imagePath, expectedImagePath) {\n  const bitmapBuffer = fs.readFileSync(imagePath);\n  const expectedBitmapBuffer = fs.readFileSync(expectedImagePath);\n  if (!bitmapBuffer.equals(expectedBitmapBuffer)) {\n    throw new Error(`Expected image at ${imagePath} to be equal to image at ${expectedImagePath}, but it was different!`);\n  }\n}\n```\n\n**Important:** The recommended, more practical way of doing this, is by utilizing more advanced 3rd-party image snapshotting & comparison tools such as [Applitools](https://applitools.com).\n\n## Device-level Screenshots\n\nTaking a screenshot of the entire screen can be done using a device-level API:\n\n```js\nconst imagePath = await device.takeScreenshot('opened general section');\n```\n\nThe API immediately returns the path of a temporary, readable image file where the screenshot is stored, all-the-while scheduling the transferring of it to the [artifacts folder](../config/artifacts.mdx#enabling-artifacts) upon completion of the currently running test.\n\n**Returns:**\n\nThe path of a temporary file containing the resulted `.png` image.\n\nImportant: The returned path is guaranteed to be valid only during the test execution. Later on, the screenshot will be moved to the artifacts' folder, and will not be available.\n\n**Parameters:**\n\n`name (optional)` - Name of the final image-file to store as the artifact. For example, setting `name` to `opened general section` would result in an artifact file named `opened general section.png`. In case the name isn’t provided, Detox would self-generate a random, distinct name, instead (though not a very descriptive one).\n\n### Artifacts Management\n\nMeans of creation of the final image as an artifact is tightly connected to the `--take-screenshots` argument to Detox CLI:\n\n- If `--take-screenshots none` is set, the screenshot will be taken, but it won’t be saved to `<artifacts-location>` after the test ends.\n- If `--take-screenshots failing` is set, and the test passes, the screenshot won’t be saved to `<artifacts-location>` after the test ends.\n- In the other modes (`manual` and `all`), if the test passes, the screenshot will be put to `<artifacts-location>/✓ Members area should greet the member with an announcement/opened general section.png`.\n- In the other modes (`manual` and `all`), if the test fails, the screenshot will be put to `<artifacts-location>/✗ Members area should greet the member with an announcement/opened general section.png`.\n\n### Caveats\n\nThis API well-captures all elements, although alongside surrounding \"visual noise\" such as the navigation bar, as can be seen in the image below:\n\n![device-screenshot](../img/device-screenshot.png)\n\nAs the image includes, for example, the current time (in the top-left corner), running the test in any _different_ time would unnecessarily result in an utter comparison failure, making the test downright useless. Fortunately, this can be resolved, by putting the device into \"demo mode\" (i.e. freezing the irrelevant, volatile elements) . For example (credits - [Miki](https://github.com/M-i-k-e-l)):\n\n```js\nasync function setDemoMode() {\n  if (device.getPlatform() === 'ios') {\n    execSync(\n      'xcrun simctl status_bar \"iPhone 11\" override --time \"12:00\" --batteryState charged --batteryLevel 100 --wifiBars 3 --cellularMode active --cellularBars 4'\n    );\n  } else {\n    // enter demo mode\n    execSync('adb shell settings put global sysui_demo_allowed 1');\n    // display time 12:00\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200');\n    // Display full mobile data with 4g type and no wifi\n    execSync(\n      'adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype 4g -e wifi false'\n    );\n    // Hide notifications\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false');\n    // Show full battery but not in charging state\n    execSync('adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100');\n  }\n}\n```\n\n> Note: This script implicitly assumes only one device is used, as device ID isn’t specified anywhere (e.g. with `adb -s <id>`).\n\n## Element-level Screenshots\n\nTaking a screenshot of a specific element can be simply done using an API similar to other element-interaction Detox APIs:\n\n```js\nconst imagePath = await element(by.id('announcementsRoot')).takeScreenshot('welcome announcement');\n```\n\n> The API works in the exact same way as `device.takeScreenshot()` does in terms of return value, arguments, and artifacts management.\n\nIn this example, the image-file specified by `imagePath` will hold the visual content of a native view whose test ID is `announcementsRoot`, alongside all of the views in the view-hierarchy formed by it as the root-view. Visually, this can be, for example:\n\n![Announcements view](../img/element-screenshot-view.png)\n\nMeaning, assuming `announcementsRoot` has been specified over some ancestor view which has both the `Announcement` title _and_ the card as its direct or indirect children, the result would include both. That, in turns, also includes the card’s children, such as the avatar, welcome text, etc.\n\n### Caveats of this approach\n\nFocusing on specific elements, this approach is key to more stable comparisons, and hence more stable tests, over time. However, inspecting less content evidently means protecting against less bugs. For example, In a screen where the element in question is partly obstructed by other elements drawn on the screen, the image created by `takeScreenshot()` will successfully hold all of it’s content, nonetheless.\n\nConsider this situation in one of the app’s screens, where the upcoming schedule overlaps the top-hand announcement card:\n\n![overlap](../img/element-screenshot-overlap.png)\n\nTaking an element-screenshot of the announcement part alone, would yield a proper result, leaving this bug overlooked:\n\n![announcement element](../img/element-screenshot-view.png)\n\nOnly by taking the element-screenshot of a common ancestor, will this bug be surfaced. However, in turn, that can affect stability, as the result is now sensitive to more details such as padding and background color.\n\n**As a bottom line, this API is mostly suited for testing UI components rather than complete screens.**\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/test-id.md",
    "content": "# Adding test ID's to your components\n\n:::info Note\n\nThis guide was written primarily for React Native apps, but it can be generalized for testing any app, including native apps.\n\n:::\n\nWhile [view-element matching](../api/matchers.md) can be done in numerous ways, it is always the best idea to match based on something unique and decoupled, as it ensures that the test code is clear, stable and sustainable over time.\n\nWe recommend assigning unique test ID's to the elements you're aiming to interact with in your tests, and preferring matching based on those rather than on anything else. Test ID's are the least likely to change over time (compared with raw text, for example), and are locale-agnostic. Furthermore, utilizing unique test ID's across the app not only simplifies the identification and interaction with specific elements but also enhances code navigability, making it easier to locate elements when traversing the codebase.\n\nIn React Native applications, `View` components have a dedicated [test ID property](https://reactnative.dev/docs/view#testid) that can be utilized:\n\n```jsx\n<View>\n  <TouchableOpacity testID=\"Onboarding.Next_button\">\n    <Text>Next</Text>\n  </TouchableOpacity>\n</View>\n```\n\nFor native apps, test ID's can be assigned by setting a value for the following properties:\n\n- **iOS:** [`accessibilityIdentifier`](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier)\n- **Android:** Default [viewTag](https://developer.android.com/reference/android/view/View#tags)\n\n## Pass testID to your native components\n\nPassing a `testID` to your custom component props has no effect until you forward it down to a native component like `<View />` or `<TouchableOpacity />`\nthat implements rendering it as an accessibility identifier in the native component hierarchy:\n\n![Pass testID to native component](../img/test-id/passTestID.png)\n\nFor example, you have `<YourCustomComponent />` and you pass a `testID` to it:\n\n```jsx title=\"YourScreen.jsx\"\nfunction YourScreen() {\n  return (\n    <YourCustomComponent testID=\"YourCustomComponent\" />\n  );\n}\n```\n\nMake sure that your implementation passes `testID` to some React Native component that supports it:\n\n```jsx title=\"YourCustomComponent.jsx\"\nfunction YourCustomComponent(props) {\n  return (\n// highlight-next-line\n    <View testID={props.testID}>\n      <Text>Some text</Text>\n    </View>\n  );\n}\n```\n\n### Child elements\n\nIf your component has several useful child elements, it is even a better idea to assign them some derived test IDs, e.g.:\n\n```jsx title=\"YourCustomComponent.jsx\"\nfunction YourCustomComponent(props) {\n  return (\n// highlight-next-line\n    <View testID={props.testID}>\n      <Text testID={`${props.testID}.label`}>Some text</Text>\n    </View>\n  );\n}\n```\n\nThat way, you could refer to specific elements in Detox tests via the most basic and least ambiguous `by.id` matchers, e.g.:\n\n```js\nexpect(element(by.id('YourCustomComponent'))).toBeVisible();\nexpect(element(by.id('YourCustomComponent.label'))).toHaveText('Some text');\n```\n\n### Repetitive components\n\nIt is highly not recommended to use non-unique `testID`, e.g. when your components get rendered in any sort of repeater or virtualized list:\n\n```jsx title=\"YourScreen.jsx\"\nconst ITEMS = [\n  { title: 'First Item' },\n  { title: 'Second Item' },\n  { title: 'Third Item' },\n];\n\nfunction YourScreen() {\n  const renderItem = ({ item }) => (\n// highlight-next-line\n    <YourCustomComponent testID={'listItem'} label={item.title} />\n  );\n\n  return (\n      <FlatList\n        data={ITEMS}\n        renderItem={renderItem}\n      />\n  );\n}\n```\n\nThis would be a violation of accessibility guidelines and unnecessary complication for your test matchers.\nYou’d also have to use extra matchers and `.atIndex` clarification:\n\n```js\nexpect(element(by.id('listItem')).atIndex(2)).toHaveText('Third Item');\n```\n\nInstead, you could generate a unique `testID` for every list item with the `index` property:\n\n```jsx\n  const renderItem = ({ item, index }) => (\n    <YourCustomComponent testID={`listItem.${index + 1}`} label={item.title} />\n  );\n```\n\nThat way, your assertion would become simpler and more deterministic:\n\n```js\nexpect(element(by.id('listItem.3'))).toHaveText('Third Item');\n```\n\n![testID for repetitive components](../img/test-id/repetitiveComponentTestID.png)\n\n## Finding your test ID\n\n:::note\n\nIncorrect or absent `testID` is a common cause for test failure.\nIf your test can't find your `testID` and you can't see it either using tools described below, that usually means you haven't passed it down to this component.\nMake sure you keep forwarding it down until it reaches a native component.\n\n:::\n\nTo make sure your `testID` is indeed rendered in your app, you can use such tools as MacOS' built-in [accessibility inspector](https://developer.apple.com/documentation/accessibility/inspecting-the-accessibility-of-screens) for iOS, and [Detox Layout-inspector](https://github.com/wix-incubator/detox-inspector) (setup required) for Android.\n\n## Test ID naming - Best practices\n\nTest ID's work best when they are unique, simple and concise. Here are our recommendations regarding what rules to follow in terms of naming.\n\n### Use a consistent naming system\n\nDecide upon a system by which test ID's are named, and stick with it.\n\n1. Use a consistent naming convention. An `ITEM_NAME_ALL_CAPS` convention and an `ItemNameUpperCamelCase` are both ok, but **don't use them either intermittently nor in conjunction:**\n\n   - `SITE_LIST_ROOT` & `SITE_LIST_ITEM_1` - :white\\_check\\_mark:\n   - `SITE_LIST_ROOT` & `SiteList_Item1` - :x:\n   - `SITE_LIST_Item1` - :x:\n1. Consistently apply notations for special items. For example:\n   - A `_ROOT` postfix for screen-root or list-root items (e.g. `SITE_LIST_ROOT`)\n   - A `_BTN` for buttons / touchable CTA elements\n1. Apply consistent prefixes as categories in order to introduce a top-level context to the test ID, distinguishing it from similar ones in various places in the app. The name of the associated screen can be useful in that sense. For example: `EDIT_PROFILE_SCREEN.DONE_BTN` is better than just `DONE_BTN` for a button that is inside a user profile editing screen. Also, things such as `NAV_TABS.`, `TOP_TABS.` and `SIDE_MENU.` can be used as good context providers.\n1. As explained in the section on passing test ID's to _child_ elements, drill down to the details of elements via a _chain of contexts_. Given the parent element-group of an element (for example, a card in a feed), use its own test ID as a prefix for the sub-items (e.g. an options \"meatballs\" / \"kebab\" CTA or an _edit_ button). For example:\n   - `SITE_LIST_ITEM1` ⇒\n     - `SITE_LIST_ITEM1.OPTIONS`\n     - `SITE_LIST_ITEM1.EDIT_BTN`\n     - `SITE_LIST_ITEM1.TITLE`\n1. In a large-scale, multi-module environment, apply a consistent module identifier as the module's test ID's prefix. For example:\n   - `AUTH.LOGIN_SCREEN.EDIT_PASSWORD` - the `AUTH.` prefix suggests that were are under the context of a module handling Authentication matters.\n\n:::tip\n\nDon't hesitate to articulate a well defined conventions manifest that all teams should adhere to.\n\n:::\n\n### Use simple names\n\nStick to simple alpha-numeric characters, and simple separators. When it comes to test ID's, there's usually no reason to use special characters or emojis.\n\nIn addition, use test ID that clearly describe the associated element, but are also concise. For example:\n\n- `SITE_LIST_ROOT` - :white\\_check\\_mark:\n- `MAIN_SITE_LIST_WRAPPER_ELEMENT` - :x:\n- `SITE_LIST@ITEM$1` - :x:\n\n### Dissociate test ID names\n\nMake sure the names you give test ID's are completely decoupled and dissociated from everything else in the system. In particular -\n\n:::warning Attention\n\nBy all means, **never utilize the element's text / label in the naming of a test ID!**\nNamely, a test ID should never use `text` or `label` props passed to a React Native component.\n\n:::\n\nThere are at least 2 reasons why this is a very important rule:\n\n1. Alternation of test ID's can lead to broken tests (test-ID based matchers become obsolete), and on-screen text can change frequently.\n1. In apps supporting multiple languages, the on-screen text is likely to be different in each language. You want the same test code to be compatible with any language set into the test device, and you therefore need it have as little awareness to it as possible. Using test ID's is the best means to keep it that way.\n\n### Examples\n\nBased on the `ALL_CAPS` convention, here is an example of a screen which test ID's illustrate the principles of this discussion:\n\n![Test ID: Naming example](../img/test-id/naming-example.png)\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/testing-webviews.md",
    "content": "# Testing WebViews\n\nIn this tutorial, we'll go over how you can test a WebView in React Native applications using Detox. We will cover how to engage with web elements in both single and multi WebView scenarios, apply matchers, and execute actions.\n\nWebViews are crucial parts in a lot of mobile applications, rendering content like web pages or PDF documents within the native environment. However, because the content inside WebViews is web content and not native, it isn't straightforward to interact with using Detox. But fear not, Detox has got you covered with its suite of Web View methods.\n\n:::note\n\nThis guide provides an overview of testing web views within React Native apps with Detox. For complete API details, refer to our [WebView API documentation][api].\n\n:::\n\n## Step 0: Setting Up Detox\n\nThe first thing you'll need is to have your Detox environment properly set up. If you need a hand with that, you can follow the set-up guide [here][setup].\n\n## Step 1: Locating the WebView\n\nDetox provides two approaches for locating the host web view and its inner elements, depending on the number of WebViews on the screen.\n\n### Single WebView Scenario\n\nThe case of a single WebView on the screen is the most common scenario, and it's the simplest to handle.\n\nDetox will automatically locate the web view for you, so you don't need to do anything special to find it.\nIn this case, you can use the [`web.element()`][webelementmatcher] function with web element matchers to reference elements inside it, see [next step][finding-inner-elements] in this guide for further details.\n\n### Multiple Web Views Scenario\n\nIn scenarios where there are multiple WebViews displayed on the screen, you will have to identify a particular WebView first.\nUse a [native matcher][native-matcher] to do this, same as you would for native elements.\n\n```javascript\nconst myWebView = web(by.id('webview_identifier'));\n```\n\nAfter locating the web view, you can then use the `myWebView.element()` method with web view matchers to locate elements within it. See [next step][finding-inner-elements] in this guide for further details.\n\n#### Using `atIndex`\n\nIt is also possible to locate the web view by applying at-index to the web view matcher in case there are multiple matching web views for the same matcher.\n\n```javascript\nconst myWebView = web(by.id('webview_identifier').atIndex(1));\n```\n\n:::note\n\n`atIndex()` API for WebView matching is currently supported for iOS only. Check our [API documentation][at-index-api] for updates.\n\n:::\n\n## Step 2: Finding Inner Elements\n\nElement matchers are used to find elements within a web view. The [Detox WebView APIs][matchers-apis] provide various matchers for locating elements within a web view (e.g. `by.web.id(id)`, `by.web.className(className)`, `by.web.tag(tag)`, `atIndex(index)` etc.).\n\nHere are examples of using some of the matchers:\n\n```javascript\n// Match by ID attribute\nconst elementByID = web.element(by.web.id('identifier'));\n\n// Match by CSS class name attribute\nconst elementByClassName = web.element(by.web.className('className'));\n\n// Match by CSS selector\nconst elementByCSSSelector = web.element(by.web.cssSelector('#cssSelector'));\n\n// Match with index in case of multiple matching elements\nconst elementAtIndex = web.element(by.web.id('identifier').atIndex(1));\n```\n\n### Bypass CORS Restrictions (iOS Only)\n\nWhen testing web views, you may encounter Cross-Origin Resource Sharing (CORS) restrictions that prevent you from interacting with elements inside the web view.\n\nAt the moment, Detox is able to bypass CORS restrictions and other browser security features only on iOS, allowing you to interact with inner elements in cases of CORS restrictions (in most cases).\n\nTo bypass CORS restrictions on iOS, you can pass the [`detoxDisableWebKitSecurity`] launch argument. This argument will disable the WebKit security features, allowing Detox to interact with the WebView in a \"Sandbox\" environment.\n\n```javascript\nawait device.launchApp({ launchArgs: { detoxDisableWebKitSecurity: true } });\n```\n\n## Step 3: Perform Actions\n\nActions allow you to interact with elements within a web view. The [Detox WebView APIs][actions-apis] provide various actions that can be invoked on inner elements.\n\nFor example, here's a simple example for filling a login form and press on login button:\n\n```javascript\n\n// Fill username and password\nawait web.element(by.web.id('username')).typeText('John Doe');\nawait web.element(by.web.id('password')).typeText('123456789');\n\n// Press the login button\nawait web.element(by.web.id('login')).tap();\n\n```\n\n### Perform Custom Actions (`runScript`)\n\nYou can also execute custom JavaScript code on the web view using the `runScript` action (see [API docs][run-script-api]).\nThis is useful for scenarios where you need to interact with the web view in a way that isn't covered by the built-in actions, for fetching data, or for triggering custom events.\n\nFor example, you can use `runScript` to get the font size of a text element:\n\n```javascript\n// Define the matcher for the inner text element\nconst textElement = web(by.id('webview_identifier')).element(by.web.id('text_element'));\n\n// Get the font size of a text element\nconst fontSize = await textElement.runScript(function get(element) {\n  return element.style.fontSize;\n});\n\n// Use jestExpect to assert the font size\njestExpect(fontSize).toBe('16px');\n```\n\n:::note\n\nUsing jest-expectations in Detox tests is possible by importing `expect` API from `jest` package and using it with a separate `jestExpect` variable (as shown in the example below).\nThis is due to the fact that Detox uses its own `expect` API, which is not compatible with jest-expectations.\n\n```javascript\nconst jestExpect = require('expect').default;\n```\n\n:::\n\n## Step 4: Assert on Expected Behaviour\n\nExpectations are assertions on the state of elements within a WebView.\n\nFor instance, to verify an element has specific text:\n\n```javascript\nawait expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n```\n\nOr to assert an element does not exist:\n\n```javascript\nawait expect(web.element(by.web.id('invalid_identifier'))).not.toExist();\n```\n\n## Full Example\n\nHere's a full example of a test that interacts with a WebView:\n\n```javascript\nit('should login successfully', async () => {\n    // Assert the welcome message is not visible before login\n    await expect(web.element(by.web.id('welcome_message'))).not.toExist();\n\n    // Fill username and password\n    await web.element(by.web.id('username')).typeText('John Doe');\n    await web.element(by.web.id('password')).typeText('123456789');\n\n    // Press the login button\n    await web.element(by.web.id('login')).tap();\n\n    // Assert the login was successful\n    await expect(web.element(by.web.id('welcome_message'))).toHaveText('Welcome, John Doe!');\n});\n```\n\n[setup]: ../introduction/environment-setup.md\n[api]: ../api/webviews.md\n[native-matcher]: ../api/matchers.md\n[content-editable]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable\n[webelementmatcher]: ../api/webviews.md#webelementmatcher\n[matchers-apis]: ../api/webviews.md#matchers\n[actions-apis]: ../api/webviews.md#actions\n[run-script-api]: ../api/webviews.md#runscriptscript-args\n[finding-inner-elements]: #step-2-finding-inner-elements\n[at-index-api]: ../api/webviews.md#webnativematcheratindexindexelementmatcher\n[`detoxDisableWebKitSecurity`]: ../api/device.md#12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/typescript.md",
    "content": "# Using TypeScript\n\n:::info\n\nThis guide assumes you are using Detox's default test runner integration with Jest.\nIf you have a custom integration, you need to consult your test runner's documentation\non how to use TypeScript with it.\n\n:::\n\nIt is very common among JavaScript developers to use TypeScript in their projects,\nso a question arises: **how to use Detox with TypeScript?** Since Detox by default\nbases on Jest, the question can be rephrased as: [how to use Jest with TypeScript?](https://jestjs.io/docs/getting-started#using-typescript).\n\nNevertheless, since many people ask about it, we decided to provide a guide on how to use Detox with TypeScript.\n\n## Prerequisites\n\n- A working Detox setup with Jest as your test runner.\n- TypeScript installed in your project.\n\nSince React Native 0.71, the default React Native project template comes with TypeScript support out of the box. However, if you have no TypeScript project, now's the time:\n\n```bash npm2yarn\nnpm install --save-dev typescript\ntsc --init\n```\n\nThe latter command will generate a default `tsconfig.json` file, so that you can modify it to suit your needs.\n\n:::tip\n\nIf you get an error like:\n\n```plain text\ncommand not found: tsc\n```\n\nYou can try to:\n\n1. `export PATH=$PATH:./node_modules/.bin` if you are using `bash` or `zsh`.\n1. `set PATH=%PATH%;./node_modules/.bin` if you are using Windows Command Prompt.\n1. run `npx tsc --init` instead of `tsc --init`.\n1. or any other solution to run an executable from `node_modules/.bin` directory.\n\n:::\n\nMake sure your TypeScript compiles without errors before proceeding:\n\n```bash\ntsc # or tsc --noEmit if you don't want to generate output files\n```\n\n## Setting up Jest with TypeScript\n\nJest requires a few extra packages to work seamlessly with TypeScript, so let's install them:\n\n```bash npm2yarn\nnpm install --save-dev ts-jest @types/jest @types/node\n```\n\nYour Jest config file at `e2e/jest.config.js` (or wherever you keep your Jest configuration) also needs a couple of tweaks:\n\n```javascript\n/** @type {import('@jest/types').Config.InitialOptions} */\nmodule.exports = {\n// highlight-next-line\n  preset: 'ts-jest', // (1)\n  rootDir: '..',\n// highlight-next-line\n  testMatch: ['<rootDir>/e2e/**/*.test.ts'], // (2)\n  testTimeout: 120000,\n  maxWorkers: 1,\n  globalSetup: 'detox/runners/jest/globalSetup',\n  globalTeardown: 'detox/runners/jest/globalTeardown',\n  reporters: ['detox/runners/jest/reporter'],\n  testEnvironment: 'detox/runners/jest/testEnvironment',\n  verbose: true,\n};\n```\n\n1. The `preset` option tells Jest to use `ts-jest` to compile TypeScript files. This is the most important part of the setup.\n1. Make sure you update your `testMatch` to include TypeScript files. Otherwise, you are likely to get an error like this:\n\n   ```plain text\n   No tests found, exiting with code 1\n   Run with `--passWithNoTests` to exit with code 0\n   In /path/to/your/project\n     60 files checked.\n     testMatch: /path/to/your/project/e2e/**/*.test.js - 0 matches\n     testPathIgnorePatterns: /node_modules/ - 60 matches\n     testRegex:  - 0 matches\n   Pattern:  - 0 matches\n   ```\n\n## Writing Detox Tests in TypeScript\n\nWith the setup ready, you can now write Detox tests in TypeScript.\nChange file extensions from `.js` to `.ts` where appropriate, and you’re good to go.\n\n```typescript\n// highlight-next-line\nimport { expect } from 'detox';\n\ndescribe('Login Screen', () => {\n it('should login with correct credentials', async () => {\n   const email: string = 'test@example.com';\n   const password: string = 'password123';\n\n   await element(by.id('emailInput')).typeText(email);\n   await element(by.id('passwordInput')).typeText(password);\n   await element(by.id('loginButton')).tap();\n\n   expect(await element(by.id('welcomeMessage'))).toBeVisible();\n });\n});\n```\n\n:::info\n\nPay attention at the highlighted line above, where we import `expect` from Detox. Unfortunately, there is [an unresolved clash](https://github.com/wix/Detox/issues/2610) between Jest's `expect` and Detox's `expect` when using TypeScript. This will be fixed in the future, but for now, you need to import Detox's `expect` explicitly in case you see errors like this:\n\n```plain text\nerror TS2339: Property 'toBeVisible' does not exist on type 'JestMatchers<IndexableNativeElement>'.\n```\n\n:::\n\n## Conclusion\n\nUsing Detox with TypeScript largely boils down to setting up Jest to understand TypeScript. With the power of static typing, your Detox tests can now become more robust, easier to understand, and less error-prone. Happy testing!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/guide/uninstalling.md",
    "content": "# Uninstalling Detox\n\nInstalling and using Detox implies certain side effects: cloned devices, cache files, state files, temporary files, etc.\n\nThis checklist might come in handy whenever you have to make a clean uninstallation after using Detox.\n\n## Detox Framework Cache\n\nEvery install of Detox also triggers a `postinstall` script in its `package.json`, which builds (or unpacks) `Detox.framework` into `~/Library/Detox`.\n\nYou can either delete the folder manually:\n\n```bash\nrm -rf ~/Library/Detox\n```\n\nor run:\n\n```bash\ndetox clean-framework-cache\n```\n\n## Test Session State\n\nOn every test run, Detox rewrites a few temporary files in `DETOX_LIBRARY_ROOT_PATH`, i.e.:\n\n1. `device.registry.json`, to tell apart the busy and the available devices for use with multiple workers.\n2. `global-context.json.lock`, to detect multiple concurrent instances of Detox.\n\nThe location of `DETOX_LIBRARY_ROOT_PATH` may vary depending on the operating system:\n\n- macOS:\n  - `~/Library/Detox`.\n- Linux:\n  - `$XDG_DATA_HOME/Detox`, if `$XDG_DATA_HOME` is defined;\n  - `~/.local/share/Detox`, otherwise.\n- Windows:\n  - `%LOCALAPPDATA%\\data\\Detox`, if `%LOCALAPPDATA%` is defined;\n  - `%USERPROFILE%\\Application Data\\Detox`, otherwise.\n\n## Cloned Simulators (macOS)\n\nTo support the \"multiple workers\" feature on iOS, Detox clones simulator instances when there aren’t enough available ones.\nThe autogenerated simulators have names with `-Detox` suffix appended, so you can easily spot them with:\n\n```bash\nxcrun simctl list | grep \"-Detox\"\n```\n\nTo delete a simulator, you can use:\n\n```bash\nxcrun simctl delete <uuid>\n```\n\n## Remnants of Artifacts\n\nForced exits may result in leaving some temporary files behind.\n\n### iOS\n\nTo ensure there are no temporary artifact files (logs, screenshots, etc.), you can run:\n\n```bash\nrm -rf $TMPDIR/*.detox.*\n```\n\nIf you wish to clean up your iOS simulators from the installed apps and other customizations, just run the erase procedure for the relevant ones:\n\n```bash\nxcrun simctl erase <uuid>\n```\n\n### Android\n\nThe advice for iOS applies to the Android virtual devices as well. To wipe user files on a specific AVD, run:\n\n```bash\nemulator -avd <your_AVD> -wipe-data\n```\n\nIf you have to clean temporary Detox files from an individual booted device, look out for files like `11159175_0.log` in `/sdcard` folder.\nYou can try deleting them using a simple wildcard like below or use your own:\n\n```bash\nadb -s <emulator-port> shell rm -rf /sdcard/*_*.*\n```\n\n## Detox CLI\n\nIf you have installed the official CLI wrapper for Detox, then make sure to uninstall it as well:\n\n```bash\nnpm uninstall detox-cli --global\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/debugging.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\nimport DebuggerAttachWebstorm from './partials/_debugging-attach-webstorm.mdx';\nimport DebuggerAttachChrome from './partials/_debugging-attach-chrome.mdx';\nimport DebuggerAttachVscode from './partials/_debugging-attach-vscode.mdx';\nimport CompilingIOS from './partials/_debugging-native-code-compliing-ios.mdx';\nimport CompilingAndroid from './partials/_debugging-native-code-compliing-android.mdx';\nimport ConfigIOS from './partials/_debugging-native-code-config-ios.mdx';\nimport ConfigAndroid from './partials/_debugging-native-code-config-android.mdx';\nimport RunIos from './partials/_debugging-native-code-run-ios.mdx';\nimport RunAndroid from './partials/_debugging-native-code-run-android.mdx';\nimport TroubleshootingAndroid from './partials/_debugging-native-code-troubleshooting-android.mdx';\n\n# How to Debug\n\nIn the Detox world, you can debug either Detox itself (i.e. run it step by step), and the tested app. This guide covers both options.\n\n## Running Detox Tests Step-by-Step\n\nDetox tests can be run step-by-step either using an IDE or by using Chrome debugger.\n\n:::tip New in Detox\n\nDetox now supports an interactive **REPL** (Read-Eval-Print Loop) mode for debugging. You can explore app state, issue commands, or pause test execution — all in real time.\n\nEnable it via `--repl` CLI argument and add `await detox.REPL()` in test code.\n\n→ [**See full guide**](../guide/detox-repl.md)\n:::\n\nStart by running Detox using the Detox CLI alongside the inspection argument (`--inspect-brk`) and the file in which the test resides. For example:\n\n```bash\ndetox test --inspect-brk -c android.emu.debug e2e/starter.test.js\n```\n\nYou will see Detox starts and these logs:\n\n```plain text\nDebugger listening on ws://127.0.0.1:9229/3dedd03b-8896-4ab8-a0a8-1b647abb9c98\nFor help, see: https://nodejs.org/en/docs/inspector\n```\n\nNow you can attach to Detox and tap-in into its execution process.\n\n:::info\n\nTo learn more about debugging with `--inspect-brk`, refer to [Debugging — Getting Started](https://nodejs.org/en/docs/guides/debugging-getting-started/) on the official Node.js website.\n\n:::\n\n<Tabs groupId=\"debuggerAttach\">\n  <TabItem value=\"Webstorm\" label=\"Webstorm\" default>\n    <DebuggerAttachWebstorm />\n  </TabItem>\n  <TabItem value=\"vs-code\" label=\"vs-code\">\n    <DebuggerAttachVscode />\n  </TabItem>\n  <TabItem value=\"Chrome\" label=\"Chrome\">\n    <DebuggerAttachChrome />\n  </TabItem>\n</Tabs>\n\n\n\n## Debugging JavaScript application code\n\nUse debug configurations of your app that rely on React Native Packager running on port 8081 (or another):\n\n* `ios.sim.debug`\n* `android.emu.debug`\n\nFor the rest of details, please refer to [React Native – Debugging](https://reactnative.dev/docs/debugging).\n\n## Debugging Native application code\n\n### Setting Detox up as a compiling dependency\n\n:::info Note\n\nThis step is optional. It is intended for investigating weird crashes or when contributing to Detox itself.\n\n:::\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\" default>\n    <CompilingIOS />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <CompilingAndroid />\n  </TabItem>\n</Tabs>\n\n### Add a \"manual\" configuration to your Detox config\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\" default>\n    <ConfigIOS />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <ConfigAndroid />\n  </TabItem>\n</Tabs>\n\nWhile the `behavior` section is a **mandatory** thing to include, there are a few more optional\nparameters to disable various side effects and make life easier when debugging:\n\n```diff\n {\n   …\n   \"configurations\": {\n     \"<your configuration>\": {\n       …\n       \"behavior\": {\n         \"launchApp\": \"manual\"\n       },\n+      \"session\": {\n+        \"autoStart\": true,\n+        \"debugSynchronization\": 0,\n+        \"server\": \"ws://localhost:8099\",\n+        \"sessionId\": \"test\"\n+      },\n+      \"testRunner\": {\n+        \"args\": {\n+          \"testTimeout\": 999999\n+        }\n+      }\n+      \"artifacts\": false\n     },\n   }\n }\n```\n\n- Using a preconfigured `session` with an auto-starting server removes the legwork of copying and\npasting values to the instrumentation runner launch arguments dialog every time before any launch\nfrom the IDE. Otherwise, by default when the `session` object omitted, `server` and `sessionId`\nare randomly generated for every new test session.\n\n- The `debugSynchronization: 0` override matters only if you have a global `session` config\nwith `debugSynchronization` set to a positive integer value. Otherwise, it is not needed. The point\nis to disable regular app polling requests during debugging, since that only can hinder the debugging.\n\n- If you are using Jest as a test runner, you might want to prolong the test timeout via forwarding\n`--testTimeout 999999` to it.\n\n- Setting `artifacts: false` override also matters only if you have a global `artifacts` config.\nThe motivation is to disable irrelevant taxing activities on the device such as capturing logs\nscreenshots, videos and so on. If your investigation addresses a specific artifact plugin glitch\non the native side, then just disable all the non-relevant plugins. See\n[Configuration > Artifacts](../config/artifacts.mdx) document for the reference.\n\n### Run a specific test\n\nUsually, you would want to focus on a specific test suite to save time, e.g.:\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <CodeBlock language=\"sh\">\n      detox test -c ios.manual e2e/someSuite.test.js\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <CodeBlock language=\"sh\">\n      detox test -c android.manual e2e/someSuite.test.js\n    </CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::caution\n\nDon't use multiple workers, e.g. `-w, --maxWorkers` for Jest, if you set `session.sessionId` to a constant value.\n\n:::\n\nAfterwards, you should see your test suite starting as usual until it reaches the app launch, where\nDetox stops instead and prompts you to launch the app from the IDE:\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <RunIos />\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <RunAndroid />\n  </TabItem>\n</Tabs>\n\n### Troubleshooting\n\n<Tabs groupId=\"mobileOs\">\n  <TabItem value=\"iOS\" label=\"iOS\">\n    <>There are no known issues at the moment. Check out <b>Android</b> tab if you need some.</>\n  </TabItem>\n  <TabItem value=\"Android\" label=\"Android\">\n    <TroubleshootingAndroid />\n  </TabItem>\n</Tabs>\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/environment-setup.md",
    "content": "# Environment Setup\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport IntroRN from './partials/_getting-started-rn.md';\nimport IntroExpo from './partials/_getting-started-expo.md';\nimport IntroOther from './partials/_getting-started-other.mdx';\n\nThe _Introduction section_ walks you through setting up Detox in your project, one step at a time.\n\nYou will find that some steps are longer than the others: some are a couple of paragraphs, while the others look like a dedicated multistep guide.\nBear with us - it is all necessary, and once set up, it is easy to move forward with writing tests at a high pace.\n\nPlease select type of your mobile application before you start the tutorial:\n\n<Tabs groupId=\"appType\">\n    <TabItem value=\"start-rn\" label=\"React Native\" default>\n        <IntroRN />\n    </TabItem>\n    <TabItem value=\"start-expo\" label=\"Expo\">\n        <IntroExpo />\n    </TabItem>\n    <TabItem value=\"start-other\" label=\"Other\">\n        <IntroOther />\n    </TabItem>\n</Tabs>\n\n## React Native CLI Quickstart\n\nYour first step would be to complete the\n[📚 React Native CLI Quickstart Guide](https://reactnative.dev/docs/next/environment-setup) for iOS/Android/both (depending\non your use case).\n\n:::info Note\n\nMind that for Android, we have an equivalent [environment setup guide](../guide/android-dev-env.md), which is a bit different,\nbut more comprehensive. Use your judgement and take what's most suitable for your environment from both guides. For\nexample, there is more than one way to install the right Java Development Kit.\n\n:::\n\n![RN Env](../img/rn-env.png)\n\n<p>\n    Open the link above and switch there to <b>React Native CLI Quickstart</b> tab to see\n    the interactive tutorial for <b>Development OS</b> and <b>Target OS</b> of your choice.\n</p>\n\n<p>\n    Follow all\n    the steps <span style={{color: 'red'}}>(yes, even if you have a native app!)</span> and\n    make sure you can create and run React Native apps on virtual testing devices.\n</p>\n\n![RN Env Done](../img/rn-env-done.png)\n\n## Detox Prerequisites\n\nTo complete the environment setup, you still have 2 steps ahead: installing `detox-cli` and `applesimutils`.\n\n### 1. Command Line Tools (`detox-cli`)\n\n`detox-cli` is merely a script that passes commands through to\na local Detox executable located at `node_modules/.bin/detox`,\nmaking it easier to operate Detox from the command line, e.g. `detox test -c ios.sim.debug`.\n\nIt should be installed globally, enabling usage of the command line tools outside your npm scripts:\n\n```bash\nnpm install detox-cli --global\n```\n\nOn the other hand, if you are fine with running Detox commands with `npx detox ...`, you may skip installing `detox-cli`.\n\n### 2. [MacOS Only] `applesimutils`\n\nThis tool is **required** by Detox to work with iOS simulators. The recommended way to install\n[`applesimutils`](https://github.com/wix/AppleSimulatorUtils) is via [Homebrew](https://brew.sh):\n\n```bash\nbrew tap wix/brew\nbrew install applesimutils\n```\n\n:::info Note\n\nMake sure to periodically update your version of `applesimutils` to the latest version.\n\n:::\n\nNow, when your environment is ready, let's move to the next section, [Project Setup](project-setup.mdx).\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/getting-started.mdx",
    "content": "# Getting Started\n\n## Before You Start\n\n### Overview of Detox\n\nDetox is an open-source end-to-end (E2E) testing framework for React Native mobile applications.\nOur main goal is to enable the testing of any end-to-end flow in the app, with maximum velocity and zero flakiness.\nDetox tests your mobile app while it's running on a real device or simulator, simulating a real user's interactions.\n\n![Detox overview](../img/Detox.gif)\n\n### What Does a Detox Test Look Like?\n\nThis is a test for a login screen, it runs on a device or simulator like an actual user:\n\n```js\ndescribe('Login flow', () => {\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should login successfully', async () => {\n    await element(by.id('email')).typeText('john@example.com');\n    await element(by.id('password')).typeText('123456');\n\n    const loginButton = element(by.text('Login'));\n    await loginButton.tap();\n\n    await expect(loginButton).not.toExist();\n    await expect(element(by.label('Welcome'))).toBeVisible();\n  });\n});\n```\n\n### Gray box testing\n\nOne of the most challenging aspects of automated testing on mobile is end-to-end testing.\nUI testing frameworks are often not fully-deterministic, since they are built with a \"black box\" approach, where the test runner has no access to the internals of the app under test, and is unaware of asynchronous operations that take place in the app (such as network requests, animations, etc.).\nThis makes it difficult to write reliable E2E tests, and often leads to flaky tests that are hard to debug and maintain.\n\nTo address this issue, Detox adopts a \"gray box\" testing approach, by having access to the internals of the app under test.\nThis allows for more control and predictability in the testing process. For more information, you can read [how Detox works].\n\n## Start with Detox\n\n### Follow the Setup Guides\n\nThe following guides in this Introduction section will help you get started with Detox, one step at a time, from setting up your environment to writing and running your first test.\n\n### Join the Community 🤝\n\nAs an open-source project, Detox encourages and welcomes contributions from the community.\nWhether you're a developer, tester, or just someone who is passionate about making mobile development better, there's a place for you in the Detox community.\nBy contributing to Detox, you'll be helping to improve the reliability and user experience of mobile apps, and you'll be part of a team that is dedicated to making mobile development faster and more efficient.\nWe welcome all types of contributions, from code and documentation, to bug reports, questions and feature requests.\n\nSo, if you're interested to be part of the community, we encourage you to get involved by reading our [contributing guidelines], and join our [Discord server].\nWe also have a [Twitter account] where we share updates about the project.\n\n\n[how Detox works]: ../articles/how-detox-works.md\n[contributing guidelines]: contributing.md\n[Discord server]: https://discord.gg/CkD5QKheF5\n[Twitter account]: https://twitter.com/detoxe2e\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-attach-chrome.mdx",
    "content": "Edit your test file. Mark the test you wish to debug as `it.only`, and then add a `debugger` statement\ninside your test to mark a starting point, e.g.:\n\n```diff title=\"e2e/starter.test.js\"\n describe('Example', () => {\n   beforeAll(async () => {\n     await device.launchApp();\n   });\n   \n-   it('should debug nicely :-)', async () => {\n+   it.only('should debug nicely :-)', async () => {\n     await element(by.text('Filter')).tap();\n+     debugger;\n\n   });\n```\n\nOpen `Google Chrome` and go to `chrome://inspect` tab, where you'll see `./node_modules/.bin/jest` as a remote\ntarget waiting until you click `inspect` to attach to it.\n\n![](../../img/inspect-brk.png)\n\nHappy debugging!"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-attach-vscode.mdx",
    "content": "Coming soon!"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-attach-webstorm.mdx",
    "content": "Open your app project (where there tests are, among other things) on Webstorm.\n\n#### Set up a breakpoint\n\nOpen the file where the test you wish to run is. Mark it as `it.only`, and set up a breakpoint in a line that suites your needs (note: This can actually be inside a helper function or a test-driver's function):\n\n![Webstorm breakpoint](../../img/webstorm/breakpoint.png)\n\n#### Create & Run a debug configuration\n\nGo to Webstorm's [`Edit Configurations`](https://www.jetbrains.com/help/webstorm/run-debug-configuration.html).\n\nTap the `+` button and select the Node.js option:\n\n![Webstorm edit configurations](../../img/webstorm/new-configuration.png)\n\nCreate a new debugging configuration using the default arguments (port 9229, etc.):\n\n![Webstorm node debugging configuration](../../img/webstorm/node-debug-configuration.png)\n\nAttach to Detox by \"debugging\" the new configuration (start it using the beetle button).\n\n![Webstorm start debug configuration](../../img/webstorm/run-debug-configuration.png)\n\nLet Detox run until stopped at the break-point:\n\n![Webstorm stopped at breakpoint](../../img/webstorm/stopped-at-breakpoint.png)\n\nRun step-by-step using Webstorm's debugging actions (step-over, step-into, etc.)\n\nHappy debugging!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-compliing-android.mdx",
    "content": "1. Add in your Android project settings:\n\n    ```diff title=\"android/settings.gradle\"\n    +include ':detox'\n    +project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')\n    ```\n\n1. In your _root_ build script register `google()` as a repository lookup point in all projects:\n\n    ```diff title=\"android/build.gradle\"\n     allprojects {\n         repositories {\n             // ...\n    +        google()\n         }\n     }\n    ```\n\n    If `allprojects` section doesn't exist, then add it.\n\n1. In your app’s build script, add to `dependencies` section:\n\n    ```diff title=\"android/app/build.gradle\"\n     dependencies {\n         // ...\n    -    androidTestImplementation('com.wix:detox:+')\n    +    androidTestImplementation(project(path: \":detox\"))\n     }\n    ```\n\n1. Stay in that file, just scroll down and add to the `defaultConfig` subsection:\n\n    ```diff title=\"android/app/build.gradle\"\n     android {\n       // ...\n\n       defaultConfig {\n           // ...\n    +      testBuildType System.getProperty('testBuildType', 'debug')  // This will later be used to control the test apk build type\n    +      testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n    +      missingDimensionStrategy 'detox', 'full'\n       }\n     }\n    ```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-compliing-ios.mdx",
    "content": "1. Go to `node_modules/detox` and extract `Detox-ios-src.tbz`\n\n    ![extracted detox-ios-src directory](../../img/xcode/extracted-ios-src.png)\n\n1. Drag `Detox-ios-src/Detox.xcodeproj` into your Xcode project\n\n    ![Detox inside Xcode project](../../img/xcode/drag-src-to-project.png)\n\n1. Go to your project settings → **General** and add **Detox.framework** to **Frameworks, Libraries, and Embedded Content** (make sure **Embed & Sign** is selected under **Embed**)\n\n    ![embed Detox](../../img/xcode/embed-detox-project.png)\n\n:::caution\n\nApps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove **Detox.framework** from your project.\n\n:::\n\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-config-android.mdx",
    "content": "```json\n{\n  \"devices\": {\n    \"emulator\": {\n      \"type\": \"android.emulator\",\n      \"device\": {\n        \"avdName\": \"<e.g., Pixel_API_28>\"\n      }\n    }\n  },\n  \"apps\": {\n    \"android.debug\": {\n      \"type\": \"android.apk\",\n      \"binaryPath\": \"<path to your app binary built before>\"\n    }\n  },\n  \"configurations\": {\n// highlight-start\n    \"android.manual\": {\n      \"device\": \"emulator\",\n      \"app\": \"android.debug\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      }\n    }\n// highlight-end\n  }\n}\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-config-ios.mdx",
    "content": "```json\n{\n  \"devices\": {\n    \"simulator\": {\n      \"type\": \"ios.simulator\",\n      \"device\": {\n        \"type\": \"<e.g., iPhone 12 Pro>\"\n      }\n    }\n  },\n  \"apps\": {\n    \"ios.debug\": {\n      \"type\": \"ios.app\",\n      \"binaryPath\": \"<path to your app binary built before>\"\n    }\n  },\n  \"configurations\": {\n// highlight-start\n    \"ios.manual\": {\n      \"device\": \"simulator\",\n      \"app\": \"ios.debug\",\n      \"behavior\": {\n        \"launchApp\": \"manual\"\n      }\n    }\n// highlight-end\n  }\n}\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-run-android.mdx",
    "content": "```plain text\n18:26:07.024 detox[45214] i Waiting for you to manually launch your app in Android Studio.\n\nInstrumentation class: com.wix.detox.test.test/com.example.DetoxTestAppJUnitRunner\nInstrumentation arguments:\n------------------------------------\nKey            | Value\n------------------------------------\ndetoxServer    | ws://localhost:8099\ndetoxSessionId | test\n------------------------------------\n\nPress any key to continue...\n```\n\nNow it is time to switch back to Android Studio. You’ll need to run your instrumentation runner with the said arguments,\nthis is why you should create a debug configuration of `Android Instrumented Tests` type similar to the one below:\n\n![Android Debug Configuration - Android Instrumented Tests](../../img/android-studio-debug-configuration.png)\n\nMake sure to put breakpoints at the points of interest before you start the app.\n\nAfter the app is launched, go back to the Terminal where Detox is running and press any key.\nAs a result, you are expected to see a confirmation from Detox, e.g.:\n\n```plain text\nFound the app (com.wix.detox-example) with process ID = 16854. Proceeding...\n```\n\nNow the entire test will run as usual until it sends an action to the app, which gets trapped\nin your breakpoint.\n\n![Breakpoint is active](../../img/android-happy-debugging.png)\n\nHappy debugging!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-run-ios.mdx",
    "content": "```plain text\n18:26:07.024 detox[45214] i Waiting for you to manually launch your app in Xcode.\nMake sure to pass the launch arguments listed below:\n  -detoxServer ws://localhost:8099\n  -detoxSessionId com.wix.detox-example\n\nPress any key to continue...\n```\n\nYou’ll need to run your app with the said arguments from Xcode:\n\n![Xcode - Edit Schema - Arguments tab](../../img/xcode/edit-schema-arguments.png)\n\nBefore you launch the app, make sure to [put breakpoints](https://developer.apple.com/documentation/xcode/setting-breakpoints-to-pause-your-running-app) at the points of interest, e.g.:\n\n![put a breakpoint in the native code](../../img/xcode/putting-a-breakpoint.png)\n\nLaunch the app with the debugger attached:\n\n![launching the app](../../img/xcode/launch-app-with-debugger.png)\n\nThe moment you see the app is idle, go back to the Terminal where Detox is running\nand press any key. If you wish to terminate the process for some reason, use Ctrl+C.\nIn a couple of seconds you are expected to see a confirmation from Detox, e.g.:\n\n```plain text\nFound the app (com.wix.detox-example) with process ID = 16854. Proceeding...\n```\n\nNow the entire test will run as usual until it sends an action to the app, which gets trapped\nin your breakpoint.\n\nHappy debugging!\n\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_debugging-native-code-troubleshooting-android.mdx",
    "content": "Here are some known issues you can solve on your own:\n\n1. **DetoxWSClient: Retrying... At connectToServer**\n\n    ```plain text\n    I/DetoxWSClient: At connectToServer\n    D/DetoxWSClient: Retrying...\n    ```\n\n    If you see the repeatedly printed messages like above in Android application logs, it's likely\n    that your port is not reversed. Assuming you're following the tutorial and `detoxServer` address\n    is `ws://localhost:8099` (if not – check what Detox prints you), reverse the port on your device\n    using ADB:\n\n    ```bash\n    adb reverse tcp:8099 tcp:8099\n    ```\n\n1. **Waited for the new RN-context for too long!**\n\n    ```plain text\n    Waited for the new RN-context for too long! (60 seconds)\n    If you think that’s not long enough, consider applying a custom Detox runtime-config in DetoxTest.runTests().\n    ```\n\n    If you see an error like above, you can patch Detox code to disable the timeout here:\n\n    ```diff title=\"detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt\"\n     package com.wix.detox.config\n\n     class DetoxConfig {\n         @JvmField var idlePolicyConfig: DetoxIdlePolicyConfig = DetoxIdlePolicyConfig()\n    -    @JvmField var rnContextLoadTimeoutSec = 60\n    +    @JvmField var rnContextLoadTimeoutSec = Int.MAX_VALUE\n\n         fun apply() {\n             idlePolicyConfig.apply()\n    ```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_getting-started-expo.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\n:::caution Note\n\nExpo integration with Detox is entirely a community-driven effort.\nThere is no special support for Expo projects in Detox, and we do not maintain any Expo-specific code or documentation.\n\n:::\n\nThere is a tutorial on how to set up Detox with Expo projects, which you can find on Expo official documentation site: [Running E2E tests on EAS Build]. It is a great starting point for projects that are using Expo.\n\nFor support on how to use Detox with Expo, you should contact the Expo team or the Expo community.\n\nIf you are experiencing a bug, which you believe is a Detox issue, please [open an issue] on our GitHub repository.\n\n[open an issue]: https://github.com/wix/Detox/issues\n\n[Running E2E tests on EAS Build]: https://docs.expo.dev/build-reference/e2e-tests/\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_getting-started-other.mdx",
    "content": ":::caution Note\n\nAt the moment, Detox does not support non-React Native apps on **Android** due to the blocking issues:\n\n* [Restore support for pure-native/hybrid Projects](https://github.com/wix/Detox/issues/2543)\n* [cannot be cast to com.facebook.react.ReactApplication](https://github.com/wix/Detox/issues/1220)\n* [native android app Process crashes](https://github.com/wix/Detox/issues/1093)\n\n:::\n\nHowever, native iOS apps are expected to work fine with Detox, and if that's your case, this introduction will help you in equal measure.\n\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_getting-started-rn.md",
    "content": "<!-- markdownlint-configure-file { \"first-line-h1\": 0 } -->\n\nDetox was built from the ground up to support \"classic\" React Native projects.\n\n:::info Note\n\nWhile Detox should work out of the box with any React Native version of the latest minor releases,\nthe _official_ versions compatibility is provided according to the following:\n\n- **RN `v0.77.x` - `v0.82.x`:** Fully compatible with React Native's [\"New Architecture\"](https://reactnative.dev/docs/the-new-architecture/landing-page).\n  Newer RN versions might work with Detox, but they've not been thoroughly tested by the Detox team yet.\n\nAlthough we do not officially support older React Native versions, we do our best to keep Detox compatible with them.\n\nAlso, in case of a problem with an unsupported version of React Native, please [submit an issue](https://github.com/wix/Detox/issues/new/choose) or write us in our [Discord server](https://discord.gg/CkD5QKheF5) and we will do our best to help out.\n\n:::\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-apps-android.mdx",
    "content": "<!-- markdownlint-configure-file { \"no-trailing-punctuation\": 0 } -->\n\nimport FlavorizedCodeBlock from '@site/src/components/FlavorizedCodeBlock';\n\nCheck the **build** and **binaryPath** attributes for the `android.debug` and `android.release` Detox configs:\n\n```js title=\".detoxrc.js\"\nmodule.exports = {\n  apps: {\n    'android.debug': {\n      type: 'android.apk',\n      // highlight-start\n      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk'\n      // highlight-end\n    },\n    'android.release': {\n      type: 'android.apk',\n      // highlight-start\n      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',\n      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk'\n      // highlight-end\n    },\n    // ...\n  },\n  // ...\n};\n```\n\nIf you have a typical React Native project, these values should already be sufficient and correct.\n\n#### testBinaryPath\n\nIn Android automation testing, there are in fact 2 app binaries involved:\n1. The _app_ APK, containing your app's code.\n2. The _test_ APK, containing _test_ code. That includes Detox's native code, Espresso and more.\n\nIn some projects, it might make sense for the test APK to be generated over a separate flow, through which is may end up\nbeing put it some custom,\n[non-default path](https://stackoverflow.com/questions/43670463/where-is-the-test-apk-located-in-android-project).\nOne such example is an optimization where the test APK is prebuilt once and used across multiple app variations. This is\na place where the `testBinaryPath` attribute can come to the rescue; It can be applied in order to set the custom path\nto the test APK explicitly:\n\n```js title=\".detoxrc.js\"\nmodule.exports = {\n  apps: {\n    'android.debug': {\n      type: 'android.apk',\n      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',\n      // highlight-start\n      testBinaryPath: 'custom/path/to/app-debug-androidTest.apk'\n      // highlight-end\n    },\n    'android.release': {\n      type: 'android.apk',\n      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',\n      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',\n      // highlight-start\n      testBinaryPath: 'custom/path/to/app-release-androidTest.apk'\n      // highlight-end\n    },\n    // ...\n  },\n  // ...\n};\n```\n\n:::info Note\n\nIn the common case, the `testBinaryPath` attributes is not explicitly required, simply because Detox knows\nhow to locate it in one of the default paths automatically.\n\n:::\n\n#### Product flavors\n\nOn even more advanced use cases, apps may have additional, custom [`productFlavors`](https://developer.android.com/studio/build/build-variants#product-flavors)\n(for example, `driver` and `passenger` flavors of a taxi application). In this case, you should rewrite your apps config,\nfor both **debug** and **release** configurations, according to those flavors, e.g.:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  header={'   apps: {\\n'}\n  flavors={['Driver', 'Passenger']}\n>\n  {(flavor) => `\\\n     '${flavor.toLowerCase()}.android.debug': {\n       type: 'android.apk',\n-      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',\n+      binaryPath: 'android/app/build/outputs/apk/${flavor.toLowerCase()}/debug/app-${flavor.toLowerCase()}-debug.apk',\n-      build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',\n+      build: 'cd android && ./gradlew assemble${flavor}Debug assemble${flavor}DebugAndroidTest -DtestBuildType=debug',\n     },`}\n</FlavorizedCodeBlock>\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-apps-ios.mdx",
    "content": "<!-- markdownlint-configure-file { \"no-trailing-punctuation\": 0 } -->\n\nimport FlavorizedCodeBlock from '@site/src/components/FlavorizedCodeBlock';\n\nOpen your Detox config and replace `YOUR_APP` placeholder with the actual app name, e.g.:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  title={'.detoxrc.js'}\n  header={'   apps: {\\n'}\n  flavors={['Debug', 'Release']}\n>\n  {(conf) => `\\\n     'ios.${conf.toLowerCase()}': {\n       type: 'ios.app',\n-      binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/YOUR_APP.app',\n+      binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/example.app',\n-      build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n+      build: 'xcodebuild -workspace ios/example.xcworkspace -scheme example -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n     },`}\n</FlavorizedCodeBlock>\n\n:::info\n\nIf your app uses [CocoaPods] (all modern React Native projects do since `0.60.0`), make sure\nto run `pod install` in your `ios/` folder before building with Detox.\n\nIf your project doesn't use the pods, then you won't have any `YourApp.xcworkspace` in your iOS project directory.\nYou should search instead for something like `YourApp.xcodeproj` there, and adjust your build command accordingly:\n\n<FlavorizedCodeBlock\n  language=\"diff\"\n  header={'   apps: {\\n'}\n  flavors={['Debug', 'Release']}\n>\n  {(conf) => `\\\n     'ios.${conf.toLowerCase()}': {\n       type: 'ios.app',\n       binaryPath: 'ios/build/Build/Products/${conf}-iphonesimulator/example.app',\n-      build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration ${conf} -sdk iphonesimulator -derivedDataPath ios/build'\n+      build: 'xcodebuild -project ios/example.xcodeproj -scheme example -sdk -configuration ${conf} iphonesimulator -derivedDataPath ios/build'\n     },`}\n</FlavorizedCodeBlock>\n\n:::\n\n[cocoapods]: https://cocoapods.org/\n\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-bootstrap-other.mdx",
    "content": "Create a `package.json` in your project's root by running this command:\n\n```bash\nnpm init -y\n```\n\nRemember to add the `node_modules` folder to your `.gitignore` file.\nNow you are ready to install the Detox itself. Run:\n\n```bash npm2yarn\nnpm install detox --save-dev\n```\n\nThe next step is to **install a test runner**. Out of the box, Detox offers you a first-class integration\nwith [Jest](https://jestjs.io), a popular and proven choice in the JavaScript community:\n\n```bash npm2yarn\nnpm install jest --save-dev\n```\n\nIf you are not familiar with Jest, we recommend you to read the [Jest: Getting Started](https://jestjs.io/docs/en/getting-started) guide.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-bootstrap-rn.mdx",
    "content": "Out of the box, Detox offers you a first-class integration with [Jest](https://jestjs.io), the most popular testing framework for React Native. That's why your first step will be to install or update Jest in your project.\n\nGo to your project's root folder, i.e., where `package.json` is found, and run:\n\n```bash npm2yarn\nnpm install \"jest@^29\" --save-dev\n```\n\n:::note Info\n\nThe command above will install the **latest supported Jest version**. The `@^29` override is recommended in the first place to prevent you from getting an outdated Jest version unknowingly, under the influence of package lock files. For example, in React Native boilerplate projects, the `package-lock.json` is apt to restrict `npm install jest` to installing an older, unsupported version `26.x`.\n\n:::\n\nNow it's time to install Detox itself:\n\n```bash npm2yarn\nnpm install detox --save-dev\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-build.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\n\n<>\n  {props.debug && <div>\n\nSince this is a debug configuration, you need to have React Native packager running in parallel before you start\nDetox tests:\n\n```bash\nnpm start\n\n> react-native start\n\n#                        #######\n#                   ################\n#                #########     #########\n#            #########             ##########\n#        #########        ######        #########\n#       ##########################################\n#      #####      #####################       #####\n#      #####          ##############          #####\n#      #####    ###       ######       ###    #####\n#      #####    #######            #######    #####\n#      #####    ###########    ###########    #####\n#      #####    ##########################    #####\n#      #####    ##########################    #####\n#      #####      ######################     ######\n#       ######        #############        #######\n#         #########        ####       #########\n#              #########          #########\n#                  ######### #########\n#                       #########\n#\n#\n#                    Welcome to Metro!\n#              Fast - Scalable - Integrated\n```\n\n  </div>}\n</>\n\nNow you can run your first test:\n\n<CodeBlock language=\"sh\">\n  detox test --configuration {props.configurationName}\n</CodeBlock>\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-devices-android.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nTo check if a specific Android virtual device (e.g. `Pixel_3a_API_30_x86`) is installed locally, run:\n\n```bash\nemulator -list-avds\n```\n\nYou should see an output like:\n\n```plain text\n// highlight-next-line\nPixel_3a_API_30_x86\nPixel_API_30\n```\n\n:::tip\n\nIf you see `zsh: command not found` (or a similar message), please go back to\n[Setting up the environment](../getting-started.mdx#setting-up-the-environment) section\nwhere we were redirecting you to the official **React Native CLI Quickstart**, and make sure you\nhave completed it.\n\nProvided you have `ANDROID_SDK_ROOT` (or `ANDROID_HOME`) environment variables\ndefined, using an explicit path to `emulator` should help:\n\n<Tabs groupId=\"desktopOS\">\n    <TabItem value=\"darwin\" label=\"MacOS\">\n        <CodeBlock language=\"bash\">\n            $ANDROID_SDK_ROOT/emulator/emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n    <TabItem value=\"linux\" label=\"Linux\">\n        <CodeBlock language=\"bash\">\n            $ANDROID_SDK_ROOT/emulator/emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n    <TabItem value=\"win32\" label=\"Windows\">\n        <CodeBlock language=\"plain text\">\n            %ANDROID_HOME%\\emulator\\emulator -list-avds\n        </CodeBlock>\n    </TabItem>\n</Tabs>\n\n:::\n\nIf you don't see that AVD name, you might use another one from the list – just replace it in Detox config, e.g.:\n\n```diff\n   emulator: {\n     type: 'android.emulator',\n     device: {\n-      avdName: 'Pixel_3a_API_30_x86',\n+      avdName: 'Pixel_API_30',\n     },\n   },\n```\n\nIf the output is completely blank, then you need to open Android Studio and [create a new virtual device (AVD)](https://developer.android.com/studio/run/managing-avds#createavd)\nfirst. Experienced users might do that via [`avdmanager`](https://developer.android.com/studio/command-line/avdmanager), if Android Studio is not installed (e.g. on CI).\n\n:::info\n\nIf you wish to use an attached Android device (via USB or wireless network), make sure it is available:\n\n```bash\nadb devices\n```\n\nIf the device is properly connected, you should get an output like this:\n\n```plain text\nList of devices attached\n2F6315NVPH      device\n```\n\nAssuming the device is available (troubleshooting _adb_ issues is out of scope of this tutorial), you just\nneed to use `android.att.*` Detox configurations instead of `android.emu.*` where required.\n\n:warning: If you have multiple devices connected, replace that loose regular expression (`adbName: '.*'`)\nin your Detox config with a specific device name.\n\n:::\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/partials/_project-setup-devices-ios.mdx",
    "content": "To check if a specific device type (e.g. `iPhone 15`) is installed locally, run:\n\n```bash\nxcrun simctl list devicetypes\n```\n\nIf it is available, you'll see it among the other device types in the output:\n\n```plain text\n== Device Types ==\niPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)\niPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)\n…\niPhone SE (2nd generation) (com.apple.CoreSimulator.SimDeviceType.iPhone-SE--2nd-generation-)\niPhone 12 mini (com.apple.CoreSimulator.SimDeviceType.iPhone-12-mini)\n// highlight-next-line\niPhone 15 (com.apple.CoreSimulator.SimDeviceType.iPhone-15)\niPhone 15 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro)\n…\n```\n\nIf there is no such device type, you can replace it with another from the list:\n\n```diff\n   simulator: {\n     type: 'ios.simulator',\n     device: {\n-      type: 'iPhone 12',\n+      type: 'iPhone 13 Pro',\n     },\n   },\n```\n\n:::tip\n\nIf the device type list is empty or you need a specific iOS version,\ngo to `Xcode > Preferences > Components` and install a proper Simulator version from the list:\n\n![](../../img/xcode/install-simulator-runtime.png)\n\n:::\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/preparing-for-ci.md",
    "content": "# Preparing for CI\n\n:::danger Disclaimer\n\nThis guide is outdated.\n\n:::\n\nWhen your test suite is finally ready, it should be set up to run automatically on your CI server on every git push. This will alert you if new changes to the app break existing functionality.\n\nRunning Detox on CI is not that different from running it locally. There are two main differences:\n\n- You should test a release build rather than a debug build\n- Tell Detox to shut down the simulator when test is over\n\n## Step 1: Prepare a Release Configuration for Your App\n\nWe will need to create a release app configuration for Detox – follow [the previous tutorial](project-setup.mdx)\nif you haven’t completed it already.\n\n## Step 2: Add `build` and `test` Commands to Your CI Script\n\nAssuming your CI is executing some sort of shell script, add the following commands that should run inside the project root:\n\n```bash\ndetox build --configuration ios.sim.release\ndetox test --configuration ios.sim.release\n```\n\n:::tip\n\nMake sure to shut down the simulator when your tests are over.\n\n:::\n\n## Running Android Tests on CI\n\nSetting up a CI environment capable of running Android tests isn’t as trivial.\n\nFortunately, we’ve written all about it in a [blogpost on medium!](https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f)\n\nAlso, check out the guide on how to [prepare Android emulators for CI](../guide/android-dev-env.md).\n\n## Appendix\n\n### • Running Detox on [Travis CI](https://travis-ci.org/)\n\nDetox’s own build is running on Travis, check out Detox’s [`.travis.yml`](https://github.com/wix/Detox/tree/master/.travis.yml) file to see how it’s done.\n\nThis is a simple example configuration to get you started with Detox on Travis:\n\n```yaml\nlanguage: objective-c\nosx_image: xcode8.3\n\nbranches:\n  only:\n  - master\n\nenv:\n  global:\n  - NODE_VERSION=stable\n\ninstall:\n- brew tap wix/brew\n- brew install applesimutils\n- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash\n- export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"\n- nvm install $NODE_VERSION\n- nvm use $NODE_VERSION\n- nvm alias default $NODE_VERSION\n\n- npm install react-native-cli --global\n- npm install detox-cli --global\n\nscript:\n- detox build --configuration ios.sim.release\n- detox test --configuration ios.sim.release --cleanup\n\n```\n\n### • Running Detox on [Bitrise](https://www.bitrise.io/)\n\nBitrise is a popular CI service for automating React Native apps. If you are looking to get started with Bitrise, check out [this](https://blog.bitrise.io/post/how-to-set-up-a-react-native-app-on-bitrise) guide.\n\nYou can run Detox on Bitrise by creating a new workflow. Below is an example of the Bitrise `.yml` file for a workflow called `tests`.\n\nAdditionally, you can use a [webhook](https://devcenter.bitrise.io/en/apps/webhooks/adding-incoming-webhooks.html) on Bitrise to post the build status directly into your Slack channel.\n\n```yaml\n---\nformat_version: 1.1.0\ndefault_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git\ntrigger_map:\n- push_branch: \"*\"\n  workflow: tests\nworkflows:\n  _tests_setup:\n    steps:\n    - activate-ssh-key: {}\n    - git-clone:\n        inputs:\n        - clone_depth: ''\n        title: Git Clone Repo\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            npm cache verify\n\n            npm install\n        title: Install NPM Packages\n    before_run:\n    after_run:\n  _detox_tests:\n    before_run: []\n    after_run: []\n    steps:\n    - npm:\n        inputs:\n        - command: install -g detox-cli\n        title: Install Detox CLI\n    - npm:\n        inputs:\n        - command: install -g react-native-cli\n        title: Install React Native CLI\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            brew tap wix/brew\n            brew install applesimutils\n        title: Install Detox Utils\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox build --configuration ios.sim.release\n        title: Detox - Build Release App\n    - script:\n        inputs:\n        - content: |-\n            #!/bin/bash\n\n            detox test --configuration ios.sim.release --cleanup\n        title: Detox - Run E2E Tests\n  tests:\n    before_run:\n    - _tests_setup\n    - _detox_tests\n    after_run: []\n```\n\n### • Running Detox on [GitLab CI](https://docs.gitlab.com/ee/ci/README.html) - Android Only\n\nGitLab is also a popular git management service which also include a built-in CI system. They provide free runner up to 2000 minutes for private projects, however, the runners provided by them cannot be used to run Detox due to the lack of KVM support (in order to run Android Emulators). You can, instead, [create your own runner](https://docs.gitlab.com/ee/ci/runners/README.html) with KVM support. Some example of cloud providers offering this are: [Digital Ocean](https://www.digitalocean.com/products/droplets/), AWS (with [C5 instance types](https://aws.amazon.com/ec2/instance-types/c5/)), [Google Cloud](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances) and [Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/nested-virtualization)\n\nOne example of such job can be:\n\n```yaml\ndetox_e2e:\n  stage: test\n  image: reactnativecommunity/react-native-android\n  variables:\n  before_script:\n    - npm install envinfo detox-cli --global && envinfo\n    # Increase file watcher limit, see more here: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details\n    - echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p\n    - mkdir -p /root/.android && touch /root/.android/repositories.cfg\n    # The Dockerimage provides two paths for sdkmanager and avdmanager, which the defaults are from $ANDROID_HOME/cmdline-tools\n    # That is not compatible with the one that Detox is using ($ANDROID_HOME/tools/bin)\n    - echo yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --channel=0 --verbose \"system-images;android-27;default;x86_64\" \"emulator\"\n    # Nexus 6P, API 27, XXXHDPI\n    - echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager --verbose create avd --force --name \"Nexus6P\" --package \"system-images;android-27;default;x86_64\" --sdcard 200M --device 11\n    - adb start-server\n  script:\n    - npx detox build -c android.emu.release.ci\n    - npx detox test -c android.emu.release.ci --headless\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/project-setup.mdx",
    "content": "import CodeBlock from '@theme/CodeBlock';\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport PrepareBootstrapRN from './partials/_project-setup-bootstrap-rn.mdx';\nimport PrepareBootstrapOther from './partials/_project-setup-bootstrap-other.mdx';\nimport PrepareAppConfigsIos from './partials/_project-setup-apps-ios.mdx';\nimport PrepareAppConfigsAndroid from './partials/_project-setup-apps-android.mdx';\nimport PrepareDeviceConfigsIos from './partials/_project-setup-devices-ios.mdx';\nimport PrepareDeviceConfigsAndroid from './partials/_project-setup-devices-android.mdx';\n\n# Project Setup\n\n:::info\n\nThis article mainly covers standard React Native projects.\nIf some steps don't look applicable to your project, please adapt them accordingly, relying on the common sense –\nlook for other file locations, use custom build commands and so on.\n\nIf you're using **Expo**, please refer to the [setup guide] from their documentation website instead.\nThe setup for Expo projects is different and is not covered in this article.\n\n:::\n\n## Step 1: Bootstrap\n\n<Tabs groupId=\"appType\">\n  <TabItem value=\"start-rn\" label=\"React Native\" default>\n    <PrepareBootstrapRN />\n  </TabItem>\n  <TabItem value=\"start-other\" label=\"Native iOS\">\n    <PrepareBootstrapOther />\n  </TabItem>\n</Tabs>\n\nNow, when all the dependencies are installed, initialize Detox in your project:\n\n```bash\ndetox init\n```\n\nNormally you should see an output like:\n\n```plain text\nCreated a file at path: .detoxrc.js\nCreated a file at path: e2e/jest.config.js\nCreated a file at path: e2e/starter.test.js\n```\n\n:::tip\nIf you see a message like `command not found: detox`, make sure you have [installed Detox command line tools](#1-command-line-tools-detox-cli).\n:::\nAfter Detox generated these files in your project's root, you still have some work to do with them:\n\n* `.detoxrc.js` – Detox config file;\n* `e2e/jest.config.js` – Jest configuration;\n* `e2e/starter.test.js` – dummy first test.\n\n## Step 2: App configs\n\nIn this step you need to provide Detox with the right **commands to build** your app for iOS and Android,\nand also the right **paths to the app binaries** so that Detox can install your app on the device before\nactually starting the tests.\n\n<Tabs groupId=\"mobileOs\">\n    <TabItem value=\"iOS\" label=\"iOS\" default>\n        <PrepareAppConfigsIos />\n    </TabItem>\n    <TabItem value=\"Android\" label=\"Android\">\n        <PrepareAppConfigsAndroid />\n    </TabItem>\n</Tabs>\n\n## Step 3: Device configs\n\nBy default, Detox config suggests default device types for iOS and Android:\n\n```js title=\".detoxrc.js\"\n/** @type {Detox.DetoxConfig} */\nmodule.exports = {\n  // ...\n  devices: {\n    simulator: {\n      type: 'ios.simulator',\n      device: {\n        // highlight-next-line\n        type: 'iPhone 12',\n      },\n    },\n    attached: {\n      type: 'android.attached',\n      device: {\n        // highlight-next-line\n        adbName: '.*', // any attached device\n      },\n    },\n    emulator: {\n      type: 'android.emulator',\n      device: {\n        // highlight-next-line\n        avdName: 'Pixel_3a_API_30_x86',\n      },\n    },\n  },\n};\n```\n\n:::info\n\nIf you plan to use cloud devices instead, check out the [Genymotion SaaS guide](../guide/genymotion-saas.mdx), which will help you to set up remote Android devices.\nThis tutorial, however, focuses on devices running locally.\n\n:::\n\nHere's how you can check they are correct and change them if you need something else:\n\n<Tabs groupId=\"mobileOs\">\n    <TabItem value=\"iOS\" label=\"iOS\">\n        <PrepareDeviceConfigsIos />\n    </TabItem>\n    <TabItem value=\"Android\" label=\"Android\" default>\n        <PrepareDeviceConfigsAndroid />\n    </TabItem>\n</Tabs>\n\n## Step 4: Additional Android configuration\n\n:::tip\n\nIf you want to try out your tests right away on iOS,\nyou can skip to [Step 5: Build the app](#step-5-build-the-app)\nand revisit it when you're ready to move forward with Android.\n\n:::\n\nAssuming you have a regular React Native project, these are the files you normally would need to\npatch or create if they are missing:\n\n* **Build scripts:**\n    * `android/build.gradle`\n    * `android/app/build.gradle`\n* **Native test code:**\n    * `android/app/src/androidTest/java/com/<your.package>/DetoxTest.java`\n* **Manifests:**\n    * `android/app/src/main/AndroidManifest.xml`\n    * `android/app/src/main/res/xml/network_security_config.xml`\n\n### 4.1. Patching build scripts\n\nOpen your main build script and apply the suggested changes:\n\n:::note\nNew Android projects won't have an `allprojects {}` section, so you will need to add it yourself.\n:::\n\n```diff title=\"android/build.gradle\"\n buildscript {\n   ext {\n     buildToolsVersion = \"31.0.0\"\n// highlight-next-line\n     minSdkVersion = 21 // (1)\n     compileSdkVersion = 30\n     targetSdkVersion = 30\n// highlight-next-line\n+    kotlinVersion = 'X.Y.Z' // (2)\n   }\n …\n   dependencies {\n     classpath(\"com.android.tools.build:gradle:7.1.1\")\n     classpath(\"com.facebook.react:react-native-gradle-plugin\")\n     classpath(\"de.undercouch:gradle-download-task:5.0.1\")\n// highlight-next-line\n+    classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\") // (3)\n …\n\n allprojects {\n   repositories {\n     …\n     google()\n// highlight-start\n+    maven { // (4)\n+      url(\"$rootDir/../node_modules/detox/Detox-android\")\n+    }\n// highlight-end\n     maven { url 'https://www.jitpack.io' }\n   }\n }\n```\n\nHere is the explanation of those changes, numbered 1-4:\n\n1. Make sure your `minSdkVersion` is at least 18 or higher.\n1. We recommend you to define a global `kotlinVersion` constant you would use in the next step.\nReplace `X.Y.Z` with the actual version number.\nTo get one, open **Android Studio**, go to `Preferences > Languages & Frameworks > Kotlin` and\nlook at `Current Kotlin plugin version` field. For example, `211-1.5.30-release-408-AS7442.40`\nmeans you have version `1.5.30`.\n    ![](../img/android/get-kotlin-version.png)\n1. The line adds [Kotlin Gradle plugin](https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin)\nto the build script. If your project is not entirely new, there's a chance you might have it already, so make sure\nyou aren't adding it twice. :wink:\n1. Last, we add Detox as a precompiled native dependency, `.aar`. If you need to have Detox as a\n_compiling dependency_ instead, consult the respective section in [Debugging](debugging.mdx#native-application-code) guide.\n\nNow let's move on to the next build script and prepare it:\n\n```diff title=\"android/app/build.gradle\"\n …\n\n android {\n   …\n   defaultConfig {\n     …\n     versionCode 1\n     versionName \"1.0\"\n+    testBuildType System.getProperty('testBuildType', 'debug')\n+    testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n   …\n   buildTypes {\n     release {\n       minifyEnabled true\n       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n+      proguardFile \"${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro\"\n\n       signingConfig signingConfigs.release\n     }\n   }\n   …\n\n dependencies {\n+  androidTestImplementation('com.wix:detox:+')\n+  implementation 'androidx.appcompat:appcompat:1.1.0'\n   implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n```\n\n:::info ProGuard notice\n\nDetox relies on\n[Android Reflection API](https://developer.android.com/reference/java/lang/reflect/package-summary)\nto integrate with React Native on Android, that's why you have to exempt some of its native code from\n[ProGuard minification](https://developer.android.com/studio/build/shrink-code).\nOtherwise, you'll see Detox crashing or hanging up infinitely upon an attempt to\nrun tests with your app built in **release mode**.\n\n:::\n\n### 4.2. Adding an auxiliary Android test\n\nDetox requires that your project has a single dummy native Android test with some special content,\nwhich will be picked up by `testRunner` that you just added in the previous step, so let's create it now.\n\nCopy the snippet below to create a file under the following path (where `<your.package>` is your actual\npackage name):\n\n```java title=\"android/app/src/androidTest/java/com/<your.package>/DetoxTest.java\" showLineNumbers\n// highlight-next-line\npackage com.<your.package>; // (1)\n\nimport com.wix.detox.Detox;\nimport com.wix.detox.config.DetoxConfig;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.rule.ActivityTestRule;\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class DetoxTest {\n    @Rule // (2)\n// highlight-next-line\n    public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);\n\n    @Test\n    public void runDetoxTests() {\n        DetoxConfig detoxConfig = new DetoxConfig();\n        detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;\n        detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;\n        detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);\n\n        Detox.runTests(mActivityRule, detoxConfig);\n    }\n}\n```\n\nYou can see there are two lines (1 and 18) that require extra care:\n\n1. Replace with your package name. To look it up, you could copy and paste the first line from `android/app/src/main/java/com/<your.package>/MainActivity.java`.\n1. Usually not the case, but you might have a custom activity name instead of a default `MainActivity`. To check whether it is so or not, open your `android/app/src/main/AndroidManifest.xml`,\nand check what your main activity is called:\n\n```plain text\n…\n  <activity\n// highlight-next-line\n    android:name=\".MainActivity\"\n    android:label=\"@string/app_name\"\n    android:launchMode=\"standard\"\n```\n\n### 4.3. Enabling unencrypted traffic for Detox\n\n:::info\n\nFor Detox to work, its native code running on Android device has to be able to connect to the Node.js host running tests.\nIt sends an unencrypted HTTP traffic via virtual `localhost` interface, that's why you need to create a new file which\nadds a couple of exceptions to the security rules.\n\nIf properly configured, this approach in no way compromises the security settings of your app.\nFor more details, refer to [Android’s security-config guide](https://developer.android.com/training/articles/security-config)\nand the [dedicated article](https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html)\nin the Android developers blog.\n\n:::\n\nCreate a new network security config file for Android (or patch it if you have one):\n\n```xml title=\"android/app/src/main/res/xml/network_security_config.xml\"\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n    <domain-config cleartextTrafficPermitted=\"true\">\n        <domain includeSubdomains=\"true\">10.0.2.2</domain>\n        <domain includeSubdomains=\"true\">localhost</domain>\n    </domain-config>\n</network-security-config>\n```\n\nIf you had no network security config before, it means you also have to register it after creation:\n\n```diff title=\"android/app/src/main/AndroidManifest.xml\"\n <manifest>\n   <application\n   …\n+    android:networkSecurityConfig=\"@xml/network_security_config\">\n   </application>\n </manifest>\n```\n\n:trophy: Pat yourself on the back! The hardest part is over, now your Android app is ready to be used with Detox.\n\n## Step 5: Build the app\n\n<Tabs groupId=\"configurationName\">\n  <TabItem value=\"ios.sim.debug\" label=\"iOS (Debug)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration ios.sim.debug\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"ios.sim.release\" label=\"iOS (Release)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration ios.sim.release\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"android.emu.debug\" label=\"Android (Debug)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration android.emu.debug\n    </CodeBlock>\n  </TabItem>\n  <TabItem value=\"android.emu.release\" label=\"Android (Release)\">\n    <CodeBlock language=\"sh\">\n      detox build --configuration android.emu.release\n    </CodeBlock>\n  </TabItem>\n</Tabs>\n\n:::tip\n\nIf the build is failing, try out our [Troubleshooting](../troubleshooting/building-the-app.md) section.\n\nNote that Detox CLI just executes the build command you specified in your Detox config (`.detoxrc.js`)\nfor a specific configuration. In the other words, it has no extra logic – it just takes the command and runs it,\nnothing more and nothing less.\n\n:::\n\nOnce your build is ready to use, please proceed to the next article.\n\n[setup guide]: https://docs.expo.dev/build-reference/e2e-tests\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/introduction/your-first-test.mdx",
    "content": "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\nimport RunningYourTest from './partials/_project-setup-build.mdx';\n\n# Your First Test\n\nThe previous articles have addressed the environment and project setup, and now it is time for writing\nand running the tests.\n\nIf you are eager to check first whether your build configuration was correct, you can skip writing a test for now and try [running tests](#running-tests) instead, to identify potential [late issues](../troubleshooting/running-tests.md#no-simulators-found-ios) caused by incorrect project configuration.\n\n## Writing a test\n\nThis subsection shows how to write a test which can:\n\n* _launch_ the application,\n* _tap_ on a button,\n* and _assert_ that some text appears as a result.\n\nAlso, it will familiarize you with commonly used Detox [actions], [assertions] and [matchers] along the way.\n\n### 1. Create a test suite\n\n:::info Note\n\nYou can also duplicate and modify a `e2e/starter.test.js` file that was generated automatically by `detox init` command.\n\n:::\n\nCreate a new test file under your `e2e` folder and add a similar test suite skeleton:\n\n```js title=\"e2e/yourTestName.test.js\"\ndescribe('Example', () => {\n  beforeAll(async () => {});\n\n  beforeEach(async () => {});\n\n  it('should test something', async () => {});\n});\n```\n\n### 2. Launch the application\n\nWhen your test starts, the application is not running yet. You need to call [`device.launchApp()`](../api/device.md#devicelaunchappparams) at least once, e.g. in the `beforeAll` hook:\n\n```js\ndescribe('Example', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  // …\n});\n```\n\nIf your app supports deep links, you can configure it to [start from a specific screen](../guide/mocking-open-with-url.md).\n\n:::tip\n\nIt is a good idea to start every test from a fresh state, since the preceding ones might leave your application\nin an unpredictable state if they fail.\n\nOne way to do it is to launch the app as a new instance in `beforeEach` hook instead:\n\n```js\nbeforeEach(async () => {\n  await device.launchApp({ newInstance: true });\n});\n```\n\nThe other way is to _reload React Native_ without restarting the app. Like any live reloading, it is apt to cause glitches for more complex apps,\nbut for simpler apps it proves to be a quicker way to reset the state between the tests:\n\n```js\nbeforeEach(async () => {\n  await device.reloadReactNative();\n});\n```\n\nSo, pick your favorite one wisely, on the basis of _speed_ vs _stability_ considerations.\n\n:::\n\n### 3. Match an element\n\nThe next step is to [match][matchers] an element you want to interact with.\n\nDetox provides many options to match an element [`by.id()`], [`by.label()`], [`by.text()`] and [more][matchers].\nThe most common way to match elements is either by _id_ or _text_:\n\n```js\nelement(by.id('YourTestID')); // recommended\nelement(by.text('Element text'));\n```\n\n:::info Best practice\n\nTry to use [`by.id()`](../api/matchers.md#byidid) matcher wherever possible.\n[Explore our guide](../guide/test-id.md) to learn how to work with `testID` props.\n\n:::\n\n### 4. Perform an action\n\nDetox provides many actions on elements such as [`tap()`], [`swipe()`], [`scroll()`] and [other interactions][actions#more].\n\nLet's tap on an element for the sake of the example:\n\n```jsx\ndescribe('Example', () => {\n  // …\n\n  it('should tap on a button', async () => {\n    await element(by.id('ButtonID')).tap();\n  });\n});\n```\n\n:::info Note\n\nYou don't need to wait or \"sleep\" after interacting with an element, because Detox already does it for you.\nIt synchronises with your application and waits after each action for all the foreground activities to finish before performing any further step.\n\nWhile convenient, this feature goes sideways at times, for example, when your app has looping animations causing Detox to wait forever.\nThis is why you sometimes have to tweak your app specifically for Detox tests, and [there is a special guide](../troubleshooting/synchronization.md) for that.\n\n:::\n\n### 5. Make an assertion\n\nAn essential step of any test is _making an assertion_.\n\nDetox provides its own `expect` object, so that you can expect from any element [`toExist()`], [`toBeVisible()`], [`toHaveText()`] and [more various things][assertions#more].\nAll the assertions can be inverted with [`not` property](../api/expect.md#not).\n\nLet's assert that our text is shown on a screen using [`toBeVisible()`] function:\n\n```jsx\ndescribe('Example', () => {\n  beforeAll(async () => {\n    await device.launchApp();\n  });\n\n  beforeEach(async () => {\n    await device.reloadReactNative();\n  });\n\n  it('should tap on button by id and expect some text to be visible', async () => {\n    await element(by.id('ButtonID')).tap();\n    await expect(element(by.text('The button has been pressed'))).toBeVisible();\n  });\n});\n```\n\nNote that instead of matching by text you can assert a specific text on an element with [`toHaveText()`], e.g.:\n\n```jsx\nawait expect(element(by.id('TextAfterButtonPressed'))).toHaveText('Button pressed');\n```\n\n## Running tests\n\n<Tabs groupId=\"configurationName\">\n  <TabItem value=\"ios.sim.debug\" label=\"iOS (Debug)\">\n    <RunningYourTest configurationName={'ios.sim.debug'} debug />\n  </TabItem>\n  <TabItem value=\"ios.sim.release\" label=\"iOS (Release)\">\n    <RunningYourTest configurationName={'ios.sim.release'} />\n  </TabItem>\n  <TabItem value=\"android.emu.debug\" label=\"Android (Debug)\">\n    <RunningYourTest configurationName={'android.emu.debug'} debug />\n  </TabItem>\n  <TabItem value=\"android.emu.release\" label=\"Android (Release)\">\n    <RunningYourTest configurationName={'android.emu.release'} />\n  </TabItem>\n</Tabs>\n\nIf you haven't changed the generated `e2e/starter.test.js`, you are likely to see errors like this:\n\n```\n FAIL  e2e/starter.test.js (25.916 s)\n  Example\n    ✕ should have welcome screen (662 ms)\n    ✕ should show hello screen after tap (236 ms)\n    ✕ should show world screen after tap (236 ms)\n\n  ● Example › should have welcome screen\n\n    Test Failed: No elements found for “MATCHER(id == “welcome”)”\n\n    HINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.\n\n       9 |\n      10 |   it('should have welcome screen', async () => {\n    > 11 |     await expect(element(by.id('welcome'))).toBeVisible();\n         |                                             ^\n      12 |   });\n      13 |\n      14 |   it('should show hello screen after tap', async () => {\n\n      at Object.toBeVisible (e2e/starter.test.js:11:45)\n\n  …\n```\n\nIf you have created your own test, and it is failing, examine the error message, check out our [Troubleshooting](../troubleshooting/running-tests.md)\nand [Debugging](debugging.mdx) guides..\n\n[matchers]: ../api/matchers.md\n[`by.id()`]: ../api/matchers.md#byidid\n[`by.label()`]: ../api/matchers.md#bylabellabel\n[`by.text()`]: ../api/matchers.md#bytexttext\n[actions]: ../api/actions.md\n[`tap()`]: ../api/actions.md#tappoint\n[`swipe()`]: ../api/actions.md#swipedirection-speed-normalizedoffset-normalizedstartingpointx-normalizedstartingpointy\n[`scroll()`]: ../api/actions.md#scrolloffset-direction-startpositionx-startpositiony\n[actions#more]: ../api/actions.md#methods\n[assertions]: ../api/expect.md\n[`toExist()`]: ../api/expect.md#toexist\n[`toBeVisible()`]: ../api/expect.md#tobevisible\n[`toHaveText()`]: ../api/expect.md#tohavetexttext\n[assertions#more]: ../api/expect.md#methods\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/pilot/best-practices.md",
    "content": "# Pilot Best Practices\n\nPilot allows you to write tests using natural language commands. Each step corresponds to a specific action or assertion within your app. In case you're wondering how to make the most out of this feature, here are some best practices to follow when writing your Pilot intents.\n\n---\n\n## Best Practices for `perform`\n\nThe `perform()` function executes a series of steps based on natural language commands. Proper structuring of these steps is crucial for accurate and reliable test execution.\n\n### Step-by-Step Instructions\n\n- **Write Sequential Steps**: Describe your test steps in a clear and sequential manner.\n- **Example**:\n\n```javascript\nit('should navigate and add a product to the cart', async () => {\n  await pilot.perform(\n    'Navigate to the \"Products\" page',\n    'Tap on the \"Add to Cart\" button for the first product',\n    'Verify that the \"Added to Cart\" pop-up is displayed'\n  );\n});\n```\n\n### Define Specific and Clear Steps\n\n- **Provide Clear Instructions**: The clearer your instructions, the better Pilot can interpret them.\n- **Example**:\n  - **Good**: `'Tap on the \"Login\" button'`\n  - **Better**: `'Tap on the \"Login\" button located at the top right corner'`\n\n### One Action per Step\n\n- **Avoid Combining Multiple Actions**: Keep each step focused on a single action or assertion.\n- **Example**:\n\n  - **Avoid**: `'Tap on the \"Login\" button and enter credentials'`\n  - **Prefer**:\n\n  ```javascript\n  'Tap on the \"Login\" button',\n  'Enter \"user@example.com\" into the \"Email\" field'\n  ```\n\n### Use Exact Labels\n\n- **Refer to UI Elements Precisely**: Use the exact text or identifiers as they appear in the app.\n- **Example**:\n  - **Good**: `'Enter \"password123\" into the \"Password\" field'`\n  - **Avoid**: `'Enter password into its field'`\n\n### Keep Assertions Simple\n\n- **Focus on Specific Outcomes**: Make assertions straightforward and specific.\n- **Example**:\n  - **Good**: `'Verify that the \"Welcome\" message is displayed'`\n  - **Avoid**: `'Check if the welcome message appears correctly on the screen'`\n\n### Leverage Visual Context\n\n- **Utilize Visual Descriptions**: If your LLM supports image snapshots, include visual context in your intents.\n- **Example**: `'Ensure the profile picture is visible at the top of the screen'`\n\n### Avoid Ambiguity\n\n- **Specify Elements Precisely**: If multiple elements could match, provide additional details.\n- **Example**:\n  - **Ambiguous**: `'Tap on the \"Submit\" button'`\n  - **Specific**: `'Tap on the \"Submit\" button in the registration form'`\n\n## Best Practices for `autopilot(goal)`\n\nThe `autopilot()` function automatically generates a series of steps to achieve the given goal. To optimize the output, follow these guidelines:\n\n### Define Specific and Clear Goals\n\n- **Be Clear and Concise**: Describe the goal with enough detail for Pilot to understand the desired outcome.\n- **Example**:\n\n```javascript\nawait pilot.autopilot('Complete the checkout process and verify the order confirmation');\n```\n\n### Provide Context\n\n- **Specify the Context of the Flow**: Indicate which part of the app you're focusing on.\n- **Example**: 'Verify the login flow from the homepage'\n\n## General Recommendations\n\n- **Flexibility**: While it's best to provide clear instructions, Pilot is designed to interpret a variety of phrasing. Different approaches can work, and you are encouraged to experiment.\n- **Feedback Loop**: Observe how Pilot interprets your instructions and adjust accordingly.\n- **Model Selection**: Choose an LLM model that best suits your application's complexity and language requirements. We recommend advanced models like **Sonnet 3.5** or **GPT-4o** for better performance.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/pilot/testing-with-pilot.md",
    "content": "# Natural Language Testing with Pilot\n\nIn this tutorial, we'll explore how to use **Pilot** to write end-to-end tests using natural language commands. Pilot leverages large language models (LLMs) to translate human-readable instructions or goal into Detox actions and assertions, making test writing more intuitive and accessible.\n\n:::note\n\nPilot now has a new [documentation site](https://wix-pilot.com/).<br/>\nThere, you can find a [technical overview](https://wix-pilot.com/docs/guides/technical-overview), learn how to [implement a driver for your preferred testing framework](https://wix-pilot.com/docs/guides/implementing-custom-testing-framework-driver), and stay up to date with the latest features and updates.\n\n:::\n\n:::caution Work in Progress\n\n**Note**: Pilot is in active development. APIs are subject to change in future releases.<br/>\nFor complete API details, refer to our [Pilot API documentation](../api/pilot).\n\n:::\n\n## Introduction\n\nPilot simplifies the process of writing tests by allowing you to describe test steps in natural language.\nIt interprets these instructions or goal and translates them into Detox commands. This guide will help you integrate Pilot into your testing workflow and provide best practices for writing effective intents.\n\n![Demo](../img/copilot/copilot-demo.gif)\n\n## Implementing a `PromptHandler`\n\nThe `PromptHandler` is a crucial component that interfaces with your LLM service.\nBelow is an example of how to implement a `PromptHandler` using OpenAI's GPT-4 API.\n\nYou can adapt this code to work with other LLMs or services as needed. You may also find pre-built `PromptHandler` implementations for popular LLMs in the [Pilot repository on GitHub](https://github.com/wix-incubator/pilot).\n\n:::note Open for Contributions\n\nIf you have implemented a `PromptHandler` for a specific LLM or service, consider contributing it to the [Wix Pilot GitHub Repository](https://github.com/wix-incubator/pilot) to help the community.\n\n:::\n\n### Example of a `PromptHandler` for OpenAI's GPT-4\n\n```javascript\nimport OpenAI from 'openai';\n\nconst path = require('path');\n\nclass OpenAIPromptHandler {\n  constructor(apiKey) {\n    const configuration = new OpenAI({ apiKey });\n    this.openai = new OpenAI(configuration);\n  }\n\n  async runPrompt(prompt, imagePath) {\n    const messages = [\n      { role: 'system', content: 'You are a test automation assistant.' },\n      { role: 'user', content: prompt },\n    ];\n\n    // If an image is provided, \"upload\" it and include the URL in the prompt\n    if (imagePath && this.isSnapshotImageSupported()) {\n      try {\n        const imageUrl = await this.uploadImage(imagePath);\n        messages.push({\n          role: 'user',\n          content: `Here is an image for reference: ${imageUrl}`,\n        });\n      } catch (error) {\n        console.error('Error uploading image:', error);\n        throw new Error('Failed to upload image');\n      }\n    }\n\n    const response = await this.openai.chat.completions.create({\n      model: 'gpt-4',\n      messages,\n    });\n\n    return response.data.choices[0].message.content;\n  }\n\n  async uploadImage(imagePath) {\n    // Uploads the image and returns the URL\n  }\n\n  isSnapshotImageSupported() {\n    return true; // Set to true to handle image uploads\n  }\n}\n\nmodule.exports = OpenAIPromptHandler;\n```\n\n**Explanation**:\n\n- **`runPrompt`**: Sends the prompt to the LLM and returns the response.\n- **`isSnapshotImageSupported`**: Indicates whether the LLM can handle snapshot images. If set to `true`, the handler will include image URLs in the prompt and will include them when instructing Pilot.\n\n## Initializing Pilot\n\nInitialize Pilot with your `PromptHandler` before running any tests.\nThis is typically done in the `beforeAll` hook or a setup file.\n\n**Example**:\n\n```javascript\nconst {pilot} = require('detox/index');\nconst OpenAIPromptHandler = require('./OpenAIPromptHandler');\n\nbeforeAll(() => {\n  const promptHandler = new OpenAIPromptHandler('YOUR_OPENAI_API_KEY');\n  pilot.init(promptHandler);\n});\n```\n\n## Writing Tests with Pilot\n\nWith Pilot initialized, you can now write tests using the `pilot.perform` method by sending a list of specific instructions, or the `pilot.autopilot` method to define the goal and generate actions automatically.\n\n### Writing Step-by-Step Tests with `pilot.perform`\n\nPilot allows you to write tests by providing a sequence of natural language instructions, using `perform` method. Each instruction corresponds to a single action or assertion.\n\n```javascript\nit('should verify element sizes and button states', async () => {\n  await pilot.perform(\n    'Launch the app with notification permissions enabled',\n    'Navigate to the \"Settings\" page',\n    'Verify that the \"Save\" button is disabled',\n    'Locate the profile picture element',\n    'Verify that the profile picture size is 100 x 100 pixels and that the image is available and rendered',\n    'Tap on the \"Edit Profile\" button',\n    'Verify that the \"Save\" button is now enabled',\n    'Verify that the \"Username\" field text is bold'\n  );\n});\n```\n\nIn the example above, Pilot can perform checks that go beyond traditional UI testing, such as verifying element sizes, button states (enabled/disabled), or text styles (e.g., bold). This is thanks to the combination of Detox code-generation and multimodal LLMs that can analyze the snapshots.\n\n- **Step-by-Step Instructions**: Each step is a separate string, representing a single action or assertion.\n- **Sequential Execution**: Steps are executed in order, allowing you to describe complex interactions intuitively.\n\n#### Hybrid Tests with Pilot and Detox APIs\n\nYou can also combine Pilot commands with traditional Detox APIs for more control.\n\n```javascript\nit('should add an item to the cart', async () => {\n  await pilot.perform(\n    'Launch the app',\n    'Navigate to the \"Products\" page',\n    'Tap on the \"Add to Cart\" button for the first product'\n  );\n\n  const cartBadge = element(by.id('cart-badge'));\n  await expect(cartBadge).toHaveText('1');\n\n  await pilot.perform(\n    'Navigate to the \"Cart\" page',\n    'Verify that the product is listed in the cart'\n  );\n});\n```\n\n### Locating Elements with Pilot\n\nYou can also use Pilot to retrieve values, locate elements, or perform advanced checks such as verifying element sizes or button states.\n\n```javascript\nit('should display the correct page title', async () => {\n  const pageTitleElement = await pilot.perform(\n    'Launch the app',\n    'Navigate to the \"Profile\" page',\n    'Locate the page title element'\n  );\n\n  await expect(pageTitleElement).toHaveText('Profile');\n});\n```\n\n## Goal-Oriented Tests with `pilot.autoPilot`\n\nWith the `pilot.autopilot` method, you can define the desired goal of your test, and Pilot will automatically generate the necessary actions and assertions to achieve that goal. This method focuses on the outcome, allowing you to create tests without having to specify each step manually.\n\n## Contributing to Pilot\n\nContributions are welcome!\nVisit the [Pilot GitHub Repository](https://github.com/wix-incubator/pilot) to open issues or pull requests if they are relevant to the core-library functionality or open a it under [Detox repository](https://github.com/wix/Detox) if it is related to Detox-Pilot integration or if you are not sure where the issue should be opened.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/artifacts.md",
    "content": "# Artifacts\n\n## Video Recording Issues on CI\n\nFor iOS, you might be getting errors on CI similar to this:\n\n```plain text\nError: Error Domain=NSPOSIXErrorDomain Code=22 \"Invalid argument\" UserInfo={NSLocalizedDescription=Video recording requires hardware Metal capability.}.\n```\n\nUnfortunately, this error is beyond our reach. To fix it, you have to enable hardware acceleration on your build machine, or just disable video recording on CI if it is not possible to turn on the acceleration.\n\nThere might be a similar issue on Android when the screen recording process exits with an error on CI. While the solution might be identical to the one above, also you might try to experiment with other emulator devices and Android OS versions to see if it helps.\n\n## Detox Instruments is Installed in a Custom Location\n\nIf you have to use [Detox Instruments](https://github.com/wix/DetoxInstruments) installed in a custom location, you can point Detox to it with the `DETOX_INSTRUMENTS_PATH` environment variable, as shown below:\n\n```bash\nDETOX_INSTRUMENTS_PATH=\"/path/to/Detox Instruments.app\" detox test ...\n```\n\n> **Note:** If **Detox Instruments** had been [integrated into your project](https://github.com/wix/DetoxInstruments/blob/master/Documentation/XcodeIntegrationGuide.md), then the integrated [Detox Profiler framework](https://github.com/wix/DetoxInstruments/tree/master/Profiler) will be used when profiling with Detox.\n\n## `Ctrl+C` Does Not Clean Up Temporary Files\n\nThis is a known issue. :man\\_shrugging:\nAfter you press `Ctrl+C` and stop the tests, some of temporary files won’t get erased (e.g. `/sdcard/83541_0.mp4` on Android emulator, or `/private/var/folders/lm/thz8hdxs4v3fppjh0fjc2twhfl_3x2/T/f12a4fcb-0d1f-4d98-866c-e7cea4942ade.png` on your Mac).\nIt cannot be solved on behalf of Detox itself, because the problem has to do with how Jest runner terminates its puppet processes.\nThe issue is on our radar, but the ETA for the fix stays unknown.\nIf you feel able to contribute the fix to [Jest](https://github.com/facebook/jest), you are very welcome.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/building-the-app.md",
    "content": "# Dealing With Problems With Building the App & Detox\n\nThis page is about issues related to building the app, typically triggered when running `detox build` (and not `detox test`, for example).\n\n## Android\n\n### Problem: AAPT - resource linking failure\n\nFor build errors involving AAPT resource linking failure, such as this one:\n\n```plain text\nExecution failed for task ':app:processReleaseAndroidTestResources'.\n> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction\n   > Android resource linking failed\n     ERROR:: AAPT: error: resource style/Widget.AppCompat.TextView ...\n```\n\nEnsure that the following line appears in your app build script in the `dependencies` section:\n\n```gradle title=\"android/app/build.gradle\"\ndependencies {\n    // ...\n    implementation 'androidx.appcompat:appcompat:1.1.0' // (check what the latest version is!)\n}\n```\n\n### Problem: minSdkVersion mismatch\n\nFor Gradle errors involving `minSdkVersion` mismatches resembling this one:\n\n```text\nuses-sdk:minSdkVersion 18 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.3] /Users/janedoe/.gradle/caches/transforms-3/6a9cd4eeeb285f80b9e6f413ecd78d0d/transformed/jetified-react-native-0.64.3/AndroidManifest.xml as the library might be using APIs not available in 18\n        Suggestion: use a compatible library with a minSdk of at most 18,\n                or increase this project's minSdk version to at least 21,\n                or use tools:overrideLibrary=\"com.facebook.react\" to force usage (may lead to runtime failures)\n```\n\nTry applying the solution suggested in [this Stack-overflow](https://stackoverflow.com/questions/21032271/how-to-inject-android-configuration-to-each-subproject-with-gradle) post, namely adding this to your root-project's `build.gradle` file (replace `21` those matching your app's `build.gradle`):\n\n```gradle title=\"android/build.gradle\"\nallprojects {\n    afterEvaluate {\n        if (it.hasProperty('android')){\n            android {\n                defaultConfig {\n                    minSdkVersion 21 // Replace '21' with whatever suites your case\n                }\n            }\n        }\n    }\n}\n```\n\n### Problem: Kotlin `stdlib` version conflicts\n\nThe problems and resolutions here are different depending on whether you’re using Detox as a precompiled dependency artifact (i.e. an `.aar`) - which is by far the common case, or compiling it yourself.\n\n#### Resolving for a precompiled dependency (`.aar`)\n\nOf all [Kotlin implementation flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies), Detox assumes the most recent one, namely `kotlin-stdlib-jdk8`. If your Android build fails due to conflicts with implementations coming from other dependencies or even your own app, consider adding an exclusion to either the \"other\" dependencies or detox itself, for example:\n\n```diff\ndependencies {\n-    androidTestImplementation('com.wix:detox:+')\n+    androidTestImplementation('com.wix:detox:+') {\n+        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'\n+    }\n}\n```\n\nDetox should work with `kotlin-stdlib-jdk7`, as well.\n\nA typical error output formed by `Gradle` in this case is as provided, for example, in [#1380](https://github.com/wix/Detox/issues/1380):\n\n```plain text\nCould not determine the dependencies of task ':detox:compileDebugAidl'.\n> Could not resolve all task dependencies for configuration ':detox:debugCompileClasspath'.\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30'\n           Dependency path 'OurApp:detox:unspecified' --> 'com.facebook.react:react-native:0.59.5' --> 'com.squareup.okio:okio:2.2.2' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.60'\n           Dependency path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.0'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n\n   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.0.\n     Required by:\n         project :detox\n      > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:\n           Dependency path 'OurApp:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:4.0.0-alpha01' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.30' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.30'\n           Constraint path 'OurApp:detox:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.0' because of the following reason: debugRuntimeClasspath uses version 1.3.0\n```\n\n(i.e. the project indirectly depends on different versions of `kotlin-stdlib`, such as `1.3.0`, `1.3.30`, `1.2.60`)\n\n#### Resolving for a compiling subproject\n\nDetox requires the Kotlin standard-library as its own dependency. Due to the [many flavors](https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies) by which Kotlin has been released, multiple dependencies often create a conflict.\n\nFor that, Detox allows for the exact specification of the standard library to use using two Gradle globals: `detoxKotlinVersion` and `detoxKotlinStdlib`. You can define both in your root build script file:\n\n```gradle title=\"android/build.gradle\"\nbuildscript {\n    // ...\n    ext.detoxKotlinVersion = '1.3.0' // Detox' default is 1.2.0\n    ext.detoxKotlinStdlib = 'kotlin-stdlib-jdk7' // Detox' default is kotlin-stdlib-jdk8\n}\n```\n\n### Problem: `Duplicate files copied in ...`\n\nIf you get an error like this:\n\n```plain text\nExecution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.\n> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE\n```\n\nYou need to add this to the `android` section of your app build script:\n\n```gradle title=\"android/app/build.gradle\"\npackagingOptions {\n    exclude 'META-INF/LICENSE'\n}\n```\n\n### Running Detox in a Rosetta environment\n\nWhen working with dependencies that require running your iOS app in a Rosetta simulator, you may encounter issues with the `detox build` command. These issues often relate to SwiftEmitModule or SwiftCompile errors. To resolve this, follow these steps:\n\n1. Modify your build command in the Detox configuration:\n\n```json\n\"build\": \"xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build\"\n```\n\n1. Run the following command in your terminal to ensure Xcode is properly selected:\n\n```bash\nsudo xcode-select --switch /Applications/Xcode.app\n```\n\n1. Launch the iOS simulator in Rosetta mode:\n\n```bash\narch -x86_64 /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator\n```\n\nAfter following these steps, the `detox build` command should run without errors in your Rosetta environment.\n\n:::note\n\nThis approach configures Detox specifically to build and run with Rosetta without affecting your app's regular builds. To run your app with Rosetta in Xcode, enable Rosetta simulator destinations via Xcode.\n\n:::\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/element-matching.md",
    "content": "# Dealing with Element Matching Issues\n\nThe preferred element-matching technique in Detox tests is by using **test ID's**.\n\nIn React Native, the `testID` prop is only supported on **built-in native components**. If you’ve created a **custom composite component**, you’ll need to manually pass the `testID` down to a native child component. The most common approach is to propagate it to one of the rendered children that are **native** components (such as `View`, `Text`, or `TouchableOpacity`):\n\n```jsx\nexport class MyCompositeComponent extends Component {\n  render() {\n    return (\n      <TouchableOpacity testID={this.props.testID}>\n        <View>\n          <Text>Something something</Text>\n        </View>\n      </TouchableOpacity>\n    );\n  }\n}\n```\n\nNow, when adding a `testID` to your composite component, it will be correctly applied:\n\n```jsx\nrender() {\n  return <MyCompositeComponent testID='MyUniqueId123' />;\n}\n```\n\n:::tip\n\nFor more info about this technique and test ID's in general, read our [guide about test ID's](../guide/test-id.md).\n\n:::\n\n## Debug View Hierarchy\n\nWhen element matching fails, inspecting the **native view hierarchy** can help diagnose the issue. This allows you to see how elements are structured in the app and determine whether a test ID is missing or the matcher needs to be improved.\n\nOn iOS, you can use `xcode` to visualize the native view hierarchy:\n\n1. Start a debuggable app (not a release build) in your simulator\n1. Open `xcode`\n1. Attach `xcode` to your app’s process\n   ![attach to process](../img/attach-to-process.jpg)\n1. Press the `Debug View Hierarchy` button\n   ![debug view hierarchy](../img/debug-view-hierarchy.jpg)\n1. This will open the hierarchy viewer, and will show a breakdown of your app’s native view hierarchy. Here you can browse through the views\n1. React Native testIDs are manifested as _accessibility identifiers_ in the native view hierarchy\n\nLet’s see an example. We will find the following view in the native hierarchy:\n\n```jsx\n<TouchableOpacity onPress={this.onButtonPress.bind(this, 'ID Working')}>\n  <Text testID='UniqueId345' style={{color: 'blue', marginBottom: 20}}>ID</Text>\n</TouchableOpacity>\n```\n\nThis is the hierarchy viewer, pointing to the native view just mentioned:\n\n![hierarchy viewer](../img/hierarchy-viewer.jpg)\n\nThere are other techniques for doing this besides using `xcode`, and also on Android -- coming soon!\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/flakiness.md",
    "content": "# Dealing With Flakiness in Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\n> What is a flaky test?\n\nA flaky test is a test that passes most of the time, and sometimes without any apparent reason and without any changes to your app - it fails. This can even happen only on certain machines. For example, on your own machine it always passes, but on a different slower machine, like the CI, it fails.\n\n### 1. We Feel Your Pain\n\nFlakiness is the greatest challenge in E2E. The good news is that Detox was designed with this mission in mind: dealing with flakiness head on.\n\nAssume you have a suite of 100 tests and each test is flaky in 0.5% of executions (failing without an actual bug in your app). The total flakiness of your entire suite is about 40% (the exact formula is `1 - (1 - 0.005)^100`). This means that there’s 40% chance your suite will fail without an actual bug! This makes your entire suite useless.\n\n### 2. Sources of Flakiness\n\nIt’s important to identify the various sources of flakiness in Detox tests.\n\n- Control of the device / simulator - in order to run your tests, Detox must communicate with a simulator and instruct it to install the app, restart it, etc. Simulators don’t always behave and controlling them might occasionally fail. Detox’s underlying simulator control is [`AppleSimulatorUtils`](https://github.com/wix/AppleSimulatorUtils), it is a tool that supports both basic and advanced simulator and device interaction options, it uses some core simulator features which are not always stable and may need time to \"warm up\" (booting, shutting down, etc.). Detox is set to have a few retries on any of these actions before failing. It will also print all the `exec` commands when using `verbose` log level, and with `trace` level it will print everything.\n\n- Asynchronous operations inside your app - every time an E2E test runs, operations might take place in a different order inside your app. This makes E2E tests nondeterministic. Consider an HTTP request made to a server, this request may take a variable time to complete due to external concerns like network congestion and server load. Detox takes this into account by monitoring all asynchronous operations that take place in your app from the inside. Detox knows which network requests are currently in-flight. Detox knows how busy the React Native bridge is. Tests are automatically synchronized to the app and only move forward when the app is idle.\n\n### 3. Get More Data About the Problem\n\nIn order to identify the source of flakiness you’re suffering from you need more data. If you catch a failing test that should be passing, you need to record as much information as possible in order to investigate.\n\n- Enable `trace` mode in Detox. This will output a lot of information about what happening during the test:\n  1. `exec` commands\n  1. All communication going over the websocket, both from tester and app\n\nTo enable `trace` mode run your tests in trace log mode:\n\n```bash\ndetox test --loglevel trace\n```\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/running-tests.md",
    "content": "# Dealing With Problems With Running Tests\n\n<!-- markdownlint-disable MD024 -->\n\nThis page is about issues related to executing your Detox tests, typically triggered when running `detox test` (and not `detox build`, for example).\n\n## No simulators/emulators found\n\n### iOS\n\nIn order to run tests on a simulator, you need to have simulator images installed on your machine. This process is performed by `xcode` itself. You can list all available simulators using `simctl` by typing `xcrun simctl list` in terminal.\n\nIf you’re missing a simulator, you need to [manually install it](https://developer.apple.com/documentation/safari-developer-tools/adding-additional-simulators). Note that `xcode` is required.\n\nOnce the desired simulator is installed and returned by `xcrun simctl list`, double check its name in the list and make sure this name is found in the `detox` configuration entry in `package.json`. The reference for the configuration options is available [here](../config/devices.mdx).\n\n### Android\n\nComing soon...\n\n## Detox starts but my test doesn't actually run\n\n### Issue\n\n- A while after running Detox, things seem to hang and you get a message about a failure to connect to the running app, in Detox's logs:\n\n```plain text\nDetox can’t seem to connect to the test app(s)!\n```\n\n### Course of action\n\nThis can be a result of various reasons. It is generally up to you to debug and find the root cause. In any case, below are the common ones.\n\n#### If you don't see your app running on the device\n\n- You might have forgotten to run `device.launchApp()` in the beginning of your test.\n- The app might have crashed before Detox has had a chance to connect to it. To get the crash details, you can run Detox tests with `--record-logs all` CLI option and then inspect the device logs in the artifacts' folder.\n- **On Android**, there might be a problem with the native test code in the `DetoxTest.java` file. Revisit the [associated section](../introduction/project-setup.mdx#step-4-additional-android-configuration) in the setup guide.\n- **On Android**, your `Network Security Config` may not be recognized. Revisit the [associated section](../introduction/project-setup.mdx#43-enabling-unencrypted-traffic-for-detox) in the setup guide.\n\n**If you _do_ see your app running on the device**\n\n- **On Android with SDK≥28**, the app’s connection to the Detox test server is blocked due to clear-traffic blockage (as reported in issue [#1450](https://github.com/wix/Detox/issues/1450)).\n  The main step for getting this fixed is to revisit the [associated section](../introduction/project-setup.mdx#step-4-additional-android-configuration) in the setup guide, which discusses network-security. Alternatively, the `android:usesCleartextTraffic=\"true\"` attribute can be configured in the `<application>` tag of the app’s `AndroidManifest.xml`, but **that is highly discouraged**.\n- If you’ve applied the above suggestion but the app fails to connect to the Detox test server, nonetheless: Refer to the device’s logs, which should contain messages about failed connection attempts (get them using the `--record-logs all` argument)\n- The app could be running without Detox native code injected. In this case, first, make sure you’re not trying to run in manual launch mode (where this behavior is valid). If so, examine the logs from the device (get them using the `--record-logs all` argument). If you see a crash related to Detox’s native code, you are welcome to report it on our GitHub tracker.\n- Try reading our [Debugging tutorial](../introduction/debugging.mdx).\n\n## The test runs but the app looks stuck / test times-out\n\n### Issue\n\n- **The test runs and at some point the app gets stuck on the same screen / state until the end of the test** - for example, displaying a loader animation. This can be observed directly if Detox is run locally, or otherwise post-factum by checking Detox's [video recording artifact](https://wix.github.io/Detox/docs/config/artifacts/#enabling-artifacts):\n  \n  ![App loader example](../img/app-loader.jpeg)\n  \n- Detox logs might also show synchronization warnings, repeatedly. For example:\n\n  ```plain text\n  19:07:20.140 detox[1907] i The app is busy with the following tasks:\n  • UI elements are busy:\n    - View animations pending: 2.\n    - Layers pending animations: 7.\n    - Layers needs layout: 147.\n    - View needs layout: 98.\n    - View needs display: 67.\n    - Layers needs display: 82.\n  • 1 enqueued native timers:\n    - Timer #1:\n      + Fire date: none.\n      + Time until fire: 0.000.\n      + Repeat interval: 0.\n      + Is recurring: YES.\n  • 1 network requests with URLs:\n    - URL #1: https://example.org/something?id=1337\n  ```\n\n- The test failure reason might be associated with time-outs, or you see time-outs in the _device_ (not Detox) log (available as a Detox [test artifact](https://wix.github.io/Detox/docs/config/artifacts/#enabling-artifacts)).\n\n### Course of action\n\nThis might be related somehow to your test code, but **could definitely stem from a an app bug.** Take an in-depth look at the [synchronization troubleshooting guide](./synchronization.md).\n\n## Detox can't find or interact with an element even though it's on the screen\n\n### Issue\n\nEither one of the following 2 scenarios:\n\n1. The test runs, the app starts on the device and is maybe even being successfully navigated-through by the test, onto an inner screen; The app/screen opens properly and you know for sure that your element matcher is spot-on - **yet Detox says the element cannot be found (this can even happen intermittently, in a flaky test).**\n2. The test runs, the app starts and displays a transient UI element for a limited amount of time and is then removed automatically. For example: A _Toast_ element. Another example: A temporary \"Success\" cheering-effect that fades out to the screen below:\n\n   ![Transient UI element](../img/transient-ui-element.png)\n\n### Course of action\n\nFor the 1st option, you'd have to go deeper by exploring the possibility of disabling auto-synchronization as explained in the [synchronization troubleshooting guide](./synchronization.md#last-resort-Switching-to-manual-synchronization).\n\nAs for the 2nd option -\n\n1. If possible, start by revisiting your matching technique, as explained in the dedicated [matching troubleshooting guide](./element-matching.md).\n2. If that doesn't solve it, consider switching to using `waitFor()` (see below).\n3. If all fails, consider [disabling synchronization](./synchronization.md#last-resort-Switching-to-manual-synchronization) altogether.\n\n#### Switching to the polling-based `waitFor()` API's\n\nyou'd have to resort to Detox's fail-safe `waitFor()` family of API's, which poll your matching criteria within a specified time frame defined by you as a timeout. To take the screen above as an example, you'd have to change your test from:\n\n```js\nawait element(by.id('join-button')).tap();\nawait expect(element(by.text('Success!'))).toBeVisible();\n```\n\nto something like:\n\n```js\nawait element(by.id('join-button')).tap();\nawait waitFor(element(by.text('Success!'))).toBeVisible().withTimeout(2_000);\n```\n\n## Detox says an element is not visible enough\n\n**On iOS**, you may run in a situation, when one of the interactions (tap, scroll, etc.) on an element fails with an error like:\n\n```plain text\nTest Failed: View \"<RCTScrollView: 0x7f8d32296d70>\" is not visible: view does not pass visibility threshold (0% visible of 75% required)\n```\n\n1. Try retrieving `ui.viewhierarchy` artifact — sometimes examining the hierarchy visually can give you insights.\n   Add a line `\"uiHierarchy\": \"enabled\"` to your artifacts' configuration in `.detoxrc.js`, like in an example here: [Artifacts Configuration](../config/artifacts.mdx). After a rerun, you should find\n   a `ui.viewhierarchy` in a folder of your failing test. Please mind that you need Xcode 12 at least to open `*.viewhierarchy` files.\n\n1. Besides, you can rerun your iOS app tests with `--take-screenshots failing`. What will happen is, for each view that fails visibility, two images will be saved at `artifacts/<configuration-timestamp-dir>/<test name>/DETOX_VISIBILITY_<viewType>__<viewID>__SCREEN.png` (and `.../DETOX_VISIBILITY_<viewType>__<viewID>__TEST.png` folder aside) with autogenerated names, e.g. `DETOX_VISIBILITY_RCTTextView__0x7fab7660f3e0__TEST.png`:\n\n|                                                            in `DETOX_*_SCREEN.png`                                                           |                                                              in `DETOX_*_TEST.png`                                                             |\n| :------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: |\n| <img alt=\"visible\" src=\"https://user-images.githubusercontent.com/2270433/94178906-68872380-fea4-11ea-845c-c55c25b68c0e.png\" height=\"480\" /> | <img alt=\"internals\" src=\"https://user-images.githubusercontent.com/2270433/94178919-6c1aaa80-fea4-11ea-8db6-64f1f4b21361.png\" height=\"480\" /> |\n\nThe first is supposed to show what is seen on screen. The second shows the internal buffer that Detox tests for visibility; if the pixels aren’t transparent enough and less than 75% of tested region is not transparent, the view is not considered visible.\n\nIf you are developing a React Native app, then the following applies. If, for instance, you see that tapping fails due to a view with `pointerEvents=\"none\"` obscuring your target — well, the only solutions are: either to make the obscurer a descendant of your target (instead of being a sibling), or to tap on the parent container.\n\nIf you see that your issue cannot be solved via testID replacement or a simple hierarchy rearrangement, then there’s a chance this is a bug in Detox. Make sure to provide your `ui.viewhierarchy` artifact, the generated `DETOX_VISIBILITY_*` pictures and a comprehensive description of the issue backed up with sound arguments.\n\n## Explore More Options\n\n### Compare to a Working Setup\n\nIf you feel lost, try starting from a working example for sanity.\n\nThere are multiple working examples included in this repo, such as [demo-react-native](https://github.com/wix/Detox/tree/master/examples/demo-react-native).\n\nFirst, install, build and make sure the tests are indeed passing. If they are, try comparing this setup with what you have.\n\n### Take a Look at Past Issues\n\nBefore opening a new issue, search the [list of issues](https://github.com/wix/detox/issues?utf8=%E2%9C%93\\&q=is%3Aissue) on GitHub. There’s a good chance somebody faced the same problem you are having.\n\n### How to Open a New Issue\n\nBefore opening a new issue, please follow the entire troubleshooting guide and go over past issues.\n\nGeneral usage questions should be opened on Stack Overflow, where the core Detox team is active and responds to questions:\n<https://stackoverflow.com/questions/tagged/detox>\n\nIf you believe you are seeing a Detox issue, select the correct template from the options, and make sure to fill all requested information in the template. Omitting important information will likely result in a closed issue.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/troubleshooting/synchronization.md",
    "content": "# Dealing With Synchronization Issues in Tests\n\n<!-- markdownlint-configure-file { \"header-increment\": 0 } -->\n\nTraditionally, one of the most difficult aspects of E2E testing is synchronizing the test scenario with the app.\n\nComplex operations inside the app (like accessing servers or performing animations) often take a variable amount of time to complete; In each step, we can’t move on to the next one until they’ve completed (i.e. when the app goes idle), which in turn surfaces a challenge in continuously trying to understand when the right time to do so is.\n\nFortunately, Detox - which comes with a gray-box approach, cleverly performs the synchronization automatically, as explained [here](../articles/how-detox-works.md#how-detox-automatically-synchronizes-with-your-app).\n\n## Mitigating Synchronization Issues\n\nWhile Detox's auto-synchronization mechanism is powerful and efficient, it does come with at least one caveat: **It imposes strictness over the app's behavior.** By default, Detox will fail your tests (i.e. due to a wait-for-idle **time-out**), if, for example, following an app launch or a navigation to a new screen, timers or animations continue to run endlessly. While this could be considered an advantage (e.g. finding an animation or timer management leakage!), these type of issues may not:\n\n1. Be specifically related to the main coverage goal of your test.\n2. Be directly visible to or considered a significant bug by the end user.\n\nTherefore, it may be something some would want to be able to limit or completely opt-out of. With this in mind, let's review the possible ways of mitigation, aimed at either finding and fixing a bug, or allowing for it to be overlooked.\n\n### Step 1: Understanding what's blocking your app\n\nDetox's synchronization debugging mechanism generates output to Detox's log which provides useful synchronization debugging information. We recommend that you'd start by pinpointing what the busy resources are - those that are keeping your app from going idle, based on those logs. Turn the debugging mechanism toggle on if you need to (although, it is on by default), rerun your test(s) and follow Detox's logs.\n\n:::info\n\nRead about Detox's _synchronization debugging mechanism_ in order to understand how to debug your app for unnecessarily busy resources. It can be specified either via the [Detox configuration file](../config/session.mdx#sessiondebugsynchronization-number) or more directly, as a [CLI argument](../cli/test.md#options):\n\n```js\ndetox test --debug-synchronization 5000\n```\n\n:::\n\n#### (Optional) Lower-level debugging (iOS only)\n\nIf the synchronization debugging mechanism does not provide all of the necessary information, on iOS you can add the following launch argument to your app (using `launchArgs` in your `launchApp()` call) to enable a very verbose logging of the idling resource system to the system log:\n\n```plain text\n-DTXEnableVerboseSyncSystem YES -DTXEnableVerboseSyncResources YES\n```\n\nYou can then obtain this log by running the following command:\n\n```bash\nxcrun simctl spawn booted log stream --level debug --style compact --predicate \"category=='SyncManager'\"\n```\n\nFor example, change your `device.launchApp()` call like:\n\n```js\nawait device.launchApp({\n  newInstance: true,\n  launchArgs: { 'DTXEnableVerboseSyncSystem': 'YES', 'DTXEnableVerboseSyncResources': 'YES' },\n});\n```\n\n### Step 2: Applying the Most Suitable Solution\n\nFirst and foremost, as explained, an app's inability to go idle might be an indication of that some resources are _unnecessarily_ busy. Therefore, whether it's a network request that's been left unacknowledged, or an endless loader -\n\n**The best solution is to fix the problem! :construction_worker:**\n\n#### Dealing with endless animation bugs (e.g. loaders)\n\nSometimes the resource that's holding the app back from turning idle is a mere animation of a single loader - running endlessly on the screen:\n\n![App loader example](../img/app-loader.jpeg)\n\nThe synchronization logs telling you that, would usually look roughly like this:\n\n```plain text\n09:04:20.170 detox[90417] i The app is busy with the following tasks:\n• UI elements are busy:\n  - View animations pending: 2.\n  - Layers pending animations: 7.\n  - Layers needs layout: 147.\n  - View needs layout: 98.\n  - View needs display: 67.\n  - Layers needs display: 82.\n• 1 enqueued native timers:\n  - Timer #1:\n    + Fire date: none.\n    + Time until fire: 0.000.\n    + Repeat interval: 0.\n    + Is recurring: YES.\n```\n\n<sup>(these are logs generated by Detox iOS; Detox-Android generates different yet equivalent ones)</sup>\n\n**Below are a few actual-bug scenarios where this can take place - all of which are easy to inspect, identify and fix.**\n\n##### i. A server is being non-responsive\n\nYour app is waiting indefinitely to load all of the necessary data from the a non-responsive server / a bad network, and therefore cannot switch to rendering the expected UI. When this is the deal, additional synchronization logs also repeatedly show some in-flight network calls:\n\n```plain text\n09:04:20.170 detox[90417] i The app is busy with the following tasks:\n• 1 network requests with URLs:\n  - URL #1: https://nonresponsive-server.org/something?id=1337\n  - URL #2: https://unreachable-server.org/hello\n```\n\n_This can be solved by finding out why the server is being non-responsive or unreachable, for example - by tracking network calls into the logs, or inspecting requests on the server-ends._\n\n##### ii. A returned server error is not conveyed by the UI\n\nSometimes the servers _do_ respond, **but with an error**. Often times, we fail to adjust our app code to display the necessary UI (e.g. replacing the loader with a friendly message). Rather, the loader just remains running indefinitely. Unlike in the previous case, you will not see synchronization-debug logs surfacing those unacknowledged network calls.\n\n_Scan through the **app/device** logs (not Detox log!) from the bottom up and find traces of errors. The app/device logs can be automatically recorded by Detox as a test-run artifact._\n\n##### iii. An app error is ignored\n\nLast but not least, this behavior can be the result of an app bug around handling **valid data returned from the server**, such as an error while parsing the data.\n\n_Look up the error - which usually comes with a stack-trace and is therefore very prominent, in the test summary in the (also Detox) logs. If it's not in the summary itself, you'd have to resort to searching those in the app/device logs. The app/device logs can be automatically recorded by Detox as a test-run artifact._\n\n#### Dealing with looping animations\n\nAnimations are ultimately a way of making our apps friendlier and nicer to use. Sometimes a good user experience comes specifically from animations that are forever-looping on purpose (for example. animated `.gif`s).\n\nDetox currently has no API's for \"black listing\" animations - namely, excluding them from the synchronization process (i.e. as it does with network calls). Therefore, you might want to consider removing the looping animation in your tests by rebuilding the app with such animating elements replaced by [mocks](../guide/mocking.md).\n\n#### Dealing with **hidden** animations\n\nNot all synchronization issues around animations are trivial:\n\n- The animation can be associated with an element that is rendered off-screen, such as an item in a long news feed that's been rendered beyond the screen's bound, or a loader in a screen associated with a bottom tab that hasn't been navigated-to since the beginning of the test.\n- The animation can also be associated with elements which have been silently leaked (bug) under other UI elements. They are fully functional yet not visible to the user. For example: A compact loader accidentally showing under the app bar (android)/navigation bar (iOS).\n\nThese types of animations can be difficult to track down, and sometimes fix.\n\n**We are aiming to provide more advanced Detox-complementary tools that would help identify such animations more easily (follow Github issue [#4734](https://github.com/wix/Detox/issues/4734)). Until we do, here are some things you can do, roughly, in order:**\n\n1. _(Most recommended) Start Detox in [debug mode](../introduction/debugging.mdx), and then run the blocked test step-by-step - either from the beginning of it, or starting a breakpoint you've set over where you think the synchronization issue starts. Step over the Detox commands until Detox gets blocked and signals for synchronization issues (i.e. in the logs). Then, explore the app yourself (!), physically looking for animations (e.g. by scrolling lists, navigating through tabs, and so on.\n   You might actually be able to see the animation in your own eyes, or witness Detox getting unblocked as your interactions release an otherwise endless loader._\n   _Do this iteratively until the exact animating UI element can be pinpointed._\n\n2. _Run the test and [generate a view-hierarchy](../api/device.md#devicecaptureviewhierarchyname) at the right timing, then inspect your app's layout in xcode's powerful view-hierarchy inspector_. Look for off-screen or obscured elements.\n\n3. _Run your app (without Detox) on Android in debug mode using Android Studio, and use its fancy [Layout Inspector](https://developer.android.com/studio/debug/layout-inspector) tool in order to inspect your app._\n\n4. _Perform a \"binary search\" over the screen's content: Remove big blocks of content from it intermittently, rerunning the failing test each time, until synchronization stops blocking you. Then, slowly bring back repeatedly smaller and smaller sub-elements of the UI to see which one retriggers synchronization blockage. Eventually, you could pinpoint the exact culprit._\n\n#### Dealing with network synchronization issues\n\nSometimes Detox synchronization gets block, waiting for networks call that are in fact associated with URL's that happen to be \"noise\", meaning - specifically related to some kind of long polling background tasks, or web-socket connections. Such network calls should NOT be considered blocking in a user-flow test.\n\n_This can be solved by [black-listing the URL's in Detox](../api/device.md#deviceseturlblacklisturls), which would exclude it from Detox's synchronization over the network:_\n\n```js\n// Black-list (exclude) URL's in mid test-run:\nawait device.setURLBlacklist(['.*127.0.0.1.*']);\n\n// Black-list URL's from as early as app launch:\nawait device.launchApp({\n  launchArgs: {\n    detoxURLBlacklistRegex: '(\".*example.com/some-url/.*\")',\n  },\n});\n\n// Reset black-list\nawait device.setURLBlacklist([]);\n```\n\n#### Dealing with endless timers\n\nBy default, Detox is designed to ignore JavaScript's `setInterval()` and will only wait for `setTimeout()`'s **of up to 1.5 seconds**.\n\n*If you have an endless polling loop with short intervals implemented with `setTimeout`, switch the implementation to `setInterval`. If possible, avoid aggressive polling in your app altogether, the poor single JavaScript thread we have doesn’t like it.*\n\n#### Last resort: Switching to manual synchronization\n\nDisabling automatic synchronization makes sense in two cases:\n\n1. You have a synchronization problem (as explained above) but you can't find the source of the problem, or simply decide not to fix it (temporarily...)\n2. You have a screen with a transient element, such as a toast or a cheering UI element, that is displayed temporarily and disappears automatically:\n\n   ![Transient UI element](../img/transient-ui-element.png)\n\nDetox always has the fail-safe solution of turning off automatic-synchronization altogether and waiting manually for elements.\n\nThis isn’t the recommended approach as you'd be giving up Detox's synchronization super-powers and resort to manually defining timeouts, but hey, life is about trade-offs. You can do this with the main [synchronization switching API's](../api/device.md#devicedisablesynchronization):\n\n```js\n// Disabling in mid test-run:\nawait device.disableSynchronization();\n```\n\n```js\n// Launching the app with sync disabled from the start:\nawait device.launchApp({\n  launchArgs: {\n    detoxEnableSynchronization: 0\n  },\n});\n```\n\n```js\n// To turn synchronization back on (this command will block on synchronization):\nawait device.enableSynchronization();\n```\n\nMind that when this technique is applied, it effectively means that have to start using Detox API's differently (i.e. resort to using [`waitFor().withTimeout()`](../api/expect.md#withtimeouttimeout)) API's and possibly even migrate test code.\n\nFor example, instead of:\n\n```js\nawait element(by.id('write-message-btn')).tap(); // Navigate to message writing screen\nawait element(by.id('message-input')).typeText('Hello!'); // Type in a message\nawait element(by.id('submit-btn')).tap(); // Submit!\n```\n\nYour test code will have to look more like this:\n\n```js\nawait device.disableSynchronization();\n\nawait element(by.id('write-message-btn')).tap();\n\n// Wait up to 4 seconds for the screen to fully load\nawait waitFor(element(by.id('message-input'))).toBeVisible().withTimeout(4000);\n\nawait element(by.id('message-input')).typeText('Hello!');\nawait element(by.id('submit-btn')).tap();\n```\n\n##### Hybrid manual/automatic synchronization\n\nAs of writing this, fine-tuned control over the various synchronized OS-systems that Detox monitors is not supported. Follow issue [#1513](https://github.com/wix/Detox/issues/1513) to keep track of that.\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/boot-cli-many-workers.uml",
    "content": "@startuml\n\nactor User\nboundary \"Detox CLI\" as CLI\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxSecondaryContext.0\" as Sec0\nboundary \"Jest (worker N)\" as JestN\nparticipant \"DetoxSecondaryContext.N\" as SecN\nparticipant \"DetoxCircusEnvironment.N\" as Env\n\nUser -> CLI: detox test\nactivate CLI\nCLI -> Pri: require('detox')\nactivate Pri\nCLI -> Pri: init()\nloop while exitCode != 0 and retries > 0\n  CLI -> Jest0: child_process.spawn('jest')\n  activate Jest0\n  Jest0 -> Sec0: require('detox')\n  activate Sec0\n  Jest0 -> Sec0: resolveConfig()\n  Jest0 -> Sec0: init()\n  Jest0 -> JestN: child_process.fork()\n  activate JestN\n  loop every test file\n    JestN -> Env: new()\n    activate Env\n    JestN -> Env: setup()\n    Env -> SecN: require('detox')\n    activate SecN\n    Env -> SecN: init()\n    Env -> SecN: installWorker()\n    SecN --> Pri: register worker\n    JestN -> Env: run test file\n    JestN -> Env: teardown()\n    Env -> SecN: uninstallWorker()\n    deactivate Env\n    Jest0 --> Pri: reportTestResults()\n  end loop\n  deactivate SecN\n  deactivate JestN\n  Jest0 -> Sec0: cleanup()\n  deactivate Sec0\n  deactivate Jest0\nend loop\nCLI -> Pri: cleanup()\ndeactivate Pri\ndeactivate CLI\n\n@enduml\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/boot-cli-single-worker.uml",
    "content": "@startuml\n\nactor User\nboundary \"Detox CLI\" as CLI\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxSecondaryContext\" as Sec\nparticipant \"DetoxCircusEnvironment\" as Env\n\nUser -> CLI: detox test\nactivate CLI\nCLI -> Pri: require('detox')\nactivate Pri\nCLI -> Pri: init()\nloop while exitCode != 0 and retries > 0\n  CLI -> Jest0: child_process.spawn('jest')\n  activate Jest0\n  Jest0 -> Sec: require('detox')\n  activate Sec\n  Jest0 -> Sec: resolveConfig()\n  Jest0 -> Sec: init()\n  loop every test file\n    Jest0 -> Env: new()\n    activate Env\n    Jest0 -> Env: setup()\n    Env -> Sec: installWorker()\n    Sec --> Pri: register worker\n    Jest0 -> Env: run test file\n    Jest0 -> Env: teardown()\n    Env -> Sec: uninstallWorker()\n    deactivate Env\n    Jest0 --> Pri: reportTestResults()\n  end loop\n  Jest0 -> Sec: cleanup()\n  deactivate Sec\n  deactivate Jest0\nend loop\nCLI -> Pri: cleanup()\ndeactivate Pri\ndeactivate CLI\n\n@enduml\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/boot-jest-many-workers.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxPrimaryContext\" as Pri\nboundary \"Jest (worker N)\" as JestN\nparticipant \"DetoxSecondaryContext.N\" as Sec\nparticipant \"DetoxCircusEnvironment.N\" as Env\n\nUser -> Jest0: jest --maxWorkers N\nactivate Jest0\nJest0 -> Pri: require('detox')\nactivate Pri\nJest0 -> Pri: resolveConfig()\nJest0 -> Pri: init()\nJest0 -> JestN: child_process.fork()\nactivate JestN\nloop every test file\n  JestN -> Env: new()\n  activate Env\n  JestN -> Env: setup()\n  Env -> Sec: require('detox')\n  activate Sec\n  Env -> Sec: init()\n  Env -> Sec: installWorker()\n  Sec --> Pri: register worker\n  JestN -> Env: run test file\n  JestN -> Env: teardown()\n  Env -> Sec: uninstallWorker()\n  deactivate Env\n  Jest0 --> Pri: reportTestResults()\nend loop\ndeactivate Sec\ndeactivate JestN\nJest0 -> Pri: cleanup()\ndeactivate Pri\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/boot-jest-single-worker.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"DetoxPrimaryContext\" as Pri\nparticipant \"DetoxCircusEnvironment\" as Env\n\nUser -> Jest0 : jest --runInBand\nactivate Jest0\nJest0 -> Pri: require('detox')\nactivate Pri\nJest0 -> Pri: resolveConfig()\nJest0 -> Pri: init()\nloop every test file\n  Jest0 -> Env: new()\n  activate Env\n  Jest0 -> Env: setup()\n  Env -> Pri: installWorker()\n  Jest0 -> Env: run test file\n  Jest0 -> Env: teardown()\n  Env -> Pri: uninstallWorker()\n  deactivate Env\n  Jest0 --> Pri: reportTestResults()\nend loop\nJest0 -> Pri: cleanup()\ndeactivate Pri\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/jest-diagram-runInBand.uml",
    "content": "@startuml\n\ntitle \"jest --runInBand\"\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"jest.config.js\" as jestConfig\nparticipant \"globalSetup\" as globalSetup\nparticipant \"reporters\" as jestReporter\nparticipant \"globalTeardown.js\" as globalTeardown\n\nUser -> Jest0 : jest ...\nactivate Jest0\nJest0 -> jestConfig: import\nactivate jestConfig\njestConfig -> Jest0: await\ndeactivate jestConfig\nJest0 -> globalSetup: import\nactivate globalSetup\nglobalSetup -> Jest0: await\ndeactivate globalSetup\nJest0 -> jestReporter: import\nactivate jestReporter\nJest0 -> jestReporter: onRunStart()\nloop every test file\n  Jest0 -> Jest0: runTests()\n  Jest0 -> jestReporter: onTestFileResult()\nend loop\nJest0 -> jestReporter: onRunComplete()\ndeactivate jestReporter\nJest0 -> globalTeardown: import\nactivate globalTeardown\nglobalTeardown -> Jest0: await\ndeactivate globalTeardown\n\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "website/versioned_docs/version-20.x/uml/sequence/jest-diagram.uml",
    "content": "@startuml\n\nactor User\nboundary \"Jest (main)\" as Jest0\nparticipant \"jest.config.js\" as jestConfig\nparticipant \"globalSetup\" as globalSetup\nparticipant \"reporters\" as jestReporter\nparticipant \"globalTeardown.js\" as globalTeardown\nboundary \"Jest (worker N)\" as JestN\n\nUser -> Jest0 : jest ...\nactivate Jest0\nJest0 -> jestConfig: import\nactivate jestConfig\njestConfig -> Jest0: await\ndeactivate jestConfig\nJest0 -> globalSetup: import\nactivate globalSetup\nglobalSetup -> Jest0: await\ndeactivate globalSetup\nJest0 -> jestReporter: import\nactivate jestReporter\nJest0 -> jestReporter: onRunStart()\nJest0 -> JestN: child_process.fork()\nactivate JestN\nloop every test file\n  Jest0 -> JestN: runTests()\n  JestN -> jestReporter: onTestFileResult()\nend loop\ndeactivate JestN\nJest0 -> jestReporter: onRunComplete()\ndeactivate jestReporter\nJest0 -> globalTeardown: import\nactivate globalTeardown\nglobalTeardown -> Jest0: await\ndeactivate globalTeardown\n\ndeactivate Jest0\n\n@enduml\n"
  },
  {
    "path": "website/versioned_sidebars/version-19.x-sidebars.json",
    "content": "{\n  \"tutorialSidebar\": [\n    {\n      \"type\": \"category\",\n      \"label\": \"Introduction\",\n      \"items\": [\n        \"introduction/getting-started\",\n        \"ios-dev-env\",\n        \"android-dev-env\",\n        \"ios\",\n        \"android\",\n        \"writing-first-test\",\n        \"how-detox-works\",\n        \"design-principles\",\n        \"workflows\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"API Reference\",\n      \"items\": [\n        \"detox-cli\",\n        \"config/overview\",\n        \"detox-object-api\",\n        \"device-object-api\",\n        \"test-lifecycle\",\n        \"matchers\",\n        \"actions-on-element\",\n        \"expect\",\n        \"launch-args\",\n        \"mocking-open-with-url\",\n        \"mocking-user-notifications\",\n        \"mocking-user-activity\",\n        \"artifacts\",\n        \"screenshots\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Troubleshooting\",\n      \"items\": [\n        \"troubleshooting\",\n        \"building-the-app\",\n        \"running-tests\",\n        \"synchronization\",\n        \"flakiness\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Guides\",\n      \"items\": [\n        \"running-locally\",\n        \"developing-while-writing-tests\",\n        \"running-on-ci\",\n        \"debugging-in-xcode\",\n        \"debugging-in-android-studio\",\n        \"mocking\",\n        \"migration\",\n        \"jest\",\n        \"mocha\",\n        \"parallel-test-execution\",\n        \"third-party-drivers\",\n        \"expo\",\n        \"uninstalling\"\n      ]\n    },\n    {\n      \"type\": \"doc\",\n      \"label\": \"Contributing\",\n      \"id\": \"contributing\"\n    }\n  ]\n}\n"
  },
  {
    "path": "website/versioned_sidebars/version-20.x-sidebars.json",
    "content": "{\n  \"tutorialSidebar\": [\n    {\n      \"type\": \"category\",\n      \"label\": \"Introduction\",\n      \"items\": [\n        \"introduction/getting-started\",\n        \"introduction/environment-setup\",\n        \"introduction/project-setup\",\n        \"introduction/your-first-test\",\n        \"introduction/debugging\",\n        \"introduction/preparing-for-ci\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Guides\",\n      \"items\": [\n        \"guide/test-id\",\n        \"guide/parallel-test-execution\",\n        \"guide/detox-repl\",\n        \"guide/typescript\",\n        \"guide/testing-webviews\",\n        \"guide/genymotion-saas\",\n        \"guide/taking-screenshots\",\n        \"guide/mocking\",\n        \"guide/launch-args\",\n        \"guide/mocking-open-with-url\",\n        \"guide/mocking-user-notifications\",\n        \"guide/mocking-user-activity\",\n        \"guide/developing-while-writing-tests\",\n        \"guide/android-dev-env\",\n        \"guide/proguard-configuration\",\n        \"guide/cucumber-js-integration\",\n        \"guide/uninstalling\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Pilot-Powered Detox Testing\",\n      \"items\": [\n        \"pilot/testing-with-pilot\",\n        \"pilot/best-practices\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Troubleshooting\",\n      \"items\": [\n        \"troubleshooting/building-the-app\",\n        \"troubleshooting/running-tests\",\n        \"troubleshooting/synchronization\",\n        \"troubleshooting/flakiness\",\n        \"troubleshooting/element-matching\"\n      ]\n    },\n    {\n      \"type\": \"doc\",\n      \"id\": \"guide/migration\"\n    }\n  ],\n  \"apiSidebar\": [\n    {\n      \"type\": \"category\",\n      \"label\": \"Config file\",\n      \"items\": [\n        \"config/overview\",\n        \"config/devices\",\n        \"config/apps\",\n        \"config/artifacts\",\n        \"config/behavior\",\n        \"config/logger\",\n        \"config/session\",\n        \"config/testRunner\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Command Line Interface\",\n      \"items\": [\n        \"cli/overview\",\n        \"cli/init\",\n        \"cli/build\",\n        \"cli/start\",\n        \"cli/test\",\n        \"cli/recorder\",\n        \"cli/build-framework-cache\",\n        \"cli/clean-framework-cache\",\n        \"cli/rebuild-framework-cache\",\n        \"cli/reset-lock-file\",\n        \"cli/run-server\"\n      ]\n    },\n    {\n      \"type\": \"category\",\n      \"label\": \"Client API\",\n      \"items\": [\n        \"api/device\",\n        \"api/matchers\",\n        \"api/actions\",\n        \"api/expect\",\n        \"api/webviews\",\n        \"api/system\",\n        \"api/logger\",\n        \"api/pilot\"\n      ]\n    },\n    \"api/internals\",\n    {\n      \"type\": \"category\",\n      \"label\": \"Tech Articles\",\n      \"items\": [\n        \"articles/design-principles\",\n        \"articles/how-detox-works\",\n        \"articles/third-party-drivers\"\n      ]\n    }\n  ],\n  \"contributeSidebar\": [\n    \"contributing\",\n    {\n      \"type\": \"category\",\n      \"label\": \"Questions & Answers\",\n      \"items\": [\n        \"contributing/questions/asking-questions\",\n        \"contributing/questions/answering-questions\"\n      ]\n    },\n    \"contributing/reporting-bugs\",\n    \"contributing/feature-requests\",\n    {\n      \"type\": \"category\",\n      \"label\": \"Code Changes\",\n      \"items\": [\n        \"contributing/code/overview\",\n        \"contributing/code/setting-up-the-dev-environment\",\n        \"contributing/code/building-and-testing\",\n        \"contributing/code/example-projects\",\n        \"contributing/code/submitting-pull-requests\",\n        \"contributing/code/reviewing-pull-requests\"\n      ]\n    },\n    \"contributing/documentation\",\n    \"contributing/code-of-conduct\"\n  ]\n}\n"
  },
  {
    "path": "website/versions.json",
    "content": "[\n  \"20.x\",\n  \"19.x\"\n]\n"
  }
]